diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..12dd2ad8d --- /dev/null +++ b/.clang-format @@ -0,0 +1,216 @@ +--- +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignConsecutiveDeclarations: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignEscapedNewlines: Right +AlignOperands: Align +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortEnumsOnASingleLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +AttributeMacros: + - __capability +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: Always +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +QualifierAlignment: Leave +CompactNamespaces: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DeriveLineEnding: true +DerivePointerAlignment: false +DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: false +PackConstructorInitializers: BinPack +BasedOnStyle: '' +ConstructorInitializerAllOnOneLineOrOnePerLine: false +AllowAllConstructorInitializersOnNextLine: true +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IfMacros: + - KJ_IF_MAYBE +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 + CaseSensitive: false + - Regex: '.*' + Priority: 1 + SortPriority: 0 + CaseSensitive: false +IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentAccessModifiers: false +IndentCaseLabels: false +IndentCaseBlocks: false +IndentGotoLabels: true +IndentPPDirectives: None +IndentExternBlock: AfterExternBlock +IndentRequiresClause: true +IndentWidth: 2 +IndentWrappedFunctionNames: false +InsertBraces: false +InsertTrailingCommas: None +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +LambdaBodyIndentation: Signature +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakOpenParenthesis: 0 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PenaltyIndentedWhitespace: 0 +PointerAlignment: Right +PPIndentWidth: -1 +ReferenceAlignment: Pointer +ReflowComments: true +RemoveBracesLLVM: false +RequiresClausePosition: OwnLine +SeparateDefinitionBlocks: Leave +ShortNamespaceLines: 1 +SortIncludes: Never +SortJavaStaticImport: Before +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterForeachMacros: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterIfMacros: true + AfterOverloadedOperator: false + AfterRequiresInClause: false + AfterRequiresInExpression: false + BeforeNonEmptyParentheses: false +SpaceAroundPointerQualifiers: Default +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: Never +SpacesInConditionalStatement: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +BitFieldColonSpacing: Both +Standard: Latest +StatementAttributeLikeMacros: + - Q_EMIT +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 8 +UseCRLF: false +UseTab: Never +WhitespaceSensitiveMacros: + - STRINGIZE + - PP_STRINGIZE + - BOOST_PP_STRINGIZE + - NS_SWIFT_NAME + - CF_SWIFT_NAME +... + diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 000000000..50d5e4a1a --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,39 @@ +name: Enforce clang-format + +on: + pull_request: + push: + schedule: + - cron: '0 3 * * 5' # Every Friday at 3am + +jobs: + clang-format: + name: Enforce clang-format + runs-on: ubuntu-22.04 + env: + CLANG_MAJOR_VERSION: 15 + steps: + + - uses: actions/checkout@v3 + + - name: Add Clang/LLVM repositories + run: |- + set -x + source /etc/os-release + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_MAJOR_VERSION} main" + + - name: Install clang-format + run: |- + set -x + sudo apt-get update + sudo apt-get install --yes --no-install-recommends -V \ + clang-format-${CLANG_MAJOR_VERSION} + + - name: Enforce clang-format + run: |- + set -x -o pipefail + clang-format-${CLANG_MAJOR_VERSION} --version + git ls-files \*.{c,cpp,h,hpp} \ + |xargs clang-format-${CLANG_MAJOR_VERSION} --style=file -i + git diff --exit-code # i.e. reject non-empty diff diff --git a/libvisual-plugins/common/GL/glu.c b/libvisual-plugins/common/GL/glu.c index 7a6eba52d..7005ba144 100644 --- a/libvisual-plugins/common/GL/glu.c +++ b/libvisual-plugins/common/GL/glu.c @@ -48,335 +48,339 @@ /* ** Make m an identity matrix */ -static void __gluMakeIdentityd(_GL_REAL m[16]) -{ - m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; - m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; - m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; - m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; +static void __gluMakeIdentityd(_GL_REAL m[16]) { + m[0 + 4 * 0] = 1; + m[0 + 4 * 1] = 0; + m[0 + 4 * 2] = 0; + m[0 + 4 * 3] = 0; + m[1 + 4 * 0] = 0; + m[1 + 4 * 1] = 1; + m[1 + 4 * 2] = 0; + m[1 + 4 * 3] = 0; + m[2 + 4 * 0] = 0; + m[2 + 4 * 1] = 0; + m[2 + 4 * 2] = 1; + m[2 + 4 * 3] = 0; + m[3 + 4 * 0] = 0; + m[3 + 4 * 1] = 0; + m[3 + 4 * 2] = 0; + m[3 + 4 * 3] = 1; } -static void __gluMakeIdentityf(GLfloat m[16]) -{ - m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; - m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; - m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; - m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; +static void __gluMakeIdentityf(GLfloat m[16]) { + m[0 + 4 * 0] = 1; + m[0 + 4 * 1] = 0; + m[0 + 4 * 2] = 0; + m[0 + 4 * 3] = 0; + m[1 + 4 * 0] = 0; + m[1 + 4 * 1] = 1; + m[1 + 4 * 2] = 0; + m[1 + 4 * 3] = 0; + m[2 + 4 * 0] = 0; + m[2 + 4 * 1] = 0; + m[2 + 4 * 2] = 1; + m[2 + 4 * 3] = 0; + m[3 + 4 * 0] = 0; + m[3 + 4 * 1] = 0; + m[3 + 4 * 2] = 0; + m[3 + 4 * 3] = 1; } -void GLAPIENTRY -gluOrtho2D(_GL_REAL left, _GL_REAL right, _GL_REAL bottom, _GL_REAL top) -{ +void GLAPIENTRY gluOrtho2D(_GL_REAL left, _GL_REAL right, _GL_REAL bottom, + _GL_REAL top) { #ifdef USE_OPENGL_ES - glOrthof(left, right, bottom, top, -1.0f, 1.0f); + glOrthof(left, right, bottom, top, -1.0f, 1.0f); #else - glOrtho(left, right, bottom, top, -1, 1); + glOrtho(left, right, bottom, top, -1, 1); #endif } #define __glPi 3.14159265358979323846 -void GLAPIENTRY -gluPerspective(_GL_REAL fovy, _GL_REAL aspect, _GL_REAL zNear, _GL_REAL zFar) -{ - REAL m[4][4]; - REAL sine, cotangent, deltaZ; - REAL radians = fovy / 2 * __glPi / 180; - - deltaZ = zFar - zNear; - sine = sin(radians); - if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) { - return; - } - cotangent = COS(radians) / sine; - - __gluMakeIdentityd(&m[0][0]); - m[0][0] = cotangent / aspect; - m[1][1] = cotangent; - m[2][2] = -(zFar + zNear) / deltaZ; - m[2][3] = -1; - m[3][2] = -2 * zNear * zFar / deltaZ; - m[3][3] = 0; +void GLAPIENTRY gluPerspective(_GL_REAL fovy, _GL_REAL aspect, _GL_REAL zNear, + _GL_REAL zFar) { + REAL m[4][4]; + REAL sine, cotangent, deltaZ; + REAL radians = fovy / 2 * __glPi / 180; + + deltaZ = zFar - zNear; + sine = sin(radians); + if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) { + return; + } + cotangent = COS(radians) / sine; + + __gluMakeIdentityd(&m[0][0]); + m[0][0] = cotangent / aspect; + m[1][1] = cotangent; + m[2][2] = -(zFar + zNear) / deltaZ; + m[2][3] = -1; + m[3][2] = -2 * zNear * zFar / deltaZ; + m[3][3] = 0; #ifdef USE_OPENGL_ES - glMultMatrixf(&m[0][0]); + glMultMatrixf(&m[0][0]); #else - glMultMatrixd(&m[0][0]); + glMultMatrixd(&m[0][0]); #endif } -static void normalize(float v[3]) -{ - float r; +static void normalize(float v[3]) { + float r; - r = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ); - if (r == 0.0) return; + r = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); + if (r == 0.0) + return; - v[0] /= r; - v[1] /= r; - v[2] /= r; + v[0] /= r; + v[1] /= r; + v[2] /= r; } -static void cross(float v1[3], float v2[3], float result[3]) -{ - result[0] = v1[1]*v2[2] - v1[2]*v2[1]; - result[1] = v1[2]*v2[0] - v1[0]*v2[2]; - result[2] = v1[0]*v2[1] - v1[1]*v2[0]; +static void cross(float v1[3], float v2[3], float result[3]) { + result[0] = v1[1] * v2[2] - v1[2] * v2[1]; + result[1] = v1[2] * v2[0] - v1[0] * v2[2]; + result[2] = v1[0] * v2[1] - v1[1] * v2[0]; } -void GLAPIENTRY -gluLookAt(_GL_REAL eyex, _GL_REAL eyey, _GL_REAL eyez, _GL_REAL centerx, - _GL_REAL centery, _GL_REAL centerz, _GL_REAL upx, _GL_REAL upy, - _GL_REAL upz) -{ - float forward[3], side[3], up[3]; - GLfloat m[4][4]; +void GLAPIENTRY gluLookAt(_GL_REAL eyex, _GL_REAL eyey, _GL_REAL eyez, + _GL_REAL centerx, _GL_REAL centery, _GL_REAL centerz, + _GL_REAL upx, _GL_REAL upy, _GL_REAL upz) { + float forward[3], side[3], up[3]; + GLfloat m[4][4]; - forward[0] = centerx - eyex; - forward[1] = centery - eyey; - forward[2] = centerz - eyez; + forward[0] = centerx - eyex; + forward[1] = centery - eyey; + forward[2] = centerz - eyez; - up[0] = upx; - up[1] = upy; - up[2] = upz; + up[0] = upx; + up[1] = upy; + up[2] = upz; - normalize(forward); + normalize(forward); - /* Side = forward x up */ - cross(forward, up, side); - normalize(side); + /* Side = forward x up */ + cross(forward, up, side); + normalize(side); - /* Recompute up as: up = side x forward */ - cross(side, forward, up); + /* Recompute up as: up = side x forward */ + cross(side, forward, up); - __gluMakeIdentityf(&m[0][0]); - m[0][0] = side[0]; - m[1][0] = side[1]; - m[2][0] = side[2]; + __gluMakeIdentityf(&m[0][0]); + m[0][0] = side[0]; + m[1][0] = side[1]; + m[2][0] = side[2]; - m[0][1] = up[0]; - m[1][1] = up[1]; - m[2][1] = up[2]; + m[0][1] = up[0]; + m[1][1] = up[1]; + m[2][1] = up[2]; - m[0][2] = -forward[0]; - m[1][2] = -forward[1]; - m[2][2] = -forward[2]; + m[0][2] = -forward[0]; + m[1][2] = -forward[1]; + m[2][2] = -forward[2]; - glMultMatrixf(&m[0][0]); + glMultMatrixf(&m[0][0]); #ifdef USE_OPENGL_ES - glTranslatef(-eyex, -eyey, -eyez); + glTranslatef(-eyex, -eyey, -eyez); #else - glTranslated(-eyex, -eyey, -eyez); + glTranslated(-eyex, -eyey, -eyez); #endif } static void __gluMultMatrixVecd(const _GL_REAL matrix[16], const _GL_REAL in[4], - _GL_REAL out[4]) -{ - int i; - - for (i=0; i<4; i++) { - out[i] = - in[0] * matrix[0*4+i] + - in[1] * matrix[1*4+i] + - in[2] * matrix[2*4+i] + - in[3] * matrix[3*4+i]; - } + _GL_REAL out[4]) { + int i; + + for (i = 0; i < 4; i++) { + out[i] = in[0] * matrix[0 * 4 + i] + in[1] * matrix[1 * 4 + i] + + in[2] * matrix[2 * 4 + i] + in[3] * matrix[3 * 4 + i]; + } } /* ** Invert 4x4 matrix. ** Contributed by David Moore (See Mesa bug #6748) */ -static int __gluInvertMatrixd(const _GL_REAL m[16], _GL_REAL invOut[16]) -{ - double inv[16], det; - int i; - - inv[0] = m[5]*m[10]*m[15] - m[5]*m[11]*m[14] - m[9]*m[6]*m[15] - + m[9]*m[7]*m[14] + m[13]*m[6]*m[11] - m[13]*m[7]*m[10]; - inv[4] = -m[4]*m[10]*m[15] + m[4]*m[11]*m[14] + m[8]*m[6]*m[15] - - m[8]*m[7]*m[14] - m[12]*m[6]*m[11] + m[12]*m[7]*m[10]; - inv[8] = m[4]*m[9]*m[15] - m[4]*m[11]*m[13] - m[8]*m[5]*m[15] - + m[8]*m[7]*m[13] + m[12]*m[5]*m[11] - m[12]*m[7]*m[9]; - inv[12] = -m[4]*m[9]*m[14] + m[4]*m[10]*m[13] + m[8]*m[5]*m[14] - - m[8]*m[6]*m[13] - m[12]*m[5]*m[10] + m[12]*m[6]*m[9]; - inv[1] = -m[1]*m[10]*m[15] + m[1]*m[11]*m[14] + m[9]*m[2]*m[15] - - m[9]*m[3]*m[14] - m[13]*m[2]*m[11] + m[13]*m[3]*m[10]; - inv[5] = m[0]*m[10]*m[15] - m[0]*m[11]*m[14] - m[8]*m[2]*m[15] - + m[8]*m[3]*m[14] + m[12]*m[2]*m[11] - m[12]*m[3]*m[10]; - inv[9] = -m[0]*m[9]*m[15] + m[0]*m[11]*m[13] + m[8]*m[1]*m[15] - - m[8]*m[3]*m[13] - m[12]*m[1]*m[11] + m[12]*m[3]*m[9]; - inv[13] = m[0]*m[9]*m[14] - m[0]*m[10]*m[13] - m[8]*m[1]*m[14] - + m[8]*m[2]*m[13] + m[12]*m[1]*m[10] - m[12]*m[2]*m[9]; - inv[2] = m[1]*m[6]*m[15] - m[1]*m[7]*m[14] - m[5]*m[2]*m[15] - + m[5]*m[3]*m[14] + m[13]*m[2]*m[7] - m[13]*m[3]*m[6]; - inv[6] = -m[0]*m[6]*m[15] + m[0]*m[7]*m[14] + m[4]*m[2]*m[15] - - m[4]*m[3]*m[14] - m[12]*m[2]*m[7] + m[12]*m[3]*m[6]; - inv[10] = m[0]*m[5]*m[15] - m[0]*m[7]*m[13] - m[4]*m[1]*m[15] - + m[4]*m[3]*m[13] + m[12]*m[1]*m[7] - m[12]*m[3]*m[5]; - inv[14] = -m[0]*m[5]*m[14] + m[0]*m[6]*m[13] + m[4]*m[1]*m[14] - - m[4]*m[2]*m[13] - m[12]*m[1]*m[6] + m[12]*m[2]*m[5]; - inv[3] = -m[1]*m[6]*m[11] + m[1]*m[7]*m[10] + m[5]*m[2]*m[11] - - m[5]*m[3]*m[10] - m[9]*m[2]*m[7] + m[9]*m[3]*m[6]; - inv[7] = m[0]*m[6]*m[11] - m[0]*m[7]*m[10] - m[4]*m[2]*m[11] - + m[4]*m[3]*m[10] + m[8]*m[2]*m[7] - m[8]*m[3]*m[6]; - inv[11] = -m[0]*m[5]*m[11] + m[0]*m[7]*m[9] + m[4]*m[1]*m[11] - - m[4]*m[3]*m[9] - m[8]*m[1]*m[7] + m[8]*m[3]*m[5]; - inv[15] = m[0]*m[5]*m[10] - m[0]*m[6]*m[9] - m[4]*m[1]*m[10] - + m[4]*m[2]*m[9] + m[8]*m[1]*m[6] - m[8]*m[2]*m[5]; - - det = m[0]*inv[0] + m[1]*inv[4] + m[2]*inv[8] + m[3]*inv[12]; - if (det == 0) - return GL_FALSE; - - det = 1.0 / det; - - for (i = 0; i < 16; i++) - invOut[i] = inv[i] * det; - - return GL_TRUE; +static int __gluInvertMatrixd(const _GL_REAL m[16], _GL_REAL invOut[16]) { + double inv[16], det; + int i; + + inv[0] = m[5] * m[10] * m[15] - m[5] * m[11] * m[14] - m[9] * m[6] * m[15] + + m[9] * m[7] * m[14] + m[13] * m[6] * m[11] - m[13] * m[7] * m[10]; + inv[4] = -m[4] * m[10] * m[15] + m[4] * m[11] * m[14] + m[8] * m[6] * m[15] - + m[8] * m[7] * m[14] - m[12] * m[6] * m[11] + m[12] * m[7] * m[10]; + inv[8] = m[4] * m[9] * m[15] - m[4] * m[11] * m[13] - m[8] * m[5] * m[15] + + m[8] * m[7] * m[13] + m[12] * m[5] * m[11] - m[12] * m[7] * m[9]; + inv[12] = -m[4] * m[9] * m[14] + m[4] * m[10] * m[13] + m[8] * m[5] * m[14] - + m[8] * m[6] * m[13] - m[12] * m[5] * m[10] + m[12] * m[6] * m[9]; + inv[1] = -m[1] * m[10] * m[15] + m[1] * m[11] * m[14] + m[9] * m[2] * m[15] - + m[9] * m[3] * m[14] - m[13] * m[2] * m[11] + m[13] * m[3] * m[10]; + inv[5] = m[0] * m[10] * m[15] - m[0] * m[11] * m[14] - m[8] * m[2] * m[15] + + m[8] * m[3] * m[14] + m[12] * m[2] * m[11] - m[12] * m[3] * m[10]; + inv[9] = -m[0] * m[9] * m[15] + m[0] * m[11] * m[13] + m[8] * m[1] * m[15] - + m[8] * m[3] * m[13] - m[12] * m[1] * m[11] + m[12] * m[3] * m[9]; + inv[13] = m[0] * m[9] * m[14] - m[0] * m[10] * m[13] - m[8] * m[1] * m[14] + + m[8] * m[2] * m[13] + m[12] * m[1] * m[10] - m[12] * m[2] * m[9]; + inv[2] = m[1] * m[6] * m[15] - m[1] * m[7] * m[14] - m[5] * m[2] * m[15] + + m[5] * m[3] * m[14] + m[13] * m[2] * m[7] - m[13] * m[3] * m[6]; + inv[6] = -m[0] * m[6] * m[15] + m[0] * m[7] * m[14] + m[4] * m[2] * m[15] - + m[4] * m[3] * m[14] - m[12] * m[2] * m[7] + m[12] * m[3] * m[6]; + inv[10] = m[0] * m[5] * m[15] - m[0] * m[7] * m[13] - m[4] * m[1] * m[15] + + m[4] * m[3] * m[13] + m[12] * m[1] * m[7] - m[12] * m[3] * m[5]; + inv[14] = -m[0] * m[5] * m[14] + m[0] * m[6] * m[13] + m[4] * m[1] * m[14] - + m[4] * m[2] * m[13] - m[12] * m[1] * m[6] + m[12] * m[2] * m[5]; + inv[3] = -m[1] * m[6] * m[11] + m[1] * m[7] * m[10] + m[5] * m[2] * m[11] - + m[5] * m[3] * m[10] - m[9] * m[2] * m[7] + m[9] * m[3] * m[6]; + inv[7] = m[0] * m[6] * m[11] - m[0] * m[7] * m[10] - m[4] * m[2] * m[11] + + m[4] * m[3] * m[10] + m[8] * m[2] * m[7] - m[8] * m[3] * m[6]; + inv[11] = -m[0] * m[5] * m[11] + m[0] * m[7] * m[9] + m[4] * m[1] * m[11] - + m[4] * m[3] * m[9] - m[8] * m[1] * m[7] + m[8] * m[3] * m[5]; + inv[15] = m[0] * m[5] * m[10] - m[0] * m[6] * m[9] - m[4] * m[1] * m[10] + + m[4] * m[2] * m[9] + m[8] * m[1] * m[6] - m[8] * m[2] * m[5]; + + det = m[0] * inv[0] + m[1] * inv[4] + m[2] * inv[8] + m[3] * inv[12]; + if (det == 0) + return GL_FALSE; + + det = 1.0 / det; + + for (i = 0; i < 16; i++) + invOut[i] = inv[i] * det; + + return GL_TRUE; } static void __gluMultMatricesd(const _GL_REAL a[16], const _GL_REAL b[16], - _GL_REAL r[16]) -{ - int i, j; + _GL_REAL r[16]) { + int i, j; - for (i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { - r[i*4+j] = - a[i*4+0]*b[0*4+j] + - a[i*4+1]*b[1*4+j] + - a[i*4+2]*b[2*4+j] + - a[i*4+3]*b[3*4+j]; - } + r[i * 4 + j] = a[i * 4 + 0] * b[0 * 4 + j] + a[i * 4 + 1] * b[1 * 4 + j] + + a[i * 4 + 2] * b[2 * 4 + j] + a[i * 4 + 3] * b[3 * 4 + j]; } + } } -GLint GLAPIENTRY -gluProject(_GL_REAL objx, _GL_REAL objy, _GL_REAL objz, - const _GL_REAL modelMatrix[16], - const _GL_REAL projMatrix[16], - const GLint viewport[4], - _GL_REAL *winx, _GL_REAL *winy, _GL_REAL *winz) -{ - REAL in[4]; - REAL out[4]; - - in[0]=objx; - in[1]=objy; - in[2]=objz; - in[3]=1.0; - __gluMultMatrixVecd(modelMatrix, in, out); - __gluMultMatrixVecd(projMatrix, out, in); - if (in[3] == 0.0) return(GL_FALSE); - in[0] /= in[3]; - in[1] /= in[3]; - in[2] /= in[3]; - /* Map x, y and z to range 0-1 */ - in[0] = in[0] * 0.5 + 0.5; - in[1] = in[1] * 0.5 + 0.5; - in[2] = in[2] * 0.5 + 0.5; - - /* Map x,y to viewport */ - in[0] = in[0] * viewport[2] + viewport[0]; - in[1] = in[1] * viewport[3] + viewport[1]; - - *winx=in[0]; - *winy=in[1]; - *winz=in[2]; - return(GL_TRUE); +GLint GLAPIENTRY gluProject(_GL_REAL objx, _GL_REAL objy, _GL_REAL objz, + const _GL_REAL modelMatrix[16], + const _GL_REAL projMatrix[16], + const GLint viewport[4], _GL_REAL *winx, + _GL_REAL *winy, _GL_REAL *winz) { + REAL in[4]; + REAL out[4]; + + in[0] = objx; + in[1] = objy; + in[2] = objz; + in[3] = 1.0; + __gluMultMatrixVecd(modelMatrix, in, out); + __gluMultMatrixVecd(projMatrix, out, in); + if (in[3] == 0.0) + return (GL_FALSE); + in[0] /= in[3]; + in[1] /= in[3]; + in[2] /= in[3]; + /* Map x, y and z to range 0-1 */ + in[0] = in[0] * 0.5 + 0.5; + in[1] = in[1] * 0.5 + 0.5; + in[2] = in[2] * 0.5 + 0.5; + + /* Map x,y to viewport */ + in[0] = in[0] * viewport[2] + viewport[0]; + in[1] = in[1] * viewport[3] + viewport[1]; + + *winx = in[0]; + *winy = in[1]; + *winz = in[2]; + return (GL_TRUE); } -GLint GLAPIENTRY -gluUnProject(_GL_REAL winx, _GL_REAL winy, _GL_REAL winz, - const _GL_REAL modelMatrix[16], - const _GL_REAL projMatrix[16], - const GLint viewport[4], - _GL_REAL *objx, _GL_REAL *objy, _GL_REAL *objz) -{ - REAL finalMatrix[16]; - REAL in[4]; - REAL out[4]; - - __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); - if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); - - in[0]=winx; - in[1]=winy; - in[2]=winz; - in[3]=1.0; - - /* Map x and y from window coordinates */ - in[0] = (in[0] - viewport[0]) / viewport[2]; - in[1] = (in[1] - viewport[1]) / viewport[3]; - - /* Map to range -1 to 1 */ - in[0] = in[0] * 2 - 1; - in[1] = in[1] * 2 - 1; - in[2] = in[2] * 2 - 1; - - __gluMultMatrixVecd(finalMatrix, in, out); - if (out[3] == 0.0) return(GL_FALSE); - out[0] /= out[3]; - out[1] /= out[3]; - out[2] /= out[3]; - *objx = out[0]; - *objy = out[1]; - *objz = out[2]; - return(GL_TRUE); +GLint GLAPIENTRY gluUnProject(_GL_REAL winx, _GL_REAL winy, _GL_REAL winz, + const _GL_REAL modelMatrix[16], + const _GL_REAL projMatrix[16], + const GLint viewport[4], _GL_REAL *objx, + _GL_REAL *objy, _GL_REAL *objz) { + REAL finalMatrix[16]; + REAL in[4]; + REAL out[4]; + + __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); + if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) + return (GL_FALSE); + + in[0] = winx; + in[1] = winy; + in[2] = winz; + in[3] = 1.0; + + /* Map x and y from window coordinates */ + in[0] = (in[0] - viewport[0]) / viewport[2]; + in[1] = (in[1] - viewport[1]) / viewport[3]; + + /* Map to range -1 to 1 */ + in[0] = in[0] * 2 - 1; + in[1] = in[1] * 2 - 1; + in[2] = in[2] * 2 - 1; + + __gluMultMatrixVecd(finalMatrix, in, out); + if (out[3] == 0.0) + return (GL_FALSE); + out[0] /= out[3]; + out[1] /= out[3]; + out[2] /= out[3]; + *objx = out[0]; + *objy = out[1]; + *objz = out[2]; + return (GL_TRUE); } -GLint GLAPIENTRY -gluUnProject4(_GL_REAL winx, _GL_REAL winy, _GL_REAL winz, _GL_REAL clipw, - const _GL_REAL modelMatrix[16], - const _GL_REAL projMatrix[16], - const GLint viewport[4], - _GL_CLAMP_REAL nearVal, _GL_CLAMP_REAL farVal, - _GL_REAL *objx, _GL_REAL *objy, _GL_REAL *objz, - _GL_REAL *objw) -{ - REAL finalMatrix[16]; - REAL in[4]; - REAL out[4]; - - __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); - if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); - - in[0]=winx; - in[1]=winy; - in[2]=winz; - in[3]=clipw; - - /* Map x and y from window coordinates */ - in[0] = (in[0] - viewport[0]) / viewport[2]; - in[1] = (in[1] - viewport[1]) / viewport[3]; - in[2] = (in[2] - nearVal) / (farVal - nearVal); - - /* Map to range -1 to 1 */ - in[0] = in[0] * 2 - 1; - in[1] = in[1] * 2 - 1; - in[2] = in[2] * 2 - 1; - - __gluMultMatrixVecd(finalMatrix, in, out); - if (out[3] == 0.0) return(GL_FALSE); - *objx = out[0]; - *objy = out[1]; - *objz = out[2]; - *objw = out[3]; - return(GL_TRUE); +GLint GLAPIENTRY gluUnProject4(_GL_REAL winx, _GL_REAL winy, _GL_REAL winz, + _GL_REAL clipw, const _GL_REAL modelMatrix[16], + const _GL_REAL projMatrix[16], + const GLint viewport[4], _GL_CLAMP_REAL nearVal, + _GL_CLAMP_REAL farVal, _GL_REAL *objx, + _GL_REAL *objy, _GL_REAL *objz, _GL_REAL *objw) { + REAL finalMatrix[16]; + REAL in[4]; + REAL out[4]; + + __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); + if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) + return (GL_FALSE); + + in[0] = winx; + in[1] = winy; + in[2] = winz; + in[3] = clipw; + + /* Map x and y from window coordinates */ + in[0] = (in[0] - viewport[0]) / viewport[2]; + in[1] = (in[1] - viewport[1]) / viewport[3]; + in[2] = (in[2] - nearVal) / (farVal - nearVal); + + /* Map to range -1 to 1 */ + in[0] = in[0] * 2 - 1; + in[1] = in[1] * 2 - 1; + in[2] = in[2] * 2 - 1; + + __gluMultMatrixVecd(finalMatrix, in, out); + if (out[3] == 0.0) + return (GL_FALSE); + *objx = out[0]; + *objy = out[1]; + *objz = out[2]; + *objw = out[3]; + return (GL_TRUE); } -void GLAPIENTRY -gluPickMatrix(_GL_REAL x, _GL_REAL y, _GL_REAL deltax, _GL_REAL deltay, - GLint viewport[4]) -{ - if (deltax <= 0 || deltay <= 0) { - return; - } +void GLAPIENTRY gluPickMatrix(_GL_REAL x, _GL_REAL y, _GL_REAL deltax, + _GL_REAL deltay, GLint viewport[4]) { + if (deltax <= 0 || deltay <= 0) { + return; + } - /* Translate and scale the picked region to the entire window */ - glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax, - (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); - glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0); + /* Translate and scale the picked region to the entire window */ + glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax, + (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); + glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0); } diff --git a/libvisual-plugins/common/GL/glu.h b/libvisual-plugins/common/GL/glu.h index 1ea2eaef4..fd5027893 100644 --- a/libvisual-plugins/common/GL/glu.h +++ b/libvisual-plugins/common/GL/glu.h @@ -52,15 +52,15 @@ #endif #if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32) -# undef GLAPI -# define GLAPI __declspec(dllexport) +#undef GLAPI +#define GLAPI __declspec(dllexport) #elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# undef GLAPI -# define GLAPI __declspec(dllimport) +#undef GLAPI +#define GLAPI __declspec(dllimport) #elif !defined(GLAPI) /* for use with static link lib build of Win32 edition only */ -# define GLAPI extern +#define GLAPI extern #endif /* _STATIC_MESA support */ #ifdef USE_OPENGL_ES @@ -74,13 +74,29 @@ #ifdef __cplusplus extern "C" { #endif -GLAPI void GLAPIENTRY gluLookAt (_GL_REAL eyeX, _GL_REAL eyeY, _GL_REAL eyeZ, _GL_REAL centerX, _GL_REAL centerY, _GL_REAL centerZ, _GL_REAL upX, _GL_REAL upY, _GL_REAL upZ); -GLAPI void GLAPIENTRY gluOrtho2D (_GL_REAL left, _GL_REAL right, _GL_REAL bottom, _GL_REAL top); -GLAPI void GLAPIENTRY gluPerspective (_GL_REAL fovy, _GL_REAL aspect, _GL_REAL zNear, _GL_REAL zFar); -GLAPI void GLAPIENTRY gluPickMatrix (_GL_REAL x, _GL_REAL y, _GL_REAL delX, _GL_REAL delY, GLint *viewport); -GLAPI GLint GLAPIENTRY gluProject (_GL_REAL objX, _GL_REAL objY, _GL_REAL objZ, const _GL_REAL *model, const _GL_REAL *proj, const GLint *view, _GL_REAL* winX, _GL_REAL* winY, _GL_REAL* winZ); -GLAPI GLint GLAPIENTRY gluUnProject (_GL_REAL winX, _GL_REAL winY, _GL_REAL winZ, const _GL_REAL *model, const _GL_REAL *proj, const GLint *view, _GL_REAL* objX, _GL_REAL* objY, _GL_REAL* objZ); -GLAPI GLint GLAPIENTRY gluUnProject4 (_GL_REAL winX, _GL_REAL winY, _GL_REAL winZ, _GL_REAL clipW, const _GL_REAL *model, const _GL_REAL *proj, const GLint *view, _GL_CLAMP_REAL nearVal, _GL_CLAMP_REAL farVal, _GL_REAL* objX, _GL_REAL* objY, _GL_REAL* objZ, _GL_REAL* objW); +GLAPI void GLAPIENTRY gluLookAt(_GL_REAL eyeX, _GL_REAL eyeY, _GL_REAL eyeZ, + _GL_REAL centerX, _GL_REAL centerY, + _GL_REAL centerZ, _GL_REAL upX, _GL_REAL upY, + _GL_REAL upZ); +GLAPI void GLAPIENTRY gluOrtho2D(_GL_REAL left, _GL_REAL right, _GL_REAL bottom, + _GL_REAL top); +GLAPI void GLAPIENTRY gluPerspective(_GL_REAL fovy, _GL_REAL aspect, + _GL_REAL zNear, _GL_REAL zFar); +GLAPI void GLAPIENTRY gluPickMatrix(_GL_REAL x, _GL_REAL y, _GL_REAL delX, + _GL_REAL delY, GLint *viewport); +GLAPI GLint GLAPIENTRY gluProject(_GL_REAL objX, _GL_REAL objY, _GL_REAL objZ, + const _GL_REAL *model, const _GL_REAL *proj, + const GLint *view, _GL_REAL *winX, + _GL_REAL *winY, _GL_REAL *winZ); +GLAPI GLint GLAPIENTRY gluUnProject(_GL_REAL winX, _GL_REAL winY, _GL_REAL winZ, + const _GL_REAL *model, const _GL_REAL *proj, + const GLint *view, _GL_REAL *objX, + _GL_REAL *objY, _GL_REAL *objZ); +GLAPI GLint GLAPIENTRY +gluUnProject4(_GL_REAL winX, _GL_REAL winY, _GL_REAL winZ, _GL_REAL clipW, + const _GL_REAL *model, const _GL_REAL *proj, const GLint *view, + _GL_CLAMP_REAL nearVal, _GL_CLAMP_REAL farVal, _GL_REAL *objX, + _GL_REAL *objY, _GL_REAL *objZ, _GL_REAL *objW); #ifdef __cplusplus } diff --git a/libvisual-plugins/gettext.h b/libvisual-plugins/gettext.h index df2abbe61..724f3dd27 100644 --- a/libvisual-plugins/gettext.h +++ b/libvisual-plugins/gettext.h @@ -1,5 +1,6 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 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 @@ -23,19 +24,18 @@ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ -# include +#include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ -# ifdef DEFAULT_TEXT_DOMAIN -# undef gettext -# define gettext(Msgid) \ - dgettext (DEFAULT_TEXT_DOMAIN, Msgid) -# undef ngettext -# define ngettext(Msgid1, Msgid2, N) \ - dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) -# endif +#ifdef DEFAULT_TEXT_DOMAIN +#undef gettext +#define gettext(Msgid) dgettext(DEFAULT_TEXT_DOMAIN, Msgid) +#undef ngettext +#define ngettext(Msgid1, Msgid2, N) \ + dngettext(DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +#endif #else @@ -46,17 +46,17 @@ and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) -# include +#include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) -# include -# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H -# include -# endif +#include +#if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +#include +#endif #endif /* Disabled NLS. @@ -64,32 +64,31 @@ for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ -# undef gettext -# define gettext(Msgid) ((const char *) (Msgid)) -# undef dgettext -# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) -# undef dcgettext -# define dcgettext(Domainname, Msgid, Category) \ - ((void) (Category), dgettext (Domainname, Msgid)) -# undef ngettext -# define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 \ - ? ((void) (Msgid2), (const char *) (Msgid1)) \ - : ((void) (Msgid1), (const char *) (Msgid2))) -# undef dngettext -# define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) -# undef dcngettext -# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) -# undef textdomain -# define textdomain(Domainname) ((const char *) (Domainname)) -# undef bindtextdomain -# define bindtextdomain(Domainname, Dirname) \ - ((void) (Domainname), (const char *) (Dirname)) -# undef bind_textdomain_codeset -# define bind_textdomain_codeset(Domainname, Codeset) \ - ((void) (Domainname), (const char *) (Codeset)) +#undef gettext +#define gettext(Msgid) ((const char *)(Msgid)) +#undef dgettext +#define dgettext(Domainname, Msgid) ((void)(Domainname), gettext(Msgid)) +#undef dcgettext +#define dcgettext(Domainname, Msgid, Category) \ + ((void)(Category), dgettext(Domainname, Msgid)) +#undef ngettext +#define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 ? ((void)(Msgid2), (const char *)(Msgid1)) \ + : ((void)(Msgid1), (const char *)(Msgid2))) +#undef dngettext +#define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void)(Domainname), ngettext(Msgid1, Msgid2, N)) +#undef dcngettext +#define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void)(Category), dngettext(Domainname, Msgid1, Msgid2, N)) +#undef textdomain +#define textdomain(Domainname) ((const char *)(Domainname)) +#undef bindtextdomain +#define bindtextdomain(Domainname, Dirname) \ + ((void)(Domainname), (const char *)(Dirname)) +#undef bind_textdomain_codeset +#define bind_textdomain_codeset(Domainname, Codeset) \ + ((void)(Domainname), (const char *)(Codeset)) #endif @@ -110,27 +109,33 @@ short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN -# define pgettext(Msgctxt, Msgid) \ - pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define pgettext(Msgctxt, Msgid) \ + pgettext_aux(DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + LC_MESSAGES) #else -# define pgettext(Msgctxt, Msgid) \ - pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define pgettext(Msgctxt, Msgid) \ + pgettext_aux(NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif -#define dpgettext(Domainname, Msgctxt, Msgid) \ - pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) -#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ - pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux(Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux(Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN -# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux(DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, \ + Msgid, MsgidPlural, N, LC_MESSAGES) #else -# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux(NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, \ + N, LC_MESSAGES) #endif -#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) -#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ - npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux(Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux(Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + MsgidPlural, N, Category) #ifdef __GNUC__ __inline @@ -139,12 +144,10 @@ __inline inline #endif #endif -static const char * -pgettext_aux (const char *domain, - const char *msg_ctxt_id, const char *msgid, - int category) -{ - const char *translation = dcgettext (domain, msg_ctxt_id, category); + static const char * + pgettext_aux(const char *domain, const char *msg_ctxt_id, const char *msgid, + int category) { + const char *translation = dcgettext(domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else @@ -158,14 +161,12 @@ __inline inline #endif #endif -static const char * -npgettext_aux (const char *domain, - const char *msg_ctxt_id, const char *msgid, - const char *msgid_plural, unsigned long int n, - int category) -{ + static const char * + npgettext_aux(const char *domain, const char *msg_ctxt_id, + const char *msgid, const char *msgid_plural, + unsigned long int n, int category) { const char *translation = - dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + dcngettext(domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else @@ -178,18 +179,18 @@ npgettext_aux (const char *domain, #include -#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ - (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ - /* || __STDC_VERSION__ >= 199901L */ ) +#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ + (((__GNUC__ >= 3 || __GNUG__ >= 2) && \ + !__STRICT_ANSI__) /* || __STDC_VERSION__ >= 199901L */) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif -#define pgettext_expr(Msgctxt, Msgid) \ - dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) -#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ - dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr(NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr(Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline @@ -198,43 +199,40 @@ __inline inline #endif #endif -static const char * -dcpgettext_expr (const char *domain, - const char *msgctxt, const char *msgid, - int category) -{ - size_t msgctxt_len = strlen (msgctxt) + 1; - size_t msgid_len = strlen (msgid) + 1; + static const char * + dcpgettext_expr(const char *domain, const char *msgctxt, const char *msgid, + int category) { + size_t msgctxt_len = strlen(msgctxt) + 1; + size_t msgid_len = strlen(msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; - char *msg_ctxt_id = - (msgctxt_len + msgid_len <= sizeof (buf) - ? buf - : (char *) malloc (msgctxt_len + msgid_len)); + char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof(buf) + ? buf + : (char *)malloc(msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif - { - memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); - msg_ctxt_id[msgctxt_len - 1] = '\004'; - memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); - translation = dcgettext (domain, msg_ctxt_id, category); + { + memcpy(msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy(msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext(domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS - if (msg_ctxt_id != buf) - free (msg_ctxt_id); + if (msg_ctxt_id != buf) + free(msg_ctxt_id); #endif - if (translation != msg_ctxt_id) - return translation; - } + if (translation != msg_ctxt_id) + return translation; + } return msgid; } -#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ - dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) -#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ - dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr(NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline @@ -243,42 +241,39 @@ __inline inline #endif #endif -static const char * -dcnpgettext_expr (const char *domain, - const char *msgctxt, const char *msgid, - const char *msgid_plural, unsigned long int n, - int category) -{ - size_t msgctxt_len = strlen (msgctxt) + 1; - size_t msgid_len = strlen (msgid) + 1; + static const char * + dcnpgettext_expr(const char *domain, const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) { + size_t msgctxt_len = strlen(msgctxt) + 1; + size_t msgid_len = strlen(msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; - char *msg_ctxt_id = - (msgctxt_len + msgid_len <= sizeof (buf) - ? buf - : (char *) malloc (msgctxt_len + msgid_len)); + char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof(buf) + ? buf + : (char *)malloc(msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif - { - memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); - msg_ctxt_id[msgctxt_len - 1] = '\004'; - memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); - translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + { + memcpy(msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy(msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext(domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS - if (msg_ctxt_id != buf) - free (msg_ctxt_id); + if (msg_ctxt_id != buf) + free(msg_ctxt_id); #endif - if (!(translation == msg_ctxt_id || translation == msgid_plural)) - return translation; - } + if (!(translation == msg_ctxt_id || translation == msgid_plural)) + return translation; + } return (n == 1 ? msgid : msgid_plural); } /* Added for Libvisual */ -#define _(String) gettext(String) +#define _(String) gettext(String) #define N_(String) gettext_noop(String) #endif /* _LIBGETTEXT_H */ diff --git a/libvisual-plugins/plugins/actor/blursk/actor_blursk.c b/libvisual-plugins/plugins/actor/blursk/actor_blursk.c index f3bc3bd77..ee4933c08 100644 --- a/libvisual-plugins/plugins/actor/blursk/actor_blursk.c +++ b/libvisual-plugins/plugins/actor/blursk/actor_blursk.c @@ -26,294 +26,229 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int act_blursk_init (VisPluginData *plugin); -static void act_blursk_cleanup (VisPluginData *plugin); -static void act_blursk_requisition (VisPluginData *plugin, int *width, int *height); -static void act_blursk_resize (VisPluginData *plugin, int width, int height); -static int act_blursk_events (VisPluginData *plugin, VisEventQueue *events); -static void act_blursk_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *act_blursk_palette (VisPluginData *plugin); +static int act_blursk_init(VisPluginData *plugin); +static void act_blursk_cleanup(VisPluginData *plugin); +static void act_blursk_requisition(VisPluginData *plugin, int *width, + int *height); +static void act_blursk_resize(VisPluginData *plugin, int width, int height); +static int act_blursk_events(VisPluginData *plugin, VisEventQueue *events); +static void act_blursk_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *act_blursk_palette(VisPluginData *plugin); BlurskConfig config; -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = act_blursk_requisition, - .palette = act_blursk_palette, - .render = act_blursk_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "blursk", - .name = "Blursk plugin", - .author = "Read AUTHORS", - .version = "0.0.1", - .about = N_("blursk visual plugin"), - .help = N_("This is the libvisual port of blursk xmms visualization"), - .license = VISUAL_PLUGIN_LICENSE_GPL, - - .init = act_blursk_init, - .cleanup = act_blursk_cleanup, - .events = act_blursk_events, - .plugin = &actor - }; - - return &info; +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = act_blursk_requisition, + .palette = act_blursk_palette, + .render = act_blursk_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "blursk", + .name = "Blursk plugin", + .author = "Read AUTHORS", + .version = "0.0.1", + .about = N_("blursk visual plugin"), + .help = N_("This is the libvisual port of blursk xmms visualization"), + .license = VISUAL_PLUGIN_LICENSE_GPL, + + .init = act_blursk_init, + .cleanup = act_blursk_cleanup, + .events = act_blursk_events, + .plugin = &actor}; + + return &info; } -static int act_blursk_init (VisPluginData *plugin) { +static int act_blursk_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_color_rgb ("color", - N_("Color"), - 0x00, 0xff, 0xff, - NULL), - visual_param_new_string ("color_style", - N_("Color style"), - "Rainbow", - NULL), - visual_param_new_string ("signal_color", - N_("Signal color"), - "Normal signal", - NULL), - visual_param_new_bool ("contour_lines", - N_("Contour lines"), - FALSE, - NULL), - visual_param_new_bool ("hue_on_beats", - N_("Hue change on beats"), - FALSE, - NULL), - visual_param_new_string ("background", - N_("Background"), - "Black bkgnd", - NULL), - visual_param_new_string ("blur_style", - N_("Blur style"), - "Random", - NULL), - visual_param_new_string ("transition_speed", - N_("Transition speed"), - "Medium switch", - NULL), - visual_param_new_string ("blur_when", - N_("When to blur"), - "Full blur", - NULL), - visual_param_new_string ("blur_stencil", - N_("Blur stencil"), - "No stencil", - NULL), - visual_param_new_string ("fade_speed", - N_("Fade speed"), - "Medium fade", - NULL), - visual_param_new_bool ("slow_motion", - N_("Slow motion"), - FALSE, - NULL), - visual_param_new_string ("signal_style", - N_("Signal type"), - "Stereo spectrum", - NULL), - visual_param_new_string ("plot_style", - N_("Plot style"), - "Line", - NULL), - visual_param_new_bool ("thick_on_beats", - N_("Thick on beats"), - TRUE, - NULL), - visual_param_new_string ("flash_style", - N_("Flash style"), - "No flash", - NULL), - visual_param_new_string ("overall_effect", - N_("Overall effect"), - "Normal effect", - NULL), - visual_param_new_string ("floaters", - N_("Floaters"), - "No floaters", - NULL), - visual_param_new_string ("cpu_speed", - N_("CPU speed"), - "Fast CPU", - NULL), - visual_param_new_integer ("beat_sensitivity", - N_("Beat sensitivity"), - 4, - visual_param_in_range_integer (0, 10)), - visual_param_new_string ("config_string", - N_("Config string"), - "", - NULL), - visual_param_new_string ("show_info", - N_("Show info"), - "Never show info", - NULL), - visual_param_new_integer ("info_timeout", - N_("Info timeout"), - 4, - visual_param_in_range_integer (0, INT_MAX)), - visual_param_new_bool ("show_timestamp", - N_("Show timestamp"), - TRUE, - NULL), - NULL); - - /* init plugin */ - BlurskPrivate *priv = visual_mem_new0 (BlurskPrivate, 1); - visual_plugin_set_private (plugin, priv); - - priv->plugin = plugin; - priv->rcontext = visual_plugin_get_random_context (plugin); - priv->pal = visual_palette_new (256); - priv->pcmbuf = visual_buffer_new_allocate (512 * sizeof (float)); - - config_default (&config); - - __blursk_init (priv); - - return TRUE; + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, + visual_param_new_color_rgb("color", N_("Color"), 0x00, 0xff, 0xff, NULL), + visual_param_new_string("color_style", N_("Color style"), "Rainbow", + NULL), + visual_param_new_string("signal_color", N_("Signal color"), + "Normal signal", NULL), + visual_param_new_bool("contour_lines", N_("Contour lines"), FALSE, NULL), + visual_param_new_bool("hue_on_beats", N_("Hue change on beats"), FALSE, + NULL), + visual_param_new_string("background", N_("Background"), "Black bkgnd", + NULL), + visual_param_new_string("blur_style", N_("Blur style"), "Random", NULL), + visual_param_new_string("transition_speed", N_("Transition speed"), + "Medium switch", NULL), + visual_param_new_string("blur_when", N_("When to blur"), "Full blur", + NULL), + visual_param_new_string("blur_stencil", N_("Blur stencil"), "No stencil", + NULL), + visual_param_new_string("fade_speed", N_("Fade speed"), "Medium fade", + NULL), + visual_param_new_bool("slow_motion", N_("Slow motion"), FALSE, NULL), + visual_param_new_string("signal_style", N_("Signal type"), + "Stereo spectrum", NULL), + visual_param_new_string("plot_style", N_("Plot style"), "Line", NULL), + visual_param_new_bool("thick_on_beats", N_("Thick on beats"), TRUE, NULL), + visual_param_new_string("flash_style", N_("Flash style"), "No flash", + NULL), + visual_param_new_string("overall_effect", N_("Overall effect"), + "Normal effect", NULL), + visual_param_new_string("floaters", N_("Floaters"), "No floaters", NULL), + visual_param_new_string("cpu_speed", N_("CPU speed"), "Fast CPU", NULL), + visual_param_new_integer("beat_sensitivity", N_("Beat sensitivity"), 4, + visual_param_in_range_integer(0, 10)), + visual_param_new_string("config_string", N_("Config string"), "", NULL), + visual_param_new_string("show_info", N_("Show info"), "Never show info", + NULL), + visual_param_new_integer("info_timeout", N_("Info timeout"), 4, + visual_param_in_range_integer(0, INT_MAX)), + visual_param_new_bool("show_timestamp", N_("Show timestamp"), TRUE, NULL), + NULL); + + /* init plugin */ + BlurskPrivate *priv = visual_mem_new0(BlurskPrivate, 1); + visual_plugin_set_private(plugin, priv); + + priv->plugin = plugin; + priv->rcontext = visual_plugin_get_random_context(plugin); + priv->pal = visual_palette_new(256); + priv->pcmbuf = visual_buffer_new_allocate(512 * sizeof(float)); + + config_default(&config); + + __blursk_init(priv); + + return TRUE; } -static void act_blursk_cleanup (VisPluginData *plugin) -{ - BlurskPrivate *priv = visual_plugin_get_private (plugin); +static void act_blursk_cleanup(VisPluginData *plugin) { + BlurskPrivate *priv = visual_plugin_get_private(plugin); - __blursk_cleanup (priv); + __blursk_cleanup(priv); - visual_palette_free (priv->pal); + visual_palette_free(priv->pal); - visual_buffer_unref (priv->pcmbuf); + visual_buffer_unref(priv->pcmbuf); - visual_mem_free (priv); + visual_mem_free(priv); } -static void act_blursk_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void act_blursk_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - while (reqw % 4) - reqw--; + while (reqw % 4) + reqw--; - while (reqh % 2) - reqh--; + while (reqh % 2) + reqh--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static void act_blursk_resize (VisPluginData *plugin, int width, int height) -{ - BlurskPrivate *priv = visual_plugin_get_private (plugin); +static void act_blursk_resize(VisPluginData *plugin, int width, int height) { + BlurskPrivate *priv = visual_plugin_get_private(plugin); - priv->width = width; - priv->height = height; + priv->width = width; + priv->height = height; - config.height = height; - config.width = width; + config.height = height; + config.width = width; } -static int act_blursk_events (VisPluginData *plugin, VisEventQueue *events) -{ - BlurskPrivate *priv = visual_plugin_get_private (plugin); - VisEvent ev; - VisParam *param; - VisSongInfo *newsong; - - int size_update = 0; - - /* reset regen-colmap-flag */ - priv->update_colmap = 0; - - while(visual_event_queue_poll(events, &ev)) - { - switch(ev.type) - { - - case VISUAL_EVENT_RESIZE: - act_blursk_resize (plugin, ev.event.resize.width, ev.event.resize.height); - size_update = 1; - break; - - - case VISUAL_EVENT_PARAM: - param = ev.event.param.param; - /* change config parameter */ - config_change_param(priv, param); - break; - - case VISUAL_EVENT_NEWSONG: - newsong = ev.event.newsong.songinfo; - /* pass along the song info to blursk's core */ - blursk_event_newsong(newsong); - break; - default: - break; - } +static int act_blursk_events(VisPluginData *plugin, VisEventQueue *events) { + BlurskPrivate *priv = visual_plugin_get_private(plugin); + VisEvent ev; + VisParam *param; + VisSongInfo *newsong; + + int size_update = 0; + + /* reset regen-colmap-flag */ + priv->update_colmap = 0; + + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + + case VISUAL_EVENT_RESIZE: + act_blursk_resize(plugin, ev.event.resize.width, ev.event.resize.height); + size_update = 1; + break; + + case VISUAL_EVENT_PARAM: + param = ev.event.param.param; + /* change config parameter */ + config_change_param(priv, param); + break; + + case VISUAL_EVENT_NEWSONG: + newsong = ev.event.newsong.songinfo; + /* pass along the song info to blursk's core */ + blursk_event_newsong(newsong); + break; + default: + break; } + } - /* re-generate config string */ - //if(priv->update_config_string) - // config_string_genstring(priv); + /* re-generate config string */ + // if(priv->update_config_string) + // config_string_genstring(priv); - /* regenerate palette */ - if(priv->update_colmap) - color_genmap(priv, FALSE); + /* regenerate palette */ + if (priv->update_colmap) + color_genmap(priv, FALSE); - /* resize plugin */ - if(size_update) - img_resize(priv, config.width, config.height); + /* resize plugin */ + if (size_update) + img_resize(priv, config.width, config.height); - return TRUE; + return TRUE; } -static VisPalette *act_blursk_palette (VisPluginData *plugin) -{ - BlurskPrivate *priv = visual_plugin_get_private (plugin); +static VisPalette *act_blursk_palette(VisPluginData *plugin) { + BlurskPrivate *priv = visual_plugin_get_private(plugin); - return priv->pal; + return priv->pal; } -static void act_blursk_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - BlurskPrivate *priv = visual_plugin_get_private (plugin); +static void act_blursk_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + BlurskPrivate *priv = visual_plugin_get_private(plugin); - int16_t tpcm[512]; - float *pcm; + int16_t tpcm[512]; + float *pcm; - priv->video = video; + priv->video = video; - visual_audio_get_sample_mixed_simple (audio, priv->pcmbuf, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); + visual_audio_get_sample_mixed_simple(audio, priv->pcmbuf, 2, + VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); - pcm = visual_buffer_get_data(priv->pcmbuf); + pcm = visual_buffer_get_data(priv->pcmbuf); - int i; - for(i = 0; i < sizeof(tpcm)/sizeof(int16_t); i++) - tpcm[i] = (int16_t) (pcm[i]*32767); + int i; + for (i = 0; i < sizeof(tpcm) / sizeof(int16_t); i++) + tpcm[i] = (int16_t)(pcm[i] * 32767); - __blursk_render_pcm (priv, tpcm); + __blursk_render_pcm(priv, tpcm); - visual_mem_copy (visual_video_get_pixels (video), priv->rgb_buf, visual_video_get_size (video)); + visual_mem_copy(visual_video_get_pixels(video), priv->rgb_buf, + visual_video_get_size(video)); } diff --git a/libvisual-plugins/plugins/actor/blursk/actor_blursk.h b/libvisual-plugins/plugins/actor/blursk/actor_blursk.h index 0a6bfb244..6564e76d6 100644 --- a/libvisual-plugins/plugins/actor/blursk/actor_blursk.h +++ b/libvisual-plugins/plugins/actor/blursk/actor_blursk.h @@ -24,18 +24,18 @@ #include typedef struct { - int height; - int width; - /* true if colormap should be regenerated */ - int update_colmap; - VisPalette *pal; - uint8_t *rgb_buf; - VisVideo *video; - VisBuffer *pcmbuf; - VisRandomContext *rcontext; - VisColor color; - VisPluginData *plugin; - int update_config_string; + int height; + int width; + /* true if colormap should be regenerated */ + int update_colmap; + VisPalette *pal; + uint8_t *rgb_buf; + VisVideo *video; + VisBuffer *pcmbuf; + VisRandomContext *rcontext; + VisColor color; + VisPluginData *plugin; + int update_config_string; } BlurskPrivate; #endif /* _LV_ACTOR_BLURSK_H */ diff --git a/libvisual-plugins/plugins/actor/blursk/bitmap.c b/libvisual-plugins/plugins/actor/blursk/bitmap.c index 45b9eb147..f313ea491 100644 --- a/libvisual-plugins/plugins/actor/blursk/bitmap.c +++ b/libvisual-plugins/plugins/actor/blursk/bitmap.c @@ -44,7 +44,8 @@ #include "actor_blursk.h" #include "blursk.h" -#define XBM_TEST(w,bits,x,y) ((bits)[(((w) + 7) >> 3) * (y) + ((x) >> 3)] & (1 << ((x) & 7))) +#define XBM_TEST(w, bits, x, y) \ + ((bits)[(((w) + 7) >> 3) * (y) + ((x) >> 3)] & (1 << ((x)&7))) #include "bitmaps/redhat.xbm" #include "bitmaps/suse.xbm" @@ -61,193 +62,174 @@ #include "bitmaps/bob.xbm" static struct bdx_s { - char *flashname; /* name, when used in a flash */ - char *stencilname; /* name, when used in a stencil */ - int width, height; /* size of bitmap */ - unsigned char *bits; /* bitmap data */ -} bitmaps[] = -{ - { "Red Hat flash", "Red Hat stencil", redhat_width, redhat_height, redhat_bits}, - { "SuSE flash", "SuSE stencil", suse_width, suse_height, suse_bits}, - { "Blursk flash", "Blursk stencil", blursk_width, blursk_height, blursk_bits}, - { "Tux flash", "Tux stencil", tux_width, tux_height, tux_bits}, - { "XMMS flash", "XMMS stencil", xmms_width, xmms_height, xmms_bits}, - { "X flash", "X stencil", xlogo_width, xlogo_height, xlogo_bits}, - { "Gnome flash", "Gnome stencil", gnome_width, gnome_height, gnome_bits}, - { "Notes flash", "Notes stencil", notes_width, notes_height, notes_bits}, - { "Clef flash", "Clef stencil", clef_width, clef_height, clef_bits}, - { "Flower flash", "Flower stencil", flower_width, flower_height, flower_bits}, - { "Peace flash", "Peace stencil", peace_width, peace_height, peace_bits}, - { "Question flash", "Question stencil", question_width, question_height,question_bits}, - { "Bob flash", "Bob stencil", bob_width, bob_height, bob_bits} -}; - + char *flashname; /* name, when used in a flash */ + char *stencilname; /* name, when used in a stencil */ + int width, height; /* size of bitmap */ + unsigned char *bits; /* bitmap data */ +} bitmaps[] = { + {"Red Hat flash", "Red Hat stencil", redhat_width, redhat_height, + redhat_bits}, + {"SuSE flash", "SuSE stencil", suse_width, suse_height, suse_bits}, + {"Blursk flash", "Blursk stencil", blursk_width, blursk_height, + blursk_bits}, + {"Tux flash", "Tux stencil", tux_width, tux_height, tux_bits}, + {"XMMS flash", "XMMS stencil", xmms_width, xmms_height, xmms_bits}, + {"X flash", "X stencil", xlogo_width, xlogo_height, xlogo_bits}, + {"Gnome flash", "Gnome stencil", gnome_width, gnome_height, gnome_bits}, + {"Notes flash", "Notes stencil", notes_width, notes_height, notes_bits}, + {"Clef flash", "Clef stencil", clef_width, clef_height, clef_bits}, + {"Flower flash", "Flower stencil", flower_width, flower_height, + flower_bits}, + {"Peace flash", "Peace stencil", peace_width, peace_height, peace_bits}, + {"Question flash", "Question stencil", question_width, question_height, + question_bits}, + {"Bob flash", "Bob stencil", bob_width, bob_height, bob_bits}}; /* If str is the name of a bitmap followed by some other word, then return the * bitmap's index; else return -1. */ -int bitmap_index(char *str) -{ - int bindex; - - /* Treat "Maybe stencil" as though it was "Random stencil" or - * "No stencil", randomly. +int bitmap_index(char *str) { + int bindex; + + /* Treat "Maybe stencil" as though it was "Random stencil" or + * "No stencil", randomly. + */ + if (!strcmp(str, "Maybe stencil")) { + bindex = rand_0_to(QTY(bitmaps) * 5); + if (bindex >= QTY(bitmaps)) + bindex = -1; + return bindex; + } + + /* Accept "Random" as though it was a valid name */ + if (!strncmp(str, "Random ", 7)) { + /* If we're using a random stencil then treat any other "Random" + * bitmap as a synonym for the stencil bitmap. */ - if (!strcmp(str, "Maybe stencil")) - { - bindex = rand_0_to(QTY(bitmaps) * 5); - if (bindex >= QTY(bitmaps)) - bindex = -1; - return bindex; - } - - /* Accept "Random" as though it was a valid name */ - if (!strncmp(str, "Random ", 7)) - { - /* If we're using a random stencil then treat any other "Random" - * bitmap as a synonym for the stencil bitmap. - */ - if ((!strcmp(config.blur_stencil, "Random stencil") - || !strcmp(config.blur_stencil, "Maybe stencil")) - && blur_stencil != -1 - && strcmp(str, "Random stencil")) - return blur_stencil; - - /* Otherwise, this can be any bitmap */ - return rand_0_to(QTY(bitmaps)); - } - - /* Scan through bitmaps[] for the name */ - for (bindex = 0; bindex < QTY(bitmaps); bindex++) - { - if (!strcmp(bitmaps[bindex].flashname, str) - || !strcmp(bitmaps[bindex].stencilname, str)) - return bindex; - } - - /* unknown bitmap */ - return -1; + if ((!strcmp(config.blur_stencil, "Random stencil") || + !strcmp(config.blur_stencil, "Maybe stencil")) && + blur_stencil != -1 && strcmp(str, "Random stencil")) + return blur_stencil; + + /* Otherwise, this can be any bitmap */ + return rand_0_to(QTY(bitmaps)); + } + + /* Scan through bitmaps[] for the name */ + for (bindex = 0; bindex < QTY(bitmaps); bindex++) { + if (!strcmp(bitmaps[bindex].flashname, str) || + !strcmp(bitmaps[bindex].stencilname, str)) + return bindex; + } + + /* unknown bitmap */ + return -1; } - /* Return FALSE for background pixels, TRUE for foreground pixels */ -int bitmap_test(int bindex, int x, int y) -{ - int factor; - static int xnum, xdenom, xtrans; - static int ynum, ydenom, ytrans; - static int prevwidth, prevheight; - static struct bdx_s *bdx; - - /* If first time, then precompute some scaling factors */ - if (prevwidth != img_width || prevheight != img_height || bdx != &bitmaps[bindex]) - { - /* remember the screen size, so we can skip this next time */ - prevwidth = img_width; - prevheight = img_height; - bdx = &bitmaps[bindex]; - - /* For the "Medium CPU" setting, tweak the aspect ratio. */ - if (*config.cpu_speed == 'M') - factor = 2; - else - factor = 1; - - /* Compute the conversion factors, maintaining the same aspect - * ratio. (including the above tweak) - */ - if (img_width * bdx->height * factor < img_height * bdx->width) - { - /* Scale so width matches exactly */ - xnum = bdx->width; - xdenom = img_width; - xtrans = 0; - ynum = bdx->width; - ydenom = img_width * factor; - ytrans = ((int)img_height - bdx->height * ydenom / ynum) / 2; - } - else - { - /* Scale so height matches exactly */ - xnum = bdx->height * factor; - xdenom = img_height; - xtrans = ((int)img_width - bdx->width * xdenom / xnum) / 2; - ynum = bdx->height; - ydenom = img_height; - ytrans = 0; - } - } - - /* Scale (x,y) to fit the bitmap into the window. */ - x = (x - xtrans) * xnum / xdenom; - y = (y - ytrans) * ynum / ydenom; - - /* if in bitmap, and the bit is set, then return TRUE. Else FALSE */ - if (x >= 0 && x < bdx->width && y >= 0 && y < bdx->height - && XBM_TEST(bdx->width, bdx->bits, x, y)) - { - return TRUE; +int bitmap_test(int bindex, int x, int y) { + int factor; + static int xnum, xdenom, xtrans; + static int ynum, ydenom, ytrans; + static int prevwidth, prevheight; + static struct bdx_s *bdx; + + /* If first time, then precompute some scaling factors */ + if (prevwidth != img_width || prevheight != img_height || + bdx != &bitmaps[bindex]) { + /* remember the screen size, so we can skip this next time */ + prevwidth = img_width; + prevheight = img_height; + bdx = &bitmaps[bindex]; + + /* For the "Medium CPU" setting, tweak the aspect ratio. */ + if (*config.cpu_speed == 'M') + factor = 2; + else + factor = 1; + + /* Compute the conversion factors, maintaining the same aspect + * ratio. (including the above tweak) + */ + if (img_width * bdx->height * factor < img_height * bdx->width) { + /* Scale so width matches exactly */ + xnum = bdx->width; + xdenom = img_width; + xtrans = 0; + ynum = bdx->width; + ydenom = img_width * factor; + ytrans = ((int)img_height - bdx->height * ydenom / ynum) / 2; + } else { + /* Scale so height matches exactly */ + xnum = bdx->height * factor; + xdenom = img_height; + xtrans = ((int)img_width - bdx->width * xdenom / xnum) / 2; + ynum = bdx->height; + ydenom = img_height; + ytrans = 0; } - return FALSE; + } + + /* Scale (x,y) to fit the bitmap into the window. */ + x = (x - xtrans) * xnum / xdenom; + y = (y - ytrans) * ynum / ydenom; + + /* if in bitmap, and the bit is set, then return TRUE. Else FALSE */ + if (x >= 0 && x < bdx->width && y >= 0 && y < bdx->height && + XBM_TEST(bdx->width, bdx->bits, x, y)) { + return TRUE; + } + return FALSE; } - - /* Perform a flash by drawing a logo on the screen */ -void bitmap_flash(int bindex) -{ - int x, y; - unsigned char *pixel; - - for (y = 0, pixel = img_buf; y < img_height; y++, pixel += img_bpl - img_width) - for (x = 0; x < img_width; x++, pixel++) - if (bitmap_test(bindex, x, y)) - *pixel = 160; +void bitmap_flash(int bindex) { + int x, y; + unsigned char *pixel; + + for (y = 0, pixel = img_buf; y < img_height; + y++, pixel += img_bpl - img_width) + for (x = 0; x < img_width; x++, pixel++) + if (bitmap_test(bindex, x, y)) + *pixel = 160; } +/* Return the names of logo flashes, and other flash styles */ +char *bitmap_flash_name(int i) { + switch (i) { + case 0: + return "No flash"; + case QTY(bitmaps) + 1: + return "Random flash"; -/* Return the names of logo flashes, and other flash styles */ -char *bitmap_flash_name(int i) -{ - switch (i) - { - case 0: - return "No flash"; - - case QTY(bitmaps) + 1: - return "Random flash"; - - case QTY(bitmaps) + 2: - return "Full flash"; - - case QTY(bitmaps) + 3: - return "Invert flash"; - - default: - if (i > QTY(bitmaps)) - return NULL; - return bitmaps[i - 1].flashname; - } -} + case QTY(bitmaps) + 2: + return "Full flash"; + case QTY(bitmaps) + 3: + return "Invert flash"; -char *bitmap_stencil_name(int i) -{ - switch (i) - { - case 0: - return "No stencil"; + default: + if (i > QTY(bitmaps)) + return NULL; + return bitmaps[i - 1].flashname; + } +} - case QTY(bitmaps) + 1: - return "Random stencil"; +char *bitmap_stencil_name(int i) { + switch (i) { + case 0: + return "No stencil"; - case QTY(bitmaps) + 2: - return "Maybe stencil"; + case QTY(bitmaps) + 1: + return "Random stencil"; - default: - if (i > QTY(bitmaps)) - return NULL; - return bitmaps[i - 1].stencilname; - } + case QTY(bitmaps) + 2: + return "Maybe stencil"; + + default: + if (i > QTY(bitmaps)) + return NULL; + return bitmaps[i - 1].stencilname; + } } diff --git a/libvisual-plugins/plugins/actor/blursk/blur.c b/libvisual-plugins/plugins/actor/blursk/blur.c index 9e54c1c3e..f42de1174 100644 --- a/libvisual-plugins/plugins/actor/blursk/blur.c +++ b/libvisual-plugins/plugins/actor/blursk/blur.c @@ -54,7 +54,7 @@ typedef enum { LOWER_NO, LOWER_YES, LOWER_SPECTRUM } lower_t; * "Random" or "Random & fast" blur styles are used. */ #define KEEP_RANDOM_SLOW 300 -#define KEEP_RANDOM 30 +#define KEEP_RANDOM 30 /* This is the maximum number of microseconds to use in each frame for * computing blur motion vectors. This computation only occurs when @@ -64,7 +64,7 @@ typedef enum { LOWER_NO, LOWER_YES, LOWER_SPECTRUM } lower_t; * amount prevents that, by spreading the transition among more frames. * In effect, it turns a "Fast switch" into a "Slow switch" if necessary. */ -#define MAXUSEC 10000 +#define MAXUSEC 10000 /* These control the transition dithering. MAXTRANSITION is any convenient * number (preferably prime), and dither[] is simply a shuffled list of all @@ -72,94 +72,66 @@ typedef enum { LOWER_NO, LOWER_YES, LOWER_SPECTRUM } lower_t; */ #if 1 #define MAXTRANSITION 571 -static int dither[MAXTRANSITION] = -{ - 1, 235, 36, 63, 520, 112, 191, 438, 451, 368, - 272, 57, 208, 293, 543, 523, 362, 409, 545, 346, - 429, 138, 71, 247, 89, 228, 74, 553, 274, 394, - 395, 0, 349, 164, 364, 299, 320, 555, 167, 156, - 106, 117, 127, 209, 155, 201, 461, 524, 440, 51, - 265, 542, 273, 387, 508, 199, 256, 359, 120, 56, - 136, 342, 7, 270, 550, 377, 214, 434, 66, 325, - 303, 86, 249, 532, 531, 393, 162, 221, 326, 116, - 392, 94, 558, 502, 14, 188, 340, 476, 449, 198, - 163, 336, 306, 206, 250, 32, 419, 465, 390, 4, - 144, 322, 111, 93, 245, 253, 170, 480, 279, 105, - 448, 175, 255, 288, 92, 259, 154, 237, 212, 517, - 81, 78, 282, 67, 562, 533, 435, 220, 77, 210, - 213, 39, 217, 87, 510, 418, 121, 145, 490, 82, - 25, 560, 124, 297, 275, 453, 8, 430, 456, 487, - 530, 351, 378, 421, 143, 161, 307, 317, 263, 224, - 327, 431, 142, 546, 345, 115, 423, 352, 569, 50, - 497, 439, 181, 244, 486, 108, 21, 223, 495, 159, - 44, 315, 330, 258, 24, 295, 150, 231, 278, 19, - 329, 335, 232, 343, 491, 192, 195, 528, 252, 474, - 559, 424, 27, 45, 380, 52, 183, 318, 507, 509, - 370, 102, 193, 38, 400, 205, 432, 452, 298, 37, - 148, 371, 291, 61, 468, 356, 410, 152, 471, 443, - 539, 257, 203, 484, 262, 88, 234, 341, 196, 139, - 385, 100, 241, 219, 348, 473, 355, 72, 475, 285, - 384, 34, 289, 503, 347, 567, 69, 216, 557, 157, - 103, 396, 372, 3, 310, 40, 374, 500, 513, 64, - 240, 176, 178, 229, 204, 420, 442, 242, 354, 551, - 29, 319, 514, 334, 324, 397, 547, 186, 436, 399, - 381, 149, 361, 276, 549, 286, 470, 165, 137, 312, - 379, 516, 403, 499, 466, 10, 375, 141, 493, 172, - 304, 233, 407, 54, 113, 79, 415, 450, 360, 309, - 478, 413, 123, 98, 483, 290, 365, 564, 281, 73, - 544, 107, 189, 350, 35, 501, 23, 376, 254, 302, - 540, 171, 554, 369, 84, 26, 180, 109, 226, 230, - 467, 433, 337, 131, 95, 18, 504, 187, 15, 227, - 344, 339, 207, 91, 556, 70, 469, 425, 541, 11, - 457, 153, 248, 386, 488, 99, 128, 308, 494, 537, - 570, 296, 563, 404, 261, 65, 53, 238, 185, 140, - 447, 31, 46, 411, 76, 398, 126, 445, 184, 482, - 90, 311, 518, 496, 135, 271, 85, 12, 190, 382, - 9, 292, 101, 130, 239, 16, 300, 388, 173, 17, - 28, 166, 122, 313, 561, 6, 236, 97, 60, 194, - 174, 444, 357, 147, 49, 323, 129, 125, 515, 485, - 446, 406, 197, 338, 215, 459, 132, 218, 114, 200, - 202, 158, 333, 511, 522, 428, 119, 55, 58, 260, - 13, 462, 33, 521, 565, 373, 110, 481, 412, 416, - 492, 269, 405, 267, 512, 548, 134, 80, 59, 460, - 284, 179, 498, 264, 479, 427, 454, 552, 2, 489, - 314, 316, 417, 535, 455, 463, 506, 366, 83, 287, - 441, 41, 301, 160, 363, 519, 505, 566, 146, 305, - 414, 529, 525, 43, 472, 458, 536, 266, 280, 383, - 222, 568, 534, 328, 47, 401, 367, 332, 246, 389, - 22, 277, 391, 527, 243, 133, 331, 75, 225, 437, - 321, 464, 48, 104, 402, 151, 30, 5, 42, 538, - 96, 353, 268, 62, 182, 68, 526, 422, 251, 294, - 211, 426, 20, 118, 283, 177, 477, 358, 168, 408, - 169 -}; +static int dither[MAXTRANSITION] = { + 1, 235, 36, 63, 520, 112, 191, 438, 451, 368, 272, 57, 208, 293, 543, + 523, 362, 409, 545, 346, 429, 138, 71, 247, 89, 228, 74, 553, 274, 394, + 395, 0, 349, 164, 364, 299, 320, 555, 167, 156, 106, 117, 127, 209, 155, + 201, 461, 524, 440, 51, 265, 542, 273, 387, 508, 199, 256, 359, 120, 56, + 136, 342, 7, 270, 550, 377, 214, 434, 66, 325, 303, 86, 249, 532, 531, + 393, 162, 221, 326, 116, 392, 94, 558, 502, 14, 188, 340, 476, 449, 198, + 163, 336, 306, 206, 250, 32, 419, 465, 390, 4, 144, 322, 111, 93, 245, + 253, 170, 480, 279, 105, 448, 175, 255, 288, 92, 259, 154, 237, 212, 517, + 81, 78, 282, 67, 562, 533, 435, 220, 77, 210, 213, 39, 217, 87, 510, + 418, 121, 145, 490, 82, 25, 560, 124, 297, 275, 453, 8, 430, 456, 487, + 530, 351, 378, 421, 143, 161, 307, 317, 263, 224, 327, 431, 142, 546, 345, + 115, 423, 352, 569, 50, 497, 439, 181, 244, 486, 108, 21, 223, 495, 159, + 44, 315, 330, 258, 24, 295, 150, 231, 278, 19, 329, 335, 232, 343, 491, + 192, 195, 528, 252, 474, 559, 424, 27, 45, 380, 52, 183, 318, 507, 509, + 370, 102, 193, 38, 400, 205, 432, 452, 298, 37, 148, 371, 291, 61, 468, + 356, 410, 152, 471, 443, 539, 257, 203, 484, 262, 88, 234, 341, 196, 139, + 385, 100, 241, 219, 348, 473, 355, 72, 475, 285, 384, 34, 289, 503, 347, + 567, 69, 216, 557, 157, 103, 396, 372, 3, 310, 40, 374, 500, 513, 64, + 240, 176, 178, 229, 204, 420, 442, 242, 354, 551, 29, 319, 514, 334, 324, + 397, 547, 186, 436, 399, 381, 149, 361, 276, 549, 286, 470, 165, 137, 312, + 379, 516, 403, 499, 466, 10, 375, 141, 493, 172, 304, 233, 407, 54, 113, + 79, 415, 450, 360, 309, 478, 413, 123, 98, 483, 290, 365, 564, 281, 73, + 544, 107, 189, 350, 35, 501, 23, 376, 254, 302, 540, 171, 554, 369, 84, + 26, 180, 109, 226, 230, 467, 433, 337, 131, 95, 18, 504, 187, 15, 227, + 344, 339, 207, 91, 556, 70, 469, 425, 541, 11, 457, 153, 248, 386, 488, + 99, 128, 308, 494, 537, 570, 296, 563, 404, 261, 65, 53, 238, 185, 140, + 447, 31, 46, 411, 76, 398, 126, 445, 184, 482, 90, 311, 518, 496, 135, + 271, 85, 12, 190, 382, 9, 292, 101, 130, 239, 16, 300, 388, 173, 17, + 28, 166, 122, 313, 561, 6, 236, 97, 60, 194, 174, 444, 357, 147, 49, + 323, 129, 125, 515, 485, 446, 406, 197, 338, 215, 459, 132, 218, 114, 200, + 202, 158, 333, 511, 522, 428, 119, 55, 58, 260, 13, 462, 33, 521, 565, + 373, 110, 481, 412, 416, 492, 269, 405, 267, 512, 548, 134, 80, 59, 460, + 284, 179, 498, 264, 479, 427, 454, 552, 2, 489, 314, 316, 417, 535, 455, + 463, 506, 366, 83, 287, 441, 41, 301, 160, 363, 519, 505, 566, 146, 305, + 414, 529, 525, 43, 472, 458, 536, 266, 280, 383, 222, 568, 534, 328, 47, + 401, 367, 332, 246, 389, 22, 277, 391, 527, 243, 133, 331, 75, 225, 437, + 321, 464, 48, 104, 402, 151, 30, 5, 42, 538, 96, 353, 268, 62, 182, + 68, 526, 422, 251, 294, 211, 426, 20, 118, 283, 177, 477, 358, 168, 408, + 169}; #else #define MAXTRANSITION 149 -static int dither[MAXTRANSITION] = -{ - 125, 58, 57, 118, 135, 10, 49, 19, 41, 42, - 48, 140, 51, 76, 141, 46, 27, 106, 47, 26, - 22, 36, 62, 24, 74, 3, 61, 8, 45, 32, - 13, 0, 53, 67, 105, 145, 87, 144, 43, 64, - 35, 115, 1, 130, 25, 111, 120, 15, 71, 85, - 40, 55, 88, 98, 129, 66, 82, 11, 68, 96, - 78, 37, 77, 126, 75, 34, 112, 113, 30, 99, - 79, 100, 80, 122, 18, 107, 33, 143, 95, 148, - 102, 119, 2, 131, 123, 14, 16, 12, 70, 65, - 142, 133, 108, 127, 9, 17, 56, 28, 101, 4, - 29, 63, 6, 50, 116, 83, 137, 7, 97, 147, - 117, 31, 54, 84, 94, 109, 72, 134, 124, 69, - 136, 21, 138, 44, 146, 139, 91, 20, 52, 38, - 132, 86, 5, 73, 104, 39, 92, 59, 81, 128, - 93, 89, 114, 110, 90, 60, 103, 23, 121 -}; +static int dither[MAXTRANSITION] = { + 125, 58, 57, 118, 135, 10, 49, 19, 41, 42, 48, 140, 51, 76, 141, + 46, 27, 106, 47, 26, 22, 36, 62, 24, 74, 3, 61, 8, 45, 32, + 13, 0, 53, 67, 105, 145, 87, 144, 43, 64, 35, 115, 1, 130, 25, + 111, 120, 15, 71, 85, 40, 55, 88, 98, 129, 66, 82, 11, 68, 96, + 78, 37, 77, 126, 75, 34, 112, 113, 30, 99, 79, 100, 80, 122, 18, + 107, 33, 143, 95, 148, 102, 119, 2, 131, 123, 14, 16, 12, 70, 65, + 142, 133, 108, 127, 9, 17, 56, 28, 101, 4, 29, 63, 6, 50, 116, + 83, 137, 7, 97, 147, 117, 31, 54, 84, 94, 109, 72, 134, 124, 69, + 136, 21, 138, 44, 146, 139, 91, 20, 52, 38, 132, 86, 5, 73, 104, + 39, 92, 59, 81, 128, 93, 89, 114, 110, 90, 60, 103, 23, 121}; #endif /* These store random numbers that are held constant for all pixels in a * given blur style. Each blur function can use up to MAXRANDOM random * numbers when generating pixel motion vectors. */ -#define MAXRANDOM 64 +#define MAXRANDOM 64 static int randval[MAXRANDOM]; /* The "Slow switch" setting performs less that one transition loop per frame. @@ -169,23 +141,23 @@ static int randval[MAXRANDOM]; #define SWITCH_FRACTION 3 /* These store the source offsets for the blurloop function. */ -static int blurwidth, blurheight; -static int blurxcenter, blurycenter; -static int blurlast; +static int blurwidth, blurheight; +static int blurxcenter, blurycenter; +static int blurlast; /* These are used to compute the transition from one blur style to another */ static char stylename[50]; static char stencilname[50]; static char blurname[50]; -static int isspectrum; /* boolean: is current signal_style a spectrum? */ -static char blurchar; /* first letter of blurname, or random */ -static int (*stylefunc)(int offset); -static int styletransition = -1; -static int stylekeeprandom; -static int stylelower, styleprevlower; +static int isspectrum; /* boolean: is current signal_style a spectrum? */ +static char blurchar; /* first letter of blurname, or random */ +static int (*stylefunc)(int offset); +static int styletransition = -1; +static int stylekeeprandom; +static int stylelower, styleprevlower; /* This is used to help hide anomalies from some of the blur styles */ -static int salt; +static int salt; /** * This stores the id of the current stencil bitmap, or -1 for no bitmap. @@ -207,118 +179,132 @@ static int blurintostencil; * blur motions may seem to vibrate; with it turned on, large areas which * should be smooth may appear to have a checkerboard pattern. */ - static int edgesmooth; - +static int edgesmooth; /** - * every pixel is blurred from the pixels around it + * every pixel is blurred from the pixels around it */ -static int simple(int offset) -{ - if (randval[0] == 0) - return 0; - switch (randval[0] & 0x7) - { - case 0: return 1; - case 1: return img_bpl + 1; - case 2: return img_bpl; - case 3: return img_bpl - 1; - case 4: return -1; - case 5: return -img_bpl - 1; - case 6: return -img_bpl; - default: return -img_bpl + 1; - } +static int simple(int offset) { + if (randval[0] == 0) + return 0; + switch (randval[0] & 0x7) { + case 0: + return 1; + case 1: + return img_bpl + 1; + case 2: + return img_bpl; + case 3: + return img_bpl - 1; + case 4: + return -1; + case 5: + return -img_bpl - 1; + case 6: + return -img_bpl; + default: + return -img_bpl + 1; + } } /** - * every pixel is blurred from pixels surrounding a neighbor + * every pixel is blurred from pixels surrounding a neighbor */ -static int grainy(int offset) -{ - if (++salt >= 14) salt = 0; - switch (salt) - { - case 0: return -img_bpl - 1; - case 1: return -img_bpl; - case 2: return -img_bpl + 1; - case 3: return 1; - case 4: return img_bpl + 1; - case 5: return img_bpl; - case 6: return img_bpl - 1; - case 7: return -1; - case 8: return img_bpl + 2; - case 9: return 2; - case 10: return img_bpl - 2; - case 11: return -img_bpl - 2; - case 12: return -2; - default: return -img_bpl + 2; - } +static int grainy(int offset) { + if (++salt >= 14) + salt = 0; + switch (salt) { + case 0: + return -img_bpl - 1; + case 1: + return -img_bpl; + case 2: + return -img_bpl + 1; + case 3: + return 1; + case 4: + return img_bpl + 1; + case 5: + return img_bpl; + case 6: + return img_bpl - 1; + case 7: + return -1; + case 8: + return img_bpl + 2; + case 9: + return 2; + case 10: + return img_bpl - 2; + case 11: + return -img_bpl - 2; + case 12: + return -2; + default: + return -img_bpl + 2; + } } /** - * Pixels go up, down, left, and right + * Pixels go up, down, left, and right */ -static int fourway(int offset) -{ - int x, y; - - x = offset % img_bpl; - y = offset / img_bpl; - switch (((y & 1) << 1) | (x & 1)) - { - case 0: return -2; - case 1: return 2 * img_bpl; - case 2: return -2 * img_bpl; - default: return 2; - } +static int fourway(int offset) { + int x, y; + + x = offset % img_bpl; + y = offset / img_bpl; + switch (((y & 1) << 1) | (x & 1)) { + case 0: + return -2; + case 1: + return 2 * img_bpl; + case 2: + return -2 * img_bpl; + default: + return 2; + } } /** * every pixel is blurred from pixels slightly below it, which causes the * blur to drift upward. */ -static int rise(int offset) -{ - return img_bpl; -} +static int rise(int offset) { return img_bpl; } -static int wiggle(int offset) -{ - int y = (offset / img_bpl) + (offset & 0x1); - if ((y & 0x0f) < 3) - return img_bpl; - else if (y & 0x10) - return img_bpl - 1; - else - return img_bpl + 1; +static int wiggle(int offset) { + int y = (offset / img_bpl) + (offset & 0x1); + if ((y & 0x0f) < 3) + return img_bpl; + else if (y & 0x10) + return img_bpl - 1; + else + return img_bpl + 1; } /** - * pixels above the middle blur up, and pixels below the middle blur down + * pixels above the middle blur up, and pixels below the middle blur down */ -static int updown(int offset) -{ - offset /= img_bpl; - if (offset < blurycenter) - return img_bpl; - else - return -img_bpl; +static int updown(int offset) { + offset /= img_bpl; + if (offset < blurycenter) + return img_bpl; + else + return -img_bpl; } /** - * pixels on the left move leftward, and pixels on the right move rightward + * pixels on the left move leftward, and pixels on the right move rightward */ -static int leftright(int offset) -{ - offset %= img_bpl; - if (offset < blurxcenter / 2) - return 2; - else if (offset < blurxcenter) - return 1; - else if (offset < (blurxcenter + blurwidth) / 2) - return -1; - else - return -2; +static int leftright(int offset) { + offset %= img_bpl; + if (offset < blurxcenter / 2) + return 2; + else if (offset < blurxcenter) + return 1; + else if (offset < (blurxcenter + blurwidth) / 2) + return -1; + else + return -2; } /** @@ -326,83 +312,82 @@ static int leftright(int offset) * to move outward. This is done in a way which causes the blur to move faster * near the edge. */ -static int forward(int offset) -{ - int x, y; - int dirx, diry; - - /* convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; - - /* Separate the sign from the magnitude. We must do this to get - * consistent behavior from the "/" operator in all quadrants. - */ - dirx = diry = 1; - if (x < 0) - dirx = -1, x = -x; - if (y < 0) - diry = -1, y = -y; - - /* Convert coordinates to source offset, by subtracting a scaled-down - * version of them from themselves. - */ - y -= (y * 63 + salt) / 64; - x -= (x * 63 + salt) / 64; - if (++salt >= 63) salt = 0; - - /* adjust for quadrants */ - y *= diry; - x *= dirx; - - /* return the offset of the source point, relative to this one */ - return -y * img_bpl - x; +static int forward(int offset) { + int x, y; + int dirx, diry; + + /* convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; + + /* Separate the sign from the magnitude. We must do this to get + * consistent behavior from the "/" operator in all quadrants. + */ + dirx = diry = 1; + if (x < 0) + dirx = -1, x = -x; + if (y < 0) + diry = -1, y = -y; + + /* Convert coordinates to source offset, by subtracting a scaled-down + * version of them from themselves. + */ + y -= (y * 63 + salt) / 64; + x -= (x * 63 + salt) / 64; + if (++salt >= 63) + salt = 0; + + /* adjust for quadrants */ + y *= diry; + x *= dirx; + + /* return the offset of the source point, relative to this one */ + return -y * img_bpl - x; } /** - * A more extreme version of forward() + * A more extreme version of forward() */ -static int fastfwd(int offset) -{ - int x, y; - int dirx, diry; - - /* convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; - - /* Separate the sign from the magnitude. We must do this to get - * consistent behavior from the "/" operator in all quadrants. - */ - dirx = diry = 1; - if (x < 0) - dirx = -1, x = -x; - if (y < 0) - diry = -1, y = -y; - - /* Convert coordinates to source offset, by subtracting a scaled-down - * version of them from themselves. - */ - y -= (y * 15 + salt) >> 4; - x -= (x * 15 + salt) >> 4; - if (++salt >= 16) salt = 0; - - /* adjust for quadrants */ - y *= diry; - x *= dirx; - - /* return the offset of the source point, relative to this one */ - return -y * img_bpl - x; +static int fastfwd(int offset) { + int x, y; + int dirx, diry; + + /* convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; + + /* Separate the sign from the magnitude. We must do this to get + * consistent behavior from the "/" operator in all quadrants. + */ + dirx = diry = 1; + if (x < 0) + dirx = -1, x = -x; + if (y < 0) + diry = -1, y = -y; + + /* Convert coordinates to source offset, by subtracting a scaled-down + * version of them from themselves. + */ + y -= (y * 15 + salt) >> 4; + x -= (x * 15 + salt) >> 4; + if (++salt >= 16) + salt = 0; + + /* adjust for quadrants */ + y *= diry; + x *= dirx; + + /* return the offset of the source point, relative to this one */ + return -y * img_bpl - x; } -static int spray(int offset) -{ - int x, y; - x = offset % img_bpl; - y = offset / img_bpl; - y >>= 1; - offset = y * img_bpl + x; - return forward(offset); +static int spray(int offset) { + int x, y; + x = offset % img_bpl; + y = offset / img_bpl; + y >>= 1; + offset = y * img_bpl + x; + return forward(offset); } /** @@ -410,501 +395,494 @@ static int spray(int offset) * to move inward. This is done in a way which causes the blur to move faster * near the edge. Also, it supports an optional random twisting motion. */ -static int backward(int offset) -{ - int x, y; - int dirx, diry; - static int wobble = 0, dir = 1; - - /* convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; - - /* adjust the wobble amount */ - if (randval[0] == 0) - wobble = 0; - else - { - if (randval[0] != 3) - { - if (wobble == -2) - dir = 1; - else if (wobble == 2) - dir = -1; - wobble += dir; - randval[0] = 3; - } +static int backward(int offset) { + int x, y; + int dirx, diry; + static int wobble = 0, dir = 1; + + /* convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; + + /* adjust the wobble amount */ + if (randval[0] == 0) + wobble = 0; + else { + if (randval[0] != 3) { + if (wobble == -2) + dir = 1; + else if (wobble == 2) + dir = -1; + wobble += dir; + randval[0] = 3; } - - /* spin the image slightly, based on a random number */ - diry = y; - switch (wobble) - { - case -2: - y += x; - x -= diry; - break; - - case -1: - y += (x>>1); - x -= (diry>>1); - break; - - case 0: - /* no twist */ - break; - - case 1: - y -= (x>>1); - x += (diry>>1); - break; - - case 2: - y -= x; - x += diry; - break; - } - - /* Separate the sign from the magnitude. We must do this to get - * consistent behavior from the "/" operator in all quadrants. - */ - dirx = diry = 1; - if (x < 0) - dirx = -1, x = -x; - if (y < 0) - diry = -1, y = -y; - - /* Convert coordinates to source offset, by subtracting a scaled-up - * version of them from themselves. - */ - y -= (y * 65 + salt) / 64; - x -= (x * 65 + salt) / 64; - if (++salt >= 63) salt = 0; - - /* adjust for quadrants */ - y *= diry; - x *= dirx; - - /* return the offset of the source point, relative to this one */ - return -y * img_bpl - x; + } + + /* spin the image slightly, based on a random number */ + diry = y; + switch (wobble) { + case -2: + y += x; + x -= diry; + break; + + case -1: + y += (x >> 1); + x -= (diry >> 1); + break; + + case 0: + /* no twist */ + break; + + case 1: + y -= (x >> 1); + x += (diry >> 1); + break; + + case 2: + y -= x; + x += diry; + break; + } + + /* Separate the sign from the magnitude. We must do this to get + * consistent behavior from the "/" operator in all quadrants. + */ + dirx = diry = 1; + if (x < 0) + dirx = -1, x = -x; + if (y < 0) + diry = -1, y = -y; + + /* Convert coordinates to source offset, by subtracting a scaled-up + * version of them from themselves. + */ + y -= (y * 65 + salt) / 64; + x -= (x * 65 + salt) / 64; + if (++salt >= 63) + salt = 0; + + /* adjust for quadrants */ + y *= diry; + x *= dirx; + + /* return the offset of the source point, relative to this one */ + return -y * img_bpl - x; } /** * This divides the screen into four quadrants, and then reduces & rotates * them to duplicate the image into each quadrant. */ -static int fractal(int offset) -{ - int x, y; +static int fractal(int offset) { + int x, y; - /* Compute the position within a quadrant, and then scale that quadrant - * up to the size of the whole image. - */ - x = (offset % img_bpl) * 2 % img_width; - y = (offset / img_bpl) * 2 % img_height; + /* Compute the position within a quadrant, and then scale that quadrant + * up to the size of the whole image. + */ + x = (offset % img_bpl) * 2 % img_width; + y = (offset / img_bpl) * 2 % img_height; - /* return that offset */ - return y * img_bpl + x - offset; + /* return that offset */ + return y * img_bpl + x - offset; } -static int sphere(int offset) -{ - int x, y; - int dist2; - int radius2; - double angle, through; - - /* Convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; - - /* For "Medium CPU", double X to preserve aspect ratio. For "Slow CPU" - * double both of them to preserve size. */ - if (*config.cpu_speed != 'F') - { - x *= 2; - if (*config.cpu_speed == 'S') - y *= 2; - } - - /* compute the square of the distance from the center. */ - dist2 = x * x + y * y; - radius2 = blurycenter * blurycenter; - if (*config.cpu_speed != 'S') - radius2 >>= 1; - else - radius2 <<= 1; - - /* If outside the "sphere" then use one of the other motions. */ - if (randval[0] != 0 && radius2 < dist2) - return fractal(offset); - - /* the center could cause problems -- just use 0 as the offset there */ - if (dist2 < 5) - return 0; +static int sphere(int offset) { + int x, y; + int dist2; + int radius2; + double angle, through; + + /* Convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; + + /* For "Medium CPU", double X to preserve aspect ratio. For "Slow CPU" + * double both of them to preserve size. */ + if (*config.cpu_speed != 'F') { + x *= 2; + if (*config.cpu_speed == 'S') + y *= 2; + } + + /* compute the square of the distance from the center. */ + dist2 = x * x + y * y; + radius2 = blurycenter * blurycenter; + if (*config.cpu_speed != 'S') + radius2 >>= 1; + else + radius2 <<= 1; + + /* If outside the "sphere" then use one of the other motions. */ + if (randval[0] != 0 && radius2 < dist2) + return fractal(offset); + + /* the center could cause problems -- just use 0 as the offset there */ + if (dist2 < 5) + return 0; - /* in the sphere, we want to go fast near the center, and slow near - * the edges. This is like forward() except that we want to translate - * the point through the center, by a distance of 1 radius. - */ - angle = atan2((double)y, (double)x); - through = sqrt((double)abs(radius2 - dist2) / 6.0); - if (radius2 < dist2) - through = -through; - x = blurxcenter + (int)(through * cos(angle)); - y = blurycenter + (int)(through * sin(angle)); - return fastfwd(y * img_bpl + x); + /* in the sphere, we want to go fast near the center, and slow near + * the edges. This is like forward() except that we want to translate + * the point through the center, by a distance of 1 radius. + */ + angle = atan2((double)y, (double)x); + through = sqrt((double)abs(radius2 - dist2) / 6.0); + if (radius2 < dist2) + through = -through; + x = blurxcenter + (int)(through * cos(angle)); + y = blurycenter + (int)(through * sin(angle)); + return fastfwd(y * img_bpl + x); } - /** - * rotate left, right, or both. + * rotate left, right, or both. */ -static int spinhelp(int offset, int right, int spiral, int twist) -{ - int x, y; - int dirx, diry; - int dx, dy; - int radius; - - /* convert offset to (x,y) coordinates */ - y = offset / img_bpl; - x = offset % img_bpl; - - if (right) - { - /* The right half of the top scanline, and the left half of - * the bottom scan line, both need to copy pixels from the - * other half of the scan line, to prevent "shadows" from - * the perimeter. - */ - if (y == 1 && x > blurxcenter + 12) - return blurxcenter; - if (y == 2 && x > blurxcenter + 20) - return -img_bpl - blurxcenter; - if (y == blurheight - 3 && x < blurxcenter - 20) - return img_bpl + blurxcenter; - if (y == blurheight - 2 && x < blurxcenter - 12) - return -blurxcenter; - } - else - { - /* The left half of the top scanline, and the right half of - * the bottom scan line, both need to copy pixels from the - * other half of the scan line, to prevent "shadows" from - * the perimeter. - */ - if (y == 1 && x < blurxcenter - 12) - return img_bpl + blurxcenter; - if (y == 2 && x < blurxcenter - 20) - return -blurxcenter; - if (y == blurheight - 3 && x > blurxcenter + 20) - return blurxcenter; - if (y == blurheight - 2 && x > blurxcenter + 12) - return -img_bpl - blurxcenter; - } - - /* Adjust so (0,0) is at center */ - y -= blurycenter; - x -= blurxcenter; - - /* Separate the sign from the magnitude. We must do this to get - * consistent behavior from the "/" operator in all quadrants. +static int spinhelp(int offset, int right, int spiral, int twist) { + int x, y; + int dirx, diry; + int dx, dy; + int radius; + + /* convert offset to (x,y) coordinates */ + y = offset / img_bpl; + x = offset % img_bpl; + + if (right) { + /* The right half of the top scanline, and the left half of + * the bottom scan line, both need to copy pixels from the + * other half of the scan line, to prevent "shadows" from + * the perimeter. */ - dirx = diry = 1; - if (x < 0) - dirx = -1, x = -x; - if (y < 0) - diry = -1, y = -y; - - /* Convert coordinates to source offsets. For the "Medium CPU" - * setting, we need to tweak the aspect ratio. + if (y == 1 && x > blurxcenter + 12) + return blurxcenter; + if (y == 2 && x > blurxcenter + 20) + return -img_bpl - blurxcenter; + if (y == blurheight - 3 && x < blurxcenter - 20) + return img_bpl + blurxcenter; + if (y == blurheight - 2 && x < blurxcenter - 12) + return -blurxcenter; + } else { + /* The left half of the top scanline, and the right half of + * the bottom scan line, both need to copy pixels from the + * other half of the scan line, to prevent "shadows" from + * the perimeter. */ - if (*config.cpu_speed == 'M') - { - x *= 2; - radius = x + y + 5; - if (twist) - { - if (radius < blurycenter * 2) - radius = blurycenter - radius/2; - else - radius = 5; - } - if (++salt >= radius * 2) salt = 0; - dx = (y * 2 + salt) / radius; - dy = (x * 4 + salt) / radius; + if (y == 1 && x < blurxcenter - 12) + return img_bpl + blurxcenter; + if (y == 2 && x < blurxcenter - 20) + return -blurxcenter; + if (y == blurheight - 3 && x > blurxcenter + 20) + return blurxcenter; + if (y == blurheight - 2 && x > blurxcenter + 12) + return -img_bpl - blurxcenter; + } + + /* Adjust so (0,0) is at center */ + y -= blurycenter; + x -= blurxcenter; + + /* Separate the sign from the magnitude. We must do this to get + * consistent behavior from the "/" operator in all quadrants. + */ + dirx = diry = 1; + if (x < 0) + dirx = -1, x = -x; + if (y < 0) + diry = -1, y = -y; + + /* Convert coordinates to source offsets. For the "Medium CPU" + * setting, we need to tweak the aspect ratio. + */ + if (*config.cpu_speed == 'M') { + x *= 2; + radius = x + y + 5; + if (twist) { + if (radius < blurycenter * 2) + radius = blurycenter - radius / 2; + else + radius = 5; } - else - { - radius = x + y + 5; - if (twist) - { + if (++salt >= radius * 2) + salt = 0; + dx = (y * 2 + salt) / radius; + dy = (x * 4 + salt) / radius; + } else { + radius = x + y + 5; + if (twist) { #if 1 - radius = blurycenter - radius/2; - if (radius < 5) - radius = 5; + radius = blurycenter - radius / 2; + if (radius < 5) + radius = 5; #else - radius = (blurycenter + blurxcenter + 10) / radius + 5; + radius = (blurycenter + blurxcenter + 10) / radius + 5; #endif - } - if (++salt * 2 >= radius * 3) salt = 0; - dx = (y * 4 + salt) / radius; - dy = (x * 4 + salt) / radius; } - - /* adjust for quadrants, depending on spin direction */ - if (right) - { - dy *= -dirx; - dx *= diry; - } - else - { - dy *= dirx; - dx *= -diry; - } - - if (spiral) - { - dx -= dirx; - dy -= diry; - } - - if (twist) - { - x = dx; - dx = dy; - dy = -x; - } - - /* return the offset of the source point, relative to this one */ - return dy * img_bpl + dx; + if (++salt * 2 >= radius * 3) + salt = 0; + dx = (y * 4 + salt) / radius; + dy = (x * 4 + salt) / radius; + } + + /* adjust for quadrants, depending on spin direction */ + if (right) { + dy *= -dirx; + dx *= diry; + } else { + dy *= dirx; + dx *= -diry; + } + + if (spiral) { + dx -= dirx; + dy -= diry; + } + + if (twist) { + x = dx; + dx = dy; + dy = -x; + } + + /* return the offset of the source point, relative to this one */ + return dy * img_bpl + dx; } /** - * pixels are blurred from pixels that are rotated around the image center + * pixels are blurred from pixels that are rotated around the image center */ -static int spin(int offset) -{ - return spinhelp(offset, randval[0] & 1, FALSE, FALSE); +static int spin(int offset) { + return spinhelp(offset, randval[0] & 1, FALSE, FALSE); } -static int bullseye(int offset) -{ - int x, y; - - /* Convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; - - /* For "Medium CPU", double X to preserve aspect ratio. For "Slow CPU" - * double both of them to preserve size. */ - if (*config.cpu_speed != 'F') - { - x *= 2; - if (*config.cpu_speed == 'S') - y *= 2; - } - - /* Based on distance to center, spin left or right */ - if ((x * x + y * y + 3000) & 4096) - return spinhelp(offset, TRUE, FALSE, FALSE); - else - return spinhelp(offset, FALSE, FALSE, FALSE); -} - -static int spiral(int offset) -{ - return spinhelp(offset, randval[0] & 1, TRUE, FALSE); +static int bullseye(int offset) { + int x, y; + + /* Convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; + + /* For "Medium CPU", double X to preserve aspect ratio. For "Slow CPU" + * double both of them to preserve size. */ + if (*config.cpu_speed != 'F') { + x *= 2; + if (*config.cpu_speed == 'S') + y *= 2; + } + + /* Based on distance to center, spin left or right */ + if ((x * x + y * y + 3000) & 4096) + return spinhelp(offset, TRUE, FALSE, FALSE); + else + return spinhelp(offset, FALSE, FALSE, FALSE); } -static int drain(int offset) -{ - return -spiral(offset); +static int spiral(int offset) { + return spinhelp(offset, randval[0] & 1, TRUE, FALSE); } -static int ripple(int offset) -{ - int x, y; - - /* Convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; - - /* For "Medium CPU", double X to preserve aspect ratio. For "Slow CPU" - * double both of them to preserve size. */ - if (*config.cpu_speed != 'F') - { - x *= 2; - if (*config.cpu_speed == 'S') - y *= 2; - } - - /* Based on distance to center, spin left or right */ - if ((x * x + y * y + 5000) & 2048) - return spinhelp(offset, TRUE, TRUE, FALSE); - else - return spinhelp(offset, FALSE, TRUE, FALSE); -} +static int drain(int offset) { return -spiral(offset); } -static int prismatic(int offset) -{ - int x, y, d; +static int ripple(int offset) { + int x, y; - /* Convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; + /* Convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; - /* Choose a direction by reducing x & y to square coords instead of - * pixel coords, and then checking their odd/evenness. This is easier - * that it sounds, because we just need to check a single bit from - * each. - */ - switch ((y & 0x08) | ((x >> 1) & 0x04)) - { - case 0x00: d = -1; break; - case 0x04: d = img_bpl; break; - case 0x08: d = -img_bpl; break; - default: d = 1; break; - } + /* For "Medium CPU", double X to preserve aspect ratio. For "Slow CPU" + * double both of them to preserve size. */ + if (*config.cpu_speed != 'F') { + x *= 2; + if (*config.cpu_speed == 'S') + y *= 2; + } - return d; + /* Based on distance to center, spin left or right */ + if ((x * x + y * y + 5000) & 2048) + return spinhelp(offset, TRUE, TRUE, FALSE); + else + return spinhelp(offset, FALSE, TRUE, FALSE); } -static int swirl(int offset) -{ - int x, y, d; - - /* Convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; - - salt = (salt + 1) & 0x7; - switch (salt >> 1) - { - case 0: y += 2; break; - case 1: x += 2; break; - case 2: y -= 2; break; - case 3: x -= 2; break; - } - - /* Choose a direction by reducing x & y to square coords instead of - * pixel coords, and then checking their odd/evenness. This is easier - * that it sounds, because we just need to check a single bit from - * each. - * - * Note that this differs from "Prismatic" only in that here we use - * diagonal directions, instead of Parquet's orthogonal directions. - * Oh, and the squares are larger. - */ - d = 1 + (salt & 1); - switch ((y & 0x10) | ((x >> 1) & 0x08)) - { - case 0x00: d = img_bpl - d; break; - case 0x08: d = -img_bpl - d; break; - case 0x10: d = img_bpl + d; break; - default: d = -img_bpl + d; break; - } +static int prismatic(int offset) { + int x, y, d; + + /* Convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; + + /* Choose a direction by reducing x & y to square coords instead of + * pixel coords, and then checking their odd/evenness. This is easier + * that it sounds, because we just need to check a single bit from + * each. + */ + switch ((y & 0x08) | ((x >> 1) & 0x04)) { + case 0x00: + d = -1; + break; + case 0x04: + d = img_bpl; + break; + case 0x08: + d = -img_bpl; + break; + default: + d = 1; + break; + } + + return d; +} - return d; +static int swirl(int offset) { + int x, y, d; + + /* Convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; + + salt = (salt + 1) & 0x7; + switch (salt >> 1) { + case 0: + y += 2; + break; + case 1: + x += 2; + break; + case 2: + y -= 2; + break; + case 3: + x -= 2; + break; + } + + /* Choose a direction by reducing x & y to square coords instead of + * pixel coords, and then checking their odd/evenness. This is easier + * that it sounds, because we just need to check a single bit from + * each. + * + * Note that this differs from "Prismatic" only in that here we use + * diagonal directions, instead of Parquet's orthogonal directions. + * Oh, and the squares are larger. + */ + d = 1 + (salt & 1); + switch ((y & 0x10) | ((x >> 1) & 0x08)) { + case 0x00: + d = img_bpl - d; + break; + case 0x08: + d = -img_bpl - d; + break; + case 0x10: + d = img_bpl + d; + break; + default: + d = -img_bpl + d; + break; + } + + return d; } -static int shred(int offset) -{ - switch (randval[0] & 3) - { - case 0: - if ((offset % (img_bpl - 1)) & 0x10) - return img_bpl - 1; - else - return -img_bpl + 1; +static int shred(int offset) { + switch (randval[0] & 3) { + case 0: + if ((offset % (img_bpl - 1)) & 0x10) + return img_bpl - 1; + else + return -img_bpl + 1; - case 1: - if ((offset % (img_bpl + 1)) & 0x10) - return img_bpl + 1; - else - return -img_bpl - 1; + case 1: + if ((offset % (img_bpl + 1)) & 0x10) + return img_bpl + 1; + else + return -img_bpl - 1; - case 2: - if ((offset % img_bpl) & 0x10) - return img_bpl; - else - return -img_bpl; + case 2: + if ((offset % img_bpl) & 0x10) + return img_bpl; + else + return -img_bpl; - default: - if ((offset / img_bpl) & 0x10) - return 1; - else - return -1; - } + default: + if ((offset / img_bpl) & 0x10) + return 1; + else + return -1; + } } /** - * This gives an interesting binary tree effect + * This gives an interesting binary tree effect */ -static int binary(int offset) -{ - return offset; -} +static int binary(int offset) { return offset; } /** - * Gravity -- images accelerate downward + * Gravity -- images accelerate downward */ -static int gravity(int offset) -{ - /* compute height */ - offset = offset / img_bpl; - - /* Compute dy from the height, with salt */ - offset = (offset * 3 + salt) / blurheight; - if (++salt >= blurheight) salt = 0; - - /* Return an offset, derived from dy */ - return offset * -img_bpl; -} +static int gravity(int offset) { + /* compute height */ + offset = offset / img_bpl; -static int cylinder(int offset) -{ - /* compute height, with salt */ - offset = offset / img_bpl; + /* Compute dy from the height, with salt */ + offset = (offset * 3 + salt) / blurheight; + if (++salt >= blurheight) + salt = 0; - /* return sin(height) */ - if (++salt >= 100) salt = 0; - offset = (int)((double)salt/100.0 + 2.5 * sin((double)offset / (double)img_height * VISUAL_MATH_PI)); - return offset * img_bpl; + /* Return an offset, derived from dy */ + return offset * -img_bpl; } +static int cylinder(int offset) { + /* compute height, with salt */ + offset = offset / img_bpl; + + /* return sin(height) */ + if (++salt >= 100) + salt = 0; + offset = + (int)((double)salt / 100.0 + + 2.5 * sin((double)offset / (double)img_height * VISUAL_MATH_PI)); + return offset * img_bpl; +} /** - * Each 16x16 pixel square moves in a random direction + * Each 16x16 pixel square moves in a random direction */ -static int tangram(int offset) -{ - int x, y; - - /* Decide which square this pixel is in. We only have enough random - * numbers to control 64 squares, but we don't want the same 8x8 pattern - * to repeat, so we shift the columns of 8x8 squares slightly. Each - * piece of the 8x8 square is actually a 16x16-pixel area. All of this - * complicates our computation somewhat. - */ - x = ((offset % img_bpl - blurxcenter) >> 4); - y = (((offset / img_bpl - blurycenter) >> 4) + (x >> 3)) & 0x7; - x &= 0x7; - - /* return an offset based on that square's random number */ - switch (randval[(y << 3) + x] & 0x7) - { - case 0: return img_bpl - 1; - case 1: return img_bpl + 1; - case 2: return -img_bpl - 1; - case 3: return -img_bpl + 1; - case 4: return -1; - case 5: return 1; - case 6: return img_bpl; - default: return -img_bpl; - } +static int tangram(int offset) { + int x, y; + + /* Decide which square this pixel is in. We only have enough random + * numbers to control 64 squares, but we don't want the same 8x8 pattern + * to repeat, so we shift the columns of 8x8 squares slightly. Each + * piece of the 8x8 square is actually a 16x16-pixel area. All of this + * complicates our computation somewhat. + */ + x = ((offset % img_bpl - blurxcenter) >> 4); + y = (((offset / img_bpl - blurycenter) >> 4) + (x >> 3)) & 0x7; + x &= 0x7; + + /* return an offset based on that square's random number */ + switch (randval[(y << 3) + x] & 0x7) { + case 0: + return img_bpl - 1; + case 1: + return img_bpl + 1; + case 2: + return -img_bpl - 1; + case 3: + return -img_bpl + 1; + case 4: + return -1; + case 5: + return 1; + case 6: + return img_bpl; + default: + return -img_bpl; + } } /** @@ -912,159 +890,190 @@ static int tangram(int offset) * in a random direction. The division is based on 3 mostly-vertical lines * and 2 mostly-horizontal lines. */ -static int divided(int offset) -{ - int x, y, i; - - /* if first time, then convert random numbers to edge coordinates */ - if (salt == 0) - { - salt = 1; - - /* Convert mostly-vertical values */ - for (i = 0; i < 3; i++) - { - randval[i * 2] %= img_width; - randval[i * 2 + 1] = (randval[i * 2 + 1] & 0xff) - 127; - } +static int divided(int offset) { + int x, y, i; - /* Convert mostly-horizontal values */ - for (i = 3; i < 5; i++) - { - randval[i * 2] %= img_height; - randval[i * 2 + 1] = (randval[i * 2 + 1] & 0xff) - 127; - } + /* if first time, then convert random numbers to edge coordinates */ + if (salt == 0) { + salt = 1; - /* Convert the motion values */ - for (i = 10; i < 42; i++) - { - switch (randval[i] % 20) - { - case 0: randval[i] = -2 * img_bpl - 1; break; - case 1: randval[i] = -2 * img_bpl; break; - case 2: randval[i] = -2 * img_bpl + 1; break; - case 3: randval[i] = -img_bpl - 2; break; - case 4: randval[i] = -img_bpl - 1; break; - case 5: randval[i] = -img_bpl; break; - case 6: randval[i] = -img_bpl + 1; break; - case 7: randval[i] = -img_bpl + 1; break; - case 8: randval[i] = -2; break; - case 9: randval[i] = -1; break; - case 10: randval[i] = 1; break; - case 11: randval[i] = 2; break; - case 12: randval[i] = img_bpl - 2; break; - case 13: randval[i] = img_bpl - 1; break; - case 14: randval[i] = img_bpl; break; - case 15: randval[i] = img_bpl + 1; break; - case 16: randval[i] = img_bpl + 2; break; - case 17: randval[i] = 2 * img_bpl - 1; break; - case 18: randval[i] = 2 * img_bpl; break; - case 19: randval[i] = 2 * img_bpl + 1; break; - } - } + /* Convert mostly-vertical values */ + for (i = 0; i < 3; i++) { + randval[i * 2] %= img_width; + randval[i * 2 + 1] = (randval[i * 2 + 1] & 0xff) - 127; } - - /* get the pixel coordinates of this point */ - x = offset % img_bpl; - y = offset / img_bpl; - /* Use each line as a divider, and merge a '1' or '0' bit into the - * chunk id based on which side of each line the point is on. - */ - i = 0; - if (x - randval[0] < (y * randval[1]) >> 8) - i |= 1; - if (x - randval[2] < (y * randval[3]) >> 8) - i |= 2; - if (x - randval[4] < (y * randval[5]) >> 8) - i |= 4; - if (y - randval[6] < (x * randval[7]) >> 8) - i |= 8; - if (y - randval[8] < (x * randval[9]) >> 8) - i |= 16; - - /* Return the motion vector for that chunk */ - return randval[i + 10]; -} - -static int weave(int offset) -{ - int x, y, g; - int xsize, ysize; - - /* Convert offset to (x,y) coordinates, with (0,0) at center */ - y = offset / img_bpl - blurycenter; - x = offset % img_bpl - blurxcenter; + /* Convert mostly-horizontal values */ + for (i = 3; i < 5; i++) { + randval[i * 2] %= img_height; + randval[i * 2 + 1] = (randval[i * 2 + 1] & 0xff) - 127; + } - /* The weave pattern consists of a 4x4 grid of squares. Figure out - * where this pixel is in the grid. Also set x & y to the position - * within the square, because sometimes that matters. - */ - switch (*config.cpu_speed) - { - case 'S': /* Slow CPU */ - xsize = 8; - ysize = 8; - g = ((y >> 1) & 0xc) | ((x >> 3) & 0x3); - x &= 0x7; - y &= 0x7; + /* Convert the motion values */ + for (i = 10; i < 42; i++) { + switch (randval[i] % 20) { + case 0: + randval[i] = -2 * img_bpl - 1; break; - - case 'M': /* Medium CPU */ - xsize = 8; - ysize = 16; - g = ((y >> 2) & 0xc) | ((x >> 3) & 0x3); - x &= 0x7; - y &= 0xf; + case 1: + randval[i] = -2 * img_bpl; break; - - default: /* Fast CPU */ - xsize = 16; - ysize = 16; - g = ((y >> 2) & 0xc) | ((x >> 4) & 0x3); - x &= 0xf; - y &= 0xf; + case 2: + randval[i] = -2 * img_bpl + 1; break; - } - - /* Choose a direction based mostly on the grid position */ - switch (g) - { - case 1: - if (y == 0) - return -(ysize + 1) * img_bpl; - /* else fall through... */ - case 5: - case 9: - return -img_bpl; - case 3: - if (y == ysize - 1) - return (ysize + 1) * img_bpl; - /* else fall through... */ - case 11: - case 15: - return img_bpl; - + randval[i] = -img_bpl - 2; + break; case 4: - if (x == xsize - 1) - return xsize + 1; - /* else fall through.. */ + randval[i] = -img_bpl - 1; + break; + case 5: + randval[i] = -img_bpl; + break; case 6: + randval[i] = -img_bpl + 1; + break; case 7: - return 1; - + randval[i] = -img_bpl + 1; + break; + case 8: + randval[i] = -2; + break; + case 9: + randval[i] = -1; + break; + case 10: + randval[i] = 1; + break; + case 11: + randval[i] = 2; + break; case 12: - if (x == 0) - return -(xsize + 1); - /* else fall through... */ + randval[i] = img_bpl - 2; + break; case 13: + randval[i] = img_bpl - 1; + break; case 14: - return -1; - - default: - return 0; + randval[i] = img_bpl; + break; + case 15: + randval[i] = img_bpl + 1; + break; + case 16: + randval[i] = img_bpl + 2; + break; + case 17: + randval[i] = 2 * img_bpl - 1; + break; + case 18: + randval[i] = 2 * img_bpl; + break; + case 19: + randval[i] = 2 * img_bpl + 1; + break; + } } + } + + /* get the pixel coordinates of this point */ + x = offset % img_bpl; + y = offset / img_bpl; + + /* Use each line as a divider, and merge a '1' or '0' bit into the + * chunk id based on which side of each line the point is on. + */ + i = 0; + if (x - randval[0] < (y * randval[1]) >> 8) + i |= 1; + if (x - randval[2] < (y * randval[3]) >> 8) + i |= 2; + if (x - randval[4] < (y * randval[5]) >> 8) + i |= 4; + if (y - randval[6] < (x * randval[7]) >> 8) + i |= 8; + if (y - randval[8] < (x * randval[9]) >> 8) + i |= 16; + + /* Return the motion vector for that chunk */ + return randval[i + 10]; +} + +static int weave(int offset) { + int x, y, g; + int xsize, ysize; + + /* Convert offset to (x,y) coordinates, with (0,0) at center */ + y = offset / img_bpl - blurycenter; + x = offset % img_bpl - blurxcenter; + + /* The weave pattern consists of a 4x4 grid of squares. Figure out + * where this pixel is in the grid. Also set x & y to the position + * within the square, because sometimes that matters. + */ + switch (*config.cpu_speed) { + case 'S': /* Slow CPU */ + xsize = 8; + ysize = 8; + g = ((y >> 1) & 0xc) | ((x >> 3) & 0x3); + x &= 0x7; + y &= 0x7; + break; + + case 'M': /* Medium CPU */ + xsize = 8; + ysize = 16; + g = ((y >> 2) & 0xc) | ((x >> 3) & 0x3); + x &= 0x7; + y &= 0xf; + break; + + default: /* Fast CPU */ + xsize = 16; + ysize = 16; + g = ((y >> 2) & 0xc) | ((x >> 4) & 0x3); + x &= 0xf; + y &= 0xf; + break; + } + + /* Choose a direction based mostly on the grid position */ + switch (g) { + case 1: + if (y == 0) + return -(ysize + 1) * img_bpl; + /* else fall through... */ + case 5: + case 9: + return -img_bpl; + + case 3: + if (y == ysize - 1) + return (ysize + 1) * img_bpl; + /* else fall through... */ + case 11: + case 15: + return img_bpl; + + case 4: + if (x == xsize - 1) + return xsize + 1; + /* else fall through.. */ + case 6: + case 7: + return 1; + + case 12: + if (x == 0) + return -(xsize + 1); + /* else fall through... */ + case 13: + case 14: + return -1; + + default: + return 0; + } } /** @@ -1075,155 +1084,143 @@ static int weave(int offset) * point is located exactly on a flow point; when this function returns 1, * the flow function that called it should return a 0 offset. */ -static int flow_help(int x, int y, int *totdxref, int *totdyref) -{ - int i, h, w; - double dx, dy, r2, dxpart, dypart, scale; - - /* If first time, then generate random flow points */ - if (salt == 0) - { - salt = 1; - - /* It turns out that totally random points don't usually give - * a very good effect. So instead we'll divide the window into - * 9 subsections and put one point in each. Then we'll add a - * 10th totally random point. - */ - w = img_width / 4; - h = img_height / 4; - for (i = 0; i < 9; i++) - { - randval[i * 2] = (i % 3) * w + rand_0_to(w) + w/2; - randval[i * 2 + 1] = (i / 3) * h + rand_0_to(h) + h/2; - } - randval[18] = rand_0_to(img_width); - randval[19] = rand_0_to(img_height); +static int flow_help(int x, int y, int *totdxref, int *totdyref) { + int i, h, w; + double dx, dy, r2, dxpart, dypart, scale; + + /* If first time, then generate random flow points */ + if (salt == 0) { + salt = 1; + + /* It turns out that totally random points don't usually give + * a very good effect. So instead we'll divide the window into + * 9 subsections and put one point in each. Then we'll add a + * 10th totally random point. + */ + w = img_width / 4; + h = img_height / 4; + for (i = 0; i < 9; i++) { + randval[i * 2] = (i % 3) * w + rand_0_to(w) + w / 2; + randval[i * 2 + 1] = (i / 3) * h + rand_0_to(h) + h / 2; } - - /* Add the flow factor from each flow point */ - dx = dy = 0.0; - scale = (double)(img_width + img_height) / 300.0; - for (i = 0; i < 20; i += 2) - { - /* if point is exactly on a flow point, then don't move. */ - if (x == randval[i] && y == randval[i + 1]) - return 1; - - /* Compute a flow vector from this point */ - dxpart = (double)(randval[i] - x); - dypart = (double)(randval[i + 1] - y); - r2 = sqrt(dxpart * dxpart + dypart * dypart + 15.0) / scale; - dxpart /= r2; - dypart /= r2; - - /* Invert vectors for half of the flow points */ - if ((i & 2) == 0) - { - dxpart = -dxpart; - dypart = -dypart; - } - - /* Add it to this point's overall flow */ - dx += dxpart; - dy += dypart; + randval[18] = rand_0_to(img_width); + randval[19] = rand_0_to(img_height); + } + + /* Add the flow factor from each flow point */ + dx = dy = 0.0; + scale = (double)(img_width + img_height) / 300.0; + for (i = 0; i < 20; i += 2) { + /* if point is exactly on a flow point, then don't move. */ + if (x == randval[i] && y == randval[i + 1]) + return 1; + + /* Compute a flow vector from this point */ + dxpart = (double)(randval[i] - x); + dypart = (double)(randval[i + 1] - y); + r2 = sqrt(dxpart * dxpart + dypart * dypart + 15.0) / scale; + dxpart /= r2; + dypart /= r2; + + /* Invert vectors for half of the flow points */ + if ((i & 2) == 0) { + dxpart = -dxpart; + dypart = -dypart; } - /* Convert the flow vectors to ints, with salt */ - if (++salt > 81) salt = 1; - *totdxref = dx + (double)(salt % 9 - 4) / 4.0; - *totdyref = dy + (double)((salt - 1) / 9 - 4) / 4.0; - return 0; + /* Add it to this point's overall flow */ + dx += dxpart; + dy += dypart; + } + + /* Convert the flow vectors to ints, with salt */ + if (++salt > 81) + salt = 1; + *totdxref = dx + (double)(salt % 9 - 4) / 4.0; + *totdyref = dy + (double)((salt - 1) / 9 - 4) / 4.0; + return 0; } -static int flow(int offset) -{ - int x, y; - int dx, dy; +static int flow(int offset) { + int x, y; + int dx, dy; - /* Convert offset to x & y coordinates */ - x = offset % img_bpl; - y = offset / img_bpl; + /* Convert offset to x & y coordinates */ + x = offset % img_bpl; + y = offset / img_bpl; - /* Compute the flow vector */ - if (flow_help(x, y, &dx, &dy)) - return 0; + /* Compute the flow vector */ + if (flow_help(x, y, &dx, &dy)) + return 0; - /* Convert flow vector to an offset, and return it */ - return dy * img_bpl + dx; + /* Convert flow vector to an offset, and return it */ + return dy * img_bpl + dx; } -static int flowaround(int offset) -{ - int x, y; - int dx, dy; +static int flowaround(int offset) { + int x, y; + int dx, dy; - /* Convert offset to x & y coordinates */ - x = offset % img_bpl; - y = offset / img_bpl; + /* Convert offset to x & y coordinates */ + x = offset % img_bpl; + y = offset / img_bpl; - /* Compute the flow vector */ - if (flow_help(x, y, &dx, &dy)) - return 0; + /* Compute the flow vector */ + if (flow_help(x, y, &dx, &dy)) + return 0; - /* For the "Medium CPU" setting, we need to tweak the aspect ratio. */ - if (*config.cpu_speed == 'M') - dx <<= 1; /* really dy because of the following swap */ + /* For the "Medium CPU" setting, we need to tweak the aspect ratio. */ + if (*config.cpu_speed == 'M') + dx <<= 1; /* really dy because of the following swap */ - /* Convert flow vector to an offset, and return it. Note that we - * swap dx & dy, and negate dy, to achieve a spin effect. - */ - return dx * img_bpl - dy; + /* Convert flow vector to an offset, and return it. Note that we + * swap dx & dy, and negate dy, to achieve a spin effect. + */ + return dx * img_bpl - dy; } - /** - * This is a list of the names and functions for all supported blur styles + * This is a list of the names and functions for all supported blur styles */ static struct styles { - char *name; - int (*stylefunc)(int offset); - lower_t lower; /* when to move the signal lower in window? */ - int nrandoms; /* qty of random numbers in randval[] */ - int blurintostencil;/* TRUE if motion should stop at stencil */ - int edgesmooth; /* TRUE to prefer smooth edges, not areas */ -} styles[] = -{ - {"Simple", simple, LOWER_NO, 0, FALSE, FALSE}, - {"Wobble", simple, LOWER_NO, 1, FALSE, FALSE}, - {"Grainy", grainy, LOWER_NO, 0, FALSE, TRUE}, - {"Four way", fourway, LOWER_NO, 0, FALSE, TRUE}, - {"Rise", rise, LOWER_YES, 0, FALSE, TRUE}, - {"Wiggle", wiggle, LOWER_YES, 0, FALSE, FALSE}, - {"Cylinder", cylinder, LOWER_YES, 0, FALSE, TRUE}, - {"Gravity", gravity, LOWER_NO, 0, FALSE, TRUE}, - {"Up down", updown, LOWER_NO, 0, FALSE, TRUE}, - {"Left right", leftright, LOWER_NO, 0, FALSE, FALSE}, - {"Spray", spray, LOWER_YES, 0, FALSE, TRUE}, - {"Forward", forward, LOWER_NO, 0, FALSE, FALSE}, - {"Fast forward",fastfwd, LOWER_NO, 0, FALSE, FALSE}, - {"Backward", backward, LOWER_YES, 0, FALSE, FALSE}, - {"Wobble back", backward, LOWER_YES, 1, FALSE, FALSE}, - {"Sphere", sphere, LOWER_SPECTRUM, 0, FALSE, TRUE}, - {"Spin", spin, LOWER_NO, 1, FALSE, FALSE}, - {"Bullseye", bullseye, LOWER_NO, 0, FALSE, FALSE}, - {"Spiral", spiral, LOWER_NO, 1, FALSE, FALSE}, - {"Drain", drain, LOWER_NO, 1, FALSE, FALSE}, - {"Ripple", ripple, LOWER_NO, 0, FALSE, FALSE}, - {"Prismatic", prismatic, LOWER_NO, 0, FALSE, TRUE}, - {"Swirl", swirl, LOWER_NO, 0, FALSE, TRUE}, - {"Tangram", tangram, LOWER_NO, 64, FALSE, FALSE}, - {"Divided", divided, LOWER_NO, 42, FALSE, TRUE}, - {"Shred", shred, LOWER_NO, 1, FALSE, TRUE}, - {"Weave", weave, LOWER_NO, 0, FALSE, TRUE}, - {"Binary", binary, LOWER_YES, 0, TRUE, FALSE}, - {"Fractal", fractal, LOWER_NO, 0, TRUE, TRUE}, - {"Fractal sphere", sphere, LOWER_SPECTRUM, 1, TRUE, TRUE}, - {"Flow between",flow, LOWER_NO, 0, FALSE, FALSE}, - {"Flow around", flowaround, LOWER_NO, 0, FALSE, FALSE} -}; - - + char *name; + int (*stylefunc)(int offset); + lower_t lower; /* when to move the signal lower in window? */ + int nrandoms; /* qty of random numbers in randval[] */ + int blurintostencil; /* TRUE if motion should stop at stencil */ + int edgesmooth; /* TRUE to prefer smooth edges, not areas */ +} styles[] = {{"Simple", simple, LOWER_NO, 0, FALSE, FALSE}, + {"Wobble", simple, LOWER_NO, 1, FALSE, FALSE}, + {"Grainy", grainy, LOWER_NO, 0, FALSE, TRUE}, + {"Four way", fourway, LOWER_NO, 0, FALSE, TRUE}, + {"Rise", rise, LOWER_YES, 0, FALSE, TRUE}, + {"Wiggle", wiggle, LOWER_YES, 0, FALSE, FALSE}, + {"Cylinder", cylinder, LOWER_YES, 0, FALSE, TRUE}, + {"Gravity", gravity, LOWER_NO, 0, FALSE, TRUE}, + {"Up down", updown, LOWER_NO, 0, FALSE, TRUE}, + {"Left right", leftright, LOWER_NO, 0, FALSE, FALSE}, + {"Spray", spray, LOWER_YES, 0, FALSE, TRUE}, + {"Forward", forward, LOWER_NO, 0, FALSE, FALSE}, + {"Fast forward", fastfwd, LOWER_NO, 0, FALSE, FALSE}, + {"Backward", backward, LOWER_YES, 0, FALSE, FALSE}, + {"Wobble back", backward, LOWER_YES, 1, FALSE, FALSE}, + {"Sphere", sphere, LOWER_SPECTRUM, 0, FALSE, TRUE}, + {"Spin", spin, LOWER_NO, 1, FALSE, FALSE}, + {"Bullseye", bullseye, LOWER_NO, 0, FALSE, FALSE}, + {"Spiral", spiral, LOWER_NO, 1, FALSE, FALSE}, + {"Drain", drain, LOWER_NO, 1, FALSE, FALSE}, + {"Ripple", ripple, LOWER_NO, 0, FALSE, FALSE}, + {"Prismatic", prismatic, LOWER_NO, 0, FALSE, TRUE}, + {"Swirl", swirl, LOWER_NO, 0, FALSE, TRUE}, + {"Tangram", tangram, LOWER_NO, 64, FALSE, FALSE}, + {"Divided", divided, LOWER_NO, 42, FALSE, TRUE}, + {"Shred", shred, LOWER_NO, 1, FALSE, TRUE}, + {"Weave", weave, LOWER_NO, 0, FALSE, TRUE}, + {"Binary", binary, LOWER_YES, 0, TRUE, FALSE}, + {"Fractal", fractal, LOWER_NO, 0, TRUE, TRUE}, + {"Fractal sphere", sphere, LOWER_SPECTRUM, 1, TRUE, TRUE}, + {"Flow between", flow, LOWER_NO, 0, FALSE, FALSE}, + {"Flow around", flowaround, LOWER_NO, 0, FALSE, FALSE}}; /** * This is the main blur function. The img should have a width and height @@ -1232,305 +1229,293 @@ static struct styles { * groups of 8. For example, if the window is 256x128 then the image should * have size 258x130, and img should store ((258*130+7)&~7)=33544 pixels. */ -int blur(BlurskPrivate *priv, - int beat /* Boolean: is this a beat? */, - int quiet /* Boolean: is this the start of a quiet period? */) -{ - int i, j, k; - int transition, transfrom; - static int blur_phase = 0, blur_phase2 = 0; - void (*blurfunc)(void); - struct timeval now, start; - int newspectrum; /* boolean: is new signal_style a spectrum? */ - - /* convert "transition speed" to a number */ - switch (*config.transition_speed) - { - case 'S': transition = 1 + MAXTRANSITION / 200; break; - case 'M': transition = 1 + MAXTRANSITION / 50; break; - case 'F': transition = 1 + MAXTRANSITION / 8; break; - default: transition = MAXTRANSITION; +int blur(BlurskPrivate *priv, int beat /* Boolean: is this a beat? */, + int quiet /* Boolean: is this the start of a quiet period? */) { + int i, j, k; + int transition, transfrom; + static int blur_phase = 0, blur_phase2 = 0; + void (*blurfunc)(void); + struct timeval now, start; + int newspectrum; /* boolean: is new signal_style a spectrum? */ + + /* convert "transition speed" to a number */ + switch (*config.transition_speed) { + case 'S': + transition = 1 + MAXTRANSITION / 200; + break; + case 'M': + transition = 1 + MAXTRANSITION / 50; + break; + case 'F': + transition = 1 + MAXTRANSITION / 8; + break; + default: + transition = MAXTRANSITION; + } + + /* if size has changed, then start a transition */ + if (img_width != blurwidth || img_height != blurheight) { + /* remember the new size */ + blurwidth = img_width; + blurheight = img_height; + blurxcenter = blurwidth / 2; + blurycenter = blurheight / 2; + blurlast = img_height * img_bpl; + + /* this counts as a style change, but do it instantly */ + transition = styletransition = MAXTRANSITION; + stylekeeprandom = 0; + } + + /* If "Random", and we aren't in a transition, then that counts as + * a blur change (so we continually transition from one random blur + * style to another). + */ + if (!strcmp(config.blur_style, "Random quiet")) { + if (quiet) + *stylename = '\0'; + } else if ((!strncmp(config.blur_style, "Random", 6) || + !strncmp(config.blur_style, "Flow", 4) || + !strncmp(config.blur_style, "Wobble", 6)) && + styletransition < 0 && --stylekeeprandom < 0) { + *stylename = '\0'; + } + + /* If blur style or stencil has changed, then switch to new style & + * stencil, and start a transition to make it take effect. + */ + newspectrum = (*config.signal_style == 'M' /* Mono spectrum */ + || *config.signal_style == 'S'); /* Stereo spectrum */ + if (strcmp(config.blur_style, stylename) || + strcmp(config.blur_stencil, stencilname) || + strcmp(config.blur_when, blurname) || newspectrum != isspectrum) { + /* store the new info */ + strcpy(stylename, config.blur_style); + strcpy(stencilname, config.blur_stencil); + strcpy(blurname, config.blur_when); + isspectrum = newspectrum; + + /* find the setup function for this style */ + if (!strcmp(config.blur_style, "Random quiet")) { + i = rand_0_to(QTY(styles)); + stylekeeprandom = 0; + } else if (!strcmp(config.blur_style, "Random slow")) { + i = rand_0_to(QTY(styles)); + stylekeeprandom = KEEP_RANDOM_SLOW; + } else if (!strcmp(config.blur_style, "Random")) { + i = rand_0_to(QTY(styles)); + stylekeeprandom = KEEP_RANDOM; + } else { + for (i = 0; i < QTY(styles) && strcmp(styles[i].name, stylename); i++) { + } } - /* if size has changed, then start a transition */ - if (img_width != blurwidth || img_height != blurheight) - { - /* remember the new size */ - blurwidth = img_width; - blurheight = img_height; - blurxcenter = blurwidth / 2; - blurycenter = blurheight / 2; - blurlast = img_height * img_bpl; - - /* this counts as a style change, but do it instantly */ - transition = styletransition = MAXTRANSITION; - stylekeeprandom = 0; + /* if invalid, then use the first function */ + if (i >= QTY(styles)) { + i = 0; } - /* If "Random", and we aren't in a transition, then that counts as - * a blur change (so we continually transition from one random blur - * style to another). - */ - if (!strcmp(config.blur_style, "Random quiet")) - { - if (quiet) - *stylename = '\0'; - } - else if ((!strncmp(config.blur_style, "Random", 6) - || !strncmp(config.blur_style, "Flow", 4) - || !strncmp(config.blur_style, "Wobble", 6)) - && styletransition < 0 - && --stylekeeprandom < 0) - { - *stylename = '\0'; + /* remember the new style setup function */ + stylefunc = styles[i].stylefunc; + + /* remember how this motion interacts with stencils */ + blurintostencil = styles[i].blurintostencil; + + /* remember how this motion prefers to handle edge/area smooth*/ + edgesmooth = styles[i].edgesmooth; + + /* reset the transition counter */ + salt = 0; + styletransition = MAXTRANSITION; + + /* remember whether this style lowers the signal */ + styleprevlower = stylelower; + switch (styles[i].lower) { + case LOWER_NO: + stylelower = FALSE; + break; + case LOWER_YES: + stylelower = TRUE; + break; + case LOWER_SPECTRUM: + stylelower = isspectrum; + break; } - /* If blur style or stencil has changed, then switch to new style & - * stencil, and start a transition to make it take effect. - */ - newspectrum = (*config.signal_style == 'M' /* Mono spectrum */ - || *config.signal_style == 'S'); /* Stereo spectrum */ - if (strcmp(config.blur_style, stylename) - || strcmp(config.blur_stencil, stencilname) - || strcmp(config.blur_when, blurname) - || newspectrum != isspectrum) - { - /* store the new info */ - strcpy(stylename, config.blur_style); - strcpy(stencilname, config.blur_stencil); - strcpy(blurname, config.blur_when); - isspectrum = newspectrum; - - /* find the setup function for this style */ - if (!strcmp(config.blur_style, "Random quiet")) - { - i = rand_0_to(QTY(styles)); - stylekeeprandom = 0; - } - else if (!strcmp(config.blur_style, "Random slow")) - { - i = rand_0_to(QTY(styles)); - stylekeeprandom = KEEP_RANDOM_SLOW; - } - else if (!strcmp(config.blur_style, "Random")) - { - i = rand_0_to(QTY(styles)); - stylekeeprandom = KEEP_RANDOM; - } - else - { - for (i = 0; i < QTY(styles) && strcmp(styles[i].name, stylename); i++) - { - } - } - - /* if invalid, then use the first function */ - if (i >= QTY(styles)) - { - i = 0; - } - - /* remember the new style setup function */ - stylefunc = styles[i].stylefunc; - - /* remember how this motion interacts with stencils */ - blurintostencil = styles[i].blurintostencil; - - /* remember how this motion prefers to handle edge/area smooth*/ - edgesmooth = styles[i].edgesmooth; - - /* reset the transition counter */ - salt = 0; - styletransition = MAXTRANSITION; - - /* remember whether this style lowers the signal */ - styleprevlower = stylelower; - switch (styles[i].lower) - { - case LOWER_NO: stylelower = FALSE; break; - case LOWER_YES: stylelower = TRUE; break; - case LOWER_SPECTRUM: stylelower = isspectrum;break; - } - - /* if this blur function needs random numbers, generate now */ - randval[0] = 0; - for (j = 0; j < styles[i].nrandoms; j++) - randval[j] = visual_rand(); + /* if this blur function needs random numbers, generate now */ + randval[0] = 0; + for (j = 0; j < styles[i].nrandoms; j++) + randval[j] = visual_rand(); - /* choose a stencil */ - blur_stencil = bitmap_index(config.blur_stencil); + /* choose a stencil */ + blur_stencil = bitmap_index(config.blur_stencil); - /* choose a blur intensity */ - if (!strcmp(config.blur_when, "Random blur")) - blurchar = "NRFMS"[rand_0_to(5)]; - else - blurchar = *config.blur_when; - } - - /* Decide which blur function to use */ - switch (blurchar) - { - case 'N': /* No blur */ - blurfunc = loopsharp; + /* choose a blur intensity */ + if (!strcmp(config.blur_when, "Random blur")) + blurchar = "NRFMS"[rand_0_to(5)]; + else + blurchar = *config.blur_when; + } + + /* Decide which blur function to use */ + switch (blurchar) { + case 'N': /* No blur */ + blurfunc = loopsharp; + break; + + case 'R': /* Reduced blur */ + blur_phase = (blur_phase % 5) + 1; + switch (blur_phase) { + case 1: + blurfunc = loopreduced1; + break; + case 2: + blurfunc = loopreduced2; + break; + case 3: + blurfunc = loopreduced4; + break; + case 4: + blurfunc = loopreduced3; + break; + default: + blur_phase2 = (blur_phase2 & 0x3) + 1; + switch (blur_phase2) { + case 1: + blurfunc = loopreduced1; break; - - case 'R': /* Reduced blur */ - blur_phase = (blur_phase % 5) + 1; - switch (blur_phase) - { - case 1: blurfunc = loopreduced1; break; - case 2: blurfunc = loopreduced2; break; - case 3: blurfunc = loopreduced4; break; - case 4: blurfunc = loopreduced3; break; - default: - blur_phase2 = (blur_phase2 & 0x3) + 1; - switch (blur_phase2) - { - case 1: blurfunc = loopreduced1; break; - case 2: blurfunc = loopreduced2; break; - case 3: blurfunc = loopreduced4; break; - default: blurfunc = loopreduced3; break; - } - } + case 2: + blurfunc = loopreduced2; break; - - case 'F': /* Full blur */ - blurfunc = loopblur; + case 3: + blurfunc = loopreduced4; break; - - case 'S': /* Smear */ - blurfunc = loopsmear; + default: + blurfunc = loopreduced3; break; + } + } + break; - case 'M': /* Melt */ - blurfunc = loopmelt; - break; + case 'F': /* Full blur */ + blurfunc = loopblur; + break; - default: /* case 'B': Blur on beats */ - blurfunc = beat ? loopblur : loopsharp; - break; - } + case 'S': /* Smear */ + blurfunc = loopsmear; + break; - /* If simple motion & not blurring, then we're done */ - if (styletransition < 0 && stylefunc == simple && blurfunc == loopsharp) - { - return 0; - } + case 'M': /* Melt */ + blurfunc = loopmelt; + break; - /* if in transition, then do some more dithered points */ - transfrom = styletransition; - gettimeofday(&start, NULL); - while (transition > 0 && styletransition >= 0) - { - transition--; - styletransition--; - for (i = dither[styletransition]; - i < blurlast; - i += MAXTRANSITION) - { - /* edges & stencil are always 0, else use stylefunc */ - if (i % img_bpl < img_width && - (blur_stencil < 0 || - !bitmap_test(blur_stencil, i % img_bpl, i / img_bpl))) - { - /* call stylefunc to find the source delta */ - j = i + (*stylefunc)(i); - - /* Work around the stencil; i.e., if the source - * would be in the stencil then try to move - * through the stencil to find the pixel on the - * other side of it. EXCEPT if no motion then - * that would be wasted effort so skip it. - */ - if (j != i && blur_stencil >= 0 && !blurintostencil) - { - for (k = 10; - --k >= 0 && - j >= 0 && - j <= blurlast && - bitmap_test(blur_stencil, j % img_bpl, j / img_bpl); - j += (*stylefunc)(j)) - { - } - } - - /* Verify that the result is reasonable. It's - * easier to check here than in every styelfunc. - */ - if (j < 0 || j > blurlast) - { - j = i; - } - img_source[i] = &img_buf[j]; - } - else - img_source[i] = &img_buf[i]; + default: /* case 'B': Blur on beats */ + blurfunc = beat ? loopblur : loopsharp; + break; + } + + /* If simple motion & not blurring, then we're done */ + if (styletransition < 0 && stylefunc == simple && blurfunc == loopsharp) { + return 0; + } + + /* if in transition, then do some more dithered points */ + transfrom = styletransition; + gettimeofday(&start, NULL); + while (transition > 0 && styletransition >= 0) { + transition--; + styletransition--; + for (i = dither[styletransition]; i < blurlast; i += MAXTRANSITION) { + /* edges & stencil are always 0, else use stylefunc */ + if (i % img_bpl < img_width && + (blur_stencil < 0 || + !bitmap_test(blur_stencil, i % img_bpl, i / img_bpl))) { + /* call stylefunc to find the source delta */ + j = i + (*stylefunc)(i); + + /* Work around the stencil; i.e., if the source + * would be in the stencil then try to move + * through the stencil to find the pixel on the + * other side of it. EXCEPT if no motion then + * that would be wasted effort so skip it. + */ + if (j != i && blur_stencil >= 0 && !blurintostencil) { + for (k = 10; --k >= 0 && j >= 0 && j <= blurlast && + bitmap_test(blur_stencil, j % img_bpl, j / img_bpl); + j += (*stylefunc)(j)) { + } } - /* Never allow more than MAXUSEC per frame */ - gettimeofday(&now, NULL); - if ((now.tv_sec - start.tv_sec) * 1000000 + now.tv_usec - start.tv_usec > MAXUSEC) - break; + /* Verify that the result is reasonable. It's + * easier to check here than in every styelfunc. + */ + if (j < 0 || j > blurlast) { + j = i; + } + img_source[i] = &img_buf[j]; + } else + img_source[i] = &img_buf[i]; } - /* Give the colormap a chance to transition smoothly too. */ - color_transition(priv, transfrom, styletransition, MAXTRANSITION); - - /* Perform the blur */ - if (edgesmooth) - /* Normal blurring, usually gives stable edges */ - (*blurfunc)(); - else - { - /* Alternate blurring, usually gives smoother areas */ - static int odd = 1; - odd = -odd; - img_bpl *= odd; - (*blurfunc)(); - img_bpl *= odd; - } - img_copyback(); - - /* Return the amount by which the signal should be lowered */ - if (stylelower && !styleprevlower) - return (blurheight * (MAXTRANSITION - styletransition + 1)) - / (6 * MAXTRANSITION); - else if (styleprevlower && !stylelower) - return (blurheight * (styletransition + 1)) - / (6 * MAXTRANSITION); - else if (stylelower && styleprevlower) - return blurheight / 6; - else - return 0; + /* Never allow more than MAXUSEC per frame */ + gettimeofday(&now, NULL); + if ((now.tv_sec - start.tv_sec) * 1000000 + now.tv_usec - start.tv_usec > + MAXUSEC) + break; + } + + /* Give the colormap a chance to transition smoothly too. */ + color_transition(priv, transfrom, styletransition, MAXTRANSITION); + + /* Perform the blur */ + if (edgesmooth) + /* Normal blurring, usually gives stable edges */ + (*blurfunc)(); + else { + /* Alternate blurring, usually gives smoother areas */ + static int odd = 1; + odd = -odd; + img_bpl *= odd; + (*blurfunc)(); + img_bpl *= odd; + } + img_copyback(); + + /* Return the amount by which the signal should be lowered */ + if (stylelower && !styleprevlower) + return (blurheight * (MAXTRANSITION - styletransition + 1)) / + (6 * MAXTRANSITION); + else if (styleprevlower && !stylelower) + return (blurheight * (styletransition + 1)) / (6 * MAXTRANSITION); + else if (stylelower && styleprevlower) + return blurheight / 6; + else + return 0; } /** - * Return the name of the i'th blur style (including "Random") + * Return the name of the i'th blur style (including "Random") */ -char *blur_name(int i) -{ - if (i < QTY(styles)) - return styles[i].name; - if (i == QTY(styles)) - return "Random"; - if (i == QTY(styles) + 1) - return "Random slow"; - if (i == QTY(styles) + 2) - return "Random quiet"; - return NULL; +char *blur_name(int i) { + if (i < QTY(styles)) + return styles[i].name; + if (i == QTY(styles)) + return "Random"; + if (i == QTY(styles) + 1) + return "Random slow"; + if (i == QTY(styles) + 2) + return "Random quiet"; + return NULL; } /** - * Return the name of the i'th blur_when method + * Return the name of the i'th blur_when method */ -char *blur_when_name(int i) -{ - static char *names[] = { - "No blur", "Reduced blur", "Full blur", "Melt", "Smear", - "Random blur", "Blur on beats" - }; - - if (i < QTY(names)) - return names[i]; - return NULL; +char *blur_when_name(int i) { + static char *names[] = {"No blur", "Reduced blur", "Full blur", "Melt", + "Smear", "Random blur", "Blur on beats"}; + + if (i < QTY(names)) + return names[i]; + return NULL; } diff --git a/libvisual-plugins/plugins/actor/blursk/blursk.c b/libvisual-plugins/plugins/actor/blursk/blursk.c index 1acfad4ea..90ca2ca9b 100644 --- a/libvisual-plugins/plugins/actor/blursk/blursk.c +++ b/libvisual-plugins/plugins/actor/blursk/blursk.c @@ -25,7 +25,8 @@ * Copyright (C) 1999 Steve Kirkendall * * Portions of this file are derived from the XMMS "Blur Scope" plugin. - * XMMS is Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies + * XMMS is Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas + * Nilsson and 4Front Technologies * * 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 @@ -52,14 +53,14 @@ #define DUMPCORE #ifdef DUMPCORE -# include +#include #endif /* To detect rhythms, blursk tracks the loudness of the signal across multiple * frames. This is the maximum number of frames, and should correspond to the * slowest rhythm. */ -#define BEAT_MAX 200 +#define BEAT_MAX 200 static void blursk_render_pcm(BlurskPrivate *priv, int16_t *data); @@ -68,26 +69,20 @@ static int oddeven; int nspectrums; -static int32_t beathistory[BEAT_MAX]; -static int beatbase; -static int beatquiet; /* force "quiet" situation? */ +static int32_t beathistory[BEAT_MAX]; +static int beatbase; +static int beatquiet; /* force "quiet" situation? */ int blurskinfo = FALSE; VisSongInfo *songinfo = NULL; - /** * Return the name of the i'th floater method */ -char *floaters_name(int i) -{ - static char *names[] = - { - "No floaters", "Dots", "Slow floaters", "Fast floaters", - "Retro floaters", - NULL - }; - return names[i]; +char *floaters_name(int i) { + static char *names[] = {"No floaters", "Dots", "Slow floaters", + "Fast floaters", "Retro floaters", NULL}; + return names[i]; } /* Detect beats. This involves more than just comparing the loudness to a @@ -98,342 +93,307 @@ char *floaters_name(int i) * thickness value from 0 to 3, and it detects the start of silence for * the "Random quiet" setting. */ -static int detect_beat(int32_t loudness, int *thickref, int *quietref) -{ - static int32_t aged; /* smoothed out loudness */ - static int32_t lowest; /* quietest point in current beat */ - static int elapsed; /* frames since last beat */ - static int isquiet; /* was previous frame quiet */ - static int prevbeat; /* period of previous beat */ - int beat, i, j; - int32_t total; - int sensitivity; - - /* Incorporate the current loudness into history */ - aged = (aged * 7 + loudness) >> 3; - elapsed++; - - /* If silent, then clobber the beat */ - if (aged < 2000 || elapsed > BEAT_MAX) - { - elapsed = 0; - lowest = aged; - memset(beathistory, 0, sizeof beathistory); +static int detect_beat(int32_t loudness, int *thickref, int *quietref) { + static int32_t aged; /* smoothed out loudness */ + static int32_t lowest; /* quietest point in current beat */ + static int elapsed; /* frames since last beat */ + static int isquiet; /* was previous frame quiet */ + static int prevbeat; /* period of previous beat */ + int beat, i, j; + int32_t total; + int sensitivity; + + /* Incorporate the current loudness into history */ + aged = (aged * 7 + loudness) >> 3; + elapsed++; + + /* If silent, then clobber the beat */ + if (aged < 2000 || elapsed > BEAT_MAX) { + elapsed = 0; + lowest = aged; + memset(beathistory, 0, sizeof beathistory); + } else if (aged < lowest) + lowest = aged; + + /* Beats are detected by looking for a sudden loudness after a lull. + * They are also limited to occur no more than once every 15 frames, + * so the beat flashes don't get too annoying. + */ + j = (beatbase + elapsed) % BEAT_MAX; + beathistory[j] = loudness - aged; + beat = FALSE; + if (elapsed > 15 && aged > 2000 && loudness * 4 > aged * 5) { + /* Compute the average loudness change, assuming this is beat */ + for (i = BEAT_MAX / elapsed, total = 0; --i > 0; + j = (j + BEAT_MAX - elapsed) % BEAT_MAX) { + total += beathistory[j]; } - else if (aged < lowest) - lowest = aged; + total = total * elapsed / BEAT_MAX; - /* Beats are detected by looking for a sudden loudness after a lull. - * They are also limited to occur no more than once every 15 frames, - * so the beat flashes don't get too annoying. - */ - j = (beatbase + elapsed) % BEAT_MAX; - beathistory[j] = loudness - aged; - beat = FALSE; - if (elapsed > 15 && aged > 2000 && loudness * 4 > aged * 5) - { - /* Compute the average loudness change, assuming this is beat */ - for (i = BEAT_MAX / elapsed, total = 0; - --i > 0; - j = (j + BEAT_MAX - elapsed) % BEAT_MAX) - { - total += beathistory[j]; - } - total = total * elapsed / BEAT_MAX; - - /* Tweak the sensitivity to emphasize a consistent rhythm */ - sensitivity = config.beat_sensitivity; - i = 3 - abs(elapsed - prevbeat)/2; - if (i > 0) - sensitivity += i; - - /* If average change is significantly positive, this is a beat. - */ - if (total * sensitivity > aged) - { - prevbeat = elapsed; - beatbase = (beatbase + elapsed) % BEAT_MAX; - lowest = aged; - elapsed = 0; - beat = TRUE; - } - } + /* Tweak the sensitivity to emphasize a consistent rhythm */ + sensitivity = config.beat_sensitivity; + i = 3 - abs(elapsed - prevbeat) / 2; + if (i > 0) + sensitivity += i; - /* Thickness is computed from the difference between the instantaneous - * loudness and the aged loudness. Thus, a sudden increase in volume - * will produce a thick line, regardless of rhythm. + /* If average change is significantly positive, this is a beat. */ - if (aged < 1500) - *thickref = 0; - else if (!config.thick_on_beats) - *thickref = 1; - else - { - *thickref = loudness * 2 / aged; - if (*thickref > 3) - *thickref = 3; + if (total * sensitivity > aged) { + prevbeat = elapsed; + beatbase = (beatbase + elapsed) % BEAT_MAX; + lowest = aged; + elapsed = 0; + beat = TRUE; } + } + + /* Thickness is computed from the difference between the instantaneous + * loudness and the aged loudness. Thus, a sudden increase in volume + * will produce a thick line, regardless of rhythm. + */ + if (aged < 1500) + *thickref = 0; + else if (!config.thick_on_beats) + *thickref = 1; + else { + *thickref = loudness * 2 / aged; + if (*thickref > 3) + *thickref = 3; + } + + /* Silence is computed from the aged loudness. The quietref value is + * set to TRUE only at the start of silence, not throughout the silent + * period. Also, there is some hysteresis so that silence followed + * by a slight noise and more silence won't count as two silent + * periods -- that sort of thing happens during many fade edits, so + * we have to account for it. + */ + if (beatquiet || aged < (isquiet ? 1500 : 500)) { + /* Quiet now -- is this the start of quiet? */ + *quietref = !isquiet; + isquiet = TRUE; + beatquiet = FALSE; + } else { + *quietref = FALSE; + isquiet = FALSE; + } + + /* return the result */ + return beat; +} - /* Silence is computed from the aged loudness. The quietref value is - * set to TRUE only at the start of silence, not throughout the silent - * period. Also, there is some hysteresis so that silence followed - * by a slight noise and more silence won't count as two silent - * periods -- that sort of thing happens during many fade edits, so - * we have to account for it. - */ - if (beatquiet || aged < (isquiet ? 1500 : 500)) - { - /* Quiet now -- is this the start of quiet? */ - *quietref = !isquiet; - isquiet = TRUE; - beatquiet = FALSE; - } - else - { - *quietref = FALSE; - isquiet = FALSE; +static void drawfloaters(int beat) { + static int prevfloaters; + static struct { + int x, y, age; + uint8_t color; + } floater[10]; + static int oddeven; + int nfloaters; + int i, j, delta, dx, dy; + + /* choose the number of floaters */ + switch (*config.floaters) { + case 'N': /* No floaters */ + nfloaters = 0; + break; + + case 'D': /* Dots */ + nfloaters = 1; + break; + + case 'S': /* Slow */ + oddeven++; + /* fall through... */ + + default: /* Slow/Fast/Retro floaters */ + nfloaters = 1 + img_width * img_height / 20000; + if (nfloaters > 10) + nfloaters = 10; + } + + /* for each floater... */ + for (i = 0; i < nfloaters; i++) { + /* if Dots, new, old, beat, or off-screen... */ + if (*config.floaters == 'D' || i >= prevfloaters || + floater[i].age++ > 80 + i * 13 || beat || floater[i].x < 0 || + floater[i].x >= img_width || floater[i].y < 0 || + floater[i].y >= img_height) { + /* Pretend motion is 0. This will cause blursk to + * choose a new position, later in this function. + */ + delta = 0; + } else { + /* find the real motion */ + j = floater[i].y * img_bpl + floater[i].x; + delta = &img_buf[j] - img_source[j]; } - /* return the result */ - return beat; -} - -static void drawfloaters(int beat) -{ - static int prevfloaters; - static struct {int x, y, age; uint8_t color;} floater[10]; - static int oddeven; - int nfloaters; - int i, j, delta, dx, dy; - - /* choose the number of floaters */ - switch (*config.floaters) - { - case 'N': /* No floaters */ - nfloaters = 0; + /* if motion isn't 0, then move the floater */ + if (delta != 0) { + /* decompose the delta into dx & dy. Watch signs! */ + dx = (j + delta) % img_bpl - floater[i].x; + dy = (j + delta) / img_bpl - floater[i].y; + + /* move the floater */ + switch (*config.floaters) { + case 'S': /* Slow floaters */ + if ((oddeven ^ i) & 0x1) + dx = dy = 0; break; - case 'D': /* Dots */ - nfloaters = 1; + case 'F': /* Fast floaters */ + dx *= 2; + dy *= 2; break; - case 'S': /* Slow */ - oddeven++; - /* fall through... */ - - default: /* Slow/Fast/Retro floaters */ - nfloaters = 1 + img_width * img_height / 20000; - if (nfloaters > 10) - nfloaters = 10; + case 'R': /* Retro floaters */ + dx = -dx; + dy = -dy; + break; + } + floater[i].x += dx; + floater[i].y += dy; } - /* for each floater... */ - for (i = 0; i < nfloaters; i++) - { - /* if Dots, new, old, beat, or off-screen... */ - if (*config.floaters == 'D' - || i >= prevfloaters - || floater[i].age++ > 80 + i * 13 - || beat - || floater[i].x < 0 || floater[i].x >= img_width - || floater[i].y < 0 || floater[i].y >= img_height) - { - /* Pretend motion is 0. This will cause blursk to - * choose a new position, later in this function. - */ - delta = 0; - } - else - { - /* find the real motion */ - j = floater[i].y * img_bpl + floater[i].x; - delta = &img_buf[j] - img_source[j]; - } - - /* if motion isn't 0, then move the floater */ - if (delta != 0) - { - /* decompose the delta into dx & dy. Watch signs! */ - dx = (j + delta) % img_bpl - floater[i].x; - dy = (j + delta) / img_bpl - floater[i].y; - - /* move the floater */ - switch (*config.floaters) - { - case 'S': /* Slow floaters */ - if ((oddeven ^ i) & 0x1) - dx = dy = 0; - break; - - case 'F': /* Fast floaters */ - dx *= 2; - dy *= 2; - break; - - case 'R': /* Retro floaters */ - dx = -dx; - dy = -dy; - break; - } - floater[i].x += dx; - floater[i].y += dy; - } - - /* if no motion, or motion carries it off the screen, then - * choose a new random position & contrasting color. - */ - if (delta == 0 - || floater[i].x < 0 || floater[i].x >= img_width - || floater[i].y < 0 || floater[i].y >= img_height) - { - /* choose a new random position */ - floater[i].x = rand_0_to(img_width - 9) + 2; - floater[i].y = rand_0_to(img_height - 9) + 2; - if (IMG_PIXEL(floater[i].x, floater[i].y) > 0x80) - floater[i].color = 0; - else - floater[i].color = 0xfe; - floater[i].age = 0; - } - - /* draw the floater */ - render_dot(floater[i].x, floater[i].y, floater[i].color); + /* if no motion, or motion carries it off the screen, then + * choose a new random position & contrasting color. + */ + if (delta == 0 || floater[i].x < 0 || floater[i].x >= img_width || + floater[i].y < 0 || floater[i].y >= img_height) { + /* choose a new random position */ + floater[i].x = rand_0_to(img_width - 9) + 2; + floater[i].y = rand_0_to(img_height - 9) + 2; + if (IMG_PIXEL(floater[i].x, floater[i].y) > 0x80) + floater[i].color = 0; + else + floater[i].color = 0xfe; + floater[i].age = 0; } - prevfloaters = nfloaters; + + /* draw the floater */ + render_dot(floater[i].x, floater[i].y, floater[i].color); + } + prevfloaters = nfloaters; } /* This detects libvisual songinfo events and updates title when appropriate. * It should be called once for each frame. */ -static unsigned char *show_info(unsigned char *img, int height, int bpl) -{ - int pos, length; - time_t now; - static int prevpos; - static char buf[1000]; - static time_t start, then; - static int persistent = FALSE; - char showinfo; - char posstr[32], lenstr[32]; - - if(songinfo == NULL || visual_songinfo_get_type(songinfo) == VISUAL_SONGINFO_TYPE_NULL) - return img; - - time(&now); - if(now != then) - { - then = now; - pos = visual_songinfo_get_elapsed (songinfo); - - convert_ms_to_timestamp(posstr, pos); - length = visual_songinfo_get_length(songinfo); - convert_ms_to_timestamp(lenstr, length); - if(pos != prevpos) - { - prevpos = pos; - beatquiet = TRUE; - switch(visual_songinfo_get_type(songinfo)) - { - case VISUAL_SONGINFO_TYPE_SIMPLE: - if(config.show_timestamp) - { - sprintf(buf, "{%s/%s} %s", posstr, lenstr, visual_songinfo_get_simple_name(songinfo)); - break; - } - else - { - sprintf(buf, "%s", visual_songinfo_get_simple_name (songinfo)); - } - - case VISUAL_SONGINFO_TYPE_ADVANCED: - if(config.show_timestamp) - { - if(strcmp(visual_songinfo_get_artist(songinfo), "(null)") == 0) - { - if(length >= 0) - sprintf(buf, "{%s/%s} %s", posstr, lenstr, visual_songinfo_get_song(songinfo)); - else - sprintf(buf, "(%s) %s", posstr, visual_songinfo_get_song(songinfo)); - } - else - { - if(length >= 0) - sprintf(buf, "{%s/%s} %s by %s", posstr, lenstr, - visual_songinfo_get_song(songinfo), visual_songinfo_get_artist(songinfo)); - else - sprintf(buf, "(%s) %s by %s", posstr, - visual_songinfo_get_song(songinfo), visual_songinfo_get_artist(songinfo)); - } - } - else - { - if(strcmp(visual_songinfo_get_artist(songinfo), "(null)") == 0) - { - if(strcmp(visual_songinfo_get_song(songinfo), "(null)") != 0) - sprintf(buf, "%s", visual_songinfo_get_song(songinfo)); - } - else - { - sprintf(buf, "%s by %s", visual_songinfo_get_song(songinfo), visual_songinfo_get_artist(songinfo)); - } - } - break; - - - default: - break; - } - } - } +static unsigned char *show_info(unsigned char *img, int height, int bpl) { + int pos, length; + time_t now; + static int prevpos; + static char buf[1000]; + static time_t start, then; + static int persistent = FALSE; + char showinfo; + char posstr[32], lenstr[32]; + + if (songinfo == NULL || + visual_songinfo_get_type(songinfo) == VISUAL_SONGINFO_TYPE_NULL) + return img; - showinfo = *config.show_info; - if(blurskinfo || persistent) - { - if(showinfo == 'N') - return img; + time(&now); + if (now != then) { + then = now; + pos = visual_songinfo_get_elapsed(songinfo); + + convert_ms_to_timestamp(posstr, pos); + length = visual_songinfo_get_length(songinfo); + convert_ms_to_timestamp(lenstr, length); + if (pos != prevpos) { + prevpos = pos; + beatquiet = TRUE; + switch (visual_songinfo_get_type(songinfo)) { + case VISUAL_SONGINFO_TYPE_SIMPLE: + if (config.show_timestamp) { + sprintf(buf, "{%s/%s} %s", posstr, lenstr, + visual_songinfo_get_simple_name(songinfo)); + break; + } else { + sprintf(buf, "%s", visual_songinfo_get_simple_name(songinfo)); + } - if(blurskinfo) - { - start = now; - persistent = TRUE; + case VISUAL_SONGINFO_TYPE_ADVANCED: + if (config.show_timestamp) { + if (strcmp(visual_songinfo_get_artist(songinfo), "(null)") == 0) { + if (length >= 0) + sprintf(buf, "{%s/%s} %s", posstr, lenstr, + visual_songinfo_get_song(songinfo)); + else + sprintf(buf, "(%s) %s", posstr, + visual_songinfo_get_song(songinfo)); + } else { + if (length >= 0) + sprintf(buf, "{%s/%s} %s by %s", posstr, lenstr, + visual_songinfo_get_song(songinfo), + visual_songinfo_get_artist(songinfo)); + else + sprintf(buf, "(%s) %s by %s", posstr, + visual_songinfo_get_song(songinfo), + visual_songinfo_get_artist(songinfo)); + } + } else { + if (strcmp(visual_songinfo_get_artist(songinfo), "(null)") == 0) { + if (strcmp(visual_songinfo_get_song(songinfo), "(null)") != 0) + sprintf(buf, "%s", visual_songinfo_get_song(songinfo)); + } else { + sprintf(buf, "%s by %s", visual_songinfo_get_song(songinfo), + visual_songinfo_get_artist(songinfo)); + } } - blurskinfo = FALSE; - } + break; - /* If not supposed to show text, then we're done */ - switch(showinfo) { - case 'N': /* Never show info */ - return img; - case 'T': /* 4 second info */ - if(now - start > config.info_timeout) - { - persistent = FALSE; - return img; - } - case 'A': /* Always show info */ - break; + default: + break; + } } + } - /* We don't want to draw onto the main image, because then the text - * would leave blur trails. Most combinations of cpu_speed and - * overall_effect copy the image data into a temporary buffer, but - * the specific combination of cpu_speed=Fast and overall_effect=Normal - * (which is very common!) normally leaves the image in the main buffer. - * We need to detect this, and copy the image before we draw the text. - */ - if (img != img_tmp) - { - memcpy(img_tmp, img, img_chunks * 8); - img = img_tmp; + showinfo = *config.show_info; + if (blurskinfo || persistent) { + if (showinfo == 'N') + return img; + + if (blurskinfo) { + start = now; + persistent = TRUE; } + blurskinfo = FALSE; + } - /* draw the text */ - textdraw(img, height, bpl, "Center", buf); + /* If not supposed to show text, then we're done */ + switch (showinfo) { + case 'N': /* Never show info */ return img; + case 'T': /* 4 second info */ + if (now - start > config.info_timeout) { + persistent = FALSE; + return img; + } + case 'A': /* Always show info */ + break; + } + + /* We don't want to draw onto the main image, because then the text + * would leave blur trails. Most combinations of cpu_speed and + * overall_effect copy the image data into a temporary buffer, but + * the specific combination of cpu_speed=Fast and overall_effect=Normal + * (which is very common!) normally leaves the image in the main buffer. + * We need to detect this, and copy the image before we draw the text. + */ + if (img != img_tmp) { + memcpy(img_tmp, img, img_chunks * 8); + img = img_tmp; + } + + /* draw the text */ + textdraw(img, height, bpl, "Center", buf); + return img; } - /* This is a generic rendering function. It works for all signal styles. * The input always looks like one big PCM sample; if the input is really * a spectrum, then it will have been transformed by blurk_render_pcm() @@ -447,170 +407,160 @@ static unsigned char *show_info(unsigned char *img, int height, int bpl) * produce a "bead" graph by passing the data off to render_bead(). * The decision of how to plot is based on the value of "variation". */ -static void update_image(BlurskPrivate *priv, int32_t loudness, int ndata, int16_t *data) -{ - int i, thick, quiet, center; - int beat; - int width, height, bpl; - - - /* Detect whether this is a beat, and choose a line thickness */ - beat = detect_beat(loudness, &thick, &quiet); - - /* Perform the blurring. This also affects whether the center of the - * signal will be moved lower in the window. - */ - center = img_height/2 + blur(priv, beat, quiet); - - /* Perform the fade or solid flash */ - if (beat && !strcmp(config.flash_style, "Full flash")) - i = 60; - else - { - switch (config.fade_speed[0]) - { - case 'S': i = -1; break; /* Slow */ - case 'M': i = -3; break; /* Medium */ - case 'F': i = -9; break; /* Fast */ - case 'N': - default: i = 0; /* None */ - } - } - if (i != 0) - loopfade(i); - - /* special processing for "Invert" & bitmap logo flashes */ - if (beat) - { - if (!strcmp(config.flash_style, "Invert flash")) - img_invert(); - else if ((i = bitmap_index(config.flash_style)) >= 0) - bitmap_flash(i); - } - - /* Maybe change hue on beats */ - if (beat) - color_beat(priv); - - /* Add the signal data to the image */ - render(thick, center, ndata, data); - - /* Add floaters */ - drawfloaters(beat); - - /* shift the "ripple effect" from one frame to another */ - img_rippleshift += 3; /* cyclic, since img_rippleshift is a unsigned char */ - - /* Apply the overall effect, if any */ - if (!strcmp(config.overall_effect, "Bump effect")) - { - priv->rgb_buf = img_bump(&width, &height, &bpl); +static void update_image(BlurskPrivate *priv, int32_t loudness, int ndata, + int16_t *data) { + int i, thick, quiet, center; + int beat; + int width, height, bpl; + + /* Detect whether this is a beat, and choose a line thickness */ + beat = detect_beat(loudness, &thick, &quiet); + + /* Perform the blurring. This also affects whether the center of the + * signal will be moved lower in the window. + */ + center = img_height / 2 + blur(priv, beat, quiet); + + /* Perform the fade or solid flash */ + if (beat && !strcmp(config.flash_style, "Full flash")) + i = 60; + else { + switch (config.fade_speed[0]) { + case 'S': + i = -1; + break; /* Slow */ + case 'M': + i = -3; + break; /* Medium */ + case 'F': + i = -9; + break; /* Fast */ + case 'N': + default: + i = 0; /* None */ } - else if (!strcmp(config.overall_effect, "Anti-fade effect")) - { - priv->rgb_buf = img_travel(&width, &height, &bpl); - } - else if (!strcmp(config.overall_effect, "Ripple effect")) - { - priv->rgb_buf = img_ripple(&width, &height, &bpl); - } - else /* "Normal effect" */ - { - priv->rgb_buf = img_expand(&width, &height, &bpl); - } - - priv->rgb_buf = show_info(priv->rgb_buf, height, bpl); - - /* Allow the background color to change */ - color_bg(priv, ndata, data); + } + if (i != 0) + loopfade(i); + + /* special processing for "Invert" & bitmap logo flashes */ + if (beat) { + if (!strcmp(config.flash_style, "Invert flash")) + img_invert(); + else if ((i = bitmap_index(config.flash_style)) >= 0) + bitmap_flash(i); + } + + /* Maybe change hue on beats */ + if (beat) + color_beat(priv); + + /* Add the signal data to the image */ + render(thick, center, ndata, data); + + /* Add floaters */ + drawfloaters(beat); + + /* shift the "ripple effect" from one frame to another */ + img_rippleshift += 3; /* cyclic, since img_rippleshift is a unsigned char */ + + /* Apply the overall effect, if any */ + if (!strcmp(config.overall_effect, "Bump effect")) { + priv->rgb_buf = img_bump(&width, &height, &bpl); + } else if (!strcmp(config.overall_effect, "Anti-fade effect")) { + priv->rgb_buf = img_travel(&width, &height, &bpl); + } else if (!strcmp(config.overall_effect, "Ripple effect")) { + priv->rgb_buf = img_ripple(&width, &height, &bpl); + } else /* "Normal effect" */ + { + priv->rgb_buf = img_expand(&width, &height, &bpl); + } + + priv->rgb_buf = show_info(priv->rgb_buf, height, bpl); + + /* Allow the background color to change */ + color_bg(priv, ndata, data); } - /* This is the entry point for the pcm view. Normally it just calls the * renderer with the input data. */ -static void blursk_render_pcm(BlurskPrivate *priv, int16_t *data) -{ - int i, imin, imax, start; - int32_t loudness, delta_sum; - - /* If slow motion, then ignore odd-numbered frames */ - oddeven = !oddeven; - if (config.slow_motion && oddeven) - return; - - /* Find the maximum and minimum, with the restriction that - * the minimum must occur after the maximum. - */ - for (i = 1, imin = imax = 0, delta_sum = 0; i < 255 / 2; i++) - { - if (data[i] < data[imin]) - imin = i; - if (data[i] > data[imax]) - imin = imax = i; - delta_sum += abs(data[i] - data[i - i]); - } - - /* Triggered sweeps start halfway between min & max */ - start = (imax + imin) / 2; - - /* Compute the loudness. We don't want to do a full spectrum analysis - * to do this, but we can guess the low-frequency sound is proportional - * to the maximum difference found (because loud low frequencies need - * big signal changes), and that high-frequency sound is proportional - * to the differences between adjacent samples. We want to be sensitive - * to both of those, while ignoring the mid-range sound. - * - * Because we have only one low-frequency difference, but hundreds of - * high-frequency differences, we need to give more weight to the - * low-frequency difference (even though each high-frequency difference - * is small). - */ - loudness = (((int32_t)data[imax] - (int32_t)data[imin]) * 60 + delta_sum) / 75; - - /* Draw it */ - update_image(priv, loudness, 256, &data[start]); +static void blursk_render_pcm(BlurskPrivate *priv, int16_t *data) { + int i, imin, imax, start; + int32_t loudness, delta_sum; + + /* If slow motion, then ignore odd-numbered frames */ + oddeven = !oddeven; + if (config.slow_motion && oddeven) + return; + + /* Find the maximum and minimum, with the restriction that + * the minimum must occur after the maximum. + */ + for (i = 1, imin = imax = 0, delta_sum = 0; i < 255 / 2; i++) { + if (data[i] < data[imin]) + imin = i; + if (data[i] > data[imax]) + imin = imax = i; + delta_sum += abs(data[i] - data[i - i]); + } + + /* Triggered sweeps start halfway between min & max */ + start = (imax + imin) / 2; + + /* Compute the loudness. We don't want to do a full spectrum analysis + * to do this, but we can guess the low-frequency sound is proportional + * to the maximum difference found (because loud low frequencies need + * big signal changes), and that high-frequency sound is proportional + * to the differences between adjacent samples. We want to be sensitive + * to both of those, while ignoring the mid-range sound. + * + * Because we have only one low-frequency difference, but hundreds of + * high-frequency differences, we need to give more weight to the + * low-frequency difference (even though each high-frequency difference + * is small). + */ + loudness = + (((int32_t)data[imax] - (int32_t)data[imin]) * 60 + delta_sum) / 75; + + /* Draw it */ + update_image(priv, loudness, 256, &data[start]); } - -void blursk_event_newsong(VisSongInfo *newsong) -{ - visual_return_if_fail(newsong != NULL); - visual_songinfo_copy(songinfo, newsong); - blurskinfo = TRUE; +void blursk_event_newsong(VisSongInfo *newsong) { + visual_return_if_fail(newsong != NULL); + visual_songinfo_copy(songinfo, newsong); + blurskinfo = TRUE; } -void __blursk_render_pcm (BlurskPrivate *priv, int16_t *pcmbuf) { - blursk_render_pcm(priv, pcmbuf); +void __blursk_render_pcm(BlurskPrivate *priv, int16_t *pcmbuf) { + blursk_render_pcm(priv, pcmbuf); } -void __blursk_init (BlurskPrivate *priv) { - color_genmap(priv, FALSE); - img_resize(priv, config.width, config.height); - songinfo = visual_songinfo_new(VISUAL_SONGINFO_TYPE_NULL); +void __blursk_init(BlurskPrivate *priv) { + color_genmap(priv, FALSE); + img_resize(priv, config.width, config.height); + songinfo = visual_songinfo_new(VISUAL_SONGINFO_TYPE_NULL); } -void __blursk_cleanup (BlurskPrivate *priv) { - img_cleanup(); - visual_songinfo_free(songinfo); - - /* cleanup config strings */ - visual_mem_free(config.color_style); - visual_mem_free(config.signal_color); - visual_mem_free(config.background); - visual_mem_free(config.blur_style); - visual_mem_free(config.transition_speed); - visual_mem_free(config.blur_when); - visual_mem_free(config.blur_stencil); - visual_mem_free(config.fade_speed); - visual_mem_free(config.signal_style); - visual_mem_free(config.plot_style); - visual_mem_free(config.flash_style); - visual_mem_free(config.overall_effect); - visual_mem_free(config.floaters); - visual_mem_free(config.cpu_speed); - visual_mem_free(config.show_info); - +void __blursk_cleanup(BlurskPrivate *priv) { + img_cleanup(); + visual_songinfo_free(songinfo); + + /* cleanup config strings */ + visual_mem_free(config.color_style); + visual_mem_free(config.signal_color); + visual_mem_free(config.background); + visual_mem_free(config.blur_style); + visual_mem_free(config.transition_speed); + visual_mem_free(config.blur_when); + visual_mem_free(config.blur_stencil); + visual_mem_free(config.fade_speed); + visual_mem_free(config.signal_style); + visual_mem_free(config.plot_style); + visual_mem_free(config.flash_style); + visual_mem_free(config.overall_effect); + visual_mem_free(config.floaters); + visual_mem_free(config.cpu_speed); + visual_mem_free(config.show_info); } - - diff --git a/libvisual-plugins/plugins/actor/blursk/blursk.h b/libvisual-plugins/plugins/actor/blursk/blursk.h index 78f74f2dc..58bbcc777 100644 --- a/libvisual-plugins/plugins/actor/blursk/blursk.h +++ b/libvisual-plugins/plugins/actor/blursk/blursk.h @@ -20,7 +20,6 @@ /* blursk.h */ - #ifndef BLURSK_H #define BLURSK_H @@ -28,54 +27,53 @@ #define VISUAL_PI 3.14159265358979 -#define QTY(array) (sizeof(array) / sizeof(*(array))) +#define QTY(array) (sizeof(array) / sizeof(*(array))) -#define rand_0_to(n) (visual_rand() % (n)) +#define rand_0_to(n) (visual_rand() % (n)) #define MAX(a, b) (a > b ? a : b) -#define MIN(a ,b) (a > b ? b : a) - -typedef struct -{ - /* dimensions */ - int width; - int height; - - /* color options */ - uint32_t color; - char *color_style; - char *fade_speed; - char *signal_color; - int contour_lines; - int hue_on_beats; - char *background; - - /* blur/fade options */ - char *blur_style; - char *transition_speed; - char *blur_when; - char *blur_stencil; - int slow_motion; - - /* other effects */ - char *signal_style; - char *plot_style; - int thick_on_beats; - char *flash_style; - char *overall_effect; - char *floaters; - - /* miscellany from the Advanced screen */ - char *cpu_speed; - char *show_info; - int info_timeout; - int show_timestamp; - - /* beat detector */ - int32_t beat_sensitivity; - - /* config-string */ - char *config_string; +#define MIN(a, b) (a > b ? b : a) + +typedef struct { + /* dimensions */ + int width; + int height; + + /* color options */ + uint32_t color; + char *color_style; + char *fade_speed; + char *signal_color; + int contour_lines; + int hue_on_beats; + char *background; + + /* blur/fade options */ + char *blur_style; + char *transition_speed; + char *blur_when; + char *blur_stencil; + int slow_motion; + + /* other effects */ + char *signal_style; + char *plot_style; + int thick_on_beats; + char *flash_style; + char *overall_effect; + char *floaters; + + /* miscellany from the Advanced screen */ + char *cpu_speed; + char *show_info; + int info_timeout; + int show_timestamp; + + /* beat detector */ + int32_t beat_sensitivity; + + /* config-string */ + char *config_string; } BlurskConfig; extern char config_default_color_style[]; @@ -95,27 +93,23 @@ extern char config_default_cpu_speed[]; extern char config_default_show_info[]; extern char config_default_fullscreen_method[]; - extern BlurskConfig config; -void __blursk_render_pcm (BlurskPrivate *priv, int16_t *pcmbuf); -void __blursk_init (BlurskPrivate *priv); -void __blursk_cleanup (BlurskPrivate *priv); - +void __blursk_render_pcm(BlurskPrivate *priv, int16_t *pcmbuf); +void __blursk_init(BlurskPrivate *priv); +void __blursk_cleanup(BlurskPrivate *priv); /* in config.c */ extern void config_change_param(BlurskPrivate *priv, VisParam *p); extern void config_default(BlurskConfig *conf); extern void config_string_genstring(BlurskPrivate *priv); - /* in blur.c */ extern int blur_stencil; extern int blur(BlurskPrivate *, int, int); extern char *blur_name(int); extern char *blur_when_name(int); - /* in blursk.c */ extern int blurskinfo; extern int nspectrums; @@ -123,21 +117,19 @@ extern void blursk_genrender(void); extern void blursk_event_newsong(VisSongInfo *newsong); extern char *floaters_name(int); - /* in color.c */ extern uint32_t colors[256]; extern void color_transition(BlurskPrivate *, int, int, int); extern void color_genmap(BlurskPrivate *, int); -extern void color_bg(BlurskPrivate *, int, int16_t*); +extern void color_bg(BlurskPrivate *, int, int16_t *); extern void color_cleanup(void); extern char *color_name(int); extern char *color_background_name(int); extern int color_good_for_bump(char *); extern void color_beat(BlurskPrivate *); - /* in img.c */ -#define IMG_PIXEL(x,y) (img_buf[(y) * img_bpl + (x)]) +#define IMG_PIXEL(x, y) (img_buf[(y)*img_bpl + (x)]) extern unsigned char *img_buf; extern unsigned char *img_prev; extern unsigned char *img_tmp; @@ -156,7 +148,6 @@ extern unsigned char *img_bump(int *, int *, int *); extern unsigned char *img_travel(int *, int *, int *); extern unsigned char *img_ripple(int *, int *, int *); - /* in loop.c or loopx86.s */ extern void loopblur(void); extern void loopsmear(void); @@ -169,14 +160,12 @@ extern void loopreduced4(void); extern void loopfade(int change); extern void loopinterp(void); - /* in render.c */ extern void render_dot(int x, int y, unsigned char color); extern void render(int thick, int center, int ndata, int16_t *data); extern char *render_plotname(int); extern char *signal_style_name(int i); - /* in bitmap.c */ extern int bitmap_index(char *str); extern int bitmap_test(int bindex, int x, int y); @@ -184,15 +173,13 @@ extern void bitmap_flash(int bindex); extern char *bitmap_flash_name(int i); extern char *bitmap_stencil_name(int i); - /* in paste.c */ extern BlurskConfig *paste_parsestring(char *str); extern char *paste_genstring(void); - /* in text.c */ -extern void textdraw(unsigned char *img, int height, int bpl, char *side, char *text); +extern void textdraw(unsigned char *img, int height, int bpl, char *side, + char *text); extern void convert_ms_to_timestamp(char *buf, int ms); #endif - diff --git a/libvisual-plugins/plugins/actor/blursk/color.c b/libvisual-plugins/plugins/actor/blursk/color.c index 347cc9717..923bbe5f6 100644 --- a/libvisual-plugins/plugins/actor/blursk/color.c +++ b/libvisual-plugins/plugins/actor/blursk/color.c @@ -72,9 +72,8 @@ #include "actor_blursk.h" #include "blursk.h" -typedef struct -{ - double hue, saturation, value; +typedef struct { + double hue, saturation, value; } hsv_t; /* This is where Blursk stores its version of the colors */ @@ -96,1116 +95,988 @@ static int32_t fromred, fromgreen, fromblue; static int32_t bgred, bggreen, bgblue; static char bgletter; /* first letter of chosen bkgnd, after "Random" */ -static int transition_bound; +static int transition_bound; /*---------------------------------------------------------------------------*/ /* Convert a color from RGB format to HSV format */ -static hsv_t *rgb_to_hsv(int32_t rgb) -{ - static hsv_t hsv; /* HSV value (saved between invocations */ - double r, g, b;/* the RGB components, in range 0.0 - 1.0 */ - double max, min;/* extremes from r, g, b */ - double delta; /* difference between max and min */ - - /* extract the RGB components from rgb */ - r = (double)((rgb >> 16) & 0xff) / 255.0; - g = (double)((rgb >> 8) & 0xff) / 255.0; - b = (double)(rgb & 0xff) / 255.0; - - /* find max and min */ - if (r > g) - { - max = (b > r) ? b : r; - min = (g > b) ? b : g; - } - else - { - max = (b > g) ? b : g; - min = (r > b) ? b : r; - } - - /* compute "value" */ - hsv.value = max; - - /* compute "saturation" */ - hsv.saturation = (max > 0.0) ? (max - min) / max : 0; - - /* compute "hue". This is the hard one */ - delta = max - min; - if (delta <= 0.001) - { - /* gray - any hue will work */ - hsv.hue = 0.0; - } - else - { - /* divide hexagonal color wheel into three sectors */ - if (max == r) - /* color is between yellow and magenta */ - hsv.hue = (g - b) / delta; - else if (max == g) - /* color is between cyan and yellow */ - hsv.hue = 2.0 + (b - r) / delta; - else /* max == b */ - /* color is between magenta and cyan */ - hsv.hue = 4.0 + (r - g) / delta; - - /* convert hue to degrees */ - hsv.hue *= 60.0; - - /* make sure hue is not negative */ - if (hsv.hue < 0.0) - hsv.hue += 360.0; - } - - /* return the computed color */ - return &hsv; +static hsv_t *rgb_to_hsv(int32_t rgb) { + static hsv_t hsv; /* HSV value (saved between invocations */ + double r, g, b; /* the RGB components, in range 0.0 - 1.0 */ + double max, min; /* extremes from r, g, b */ + double delta; /* difference between max and min */ + + /* extract the RGB components from rgb */ + r = (double)((rgb >> 16) & 0xff) / 255.0; + g = (double)((rgb >> 8) & 0xff) / 255.0; + b = (double)(rgb & 0xff) / 255.0; + + /* find max and min */ + if (r > g) { + max = (b > r) ? b : r; + min = (g > b) ? b : g; + } else { + max = (b > g) ? b : g; + min = (r > b) ? b : r; + } + + /* compute "value" */ + hsv.value = max; + + /* compute "saturation" */ + hsv.saturation = (max > 0.0) ? (max - min) / max : 0; + + /* compute "hue". This is the hard one */ + delta = max - min; + if (delta <= 0.001) { + /* gray - any hue will work */ + hsv.hue = 0.0; + } else { + /* divide hexagonal color wheel into three sectors */ + if (max == r) + /* color is between yellow and magenta */ + hsv.hue = (g - b) / delta; + else if (max == g) + /* color is between cyan and yellow */ + hsv.hue = 2.0 + (b - r) / delta; + else /* max == b */ + /* color is between magenta and cyan */ + hsv.hue = 4.0 + (r - g) / delta; + + /* convert hue to degrees */ + hsv.hue *= 60.0; + + /* make sure hue is not negative */ + if (hsv.hue < 0.0) + hsv.hue += 360.0; + } + + /* return the computed color */ + return &hsv; } - /* convert a color from HSV format to RGB format */ -static int32_t hsv_to_rgb(hsv_t *hsv) -{ - int32_t r, g, b;/* RGB color components */ - double h; /* copy of the "hsv.hue" */ - double i, f; /* integer and fractional parts of "h" */ - int p, q, t;/* permuted RGB values, in integer form */ - int v; /* "hsv.value", in integer form */ - - if (hsv->saturation < 0.01) - { - /* simple gray conversion */ - r = g = b = (int32_t)(hsv->value * 255.0); - } - else - { - /* convert hue to range [0,6) */ - h = hsv->hue / 60.0; - while (h >= 6.0) - h -= 6.0; - - /* break "h" down into integer and fractional parts. */ - i = floor(h); - f = h - i; - - /* compute the permuted RGB values */ - v = (int)(hsv->value * 255.0); - p = (int)((hsv->value * (1.0 - hsv->saturation)) * 255.0); - q = (int)((hsv->value * (1.0 - (hsv->saturation * f))) * 255.0); - t = (int)((hsv->value * (1.0 - (hsv->saturation * (1.0 - f)))) * 255.0); - - /* map v, p, q, and t into red, green, and blue values */ - switch ((int)i) - { - case 0: r = v, g = t, b = p; break; - case 1: r = q, g = v, b = p; break; - case 2: r = p, g = v, b = t; break; - case 3: r = p, g = q, b = v; break; - case 4: r = t, g = p, b = v; break; - default: r = v, g = p, b = q; break; - } +static int32_t hsv_to_rgb(hsv_t *hsv) { + int32_t r, g, b; /* RGB color components */ + double h; /* copy of the "hsv.hue" */ + double i, f; /* integer and fractional parts of "h" */ + int p, q, t; /* permuted RGB values, in integer form */ + int v; /* "hsv.value", in integer form */ + + if (hsv->saturation < 0.01) { + /* simple gray conversion */ + r = g = b = (int32_t)(hsv->value * 255.0); + } else { + /* convert hue to range [0,6) */ + h = hsv->hue / 60.0; + while (h >= 6.0) + h -= 6.0; + + /* break "h" down into integer and fractional parts. */ + i = floor(h); + f = h - i; + + /* compute the permuted RGB values */ + v = (int)(hsv->value * 255.0); + p = (int)((hsv->value * (1.0 - hsv->saturation)) * 255.0); + q = (int)((hsv->value * (1.0 - (hsv->saturation * f))) * 255.0); + t = (int)((hsv->value * (1.0 - (hsv->saturation * (1.0 - f)))) * 255.0); + + /* map v, p, q, and t into red, green, and blue values */ + switch ((int)i) { + case 0: + r = v, g = t, b = p; + break; + case 1: + r = q, g = v, b = p; + break; + case 2: + r = p, g = v, b = t; + break; + case 3: + r = p, g = q, b = v; + break; + case 4: + r = t, g = p, b = v; + break; + default: + r = v, g = p, b = q; + break; } + } - /* return the RGB value as a int32_t */ - return ((((int32_t)r & 0xff) << 16) - | (((int32_t)g & 0xff) << 8) - | ((int32_t)b & 0xff)); + /* return the RGB value as a int32_t */ + return ((((int32_t)r & 0xff) << 16) | (((int32_t)g & 0xff) << 8) | + ((int32_t)b & 0xff)); } - /*---------------------------------------------------------------------------*/ - /* The following functions are all possible values for stylefunc. A list of * them is stored at the end of the list. */ - -static int32_t dimming(int32_t i) -{ - return (((int32_t)(i * red / 256) << 16) - | ((int32_t)(i * green / 256) << 8) - | ((int32_t)(i * blue / 256)) - | ((255 - i) << 24)); +static int32_t dimming(int32_t i) { + return (((int32_t)(i * red / 256) << 16) | ((int32_t)(i * green / 256) << 8) | + ((int32_t)(i * blue / 256)) | ((255 - i) << 24)); } -static int32_t brightening(int32_t i) -{ - i = 255 - i; +static int32_t brightening(int32_t i) { + i = 255 - i; - return (((int32_t)(i * red / 256) << 16) - | ((int32_t)(i * green / 256) << 8) - | ((int32_t)(i * blue / 256)) - | ((255 - i) << 24)); + return (((int32_t)(i * red / 256) << 16) | ((int32_t)(i * green / 256) << 8) | + ((int32_t)(i * blue / 256)) | ((255 - i) << 24)); } -static int32_t milky(int32_t i) -{ - int32_t r, g, b, tmp, k; - if (i < 128) - { - r = i * red / 128; - g = i * green / 128; - b = i * blue / 128; - k = (127 - i) << 25; - } - else - { - tmp = 255 - i; - r = 255 - (255 - red) * tmp / 128; - g = 255 - (255 - green) * tmp / 128; - b = 255 - (255 - blue) * tmp / 128; - k = 0; - } - tmp = (r << 16) | (g << 8) | b; - if (*config.overall_effect == 'B') /* "Bump effect" */ - { +static int32_t milky(int32_t i) { + int32_t r, g, b, tmp, k; + if (i < 128) { + r = i * red / 128; + g = i * green / 128; + b = i * blue / 128; + k = (127 - i) << 25; + } else { + tmp = 255 - i; + r = 255 - (255 - red) * tmp / 128; + g = 255 - (255 - green) * tmp / 128; + b = 255 - (255 - blue) * tmp / 128; + k = 0; + } + tmp = (r << 16) | (g << 8) | b; + if (*config.overall_effect == 'B') /* "Bump effect" */ + { #if 0 if (i == 128) tmp -= (tmp >> 2) & 0x3f3f3f; else if (i == 127 || i == 129) tmp -= (tmp >> 3) & 0x1f1f1f; #else - if (i == 128) - { - tmp = (tmp >> 2) & 0x3f3f3f; - k = 0xc0000000; - } - else if (i == 127 || i == 129) - { - tmp = (tmp >> 1) & 0x7f7f7f; - k = 0x80000000; - } -#endif - } - return tmp | k; -} - -static int32_t cloud(int32_t i) -{ - int32_t faded; /* r/g/b level of gray version of color */ - int32_t r, g, b, k; - - /* Compute the gray version */ - faded = (red * 4 + green * 5 + blue * 3) / 12; - - /* handle a few specific colors */ - if (i == 128 && *config.overall_effect == 'B') /* "Bump effect" */ - { - /* Use the given color */ - r = red; - g = green; - b = blue; - k = 0; - } - else if ((i == 129 || i == 127) && *config.overall_effect == 'B') /* "Bump effect" */ - { - /* Use a faded version of the color */ - r = (red + faded) / 2; - g = (green + faded) / 2; - b = (blue + faded) / 2; - k = 0; - } - else if (i > 192) - { - /* transition between the given color and white */ - i -= 192; - r = (red * i + 255 * (63 - i)) / 64; - g = (green * i + 255 * (63 - i)) / 64; - b = (blue * i + 255 * (63 - i)) / 64; - k = 0; - } - else if (i > 128) - { - /* transition between white and faded */ - i -= 128; - r = g = b = (255 * i + faded * (63 - i)) / 64; - k = 0; - } - else - { - /* transition between faded and black */ - r = g = b = faded * i / 128; - k = (127 - i) << 25; - } - - /* Construct a color value from r/g/b, and return it */ - return (r << 16) | (g << 8) | b | k; -} - -static int32_t metal(int32_t i) -{ - int32_t r, g, b, k; - - if (i < 128) - { - r = red; - g = green; - b = blue; - } - else - { - r = g = b = 0xe0; - i = 255 - i; + if (i == 128) { + tmp = (tmp >> 2) & 0x3f3f3f; + k = 0xc0000000; + } else if (i == 127 || i == 129) { + tmp = (tmp >> 1) & 0x7f7f7f; + k = 0x80000000; } - if (i > 120) - { - i = 120 - (i - 120) * 120 / 7; - } - r = r * i / 120; - g = g * i / 120; - b = b * i / 120; - k = (120 - i) << 25; - return ((r << 16) | (g << 8) | b | k); +#endif + } + return tmp | k; } -static int32_t layers(int32_t i) -{ - int32_t k; - - /* compute the brightness */ - if (i < 0x40) - { - k = 63 - i; - i = i << 2; - } - else if (i < 0x80) - { - k = 0; - i = (i << 2) & 0xff; - } - else - { - k = 0; - i = (i << 1) & 0xff; - } - - /* set this color */ - return (((int32_t)(i * red / 256) << 16) - | ((int32_t)(i * green / 256) << 8) - | ((int32_t)(i * blue / 256)) - | (k << 26)); -} +static int32_t cloud(int32_t i) { + int32_t faded; /* r/g/b level of gray version of color */ + int32_t r, g, b, k; -static int32_t colorlayers(int32_t i) -{ - int32_t tmp, r, g, b, k; + /* Compute the gray version */ + faded = (red * 4 + green * 5 + blue * 3) / 12; - /* shift the hue */ + /* handle a few specific colors */ + if (i == 128 && *config.overall_effect == 'B') /* "Bump effect" */ + { + /* Use the given color */ r = red; g = green; b = blue; - switch (i & 0xc0) - { - case 0x00: - tmp = r; - r = (r + g * 2) / 3; - g = (g + b * 2) / 3; - b = (b + tmp * 2) / 3; - /* fall through, so color gets shifted twice... */ - - case 0x40: - tmp = r; - r = (r + g * 2) / 3; - g = (g + b * 2) / 3; - b = (b + tmp * 2) / 3; - break; - } - - /* compute the brightness and k */ - if (i < 0x40) - { - tmp = i << 2; - k = 63 - i; - } - else if (i < 0x80) - { - tmp = (i << 2) & 0xff; - k = 0; - } - else - { - tmp = (i << 1) & 0xff; - k = 0; - } - - /* set this color */ - return (((int32_t)(tmp * r / 256) << 16) - | ((int32_t)(tmp * g / 256) << 8) - | ((int32_t)(tmp * b / 256)) - | k << 26); + k = 0; + } else if ((i == 129 || i == 127) && + *config.overall_effect == 'B') /* "Bump effect" */ + { + /* Use a faded version of the color */ + r = (red + faded) / 2; + g = (green + faded) / 2; + b = (blue + faded) / 2; + k = 0; + } else if (i > 192) { + /* transition between the given color and white */ + i -= 192; + r = (red * i + 255 * (63 - i)) / 64; + g = (green * i + 255 * (63 - i)) / 64; + b = (blue * i + 255 * (63 - i)) / 64; + k = 0; + } else if (i > 128) { + /* transition between white and faded */ + i -= 128; + r = g = b = (255 * i + faded * (63 - i)) / 64; + k = 0; + } else { + /* transition between faded and black */ + r = g = b = faded * i / 128; + k = (127 - i) << 25; + } + + /* Construct a color value from r/g/b, and return it */ + return (r << 16) | (g << 8) | b | k; } -static int32_t colorstandoff(int32_t i) -{ - int32_t tmp, r, g, b, k; +static int32_t metal(int32_t i) { + int32_t r, g, b, k; - /* shift the hue */ + if (i < 128) { r = red; g = green; b = blue; - switch (i & 0xc0) - { - case 0x00: - tmp = r; - r = (r + g * 2) / 3; - g = (g + b * 2) / 3; - b = (b + tmp * 2) / 3; - /* fallthrough, so color gets shifted twice... */ - - case 0x40: - tmp = r; - r = (r + g * 2) / 3; - g = (g + b * 2) / 3; - b = (b + tmp * 2) / 3; - break; - } - - /* compute the brightness and k */ - if (i < 0x80) - { - tmp = (i & 0x3f) << 3; - } - else - { - tmp = (i & 0x7f) << 2; - } - if (tmp >= 256) - tmp = 511 - tmp; - if (i < 0x20) - k = (31 - i); - else - k = 0; - - /* set this color */ - return (((int32_t)(tmp * r / 256) << 16) - | ((int32_t)(tmp * g / 256) << 8) - | ((int32_t)(tmp * b / 256)) - | k << 27); + } else { + r = g = b = 0xe0; + i = 255 - i; + } + if (i > 120) { + i = 120 - (i - 120) * 120 / 7; + } + r = r * i / 120; + g = g * i / 120; + b = b * i / 120; + k = (120 - i) << 25; + return ((r << 16) | (g << 8) | b | k); } -static int32_t flame(int32_t i) -{ - hsv_t hsv; - int32_t k; - - /* Get the base color */ - hsv = *rgb_to_hsv(config.color); +static int32_t layers(int32_t i) { + int32_t k; - /* Change the hue, and maybe brightness, depending on i */ - hsv.hue += (255 - i) / 4; - if (hsv.hue >= 360.0) - hsv.hue -= 360.0; + /* compute the brightness */ + if (i < 0x40) { + k = 63 - i; + i = i << 2; + } else if (i < 0x80) { k = 0; - if (i < 64) - { - hsv.value *= (double)i / 64.0; - k = 63 - i; - } - else if (i > 192) - hsv.value *= (double)(319 - i) / 128; + i = (i << 2) & 0xff; + } else { + k = 0; + i = (i << 1) & 0xff; + } - /* Convert it back to RGB */ - return hsv_to_rgb(&hsv) | (k << 26); + /* set this color */ + return (((int32_t)(i * red / 256) << 16) | ((int32_t)(i * green / 256) << 8) | + ((int32_t)(i * blue / 256)) | (k << 26)); } -static int32_t rainbow(int32_t i) -{ - hsv_t hsv; - int32_t k; - - /* Get the base color */ - hsv = *rgb_to_hsv(config.color); - - /* Change the hue, and maybe brightness, depending on i */ - hsv.hue += 2 * (255 - i); - if (hsv.hue >= 360.0) - hsv.hue -= 360.0; - if (i < 64) - { - hsv.value *= (double)i / 64.0; - k = (255 - i) << 26; - } - else - k = 0; +static int32_t colorlayers(int32_t i) { + int32_t tmp, r, g, b, k; + + /* shift the hue */ + r = red; + g = green; + b = blue; + switch (i & 0xc0) { + case 0x00: + tmp = r; + r = (r + g * 2) / 3; + g = (g + b * 2) / 3; + b = (b + tmp * 2) / 3; + /* fall through, so color gets shifted twice... */ + + case 0x40: + tmp = r; + r = (r + g * 2) / 3; + g = (g + b * 2) / 3; + b = (b + tmp * 2) / 3; + break; + } + + /* compute the brightness and k */ + if (i < 0x40) { + tmp = i << 2; + k = 63 - i; + } else if (i < 0x80) { + tmp = (i << 2) & 0xff; + k = 0; + } else { + tmp = (i << 1) & 0xff; + k = 0; + } - /* Convert it back to RGB */ - return hsv_to_rgb(&hsv) | k; + /* set this color */ + return (((int32_t)(tmp * r / 256) << 16) | ((int32_t)(tmp * g / 256) << 8) | + ((int32_t)(tmp * b / 256)) | k << 26); } -static int32_t standoff(int32_t i) -{ - int k; - - /* compute the brightness */ +static int32_t colorstandoff(int32_t i) { + int32_t tmp, r, g, b, k; + + /* shift the hue */ + r = red; + g = green; + b = blue; + switch (i & 0xc0) { + case 0x00: + tmp = r; + r = (r + g * 2) / 3; + g = (g + b * 2) / 3; + b = (b + tmp * 2) / 3; + /* fallthrough, so color gets shifted twice... */ + + case 0x40: + tmp = r; + r = (r + g * 2) / 3; + g = (g + b * 2) / 3; + b = (b + tmp * 2) / 3; + break; + } + + /* compute the brightness and k */ + if (i < 0x80) { + tmp = (i & 0x3f) << 3; + } else { + tmp = (i & 0x7f) << 2; + } + if (tmp >= 256) + tmp = 511 - tmp; + if (i < 0x20) + k = (31 - i); + else k = 0; - if (i >= 128) - { - i = 0; - } - else - { - if (i >= 64) - i = (128 - i) * 4; - else - { - i *= 4; - k = 255 - i; - } - if (i > 254) - i = 254; - } - /* set this color */ - return (((int32_t)(i * red / 256) << 16) - | ((int32_t)(i * green / 256) << 8) - | ((int32_t)(i * blue / 256)) - | (k << 24)); + /* set this color */ + return (((int32_t)(tmp * r / 256) << 16) | ((int32_t)(tmp * g / 256) << 8) | + ((int32_t)(tmp * b / 256)) | k << 27); } -static int32_t threshold(int32_t i) -{ - /* always return the base color. This is only interesting when it - * is modified via contour lines, or by the standard rule that color - * 0 is always black. - */ - return config.color; +static int32_t flame(int32_t i) { + hsv_t hsv; + int32_t k; + + /* Get the base color */ + hsv = *rgb_to_hsv(config.color); + + /* Change the hue, and maybe brightness, depending on i */ + hsv.hue += (255 - i) / 4; + if (hsv.hue >= 360.0) + hsv.hue -= 360.0; + k = 0; + if (i < 64) { + hsv.value *= (double)i / 64.0; + k = 63 - i; + } else if (i > 192) + hsv.value *= (double)(319 - i) / 128; + + /* Convert it back to RGB */ + return hsv_to_rgb(&hsv) | (k << 26); } -static int32_t stripes(int32_t i) -{ - int32_t tmp, k; - - /* compute the brightness and k */ +static int32_t rainbow(int32_t i) { + hsv_t hsv; + int32_t k; + + /* Get the base color */ + hsv = *rgb_to_hsv(config.color); + + /* Change the hue, and maybe brightness, depending on i */ + hsv.hue += 2 * (255 - i); + if (hsv.hue >= 360.0) + hsv.hue -= 360.0; + if (i < 64) { + hsv.value *= (double)i / 64.0; + k = (255 - i) << 26; + } else k = 0; - if (i >= 0xd0) - { - tmp = 254; - } - else - { - switch (i & 0x18) - { - case 0x00: tmp = (i & 0x7) << 5; break; - case 0x18: tmp = ((~i) & 0x7) << 5; break; - default: tmp = 254; - } - if (i < 64) - { - tmp = (tmp * i) >> 6; - k = 63 - i; - } - } - /* set this color */ - return (((int32_t)(tmp * red / 256) << 16) - | ((int32_t)(tmp * green / 256) << 8) - | ((int32_t)(tmp * blue / 256)) - | (k << 26)); + /* Convert it back to RGB */ + return hsv_to_rgb(&hsv) | k; } -static int32_t colorstripes(int32_t i) -{ - int32_t r, g, b, k, tmp; - static int32_t brightness[] = {0, 64, 128, 192, 254, 254, 254, 254, 254, 254, 254, 254, 254, 192, 128, 64}; - - /* compute the hue */ - tmp = i & 0x30; - switch (i & 0xc0) - { - case 0x40: - r = (green * tmp + red * (0x3f - tmp)) >> 6; - g = (blue * tmp + green * (0x3f - tmp)) >> 6; - b = (red * tmp + blue * (0x3f - tmp)) >> 6; - break; - - case 0x80: - r = (blue * tmp + green * (0x3f - tmp)) >> 6; - g = (red * tmp + blue * (0x3f - tmp)) >> 6; - b = (green * tmp + red * (0x3f - tmp)) >> 6; - break; - - default: - r = (red * tmp + blue * (0x3f - tmp)) >> 6; - g = (green * tmp + red * (0x3f - tmp)) >> 6; - b = (blue * tmp + green * (0x3f - tmp)) >> 6; +static int32_t standoff(int32_t i) { + int k; + + /* compute the brightness */ + k = 0; + if (i >= 128) { + i = 0; + } else { + if (i >= 64) + i = (128 - i) * 4; + else { + i *= 4; + k = 255 - i; } + if (i > 254) + i = 254; + } - /* compute the brightness and k */ - k = 0; - if (i >= 0xf0) - { - tmp = 254; - } - else - { - tmp = brightness[i & 0xf]; - if (i < 64) - { - tmp = (tmp * i) >> 6; - k = 64 - i; - } - } - - /* set this color */ - return (((int32_t)(tmp * r / 256) << 16) - | ((int32_t)(tmp * g / 256) << 8) - | ((int32_t)(tmp * b / 256)) - | (k << 26)); + /* set this color */ + return (((int32_t)(i * red / 256) << 16) | ((int32_t)(i * green / 256) << 8) | + ((int32_t)(i * blue / 256)) | (k << 24)); } -static int32_t colorbands(int32_t i) -{ - int32_t r, g, b, k, tmp; - - /* compute the hue */ - tmp = i & 0x20; - switch (i & 0xc0) - { - case 0x40: - r = (green * tmp + red * (0x3f - tmp)) >> 6; - g = (blue * tmp + green * (0x3f - tmp)) >> 6; - b = (red * tmp + blue * (0x3f - tmp)) >> 6; - break; - - case 0x80: - r = (blue * tmp + green * (0x3f - tmp)) >> 6; - g = (red * tmp + blue * (0x3f - tmp)) >> 6; - b = (green * tmp + red * (0x3f - tmp)) >> 6; - break; - - default: - r = (red * tmp + blue * (0x3f - tmp)) >> 6; - g = (green * tmp + red * (0x3f - tmp)) >> 6; - b = (blue * tmp + green * (0x3f - tmp)) >> 6; - } +static int32_t threshold(int32_t i) { + /* always return the base color. This is only interesting when it + * is modified via contour lines, or by the standard rule that color + * 0 is always black. + */ + return config.color; +} - /* compute the brightness & k */ - if (i >= 0x40) - { - tmp = 254; - k = 0; +static int32_t stripes(int32_t i) { + int32_t tmp, k; + + /* compute the brightness and k */ + k = 0; + if (i >= 0xd0) { + tmp = 254; + } else { + switch (i & 0x18) { + case 0x00: + tmp = (i & 0x7) << 5; + break; + case 0x18: + tmp = ((~i) & 0x7) << 5; + break; + default: + tmp = 254; } - else - { - tmp = i * 4; - k = 63 - i; + if (i < 64) { + tmp = (tmp * i) >> 6; + k = 63 - i; } + } - /* set this color */ - return (((int32_t)(tmp * r / 256) << 16) - | ((int32_t)(tmp * g / 256) << 8) - | ((int32_t)(tmp * b / 256)) - | (k << 26)); + /* set this color */ + return (((int32_t)(tmp * red / 256) << 16) | + ((int32_t)(tmp * green / 256) << 8) | ((int32_t)(tmp * blue / 256)) | + (k << 26)); } -static int32_t graying(int32_t i) -{ - int32_t faded, tmp; +static int32_t colorstripes(int32_t i) { + int32_t r, g, b, k, tmp; + static int32_t brightness[] = {0, 64, 128, 192, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 192, 128, 64}; + + /* compute the hue */ + tmp = i & 0x30; + switch (i & 0xc0) { + case 0x40: + r = (green * tmp + red * (0x3f - tmp)) >> 6; + g = (blue * tmp + green * (0x3f - tmp)) >> 6; + b = (red * tmp + blue * (0x3f - tmp)) >> 6; + break; + + case 0x80: + r = (blue * tmp + green * (0x3f - tmp)) >> 6; + g = (red * tmp + blue * (0x3f - tmp)) >> 6; + b = (green * tmp + red * (0x3f - tmp)) >> 6; + break; + + default: + r = (red * tmp + blue * (0x3f - tmp)) >> 6; + g = (green * tmp + red * (0x3f - tmp)) >> 6; + b = (blue * tmp + green * (0x3f - tmp)) >> 6; + } + + /* compute the brightness and k */ + k = 0; + if (i >= 0xf0) { + tmp = 254; + } else { + tmp = brightness[i & 0xf]; + if (i < 64) { + tmp = (tmp * i) >> 6; + k = 64 - i; + } + } - /* Compute the fully faded color's intensity. Note that we actually - * make it slightly dimmer than the base color, because it seems to - * look better that way. - */ - faded = (red * 4 + green * 5 + blue * 3) / 16; + /* set this color */ + return (((int32_t)(tmp * r / 256) << 16) | ((int32_t)(tmp * g / 256) << 8) | + ((int32_t)(tmp * b / 256)) | (k << 26)); +} - /* colormap is divided into two phases: fading and dimming */ - if (i < 64) - { - /* full gray, becoming dimmer */ - return ((faded * i * 4) >> 8) * 0x010101 | ((63 - i) << 26); - } - else - { - /* full brightness, but fading to gray */ - i -= 64; - tmp = 192 - i; - return (((i * red + tmp * faded) / 192) << 16) - | (((i * green + tmp * faded) / 192) << 8) - | ((i * blue + tmp * faded) / 192); - } +static int32_t colorbands(int32_t i) { + int32_t r, g, b, k, tmp; + + /* compute the hue */ + tmp = i & 0x20; + switch (i & 0xc0) { + case 0x40: + r = (green * tmp + red * (0x3f - tmp)) >> 6; + g = (blue * tmp + green * (0x3f - tmp)) >> 6; + b = (red * tmp + blue * (0x3f - tmp)) >> 6; + break; + + case 0x80: + r = (blue * tmp + green * (0x3f - tmp)) >> 6; + g = (red * tmp + blue * (0x3f - tmp)) >> 6; + b = (green * tmp + red * (0x3f - tmp)) >> 6; + break; + + default: + r = (red * tmp + blue * (0x3f - tmp)) >> 6; + g = (green * tmp + red * (0x3f - tmp)) >> 6; + b = (blue * tmp + green * (0x3f - tmp)) >> 6; + } + + /* compute the brightness & k */ + if (i >= 0x40) { + tmp = 254; + k = 0; + } else { + tmp = i * 4; + k = 63 - i; + } + + /* set this color */ + return (((int32_t)(tmp * r / 256) << 16) | ((int32_t)(tmp * g / 256) << 8) | + ((int32_t)(tmp * b / 256)) | (k << 26)); } -static int32_t noise(int32_t i) -{ - if (rand_0_to(256) < i) - return config.color; - else - return 0xff000000; +static int32_t graying(int32_t i) { + int32_t faded, tmp; + + /* Compute the fully faded color's intensity. Note that we actually + * make it slightly dimmer than the base color, because it seems to + * look better that way. + */ + faded = (red * 4 + green * 5 + blue * 3) / 16; + + /* colormap is divided into two phases: fading and dimming */ + if (i < 64) { + /* full gray, becoming dimmer */ + return ((faded * i * 4) >> 8) * 0x010101 | ((63 - i) << 26); + } else { + /* full brightness, but fading to gray */ + i -= 64; + tmp = 192 - i; + return (((i * red + tmp * faded) / 192) << 16) | + (((i * green + tmp * faded) / 192) << 8) | + ((i * blue + tmp * faded) / 192); + } +} + +static int32_t noise(int32_t i) { + if (rand_0_to(256) < i) + return config.color; + else + return 0xff000000; } /* This is a list of the known color styles */ -static struct colorstyles -{ - char *name; - int32_t (*func)(int32_t); - int good_for_bump; -} colorstyles[17] = -{ - {"Dimming", dimming, TRUE}, - {"Brightening", brightening, TRUE}, - {"Milky", milky, TRUE}, - {"Graying", graying, TRUE}, - {"Flame", flame, TRUE}, - {"Cloud", cloud, TRUE}, - {"Metal", metal, TRUE}, - {"Layers", layers, FALSE}, - {"Color layers", colorlayers, FALSE}, - {"Standoff", standoff, FALSE}, - {"Color standoff", colorstandoff, FALSE}, - {"Threshold", threshold, FALSE}, - {"Stripes", stripes, FALSE}, - {"Color stripes", colorstripes, FALSE}, - {"Color bands", colorbands, FALSE}, - {"Rainbow", rainbow, FALSE}, - {"Noise", noise, FALSE} -}; +static struct colorstyles { + char *name; + int32_t (*func)(int32_t); + int good_for_bump; +} colorstyles[17] = {{"Dimming", dimming, TRUE}, + {"Brightening", brightening, TRUE}, + {"Milky", milky, TRUE}, + {"Graying", graying, TRUE}, + {"Flame", flame, TRUE}, + {"Cloud", cloud, TRUE}, + {"Metal", metal, TRUE}, + {"Layers", layers, FALSE}, + {"Color layers", colorlayers, FALSE}, + {"Standoff", standoff, FALSE}, + {"Color standoff", colorstandoff, FALSE}, + {"Threshold", threshold, FALSE}, + {"Stripes", stripes, FALSE}, + {"Color stripes", colorstripes, FALSE}, + {"Color bands", colorbands, FALSE}, + {"Rainbow", rainbow, FALSE}, + {"Noise", noise, FALSE}}; /* Compute the color of a single cell in the colormap. This uses (*stylefunc)() * and also checks the other relevant options. */ -static int32_t cell(int i) -{ - int32_t c; - - /* The white_signal option forces color 255 to be white */ - if (i == 255 && *config.signal_color == 'W') - return 0x00ffffff; - - /* The last three cells are always the background color */ - if (i < 3) - return 0xff000000; - - /* We can also force contour lines to be white. These look - * better if we also have a half-white/half-colored value on - * either side of it; notice the tricky way we accomplish that. - */ - if (config.contour_lines) - { - switch ((i + 8) & 0x1f) - { - case 0x00: - case 0x01: - case 0x1f: - case 0x1e: - /* solid white */ - c = 0x00ffffff; - break; - - case 0x02: - case 0x1d: - /* mixed white & computed color*/ - c = (*stylefunc)(i); - c = (((c & 0xfefefe) + 0xfefefe) / 2); - break; - - default: - /* Just compute the color */ - c = (*stylefunc)(i); - } +static int32_t cell(int i) { + int32_t c; + + /* The white_signal option forces color 255 to be white */ + if (i == 255 && *config.signal_color == 'W') + return 0x00ffffff; + + /* The last three cells are always the background color */ + if (i < 3) + return 0xff000000; + + /* We can also force contour lines to be white. These look + * better if we also have a half-white/half-colored value on + * either side of it; notice the tricky way we accomplish that. + */ + if (config.contour_lines) { + switch ((i + 8) & 0x1f) { + case 0x00: + case 0x01: + case 0x1f: + case 0x1e: + /* solid white */ + c = 0x00ffffff; + break; + + case 0x02: + case 0x1d: + /* mixed white & computed color*/ + c = (*stylefunc)(i); + c = (((c & 0xfefefe) + 0xfefefe) / 2); + break; + + default: + /* Just compute the color */ + c = (*stylefunc)(i); } - else - c = (*stylefunc)(i); + } else + c = (*stylefunc)(i); - /* Return the color */ - return c; + /* Return the color */ + return c; } -static void choosebg(int do_random) -{ - /* "Random", then choose a background */ - if (do_random) - { - if (!strncmp(config.background, "Random", 6)) - bgletter = "BWDSCF"[rand_0_to(6)]; - else - bgletter = *config.background; +static void choosebg(int do_random) { + /* "Random", then choose a background */ + if (do_random) { + if (!strncmp(config.background, "Random", 6)) + bgletter = "BWDSCF"[rand_0_to(6)]; + else + bgletter = *config.background; + } + + /* Choose new background color. Note that we don't handle + * "Flash bkgnd" here. + */ + switch (bgletter) { + case 'W': /* White bkgnd */ + tored = togreen = toblue = 230; + break; + + case 'D': /* Dark bkgnd */ + tored = red / 2; + togreen = green / 2; + toblue = blue / 2; + break; + + case 'S': /* Shift bkgnd */ + tored = blue; + togreen = red; + toblue = green; + break; + + case 'C': /* Color bkgnd */ + if (do_random) { + tored = rand_0_to(255); + togreen = rand_0_to(255); + toblue = rand_0_to(255); + } else { + tored = fromred; + togreen = fromgreen; + toblue = fromblue; } + break; - /* Choose new background color. Note that we don't handle - * "Flash bkgnd" here. - */ - switch (bgletter) - { - case 'W': /* White bkgnd */ - tored = togreen = toblue = 230; - break; - - case 'D': /* Dark bkgnd */ - tored = red / 2; - togreen = green / 2; - toblue = blue / 2; - break; - - case 'S': /* Shift bkgnd */ - tored = blue; - togreen = red; - toblue = green; - break; - - case 'C': /* Color bkgnd */ - if (do_random) - { - tored = rand_0_to(255); - togreen = rand_0_to(255); - toblue = rand_0_to(255); - } - else - { - tored = fromred; - togreen = fromgreen; - toblue = fromblue; - } - break; - - default: /* Black bkgnd, and also fake Flash bkgnd */ - tored = togreen = toblue = 0; - } - tonew = TRUE; + default: /* Black bkgnd, and also fake Flash bkgnd */ + tored = togreen = toblue = 0; + } + tonew = TRUE; } - /* This recalculates a portion of the colors, and then activates the new * colormap. If from==scale then it also chooses a new random color style. * This is called from blur() during its transitions. */ -void color_transition( - BlurskPrivate *priv, - int from, /* highest-numbered cell to change, scaled */ - int to, /* lowest-numbered cell to change, scaled */ - int scale) /* highest possible value of to & from */ +void color_transition(BlurskPrivate *priv, + int from, /* highest-numbered cell to change, scaled */ + int to, /* lowest-numbered cell to change, scaled */ + int scale) /* highest possible value of to & from */ { - VisColor *pal_colors = visual_palette_get_colors (priv->pal); + VisColor *pal_colors = visual_palette_get_colors(priv->pal); #if 1 - if (to < 0) - to = 0; + if (to < 0) + to = 0; #endif - /* Choose a random "Colored background" color at the start of the - * transition, if necessary - */ - if (from == scale) - { - /* Previous transition must be complete, I guess */ - fromred = tored; - fromgreen = togreen; - fromblue = toblue; - - choosebg(TRUE); - } - - /* Do the background color transition */ - if (to <= 0) - { - bgred = tored; - bggreen = togreen; - bgblue = toblue; - } - else - { - bgred = (tored * (scale - to) + fromred * to) / scale; - bggreen = (togreen * (scale - to) + fromgreen * to) / scale; - bgblue = (toblue * (scale - to) + fromblue * to) / scale; - } - - /* if colorstyle isn't "random" then do nothing more */ - if (strcmp(config.color_style, "Random")) - return; - - /* if from==scale then choose a new random color style */ - if (from == scale) - stylefunc = colorstyles[rand_0_to(QTY(colorstyles))].func; - - /* scale the numbers to match the size of the color table */ - from = from * 255 / scale; - to = to * 255 / scale; - - /* recompute ONLY the affected cells */ - for (; from > to; from--) - { - colors[from] = cell(from); - visual_color_set_from_uint32(&pal_colors[from], colors[from]); - } - - /* Adjust the background, and then activate the new colormap. */ - tonew = TRUE; - color_bg(priv, 0, NULL); - - /* Remember the lower bound of the transition. Other color changes - * will be limited to be no lower than this value, so that changing - * the hue or contour won't defeat the gradual transition. (The - * hue or contour change will be effected for the remaining color - * cells as a natural consequence of the transition.) - */ - transition_bound = to; + /* Choose a random "Colored background" color at the start of the + * transition, if necessary + */ + if (from == scale) { + /* Previous transition must be complete, I guess */ + fromred = tored; + fromgreen = togreen; + fromblue = toblue; + + choosebg(TRUE); + } + + /* Do the background color transition */ + if (to <= 0) { + bgred = tored; + bggreen = togreen; + bgblue = toblue; + } else { + bgred = (tored * (scale - to) + fromred * to) / scale; + bggreen = (togreen * (scale - to) + fromgreen * to) / scale; + bgblue = (toblue * (scale - to) + fromblue * to) / scale; + } + + /* if colorstyle isn't "random" then do nothing more */ + if (strcmp(config.color_style, "Random")) + return; + + /* if from==scale then choose a new random color style */ + if (from == scale) + stylefunc = colorstyles[rand_0_to(QTY(colorstyles))].func; + + /* scale the numbers to match the size of the color table */ + from = from * 255 / scale; + to = to * 255 / scale; + + /* recompute ONLY the affected cells */ + for (; from > to; from--) { + colors[from] = cell(from); + visual_color_set_from_uint32(&pal_colors[from], colors[from]); + } + + /* Adjust the background, and then activate the new colormap. */ + tonew = TRUE; + color_bg(priv, 0, NULL); + + /* Remember the lower bound of the transition. Other color changes + * will be limited to be no lower than this value, so that changing + * the hue or contour won't defeat the gradual transition. (The + * hue or contour change will be effected for the remaining color + * cells as a natural consequence of the transition.) + */ + transition_bound = to; } - /* Generate a colormap, and install it. This function is called once when the * plugin starts, and again whenever the configuration is changed in a way * which affects the colormap. */ -void color_genmap(BlurskPrivate *priv, int do_random) -{ - VisColor *pal_colors = visual_palette_get_colors (priv->pal); - int32_t i; - - /* Decompose the dominant color into R/G/B components */ - red = (int32_t)(config.color / 0x10000); - green = (int32_t)((config.color % 0x10000)/0x100); - blue = (int32_t)(config.color % 0x100); - - /* Choose a new background, if appropriate */ - choosebg(do_random); - bgred = fromred = tored; - bggreen = fromgreen = togreen; - bgblue = fromblue = toblue; - tonew = TRUE; - - /* Find the name in the colorstyles[] table */ - if ((do_random || !stylefunc) && !strcmp(config.color_style, "Random")) - { - /* Choose a "Random" colorstyle */ - stylefunc = colorstyles[rand_0_to(QTY(colorstyles))].func; - } - else if (!stylefunc || strcmp(config.color_style, "Random")) - { - /* Use the named colorstyle */ - for (i = 0; - i < QTY(colorstyles) - && strcmp(colorstyles[i].name, config.color_style); - i++) - { - } - if (i >= QTY(colorstyles)) - i = 0; - stylefunc = colorstyles[i].func; - - /* Transitions only affect "Random" colorstyle, not this one */ - transition_bound = 0; - } - - /* Generate the basic colormap */ - for (i = 255; i >= transition_bound; i--) - { - colors[i] = cell(i); - visual_color_set_from_uint32(&pal_colors[i], colors[i]); +void color_genmap(BlurskPrivate *priv, int do_random) { + VisColor *pal_colors = visual_palette_get_colors(priv->pal); + int32_t i; + + /* Decompose the dominant color into R/G/B components */ + red = (int32_t)(config.color / 0x10000); + green = (int32_t)((config.color % 0x10000) / 0x100); + blue = (int32_t)(config.color % 0x100); + + /* Choose a new background, if appropriate */ + choosebg(do_random); + bgred = fromred = tored; + bggreen = fromgreen = togreen; + bgblue = fromblue = toblue; + tonew = TRUE; + + /* Find the name in the colorstyles[] table */ + if ((do_random || !stylefunc) && !strcmp(config.color_style, "Random")) { + /* Choose a "Random" colorstyle */ + stylefunc = colorstyles[rand_0_to(QTY(colorstyles))].func; + } else if (!stylefunc || strcmp(config.color_style, "Random")) { + /* Use the named colorstyle */ + for (i = 0; i < QTY(colorstyles) && + strcmp(colorstyles[i].name, config.color_style); + i++) { } - - /* Adjust the background, and then activate the new colormap. */ - tonew = TRUE; - color_bg(priv, 0, NULL); + if (i >= QTY(colorstyles)) + i = 0; + stylefunc = colorstyles[i].func; + + /* Transitions only affect "Random" colorstyle, not this one */ + transition_bound = 0; + } + + /* Generate the basic colormap */ + for (i = 255; i >= transition_bound; i--) { + colors[i] = cell(i); + visual_color_set_from_uint32(&pal_colors[i], colors[i]); + } + + /* Adjust the background, and then activate the new colormap. */ + tonew = TRUE; + color_bg(priv, 0, NULL); } /* This function is called once for each frame, before the frame's image is * output. It adjusts the colormap's background color in response to the music. */ -void color_bg(BlurskPrivate *priv, int ndata, int16_t *data) -{ - VisColor *pal_colors = visual_palette_get_colors (priv->pal); - - int32_t bgr, bgb, bgg, k, bg; - int i, j; - int16_t max, min; - int32_t totdelta; - int32_t newcolors[256]; - static int32_t fallr, fallg, fallb; - - /* if we aren't doing "Flash bkgnd" and we've reached our final color, - * then do nothing - */ - if (bgletter != 'F' - && bgred == tored && bggreen == togreen && bgblue == toblue) - { - if (!tonew) - return; - tonew = FALSE; +void color_bg(BlurskPrivate *priv, int ndata, int16_t *data) { + VisColor *pal_colors = visual_palette_get_colors(priv->pal); + + int32_t bgr, bgb, bgg, k, bg; + int i, j; + int16_t max, min; + int32_t totdelta; + int32_t newcolors[256]; + static int32_t fallr, fallg, fallb; + + /* if we aren't doing "Flash bkgnd" and we've reached our final color, + * then do nothing + */ + if (bgletter != 'F' && bgred == tored && bggreen == togreen && + bgblue == toblue) { + if (!tonew) + return; + tonew = FALSE; + } + + /* force colors[0] to be the background color */ + colors[0] = 0xff000000; + + /* compute the RGB background color, based on data */ + if (bgletter != 'F' || ndata == 0) { + /* Use the transition colors */ + bgr = bgred; + bgg = bggreen; + bgb = bgblue; + } else /* "Flash bkgnd" */ + { + if (nspectrums == 0) { + /* data is samples */ + + /* examine the data */ + max = min = data[0]; + totdelta = 0; + for (i = 1; i < ndata; i++) { + if (data[i] < min) + min = data[i]; + else if (data[i] > max) + max = data[i]; + totdelta += abs(data[i] - data[i - 1]); + } + + /* compute red from the difference between max & min */ + bgr = (max - min) >> 8; + + /* compute blue from delta. */ + bgb = totdelta / (ndata * 16); + + /* green is just the average of those two */ + bgg = (bgr + bgb) >> 1; + } else { + /* data is spectrum. If stereo then we only care + * about the second one. (the first is mostly a + * duplicate of the second, and the first also + * suffers from being backward -- which looks cool + * in a graph, but would hurt us here. + */ + if (nspectrums == 2) + ndata /= 2, data += ndata; + + /* the lower frequencies are used for red, middle + * for green, and upper for blue. The spectrum + * energy has already been conditioned so we can + * use the first 1/3 for red, next 1/3 for green + * and last 1/3 for blue. The values have also + * been conditioned to fill the int16_t range. + */ + for (i = 0, bgr = 0, j = ndata / 3; i < j; i++) + bgr += data[i]; + bgr /= j; + for (bgg = 0; i < j * 2; i++) + bgg += data[i]; + bgg /= j; + for (bgb = 0; i < ndata; i++) + bgb += data[i]; + bgb /= (ndata - 2 * j); + + /* we need to scale the values to fit in 0..255 range */ + bgr = (20000 - bgr) >> 7; + bgg = (20000 - bgg) >> 7; + bgb = (20000 - bgb) >> 7; } - /* force colors[0] to be the background color */ - colors[0] = 0xff000000; - - /* compute the RGB background color, based on data */ - if (bgletter != 'F' || ndata == 0) - { - /* Use the transition colors */ - bgr = bgred; - bgg = bggreen; - bgb = bgblue; - } - else /* "Flash bkgnd" */ - { - if (nspectrums == 0) - { - /* data is samples */ - - /* examine the data */ - max = min = data[0]; - totdelta = 0; - for (i = 1; i < ndata; i++) - { - if (data[i] < min) - min = data[i]; - else if (data[i] > max) - max = data[i]; - totdelta += abs(data[i] - data[i - 1]); - } - - /* compute red from the difference between max & min */ - bgr = (max - min) >> 8; - - /* compute blue from delta. */ - bgb = totdelta / (ndata * 16); - - /* green is just the average of those two */ - bgg = (bgr + bgb) >> 1; - } - else - { - /* data is spectrum. If stereo then we only care - * about the second one. (the first is mostly a - * duplicate of the second, and the first also - * suffers from being backward -- which looks cool - * in a graph, but would hurt us here. - */ - if (nspectrums == 2) - ndata /= 2, data += ndata; - - /* the lower frequencies are used for red, middle - * for green, and upper for blue. The spectrum - * energy has already been conditioned so we can - * use the first 1/3 for red, next 1/3 for green - * and last 1/3 for blue. The values have also - * been conditioned to fill the int16_t range. - */ - for (i = 0, bgr = 0, j = ndata / 3; i < j; i++) - bgr += data[i]; - bgr /= j; - for (bgg = 0; i < j * 2; i++) - bgg += data[i]; - bgg /= j; - for (bgb = 0; i < ndata; i++) - bgb += data[i]; - bgb /= (ndata - 2 * j); - - /* we need to scale the values to fit in 0..255 range */ - bgr = (20000 - bgr) >> 7; - bgg = (20000 - bgg) >> 7; - bgb = (20000 - bgb) >> 7; - } - - /* during transition from colored to flash, we never want to - * be darker than the old color. - */ - if (bgr < bgred) bgr = bgred; - if (bgg < bggreen) bgg = bggreen; - if (bgb < bgblue) bgb = bgblue; - - /* clamp the background color values to be within 0...255. Also - * try to avoid dark gray backgrounds by ignoring values < 30 - */ - if (bgr < 30) bgr = 0; - else if (bgr > 255) bgr = 255; - if (bgg < 30) bgg = 0; - else if (bgg > 255) bgg = 255; - if (bgb < 30) bgb = 0; - else if (bgb > 255) bgb = 255; - - /* limit the fall-off speed */ - if (bgr < fallr) - bgr = fallr; - fallr = bgr - ((bgr + 15) >> 4); - if (bgg < fallg) - bgg = fallg; - fallg = bgg - ((bgg + 15) >> 4); - if (bgb < fallb) - bgb = fallb; - fallb = bgb - ((bgb + 15) >> 4); + /* during transition from colored to flash, we never want to + * be darker than the old color. + */ + if (bgr < bgred) + bgr = bgred; + if (bgg < bggreen) + bgg = bggreen; + if (bgb < bgblue) + bgb = bgblue; + + /* clamp the background color values to be within 0...255. Also + * try to avoid dark gray backgrounds by ignoring values < 30 + */ + if (bgr < 30) + bgr = 0; + else if (bgr > 255) + bgr = 255; + if (bgg < 30) + bgg = 0; + else if (bgg > 255) + bgg = 255; + if (bgb < 30) + bgb = 0; + else if (bgb > 255) + bgb = 255; + + /* limit the fall-off speed */ + if (bgr < fallr) + bgr = fallr; + fallr = bgr - ((bgr + 15) >> 4); + if (bgg < fallg) + bgg = fallg; + fallg = bgg - ((bgg + 15) >> 4); + if (bgb < fallb) + bgb = fallb; + fallb = bgb - ((bgb + 15) >> 4); + } + + /* build a new colormap, derived from the black-background one */ + for (i = 0; i < 256; i++) { + /* extract the bg brightness. If 0, then copy unchanged */ + k = (colors[i] >> 24) & 0xff; + if (k == 0) { + newcolors[i] = colors[i]; + visual_color_set_from_uint32(&pal_colors[i], newcolors[i]); + continue; } - /* build a new colormap, derived from the black-background one */ - for (i = 0; i < 256; i++) - { - /* extract the bg brightness. If 0, then copy unchanged */ - k = (colors[i] >> 24) & 0xff; - if (k == 0) - { - newcolors[i] = colors[i]; - visual_color_set_from_uint32(&pal_colors[i], newcolors[i]); - continue; - } - - /* else we need to blend -- extract foreground RGB */ - bg = (((bgr * k) << 8) & 0x00ff0000) - | ( (bgg * k) & 0x0000ff00) - | (((bgb * k) >> 8) & 0x000000ff); - newcolors[i] = colors[i] + bg; - visual_color_set_from_uint32(&pal_colors[i], newcolors[i]); - } + /* else we need to blend -- extract foreground RGB */ + bg = (((bgr * k) << 8) & 0x00ff0000) | ((bgg * k) & 0x0000ff00) | + (((bgb * k) >> 8) & 0x000000ff); + newcolors[i] = colors[i] + bg; + visual_color_set_from_uint32(&pal_colors[i], newcolors[i]); + } } - /* Return the name of the i'th color style */ -char *color_name(int i) -{ - if (i < QTY(colorstyles)) - return colorstyles[i].name; - else if (i == QTY(colorstyles)) - return "Random"; - return NULL; +char *color_name(int i) { + if (i < QTY(colorstyles)) + return colorstyles[i].name; + else if (i == QTY(colorstyles)) + return "Random"; + return NULL; } - /* Return the name of the i'th background style */ -char *color_background_name(int i) -{ - static char *names[] = { "Black bkgnd", "White bkgnd", - "Dark bkgnd", "Shift bkgnd", "Color bkgnd", - "Flash bkgnd", "Random bkgnd", NULL}; - return names[i]; +char *color_background_name(int i) { + static char *names[] = {"Black bkgnd", "White bkgnd", "Dark bkgnd", + "Shift bkgnd", "Color bkgnd", "Flash bkgnd", + "Random bkgnd", NULL}; + return names[i]; } - /* Return the index of a color style that's good for "bump" mode. If the given * color style is good, return it; else choose a different one and return that. * Note that we return its index, not its name, because that works better in * the config.c file where this function is used. */ -int color_good_for_bump(char *given) -{ - int i; +int color_good_for_bump(char *given) { + int i; - /* find the given color style in the list */ - for (i = 0; i < QTY(colorstyles); i++) - if (!strcmp(given, colorstyles[i].name)) - break; + /* find the given color style in the list */ + for (i = 0; i < QTY(colorstyles); i++) + if (!strcmp(given, colorstyles[i].name)) + break; - /* if valid & good for bumps, return it */ - if (i < QTY(colorstyles) && colorstyles[i].good_for_bump) - return i; + /* if valid & good for bumps, return it */ + if (i < QTY(colorstyles) && colorstyles[i].good_for_bump) + return i; - /* else return the name of one that is known to be good */ - return 0; + /* else return the name of one that is known to be good */ + return 0; } /* Allow colors to respond to beats */ -void color_beat(BlurskPrivate *priv) -{ - hsv_t hsv; - - /* if hue_on_beats isn't set, then do nothing */ - if (!config.hue_on_beats) - return; - - /* Compute a new base color. Tell the config window about it. */ - hsv = *rgb_to_hsv(config.color); - hsv.hue += 60.0; - if (hsv.hue > 360.0) - hsv.hue -= 360.0; - config.color = hsv_to_rgb(&hsv); - - /* regenerate color map */ - color_genmap(priv, FALSE); - +void color_beat(BlurskPrivate *priv) { + hsv_t hsv; + + /* if hue_on_beats isn't set, then do nothing */ + if (!config.hue_on_beats) + return; + + /* Compute a new base color. Tell the config window about it. */ + hsv = *rgb_to_hsv(config.color); + hsv.hue += 60.0; + if (hsv.hue > 360.0) + hsv.hue -= 360.0; + config.color = hsv_to_rgb(&hsv); + + /* regenerate color map */ + color_genmap(priv, FALSE); } diff --git a/libvisual-plugins/plugins/actor/blursk/config.c b/libvisual-plugins/plugins/actor/blursk/config.c index 7523a4576..737a21be3 100644 --- a/libvisual-plugins/plugins/actor/blursk/config.c +++ b/libvisual-plugins/plugins/actor/blursk/config.c @@ -34,313 +34,286 @@ /** * fill config with default values */ -void config_default(BlurskConfig *conf) -{ - char config_default_color_style[] = "Rainbow"; - char config_default_signal_color[] = "Normal signal"; - char config_default_background[] = "Black bkgnd"; - char config_default_blur_style[] = "Random"; - char config_default_transition_speed[] = "Medium switch"; - char config_default_fade_speed[] = "Medium fade"; - char config_default_blur_when[] = "Full blur"; - char config_default_blur_stencil[] = "No stencil"; - char config_default_signal_style[] = "Stereo spectrum"; - char config_default_plot_style[] = "Line"; - char config_default_flash_style[] = "No flash"; - char config_default_overall_effect[] = "Normal effect"; - char config_default_floaters[] = "No floaters"; - char config_default_cpu_speed[] = "Fast CPU"; - char config_default_show_info[] = "Never show info"; - /*char config_default_fullscreen_method[] = "None";*/ - - - /* window geometry -- generally ignored */ - conf->width = 256; - conf->height = 128; - - /* main options */ - conf->color = 0x00ffff; - if(conf->color_style) - visual_mem_free(conf->color_style); - conf->color_style = visual_strdup(config_default_color_style); - if(conf->signal_color) - visual_mem_free(conf->signal_color); - conf->signal_color = visual_strdup(config_default_signal_color); - conf->contour_lines = FALSE; - conf->hue_on_beats = FALSE; - if(conf->background) - visual_mem_free(conf->background); - conf->background = visual_strdup(config_default_background); - if(conf->blur_style) - visual_mem_free(conf->blur_style); - conf->blur_style = visual_strdup(config_default_blur_style); - if(conf->transition_speed) - visual_mem_free(conf->transition_speed); - conf->transition_speed = visual_strdup(config_default_transition_speed); - if(conf->fade_speed) - visual_mem_free(conf->fade_speed); - conf->fade_speed = visual_strdup(config_default_fade_speed); - if(conf->blur_when) - visual_mem_free(conf->blur_when); - conf->blur_when = visual_strdup(config_default_blur_when); - if(conf->blur_stencil) - visual_mem_free(conf->blur_stencil); - conf->blur_stencil = visual_strdup(config_default_blur_stencil); - conf->slow_motion = FALSE; - if(conf->signal_style) - visual_mem_free(conf->signal_style); - conf->signal_style = visual_strdup(config_default_signal_style); - if(conf->plot_style) - visual_mem_free(conf->plot_style); - conf->plot_style = visual_strdup(config_default_plot_style); - conf->thick_on_beats = TRUE; - if(conf->flash_style) - visual_mem_free(conf->flash_style); - conf->flash_style = visual_strdup(config_default_flash_style); - if(conf->overall_effect) - visual_mem_free(conf->overall_effect); - conf->overall_effect = visual_strdup(config_default_overall_effect); - if(conf->floaters) - visual_mem_free(conf->floaters); - conf->floaters = visual_strdup(config_default_floaters); - - /* advanced options */ - if(conf->cpu_speed) - visual_mem_free(conf->cpu_speed); - conf->cpu_speed = visual_strdup(config_default_cpu_speed); - if(conf->show_info) - visual_mem_free(conf->show_info); - conf->show_info = visual_strdup(config_default_show_info); - conf->info_timeout = 4; - conf->show_timestamp = 0; - conf->beat_sensitivity = 4; +void config_default(BlurskConfig *conf) { + char config_default_color_style[] = "Rainbow"; + char config_default_signal_color[] = "Normal signal"; + char config_default_background[] = "Black bkgnd"; + char config_default_blur_style[] = "Random"; + char config_default_transition_speed[] = "Medium switch"; + char config_default_fade_speed[] = "Medium fade"; + char config_default_blur_when[] = "Full blur"; + char config_default_blur_stencil[] = "No stencil"; + char config_default_signal_style[] = "Stereo spectrum"; + char config_default_plot_style[] = "Line"; + char config_default_flash_style[] = "No flash"; + char config_default_overall_effect[] = "Normal effect"; + char config_default_floaters[] = "No floaters"; + char config_default_cpu_speed[] = "Fast CPU"; + char config_default_show_info[] = "Never show info"; + /*char config_default_fullscreen_method[] = "None";*/ + + /* window geometry -- generally ignored */ + conf->width = 256; + conf->height = 128; + + /* main options */ + conf->color = 0x00ffff; + if (conf->color_style) + visual_mem_free(conf->color_style); + conf->color_style = visual_strdup(config_default_color_style); + if (conf->signal_color) + visual_mem_free(conf->signal_color); + conf->signal_color = visual_strdup(config_default_signal_color); + conf->contour_lines = FALSE; + conf->hue_on_beats = FALSE; + if (conf->background) + visual_mem_free(conf->background); + conf->background = visual_strdup(config_default_background); + if (conf->blur_style) + visual_mem_free(conf->blur_style); + conf->blur_style = visual_strdup(config_default_blur_style); + if (conf->transition_speed) + visual_mem_free(conf->transition_speed); + conf->transition_speed = visual_strdup(config_default_transition_speed); + if (conf->fade_speed) + visual_mem_free(conf->fade_speed); + conf->fade_speed = visual_strdup(config_default_fade_speed); + if (conf->blur_when) + visual_mem_free(conf->blur_when); + conf->blur_when = visual_strdup(config_default_blur_when); + if (conf->blur_stencil) + visual_mem_free(conf->blur_stencil); + conf->blur_stencil = visual_strdup(config_default_blur_stencil); + conf->slow_motion = FALSE; + if (conf->signal_style) + visual_mem_free(conf->signal_style); + conf->signal_style = visual_strdup(config_default_signal_style); + if (conf->plot_style) + visual_mem_free(conf->plot_style); + conf->plot_style = visual_strdup(config_default_plot_style); + conf->thick_on_beats = TRUE; + if (conf->flash_style) + visual_mem_free(conf->flash_style); + conf->flash_style = visual_strdup(config_default_flash_style); + if (conf->overall_effect) + visual_mem_free(conf->overall_effect); + conf->overall_effect = visual_strdup(config_default_overall_effect); + if (conf->floaters) + visual_mem_free(conf->floaters); + conf->floaters = visual_strdup(config_default_floaters); + + /* advanced options */ + if (conf->cpu_speed) + visual_mem_free(conf->cpu_speed); + conf->cpu_speed = visual_strdup(config_default_cpu_speed); + if (conf->show_info) + visual_mem_free(conf->show_info); + conf->show_info = visual_strdup(config_default_show_info); + conf->info_timeout = 4; + conf->show_timestamp = 0; + conf->beat_sensitivity = 4; } /** * generate a new config-string from current config */ -void config_string_genstring(BlurskPrivate *priv) -{ - char *string = paste_genstring(); +void config_string_genstring(BlurskPrivate *priv) { + char *string = paste_genstring(); - VisParamList *params = visual_plugin_get_params(priv->plugin); + VisParamList *params = visual_plugin_get_params(priv->plugin); - VisParam *param = visual_param_list_get(params, "config_string"); + VisParam *param = visual_param_list_get(params, "config_string"); - /* don't set if it has already been set */ - if(strcmp(string, visual_param_get_value_string(param)) != 0) - visual_param_set_value_string(param, string); + /* don't set if it has already been set */ + if (strcmp(string, visual_param_get_value_string(param)) != 0) + visual_param_set_value_string(param, string); - priv->update_config_string = 0; + priv->update_config_string = 0; } /** * reflect the new values. */ -static void _config_load_preset(BlurskPrivate *priv, BlurskConfig *conf) -{ - struct - { - const char *name; - VisParamType type; - void *val; - }entries[] = - { - {"color", VISUAL_PARAM_TYPE_COLOR, &conf->color}, - {"color_style", VISUAL_PARAM_TYPE_STRING, &conf->color_style}, - {"fade_speed", VISUAL_PARAM_TYPE_STRING, &conf->fade_speed}, - {"signal_color", VISUAL_PARAM_TYPE_STRING, &conf->signal_color}, - {"contour_lines", VISUAL_PARAM_TYPE_BOOL, &conf->contour_lines}, - {"hue_on_beats", VISUAL_PARAM_TYPE_BOOL, &conf->hue_on_beats}, - {"background", VISUAL_PARAM_TYPE_STRING, &conf->background}, - {"blur_style", VISUAL_PARAM_TYPE_STRING, &conf->blur_style}, - {"transition_speed", VISUAL_PARAM_TYPE_STRING, &conf->transition_speed}, - {"blur_when", VISUAL_PARAM_TYPE_STRING, &conf->blur_when}, - {"blur_stencil", VISUAL_PARAM_TYPE_STRING, &conf->blur_stencil}, - {"slow_motion", VISUAL_PARAM_TYPE_BOOL, &conf->slow_motion}, - {"signal_style", VISUAL_PARAM_TYPE_STRING, &conf->signal_style}, - {"plot_style", VISUAL_PARAM_TYPE_STRING, &conf->plot_style}, - {"thick_on_beats", VISUAL_PARAM_TYPE_BOOL, &conf->thick_on_beats}, - {"flash_style", VISUAL_PARAM_TYPE_STRING, &conf->flash_style}, - {"overall_effect", VISUAL_PARAM_TYPE_STRING, &conf->overall_effect}, - {"floaters", VISUAL_PARAM_TYPE_STRING, &conf->floaters}, - }; - - int i; - - for(i = 0; i < QTY(entries); i++) - { - VisParamList *params = visual_plugin_get_params(priv->plugin); - VisParam *ptmp = visual_param_list_get(params, entries[i].name); - - switch(entries[i].type) - { - case VISUAL_PARAM_TYPE_INTEGER: - { - int *integer = entries[i].val; - - /* only update if values differ */ - if(*integer != visual_param_get_value_integer(ptmp)) - visual_param_set_value_integer(ptmp, *integer); - break; - } - - - case VISUAL_PARAM_TYPE_COLOR: - { - VisColor *color = visual_param_get_value_color(ptmp); - VisColor ncolor; - uint32_t nicolor = (((color->b)<<16) + ((color->g)<<8) + color->r); - uint32_t *icolor = entries[i].val; - - /* only update if values differ */ - if(*icolor != nicolor) - { - visual_color_set(&ncolor, (*icolor&0xFF0000)>>16, (*icolor&0xFF00)>>8, (*icolor&0xFF)); - visual_param_set_value_color(ptmp, &ncolor); - } - break; - } - - - case VISUAL_PARAM_TYPE_STRING: - { - char **string = entries[i].val; - - /* only update if values differ */ - if(strcmp(*string, visual_param_get_value_string(ptmp)) != 0) - visual_param_set_value_string(ptmp, *string); - break; - } - - default: - break; - } +static void _config_load_preset(BlurskPrivate *priv, BlurskConfig *conf) { + struct { + const char *name; + VisParamType type; + void *val; + } entries[] = { + {"color", VISUAL_PARAM_TYPE_COLOR, &conf->color}, + {"color_style", VISUAL_PARAM_TYPE_STRING, &conf->color_style}, + {"fade_speed", VISUAL_PARAM_TYPE_STRING, &conf->fade_speed}, + {"signal_color", VISUAL_PARAM_TYPE_STRING, &conf->signal_color}, + {"contour_lines", VISUAL_PARAM_TYPE_BOOL, &conf->contour_lines}, + {"hue_on_beats", VISUAL_PARAM_TYPE_BOOL, &conf->hue_on_beats}, + {"background", VISUAL_PARAM_TYPE_STRING, &conf->background}, + {"blur_style", VISUAL_PARAM_TYPE_STRING, &conf->blur_style}, + {"transition_speed", VISUAL_PARAM_TYPE_STRING, &conf->transition_speed}, + {"blur_when", VISUAL_PARAM_TYPE_STRING, &conf->blur_when}, + {"blur_stencil", VISUAL_PARAM_TYPE_STRING, &conf->blur_stencil}, + {"slow_motion", VISUAL_PARAM_TYPE_BOOL, &conf->slow_motion}, + {"signal_style", VISUAL_PARAM_TYPE_STRING, &conf->signal_style}, + {"plot_style", VISUAL_PARAM_TYPE_STRING, &conf->plot_style}, + {"thick_on_beats", VISUAL_PARAM_TYPE_BOOL, &conf->thick_on_beats}, + {"flash_style", VISUAL_PARAM_TYPE_STRING, &conf->flash_style}, + {"overall_effect", VISUAL_PARAM_TYPE_STRING, &conf->overall_effect}, + {"floaters", VISUAL_PARAM_TYPE_STRING, &conf->floaters}, + }; + + int i; + + for (i = 0; i < QTY(entries); i++) { + VisParamList *params = visual_plugin_get_params(priv->plugin); + VisParam *ptmp = visual_param_list_get(params, entries[i].name); + + switch (entries[i].type) { + case VISUAL_PARAM_TYPE_INTEGER: { + int *integer = entries[i].val; + + /* only update if values differ */ + if (*integer != visual_param_get_value_integer(ptmp)) + visual_param_set_value_integer(ptmp, *integer); + break; } + + case VISUAL_PARAM_TYPE_COLOR: { + VisColor *color = visual_param_get_value_color(ptmp); + VisColor ncolor; + uint32_t nicolor = (((color->b) << 16) + ((color->g) << 8) + color->r); + uint32_t *icolor = entries[i].val; + + /* only update if values differ */ + if (*icolor != nicolor) { + visual_color_set(&ncolor, (*icolor & 0xFF0000) >> 16, + (*icolor & 0xFF00) >> 8, (*icolor & 0xFF)); + visual_param_set_value_color(ptmp, &ncolor); + } + break; + } + + case VISUAL_PARAM_TYPE_STRING: { + char **string = entries[i].val; + + /* only update if values differ */ + if (strcmp(*string, visual_param_get_value_string(ptmp)) != 0) + visual_param_set_value_string(ptmp, *string); + break; + } + + default: + break; + } + } } /** * signal main loop to update colormap */ -static void __color_genmap(BlurskPrivate *priv) -{ - priv->update_colmap = 1; -} +static void __color_genmap(BlurskPrivate *priv) { priv->update_colmap = 1; } /** * parse a blursk-config-string (tm) */ -static void _change_config_string(BlurskPrivate *priv, char **string, VisParam *p, int *(validator)(void *value)) -{ - - if(!validator || validator((void*)visual_param_get_value_string(p))) - { - BlurskConfig *c; +static void _change_config_string(BlurskPrivate *priv, char **string, + VisParam *p, int *(validator)(void *value)) { - /* free previous string? */ - if(*string) - visual_mem_free(*string); + if (!validator || validator((void *)visual_param_get_value_string(p))) { + BlurskConfig *c; - *string = visual_strdup(visual_param_get_value_string(p)); + /* free previous string? */ + if (*string) + visual_mem_free(*string); - /* parse the string */ - c = paste_parsestring(*string); + *string = visual_strdup(visual_param_get_value_string(p)); - /* use this configuration */ - _config_load_preset(priv, c); - - } - /* reset to previous value */ - else - visual_param_set_value_string(p, *string); + /* parse the string */ + c = paste_parsestring(*string); + /* use this configuration */ + _config_load_preset(priv, c); + } + /* reset to previous value */ + else + visual_param_set_value_string(p, *string); } /** * callback to change a color parameter (called by config_change_param) */ -static void _change_color(BlurskPrivate *priv, uint32_t *color, VisParam *p, int *(validator)(void *value)) -{ - VisColor *c; +static void _change_color(BlurskPrivate *priv, uint32_t *color, VisParam *p, + int *(validator)(void *value)) { + VisColor *c; - c = visual_param_get_value_color(p); - *color = ((c->r)<<16) + ((c->g)<<8) + c->b; - priv->update_config_string = 1; + c = visual_param_get_value_color(p); + *color = ((c->r) << 16) + ((c->g) << 8) + c->b; + priv->update_config_string = 1; } /** * callback to change a string parameter (called by config_change_param) */ -static void _change_string(BlurskPrivate *priv, char **string, - VisParam *p, int *(validator)(void *value)) -{ - visual_return_if_fail(visual_param_get_value_string(p)); +static void _change_string(BlurskPrivate *priv, char **string, VisParam *p, + int *(validator)(void *value)) { + visual_return_if_fail(visual_param_get_value_string(p)); - if(!validator || validator((void*)visual_param_get_value_string(p))) - { - /* free previous string? */ - if(*string) - visual_mem_free(*string); + if (!validator || validator((void *)visual_param_get_value_string(p))) { + /* free previous string? */ + if (*string) + visual_mem_free(*string); - *string = visual_strdup(visual_param_get_value_string(p)); + *string = visual_strdup(visual_param_get_value_string(p)); - priv->update_config_string = 1; - } - /* reset to previous value */ - else - visual_param_set_value_string(p, *string); + priv->update_config_string = 1; + } + /* reset to previous value */ + else + visual_param_set_value_string(p, *string); } - /** * callback to change a bool parameter (called by config_change_param) */ -static void _change_bool(BlurskPrivate *priv, int *boolean, VisParam *p, int *(validator)(void *value)) -{ - int t = visual_param_get_value_bool(p); +static void _change_bool(BlurskPrivate *priv, int *boolean, VisParam *p, + int *(validator)(void *value)) { + int t = visual_param_get_value_bool(p); - /* validate boolean */ - if(t == 0 || t == 1) - { - *boolean = t; + /* validate boolean */ + if (t == 0 || t == 1) { + *boolean = t; - priv->update_config_string = 1; - } - /* reset to previous value */ - else - visual_param_set_value_bool(p, *boolean); + priv->update_config_string = 1; + } + /* reset to previous value */ + else + visual_param_set_value_bool(p, *boolean); } /** * callback to change an integer parameter (called by config_change_param) */ -static void _change_int(BlurskPrivate *priv, int *integer, VisParam *p, int *(validator)(void *value)) -{ - *integer = visual_param_get_value_integer(p); +static void _change_int(BlurskPrivate *priv, int *integer, VisParam *p, + int *(validator)(void *value)) { + *integer = visual_param_get_value_integer(p); - priv->update_config_string = 1; + priv->update_config_string = 1; } - - /** * check if fade-speed string is valid * @p speed - fade-speed string * @return 0 if invalid, 1 if valid */ -static int _fade_speed_validate(char *speed) -{ - switch(speed[0]) - { - case 'N': - case 'S': - case 'M': - case 'F': - return 1; - } - - return 0; +static int _fade_speed_validate(char *speed) { + switch (speed[0]) { + case 'N': + case 'S': + case 'M': + case 'F': + return 1; + } + + return 0; } /** @@ -348,15 +321,12 @@ static int _fade_speed_validate(char *speed) * @p style - flash_style string * @return 0 if invalid, 1 if valid */ -static int _flash_style_validate(char *style) -{ - if(strcmp(style, "Full flash") == 0 || - strcmp(style, "Invert flash") == 0 || - strcmp(style, "No flash") == 0 || - strcmp(style, "Random flash")) - return 1; - - return 0; +static int _flash_style_validate(char *style) { + if (strcmp(style, "Full flash") == 0 || strcmp(style, "Invert flash") == 0 || + strcmp(style, "No flash") == 0 || strcmp(style, "Random flash")) + return 1; + + return 0; } /** @@ -364,15 +334,14 @@ static int _flash_style_validate(char *style) * @p effect - overall_effect string * @return 0 if invalid, 1 if valid */ -static int _overall_effect_validate(char *effect) -{ - if(strcmp(effect, "Bump effect") == 0 || - strcmp(effect, "Anti-fade effect") == 0 || - strcmp(effect, "Ripple effect") == 0 || - strcmp(effect, "Normal effect") == 0) - return 1; - - return 0; +static int _overall_effect_validate(char *effect) { + if (strcmp(effect, "Bump effect") == 0 || + strcmp(effect, "Anti-fade effect") == 0 || + strcmp(effect, "Ripple effect") == 0 || + strcmp(effect, "Normal effect") == 0) + return 1; + + return 0; } /** @@ -380,19 +349,17 @@ static int _overall_effect_validate(char *effect) * @p floaters - floaters string * @return 0 if invalid, 1 if valid */ -static int _floaters_validate(char *floaters) -{ - char *tmp; - int i = 0; - - while((tmp = floaters_name(i))) - { - if(strcmp(floaters, tmp) == 0) - return 1; - i++; - } +static int _floaters_validate(char *floaters) { + char *tmp; + int i = 0; - return 0; + while ((tmp = floaters_name(i))) { + if (strcmp(floaters, tmp) == 0) + return 1; + i++; + } + + return 0; } /** @@ -400,14 +367,11 @@ static int _floaters_validate(char *floaters) * @p show_info - show info string * @return 0 if invalid, 1 if valid */ -static int _show_info_validate(char *showinfo) -{ - if(*showinfo == 'A' || - *showinfo == 'N' || - *showinfo == 'T') - return 1; - - return 0; +static int _show_info_validate(char *showinfo) { + if (*showinfo == 'A' || *showinfo == 'N' || *showinfo == 'T') + return 1; + + return 0; } /** @@ -415,19 +379,17 @@ static int _show_info_validate(char *showinfo) * @p style - blur_style string * @return 0 if invalid, 1 if valid */ -static int _blur_style_validate(char *style) -{ - char *tmp; - int i = 0; - - while((tmp = blur_name(i))) - { - if(strcmp(style, tmp) == 0) - return 1; - i++; - } +static int _blur_style_validate(char *style) { + char *tmp; + int i = 0; + + while ((tmp = blur_name(i))) { + if (strcmp(style, tmp) == 0) + return 1; + i++; + } - return 0; + return 0; } /** @@ -435,20 +397,18 @@ static int _blur_style_validate(char *style) * @p speed - transition speed string * @return 0 if invalid, 1 if valid */ -static int _blur_transition_speed_validate(char *speed) -{ - switch(speed[0]) - { - /* slow */ - case 'S': - /* medium */ - case 'M': - /* fast */ - case 'F': - return 1; - } - - return 0; +static int _blur_transition_speed_validate(char *speed) { + switch (speed[0]) { + /* slow */ + case 'S': + /* medium */ + case 'M': + /* fast */ + case 'F': + return 1; + } + + return 0; } /** @@ -456,19 +416,17 @@ static int _blur_transition_speed_validate(char *speed) * @p when - blur_when string * @return 0 if invalid, 1 if valid */ -static int _blur_when_validate(char *when) -{ - char *tmp; - int i = 0; - - while((tmp = blur_when_name(i))) - { - if(strcmp(when, tmp) == 0) - return 1; - i++; - } +static int _blur_when_validate(char *when) { + char *tmp; + int i = 0; + + while ((tmp = blur_when_name(i))) { + if (strcmp(when, tmp) == 0) + return 1; + i++; + } - return 0; + return 0; } /** @@ -476,20 +434,18 @@ static int _blur_when_validate(char *when) * @p speed - cpu_speed string * @return 0 if invalid, 1 if valid */ -static int _cpu_speed_validate(char *speed) -{ - switch(speed[0]) - { - /* slow */ - case 'S': - /* medium */ - case 'M': - /* fast */ - case 'F': - return 1; - } - - return 0; +static int _cpu_speed_validate(char *speed) { + switch (speed[0]) { + /* slow */ + case 'S': + /* medium */ + case 'M': + /* fast */ + case 'F': + return 1; + } + + return 0; } /** @@ -497,28 +453,26 @@ static int _cpu_speed_validate(char *speed) * @p style - signal_style string * @return 0 if invalid, 1 if valid */ -static int _signal_style_validate(char *style) -{ - switch(style[0]) - { - /* High/Low plot */ - case 'H': - /* Stereo spectrum */ - case 'S': - /* Mono spectrum */ - case 'M': - /* Flower */ - case 'F': - /* Oscilloscope */ - case 'O': - /* Radial spectrum */ - case 'R': - /* Phase shift */ - case 'P': - return 1; - } - - return 0; +static int _signal_style_validate(char *style) { + switch (style[0]) { + /* High/Low plot */ + case 'H': + /* Stereo spectrum */ + case 'S': + /* Mono spectrum */ + case 'M': + /* Flower */ + case 'F': + /* Oscilloscope */ + case 'O': + /* Radial spectrum */ + case 'R': + /* Phase shift */ + case 'P': + return 1; + } + + return 0; } /** @@ -526,36 +480,34 @@ static int _signal_style_validate(char *style) * @p style - signal_style string * @return 0 if invalid, 1 if valid */ -static int _plot_style_validate(char *style) -{ - switch(style[0]) - { - /* Line */ - case 'L': - /* Inertia */ - case 'I': - /* Radar */ - case 'R': - /* Dots */ - case 'D': - /* Fuzzy dots */ - case 'F': - /* Plus signs */ - case 'P': - /* Airbrush */ - case 'A': - /* Edges */ - case 'E': - /* Mirrored */ - case 'M': - /* Starburst */ - case 'S': - /* None */ - case 'N': - return 1; - } - - return 0; +static int _plot_style_validate(char *style) { + switch (style[0]) { + /* Line */ + case 'L': + /* Inertia */ + case 'I': + /* Radar */ + case 'R': + /* Dots */ + case 'D': + /* Fuzzy dots */ + case 'F': + /* Plus signs */ + case 'P': + /* Airbrush */ + case 'A': + /* Edges */ + case 'E': + /* Mirrored */ + case 'M': + /* Starburst */ + case 'S': + /* None */ + case 'N': + return 1; + } + + return 0; } /** @@ -563,22 +515,19 @@ static int _plot_style_validate(char *style) * @p name - name of colorstyle * @return 0 if invalid, 1 if valid */ -static int _color_style_validate(char *name) -{ - int i; - char *oname; +static int _color_style_validate(char *name) { + int i; + char *oname; + for (i = 0; (oname = color_name(i)); i++) { + if (strcmp(name, oname) == 0) + return 1; + } - for(i = 0; (oname = color_name(i)); i++) - { - if(strcmp(name, oname) == 0) - return 1; - } - - if(strcmp(name, "Random") == 0) - return 1; + if (strcmp(name, "Random") == 0) + return 1; - return 0; + return 0; } /** @@ -586,17 +535,15 @@ static int _color_style_validate(char *name) * @p color - color string * @return 0 if invalid, 1 if valid */ -static int _color_signal_validate(char *color) -{ - switch(color[0]) - { - case 'N': - case 'W': - case 'C': - return 1; - } - - return 0; +static int _color_signal_validate(char *color) { + switch (color[0]) { + case 'N': + case 'W': + case 'C': + return 1; + } + + return 0; } /** @@ -604,21 +551,19 @@ static int _color_signal_validate(char *color) * @p bg - background color string * @return 0 if invalid, 1 if valid */ -static int _color_background_validate(char *bg) -{ - switch(bg[0]) - { - case 'R': - case 'B': - case 'W': - case 'D': - case 'S': - case 'C': - case 'F': - return 1; - } - - return 0; +static int _color_background_validate(char *bg) { + switch (bg[0]) { + case 'R': + case 'B': + case 'W': + case 'D': + case 'S': + case 'C': + case 'F': + return 1; + } + + return 0; } /** @@ -627,73 +572,87 @@ static int _color_background_validate(char *bg) * @p p - libvisual parameter * @p c - blursk configuration structure */ -void config_change_param(BlurskPrivate *priv, VisParam *p) -{ - /** - * structure defining handler functions for configuration values - */ - struct - { - /* parameter-name */ - char *name; - /* blursk storage for parameter value */ - void *value; - /* validator function */ - int (*validator)(void *value); - /* function called to change parameter */ - void (*change)(BlurskPrivate *priv, void **value, - VisParam *parameter, int (*validator)(void *value)); - /* function called after parameter change */ - void (*postchange)(BlurskPrivate *priv); - } parms[] = - { - {"color", &config.color, NULL, (void *) _change_color, __color_genmap}, - {"color_style", &config.color_style, (void *) _color_style_validate, (void *) _change_string, __color_genmap}, - {"signal_color", &config.signal_color, (void *) _color_signal_validate, (void *) _change_string, NULL}, - {"contour_lines", &config.contour_lines, NULL, (void *) _change_bool, NULL}, - {"hue_on_beats", &config.hue_on_beats, NULL, (void *) _change_bool, NULL}, - {"slow_motion", &config.slow_motion, NULL, (void *) _change_bool, NULL}, - {"thick_on_beats", &config.thick_on_beats, NULL, (void *) _change_bool, NULL}, - {"background", &config.background, (void *) _color_background_validate, (void *) _change_string, NULL}, - {"blur_style", &config.blur_style, (void *) _blur_style_validate, (void *) _change_string, NULL}, - {"transition_speed", &config.transition_speed, (void *) _blur_transition_speed_validate, (void *) _change_string, NULL}, - {"blur_when", &config.blur_when, (void *) _blur_when_validate, (void *) _change_string, NULL}, - {"blur_stencil", &config.blur_stencil, NULL, (void *) _change_string, NULL}, - {"fade_speed", &config.fade_speed, (void *) _fade_speed_validate, (void *) _change_string, NULL}, - {"signal_style", &config.signal_style, (void *) _signal_style_validate, (void *) _change_string, NULL}, - {"plot_style", &config.plot_style, (void *) _plot_style_validate, (void *) _change_string, NULL}, - {"flash_style", &config.flash_style, (void *) _flash_style_validate, (void *) _change_string, NULL}, - {"overall_effect", &config.overall_effect, (void *) _overall_effect_validate, (void *) _change_string, NULL}, - {"floaters", &config.floaters, (void *) _floaters_validate, (void *) _change_string, NULL}, - {"cpu_speed", &config.cpu_speed, (void *) _cpu_speed_validate, (void *) _change_string, NULL}, - {"beat_sensitivity", &config.beat_sensitivity, NULL, (void *) _change_int, NULL}, - {"config_string", &config.config_string, NULL, (void *) _change_config_string, NULL}, - {"show_info", &config.show_info, (void *) _show_info_validate, (void *) _change_string, NULL}, - {"info_timeout", &config.info_timeout, NULL, (void *) _change_int, NULL}, - {"show_timestamp", &config.show_timestamp, NULL, (void *) _change_bool, NULL} - }; - - - - /** look for parameter in our structure */ - int i; - for(i = 0; i < QTY(parms); i++) - { - /* not our parameter? -> continue the quest */ - if(!visual_param_has_name(p, parms[i].name)) { - continue; - } - - /* call this parameters' change handler */ - if(parms[i].change) - parms[i].change(priv, parms[i].value, p, parms[i].validator); - - /* call this parameters' post-change handler */ - if(parms[i].postchange) - parms[i].postchange(priv); - - return; +void config_change_param(BlurskPrivate *priv, VisParam *p) { + /** + * structure defining handler functions for configuration values + */ + struct { + /* parameter-name */ + char *name; + /* blursk storage for parameter value */ + void *value; + /* validator function */ + int (*validator)(void *value); + /* function called to change parameter */ + void (*change)(BlurskPrivate *priv, void **value, VisParam *parameter, + int (*validator)(void *value)); + /* function called after parameter change */ + void (*postchange)(BlurskPrivate *priv); + } parms[] = { + {"color", &config.color, NULL, (void *)_change_color, __color_genmap}, + {"color_style", &config.color_style, (void *)_color_style_validate, + (void *)_change_string, __color_genmap}, + {"signal_color", &config.signal_color, (void *)_color_signal_validate, + (void *)_change_string, NULL}, + {"contour_lines", &config.contour_lines, NULL, (void *)_change_bool, + NULL}, + {"hue_on_beats", &config.hue_on_beats, NULL, (void *)_change_bool, NULL}, + {"slow_motion", &config.slow_motion, NULL, (void *)_change_bool, NULL}, + {"thick_on_beats", &config.thick_on_beats, NULL, (void *)_change_bool, + NULL}, + {"background", &config.background, (void *)_color_background_validate, + (void *)_change_string, NULL}, + {"blur_style", &config.blur_style, (void *)_blur_style_validate, + (void *)_change_string, NULL}, + {"transition_speed", &config.transition_speed, + (void *)_blur_transition_speed_validate, (void *)_change_string, NULL}, + {"blur_when", &config.blur_when, (void *)_blur_when_validate, + (void *)_change_string, NULL}, + {"blur_stencil", &config.blur_stencil, NULL, (void *)_change_string, + NULL}, + {"fade_speed", &config.fade_speed, (void *)_fade_speed_validate, + (void *)_change_string, NULL}, + {"signal_style", &config.signal_style, (void *)_signal_style_validate, + (void *)_change_string, NULL}, + {"plot_style", &config.plot_style, (void *)_plot_style_validate, + (void *)_change_string, NULL}, + {"flash_style", &config.flash_style, (void *)_flash_style_validate, + (void *)_change_string, NULL}, + {"overall_effect", &config.overall_effect, + (void *)_overall_effect_validate, (void *)_change_string, NULL}, + {"floaters", &config.floaters, (void *)_floaters_validate, + (void *)_change_string, NULL}, + {"cpu_speed", &config.cpu_speed, (void *)_cpu_speed_validate, + (void *)_change_string, NULL}, + {"beat_sensitivity", &config.beat_sensitivity, NULL, (void *)_change_int, + NULL}, + {"config_string", &config.config_string, NULL, + (void *)_change_config_string, NULL}, + {"show_info", &config.show_info, (void *)_show_info_validate, + (void *)_change_string, NULL}, + {"info_timeout", &config.info_timeout, NULL, (void *)_change_int, NULL}, + {"show_timestamp", &config.show_timestamp, NULL, (void *)_change_bool, + NULL}}; + + /** look for parameter in our structure */ + int i; + for (i = 0; i < QTY(parms); i++) { + /* not our parameter? -> continue the quest */ + if (!visual_param_has_name(p, parms[i].name)) { + continue; } - visual_log(VISUAL_LOG_WARNING, "Unknown param '%s'", visual_param_get_name(p)); + /* call this parameters' change handler */ + if (parms[i].change) + parms[i].change(priv, parms[i].value, p, parms[i].validator); + + /* call this parameters' post-change handler */ + if (parms[i].postchange) + parms[i].postchange(priv); + + return; + } + + visual_log(VISUAL_LOG_WARNING, "Unknown param '%s'", + visual_param_get_name(p)); } diff --git a/libvisual-plugins/plugins/actor/blursk/img.c b/libvisual-plugins/plugins/actor/blursk/img.c index 1fcb421f8..681094611 100644 --- a/libvisual-plugins/plugins/actor/blursk/img.c +++ b/libvisual-plugins/plugins/actor/blursk/img.c @@ -46,24 +46,24 @@ #include "blursk.h" /* These global variables store image information */ -uint8_t *img_buf; /* base of the current image buffer */ -uint8_t *img_tmp; /* base of another image buffer, for temp operations */ -uint8_t **img_source; /* an array of pixel pointers, for blur motion */ -unsigned int img_height; /* height of the current image */ -unsigned int img_width; /* width of the current image */ -unsigned int img_bpl; /* bytes per line of the current image */ -unsigned int img_chunks; /* number of 8-pixel chunks in the image */ - -unsigned int img_physheight; /* height of the current window */ -unsigned int img_physwidth; /* width of the current window */ -uint8_t img_rippleshift;/* ripple map cycling counter */ +uint8_t *img_buf; /* base of the current image buffer */ +uint8_t *img_tmp; /* base of another image buffer, for temp operations */ +uint8_t **img_source; /* an array of pixel pointers, for blur motion */ +unsigned int img_height; /* height of the current image */ +unsigned int img_width; /* width of the current image */ +unsigned int img_bpl; /* bytes per line of the current image */ +unsigned int img_chunks; /* number of 8-pixel chunks in the image */ + +unsigned int img_physheight; /* height of the current window */ +unsigned int img_physwidth; /* width of the current window */ +uint8_t img_rippleshift; /* ripple map cycling counter */ /* These are the base addresses of allocated memory, so we can free the old * images when we resize to a new image. */ -static uint8_t *base_buf; -static uint8_t *base_tmp; -static uint8_t **base_source; +static uint8_t *base_buf; +static uint8_t *base_tmp; +static uint8_t **base_source; /* This stores the state of the "cpu_speed" option when bufs were allocated */ static char speed; @@ -72,506 +72,478 @@ static char speed; * This function should be called during initialization, and again any time the * window size or "cpu_speed" option changes. */ -void img_resize(BlurskPrivate *priv, int physwidth, int physheight) -{ - size_t size; - uint8_t *buf, **source; - int tmp_factor; - - /* If same size & cpu speed, then do nothing */ - if (physwidth == img_physwidth && physheight == img_physheight - && *config.cpu_speed == speed) - return; - - /* free the old memory, if any */ - if (base_buf) - { - visual_mem_free(base_buf); - visual_mem_free(base_tmp); - visual_mem_free(base_source); - } - - /* Store the width, height, and bytes-per-line of the new image size. - * Bytes-per-line is an odd number greater than 2; this gives us a - * neutral border around the image (which simplifies blurring) and - * causes even-byte dithering to have a checkerboard pattern instead - * of vertical lines (so dithering looks better). - */ - img_physheight = physheight; - img_physwidth = physwidth; - speed = *config.cpu_speed; - switch (speed) - { - case 'F': /* Fast CPU */ - img_height = physheight; - img_width = physwidth; - tmp_factor = 1; - break; - - case 'M': /* Medium CPU */ - img_height = physheight; - img_width = (physwidth + 1) / 2; - tmp_factor = 2; - break; - - default: /* Slow CPU */ - img_height = (physheight + 1) / 2; - img_width = (physwidth + 1) / 2; - tmp_factor = 4; - } - //img_bpl = ((img_width) & ~1) + 1; - img_bpl = img_width; - - /* Compute the number of chunks. This is the number of 8-pixel groups - * that are needed to cover all visible pixels. - */ - img_chunks = (img_height * img_bpl + 7) >> 3; - - /* Compute the number of pixels to allocate. This should include - * two extra rasters above and two below the image. It should also - * include enough extra bytes so that the base of the visible image - * is on an 8-byte boundary. - */ - size = ((img_height + 4) * img_bpl + 7) & ~7; - - /* allocate the memory */ - base_buf = (uint8_t *)visual_mem_malloc(size * sizeof(uint8_t)); - base_tmp = (uint8_t *)visual_mem_malloc(size * tmp_factor * sizeof(uint8_t)); - base_source = (uint8_t **)visual_mem_malloc(size * sizeof(uint8_t *)); - - /* Initialize the memory */ - memset(base_buf, 0, size); - for (buf = base_buf, source = base_source; size != 0; size--) - *source++ = buf++; - - /* Set the image pointer bases to the start of the visible pixels */ - size = (img_bpl * 2 + 7) & ~7; - img_buf = base_buf + size; - img_tmp = base_tmp + tmp_factor * size; - img_source = base_source + size; - - priv->rgb_buf = img_buf; +void img_resize(BlurskPrivate *priv, int physwidth, int physheight) { + size_t size; + uint8_t *buf, **source; + int tmp_factor; + + /* If same size & cpu speed, then do nothing */ + if (physwidth == img_physwidth && physheight == img_physheight && + *config.cpu_speed == speed) + return; + + /* free the old memory, if any */ + if (base_buf) { + visual_mem_free(base_buf); + visual_mem_free(base_tmp); + visual_mem_free(base_source); + } + + /* Store the width, height, and bytes-per-line of the new image size. + * Bytes-per-line is an odd number greater than 2; this gives us a + * neutral border around the image (which simplifies blurring) and + * causes even-byte dithering to have a checkerboard pattern instead + * of vertical lines (so dithering looks better). + */ + img_physheight = physheight; + img_physwidth = physwidth; + speed = *config.cpu_speed; + switch (speed) { + case 'F': /* Fast CPU */ + img_height = physheight; + img_width = physwidth; + tmp_factor = 1; + break; + + case 'M': /* Medium CPU */ + img_height = physheight; + img_width = (physwidth + 1) / 2; + tmp_factor = 2; + break; + + default: /* Slow CPU */ + img_height = (physheight + 1) / 2; + img_width = (physwidth + 1) / 2; + tmp_factor = 4; + } + // img_bpl = ((img_width) & ~1) + 1; + img_bpl = img_width; + + /* Compute the number of chunks. This is the number of 8-pixel groups + * that are needed to cover all visible pixels. + */ + img_chunks = (img_height * img_bpl + 7) >> 3; + + /* Compute the number of pixels to allocate. This should include + * two extra rasters above and two below the image. It should also + * include enough extra bytes so that the base of the visible image + * is on an 8-byte boundary. + */ + size = ((img_height + 4) * img_bpl + 7) & ~7; + + /* allocate the memory */ + base_buf = (uint8_t *)visual_mem_malloc(size * sizeof(uint8_t)); + base_tmp = (uint8_t *)visual_mem_malloc(size * tmp_factor * sizeof(uint8_t)); + base_source = (uint8_t **)visual_mem_malloc(size * sizeof(uint8_t *)); + + /* Initialize the memory */ + memset(base_buf, 0, size); + for (buf = base_buf, source = base_source; size != 0; size--) + *source++ = buf++; + + /* Set the image pointer bases to the start of the visible pixels */ + size = (img_bpl * 2 + 7) & ~7; + img_buf = base_buf + size; + img_tmp = base_tmp + tmp_factor * size; + img_source = base_source + size; + + priv->rgb_buf = img_buf; } -void img_cleanup() -{ - if(base_buf) - { - visual_mem_free(base_buf); - visual_mem_free(base_tmp); - visual_mem_free(base_source); - base_buf = NULL; - base_tmp = NULL; - base_source = NULL; - } +void img_cleanup() { + if (base_buf) { + visual_mem_free(base_buf); + visual_mem_free(base_tmp); + visual_mem_free(base_source); + base_buf = NULL; + base_tmp = NULL; + base_source = NULL; + } } /* Copy the visible parts of img_tmp into img_buf, without disturbing the * border pixels. The image in img_tmp is assumed to be the same size as the * one in img_buf, regardless of the cpu_speed option. */ -void img_copyback(void) -{ - int i; - uint8_t *src, *dst; - - for (i = img_height, src = img_tmp, dst = img_buf; - --i >= 0; - src += img_bpl, dst += img_bpl) - { - memcpy(dst, src, img_width); - } +void img_copyback(void) { + int i; + uint8_t *src, *dst; + + for (i = img_height, src = img_tmp, dst = img_buf; --i >= 0; + src += img_bpl, dst += img_bpl) { + memcpy(dst, src, img_width); + } } - /* Invert the visible pixels in img_buf, but not the border pixels */ -void img_invert(void) -{ - uint8_t *pixel; - int y, x; - - for (y = img_height, pixel = img_buf; --y >= 0; pixel += img_bpl - img_width) - for (x = img_width; --x >= 0; pixel++) - /* Invert the pixel in such a way that 255 is mapped - * back to 255. This makes the "white signal" color - * flag look better. - */ - *pixel = 254 - *pixel; +void img_invert(void) { + uint8_t *pixel; + int y, x; + + for (y = img_height, pixel = img_buf; --y >= 0; pixel += img_bpl - img_width) + for (x = img_width; --x >= 0; pixel++) + /* Invert the pixel in such a way that 255 is mapped + * back to 255. This makes the "white signal" color + * flag look better. + */ + *pixel = 254 - *pixel; } - /* Expand the image in img_buf into img_tmp */ -uint8_t *img_expand(int *widthref, int *heightref, int *bplref) -{ - int i, bpl; - uint8_t *src, *dst; - - switch (speed) - { - case 'F': /* Fast */ - /* No copying necessary, just return img_buf */ - *widthref = img_width; - *heightref = img_height; - *bplref = img_bpl; - return img_buf; - - case 'M': /* Medium */ - /* Expand img_buf into img_tmp */ - loopinterp(); - *widthref = img_physwidth; - *heightref = img_physheight; - *bplref = img_bpl * 2; - return img_tmp; - - default: /* Medium or Fast */ - /* Expand img_buf into img_tmp */ - loopinterp(); - - /* Double up every raster line */ - bpl = 2 * img_bpl; - src = &img_tmp[(img_height - 1) * bpl]; - dst = &img_tmp[(img_physheight - 1) * bpl]; - for (i = img_height; --i >= 0; ) - { - memcpy(dst, src, img_physwidth); - dst -= bpl; - memcpy(dst, src, img_physwidth); - dst -= bpl; - src -= bpl; - } - - /* Return it */ - *widthref = img_physwidth; - *heightref = img_physheight; - *bplref = bpl; - return img_tmp; +uint8_t *img_expand(int *widthref, int *heightref, int *bplref) { + int i, bpl; + uint8_t *src, *dst; + + switch (speed) { + case 'F': /* Fast */ + /* No copying necessary, just return img_buf */ + *widthref = img_width; + *heightref = img_height; + *bplref = img_bpl; + return img_buf; + + case 'M': /* Medium */ + /* Expand img_buf into img_tmp */ + loopinterp(); + *widthref = img_physwidth; + *heightref = img_physheight; + *bplref = img_bpl * 2; + return img_tmp; + + default: /* Medium or Fast */ + /* Expand img_buf into img_tmp */ + loopinterp(); + + /* Double up every raster line */ + bpl = 2 * img_bpl; + src = &img_tmp[(img_height - 1) * bpl]; + dst = &img_tmp[(img_physheight - 1) * bpl]; + for (i = img_height; --i >= 0;) { + memcpy(dst, src, img_physwidth); + dst -= bpl; + memcpy(dst, src, img_physwidth); + dst -= bpl; + src -= bpl; } -} + /* Return it */ + *widthref = img_physwidth; + *heightref = img_physheight; + *bplref = bpl; + return img_tmp; + } +} /* This transforms a normal image into a "bump effect" image. It also expands * the image like img_expand() if necessary. */ -uint8_t *img_bump(int *widthref, int *heightref, int *bplref) -{ - uint8_t *dst, *src, *end; - int delta, bpl, i; - - switch (speed) - { - case 'F': /* Fast CPU */ - /* Can't generate shadows for the first few pixels, so just use - * a generic flat background. And hope nobody notices. - */ - delta = 3 * img_bpl + 2; - memset(img_tmp, 128, delta); - - /* The remaining ones can have shadows. Lift the "white_signal" - * test outside the loop, for efficiency. - */ - src = img_buf + delta; - dst = img_tmp + delta; - end = img_tmp + img_height * img_bpl; - if (*config.signal_color == 'W') - { - for (; dst < end; dst++, src++) - { - if (*src == 255) - *dst = 255; - else - *dst = (256 + src[0] - src[-delta]) / 2; - } - } +uint8_t *img_bump(int *widthref, int *heightref, int *bplref) { + uint8_t *dst, *src, *end; + int delta, bpl, i; + + switch (speed) { + case 'F': /* Fast CPU */ + /* Can't generate shadows for the first few pixels, so just use + * a generic flat background. And hope nobody notices. + */ + delta = 3 * img_bpl + 2; + memset(img_tmp, 128, delta); + + /* The remaining ones can have shadows. Lift the "white_signal" + * test outside the loop, for efficiency. + */ + src = img_buf + delta; + dst = img_tmp + delta; + end = img_tmp + img_height * img_bpl; + if (*config.signal_color == 'W') { + for (; dst < end; dst++, src++) { + if (*src == 255) + *dst = 255; else - { - for (; dst < end; dst++, src++) - { - *dst = (256 + src[0] - src[-delta]) / 2; - } - } - - /* return the image size */ - *widthref = img_width; - *heightref = img_height; - *bplref = img_bpl; - return img_tmp; - - default: /* Medium CPU or Slow CPU */ - /* Can't generate shadows for the first few pixels, so just use - * a generic flat background. And hope nobody notices. - */ - delta = 3 * img_bpl + 2; - memset(img_tmp, 128, delta * 2); - - /* The remaining ones can have shadows. Lift the "white_signal" - * test outside the loop, for efficiency. - */ - src = img_buf + delta; - dst = img_tmp + delta * 2; - end = img_tmp + img_height * img_bpl * 2; - if (*config.signal_color == 'W') - { - for (; dst < end; dst += 2, src++) - { - if (*src == 255) - dst[0] = dst[1] = 255; - else - dst[0] = dst[1] = (256 + src[0] - src[-delta]) / 2; - } - } + *dst = (256 + src[0] - src[-delta]) / 2; + } + } else { + for (; dst < end; dst++, src++) { + *dst = (256 + src[0] - src[-delta]) / 2; + } + } + + /* return the image size */ + *widthref = img_width; + *heightref = img_height; + *bplref = img_bpl; + return img_tmp; + + default: /* Medium CPU or Slow CPU */ + /* Can't generate shadows for the first few pixels, so just use + * a generic flat background. And hope nobody notices. + */ + delta = 3 * img_bpl + 2; + memset(img_tmp, 128, delta * 2); + + /* The remaining ones can have shadows. Lift the "white_signal" + * test outside the loop, for efficiency. + */ + src = img_buf + delta; + dst = img_tmp + delta * 2; + end = img_tmp + img_height * img_bpl * 2; + if (*config.signal_color == 'W') { + for (; dst < end; dst += 2, src++) { + if (*src == 255) + dst[0] = dst[1] = 255; else - { - for (; dst < end; dst += 2, src++) - { - dst[0] = dst[1] = (256 + src[0] - src[-delta]) / 2; - } - } - - /* For "Slow CPU", we also need to double the height */ - if (speed == 'S') - { - bpl = 2 * img_bpl; - src = &img_tmp[(img_height - 1) * bpl]; - dst = &img_tmp[(img_physheight - 1) * bpl]; - for (i = img_height; --i >= 0; ) - { - memcpy(dst, src, img_physwidth); - dst -= bpl; - memcpy(dst, src, img_physwidth); - dst -= bpl; - src -= bpl; - } - } - - /* return the physical size */ - *widthref = img_physwidth; - *heightref = img_physheight; - *bplref = img_bpl * 2; - return img_tmp; + dst[0] = dst[1] = (256 + src[0] - src[-delta]) / 2; + } + } else { + for (; dst < end; dst += 2, src++) { + dst[0] = dst[1] = (256 + src[0] - src[-delta]) / 2; + } + } + + /* For "Slow CPU", we also need to double the height */ + if (speed == 'S') { + bpl = 2 * img_bpl; + src = &img_tmp[(img_height - 1) * bpl]; + dst = &img_tmp[(img_physheight - 1) * bpl]; + for (i = img_height; --i >= 0;) { + memcpy(dst, src, img_physwidth); + dst -= bpl; + memcpy(dst, src, img_physwidth); + dst -= bpl; + src -= bpl; + } } + + /* return the physical size */ + *widthref = img_physwidth; + *heightref = img_physheight; + *bplref = img_bpl * 2; + return img_tmp; + } } /* This transforms a normal image into a "travel effect" image. It also * expands the image like img_expand() if necessary. */ -uint8_t *img_travel(int *widthref, int *heightref, int *bplref) -{ - uint8_t *dst, *src; - int bpl, i; - static uint8_t shift; - - /* Compute colormap shift factor, based on fade speed and whether this - * function is called for every frame, or just alternate frames. +uint8_t *img_travel(int *widthref, int *heightref, int *bplref) { + uint8_t *dst, *src; + int bpl, i; + static uint8_t shift; + + /* Compute colormap shift factor, based on fade speed and whether this + * function is called for every frame, or just alternate frames. + */ + switch (*config.fade_speed) { + case 'N': + i = 0; + break; + case 'S': + i = 1; + break; + case 'M': + i = 3; + break; + default: + i = 9; + break; + } + shift = (shift + i) & 0xff; + + /* Copy the image, expanding it for lower CPU speeds */ + switch (speed) { + case 'F': /* Fast CPU */ + /* The remaining ones can have shadows. Lift the "white_signal" + * test outside the loop, for efficiency. */ - switch (*config.fade_speed) - { - case 'N': i = 0; break; - case 'S': i = 1; break; - case 'M': i = 3; break; - default: i = 9; break; - } - shift = (shift + i) & 0xff; - - /* Copy the image, expanding it for lower CPU speeds */ - switch (speed) - { - case 'F': /* Fast CPU */ - /* The remaining ones can have shadows. Lift the "white_signal" - * test outside the loop, for efficiency. - */ - src = img_buf; - dst = img_tmp; - i = img_chunks; - if (*config.signal_color == 'W') - { - for (i <<= 3; --i >= 0; dst++, src++) - { - if (*src == 255 || *src < 3) - *dst = *src; - else if ((uint8_t)(*src + shift) == 255) - *dst = 254; - else - *dst = *src + shift; - } - } + src = img_buf; + dst = img_tmp; + i = img_chunks; + if (*config.signal_color == 'W') { + for (i <<= 3; --i >= 0; dst++, src++) { + if (*src == 255 || *src < 3) + *dst = *src; + else if ((uint8_t)(*src + shift) == 255) + *dst = 254; else - { - for (; --i >= 0; ) - { - if ((*dst = *src++) >= 3) *dst += shift; - dst++; - if ((*dst = *src++) >= 3) *dst += shift; - dst++; - if ((*dst = *src++) >= 3) *dst += shift; - dst++; - if ((*dst = *src++) >= 3) *dst += shift; - dst++; - if ((*dst = *src++) >= 3) *dst += shift; - dst++; - if ((*dst = *src++) >= 3) *dst += shift; - dst++; - if ((*dst = *src++) >= 3) *dst += shift; - dst++; - if ((*dst = *src++) >= 3) *dst += shift; - dst++; - } - } - - /* return the image size */ - *widthref = img_width; - *heightref = img_height; - *bplref = img_bpl; - return img_tmp; - - default: /* Medium CPU or Slow CPU */ - /* The remaining ones can have shadows. Lift the "white_signal" - * test outside the loop, for efficiency. - */ - src = img_buf; - dst = img_tmp; - i = img_chunks; - if (*config.signal_color == 'W') - { - for (i <<= 3; --i >= 0; dst += 2, src++) - { - if (*src == 255 || *src < 3) - dst[0] = dst[1] = *src; - else if ((uint8_t)(*src + shift) == 255) - *dst = 254; - else - dst[0] = dst[1] = *src + shift; - } - } + *dst = *src + shift; + } + } else { + for (; --i >= 0;) { + if ((*dst = *src++) >= 3) + *dst += shift; + dst++; + if ((*dst = *src++) >= 3) + *dst += shift; + dst++; + if ((*dst = *src++) >= 3) + *dst += shift; + dst++; + if ((*dst = *src++) >= 3) + *dst += shift; + dst++; + if ((*dst = *src++) >= 3) + *dst += shift; + dst++; + if ((*dst = *src++) >= 3) + *dst += shift; + dst++; + if ((*dst = *src++) >= 3) + *dst += shift; + dst++; + if ((*dst = *src++) >= 3) + *dst += shift; + dst++; + } + } + + /* return the image size */ + *widthref = img_width; + *heightref = img_height; + *bplref = img_bpl; + return img_tmp; + + default: /* Medium CPU or Slow CPU */ + /* The remaining ones can have shadows. Lift the "white_signal" + * test outside the loop, for efficiency. + */ + src = img_buf; + dst = img_tmp; + i = img_chunks; + if (*config.signal_color == 'W') { + for (i <<= 3; --i >= 0; dst += 2, src++) { + if (*src == 255 || *src < 3) + dst[0] = dst[1] = *src; + else if ((uint8_t)(*src + shift) == 255) + *dst = 254; else - { - for (; --i >= 0; ) - { - if ((*dst = *src++) >= 3) *dst += shift; - dst[1] = dst[0]; - dst += 2; - if ((*dst = *src++) >= 3) *dst += shift; - dst[1] = dst[0]; - dst += 2; - if ((*dst = *src++) >= 3) *dst += shift; - dst[1] = dst[0]; - dst += 2; - if ((*dst = *src++) >= 3) *dst += shift; - dst[1] = dst[0]; - dst += 2; - if ((*dst = *src++) >= 3) *dst += shift; - dst[1] = dst[0]; - dst += 2; - if ((*dst = *src++) >= 3) *dst += shift; - dst[1] = dst[0]; - dst += 2; - if ((*dst = *src++) >= 3) *dst += shift; - dst[1] = dst[0]; - dst += 2; - if ((*dst = *src++) >= 3) *dst += shift; - dst[1] = dst[0]; - dst += 2; - } - } - - /* For "Slow CPU", we also need to double the height */ - if (speed == 'S') - { - bpl = 2 * img_bpl; - src = &img_tmp[(img_height - 1) * bpl]; - dst = &img_tmp[(img_physheight - 1) * bpl]; - for (i = img_height; --i >= 0; ) - { - memcpy(dst, src, img_physwidth); - dst -= bpl; - memcpy(dst, src, img_physwidth); - dst -= bpl; - src -= bpl; - } - } - - /* return the physical size */ - *widthref = img_physwidth; - *heightref = img_physheight; - *bplref = img_bpl * 2; - return img_tmp; + dst[0] = dst[1] = *src + shift; + } + } else { + for (; --i >= 0;) { + if ((*dst = *src++) >= 3) + *dst += shift; + dst[1] = dst[0]; + dst += 2; + if ((*dst = *src++) >= 3) + *dst += shift; + dst[1] = dst[0]; + dst += 2; + if ((*dst = *src++) >= 3) + *dst += shift; + dst[1] = dst[0]; + dst += 2; + if ((*dst = *src++) >= 3) + *dst += shift; + dst[1] = dst[0]; + dst += 2; + if ((*dst = *src++) >= 3) + *dst += shift; + dst[1] = dst[0]; + dst += 2; + if ((*dst = *src++) >= 3) + *dst += shift; + dst[1] = dst[0]; + dst += 2; + if ((*dst = *src++) >= 3) + *dst += shift; + dst[1] = dst[0]; + dst += 2; + if ((*dst = *src++) >= 3) + *dst += shift; + dst[1] = dst[0]; + dst += 2; + } + } + + /* For "Slow CPU", we also need to double the height */ + if (speed == 'S') { + bpl = 2 * img_bpl; + src = &img_tmp[(img_height - 1) * bpl]; + dst = &img_tmp[(img_physheight - 1) * bpl]; + for (i = img_height; --i >= 0;) { + memcpy(dst, src, img_physwidth); + dst -= bpl; + memcpy(dst, src, img_physwidth); + dst -= bpl; + src -= bpl; + } } + + /* return the physical size */ + *widthref = img_physwidth; + *heightref = img_physheight; + *bplref = img_bpl * 2; + return img_tmp; + } } /* This transforms a normal image into a "Ripple effect" image. It also * expands the image like img_expand() if necessary. */ -uint8_t *img_ripple(int *widthref, int *heightref, int *bplref) -{ - uint8_t *dst, *src; - int bpl, i; - uint8_t tbl[256]; - - /* Compute the mapping table */ - for (i = QTY(tbl); --i >= 0; ) - { - tbl[i] = i + (uint8_t)((double)((QTY(tbl)/2 - abs((int)QTY(tbl)/2 - i)) >> 1) * sin((double)(i + img_rippleshift) / 10.0)); +uint8_t *img_ripple(int *widthref, int *heightref, int *bplref) { + uint8_t *dst, *src; + int bpl, i; + uint8_t tbl[256]; + + /* Compute the mapping table */ + for (i = QTY(tbl); --i >= 0;) { + tbl[i] = + i + + (uint8_t)((double)((QTY(tbl) / 2 - abs((int)QTY(tbl) / 2 - i)) >> 1) * + sin((double)(i + img_rippleshift) / 10.0)); + } + + /* Copy the image, expanding it for lower CPU speeds */ + switch (speed) { + case 'F': /* Fast CPU */ + /* copy the image, computing deltas */ + for (src = img_buf, dst = img_tmp, i = img_chunks; --i >= 0;) { + *dst++ = tbl[*src++]; + *dst++ = tbl[*src++]; + *dst++ = tbl[*src++]; + *dst++ = tbl[*src++]; + *dst++ = tbl[*src++]; + *dst++ = tbl[*src++]; + *dst++ = tbl[*src++]; + *dst++ = tbl[*src++]; } - /* Copy the image, expanding it for lower CPU speeds */ - switch (speed) - { - case 'F': /* Fast CPU */ - /* copy the image, computing deltas */ - for (src = img_buf, dst = img_tmp, i = img_chunks; - --i >= 0; - ) - { - *dst++ = tbl[*src++]; - *dst++ = tbl[*src++]; - *dst++ = tbl[*src++]; - *dst++ = tbl[*src++]; - *dst++ = tbl[*src++]; - *dst++ = tbl[*src++]; - *dst++ = tbl[*src++]; - *dst++ = tbl[*src++]; - } - - /* return the image size */ - *widthref = img_width; - *heightref = img_height; - *bplref = img_bpl; - return img_tmp; - - default: /* Medium CPU or Slow CPU */ - for (src = img_buf, dst = img_tmp, i = img_chunks; - --i >= 0; - ) - { - dst[0] = dst[1] = tbl[*src++], dst += 2; - dst[0] = dst[1] = tbl[*src++], dst += 2; - dst[0] = dst[1] = tbl[*src++], dst += 2; - dst[0] = dst[1] = tbl[*src++], dst += 2; - dst[0] = dst[1] = tbl[*src++], dst += 2; - dst[0] = dst[1] = tbl[*src++], dst += 2; - dst[0] = dst[1] = tbl[*src++], dst += 2; - dst[0] = dst[1] = tbl[*src++], dst += 2; - } - - /* For "Slow CPU", we also need to double the height */ - if (speed == 'S') - { - bpl = 2 * img_bpl; - src = &img_tmp[(img_height - 1) * bpl]; - dst = &img_tmp[(img_physheight - 1) * bpl]; - for (i = img_height; --i >= 0; ) - { - memcpy(dst, src, img_physwidth); - dst -= bpl; - memcpy(dst, src, img_physwidth); - dst -= bpl; - src -= bpl; - } - } - - /* return the physical size */ - *widthref = img_physwidth; - *heightref = img_physheight; - *bplref = img_bpl * 2; - return img_tmp; + /* return the image size */ + *widthref = img_width; + *heightref = img_height; + *bplref = img_bpl; + return img_tmp; + + default: /* Medium CPU or Slow CPU */ + for (src = img_buf, dst = img_tmp, i = img_chunks; --i >= 0;) { + dst[0] = dst[1] = tbl[*src++], dst += 2; + dst[0] = dst[1] = tbl[*src++], dst += 2; + dst[0] = dst[1] = tbl[*src++], dst += 2; + dst[0] = dst[1] = tbl[*src++], dst += 2; + dst[0] = dst[1] = tbl[*src++], dst += 2; + dst[0] = dst[1] = tbl[*src++], dst += 2; + dst[0] = dst[1] = tbl[*src++], dst += 2; + dst[0] = dst[1] = tbl[*src++], dst += 2; } + + /* For "Slow CPU", we also need to double the height */ + if (speed == 'S') { + bpl = 2 * img_bpl; + src = &img_tmp[(img_height - 1) * bpl]; + dst = &img_tmp[(img_physheight - 1) * bpl]; + for (i = img_height; --i >= 0;) { + memcpy(dst, src, img_physwidth); + dst -= bpl; + memcpy(dst, src, img_physwidth); + dst -= bpl; + src -= bpl; + } + } + + /* return the physical size */ + *widthref = img_physwidth; + *heightref = img_physheight; + *bplref = img_bpl * 2; + return img_tmp; + } } diff --git a/libvisual-plugins/plugins/actor/blursk/loop.c b/libvisual-plugins/plugins/actor/blursk/loop.c index 4bd37f56c..a4afb3efb 100644 --- a/libvisual-plugins/plugins/actor/blursk/loop.c +++ b/libvisual-plugins/plugins/actor/blursk/loop.c @@ -25,7 +25,8 @@ * Copyright (C) 1999 Steve Kirkendall * * Portions of this file are derived from the XMMS "Blur Scope" plugin. - * XMMS is Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies + * XMMS is Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas + * Nilsson and 4Front Technologies * * 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 @@ -44,315 +45,301 @@ #include "actor_blursk.h" #include "blursk.h" -# define BLUR src = *srcref++; \ - *dest++ = (src[-bpl] + src[0] \ - + src[bpl - 1] + src[bpl + 1]) >> 2; \ - bpl = -bpl; - -# define SHARP *dest++ = **srcref++; - -# define SMEAR src = *srcref++; \ - pix = (src[-bpl - 1] + src[bpl - 1] \ - + src[0] + src[1]) >> 2; \ - if (pix < *orig++) \ - pix = orig[-1]; \ - *dest++ = pix; \ - bpl = -bpl; - -# define MELT src = *srcref++; \ - pix = *orig++; \ - if (pix < 160) \ - pix = (src[-bpl] + src[0] \ - + src[bpl - 1] + src[bpl + 1]) >> 2; \ - *dest++ = pix; \ - bpl = -bpl; - - -void loopblur(void) -{ - unsigned int i = img_chunks; - int bpl = img_bpl; - unsigned char *dest, *src, **srcref; - - i = img_chunks; - dest = img_tmp; - srcref = img_source; - do - { - BLUR - BLUR - BLUR - BLUR - BLUR - BLUR - BLUR - BLUR +#define BLUR \ + src = *srcref++; \ + *dest++ = (src[-bpl] + src[0] + src[bpl - 1] + src[bpl + 1]) >> 2; \ + bpl = -bpl; + +#define SHARP *dest++ = **srcref++; + +#define SMEAR \ + src = *srcref++; \ + pix = (src[-bpl - 1] + src[bpl - 1] + src[0] + src[1]) >> 2; \ + if (pix < *orig++) \ + pix = orig[-1]; \ + *dest++ = pix; \ + bpl = -bpl; + +#define MELT \ + src = *srcref++; \ + pix = *orig++; \ + if (pix < 160) \ + pix = (src[-bpl] + src[0] + src[bpl - 1] + src[bpl + 1]) >> 2; \ + *dest++ = pix; \ + bpl = -bpl; + +void loopblur(void) { + unsigned int i = img_chunks; + int bpl = img_bpl; + unsigned char *dest, *src, **srcref; + + i = img_chunks; + dest = img_tmp; + srcref = img_source; + do { + BLUR BLUR BLUR BLUR BLUR BLUR BLUR BLUR + + } while (--i != 0); +} - } while (--i != 0); +void loopsmear(void) { + unsigned int i = img_chunks; + int bpl = img_bpl; + unsigned char *dest, *src, *orig, **srcref, pix; + + i = img_chunks; + dest = img_tmp; + srcref = img_source; + orig = img_buf; + do { + SMEAR + SMEAR + SMEAR + SMEAR + SMEAR + SMEAR + SMEAR + SMEAR + + } while (--i != 0); } -void loopsmear(void) -{ - unsigned int i = img_chunks; - int bpl = img_bpl; - unsigned char *dest, *src, *orig, **srcref, pix; +void loopmelt(void) { + unsigned int i = img_chunks; + int bpl = img_bpl; + unsigned char *dest, *src, *orig, **srcref, pix; - i = img_chunks; - dest = img_tmp; - srcref = img_source; - orig = img_buf; - do - { - SMEAR - SMEAR - SMEAR - SMEAR - SMEAR - SMEAR - SMEAR - SMEAR + i = img_chunks; + dest = img_tmp; + srcref = img_source; + orig = img_buf; + do { + MELT MELT MELT MELT MELT MELT MELT MELT - } while (--i != 0); + } while (--i != 0); } -void loopmelt(void) -{ - unsigned int i = img_chunks; - int bpl = img_bpl; - unsigned char *dest, *src, *orig, **srcref, pix; - - i = img_chunks; - dest = img_tmp; - srcref = img_source; - orig = img_buf; - do - { - MELT - MELT - MELT - MELT - MELT - MELT - MELT - MELT - - } while (--i != 0); +void loopsharp(void) { + unsigned int i; + unsigned char *dest, **srcref; + + i = img_chunks; + dest = img_tmp; + srcref = img_source; + do { + SHARP + SHARP + SHARP + SHARP + SHARP + SHARP + SHARP + SHARP + + } while (--i != 0); } +void loopreduced1(void) { + unsigned int i; + int bpl; + unsigned char *dest, *src, **srcref; + + i = img_chunks; + bpl = img_bpl; + dest = img_tmp; + srcref = img_source; + do { + BLUR SHARP SHARP SHARP BLUR SHARP SHARP SHARP + } while (--i != 0); +} -void loopsharp(void) -{ - unsigned int i; - unsigned char *dest, **srcref; +void loopreduced2(void) { + unsigned int i; + int bpl; + unsigned char *dest, *src, **srcref; - i = img_chunks; - dest = img_tmp; - srcref = img_source; - do - { - SHARP - SHARP - SHARP - SHARP - SHARP - SHARP - SHARP - SHARP + i = img_chunks; + bpl = img_bpl; + dest = img_tmp; + srcref = img_source; + do { + SHARP + BLUR SHARP SHARP SHARP BLUR SHARP SHARP - } while (--i != 0); + } while (--i != 0); } -void loopreduced1(void) -{ - unsigned int i; - int bpl; - unsigned char *dest, *src, **srcref; - - i = img_chunks; - bpl = img_bpl; - dest = img_tmp; - srcref = img_source; - do - { - BLUR - SHARP - SHARP - SHARP - BLUR - SHARP - SHARP - SHARP - } while (--i != 0); +void loopreduced3(void) { + unsigned int i; + int bpl; + unsigned char *dest, *src, **srcref; + + i = img_chunks; + bpl = img_bpl; + dest = img_tmp; + srcref = img_source; + do { + SHARP + SHARP + BLUR SHARP SHARP SHARP BLUR SHARP + + } while (--i != 0); } -void loopreduced2(void) -{ - unsigned int i; - int bpl; - unsigned char *dest, *src, **srcref; - - i = img_chunks; - bpl = img_bpl; - dest = img_tmp; - srcref = img_source; - do - { - SHARP - BLUR - SHARP - SHARP - SHARP - BLUR - SHARP - SHARP - - } while (--i != 0); +void loopreduced4(void) { + unsigned int i; + int bpl; + unsigned char *dest, *src, **srcref; + + i = img_chunks; + bpl = img_bpl; + dest = img_tmp; + srcref = img_source; + do { + SHARP + SHARP + SHARP + BLUR SHARP SHARP SHARP BLUR + + } while (--i != 0); } -void loopreduced3(void) -{ - unsigned int i; - int bpl; - unsigned char *dest, *src, **srcref; +void loopfade(int change) { + register unsigned char *ptr; + unsigned char limit; + unsigned int i; + /* Fade the pixels */ + if (change < 0) { + change = -change; + ptr = img_buf; i = img_chunks; - bpl = img_bpl; - dest = img_tmp; - srcref = img_source; - do - { - SHARP - SHARP - BLUR - SHARP - SHARP - SHARP - BLUR - SHARP - + do { + if (*ptr > change) + *ptr -= change; + else + *ptr = 0; + ptr++; + if (*ptr > change) + *ptr -= change; + else + *ptr = 0; + ptr++; + if (*ptr > change) + *ptr -= change; + else + *ptr = 0; + ptr++; + if (*ptr > change) + *ptr -= change; + else + *ptr = 0; + ptr++; + if (*ptr > change) + *ptr -= change; + else + *ptr = 0; + ptr++; + if (*ptr > change) + *ptr -= change; + else + *ptr = 0; + ptr++; + if (*ptr > change) + *ptr -= change; + else + *ptr = 0; + ptr++; + if (*ptr > change) + *ptr -= change; + else + *ptr = 0; + ptr++; } while (--i != 0); -} - -void loopreduced4(void) -{ - unsigned int i; - int bpl; - unsigned char *dest, *src, **srcref; - + } else { + limit = 255 - change; + ptr = img_buf; i = img_chunks; - bpl = img_bpl; - dest = img_tmp; - srcref = img_source; - do - { - SHARP - SHARP - SHARP - BLUR - SHARP - SHARP - SHARP - BLUR - + do { + if (*ptr < limit) + *ptr += change; + else + *ptr = 255; + ptr++; + if (*ptr < limit) + *ptr += change; + else + *ptr = 255; + ptr++; + if (*ptr < limit) + *ptr += change; + else + *ptr = 255; + ptr++; + if (*ptr < limit) + *ptr += change; + else + *ptr = 255; + ptr++; + if (*ptr < limit) + *ptr += change; + else + *ptr = 255; + ptr++; + if (*ptr < limit) + *ptr += change; + else + *ptr = 255; + ptr++; + if (*ptr < limit) + *ptr += change; + else + *ptr = 255; + ptr++; + if (*ptr < limit) + *ptr += change; + else + *ptr = 255; + ptr++; } while (--i != 0); -} - -void loopfade(int change) -{ - register unsigned char *ptr; - unsigned char limit; - unsigned int i; - - /* Fade the pixels */ - if (change < 0) - { - change = -change; - ptr = img_buf; - i = img_chunks; - do - { - if (*ptr > change) *ptr -= change; else *ptr = 0; - ptr++; - if (*ptr > change) *ptr -= change; else *ptr = 0; - ptr++; - if (*ptr > change) *ptr -= change; else *ptr = 0; - ptr++; - if (*ptr > change) *ptr -= change; else *ptr = 0; - ptr++; - if (*ptr > change) *ptr -= change; else *ptr = 0; - ptr++; - if (*ptr > change) *ptr -= change; else *ptr = 0; - ptr++; - if (*ptr > change) *ptr -= change; else *ptr = 0; - ptr++; - if (*ptr > change) *ptr -= change; else *ptr = 0; - ptr++; - } while (--i != 0); - } - else - { - limit = 255 - change; - ptr = img_buf; - i = img_chunks; - do - { - if (*ptr < limit) *ptr += change; else *ptr = 255; - ptr++; - if (*ptr < limit) *ptr += change; else *ptr = 255; - ptr++; - if (*ptr < limit) *ptr += change; else *ptr = 255; - ptr++; - if (*ptr < limit) *ptr += change; else *ptr = 255; - ptr++; - if (*ptr < limit) *ptr += change; else *ptr = 255; - ptr++; - if (*ptr < limit) *ptr += change; else *ptr = 255; - ptr++; - if (*ptr < limit) *ptr += change; else *ptr = 255; - ptr++; - if (*ptr < limit) *ptr += change; else *ptr = 255; - ptr++; - } while (--i != 0); - } + } } /* Interpolate between pixels, doubling the image width. It is assumed that * the source is in img_buf, the destination is img_tmp, and img_tmp is large * enough to hold the double-width image. */ -void loopinterp(void) -{ - unsigned int i = img_chunks; - unsigned char *dest, *src, prev; +void loopinterp(void) { + unsigned int i = img_chunks; + unsigned char *dest, *src, prev; - i = img_chunks; - dest = img_tmp; - src = img_buf; - do - { - prev = *dest++ = *src++; - *dest++ = (prev + *src) >> 1; + i = img_chunks; + dest = img_tmp; + src = img_buf; + do { + prev = *dest++ = *src++; + *dest++ = (prev + *src) >> 1; - prev = *dest++ = *src++; - *dest++ = (prev + *src) >> 1; + prev = *dest++ = *src++; + *dest++ = (prev + *src) >> 1; - prev = *dest++ = *src++; - *dest++ = (prev + *src) >> 1; + prev = *dest++ = *src++; + *dest++ = (prev + *src) >> 1; - prev = *dest++ = *src++; - *dest++ = (prev + *src) >> 1; + prev = *dest++ = *src++; + *dest++ = (prev + *src) >> 1; - prev = *dest++ = *src++; - *dest++ = (prev + *src) >> 1; + prev = *dest++ = *src++; + *dest++ = (prev + *src) >> 1; - prev = *dest++ = *src++; - *dest++ = (prev + *src) >> 1; + prev = *dest++ = *src++; + *dest++ = (prev + *src) >> 1; - prev = *dest++ = *src++; - *dest++ = (prev + *src) >> 1; + prev = *dest++ = *src++; + *dest++ = (prev + *src) >> 1; - prev = *dest++ = *src++; - *dest++ = (prev + *src) >> 1; + prev = *dest++ = *src++; + *dest++ = (prev + *src) >> 1; - } while (--i != 0); + } while (--i != 0); } diff --git a/libvisual-plugins/plugins/actor/blursk/paste.c b/libvisual-plugins/plugins/actor/blursk/paste.c index 81d050cec..1cf0c8cb8 100644 --- a/libvisual-plugins/plugins/actor/blursk/paste.c +++ b/libvisual-plugins/plugins/actor/blursk/paste.c @@ -4,8 +4,9 @@ * Copyright (C) 1999 Steve Kirkendall * * Portions of this file are derived from the XMMS "Blur Scope" plugin. - * XMMS is Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies - * + * XMMS is Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas + * Nilsson and 4Front Technologies + * * 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 @@ -30,129 +31,121 @@ #include "actor_blursk.h" #include "blursk.h" - - /* Convert the leading words in a value into a single letter and '.' */ -static char *abbreviate(char *value) -{ - char full[40]; /* full value */ - static char abbr[40]; /* abbreviated value */ - char *word; - - /* Strip off a trailing "stencil" or "flash" word */ - strcpy(full, value); - word = strrchr(full, ' '); - if (word && (!strcmp(word, " stencil") || !strcmp(word, " flash"))) - *word = '\0'; - - /* generate the abbreviated version of the string */ - word = strrchr(full, ' '); - if (word) - sprintf(abbr, "%.1s.%s", full, word + 1); - else - strcpy(abbr, full); - return abbr; +static char *abbreviate(char *value) { + char full[40]; /* full value */ + static char abbr[40]; /* abbreviated value */ + char *word; + + /* Strip off a trailing "stencil" or "flash" word */ + strcpy(full, value); + word = strrchr(full, ' '); + if (word && (!strcmp(word, " stencil") || !strcmp(word, " flash"))) + *word = '\0'; + + /* generate the abbreviated version of the string */ + word = strrchr(full, ' '); + if (word) + sprintf(abbr, "%.1s.%s", full, word + 1); + else + strcpy(abbr, full); + return abbr; } /* Convert a value to its shortest possible form */ -static void genfield( - char **buf, /* where to stuff the short value */ - char *current, /* current value */ - char *(*namefunc)(int), /* called to generate names of items */ - ...) /* NULL-terminated list of hardcoded items */ +static void +genfield(char **buf, /* where to stuff the short value */ + char *current, /* current value */ + char *(*namefunc)(int), /* called to generate names of items */ + ...) /* NULL-terminated list of hardcoded items */ { - char str[40]; /* abbreviated value */ - char *value; - int i,len, found; - va_list ap; - - /* generate the abbreviated version of the string */ - strcpy(str, abbreviate(current)); + char str[40]; /* abbreviated value */ + char *value; + int i, len, found; + va_list ap; + + /* generate the abbreviated version of the string */ + strcpy(str, abbreviate(current)); + + /* compare to other values, to see how short we can make this */ + va_start(ap, namefunc); + i = 0; + value = namefunc ? (*namefunc)(i) : NULL; + if (!value) { + namefunc = NULL; + value = va_arg(ap, char *); + } + + /* For each arg... */ + for (found = FALSE, len = 1; value;) { + /* abbreviate this possible value */ + value = abbreviate(value); + + /* if this is the initial value, remember that. */ + if (!strcmp(value, str)) + found = TRUE; + else + /* make sure "len" is big enough to distinguish this + * item from any preceding item. + */ + while (!found && !strncmp(value, str, len)) + len++; - /* compare to other values, to see how short we can make this */ - va_start(ap, namefunc); - i = 0; + /* get the next value, from either the function or args */ + i++; value = namefunc ? (*namefunc)(i) : NULL; - if (!value) - { - namefunc = NULL; - value = va_arg(ap, char *); - } - - /* For each arg... */ - for (found = FALSE, len = 1; value; ) - { - /* abbreviate this possible value */ - value = abbreviate(value); - - /* if this is the initial value, remember that. */ - if (!strcmp(value, str)) - found = TRUE; - else - /* make sure "len" is big enough to distinguish this - * item from any preceding item. - */ - while (!found && !strncmp(value, str, len)) - len++; - - /* get the next value, from either the function or args */ - i++; - value = namefunc ? (*namefunc)(i) : NULL; - if (!value) - { - namefunc = NULL; - value = va_arg(ap, char *); - } + if (!value) { + namefunc = NULL; + value = va_arg(ap, char *); } - va_end(ap); + } + va_end(ap); - /* Add the shortest abbreviation of this item to the buffer */ - strncpy(*buf, str, len); - (*buf) += len; - **buf = '\0'; + /* Add the shortest abbreviation of this item to the buffer */ + strncpy(*buf, str, len); + (*buf) += len; + **buf = '\0'; } - /* return a string which describes the current configuration */ -char *paste_genstring(void) -{ - static char buf[100]; - char *str; - - /* start with the color, as a decimal number */ - sprintf(buf, "%d", config.color); - str = buf + strlen(buf); - - /* Add the color options */ - genfield(&str, config.color_style, color_name, NULL); - genfield(&str, config.fade_speed, NULL, "No fade", "Slow fade", - "Medium fade", "Fast fade", NULL); - genfield(&str, config.signal_color, NULL, "Normal signal", - "White signal", "Cycling signal", NULL); - *str++ = config.contour_lines ? 'Y' : 'N'; - *str++ = config.hue_on_beats ? 'Y' : 'N'; - genfield(&str, config.background, color_background_name, NULL); - *str++ = '/'; - - /* Add the blur options */ - genfield(&str, config.blur_style, blur_name, NULL); - genfield(&str, config.transition_speed, NULL, "Slow switch", - "Medium switch", "Fast switch", NULL); - genfield(&str, config.blur_when, blur_when_name, NULL); - genfield(&str, config.blur_stencil, bitmap_stencil_name, NULL); - *str++ = config.slow_motion ? 'Y': 'N'; - *str++ = '/'; - - /* Add the effects options */ - genfield(&str, config.signal_style, signal_style_name, NULL); - genfield(&str, config.plot_style, render_plotname, NULL); - *str++ = config.thick_on_beats ? 'Y' : 'N'; - genfield(&str, config.flash_style, bitmap_flash_name, NULL); - genfield(&str, config.overall_effect, NULL, "Normal effect", - "Bump effect", "Anti-fade effect", "Ripple effect", NULL); - genfield(&str, config.floaters, floaters_name, NULL); - *str = '\0'; - return buf; +char *paste_genstring(void) { + static char buf[100]; + char *str; + + /* start with the color, as a decimal number */ + sprintf(buf, "%d", config.color); + str = buf + strlen(buf); + + /* Add the color options */ + genfield(&str, config.color_style, color_name, NULL); + genfield(&str, config.fade_speed, NULL, "No fade", "Slow fade", "Medium fade", + "Fast fade", NULL); + genfield(&str, config.signal_color, NULL, "Normal signal", "White signal", + "Cycling signal", NULL); + *str++ = config.contour_lines ? 'Y' : 'N'; + *str++ = config.hue_on_beats ? 'Y' : 'N'; + genfield(&str, config.background, color_background_name, NULL); + *str++ = '/'; + + /* Add the blur options */ + genfield(&str, config.blur_style, blur_name, NULL); + genfield(&str, config.transition_speed, NULL, "Slow switch", "Medium switch", + "Fast switch", NULL); + genfield(&str, config.blur_when, blur_when_name, NULL); + genfield(&str, config.blur_stencil, bitmap_stencil_name, NULL); + *str++ = config.slow_motion ? 'Y' : 'N'; + *str++ = '/'; + + /* Add the effects options */ + genfield(&str, config.signal_style, signal_style_name, NULL); + genfield(&str, config.plot_style, render_plotname, NULL); + *str++ = config.thick_on_beats ? 'Y' : 'N'; + genfield(&str, config.flash_style, bitmap_flash_name, NULL); + genfield(&str, config.overall_effect, NULL, "Normal effect", "Bump effect", + "Anti-fade effect", "Ripple effect", NULL); + genfield(&str, config.floaters, floaters_name, NULL); + *str = '\0'; + return buf; } /* Convert a single field. The behavior of this function has been tweaked to @@ -168,185 +161,165 @@ char *paste_genstring(void) * bothering to check for errors. At the end of a series, if "field" is NULL * then there was an error. */ -static char *parsefield( - char **field, /* pointer into string of fields */ - char *dflt, /* default return value */ - char *(*namefunc)(int), /* called to generate names of items */ - ...) /* NULL-terminated list of hardcoded items */ +static char * +parsefield(char **field, /* pointer into string of fields */ + char *dflt, /* default return value */ + char *(*namefunc)(int), /* called to generate names of items */ + ...) /* NULL-terminated list of hardcoded items */ { - char *value, *abbr; - int i,len; - char *found; - va_list ap; - - /* if "field" is NULL or points to a slash, do nothing */ - if (!*field || !**field || **field == '/') - { - return dflt; - } + char *value, *abbr; + int i, len; + char *found; + va_list ap; - /* count the length of this abbreviated field */ - len = 1; - if ((*field)[1] == '.') - len = 2; - while (islower((*field)[len])) - len++; - - - /* compare to each possible value, to find the unabbreviated form */ - va_start(ap, namefunc); - i = 0; + /* if "field" is NULL or points to a slash, do nothing */ + if (!*field || !**field || **field == '/') { + return dflt; + } + + /* count the length of this abbreviated field */ + len = 1; + if ((*field)[1] == '.') + len = 2; + while (islower((*field)[len])) + len++; + + /* compare to each possible value, to find the unabbreviated form */ + va_start(ap, namefunc); + i = 0; + value = namefunc ? (*namefunc)(i) : NULL; + if (!value) { + namefunc = NULL; + value = va_arg(ap, char *); + } + for (found = NULL; value;) { + /* abbreviate this possible value */ + abbr = abbreviate(value); + + /* if this is the value value, remember that. */ + if (!found && !strncmp(abbr, *field, len)) + found = value; + + /* get the next value, from either the function or args */ + i++; value = namefunc ? (*namefunc)(i) : NULL; - if (!value) - { - namefunc = NULL; - value = va_arg(ap, char *); - } - for (found = NULL; value; ) - { - /* abbreviate this possible value */ - abbr = abbreviate(value); - - /* if this is the value value, remember that. */ - if (!found && !strncmp(abbr, *field, len)) - found = value; - - /* get the next value, from either the function or args */ - i++; - value = namefunc ? (*namefunc)(i) : NULL; - if (!value) - { - namefunc = NULL; - value = va_arg(ap, char *); - } - } - va_end(ap); - - /* did we find it? */ - if (found) - { - /* Yes - move past the field, and then return long version */ - *field += len; - return found; - } - else - { - /* No - skip to next slash or end of string & return default */ - while (**field && **field != '/') - (*field)++; - return dflt; + if (!value) { + namefunc = NULL; + value = va_arg(ap, char *); } + } + va_end(ap); + + /* did we find it? */ + if (found) { + /* Yes - move past the field, and then return long version */ + *field += len; + return found; + } else { + /* No - skip to next slash or end of string & return default */ + while (**field && **field != '/') + (*field)++; + return dflt; + } } /* This is like parsefield(), but for booleans */ -static int parsebool( - char **field, /* pointer to current field within pasted string */ - int dflt) /* default value */ +static int +parsebool(char **field, /* pointer to current field within pasted string */ + int dflt) /* default value */ { - if (!*field || !**field || **field == '/') - return dflt; - if (**field == 'Y') - { - (*field)++; - return TRUE; - } - if (**field == 'N') - { - (*field)++; - return FALSE; - } - - /* Not recognized -- skip to next slash or end of string */ - while (**field && **field != '/') - (*field)++; + if (!*field || !**field || **field == '/') return dflt; + if (**field == 'Y') { + (*field)++; + return TRUE; + } + if (**field == 'N') { + (*field)++; + return FALSE; + } + + /* Not recognized -- skip to next slash or end of string */ + while (**field && **field != '/') + (*field)++; + return dflt; } /* parse a configuration string & set the current configuration accordingly */ -BlurskConfig *paste_parsestring(char *str) -{ - char *afternumber; - uint32_t newcolor; - static BlurskConfig c; - static int first_call = TRUE; - - if(first_call) - { - memset(&c, 0, sizeof(BlurskConfig)); - config_default(&c); - first_call = FALSE; - } - - /* skip leading whitespace */ - while (isspace(*str)) - str++; - - /* skip title, if any */ - if (*str == '[') - { - ++str; - while (*str && *str != ']') - str++; - if (*str) - *str++ = '\0'; - } - - /* parse the color */ - newcolor = (uint32_t) strtol(str, &afternumber, 10); - - /* no color parsed? */ - if (afternumber == str) - return &c; - - c.color = newcolor; - str = afternumber; - - /* parse the color options */ - c.color_style = parsefield(&str, c.color_style, color_name,NULL); - c.fade_speed = parsefield(&str, c.fade_speed, NULL, "No fade", - "Slow fade", "Medium fade", "Fast fade", NULL); - c.signal_color = parsefield(&str, c.signal_color, NULL, - "Normal signal", "White signal", "Cycling signal", NULL); - c.contour_lines = parsebool(&str, c.contour_lines); - c.hue_on_beats = parsebool(&str, c.hue_on_beats); - c.background = parsefield(&str, c.background, - color_background_name, NULL); - if (!str) - return &c; - while (*str && *str != '/') - str++; - if (*str == '/') - str++; - - /* parse the blur options */ - c.blur_style = parsefield(&str, c.blur_style, blur_name, NULL); - c.transition_speed = parsefield(&str, c.transition_speed, NULL, - "Slow switch", "Medium switch", "Fast switch", NULL); - c.blur_when = parsefield(&str, c.blur_when, blur_when_name, NULL); - c.blur_stencil = parsefield(&str, c.blur_stencil, - bitmap_stencil_name, NULL); - c.slow_motion = parsebool(&str, c.slow_motion); - if (!str) - return &c; - while (*str && *str != '/') - str++; - if (*str == '/') - str++; - - /* parse the effects options */ - c.signal_style = parsefield(&str, c.signal_style, signal_style_name, - NULL); - c.plot_style = parsefield(&str, c.plot_style, render_plotname, - NULL); - c.thick_on_beats = parsebool(&str, c.thick_on_beats); - c.flash_style = parsefield(&str, c.flash_style, - bitmap_flash_name, NULL); - c.overall_effect = parsefield(&str, c.overall_effect, NULL, - "Normal effect", "Bump effect", "Anti-fade effect", - "Ripple effect", NULL); - c.floaters = parsefield(&str, c.floaters, floaters_name, NULL); +BlurskConfig *paste_parsestring(char *str) { + char *afternumber; + uint32_t newcolor; + static BlurskConfig c; + static int first_call = TRUE; + + if (first_call) { + memset(&c, 0, sizeof(BlurskConfig)); + config_default(&c); + first_call = FALSE; + } + + /* skip leading whitespace */ + while (isspace(*str)) + str++; + + /* skip title, if any */ + if (*str == '[') { + ++str; + while (*str && *str != ']') + str++; + if (*str) + *str++ = '\0'; + } + + /* parse the color */ + newcolor = (uint32_t)strtol(str, &afternumber, 10); + + /* no color parsed? */ + if (afternumber == str) + return &c; + c.color = newcolor; + str = afternumber; + + /* parse the color options */ + c.color_style = parsefield(&str, c.color_style, color_name, NULL); + c.fade_speed = parsefield(&str, c.fade_speed, NULL, "No fade", "Slow fade", + "Medium fade", "Fast fade", NULL); + c.signal_color = parsefield(&str, c.signal_color, NULL, "Normal signal", + "White signal", "Cycling signal", NULL); + c.contour_lines = parsebool(&str, c.contour_lines); + c.hue_on_beats = parsebool(&str, c.hue_on_beats); + c.background = parsefield(&str, c.background, color_background_name, NULL); + if (!str) + return &c; + while (*str && *str != '/') + str++; + if (*str == '/') + str++; + + /* parse the blur options */ + c.blur_style = parsefield(&str, c.blur_style, blur_name, NULL); + c.transition_speed = parsefield(&str, c.transition_speed, NULL, "Slow switch", + "Medium switch", "Fast switch", NULL); + c.blur_when = parsefield(&str, c.blur_when, blur_when_name, NULL); + c.blur_stencil = parsefield(&str, c.blur_stencil, bitmap_stencil_name, NULL); + c.slow_motion = parsebool(&str, c.slow_motion); + if (!str) return &c; + while (*str && *str != '/') + str++; + if (*str == '/') + str++; + + /* parse the effects options */ + c.signal_style = parsefield(&str, c.signal_style, signal_style_name, NULL); + c.plot_style = parsefield(&str, c.plot_style, render_plotname, NULL); + c.thick_on_beats = parsebool(&str, c.thick_on_beats); + c.flash_style = parsefield(&str, c.flash_style, bitmap_flash_name, NULL); + c.overall_effect = + parsefield(&str, c.overall_effect, NULL, "Normal effect", "Bump effect", + "Anti-fade effect", "Ripple effect", NULL); + c.floaters = parsefield(&str, c.floaters, floaters_name, NULL); + + return &c; } - - diff --git a/libvisual-plugins/plugins/actor/blursk/render.c b/libvisual-plugins/plugins/actor/blursk/render.c index ef49ece87..bca92b9cb 100644 --- a/libvisual-plugins/plugins/actor/blursk/render.c +++ b/libvisual-plugins/plugins/actor/blursk/render.c @@ -25,7 +25,8 @@ * Copyright (C) 1999 Steve Kirkendall * * Portions of this file are derived from the XMMS "Blur Scope" plugin. - * XMMS is Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies + * XMMS is Copyright (C) 1998-1999 Peter Alm, Mikael Alm, Olle Hallnas, Thomas + * Nilsson and 4Front Technologies * * 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 @@ -52,303 +53,258 @@ * bead. Examine render_highlow() for a description of why this value was * chosen. */ -#define BEAD_THRESHOLD 15000 - +#define BEAD_THRESHOLD 15000 /* Some of the plotting functions interpolate to generate extra data points. * The data points are stored here when that happens. */ -#define MAXPOINTS 512 -static int16_t renderdata[MAXPOINTS]; - +#define MAXPOINTS 512 +static int16_t renderdata[MAXPOINTS]; /* Draw a line between two points, in a given color */ -static void line(int x, int y, int x2, int y2, unsigned char color) -{ - int xdiff, ydiff; - int error; - int bpl; - register unsigned char *point; - register int i; - - /* We only draw from left to right. Swap endpoints otherwise */ - if (x > x2) - { - error = x; - x = x2; - x2 = error; - error = y; - y = y2; - y2 = error; - } - xdiff = x2 - x; - - /* skip if either endpoint is offscreen */ - if (x < 0 || x2 >= img_width) - return; - - /* Moving upward or downward? */ - if(y < y2) - { - /* downward */ - if (y < 0 || y2 >= img_height - 1) - return; - bpl = img_bpl; - ydiff = y2 - y; - } - else - { - /* upward */ - if (y2 < 0 || y >= img_height - 1) - return; - bpl = -img_bpl; - ydiff = y - y2; - } - - /* locate the starting point */ - point = &IMG_PIXEL(x, y); - - /* different line strategy, depending on slope */ - if (xdiff == 0) - { - /* vertical line */ - for (i = ydiff + 1; --i >= 0; point += bpl) - *point = color; +static void line(int x, int y, int x2, int y2, unsigned char color) { + int xdiff, ydiff; + int error; + int bpl; + register unsigned char *point; + register int i; + + /* We only draw from left to right. Swap endpoints otherwise */ + if (x > x2) { + error = x; + x = x2; + x2 = error; + error = y; + y = y2; + y2 = error; + } + xdiff = x2 - x; + + /* skip if either endpoint is offscreen */ + if (x < 0 || x2 >= img_width) + return; + + /* Moving upward or downward? */ + if (y < y2) { + /* downward */ + if (y < 0 || y2 >= img_height - 1) + return; + bpl = img_bpl; + ydiff = y2 - y; + } else { + /* upward */ + if (y2 < 0 || y >= img_height - 1) + return; + bpl = -img_bpl; + ydiff = y - y2; + } + + /* locate the starting point */ + point = &IMG_PIXEL(x, y); + + /* different line strategy, depending on slope */ + if (xdiff == 0) { + /* vertical line */ + for (i = ydiff + 1; --i >= 0; point += bpl) + *point = color; + } else if (ydiff == 0) { + /* horizontal line */ + memset(point, color, xdiff); + } else if (ydiff < xdiff) { + /* mostly horizontal */ + for (i = xdiff, error = ydiff / 2; --i >= 0;) { + *point++ = color; + error += ydiff; + if (error > xdiff) { + error -= xdiff; + point += bpl; + } } - else if (ydiff == 0) - { - /* horizontal line */ - memset(point, color, xdiff); - } - else if (ydiff < xdiff) - { - /* mostly horizontal */ - for (i = xdiff, error = ydiff / 2; --i >= 0; ) - { - *point++ = color; - error += ydiff; - if (error > xdiff) - { - error -= xdiff; - point += bpl; - } - } - } - else - { - /* mostly vertical */ - for (i = ydiff, error = xdiff / 2; --i >= 0; ) - { - *point = color; - point += bpl; - error += xdiff; - if (error > ydiff) - { - error -= ydiff; - point++; - } - } + } else { + /* mostly vertical */ + for (i = ydiff, error = xdiff / 2; --i >= 0;) { + *point = color; + point += bpl; + error += xdiff; + if (error > ydiff) { + error -= ydiff; + point++; + } } + } } -#define addclipped(ptr, add) if (*(ptr) < 255 - (add)) \ - *(ptr) += (add); \ - else \ - *(ptr) = 255; - -static void fuzzydot(int x, int y, int add) -{ - int xx, yy; - int sum; - unsigned char *point; - - /* if too near the edge, then skip it */ - if (x < 5 || x >= img_width - 5 || y < 5 || y >= img_height - 5) - return; - - /* For each point in the dot... */ - for (yy = -4; yy <= 4; yy++) - { - for (xx = -4, point = &IMG_PIXEL(x + xx, y + yy); - xx <= 4; - xx++, point++) - { - sum = (xx * xx + yy * yy + 1) * 4; - if (sum <= add) - { - sum = add - sum; - addclipped(point, sum); - } - } +#define addclipped(ptr, add) \ + if (*(ptr) < 255 - (add)) \ + *(ptr) += (add); \ + else \ + *(ptr) = 255; + +static void fuzzydot(int x, int y, int add) { + int xx, yy; + int sum; + unsigned char *point; + + /* if too near the edge, then skip it */ + if (x < 5 || x >= img_width - 5 || y < 5 || y >= img_height - 5) + return; + + /* For each point in the dot... */ + for (yy = -4; yy <= 4; yy++) { + for (xx = -4, point = &IMG_PIXEL(x + xx, y + yy); xx <= 4; xx++, point++) { + sum = (xx * xx + yy * yy + 1) * 4; + if (sum <= add) { + sum = add - sum; + addclipped(point, sum); + } } + } } -static void plussign(int x, int y, int add) -{ - int extent, i; - unsigned char *point; - - /* Compute the extent of this plus sign. */ - extent = add / 4; - - /* if too close to edge, then skip it */ - if (x < extent || x >= img_width - extent || y < extent || y >= img_height - extent) - return; - extent -= 1; /* <-- for safety */ - - /* Plot the center of the + sign */ - point = &IMG_PIXEL(x, y); +static void plussign(int x, int y, int add) { + int extent, i; + unsigned char *point; + + /* Compute the extent of this plus sign. */ + extent = add / 4; + + /* if too close to edge, then skip it */ + if (x < extent || x >= img_width - extent || y < extent || + y >= img_height - extent) + return; + extent -= 1; /* <-- for safety */ + + /* Plot the center of the + sign */ + point = &IMG_PIXEL(x, y); + addclipped(point, add); + add -= 4; + + /* fill in the corners */ + addclipped(point - img_bpl - 1, add); + addclipped(point - img_bpl + 1, add); + addclipped(point + img_bpl - 1, add); + addclipped(point + img_bpl + 1, add); + + /* Plot the surrounding points */ + for (i = 1; i <= extent; i++, add -= 4) { + point = &IMG_PIXEL(x - i, y); addclipped(point, add); - add -= 4; - - /* fill in the corners */ - addclipped(point - img_bpl - 1, add); - addclipped(point - img_bpl + 1, add); - addclipped(point + img_bpl - 1, add); - addclipped(point + img_bpl + 1, add); - - /* Plot the surrounding points */ - for (i = 1; i <= extent; i++, add -= 4) - { - point = &IMG_PIXEL(x - i, y); - addclipped(point, add); - point = &IMG_PIXEL(x + i, y); - addclipped(point, add); - point = &IMG_PIXEL(x, y - i); - addclipped(point, add); - point = &IMG_PIXEL(x, y + i); - addclipped(point, add); - } + point = &IMG_PIXEL(x + i, y); + addclipped(point, add); + point = &IMG_PIXEL(x, y - i); + addclipped(point, add); + point = &IMG_PIXEL(x, y + i); + addclipped(point, add); + } } -void render_dot(int x, int y, unsigned char color) -{ - int x2, y2; - - /* convert (x,y) from center of dot to corner of dot */ - x -= 2; - y -= 2; - - /* ignore if outside the image */ - if (x < 0 || y < 0 || x + 5 >= img_width || y + 5 >= img_height) - return; - - /* draw the dot */ - for (x2 = 0; x2 <= 4; x2++) - { - if (x2 == 0 || x2 == 4) - { - for (y2 = 1; y2 <= 3; y2++) - IMG_PIXEL(x + x2, y + y2) = color; - } - else - { - for (y2 = 0; y2 <= 4; y2++) - IMG_PIXEL(x + x2, y + y2) = color; - } +void render_dot(int x, int y, unsigned char color) { + int x2, y2; + + /* convert (x,y) from center of dot to corner of dot */ + x -= 2; + y -= 2; + + /* ignore if outside the image */ + if (x < 0 || y < 0 || x + 5 >= img_width || y + 5 >= img_height) + return; + + /* draw the dot */ + for (x2 = 0; x2 <= 4; x2++) { + if (x2 == 0 || x2 == 4) { + for (y2 = 1; y2 <= 3; y2++) + IMG_PIXEL(x + x2, y + y2) = color; + } else { + for (y2 = 0; y2 <= 4; y2++) + IMG_PIXEL(x + x2, y + y2) = color; } + } } - -static void airbrush(int x, int y, unsigned char color) -{ - static unsigned char bits[] = {0x24,0x12,0x29,0x1a,0x54,0x02,0x10}; - int i, j, bit; - unsigned char *pixel; - - /* ignore if outside the image */ - if ((x -= 3) < 0 || (y -= 3) < 0 || x + 6 >= img_width || y + 6 >= img_height) - return; - - /* draw a whole collection of points */ - for (i = 0; i <= 6; i++) - { - pixel = &IMG_PIXEL(x, y + i); - for (j = 0, bit = 1; j <= 6; j++, bit += bit) - { - if (bits[i] & bit) - *pixel = color; - pixel++; - } +static void airbrush(int x, int y, unsigned char color) { + static unsigned char bits[] = {0x24, 0x12, 0x29, 0x1a, 0x54, 0x02, 0x10}; + int i, j, bit; + unsigned char *pixel; + + /* ignore if outside the image */ + if ((x -= 3) < 0 || (y -= 3) < 0 || x + 6 >= img_width || y + 6 >= img_height) + return; + + /* draw a whole collection of points */ + for (i = 0; i <= 6; i++) { + pixel = &IMG_PIXEL(x, y + i); + for (j = 0, bit = 1; j <= 6; j++, bit += bit) { + if (bits[i] & bit) + *pixel = color; + pixel++; } + } } -static void edges(int x, int y, int thick) -{ - double frac; /* X, scaled to be between 0.0 and 1.0 */ - int iw, ih; /* image width & height, minus 20 */ - int color; - - /* verify that the image size is big enough for us to work with */ - if (img_width < 30 || img_height < 30 - || x < 0 || x >= img_width - || y < 0 || y >= img_height) - return; - - /* x is scaled to width, and y is scaled to height. We want to derive - * a color from y, scaled from 0 - 255, and choose new x & y by scaling - * x to the length of the perimeter. - * - * We begin by computing a new color size - */ - iw = img_width - 20; - ih = img_height - 20; - - if (config.thick_on_beats) - color = (ih - y) * (1600 - 200 * thick) / ih; - else - color = (ih - y) * 1300 / ih; - if (color > 255) - color = 255; - else if (color < 0) - color = 0; - - /* Note: the following divides the perimeter into segments. The - * perimeter is assumed to have approximately a 4:3 aspect ratio, - * so the overall perimeter is scaled to 14 units. The first segment - * is the left half of the bottom, which is two units long. Then - * it progresses up the left edge, across the top, down the right, - * and back to the middle again, for a total of 5 segments. Within - * each segment, "frac" is first scaled to be between 0.0 and 1.0, - * and then x and y are computed from that. - */ - frac = (double)x / (double)img_width * 14.0; - if ((frac -= 2.0) < 0.0) - { - frac = frac / -4.0; - x = 10 + iw * frac; - y = 10; - } - else if ((frac -= 3.0) < 0.0) - { - frac = 1.0 - (frac / -3.0); - x = 10; - y = 10 + ih * frac; - } - else if ((frac -= 4.0) < 0) - { - frac = frac / -4.0; - x = 10 + iw - iw * frac; - y = 10 + ih; - } - else if ((frac -= 3.0) < 0) - { - frac = frac / -3.0; - x = 10 + iw; - y = 10 + ih * frac; - } - else - { - frac = 0.5 + (2.0 - frac) / 4.0; - x = 10 + iw * frac; - y = 10; - } - - /* Now we can plot! */ - render_dot(x, y, color); +static void edges(int x, int y, int thick) { + double frac; /* X, scaled to be between 0.0 and 1.0 */ + int iw, ih; /* image width & height, minus 20 */ + int color; + + /* verify that the image size is big enough for us to work with */ + if (img_width < 30 || img_height < 30 || x < 0 || x >= img_width || y < 0 || + y >= img_height) + return; + + /* x is scaled to width, and y is scaled to height. We want to derive + * a color from y, scaled from 0 - 255, and choose new x & y by scaling + * x to the length of the perimeter. + * + * We begin by computing a new color size + */ + iw = img_width - 20; + ih = img_height - 20; + + if (config.thick_on_beats) + color = (ih - y) * (1600 - 200 * thick) / ih; + else + color = (ih - y) * 1300 / ih; + if (color > 255) + color = 255; + else if (color < 0) + color = 0; + + /* Note: the following divides the perimeter into segments. The + * perimeter is assumed to have approximately a 4:3 aspect ratio, + * so the overall perimeter is scaled to 14 units. The first segment + * is the left half of the bottom, which is two units long. Then + * it progresses up the left edge, across the top, down the right, + * and back to the middle again, for a total of 5 segments. Within + * each segment, "frac" is first scaled to be between 0.0 and 1.0, + * and then x and y are computed from that. + */ + frac = (double)x / (double)img_width * 14.0; + if ((frac -= 2.0) < 0.0) { + frac = frac / -4.0; + x = 10 + iw * frac; + y = 10; + } else if ((frac -= 3.0) < 0.0) { + frac = 1.0 - (frac / -3.0); + x = 10; + y = 10 + ih * frac; + } else if ((frac -= 4.0) < 0) { + frac = frac / -4.0; + x = 10 + iw - iw * frac; + y = 10 + ih; + } else if ((frac -= 3.0) < 0) { + frac = frac / -3.0; + x = 10 + iw; + y = 10 + ih * frac; + } else { + frac = 0.5 + (2.0 - frac) / 4.0; + x = 10 + iw * frac; + y = 10; + } + + /* Now we can plot! */ + render_dot(x, y, color); } - static int plotfirst; static int plotthick; static unsigned char plotcolor; @@ -361,428 +317,386 @@ static int plotx[512], ploty[512]; static int plotprevmax; static int plotprevx[512], plotprevy[512]; -static void plotbefore(int thick, int max) -{ - plotthick = thick; - plotfirst = TRUE; - plotcount = 0; - plotmax = max; - if (*config.signal_color != 'C') - plotcolor = 255; - else if (plotcolor == 255) - plotcolor = 76; - else - plotcolor++; +static void plotbefore(int thick, int max) { + plotthick = thick; + plotfirst = TRUE; + plotcount = 0; + plotmax = max; + if (*config.signal_color != 'C') + plotcolor = 255; + else if (plotcolor == 255) + plotcolor = 76; + else + plotcolor++; } -static void plot(int x, int y) -{ - static int fromx, fromy; - int i; - - switch (*config.plot_style) - { - case 'D': /* Dots */ - render_dot(x, y, plotcolor); - break; - - case 'F': /* Fuzzy dots */ - fuzzydot(x, y, plotthick * 5 + 50); - break; - - case 'P': /* Plus signs */ - plussign(x, y, (plotthick + 4) * 6); - break; - - case 'A': /* Airbrush */ - airbrush(x, y, plotcolor); - break; - - case 'E': /* Edges */ - edges(x, y, plotthick); - break; - - case 'M': /* Mirrored */ - if (!plotfirst) - { - line(img_width - 1 - fromx, img_height - 1 - fromy, img_width - 1 - x, img_height - 1 - y, plotcolor); - if (plotthick >= 2) - line(img_width - 1 - fromx, img_height - fromy, img_width - 1 - x, img_height - y, plotcolor); - if (plotthick >= 3) - line(img_width - fromx, img_height - 1 - fromy, img_width - x, img_height - 1 - y, plotcolor); - } - /* fall through... */ - - case 'L': /* Line */ - if (plotfirst) - plotfirst = FALSE; - else - { - line(fromx, fromy, x, y, plotcolor); - if (plotthick >= 2) - line(fromx, fromy - 1, x, y - 1, plotcolor); - if (plotthick >= 3) - line(fromx - 1, fromy, x - 1, y, plotcolor); - } - fromx = x; - fromy = y; - break; - - case 'S': /* Starburst */ - line(img_width / 2, img_height / 2, x, y, plotcolor); - break; - - case 'R': /* Radar */ - x = img_width + 10 - x; - y = (img_height - 10 - y) * 450 / img_height; - if (y > 255) - y = 255; - else if (y < 0) - y = 0; - line((int)(x * plotcos) + img_width/2, - (int)(x * plotsin) + img_height/2, - (int)(x * plotprevcos) + img_width/2, - (int)(x * plotprevsin) + img_height/2, - y); - break; - - case 'I': /* Inertia */ - plotx[plotcount] = x; - ploty[plotcount] = y; - i = (plotcount * plotprevmax) / plotmax; - plotcount++; - line(plotprevx[i], plotprevy[i], x, y, plotcolor); - if (plotthick >= 2) - line(plotprevx[i], plotprevy[i]-1, x, y-1, plotcolor); - if (plotthick >= 3) - line(plotprevx[i]-1, plotprevy[i], x-1, y, plotcolor); - break; +static void plot(int x, int y) { + static int fromx, fromy; + int i; + + switch (*config.plot_style) { + case 'D': /* Dots */ + render_dot(x, y, plotcolor); + break; + + case 'F': /* Fuzzy dots */ + fuzzydot(x, y, plotthick * 5 + 50); + break; + + case 'P': /* Plus signs */ + plussign(x, y, (plotthick + 4) * 6); + break; + + case 'A': /* Airbrush */ + airbrush(x, y, plotcolor); + break; + + case 'E': /* Edges */ + edges(x, y, plotthick); + break; + + case 'M': /* Mirrored */ + if (!plotfirst) { + line(img_width - 1 - fromx, img_height - 1 - fromy, img_width - 1 - x, + img_height - 1 - y, plotcolor); + if (plotthick >= 2) + line(img_width - 1 - fromx, img_height - fromy, img_width - 1 - x, + img_height - y, plotcolor); + if (plotthick >= 3) + line(img_width - fromx, img_height - 1 - fromy, img_width - x, + img_height - 1 - y, plotcolor); } -} - -static void plotafter(void) -{ - int i, j; - int x, y; - - /* For "Radar", compute the plotsin & plotcos for the next wedge. */ - if (*config.plot_style == 'R') - { - plotprevsin = plotsin; - plotprevcos = plotcos; - plottheta = plottheta + 0.1; - if (plottheta > 2 * VISUAL_MATH_PI) - plottheta -= 2 * VISUAL_MATH_PI; - plotsin = (sin(plottheta) * (double)img_height) / (2.1 * (double)img_width); - plotcos = cos(plottheta) / 2.1; + /* fall through... */ + + case 'L': /* Line */ + if (plotfirst) + plotfirst = FALSE; + else { + line(fromx, fromy, x, y, plotcolor); + if (plotthick >= 2) + line(fromx, fromy - 1, x, y - 1, plotcolor); + if (plotthick >= 3) + line(fromx - 1, fromy, x - 1, y, plotcolor); } + fromx = x; + fromy = y; + break; + + case 'S': /* Starburst */ + line(img_width / 2, img_height / 2, x, y, plotcolor); + break; + + case 'R': /* Radar */ + x = img_width + 10 - x; + y = (img_height - 10 - y) * 450 / img_height; + if (y > 255) + y = 255; + else if (y < 0) + y = 0; + line((int)(x * plotcos) + img_width / 2, + (int)(x * plotsin) + img_height / 2, + (int)(x * plotprevcos) + img_width / 2, + (int)(x * plotprevsin) + img_height / 2, y); + break; + + case 'I': /* Inertia */ + plotx[plotcount] = x; + ploty[plotcount] = y; + i = (plotcount * plotprevmax) / plotmax; + plotcount++; + line(plotprevx[i], plotprevy[i], x, y, plotcolor); + if (plotthick >= 2) + line(plotprevx[i], plotprevy[i] - 1, x, y - 1, plotcolor); + if (plotthick >= 3) + line(plotprevx[i] - 1, plotprevy[i], x - 1, y, plotcolor); + break; + } +} - /* For "Inertia", compute new plotprevx & plotprevy values */ - if (*config.plot_style == 'I') - { - for (i = 0; i < plotmax; i++) - { - j = (i * plotprevmax) / plotmax; - x = (plotx[i] + 7 * plotprevx[j] + 4) >> 3; - y = (ploty[i] + 7 * plotprevy[j] + 4) >> 3; - if (abs(x - plotx[i]) > 4 || abs(y - ploty[i]) > 4) - { - plotx[i] = x; - ploty[i] = y; - } - } - memcpy(plotprevx, plotx, plotmax * sizeof *plotprevx); - memcpy(plotprevy, ploty, plotmax * sizeof *plotprevy); - plotprevmax = plotmax; - +static void plotafter(void) { + int i, j; + int x, y; + + /* For "Radar", compute the plotsin & plotcos for the next wedge. */ + if (*config.plot_style == 'R') { + plotprevsin = plotsin; + plotprevcos = plotcos; + plottheta = plottheta + 0.1; + if (plottheta > 2 * VISUAL_MATH_PI) + plottheta -= 2 * VISUAL_MATH_PI; + plotsin = (sin(plottheta) * (double)img_height) / (2.1 * (double)img_width); + plotcos = cos(plottheta) / 2.1; + } + + /* For "Inertia", compute new plotprevx & plotprevy values */ + if (*config.plot_style == 'I') { + for (i = 0; i < plotmax; i++) { + j = (i * plotprevmax) / plotmax; + x = (plotx[i] + 7 * plotprevx[j] + 4) >> 3; + y = (ploty[i] + 7 * plotprevy[j] + 4) >> 3; + if (abs(x - plotx[i]) > 4 || abs(y - ploty[i]) > 4) { + plotx[i] = x; + ploty[i] = y; + } } + memcpy(plotprevx, plotx, plotmax * sizeof *plotprevx); + memcpy(plotprevy, ploty, plotmax * sizeof *plotprevy); + plotprevmax = plotmax; + } } - - /* Adjust the number of data points to be between max/2 and max. Upon return, * the points are copied into renderdata[]. The return value indicates the * final number of data points. */ -static int condition_data(int max, int ndata, int16_t **dataref) -{ - int i, j, step; - - /* if number of data points is already good, just copy it */ - if (ndata > max/2 && ndata <= max) - { - return ndata; - } +static int condition_data(int max, int ndata, int16_t **dataref) { + int i, j, step; - /* if too many data points, then reduce */ - if (ndata > max) - { - for (step = (ndata + max - 1) / max, i = 0, j = step/2; - j < ndata; - j += step, i++) - { - renderdata[i] = (*dataref)[j]; - } - *dataref = renderdata; - return i; - } + /* if number of data points is already good, just copy it */ + if (ndata > max / 2 && ndata <= max) { + return ndata; + } - /* else it must be too small. Expand it, interpolating values and - * smoothing on each iteration, until it is large enough. - */ - while (ndata < max/2) - { - /* interpolate */ - for (j = ndata - 1, i = ndata * 2 - 2; - j >= 0; - j--, i -= 2) - { - renderdata[i] = (*dataref)[j]; - renderdata[i + 1] = (renderdata[i] + renderdata[i + 2]) / 2; - } - ndata = ndata * 2 - 1; - *dataref = renderdata; - - /* smooth */ - for (i = 1; i < ndata - 2; i++) - renderdata[i] = (int16_t)((renderdata[i - 1] + renderdata[i + 1]) * 3 + renderdata[i] * 10) >> 4; + /* if too many data points, then reduce */ + if (ndata > max) { + for (step = (ndata + max - 1) / max, i = 0, j = step / 2; j < ndata; + j += step, i++) { + renderdata[i] = (*dataref)[j]; } - return ndata; + *dataref = renderdata; + return i; + } + + /* else it must be too small. Expand it, interpolating values and + * smoothing on each iteration, until it is large enough. + */ + while (ndata < max / 2) { + /* interpolate */ + for (j = ndata - 1, i = ndata * 2 - 2; j >= 0; j--, i -= 2) { + renderdata[i] = (*dataref)[j]; + renderdata[i + 1] = (renderdata[i] + renderdata[i + 2]) / 2; + } + ndata = ndata * 2 - 1; + *dataref = renderdata; + + /* smooth */ + for (i = 1; i < ndata - 2; i++) + renderdata[i] = (int16_t)((renderdata[i - 1] + renderdata[i + 1]) * 3 + + renderdata[i] * 10) >> + 4; + } + return ndata; } /* Plot a radial spectrum. */ -static void render_radial(int thick, int center, int ndata, int16_t *data) -{ - double theta, step, sig; - int i; - int x, y, xscale, xcenter, yscale; - static int16_t prev[MAXPOINTS]; - static int nprev; - int32_t trigger; - - /* We'd like to have between 127 and 256 data samples */ - ndata = condition_data(256, ndata, &data); +static void render_radial(int thick, int center, int ndata, int16_t *data) { + double theta, step, sig; + int i; + int x, y, xscale, xcenter, yscale; + static int16_t prev[MAXPOINTS]; + static int nprev; + int32_t trigger; + + /* We'd like to have between 127 and 256 data samples */ + ndata = condition_data(256, ndata, &data); #if 1 - /* If same number of points as last time (which should normally be the - * case) then merge previous data with current data. - */ - if (ndata == nprev) - { - for (i = 0; i < ndata; i++) - prev[i] = ((int32_t)prev[i] + (int32_t)data[i]) >> 1; - data = prev; - } - else - { - nprev = ndata; - memcpy(prev, data, ndata * sizeof(int16_t)); - } + /* If same number of points as last time (which should normally be the + * case) then merge previous data with current data. + */ + if (ndata == nprev) { + for (i = 0; i < ndata; i++) + prev[i] = ((int32_t)prev[i] + (int32_t)data[i]) >> 1; + data = prev; + } else { + nprev = ndata; + memcpy(prev, data, ndata * sizeof(int16_t)); + } #endif - /* Some image geometry constants */ - xscale = xcenter = img_width / 2; - yscale = img_height / 2; - - /* Take samples starting from the center out */ - plotbefore(thick, ndata); - trigger = BEAD_THRESHOLD * 5; - for (theta = 0.0, step = 2.0 * VISUAL_MATH_PI / ndata, i = 0; - i < ndata; - theta += step, i++) - { - trigger -= (50000 - data[i]); - if (trigger < 0) - { - trigger += BEAD_THRESHOLD * 10; - if (*config.signal_style == 'F') - sig = (double)(14000 - data[i]) / 30000.0; - else - sig = (double)(20000 - data[i]) / 20000.0; - x = xcenter - xscale * sig * sin(theta); - y = center - yscale * sig * cos(theta); - plot(x, y); - } + /* Some image geometry constants */ + xscale = xcenter = img_width / 2; + yscale = img_height / 2; + + /* Take samples starting from the center out */ + plotbefore(thick, ndata); + trigger = BEAD_THRESHOLD * 5; + for (theta = 0.0, step = 2.0 * VISUAL_MATH_PI / ndata, i = 0; i < ndata; + theta += step, i++) { + trigger -= (50000 - data[i]); + if (trigger < 0) { + trigger += BEAD_THRESHOLD * 10; + if (*config.signal_style == 'F') + sig = (double)(14000 - data[i]) / 30000.0; + else + sig = (double)(20000 - data[i]) / 20000.0; + x = xcenter - xscale * sig * sin(theta); + y = center - yscale * sig * cos(theta); + plot(x, y); } - plotafter(); + } + plotafter(); } /* Draw some dots, based on phase-shifted sample points */ -static void render_phase(int thick, int center, int ndata, int16_t *data) -{ - int npoints, i, sample, x, y; - - /* We'd like to have between 256 and 512 data samples */ - ndata = condition_data(512, ndata, &data); - - /* Choose a number of points to draw, based on thick */ - npoints = 12 + 8 * thick; - - /* For each point... */ - plotbefore(thick, ndata); - for (i = 0; i < npoints; i++) - { - /* Derive x & y from uniformly-separated samples */ - sample = i * 3 * ndata / (8 * npoints); - x = ((int16_t)data[sample] >> 8) + img_width/2; - y = ((int16_t)data[sample + ndata/8 - 1] >> 9) + center; - - /* Plot the point */ - plot(x, y); - } - plotafter(); +static void render_phase(int thick, int center, int ndata, int16_t *data) { + int npoints, i, sample, x, y; + + /* We'd like to have between 256 and 512 data samples */ + ndata = condition_data(512, ndata, &data); + + /* Choose a number of points to draw, based on thick */ + npoints = 12 + 8 * thick; + + /* For each point... */ + plotbefore(thick, ndata); + for (i = 0; i < npoints; i++) { + /* Derive x & y from uniformly-separated samples */ + sample = i * 3 * ndata / (8 * npoints); + x = ((int16_t)data[sample] >> 8) + img_width / 2; + y = ((int16_t)data[sample + ndata / 8 - 1] >> 9) + center; + + /* Plot the point */ + plot(x, y); + } + plotafter(); } /* Draw some dots, based on the sample values. */ -static void render_highlow(int thick, int center, int ndata, int16_t *data) -{ - int16_t *d1, *d2; - int32_t trigger; - int i, x, y; - - /* We take values from the first half of the sample data and the - * second half of the sample data, and use those as X & Y values. - */ - ndata >>= 1; - d1 = data; - d2 = data + ndata; - - /* We don't plot every possible bead. We accumulate d1 & d2 until - * their sum exceeds a threshold, and then we plot one bead and reduce - * the accumulated value. - * - * We want to plot perhaps 10 beads per frame. Assuming they average - * about 2500 in each sample, and we have 64 sample pairs, we'll want - * to draw a bead when the trigger hits about 15000. We'd like to - * initialize the trigger to about half of that for a medium-thickness - * sound, so... - */ - trigger = BEAD_THRESHOLD / 2; - - /* We'll use "thick" to widen the image when loud. Tweak it. */ - thick++; - - /* Okay, now let's check each pair */ - plotbefore(thick, ndata); - for (i = 0; i < ndata; i++) - { - /* Accumulate the amounts that these differ from 20000 */ - trigger += abs(40000 - d1[i] - d2[i]); - - /* Have we hit the threshold? */ - if (trigger >= BEAD_THRESHOLD) - { - trigger -= BEAD_THRESHOLD; - - /* Okay, we need to plot a point derived from the X - * and Y values in the graph. We'd like for the graph - * to be centered horizontally, so we compute X from - * the current index value, since we know its range. - * The Y value is computed from the difference between - * the samples. - */ - x = img_width / 2 + (((i - ndata/2) * (int32_t)img_width * thick) >> 7); - y = center + (((int32_t)d1[i] - (int32_t)d2[i]) >> 8); - plot(x, y); - } +static void render_highlow(int thick, int center, int ndata, int16_t *data) { + int16_t *d1, *d2; + int32_t trigger; + int i, x, y; + + /* We take values from the first half of the sample data and the + * second half of the sample data, and use those as X & Y values. + */ + ndata >>= 1; + d1 = data; + d2 = data + ndata; + + /* We don't plot every possible bead. We accumulate d1 & d2 until + * their sum exceeds a threshold, and then we plot one bead and reduce + * the accumulated value. + * + * We want to plot perhaps 10 beads per frame. Assuming they average + * about 2500 in each sample, and we have 64 sample pairs, we'll want + * to draw a bead when the trigger hits about 15000. We'd like to + * initialize the trigger to about half of that for a medium-thickness + * sound, so... + */ + trigger = BEAD_THRESHOLD / 2; + + /* We'll use "thick" to widen the image when loud. Tweak it. */ + thick++; + + /* Okay, now let's check each pair */ + plotbefore(thick, ndata); + for (i = 0; i < ndata; i++) { + /* Accumulate the amounts that these differ from 20000 */ + trigger += abs(40000 - d1[i] - d2[i]); + + /* Have we hit the threshold? */ + if (trigger >= BEAD_THRESHOLD) { + trigger -= BEAD_THRESHOLD; + + /* Okay, we need to plot a point derived from the X + * and Y values in the graph. We'd like for the graph + * to be centered horizontally, so we compute X from + * the current index value, since we know its range. + * The Y value is computed from the difference between + * the samples. + */ + x = img_width / 2 + (((i - ndata / 2) * (int32_t)img_width * thick) >> 7); + y = center + (((int32_t)d1[i] - (int32_t)d2[i]) >> 8); + plot(x, y); } - plotafter(); + } + plotafter(); } /* Draw a line graph for the next image. The input data consists of img_width/2 * samples, which may be either PCM data, or spectrum data which has been * tweaked to resemble PCM data. */ -static void render_curve(int thick, int center, int ndata, int16_t *data) -{ - int i, x, y; - int32_t scale; - - /* We'd like to have about 256 sample points. */ - ndata = condition_data(256, ndata, &data); - - scale = img_height / 4; - plotbefore(thick, ndata); - for(i = 0; i < ndata; i++) - { - x = i * (img_width - 1) / (ndata - 1); - y = center + (((int32_t)data[i] * scale) >> 14); - if(y < 0) - y = 0; - if(y >= img_height - 1) - y = img_height - 2; - plot(x, y); - } - plotafter(); +static void render_curve(int thick, int center, int ndata, int16_t *data) { + int i, x, y; + int32_t scale; + + /* We'd like to have about 256 sample points. */ + ndata = condition_data(256, ndata, &data); + + scale = img_height / 4; + plotbefore(thick, ndata); + for (i = 0; i < ndata; i++) { + x = i * (img_width - 1) / (ndata - 1); + y = center + (((int32_t)data[i] * scale) >> 14); + if (y < 0) + y = 0; + if (y >= img_height - 1) + y = img_height - 2; + plot(x, y); + } + plotafter(); } /* Generic data rendering function */ -void render(int thick, int center, int ndata, int16_t *data) -{ - /* if thick=0, then most plot styles do nothing, but the Radar plot - * style treats that as though thick=1. - */ - if (thick == 0) - { - if (*config.plot_style == 'R') - thick = 1; - else - return; - } - - /* Plot the signal */ - switch (*config.signal_style) - { - case 'R': /* Radial spectrum */ - case 'F': /* Flower */ - render_radial(thick, center, ndata, data); - break; - - case 'O': /* Oscilloscope */ - case 'M': /* Mono spectrum */ - case 'S': /* Stereo spectrum */ - render_curve(thick, center, ndata, data); - break; - - case 'P': /* Phase shift */ - render_phase(thick, center, ndata, data); - break; - - case 'H': /* High/Low spectrum */ - render_highlow(thick, center, ndata, data); - break; - - case 'N': /* None */ - break; - } - +void render(int thick, int center, int ndata, int16_t *data) { + /* if thick=0, then most plot styles do nothing, but the Radar plot + * style treats that as though thick=1. + */ + if (thick == 0) { + if (*config.plot_style == 'R') + thick = 1; + else + return; + } + + /* Plot the signal */ + switch (*config.signal_style) { + case 'R': /* Radial spectrum */ + case 'F': /* Flower */ + render_radial(thick, center, ndata, data); + break; + + case 'O': /* Oscilloscope */ + case 'M': /* Mono spectrum */ + case 'S': /* Stereo spectrum */ + render_curve(thick, center, ndata, data); + break; + + case 'P': /* Phase shift */ + render_phase(thick, center, ndata, data); + break; + + case 'H': /* High/Low spectrum */ + render_highlow(thick, center, ndata, data); + break; + + case 'N': /* None */ + break; + } } /** * Returns the i'th plot-style */ -char *render_plotname(int i) -{ - static char *name[] = { - "Line", "Mirrored", "Dots", "Fuzzy dots", "Plus signs", - "Airbrush", "Starburst", "Inertia", "Radar", "Edges", "None" - }; - - if (i >= QTY(name)) - return NULL; - else - return name[i]; +char *render_plotname(int i) { + static char *name[] = {"Line", "Mirrored", "Dots", "Fuzzy dots", + "Plus signs", "Airbrush", "Starburst", "Inertia", + "Radar", "Edges", "None"}; + + if (i >= QTY(name)) + return NULL; + else + return name[i]; } /** * Returns the i'th signal-style */ -char *signal_style_name(int i) -{ - static char *names[] = - { - "Oscilloscope", "Phase shift", "Flower", "Radial spectrum", - "High/Low plot", "Stereo spectrum", "Mono spectrum", - NULL - }; - return names[i]; +char *signal_style_name(int i) { + static char *names[] = { + "Oscilloscope", "Phase shift", "Flower", "Radial spectrum", + "High/Low plot", "Stereo spectrum", "Mono spectrum", NULL}; + return names[i]; } diff --git a/libvisual-plugins/plugins/actor/blursk/text.c b/libvisual-plugins/plugins/actor/blursk/text.c index 9543f171e..ce5c1622f 100644 --- a/libvisual-plugins/plugins/actor/blursk/text.c +++ b/libvisual-plugins/plugins/actor/blursk/text.c @@ -26,9 +26,9 @@ #include #include -static int textheight; /* height of the tallest character, plus 1 */ -static int frame; /* frame counter, used for color-cycling */ -static int textbg; /* background color for text */ +static int textheight; /* height of the tallest character, plus 1 */ +static int frame; /* frame counter, used for color-cycling */ +static int textbg; /* background color for text */ /* this is a map of the shapes for 0-9, A-Z, and a few punctuation characters. * A space char indicates that the pixel should be unchanged, a period that it @@ -38,888 +38,858 @@ static int textbg; /* background color for text */ * and NULL marks the end of the list. After run-time initialization, the * single-character strings are converted to NULLs. */ -static char *shapes[] = { - "_", - " ", - - " ", - " ", - - "0", - " ..... ", - " .xxxxx. ", - ".xx...xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx...xx.", - " .xxxxx. ", - " ..... ", - - "1", - " ... ", - " .xxx. ", - " .xxxx. ", - " ..xx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " ...xx.. ", - ".xxxxxxx.", - " ....... ", - - "2", - " ..... ", - " .xxxxx. ", - ".xx...xx.", - " .. .xx.", - " ...xx. ", - " .xxxx. ", - ".xx... ", - ".xx..... ", - ".xxxxxxx.", - " ....... ", - - "3", - " ..... ", - " .xxxxx. ", - ".xx...xx.", - " .. ..xx.", - " .xxx. ", - " ..xx.", - " .. .xx.", - ".xx...xx.", - " .xxxxx. ", - " ..... ", - - "4", - " ... ", - " .xxx. ", - " .xxxx. ", - " .xx.xx. ", - ".xx..xx. ", - ".xx..xx. ", - ".xxxxxxx.", - " ....xx. ", - " .xx. ", - " .. ", - - "5", - " ....... ", - ".xxxxxxx.", - ".xx..... ", - ".xx.... ", - ".xxxxxx. ", - "......xx.", - " .. .xx.", - ".xx...xx.", - " .xxxxx. ", - " ..... ", - - "6", - " .. ", - " .xx. ", - " .xx. ", - " .xx. ", - ".xx.... ", - ".xxxxxx. ", - ".xx...xx.", - ".xx...xx.", - " .xxxxx. ", - " ..... ", - - "7", - " ....... ", - ".xxxxxxx.", - ".x....xx.", - " . .xx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " .. ", - - "8", - " ..... ", - " .xxxxx. ", - ".xx...xx.", - ".xx...xx.", - " .xxxxx. ", - ".xx...xx.", - ".xx. .xx.", - ".xx...xx.", - " .xxxxx. ", - " ..... ", - - "9", - " ..... ", - " .xxxxx. ", - ".xx...xx.", - ".xx...xx.", - " .xxxxxx.", - " ....xx.", - " .xx. ", - " .xx. ", - " .xx. ", - " .. ", - - "a", - " ", - " ", - " ..... ", - " .xxxxx. ", - " ....xx.", - " .xxxxxx.", - ".xx. .xx.", - ".xx. .xx.", - " .xxxxxx.", - " ...... ", - - "b", - " .. ", - ".xx. ", - ".xx..... ", - ".xx.xxxx. ", - ".xxx...xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xxx...xx.", - ".xx.xxxx. ", - " .. .... ", - - "c", - " ", - " ", - " ..... ", - " .xxxxx. ", - ".xx...xx.", - ".xx. .. ", - ".xx. ", - ".xx..... ", - " .xxxxxx.", - " ..... ", - - "d", - " .. ", - " .xx.", - " .....xx.", - " .xxxx.xx.", - ".xx...xxx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx...xxx.", - " .xxxx.xx.", - " .... .. ", - - "e", - " ", - " ", - " ..... ", - " .xxxxx. ", - ".xx. .xx.", - ".xx. .xx.", - ".xxxxxx. ", - ".xx.... ", - " .xxxxx. ", - " ..... ", - - "f", - " .... ", - " .xxxx. ", - " .xx..xx.", - " .xx. .. ", - " .xx. ", - ".xxxx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " .. ", - - "g", - " ", - " ", - " .. .... ", - " .xxx.xx.", - ".xx..xxx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx..xxx.", - " .xxx.xx.", - " ....xx.", - " .xxxxx. ", - " ..... ", - - "h", - " .. ", - ".xx. ", - ".xx.... ", - ".xx.xxx. ", - ".xxx..xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - " .. .. ", - - "i", - " .. ", - ".xx.", - " .. ", - ".xx.", - ".xx.", - ".xx.", - ".xx.", - ".xx.", - ".xx.", - " .. ", - - "j", - " .. ", - " .xx.", - " .. ", - " .xx.", - " .xx.", - " .xx.", - " .xx.", - " .xx.", - " ..xx.", - ".xxx. ", - " ... ", - - "k", - " .. ", - ".xx. ", - ".xx. .. ", - ".xx. .xx.", - ".xx..xx. ", - ".xxxxx. ", - ".xx..xx. ", - ".xx. .xx.", - ".xx. .xx.", - " .. .. ", - - "l", - " ... ", - ".xxx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " .xx. ", - ".xxxx.", - " .... ", - - "m", - " ", - " ", - " .. ... .... ", - ".xx.xxx.xxxx. ", - ".xxx..xxx..xx.", - ".xx. .xx. .xx.", - ".xx. .xx. .xx.", - ".xx. .xx. .xx.", - ".xx. .xx. .xx.", - " .. .. .. ", - - "n", - " ", - " ", - " .. .... ", - ".xx.xxxx. ", - ".xxx...xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - " .. .. ", - - "o", - " ", - " ", - " ..... ", - " .xxxxx. ", - ".xx...xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx...xx.", - " .xxxxx. ", - " ..... ", - - "p", - " ", - " ", - " .. .... ", - ".xx.xxxx. ", - ".xxx...xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xxx...xx.", - ".xx.xxxx. ", - ".xx..... ", - ".xx. ", - " .. ", - - "q", - " ", - " ", - " .... .. ", - " .xxxx.xx.", - ".xx...xxx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx...xxx.", - " .xxxx.xx.", - " .....xx.", - " .xx.", - " .. ", - - "r", - " ", - " ", - " .. ... ", - ".xx.xxx.", - ".xxxx.. ", - ".xxx. ", - ".xx. ", - ".xx. ", - ".xx. ", - " .. ", - - "s", - " ", - " ", - " ..... ", - " .xxxxx. ", - ".xx...xx.", - " .xxx.. ", - " ..xxx. ", - ".xx...xx.", - " .xxxxx. ", - " ..... ", - - "t", - " .. ", - " .xx. ", - " ..xx... ", - ".xxxxxxx.", - " ..xx... ", - " .xx. ", - " .xx. ", - " .xx. ", - " .xx. ", - " .. ", - - "u", - " ", - " ", - " .. .. ", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx....xx.", - " .xxxxxx. ", - " ...... ", - - "v", - " ", - " ", - " .. .. ", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - " .xx.xx. ", - " .xx.xx. ", - " .xxx. ", - " ... ", - - "w", - " ", - " ", - " .. .. ", - ".xx. .xx.", - ".xx. . .xx.", - ".xx. .x. .xx.", - " .xx.xxx.xx. ", - " .xx.xxx.xx. ", - " .xxx.xxx. ", - " ... ... ", - - "x", - " ", - " ", - " .. .. ", - ".xx. .xx.", - " .xx.xx. ", - " .xxx. ", - " .xxx. ", - " .xx.xx. ", - ".xx. .xx.", - " .. .. ", - - "y", - " ", - " ", - " .. .. ", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx. .xx.", - ".xx..xxx.", - " .xxx.xx.", - " ....xx.", - " .xxxxx. ", - " ..... ", - - "z", - " ", - " ", - " ....... ", - ".xxxxxxx.", - " ....xx. ", - " .xx. ", - " .xx. ", - " .xx.... ", - ".xxxxxxx.", - " ....... ", - - "-", - " ", - " ", - " ", - " ...... ", - ".xxxxxx.", - " ...... ", - - "~", - " ", - " ", - " ", - " .... ", - " .xx.x.", - ".x.xx. ", - " .... ", - - - ".", - " ", - " ", - " ", - " ", - " ", - " ", - " .. ", - ".xx.", - ".xx.", - " .. ", - - "!", - " .. ", - ".xx.", - ".xx.", - ".xx.", - ".xx.", - ".xx.", - " .. ", - " .. ", - ".xx.", - ".xx.", - " .. ", - - ":", - " ", - " .. ", - ".xx.", - ".xx.", - " .. ", - " ", - " .. ", - ".xx.", - ".xx.", - " .. ", - - "#", - " . . ", - " .x..x. ", - " ..x..x. ", - " .xxxxxxx.", - " .x..x.. ", - " ..x..x. ", - ".xxxxxxx. ", - " .x..x.. ", - " .x..x. ", - " . . ", - - "[", - " .... ", - ".xxxx.", - ".xx. ", - ".xx. ", - ".xx. ", - ".xx. ", - ".xx. ", - ".xx. ", - ".xxxx.", - " .... ", - - "]", - " .... ", - ".xxxx.", - " .xx.", - " .xx.", - " .xx.", - " .xx.", - " .xx.", - " .xx.", - ".xxxx.", - " .... ", - - "(", - " .. ", - " .xx.", - " .xx. ", - ".xx. ", - ".xx. ", - ".xx. ", - ".xx. ", - " .xx. ", - " .xx.", - " .. ", - - ")", - " .. ", - ".xx. ", - " .xx. ", - " .xx.", - " .xx.", - " .xx.", - " .xx.", - " .xx. ", - ".xx. ", - " .. ", - - "'", - " .. ", - " .xx.", - " .xx.", - ".xx. ", - " .. ", - - ",", - " ", - " ", - " ", - " ", - " .. ", - " .xx. ", - ".xxxx.", - " .xx. ", - ".xx. ", - " .. ", - - "%", - " ", - " .. ", - ".xx. .. ", - " .. .xx.", - " .xx. ", - " .xx. ", - " .xx. ", - ".xx. .. ", - " .. .xx.", - " .. ", - - "/", - " ", - " ", - " .. ", - " .xx.", - " .xx. ", - " .xx. ", - " .xx. ", - ".xx. ", - " .. ", - - ">", - " ", - " ... ", - ".xxx.. ", - " ..xxx. ", - " ..xx.", - " ..xxx. ", - ".xxx.. ", - " ... ", - - "<", - " ", - " ... ", - " ..xxx.", - " .xxx.. ", - ".xx.. ", - " .xxx.. ", - " ..xxx.", - " ... ", - - NULL -}; - +static char *shapes[] = {"_", + " ", + + " ", + " ", + + "0", + " ..... ", + " .xxxxx. ", + ".xx...xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx...xx.", + " .xxxxx. ", + " ..... ", + + "1", + " ... ", + " .xxx. ", + " .xxxx. ", + " ..xx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " ...xx.. ", + ".xxxxxxx.", + " ....... ", + + "2", + " ..... ", + " .xxxxx. ", + ".xx...xx.", + " .. .xx.", + " ...xx. ", + " .xxxx. ", + ".xx... ", + ".xx..... ", + ".xxxxxxx.", + " ....... ", + + "3", + " ..... ", + " .xxxxx. ", + ".xx...xx.", + " .. ..xx.", + " .xxx. ", + " ..xx.", + " .. .xx.", + ".xx...xx.", + " .xxxxx. ", + " ..... ", + + "4", + " ... ", + " .xxx. ", + " .xxxx. ", + " .xx.xx. ", + ".xx..xx. ", + ".xx..xx. ", + ".xxxxxxx.", + " ....xx. ", + " .xx. ", + " .. ", + + "5", + " ....... ", + ".xxxxxxx.", + ".xx..... ", + ".xx.... ", + ".xxxxxx. ", + "......xx.", + " .. .xx.", + ".xx...xx.", + " .xxxxx. ", + " ..... ", + + "6", + " .. ", + " .xx. ", + " .xx. ", + " .xx. ", + ".xx.... ", + ".xxxxxx. ", + ".xx...xx.", + ".xx...xx.", + " .xxxxx. ", + " ..... ", + + "7", + " ....... ", + ".xxxxxxx.", + ".x....xx.", + " . .xx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " .. ", + + "8", + " ..... ", + " .xxxxx. ", + ".xx...xx.", + ".xx...xx.", + " .xxxxx. ", + ".xx...xx.", + ".xx. .xx.", + ".xx...xx.", + " .xxxxx. ", + " ..... ", + + "9", + " ..... ", + " .xxxxx. ", + ".xx...xx.", + ".xx...xx.", + " .xxxxxx.", + " ....xx.", + " .xx. ", + " .xx. ", + " .xx. ", + " .. ", + + "a", + " ", + " ", + " ..... ", + " .xxxxx. ", + " ....xx.", + " .xxxxxx.", + ".xx. .xx.", + ".xx. .xx.", + " .xxxxxx.", + " ...... ", + + "b", + " .. ", + ".xx. ", + ".xx..... ", + ".xx.xxxx. ", + ".xxx...xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xxx...xx.", + ".xx.xxxx. ", + " .. .... ", + + "c", + " ", + " ", + " ..... ", + " .xxxxx. ", + ".xx...xx.", + ".xx. .. ", + ".xx. ", + ".xx..... ", + " .xxxxxx.", + " ..... ", + + "d", + " .. ", + " .xx.", + " .....xx.", + " .xxxx.xx.", + ".xx...xxx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx...xxx.", + " .xxxx.xx.", + " .... .. ", + + "e", + " ", + " ", + " ..... ", + " .xxxxx. ", + ".xx. .xx.", + ".xx. .xx.", + ".xxxxxx. ", + ".xx.... ", + " .xxxxx. ", + " ..... ", + + "f", + " .... ", + " .xxxx. ", + " .xx..xx.", + " .xx. .. ", + " .xx. ", + ".xxxx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " .. ", + + "g", + " ", + " ", + " .. .... ", + " .xxx.xx.", + ".xx..xxx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx..xxx.", + " .xxx.xx.", + " ....xx.", + " .xxxxx. ", + " ..... ", + + "h", + " .. ", + ".xx. ", + ".xx.... ", + ".xx.xxx. ", + ".xxx..xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + " .. .. ", + + "i", + " .. ", + ".xx.", + " .. ", + ".xx.", + ".xx.", + ".xx.", + ".xx.", + ".xx.", + ".xx.", + " .. ", + + "j", + " .. ", + " .xx.", + " .. ", + " .xx.", + " .xx.", + " .xx.", + " .xx.", + " .xx.", + " ..xx.", + ".xxx. ", + " ... ", + + "k", + " .. ", + ".xx. ", + ".xx. .. ", + ".xx. .xx.", + ".xx..xx. ", + ".xxxxx. ", + ".xx..xx. ", + ".xx. .xx.", + ".xx. .xx.", + " .. .. ", + + "l", + " ... ", + ".xxx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " .xx. ", + ".xxxx.", + " .... ", + + "m", + " ", + " ", + " .. ... .... ", + ".xx.xxx.xxxx. ", + ".xxx..xxx..xx.", + ".xx. .xx. .xx.", + ".xx. .xx. .xx.", + ".xx. .xx. .xx.", + ".xx. .xx. .xx.", + " .. .. .. ", + + "n", + " ", + " ", + " .. .... ", + ".xx.xxxx. ", + ".xxx...xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + " .. .. ", + + "o", + " ", + " ", + " ..... ", + " .xxxxx. ", + ".xx...xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx...xx.", + " .xxxxx. ", + " ..... ", + + "p", + " ", + " ", + " .. .... ", + ".xx.xxxx. ", + ".xxx...xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xxx...xx.", + ".xx.xxxx. ", + ".xx..... ", + ".xx. ", + " .. ", + + "q", + " ", + " ", + " .... .. ", + " .xxxx.xx.", + ".xx...xxx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx...xxx.", + " .xxxx.xx.", + " .....xx.", + " .xx.", + " .. ", + + "r", + " ", + " ", + " .. ... ", + ".xx.xxx.", + ".xxxx.. ", + ".xxx. ", + ".xx. ", + ".xx. ", + ".xx. ", + " .. ", + + "s", + " ", + " ", + " ..... ", + " .xxxxx. ", + ".xx...xx.", + " .xxx.. ", + " ..xxx. ", + ".xx...xx.", + " .xxxxx. ", + " ..... ", + + "t", + " .. ", + " .xx. ", + " ..xx... ", + ".xxxxxxx.", + " ..xx... ", + " .xx. ", + " .xx. ", + " .xx. ", + " .xx. ", + " .. ", + + "u", + " ", + " ", + " .. .. ", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx....xx.", + " .xxxxxx. ", + " ...... ", + + "v", + " ", + " ", + " .. .. ", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + " .xx.xx. ", + " .xx.xx. ", + " .xxx. ", + " ... ", + + "w", + " ", + " ", + " .. .. ", + ".xx. .xx.", + ".xx. . .xx.", + ".xx. .x. .xx.", + " .xx.xxx.xx. ", + " .xx.xxx.xx. ", + " .xxx.xxx. ", + " ... ... ", + + "x", + " ", + " ", + " .. .. ", + ".xx. .xx.", + " .xx.xx. ", + " .xxx. ", + " .xxx. ", + " .xx.xx. ", + ".xx. .xx.", + " .. .. ", + + "y", + " ", + " ", + " .. .. ", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx. .xx.", + ".xx..xxx.", + " .xxx.xx.", + " ....xx.", + " .xxxxx. ", + " ..... ", + + "z", + " ", + " ", + " ....... ", + ".xxxxxxx.", + " ....xx. ", + " .xx. ", + " .xx. ", + " .xx.... ", + ".xxxxxxx.", + " ....... ", + + "-", + " ", + " ", + " ", + " ...... ", + ".xxxxxx.", + " ...... ", + + "~", + " ", + " ", + " ", + " .... ", + " .xx.x.", + ".x.xx. ", + " .... ", + + ".", + " ", + " ", + " ", + " ", + " ", + " ", + " .. ", + ".xx.", + ".xx.", + " .. ", + + "!", + " .. ", + ".xx.", + ".xx.", + ".xx.", + ".xx.", + ".xx.", + " .. ", + " .. ", + ".xx.", + ".xx.", + " .. ", + + ":", + " ", + " .. ", + ".xx.", + ".xx.", + " .. ", + " ", + " .. ", + ".xx.", + ".xx.", + " .. ", + + "#", + " . . ", + " .x..x. ", + " ..x..x. ", + " .xxxxxxx.", + " .x..x.. ", + " ..x..x. ", + ".xxxxxxx. ", + " .x..x.. ", + " .x..x. ", + " . . ", + + "[", + " .... ", + ".xxxx.", + ".xx. ", + ".xx. ", + ".xx. ", + ".xx. ", + ".xx. ", + ".xx. ", + ".xxxx.", + " .... ", + + "]", + " .... ", + ".xxxx.", + " .xx.", + " .xx.", + " .xx.", + " .xx.", + " .xx.", + " .xx.", + ".xxxx.", + " .... ", + + "(", + " .. ", + " .xx.", + " .xx. ", + ".xx. ", + ".xx. ", + ".xx. ", + ".xx. ", + " .xx. ", + " .xx.", + " .. ", + + ")", + " .. ", + ".xx. ", + " .xx. ", + " .xx.", + " .xx.", + " .xx.", + " .xx.", + " .xx. ", + ".xx. ", + " .. ", + + "'", + " .. ", + " .xx.", + " .xx.", + ".xx. ", + " .. ", + + ",", + " ", + " ", + " ", + " ", + " .. ", + " .xx. ", + ".xxxx.", + " .xx. ", + ".xx. ", + " .. ", + + "%", + " ", + " .. ", + ".xx. .. ", + " .. .xx.", + " .xx. ", + " .xx. ", + " .xx. ", + ".xx. .. ", + " .. .xx.", + " .. ", + + "/", + " ", + " ", + " .. ", + " .xx.", + " .xx. ", + " .xx. ", + " .xx. ", + ".xx. ", + " .. ", + + ">", + " ", + " ... ", + ".xxx.. ", + " ..xxx. ", + " ..xx.", + " ..xxx. ", + ".xxx.. ", + " ... ", + + "<", + " ", + " ... ", + " ..xxx.", + " .xxx.. ", + ".xx.. ", + " .xxx.. ", + " ..xxx.", + " ... ", + + NULL}; static char **chmap[127]; static int row; static int big; -static void textinit() -{ - int i, h; - - /* if already initialized, then do nothing */ - if (!shapes[0]) - return; - - /* scan shapes for the characters defined there */ - for (h = i = 0; shapes[i]; i++, h++) - { - /* start of new char? */ - if (!shapes[i][1]) - { - /* was previous char the tallest? */ - if (h >= textheight) - textheight = h; - h = 0; - - /* remember the shape */ - chmap[(int)shapes[i][0]] = &shapes[i + 1]; - shapes[i] = NULL; - } +static void textinit() { + int i, h; + + /* if already initialized, then do nothing */ + if (!shapes[0]) + return; + + /* scan shapes for the characters defined there */ + for (h = i = 0; shapes[i]; i++, h++) { + /* start of new char? */ + if (!shapes[i][1]) { + /* was previous char the tallest? */ + if (h >= textheight) + textheight = h; + h = 0; + + /* remember the shape */ + chmap[(int)shapes[i][0]] = &shapes[i + 1]; + shapes[i] = NULL; } + } } +static unsigned char *normaltext(unsigned char *cursor, int bpl, char **shape, + int color) { + int x, y; -static unsigned char *normaltext(unsigned char *cursor, int bpl, char **shape, int color) -{ - int x, y; - - for (x = 0; shape[0][x]; x++, cursor++) - for (y = 0; shape[y]; y++) - switch (shape[y][x]) - { - case '.': cursor[y * bpl] = textbg; break; - case 'x': cursor[y * bpl] = color; break; - } + for (x = 0; shape[0][x]; x++, cursor++) + for (y = 0; shape[y]; y++) + switch (shape[y][x]) { + case '.': + cursor[y * bpl] = textbg; + break; + case 'x': + cursor[y * bpl] = color; + break; + } - return cursor; + return cursor; } +static unsigned char *bigtext(unsigned char *cursor, int bpl, char **shape, + int color) { + int x, y; + unsigned char *raster; -static unsigned char *bigtext(unsigned char *cursor, int bpl, char **shape, int color) -{ - int x, y; - unsigned char *raster; - - for (x = 0; shape[0][x]; x++, cursor += 2) - for (y = 0, raster = cursor; shape[y]; y++, raster += 2 * bpl) - switch (shape[y][x]) - { - case '.': - raster[0] = raster[1] = raster[bpl] - = raster[bpl + 1] = textbg; - break; + for (x = 0; shape[0][x]; x++, cursor += 2) + for (y = 0, raster = cursor; shape[y]; y++, raster += 2 * bpl) + switch (shape[y][x]) { + case '.': + raster[0] = raster[1] = raster[bpl] = raster[bpl + 1] = textbg; + break; - case 'x': - raster[0] = raster[1] = raster[bpl] - = raster[bpl + 1] = color; - break; - } + case 'x': + raster[0] = raster[1] = raster[bpl] = raster[bpl + 1] = color; + break; + } - return cursor; + return cursor; } - /* Find the number of chars in words that fit */ -static int fitwords(int maxwidth, char *text, int *width) -{ - int scale = big ? 2 : 1; - int i, w, last, lastw, ch; - int fudgefactor = 0; - - for (i = last = lastw = w = 0; text[i] && w < maxwidth - fudgefactor; i++) - { - ch = tolower(text[i]); - switch (ch) - { - case '{': - scale = 2; - break; - - case '}': - scale = 1; - break; - - case '\n': - *width = w; - return i; - - default: - /* ignore if it can't be shown */ - if (ch < 0 || ch > 126 || !chmap[ch]) - break; - - /* if end of word, remember it */ - if (ch == ' ') - { - last = i; - lastw = w; - } - - /* prefer to break lines before certain punctuation */ - if (strchr("-([,", ch)) - fudgefactor = 100; - else - fudgefactor = 0; - - /* add the width of this character */ - w += scale * strlen(chmap[ch][0]); - } - } - if (!text[i]) - { - *width = w; - return i; - } - if (last > 0) - { - *width = lastw; - return last; - } - *width = maxwidth; - return i - 1; -} - - -static void textdrawrow(unsigned char *img, int height, int bpl, char *side, char *text, int max, int rowwidth) -{ - int big = FALSE; - unsigned char *cursor; - int bpt = bpl * (textheight / 2); - int hasbig; - int rowheight; - int i, ch, color; - - /* determine whether this involves any big chars */ - if (big) - hasbig = TRUE; - else - { - for (i = 0; i < max && text[i] && text[i] != '{'; i++) - { - } - hasbig = (i < max && text[i] == '{'); - } - - /* if too high, then skip it */ - rowheight = (hasbig ? textheight * 2 : textheight); - if (row + rowheight >= height) - return; - - /* choose the starting position for this row */ - cursor = img + row * bpl; - switch (*side) - { - case 'R': - cursor += (bpl - 3 - rowwidth); +static int fitwords(int maxwidth, char *text, int *width) { + int scale = big ? 2 : 1; + int i, w, last, lastw, ch; + int fudgefactor = 0; + + for (i = last = lastw = w = 0; text[i] && w < maxwidth - fudgefactor; i++) { + ch = tolower(text[i]); + switch (ch) { + case '{': + scale = 2; + break; + + case '}': + scale = 1; + break; + + case '\n': + *width = w; + return i; + + default: + /* ignore if it can't be shown */ + if (ch < 0 || ch > 126 || !chmap[ch]) break; - case 'L': - cursor += 1; - break; + /* if end of word, remember it */ + if (ch == ' ') { + last = i; + lastw = w; + } + + /* prefer to break lines before certain punctuation */ + if (strchr("-([,", ch)) + fudgefactor = 100; + else + fudgefactor = 0; - default: - cursor += ((bpl - 3 - rowwidth)/2); + /* add the width of this character */ + w += scale * strlen(chmap[ch][0]); } + } + if (!text[i]) { + *width = w; + return i; + } + if (last > 0) { + *width = lastw; + return last; + } + *width = maxwidth; + return i - 1; +} - /* if big text, then start the base line a little lower to make room */ - if (hasbig) - cursor += bpt; - - /* for each text character... */ - for (i = 0; i < max && text[i]; i++) - { - /* handle special or unsupported characters */ - ch = tolower(text[i]); - if (ch == '{') - { - big = TRUE; - continue; - } - if (ch == '}') - { - big = FALSE; - continue; - } - if (ch < 0 || ch > 126 || !chmap[ch]) - continue; - - /* choose a color */ - color = (( frame - i) * 3) & 0xff; - if (color < 128) - color = color ^ 0xff; - - /* draw the character */ - if (big) - { - cursor -= bpt; - cursor = bigtext(cursor, bpl, chmap[ch], color); - cursor += bpt; - } - else - { - cursor = normaltext(cursor, bpl, chmap[ch], color); - } +static void textdrawrow(unsigned char *img, int height, int bpl, char *side, + char *text, int max, int rowwidth) { + int big = FALSE; + unsigned char *cursor; + int bpt = bpl * (textheight / 2); + int hasbig; + int rowheight; + int i, ch, color; + + /* determine whether this involves any big chars */ + if (big) + hasbig = TRUE; + else { + for (i = 0; i < max && text[i] && text[i] != '{'; i++) { + } + hasbig = (i < max && text[i] == '{'); + } + + /* if too high, then skip it */ + rowheight = (hasbig ? textheight * 2 : textheight); + if (row + rowheight >= height) + return; + + /* choose the starting position for this row */ + cursor = img + row * bpl; + switch (*side) { + case 'R': + cursor += (bpl - 3 - rowwidth); + break; + + case 'L': + cursor += 1; + break; + + default: + cursor += ((bpl - 3 - rowwidth) / 2); + } + + /* if big text, then start the base line a little lower to make room */ + if (hasbig) + cursor += bpt; + + /* for each text character... */ + for (i = 0; i < max && text[i]; i++) { + /* handle special or unsupported characters */ + ch = tolower(text[i]); + if (ch == '{') { + big = TRUE; + continue; + } + if (ch == '}') { + big = FALSE; + continue; } + if (ch < 0 || ch > 126 || !chmap[ch]) + continue; + + /* choose a color */ + color = ((frame - i) * 3) & 0xff; + if (color < 128) + color = color ^ 0xff; + + /* draw the character */ + if (big) { + cursor -= bpt; + cursor = bigtext(cursor, bpl, chmap[ch], color); + cursor += bpt; + } else { + cursor = normaltext(cursor, bpl, chmap[ch], color); + } + } - /* increment row by the height of this text row */ - row += (hasbig ? textheight * 2 : textheight); + /* increment row by the height of this text row */ + row += (hasbig ? textheight * 2 : textheight); } /* Convert time in ms to useful string */ -void convert_ms_to_timestamp(char *buf, int time) -{ - int m = (time / 1000 / 60); - int s = (time / 1000) % 60; - sprintf(buf, "%d:%d", m, s); +void convert_ms_to_timestamp(char *buf, int time) { + int m = (time / 1000 / 60); + int s = (time / 1000) % 60; + sprintf(buf, "%d:%d", m, s); } /* Draw text into an image. */ -void textdraw(unsigned char *img, int height, int bpl, char *side, char *text) -{ - int max, twidth; - - /* parse the font table, if necessary */ - textinit(); - - /* initialize */ - frame++; - row = 0; - big = FALSE; - textbg = (*config.overall_effect == 'B' ? 0x80 : 0); - - /* for each row of text... */ - while (text) - { - /* find out how much can fit on this row */ - max = fitwords(bpl - 3, text, &twidth); - - /* draw it */ - textdrawrow(img, height, bpl, side, text, max, twidth); - - /* move to start of next row */ - text += max; - while (isspace(*text)) - text++; - } +void textdraw(unsigned char *img, int height, int bpl, char *side, char *text) { + int max, twidth; + + /* parse the font table, if necessary */ + textinit(); + + /* initialize */ + frame++; + row = 0; + big = FALSE; + textbg = (*config.overall_effect == 'B' ? 0x80 : 0); + + /* for each row of text... */ + while (text) { + /* find out how much can fit on this row */ + max = fitwords(bpl - 3, text, &twidth); + + /* draw it */ + textdrawrow(img, height, bpl, side, text, max, twidth); + + /* move to start of next row */ + text += max; + while (isspace(*text)) + text++; + } } - diff --git a/libvisual-plugins/plugins/actor/bumpscope/actor_bumpscope.c b/libvisual-plugins/plugins/actor/bumpscope/actor_bumpscope.c index a0406ad59..7c3a60e72 100644 --- a/libvisual-plugins/plugins/actor/bumpscope/actor_bumpscope.c +++ b/libvisual-plugins/plugins/actor/bumpscope/actor_bumpscope.c @@ -27,219 +27,207 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int act_bumpscope_init (VisPluginData *plugin); -static void act_bumpscope_cleanup (VisPluginData *plugin); -static void act_bumpscope_requisition (VisPluginData *plugin, int *width, int *height); -static void act_bumpscope_resize (VisPluginData *plugin, int width, int height); -static int act_bumpscope_events (VisPluginData *plugin, VisEventQueue *events); -static void act_bumpscope_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *act_bumpscope_palette (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = act_bumpscope_requisition, - .palette = act_bumpscope_palette, - .render = act_bumpscope_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "bumpscope", - .name = "Bumpscope plugin", - .author = N_("Original by: Zinx Verituse , Port by: Dennis Smit "), - .version = "0.0.1", - .about = N_("Bumpscope visual plugin"), - .help = N_("This is the libvisual port of the xmms Bumpscope plugin"), - .license = VISUAL_PLUGIN_LICENSE_GPL, - - .init = act_bumpscope_init, - .cleanup = act_bumpscope_cleanup, - .events = act_bumpscope_events, - .plugin = &actor - }; - - return &info; +static int act_bumpscope_init(VisPluginData *plugin); +static void act_bumpscope_cleanup(VisPluginData *plugin); +static void act_bumpscope_requisition(VisPluginData *plugin, int *width, + int *height); +static void act_bumpscope_resize(VisPluginData *plugin, int width, int height); +static int act_bumpscope_events(VisPluginData *plugin, VisEventQueue *events); +static void act_bumpscope_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *act_bumpscope_palette(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = act_bumpscope_requisition, + .palette = act_bumpscope_palette, + .render = act_bumpscope_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "bumpscope", + .name = "Bumpscope plugin", + .author = N_("Original by: Zinx Verituse , Port by: " + "Dennis Smit "), + .version = "0.0.1", + .about = N_("Bumpscope visual plugin"), + .help = N_("This is the libvisual port of the xmms Bumpscope plugin"), + .license = VISUAL_PLUGIN_LICENSE_GPL, + + .init = act_bumpscope_init, + .cleanup = act_bumpscope_cleanup, + .events = act_bumpscope_events, + .plugin = &actor}; + + return &info; } -static int act_bumpscope_init (VisPluginData *plugin) -{ +static int act_bumpscope_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_color_rgb ("color", - N_("The light's color"), - 122, 204, 255, - NULL), - visual_param_new_integer ("light_size", - N_("The size of the light"), - 256, - visual_param_in_range_integer (0, 1000)), - visual_param_new_bool ("color_cycle", - N_("Whether to cycle colors"), - TRUE, - NULL), - visual_param_new_bool ("moving_light", - N_("Whether the light moves with the mouse"), - TRUE, - NULL), - visual_param_new_bool ("diamond", - N_("Whether to use a diamond shape light"), - FALSE, - NULL), - NULL); - - BumpscopePrivate *priv = visual_mem_new0 (BumpscopePrivate, 1); - visual_plugin_set_private (plugin, priv); - - priv->phongres = 256; - priv->rcontext = visual_plugin_get_random_context (plugin); - priv->pal = visual_palette_new (256); - priv->pcmbuf = visual_buffer_new_allocate (512 * sizeof (float)); - - return TRUE; + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, + visual_param_new_color_rgb("color", N_("The light's color"), 122, 204, + 255, NULL), + visual_param_new_integer("light_size", N_("The size of the light"), 256, + visual_param_in_range_integer(0, 1000)), + visual_param_new_bool("color_cycle", N_("Whether to cycle colors"), TRUE, + NULL), + visual_param_new_bool("moving_light", + N_("Whether the light moves with the mouse"), TRUE, + NULL), + visual_param_new_bool( + "diamond", N_("Whether to use a diamond shape light"), FALSE, NULL), + NULL); + + BumpscopePrivate *priv = visual_mem_new0(BumpscopePrivate, 1); + visual_plugin_set_private(plugin, priv); + + priv->phongres = 256; + priv->rcontext = visual_plugin_get_random_context(plugin); + priv->pal = visual_palette_new(256); + priv->pcmbuf = visual_buffer_new_allocate(512 * sizeof(float)); + + return TRUE; } -static void act_bumpscope_cleanup (VisPluginData *plugin) -{ - BumpscopePrivate *priv = visual_plugin_get_private (plugin); +static void act_bumpscope_cleanup(VisPluginData *plugin) { + BumpscopePrivate *priv = visual_plugin_get_private(plugin); - __bumpscope_cleanup (priv); + __bumpscope_cleanup(priv); - visual_palette_free (priv->pal); + visual_palette_free(priv->pal); - visual_buffer_unref (priv->pcmbuf); + visual_buffer_unref(priv->pcmbuf); - visual_mem_free (priv); + visual_mem_free(priv); } -static void act_bumpscope_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void act_bumpscope_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - while (reqw % 4) - reqw--; + while (reqw % 4) + reqw--; - while (reqh % 2) - reqh--; + while (reqh % 2) + reqh--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static void act_bumpscope_resize (VisPluginData *plugin, int width, int height) -{ - BumpscopePrivate *priv = visual_plugin_get_private (plugin); +static void act_bumpscope_resize(VisPluginData *plugin, int width, int height) { + BumpscopePrivate *priv = visual_plugin_get_private(plugin); - priv->width = width; - priv->height = height; + priv->width = width; + priv->height = height; - __bumpscope_cleanup (priv); - __bumpscope_init (priv); + __bumpscope_cleanup(priv); + __bumpscope_init(priv); } -static int act_bumpscope_events (VisPluginData *plugin, VisEventQueue *events) -{ - BumpscopePrivate *priv = visual_plugin_get_private (plugin); - VisEvent ev; - VisParam *param; - VisColor *tmp; +static int act_bumpscope_events(VisPluginData *plugin, VisEventQueue *events) { + BumpscopePrivate *priv = visual_plugin_get_private(plugin); + VisEvent ev; + VisParam *param; + VisColor *tmp; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - act_bumpscope_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + act_bumpscope_resize(plugin, ev.event.resize.width, + ev.event.resize.height); + break; - case VISUAL_EVENT_MOUSEMOTION: - if (ev.event.mousemotion.state == VISUAL_MOUSE_DOWN) { - priv->light_x = ev.event.mousemotion.x; - priv->light_y = ev.event.mousemotion.y; - } + case VISUAL_EVENT_MOUSEMOTION: + if (ev.event.mousemotion.state == VISUAL_MOUSE_DOWN) { + priv->light_x = ev.event.mousemotion.x; + priv->light_y = ev.event.mousemotion.y; + } - break; + break; - case VISUAL_EVENT_PARAM: - param = ev.event.param.param; + case VISUAL_EVENT_PARAM: + param = ev.event.param.param; - if (visual_param_has_name (param, "color")) { - tmp = visual_param_get_value_color (param); - visual_color_copy (&priv->color, tmp); + if (visual_param_has_name(param, "color")) { + tmp = visual_param_get_value_color(param); + visual_color_copy(&priv->color, tmp); - __bumpscope_generate_palette (priv, &priv->color); + __bumpscope_generate_palette(priv, &priv->color); - } else if (visual_param_has_name (param, "light size")) { - priv->phongres = visual_param_get_value_integer (param); + } else if (visual_param_has_name(param, "light size")) { + priv->phongres = visual_param_get_value_integer(param); - __bumpscope_cleanup (priv); - __bumpscope_init (priv); + __bumpscope_cleanup(priv); + __bumpscope_init(priv); - } else if (visual_param_has_name (param, "color_cycle")) { - priv->color_cycle = visual_param_get_value_bool (param); + } else if (visual_param_has_name(param, "color_cycle")) { + priv->color_cycle = visual_param_get_value_bool(param); - } else if (visual_param_has_name (param, "moving_light")) { - priv->moving_light = visual_param_get_value_bool (param); + } else if (visual_param_has_name(param, "moving_light")) { + priv->moving_light = visual_param_get_value_bool(param); - } else if (visual_param_has_name (param, "diamond")) { - priv->diamond = visual_param_get_value_bool (param); + } else if (visual_param_has_name(param, "diamond")) { + priv->diamond = visual_param_get_value_bool(param); - __bumpscope_generate_phongdat (priv); - } + __bumpscope_generate_phongdat(priv); + } - break; + break; - default: /* to avoid warnings */ - break; - } - } + default: /* to avoid warnings */ + break; + } + } - return TRUE; + return TRUE; } -static VisPalette *act_bumpscope_palette (VisPluginData *plugin) -{ - BumpscopePrivate *priv = visual_plugin_get_private (plugin); +static VisPalette *act_bumpscope_palette(VisPluginData *plugin) { + BumpscopePrivate *priv = visual_plugin_get_private(plugin); - return priv->pal; + return priv->pal; } -static void act_bumpscope_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - BumpscopePrivate *priv = visual_plugin_get_private (plugin); - priv->video = video; +static void act_bumpscope_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + BumpscopePrivate *priv = visual_plugin_get_private(plugin); + priv->video = video; - visual_audio_get_sample_mixed_simple (audio, priv->pcmbuf, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); + visual_audio_get_sample_mixed_simple(audio, priv->pcmbuf, 2, + VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); - __bumpscope_render_pcm (priv, visual_buffer_get_data (priv->pcmbuf)); + __bumpscope_render_pcm(priv, visual_buffer_get_data(priv->pcmbuf)); - visual_mem_copy (visual_video_get_pixels (video), priv->rgb_buf2, visual_video_get_size (video)); + visual_mem_copy(visual_video_get_pixels(video), priv->rgb_buf2, + visual_video_get_size(video)); - priv->colorupdate++; + priv->colorupdate++; - /* Let's not overload the color selector */ - if (priv->colorupdate > 1) - priv->colorupdate = 0; + /* Let's not overload the color selector */ + if (priv->colorupdate > 1) + priv->colorupdate = 0; - if (priv->colorchanged == TRUE && priv->colorupdate == 0) { - /* I couldn't hold myself */ - visual_param_set_value_color ( - visual_param_list_get ( - visual_plugin_get_params (plugin), "color"), &priv->color); - } + if (priv->colorchanged == TRUE && priv->colorupdate == 0) { + /* I couldn't hold myself */ + visual_param_set_value_color( + visual_param_list_get(visual_plugin_get_params(plugin), "color"), + &priv->color); + } } diff --git a/libvisual-plugins/plugins/actor/bumpscope/actor_bumpscope.h b/libvisual-plugins/plugins/actor/bumpscope/actor_bumpscope.h index dd8210536..24d94b257 100644 --- a/libvisual-plugins/plugins/actor/bumpscope/actor_bumpscope.h +++ b/libvisual-plugins/plugins/actor/bumpscope/actor_bumpscope.h @@ -25,42 +25,42 @@ #include typedef struct { - int height; - int width; + int height; + int width; - VisPalette *pal; + VisPalette *pal; - float intense1[256]; - float intense2[256]; + float intense1[256]; + float intense2[256]; - int phongres; - uint8_t *phongdat; + int phongres; + uint8_t *phongdat; - uint8_t *rgb_buf; - uint8_t *rgb_buf2; + uint8_t *rgb_buf; + uint8_t *rgb_buf2; - VisVideo *video; + VisVideo *video; - float h; - float s; - float v; + float h; + float s; + float v; - int colorchanged; - int colorupdate; + int colorchanged; + int colorupdate; - /* Configs */ - VisColor color; - VisColor old_color; - int color_cycle; - int moving_light; - int diamond; - int light_x; - int light_y; + /* Configs */ + VisColor color; + VisColor old_color; + int color_cycle; + int moving_light; + int diamond; + int light_x; + int light_y; - VisBuffer *pcmbuf; + VisBuffer *pcmbuf; - /* Random context for the plugin */ - VisRandomContext *rcontext; + /* Random context for the plugin */ + VisRandomContext *rcontext; } BumpscopePrivate; diff --git a/libvisual-plugins/plugins/actor/bumpscope/bump_scope.c b/libvisual-plugins/plugins/actor/bumpscope/bump_scope.c index 7b3691502..cb0e77d5e 100644 --- a/libvisual-plugins/plugins/actor/bumpscope/bump_scope.c +++ b/libvisual-plugins/plugins/actor/bumpscope/bump_scope.c @@ -32,406 +32,408 @@ #define PI 3.14159265358979323846 -static void bumpscope_blur_8 (uint8_t *ptr, int w, int h, int bpl); -static void bumpscope_generate_intense (BumpscopePrivate *priv); -static void bumpscope_translate (BumpscopePrivate *priv, int x, int y, int *xo, int *yo, int *xd, int *yd, int *angle); -static void bumpscope_draw (BumpscopePrivate *priv); -static inline void draw_vert_line(uint8_t *buffer, int x, int y1, int y2, int pitch); -static void bumpscope_render_light (BumpscopePrivate *priv, int lx, int ly); - -static void bumpscope_blur_8 (uint8_t *ptr, int w, int h, int bpl) -{ - register unsigned int i,sum = 0; - register uint8_t *iptr; - - iptr = ptr + bpl + 1; - i = bpl * h; - - if (visual_cpu_has_mmx ()) { +static void bumpscope_blur_8(uint8_t *ptr, int w, int h, int bpl); +static void bumpscope_generate_intense(BumpscopePrivate *priv); +static void bumpscope_translate(BumpscopePrivate *priv, int x, int y, int *xo, + int *yo, int *xd, int *yd, int *angle); +static void bumpscope_draw(BumpscopePrivate *priv); +static inline void draw_vert_line(uint8_t *buffer, int x, int y1, int y2, + int pitch); +static void bumpscope_render_light(BumpscopePrivate *priv, int lx, int ly); + +static void bumpscope_blur_8(uint8_t *ptr, int w, int h, int bpl) { + register unsigned int i, sum = 0; + register uint8_t *iptr; + + iptr = ptr + bpl + 1; + i = bpl * h; + + if (visual_cpu_has_mmx()) { #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) - __asm __volatile - ("pxor %%mm6, %%mm6" - ::); - - while(i -= 4) - { - __asm __volatile - ("\n\t movd %[dest], %%mm0" - "\n\t movd %[pix2], %%mm1" - "\n\t punpcklbw %%mm6, %%mm0" - "\n\t movd %[pix3], %%mm2" - "\n\t punpcklbw %%mm6, %%mm1" - "\n\t movd %[pix4], %%mm3" - "\n\t punpcklbw %%mm6, %%mm2" - "\n\t movd %[pix5], %%mm4" - "\n\t punpcklbw %%mm6, %%mm3" - "\n\t paddw %%mm1, %%mm2" - "\n\t punpcklbw %%mm6, %%mm4" - "\n\t paddw %%mm3, %%mm2" - "\n\t paddw %%mm2, %%mm4" - "\n\t psrlw $2, %%mm4" - "\n\t packuswb %%mm6, %%mm4" - "\n\t movd %%mm4, %[dest]" - :: [dest] "m" (*(iptr)) - , [pix2] "m" (*(iptr - bpl)) - , [pix3] "m" (*(iptr - 1)) - , [pix4] "m" (*(iptr + 1)) - , [pix5] "m" (*(iptr + bpl))); - - iptr += 4; - } - - __asm __volatile - ("\n\t emms"); + __asm __volatile("pxor %%mm6, %%mm6" ::); + + while (i -= 4) { + __asm __volatile("\n\t movd %[dest], %%mm0" + "\n\t movd %[pix2], %%mm1" + "\n\t punpcklbw %%mm6, %%mm0" + "\n\t movd %[pix3], %%mm2" + "\n\t punpcklbw %%mm6, %%mm1" + "\n\t movd %[pix4], %%mm3" + "\n\t punpcklbw %%mm6, %%mm2" + "\n\t movd %[pix5], %%mm4" + "\n\t punpcklbw %%mm6, %%mm3" + "\n\t paddw %%mm1, %%mm2" + "\n\t punpcklbw %%mm6, %%mm4" + "\n\t paddw %%mm3, %%mm2" + "\n\t paddw %%mm2, %%mm4" + "\n\t psrlw $2, %%mm4" + "\n\t packuswb %%mm6, %%mm4" + "\n\t movd %%mm4, %[dest]" ::[dest] "m"(*(iptr)), + [pix2] "m"(*(iptr - bpl)), [pix3] "m"(*(iptr - 1)), + [pix4] "m"(*(iptr + 1)), [pix5] "m"(*(iptr + bpl))); + + iptr += 4; + } + + __asm __volatile("\n\t emms"); #endif - } else { - while(i--) - { - sum = (iptr[-bpl] + iptr[-1] + iptr[1] + iptr[bpl]) >> 2; - *(iptr++) = sum; - } - } + } else { + while (i--) { + sum = (iptr[-bpl] + iptr[-1] + iptr[1] + iptr[bpl]) >> 2; + *(iptr++) = sum; + } + } } -static void bumpscope_generate_intense (BumpscopePrivate *priv) -{ - int32_t i; +static void bumpscope_generate_intense(BumpscopePrivate *priv) { + int32_t i; - for(i = 255; i > 0; i--) { - priv->intense1[i] = cos(((float)(255-i)*PI)/512.0); - priv->intense2[i] = pow(priv->intense1[i], 250)*150; - } + for (i = 255; i > 0; i--) { + priv->intense1[i] = cos(((float)(255 - i) * PI) / 512.0); + priv->intense2[i] = pow(priv->intense1[i], 250) * 150; + } - priv->intense1[0] = priv->intense1[1]; - priv->intense2[0] = priv->intense2[1]; + priv->intense1[0] = priv->intense1[1]; + priv->intense2[0] = priv->intense2[1]; } -static void bumpscope_translate (BumpscopePrivate *priv, int x, int y, int *xo, int *yo, int *xd, int *yd, int *angle) -{ - /* try setting y to both maxes */ - *yo = priv->height/2; - *angle = asin((float)(y-(priv->height/2))/(float)*yo)/(PI/180.0); - *xo = (x-(priv->width/2))/cos(*angle*(PI/180.0)); - - if (*xo>=-(priv->width/2) && *xo<=(priv->width/2)) { - *xd = (*xo>0)?-1:1; - *yd = 0; - return; - } - - *yo = -*yo; - *angle = asin((float)(y-(priv->height/2))/(float)*yo)/(PI/180.0); - *xo = (x-(priv->width/2))/cos(*angle*(PI/180.0)); - - if (*xo>=-(priv->width/2) && *xo<=(priv->width/2)) { - *xd = (*xo>0)?-1:1; - *yd = 0; - return; - } - - /* try setting x to both maxes */ - *xo = priv->width/2; - *angle = acos((float)(x-(priv->width/2))/(float)*xo)/(PI/180.0); - *yo = (y-(priv->height/2))/sin(*angle*(PI/180.0)); - - if (*yo>=-(priv->height/2) && *yo<=(priv->height/2)) { - *yd = (*yo>0)?-1:1; - *xd = 0; - return; - } - - *xo = -*xo; - *angle = acos((float)(x-(priv->width/2))/(float)*xo)/(PI/180.0); - *yo = (y-(priv->height/2))/sin(*angle*(PI/180.0)); - - /* if this isn't right, it's out of our range and we don't care */ - *yd = (*yo>0)?-1:1; - *xd = 0; +static void bumpscope_translate(BumpscopePrivate *priv, int x, int y, int *xo, + int *yo, int *xd, int *yd, int *angle) { + /* try setting y to both maxes */ + *yo = priv->height / 2; + *angle = asin((float)(y - (priv->height / 2)) / (float)*yo) / (PI / 180.0); + *xo = (x - (priv->width / 2)) / cos(*angle * (PI / 180.0)); + + if (*xo >= -(priv->width / 2) && *xo <= (priv->width / 2)) { + *xd = (*xo > 0) ? -1 : 1; + *yd = 0; + return; + } + + *yo = -*yo; + *angle = asin((float)(y - (priv->height / 2)) / (float)*yo) / (PI / 180.0); + *xo = (x - (priv->width / 2)) / cos(*angle * (PI / 180.0)); + + if (*xo >= -(priv->width / 2) && *xo <= (priv->width / 2)) { + *xd = (*xo > 0) ? -1 : 1; + *yd = 0; + return; + } + + /* try setting x to both maxes */ + *xo = priv->width / 2; + *angle = acos((float)(x - (priv->width / 2)) / (float)*xo) / (PI / 180.0); + *yo = (y - (priv->height / 2)) / sin(*angle * (PI / 180.0)); + + if (*yo >= -(priv->height / 2) && *yo <= (priv->height / 2)) { + *yd = (*yo > 0) ? -1 : 1; + *xd = 0; + return; + } + + *xo = -*xo; + *angle = acos((float)(x - (priv->width / 2)) / (float)*xo) / (PI / 180.0); + *yo = (y - (priv->height / 2)) / sin(*angle * (PI / 180.0)); + + /* if this isn't right, it's out of our range and we don't care */ + *yd = (*yo > 0) ? -1 : 1; + *xd = 0; } -static void bumpscope_draw (BumpscopePrivate *priv) -{ - /* FIXME remove the statics */ - static int angle, xo, yo, xd, yd, lx, ly; - static int was_moving = 0, was_color = 0; - static float sd = 0; - static float h, s, v; - static int hd = 0; - - lx = priv->light_x; - ly = priv->light_y; - if (priv->moving_light) { - if (!was_moving) { - bumpscope_translate (priv, lx, ly, &xo, &yo, &xd, &yd, &angle); - was_moving = 1; - } - - lx = priv->width/2+cos(angle*(PI/180.0))*xo; - ly = priv->height/2+sin(angle*(PI/180.0))*yo; - - angle += 2; if (angle >= 360) angle = 0; - - xo += xd; - if ((int)xo > ((int)priv->width/(int)2) || (int)xo < -((int)priv->width/(int)2)) { - xo = (xo>0)?(priv->width/2):-(priv->width/2); - if (visual_random_context_int(priv->rcontext)&1) { - xd = (xd>0)?-1:1; - yd = 0; - } else { - yd = (yd>0)?-1:1; - xd = 0; - } - } - - yo += yd; - if ((int)yo > ((int)priv->height/(int)2) || (int)yo < -((int)priv->height/(int)2)) { - yo = (yo>0)?(priv->height/2):-(priv->height/2); - if (visual_random_context_int(priv->rcontext)&1) { - xd = (xd>0)?-1:1; - yd = 0; - } else { - yd = (yd>0)?-1:1; - xd = 0; - } - } - } else { - if (was_moving) { - was_moving = 0; - } - } - - if (priv->color_cycle) { - if (!was_color) { - visual_color_get_hsv (&priv->color, &h, &s, &v); - - was_color = 1; - - if (visual_random_context_int(priv->rcontext)&1) { - hd = (visual_random_context_int(priv->rcontext)&1)*2-1; - sd = 0; - } else { - sd = 0.01 * ((visual_random_context_int(priv->rcontext)&1)*2-1); - hd = 0; - } - } - - visual_color_set_hsv (&priv->color, h, s, v); - __bumpscope_generate_palette (priv, &priv->color); - - if (hd) { - h += hd; - if (h >= 360) h = 0; - if (h < 0) h = 359; - if ((visual_random_context_int(priv->rcontext)%150) == 0) { - if (visual_random_context_int(priv->rcontext)&1) { - hd = (visual_random_context_int(priv->rcontext)&1)*2-1; - sd = 0; - } else { - sd = 0.01 * ((visual_random_context_int(priv->rcontext)&1)*2-1); - hd = 0; - } - } - } else { - s += sd; - - if (s <= 0 || s >= 0.5) { - if (s < 0) s = 0; - - if (s > 0.52) { - sd = -0.01; - } else if (s == 0) { - h = visual_random_context_int(priv->rcontext)%360; - sd = 0.01; - } else { - if (visual_random_context_int(priv->rcontext)&1) { - hd = (visual_random_context_int(priv->rcontext)&1)*2-1; - sd = 0; - } else { - sd = 0.01 * ((visual_random_context_int(priv->rcontext)&1)*2-1); - hd = 0; - } - } - } - } - } else if (was_color) { - __bumpscope_generate_palette (priv, &priv->color); - was_color = 0; - } - - if (visual_color_compare (&priv->old_color, &priv->color) == FALSE) - priv->colorchanged = TRUE; - else - priv->colorchanged = FALSE; - - visual_color_copy (&priv->old_color, &priv->color); - - bumpscope_render_light (priv, lx, ly); +static void bumpscope_draw(BumpscopePrivate *priv) { + /* FIXME remove the statics */ + static int angle, xo, yo, xd, yd, lx, ly; + static int was_moving = 0, was_color = 0; + static float sd = 0; + static float h, s, v; + static int hd = 0; + + lx = priv->light_x; + ly = priv->light_y; + if (priv->moving_light) { + if (!was_moving) { + bumpscope_translate(priv, lx, ly, &xo, &yo, &xd, &yd, &angle); + was_moving = 1; + } + + lx = priv->width / 2 + cos(angle * (PI / 180.0)) * xo; + ly = priv->height / 2 + sin(angle * (PI / 180.0)) * yo; + + angle += 2; + if (angle >= 360) + angle = 0; + + xo += xd; + if ((int)xo > ((int)priv->width / (int)2) || + (int)xo < -((int)priv->width / (int)2)) { + xo = (xo > 0) ? (priv->width / 2) : -(priv->width / 2); + if (visual_random_context_int(priv->rcontext) & 1) { + xd = (xd > 0) ? -1 : 1; + yd = 0; + } else { + yd = (yd > 0) ? -1 : 1; + xd = 0; + } + } + + yo += yd; + if ((int)yo > ((int)priv->height / (int)2) || + (int)yo < -((int)priv->height / (int)2)) { + yo = (yo > 0) ? (priv->height / 2) : -(priv->height / 2); + if (visual_random_context_int(priv->rcontext) & 1) { + xd = (xd > 0) ? -1 : 1; + yd = 0; + } else { + yd = (yd > 0) ? -1 : 1; + xd = 0; + } + } + } else { + if (was_moving) { + was_moving = 0; + } + } + + if (priv->color_cycle) { + if (!was_color) { + visual_color_get_hsv(&priv->color, &h, &s, &v); + + was_color = 1; + + if (visual_random_context_int(priv->rcontext) & 1) { + hd = (visual_random_context_int(priv->rcontext) & 1) * 2 - 1; + sd = 0; + } else { + sd = 0.01 * ((visual_random_context_int(priv->rcontext) & 1) * 2 - 1); + hd = 0; + } + } + + visual_color_set_hsv(&priv->color, h, s, v); + __bumpscope_generate_palette(priv, &priv->color); + + if (hd) { + h += hd; + if (h >= 360) + h = 0; + if (h < 0) + h = 359; + if ((visual_random_context_int(priv->rcontext) % 150) == 0) { + if (visual_random_context_int(priv->rcontext) & 1) { + hd = (visual_random_context_int(priv->rcontext) & 1) * 2 - 1; + sd = 0; + } else { + sd = 0.01 * ((visual_random_context_int(priv->rcontext) & 1) * 2 - 1); + hd = 0; + } + } + } else { + s += sd; + + if (s <= 0 || s >= 0.5) { + if (s < 0) + s = 0; + + if (s > 0.52) { + sd = -0.01; + } else if (s == 0) { + h = visual_random_context_int(priv->rcontext) % 360; + sd = 0.01; + } else { + if (visual_random_context_int(priv->rcontext) & 1) { + hd = (visual_random_context_int(priv->rcontext) & 1) * 2 - 1; + sd = 0; + } else { + sd = 0.01 * + ((visual_random_context_int(priv->rcontext) & 1) * 2 - 1); + hd = 0; + } + } + } + } + } else if (was_color) { + __bumpscope_generate_palette(priv, &priv->color); + was_color = 0; + } + + if (visual_color_compare(&priv->old_color, &priv->color) == FALSE) + priv->colorchanged = TRUE; + else + priv->colorchanged = FALSE; + + visual_color_copy(&priv->old_color, &priv->color); + + bumpscope_render_light(priv, lx, ly); } -static inline void draw_vert_line(uint8_t *buffer, int x, int y1, int y2, int pitch) -{ - int y; - uint8_t *p; - if(y1 < y2) - { - p = buffer+((y1+1)*pitch)+x+1; - for(y = y1; y <= y2; y++) { - *p = 0xff; - p += pitch; - } - } - else if(y2 < y1) - { - p = buffer+((y2+1)*pitch)+x+1; - for(y = y2; y <= y1; y++) { - *p = 0xff; - p += pitch; - } - } - else { - buffer[((y1+1)*pitch)+x+1] = 0xff; - } +static inline void draw_vert_line(uint8_t *buffer, int x, int y1, int y2, + int pitch) { + int y; + uint8_t *p; + if (y1 < y2) { + p = buffer + ((y1 + 1) * pitch) + x + 1; + for (y = y1; y <= y2; y++) { + *p = 0xff; + p += pitch; + } + } else if (y2 < y1) { + p = buffer + ((y2 + 1) * pitch) + x + 1; + for (y = y2; y <= y1; y++) { + *p = 0xff; + p += pitch; + } + } else { + buffer[((y1 + 1) * pitch) + x + 1] = 0xff; + } } -static void bumpscope_render_light (BumpscopePrivate *priv, int lx, int ly) -{ - int i, j, prev_y, dy, dx, xq, yq; - int video_pitch; +static void bumpscope_render_light(BumpscopePrivate *priv, int lx, int ly) { + int i, j, prev_y, dy, dx, xq, yq; + int video_pitch; - video_pitch = visual_video_get_pitch (priv->video); + video_pitch = visual_video_get_pitch(priv->video); - prev_y = video_pitch + 1; + prev_y = video_pitch + 1; - for (dy = (-ly)+(priv->phongres/2), j = 0; j < priv->height; j++, dy++, prev_y+=video_pitch-priv->width) { - for (dx = (-lx)+(priv->phongres/2), i = 0; i < priv->width; i++, dx++, prev_y++) { + for (dy = (-ly) + (priv->phongres / 2), j = 0; j < priv->height; + j++, dy++, prev_y += video_pitch - priv->width) { + for (dx = (-lx) + (priv->phongres / 2), i = 0; i < priv->width; + i++, dx++, prev_y++) { - xq = (priv->rgb_buf[prev_y-1]-priv->rgb_buf[prev_y+1])+dx; - yq = (priv->rgb_buf[prev_y-video_pitch]-priv->rgb_buf[prev_y+video_pitch])+dy; + xq = (priv->rgb_buf[prev_y - 1] - priv->rgb_buf[prev_y + 1]) + dx; + yq = (priv->rgb_buf[prev_y - video_pitch] - + priv->rgb_buf[prev_y + video_pitch]) + + dy; - if (yq<0 || yq>=priv->phongres || - xq<0 || xq>=priv->phongres) { + if (yq < 0 || yq >= priv->phongres || xq < 0 || xq >= priv->phongres) { - priv->rgb_buf2[prev_y] = 0; + priv->rgb_buf2[prev_y] = 0; - continue; - } + continue; + } - priv->rgb_buf2[prev_y] = priv->phongdat[(xq * priv->phongres) + yq]; - } - } + priv->rgb_buf2[prev_y] = priv->phongdat[(xq * priv->phongres) + yq]; + } + } } -void __bumpscope_generate_palette (BumpscopePrivate *priv, VisColor *col) -{ - VisColor *pal_colors = visual_palette_get_colors (priv->pal); +void __bumpscope_generate_palette(BumpscopePrivate *priv, VisColor *col) { + VisColor *pal_colors = visual_palette_get_colors(priv->pal); - int32_t i,r,g,b; + int32_t i, r, g, b; - for (i = 0; i < 256; i++) { - r = ((float)(100*col->r/255)*priv->intense1[i]+priv->intense2[i]); - g = ((float)(100*col->g/255)*priv->intense1[i]+priv->intense2[i]); - b = ((float)(100*col->b/255)*priv->intense1[i]+priv->intense2[i]); + for (i = 0; i < 256; i++) { + r = ((float)(100 * col->r / 255) * priv->intense1[i] + priv->intense2[i]); + g = ((float)(100 * col->g / 255) * priv->intense1[i] + priv->intense2[i]); + b = ((float)(100 * col->b / 255) * priv->intense1[i] + priv->intense2[i]); - pal_colors[i].r = r; - pal_colors[i].g = g; - pal_colors[i].b = b; - } + pal_colors[i].r = r; + pal_colors[i].g = g; + pal_colors[i].b = b; + } } -void __bumpscope_generate_phongdat (BumpscopePrivate *priv) -{ - int y, x; - double i, i2, cont = 0; - int phresd2 = priv->phongres / 2; - - for (y = phresd2; y < priv->phongres; y++) { - for (x = phresd2; x < priv->phongres; x++) { - - i = (double)x/((double)priv->phongres)-1; - i2 = (double)y/((double)priv->phongres)-1; - - if (priv->diamond) - i = 1 - pow(i*i2,.75) - i*i - i2*i2; - else - i = 1 - i*i - i2*i2; - - if (i >= 0) { - if (priv->diamond) - i = i*i*i * 255.0; - else - i = i*i*i * 255.0; - - if (i > 255) i = 255; - - cont = i; - - if (cont < 110) - cont = 0; - - priv->phongdat[((y - phresd2) * priv->phongres) + x - phresd2] = cont; - priv->phongdat[(((priv->phongres-1)-y + phresd2) * priv->phongres) + x - phresd2] = cont; - priv->phongdat[(((y - phresd2) * priv->phongres) + ((priv->phongres-1) - x)) + phresd2] = cont; - priv->phongdat[(((priv->phongres-1)-y + phresd2) * priv->phongres) + ((priv->phongres-1)-x + phresd2)] = cont; - } else { - priv->phongdat[((y - phresd2) * priv->phongres) + x - phresd2] = cont; - priv->phongdat[(((priv->phongres-1)-y + phresd2) * priv->phongres) + x - phresd2] = cont; - priv->phongdat[(((y - phresd2) * priv->phongres) + ((priv->phongres-1) - x)) + phresd2] = cont; - priv->phongdat[(((priv->phongres-1)-y + phresd2) * priv->phongres) + ((priv->phongres-1)-x + phresd2)] = cont; - } - } - } +void __bumpscope_generate_phongdat(BumpscopePrivate *priv) { + int y, x; + double i, i2, cont = 0; + int phresd2 = priv->phongres / 2; + + for (y = phresd2; y < priv->phongres; y++) { + for (x = phresd2; x < priv->phongres; x++) { + + i = (double)x / ((double)priv->phongres) - 1; + i2 = (double)y / ((double)priv->phongres) - 1; + + if (priv->diamond) + i = 1 - pow(i * i2, .75) - i * i - i2 * i2; + else + i = 1 - i * i - i2 * i2; + + if (i >= 0) { + if (priv->diamond) + i = i * i * i * 255.0; + else + i = i * i * i * 255.0; + + if (i > 255) + i = 255; + + cont = i; + + if (cont < 110) + cont = 0; + + priv->phongdat[((y - phresd2) * priv->phongres) + x - phresd2] = cont; + priv->phongdat[(((priv->phongres - 1) - y + phresd2) * priv->phongres) + + x - phresd2] = cont; + priv->phongdat[(((y - phresd2) * priv->phongres) + + ((priv->phongres - 1) - x)) + + phresd2] = cont; + priv->phongdat[(((priv->phongres - 1) - y + phresd2) * priv->phongres) + + ((priv->phongres - 1) - x + phresd2)] = cont; + } else { + priv->phongdat[((y - phresd2) * priv->phongres) + x - phresd2] = cont; + priv->phongdat[(((priv->phongres - 1) - y + phresd2) * priv->phongres) + + x - phresd2] = cont; + priv->phongdat[(((y - phresd2) * priv->phongres) + + ((priv->phongres - 1) - x)) + + phresd2] = cont; + priv->phongdat[(((priv->phongres - 1) - y + phresd2) * priv->phongres) + + ((priv->phongres - 1) - x + phresd2)] = cont; + } + } + } } -void __bumpscope_render_pcm (BumpscopePrivate *priv, float *data) -{ - int i, y, prev_y, video_pitch; +void __bumpscope_render_pcm(BumpscopePrivate *priv, float *data) { + int i, y, prev_y, video_pitch; - video_pitch = visual_video_get_pitch (priv->video); + video_pitch = visual_video_get_pitch(priv->video); - prev_y = (int)priv->height/(int)2 + (data[0] * (priv->height / 2)); + prev_y = (int)priv->height / (int)2 + (data[0] * (priv->height / 2)); - if (prev_y < 0) prev_y = 0; - if (prev_y >= priv->height) prev_y = priv->height-1; + if (prev_y < 0) + prev_y = 0; + if (prev_y >= priv->height) + prev_y = priv->height - 1; - for(i = 0; i < priv->width; i++) - { - y = (i*511)/(priv->width-1); + for (i = 0; i < priv->width; i++) { + y = (i * 511) / (priv->width - 1); - y = (int)priv->height/(int)2 + (data[y % 512] * priv->height); + y = (int)priv->height / (int)2 + (data[y % 512] * priv->height); - /* This should _never_ happen (and doesn't), but I test anyway. */ - if (y < 0) y = 0; - if(y >= priv->height) y = priv->height - 1; + /* This should _never_ happen (and doesn't), but I test anyway. */ + if (y < 0) + y = 0; + if (y >= priv->height) + y = priv->height - 1; - draw_vert_line(priv->rgb_buf, i, prev_y, y, video_pitch); - prev_y = y; - } + draw_vert_line(priv->rgb_buf, i, prev_y, y, video_pitch); + prev_y = y; + } - bumpscope_blur_8(priv->rgb_buf, priv->width, priv->height, video_pitch); - bumpscope_draw (priv); + bumpscope_blur_8(priv->rgb_buf, priv->width, priv->height, video_pitch); + bumpscope_draw(priv); } -void __bumpscope_init (BumpscopePrivate *priv) -{ - priv->phongdat = visual_mem_malloc0 (priv->phongres * priv->phongres * 2); - priv->rgb_buf = visual_mem_malloc0 (priv->width*2 * priv->height + 1); - priv->rgb_buf2 = visual_mem_malloc0 (priv->width*2 * priv->height + 1); +void __bumpscope_init(BumpscopePrivate *priv) { + priv->phongdat = visual_mem_malloc0(priv->phongres * priv->phongres * 2); + priv->rgb_buf = visual_mem_malloc0(priv->width * 2 * priv->height + 1); + priv->rgb_buf2 = visual_mem_malloc0(priv->width * 2 * priv->height + 1); - __bumpscope_generate_phongdat (priv); - bumpscope_generate_intense (priv); - __bumpscope_generate_palette (priv, &priv->color); + __bumpscope_generate_phongdat(priv); + bumpscope_generate_intense(priv); + __bumpscope_generate_palette(priv, &priv->color); } -void __bumpscope_cleanup (BumpscopePrivate *priv) -{ - if (priv->phongdat != NULL) - visual_mem_free (priv->phongdat); +void __bumpscope_cleanup(BumpscopePrivate *priv) { + if (priv->phongdat != NULL) + visual_mem_free(priv->phongdat); - if (priv->rgb_buf != NULL) - visual_mem_free (priv->rgb_buf); + if (priv->rgb_buf != NULL) + visual_mem_free(priv->rgb_buf); - if (priv->rgb_buf2 != NULL) - visual_mem_free (priv->rgb_buf2); + if (priv->rgb_buf2 != NULL) + visual_mem_free(priv->rgb_buf2); } - diff --git a/libvisual-plugins/plugins/actor/bumpscope/bump_scope.h b/libvisual-plugins/plugins/actor/bumpscope/bump_scope.h index 5f7ff785c..577e167c5 100644 --- a/libvisual-plugins/plugins/actor/bumpscope/bump_scope.h +++ b/libvisual-plugins/plugins/actor/bumpscope/bump_scope.h @@ -1,12 +1,12 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 1999, 2001 Zinx Verituse * * Authors: Zinx Verituse * Dennis Smit * * Notes: Bumpscope plugin originally from XMMS. - * + * * $Id: bump_scope.h,v 1.5 2005/12/20 18:49:13 synap Exp $ * * This program is free software; you can redistribute it and/or modify @@ -26,9 +26,8 @@ #include "actor_bumpscope.h" -void __bumpscope_generate_palette (BumpscopePrivate *priv, VisColor *col); -void __bumpscope_generate_phongdat (BumpscopePrivate *priv); -void __bumpscope_render_pcm (BumpscopePrivate *priv, float *data); -void __bumpscope_init (BumpscopePrivate *priv); -void __bumpscope_cleanup (BumpscopePrivate *priv); - +void __bumpscope_generate_palette(BumpscopePrivate *priv, VisColor *col); +void __bumpscope_generate_phongdat(BumpscopePrivate *priv); +void __bumpscope_render_pcm(BumpscopePrivate *priv, float *data); +void __bumpscope_init(BumpscopePrivate *priv); +void __bumpscope_cleanup(BumpscopePrivate *priv); diff --git a/libvisual-plugins/plugins/actor/corona/actor_corona.cpp b/libvisual-plugins/plugins/actor/corona/actor_corona.cpp index ef5126a38..cd0af4a57 100644 --- a/libvisual-plugins/plugins/actor/corona/actor_corona.cpp +++ b/libvisual-plugins/plugins/actor/corona/actor_corona.cpp @@ -33,229 +33,220 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR namespace { - struct CoronaPrivate { - LV::Time oldtime; - LV::Palette pal; - Corona* corona; /* The corona internal private struct */ - PaletteCycler* pcyl; - TimedLevel tl; - }; - - int lv_corona_init (VisPluginData *plugin); - void lv_corona_cleanup (VisPluginData *plugin); - void lv_corona_requisition (VisPluginData *plugin, int *width, int *height); - void lv_corona_resize (VisPluginData *plugin, int width, int height); - int lv_corona_events (VisPluginData *plugin, VisEventQueue *events); - void lv_corona_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); - VisPalette *lv_corona_palette (VisPluginData *plugin); - - const int PALETTEDATA[][NB_PALETTES] = { - { 4, 85, 0xff0000, 170, 0xffff00, 224, 0xffffff, 240, 0xf8f8e0 }, // 0. fire - { 3, 85, 0xff, 170, 0xffff, 256, 0xffffff }, // 1. ice - { 1, 256, 0xffffff }, // 2. white - { 2, 128, 0xffffff, 256, 0xff }, // 3. white to blue - { 2, 128, 0x808080, 256, 0xff }, // 4. gray to blue - { 2, 128, 0xffff80, 256, 0xff }, // 5. yellow to blue - { 2, 128, 0xffffff, 256, 0xff0000 }, // 6. white to red - { 2, 128, 0xff, 256, 0xff0000 }, // 7. blue to red - { 2, 128, 0xff0000, 256, 0xff }, // 8. red to blue - { 2, 128, 0xff, 256, 0xffffff }, // 9. blue to white - { 2, 128, 0xffffff, 256, 0 }, // 10. white to black - { 2, 128, 0xff, 256, 0 }, // 11. blue to black - { 2, 128, 0xff0000, 256, 0 }, // 12. red to black - { 8, 32, 0xff, 64, 0, 96, 0xff, 128, 0, 192, 0xff, 256, 0 }, // 13. blue lines on black - { 8, 32, 0xffffff, 64, 0, 96, 0xffffff, 128, 0, 192, 0xffffff, 256, 0 }, // 14. white lines on black - { 3, 0, 0x000020, 128, 0x40, 256, 0xffffff }, // 15. night sky - { 2, 128, 0xff8080, 256, 0xff }, // 16. pink to blue - { 2, 0, 0xffffff, 256, 0 }, // 17. black on white - { 3, 0, 0xffffff, 128, 0, 256, 0xffffff }, // 18. black to white on white - { 3, 0, 0xffffff, 128, 0, 256, 0xc0c0ff }, // 19. heavenly blue - { 4, 120, 0x78, 128, 0xff0000, 136, 0x88, 256, 0xff }, // 20. blue, red line - { 2, 0, 0xffe0a0, 256, 0 }, // 21. twilight yellow - { 3, 0, 0xc0c0ff, 128, 0xa0a0a0, 256, 0xffffff } // 22. clouds - }; +struct CoronaPrivate { + LV::Time oldtime; + LV::Palette pal; + Corona *corona; /* The corona internal private struct */ + PaletteCycler *pcyl; + TimedLevel tl; +}; + +int lv_corona_init(VisPluginData *plugin); +void lv_corona_cleanup(VisPluginData *plugin); +void lv_corona_requisition(VisPluginData *plugin, int *width, int *height); +void lv_corona_resize(VisPluginData *plugin, int width, int height); +int lv_corona_events(VisPluginData *plugin, VisEventQueue *events); +void lv_corona_render(VisPluginData *plugin, VisVideo *video, VisAudio *audio); +VisPalette *lv_corona_palette(VisPluginData *plugin); + +const int PALETTEDATA[][NB_PALETTES] = { + {4, 85, 0xff0000, 170, 0xffff00, 224, 0xffffff, 240, 0xf8f8e0}, // 0. fire + {3, 85, 0xff, 170, 0xffff, 256, 0xffffff}, // 1. ice + {1, 256, 0xffffff}, // 2. white + {2, 128, 0xffffff, 256, 0xff}, // 3. white to blue + {2, 128, 0x808080, 256, 0xff}, // 4. gray to blue + {2, 128, 0xffff80, 256, 0xff}, // 5. yellow to blue + {2, 128, 0xffffff, 256, 0xff0000}, // 6. white to red + {2, 128, 0xff, 256, 0xff0000}, // 7. blue to red + {2, 128, 0xff0000, 256, 0xff}, // 8. red to blue + {2, 128, 0xff, 256, 0xffffff}, // 9. blue to white + {2, 128, 0xffffff, 256, 0}, // 10. white to black + {2, 128, 0xff, 256, 0}, // 11. blue to black + {2, 128, 0xff0000, 256, 0}, // 12. red to black + {8, 32, 0xff, 64, 0, 96, 0xff, 128, 0, 192, 0xff, 256, + 0}, // 13. blue lines on black + {8, 32, 0xffffff, 64, 0, 96, 0xffffff, 128, 0, 192, 0xffffff, 256, + 0}, // 14. white lines on black + {3, 0, 0x000020, 128, 0x40, 256, 0xffffff}, // 15. night sky + {2, 128, 0xff8080, 256, 0xff}, // 16. pink to blue + {2, 0, 0xffffff, 256, 0}, // 17. black on white + {3, 0, 0xffffff, 128, 0, 256, 0xffffff}, // 18. black to white on white + {3, 0, 0xffffff, 128, 0, 256, 0xc0c0ff}, // 19. heavenly blue + {4, 120, 0x78, 128, 0xff0000, 136, 0x88, 256, 0xff}, // 20. blue, red line + {2, 0, 0xffe0a0, 256, 0}, // 21. twilight yellow + {3, 0, 0xc0c0ff, 128, 0xa0a0a0, 256, 0xffffff} // 22. clouds +}; +} // namespace + +const VisPluginInfo *get_plugin_info() { + static VisActorPlugin actor; + static VisPluginInfo info; + + actor.requisition = lv_corona_requisition; + actor.palette = lv_corona_palette; + actor.render = lv_corona_render; + actor.vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT; + + info.type = VISUAL_PLUGIN_TYPE_ACTOR; + + info.plugname = "corona"; + info.name = "libvisual corona plugin"; + info.author = "Jean-Christophe Hoelt and Richard " + "Ashburn "; + info.version = "0.1"; + info.about = N_("Libvisual corona plugin"); + info.help = N_("This plugin adds support for the neat corona plugin"); + info.license = VISUAL_PLUGIN_LICENSE_GPL, + + info.init = lv_corona_init; + info.cleanup = lv_corona_cleanup; + info.events = lv_corona_events; + info.plugin = &actor; + + return &info; } -const VisPluginInfo *get_plugin_info () -{ - static VisActorPlugin actor; - static VisPluginInfo info; - - actor.requisition = lv_corona_requisition; - actor.palette = lv_corona_palette; - actor.render = lv_corona_render; - actor.vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT; - - info.type = VISUAL_PLUGIN_TYPE_ACTOR; - - info.plugname = "corona"; - info.name = "libvisual corona plugin"; - info.author = "Jean-Christophe Hoelt and Richard Ashburn "; - info.version = "0.1"; - info.about = N_("Libvisual corona plugin"); - info.help = N_("This plugin adds support for the neat corona plugin"); - info.license = VISUAL_PLUGIN_LICENSE_GPL, - - info.init = lv_corona_init; - info.cleanup = lv_corona_cleanup; - info.events = lv_corona_events; - info.plugin = &actor; - - return &info; -} - - namespace { -int lv_corona_init (VisPluginData *plugin) -{ +int lv_corona_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - auto priv = new CoronaPrivate; - visual_mem_set (priv, 0, sizeof (CoronaPrivate)); + auto priv = new CoronaPrivate; + visual_mem_set(priv, 0, sizeof(CoronaPrivate)); - visual_plugin_set_private (plugin, priv); + visual_plugin_set_private(plugin, priv); - priv->corona = new Corona(); - priv->pcyl = new PaletteCycler(PALETTEDATA, NB_PALETTES); - priv->tl.timeStamp = 0; - priv->tl.lastbeat = 0; - priv->tl.state = normal_state; + priv->corona = new Corona(); + priv->pcyl = new PaletteCycler(PALETTEDATA, NB_PALETTES); + priv->tl.timeStamp = 0; + priv->tl.lastbeat = 0; + priv->tl.state = normal_state; - priv->oldtime = LV::Time::now (); + priv->oldtime = LV::Time::now(); - priv->pal.colors.resize (256); + priv->pal.colors.resize(256); - return true; + return true; } -void lv_corona_cleanup (VisPluginData *plugin) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_corona_cleanup(VisPluginData *plugin) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - delete priv->corona; - delete priv->pcyl; - delete priv; + delete priv->corona; + delete priv->pcyl; + delete priv; } -void lv_corona_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +void lv_corona_requisition(VisPluginData *plugin, int *width, int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - while (reqw % 4) - reqw--; + while (reqw % 4) + reqw--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -void lv_corona_resize (VisPluginData *plugin, int width, int height) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_corona_resize(VisPluginData *plugin, int width, int height) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - delete priv->corona; - delete priv->pcyl; + delete priv->corona; + delete priv->pcyl; - priv->corona = new Corona(); - priv->pcyl = new PaletteCycler(PALETTEDATA, NB_PALETTES); - priv->tl.timeStamp = 0; - priv->tl.lastbeat = 0; - priv->tl.state = normal_state; + priv->corona = new Corona(); + priv->pcyl = new PaletteCycler(PALETTEDATA, NB_PALETTES); + priv->tl.timeStamp = 0; + priv->tl.lastbeat = 0; + priv->tl.state = normal_state; - priv->corona->setUpSurface(width, height); + priv->corona->setUpSurface(width, height); } -int lv_corona_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; +int lv_corona_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_corona_resize (plugin, ev.event.resize.width, ev.event.resize.height); + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_corona_resize(plugin, ev.event.resize.width, ev.event.resize.height); - break; + break; - default: - break; - } - } + default: + break; + } + } - return true; + return true; } -VisPalette *lv_corona_palette (VisPluginData *plugin) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +VisPalette *lv_corona_palette(VisPluginData *plugin) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - priv->pcyl->updateVisPalette (&priv->pal); + priv->pcyl->updateVisPalette(&priv->pal); - return &priv->pal; + return &priv->pal; } -void lv_corona_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_corona_render(VisPluginData *plugin, VisVideo *video, VisAudio *audio) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - float freq[2][256]; - float pcm[256]; - short freqdata[2][512]; // FIXME Move to floats - unsigned long timemilli = 0; + float freq[2][256]; + float pcm[256]; + short freqdata[2][512]; // FIXME Move to floats + unsigned long timemilli = 0; - LV::BufferPtr buffer = LV::Buffer::create (); - LV::BufferPtr pcmb = LV::Buffer::create (); + LV::BufferPtr buffer = LV::Buffer::create(); + LV::BufferPtr pcmb = LV::Buffer::create(); - pcmb->set (pcm, sizeof (pcm)); + pcmb->set(pcm, sizeof(pcm)); - audio->get_sample (pcmb, VISUAL_AUDIO_CHANNEL_LEFT); - buffer->set (freq[0], sizeof (freq[0])); - audio->get_spectrum_for_sample (buffer, pcmb, true); + audio->get_sample(pcmb, VISUAL_AUDIO_CHANNEL_LEFT); + buffer->set(freq[0], sizeof(freq[0])); + audio->get_spectrum_for_sample(buffer, pcmb, true); - audio->get_sample (pcmb, VISUAL_AUDIO_CHANNEL_RIGHT); - buffer->set (freq[1], sizeof (freq[1])); - audio->get_spectrum_for_sample (buffer, pcmb, true); + audio->get_sample(pcmb, VISUAL_AUDIO_CHANNEL_RIGHT); + buffer->set(freq[1], sizeof(freq[1])); + audio->get_spectrum_for_sample(buffer, pcmb, true); - for (unsigned int i = 0; i < 256; ++i) { - freqdata[0][i*2] = freq[0][i]; - freqdata[1][i*2] = freq[1][i]; - freqdata[0][i*2+1] = freq[0][i]; - freqdata[1][i*2+1] = freq[1][i]; - } + for (unsigned int i = 0; i < 256; ++i) { + freqdata[0][i * 2] = freq[0][i]; + freqdata[1][i * 2] = freq[1][i]; + freqdata[0][i * 2 + 1] = freq[0][i]; + freqdata[1][i * 2 + 1] = freq[1][i]; + } - LV::Time curtime = LV::Time::now (); - LV::Time difftime = curtime - priv->oldtime; + LV::Time curtime = LV::Time::now(); + LV::Time difftime = curtime - priv->oldtime; - timemilli = difftime.to_msecs (); + timemilli = difftime.to_msecs(); - priv->tl.timeStamp += timemilli; - priv->oldtime = curtime; + priv->tl.timeStamp += timemilli; + priv->oldtime = curtime; - for (unsigned int i = 0; i < 512; ++i) { - priv->tl.frequency[0][i] = freqdata[0][i] * 32768; - priv->tl.frequency[1][i] = freqdata[1][i] * 32768; - } + for (unsigned int i = 0; i < 512; ++i) { + priv->tl.frequency[0][i] = freqdata[0][i] * 32768; + priv->tl.frequency[1][i] = freqdata[1][i] * 32768; + } - priv->corona->update(&priv->tl); // Update Corona - priv->pcyl->update(&priv->tl); // Update Palette Cycler + priv->corona->update(&priv->tl); // Update Corona + priv->pcyl->update(&priv->tl); // Update Palette Cycler - LV::VideoPtr vidcorona = LV::Video::wrap (priv->corona->getSurface (), - false, - video->get_width (), - video->get_height (), - VISUAL_VIDEO_DEPTH_8BIT); - video->mirror (vidcorona, VISUAL_VIDEO_MIRROR_Y); + LV::VideoPtr vidcorona = + LV::Video::wrap(priv->corona->getSurface(), false, video->get_width(), + video->get_height(), VISUAL_VIDEO_DEPTH_8BIT); + video->mirror(vidcorona, VISUAL_VIDEO_MIRROR_Y); } } // anonymous namespace - diff --git a/libvisual-plugins/plugins/actor/corona/autopal.h b/libvisual-plugins/plugins/actor/corona/autopal.h index f124561d4..e8a1223d8 100644 --- a/libvisual-plugins/plugins/actor/corona/autopal.h +++ b/libvisual-plugins/plugins/actor/corona/autopal.h @@ -1,5 +1,5 @@ - /* Libvisual-plugins - Standard plugins for libvisual - * +/* Libvisual-plugins - Standard plugins for libvisual + * * Copyright (C) 2000, 2001 Richard Ashburn * * Authors: Richard Ashburn @@ -23,34 +23,44 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -{ 4, 85, 0xff0000, 170, 0xffff00, 224, 0xffffff, 240, 0xf8f8e0 }, /* 0 */ - { 3, 85, 0x0000ff, 170, 0x00ffff, 255, 0xffffff }, /* 1 */ - { 1, 255, 0xffffff }, /* 2 */ - { 2, 128, 0xffffff, 255, 0x0000ff }, /* 3 */ - { 2, 128, 0x808080, 255, 0x0000ff }, /* 4 */ - { 2, 128, 0xffff80, 255, 0x0000ff }, /* 5 */ - { 2, 128, 0xffffff, 255, 0xff0000 }, /* 6 */ - { 2, 128, 0x0000ff, 255, 0xff0000 }, /* 7 */ - { 2, 128, 0xff0000, 255, 0x0000ff }, /* 8 */ - { 2, 128, 0x0000ff, 255, 0xffffff }, /* 9 */ - { 2, 128, 0xffffff, 255, 0x000000 }, /* 10 */ - { 2, 128, 0x0000ff, 255, 0x000000 }, /* 11 */ - { 2, 128, 0xff0000, 255, 0x000000 }, /* 12 */ - { 6, 32, 0x0000ff, 64, 0x000000, 96, 0x0000ff, 128, 0x000000, 192, 0x0000ff, 255, 0x000000 }, /* 13 */ - { 6, 32, 0xffffff, 64, 0x000000, 96, 0xffffff, 128, 0x000000, 192, 0xffffff, 255, 0x000000 }, /* 14 */ - { 3, 0, 0x000020, 128, 0x000040, 255, 0xffffff }, /* 15 */ - { 2, 128, 0xff8080, 255, 0x0000ff }, /* 16 */ - { 2, 0, 0xffffff, 255, 0x000000 }, /* 17 */ - { 3, 0, 0xffffff, 128, 0x000000, 255, 0xffffff }, /* 18 */ - { 3, 0, 0xffffff, 128, 0x000000, 255, 0xc0c0ff }, /* 19 */ - { 4, 120, 0x000078, 128, 0xff0000, 136, 0x000088, 255, 0x0000ff }, /* 20 */ - { 2, 0, 0xffe0a0, 255, 0x000000 }, /* 21 */ - { 3, 0, 0xc0c0ff, 128, 0xa0a0a0, 255, 0xffffff }, /* 22 */ - { 4, 0, 0xbfa878, 160, 0x000000, 224, 0x0000ff, 255, 0x000000 }, /* 23 */ - { 8, 0, 0xffffff, 64, 0x000000, 96, 0xc0c0ff, 160, 0x000000, 216, 0xffe0a0, 224, 0xffffd8, 232, 0xffe0a0, 255, 0x000000 }, /* 24 */ - { 6, 85, 0xd45454, 128, 0xffc07f, 170, 0xd4d47f, 224, 0x9e9eff, 240, 0x8b8bef, 255, 0x7c7cef }, /* 25 */ - { 7, 0, 0xffffff, 64, 0x3f3f3f, 96, 0x7f7f9f, 128, 0x30303f, 160, 0x181820, 224, 0xc8b8b0, 255, 0x60607f }, /* 26 */ - { 10, 32, 0xaf7f7f, 64, 0x600000, 85, 0xd35353, 96, 0xff907f, 128, 0x7f4000, 170, 0xd3d353, 192, 0xffffb3, 224, 0xbebebe, 240, 0x9a9a8e, 255, 0x7c7c70 }, /* 27 */ - { 5, 0, 0xffe0a0, 96, 0x9f8c64, 128, 0x9f4632, 176, 0x312319, 255, 0x000000 }, /* 28 */ - { 3, 0, 0xffffff, 128, 0x000000, 255, 0xffc0e0 }, /* 29 */ - { 4, 0, 0xffffff, 128, 0x808080, 160, 0x600000, 224, 0x000000 } /* 30 */ +{4, 85, 0xff0000, 170, 0xffff00, 224, 0xffffff, 240, 0xf8f8e0}, /* 0 */ + {3, 85, 0x0000ff, 170, 0x00ffff, 255, 0xffffff}, /* 1 */ + {1, 255, 0xffffff}, /* 2 */ + {2, 128, 0xffffff, 255, 0x0000ff}, /* 3 */ + {2, 128, 0x808080, 255, 0x0000ff}, /* 4 */ + {2, 128, 0xffff80, 255, 0x0000ff}, /* 5 */ + {2, 128, 0xffffff, 255, 0xff0000}, /* 6 */ + {2, 128, 0x0000ff, 255, 0xff0000}, /* 7 */ + {2, 128, 0xff0000, 255, 0x0000ff}, /* 8 */ + {2, 128, 0x0000ff, 255, 0xffffff}, /* 9 */ + {2, 128, 0xffffff, 255, 0x000000}, /* 10 */ + {2, 128, 0x0000ff, 255, 0x000000}, /* 11 */ + {2, 128, 0xff0000, 255, 0x000000}, /* 12 */ + {6, 32, 0x0000ff, 64, 0x000000, 96, 0x0000ff, + 128, 0x000000, 192, 0x0000ff, 255, 0x000000}, /* 13 */ + {6, 32, 0xffffff, 64, 0x000000, 96, 0xffffff, + 128, 0x000000, 192, 0xffffff, 255, 0x000000}, /* 14 */ + {3, 0, 0x000020, 128, 0x000040, 255, 0xffffff}, /* 15 */ + {2, 128, 0xff8080, 255, 0x0000ff}, /* 16 */ + {2, 0, 0xffffff, 255, 0x000000}, /* 17 */ + {3, 0, 0xffffff, 128, 0x000000, 255, 0xffffff}, /* 18 */ + {3, 0, 0xffffff, 128, 0x000000, 255, 0xc0c0ff}, /* 19 */ + {4, 120, 0x000078, 128, 0xff0000, 136, 0x000088, 255, 0x0000ff}, /* 20 */ + {2, 0, 0xffe0a0, 255, 0x000000}, /* 21 */ + {3, 0, 0xc0c0ff, 128, 0xa0a0a0, 255, 0xffffff}, /* 22 */ + {4, 0, 0xbfa878, 160, 0x000000, 224, 0x0000ff, 255, 0x000000}, /* 23 */ + {8, 0, 0xffffff, 64, 0x000000, 96, 0xc0c0ff, 160, 0x000000, 216, + 0xffe0a0, 224, 0xffffd8, 232, 0xffe0a0, 255, 0x000000}, /* 24 */ + {6, 85, 0xd45454, 128, 0xffc07f, 170, 0xd4d47f, + 224, 0x9e9eff, 240, 0x8b8bef, 255, 0x7c7cef}, /* 25 */ + {7, 0, 0xffffff, 64, 0x3f3f3f, 96, 0x7f7f9f, 128, + 0x30303f, 160, 0x181820, 224, 0xc8b8b0, 255, 0x60607f}, /* 26 */ + {10, 32, 0xaf7f7f, 64, 0x600000, 85, 0xd35353, 96, + 0xff907f, 128, 0x7f4000, 170, 0xd3d353, 192, 0xffffb3, 224, + 0xbebebe, 240, 0x9a9a8e, 255, 0x7c7c70}, /* 27 */ + {5, 0, 0xffe0a0, 96, 0x9f8c64, 128, + 0x9f4632, 176, 0x312319, 255, 0x000000}, /* 28 */ + {3, 0, 0xffffff, 128, 0x000000, 255, 0xffc0e0}, /* 29 */ +{ + 4, 0, 0xffffff, 128, 0x808080, 160, 0x600000, 224, 0x000000 +} /* 30 */ diff --git a/libvisual-plugins/plugins/actor/corona/corona.cpp b/libvisual-plugins/plugins/actor/corona/corona.cpp index 120f5bef9..95a33e3b7 100644 --- a/libvisual-plugins/plugins/actor/corona/corona.cpp +++ b/libvisual-plugins/plugins/actor/corona/corona.cpp @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Richard Ashburn * * Authors: Richard Ashburn @@ -39,479 +39,489 @@ using namespace std; - ///////////////////////////////////////////////////////////////////////////// // Corona::Corona // Constructor -Corona::Corona() -{ - m_clrForeground = 0x0000FF; - m_swirltime = 0; - m_testing = false; - m_silent = false; - m_avg = 1; - m_oldval = 0; - m_pos = 0; - - m_nPreset = PRESET_CORONA; - - m_image = 0; - m_real_image = 0; - m_deltafield = 0; - m_width = -1; - m_height = -1; - m_real_height = -1; - nbParticules = 1000; - m_reflArray = 0; - m_waveloop = 0.0; - - m_particles = visual_mem_new0 (Particle, nbParticules); - // Create particles in random positions - for (int i = nbParticules - 1; i >= 0; --i) - { - Particle *it = m_particles + i; - it->x = random(0, 1); - it->y = random(0, 1); - it->xvel = it->yvel = 0; - } - // Set up the background swirling effect - chooseRandomSwirl(); +Corona::Corona() { + m_clrForeground = 0x0000FF; + m_swirltime = 0; + m_testing = false; + m_silent = false; + m_avg = 1; + m_oldval = 0; + m_pos = 0; + + m_nPreset = PRESET_CORONA; + + m_image = 0; + m_real_image = 0; + m_deltafield = 0; + m_width = -1; + m_height = -1; + m_real_height = -1; + nbParticules = 1000; + m_reflArray = 0; + m_waveloop = 0.0; + + m_particles = visual_mem_new0(Particle, nbParticules); + // Create particles in random positions + for (int i = nbParticules - 1; i >= 0; --i) { + Particle *it = m_particles + i; + it->x = random(0, 1); + it->y = random(0, 1); + it->xvel = it->yvel = 0; + } + // Set up the background swirling effect + chooseRandomSwirl(); } ///////////////////////////////////////////////////////////////////////////// // Corona::~Corona // Destructor -Corona::~Corona() -{ - if (m_real_image) free(m_real_image); - if (m_deltafield) free(m_deltafield); - visual_mem_free (m_particles); +Corona::~Corona() { + if (m_real_image) + free(m_real_image); + if (m_deltafield) + free(m_deltafield); + visual_mem_free(m_particles); } double Corona::random(double min, double max) const { - return LV::rand() * (max - min) / std::numeric_limits::max() + min; + return LV::rand() * (max - min) / std::numeric_limits::max() + min; } bool Corona::setUpSurface(int width, int height) { - // Delete any image that might have previously been allocated - if (m_real_image) free(m_real_image); - if (m_deltafield) free(m_deltafield); - if (m_reflArray) free(m_reflArray); - - // Fill in the size details in the BitmapInfo structure - m_width = width; - m_height = (height*4) / 5; - m_real_height = height; - - // Allocate the image data - m_real_image = (unsigned char *)calloc(1,width*height); - if (m_real_image == 0) return false; - m_image = m_real_image + m_width * (m_real_height - m_height); - m_reflArray = (int*)malloc((m_real_height - m_height) + m_width); - - // Allocate the delta-field memory, and initialise it - m_deltafield = (unsigned char**)malloc(m_width * m_height * sizeof(unsigned char*)); - - for (int x = 0; x < m_width; ++x) { - for (int y = 0; y < m_height; ++y) { - setPointDelta(x, y); - } - } - - // Change the number of particles - int newsize = (int) (sqrt(float(m_width * m_height)) * 3.0); - if (newsize < 2000) newsize = 2000; - int oldsize = (int) nbParticules; - nbParticules = newsize; - m_particles = (Particle*) visual_mem_realloc(m_particles, sizeof(Particle) * newsize); - for (int i = oldsize; i < newsize; ++i) { - m_particles[i].x = random(0, 1); - m_particles[i].y = random(0, 1); - m_particles[i].xvel = m_particles[i].yvel = 0; - } - - return true; + // Delete any image that might have previously been allocated + if (m_real_image) + free(m_real_image); + if (m_deltafield) + free(m_deltafield); + if (m_reflArray) + free(m_reflArray); + + // Fill in the size details in the BitmapInfo structure + m_width = width; + m_height = (height * 4) / 5; + m_real_height = height; + + // Allocate the image data + m_real_image = (unsigned char *)calloc(1, width * height); + if (m_real_image == 0) + return false; + m_image = m_real_image + m_width * (m_real_height - m_height); + m_reflArray = (int *)malloc((m_real_height - m_height) + m_width); + + // Allocate the delta-field memory, and initialise it + m_deltafield = + (unsigned char **)malloc(m_width * m_height * sizeof(unsigned char *)); + + for (int x = 0; x < m_width; ++x) { + for (int y = 0; y < m_height; ++y) { + setPointDelta(x, y); + } + } + + // Change the number of particles + int newsize = (int)(sqrt(float(m_width * m_height)) * 3.0); + if (newsize < 2000) + newsize = 2000; + int oldsize = (int)nbParticules; + nbParticules = newsize; + m_particles = + (Particle *)visual_mem_realloc(m_particles, sizeof(Particle) * newsize); + for (int i = oldsize; i < newsize; ++i) { + m_particles[i].x = random(0, 1); + m_particles[i].y = random(0, 1); + m_particles[i].xvel = m_particles[i].yvel = 0; + } + + return true; } -void Corona::drawLine(int x0, int y0, int x1, int y1, unsigned char col) -{ - int incx = (x1 > x0) ? 1 : -1; - int incy = (y1 > y0) ? m_width : -m_width; - int dincx = 2 * abs(y1 - y0); - int dincy = 2 * abs(x1 - x0); - unsigned char* p = &(m_image[x0 + y0 * m_width]); - unsigned char* const end = &(m_image[m_width + (m_height - 1) * m_width]); - unsigned char* const start = m_image; - int n, d; // n is the "pixel counter" - - // Always draw at least one pixel - if (start <= p && p < end) *p = col; - - if (abs(x1 - x0) > abs(y1 - y0)) { - d = x0 - x1; - for (n = abs(x1 - x0); n > 0; --n, p += incx) { - if (start <= p && p < end) *p = col; - d += dincx; - if (d > 0) { - p += incy; - d -= dincy; - } - } - } - else { - d = y0 - y1; - for (n = abs(y1 - y0); n > 0; --n, p += incy) { - if (start <= p && p < end) *p = col; - d += dincy; - if (d > 0) { - p += incx; - d -= dincx; - } - } - } +void Corona::drawLine(int x0, int y0, int x1, int y1, unsigned char col) { + int incx = (x1 > x0) ? 1 : -1; + int incy = (y1 > y0) ? m_width : -m_width; + int dincx = 2 * abs(y1 - y0); + int dincy = 2 * abs(x1 - x0); + unsigned char *p = &(m_image[x0 + y0 * m_width]); + unsigned char *const end = &(m_image[m_width + (m_height - 1) * m_width]); + unsigned char *const start = m_image; + int n, d; // n is the "pixel counter" + + // Always draw at least one pixel + if (start <= p && p < end) + *p = col; + + if (abs(x1 - x0) > abs(y1 - y0)) { + d = x0 - x1; + for (n = abs(x1 - x0); n > 0; --n, p += incx) { + if (start <= p && p < end) + *p = col; + d += dincx; + if (d > 0) { + p += incy; + d -= dincy; + } + } + } else { + d = y0 - y1; + for (n = abs(y1 - y0); n > 0; --n, p += incy) { + if (start <= p && p < end) + *p = col; + d += dincy; + if (d > 0) { + p += incx; + d -= dincx; + } + } + } } - -void Corona::chooseRandomSwirl() -{ - m_swirl.x = random(0.2, 0.8); - m_swirl.y = random(0.2, 0.8); - m_swirl.tightness = random(-0.01, 0.01); - m_swirl.pull = random(1.0, 1.04); +void Corona::chooseRandomSwirl() { + m_swirl.x = random(0.2, 0.8); + m_swirl.y = random(0.2, 0.8); + m_swirl.tightness = random(-0.01, 0.01); + m_swirl.pull = random(1.0, 1.04); } // FIXME: inline, optimize, simd -void Corona::setPointDelta(int x, int y) -{ - /* FIXME calculate using fixed point ? */ - double tx = ((double) x / m_width) - m_swirl.x; - double ty = ((double) y / m_height) - m_swirl.y; - double d = tx * tx + ty * ty; - double ds = ::sqrt(d); - double ang = atan2(ty, tx) + m_swirl.tightness / (d + 0.01); - int dx = (int) ((ds * m_swirl.pull * cos(ang) - tx) * m_width) + LV::rand() % 5 - 2; - int dy = (int) ((ds * m_swirl.pull * sin(ang) - ty) * m_height) + LV::rand() % 5 - 2; - if (x + dx < 0) dx = -dx - x; - if (x + dx >= m_width) dx = 2 * m_width - 2 * x - dx - 1; - if (y + dy < 0) dy = -dy - y; - if (y + dy >= m_height) dy = 2 * m_height - 2 * y - dy - 1; - m_deltafield[x + y * m_width] = &(m_image[x + dx + (y + dy) * m_width]); +void Corona::setPointDelta(int x, int y) { + /* FIXME calculate using fixed point ? */ + double tx = ((double)x / m_width) - m_swirl.x; + double ty = ((double)y / m_height) - m_swirl.y; + double d = tx * tx + ty * ty; + double ds = ::sqrt(d); + double ang = atan2(ty, tx) + m_swirl.tightness / (d + 0.01); + int dx = + (int)((ds * m_swirl.pull * cos(ang) - tx) * m_width) + LV::rand() % 5 - 2; + int dy = (int)((ds * m_swirl.pull * sin(ang) - ty) * m_height) + + LV::rand() % 5 - 2; + if (x + dx < 0) + dx = -dx - x; + if (x + dx >= m_width) + dx = 2 * m_width - 2 * x - dx - 1; + if (y + dy < 0) + dy = -dy - y; + if (y + dy >= m_height) + dy = 2 * m_height - 2 * y - dy - 1; + m_deltafield[x + y * m_width] = &(m_image[x + dx + (y + dy) * m_width]); } -void Corona::applyDeltaField(bool heavy) -{ - /* FIXME MMXify */ - if (heavy) { - for (int y = 0; y < m_height; ++y) { - unsigned char *s = &(m_image[y * m_width]); - unsigned char **p = &(m_deltafield[y * m_width]); - for (int x = 0; x < m_width; ++x, ++s, ++p) { - *s = (*s + *(*p)) >> 1; - if (*s >= 2) *s -= 2; - } - } - } - else { - for (int y = 0; y < m_height; ++y) { - unsigned char *s = &(m_image[y * m_width]); - unsigned char **p = &(m_deltafield[y * m_width]); - for (int x = 0; x < m_width; ++x, ++s, ++p) { - *s = (*s + **p) >> 1; - if (*s >= 1) *s -= 1; - } - } - } +void Corona::applyDeltaField(bool heavy) { + /* FIXME MMXify */ + if (heavy) { + for (int y = 0; y < m_height; ++y) { + unsigned char *s = &(m_image[y * m_width]); + unsigned char **p = &(m_deltafield[y * m_width]); + for (int x = 0; x < m_width; ++x, ++s, ++p) { + *s = (*s + *(*p)) >> 1; + if (*s >= 2) + *s -= 2; + } + } + } else { + for (int y = 0; y < m_height; ++y) { + unsigned char *s = &(m_image[y * m_width]); + unsigned char **p = &(m_deltafield[y * m_width]); + for (int x = 0; x < m_width; ++x, ++s, ++p) { + *s = (*s + **p) >> 1; + if (*s >= 1) + *s -= 1; + } + } + } } -int Corona::getBeatVal(TimedLevel *tl) -{ - int total = 0; - for (int i = 50; i < 250; ++i) { - int n = tl->frequency[0][i]; - total += n; - } - total /= 3; - - m_avg = 0.9 * m_avg + 0.1 * total; - if (m_avg < 1000) m_avg = 1000; - - if (total > m_avg * 1.2 && tl->timeStamp - tl->lastbeat > 750) { - m_avg = total; - tl->lastbeat = tl->timeStamp; - if (total > 2500) return 2500; - else return total; - } - else return 0; +int Corona::getBeatVal(TimedLevel *tl) { + int total = 0; + for (int i = 50; i < 250; ++i) { + int n = tl->frequency[0][i]; + total += n; + } + total /= 3; + + m_avg = 0.9 * m_avg + 0.1 * total; + if (m_avg < 1000) + m_avg = 1000; + + if (total > m_avg * 1.2 && tl->timeStamp - tl->lastbeat > 750) { + m_avg = total; + tl->lastbeat = tl->timeStamp; + if (total > 2500) + return 2500; + else + return total; + } else + return 0; } -void Corona::drawParticules() -{ - int p; - for (p = 0; p < nbParticules; ++p) { - Particle *it = m_particles + p; - int x = (int) (it->x * m_width); - int y = (int) (it->y * m_height); - int xv = (int) (it->xvel * m_width); - int yv = (int) (it->yvel * m_height); - drawLine(x, y, x - xv, y - yv, 255); - } +void Corona::drawParticules() { + int p; + for (p = 0; p < nbParticules; ++p) { + Particle *it = m_particles + p; + int x = (int)(it->x * m_width); + int y = (int)(it->y * m_height); + int xv = (int)(it->xvel * m_width); + int yv = (int)(it->yvel * m_height); + drawLine(x, y, x - xv, y - yv, 255); + } } -void Corona::drawParticulesWithShift() -{ - int p; - for (p = 0; p < nbParticules; ++p) { - Particle *it = m_particles + p; - int x = (int) (it->x * m_width); - int y = (int) (it->y * m_height); - int xv = (int) (it->xvel * m_width); - int yv = (int) (it->yvel * m_height); - double l = (xv * xv + yv * yv); - if (l > 10.0 * 10.0) { - l = ::sqrt(l); - double dl = 10 / (l + 0.01); - xv = (int) (xv * dl); - yv = (int) (yv * dl); - } - drawLine(x, y, x - xv, y - yv, 255); - } +void Corona::drawParticulesWithShift() { + int p; + for (p = 0; p < nbParticules; ++p) { + Particle *it = m_particles + p; + int x = (int)(it->x * m_width); + int y = (int)(it->y * m_height); + int xv = (int)(it->xvel * m_width); + int yv = (int)(it->yvel * m_height); + double l = (xv * xv + yv * yv); + if (l > 10.0 * 10.0) { + l = ::sqrt(l); + double dl = 10 / (l + 0.01); + xv = (int)(xv * dl); + yv = (int)(yv * dl); + } + drawLine(x, y, x - xv, y - yv, 255); + } } -void Corona::getAvgParticlePos(double& x, double& y) const -{ - x = y = 0; - for (int i = 0; i < 10; ++i) { - int r = LV::rand() % nbParticules; - x += m_particles[r].x; - y += m_particles[r].y; - } - x /= 10; - y /= 10; +void Corona::getAvgParticlePos(double &x, double &y) const { + x = y = 0; + for (int i = 0; i < 10; ++i) { + int r = LV::rand() % nbParticules; + x += m_particles[r].x; + y += m_particles[r].y; + } + x /= 10; + y /= 10; } #define REFL_MIN_WIDTH 3.0 #define REFL_INC_WIDTH 0.08 -void Corona::genReflectedWaves(double loop) -{ - double fdec = 0.0; - double floop = 0.0; - double fwidth = (m_real_height - m_height) * REFL_INC_WIDTH + REFL_MIN_WIDTH; - double REFL_MAX_WIDTH = fwidth; - - // int *reflArray; - // reflArray = new int[(m_real_height - m_height) + m_width]; - - for (int i = 0; i < m_real_height - m_height; ++i) - { - double fincr = (3.1415 / 2.0) * (1.0 - (fwidth - REFL_MIN_WIDTH) / REFL_MAX_WIDTH); - floop += fincr; - - fwidth -= REFL_INC_WIDTH; - fdec = fwidth * sin(floop + loop); - m_reflArray[i] = (int)fdec; - } +void Corona::genReflectedWaves(double loop) { + double fdec = 0.0; + double floop = 0.0; + double fwidth = (m_real_height - m_height) * REFL_INC_WIDTH + REFL_MIN_WIDTH; + double REFL_MAX_WIDTH = fwidth; + + // int *reflArray; + // reflArray = new int[(m_real_height - m_height) + m_width]; + + for (int i = 0; i < m_real_height - m_height; ++i) { + double fincr = + (3.1415 / 2.0) * (1.0 - (fwidth - REFL_MIN_WIDTH) / REFL_MAX_WIDTH); + floop += fincr; + + fwidth -= REFL_INC_WIDTH; + fdec = fwidth * sin(floop + loop); + m_reflArray[i] = (int)fdec; + } } -void Corona::drawReflected() -{ - genReflectedWaves(m_waveloop); - int offsetDest = (m_real_height - m_height - 1) * m_width; - int offsetSrc = (m_real_height - m_height) * m_width; - - for (int i = m_real_height - m_height; i--;) - { - int idec = m_reflArray[i]; - - for (int x = m_width; x--;) - { - int out = m_real_image[(offsetSrc++) + idec]; - m_real_image[offsetDest++] = out; - } - - offsetDest -= m_width * 2; - offsetSrc += m_width; - } +void Corona::drawReflected() { + genReflectedWaves(m_waveloop); + int offsetDest = (m_real_height - m_height - 1) * m_width; + int offsetSrc = (m_real_height - m_height) * m_width; + + for (int i = m_real_height - m_height; i--;) { + int idec = m_reflArray[i]; + + for (int x = m_width; x--;) { + int out = m_real_image[(offsetSrc++) + idec]; + m_real_image[offsetDest++] = out; + } + + offsetDest -= m_width * 2; + offsetSrc += m_width; + } } -void Corona::blurImage() -{ - uint8_t *ptr = m_real_image + m_width; - int n = (m_real_height - 2) * m_width; +void Corona::blurImage() { + uint8_t *ptr = m_real_image + m_width; + int n = (m_real_height - 2) * m_width; - if (visual_cpu_has_mmx ()) { + if (visual_cpu_has_mmx()) { #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) - __asm __volatile - ("pxor %%mm6, %%mm6" - ::); - - while (n -= 4) { - __asm __volatile - ("\n\t movd %[dest], %%mm0" - "\n\t movd %[pix2], %%mm1" - "\n\t punpcklbw %%mm6, %%mm0" - "\n\t movd %[pix3], %%mm2" - "\n\t punpcklbw %%mm6, %%mm1" - "\n\t movd %[pix4], %%mm3" - "\n\t punpcklbw %%mm6, %%mm2" - "\n\t movd %[pix5], %%mm4" - "\n\t punpcklbw %%mm6, %%mm3" - "\n\t paddw %%mm1, %%mm2" - "\n\t punpcklbw %%mm6, %%mm4" - "\n\t paddw %%mm3, %%mm2" - "\n\t paddw %%mm2, %%mm4" - "\n\t psrlw $2, %%mm4" - "\n\t packuswb %%mm6, %%mm4" - "\n\t movd %%mm4, %[dest]" - :: [dest] "m" (*(ptr)) - , [pix2] "m" (*(ptr - m_width)) - , [pix3] "m" (*(ptr - 1)) - , [pix4] "m" (*(ptr + 1)) - , [pix5] "m" (*(ptr + m_width))); - ptr += 4; - } - - __asm __volatile - ("\n\t emms"); + __asm __volatile("pxor %%mm6, %%mm6" ::); + + while (n -= 4) { + __asm __volatile("\n\t movd %[dest], %%mm0" + "\n\t movd %[pix2], %%mm1" + "\n\t punpcklbw %%mm6, %%mm0" + "\n\t movd %[pix3], %%mm2" + "\n\t punpcklbw %%mm6, %%mm1" + "\n\t movd %[pix4], %%mm3" + "\n\t punpcklbw %%mm6, %%mm2" + "\n\t movd %[pix5], %%mm4" + "\n\t punpcklbw %%mm6, %%mm3" + "\n\t paddw %%mm1, %%mm2" + "\n\t punpcklbw %%mm6, %%mm4" + "\n\t paddw %%mm3, %%mm2" + "\n\t paddw %%mm2, %%mm4" + "\n\t psrlw $2, %%mm4" + "\n\t packuswb %%mm6, %%mm4" + "\n\t movd %%mm4, %[dest]" ::[dest] "m"(*(ptr)), + [pix2] "m"(*(ptr - m_width)), [pix3] "m"(*(ptr - 1)), + [pix4] "m"(*(ptr + 1)), [pix5] "m"(*(ptr + m_width))); + ptr += 4; + } + + __asm __volatile("\n\t emms"); #endif - } else { - while (n--) { - int val = *(ptr + 1); - val += *(ptr - 1); - val += *(ptr - m_width); - val += *(ptr + m_width); - val >>= 2; - - *(ptr++) = val; - } - } + } else { + while (n--) { + int val = *(ptr + 1); + val += *(ptr - 1); + val += *(ptr - m_width); + val += *(ptr + m_width); + val >>= 2; + + *(ptr++) = val; + } + } } -void Corona::update(TimedLevel *pLevels) -{ - // Check for a beat - int beatval = getBeatVal(pLevels); - if (beatval > 1000) - { - int total = 0; - for (int i = 0; i < 512; ++i) - total += 2 * pLevels->frequency[0][i]; - double currval = 1.0 - exp(-total / 40000.0); - m_oldval = (m_oldval + currval) / 2.0; - - double tx, ty; - getAvgParticlePos(tx, ty); - // If most of the particles are low down, use a launch - if (ty < 0.2 && LV::rand() % 4 != 0) { - int p; - double bv = m_oldval * 5.0; - for (p = 0; p < nbParticules; ++p) - { - Particle *it = m_particles + p; - if (it->y < 0.1) { - double x = (it->x - tx) / bv; - it->yvel += 0.01 * bv * exp(-1000.0 * x * x); - } - } - } - else - { // Otherwise use a swirl - tx += random(-0.1, 0.1); - ty += random(-0.1, 0.1); - double bv = 0.009 * m_oldval; - double bv2 = 0.0036 * m_oldval; - if (LV::rand() % 2 == 0) bv = -bv; - m_movement.x = tx; - m_movement.y = ty; - m_movement.tightness = random(0.8 * bv, bv); - m_movement.pull = random(1 - bv2, 1 - 0.2 * bv2); - m_swirltime = 1; - } - - pLevels->lastbeat = pLevels->timeStamp; - } - - // Deal with the particles - int p; - for (p = 0; p < nbParticules; ++p) - { - Particle *it = m_particles + p; - // Apply gravity - it->yvel -= 0.0006; // the gravity value - - // If there's an active swirl, swirl around it - if (m_swirltime > 0) { - double dx = it->x - m_movement.x; - double dy = it->y - m_movement.y; - double d = dx * dx + dy * dy; - double ds = ::sqrt(d); - double ang = atan2(dy, dx) + m_movement.tightness / (d + 0.01); - it->xvel += (ds * m_movement.pull * cos(ang) - dx); - it->yvel += (ds * m_movement.pull * sin(ang) - dy); - } - - // Gitter - it->xvel += random(-0.0002, 0.0002); - it->yvel += random(-0.0002, 0.0002); - - // Clamp the velocity - if (it->xvel < -0.1 ) it->xvel = -0.1; - if (it->xvel > 0.1 ) it->xvel = 0.1; - if (it->yvel < -0.1 ) it->yvel = -0.1; - if (it->yvel > 0.1 ) it->yvel = 0.1; - - // Randomly move the particle once in a while - if (LV::rand() % (nbParticules / 5) == 0) - { - it->x = random(0, 1); - it->y = random(0, 1); - it->xvel = it->yvel = 0; - } - - // Move and bounce the particle - it->x += it->xvel; - it->y += it->yvel; - if (it->x < 0) { it->x = -it->x; it->xvel *= -0.25; it->yvel *= 0.25; } - if (it->y < 0) { it->y = -it->y; it->xvel *= 0.25; it->yvel *= -0.25; } - if (it->x > 1) { it->x = 2.0 - it->x; it->xvel *= -0.25; it->yvel *= 0.25; } - if (it->y > 1) { it->y = 2.0 - it->y; it->xvel *= 0.25; it->yvel = 0; } - } - - if (m_swirltime > 0) --m_swirltime; - - // Randomly change the delta field - if (LV::rand() % 200 == 0) chooseRandomSwirl(); - - // Animate the waves - m_waveloop += 0.6; - - // drawing. - if (m_image != 0) - { - // Draw the particles on the bitmap - drawParticules(); - - // Apply the deltafield and update a few of its points - applyDeltaField(m_nPreset == PRESET_BLAZE && m_width * m_height < 150000); - - int n = (m_width * m_height) / 100; - for (int i = 0; i < n; ++i) - setPointDelta(LV::rand() % m_width, LV::rand() % m_height); - - // If on the blaze preset, draw the particles again - if (m_nPreset == PRESET_BLAZE) - drawParticules(); - - drawReflected(); - - // Blur the bitmap - blurImage(); - - // If on the blaze preset, draw the particles one last time - if (m_nPreset == PRESET_BLAZE) - drawParticulesWithShift(); - } +void Corona::update(TimedLevel *pLevels) { + // Check for a beat + int beatval = getBeatVal(pLevels); + if (beatval > 1000) { + int total = 0; + for (int i = 0; i < 512; ++i) + total += 2 * pLevels->frequency[0][i]; + double currval = 1.0 - exp(-total / 40000.0); + m_oldval = (m_oldval + currval) / 2.0; + + double tx, ty; + getAvgParticlePos(tx, ty); + // If most of the particles are low down, use a launch + if (ty < 0.2 && LV::rand() % 4 != 0) { + int p; + double bv = m_oldval * 5.0; + for (p = 0; p < nbParticules; ++p) { + Particle *it = m_particles + p; + if (it->y < 0.1) { + double x = (it->x - tx) / bv; + it->yvel += 0.01 * bv * exp(-1000.0 * x * x); + } + } + } else { // Otherwise use a swirl + tx += random(-0.1, 0.1); + ty += random(-0.1, 0.1); + double bv = 0.009 * m_oldval; + double bv2 = 0.0036 * m_oldval; + if (LV::rand() % 2 == 0) + bv = -bv; + m_movement.x = tx; + m_movement.y = ty; + m_movement.tightness = random(0.8 * bv, bv); + m_movement.pull = random(1 - bv2, 1 - 0.2 * bv2); + m_swirltime = 1; + } + + pLevels->lastbeat = pLevels->timeStamp; + } + + // Deal with the particles + int p; + for (p = 0; p < nbParticules; ++p) { + Particle *it = m_particles + p; + // Apply gravity + it->yvel -= 0.0006; // the gravity value + + // If there's an active swirl, swirl around it + if (m_swirltime > 0) { + double dx = it->x - m_movement.x; + double dy = it->y - m_movement.y; + double d = dx * dx + dy * dy; + double ds = ::sqrt(d); + double ang = atan2(dy, dx) + m_movement.tightness / (d + 0.01); + it->xvel += (ds * m_movement.pull * cos(ang) - dx); + it->yvel += (ds * m_movement.pull * sin(ang) - dy); + } + + // Gitter + it->xvel += random(-0.0002, 0.0002); + it->yvel += random(-0.0002, 0.0002); + + // Clamp the velocity + if (it->xvel < -0.1) + it->xvel = -0.1; + if (it->xvel > 0.1) + it->xvel = 0.1; + if (it->yvel < -0.1) + it->yvel = -0.1; + if (it->yvel > 0.1) + it->yvel = 0.1; + + // Randomly move the particle once in a while + if (LV::rand() % (nbParticules / 5) == 0) { + it->x = random(0, 1); + it->y = random(0, 1); + it->xvel = it->yvel = 0; + } + + // Move and bounce the particle + it->x += it->xvel; + it->y += it->yvel; + if (it->x < 0) { + it->x = -it->x; + it->xvel *= -0.25; + it->yvel *= 0.25; + } + if (it->y < 0) { + it->y = -it->y; + it->xvel *= 0.25; + it->yvel *= -0.25; + } + if (it->x > 1) { + it->x = 2.0 - it->x; + it->xvel *= -0.25; + it->yvel *= 0.25; + } + if (it->y > 1) { + it->y = 2.0 - it->y; + it->xvel *= 0.25; + it->yvel = 0; + } + } + + if (m_swirltime > 0) + --m_swirltime; + + // Randomly change the delta field + if (LV::rand() % 200 == 0) + chooseRandomSwirl(); + + // Animate the waves + m_waveloop += 0.6; + + // drawing. + if (m_image != 0) { + // Draw the particles on the bitmap + drawParticules(); + + // Apply the deltafield and update a few of its points + applyDeltaField(m_nPreset == PRESET_BLAZE && m_width * m_height < 150000); + + int n = (m_width * m_height) / 100; + for (int i = 0; i < n; ++i) + setPointDelta(LV::rand() % m_width, LV::rand() % m_height); + + // If on the blaze preset, draw the particles again + if (m_nPreset == PRESET_BLAZE) + drawParticules(); + + drawReflected(); + + // Blur the bitmap + blurImage(); + + // If on the blaze preset, draw the particles one last time + if (m_nPreset == PRESET_BLAZE) + drawParticulesWithShift(); + } } - diff --git a/libvisual-plugins/plugins/actor/corona/corona.h b/libvisual-plugins/plugins/actor/corona/corona.h index 78d802412..cec8bc399 100644 --- a/libvisual-plugins/plugins/actor/corona/corona.h +++ b/libvisual-plugins/plugins/actor/corona/corona.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Richard Ashburn * * Authors: Richard Ashburn @@ -35,97 +35,88 @@ #include "corona_types.h" // presets -enum { - PRESET_CORONA = 0, - PRESET_BLAZE, - PRESET_COUNT -}; +enum { PRESET_CORONA = 0, PRESET_BLAZE, PRESET_COUNT }; // The particles -struct Particle -{ +struct Particle { double x, y, xvel, yvel; }; // The background swirl -struct Swirl -{ +struct Swirl { double x; double y; double tightness; double pull; }; - ///////////////////////////////////////////////////////////////////////////// // // Core Class of the Corona Visual FX // ///////////////////////////////////////////////////////////////////////////// -class Corona -{ - private: - int m_clrForeground; // foreground color - int m_nPreset; - - Particle *m_particles; - int nbParticules; - - // The off-screen buffer - unsigned char* m_image; - unsigned char* m_real_image; - - int m_width; - int m_height; - int m_real_height; - - Swirl m_swirl; - unsigned char** m_deltafield; - - // Particle movement info - int m_swirltime; - Swirl m_movement; - - bool m_testing; - bool m_silent; - - // Beat detection - double m_avg; - double m_oldval; - int m_pos; - - // Waves - double m_waveloop; - int *m_reflArray; - - // Implementation functions - double random(double min, double max) const; - // void setUpPalette(); - void drawLine(int x0, int y0, int x1, int y1, unsigned char col); - void drawParticules(); - void drawParticulesWithShift(); - void blurImage(); - void drawReflected(); - - void chooseRandomSwirl(); - void setPointDelta(int x, int y); - void applyDeltaField(bool heavy); - int getBeatVal(TimedLevel *tl); - void getAvgParticlePos(double& x, double& y) const; - void genReflectedWaves(double loop); - - - public: - Corona(); - ~Corona(); - - bool setUpSurface(int width, int height); - void update(TimedLevel *pLevels); - unsigned char *getSurface() const { return m_real_image; } - - int getWidth() const { return m_width; } - int getHeight() const { return m_real_height; } +class Corona { +private: + int m_clrForeground; // foreground color + int m_nPreset; + + Particle *m_particles; + int nbParticules; + + // The off-screen buffer + unsigned char *m_image; + unsigned char *m_real_image; + + int m_width; + int m_height; + int m_real_height; + + Swirl m_swirl; + unsigned char **m_deltafield; + + // Particle movement info + int m_swirltime; + Swirl m_movement; + + bool m_testing; + bool m_silent; + + // Beat detection + double m_avg; + double m_oldval; + int m_pos; + + // Waves + double m_waveloop; + int *m_reflArray; + + // Implementation functions + double random(double min, double max) const; + // void setUpPalette(); + void drawLine(int x0, int y0, int x1, int y1, unsigned char col); + void drawParticules(); + void drawParticulesWithShift(); + void blurImage(); + void drawReflected(); + + void chooseRandomSwirl(); + void setPointDelta(int x, int y); + void applyDeltaField(bool heavy); + int getBeatVal(TimedLevel *tl); + void getAvgParticlePos(double &x, double &y) const; + void genReflectedWaves(double loop); + +public: + Corona(); + ~Corona(); + + bool setUpSurface(int width, int height); + void update(TimedLevel *pLevels); + unsigned char *getSurface() const { return m_real_image; } + + int getWidth() const { return m_width; } + int getHeight() const { return m_real_height; } }; #endif //__CORONA_H_ diff --git a/libvisual-plugins/plugins/actor/corona/corona_types.h b/libvisual-plugins/plugins/actor/corona/corona_types.h index dccc7425a..0200cef09 100644 --- a/libvisual-plugins/plugins/actor/corona/corona_types.h +++ b/libvisual-plugins/plugins/actor/corona/corona_types.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Richard Ashburn * * Authors: Richard Ashburn @@ -31,8 +31,7 @@ // TIMED LEVEL // -struct TimedLevel -{ +struct TimedLevel { unsigned char frequency[2][512]; int state; unsigned int timeStamp; @@ -42,12 +41,10 @@ struct TimedLevel // COLOR // -struct ColorRGB -{ +struct ColorRGB { unsigned char rgbRed; unsigned char rgbGreen; unsigned char rgbBlue; }; - #endif diff --git a/libvisual-plugins/plugins/actor/corona/palette.cpp b/libvisual-plugins/plugins/actor/corona/palette.cpp index afc0c7ad5..3db983aa1 100644 --- a/libvisual-plugins/plugins/actor/corona/palette.cpp +++ b/libvisual-plugins/plugins/actor/corona/palette.cpp @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Richard Ashburn * * Authors: Richard Ashburn @@ -31,68 +31,68 @@ using namespace std; /////////////////////////////////////////////////////////////////////////////// - // Palette stored in compressed format (just checkpoints) -class CompressedPalette -{ - public: +class CompressedPalette { +public: ColorRGB m_col[16]; - int m_ind[16]; - int m_nb; + int m_ind[16]; + int m_nb; CompressedPalette() : m_nb(0) {} - void push_color(int i, ColorRGB col) { m_col[m_nb] = col; m_ind[m_nb++] = i; } + void push_color(int i, ColorRGB col) { + m_col[m_nb] = col; + m_ind[m_nb++] = i; + } void expand(Palette pal) const; }; /////////////////////////////////////////////////////////////////////////////// - + PaletteCycler::PaletteCycler(const int palettes[][NB_PALETTES], int nbPalettes) - : m_palettes(palettes, nbPalettes) -{ - visual_mem_set (m_srcpal, 0, sizeof (Palette)); - visual_mem_set (m_destpal, 0, sizeof (Palette)); - visual_mem_set (m_curpal, 0, sizeof (Palette)); + : m_palettes(palettes, nbPalettes) { + visual_mem_set(m_srcpal, 0, sizeof(Palette)); + visual_mem_set(m_destpal, 0, sizeof(Palette)); + visual_mem_set(m_curpal, 0, sizeof(Palette)); startPaletteTransition(); affectPaletteTransition(1); - m_transferring = false; - m_srcnum = m_destnum; + m_transferring = false; + m_srcnum = m_destnum; } -void PaletteCycler::startPaletteTransition() -{ - if (m_palettes.size() > 0) - { +void PaletteCycler::startPaletteTransition() { + if (m_palettes.size() > 0) { // Copy the current palette to the "source palette" visual_mem_copy(m_srcpal, m_curpal, sizeof(m_srcpal)); // Create a new palette as the "destination palette" - m_srcnum = m_destnum; - m_destnum = LV::rand() % (int) m_palettes.size(); + m_srcnum = m_destnum; + m_destnum = LV::rand() % (int)m_palettes.size(); m_palettes.expandPalette(m_destnum, m_destpal); // Begin the transition m_transferring = true; - m_progress = 0; + m_progress = 0; } } -void PaletteCycler::update(TimedLevel *pLevels) -{ +void PaletteCycler::update(TimedLevel *pLevels) { // Randomly change the destination palette if (pLevels->timeStamp - pLevels->lastbeat > 10000000) { - if (LV::rand() % 100 == 0) startPaletteTransition(); - } - else { - if (LV::rand() % 400 == 0) startPaletteTransition(); + if (LV::rand() % 100 == 0) + startPaletteTransition(); + } else { + if (LV::rand() % 400 == 0) + startPaletteTransition(); } // Continue any current palette transtion if (m_transferring) { - if (pLevels->timeStamp - pLevels->lastbeat > 10000000) m_progress += 0.01; - else m_progress += 0.005; + if (pLevels->timeStamp - pLevels->lastbeat > 10000000) + m_progress += 0.01; + else + m_progress += 0.005; if (m_progress >= 1) { m_transferring = false; m_progress = 1; @@ -100,106 +100,100 @@ void PaletteCycler::update(TimedLevel *pLevels) } // Use an inverse sigmoid transition to emphasise the midway palette double x; - if (m_progress < 0.5) x = 2 * m_progress * (1 - m_progress); - else x = 2 * m_progress * (m_progress - 1) + 1; + if (m_progress < 0.5) + x = 2 * m_progress * (1 - m_progress); + else + x = 2 * m_progress * (m_progress - 1) + 1; affectPaletteTransition(x); } } -void PaletteCycler::updateVisPalette (VisPalette *pal) -{ - for (int i = 0; i < 256; i++) { - pal->colors[i].r = m_curpal[i].rgbRed; - pal->colors[i].g = m_curpal[i].rgbGreen; - pal->colors[i].b = m_curpal[i].rgbBlue; - } +void PaletteCycler::updateVisPalette(VisPalette *pal) { + for (int i = 0; i < 256; i++) { + pal->colors[i].r = m_curpal[i].rgbRed; + pal->colors[i].g = m_curpal[i].rgbGreen; + pal->colors[i].b = m_curpal[i].rgbBlue; + } } -void PaletteCycler::affectPaletteTransition(double p) -{ - for (int i = 0; i < 256; ++i) - { +void PaletteCycler::affectPaletteTransition(double p) { + for (int i = 0; i < 256; ++i) { ColorRGB c1 = m_srcpal[i]; ColorRGB c2 = m_destpal[i]; - m_curpal[i].rgbRed = (unsigned char) ((1 - p) * c1.rgbRed + p * c2.rgbRed); - m_curpal[i].rgbGreen = (unsigned char) ((1 - p) * c1.rgbGreen + p * c2.rgbGreen); - m_curpal[i].rgbBlue = (unsigned char) ((1 - p) * c1.rgbBlue + p * c2.rgbBlue); + m_curpal[i].rgbRed = (unsigned char)((1 - p) * c1.rgbRed + p * c2.rgbRed); + m_curpal[i].rgbGreen = + (unsigned char)((1 - p) * c1.rgbGreen + p * c2.rgbGreen); + m_curpal[i].rgbBlue = + (unsigned char)((1 - p) * c1.rgbBlue + p * c2.rgbBlue); } } - - /////////////////////////////////////////////////////////////////////////////// -void CompressedPalette::expand(Palette dest) const -{ +void CompressedPalette::expand(Palette dest) const { ColorRGB col; int entry = 0; col.rgbBlue = col.rgbGreen = col.rgbRed = 0; int i = 0; - for (; i < m_nb; ++i) - { + for (; i < m_nb; ++i) { int j = entry; - for (; j < m_ind[i]; ++j) - { - double t = (double) (j - entry) / (m_ind[i] - entry); - dest[j].rgbRed = (unsigned char) ((1 - t) * col.rgbRed + t * m_col[i].rgbRed); - dest[j].rgbGreen = (unsigned char) ((1 - t) * col.rgbGreen + t * m_col[i].rgbGreen); - dest[j].rgbBlue = (unsigned char) ((1 - t) * col.rgbBlue + t * m_col[i].rgbBlue); + for (; j < m_ind[i]; ++j) { + double t = (double)(j - entry) / (m_ind[i] - entry); + dest[j].rgbRed = + (unsigned char)((1 - t) * col.rgbRed + t * m_col[i].rgbRed); + dest[j].rgbGreen = + (unsigned char)((1 - t) * col.rgbGreen + t * m_col[i].rgbGreen); + dest[j].rgbBlue = + (unsigned char)((1 - t) * col.rgbBlue + t * m_col[i].rgbBlue); } entry = j; col = m_col[i]; } - for (; entry < 256; ++entry) dest[entry] = col; + for (; entry < 256; ++entry) + dest[entry] = col; } /////////////////////////////////////////////////////////////////////////////// -PaletteCollection::PaletteCollection(const int palettes[][NB_PALETTES], int nbPalettes) -{ +PaletteCollection::PaletteCollection(const int palettes[][NB_PALETTES], + int nbPalettes) { m_cpal = new CompressedPalette[nbPalettes]; m_nbPalettes = nbPalettes; - // Set up the palettes from the array - for (int i = 0; i < nbPalettes; ++i) - { + // Set up the palettes from the array + for (int i = 0; i < nbPalettes; ++i) { CompressedPalette newpal; - const int* pal = palettes[i]; - for (int j = 1; j < pal[0] * 2; j += 2) - { - ColorRGB rgb; - rgb.rgbRed = (pal[j + 1] & 0xff0000) >> 16; - rgb.rgbGreen = (pal[j + 1] & 0xff00) >> 8; - rgb.rgbBlue = pal[j + 1] & 0xff; - newpal.push_color(pal[j], rgb); - } + const int *pal = palettes[i]; + for (int j = 1; j < pal[0] * 2; j += 2) { + ColorRGB rgb; + rgb.rgbRed = (pal[j + 1] & 0xff0000) >> 16; + rgb.rgbGreen = (pal[j + 1] & 0xff00) >> 8; + rgb.rgbBlue = pal[j + 1] & 0xff; + newpal.push_color(pal[j], rgb); + } m_cpal[i] = newpal; - } + } } -PaletteCollection::~PaletteCollection() -{ - delete[] m_cpal; -} - -void PaletteCollection::expandPalette(int i, Palette dest) const -{ +PaletteCollection::~PaletteCollection() { delete[] m_cpal; } + +void PaletteCollection::expandPalette(int i, Palette dest) const { m_cpal[i].expand(dest); } /////////////////////////////////////////////////////////////////////////////// -void blitSurface8To32(unsigned char *byteSurf, int *colorSurf, int palette[256], int size) -{ +void blitSurface8To32(unsigned char *byteSurf, int *colorSurf, int palette[256], + int size) { int i = 0; - while(size--) { + while (size--) { colorSurf[i++] = palette[byteSurf[size]]; } } -void paletteToRGBA(int dest[256], const Palette src) -{ - for (int i=0; i<256; ++i) - dest[i] = ((int)src[i].rgbRed << 16) | ((int)src[i].rgbGreen << 8) | (int)src[i].rgbBlue; +void paletteToRGBA(int dest[256], const Palette src) { + for (int i = 0; i < 256; ++i) + dest[i] = ((int)src[i].rgbRed << 16) | ((int)src[i].rgbGreen << 8) | + (int)src[i].rgbBlue; } diff --git a/libvisual-plugins/plugins/actor/corona/palette.h b/libvisual-plugins/plugins/actor/corona/palette.h index 1350206fa..bb6c7ade0 100644 --- a/libvisual-plugins/plugins/actor/corona/palette.h +++ b/libvisual-plugins/plugins/actor/corona/palette.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Richard Ashburn * * Authors: Richard Ashburn @@ -33,61 +33,61 @@ #include "corona_types.h" // PALETTE -// +// typedef ColorRGB Palette[256]; -class CompressedPalette; +class CompressedPalette; // COLLECTION OF PALETTES // // Definition of some palettes stored in compressed format. // -class PaletteCollection -{ - public: - PaletteCollection(const int palettes[][NB_PALETTES], int nbPalettes); - ~PaletteCollection(); +class PaletteCollection { +public: + PaletteCollection(const int palettes[][NB_PALETTES], int nbPalettes); + ~PaletteCollection(); - int size() const { return m_nbPalettes; } - void expandPalette(int i, Palette dest) const; + int size() const { return m_nbPalettes; } + void expandPalette(int i, Palette dest) const; - private: - CompressedPalette *m_cpal; - int m_nbPalettes; +private: + CompressedPalette *m_cpal; + int m_nbPalettes; }; // PALETTE CYCLER // // A class to create cycling palettes. -// -class PaletteCycler -{ - private: - Palette m_srcpal; - Palette m_destpal; - Palette m_curpal; +// +class PaletteCycler { +private: + Palette m_srcpal; + Palette m_destpal; + Palette m_curpal; - PaletteCollection m_palettes; - int m_srcnum, m_destnum; - bool m_transferring; - double m_progress; + PaletteCollection m_palettes; + int m_srcnum, m_destnum; + bool m_transferring; + double m_progress; - void startPaletteTransition(); - void affectPaletteTransition(double p); + void startPaletteTransition(); + void affectPaletteTransition(double p); - public: - PaletteCycler(const int palettes[][NB_PALETTES], int nbPalettes); - void update(TimedLevel *pLevels); - void updateVisPalette(VisPalette *pal); - const Palette &getPalette() const { return m_curpal; } +public: + PaletteCycler(const int palettes[][NB_PALETTES], int nbPalettes); + void update(TimedLevel *pLevels); + void updateVisPalette(VisPalette *pal); + const Palette &getPalette() const { return m_curpal; } }; // PALETTE CONVERSIOn // -// Display/Architecture specific routines to convert Palette to int[] (hardware color) -// +// Display/Architecture specific routines to convert Palette to int[] (hardware +// color) +// void paletteToRGBA(int dest[256], const Palette src); // BLIT A PALETTIZED SURFACE using converted palette. -void blitSurface8To32(unsigned char *byteSurf, int *colorSurf, int palette[256], int size); +void blitSurface8To32(unsigned char *byteSurf, int *colorSurf, int palette[256], + int size); #endif diff --git a/libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.cpp b/libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.cpp index 722b9e388..5dcf1a674 100644 --- a/libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.cpp +++ b/libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.cpp @@ -37,171 +37,176 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR namespace { - int lv_dancingparticles_init (VisPluginData *plugin); - void lv_dancingparticles_cleanup (VisPluginData *plugin); - void lv_dancingparticles_requisition (VisPluginData *plugin, int *width, int *height); - void lv_dancingparticles_resize (VisPluginData *plugin, int width, int height); - int lv_dancingparticles_events (VisPluginData *plugin, VisEventQueue *events); - void lv_dancingparticles_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); - VisPalette *lv_dancingparticles_palette (VisPluginData *plugin); -} +int lv_dancingparticles_init(VisPluginData *plugin); +void lv_dancingparticles_cleanup(VisPluginData *plugin); +void lv_dancingparticles_requisition(VisPluginData *plugin, int *width, + int *height); +void lv_dancingparticles_resize(VisPluginData *plugin, int width, int height); +int lv_dancingparticles_events(VisPluginData *plugin, VisEventQueue *events); +void lv_dancingparticles_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +VisPalette *lv_dancingparticles_palette(VisPluginData *plugin); +} // namespace unsigned int fast_sqrt_table[0x10000]; int titleHasChanged = false; const char *curtitle = "Moeders"; /* Main plugin stuff */ -const VisPluginInfo *get_plugin_info () -{ - static VisActorPlugin actor; - - actor.requisition = lv_dancingparticles_requisition; - actor.palette = lv_dancingparticles_palette; - actor.render = lv_dancingparticles_render; - actor.vidoptions.depth = VISUAL_VIDEO_DEPTH_GL; - - static VisPluginInfo info; - - info.type = VISUAL_PLUGIN_TYPE_ACTOR; - info.plugname = "dancingparticles"; - info.name = "libvisual Dancing Particles plugin"; - info.author = N_("Original by: Pierre Tardy , Port by: Dennis Smit "); - info.version = "0.1"; - info.about = N_("Libvisual Dancing Particles plugin"); - info.help = N_("This plugin shows dancing particles"); - info.license = VISUAL_PLUGIN_LICENSE_GPL, - - info.init = lv_dancingparticles_init; - info.cleanup = lv_dancingparticles_cleanup; - info.events = lv_dancingparticles_events; - info.plugin = &actor; - - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, 1); - - return &info; +const VisPluginInfo *get_plugin_info() { + static VisActorPlugin actor; + + actor.requisition = lv_dancingparticles_requisition; + actor.palette = lv_dancingparticles_palette; + actor.render = lv_dancingparticles_render; + actor.vidoptions.depth = VISUAL_VIDEO_DEPTH_GL; + + static VisPluginInfo info; + + info.type = VISUAL_PLUGIN_TYPE_ACTOR; + info.plugname = "dancingparticles"; + info.name = "libvisual Dancing Particles plugin"; + info.author = N_("Original by: Pierre Tardy , Port by: " + "Dennis Smit "); + info.version = "0.1"; + info.about = N_("Libvisual Dancing Particles plugin"); + info.help = N_("This plugin shows dancing particles"); + info.license = VISUAL_PLUGIN_LICENSE_GPL, + + info.init = lv_dancingparticles_init; + info.cleanup = lv_dancingparticles_cleanup; + info.events = lv_dancingparticles_events; + info.plugin = &actor; + + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, + 1); + + return &info; } namespace { -int lv_dancingparticles_init (VisPluginData *plugin) -{ +int lv_dancingparticles_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - auto priv = visual_mem_new0 (DancingParticlesPrivate, 1); - visual_plugin_set_private (plugin, priv); + auto priv = visual_mem_new0(DancingParticlesPrivate, 1); + visual_plugin_set_private(plugin, priv); - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_bool ("transparent_bars", - N_("Transparent bars"), - FALSE, - NULL), - NULL); + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many(params, + visual_param_new_bool("transparent_bars", + N_("Transparent bars"), + FALSE, NULL), + NULL); - build_sqrt_table (); + build_sqrt_table(); - init_gl (); + init_gl(); - return true; + return true; } -void lv_dancingparticles_cleanup (VisPluginData *plugin) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_dancingparticles_cleanup(VisPluginData *plugin) { + auto priv = + static_cast(visual_plugin_get_private(plugin)); - visual_mem_free (priv); + visual_mem_free(priv); } -void lv_dancingparticles_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +void lv_dancingparticles_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - if (reqw < 1) - reqw = 1; + if (reqw < 1) + reqw = 1; - if (reqh < 1) - reqh = 1; + if (reqh < 1) + reqh = 1; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -void lv_dancingparticles_resize (VisPluginData *plugin, int width, int height) -{ - glViewport(0, 0, width, height); +void lv_dancingparticles_resize(VisPluginData *plugin, int width, int height) { + glViewport(0, 0, width, height); - build_sqrt_table (); + build_sqrt_table(); } -int lv_dancingparticles_events (VisPluginData *plugin, VisEventQueue *events) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +int lv_dancingparticles_events(VisPluginData *plugin, VisEventQueue *events) { + auto priv = + static_cast(visual_plugin_get_private(plugin)); - VisEvent ev; - VisParam *param; + VisEvent ev; + VisParam *param; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_dancingparticles_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_dancingparticles_resize(plugin, ev.event.resize.width, + ev.event.resize.height); + break; - case VISUAL_EVENT_PARAM: - param = static_cast (ev.event.param.param); + case VISUAL_EVENT_PARAM: + param = static_cast(ev.event.param.param); - if (visual_param_has_name (param, "transparent_bars")) { - priv->transparent = visual_param_get_value_bool (param); + if (visual_param_has_name(param, "transparent_bars")) { + priv->transparent = visual_param_get_value_bool(param); - if (priv->transparent == FALSE) - glDisable (GL_BLEND); - else - glEnable (GL_BLEND); - } + if (priv->transparent == FALSE) + glDisable(GL_BLEND); + else + glEnable(GL_BLEND); + } - default: /* to avoid warnings */ - break; - } - } + default: /* to avoid warnings */ + break; + } + } - return true; + return true; } -VisPalette *lv_dancingparticles_palette (VisPluginData *plugin) -{ - return nullptr; +VisPalette *lv_dancingparticles_palette(VisPluginData *plugin) { + return nullptr; } -void lv_dancingparticles_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - const unsigned int size = 256; +void lv_dancingparticles_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + const unsigned int size = 256; - float freq[3][size]; + float freq[3][size]; - LV::BufferPtr fbuf = LV::Buffer::create (); - fbuf->set (freq[0], size * sizeof(float)); - audio->get_spectrum (fbuf, size, VISUAL_AUDIO_CHANNEL_LEFT, false); + LV::BufferPtr fbuf = LV::Buffer::create(); + fbuf->set(freq[0], size * sizeof(float)); + audio->get_spectrum(fbuf, size, VISUAL_AUDIO_CHANNEL_LEFT, false); - fbuf->set (freq[1], size * sizeof(float)); - audio->get_spectrum (fbuf, size, VISUAL_AUDIO_CHANNEL_RIGHT, false); + fbuf->set(freq[1], size * sizeof(float)); + audio->get_spectrum(fbuf, size, VISUAL_AUDIO_CHANNEL_RIGHT, false); - for (unsigned int i = 0; i < size; i++) - freq[2][i] = (freq[0][i] + freq[1][i]) / 2; + for (unsigned int i = 0; i < size; i++) + freq[2][i] = (freq[0][i] + freq[1][i]) / 2; - /* FIXME on title change, do something */ - dp_render_freq (freq); -// update_playlist_info (); - etoileLoop (); - draw_gl (); + /* FIXME on title change, do something */ + dp_render_freq(freq); + // update_playlist_info (); + etoileLoop(); + draw_gl(); } } // anonymous namespace diff --git a/libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.h b/libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.h index caf6ed807..f61233ca5 100644 --- a/libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.h +++ b/libvisual-plugins/plugins/actor/dancingparticles/actor_dancingparticles.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2004, 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -26,10 +26,9 @@ #include - typedef struct { - int transparent; - int titleHasChanged; + int transparent; + int titleHasChanged; } DancingParticlesPrivate; #endif /* _ACTOR_DANCINGPARTICLES_H */ diff --git a/libvisual-plugins/plugins/actor/dancingparticles/epic.cpp b/libvisual-plugins/plugins/actor/dancingparticles/epic.cpp index eb9261871..b7689d408 100644 --- a/libvisual-plugins/plugins/actor/dancingparticles/epic.cpp +++ b/libvisual-plugins/plugins/actor/dancingparticles/epic.cpp @@ -5,113 +5,96 @@ #include #include "etoile.h" - static float totLength; - - -void addpoints(char *p) -{ - int x,y; - char *a,*b; +void addpoints(char *p) { + int x, y; + char *a, *b; FloatPoint t; - while(1) - { - while(*p && *p!='(')p++; - if(*p==0) - return; + while (1) { + while (*p && *p != '(') p++; - a=p; - while(*p && *p!=',')p++; - if(*p==0) - return; - - *p=0; + if (*p == 0) + return; + p++; + a = p; + while (*p && *p != ',') p++; - b=p; - while(*p && *p!=')')p++; - if(*p==0) - return; + if (*p == 0) + return; - *p=0; + *p = 0; + p++; + b = p; + while (*p && *p != ')') p++; - x=atoi(a); - y=atoi(b); - t=FloatPoint(x/15 - 300,y/15-200,0); - if(!newline2[numCenters2]) - totLength+=(t-Centers2[numCenters2-1]).length(); - - Centers2[numCenters2++]=t; - newline2[numCenters2]=0; - } - - + if (*p == 0) + return; + + *p = 0; + p++; + x = atoi(a); + y = atoi(b); + t = FloatPoint(x / 15 - 300, y / 15 - 200, 0); + if (!newline2[numCenters2]) + totLength += (t - Centers2[numCenters2 - 1]).length(); + + Centers2[numCenters2++] = t; + newline2[numCenters2] = 0; + } } // we should change this hack.. -void loadepic2(const char *file) -{ - FILE *f = fopen(file,"r"); - int mode=0; +void loadepic2(const char *file) { + FILE *f = fopen(file, "r"); + int mode = 0; char buf[255]; - if(!f) - { - printf("unable to open the file %s \n", file); - exit(1); - } + if (!f) { + printf("unable to open the file %s \n", file); + exit(1); + } numCenters2 = 0; - totLength=0; - fgets(buf,255,f); - while(!feof(f)) - { - - if(buf[0]=='\\') - mode = 0; - switch(mode) - { - case 0: - if(memcmp(buf,"\\drawline",9)==0) - { - char *p=buf+9; - newline2[numCenters2]=1; - addpoints(p); - mode++; - } - break; - case 1: - addpoints(buf); - break; - - - } - fgets(buf,255,f); + totLength = 0; + fgets(buf, 255, f); + while (!feof(f)) { + + if (buf[0] == '\\') + mode = 0; + switch (mode) { + case 0: + if (memcmp(buf, "\\drawline", 9) == 0) { + char *p = buf + 9; + newline2[numCenters2] = 1; + addpoints(p); + mode++; + } + break; + case 1: + addpoints(buf); + break; } + fgets(buf, 255, f); + } fclose(f); - if(!numCenters2) + if (!numCenters2) printf("pas de points\n"); - } -void loadepic(const char *filename) -{ +void loadepic(const char *filename) { loadepic2(filename); - numCenters=0; - Centers[numCenters++]=Centers2[0]; - for(int i=1;i #include -Rect windRect; - -FloatPoint *pts=0; -FloatPoint *speed=0; -FloatPoint *Centers=0; -int *newline=0; -FloatPoint *Centers2=0; -int *newline2=0; +Rect windRect; + +FloatPoint *pts = 0; +FloatPoint *speed = 0; +FloatPoint *Centers = 0; +int *newline = 0; +FloatPoint *Centers2 = 0; +int *newline2 = 0; int numCenters; int numCenters2; -FloatPoint Center(200.,200.,0); -int ptsNum=2000, ptsNumMax=2000; +FloatPoint Center(200., 200., 0); +int ptsNum = 2000, ptsNumMax = 2000; unsigned short *gfrq[256]; int beat; @@ -28,191 +28,169 @@ int frames = 0; matrix rot; extern int gloudness; -void affloudness(int i) -{ - static int curi =0; - - if(i== 0) - { - curi++; - curi%=(ptsNum/3); - } - if(i/3 == curi) - { - // gloudness=0; - Centers[i][0]=400- (i%3)*(800.0/(myfloat)(ptsNum/3)); - Centers[i][1]=gloudness/6-300; - Centers[i][2]=0; - } - else - { - Centers[i][0]-=(800.0/(myfloat)(ptsNum/3)); - Centers[i][2]= (Centers[i][0])/30; - Centers[i][2]*= -Centers[i][2]*gloudness/400; - - } +void affloudness(int i) { + static int curi = 0; + + if (i == 0) { + curi++; + curi %= (ptsNum / 3); + } + if (i / 3 == curi) { + // gloudness=0; + Centers[i][0] = 400 - (i % 3) * (800.0 / (myfloat)(ptsNum / 3)); + Centers[i][1] = gloudness / 6 - 300; + Centers[i][2] = 0; + } else { + Centers[i][0] -= (800.0 / (myfloat)(ptsNum / 3)); + Centers[i][2] = (Centers[i][0]) / 30; + Centers[i][2] *= -Centers[i][2] * gloudness / 400; + } } -void afffilter(int i) -{ - Centers[i][0]= -400+ i*(800.0/(myfloat)(ptsNum)); - Centers[i][1]= detector.filter[i]/2 -300; - Centers[i][2]=0; +void afffilter(int i) { + Centers[i][0] = -400 + i * (800.0 / (myfloat)(ptsNum)); + Centers[i][1] = detector.filter[i] / 2 - 300; + Centers[i][2] = 0; } -void afffilter2(int i) -{ - Centers[i][0]= -400+ i*(800.0/(myfloat)(ptsNum)); - Centers[i][1]= detector.filter2[i]/2 -300; - Centers[i][2]=0; +void afffilter2(int i) { + Centers[i][0] = -400 + i * (800.0 / (myfloat)(ptsNum)); + Centers[i][1] = detector.filter2[i] / 2 - 300; + Centers[i][2] = 0; } extern int titleHasChanged; -void etoileLoop(void) -{ - int frames2=frames; +void etoileLoop(void) { + int frames2 = frames; static int nextframes; static int nextbeat; - if(p.size<1E-6) - { - init_parameters(); - visual_log (VISUAL_LOG_INFO, "Size is too small, possible bug with strtof()"); - //p.size=.2; - } + if (p.size < 1E-6) { + init_parameters(); + visual_log(VISUAL_LOG_INFO, + "Size is too small, possible bug with strtof()"); + // p.size=.2; + } frames++; - if(titleHasChanged || (beatcnt >nextbeat ) || frames > nextframes) - { - changep(); - nextframes = frames + p.duration_f; - nextbeat = beatcnt + p.duration_b; - } - if(beat==2) + if (titleHasChanged || (beatcnt > nextbeat) || frames > nextframes) { + changep(); + nextframes = frames + p.duration_f; + nextbeat = beatcnt + p.duration_b; + } + if (beat == 2) beat--; - Center=eSetCenter(frames); - - rot=matrix(p.rotspeed1,FloatPoint(cos(((double)frames2)/120.)*2,cos(((double)frames2)/54.)*2,cos(((double)frames2)/231.)*2)); - - for(int i=0;ip.maxantig) - d2=p.maxantig; - vect=(vect * d2); - if(p.noagexplosion)// just to make a sphere - vect= vect - ( vectunite * (vect % vectunite)); - - speed[i]+= vect ; - } - else - { - pts[i][0]+=0.01; - } - } + for (int k = 0; k < p.agnumparts; k++) { + int j = (frames + k + i) % ptsNum; + /* if((i==0) &&(k==0)) + cout << j << " "; + */ + if (i != j) { + FloatPoint vect = pts[i] - pts[j]; + float d1 = (float)vect.length(); + float d2 = d1; + if (d2 != 0) { + // d include the normalisation + for (int k = 0; k < p.antigorder; k++) + d2 = d2 * d1; + d2 = (10 * p.ag) / d2; + + if (d2 > p.maxantig) + d2 = p.maxantig; + vect = (vect * d2); + if (p.noagexplosion) // just to make a sphere + vect = vect - (vectunite * (vect % vectunite)); + + speed[i] += vect; + } else { + pts[i][0] += 0.01; + } } - - float d0=p.d0min+ (((p.dancingpartk*i +frames)%ptsNum1) - { - rot=matrix(p.rotspeed2,FloatPoint(cos(((double)time)/40.)*5,cos(((double)time)/124.)*5,cos(((double)time)/231.)*5)); - for(int i=0;i 1) { + rot = matrix(p.rotspeed2, FloatPoint(cos(((double)time) / 40.) * 5, + cos(((double)time) / 124.) * 5, + cos(((double)time) / 231.) * 5)); + for (int i = 0; i < numCenters; i++) { + rot.ApplyMatrix(Centers[i], c); } - - return a;//FloatPoint(200+(LV::rand()%(width-200)),200+(LV::rand()%(height-200)),0) + } else { + rot = matrix(p.rotspeed2, FloatPoint(cos(((double)time) / 40.) * 5, + cos(((double)time) / 124.) * 5, + cos(((double)time) / 231.) * 5)); + rot.ApplyMatrix(a, c); + + FloatPoint dist = a; + float d = (float)dist.length(); + float d0 = p.d1; + FloatPoint vectunite = (dist / d); + float f = -1 * (d - d0); + + vectunite = vectunite * f; + a += vectunite; + } + + return a; // FloatPoint(200+(LV::rand()%(width-200)),200+(LV::rand()%(height-200)),0) } diff --git a/libvisual-plugins/plugins/actor/dancingparticles/etoile.h b/libvisual-plugins/plugins/actor/dancingparticles/etoile.h index 74cddb23a..039bb55d9 100644 --- a/libvisual-plugins/plugins/actor/dancingparticles/etoile.h +++ b/libvisual-plugins/plugins/actor/dancingparticles/etoile.h @@ -16,15 +16,14 @@ void dp_render_freq(float spectrum[3][256]); /* Globals */ -struct parameters -{ +struct parameters { char *name; char key; int mode; - myfloat k; // cst du ressort - myfloat d0min; // longueur min - myfloat d1; // longueur du cercle du centre - myfloat ag; // antigravit� + myfloat k; // cst du ressort + myfloat d0min; // longueur min + myfloat d1; // longueur du cercle du centre + myfloat ag; // antigravit� int antigorder; int agnumparts; myfloat maxantig; @@ -32,11 +31,11 @@ struct parameters myfloat dancingpart; // in % int dancingpartk; myfloat velocity; - int numfrq; + int numfrq; myfloat visc; myfloat rotspeed1; myfloat rotspeed2; - int strombo; // 1 = no strombo + int strombo; // 1 = no strombo int numpart; myfloat size; @@ -49,13 +48,13 @@ struct parameters extern parameters p; - extern FloatPoint *pts; extern FloatPoint *speed; extern FloatPoint *Centers; -extern int *newline; -extern FloatPoint *Centers2; // used to build the Centers TODO need to be a better data struct for Centers -extern int *newline2; +extern int *newline; +extern FloatPoint *Centers2; // used to build the Centers TODO need to be a + // better data struct for Centers +extern int *newline2; extern int numCenters; extern int numCenters2; @@ -71,37 +70,35 @@ extern int nump; extern int frames; /* These define the resolution and tonal scale of the spectrum analyzer */ -#define NUM_BANDS 255 +#define NUM_BANDS 255 extern GLfloat heights[NUM_BANDS]; - /* Prototypes */ void etoileLoop(void); -void DrawPt(int i); +void DrawPt(int i); void DrawCenter(); void BeginDrawing(); void EndDrawing(); Boolean eTestEnd(); FloatPoint eSetCenter(long time); void Tourne(short i); -void Elastantig(short i,FloatPoint &c); +void Elastantig(short i, FloatPoint &c); // parameters void etoileinit(); -void init_parameters(); +void init_parameters(); void changep(); void allocParts(); void loadepic(const char *file); -class beatdetector -{ +class beatdetector { public: float filter[NUM_BANDS]; float filter2[NUM_BANDS]; - float filterpower; // sum of all the bands + float filterpower; // sum of all the bands int lastbeats[10]; int freq; // in CLK_TCK @@ -109,19 +106,18 @@ class beatdetector float loudness; int beat; - uint32_t avloudness; - uint32_t uplimit; - uint32_t downlimit; - int state; + uint32_t avloudness; + uint32_t uplimit; + uint32_t downlimit; + int state; - int beatbase; - int beatquiet; /* force "quiet" situation? */ + int beatbase; + int beatquiet; /* force "quiet" situation? */ beatdetector(); void calc_loudness(float data[3][256]); void detect_beat(); void learnbeat(float data[3][256]); - }; extern beatdetector detector; diff --git a/libvisual-plugins/plugins/actor/dancingparticles/fastmath.h b/libvisual-plugins/plugins/actor/dancingparticles/fastmath.h index 79fd93fb8..c04d670cc 100644 --- a/libvisual-plugins/plugins/actor/dancingparticles/fastmath.h +++ b/libvisual-plugins/plugins/actor/dancingparticles/fastmath.h @@ -25,7 +25,7 @@ commercialisation ou d'adaptation dans un but #include #include #if (defined(__INTEL_COMPILER)) -#include //#include +#include //#include #else #include #endif @@ -37,128 +37,119 @@ commercialisation ou d'adaptation dans un but #define EXTERN extern #endif -union FloatRepr -{ - float f; - uint32_t i; +union FloatRepr { + float f; + uint32_t i; }; -#define FP_ABS_BITS(fp) (fp_bits(fp)&0x7FFFFFFF) -#define FP_SIGN_BIT(fp) (fp_bits(fp)&0x80000000) +#define FP_ABS_BITS(fp) (fp_bits(fp) & 0x7FFFFFFF) +#define FP_SIGN_BIT(fp) (fp_bits(fp) & 0x80000000) #define FP_ONE_BITS 0x3F800000 // r = 1/p -#define FP_INV(r,p) \ -{ \ - int _i = 2 * FP_ONE_BITS - *(int *)&(p); \ - r = *(float *)&_i; \ - r = r * (2.0f - (p) * r); \ +#define FP_INV(r, p) \ + { \ + int _i = 2 * FP_ONE_BITS - *(int *)&(p); \ + r = *(float *)&_i; \ + r = r * (2.0f - (p)*r); \ + } + +#define FP_EXP(e, p) \ + { \ + int _i; \ + e = -1.44269504f * (float)0x00800000 * (p); \ + _i = (int)e + 0x3F800000; \ + e = *(float *)&_i; \ + } + +#define FP_NORM_TO_BYTE(i, p) \ + { \ + float _n = (p) + 1.0f; \ + i = *(int *)&_n; \ + if (i >= 0x40000000) \ + i = 0xFF; \ + else if (i <= 0x3F800000) \ + i = 0; \ + else \ + i = ((i) >> 15) & 0xFF; \ + } + +inline uint32_t fp_bits(float fp) { + FloatRepr tmp; + tmp.f = fp; + return tmp.i; } - -#define FP_EXP(e,p) \ -{ \ - int _i; \ - e = -1.44269504f * (float)0x00800000 * (p); \ - _i = (int)e + 0x3F800000; \ - e = *(float *)&_i; \ -} - -#define FP_NORM_TO_BYTE(i,p) \ -{ \ - float _n = (p) + 1.0f; \ - i = *(int *)&_n; \ - if (i >= 0x40000000) i = 0xFF; \ - else if (i <=0x3F800000) i = 0; \ - else i = ((i) >> 15) & 0xFF; \ -} - -inline uint32_t fp_bits(float fp) -{ - FloatRepr tmp; - tmp.f = fp; - return tmp.i; +inline uint32_t FP_NORM_TO_BYTE2(float p) { + FloatRepr tmp; + tmp.f = p + 1.0f; + return (tmp.i >> 15) & 0xFF; } -inline uint32_t FP_NORM_TO_BYTE2(float p) -{ - FloatRepr tmp; - tmp.f = p + 1.0f; - return (tmp.i >> 15) & 0xFF; +inline uint32_t FP_NORM_TO_BYTE3(float p) { + FloatRepr tmp; + tmp.f = p + 12582912.0f; + return (tmp.i & 0xFF); } +extern uint32_t fast_sqrt_table[0x10000]; // declare table of square roots -inline uint32_t FP_NORM_TO_BYTE3(float p) -{ - FloatRepr tmp; - tmp.f = p + 12582912.0f; - return (tmp.i & 0xFF); -} - -extern uint32_t fast_sqrt_table[0x10000]; // declare table of square roots - -inline void build_sqrt_table() -{ - unsigned int i; - FloatRepr s; +inline void build_sqrt_table() { + unsigned int i; + FloatRepr s; - for (i = 0; i <= 0x7FFF; i++) - { + for (i = 0; i <= 0x7FFF; i++) { - // Build a float with the bit pattern i as mantissa - // and an exponent of 0, stored as 127 + // Build a float with the bit pattern i as mantissa + // and an exponent of 0, stored as 127 - s.i = (i << 8) | (0x7F << 23); - s.f = sqrtf(s.f); + s.i = (i << 8) | (0x7F << 23); + s.f = sqrtf(s.f); - // Take the square root then strip the first 7 bits of - // the mantissa into the table + // Take the square root then strip the first 7 bits of + // the mantissa into the table - fast_sqrt_table[i + 0x8000] = (s.i & 0x7FFFFF); + fast_sqrt_table[i + 0x8000] = (s.i & 0x7FFFFF); - // Repeat the process, this time with an exponent of 1, - // stored as 128 + // Repeat the process, this time with an exponent of 1, + // stored as 128 - s.i = (i << 8) | (0x80 << 23); - s.f = sqrtf(s.f); + s.i = (i << 8) | (0x80 << 23); + s.f = sqrtf(s.f); - fast_sqrt_table[i] = (s.i & 0x7FFFFF); - } + fast_sqrt_table[i] = (s.i & 0x7FFFFF); + } } -//#define fastsqrt sqrtf +// #define fastsqrt sqrtf +inline float fastsqrt(float n) { + FloatRepr in; + in.f = n; -inline float fastsqrt(float n) -{ - FloatRepr in; - in.f = n; + if (in.i == 0) + return 0.0; // check for square root of 0 - if (in.i == 0) - return 0.0; // check for square root of 0 + FloatRepr result; + result.i = fast_sqrt_table[(in.i >> 8) & 0xFFFF] | + ((((in.i - 0x3F800000) >> 1) + 0x3F800000) & 0x7F800000); - FloatRepr result; - result.i = fast_sqrt_table[(in.i >> 8) & 0xFFFF] | ((((in.i - 0x3F800000) >> 1) + 0x3F800000) & 0x7F800000); - - return result.f; + return result.f; } -inline float distanceVector(float * v1,float * v2) -{ - float diff; - float sum = 0.0f; +inline float distanceVector(float *v1, float *v2) { + float diff; + float sum = 0.0f; - for(int i=0;i<3;i++) - { - diff=v1[i]-v2[i]; - sum+=diff*diff; - } + for (int i = 0; i < 3; i++) { + diff = v1[i] - v2[i]; + sum += diff * diff; + } - return fastsqrt(sum); + return fastsqrt(sum); } #undef EXTERN #define sqrt DONT_USE_SQRT #endif - diff --git a/libvisual-plugins/plugins/actor/dancingparticles/floatpoint.h b/libvisual-plugins/plugins/actor/dancingparticles/floatpoint.h index 68e07b2b1..aa01fc219 100644 --- a/libvisual-plugins/plugins/actor/dancingparticles/floatpoint.h +++ b/libvisual-plugins/plugins/actor/dancingparticles/floatpoint.h @@ -5,137 +5,127 @@ #include using namespace std; -#define myfloat GLfloat +#define myfloat GLfloat -struct Point -{ - int h,v; +struct Point { + int h, v; }; -struct Rect{ - int top,bottom,left,right; +struct Rect { + int top, bottom, left, right; }; typedef int Boolean; - -class FloatPoint -{ -public : + +class FloatPoint { +public: myfloat v[3]; - FloatPoint operator +=(const FloatPoint &b){ - for(int i=0;i<3;i++) - v[i]+=b.v[i]; + FloatPoint operator+=(const FloatPoint &b) { + for (int i = 0; i < 3; i++) + v[i] += b.v[i]; return *this; }; - FloatPoint operator -=(const FloatPoint &b){ - for(int i=0;i<3;i++) - v[i]-=b.v[i]; + FloatPoint operator-=(const FloatPoint &b) { + for (int i = 0; i < 3; i++) + v[i] -= b.v[i]; return *this; }; - FloatPoint operator *=(const myfloat &b){ - for(int i=0;i<3;i++) - v[i]*=b; + FloatPoint operator*=(const myfloat &b) { + for (int i = 0; i < 3; i++) + v[i] *= b; return *this; }; - FloatPoint operator /=(const myfloat &b){ - for(int i=0;i<3;i++) - v[i]/=b; + FloatPoint operator/=(const myfloat &b) { + for (int i = 0; i < 3; i++) + v[i] /= b; return *this; }; - - FloatPoint(const Point &P){ - v[0]=P.h; - v[1]=P.v; - v[2]=20; + FloatPoint(const Point &P) { + v[0] = P.h; + v[1] = P.v; + v[2] = 20; }; - FloatPoint(const FloatPoint &P){ - visual_mem_copy(v,P.v,3*sizeof(myfloat)); + FloatPoint(const FloatPoint &P) { + visual_mem_copy(v, P.v, 3 * sizeof(myfloat)); }; - FloatPoint(){ - v[0]=0; - v[1]=0; - v[2]=20; + FloatPoint() { + v[0] = 0; + v[1] = 0; + v[2] = 20; }; - FloatPoint (myfloat a, myfloat b, myfloat c){ - v[0]=a; - v[1]=b; - v[2]=c; + FloatPoint(myfloat a, myfloat b, myfloat c) { + v[0] = a; + v[1] = b; + v[2] = c; }; - FloatPoint (myfloat *a){ - v[0]=a[0]; - v[1]=a[1]; - v[2]=a[2]; + FloatPoint(myfloat *a) { + v[0] = a[0]; + v[1] = a[1]; + v[2] = a[2]; } - FloatPoint (myfloat a){ - v[0]=a; - v[1]=a; - v[2]=a; + FloatPoint(myfloat a) { + v[0] = a; + v[1] = a; + v[2] = a; } - FloatPoint & operator = (myfloat a) - { - v[0]=a; - v[1]=a; - v[2]=a; - return *this; + FloatPoint &operator=(myfloat a) { + v[0] = a; + v[1] = a; + v[2] = a; + return *this; } - FloatPoint & operator = (FloatPoint a) - { - v[0]=a[0]; - v[1]=a[1]; - v[2]=a[2]; - return *this; + FloatPoint &operator=(FloatPoint a) { + v[0] = a[0]; + v[1] = a[1]; + v[2] = a[2]; + return *this; } - myfloat &operator [] (int i) { return v[i]; } - const myfloat &operator [] (int i) const{ return v[i]; } + myfloat &operator[](int i) { return v[i]; } + const myfloat &operator[](int i) const { return v[i]; } - inline myfloat length(){return (myfloat)fastsqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);} - void display() - { - cout << v[0] <<" "<< v[1] <<" " << v[2] <0) - { - beat--; - glBegin(GL_TRIANGLE_STRIP); - glColor3f(0.1 , 0.9 , 0.1 );// subliminal beat.. - glVertex3f(2,2,0); - glVertex3f(-2,2,0); - glVertex3f(-2,-2,0); - glVertex3f(2,-2,0); - glEnd(); - } - glColor3f(1 , 1 , .3 );// subliminal beat.. + if (beat > 0) { + beat--; + glBegin(GL_TRIANGLE_STRIP); + glColor3f(0.1, 0.9, 0.1); // subliminal beat.. + glVertex3f(2, 2, 0); + glVertex3f(-2, 2, 0); + glVertex3f(-2, -2, 0); + glVertex3f(2, -2, 0); + glEnd(); + } + glColor3f(1, 1, .3); // subliminal beat.. glBegin(GL_LINES); - for(int i = 0; i < 200; i++) - { - double x = (i-100); - double y = gloudnesses[(200+i+curloudness)%200]; - int beat = 0; - if(y <0) - { - y = -y; - beat = 1; - } - y = 4*(y-100)/200; - glVertex3f(x/30,y,0); - if(beat) - { - glVertex3f(x/30,-1.9,0); - glVertex3f(x/30,-2,0); - } - if(i>0 && i <199) - glVertex3f(x/30,y,0); - - } + for (int i = 0; i < 200; i++) { + double x = (i - 100); + double y = gloudnesses[(200 + i + curloudness) % 200]; + int beat = 0; + if (y < 0) { + y = -y; + beat = 1; + } + y = 4 * (y - 100) / 200; + glVertex3f(x / 30, y, 0); + if (beat) { + glVertex3f(x / 30, -1.9, 0); + glVertex3f(x / 30, -2, 0); + } + if (i > 0 && i < 199) + glVertex3f(x / 30, y, 0); + } double y = maxgloudness; - y = 4*(y-100)/200; - glVertex3f(-3,y,0); - glVertex3f(3,y,0); + y = 4 * (y - 100) / 200; + glVertex3f(-3, y, 0); + glVertex3f(3, y, 0); y = mingloudness; - y = 4*(y-100)/200; - glVertex3f(-3,y,0); - glVertex3f(3,y,0); + y = 4 * (y - 100) / 200; + glVertex3f(-3, y, 0); + glVertex3f(3, y, 0); y = avgloudness; - y = 4*(y-100)/200; - glVertex3f(-3,y,0); - glVertex3f(3,y,0); + y = 4 * (y - 100) / 200; + glVertex3f(-3, y, 0); + glVertex3f(3, y, 0); glEnd(); #else @@ -168,84 +163,68 @@ void draw_gl(void) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); - for(int i=0;ipts[i][0]) - { - /* if(speed[i][0]>0) - { - glColor4f(colors[0][0], colors[0][1], colors[0][2], 1.0f); - glBegin(GL_QUADS); - glVertex3f(pts[i][0]/100,1,pts[i][2]/100); - glVertex3f(pts[i][0]/100+SIZE2,1,pts[i][2]/100); - glVertex3f(pts[i][0]/100+SIZE2, 1+SIZE2, pts[(i+1)%ptsNum][2]/100); - glVertex3f(pts[i][0]/100,1+SIZE2,pts[(i+1)%ptsNum][2]/100); - glEnd(); - } - */ - glColor4f(colors[2][0], colors[2][1], colors[2][2], 1.0f); - - GLfloat vertices[4][2] = { - { pts[i][0]/100,pts[i][1]/100 }, - { pts[i][0]/100+SIZE,pts[i][1]/100 }, - { pts[(i+1)%ptsNum][0]/100+SIZE, pts[(i+1)%ptsNum][1]/100 }, - { pts[(i+1)%ptsNum][0]/100,pts[(i+1)%ptsNum][1]/100 } - }; - - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2,GL_FLOAT,0,vertices); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - glDisableClientState(GL_VERTEX_ARRAY); - } - } + for (int i = 0; i < ptsNum; i++) { + GLfloat colors[][3] = {{1.0, 0.2, 0.2}, {0.2, 1.0, 0.2}, {0.4, 0.4, 1.0}}; + + if (p.mode < 50) { + static const GLfloat vertices[4][2] = { + {-1.0, -1.0}, {1.0, -1.0}, {1.0, 1.0}, {-1.0, 1.0}}; + + static const GLfloat tex_coords[4][2] = { + {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}, {0.0, 1.0}}; + + glBindTexture(GL_TEXTURE_2D, texture[0]); // choose the texture to use. + glEnable(GL_TEXTURE_2D); + glPushMatrix(); + glTranslatef(pts[i][0] / 100, pts[i][1] / 100, pts[i][2] / 100); + glScalef(SIZE, SIZE, 1.0); + + int c = i % 3; + glColor4f(colors[c][0], colors[c][1], colors[c][2], 1.0f); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + glVertexPointer(2, GL_FLOAT, 0, vertices); + glTexCoordPointer(2, GL_FLOAT, 0, tex_coords); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); + + glPopMatrix(); + } else { + // float SIZE2=SIZE*10; + glDisable(GL_TEXTURE_2D); + if (pts[(i + 1) % ptsNum][0] > pts[i][0]) { + /* if(speed[i][0]>0) + { + glColor4f(colors[0][0], colors[0][1], + colors[0][2], 1.0f); glBegin(GL_QUADS); + glVertex3f(pts[i][0]/100,1,pts[i][2]/100); + glVertex3f(pts[i][0]/100+SIZE2,1,pts[i][2]/100); + glVertex3f(pts[i][0]/100+SIZE2, 1+SIZE2, + pts[(i+1)%ptsNum][2]/100); + glVertex3f(pts[i][0]/100,1+SIZE2,pts[(i+1)%ptsNum][2]/100); + glEnd(); + } + */ + glColor4f(colors[2][0], colors[2][1], colors[2][2], 1.0f); + + GLfloat vertices[4][2] = { + {pts[i][0] / 100, pts[i][1] / 100}, + {pts[i][0] / 100 + SIZE, pts[i][1] / 100}, + {pts[(i + 1) % ptsNum][0] / 100 + SIZE, + pts[(i + 1) % ptsNum][1] / 100}, + {pts[(i + 1) % ptsNum][0] / 100, pts[(i + 1) % ptsNum][1] / 100}}; + + glEnableClientState(GL_VERTEX_ARRAY); + glVertexPointer(2, GL_FLOAT, 0, vertices); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + glDisableClientState(GL_VERTEX_ARRAY); + } } + } #endif } diff --git a/libvisual-plugins/plugins/actor/dancingparticles/matrix.h b/libvisual-plugins/plugins/actor/dancingparticles/matrix.h index d392713cf..cf861a573 100644 --- a/libvisual-plugins/plugins/actor/dancingparticles/matrix.h +++ b/libvisual-plugins/plugins/actor/dancingparticles/matrix.h @@ -1,47 +1,40 @@ #include -class matrix -{ - public: - double v[3][3]; - - void ApplyMatrix(FloatPoint &p,FloatPoint &C) - { - FloatPoint P(p); - p[0]=(P[2]-C[2])*v[0][2]+(P[1]-C[1])*v[0][1]+(P[0]-C[0])*v[0][0]+C[0]; - p[1]=(P[2]-C[2])*v[1][2]+(P[1]-C[1])*v[1][1]+(P[0]-C[0])*v[1][0]+C[1]; - p[2]=(P[2]-C[2])*v[2][2]+(P[1]-C[1])*v[2][1]+(P[0]-C[0])*v[2][0]+C[2]; +class matrix { +public: + double v[3][3]; - } - matrix(double angle, FloatPoint axe) - { - #define a axe[0] - #define b axe[1] - #define c axe[2] - double aa=a*a, - bb=b*b, - cc=c*c, - cosa=cos(angle), - sina=sin(angle), - abc=aa+bb+cc, - rabc=fastsqrt(abc); - - v[0][0]=((bb+cc)*cosa + aa)/abc; - v[0][1]=-((c*rabc*sina+(b*a*(cosa-1.))))/abc; - v[0][2]=(b*rabc*sina-(c*a*(cosa-1.)))/abc; + void ApplyMatrix(FloatPoint &p, FloatPoint &C) { + FloatPoint P(p); + p[0] = (P[2] - C[2]) * v[0][2] + (P[1] - C[1]) * v[0][1] + + (P[0] - C[0]) * v[0][0] + C[0]; + p[1] = (P[2] - C[2]) * v[1][2] + (P[1] - C[1]) * v[1][1] + + (P[0] - C[0]) * v[1][0] + C[1]; + p[2] = (P[2] - C[2]) * v[2][2] + (P[1] - C[1]) * v[2][1] + + (P[0] - C[0]) * v[2][0] + C[2]; + } + matrix(double angle, FloatPoint axe) { +#define a axe[0] +#define b axe[1] +#define c axe[2] + double aa = a * a, bb = b * b, cc = c * c, cosa = cos(angle), + sina = sin(angle), abc = aa + bb + cc, rabc = fastsqrt(abc); - v[1][0]=((c*rabc*sina+(b*a*(cosa-1.))))/abc; - v[1][1]=((aa+cc)*cosa + bb)/abc; - v[1][2]=-(a*rabc*sina-(c*b*(cosa-1.)))/abc; + v[0][0] = ((bb + cc) * cosa + aa) / abc; + v[0][1] = -((c * rabc * sina + (b * a * (cosa - 1.)))) / abc; + v[0][2] = (b * rabc * sina - (c * a * (cosa - 1.))) / abc; - v[2][0]=-((b*rabc*sina+(c*a*(cosa-1.))))/abc; - v[2][1]=(a*rabc*sina-(c*b*(cosa-1.)))/abc; - v[2][2]=((bb+aa)*cosa + cc)/abc; - - #undef a - #undef b - #undef c - } + v[1][0] = ((c * rabc * sina + (b * a * (cosa - 1.)))) / abc; + v[1][1] = ((aa + cc) * cosa + bb) / abc; + v[1][2] = -(a * rabc * sina - (c * b * (cosa - 1.))) / abc; - matrix(){}; -}; + v[2][0] = -((b * rabc * sina + (c * a * (cosa - 1.)))) / abc; + v[2][1] = (a * rabc * sina - (c * b * (cosa - 1.))) / abc; + v[2][2] = ((bb + aa) * cosa + cc) / abc; + +#undef a +#undef b +#undef c + } + matrix(){}; +}; diff --git a/libvisual-plugins/plugins/actor/dancingparticles/parameters.cpp b/libvisual-plugins/plugins/actor/dancingparticles/parameters.cpp index 0e8245dd7..ac359b448 100644 --- a/libvisual-plugins/plugins/actor/dancingparticles/parameters.cpp +++ b/libvisual-plugins/plugins/actor/dancingparticles/parameters.cpp @@ -3,344 +3,303 @@ #include "etoile.h" #include "t1font.h" - // or why use lex when.. - -int nump=0; -parameters *ps=0; +int nump = 0; +parameters *ps = 0; parameters p; const char *configfilename = ""; int IKnowAboutConfigFile; parameters p_parsed; -static int newconfig = 1; +static int newconfig = 1; enum { PARAM_INT, PARAM_STR, PARAM_FLOAT, PARAM_CHAR }; -struct param_params{ const char *pname; int type; void * where; }; -param_params pp[] = - { { "name", PARAM_STR, &p_parsed.name }, - { "key", PARAM_CHAR, &p_parsed.key }, - { "mode", PARAM_INT, &p_parsed.mode }, - { "k", PARAM_FLOAT, &p_parsed.k }, - { "d0min", PARAM_FLOAT, &p_parsed.d0min }, - { "d1", PARAM_FLOAT, &p_parsed.d1 }, - { "ag", PARAM_FLOAT, &p_parsed.ag }, - { "agnumparts", PARAM_INT, &p_parsed.agnumparts }, - { "antigorder", PARAM_INT, &p_parsed.antigorder }, - { "maxantig", PARAM_FLOAT, &p_parsed.maxantig }, - { "noagexplosion", PARAM_INT, &p_parsed.noagexplosion }, - { "dancingpart", PARAM_FLOAT, &p_parsed.dancingpart }, - { "dancingpartk", PARAM_INT, &p_parsed.dancingpartk }, - { "velocity", PARAM_FLOAT, &p_parsed.velocity }, - { "numfrq", PARAM_INT, &p_parsed.numfrq }, - { "visc", PARAM_FLOAT, &p_parsed.visc }, - { "rotspeed1", PARAM_FLOAT, &p_parsed.rotspeed1 }, - { "rotspeed2", PARAM_FLOAT, &p_parsed.rotspeed2 }, - { "strombo", PARAM_FLOAT, &p_parsed.strombo }, - { "numpart", PARAM_INT, &p_parsed.numpart}, - { "size", PARAM_FLOAT, &p_parsed.size}, - { "sizeloudness", PARAM_FLOAT, &p_parsed.sizeloudness}, - { "chance", PARAM_INT, &p_parsed.chance }, - { "duration_f", PARAM_INT, &p_parsed.duration_f }, - { "duration_b", PARAM_INT, &p_parsed.duration_b }, - - - { "MaxParticles", PARAM_INT, &ptsNumMax }, - { "IKnowAboutConfigFile", PARAM_INT, &IKnowAboutConfigFile }, - }; -int numpp= sizeof(pp)/sizeof(pp[0]); - -char *nextword(char * &ptr) -{ +struct param_params { + const char *pname; + int type; + void *where; +}; +param_params pp[] = { + {"name", PARAM_STR, &p_parsed.name}, + {"key", PARAM_CHAR, &p_parsed.key}, + {"mode", PARAM_INT, &p_parsed.mode}, + {"k", PARAM_FLOAT, &p_parsed.k}, + {"d0min", PARAM_FLOAT, &p_parsed.d0min}, + {"d1", PARAM_FLOAT, &p_parsed.d1}, + {"ag", PARAM_FLOAT, &p_parsed.ag}, + {"agnumparts", PARAM_INT, &p_parsed.agnumparts}, + {"antigorder", PARAM_INT, &p_parsed.antigorder}, + {"maxantig", PARAM_FLOAT, &p_parsed.maxantig}, + {"noagexplosion", PARAM_INT, &p_parsed.noagexplosion}, + {"dancingpart", PARAM_FLOAT, &p_parsed.dancingpart}, + {"dancingpartk", PARAM_INT, &p_parsed.dancingpartk}, + {"velocity", PARAM_FLOAT, &p_parsed.velocity}, + {"numfrq", PARAM_INT, &p_parsed.numfrq}, + {"visc", PARAM_FLOAT, &p_parsed.visc}, + {"rotspeed1", PARAM_FLOAT, &p_parsed.rotspeed1}, + {"rotspeed2", PARAM_FLOAT, &p_parsed.rotspeed2}, + {"strombo", PARAM_FLOAT, &p_parsed.strombo}, + {"numpart", PARAM_INT, &p_parsed.numpart}, + {"size", PARAM_FLOAT, &p_parsed.size}, + {"sizeloudness", PARAM_FLOAT, &p_parsed.sizeloudness}, + {"chance", PARAM_INT, &p_parsed.chance}, + {"duration_f", PARAM_INT, &p_parsed.duration_f}, + {"duration_b", PARAM_INT, &p_parsed.duration_b}, + + {"MaxParticles", PARAM_INT, &ptsNumMax}, + {"IKnowAboutConfigFile", PARAM_INT, &IKnowAboutConfigFile}, +}; +int numpp = sizeof(pp) / sizeof(pp[0]); + +char *nextword(char *&ptr) { char *deb; - while ( *ptr==' ' || *ptr=='\t') + while (*ptr == ' ' || *ptr == '\t') ptr++; deb = ptr; - while ( *ptr!=' ' && *ptr!='\t' && *ptr!='\0' && *ptr!='\n') + while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0' && *ptr != '\n') ptr++; - if(*ptr!=0) + if (*ptr != 0) *ptr++ = 0; return deb; - } -void freeparams() -{ - for(int i=0;isource) { - g_object_unref (priv->source); - priv->source = NULL; - } + if (priv->source) { + g_object_unref(priv->source); + priv->source = NULL; + } - if (priv->target) { - visual_video_unref (priv->target); - priv->target = NULL; - } + if (priv->target) { + visual_video_unref(priv->target); + priv->target = NULL; + } - visual_mem_free (priv->filename); - priv->filename = visual_strdup (filename); + visual_mem_free(priv->filename); + priv->filename = visual_strdup(filename); - priv->source = gdk_pixbuf_new_from_file (filename, NULL); - if (!priv->source) { - visual_log (VISUAL_LOG_ERROR, "Failed to load image from file '%s'", filename); - return FALSE; - } + priv->source = gdk_pixbuf_new_from_file(filename, NULL); + if (!priv->source) { + visual_log(VISUAL_LOG_ERROR, "Failed to load image from file '%s'", + filename); + return FALSE; + } - act_gdkpixbuf_update_image (priv); + act_gdkpixbuf_update_image(priv); - return TRUE; + return TRUE; } -static void act_gdkpixbuf_update_image (PixbufPrivate *priv) -{ - if (priv->target) { - visual_video_unref (priv->target); - priv->target = NULL; - } - - if (!priv->source) { - return; - } - - if (priv->set_scaled) { - GdkInterpType interp; - - switch (priv->interpolate) { - case 0: - interp = GDK_INTERP_NEAREST; - break; - case 1: - interp = GDK_INTERP_TILES; - break; - case 2: - interp = GDK_INTERP_BILINEAR; - break; - case 3: - interp = GDK_INTERP_HYPER; - break; - default: - interp = GDK_INTERP_NEAREST; - break; - } - - int width = 0; - int height = 0; - - if (priv->set_size) { - width = priv->set_width; - height = priv->set_height; - } else if (priv->aspect) { - int rw = gdk_pixbuf_get_width (priv->source); - int rh = gdk_pixbuf_get_height (priv->source); - - if ((priv->width - rw) > (priv->height - rh)) { - height = priv->height; - width = rw * ((float) height / rh); - } else { - width = priv->width; - height = rh * ((float) width / rw); - } - } else { - width = priv->width; - height = priv->height; - } - - if (width == 0 || height == 0) { - return; - } - - priv->target = visvideo_from_scaled_gdkpixbuf (priv->source, width, height, interp); - } else { - priv->target = visvideo_from_gdkpixbuf (priv->source); - } +static void act_gdkpixbuf_update_image(PixbufPrivate *priv) { + if (priv->target) { + visual_video_unref(priv->target); + priv->target = NULL; + } + + if (!priv->source) { + return; + } + + if (priv->set_scaled) { + GdkInterpType interp; + + switch (priv->interpolate) { + case 0: + interp = GDK_INTERP_NEAREST; + break; + case 1: + interp = GDK_INTERP_TILES; + break; + case 2: + interp = GDK_INTERP_BILINEAR; + break; + case 3: + interp = GDK_INTERP_HYPER; + break; + default: + interp = GDK_INTERP_NEAREST; + break; + } + + int width = 0; + int height = 0; + + if (priv->set_size) { + width = priv->set_width; + height = priv->set_height; + } else if (priv->aspect) { + int rw = gdk_pixbuf_get_width(priv->source); + int rh = gdk_pixbuf_get_height(priv->source); + + if ((priv->width - rw) > (priv->height - rh)) { + height = priv->height; + width = rw * ((float)height / rh); + } else { + width = priv->width; + height = rh * ((float)width / rw); + } + } else { + width = priv->width; + height = priv->height; + } + + if (width == 0 || height == 0) { + return; + } + + priv->target = + visvideo_from_scaled_gdkpixbuf(priv->source, width, height, interp); + } else { + priv->target = visvideo_from_gdkpixbuf(priv->source); + } } -static VisVideo *visvideo_from_scaled_gdkpixbuf (GdkPixbuf *src, int width, int height, GdkInterpType interp) -{ - GdkPixbuf *scaled = gdk_pixbuf_scale_simple (src, width, height, interp); - VisVideo *result = visvideo_from_gdkpixbuf (scaled); - g_object_unref (scaled); +static VisVideo *visvideo_from_scaled_gdkpixbuf(GdkPixbuf *src, int width, + int height, + GdkInterpType interp) { + GdkPixbuf *scaled = gdk_pixbuf_scale_simple(src, width, height, interp); + VisVideo *result = visvideo_from_gdkpixbuf(scaled); + g_object_unref(scaled); - return result; + return result; } -static VisVideo *visvideo_from_gdkpixbuf (GdkPixbuf *src) -{ - int width = gdk_pixbuf_get_width (src); - int height = gdk_pixbuf_get_height (src); +static VisVideo *visvideo_from_gdkpixbuf(GdkPixbuf *src) { + int width = gdk_pixbuf_get_width(src); + int height = gdk_pixbuf_get_height(src); - VisVideoDepth depth = visual_video_depth_from_bpp (gdk_pixbuf_get_n_channels (src) * 8); + VisVideoDepth depth = + visual_video_depth_from_bpp(gdk_pixbuf_get_n_channels(src) * 8); - /* Wrap GdkPixbuf's pixel buffer in VisVideo */ - VisVideo *bgr = visual_video_new_wrap_buffer (gdk_pixbuf_get_pixels (src), - FALSE, - width, - height, - depth, - gdk_pixbuf_get_rowstride (src)); + /* Wrap GdkPixbuf's pixel buffer in VisVideo */ + VisVideo *bgr = visual_video_new_wrap_buffer(gdk_pixbuf_get_pixels(src), + FALSE, width, height, depth, + gdk_pixbuf_get_rowstride(src)); - /* Flip RGB byte order */ - VisVideo *target = visual_video_new_with_buffer (width, height, depth); - visual_video_flip_pixel_bytes (target, bgr); + /* Flip RGB byte order */ + VisVideo *target = visual_video_new_with_buffer(width, height, depth); + visual_video_flip_pixel_bytes(target, bgr); - visual_video_unref (bgr); + visual_video_unref(bgr); - return target; + return target; } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/EgCommon.h b/libvisual-plugins/plugins/actor/gforce/Common/EgCommon.h index 716404e17..b839f3071 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/EgCommon.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/EgCommon.h @@ -3,37 +3,36 @@ #include - struct Rect { - short left, top, right, bottom; - }; - #define Rect_Defined - - typedef long KeyMap[4]; - - struct Point { - short v, h; - }; - - struct RGBColor { - unsigned short red, green, blue; - }; +struct Rect { + short left, top, right, bottom; +}; +#define Rect_Defined -/* FIXME */ - typedef void * PixMapHandle; - typedef void * GrafPtr; - typedef void * CGrafPtr; - typedef void * WindowPtr; - typedef mfl_context GWorldPtr; - typedef void * BitMap; +typedef long KeyMap[4]; - struct ColorSpec { - short value; - RGBColor rgb; - }; +struct Point { + short v, h; +}; +struct RGBColor { + unsigned short red, green, blue; +}; + +/* FIXME */ +typedef void *PixMapHandle; +typedef void *GrafPtr; +typedef void *CGrafPtr; +typedef void *WindowPtr; +typedef mfl_context GWorldPtr; +typedef void *BitMap; + +struct ColorSpec { + short value; + RGBColor rgb; +}; struct LongRect { - long left, top, right, bottom; + long left, top, right, bottom; }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Arg.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Arg.cpp index fc647b1be..1fa226bf3 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Arg.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Arg.cpp @@ -1,99 +1,72 @@ #include "Arg.h" - #include "UtilStr.h" #include "CEgOStream.h" +Arg::Arg(long inID, long inData, Arg *inNext) { + mID = inID; + mIsStr = false; + mNext = inNext; -Arg::Arg( long inID, long inData, Arg* inNext ) { - - mID = inID; - mIsStr = false; - mNext = inNext; - - Assign( inData ); + Assign(inData); } +Arg::Arg(long inID, const char *inStr, Arg *inNext) { + mID = inID; + mIsStr = true; + mNext = inNext; + mData = 0; - - - -Arg::Arg( long inID, const char* inStr, Arg* inNext ) { - mID = inID; - mIsStr = true; - mNext = inNext; - mData = 0; - - Assign( inStr ); + Assign(inStr); } - - - - - Arg::~Arg() { - if ( mIsStr && mData ) - delete ((UtilStr*) mData); - - if ( mNext ) - delete mNext; -} - - + if (mIsStr && mData) + delete ((UtilStr *)mData); - - - - - -void Arg::Assign( long inData ) { - if ( mIsStr && mData ) - delete ((UtilStr*) mData); - - mIsStr = false; - mData = inData; + if (mNext) + delete mNext; } +void Arg::Assign(long inData) { + if (mIsStr && mData) + delete ((UtilStr *)mData); -void Arg::Assign( const UtilStr* inStr ) { - - if ( inStr ) - Assign( inStr -> getCStr() ); + mIsStr = false; + mData = inData; } +void Arg::Assign(const UtilStr *inStr) { - -void Arg::Assign( const char* inStr ) { - if ( ! mData || ! mIsStr ) - mData = (long) new UtilStr; - - mIsStr = true; - - ((UtilStr*) mData) -> Assign( inStr ); + if (inStr) + Assign(inStr->getCStr()); } +void Arg::Assign(const char *inStr) { + if (!mData || !mIsStr) + mData = (long)new UtilStr; + mIsStr = true; -void Arg::ExportTo( CEgOStream* ioStream ) const { - UtilStr str; - unsigned char c; - - if ( mID > 31 ) { - for ( int d = 0; d <= 24; d += 8 ) { // Go thru each byte in ID num - c = ((mID << d) >> 24 ); - if ( c > 31 && c < 128) - ioStream -> PutByte( c ); - } - ioStream -> PutByte( '=' ); - if ( mIsStr ) - str.AppendAsMeta( (UtilStr*) mData ); - else - str.Append( (long) mData ); - ioStream -> Write( &str ); - } + ((UtilStr *)mData)->Assign(inStr); } - - +void Arg::ExportTo(CEgOStream *ioStream) const { + UtilStr str; + unsigned char c; + + if (mID > 31) { + for (int d = 0; d <= 24; d += 8) { // Go thru each byte in ID num + c = ((mID << d) >> 24); + if (c > 31 && c < 128) + ioStream->PutByte(c); + } + ioStream->PutByte('='); + if (mIsStr) + str.AppendAsMeta((UtilStr *)mData); + else + str.Append((long)mData); + ioStream->Write(&str); + } +} diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/ArgList.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/ArgList.cpp index 0582b2b52..1e05e67ed 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/ArgList.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/ArgList.cpp @@ -5,423 +5,352 @@ #include "CEgOStream.h" #include "CEgIStream.h" +ArgList::ArgList() { mHeadArg = 0; } - - - - -ArgList::ArgList() { - - mHeadArg = 0; -} - - - -ArgList::~ArgList() { - - Clear(); -} - - - +ArgList::~ArgList() { Clear(); } void ArgList::Clear() { - if ( mHeadArg ) { - delete mHeadArg; - mHeadArg = 0; - } + if (mHeadArg) { + delete mHeadArg; + mHeadArg = 0; + } } - - -void ArgList::WriteTo( CEgOStream* ioStream ) { - Arg* arg = mHeadArg; - - ioStream -> PutLong( NumArgs() ); - - while ( arg && ioStream -> noErr() ) { - ioStream -> PutLong( arg -> GetID() ); - if ( arg -> IsStr() ) { - ioStream -> PutByte( '$' ); - ((UtilStr*) arg -> GetData()) -> WriteTo( ioStream ); } - else { - ioStream -> PutByte( '#' ); - ioStream -> PutLong( arg -> GetData() ); - } - arg = arg -> mNext; - } +void ArgList::WriteTo(CEgOStream *ioStream) { + Arg *arg = mHeadArg; + + ioStream->PutLong(NumArgs()); + + while (arg && ioStream->noErr()) { + ioStream->PutLong(arg->GetID()); + if (arg->IsStr()) { + ioStream->PutByte('$'); + ((UtilStr *)arg->GetData())->WriteTo(ioStream); + } else { + ioStream->PutByte('#'); + ioStream->PutLong(arg->GetData()); + } + arg = arg->mNext; + } } - -void ArgList::ReadFrom( CEgIStream* ioStream ) { - long ID, n; - UtilStr str; - - for ( n = ioStream -> GetLong(); n > 0 && ioStream -> noErr() ; n-- ) { - ID = ioStream -> GetLong(); - if ( ioStream -> GetByte() == '#' ) - SetArg( ID, ioStream -> GetLong() ); - else { - str.ReadFrom( ioStream ); - SetArg( ID, str ); - } - } +void ArgList::ReadFrom(CEgIStream *ioStream) { + long ID, n; + UtilStr str; + + for (n = ioStream->GetLong(); n > 0 && ioStream->noErr(); n--) { + ID = ioStream->GetLong(); + if (ioStream->GetByte() == '#') + SetArg(ID, ioStream->GetLong()); + else { + str.ReadFrom(ioStream); + SetArg(ID, str); + } + } } - - long ArgList::NumArgs() const { - long n = 0; - Arg* arg = mHeadArg; - - while ( arg ) { - arg = arg -> mNext; - n++; - } - - return n; -} - - - -Arg* ArgList::FetchArg( unsigned long inID ) const { - Arg* arg = mHeadArg; + long n = 0; + Arg *arg = mHeadArg; - while ( arg ) { - if ( arg -> GetID() == inID ) - return arg; - arg = arg -> mNext; - } + while (arg) { + arg = arg->mNext; + n++; + } - return 0; + return n; } +Arg *ArgList::FetchArg(unsigned long inID) const { + Arg *arg = mHeadArg; + while (arg) { + if (arg->GetID() == inID) + return arg; + arg = arg->mNext; + } - - - -void ArgList::DeleteArg( unsigned long inArgID ) { - Arg* prev = 0, *arg = mHeadArg; - - while ( arg ) { - if ( arg -> GetID() == inArgID ) { - if ( prev ) - prev -> mNext = arg -> mNext; - else - mHeadArg = arg -> mNext; - arg -> mNext = 0; - delete arg; - arg = 0; } - else { - prev = arg; - arg = arg -> mNext; - } - } + return 0; } - - -void ArgList::SetArg( unsigned long inArgID, long inArg ) { - Arg* arg = FetchArg( inArgID ); - if ( arg ) - arg -> Assign( inArg ); - else - mHeadArg = new Arg( inArgID, inArg, mHeadArg ); +void ArgList::DeleteArg(unsigned long inArgID) { + Arg *prev = 0, *arg = mHeadArg; + + while (arg) { + if (arg->GetID() == inArgID) { + if (prev) + prev->mNext = arg->mNext; + else + mHeadArg = arg->mNext; + arg->mNext = 0; + delete arg; + arg = 0; + } else { + prev = arg; + arg = arg->mNext; + } + } } +void ArgList::SetArg(unsigned long inArgID, long inArg) { + Arg *arg = FetchArg(inArgID); + if (arg) + arg->Assign(inArg); + else + mHeadArg = new Arg(inArgID, inArg, mHeadArg); +} - -void ArgList::SetArg( unsigned long inArgID, const UtilStr& inArg ) { - SetArg( inArgID, inArg.getCStr() ); +void ArgList::SetArg(unsigned long inArgID, const UtilStr &inArg) { + SetArg(inArgID, inArg.getCStr()); } +void ArgList::SetArg(unsigned long inArgID, const char *inArgStr) { + Arg *arg = FetchArg(inArgID); -void ArgList::SetArg( unsigned long inArgID, const char* inArgStr ) { - Arg* arg = FetchArg( inArgID ); - - if ( arg ) - arg -> Assign( inArgStr ); - else - mHeadArg = new Arg( inArgID, inArgStr, mHeadArg ); + if (arg) + arg->Assign(inArgStr); + else + mHeadArg = new Arg(inArgID, inArgStr, mHeadArg); } +bool ArgList::GetArg(unsigned long inArgID, UtilStr &outStr) const { + Arg *arg = FetchArg(inArgID); + outStr.Wipe(); + if (arg) { + if (arg->IsStr()) + outStr.Assign((UtilStr *)arg->GetData()); + else // Allows calling for strings if you're not sure the Arg is a long of + // not + outStr.Assign((long)arg->GetData()); + return true; + } -bool ArgList::GetArg( unsigned long inArgID, UtilStr& outStr ) const { - Arg* arg = FetchArg( inArgID ); - - outStr.Wipe(); - - if ( arg ) { - if ( arg -> IsStr() ) - outStr.Assign( (UtilStr*) arg -> GetData() ); - else // Allows calling for strings if you're not sure the Arg is a long of not - outStr.Assign( (long) arg -> GetData() ); - - return true; - } - - return false; + return false; } +long ArgList::GetArraySize(unsigned long inID) const { + long i = 0; + + while (FetchArg(IndexedID2ID(inID, i))) { + i++; + } -long ArgList::GetArraySize( unsigned long inID ) const { - long i = 0; - - while ( FetchArg( IndexedID2ID( inID, i ) ) ) { - i++; - } - - return i; + return i; } +long ArgList::IndexedID2ID(long inBaseID, long inIndex) { + long id = inBaseID; -long ArgList::IndexedID2ID( long inBaseID, long inIndex ) { - long id = inBaseID; - + if (inIndex >= 100) { + id = (id << 8) | ((inIndex / 100) + '0'); + inIndex = inIndex % 100; + } - if ( inIndex >= 100 ) { - id = ( id << 8 ) | ( ( inIndex / 100 ) + '0' ); - inIndex = inIndex % 100; - } + if (inIndex >= 10) { + id = (id << 8) | ((inIndex / 10) + '0'); + inIndex = inIndex % 10; + } - if ( inIndex >= 10 ) { - id = ( id << 8 ) | ( ( inIndex / 10 ) + '0' ); - inIndex = inIndex % 10; - } - - id = ( id << 8 ) | ( inIndex + '0' ); + id = (id << 8) | (inIndex + '0'); - return id; + return id; } +const UtilStr *ArgList::GetStr(unsigned long inArgID) const { + Arg *arg = FetchArg(inArgID); + if (arg) { + if (arg->IsStr()) + return (UtilStr *)arg->GetData(); + } + return 0; +} +double ArgList::GetFloat(unsigned long inArgID) const { + Arg *arg = FetchArg(inArgID); + if (arg) { + if (arg->IsStr()) + return ((UtilStr *)arg->GetData())->GetFloatValue(); + } -const UtilStr* ArgList::GetStr( unsigned long inArgID ) const { - Arg* arg = FetchArg( inArgID ); - - if ( arg ) { - if ( arg -> IsStr() ) - return (UtilStr*) arg -> GetData(); - } - - return 0; + return 0; } +bool ArgList::GetArg(unsigned long inArgID, bool &outArg) const { + Arg *arg = FetchArg(inArgID); + bool found = false; + outArg = false; + if (arg) { + found = !arg->IsStr(); + if (found) + outArg = arg->GetData() != 0; + } -double ArgList::GetFloat( unsigned long inArgID ) const { - Arg* arg = FetchArg( inArgID ); - - if ( arg ) { - if ( arg -> IsStr() ) - return ( (UtilStr*) arg -> GetData() ) -> GetFloatValue(); - } - - return 0; + return found; } +bool ArgList::GetArg(unsigned long inArgID, long &outArg) const { + Arg *arg = FetchArg(inArgID); + bool found = false; + if (arg) { + found = !arg->IsStr(); + if (found) + outArg = arg->GetData(); + } + if (!found) + outArg = 0; - - -bool ArgList::GetArg( unsigned long inArgID, bool& outArg ) const { - Arg* arg = FetchArg( inArgID ); - bool found = false; - - outArg = false; - - if ( arg ) { - found = ! arg -> IsStr(); - if ( found ) - outArg = arg -> GetData() != 0; - } - - return found; + return found; } +long ArgList::GetArg(unsigned long inArgID) const { + Arg *arg = FetchArg(inArgID); + if (arg) { + if (!arg->IsStr()) + return arg->GetData(); + else + return ((UtilStr *)arg->GetData())->GetValue(); + } -bool ArgList::GetArg( unsigned long inArgID, long& outArg ) const { - Arg* arg = FetchArg( inArgID ); - bool found = false; - - if ( arg ) { - found = ! arg -> IsStr(); - if ( found ) - outArg = arg -> GetData(); - } - - if ( ! found ) - outArg = 0; - - return found; -} - - - -long ArgList::GetArg( unsigned long inArgID ) const { - Arg* arg = FetchArg( inArgID ); - - if ( arg ) { - if ( ! arg -> IsStr() ) - return arg -> GetData(); - else - return ( (UtilStr*) arg -> GetData() ) -> GetValue(); - } - - return 0; + return 0; } - - - - -void ArgList::SetArgs( const ArgList& inArgs ) { - Arg* arg = inArgs.mHeadArg; - long data; - long id; - - while ( arg ) { - id = arg -> GetID(); - data = arg -> GetData(); - if ( arg -> IsStr() ) - SetArg( id, (UtilStr*) data ); - else - SetArg( id, data ); - arg = arg -> mNext; - } -} - - -void ArgList::SetArgs( const char* curPtr, long inLen ) { - const char* lastPtr; - const char* endPtr = curPtr; - long ID; - bool terminated, isStr; - UtilStr s; - - if ( inLen > 0 ) - endPtr = curPtr + inLen; - else { - endPtr = curPtr; - while ( *endPtr ) - endPtr++; - } - - do { // Loop thru each arg in the str - terminated = true; - - // When we're not inside a string, igrore oddball/whitespace chars (chars <= 32) - while ( curPtr < endPtr && *curPtr <= ' ' ) - curPtr++; - lastPtr = curPtr; - - - while ( curPtr < endPtr && ( *curPtr != cArgSeparator || ! terminated ) ) { - if ( *curPtr == '"' ) - terminated = ! terminated; // Toggle string acceptance - curPtr++; - } - - // Extract the 4 byte ID... - ID = 0; - while ( *lastPtr != '=' && *lastPtr != '-' && curPtr > lastPtr ) { - ID = (ID << 8) | ((unsigned long) *lastPtr); - lastPtr++; - } - lastPtr++; // Skip the '=' - isStr = *lastPtr == '\"'; // This arg is a string if we see a " - if ( curPtr > lastPtr ) { - if ( isStr ) { - s.Wipe(); - s.AppendFromMeta( lastPtr, curPtr - lastPtr ); - SetArg( ID, s ); } - else { - s.Assign( lastPtr, curPtr - lastPtr ); - SetArg( ID, s.GetValue() ); - } - } - curPtr++; - } while ( curPtr < endPtr ); +void ArgList::SetArgs(const ArgList &inArgs) { + Arg *arg = inArgs.mHeadArg; + long data; + long id; + + while (arg) { + id = arg->GetID(); + data = arg->GetData(); + if (arg->IsStr()) + SetArg(id, (UtilStr *)data); + else + SetArg(id, data); + arg = arg->mNext; + } } - - -void ArgList::SetArgs( CEgIStream* inStream ) { - UtilStr str, configText; - long numQuotes, pos, i, end; - - - if ( inStream -> noErr() ) { - - // Read and chuck any comments - while ( inStream -> noErr() ) { - inStream -> Readln( str ); - pos = 1; - numQuotes = 0; - do { - i = str.contains( "//", 2, pos - 1 ); - for ( ; pos <= i; pos++ ) { - if ( str.getChar( pos ) == '\"' ) - numQuotes++; - } - } while ( numQuotes % 2 == 1 && i > 0 ); - - if ( i > 0 ) - str.Keep( i - 1 ); - configText.Append( str ); - } - inStream -> throwErr( cNoErr ); - - // Remove block comments - do { - i = configText.contains( "/*" ); - if ( i > 0 ) { - end = configText.contains( "*/" ); - if ( end > 0 ) - configText.Remove( i, end - i + 2 ); - } - } while ( i > 0 && end > 0 ); - - // Parse the args/dict... - SetArgs( configText ); - } +void ArgList::SetArgs(const char *curPtr, long inLen) { + const char *lastPtr; + const char *endPtr = curPtr; + long ID; + bool terminated, isStr; + UtilStr s; + + if (inLen > 0) + endPtr = curPtr + inLen; + else { + endPtr = curPtr; + while (*endPtr) + endPtr++; + } + + do { // Loop thru each arg in the str + terminated = true; + + // When we're not inside a string, igrore oddball/whitespace chars (chars <= + // 32) + while (curPtr < endPtr && *curPtr <= ' ') + curPtr++; + lastPtr = curPtr; + + while (curPtr < endPtr && (*curPtr != cArgSeparator || !terminated)) { + if (*curPtr == '"') + terminated = !terminated; // Toggle string acceptance + curPtr++; + } + + // Extract the 4 byte ID... + ID = 0; + while (*lastPtr != '=' && *lastPtr != '-' && curPtr > lastPtr) { + ID = (ID << 8) | ((unsigned long)*lastPtr); + lastPtr++; + } + lastPtr++; // Skip the '=' + isStr = *lastPtr == '\"'; // This arg is a string if we see a " + if (curPtr > lastPtr) { + if (isStr) { + s.Wipe(); + s.AppendFromMeta(lastPtr, curPtr - lastPtr); + SetArg(ID, s); + } else { + s.Assign(lastPtr, curPtr - lastPtr); + SetArg(ID, s.GetValue()); + } + } + curPtr++; + } while (curPtr < endPtr); } +void ArgList::SetArgs(CEgIStream *inStream) { + UtilStr str, configText; + long numQuotes, pos, i, end; + + if (inStream->noErr()) { + + // Read and chuck any comments + while (inStream->noErr()) { + inStream->Readln(str); + pos = 1; + numQuotes = 0; + do { + i = str.contains("//", 2, pos - 1); + for (; pos <= i; pos++) { + if (str.getChar(pos) == '\"') + numQuotes++; + } + } while (numQuotes % 2 == 1 && i > 0); + + if (i > 0) + str.Keep(i - 1); + configText.Append(str); + } + inStream->throwErr(cNoErr); + + // Remove block comments + do { + i = configText.contains("/*"); + if (i > 0) { + end = configText.contains("*/"); + if (end > 0) + configText.Remove(i, end - i + 2); + } + } while (i > 0 && end > 0); + + // Parse the args/dict... + SetArgs(configText); + } +} +void ArgList::ExportTo(UtilStr &ioStr, bool inLineBreaks) const { + CEgOStream ostream; - - -void ArgList::ExportTo( UtilStr& ioStr, bool inLineBreaks ) const { - CEgOStream ostream; - - ExportTo( &ostream, inLineBreaks ); - ostream.mOBuf.Swap( ioStr ); -} - - - -void ArgList::ExportTo( CEgOStream* ioStream, bool inLineBreaks ) const { - Arg* arg = mHeadArg; - - while (arg) { - arg -> ExportTo( ioStream ); - arg = arg -> mNext; - if ( arg ) { - ioStream -> PutByte( cArgSeparator ); - if ( inLineBreaks ) - ioStream -> Writeln(); - } - } -} + ExportTo(&ostream, inLineBreaks); + ostream.mOBuf.Swap(ioStr); +} +void ArgList::ExportTo(CEgOStream *ioStream, bool inLineBreaks) const { + Arg *arg = mHeadArg; + + while (arg) { + arg->ExportTo(ioStream); + arg = arg->mNext; + if (arg) { + ioStream->PutByte(cArgSeparator); + if (inLineBreaks) + ioStream->Writeln(); + } + } +} diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/FileSpecList.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/FileSpecList.cpp index 2d55444a8..9555e4eee 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/FileSpecList.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/FileSpecList.cpp @@ -2,69 +2,50 @@ #include "CEgFileSpec.h" +FileSpecList::FileSpecList(XStrListOptsT inOption, ListOrderingT inOrdering) + : mSpecs(cOrderImportant), mSpecNames(inOption, inOrdering) {} +FileSpecList::~FileSpecList() { RemoveAll(); } +void FileSpecList::RemoveAll() { + CEgFileSpec *spec; -FileSpecList::FileSpecList( XStrListOptsT inOption, ListOrderingT inOrdering ) : - mSpecs( cOrderImportant ), - mSpecNames( inOption, inOrdering ) { - -} - - - -FileSpecList::~FileSpecList() { - RemoveAll(); -} - - + while (mSpecs.FetchLast((void **)(&spec))) { + delete spec; + mSpecs.RemoveLast(); + } -void FileSpecList::RemoveAll() { - CEgFileSpec* spec; - - while ( mSpecs.FetchLast( (void **)(&spec) ) ) { - delete spec; - mSpecs.RemoveLast(); - } - - mSpecNames.RemoveAll(); + mSpecNames.RemoveAll(); } +long FileSpecList::AddCopy(const CEgFileSpec &inSpec) { + UtilStr name; + long idx; + inSpec.GetFileName(name); + idx = mSpecNames.Add(name); + if (idx > 0) + mSpecs.Add(new CEgFileSpec(inSpec), idx - 1); -long FileSpecList::AddCopy( const CEgFileSpec& inSpec ) { - UtilStr name; - long idx; - - inSpec.GetFileName( name ); - idx = mSpecNames.Add( name ); - if ( idx > 0 ) - mSpecs.Add( new CEgFileSpec( inSpec ), idx - 1 ); - - return idx; + return idx; } - -const CEgFileSpec* FileSpecList::FetchSpec( int inIndex ) const { - return (CEgFileSpec*) mSpecs.Fetch( inIndex ); +const CEgFileSpec *FileSpecList::FetchSpec(int inIndex) const { + return (CEgFileSpec *)mSpecs.Fetch(inIndex); } - -bool FileSpecList::FetchSpecName( int inIndex, UtilStr& outStr ) const { - return mSpecNames.Fetch( inIndex, outStr ); +bool FileSpecList::FetchSpecName(int inIndex, UtilStr &outStr) const { + return mSpecNames.Fetch(inIndex, outStr); } -const UtilStr* FileSpecList::FetchSpecName( int inIndex ) const { - return mSpecNames.Fetch( inIndex ); +const UtilStr *FileSpecList::FetchSpecName(int inIndex) const { + return mSpecNames.Fetch(inIndex); } - -long FileSpecList::FetchBestMatch( const UtilStr& inStr ) { - return mSpecNames.FetchBestMatch( inStr ); +long FileSpecList::FetchBestMatch(const UtilStr &inStr) { + return mSpecNames.FetchBestMatch(inStr); } - - -long FileSpecList::Lookup( UtilStr& inName ) const { - return mSpecNames.FindIndexOf( inName ); +long FileSpecList::Lookup(UtilStr &inName) const { + return mSpecNames.FindIndexOf(inName); } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Hashtable.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Hashtable.cpp index 91d1f6ec3..4c52d318e 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Hashtable.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Hashtable.cpp @@ -3,326 +3,291 @@ #include - - -long Hashtable::sTableSizes[ NUM_SIZES ] = { 23, 97, 397, 797, 3203, 6421, 12853, 51437, 205759, 411527, 1646237, 3292489, 6584983, 13169977, 52679969 }; - -#define _MIN( a, b ) ( (a) > (b) ? (b) : (a) ) - - -Hashtable::Hashtable( bool inKeysOwned, int inLoadFactor ) { - mKeysOwned = inKeysOwned; - mTableSize = 0; - mTable = 0; - mNumEntries = 0; - mThreshold = 0; - mLoadFactor = inLoadFactor; - - // Don't let the client kill himself with a bad load factor - if ( mLoadFactor > 100 ) - mLoadFactor = 100; - else if ( mLoadFactor < 10 ) - mLoadFactor = 10; - - Rehash(); +long Hashtable::sTableSizes[NUM_SIZES] = { + 23, 97, 397, 797, 3203, 6421, 12853, 51437, + 205759, 411527, 1646237, 3292489, 6584983, 13169977, 52679969}; + +#define _MIN(a, b) ((a) > (b) ? (b) : (a)) + +Hashtable::Hashtable(bool inKeysOwned, int inLoadFactor) { + mKeysOwned = inKeysOwned; + mTableSize = 0; + mTable = 0; + mNumEntries = 0; + mThreshold = 0; + mLoadFactor = inLoadFactor; + + // Don't let the client kill himself with a bad load factor + if (mLoadFactor > 100) + mLoadFactor = 100; + else if (mLoadFactor < 10) + mLoadFactor = 10; + + Rehash(); } - Hashtable::~Hashtable() { - RemoveAll(); + RemoveAll(); - if ( mTable ) - delete []mTable; + if (mTable) + delete[] mTable; } - void Hashtable::Rehash() { - long index; - unsigned long oldSize = mTableSize; - KEntry * temp; - KEntry * entry; - KEntry** oldTable = mTable; - - // Find the next bigger table size - for (unsigned long i = 0; mTableSize <= oldSize; i++ ) - mTableSize = sTableSizes[ i ]; - - - // Alloc the new table and make it empty - mTable = new KEntry*[ mTableSize ]; - for (unsigned long i = 0; i < mTableSize; i++ ) - mTable[ i ] = 0; - - // Rehash all the old values into the new table - for (unsigned long i = 0; i < oldSize; i++ ) { - for ( entry = oldTable[ i ]; entry; ) { - index = entry -> mKey % mTableSize; - temp = entry -> mNext; - entry -> mNext = mTable[ index ]; - mTable[ index ] = entry; - entry = temp; - } - } - - // Set the new size thet we'll rehash at - mThreshold = mLoadFactor * mTableSize / 100; - - // We don't need the old table anymore - if ( oldTable ) - delete []oldTable; + long index; + unsigned long oldSize = mTableSize; + KEntry *temp; + KEntry *entry; + KEntry **oldTable = mTable; + + // Find the next bigger table size + for (unsigned long i = 0; mTableSize <= oldSize; i++) + mTableSize = sTableSizes[i]; + + // Alloc the new table and make it empty + mTable = new KEntry *[mTableSize]; + for (unsigned long i = 0; i < mTableSize; i++) + mTable[i] = 0; + + // Rehash all the old values into the new table + for (unsigned long i = 0; i < oldSize; i++) { + for (entry = oldTable[i]; entry;) { + index = entry->mKey % mTableSize; + temp = entry->mNext; + entry->mNext = mTable[index]; + mTable[index] = entry; + entry = temp; + } + } + + // Set the new size thet we'll rehash at + mThreshold = mLoadFactor * mTableSize / 100; + + // We don't need the old table anymore + if (oldTable) + delete[] oldTable; } - - - - -void* Hashtable::put( long inKey, const Hashable* inHKey, void* inValue ) { - long index; - KEntry* entry; - void* oldVal; - - // See if we need to make the hash table bigger - if ( mNumEntries >= mThreshold ) - Rehash(); - - // If we already have the key, replace the value and pass the old one back - entry = fetchEntry( inKey, inHKey ); - if ( entry ) { - oldVal = entry -> mValue; - if ( mKeysOwned && inHKey ) - delete inHKey; } - else { - oldVal = 0; - index = ((unsigned long) inKey) % mTableSize; - entry = new KEntry; - entry -> mHashable = inHKey; - entry -> mKey = ((unsigned long) inKey); - entry -> mNext = mTable[ index ]; - mTable[ index ] = entry; - mNumEntries++; - } - - entry -> mValue = inValue; - - return oldVal; +void *Hashtable::put(long inKey, const Hashable *inHKey, void *inValue) { + long index; + KEntry *entry; + void *oldVal; + + // See if we need to make the hash table bigger + if (mNumEntries >= mThreshold) + Rehash(); + + // If we already have the key, replace the value and pass the old one back + entry = fetchEntry(inKey, inHKey); + if (entry) { + oldVal = entry->mValue; + if (mKeysOwned && inHKey) + delete inHKey; + } else { + oldVal = 0; + index = ((unsigned long)inKey) % mTableSize; + entry = new KEntry; + entry->mHashable = inHKey; + entry->mKey = ((unsigned long)inKey); + entry->mNext = mTable[index]; + mTable[index] = entry; + mNumEntries++; + } + + entry->mValue = inValue; + + return oldVal; } +bool Hashtable::Get(long inKey, void **outValue) const { + KEntry *entry = fetchEntry(inKey, 0); + if (entry && outValue) + *outValue = entry->mValue; -bool Hashtable::Get( long inKey, void** outValue ) const { - KEntry* entry = fetchEntry( inKey, 0 ); - - if ( entry && outValue ) - *outValue = entry -> mValue; - - return entry != 0; + return entry != 0; } +bool Hashtable::Get(const Hashable *inKey, void **outValue) const { + KEntry *entry = fetchEntry(inKey->Hash(), inKey); -bool Hashtable::Get( const Hashable* inKey, void** outValue ) const { - KEntry* entry = fetchEntry( inKey -> Hash(), inKey ); - - if ( entry && outValue ) - *outValue = entry -> mValue; + if (entry && outValue) + *outValue = entry->mValue; - return entry != 0; + return entry != 0; } +void Hashtable::GetValues(XPtrList &outValues) { + KEntry **entryP = mTable, *entry; + outValues.RemoveAll(); + outValues.Dim(4); -void Hashtable::GetValues( XPtrList& outValues ) { - KEntry** entryP = mTable, *entry; - - outValues.RemoveAll(); - outValues.Dim( 4 ); + for (unsigned long i = 0; i < mTableSize; i++) { + entry = *entryP; + while (entry) { + outValues.Add(entry->mValue); + entry = entry->mNext; + } - for (unsigned long i = 0; i < mTableSize; i++ ) { - entry = *entryP; - while ( entry ) { - outValues.Add( entry -> mValue ); - entry = entry -> mNext; - } - - entryP++; - } + entryP++; + } } +void Hashtable::GetKeys(XPtrList &outKeys) { + KEntry **entryP = mTable, *entry; -void Hashtable::GetKeys( XPtrList& outKeys ) { - KEntry** entryP = mTable, *entry; - - outKeys.RemoveAll(); - outKeys.Dim( 4 * NumEntries() ); + outKeys.RemoveAll(); + outKeys.Dim(4 * NumEntries()); - for (unsigned long i = 0; i < mTableSize; i++ ) { - entry = *entryP; - while ( entry ) { - outKeys.Add( ( entry -> mHashable ) ? entry -> mHashable : (const Hashable*) entry -> mKey ); - entry = entry -> mNext; - } + for (unsigned long i = 0; i < mTableSize; i++) { + entry = *entryP; + while (entry) { + outKeys.Add((entry->mHashable) ? entry->mHashable + : (const Hashable *)entry->mKey); + entry = entry->mNext; + } - entryP++; - } + entryP++; + } } - - - -KEntry* Hashtable::fetchEntry( long inKey, const Hashable* inHKey ) const { - long index = ( (unsigned long) inKey ) % mTableSize; - KEntry* entry = mTable[ index ]; - - // Look thru the chain for the key and the entry holding that key-value pair - while ( entry ) { - if ( entry -> mKey == inKey ) { - if ( ! entry -> mHashable || ! inHKey ) - return entry; - else if ( inHKey -> Equals( entry -> mHashable ) ) - return entry; - } - entry = entry -> mNext; - } - - return 0; +KEntry *Hashtable::fetchEntry(long inKey, const Hashable *inHKey) const { + long index = ((unsigned long)inKey) % mTableSize; + KEntry *entry = mTable[index]; + + // Look thru the chain for the key and the entry holding that key-value pair + while (entry) { + if (entry->mKey == inKey) { + if (!entry->mHashable || !inHKey) + return entry; + else if (inHKey->Equals(entry->mHashable)) + return entry; + } + entry = entry->mNext; + } + + return 0; } - - - - - void Hashtable::RemoveAll() { - KEntry* entry, *temp; - - // Step theu the dict table and delete all the KEntries - for ( unsigned long i = 0; i < mTableSize; i++ ) { - for ( entry = mTable[ i ]; entry; ) { - if ( mKeysOwned && entry -> mHashable ) - delete entry -> mHashable; - temp = entry -> mNext; - delete entry; - entry = temp; - } - mTable[ i ] = 0; - } - mNumEntries = 0; + KEntry *entry, *temp; + + // Step theu the dict table and delete all the KEntries + for (unsigned long i = 0; i < mTableSize; i++) { + for (entry = mTable[i]; entry;) { + if (mKeysOwned && entry->mHashable) + delete entry->mHashable; + temp = entry->mNext; + delete entry; + entry = temp; + } + mTable[i] = 0; + } + mNumEntries = 0; } - - -void* Hashtable::remove( long inKey, const Hashable* inHKey ) { - long index = ( (unsigned long) inKey ) % mTableSize; - KEntry* entry = mTable[ index ], *prev = 0; - bool isEqual; - void* retVal; - - // Look thru the chain for a matching key and delete it - while ( entry ) { - if ( entry -> mKey == inKey ) { - if ( inHKey && entry -> mHashable ) - isEqual = inHKey -> Equals( entry -> mHashable ); - else - isEqual = true; - - if ( isEqual ) { - if ( mKeysOwned && entry -> mHashable ) - delete entry -> mHashable; - - if ( prev == 0 ) - mTable[ index ] = 0; - else - prev -> mNext = entry -> mNext; - retVal = entry -> mValue; - delete entry; - mNumEntries--; - return retVal; - } - } - prev = entry; - entry = entry -> mNext; - } - - return 0; +void *Hashtable::remove(long inKey, const Hashable *inHKey) { + long index = ((unsigned long)inKey) % mTableSize; + KEntry *entry = mTable[index], *prev = 0; + bool isEqual; + void *retVal; + + // Look thru the chain for a matching key and delete it + while (entry) { + if (entry->mKey == inKey) { + if (inHKey && entry->mHashable) + isEqual = inHKey->Equals(entry->mHashable); + else + isEqual = true; + + if (isEqual) { + if (mKeysOwned && entry->mHashable) + delete entry->mHashable; + + if (prev == 0) + mTable[index] = 0; + else + prev->mNext = entry->mNext; + retVal = entry->mValue; + delete entry; + mNumEntries--; + return retVal; + } + } + prev = entry; + entry = entry->mNext; + } + + return 0; } +long &Hashtable::operator[](const long inKey) { + KEntry *entry = fetchEntry(inKey, 0); + if (!entry) { + Put(inKey, 0); + entry = fetchEntry(inKey, 0); + } -long& Hashtable::operator[] ( const long inKey ) { - KEntry* entry = fetchEntry( inKey, 0 ); - - if ( ! entry ) { - Put( inKey, 0 ); - entry = fetchEntry( inKey, 0 ); - } - - return * (long *) entry -> mValue; + return *(long *)entry->mValue; } +void *&Hashtable::operator[](const void *inKey) { + KEntry *entry = fetchEntry((long)inKey, 0); + if (!entry) { + Put((long)inKey, 0); + entry = fetchEntry((long)inKey, 0); + } -void*& Hashtable::operator[] ( const void* inKey ) { - KEntry* entry = fetchEntry( (long) inKey, 0 ); - - if ( ! entry ) { - Put( (long) inKey, 0 ); - entry = fetchEntry( (long) inKey, 0 ); - } - - return entry -> mValue; + return entry->mValue; } - - - - - -void Hashtable::Rank( XPtrList& outKeys, CompFunctionT inCompFcn, unsigned long inNumToRank ) { - unsigned long n = NumEntries(); - KEntry** entryP = mTable, *entry; - const void **p, **temp = new const void*[ 2 * n ]; - - if ( inNumToRank < 0 ) - inNumToRank = n; - inNumToRank = _MIN( inNumToRank, n ); - - // To rank, we must sort by value, with a tag on each element of its key - p = temp; - for ( unsigned long i = 0; i < mTableSize; i++ ) { - entry = *entryP; - while ( entry ) { - *p = entry -> mValue; - p++; - *p = ( entry -> mHashable ) ? entry -> mHashable : (const void*) entry -> mKey; - p++; - entry = entry -> mNext; - } - - entryP++; - } - - // Default to long-long ranking - if ( ! inCompFcn ) - inCompFcn = sLongComparitor; - - // Sort the floats - qsort( temp, n, 8, inCompFcn ); - - // Put the sorted results in the destination - outKeys.RemoveAll(); - p = temp + 1; - for ( unsigned long i = 0; i < n; i++ ) { - outKeys.Add( *p ); - p += 2; - } - - // Cleanup - delete []temp; +void Hashtable::Rank(XPtrList &outKeys, CompFunctionT inCompFcn, + unsigned long inNumToRank) { + unsigned long n = NumEntries(); + KEntry **entryP = mTable, *entry; + const void **p, **temp = new const void *[2 * n]; + + if (inNumToRank < 0) + inNumToRank = n; + inNumToRank = _MIN(inNumToRank, n); + + // To rank, we must sort by value, with a tag on each element of its key + p = temp; + for (unsigned long i = 0; i < mTableSize; i++) { + entry = *entryP; + while (entry) { + *p = entry->mValue; + p++; + *p = (entry->mHashable) ? entry->mHashable : (const void *)entry->mKey; + p++; + entry = entry->mNext; + } + + entryP++; + } + + // Default to long-long ranking + if (!inCompFcn) + inCompFcn = sLongComparitor; + + // Sort the floats + qsort(temp, n, 8, inCompFcn); + + // Put the sorted results in the destination + outKeys.RemoveAll(); + p = temp + 1; + for (unsigned long i = 0; i < n; i++) { + outKeys.Add(*p); + p += 2; + } + + // Cleanup + delete[] temp; } - - - - -int Hashtable::sLongComparitor( const void* inA, const void* inB ) { - return ((long) inB - (long) inA); +int Hashtable::sLongComparitor(const void *inA, const void *inB) { + return ((long)inB - (long)inA); } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Arg.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Arg.h index 1190e8d8e..a6a00e94a 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Arg.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Arg.h @@ -9,32 +9,28 @@ class CEgOStream; class Arg { - - public: - Arg( long inID, long inData, Arg* inNext ); - Arg( long inID, const char* inStr, Arg* inNext ); - ~Arg(); - - void Assign( long inData ); - void Assign( const UtilStr* inStr ); - void Assign( const char* inStr ); - - void ExportTo( CEgOStream* ioStream ) const; - - - inline unsigned long GetID() const { return mID; } - inline bool IsStr() const { return mIsStr; } - inline long GetData() const { return mData; } - - - protected: - unsigned long mID; - bool mIsStr; - long mData; - - public: - Arg* mNext; -}; +public: + Arg(long inID, long inData, Arg *inNext); + Arg(long inID, const char *inStr, Arg *inNext); + ~Arg(); + + void Assign(long inData); + void Assign(const UtilStr *inStr); + void Assign(const char *inStr); + + void ExportTo(CEgOStream *ioStream) const; + inline unsigned long GetID() const { return mID; } + inline bool IsStr() const { return mIsStr; } + inline long GetData() const { return mData; } + +protected: + unsigned long mID; + bool mIsStr; + long mData; + +public: + Arg *mNext; +}; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ArgList.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ArgList.h index b2397a11a..e06ef83e7 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ArgList.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ArgList.h @@ -9,88 +9,99 @@ class Arg; class CEgOStream; class CEgIStream; - -class ArgList { - - public: - ArgList(); - virtual ~ArgList(); - - // Post: Adds any args in the given string meta line to this arg list. Note that if arg 'blah' is in this list - // and someone calls this.SetArgs( "hi=123,bye=345" ), then 'blah' is still in this list and has the original - // value it had before the call to SetArgs(). - // Note: An example of a meta arg list: hi=123,name="sally",andy="really cool" - // Note: This call is functionally the same as: ArgList temp; temp.SetArgs( str ); this.SetArgs( temp ); - // Note: In the above example, if you wanted to get rid of blah (and all other args before the Set, call Clear()) - // Note: For SetArgs( char*, long ), len == -1 means that the length will be computed. - void SetArgs( const UtilStr& inArgList ) { SetArgs( inArgList.getCStr(), inArgList.length() ); } - void SetArgs( const char* inArgList, long inLen = -1 ); - - // A more flexible version of SetArgs() than above. This ignores line breaks, "//" comments, and "/*"-"*/" block comments. - void SetArgs( CEgIStream* inStream ); - - // Post: Similar to above except that the arg list is already in the form of an arg list. - void SetArgs( const ArgList& inArgs ); - - // Appends/Exports the args in this list to a meta string format. This means all chars in the string - // will be above or equal to 0x20 and less than 0x80. - // Post: If inLineBreaks is true, a CR/LF is put after each arg - void ExportTo( UtilStr& ioStr, bool inLineBreaks = false ) const; - void ExportTo( CEgOStream* ioStream, bool inLineBreaks = false ) const; - - // Writes this arg list to a stream, with no regard to byte range (in contrast to ExportTo, where all the - // output bytes are >= 0x20 and < 0x80 - void WriteTo( CEgOStream* ioStream ); - void ReadFrom( CEgIStream* ioStream ); - - // Removes all args from this argList - void Clear(); - - - void DeleteArg( unsigned long inArgID ); - - // Pre: No byte in can be a -, =, or " - void SetArg( unsigned long inArgID, long inArg ); - void SetArg( unsigned long inArgID, const UtilStr& inArg ); - void SetArg( unsigned long inArgID, const char* inArgStr ); - - - - // Post: The specified argument is fetched and transferred to . - // Note: If the arg is found, true is returned, else false is returned and is zeroed. - // Note: If the arg is found and is a string, GetArg( long, UtilStr& ) puts a copy of the arg's string in the argument. - // If the arg is found and is a long, GetArg( long, UtilStr& ) stores a string of the long (in base 10) - inline bool ArgExists( unsigned long inArgID ) const { return FetchArg( inArgID ) != 0; } - bool GetArg( unsigned long inArgID, bool& outArg ) const; +class ArgList { + +public: + ArgList(); + virtual ~ArgList(); + + // Post: Adds any args in the given string meta line to this arg list. + // Note that if arg 'blah' is in this list and someone calls this.SetArgs( + // "hi=123,bye=345" ), then 'blah' is still in this list and has the original + // value it had before the call to SetArgs(). + // Note: An example of a meta arg list: hi=123,name="sally",andy="really + //cool" Note: This call is functionally the same as: ArgList temp; + //temp.SetArgs( str ); this.SetArgs( temp ); Note: In the above example, if + //you wanted to get rid of blah (and all other args before the Set, call + //Clear()) + // Note: For SetArgs( char*, long ), len == -1 means that the length will + //be computed. + void SetArgs(const UtilStr &inArgList) { + SetArgs(inArgList.getCStr(), inArgList.length()); + } + void SetArgs(const char *inArgList, long inLen = -1); + + // A more flexible version of SetArgs() than above. This ignores line + //breaks, "//" comments, and "/*"-"*/" block comments. + void SetArgs(CEgIStream *inStream); + + // Post: Similar to above except that the arg list is already in the form + //of an arg list. + void SetArgs(const ArgList &inArgs); + + // Appends/Exports the args in this list to a meta string format. This means + // all chars in the string + // will be above or equal to 0x20 and less than 0x80. + // Post: If inLineBreaks is true, a CR/LF is put after each arg + void ExportTo(UtilStr &ioStr, bool inLineBreaks = false) const; + void ExportTo(CEgOStream *ioStream, bool inLineBreaks = false) const; + + // Writes this arg list to a stream, with no regard to byte range (in contrast + // to ExportTo, where all the + // output bytes are >= 0x20 and < 0x80 + void WriteTo(CEgOStream *ioStream); + void ReadFrom(CEgIStream *ioStream); + + // Removes all args from this argList + void Clear(); + + void DeleteArg(unsigned long inArgID); + + // Pre: No byte in can be a -, =, or " + void SetArg(unsigned long inArgID, long inArg); + void SetArg(unsigned long inArgID, const UtilStr &inArg); + void SetArg(unsigned long inArgID, const char *inArgStr); + + // Post: The specified argument is fetched and transferred to + //. Note: If the arg is found, true is returned, else false is + //returned and is zeroed. + // Note: If the arg is found and is a string, GetArg( long, UtilStr& ) puts + // a copy of the arg's string in the argument. + // If the arg is found and is a long, GetArg( long, UtilStr& ) stores + // a string of the long (in base 10) + inline bool ArgExists(unsigned long inArgID) const { + return FetchArg(inArgID) != 0; + } + bool GetArg(unsigned long inArgID, bool &outArg) const; #if 0 bool GetArg( unsigned long inArgID, char& outArg ) const; #endif - bool GetArg( unsigned long inArgID, long& outArg ) const; - bool GetArg( unsigned long inArgID, UtilStr& outStr ) const; - bool GetArg( long inID, UtilStr& outStr, long inIndex ) const { return GetArg( IndexedID2ID( inID, inIndex ), outStr ); } - long GetArg( unsigned long inArgID ) const; - double GetFloat( unsigned long inArgID ) const; - const UtilStr* GetStr( unsigned long inArgID ) const; + bool GetArg(unsigned long inArgID, long &outArg) const; + bool GetArg(unsigned long inArgID, UtilStr &outStr) const; + bool GetArg(long inID, UtilStr &outStr, long inIndex) const { + return GetArg(IndexedID2ID(inID, inIndex), outStr); + } + long GetArg(unsigned long inArgID) const; + double GetFloat(unsigned long inArgID) const; + const UtilStr *GetStr(unsigned long inArgID) const; #if 0 inline bool GetArg( unsigned long inArgID, unsigned char& outArg ) const { return GetArg( inArgID, (char&) outArg ); } #endif - inline bool GetArg( unsigned long inArgID, unsigned long& outArg ) const { return GetArg( inArgID, (long&) outArg ); } + inline bool GetArg(unsigned long inArgID, unsigned long &outArg) const { + return GetArg(inArgID, (long &)outArg); + } - long GetArraySize( unsigned long inID ) const; - long NumArgs() const; + long GetArraySize(unsigned long inID) const; + long NumArgs() const; - enum { - cArgSeparator = ',' - }; + enum { cArgSeparator = ',' }; - static long IndexedID2ID( long inBaseID, long inIndex ); + static long IndexedID2ID(long inBaseID, long inIndex); - protected: - Arg* mHeadArg; +protected: + Arg *mHeadArg; - Arg* FetchArg( unsigned long inID ) const; + Arg *FetchArg(unsigned long inID) const; }; - - #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/BST.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/BST.h index 142ce7cb2..e6c1c5c26 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/BST.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/BST.h @@ -3,26 +3,24 @@ class BST { - friend class BST; - - protected: - BST* mLeft; - BST* mRight; - BST* mParent; - - long mKey; - - public: - BST(); - virtual ~BST(); - - - void Detach(); - - BST* Fetch( long inKey ); - - void Insert( BST* inNode ); - + friend class BST; + +protected: + BST *mLeft; + BST *mRight; + BST *mParent; + + long mKey; + +public: + BST(); + virtual ~BST(); + + void Detach(); + + BST *Fetch(long inKey); + + void Insert(BST *inNode); }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/CStrNode.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/CStrNode.h index c064fcb8c..fe18cd396 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/CStrNode.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/CStrNode.h @@ -1,23 +1,21 @@ #ifndef _CSTRNODE_ #define _CSTRNODE_ - #include "nodeClass.h" #include "UtilStr.h" -#define VAL(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) +#define VAL(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) class CStrNode : public nodeClass, public UtilStr { - public: - CStrNode( nodeClass* inParent, char* inStr ); - CStrNode( nodeClass* inParent ); - - enum { sClassID = VAL('S','t','r','N') }; +public: + CStrNode(nodeClass *inParent, char *inStr); + CStrNode(nodeClass *inParent); - virtual void ReadFrom( CEgIStream* inStream ); - virtual void WriteTo( CEgOStream* inStream ); + enum { sClassID = VAL('S', 't', 'r', 'N') }; + virtual void ReadFrom(CEgIStream *inStream); + virtual void WriteTo(CEgOStream *inStream); }; #undef VAL diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Clipboard.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Clipboard.h index b8fb56ed7..1b2a989b4 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Clipboard.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Clipboard.h @@ -1,38 +1,35 @@ #ifndef _CLIPBOARD_ #define _CLIPBOARD_ - #include "XLongList.h" #include "XStrList.h" class Clipboard { +public: + Clipboard(); - public: - Clipboard(); - - // Post: Empties the clipboard. - void Clear(); - - // Post: Adds a chuck of data to this clipboard, with a flavor tag indicating the kind of data it is. - void Append( UtilStr& inData, long inDataFlavor ); - void Append( void* inData, long inLen, long inDataFlavor ); + // Post: Empties the clipboard. + void Clear(); - // Post: Loads the data at the th slot to and . - // Post: is returned iff the fetch was successful - // Note: 1 is the first item in the clipboard (ie, "one-indexing" is used) - bool Fetch( long inIndex, long& outDataFlavor ) const; - bool Fetch( long inIndex, UtilStr& outData, long& outDataFlavor ) const; + // Post: Adds a chuck of data to this clipboard, with a flavor tag + //indicating the kind of data it is. + void Append(UtilStr &inData, long inDataFlavor); + void Append(void *inData, long inLen, long inDataFlavor); - // Designed to be used publicly by any application. - static Clipboard sAppClipboard; - - protected: - XLongList mFlavorList; - XStrList mDataList; + // Post: Loads the data at the th slot to and + //. Post: is returned iff the fetch was successful + // Note: 1 is the first item in the clipboard (ie, "one-indexing" is + //used) + bool Fetch(long inIndex, long &outDataFlavor) const; + bool Fetch(long inIndex, UtilStr &outData, long &outDataFlavor) const; + // Designed to be used publicly by any application. + static Clipboard sAppClipboard; +protected: + XLongList mFlavorList; + XStrList mDataList; }; #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/FileSpecList.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/FileSpecList.h index d6abfc741..67b02390b 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/FileSpecList.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/FileSpecList.h @@ -1,7 +1,6 @@ #ifndef _FileSpecList_ #define _FileSpecList_ - #include "XStrList.h" class CEgFileSpec; @@ -9,39 +8,37 @@ class CEgFileSpec; // Designed to represent a list of file specs. class FileSpecList { - public: - FileSpecList( XStrListOptsT inOption, ListOrderingT inOrdering ); - virtual ~FileSpecList(); - - // Removes all the files specs from this list - void RemoveAll(); +public: + FileSpecList(XStrListOptsT inOption, ListOrderingT inOrdering); + virtual ~FileSpecList(); - // Makes a private copy of the given spec and inserts it into this list. The number - // returned is what element the spec now is in this list (1-based indexing) - long AddCopy( const CEgFileSpec& inSpec ); + // Removes all the files specs from this list + void RemoveAll(); - // Get access to the certain spec - const CEgFileSpec* FetchSpec( int inIndex ) const; + // Makes a private copy of the given spec and inserts it into this list. The + // number returned is what element the spec now is in this list (1-based + // indexing) + long AddCopy(const CEgFileSpec &inSpec); - // See what the name of the ith item is (1-based indexing) - const UtilStr* FetchSpecName( int inIndex ) const; - bool FetchSpecName( int inIndex, UtilStr& outStr ) const; + // Get access to the certain spec + const CEgFileSpec *FetchSpec(int inIndex) const; - // Returns spec (via index) of closest matching name with inStr - long FetchBestMatch( const UtilStr& inStr ); + // See what the name of the ith item is (1-based indexing) + const UtilStr *FetchSpecName(int inIndex) const; + bool FetchSpecName(int inIndex, UtilStr &outStr) const; - // Look for a item with the given name. If nothing is found, 0 is returned - long Lookup( UtilStr& inName ) const; + // Returns spec (via index) of closest matching name with inStr + long FetchBestMatch(const UtilStr &inStr); - // Returns the number of specs in this list - long Count() const { return mSpecNames.Count(); } + // Look for a item with the given name. If nothing is found, 0 is returned + long Lookup(UtilStr &inName) const; - protected: - XPtrList mSpecs; - XStrList mSpecNames; + // Returns the number of specs in this list + long Count() const { return mSpecNames.Count(); } +protected: + XPtrList mSpecs; + XStrList mSpecNames; }; - #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Hashable.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Hashable.h index 2be2c71e4..5d7b697c5 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Hashable.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Hashable.h @@ -1,16 +1,14 @@ #ifndef _HASHABLE_H #define _HASHABLE_H - class Hashable { - public: - virtual long Hash() const = 0; +public: + virtual long Hash() const = 0; - virtual bool Equals( const Hashable* inComp ) const = 0; + virtual bool Equals(const Hashable *inComp) const = 0; - virtual ~Hashable () {} + virtual ~Hashable() {} }; #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Hashtable.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Hashtable.h index 0d72c587a..a8ec48861 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Hashtable.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Hashtable.h @@ -5,107 +5,118 @@ #include "XPtrList.h" struct KEntry { - public: - long mKey; - const Hashable* mHashable; - void* mValue; - KEntry* mNext; +public: + long mKey; + const Hashable *mHashable; + void *mValue; + KEntry *mNext; }; class Hashtable { - - public: - // Makes a new Hashtable. The load factor how efficient memory usage is. The higher - // the load factor, the more compact the Hashtable it, but at a penalty of performance. - // In this implementaion, the performance gains out weight the more mem used by 4 or 5 to 1. - // If inKeysOwned is true, this Hashtable will delete any keys that are of type Hashable when - // are no longer needed (and on the destruction of this). For keys added via Put( long, void* ), they - // are never owned since the keys are actal 4-byte numbers. For example, a Hashtable used to map - // ptrs to void*s never owns any keys because the point of using Put( long, void* ) is that the longs used - // as keys (ie, recast pts) are already unique by nature. - Hashtable( bool inKeysOwned = false, int inLoadFactor = 50 ); - virtual ~Hashtable(); - - // Returns the number of entries (ie, key-value pairs) in this hashtable - inline long NumEntries() const { return mNumEntries; } - - // Associates inValue with inKey. - // Note: If a value is already assigned to that key, that value is replaced with inValue and - // the old value is returned, otherwise 0 is returned. - // Note: Values are never owned by a Hashtable--it's the client's responsibilty (they couldn't because they don't know what the long represents!). - // Keys are owned by a hashtable depending on what was pass in this' contructor. - // Note: If keys are not owned (see contructor), it's the client's responsibility to (a) delete whatever gets - // returned from a Put( Hashable*, void* ) and (b) keep any Hashables currently in this table via Put() - // allocated until this table is deleted/destroyed. - // Note: O(1) running time - inline void* Put( long inKey, void* inValue ) { return put( inKey, 0, inValue ); } - inline void* Put( const Hashable* inKey, void* inValue ) { return put( inKey->Hash(), inKey, inValue ); } - - // Fetches the value associated with inKey (from a Put()). - // Note: If a matching key is found, true is returned. If outValue is 0, the value is not returned. - // Note: O(1) running time - bool Get( long inKey, void** outValue = 0 ) const; - bool Get( const Hashable* inKey, void** outValue = 0 ) const; - - // Returns a list of all the values in this hashtable in no particular order. - // Note: The values are added one by one, so the list can have any sorting/order flag set on it. - void GetValues( XPtrList& outValues ); - - // Returns a list of all the keys in this hashtable in no particular order - // Note: The keys are added one by one, so the list can have any sorting/order flag set on it. - void GetKeys( XPtrList& outKeys ); - - // Return's the nth value in this hashtable, with the values in no particular order. If there - // are less than n entries this this hashtable, 0 is returned. - // Note: O(N) running time. - //void* Get( long inN ); - - // These are 2 other handy ways of invoking Get(long, void**). The only difference is that if the key isn't - // found, it is entered in this dictionary with a value set to zero/0. - void*& operator[] ( const void* inKey ); - long& operator[] ( const long inKey ); - - // Removes inKey from this Hashtable. If inKey is not found, 0 is returned. - // If inKey was found, the key (and its associated value) are removed and the key's value is returned. - // Note: if keys are owned, this fcn deletes the hashable that was used in Put() - inline void* Remove( long inKey ) { return remove( inKey, 0 ); } - inline void* Remove( const Hashable* inKey ) { return remove( inKey -> Hash(), inKey ); } - - // Removes/clears all keys in this Dictionary. - void RemoveAll(); - - // Pre: The compare function takes in two values and returns if the first is less, equal, or greater than (See XPtrList.h) - // Note: The compare fcn is arbitrary, but if it's it left out (ie. 0) then it sorts by value size, low to high. - // Note: The compare fcn has the same prototype as the one in XPtrList.h, but this compare fcn is one qsort uses, which - // means the void ptrs comin in point to the array elements (not the 4 bytes in the cur pt in the array) - // Post: Get( outKeys[ i ] ) is the ith largest value in this list (in reference to the given compariston fcn) - // Post: outKeys.Count() == inNumToRank (ie, only inNumToRank values of the ranking are returned) - // Note: If inNumToRank is invalid, the full ranking is returned - void Rank( XPtrList& outKeys, CompFunctionT inCompFcn = 0, unsigned long inNumToRank = -1 ); - - protected: - void Rehash(); - - KEntry* fetchEntry( long inKey, const Hashable* inHashable ) const; - void* remove( long inKey, const Hashable* inHashable ); - void* put( long inKey, const Hashable* inHashable, void* inValue ); - - static int sLongComparitor( const void* inA, const void* inB ); - enum { - NUM_SIZES = 15 - }; - - bool mKeysOwned; - static long sTableSizes[ NUM_SIZES ]; - - KEntry** mTable; - unsigned long mTableSize; - long mNumEntries; - long mLoadFactor; // Percent from 0 to 100; - long mThreshold; // Always mLoadFactor * mNumKeys / 100 +public: + // Makes a new Hashtable. The load factor how efficient memory usage is. The + // higher the load factor, the more compact the Hashtable it, but at a penalty + // of performance. In this implementaion, the performance gains out weight the + // more mem used by 4 or 5 to 1. If inKeysOwned is true, this Hashtable will + // delete any keys that are of type Hashable when are no longer needed (and on + // the destruction of this). For keys added via Put( long, void* ), they are + // never owned since the keys are actal 4-byte numbers. For example, a + // Hashtable used to map ptrs to void*s never owns any keys because the point + // of using Put( long, void* ) is that the longs used as keys (ie, recast pts) + // are already unique by nature. + Hashtable(bool inKeysOwned = false, int inLoadFactor = 50); + virtual ~Hashtable(); + + // Returns the number of entries (ie, key-value pairs) in this hashtable + inline long NumEntries() const { return mNumEntries; } + + // Associates inValue with inKey. + // Note: If a value is already assigned to that key, that value is replaced + //with inValue and the old value is returned, otherwise 0 is returned. Note: + //Values are never owned by a Hashtable--it's the client's responsibilty (they + //couldn't because they don't know what the long represents!). Keys are owned + //by a hashtable depending on what was pass in this' contructor. Note: If keys + //are not owned (see contructor), it's the client's responsibility to (a) + //delete whatever gets returned from a Put( Hashable*, void* ) and (b) keep + //any Hashables currently in this table via Put() allocated until this table + //is deleted/destroyed. Note: O(1) running time + inline void *Put(long inKey, void *inValue) { return put(inKey, 0, inValue); } + inline void *Put(const Hashable *inKey, void *inValue) { + return put(inKey->Hash(), inKey, inValue); + } + + // Fetches the value associated with inKey (from a Put()). + // Note: If a matching key is found, true is returned. If outValue is 0, + //the value is not returned. Note: O(1) running time + bool Get(long inKey, void **outValue = 0) const; + bool Get(const Hashable *inKey, void **outValue = 0) const; + + // Returns a list of all the values in this hashtable in no particular + //order. Note: The values are added one by one, so the list can have any + //sorting/order flag set on it. + void GetValues(XPtrList &outValues); + + // Returns a list of all the keys in this hashtable in no particular order + // Note: The keys are added one by one, so the list can have any + //sorting/order flag set on it. + void GetKeys(XPtrList &outKeys); + + // Return's the nth value in this hashtable, with the values in no + //particular order. If there are less than n entries this this hashtable, 0 is + //returned. Note: O(N) running time. + // void* Get( long inN ); + + // These are 2 other handy ways of invoking Get(long, void**). The only + // difference is that if the key isn't + // found, it is entered in this dictionary with a value set to zero/0. + void *&operator[](const void *inKey); + long &operator[](const long inKey); + + // Removes inKey from this Hashtable. If inKey is not found, 0 is + //returned. If inKey was found, the key (and its associated value) are removed + //and the key's value is returned. Note: if keys are owned, this fcn deletes + //the hashable that was used in Put() + inline void *Remove(long inKey) { return remove(inKey, 0); } + inline void *Remove(const Hashable *inKey) { + return remove(inKey->Hash(), inKey); + } + + // Removes/clears all keys in this Dictionary. + void RemoveAll(); + + // Pre: The compare function takes in two values and returns if the + //first is less, equal, or greater than (See XPtrList.h) + // Note: The compare fcn is arbitrary, but if it's it left out (ie. 0) + //then it sorts by value size, low to high. Note: The compare fcn has the + //same prototype as the one in XPtrList.h, but this compare fcn is one qsort + //uses, which means the void ptrs comin in point to the array elements (not + //the 4 bytes in the cur pt in the array) + // Post: Get( outKeys[ i ] ) is the ith largest value in this list (in + //reference to the given compariston fcn) Post: outKeys.Count() == + //inNumToRank (ie, only inNumToRank values of the ranking are returned) Note: + //If inNumToRank is invalid, the full ranking is returned + void Rank(XPtrList &outKeys, CompFunctionT inCompFcn = 0, + unsigned long inNumToRank = -1); + +protected: + void Rehash(); + + KEntry *fetchEntry(long inKey, const Hashable *inHashable) const; + void *remove(long inKey, const Hashable *inHashable); + void *put(long inKey, const Hashable *inHashable, void *inValue); + + static int sLongComparitor(const void *inA, const void *inB); + enum { NUM_SIZES = 15 }; + + bool mKeysOwned; + static long sTableSizes[NUM_SIZES]; + + KEntry **mTable; + unsigned long mTableSize; + long mNumEntries; + long mLoadFactor; // Percent from 0 to 100; + long mThreshold; // Always mLoadFactor * mNumKeys / 100 }; - #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ListSocket.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ListSocket.h index 00fc512f7..c522ceafe 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ListSocket.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ListSocket.h @@ -1,94 +1,93 @@ #ifndef _LISTSOCKET_ #define _LISTSOCKET_ - class UtilStr; class XLongList; class Clipboard; class ListSocket { - - public: - - // Post: Mirrors a GUI drag of the selected items dropped before cell at depth - // Note: If is invalid or < 0 or > N, the closest boundry is used. - virtual void MoveSelected( long inAboveCell, long inDepth ); - - // Post: Used by a GUI to refine a given insertion point. - // Post: and may be adjusted/corrected. - // Note: Depths are such that 0 means root level. - // Note: Fcn succesful iff is returned. - virtual bool CheckInsertPt( long& ioNodeNum, long& ioDepth ); - - // Post: Used to select cells. DeleteSelected() and MoveSelected() use cell selections. - virtual void SetSelected( long inCellNum, bool isSelected ) = 0; - virtual long NumSelected(); - virtual bool IsSelected( long inCellNum ) = 0; - virtual void SetSelectAll( bool inAreSelected ); - inline void UnselectAll() { SetSelectAll( false ); } - inline void SelectAll() { SetSelectAll( true ); } - - // Post: Used to enable/disable cells. - virtual void SetEnabled( long inCellNum, bool isSelected ); - virtual bool IsEnabled( long inCellNum ); - virtual void EnableAll(); - - // Post: Returns the first/last cell that's selected. - // Note: 0 is returned if no cell is selected - long GetFirstSelected(); - long GetLastSelected(); - - // Post: Permanently deletes the cells from the list. - virtual void DeleteSelected(); - - // Post: Retruns info about the cell . - // Note: Returns true if specifies a valid cell (and valid info is sent back). - // Note: Depths are such that 0 means root level, etc. - virtual bool GetCell( long inCellNum, long& outIcnID, long& outDepth, UtilStr& outLabel ) = 0; - - // Post: Returns the number of cells in the list - virtual long NumCells() = 0; - - // Post: Stub fcn for ListSocket. Overridde if your table needs this functionality. - // Note: depth == 0 means root level. - virtual void SetInsertionPt( long inCellNum, long inDepth ); - - // Post: Universally manages a click on the th cell, using the current insertion - // point as the anchor if nessecary to select cells. - // Note: It returns a list of cell numbers that need refreshing (ie, their select state changed). - virtual XLongList* ManageClick( long inCell, bool inShift, bool inCmd, bool inDeselectRest ); - - // Post: Moves the selection location cells forward. This fcn is useful for handling - // arrow keys in a list for example. - // Note: If there is nothing selected, the first cell will be selected. - // Note: It returns a list of cell numbers that need refreshing (ie, their select state changed). - XLongList* ArrowSelection( int inCellDelta ); - - // Post: Returns the cell number associated with the user typing in . In otherwords, this - // fcn maps the cell labeling to the cell number. - virtual long GUINumToCellNum( long inGUINum ); - - // Used to see if a given clipboard opertion can be performed (ie, if the menu item can be enabled). - virtual bool CanClear() { return false; } - virtual bool CanCutToClip(); - virtual bool CanCopyToClip(); - virtual bool CanPasteFromClip( Clipboard& inClip ); - - // Performs the standard clipboard operations. - virtual void Clear(); - virtual void CutToClip( Clipboard& outClip ); - virtual void CopyToClip( Clipboard& outClip ); - virtual void PasteFromClip( Clipboard& inClip ); - - - protected: - long mInsertionPt; - long mInsertionDepth; - +public: + // Post: Mirrors a GUI drag of the selected items dropped before cell + // at depth Note: If is invalid or + // < 0 or > N, the closest boundry is used. + virtual void MoveSelected(long inAboveCell, long inDepth); -}; + // Post: Used by a GUI to refine a given insertion point. + // Post: and may be adjusted/corrected. + // Note: Depths are such that 0 means root level. + // Note: Fcn succesful iff is returned. + virtual bool CheckInsertPt(long &ioNodeNum, long &ioDepth); + + // Post: Used to select cells. DeleteSelected() and MoveSelected() use + //cell selections. + virtual void SetSelected(long inCellNum, bool isSelected) = 0; + virtual long NumSelected(); + virtual bool IsSelected(long inCellNum) = 0; + virtual void SetSelectAll(bool inAreSelected); + inline void UnselectAll() { SetSelectAll(false); } + inline void SelectAll() { SetSelectAll(true); } + + // Post: Used to enable/disable cells. + virtual void SetEnabled(long inCellNum, bool isSelected); + virtual bool IsEnabled(long inCellNum); + virtual void EnableAll(); + + // Post: Returns the first/last cell that's selected. + // Note: 0 is returned if no cell is selected + long GetFirstSelected(); + long GetLastSelected(); + + // Post: Permanently deletes the cells from the list. + virtual void DeleteSelected(); + + // Post: Retruns info about the cell . + // Note: Returns true if specifies a valid cell (and valid + //info is sent back). Note: Depths are such that 0 means root level, etc. + virtual bool GetCell(long inCellNum, long &outIcnID, long &outDepth, + UtilStr &outLabel) = 0; + // Post: Returns the number of cells in the list + virtual long NumCells() = 0; + // Post: Stub fcn for ListSocket. Overridde if your table needs this + //functionality. Note: depth == 0 means root level. + virtual void SetInsertionPt(long inCellNum, long inDepth); + + // Post: Universally manages a click on the th cell, using the + //current insertion point as the anchor if nessecary to select cells. Note: + //It returns a list of cell numbers that need refreshing (ie, their select + //state changed). + virtual XLongList *ManageClick(long inCell, bool inShift, bool inCmd, + bool inDeselectRest); + + // Post: Moves the selection location cells forward. This + //fcn is useful for handling arrow keys in a list for example. Note: If there + //is nothing selected, the first cell will be selected. Note: It returns a + //list of cell numbers that need refreshing (ie, their select state changed). + XLongList *ArrowSelection(int inCellDelta); + + // Post: Returns the cell number associated with the user typing in + //. In otherwords, this fcn maps the cell labeling to the cell + //number. + virtual long GUINumToCellNum(long inGUINum); + + // Used to see if a given clipboard opertion can be performed (ie, if the + //menu item can be enabled). + virtual bool CanClear() { return false; } + virtual bool CanCutToClip(); + virtual bool CanCopyToClip(); + virtual bool CanPasteFromClip(Clipboard &inClip); + + // Performs the standard clipboard operations. + virtual void Clear(); + virtual void CutToClip(Clipboard &outClip); + virtual void CopyToClip(Clipboard &outClip); + virtual void PasteFromClip(Clipboard &inClip); + +protected: + long mInsertionPt; + long mInsertionDepth; +}; #endif \ No newline at end of file diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ListableClientBase.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ListableClientBase.h index 893c6130b..0027e105e 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ListableClientBase.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/ListableClientBase.h @@ -9,96 +9,93 @@ class Clipboard; class ListableClientBase : public Messager { +public: + ListableClientBase(long inCellHeight, ListSocket *inListToUse); + // Post: Redraws the cells specified by + virtual void RedrawCells(XLongList &inRefreshList); - public: - ListableClientBase( long inCellHeight, ListSocket* inListToUse ); - - // Post: Redraws the cells specified by - virtual void RedrawCells( XLongList& inRefreshList ); - - // Post: Scrolls vertically to bring the specified cell into view. - virtual void ScrollToCell( long inCellNum ); - - // Post: Scrolls vertically to bring the selection into view. - virtual void ScrollToSelected(); - - // Post: Returns the index of the first selected cell. - // Note: If no cells are selected, 0 is returned. - long GetFirstSelected(); - - // Post: Returns the index of the last selected cell. - // Note: If no cells are selected, 0 is returned. - long GetLastSelected(); - - // Post: Returns the cell range currently visible. - void GetVisibleRange( long& outStart, long& outEnd ); - - // Post: This fcn should peform a generic export of its particular drag data to . - virtual void SendDrag( Clipboard& outClip ); - - virtual void ClickSelf( long inX, long inY, bool inDblClick, bool inModKeys ); - - virtual void ClickCellSelf( long inCell, bool inDblClick ); - - - void RedrawCell( long inCellNum ); - - virtual bool FindItemStatus( long inItemID, bool& ioChecked ); - virtual bool ListenToMsg( long inCmdID, long inArgs[] ); - - // Callbacks or visual updating - virtual void NumCellsChanged() = 0; - virtual void NeedsRedraw() = 0; - - protected: - ListSocket* mList; - long mCellHeight; - long mCellWidth; - long mRows; - long mCols; - bool mHasGridLines; - bool mRightJustified; // If cell text is right justified - long mDepthIndent; - long mListIndent; - long mTextIconDist; - - - // Post: Returns the number of pixels the given cell is out of view. If it's negative - // the cell lies above, if positive, it's below, and zero means it's already in view. - long YDeltaOfCell( long inCellNum ); - - - virtual void CalcSize( long& ioWidth, long& ioHeight ); - - virtual void HandleKeyPress( unsigned char c ); - - virtual long GetCellHit( long inX, long inY ); - - // Scroller callback - virtual void ScrollBy( long inDeltaX, long inDeltaY ) = 0; - - // Callbacks before and after drawing - virtual void LCBeginDraw() = 0; - virtual void EndDraw() = 0; - - // Post: Returns the cell range currently visible to the user (ie, the range worth drawing). - virtual void GetVisibleRect( long& outLeft, long& outTop, long& outRight, long& outBottom ) = 0; - - // Low level callback to draw one cell - virtual void DrawCell( long inCellNum, bool inDrawBackground ) = 0; - - virtual void RedrawRect( long inLeft, long inTop, long inBottom, long inRight ); - - static long sLastKeyTime; - - - enum { - cDefaultTextIconDist = 5, - cDefaultListIndent = 5, - cDefualtDepthIndent = 15 - }; -}; + // Post: Scrolls vertically to bring the specified cell into view. + virtual void ScrollToCell(long inCellNum); + + // Post: Scrolls vertically to bring the selection into view. + virtual void ScrollToSelected(); + + // Post: Returns the index of the first selected cell. + // Note: If no cells are selected, 0 is returned. + long GetFirstSelected(); + + // Post: Returns the index of the last selected cell. + // Note: If no cells are selected, 0 is returned. + long GetLastSelected(); + + // Post: Returns the cell range currently visible. + void GetVisibleRange(long &outStart, long &outEnd); + + // Post: This fcn should peform a generic export of its particular drag + //data to . + virtual void SendDrag(Clipboard &outClip); + + virtual void ClickSelf(long inX, long inY, bool inDblClick, bool inModKeys); + + virtual void ClickCellSelf(long inCell, bool inDblClick); + + void RedrawCell(long inCellNum); + + virtual bool FindItemStatus(long inItemID, bool &ioChecked); + virtual bool ListenToMsg(long inCmdID, long inArgs[]); + + // Callbacks or visual updating + virtual void NumCellsChanged() = 0; + virtual void NeedsRedraw() = 0; + +protected: + ListSocket *mList; + long mCellHeight; + long mCellWidth; + long mRows; + long mCols; + bool mHasGridLines; + bool mRightJustified; // If cell text is right justified + long mDepthIndent; + long mListIndent; + long mTextIconDist; + // Post: Returns the number of pixels the given cell is out of view. If + //it's negative the cell lies above, if positive, it's below, and zero means + //it's already in view. + long YDeltaOfCell(long inCellNum); + + virtual void CalcSize(long &ioWidth, long &ioHeight); + + virtual void HandleKeyPress(unsigned char c); + + virtual long GetCellHit(long inX, long inY); + + // Scroller callback + virtual void ScrollBy(long inDeltaX, long inDeltaY) = 0; + + // Callbacks before and after drawing + virtual void LCBeginDraw() = 0; + virtual void EndDraw() = 0; + + // Post: Returns the cell range currently visible to the user (ie, the + //range worth drawing). + virtual void GetVisibleRect(long &outLeft, long &outTop, long &outRight, + long &outBottom) = 0; + + // Low level callback to draw one cell + virtual void DrawCell(long inCellNum, bool inDrawBackground) = 0; + + virtual void RedrawRect(long inLeft, long inTop, long inBottom, long inRight); + + static long sLastKeyTime; + + enum { + cDefaultTextIconDist = 5, + cDefaultListIndent = 5, + cDefualtDepthIndent = 15 + }; +}; #endif \ No newline at end of file diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/LowUnionFind.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/LowUnionFind.h index e7a732110..c9ce1ade0 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/LowUnionFind.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/LowUnionFind.h @@ -1,44 +1,39 @@ #ifndef LowUnionFind_H #define LowUnionFind_H - #include "nodeClass.h" #include "XLongList.h" -class SubTree : public nodeClass, public XLongList { - -}; +class SubTree : public nodeClass, public XLongList {}; - -/* -"Low" in contrast to HighUnionFind in that running time for Union() is O( N ), so -performace will drop as the number of nodes starts to get very high. +/* +"Low" in contrast to HighUnionFind in that running time for Union() is O( N ), +so performace will drop as the number of nodes starts to get very high. */ class LowUnionFind { - public: - LowUnionFind( long inNumVerticies ); - ~LowUnionFind(); - - // Note: O( N ) - void AddEdge( long inA, long inB ); - - // Returns access to the largest union/subtree in this graph. 0 is returned if there's - // no verticies in this graph. - const XLongList* LargestPile() { return mLargest; } - - - // Removes the vertex from all given piles. - void RemoveVertex( long inA ); - - - protected: - XLongList* mAdj; - long mNumVerticies; - XLongList* mLargest; // Always pts to the largest node/group/pile - - XLongList* FindLargestPile(); +public: + LowUnionFind(long inNumVerticies); + ~LowUnionFind(); + + // Note: O( N ) + void AddEdge(long inA, long inB); + + // Returns access to the largest union/subtree in this graph. 0 is returned + //if there's + // no verticies in this graph. + const XLongList *LargestPile() { return mLargest; } + + // Removes the vertex from all given piles. + void RemoveVertex(long inA); + +protected: + XLongList *mAdj; + long mNumVerticies; + XLongList *mLargest; // Always pts to the largest node/group/pile + + XLongList *FindLargestPile(); }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Messager.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Messager.h index 27a74a376..b266ac77c 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Messager.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/Messager.h @@ -2,43 +2,35 @@ #ifndef _MESSAGER_ #define _MESSAGER_ - #include "XPtrList.h" +class Messager { + +private: + XPtrList mListeners; + bool mIsListening; + bool mAllowBroadcasting; + static XPtrList sAllMessagers; +public: + Messager(); + ~Messager(); -class Messager { + void StartListening(); + void StopListening(); + bool IsListening() { return mIsListening; } - private: - - XPtrList mListeners; - bool mIsListening; - bool mAllowBroadcasting; - - static XPtrList sAllMessagers; - - - public: - Messager(); - ~Messager(); - - void StartListening(); - void StopListening(); - bool IsListening() { return mIsListening; } - - void SetAllowBroadcasting( bool inAllowed ); - - // Post: Returns true if message was handled. - virtual bool ListenToMsg( long inMessage, long inArgs[] ); - - void AddListener( Messager* inListener ); - void CopyListeners( Messager* inSource ); - void BroadcastMessage( long inMsg, long inArgs[] ); - - static void BroadcastGlobalMessage( long inMessage, long inArgs[] ); + void SetAllowBroadcasting(bool inAllowed); + // Post: Returns true if message was handled. + virtual bool ListenToMsg(long inMessage, long inArgs[]); + + void AddListener(Messager *inListener); + void CopyListeners(Messager *inSource); + void BroadcastMessage(long inMsg, long inArgs[]); + + static void BroadcastGlobalMessage(long inMessage, long inArgs[]); }; #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/RectUtils.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/RectUtils.h index 1bb14920e..df8bc8273 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/RectUtils.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/RectUtils.h @@ -3,11 +3,11 @@ #include -extern short PtInRect( const Point& inPt, const Rect* inRect ); -extern void SetRect( Rect* inR, long left, long top, long right, long bot ); -extern void InsetRect( Rect* inR, int inDelX, int inDelY ); -extern void UnionRect( const Rect* inR1, const Rect* inR2, Rect* outRect ); -extern void OffsetRect( Rect* inRect, int inDelX, int inDelY ); -extern void SectRect( const Rect* inR1, const Rect* inR2, Rect* outRect ); +extern short PtInRect(const Point &inPt, const Rect *inRect); +extern void SetRect(Rect *inR, long left, long top, long right, long bot); +extern void InsetRect(Rect *inR, int inDelX, int inDelY); +extern void UnionRect(const Rect *inR1, const Rect *inR2, Rect *outRect); +extern void OffsetRect(Rect *inRect, int inDelX, int inDelY); +extern void SectRect(const Rect *inR1, const Rect *inR2, Rect *outRect); #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/TempMem.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/TempMem.h index 3165687c7..14f75967d 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/TempMem.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/TempMem.h @@ -1,33 +1,27 @@ #ifndef __TempMem__ #define __TempMem__ - #include "UtilStr.h" /* This class allocs a chunk of the system/shared memory */ class TempMem { - public: - TempMem(); - ~TempMem(); - - // Returns a ptr a block inBytes big (from temporary memory) - char* Dim( long inBytes ); - - - protected: - long mDimSize; - - #if EG_WIN != 0 || defined(UNIX_X) - UtilStr mTemp; - #elif EG_MAC - char** mTempH; - #endif -}; - +public: + TempMem(); + ~TempMem(); + // Returns a ptr a block inBytes big (from temporary memory) + char *Dim(long inBytes); +protected: + long mDimSize; +#if EG_WIN != 0 || defined(UNIX_X) + UtilStr mTemp; +#elif EG_MAC + char **mTempH; +#endif +}; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/UnionFind.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/UnionFind.h index 7785dccc0..e68814c94 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/UnionFind.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/UnionFind.h @@ -1,41 +1,36 @@ #ifndef _UnionFind_ #define _UnionFind_ -/* +/* An implementation of the famous union-find algorithm. */ class XLongList; - class UnionFind { - - public: - UnionFind(); - virtual ~UnionFind(); - - // Helps UnionFind make a good size ahead of time - void Dim( long inNum ) { Find( inNum - 1 ); } - - void Union( long inA, long inB ); - - long Find( long inA ); - - long LargestSet( long* outSize ); - - void EnumerateSet( long inSetID, XLongList& outSet ); - - long NumSets(); - - void GetSets( XLongList& outSets ); - - protected: - long mDimSize; - unsigned short* mElements; - -}; +public: + UnionFind(); + virtual ~UnionFind(); + + // Helps UnionFind make a good size ahead of time + void Dim(long inNum) { Find(inNum - 1); } + + void Union(long inA, long inB); + + long Find(long inA); + long LargestSet(long *outSize); + void EnumerateSet(long inSetID, XLongList &outSet); + + long NumSets(); + + void GetSets(XLongList &outSets); + +protected: + long mDimSize; + unsigned short *mElements; +}; #endif \ No newline at end of file diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/UtilStr.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/UtilStr.h index a248e736c..bc65c348b 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/UtilStr.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/UtilStr.h @@ -1,263 +1,295 @@ #ifndef _UTILSTR_ #define _UTILSTR_ - #include "Hashable.h" - class CEgIStream; class CEgOStream; // This is versitile string class, optimized for all string sizes class UtilStr : public Hashable { - - public: - UtilStr(); - UtilStr( const char* inCStr ); - UtilStr( const unsigned char* inStrPtr ); - UtilStr( const UtilStr& inStr ); - UtilStr( const UtilStr* inStr ); - UtilStr( long inNum ); - UtilStr( const void* inPtr, unsigned long numBytes ); - virtual ~UtilStr(); - - // *** Assign *** - // Post: This UtilStr empties itself and appends the argument (ie it copies the argument) - inline void Assign( const char* inCStr ) { mStrLen = 0; Append( inCStr ); } - void Assign( const unsigned char* inStrPtr ); - void Assign( const UtilStr* inStr ); - void Assign( const UtilStr& inStr ); - void Assign( long inNum ); - void Assign( char inChar ); - void Assign( const void* inPtr, unsigned long numBytes ); - void Assign( CEgIStream& inStream, unsigned long numBytes ); - - // *** Append *** - // Post: The argument is appended to this string - void Append( const char* inCStr ); - inline void Append( const unsigned char* inStrPtr ); - inline void Append( char inChar ) { Append( &inChar, 1 ); } - void Append( long inNum ); - inline void Append( const UtilStr* inStr ); - inline void Append( const UtilStr& inStr ) { Append( inStr.getCStr(), inStr.length() ); } - void Append( const void* inSrce, unsigned long numBytes ); - - // *** Operators *** - // The + signifies Append() an append and the = signifies Assign() - UtilStr operator + ( const UtilStr& inStr ); - UtilStr operator + ( const char* inCStr ); - UtilStr operator + ( const long inNum ); - UtilStr& operator = ( const UtilStr& inStr ); - - - // Post: Makes the length of this . - // Note: The data in this is garbage! - char* Dim( unsigned long numBytes ) { mStrLen = 0; Append( (void*) 0, numBytes ); return mBuf; } - - // Post: Swaps the internal string ptrs. This fcn is useful if you need to assign a string value and don't care - // if the original string changes. - void Swap( UtilStr& ioStr ); - - // Post: The length of this string is returned - inline unsigned long length() const { return mStrLen; } - - // Post: Returns the th character in this string. If i < 1 or greater than len, 0 is returned - char getChar( unsigned long i ) const; - - // Post: The th character is replaced with . If i < 1 or greater than len, this - // string is unaffected. - void setChar( unsigned long i, char inChar ); - - // Post: is appended to the beginning to this string. - void Prepend( const char inChar); - void Prepend( const char* inStr ); - void Prepend( UtilStr& inStr ); - - // Post: (or ) is inserted in the string after the th character - // Note: When = 0, this is the same as Prepend(...) - // Note: If is greater then or equal to the length of this str, is appended to the end - // "HiFred".Insert( 2, "," ) ---> "Hi,Fred" - void Insert( unsigned long inPos, const UtilStr& inSrce ); - void Insert( unsigned long inPos, const char* inSrce, long inSrceLen ); - void Insert( unsigned long inPos, char inChar, long inNumTimes ); - void Insert( unsigned long inPos, long inNum ); - - // Post: Returns a ptr to a pascal style string of this string. Remember that if this string is greater than - // 255 chars, only the first 255 can be accessed. *NOTE: This fcn is designed for - // instantanious use (ie, if you change the string at all, you *must* re-call this method). In other words, - // treat the ptr returned as *read* only! - unsigned char* getPasStr() const; - - // Post: Returns a ptr to a C style string of this string. *NOTE: This fcn is designed for - // instantanious use (ie, if you change the string at all, you *must* re-call this method). In other words, - // treat the ptr returned as *read* only! - char* getCStr() const; - - // Post: This string is emptied (length is zero) - inline void Wipe() { mStrLen = 0; } - - // Post: Replaces all instances of with - // Returns how many replaces took place - long Replace( char inTarget, char inReplacement ); - long Replace( const char* inTarget, const char* inReplacement, bool inCaseSensitive = true ); - - // Post: Truncates chars from this string, either from the right or left. If is - // less than 1, this string is unaffected. If is greater or equal to the length - // if this string, the string is emptied. - void Trunc( unsigned long numToChop, bool fromRight = true ); - - // Post: At position in the string, characters are removed - // "Hi,Fred".Remove( 3, 1 ) ---> "HiFred" - void Remove( unsigned long inPos, unsigned long inNum ); - - // Post: All instances of a given string are removed from this string - // Note: inLen is the length of inStr. If inLen < -1, the length of inStr is calculated - void Remove( const char* inStr, int inLen = -1, bool inCaseSensitive = true ); - - // Post: Truncates after the th character. If is greater than or equal to - // the length, nothing happens. - void Keep( unsigned long inNumToKeep ); - - // Post: If this' len is larger than , a '�' replaces the th character and chars are removed - // after the '�' until the this' length is - void PoliteKeep( unsigned long inMaxLen, unsigned long inPos ); - - // Post: A simple filter that decapitalized all chars that aren't the first in each word. - void Decapitalize(); - - // Post: Capitalizes all the chars in this string. - void Capitalize(); - - // Post: Removes any leading spaces in this string. - void ZapLeadingSpaces(); - - // Pre: points to a pascal string of length - // Post: The contents of this string is copied to , updating its length byte - void copyTo( unsigned char* pasDestPtr, unsigned char inBytesToCopy ) const; - - // Pre: points to a c string with an allocated length of - // Post: The contents of this string is copied to , appending the NUL byte - void copyTo( char* cDestPtr, unsigned long inBytesToCopy ) const; - - // Post: This string is read from from the current file position - void ReadFrom( CEgIStream* inStream ); - - // Post: This string writes itself to at the current file position - void WriteTo( CEgOStream* inStream ) const; - - // Post: Returns the rational value of this string times . All chars not '0'..'9' are - // ignored, except a leading '-' and a '.', where the digits that follow are decimal digits - // Usage: "12.34".GetValue( 20 ) will return 246 - long GetValue( long inMultiplier = 1 ) const; - - // Post: Returns a floating point value of this string - double GetFloatValue() const; - - // Pre: != 0 - // < 8 - // Post: Assigns the string equivilent of / to this string, truncating the string - // after decimal places. - // Usage: SetValue( 24686, 20, 2 ) would assign this string to "12.34" - void SetValue( long inVal, long inDivisor = 1, int inNumDecPlaces = 5 ); - - // Pre: |inValue| < 2^31 - // Sets this string to the given float value, using '.' as a decimal point, using at most inDigits behind the decimal point - void SetFloatValue( float inValue, int inDigits = 4 ); - - // Post: Assigns this string the roman numeral string for the number . - void SetRomanValue( long inValue ); - - // Post: Returns the character position within this string of the rightmost occurance of . If - // is not found, 0 is returned. - inline long FindLastInstanceOf( char c ) const { return FindPrevInstanceOf( mStrLen, c ); } - - // Post: Returns the character position within this string of the leftmost occurance of after pos . - // If is not found, 0 is returned. Setting inPos to 0 starts from the beginning. - // "blah,blah!".FindNextInstanceOf( 0, ',' ) == 5 - long FindNextInstanceOf( unsigned long inPos, char c ) const; - - // Post: Returns the character position within this string of the rightmost occurance of after pos . - // If is not found, 0 is returned. - long FindPrevInstanceOf( unsigned long inPos, char c ) const; - - // Post: Compares this str with and returns: - // "hi".compareTo( "hi", 3, true ) == 0 - // "a".compareTo( "z", 2, true ) < 0 - // "Z".compareTo( "a", 2, false ) > 0 - int compareTo( const UtilStr* inStr, bool inCaseSensitive = true ) const; - int compareTo( const unsigned char* inPStr, bool inCaseSensitive = true ) const; - int compareTo( const char* inCStr, bool inCaseSensitive = true ) const; - - - // Post: Compares the first chars of data at and and returns: - // StrCmp( "hi", "hi", 3, true ) == 0 - // StrCmp( "a", "z", 2, true ) < 0 - // StrCmp( "z", "a", 2, true ) > 0 - // Note: If < 0, the length of s1 (as a C string) is used. - // Note: StrCmp( *, *, 0, * ) always returns false. - static int StrCmp( const char* s1, const char* s2, long inN, bool inCaseSensitive ); - - // Post: Returns the 1st next instance of in this str, skipping the first inStartingPos chars. If an instance cannot be found, 0 is returned. - // Note: inLen is the length of inStr. If inLen < -1, the length of inStr is calculated - // "Hi,Fred".contains( "fred", false ) == 4 - inline long contains( const UtilStr& inStr, int inStartingPos = 0, bool inCaseSensitive = true ) const { return contains( inStr.getCStr(), inStr.length(), inStartingPos, inCaseSensitive ); } - long contains( const char* inStr, int inLen = -1, int inStartingPos = 0, bool inCaseSensitive = true ) const; - - // Post: Blockmoves memory - static void Move( void* inDest, const void* inSrce, unsigned long inNumBytes ); - - // Post: Appends , exporting/translating to "meta" format (ie, all translated bytes >= 32 or <= 127) - void AppendAsMeta( const UtilStr* inData ); - void AppendAsMeta( void* inData, unsigned long inLen ); - - // Post: Appends , importing/translating from "meta" format. - // Note: See AppendAsMeta() - // Ex: s.Wipe(); t.Wipe(); // Empty our strings s and t - // s.AppendAsMeta( dataPtr, 5 ); // Encode some data and put it in s - // t.AppendFromMeta( s.getCStr(), s.length() ); // t now contains exactly what was in dataPtr - void AppendFromMeta( const UtilStr* inStr ); - void AppendFromMeta( const void* inStr, unsigned long inLen ); - - // Post: Returns a psudorandom long for this string - long Hash() const; - - // Must be defined as a Hashable - bool Equals( const Hashable* inComp ) const; - - - - // Pre: inB1 and inB2 are '0' to '9', 'A' to 'F', or 'a' to 'f' - // Post: The corresponding byte value is appended to this string - void AppendHex( char inB1, char inB2 ); - - // Post: Returns a floating point number for the given ASCII chars - static double GetFloatVal( const char* inNumStr, unsigned long inLen ); - - // Post: Returns the truncated signed long value of this string. All characters not '0'..'9' are ignored - // except a leading '-' - // <*outPlacePtr> is set to 10^( 1 + trunc( log10( ) ) ) - // Usage: "12.9".GetIntValue( &i ) returns 12 and assigns i to 100 - static long GetIntValue( const char* inStr, unsigned long inLen, long* outPlacePtr = 0 ); - - // Longest Common Substring Seach Score - // Post: Returns a 'score' -- the greater the score, the more similar inStr is this string. - // Note: If inLen < 0, inStr (as a C string) is used. - // Note: This fcn is *not* communitive ( "cat" is more similar to "bigcat" then "bigcat" is to "cat" ) - // Note: Running time O( this.length * inStr.length ) - long LCSMatchScore( const char* inStr, long inStrLen = -1 ) const; - long LCSMatchScore( const UtilStr& inStr ) const { return LCSMatchScore( inStr.getCStr(), inStr.length() ); } - - protected: - unsigned long mBufSize; // Physical size of buf - unsigned long mStrLen; // NOTE: ALWAYS holds string size - char* mBuf; // Holds ptr to str data - - void init(); - +public: + UtilStr(); + UtilStr(const char *inCStr); + UtilStr(const unsigned char *inStrPtr); + UtilStr(const UtilStr &inStr); + UtilStr(const UtilStr *inStr); + UtilStr(long inNum); + UtilStr(const void *inPtr, unsigned long numBytes); + virtual ~UtilStr(); + + // *** Assign *** + // Post: This UtilStr empties itself and appends the argument (ie it + //copies the argument) + inline void Assign(const char *inCStr) { + mStrLen = 0; + Append(inCStr); + } + void Assign(const unsigned char *inStrPtr); + void Assign(const UtilStr *inStr); + void Assign(const UtilStr &inStr); + void Assign(long inNum); + void Assign(char inChar); + void Assign(const void *inPtr, unsigned long numBytes); + void Assign(CEgIStream &inStream, unsigned long numBytes); + + // *** Append *** + // Post: The argument is appended to this string + void Append(const char *inCStr); + inline void Append(const unsigned char *inStrPtr); + inline void Append(char inChar) { Append(&inChar, 1); } + void Append(long inNum); + inline void Append(const UtilStr *inStr); + inline void Append(const UtilStr &inStr) { + Append(inStr.getCStr(), inStr.length()); + } + void Append(const void *inSrce, unsigned long numBytes); + + // *** Operators *** + // The + signifies Append() an append and the = signifies Assign() + UtilStr operator+(const UtilStr &inStr); + UtilStr operator+(const char *inCStr); + UtilStr operator+(const long inNum); + UtilStr &operator=(const UtilStr &inStr); + + // Post: Makes the length of this + //. Note: The data in this is + //garbage! + char *Dim(unsigned long numBytes) { + mStrLen = 0; + Append((void *)0, numBytes); + return mBuf; + } + + // Post: Swaps the internal string ptrs. This fcn is useful if you need + //to assign a string value and don't care if the original string changes. + void Swap(UtilStr &ioStr); + + // Post: The length of this string is returned + inline unsigned long length() const { return mStrLen; } + + // Post: Returns the th character in this string. If i < 1 or greater + //than len, 0 is returned + char getChar(unsigned long i) const; + + // Post: The th character is replaced with . If i < 1 or + //greater than len, this string is unaffected. + void setChar(unsigned long i, char inChar); + + // Post: is appended to the beginning to this string. + void Prepend(const char inChar); + void Prepend(const char *inStr); + void Prepend(UtilStr &inStr); + + // Post: (or ) is inserted in the string after the + //th character Note: When = 0, this is the same as + //Prepend(...) Note: If is greater then or equal to the length of + //this str, is appended to the end "HiFred".Insert( 2, "," ) ---> + //"Hi,Fred" + void Insert(unsigned long inPos, const UtilStr &inSrce); + void Insert(unsigned long inPos, const char *inSrce, long inSrceLen); + void Insert(unsigned long inPos, char inChar, long inNumTimes); + void Insert(unsigned long inPos, long inNum); + + // Post: Returns a ptr to a pascal style string of this string. Remember + //that if this string is greater than 255 chars, only the first 255 can be + //accessed. *NOTE: This fcn is designed for instantanious use (ie, if you + //change the string at all, you *must* re-call this method). In other words, + // treat the ptr returned as *read* only! + unsigned char *getPasStr() const; + + // Post: Returns a ptr to a C style string of this string. *NOTE: This + //fcn is designed for instantanious use (ie, if you change the string at all, + //you *must* re-call this method). In other words, treat the ptr returned as + //*read* only! + char *getCStr() const; + + // Post: This string is emptied (length is zero) + inline void Wipe() { mStrLen = 0; } + + // Post: Replaces all instances of with + // Returns how many replaces took place + long Replace(char inTarget, char inReplacement); + long Replace(const char *inTarget, const char *inReplacement, + bool inCaseSensitive = true); + + // Post: Truncates chars from this string, either from the + //right or left. If is less than 1, this string is unaffected. If + // is greater or equal to the length if this string, the string is + //emptied. + void Trunc(unsigned long numToChop, bool fromRight = true); + + // Post: At position in the string, characters are + //removed "Hi,Fred".Remove( 3, 1 ) ---> "HiFred" + void Remove(unsigned long inPos, unsigned long inNum); + + // Post: All instances of a given string are removed from this string + // Note: inLen is the length of inStr. If inLen < -1, the length of + //inStr is calculated + void Remove(const char *inStr, int inLen = -1, bool inCaseSensitive = true); + + // Post: Truncates after the th character. If + //is greater than or equal to the length, nothing happens. + void Keep(unsigned long inNumToKeep); + + // Post: If this' len is larger than , a '�' replaces the + //th character and chars are removed after the '�' until the this' + //length is + void PoliteKeep(unsigned long inMaxLen, unsigned long inPos); + + // Post: A simple filter that decapitalized all chars that aren't the + //first in each word. + void Decapitalize(); + + // Post: Capitalizes all the chars in this string. + void Capitalize(); + + // Post: Removes any leading spaces in this string. + void ZapLeadingSpaces(); + + // Pre: points to a pascal string of length + // Post: The contents of this string is copied to , updating + //its length byte + void copyTo(unsigned char *pasDestPtr, unsigned char inBytesToCopy) const; + + // Pre: points to a c string with an allocated length of + // Post: The contents of this string is copied to + //, appending the NUL byte + void copyTo(char *cDestPtr, unsigned long inBytesToCopy) const; + + // Post: This string is read from from the current file position + void ReadFrom(CEgIStream *inStream); + + // Post: This string writes itself to at the current file + //position + void WriteTo(CEgOStream *inStream) const; + + // Post: Returns the rational value of this string times . + //All chars not '0'..'9' are ignored, except a leading '-' and a '.', where + //the digits that follow are decimal digits Usage: "12.34".GetValue( 20 ) + //will return 246 + long GetValue(long inMultiplier = 1) const; + + // Post: Returns a floating point value of this string + double GetFloatValue() const; + + // Pre: != 0 + // < 8 + // Post: Assigns the string equivilent of / to this + //string, truncating the string after decimal places. Usage: + //SetValue( 24686, 20, 2 ) would assign this string to "12.34" + void SetValue(long inVal, long inDivisor = 1, int inNumDecPlaces = 5); + + // Pre: |inValue| < 2^31 + // Sets this string to the given float value, using '.' as a decimal point, + //using at most inDigits behind the decimal point + void SetFloatValue(float inValue, int inDigits = 4); + + // Post: Assigns this string the roman numeral string for the number + //. + void SetRomanValue(long inValue); + + // Post: Returns the character position within this string of the + //rightmost occurance of . If is not found, 0 is returned. + inline long FindLastInstanceOf(char c) const { + return FindPrevInstanceOf(mStrLen, c); + } + + // Post: Returns the character position within this string of the + //leftmost occurance of after pos . If is not found, 0 is + //returned. Setting inPos to 0 starts from the beginning. + // "blah,blah!".FindNextInstanceOf( 0, ',' ) == 5 + long FindNextInstanceOf(unsigned long inPos, char c) const; + + // Post: Returns the character position within this string of the + //rightmost occurance of after pos . If is not found, 0 is + //returned. + long FindPrevInstanceOf(unsigned long inPos, char c) const; + + // Post: Compares this str with and returns: + // "hi".compareTo( "hi", 3, true ) == 0 + // "a".compareTo( "z", 2, true ) < 0 + // "Z".compareTo( "a", 2, false ) > 0 + int compareTo(const UtilStr *inStr, bool inCaseSensitive = true) const; + int compareTo(const unsigned char *inPStr, bool inCaseSensitive = true) const; + int compareTo(const char *inCStr, bool inCaseSensitive = true) const; + + // Post: Compares the first chars of data at and and + //returns: StrCmp( "hi", "hi", 3, true ) == 0 StrCmp( "a", "z", 2, true ) < 0 + // StrCmp( "z", "a", 2, true ) > 0 + // Note: If < 0, the length of s1 (as a C string) is used. + // Note: StrCmp( *, *, 0, * ) always returns false. + static int StrCmp(const char *s1, const char *s2, long inN, + bool inCaseSensitive); + + // Post: Returns the 1st next instance of in this str, skipping + //the first inStartingPos chars. If an instance cannot be found, 0 is + //returned. + // Note: inLen is the length of inStr. If inLen < -1, the length of + //inStr is calculated "Hi,Fred".contains( "fred", false ) == 4 + inline long contains(const UtilStr &inStr, int inStartingPos = 0, + bool inCaseSensitive = true) const { + return contains(inStr.getCStr(), inStr.length(), inStartingPos, + inCaseSensitive); + } + long contains(const char *inStr, int inLen = -1, int inStartingPos = 0, + bool inCaseSensitive = true) const; + + // Post: Blockmoves memory + static void Move(void *inDest, const void *inSrce, unsigned long inNumBytes); + + // Post: Appends , exporting/translating to "meta" format + //(ie, all translated bytes >= 32 or <= 127) + void AppendAsMeta(const UtilStr *inData); + void AppendAsMeta(void *inData, unsigned long inLen); + + // Post: Appends , importing/translating from "meta" + //format. Note: See AppendAsMeta() Ex: s.Wipe(); t.Wipe(); + //// Empty our strings s and t s.AppendAsMeta( dataPtr, 5 ); + //// Encode some data and put it in s t.AppendFromMeta( s.getCStr(), + //s.length() ); // t now contains exactly what was in dataPtr + void AppendFromMeta(const UtilStr *inStr); + void AppendFromMeta(const void *inStr, unsigned long inLen); + + // Post: Returns a psudorandom long for this string + long Hash() const; + + // Must be defined as a Hashable + bool Equals(const Hashable *inComp) const; + + // Pre: inB1 and inB2 are '0' to '9', 'A' to 'F', or 'a' to 'f' + // Post: The corresponding byte value is appended to this string + void AppendHex(char inB1, char inB2); + + // Post: Returns a floating point number for the given ASCII chars + static double GetFloatVal(const char *inNumStr, unsigned long inLen); + + // Post: Returns the truncated signed long value of this string. All + //characters not '0'..'9' are ignored except a leading '-' + // <*outPlacePtr> is set to 10^( 1 + trunc( log10( ) ) + //) Usage: "12.9".GetIntValue( &i ) returns 12 and assigns i to 100 + static long GetIntValue(const char *inStr, unsigned long inLen, + long *outPlacePtr = 0); + + // Longest Common Substring Seach Score + // Post: Returns a 'score' -- the greater the score, the more similar + // inStr is this string. + // Note: If inLen < 0, inStr (as a C string) is used. + // Note: This fcn is *not* communitive ( "cat" is more similar to + //"bigcat" then "bigcat" is to "cat" ) + // Note: Running time O( this.length * inStr.length ) + long LCSMatchScore(const char *inStr, long inStrLen = -1) const; + long LCSMatchScore(const UtilStr &inStr) const { + return LCSMatchScore(inStr.getCStr(), inStr.length()); + } + +protected: + unsigned long mBufSize; // Physical size of buf + unsigned long mStrLen; // NOTE: ALWAYS holds string size + char *mBuf; // Holds ptr to str data + + void init(); }; - - - #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XDynArray.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XDynArray.h index 2ffe5c670..e9432fb55 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XDynArray.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XDynArray.h @@ -1,40 +1,36 @@ #ifndef XDynArray_H #define XDynArray_H - #include "UtilStr.h" +class XDynArray : protected UtilStr { +public: + // The argument specified how big each element is in this array + XDynArray(long inRecSize); + // Returns the dimmed size of this Array + inline long Count() const { return mNumElements; } + // Effectively makes the length of this array zero. + void RemoveAll() { + Wipe(); + mNumElements = 0; + } -class XDynArray : protected UtilStr { + // Allows easy dynamic array usage. Simple use any index and XPtrList will + // expand to meet that size. + // Impt: Zero based indexing. + // Note: Indexs below 0 lead to disaster; + // Note: Since caller has access to changes values, any current sorting + //fcn is not used + void *operator[](const long inIndex); +protected: + long mNumElements; + long mRecSize; - public: - // The argument specified how big each element is in this array - XDynArray( long inRecSize ); - - // Returns the dimmed size of this Array - inline long Count() const { return mNumElements; } - - // Effectively makes the length of this array zero. - void RemoveAll() { Wipe(); mNumElements = 0; } - - // Allows easy dynamic array usage. Simple use any index and XPtrList will expand to meet that size. - // Impt: Zero based indexing. - // Note: Indexs below 0 lead to disaster; - // Note: Since caller has access to changes values, any current sorting fcn is not used - void* operator[] ( const long inIndex ); - - - - protected: - long mNumElements; - long mRecSize; - - static void* sDummy; + static void *sDummy; }; - #endif \ No newline at end of file diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XFloatList.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XFloatList.h index c78f08bdc..45637c2ac 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XFloatList.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XFloatList.h @@ -7,56 +7,67 @@ class XLongList; - class XFloatList { - public: - XFloatList( ListOrderingT inOrdering = cOrderNotImportant ); // See XPtrList.h for ListOrderingT choices - - // See XPtrList.h for description of functions. - virtual long Add( float inNum ) { return mList.Add( *((void**) &inNum) ); } - virtual void Add( const XFloatList& inList ) { mList.Add( inList.mList ); } - virtual bool RemoveElement( long inIndex ) { return mList.RemoveElement( inIndex ); } - virtual void RemoveAll() { mList.RemoveAll(); } - virtual float Fetch( long inIndex ) { long t = (long) mList.Fetch( inIndex ); return *((float*) &t);} - virtual bool Fetch( long inIndex, float* ioPtrDest ) const { return mList.Fetch( inIndex, (void**)ioPtrDest ); } - virtual long Count() const { return mList.Count(); } - - // Post: Ranks all the values in this list. - // Post: Fetch( outRank[ i ] ) is the ith largest value in this list. - // Post: outRank.Count() == inNumToRank (ie, only inNumToRank values of the ranking are returned) - // Note: If inNumToRank is invalid, the full ranking is returned - // Note: O( N log N ) running time - void Rank( XLongList& outRank, long inNumToRank = -1 ) const; - - // Computes a specified number of values that represent center-values for that current list of floats - // Note: if this float list isn't already sorted from LowToHigh, GetMeans() will have to perform a full sort!! - void FindMeans( long inNumMeans, float outMeans[], float inSigmaScale = 0.05 ) const; - - // Smoothes all the floats in this list - void GaussSmooth( float inSigma ); - - float operator[] ( const long inIndex ) { long t = (long) mList.Fetch( inIndex ); return *((float*) &t); } - - // Generic utility fcn to gauss-smooth a 1D curve. - static void GaussSmooth( float inSigma, long inN, float inSrceDest[] ); - static void GaussSmooth( float inSigma, long inN, float inSrce[], float inDest[] ); - - - static void SlopeSmooth( float inSmoothness, long inN, float ioData[] ); - - protected: - static int sFloatComparitor( const void* inA, const void* inB ); - static int sQSFloatComparitor( const void* inA, const void* inB ); - - #define MASK_MAX 40 - - static float sMask[ MASK_MAX ]; - static UtilStr sTemp; - - XPtrList mList; - +public: + XFloatList( + ListOrderingT inOrdering = + cOrderNotImportant); // See XPtrList.h for ListOrderingT choices + + // See XPtrList.h for description of functions. + virtual long Add(float inNum) { return mList.Add(*((void **)&inNum)); } + virtual void Add(const XFloatList &inList) { mList.Add(inList.mList); } + virtual bool RemoveElement(long inIndex) { + return mList.RemoveElement(inIndex); + } + virtual void RemoveAll() { mList.RemoveAll(); } + virtual float Fetch(long inIndex) { + long t = (long)mList.Fetch(inIndex); + return *((float *)&t); + } + virtual bool Fetch(long inIndex, float *ioPtrDest) const { + return mList.Fetch(inIndex, (void **)ioPtrDest); + } + virtual long Count() const { return mList.Count(); } + + // Post: Ranks all the values in this list. + // Post: Fetch( outRank[ i ] ) is the ith largest value in this list. + // Post: outRank.Count() == inNumToRank (ie, only inNumToRank values of + //the ranking are returned) Note: If inNumToRank is invalid, the full ranking + //is returned Note: O( N log N ) running time + void Rank(XLongList &outRank, long inNumToRank = -1) const; + + // Computes a specified number of values that represent center-values for that + // current list of floats Note: if this float list isn't already sorted from + // LowToHigh, GetMeans() will have to perform a full sort!! + void FindMeans(long inNumMeans, float outMeans[], + float inSigmaScale = 0.05) const; + + // Smoothes all the floats in this list + void GaussSmooth(float inSigma); + + float operator[](const long inIndex) { + long t = (long)mList.Fetch(inIndex); + return *((float *)&t); + } + + // Generic utility fcn to gauss-smooth a 1D curve. + static void GaussSmooth(float inSigma, long inN, float inSrceDest[]); + static void GaussSmooth(float inSigma, long inN, float inSrce[], + float inDest[]); + + static void SlopeSmooth(float inSmoothness, long inN, float ioData[]); + +protected: + static int sFloatComparitor(const void *inA, const void *inB); + static int sQSFloatComparitor(const void *inA, const void *inB); + +#define MASK_MAX 40 + + static float sMask[MASK_MAX]; + static UtilStr sTemp; + + XPtrList mList; }; - #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XList.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XList.h index 11fd94352..f0df3a4eb 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XList.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XList.h @@ -4,57 +4,55 @@ #include "nodeClass.h" #include "ListSocket.h" - - - - class XList : protected nodeClass, public ListSocket { - - - public: - XList( nodeClass* inParent ); - - // Post: This inserts within this node, after the current insertion point (ie, at mInsertionPt and mInsertionDepth). - // Note: 0 for a depth means the root level. - // Note: The insertion pt is modified/maintained to follow after was placed - void DoBestInsert( nodeClass* inNodeToAdd ); - - // Post: Sets the current insertion point before the node . - // Note: If is 0, the insert pt is at the end of the list - void SetInsertPtBefore( nodeClass* inInsertPt ); - - // *** nodeClass overrides--see nodeClass.h for fcn docs *** - // Post: Same as nodeClass::findSubNode() except that caching brings running time to O(1) (vs. O(n)) if - // the previous call was an adjacent node - virtual nodeClass* findSubNode( long inNodeNum ); - - // Post: Same as nodeClass::findSubNode() except that caching brings running time to O(1) (vs. O(n)) if - // the previous call was an adjacent node - virtual long findSubNode( nodeClass* inNodePtr ); - - // Post: Returns the cell number that is hierarcharaly inside (similar to nodeClass's GetParent()). - // Note: If the specified cell is at the root level (ie it has no real visible parent) then 0 is returned. - // Note: If the specified cell does not exist, -1 is returned. - long GetParent( long inCellNum ); - - // *** ListSocket overrides--see ListSocket.h for fcn docs *** - virtual bool CheckInsertPt( long& ioNodeNum, long& ioDepth ) { return nodeClass::CheckInsertPt( ioNodeNum, ioDepth ); } - virtual void MoveSelected( long inAboveCell, long inDepth ) { nodeClass::MoveSelected( inAboveCell, inDepth ); } - virtual void DeleteSelected() { nodeClass::DeleteSelected(); } - virtual XLongList* ManageClick( long inCell, bool inShift, bool inCmd, bool inDeselectRest ); - virtual void SetSelected( long inElementNum, bool isSelected ); - virtual bool IsSelected( long inElementNum ); - virtual long NumCells(); - - - protected: - virtual void UpdateCounts( int inShallowChange ); - - - nodeClass* mCachedNode; // 0 if Dirty - long mCachedNodeNum; // Deep instance of mCachedNode - +public: + XList(nodeClass *inParent); + + // Post: This inserts within this node, after the current + //insertion point (ie, at mInsertionPt and mInsertionDepth). Note: 0 for a + //depth means the root level. Note: The insertion pt is modified/maintained + //to follow after was placed + void DoBestInsert(nodeClass *inNodeToAdd); + + // Post: Sets the current insertion point before the node . + // Note: If is 0, the insert pt is at the end of the list + void SetInsertPtBefore(nodeClass *inInsertPt); + + // *** nodeClass overrides--see nodeClass.h for fcn docs *** + // Post: Same as nodeClass::findSubNode() except that caching brings + //running time to O(1) (vs. O(n)) if the previous call was an adjacent node + virtual nodeClass *findSubNode(long inNodeNum); + + // Post: Same as nodeClass::findSubNode() except that caching brings + //running time to O(1) (vs. O(n)) if the previous call was an adjacent node + virtual long findSubNode(nodeClass *inNodePtr); + + // Post: Returns the cell number that is hierarcharaly inside + //(similar to nodeClass's GetParent()). Note: If the specified cell is at the + //root level (ie it has no real visible parent) then 0 is returned. + // Note: If the specified cell does not exist, -1 is returned. + long GetParent(long inCellNum); + + // *** ListSocket overrides--see ListSocket.h for fcn docs *** + virtual bool CheckInsertPt(long &ioNodeNum, long &ioDepth) { + return nodeClass::CheckInsertPt(ioNodeNum, ioDepth); + } + virtual void MoveSelected(long inAboveCell, long inDepth) { + nodeClass::MoveSelected(inAboveCell, inDepth); + } + virtual void DeleteSelected() { nodeClass::DeleteSelected(); } + virtual XLongList *ManageClick(long inCell, bool inShift, bool inCmd, + bool inDeselectRest); + virtual void SetSelected(long inElementNum, bool isSelected); + virtual bool IsSelected(long inElementNum); + virtual long NumCells(); + +protected: + virtual void UpdateCounts(int inShallowChange); + + nodeClass *mCachedNode; // 0 if Dirty + long mCachedNodeNum; // Deep instance of mCachedNode }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XLongList.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XLongList.h index 85f84a9f5..f80fba1e5 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XLongList.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XLongList.h @@ -5,60 +5,62 @@ #include "XPtrList.h" - class XLongList { - - public: - XLongList( ListOrderingT inOrdering = cOrderNotImportant ); // See XPtrList.h for ListOrderingT choices - - // See XPtrList.h for description of functions. - inline long Add( long inNum ) { return mList.Add( (void*) inNum ); } - inline void Add( const XLongList& inList ) { mList.Add( inList.mList ); } - inline bool Remove( long inNum ) { return mList.Remove( (void*) inNum ); } - inline bool RemoveElement( long inIndex ) { return mList.RemoveElement( inIndex ); } - inline void RemoveAll() { mList.RemoveAll(); } - inline long Fetch( long inIndex ) { return (long) mList.Fetch( inIndex ); } - inline bool Fetch( long inIndex, long* ioPtrDest ) const { return mList.Fetch( inIndex, (void**)ioPtrDest ); } - inline long FindIndexOf( const long inMatch ) const { return mList.FindIndexOf( (void*) inMatch ); } - inline long Count() const { return mList.Count(); } - void Randomize() { mList.Randomize(); } - - // Post: Any nums in this list that are in the interval [ inStart, inEnd ] are removed. - // Note: Note how the interval is inclusive. - void SubtractRange( long inStart, long inEnd ); - - // Post: Any nums in this list that are not in the interval [ inStart, inEnd ] are removed. - // Note: Note how the interval is inclusive. - void ApplyMask( long inStart, long inEnd ); - - // Allows easy dynamic array usage. Simply use any index and XLongList will expand to meet that size. - // Impt: Zero based indexing is used here!! (In contrast to Fetch()) - // Note: Elements that are newly accessed are initialized to 0 - // Note: Indexs below 0 lead to sDummy; - // Note: Since caller has access to changes values, any current sorting fcn is not used - long& operator[] ( const long inIndex ); +public: + XLongList(ListOrderingT inOrdering = + cOrderNotImportant); // See XPtrList.h for ListOrderingT choices + // See XPtrList.h for description of functions. + inline long Add(long inNum) { return mList.Add((void *)inNum); } + inline void Add(const XLongList &inList) { mList.Add(inList.mList); } + inline bool Remove(long inNum) { return mList.Remove((void *)inNum); } + inline bool RemoveElement(long inIndex) { + return mList.RemoveElement(inIndex); + } + inline void RemoveAll() { mList.RemoveAll(); } + inline long Fetch(long inIndex) { return (long)mList.Fetch(inIndex); } + inline bool Fetch(long inIndex, long *ioPtrDest) const { + return mList.Fetch(inIndex, (void **)ioPtrDest); + } + inline long FindIndexOf(const long inMatch) const { + return mList.FindIndexOf((void *)inMatch); + } + inline long Count() const { return mList.Count(); } - // Post: Ranks all the values in this list. - // Post: Fetch( outRank[ i ] ) is the ith largest value in this list. - // Post: outRank.Count() == inNumToRank (ie, only inNumToRank values of the ranking are returned) - // Note: If inNumToRank is invalid, the full ranking is returned - // Note: O( N log N ) running time - void Rank( XLongList& outRank, long inNumToRank = -1 ) const; + void Randomize() { mList.Randomize(); } - - protected: - static int sLongComparitor( const void* inA, const void* inB ); - static int sQSLongComparitor( const void* inA, const void* inB ); + // Post: Any nums in this list that are in the interval [ inStart, inEnd + //] are removed. Note: Note how the interval is inclusive. + void SubtractRange(long inStart, long inEnd); - XPtrList mList; - - static long sDummy; - -}; + // Post: Any nums in this list that are not in the interval [ inStart, + //inEnd ] are removed. Note: Note how the interval is inclusive. + void ApplyMask(long inStart, long inEnd); + + // Allows easy dynamic array usage. Simply use any index and XLongList + // will expand to meet that size. + // Impt: Zero based indexing is used here!! (In contrast to Fetch()) + // Note: Elements that are newly accessed are initialized to 0 + // Note: Indexs below 0 lead to sDummy; + // Note: Since caller has access to changes values, any current sorting + //fcn is not used + long &operator[](const long inIndex); + // Post: Ranks all the values in this list. + // Post: Fetch( outRank[ i ] ) is the ith largest value in this list. + // Post: outRank.Count() == inNumToRank (ie, only inNumToRank values of + //the ranking are returned) Note: If inNumToRank is invalid, the full ranking + //is returned Note: O( N log N ) running time + void Rank(XLongList &outRank, long inNumToRank = -1) const; +protected: + static int sLongComparitor(const void *inA, const void *inB); + static int sQSLongComparitor(const void *inA, const void *inB); + XPtrList mList; + + static long sDummy; +}; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XPtrList.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XPtrList.h index f9153caa9..da43ec62b 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XPtrList.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XPtrList.h @@ -5,112 +5,112 @@ #include "UtilStr.h" -// Post: Returns a num >= 0 iff the first arg is less than or equal to the second arg. -// Returns a num < 0 iff the first arg is greater than the second arg. -typedef int (*CompFunctionT)(const void*, const void*); - +// Post: Returns a num >= 0 iff the first arg is less than or equal to the +// second arg. +// Returns a num < 0 iff the first arg is greater than the +//second arg. +typedef int (*CompFunctionT)(const void *, const void *); enum ListOrderingT { - cOrderImportant, - cOrderNotImportant, - cSortLowToHigh, - cSortHighToLow + cOrderImportant, + cOrderNotImportant, + cSortLowToHigh, + cSortHighToLow }; class XPtrList : protected UtilStr { - friend class XStrList; - friend class XDictionary; - friend class Hashtable; - friend class XFloatList; - friend class XLongList; - - public: - XPtrList( const XPtrList& inList ); - XPtrList( ListOrderingT inOrdering = cOrderNotImportant ); - - // Post: Assigns this from . - void Assign( const XPtrList& inList ); - - // Post: Adds the ptr to this' list - // Order: O( 1 ), O( log n ) if sorting is on. - // Note: Returns what index the new element occupies (1-based indexing). - long Add( const void* inPtrToAdd ); - - // Post: Adds the ptr to this' list after (existing) ptr number inN--make inN 0 if you want your ptr to be the 1st element - // Order: O( 1 ) - // Note: If inN is invalid, the closest element is used - void Add( const void* inPtrToAdd, long inN ); - - // Post: Adds each element of the incoming list to this list. This is functionally the same as - // looping thru the size of inPtrList and calling this.Add() for each element. - void Add( const XPtrList& inPtrList ); - - // Post: Searches for the ptr in the list and removes it if found. - // Note: is returned if the ptr was found (and removed) - // Order: O( N ), O( log n + alpha n ) if sorting is on. - bool Remove( const void* inPtrToRemove ); - - // Note: is returned if the element was found (and removed) - // Order: O( N ), O( log n ) if sorting is on. - // Note: When order is set to be preserved (via cOrderImportant or a specificed sort fcn), elements - // at the end of the list are removed faster - bool RemoveElement( long inIndex ); - bool RemoveLast(); - - // Post: Empties the ptr list - void RemoveAll(); - - // Post: Used to fetch any given ptr. If the index exists, is returned and the ptr is copied to *inPtrDest. - // Note: One based indexing is used - // Order: O( 1 ) - void* Fetch( long inIndex ) const; - bool Fetch( long inIndex, void** ioPtrDest ) const; - inline bool FetchLast( void** ioPtrDest ) const { return Fetch( Count(), ioPtrDest ); } - - // Allows easy dynamic array usage. Simple use any index and XPtrList will expand to meet that size. - // Impt: Zero based indexing is used here!! (In contrast to Fetch()) - // Note: Elements that are newly accessed are initialized to 0 - // Note: Indexs below 0 lead to sDummy; - // Note: Since caller has access to changes values, any current sorting fcn is not used - void*& operator[] ( long inIndex ); - - // Post: Moves element at so that it has index 1. - void MoveToHead( long inIndex ); - - // Post: Searches for the given ptr in its ptr list and returns the index of the match - // If the item cannot be found, 0 is returned - // Note: One based indexing is used - // Order: O( N ), O( log n ) if sorting is on. - long FindIndexOf( const void* inMatchPtr ) const; - - // Post: Returns the number of items in this list. - // Order: O( 1 ) - inline long Count() const { return length() / sizeof(void*); } - - // Post: All ptrs in this list are randomly reordered. - void Randomize(); - - // Allows the compare fcn to be set. Causes the current contents to be removed. - void SetCompFcn( CompFunctionT inFcn, bool inSortLowToHigh ); - - protected: - - - ListOrderingT mOrdering; - CompFunctionT mCompFcn; - - // Pre: The list of nums must be sorted - // Post: Returns the (one based) index of the predicessor of . If zero is returned, - // then is <= than all the elements in the list. - long FetchPredIndex( const void* inNum ) const; - - static void* sDummy; - + friend class XStrList; + friend class XDictionary; + friend class Hashtable; + friend class XFloatList; + friend class XLongList; + +public: + XPtrList(const XPtrList &inList); + XPtrList(ListOrderingT inOrdering = cOrderNotImportant); + + // Post: Assigns this from . + void Assign(const XPtrList &inList); + + // Post: Adds the ptr to this' list + // Order: O( 1 ), O( log n ) if sorting is on. + // Note: Returns what index the new element occupies (1-based indexing). + long Add(const void *inPtrToAdd); + + // Post: Adds the ptr to this' list after (existing) ptr number inN--make + //inN 0 if you want your ptr to be the 1st element Order: O( 1 ) + // Note: If inN is invalid, the closest element is used + void Add(const void *inPtrToAdd, long inN); + + // Post: Adds each element of the incoming list to this list. This is + //functionally the same as looping thru the size of inPtrList and calling + //this.Add() for each element. + void Add(const XPtrList &inPtrList); + + // Post: Searches for the ptr in the list and removes it if found. + // Note: is returned if the ptr was found (and removed) + // Order: O( N ), O( log n + alpha n ) if sorting is on. + bool Remove(const void *inPtrToRemove); + + // Note: is returned if the element was found (and removed) + // Order: O( N ), O( log n ) if sorting is on. + // Note: When order is set to be preserved (via cOrderImportant or a + //specificed sort fcn), elements at the end of the list are removed faster + bool RemoveElement(long inIndex); + bool RemoveLast(); + + // Post: Empties the ptr list + void RemoveAll(); + + // Post: Used to fetch any given ptr. If the index exists, is + //returned and the ptr is copied to *inPtrDest. Note: One based indexing is + //used Order: O( 1 ) + void *Fetch(long inIndex) const; + bool Fetch(long inIndex, void **ioPtrDest) const; + inline bool FetchLast(void **ioPtrDest) const { + return Fetch(Count(), ioPtrDest); + } + + // Allows easy dynamic array usage. Simple use any index and XPtrList will + // expand to meet that size. + // Impt: Zero based indexing is used here!! (In contrast to Fetch()) + // Note: Elements that are newly accessed are initialized to 0 + // Note: Indexs below 0 lead to sDummy; + // Note: Since caller has access to changes values, any current sorting + //fcn is not used + void *&operator[](long inIndex); + + // Post: Moves element at so that it has index 1. + void MoveToHead(long inIndex); + + // Post: Searches for the given ptr in its ptr list and returns the index + //of the match If the item cannot be found, 0 is returned + // Note: One based indexing is used + // Order: O( N ), O( log n ) if sorting is on. + long FindIndexOf(const void *inMatchPtr) const; + + // Post: Returns the number of items in this list. + // Order: O( 1 ) + inline long Count() const { return length() / sizeof(void *); } + + // Post: All ptrs in this list are randomly reordered. + void Randomize(); + + // Allows the compare fcn to be set. Causes the current contents to be + //removed. + void SetCompFcn(CompFunctionT inFcn, bool inSortLowToHigh); + +protected: + ListOrderingT mOrdering; + CompFunctionT mCompFcn; + + // Pre: The list of nums must be sorted + // Post: Returns the (one based) index of the predicessor of . If + //zero is returned, then is <= than all the elements in the list. + long FetchPredIndex(const void *inNum) const; + + static void *sDummy; }; - - - - #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XPtrMatrix.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XPtrMatrix.h index a0dc1fe57..893114b26 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XPtrMatrix.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XPtrMatrix.h @@ -1,36 +1,30 @@ - #ifndef __XPTRMATRIX__ #define __XPTRMATRIX__ - #include "XPtrList.h" - class XPtrMatrix { - public: - XPtrMatrix( bool inRowOrderImpt = false ); - virtual ~XPtrMatrix(); - - // Removes all the rows (ie, elements) - void RemoveAll(); - - // Appends the given ptr to the end of the given column. - // Note: zero-based indexing is used for the column number - void Add( long inColumn, void* inPtr ); - inline void Add( long inColumn, long inNum ) { Add( inColumn, (void*) inNum ); } - - // Fetches the specified column (using zero-based indexing) - XPtrList* operator[]( long inIndex ); - - - protected: - XPtrList mColumns; - ListOrderingT mRowOrdering; -}; +public: + XPtrMatrix(bool inRowOrderImpt = false); + virtual ~XPtrMatrix(); + // Removes all the rows (ie, elements) + void RemoveAll(); -#endif + // Appends the given ptr to the end of the given column. + // Note: zero-based indexing is used for the column number + void Add(long inColumn, void *inPtr); + inline void Add(long inColumn, long inNum) { Add(inColumn, (void *)inNum); } + // Fetches the specified column (using zero-based indexing) + XPtrList *operator[](long inIndex); + +protected: + XPtrList mColumns; + ListOrderingT mRowOrdering; +}; + +#endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XStrList.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XStrList.h index 04eaf305d..57103ee98 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XStrList.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/XStrList.h @@ -3,54 +3,51 @@ #include "XPtrList.h" - enum XStrListOptsT { - cDuplicatesAllowed, - cNoDuplicates_CaseSensitive, - cNoDuplicates_CaseInsensitive + cDuplicatesAllowed, + cNoDuplicates_CaseSensitive, + cNoDuplicates_CaseInsensitive }; - - class XStrList { - public: - XStrList( XStrListOptsT inOption, ListOrderingT inOrdering = cOrderNotImportant ); - virtual ~XStrList(); +public: + XStrList(XStrListOptsT inOption, + ListOrderingT inOrdering = cOrderNotImportant); + virtual ~XStrList(); - // Returns what index the copy of the given string now occupies (1-based indexing). If 0 is returned, - // a copy of the string was not added because it was a duplicate (if that flag is on) - long Add( const void* inData, long inLen ); - long Add( const char* inStr ); - long Add( const UtilStr& inStr ); + // Returns what index the copy of the given string now occupies (1-based + // indexing). If 0 is returned, a copy of the string was not added because it + // was a duplicate (if that flag is on) + long Add(const void *inData, long inLen); + long Add(const char *inStr); + long Add(const UtilStr &inStr); - void RemoveAll(); - void Remove( long inIndex ); + void RemoveAll(); + void Remove(long inIndex); - // Look for an item with a matching name. If 0 is returned, no item was found. - //virtual long FindIndexOf( const char* inStr ) const; - long FindIndexOf( const UtilStr& inStr ) const; + // Look for an item with a matching name. If 0 is returned, no item was + // found. + // virtual long FindIndexOf( const char* inStr ) const; + long FindIndexOf(const UtilStr &inStr) const; - // Returns a copy of the string's contents - bool Fetch( long inIndex, UtilStr& outStr ) const; + // Returns a copy of the string's contents + bool Fetch(long inIndex, UtilStr &outStr) const; - // Returns direct access to the string. You're free to modify the string, - // but be reminded that it's owned by this (so don't delete it) - UtilStr* Fetch( long inIndex ) const; + // Returns direct access to the string. You're free to modify the string, + // but be reminded that it's owned by this (so don't delete it) + UtilStr *Fetch(long inIndex) const; - // Returns an index of the closest matching string to inStr - long FetchBestMatch( const UtilStr& inStr ); + // Returns an index of the closest matching string to inStr + long FetchBestMatch(const UtilStr &inStr); + inline long Count() const { return mStrings.Count(); } - inline long Count() const { return mStrings.Count(); } - - protected: - static int sStrComparitor( const void* inA, const void* inB ); - static int sStrComparitorCI( const void* inA, const void* inB ); - XStrListOptsT mStrListOption; - XPtrList mStrings; - +protected: + static int sStrComparitor(const void *inA, const void *inB); + static int sStrComparitorCI(const void *inA, const void *inB); + XStrListOptsT mStrListOption; + XPtrList mStrings; }; - #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/nodeClass.h b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/nodeClass.h index f0f22c72e..b4afa3276 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/nodeClass.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/Headers/nodeClass.h @@ -2,307 +2,321 @@ #ifndef _NODECLASS_ #define _NODECLASS_ - class nodeClass; class CEgIStream; class CEgOStream; -//#define EG_DEBUG +// #define EG_DEBUG enum { - nodeClassT = 1, - entryClassT = 2, - CEgDbMgrT = 4, - CEgChapMgrT = 5, - CPLDbMgrT = 6, - FdeT = 7, - FqpT = 8, - FAttributeT = 9, - FParagraphT = 10, - FBitmapT = 11, - CDbItemRefNodeT = 12, - CStrNodeT = 13, - nodeClassReserved = 14, - FTabT = 15, - FFractionT = 16, - FVerticalSubT = 17, - CPLItemT = 90, - - cEgSubEnd = 0 + nodeClassT = 1, + entryClassT = 2, + CEgDbMgrT = 4, + CEgChapMgrT = 5, + CPLDbMgrT = 6, + FdeT = 7, + FqpT = 8, + FAttributeT = 9, + FParagraphT = 10, + FBitmapT = 11, + CDbItemRefNodeT = 12, + CStrNodeT = 13, + nodeClassReserved = 14, + FTabT = 15, + FFractionT = 16, + FVerticalSubT = 17, + CPLItemT = 90, + + cEgSubEnd = 0 }; - // Use this macro to register your derived node class with nodeClass -#define RegisterNode_( ClassName ) TNodeRegistrar::RegisterNode( ClassName##T ); +#define RegisterNode_(ClassName) \ + TNodeRegistrar::RegisterNode(ClassName##T); -typedef nodeClass* (*CreatorFuncT)( nodeClass* inParent ); +typedef nodeClass *(*CreatorFuncT)(nodeClass *inParent); -#define isPLItem( nodePtr ) (( nodePtr -> GetType() == 90 ) ? (CPLItem*) nodePtr : 0) -#define Cast( nodePtr, className ) (( nodePtr -> GetType() == className##T ) ? (className*) nodePtr : 0) +#define isPLItem(nodePtr) ((nodePtr->GetType() == 90) ? (CPLItem *)nodePtr : 0) +#define Cast(nodePtr, className) \ + ((nodePtr->GetType() == className##T) ? (className *)nodePtr : 0) +/* This is a basic list classn. Derive from nodeClass and attach you data + */ +class nodeClass { -/* This is a basic list classn. Derive from nodeClass and attach you data -*/ + friend class XList; +private: + static long sClassIDs[30]; + static CreatorFuncT sCreatorFunc[30]; + static int sNumRegistered; -class nodeClass { + void initSelf(); - friend class XList; - - private: - static long sClassIDs[ 30 ]; - static CreatorFuncT sCreatorFunc[ 30 ]; - static int sNumRegistered; - - void initSelf(); - - unsigned short mFlags; - - nodeClass* mNext; - nodeClass* mPrev; - nodeClass* mParent; - - long mShallowCount; - long mDeepCount; // -1 if Dirty - - - - virtual void UpdateCounts( int inShallowChange ); - - protected: - nodeClass* mHead; - nodeClass* mTail; - - // Access this enum to typecast this node - unsigned char mType; - - static nodeClass* CreateNode( long inClassID, nodeClass* inParent ); - - - - public: - - nodeClass(); - // Post: Constructs a node and places the node at the tail of - nodeClass( nodeClass* inParentPtr ); - - // Post: Destroys this node and all sub items inside it - virtual ~nodeClass(); - - inline unsigned char GetType() const { return mType; } - - // Post: This is how nodeClass "knows" what kind of nodeClass to instantiate when it reads an ID from a stream. - static void RegisterNodeClass( long inID, CreatorFuncT inCreatorFunc ); - - - // Post: Returns a random number from to , inclusive. - static long Rnd( long min, long max ); - - - #ifdef EG_DEBUG - nodeClass* mNextDebug; - static nodeClass* sFirstDebug; - static long sCacheHitsA; - static long sCacheHitsB; - static long sCacheTrysA; - static long sCacheTrysB; - static long sCacheHitsC; - static long sCacheTrysC; - static void DebugBreak(); - #endif - - // Post: All sub nodes (at any depth) that are selected are deleted. If a node is selected, its contents are placed at the same - // level of this and this is then deleted. - virtual void DeleteSelected(); - - inline void Select() { mFlags = mFlags | 0x1; } - inline void Unselect() { mFlags = mFlags & 0xFFFE; } - inline bool IsSelected() const { return mFlags & 0x1; } - void SetSelected( bool inIsSelected ) { if ( inIsSelected ) Select(); else Unselect(); } - - - - // Post: Allows client write access to various boolean flags. - // Note: If is < 1 or > 9, nothing occurs. - void SetFlag( unsigned int inFlagNum, bool inVal ); - - // Post: Allows client read access to various boolean flags. - // Note: If is < 1 or > 9, false is returned. - bool GetFlag( unsigned int inFlagNum ) const; - - // Post: This node and all sub nodes (and their sub nodes, etc) are un/selected with . - void SetTreeSelected( bool inSelected ); - - // Post: Returns an associated unique or hash for the node. - // Note: This is how XList knows what order to sort nodes, if that option is enabled. - virtual long GetKey() { return 0; } - - // Post: The node is detached from it's parent. Obviously, the caller now assumes ownership of the node. - void detach(); - - // Post: This node is inserted in 's parent list following in the list order - void insertAfter( nodeClass* inPrevNode ); - - // Post: If <= 0, is added at this' head. - // If 0 < <= deepCount(), is added after the item. - // If > deepCount(), is added at this' tail. - void insertAfter( long inAfterNode, nodeClass* inNodeToAdd ); - - // The following are useful for setting up loops, etc - inline nodeClass* GetNext() const { return mNext; } - inline nodeClass* GetPrev() const { return mPrev; } - inline nodeClass* GetParent() const { return mParent; } - inline nodeClass* GetTail() const { return mTail; } - inline nodeClass* GetHead() const { return mHead; } - - // Post: Returns the node following this heirarchaly. - // Post: The node returned will have as a super-parent. - /* Sample: 1 (leftward is the mHead) - / \ - 2 6 - / \ - 3 4 - | - 5 - - void f( nodeClass* ceiling ) { - node = ceiling; - while ( node != 0 ) { - print( node ); - node = node -> NextInChain( ceiling ) - } - } - - Output of f(1): 2, 3, 4, 5, 6 - Output of f(2): 3, 4, 5 */ - nodeClass* NextInChain( const nodeClass* inCeiling ) const; - - // Post: The inverse fcn of NextInChain() (see above) - nodeClass* PrevInChain( const nodeClass* inCeiling ) const; - - // Post: is detached from it's current parent list and is inserted as the last node in this' sub list - void addToTail( nodeClass* inPtr ); - - // Post: is detached from it's current parent list and is inserted at the 1st node in this' sub list - void addToHead( nodeClass* inPtr ); - - // Post: Returns the last deep sub node in the deep sub list. - // In other words, this fcn equals: this -> findSubNode( this -> deepCount() ) - nodeClass* GetDeepTail() const; - - // Post: Returns the highest parent, say p, of this node where (p -> GetDeepTail() == this) is true. - // In other words, this returns the highest parent that has prev node. - // Note: Returns 0 if no such parent exists. - nodeClass* GetParentDeepTail( const nodeClass* inCeiling ) const; - - // Post: this -> CountDepth( GetParentDeepTail( inCeiling ) ); - // Or, in easy terms, CountOverhang returns the difference in depth between itself - // and the parent node where CountOverhang is zero. - // Or, easier yet, - /* 1 - |- 2 2 -> CountOverhang( 1 ) == 0 - | |-3 3 -> CountOverhang( 1 ) == 0 - | |-4 4 -> CountOverhang( 1 ) == 1 - | - |- 5 5 -> CountOverhang( 1 ) == 0 - | |-6 6 -> CountOverhang( 1 ) == 1 - | |-7 7 -> CountOverhang( 1 ) == 2 - |- 8 8 -> CountOverhang( 1 ) == 1 */ - int CountOverhang( const nodeClass* inCeiling ) const; - - // Post: Used by a GUI to refine a given insertion point. - // Post: and may be adjusted/corrected. - // Note: Depths are such that 0 means root level. - // Note: Fcn succesful iff is returned. - virtual bool CheckInsertPt( long& ioNodeNum, long& ioDepth ); - - // Post: Mirrors a GUI drag of the selected items dropped before cell at depth - // Note: If is invalid or < 0 or > N, the closest boundry is used. - // Calls: VerifyNode() - virtual void MoveSelected( long afterItemNum, long inDepth ); - - // Post: Examines to see if it's in a valid location. If not, it may be moved or deleted. - virtual void VerifyNode( nodeClass* nodeAdded ); - - // Post: Delete's all sub nodes in this node - virtual void deleteContents(); - - // Post: Travels upward in its hierarchy until it finds a parent without its own parent - nodeClass* getHighestParent(); - - // Post: Returns if is any parent of this. - // Note: If inMaybeParent == 0, false is returned. - bool HasTheParent( const nodeClass* inMaybeParent ) const; - - // Post: Returns if this node contains other nodes (optimized for speed) - inline bool IsEmpty() const { return mHead == 0; } - - // Post: Returns the number of nodes in this node's sub list (in contrast to deepCount() ) - inline long shallowCount() const { return mShallowCount; } - - // Post: Returns the total number of nodes in this node's sub list PLUS the number of items in *their* sub lists. - long deepCount(); - - // Post: Returns the number of super lists above this node. Ex, if this node didn't have a parent, countDepth() - // would return 0. If we then put it inside a newly constructed node, countDepth() would return 1. - long CountDepth( const nodeClass* inCeiling ) const; - - // Post: Return what node number this node is in its parent's shallow list. Ex, if you added this node to the head of - // another node, findInstance() would return a 1. If this node is not in a sub list (ie, it has no parent), - // a 0 is returned. - long findInstance() const; - - // Post: Returns the th node in this node's (shallow) sub list. A 0 is returned if - // is less than or equal to zero or if greater than the number of items in this node's sub list. - nodeClass* findNodeNum( long inNodeNum ); - - // Post: Similar to findNodeNum( long ) except that the node returned is the th node in the _entire_ - // _sub_ _tree_ (as opposed to the base sub level). If we had 2 sub nodes per node and we had 3 levels of - // these, there would be a total of 2^3 leaves and a total of 2^4-1 nodes. findSubNode( 8 ) would return the - // second node at the root level. The inverse of this function is findSubNode( nodeClass* ) and findNum(). - // Note: If does not exist (ie, it's <= 0 or > deepCount()) then 0 is returned. - virtual nodeClass* findSubNode( long inNodeNum ); - - // Post: This is the exact inverse function of findSubNode( long ). This fcn returns the deep instance number of - // in this node deep sub tree. If the node was not found in this node's sub tree, 0 is returned. - // Note: If is 0, 0 is returned. - virtual long findSubNode( nodeClass* inNodePtr ); - - // Post: All sub nodes in are appended in order inside this node. If is true, the nodes - // in are put at the head of this, and if it is false, the nodes are put at the tail of this. - void absorbContents( nodeClass* sourceList, int inPutAtHead = true ); - - // Post: All sub nodes in are moved to the tail of this if they are marked - void absorbMarked( nodeClass* sourceList ); - - // Post: All sub nodes in are moved after this node (thus placing them in this node's parent's sub list) - void absorbAfter( nodeClass* sourceList ); - - // Post: Randomizes all sub nodes within this node. - void RandomizeSubs(); - - virtual void WriteTo( CEgOStream* inStream ); - virtual void ReadFrom( CEgIStream* inFile ); - virtual void StartRead( CEgIStream* inFile ); + unsigned short mFlags; -}; + nodeClass *mNext; + nodeClass *mPrev; + nodeClass *mParent; + long mShallowCount; + long mDeepCount; // -1 if Dirty + virtual void UpdateCounts(int inShallowChange); -template class TNodeRegistrar { +protected: + nodeClass *mHead; + nodeClass *mTail; - public: - static T* CreateFromStream( nodeClass* inParent ) { - return new T( inParent ); - } + // Access this enum to typecast this node + unsigned char mType; + static nodeClass *CreateNode(long inClassID, nodeClass *inParent); - static void RegisterNode( long inClassID ) { - nodeClass::RegisterNodeClass( inClassID, (CreatorFuncT) CreateFromStream ); - } -}; +public: + nodeClass(); + // Post: Constructs a node and places the node at the tail of + // + nodeClass(nodeClass *inParentPtr); + + // Post: Destroys this node and all sub items inside it + virtual ~nodeClass(); + inline unsigned char GetType() const { return mType; } + // Post: This is how nodeClass "knows" what kind of nodeClass to + //instantiate when it reads an ID from a stream. + static void RegisterNodeClass(long inID, CreatorFuncT inCreatorFunc); + + // Post: Returns a random number from to , inclusive. + static long Rnd(long min, long max); + +#ifdef EG_DEBUG + nodeClass *mNextDebug; + static nodeClass *sFirstDebug; + static long sCacheHitsA; + static long sCacheHitsB; + static long sCacheTrysA; + static long sCacheTrysB; + static long sCacheHitsC; + static long sCacheTrysC; + static void DebugBreak(); #endif + // Post: All sub nodes (at any depth) that are selected are deleted. If + //a node is selected, its contents are placed at the same level of this and + //this is then deleted. + virtual void DeleteSelected(); + + inline void Select() { mFlags = mFlags | 0x1; } + inline void Unselect() { mFlags = mFlags & 0xFFFE; } + inline bool IsSelected() const { return mFlags & 0x1; } + void SetSelected(bool inIsSelected) { + if (inIsSelected) + Select(); + else + Unselect(); + } + + // Post: Allows client write access to various boolean flags. + // Note: If is < 1 or > 9, nothing occurs. + void SetFlag(unsigned int inFlagNum, bool inVal); + + // Post: Allows client read access to various boolean flags. + // Note: If is < 1 or > 9, false is returned. + bool GetFlag(unsigned int inFlagNum) const; + + // Post: This node and all sub nodes (and their sub nodes, etc) are + //un/selected with . + void SetTreeSelected(bool inSelected); + + // Post: Returns an associated unique or hash for the node. + // Note: This is how XList knows what order to sort nodes, if that option + //is enabled. + virtual long GetKey() { return 0; } + + // Post: The node is detached from it's parent. Obviously, the caller + //now assumes ownership of the node. + void detach(); + + // Post: This node is inserted in 's parent list following + // in the list order + void insertAfter(nodeClass *inPrevNode); + + // Post: If <= 0, is added at this' head. + // If 0 < <= deepCount(), is added + //after the item. If > deepCount(), + //is added at this' tail. + void insertAfter(long inAfterNode, nodeClass *inNodeToAdd); + + // The following are useful for setting up loops, etc + inline nodeClass *GetNext() const { return mNext; } + inline nodeClass *GetPrev() const { return mPrev; } + inline nodeClass *GetParent() const { return mParent; } + inline nodeClass *GetTail() const { return mTail; } + inline nodeClass *GetHead() const { return mHead; } + + // Post: Returns the node following this heirarchaly. + // Post: The node returned will have as a super-parent. + /* Sample: 1 (leftward is the + mHead) + / \ + 2 6 + / \ + 3 4 + | + 5 + + void f( nodeClass* ceiling ) { + node = ceiling; + while ( node != 0 ) { + print( node ); + node = node -> NextInChain( ceiling ) + } + } + + Output of f(1): 2, 3, 4, 5, 6 + Output of f(2): 3, 4, 5 */ + nodeClass *NextInChain(const nodeClass *inCeiling) const; + + // Post: The inverse fcn of NextInChain() (see above) + nodeClass *PrevInChain(const nodeClass *inCeiling) const; + + // Post: is detached from it's current parent list and is + //inserted as the last node in this' sub list + void addToTail(nodeClass *inPtr); + + // Post: is detached from it's current parent list and is + //inserted at the 1st node in this' sub list + void addToHead(nodeClass *inPtr); + + // Post: Returns the last deep sub node in the deep sub list. + // In other words, this fcn equals: this -> findSubNode( this -> + //deepCount() ) + nodeClass *GetDeepTail() const; + + // Post: Returns the highest parent, say p, of this node where (p -> + //GetDeepTail() == this) is true. In other words, this returns the highest + //parent that has prev node. Note: Returns 0 if no such parent exists. + nodeClass *GetParentDeepTail(const nodeClass *inCeiling) const; + + // Post: this -> CountDepth( GetParentDeepTail( inCeiling ) ); + // Or, in easy terms, CountOverhang returns the difference in depth + //between itself and the parent node where CountOverhang is zero. Or, easier + //yet, + /* 1 + |- 2 2 -> CountOverhang( 1 ) == + 0 | |-3 3 -> CountOverhang( 1 ) == 0 | |-4 + 4 -> CountOverhang( 1 ) == 1 + | + |- 5 5 -> CountOverhang( 1 ) == + 0 | |-6 6 -> CountOverhang( 1 ) == 1 | |-7 + 7 -> CountOverhang( 1 ) == 2 + |- 8 8 -> CountOverhang( 1 ) == + 1 */ + int CountOverhang(const nodeClass *inCeiling) const; + + // Post: Used by a GUI to refine a given insertion point. + // Post: and may be adjusted/corrected. + // Note: Depths are such that 0 means root level. + // Note: Fcn succesful iff is returned. + virtual bool CheckInsertPt(long &ioNodeNum, long &ioDepth); + + // Post: Mirrors a GUI drag of the selected items dropped before cell + // at depth Note: If is invalid or + // < 0 or > N, the closest boundry is used. Calls: + //VerifyNode() + virtual void MoveSelected(long afterItemNum, long inDepth); + + // Post: Examines to see if it's in a valid location. If + //not, it may be moved or deleted. + virtual void VerifyNode(nodeClass *nodeAdded); + + // Post: Delete's all sub nodes in this node + virtual void deleteContents(); + + // Post: Travels upward in its hierarchy until it finds a parent without + //its own parent + nodeClass *getHighestParent(); + + // Post: Returns if is any parent of this. + // Note: If inMaybeParent == 0, false is returned. + bool HasTheParent(const nodeClass *inMaybeParent) const; + + // Post: Returns if this node contains other nodes (optimized for + //speed) + inline bool IsEmpty() const { return mHead == 0; } + + // Post: Returns the number of nodes in this node's sub list (in contrast + //to deepCount() ) + inline long shallowCount() const { return mShallowCount; } + + // Post: Returns the total number of nodes in this node's sub list PLUS + //the number of items in *their* sub lists. + long deepCount(); + + // Post: Returns the number of super lists above this node. Ex, if this + //node didn't have a parent, countDepth() would return 0. If we then put it + //inside a newly constructed node, countDepth() would return 1. + long CountDepth(const nodeClass *inCeiling) const; + + // Post: Return what node number this node is in its parent's shallow + //list. Ex, if you added this node to the head of another node, + //findInstance() would return a 1. If this node is not in a sub list (ie, it + //has no parent), a 0 is returned. + long findInstance() const; + + // Post: Returns the th node in this node's (shallow) sub + //list. A 0 is returned if is less than or equal to zero or if + //greater than the number of items in this node's sub list. + nodeClass *findNodeNum(long inNodeNum); + + // Post: Similar to findNodeNum( long ) except that the node returned is + //the th node in the _entire_ _sub_ _tree_ (as opposed to the base + //sub level). If we had 2 sub nodes per node and we had 3 levels of these, + //there would be a total of 2^3 leaves and a total of 2^4-1 nodes. + //findSubNode( 8 ) would return the second node at the root level. The + //inverse of this function is findSubNode( nodeClass* ) and findNum(). Note: + //If does not exist (ie, it's <= 0 or > deepCount()) then 0 is + //returned. + virtual nodeClass *findSubNode(long inNodeNum); + + // Post: This is the exact inverse function of findSubNode( long ). This + //fcn returns the deep instance number of in this node deep sub + //tree. If the node was not found in this node's sub tree, 0 is returned. + // Note: If is 0, 0 is returned. + virtual long findSubNode(nodeClass *inNodePtr); + + // Post: All sub nodes in are appended in order inside this + //node. If is true, the nodes in are put at the + //head of this, and if it is false, the nodes are put at the tail of this. + void absorbContents(nodeClass *sourceList, int inPutAtHead = true); + + // Post: All sub nodes in are moved to the tail of this if + //they are marked + void absorbMarked(nodeClass *sourceList); + + // Post: All sub nodes in are moved after this node (thus + //placing them in this node's parent's sub list) + void absorbAfter(nodeClass *sourceList); + + // Post: Randomizes all sub nodes within this node. + void RandomizeSubs(); + + virtual void WriteTo(CEgOStream *inStream); + virtual void ReadFrom(CEgIStream *inFile); + virtual void StartRead(CEgIStream *inFile); +}; + +template class TNodeRegistrar { + +public: + static T *CreateFromStream(nodeClass *inParent) { return new T(inParent); } + + static void RegisterNode(long inClassID) { + nodeClass::RegisterNodeClass(inClassID, (CreatorFuncT)CreateFromStream); + } +}; + +#endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/RectUtils.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/RectUtils.cpp index 19b97ec1a..2e6e38585 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/RectUtils.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/RectUtils.cpp @@ -1,125 +1,116 @@ #include "RectUtils.h" -void SetRect( Rect* inR, long left, long top, long right, long bot ) { +void SetRect(Rect *inR, long left, long top, long right, long bot) { - inR -> top = top; - inR -> left = left; - inR -> bottom = bot; - inR -> right = right; + inR->top = top; + inR->left = left; + inR->bottom = bot; + inR->right = right; } +void InsetRect(Rect *inR, int inDelX, int inDelY) { -void InsetRect( Rect* inR, int inDelX, int inDelY ) { - - inR -> left += inDelX; - inR -> right -= inDelX; - inR -> bottom -= inDelY; - inR -> top += inDelY; + inR->left += inDelX; + inR->right -= inDelX; + inR->bottom -= inDelY; + inR->top += inDelY; } +void OffsetRect(Rect *inR, int inDelX, int inDelY) { - -void OffsetRect( Rect* inR, int inDelX, int inDelY ) { - - inR -> left += inDelX; - inR -> right += inDelX; - inR -> bottom += inDelY; - inR -> top += inDelY; + inR->left += inDelX; + inR->right += inDelX; + inR->bottom += inDelY; + inR->top += inDelY; } +void UnionRect(const Rect *inR1, const Rect *inR2, Rect *outRect) { + long l, t, b; + l = (inR1->left < inR2->left) ? inR1->left : inR2->left; + t = (inR1->top < inR2->top) ? inR1->top : inR2->top; + b = (inR1->bottom < inR2->bottom) ? inR2->bottom : inR1->bottom; + outRect->right = (inR1->right < inR2->right) ? inR2->right : inR1->right; -void UnionRect( const Rect* inR1, const Rect* inR2, Rect* outRect ) { - long l, t, b; - - l = ( inR1 -> left < inR2 -> left ) ? inR1 -> left : inR2 -> left; - t = ( inR1 -> top < inR2 -> top ) ? inR1 -> top : inR2 -> top; - b = ( inR1 -> bottom < inR2 -> bottom ) ? inR2 -> bottom : inR1 -> bottom; - outRect -> right = ( inR1 -> right < inR2 -> right ) ? inR2 -> right : inR1 -> right; - - outRect -> left = l; - outRect -> top = t; - outRect -> bottom = b; + outRect->left = l; + outRect->top = t; + outRect->bottom = b; } +void SectRect(const Rect *inR1, const Rect *inR2, Rect *outRect) { + long l, t, b; + l = (inR1->left > inR2->left) ? inR1->left : inR2->left; + t = (inR1->top > inR2->top) ? inR1->top : inR2->top; + b = (inR1->bottom > inR2->bottom) ? inR2->bottom : inR1->bottom; + outRect->right = (inR1->right > inR2->right) ? inR2->right : inR1->right; - -void SectRect( const Rect* inR1, const Rect* inR2, Rect* outRect ) { - long l, t, b; - - l = ( inR1 -> left > inR2 -> left ) ? inR1 -> left : inR2 -> left; - t = ( inR1 -> top > inR2 -> top ) ? inR1 -> top : inR2 -> top; - b = ( inR1 -> bottom > inR2 -> bottom ) ? inR2 -> bottom : inR1 -> bottom; - outRect -> right = ( inR1 -> right > inR2 -> right ) ? inR2 -> right : inR1 -> right; - - outRect -> left = l; - outRect -> top = t; - outRect -> bottom = b; + outRect->left = l; + outRect->top = t; + outRect->bottom = b; } +short PtInRect(const Point &inPt, const Rect *inRect) { + if (inPt.h > inRect->left && inPt.h <= inRect->right) { + if (inPt.v > inRect->top && inPt.v <= inRect->bottom) + return true; + } -short PtInRect( const Point& inPt, const Rect* inRect ) { - if ( inPt.h > inRect -> left && inPt.h <= inRect -> right ) { - if ( inPt.v > inRect -> top && inPt.v <= inRect -> bottom ) - return true; - } - - return false; + return false; } -void InsetRect( LongRect* inR, int inDelX, int inDelY ) { +void InsetRect(LongRect *inR, int inDelX, int inDelY) { - inR -> left += inDelX; - inR -> right -= inDelX; - inR -> bottom -= inDelY; - inR -> top += inDelY; + inR->left += inDelX; + inR->right -= inDelX; + inR->bottom -= inDelY; + inR->top += inDelY; } -#define __short( dest, n ) if ( n > 32000 ) \ - dest = 32000; \ - else if ( n + 32000 <= 0 ) \ - dest = - 32000; \ - else \ - dest = n; +#define __short(dest, n) \ + if (n > 32000) \ + dest = 32000; \ + else if (n + 32000 <= 0) \ + dest = -32000; \ + else \ + dest = n; /* -#define __short( dest, n ) if ( n > 0x7FFF ) \ - dest = 0x7FFF; \ - else if ( n + 0x7FFF <= 0 ) \ - dest = - 0x7FFF; \ - else \ - dest = n; +#define __short( dest, n ) if ( n > 0x7FFF ) +\ + dest = 0x7FFF; +\ + else if ( n + 0x7FFF <= +0 ) \ + dest = - 0x7FFF; +\ + else +\ dest = n; */ -void SetRect( Rect* ioRect, const LongRect* inRect ) { - __short( ioRect -> left, inRect -> left ) - __short( ioRect -> top, inRect -> top ) - __short( ioRect -> right, inRect -> right ) - __short( ioRect -> bottom, inRect -> bottom ) +void SetRect(Rect *ioRect, const LongRect *inRect) { + __short(ioRect->left, inRect->left) __short(ioRect->top, inRect->top) + __short(ioRect->right, inRect->right) + __short(ioRect->bottom, inRect->bottom) } - -void SetRect( LongRect* ioRect, const Rect* inRect ) { - ioRect -> left = inRect -> left; - ioRect -> top = inRect -> top; - ioRect -> right = inRect -> right; - ioRect -> bottom = inRect -> bottom; +void SetRect(LongRect *ioRect, const Rect *inRect) { + ioRect->left = inRect->left; + ioRect->top = inRect->top; + ioRect->right = inRect->right; + ioRect->bottom = inRect->bottom; } +void UnionPt(long x, long y, Rect *ioRect) { + if (ioRect->left > x) + ioRect->left = x; + if (ioRect->right < x) + ioRect->right = x; -void UnionPt( long x, long y, Rect* ioRect ) { - - if ( ioRect -> left > x ) - ioRect -> left = x; - if ( ioRect -> right < x ) - ioRect -> right = x; - - if ( ioRect -> top > y ) - ioRect -> top = y; - if ( ioRect -> bottom < y ) - ioRect -> bottom = y; + if (ioRect->top > y) + ioRect->top = y; + if (ioRect->bottom < y) + ioRect->bottom = y; } - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/TempMem.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/TempMem.cpp index 2cae91e06..6dc06216c 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/TempMem.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/TempMem.cpp @@ -2,26 +2,17 @@ #include "TempMem.h" -TempMem::TempMem() { - - mDimSize = 0; -} - - -TempMem::~TempMem() { - -} +TempMem::TempMem() { mDimSize = 0; } +TempMem::~TempMem() {} -char* TempMem::Dim( long inBytes ) { +char *TempMem::Dim(long inBytes) { - if ( inBytes > mDimSize ) { - mDimSize = 0; + if (inBytes > mDimSize) { + mDimSize = 0; - mDimSize = inBytes; - } + mDimSize = inBytes; + } - return mTemp.Dim( inBytes ); + return mTemp.Dim(inBytes); } - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/UtilStr.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/UtilStr.cpp index 108eca8f2..f8916158b 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/UtilStr.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/UtilStr.cpp @@ -1,7 +1,6 @@ #include "UtilStr.h" - #include "CEgIStream.h" #include "CEgOStream.h" @@ -9,58 +8,40 @@ #include +UtilStr::UtilStr() { init(); } -UtilStr::UtilStr() { - - init(); -} - - - -UtilStr::UtilStr( const char* inCStr ) { - init(); - Append( inCStr ); +UtilStr::UtilStr(const char *inCStr) { + init(); + Append(inCStr); } - - - -UtilStr::UtilStr( const unsigned char* inStrPtr ) { - init(); - Append( inStrPtr ); +UtilStr::UtilStr(const unsigned char *inStrPtr) { + init(); + Append(inStrPtr); } - - -UtilStr::UtilStr( const UtilStr& inStr ) { - init(); - Append( &inStr ); +UtilStr::UtilStr(const UtilStr &inStr) { + init(); + Append(&inStr); } +UtilStr::UtilStr(const UtilStr *inStr) { + init(); - -UtilStr::UtilStr( const UtilStr* inStr ) { - init(); - - Append( inStr ); + Append(inStr); } - - -UtilStr::UtilStr( long inNum ) { - init(); - Append( inNum ); +UtilStr::UtilStr(long inNum) { + init(); + Append(inNum); } +UtilStr::UtilStr(const void *inPtr, unsigned long bytes) { -UtilStr::UtilStr( const void* inPtr, unsigned long bytes ) { - - init(); - Append( inPtr, bytes ); + init(); + Append(inPtr, bytes); } - - #if 0 #include #endif @@ -68,774 +49,640 @@ UtilStr::~UtilStr() { #if 0 fprintf(stderr, "~UtilStr()->(this = %.8X mBuf = %.8X)\n", this, mBuf); #endif - if ( mBuf ) - delete[] mBuf; + if (mBuf) + delete[] mBuf; #if 0 fprintf(stderr, "<-~UtilStr()\n"); #endif } - - void UtilStr::init() { - mStrLen = 0; - mBufSize = 0; - mBuf = 0; + mStrLen = 0; + mBufSize = 0; + mBuf = 0; } +void UtilStr::Swap(UtilStr &ioStr) { + long len = mStrLen, size = mBufSize; + char *buf = mBuf; + mBuf = ioStr.mBuf; + mStrLen = ioStr.mStrLen; + mBufSize = ioStr.mBufSize; -void UtilStr::Swap( UtilStr& ioStr ) { - long len = mStrLen, size = mBufSize; - char* buf = mBuf; - - mBuf = ioStr.mBuf; - mStrLen = ioStr.mStrLen; - mBufSize = ioStr.mBufSize; - - ioStr.mBuf = buf; - ioStr.mStrLen = len; - ioStr.mBufSize = size; + ioStr.mBuf = buf; + ioStr.mStrLen = len; + ioStr.mBufSize = size; } +unsigned char *UtilStr::getPasStr() const { + if (!mBuf) + return (unsigned char *)"\0"; -unsigned char* UtilStr::getPasStr() const { - - if ( ! mBuf ) - return (unsigned char*) "\0"; - - if ( mStrLen < 255 ) - mBuf[0] = mStrLen; - else - mBuf[0] = 0xff; + if (mStrLen < 255) + mBuf[0] = mStrLen; + else + mBuf[0] = 0xff; - return (unsigned char*) &mBuf[0]; + return (unsigned char *)&mBuf[0]; } +char *UtilStr::getCStr() const { + static char empty[] = "\0"; - - -char* UtilStr::getCStr() const { - static char empty[] = "\0"; - - if ( mBuf ) { - mBuf[ mStrLen + 1 ] = '\0'; - return &mBuf[1]; } - else - return empty; -} - - - - - - - -void UtilStr::Append( const char* inCStr ) { - unsigned long i = 0; - - if ( inCStr ) { - while( inCStr[ i ] != '\0' ) - i++; - Append( inCStr, i ); - } + if (mBuf) { + mBuf[mStrLen + 1] = '\0'; + return &mBuf[1]; + } else + return empty; } +void UtilStr::Append(const char *inCStr) { + unsigned long i = 0; - -void UtilStr::Append( const unsigned char* inStrPtr ) { - - if ( inStrPtr ) - Append( (char*) &inStrPtr[1], inStrPtr[0] ); - + if (inCStr) { + while (inCStr[i] != '\0') + i++; + Append(inCStr, i); + } } +void UtilStr::Append(const unsigned char *inStrPtr) { - -void UtilStr::Append( const void* inSrce, unsigned long numBytes ) { - unsigned long newLen = numBytes + mStrLen; - char* oldBuf; - - if ( numBytes > 0 ) { - if ( newLen >= mBufSize ) { - if ( newLen < 80 ) - mBufSize = newLen + 5; - else if ( newLen < 500 ) - mBufSize = newLen + 100; - else mBufSize = newLen + 3000; - - oldBuf = mBuf; - mBuf = new char[ mBufSize + 2 ]; // One for pascal byte, one for c NUL byte - if ( oldBuf ) { - if ( mStrLen > 0 ) - Move( &mBuf[1], &oldBuf[1], mStrLen ); - - delete[] oldBuf; - } - } - - if ( inSrce && numBytes > 0 ) - Move( &mBuf[mStrLen + 1], inSrce, numBytes ); - - mStrLen = newLen; - } + if (inStrPtr) + Append((char *)&inStrPtr[1], inStrPtr[0]); } +void UtilStr::Append(const void *inSrce, unsigned long numBytes) { + unsigned long newLen = numBytes + mStrLen; + char *oldBuf; + if (numBytes > 0) { + if (newLen >= mBufSize) { + if (newLen < 80) + mBufSize = newLen + 5; + else if (newLen < 500) + mBufSize = newLen + 100; + else + mBufSize = newLen + 3000; + oldBuf = mBuf; + mBuf = new char[mBufSize + 2]; // One for pascal byte, one for c NUL byte + if (oldBuf) { + if (mStrLen > 0) + Move(&mBuf[1], &oldBuf[1], mStrLen); + delete[] oldBuf; + } + } -void UtilStr::Append( long inNum ) { - UtilStr temp; - unsigned long i; - - if ( inNum < 0 ) { - Append( '-' ); - inNum = - inNum; - } - - if ( inNum == 0 ) - Append( '0' ); + if (inSrce && numBytes > 0) + Move(&mBuf[mStrLen + 1], inSrce, numBytes); - while ( inNum > 0 ) { - temp.Append( (char) ('0' + inNum % 10) ); - inNum = inNum / 10; - } - - for ( i = temp.length(); i > 0; i-- ) - Append( temp.getChar( i ) ); + mStrLen = newLen; + } } +void UtilStr::Append(long inNum) { + UtilStr temp; + unsigned long i; + if (inNum < 0) { + Append('-'); + inNum = -inNum; + } + if (inNum == 0) + Append('0'); + while (inNum > 0) { + temp.Append((char)('0' + inNum % 10)); + inNum = inNum / 10; + } - - -void UtilStr::Append( const UtilStr* inStr ) { - - if ( inStr ) - Append( inStr -> getCStr(), inStr -> length() ); + for (i = temp.length(); i > 0; i--) + Append(temp.getChar(i)); } +void UtilStr::Append(const UtilStr *inStr) { - - - - -void UtilStr::Assign( const UtilStr& inStr ) { - - if ( this != &inStr ) { - Wipe(); - Append( inStr.getCStr(), inStr.length() ); - } + if (inStr) + Append(inStr->getCStr(), inStr->length()); } +void UtilStr::Assign(const UtilStr &inStr) { - -void UtilStr::Assign( const void* inPtr, unsigned long bytes ) { - Wipe(); - Append( inPtr, bytes ); + if (this != &inStr) { + Wipe(); + Append(inStr.getCStr(), inStr.length()); + } } - - -void UtilStr::Assign( char inChar ) { - Wipe(); - Append( &inChar, 1 ); +void UtilStr::Assign(const void *inPtr, unsigned long bytes) { + Wipe(); + Append(inPtr, bytes); } - - -void UtilStr::Assign( long inNum ) { - - Wipe(); - Append( inNum ); +void UtilStr::Assign(char inChar) { + Wipe(); + Append(&inChar, 1); } +void UtilStr::Assign(long inNum) { - - - - - - -void UtilStr::Assign( const unsigned char* inStrPtr ) { - Wipe(); - Append( inStrPtr ); + Wipe(); + Append(inNum); } - - - - -void UtilStr::Assign( const UtilStr* inStr ) { - - - if ( inStr != this ) { - Wipe(); - if ( inStr ) - Append( inStr -> getCStr(), inStr -> length() ); - } +void UtilStr::Assign(const unsigned char *inStrPtr) { + Wipe(); + Append(inStrPtr); } +void UtilStr::Assign(const UtilStr *inStr) { - -void UtilStr::Assign( CEgIStream& inStream, unsigned long numBytes ) { - - if ( numBytes > 5000000 ) // *** Safe to say that sizes over this are corrupt? - inStream.throwErr( cCorrupted ); - else if ( numBytes > 0 ) { - Dim( numBytes ); - if ( length() < numBytes ) - numBytes = length(); - inStream.GetBlock( getCStr(), numBytes ); - } + if (inStr != this) { + Wipe(); + if (inStr) + Append(inStr->getCStr(), inStr->length()); + } } +void UtilStr::Assign(CEgIStream &inStream, unsigned long numBytes) { - - - - -void UtilStr::ReadFrom( CEgIStream* inStream ) { - unsigned long len = inStream -> GetLong(); // Grab the length - - Assign( *inStream, len ); + if (numBytes > 5000000) // *** Safe to say that sizes over this are corrupt? + inStream.throwErr(cCorrupted); + else if (numBytes > 0) { + Dim(numBytes); + if (length() < numBytes) + numBytes = length(); + inStream.GetBlock(getCStr(), numBytes); + } } +void UtilStr::ReadFrom(CEgIStream *inStream) { + unsigned long len = inStream->GetLong(); // Grab the length - - -void UtilStr::WriteTo( CEgOStream* inStream ) const { - - inStream -> PutLong( length() ); - inStream -> PutBlock( getCStr(), length() ); + Assign(*inStream, len); } +void UtilStr::WriteTo(CEgOStream *inStream) const { - - - - -void UtilStr::Prepend( char inChar ) { - - Insert( 0, &inChar, 1 ); + inStream->PutLong(length()); + inStream->PutBlock(getCStr(), length()); } +void UtilStr::Prepend(char inChar) { Insert(0, &inChar, 1); } -void UtilStr::Prepend( UtilStr& inStr ) { +void UtilStr::Prepend(UtilStr &inStr) { - Insert( 0, inStr.getCStr(), inStr.length() ); + Insert(0, inStr.getCStr(), inStr.length()); } +void UtilStr::Prepend(const char *inStr) { + long len = 0; + while (*(char *)(inStr + len) != 0) + len++; -void UtilStr::Prepend( const char* inStr ) { - long len = 0; - - while ( *(char*)(inStr + len) != 0 ) - len++; - - Insert( 0, inStr, len ); + Insert(0, inStr, len); } +void UtilStr::Insert(unsigned long inPos, char inChar, long inNumTimes) { + unsigned long oldLen = length(); + unsigned long numAddable; -void UtilStr::Insert( unsigned long inPos, char inChar, long inNumTimes ) { - unsigned long oldLen = length(); - unsigned long numAddable; - - if ( inPos > oldLen ) - inPos = oldLen; + if (inPos > oldLen) + inPos = oldLen; - Insert( inPos, (char*) 0, inNumTimes ); - numAddable = length() - oldLen; - if ( numAddable > 0 && mBuf ) { - while ( inNumTimes > 0 ) { - mBuf[ inPos + inNumTimes ] = inChar; - inNumTimes--; - } - } + Insert(inPos, (char *)0, inNumTimes); + numAddable = length() - oldLen; + if (numAddable > 0 && mBuf) { + while (inNumTimes > 0) { + mBuf[inPos + inNumTimes] = inChar; + inNumTimes--; + } + } } +void UtilStr::Insert(unsigned long inPos, long inNum) { + UtilStr numStr(inNum); -void UtilStr::Insert( unsigned long inPos, long inNum ) { - UtilStr numStr( inNum ); - - Insert( inPos, numStr ); - + Insert(inPos, numStr); } -void UtilStr::Insert( unsigned long inPos, const UtilStr& inStr ) { - Insert( inPos, inStr.getCStr(), inStr.length() ); +void UtilStr::Insert(unsigned long inPos, const UtilStr &inStr) { + Insert(inPos, inStr.getCStr(), inStr.length()); } +void UtilStr::Insert(unsigned long inPos, const char *inSrce, long inBytes) { + unsigned long numToMove, len = length(); -void UtilStr::Insert( unsigned long inPos, const char* inSrce, long inBytes ) { - unsigned long numToMove, len = length(); - - if ( inPos >= len ) - Append( inSrce, inBytes ); - else if ( inBytes > 0 ) { - Append( 0, inBytes ); - numToMove = len - inPos; - if ( numToMove > 0 ) - Move( &mBuf[ inPos + inBytes + 1 ], &mBuf[ inPos + 1 ], numToMove ); - if ( inBytes > 0 && inSrce ) - Move( &mBuf[ inPos + 1 ], inSrce, inBytes ); - } + if (inPos >= len) + Append(inSrce, inBytes); + else if (inBytes > 0) { + Append(0, inBytes); + numToMove = len - inPos; + if (numToMove > 0) + Move(&mBuf[inPos + inBytes + 1], &mBuf[inPos + 1], numToMove); + if (inBytes > 0 && inSrce) + Move(&mBuf[inPos + 1], inSrce, inBytes); + } } +void UtilStr::Move(void *inDest, const void *inSrce, unsigned long inNumBytes) { - - - - - -void UtilStr::Move( void* inDest, const void* inSrce, unsigned long inNumBytes ) { - - if ( inNumBytes <= 64 ) { - unsigned char* dest = (unsigned char*) inDest; - unsigned char* srce = (unsigned char*) inSrce; - if ( srce > dest ) - while ( inNumBytes > 0 ) { - *dest = *srce; - dest++; - srce++; - inNumBytes--; - } - else { - dest += inNumBytes; - srce += inNumBytes; - while ( inNumBytes > 0 ) { - dest--; - srce--; - *dest = *srce; - inNumBytes--; - } } } - else - memmove(inDest, inSrce, inNumBytes); + if (inNumBytes <= 64) { + unsigned char *dest = (unsigned char *)inDest; + unsigned char *srce = (unsigned char *)inSrce; + if (srce > dest) + while (inNumBytes > 0) { + *dest = *srce; + dest++; + srce++; + inNumBytes--; + } + else { + dest += inNumBytes; + srce += inNumBytes; + while (inNumBytes > 0) { + dest--; + srce--; + *dest = *srce; + inNumBytes--; + } + } + } else + memmove(inDest, inSrce, inNumBytes); } - - void UtilStr::Decapitalize() { - unsigned long i, len = length(); - unsigned char c, sp; - - for( i = 2; i <= len; i++ ) { - c = getChar( i ); - sp = getChar( i-1 ); - if ( ( sp >= 'A' && sp <= 'Z' ) || ( sp >= 'a' && sp <= 'z' ) ) { - if ( getChar( i-1 ) == 'I' && c == 'I' ) { } // Prevent III from decapitalizing - else if ( c >= 'A' && c <= 'Z' ) - setChar( i, c + 32 ); - } - } + unsigned long i, len = length(); + unsigned char c, sp; + for (i = 2; i <= len; i++) { + c = getChar(i); + sp = getChar(i - 1); + if ((sp >= 'A' && sp <= 'Z') || (sp >= 'a' && sp <= 'z')) { + if (getChar(i - 1) == 'I' && c == 'I') { + } // Prevent III from decapitalizing + else if (c >= 'A' && c <= 'Z') + setChar(i, c + 32); + } + } } - - - - void UtilStr::Capitalize() { - unsigned long i, len = length(); - char c; - - for( i = 1; i <= len; i++ ) { - c = getChar( i ); - if ( c >= 'a' && c <= 'z' ) { - setChar( i, c - 32 ); - } - } + unsigned long i, len = length(); + char c; + for (i = 1; i <= len; i++) { + c = getChar(i); + if (c >= 'a' && c <= 'z') { + setChar(i, c - 32); + } + } } +void UtilStr::Trunc(unsigned long numToChop, bool fromRight) { - - -void UtilStr::Trunc( unsigned long numToChop, bool fromRight ) { - - if ( fromRight ) - Remove( length() - numToChop + 1, numToChop ); - else - Remove( 1, numToChop ); + if (fromRight) + Remove(length() - numToChop + 1, numToChop); + else + Remove(1, numToChop); } +void UtilStr::Remove(unsigned long inPos, unsigned long inNum) { + unsigned long toMove; + unsigned long len = length(); + if (inPos < 1) + inPos = 1; + if (inNum > len - inPos + 1) + inNum = len - inPos + 1; -void UtilStr::Remove( unsigned long inPos, unsigned long inNum ) { - unsigned long toMove; - unsigned long len = length(); - - if ( inPos < 1 ) - inPos = 1; + if (inPos <= len && inNum > 0) { - if ( inNum > len - inPos + 1 ) - inNum = len - inPos + 1; + mStrLen = len - inNum; + toMove = len - inPos - inNum + 1; - if ( inPos <= len && inNum > 0 ) { - - mStrLen = len - inNum; - toMove = len - inPos - inNum + 1; - - if ( toMove > 0 ) - Move( &mBuf[ inPos ], &mBuf[ inPos + inNum ], toMove ); - } + if (toMove > 0) + Move(&mBuf[inPos], &mBuf[inPos + inNum], toMove); + } } +void UtilStr::Remove(const char *inStr, int inLen, bool inCaseSensitive) { + long pos; + const char *s; + if (inLen < 0) { + inLen = 0; + s = inStr; + while (*s) { + inLen++; + s++; + } + } - -void UtilStr::Remove( const char* inStr, int inLen, bool inCaseSensitive ) { - long pos; - const char* s; - - if ( inLen < 0 ) { - inLen = 0; - s = inStr; - while ( *s ) { - inLen++; - s++; - } - } - - pos = contains( inStr, inLen, 0, inCaseSensitive ); - while ( pos > 0 ) { - Remove( pos, inLen ); - pos--; - pos = contains( inStr, inLen, pos, inCaseSensitive ); - } + pos = contains(inStr, inLen, 0, inCaseSensitive); + while (pos > 0) { + Remove(pos, inLen); + pos--; + pos = contains(inStr, inLen, pos, inCaseSensitive); + } } +void UtilStr::Keep(unsigned long inNumToKeep) { - - - -void UtilStr::Keep( unsigned long inNumToKeep ) { - - if ( inNumToKeep < length() ) - Trunc( length() - inNumToKeep, true ); + if (inNumToKeep < length()) + Trunc(length() - inNumToKeep, true); } - - - -void UtilStr::PoliteKeep( unsigned long inMaxLen, unsigned long inPos ) { - if ( length() > inMaxLen ) { - Remove( inPos + 1, length() - inMaxLen + 1 ); - setChar( inPos, 0xC9 ); // e-acute - } +void UtilStr::PoliteKeep(unsigned long inMaxLen, unsigned long inPos) { + if (length() > inMaxLen) { + Remove(inPos + 1, length() - inMaxLen + 1); + setChar(inPos, 0xC9); // e-acute + } } - - void UtilStr::ZapLeadingSpaces() { - unsigned long i = 1; - unsigned long len = length(); + unsigned long i = 1; + unsigned long len = length(); - while ( getChar( i ) == ' ' && i <= len ) - i++; + while (getChar(i) == ' ' && i <= len) + i++; - if ( i > 1 ) - Trunc( i - 1, false ); + if (i > 1) + Trunc(i - 1, false); } - - - - /* UtilStr UtilStr::MID( unsigned long start, unsigned long inLen ) const { - UtilStr newStr; - unsigned long len = length(); + UtilStr newStr; + unsigned long len = length(); - if ( start < 1 ) - start = 1; + if ( start < 1 ) + start = 1; - start--; + start--; - if ( inLen > len - start ) - inLen = len - start; + if ( inLen > len - start ) + inLen = len - start; - if ( start <= len && inLen > 0 ) - newStr.Assign( getCStr() + start, inLen ); + if ( start <= len && inLen > 0 ) + newStr.Assign( getCStr() + start, inLen ); - return newStr; + return newStr; } UtilStr UtilStr::RIGHT( unsigned long inLen ) const { - UtilStr newStr; - unsigned long start, len = length(); + UtilStr newStr; + unsigned long start, len = length(); - if ( inLen > len ) - inLen = len; + if ( inLen > len ) + inLen = len; - start = len - inLen; + start = len - inLen; - newStr.Assign( getCStr() + start, inLen ); - return newStr; + newStr.Assign( getCStr() + start, inLen ); + return newStr; } */ +long UtilStr::FindNextInstanceOf(unsigned long inPos, char c) const { + unsigned long len = length(); + if (inPos < 0) + inPos = 0; + for (unsigned i = inPos + 1; i <= len; i++) { + if (mBuf[i] == c) + return i; + } - - - -long UtilStr::FindNextInstanceOf( unsigned long inPos, char c ) const { - unsigned long len = length(); - - if ( inPos < 0 ) - inPos = 0; - - for ( unsigned i = inPos+1; i <= len; i++ ) { - if ( mBuf[ i ] == c ) - return i; - } - - return 0; + return 0; } +long UtilStr::FindPrevInstanceOf(unsigned long inPos, char c) const { + if (inPos > length()) + inPos = length(); -long UtilStr::FindPrevInstanceOf( unsigned long inPos, char c ) const { - if ( inPos > length() ) - inPos = length(); - - for ( unsigned long i = inPos; i > 0; i-- ) { - if ( mBuf[ i ] == c ) - return i; - } + for (unsigned long i = inPos; i > 0; i--) { + if (mBuf[i] == c) + return i; + } - return 0; + return 0; } +long UtilStr::Replace(char inTarget, char inReplacement) { + unsigned long count, i, len = length(); -long UtilStr::Replace( char inTarget, char inReplacement ) { - unsigned long count, i, len = length(); + count = 0; - count = 0; + for (i = 1; i <= len; i++) { + if (mBuf[i] == inTarget) { + mBuf[i] = inReplacement; + count++; + } + } - for ( i = 1; i <= len; i++ ) { - if ( mBuf[ i ] == inTarget ) { - mBuf[ i ] = inReplacement; - count++; - } - } - - return count; + return count; } +long UtilStr::Replace(const char *inTarget, const char *inReplacement, + bool inCaseSensitive) { + const char *srce; + long count = 0, pos, prevPos = 0; -long UtilStr::Replace( const char* inTarget, const char* inReplacement, bool inCaseSensitive ) { - const char* srce; - long count = 0, pos, prevPos = 0; - - // Calc the len of the target - long targLen = 0; - while ( inTarget[ targLen ] ) - targLen++; + // Calc the len of the target + long targLen = 0; + while (inTarget[targLen]) + targLen++; - // See if there's at least one instance of the target in this string... - pos = contains( inTarget, targLen, 0, inCaseSensitive ); - if ( pos ) { + // See if there's at least one instance of the target in this string... + pos = contains(inTarget, targLen, 0, inCaseSensitive); + if (pos) { - // Make this the dest str - UtilStr srceStr( this ); - srce = srceStr.getCStr(); - count = 0; - Keep( pos - 1 ); - goto _resume; + // Make this the dest str + UtilStr srceStr(this); + srce = srceStr.getCStr(); + count = 0; + Keep(pos - 1); + goto _resume; - while ( pos ) { - Append( srce + prevPos, pos - prevPos - 1 ); -_resume: Append( inReplacement ); - count++; - prevPos = pos + targLen - 1; - pos = srceStr.contains( inTarget, targLen, prevPos, inCaseSensitive ); - } + while (pos) { + Append(srce + prevPos, pos - prevPos - 1); + _resume: + Append(inReplacement); + count++; + prevPos = pos + targLen - 1; + pos = srceStr.contains(inTarget, targLen, prevPos, inCaseSensitive); + } - Append( srce + prevPos, srceStr.length() - prevPos ); - } + Append(srce + prevPos, srceStr.length() - prevPos); + } - return count; + return count; } -void UtilStr::copyTo( unsigned char* pasDestPtr, unsigned char inBytesToCopy ) const { - unsigned long bytes = length() + 1; +void UtilStr::copyTo(unsigned char *pasDestPtr, + unsigned char inBytesToCopy) const { + unsigned long bytes = length() + 1; - if ( bytes > inBytesToCopy ) - bytes = inBytesToCopy; + if (bytes > inBytesToCopy) + bytes = inBytesToCopy; - getPasStr(); // refreshes len byte for pas str + getPasStr(); // refreshes len byte for pas str - if ( bytes > 255 ) - bytes = 255; + if (bytes > 255) + bytes = 255; - Move( pasDestPtr, &mBuf[0], bytes ); + Move(pasDestPtr, &mBuf[0], bytes); } +void UtilStr::copyTo(char *inDestPtr, unsigned long inBytesToCopy) const { + unsigned long bytes = length() + 1; + if (bytes > inBytesToCopy) + bytes = inBytesToCopy; + getCStr(); // refreshes NUL byte for c strs -void UtilStr::copyTo( char* inDestPtr, unsigned long inBytesToCopy ) const { - unsigned long bytes = length() + 1; - - if ( bytes > inBytesToCopy ) - bytes = inBytesToCopy; - - getCStr(); // refreshes NUL byte for c strs - - - Move( inDestPtr, &mBuf[1], bytes ); + Move(inDestPtr, &mBuf[1], bytes); } +char UtilStr::getChar(unsigned long i) const { - - - - - -char UtilStr::getChar( unsigned long i ) const { - - if ( i <= mStrLen && i > 0 ) - return mBuf[ i ]; - else - return '\0'; + if (i <= mStrLen && i > 0) + return mBuf[i]; + else + return '\0'; } +void UtilStr::setChar(unsigned long i, char inChar) { - -void UtilStr::setChar( unsigned long i, char inChar ) { - - - if ( i <= mStrLen && i > 0 ) - mBuf[ i ] = inChar; + if (i <= mStrLen && i > 0) + mBuf[i] = inChar; } +int UtilStr::StrCmp(const char *s1, const char *s2, long inN, + bool inCaseSensitive) { + char c1, c2; + if (inN < 0) { + inN = 0; + const char *s = (*s1 != 0) ? s1 : s2; + while (*s) { + s++; + inN++; + } + } + while (inN > 0) { + inN--; + c1 = *s1; + s1++; + c2 = *s2; + s2++; + if (!inCaseSensitive) { + if (c1 >= 'a' && c1 <= 'z') + c1 -= 32; + if (c2 >= 'a' && c2 <= 'z') + c2 -= 32; + } + if (c1 != c2) + return c1 - c2; + } - -int UtilStr::StrCmp( const char* s1, const char* s2, long inN, bool inCaseSensitive ) { - char c1, c2; - - if ( inN < 0 ) { - inN = 0; - const char* s = (*s1 != 0) ? s1 : s2; - while ( *s ) { - s++; - inN++; - } - } - - while ( inN > 0 ) { - inN--; - c1 = *s1; - s1++; - c2 = *s2; - s2++; - if ( ! inCaseSensitive ) { - if ( c1 >= 'a' && c1 <= 'z' ) - c1 -= 32; - if ( c2 >= 'a' && c2 <= 'z' ) - c2 -= 32; - } - if ( c1 != c2 ) - return c1 - c2; - } - - return 0; + return 0; } +int UtilStr::compareTo(const unsigned char *inPStr, + bool inCaseSensitive) const { + if (inPStr) { + if (length() == inPStr[0]) { + return StrCmp(getCStr(), (char *)(inPStr + 1), length(), inCaseSensitive); + } + } - -int UtilStr::compareTo( const unsigned char* inPStr, bool inCaseSensitive ) const { - - if ( inPStr ) { - if ( length() == inPStr[0] ) { - return StrCmp( getCStr(), (char*) (inPStr + 1), length(), inCaseSensitive ); - } - } - - return -1; + return -1; } +int UtilStr::compareTo(const UtilStr *inStr, bool inCaseSensitive) const { -int UtilStr::compareTo( const UtilStr* inStr, bool inCaseSensitive ) const { - - if ( inStr ) - return StrCmp( inStr -> getCStr(), getCStr(), length() + 1, inCaseSensitive ); - else - return -1; + if (inStr) + return StrCmp(inStr->getCStr(), getCStr(), length() + 1, inCaseSensitive); + else + return -1; } - -int UtilStr::compareTo( const char* inStr, bool inCaseSensitive ) const { - if ( inStr ) - return StrCmp( inStr, getCStr(), length() + 1, inCaseSensitive ); - else - return -1; +int UtilStr::compareTo(const char *inStr, bool inCaseSensitive) const { + if (inStr) + return StrCmp(inStr, getCStr(), length() + 1, inCaseSensitive); + else + return -1; } +long UtilStr::contains(const char *inSrchStr, int inLen, int inStartingPos, + bool inCaseSensitive) const { + char srchChar, srchCharLC, c; + char *endPtr, *curPtr = getCStr(); + if (inLen < 0) { + inLen = 0; + while (*(inSrchStr + inLen)) + inLen++; + } -long UtilStr::contains( const char* inSrchStr, int inLen, int inStartingPos, bool inCaseSensitive ) const { - char srchChar, srchCharLC, c; - char* endPtr, *curPtr = getCStr(); - - if ( inLen < 0 ) { - inLen = 0; - while ( *(inSrchStr+inLen) ) - inLen++; - } + endPtr = curPtr + length() - inLen; - endPtr = curPtr + length() - inLen; + srchChar = *inSrchStr; + if (srchChar >= 'a' && srchChar <= 'z') + srchChar -= 32; + srchCharLC = srchChar + 32; + if (inStartingPos > 0) + curPtr += inStartingPos; - srchChar = *inSrchStr; - if ( srchChar >= 'a' && srchChar <= 'z' ) - srchChar -= 32; - srchCharLC = srchChar + 32; - if ( inStartingPos > 0 ) - curPtr += inStartingPos; + while (curPtr <= endPtr) { + c = *curPtr; + if (c == srchChar || c == srchCharLC) { + if (StrCmp(curPtr, inSrchStr, inLen, inCaseSensitive) == 0) + return curPtr - getCStr() + 1; + } + curPtr++; + } - while ( curPtr <= endPtr ) { - c = *curPtr; - if ( c == srchChar || c == srchCharLC ) { - if ( StrCmp( curPtr, inSrchStr, inLen, inCaseSensitive ) == 0 ) - return curPtr - getCStr() + 1; - } - curPtr++; - } - - return 0; + return 0; } - - /* -*** The following is some string silmilarity/matching theory... man, i miss cornell cs... +*** The following is some string silmilarity/matching theory... man, i miss +cornell cs... Dynamic Programming Algorithm for Sequence Alignment. -Dynamic Programming Algorithms are used for finding shortest paths in graphs, and in many other optimization problems, but in the comparison or alignment of strings (as in Biological DNA, RNA and protein sequence analysis, speech recognition and shape comparison) the following, or similar, is often called "the" dynamic programming algorithm (DPA). +Dynamic Programming Algorithms are used for finding shortest paths in graphs, +and in many other optimization problems, but in the comparison or alignment of +strings (as in Biological DNA, RNA and protein sequence analysis, speech +recognition and shape comparison) the following, or similar, is often called +"the" dynamic programming algorithm (DPA). Generic Dynamic Programming Algorithm for Comparing Two Strings: Given two strings or sequences A[1..|A|] and B[1..|B|] M[0, 0] = z -- usually z=0 -M[i, 0] = f( M[i-1, 0 ], c(A[i], "_" ) ) -- Boundary conditions - delete A[i] -M[0, j] = f( M[0, j-1], c("_", B[j]) ) -- Boundary conditions - delete B[j] +M[i, 0] = f( M[i-1, 0 ], c(A[i], "_" ) ) -- Boundary conditions - delete +A[i] M[0, j] = f( M[0, j-1], c("_", B[j]) ) -- Boundary conditions - +delete B[j] M[i, j] = g( f( M[i-1, j-1], c(A[i], B[j]) ), -- match/mismatch f( M[i-1, j ], c(A[i], "_" ) ), -- delete A[i] @@ -843,7 +690,10 @@ M[i, j] = g( f( M[i-1, j-1], c(A[i], B[j]) ), -- match/mismatch Note that "_" represents the null (pseudo-)character. -M[i,j] represents the cost (or score) of the partial sequences A[1..i] and B[1..j], and the algorithm requires that M[i,j] can be calculated from the three neighbours of M[i,j] - to the north (M[i,j-1]), west (M[i-1,j]), and north west (M[i-1,j-1]). +M[i,j] represents the cost (or score) of the partial sequences A[1..i] and +B[1..j], and the algorithm requires that M[i,j] can be calculated from the three +neighbours of M[i,j] - to the north (M[i,j-1]), west (M[i-1,j]), and north west +(M[i-1,j-1]). c( x, y ): Cost of replacing character x with character y f( ): String reconcatination function @@ -852,7 +702,8 @@ g( ): Substring score chooser function O( AB ) running time (Assming const running const running time for g, f and c) O( A ) or O( B ) storage -So what are z, f(), g(), and c()? By varing them, the returned score comparison will follow different match criteria/behavior. Here's 5 sets of assignments: +So what are z, f(), g(), and c()? By varing them, the returned score comparison +will follow different match criteria/behavior. Here's 5 sets of assignments: 1) === Longest Common Subsequence (LCS or LCSS) z = 0 @@ -860,19 +711,25 @@ g( ) = min( ) f( ) = + c(x,x) = 0, c(x,y) = c(x,"_") = c("_",x) = 1 A big LCS score means the sequences are similar - lots of matches c(x,x). -Note that an optimal LCS sequence alignment can be recovered either by retracing the `max' choices that were made from M[|A|,|B|] to M[0,0], or by using Hirschberg's (1975) divide and conquer technique. +Note that an optimal LCS sequence alignment can be recovered either by retracing +the `max' choices that were made from M[|A|,|B|] to M[0,0], or by using +Hirschberg's (1975) divide and conquer technique. 2) === Levenshtein Metric or Sellers' Edit Distance -A big edit distance value means the sequences are dissimilar - lots of changes c(x,y), and indels c(x,"_") and c("_",x). +A big edit distance value means the sequences are dissimilar - lots of changes +c(x,y), and indels c(x,"_") and c("_",x). z = 0 g( ) = min( ) f( ) = + c(x,x) = 0, c(x,y), c(x,"_"), c("_",x) > 0 -The above assumes "simple" gap costs; linear but some other more complex gap costs can be incorporated with modifications. +The above assumes "simple" gap costs; linear but some other more complex gap +costs can be incorporated with modifications. 3) === Probability of Alignments -For given probabilities, P(match), P(mismatch), P(insert) and P(delete), the following dynamic programming algorithm finds a most probable alignment of two given sequences: +For given probabilities, P(match), P(mismatch), P(insert) and P(delete), the +following dynamic programming algorithm finds a most probable alignment of two +given sequences: z = 1 -- NB. g( ) = max( ) @@ -881,7 +738,10 @@ c(x,x) = P(match) * P(x) c(x,y) = P(mismatch) * P(x,y | x!=y) c(x,"_") = P(delete) * P(x) c("_",x) = P(insert) * P(x) -Unfortunately the quantities calculated become very small for strings of realistic lengths and underflow is the consequence. It is more convenient to deal with the -log's of probabilities and this also corresponds to a coding or information theory interpretation - see below. +Unfortunately the quantities calculated become very small for strings of +realistic lengths and underflow is the consequence. It is more convenient to +deal with the -log's of probabilities and this also corresponds to a coding or +information theory interpretation - see below. 4) === Minimum Message Length MML Optimal Alignment aka Minimum Description Length MDL @@ -893,17 +753,29 @@ c(x,x) = -log2(P(match)) - log2(P(x)) c(x,y) = -log2(P(mismatch)) - log2(P(x,y | x!=y)) c(x,"_") = -log2(P(delete)) - log2(P(x)) c("_",x) = -log2(P(insert) -log2(P(x)) -- assuming "simple" gap costs; modify if not. Base-two logs are taken if you wish to interpret the quantities as bits; some prefer natural logarithms, giving nits. -An alignment can be thought of as a hypothesis of how strings A and B are related, and it can be compared with the null-theory that they are not related (Allison et al 1990(a), 1990(b), 1992). Thus, if an alignment gives some real data compression for the pair of strings, it is an acceptable hypothesis. +- assuming "simple" gap costs; modify if not. Base-two logs are taken if you +wish to interpret the quantities as bits; some prefer natural logarithms, giving +nits. An alignment can be thought of as a hypothesis of how strings A and B are +related, and it can be compared with the null-theory that they are not related +(Allison et al 1990(a), 1990(b), 1992). Thus, if an alignment gives some real +data compression for the pair of strings, it is an acceptable hypothesis. 5) === Minimum Message Length R-Theory, Sum Over All Alignments -The r-theory (r for related) is the hypothesis that two strings are related in some unspecified way. Its (-log2) probability is calculated as above except that +The r-theory (r for related) is the hypothesis that two strings are related in +some unspecified way. Its (-log2) probability is calculated as above except that g(,) = logplus(,) where logplus(-log2(P1), -log2(P2)) = -log2(P1+P2) -One alignment is just one hypothesis of how one string changed into the other. There may be many optimal alignments and many more suboptimal alignments. Two alignments are two different or exclusive hypotheses so their probabilities can be added. +One alignment is just one hypothesis of how one string changed into the other. +There may be many optimal alignments and many more suboptimal alignments. Two +alignments are two different or exclusive hypotheses so their probabilities can +be added. -Thus the sum over all alignments gives the -log2 probability of the two strings being created in a related but unspecified way. The complement of this r-theory is that the strings are not related. Comparing the message lengths of the r-theory and the null-theory gives the posterior -log odds-ratio that the two strings are related (for a given model of string relation of course): +Thus the sum over all alignments gives the -log2 probability of the two strings +being created in a related but unspecified way. The complement of this r-theory +is that the strings are not related. Comparing the message lengths of the +r-theory and the null-theory gives the posterior -log odds-ratio that the two +strings are related (for a given model of string relation of course): r-theory: P(A & B & related) = P(A & B).P(related | A & B) @@ -916,530 +788,469 @@ null-theory: = P(A & B).P(not related | A & B) -We can put a 50:50 prior on being related or unrelated. We do not know the prior probability of the data, P(A&B), but we can cancel it out to get the posterior -log-odds ratio of the r-theory and the null-theory. +We can put a 50:50 prior on being related or unrelated. We do not know the prior +probability of the data, P(A&B), but we can cancel it out to get the posterior +-log-odds ratio of the r-theory and the null-theory. -It is fortunate that the sum of P(A&B|L) over all alignments L can be calculated in O(|A|*|B|) time for "finite-state" models of relation (based on finite-state machines) using the dynamic programming algorithm above and variations upon it (Allison et al 1990(a), 1990(b), 1992). +It is fortunate that the sum of P(A&B|L) over all alignments L can be calculated +in O(|A|*|B|) time for "finite-state" models of relation (based on finite-state +machines) using the dynamic programming algorithm above and variations upon it +(Allison et al 1990(a), 1990(b), 1992). References. -L. Allison, C. S. Wallace and C. N. Yee. When is a String like a String? AI & Maths 1990(a) -L. Allison, C. S. Wallace and C. N. Yee. Inductive inference over macro-molecules. TR 90/148 Department of Computer Science, Monash University, November 1990(b) -L. Allison, C. S. Wallace and C. N. Yee. Finite-State Models in the Alignment of Macromolecules. Jrnl. Molec. Evol. 35 77-89 1992 -D. S. Hirschberg. A Linear Space Algorithm for Computing Maximal Common Subsequences. Comm. Assoc. Comp. Mach. 18(6) 341-343 1975 -V. I. Levenshtein. Binary Codes Capable of Correcting Deletions, Insertions and Reversals. Soviet Physics Doklady 10(8) 707-710 1966 and Doklady Akademii Nauk SSSR 163(4) 845-848 1965 -P. Sellers. On the Theory and Computation of Evolutionary Distances. SIAM J. Appl. Math 26(4) 787-793 1974 -Lloyd Allison, Department of Computer Science, Monash University, Australia 3168 +L. Allison, C. S. Wallace and C. N. Yee. When is a String like a String? AI & +Maths 1990(a) L. Allison, C. S. Wallace and C. N. Yee. Inductive inference over +macro-molecules. TR 90/148 Department of Computer Science, Monash University, +November 1990(b) L. Allison, C. S. Wallace and C. N. Yee. Finite-State Models in +the Alignment of Macromolecules. Jrnl. Molec. Evol. 35 77-89 1992 D. S. +Hirschberg. A Linear Space Algorithm for Computing Maximal Common Subsequences. +Comm. Assoc. Comp. Mach. 18(6) 341-343 1975 V. I. Levenshtein. Binary Codes +Capable of Correcting Deletions, Insertions and Reversals. Soviet Physics +Doklady 10(8) 707-710 1966 and Doklady Akademii Nauk SSSR 163(4) 845-848 1965 P. +Sellers. On the Theory and Computation of Evolutionary Distances. SIAM J. Appl. +Math 26(4) 787-793 1974 Lloyd Allison, Department of Computer Science, Monash +University, Australia 3168 */ -// An implementaion of the Longest Common Subsequece function set for the general Sequence Alignment alg described above -#define __MIN( a, b ) ( ( (a) < (b) ) ? (a) : (b) ) -#define STACK_TEMP_SIZE 30 -#define COST_CONTIGUOUS 1 -#define COST_OF_DEL 1 /* Cost of having to delete chars from this to match inStr when preceding char matches */ -#define COST_OF_INS 16 /* Cost of having to insert chars to this to match inStr. higher cost than DEL to penalize chars contained in inStr but not in this */ -#define COST_OF_CHANGE 17 /* Cose of changing a char in this to match inStr */ -#define COST_OF_CASE 1 /* Cose of having to change the case of a char in this to match a char in inStr */ - -long UtilStr::LCSMatchScore( const char* inStr, long ALen ) const { - const char *A, *B; - long* M; - long temp[ STACK_TEMP_SIZE + 1 ]; - long BLen, a, b, M_bm1, ins, del, mat_mis, c_a, c_b, c_bUC, prev_b_UC, cost; - - // Calc the length if it wasn't given to us - if ( ALen < 0 ) { - ALen = 0; - while ( *(inStr+ALen) ) - ALen++; - } - - /* Subtract 1 from the str address to account for the fact that all accesses - are 1 based indexing */ - A = inStr - 1; - B = getCStr() - 1; - BLen = length(); - - - /* let A and B be the two strings to be compared. - We need to make a 2D table, M[][], that has corner M[ |A| ][ |B| ]. If we evaluate M, row by row, we never - need to access a row more further than one row. This permits us to evaluate [ |A| ][ |B| ] with only having - to allocate a single row's worth of elements (vs. allocating all |A| rows). */ - - // Don't use stack-allocated temp mem if our string is too big... - // Top most significant byte in M[][] contains info! - if ( ALen < STACK_TEMP_SIZE ) - M = temp; - else - M = new long[ ALen + 1 ]; // +1 for the nul str column/representation - - // Initialize the topmost row of M[][] ... - M[ 0 ] = 0; - for ( a = 1; a <= ALen; a++ ) - M[ a ] = M[ a - 1 ] + COST_OF_INS; - - // Evaluate from row 2 to row BLen - c_bUC = 0; - for ( b = 1; b <= BLen; b++ ) { - prev_b_UC = c_bUC; - c_bUC = c_b = B[ b ]; - if ( c_bUC >= 'a' && c_bUC <= 'z' ) - c_bUC -= 32; - - // Evaluate M[ 0, b ] via boundry conditions - M_bm1 = M[ 0 ]; - M[ 0 ] += COST_OF_DEL; - - // Evaluate from column 2 to column ALen - for ( a = 1; a <= ALen; a++ ) { - - // === Calc NW term... - // Calc the cost of changing B[b] to A[a]... - c_a = A[ a ]; - cost = 0; - if ( c_a != c_b ) { - if ( c_a >= 'a' && c_a <= 'z' ) - c_a -= 32; - - if ( c_a != c_bUC ) - cost = COST_OF_CHANGE; - else - cost = COST_OF_CASE; - } - // NW Term: M_bm1 is M[ a - 1, b - 1 ] (replace A[a] with B[b]) - mat_mis = M_bm1 + cost; - - // === Calc N term... - // Calc the cost of changing B[b] to nul. Favor contiguity. - // Favor contiguity (case insensitive--any case match is 'contiguous') - cost = COST_OF_DEL; - if ( c_a == prev_b_UC ) - cost += COST_CONTIGUOUS; - - // N Term: M[ a ] is M[ a, b - 1 ] ( delete B[b] ) - del = M[ a ] + cost; - - // === Calc W term... - // W Term: M[ a - 1 ] is M[ a - 1, b ] ( insert A[a] ) - ins = M[ a - 1 ] + COST_OF_INS; - - // Maintain M_bm1 for next iteration of a - M_bm1 = M[ a ]; - - // Choose the lost cost direction: M[ a, b ] = max( mat_mis, delAa, insBb ) - M[ a ] = __MIN( del, ins ); - M[ a ] = __MIN( M[ a ], mat_mis ); - } - } - - if ( ALen >= STACK_TEMP_SIZE ) - delete []M; - - return 100000 - M[ ALen ]; +// An implementaion of the Longest Common Subsequece function set for the +// general Sequence Alignment alg described above +#define __MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define STACK_TEMP_SIZE 30 +#define COST_CONTIGUOUS 1 +#define COST_OF_DEL \ + 1 /* Cost of having to delete chars from this to match inStr when preceding \ + char matches */ +#define COST_OF_INS \ + 16 /* Cost of having to insert chars to this to match inStr. higher cost \ + than DEL to penalize chars contained in inStr but not in this */ +#define COST_OF_CHANGE 17 /* Cose of changing a char in this to match inStr */ +#define COST_OF_CASE \ + 1 /* Cose of having to change the case of a char in this to match a char in \ + inStr */ + +long UtilStr::LCSMatchScore(const char *inStr, long ALen) const { + const char *A, *B; + long *M; + long temp[STACK_TEMP_SIZE + 1]; + long BLen, a, b, M_bm1, ins, del, mat_mis, c_a, c_b, c_bUC, prev_b_UC, cost; + + // Calc the length if it wasn't given to us + if (ALen < 0) { + ALen = 0; + while (*(inStr + ALen)) + ALen++; + } + + /* Subtract 1 from the str address to account for the fact that all accesses + are 1 based indexing */ + A = inStr - 1; + B = getCStr() - 1; + BLen = length(); + + /* let A and B be the two strings to be compared. + We need to make a 2D table, M[][], that has corner M[ |A| ][ |B| ]. If we + evaluate M, row by row, we never need to access a row more further than one + row. This permits us to evaluate [ |A| ][ |B| ] with only having to allocate + a single row's worth of elements (vs. allocating all |A| rows). */ + + // Don't use stack-allocated temp mem if our string is too big... + // Top most significant byte in M[][] contains info! + if (ALen < STACK_TEMP_SIZE) + M = temp; + else + M = new long[ALen + 1]; // +1 for the nul str column/representation + + // Initialize the topmost row of M[][] ... + M[0] = 0; + for (a = 1; a <= ALen; a++) + M[a] = M[a - 1] + COST_OF_INS; + + // Evaluate from row 2 to row BLen + c_bUC = 0; + for (b = 1; b <= BLen; b++) { + prev_b_UC = c_bUC; + c_bUC = c_b = B[b]; + if (c_bUC >= 'a' && c_bUC <= 'z') + c_bUC -= 32; + + // Evaluate M[ 0, b ] via boundry conditions + M_bm1 = M[0]; + M[0] += COST_OF_DEL; + + // Evaluate from column 2 to column ALen + for (a = 1; a <= ALen; a++) { + + // === Calc NW term... + // Calc the cost of changing B[b] to A[a]... + c_a = A[a]; + cost = 0; + if (c_a != c_b) { + if (c_a >= 'a' && c_a <= 'z') + c_a -= 32; + + if (c_a != c_bUC) + cost = COST_OF_CHANGE; + else + cost = COST_OF_CASE; + } + // NW Term: M_bm1 is M[ a - 1, b - 1 ] (replace A[a] with B[b]) + mat_mis = M_bm1 + cost; + + // === Calc N term... + // Calc the cost of changing B[b] to nul. Favor contiguity. + // Favor contiguity (case insensitive--any case match is 'contiguous') + cost = COST_OF_DEL; + if (c_a == prev_b_UC) + cost += COST_CONTIGUOUS; + + // N Term: M[ a ] is M[ a, b - 1 ] ( delete B[b] ) + del = M[a] + cost; + + // === Calc W term... + // W Term: M[ a - 1 ] is M[ a - 1, b ] ( insert A[a] ) + ins = M[a - 1] + COST_OF_INS; + + // Maintain M_bm1 for next iteration of a + M_bm1 = M[a]; + + // Choose the lost cost direction: M[ a, b ] = max( mat_mis, delAa, insBb + // ) + M[a] = __MIN(del, ins); + M[a] = __MIN(M[a], mat_mis); + } + } + + if (ALen >= STACK_TEMP_SIZE) + delete[] M; + + return 100000 - M[ALen]; } - /* bool UtilStr::equalTo( const char* inStr, int inFlags ) const { - bool stillOk = inStr != 0; - char* thisStr = getCStr(); - char c1 = 1, c2 = 2; - bool caseInsensitive = inFlags & cCaseInsensitive != 0; - - while ( stillOk && c2 != 0 ) { - c1 = *inStr; - c2 = *thisStr; - if ( caseInsensitive ) { - if ( c1 >= 'a' && c1 <= 'z' ) - c1 -= 32; - if ( c2 >= 'a' && c2 <= 'z' ) - c2 -= 32; - } - stillOk = c1 == c2; - thisStr += 1; - inStr += 1; - } - - if ( ( inFlags & cLefthand ) && c2 == 0 ) - stillOk = true; - - return stillOk; + bool stillOk = inStr != 0; + char* thisStr = getCStr(); + char c1 = 1, c2 = 2; + bool caseInsensitive = inFlags & cCaseInsensitive != +0; + + while ( stillOk && c2 != 0 ) { + c1 = *inStr; + c2 = *thisStr; + if ( caseInsensitive ) { + if ( c1 >= 'a' && c1 <= 'z' ) + c1 -= 32; + if ( c2 >= 'a' && c2 <= 'z' ) + c2 -= 32; + } + stillOk = c1 == c2; + thisStr += 1; + inStr += 1; + } + + if ( ( inFlags & cLefthand ) && c2 == 0 ) + stillOk = true; + + return stillOk; } */ +long UtilStr::GetIntValue(const char *inStr, unsigned long inLen, + long *outPlacePtr) { + bool seenNum = false; + char c; + long ret = 0, place = 1; + for (long i = inLen - 1; i >= 0; i--) { + c = inStr[i]; + if (c >= '0' && c <= '9') { + seenNum = true; + ret += place * (c - '0'); + place *= 10; + } else if (seenNum) + i = 0; // Stop loop + } + if (outPlacePtr) + *outPlacePtr = place; - - - - - - - -long UtilStr::GetIntValue( const char* inStr, unsigned long inLen, long* outPlacePtr ) { - bool seenNum = false; - char c; - long ret = 0, place = 1; - - for ( long i = inLen - 1; i >= 0; i-- ) { - c = inStr[ i ]; - if ( c >= '0' && c <= '9' ) { - seenNum = true; - ret += place * ( c - '0' ); - place *= 10; } - else if ( seenNum ) - i = 0; // Stop loop - } - - if ( outPlacePtr ) - *outPlacePtr = place; - - return ret; + return ret; } +double UtilStr::GetFloatVal(const char *inStr, unsigned long inLen) { + unsigned long i, decLoc = 0, foundLet = false; + char c; + double n = 0, place = 1.0; + bool isNeg = false; + for (i = 0; i < inLen; i++) { + c = inStr[i]; + if (c == '-' && !foundLet) + isNeg = true; + if (c >= '0' && c <= '9') { + n = 10.0 * n + (c - '0'); + if (decLoc) + place *= 10.0; + } -double UtilStr::GetFloatVal( const char* inStr, unsigned long inLen ) { - unsigned long i, decLoc = 0, foundLet = false; - char c; - double n = 0, place = 1.0; - bool isNeg = false; - - - for ( i = 0; i < inLen; i++ ) { - c = inStr[ i ]; + if (c != ' ') + foundLet = true; - if ( c == '-' && ! foundLet ) - isNeg = true; + if (c == '.') + decLoc = i + 1; + } - if ( c >= '0' && c <= '9' ) { - n = 10.0 * n + ( c - '0' ); - if ( decLoc ) - place *= 10.0; - } + if (isNeg) + n = -n; - if ( c != ' ' ) - foundLet = true; - - if ( c == '.' ) - decLoc = i+1; - } - - if ( isNeg ) - n = - n; - - return n / place; + return n / place; } +double UtilStr::GetFloatValue() const { return GetFloatVal(mBuf + 1, mStrLen); } +long UtilStr::GetValue(long inMultiplier) const { + unsigned long i, len = length(), decLoc = 0, foundLet = false; + char c; + long left, right, place; + for (i = 1; i <= len; i++) { + c = mBuf[i]; -double UtilStr::GetFloatValue() const { - return GetFloatVal( mBuf + 1, mStrLen ); -} - - - + if (c == '-' && !foundLet) + inMultiplier *= -1; -long UtilStr::GetValue( long inMultiplier ) const { - unsigned long i, len = length(), decLoc = 0, foundLet = false; - char c; - long left, right, place; + if (c != ' ') + foundLet = true; - for ( i = 1; i <= len; i++ ) { - c = mBuf[ i ]; + if (c == '.') + decLoc = i; + } - if ( c == '-' && ! foundLet ) - inMultiplier *= -1; + if (!decLoc) + decLoc = len + 1; - if ( c != ' ' ) - foundLet = true; + left = GetIntValue(mBuf + 1, decLoc - 1); + right = GetIntValue(mBuf + decLoc + 1, len - decLoc, &place); - if ( c == '.' ) - decLoc = i; - } - - if ( ! decLoc ) - decLoc = len + 1; - - left = GetIntValue( mBuf + 1, decLoc - 1 ); - right = GetIntValue( mBuf + decLoc + 1, len - decLoc, &place ); - - return ( inMultiplier * right + place / 2 ) / place + inMultiplier * left; + return (inMultiplier * right + place / 2) / place + inMultiplier * left; } +void UtilStr::SetValue(long inVal, long inDivisor, int inNumDecPlaces) { + long i, part = inVal % inDivisor; + UtilStr partStr; + for (i = 0; i < inNumDecPlaces; i++) + part *= 10; + part /= inDivisor; -void UtilStr::SetValue( long inVal, long inDivisor, int inNumDecPlaces ) { - long i, part = inVal % inDivisor; - UtilStr partStr; - - for ( i = 0; i < inNumDecPlaces; i++ ) - part *= 10; + i = inVal / inDivisor; + if (i != 0 || part <= 0) + Assign(i); + else + Wipe(); - part /= inDivisor; + if (part > 0) { + Append('.'); + partStr.Append(part); - i = inVal / inDivisor; - if ( i != 0 || part <= 0 ) - Assign( i ); - else - Wipe(); - - if ( part > 0 ) { - Append( '.' ); - partStr.Append( part ); - - for ( i = inNumDecPlaces - partStr.length(); i > 0; i-- ) - Append( '0' ); - - Append( &partStr ); - while ( getChar( length() ) == '0' ) - Trunc( 1 ); - } + for (i = inNumDecPlaces - partStr.length(); i > 0; i--) + Append('0'); + Append(&partStr); + while (getChar(length()) == '0') + Trunc(1); + } } +void UtilStr::SetFloatValue(float inValue, int inPercision) { + int deci_digits, left_digits = log10(fabs(inValue)) + 1.00001; + float scale; - -void UtilStr::SetFloatValue( float inValue, int inPercision ) { - int deci_digits, left_digits = log10( fabs( inValue ) ) + 1.00001; - float scale; - - if ( left_digits < 9 ) { - deci_digits = 10 - left_digits; - if ( deci_digits > inPercision ) - deci_digits = inPercision; - scale = pow( 10, deci_digits ); - SetValue( inValue * scale, scale, deci_digits ); } - else - Assign( "Overflow" ); + if (left_digits < 9) { + deci_digits = 10 - left_digits; + if (deci_digits > inPercision) + deci_digits = inPercision; + scale = pow(10, deci_digits); + SetValue(inValue * scale, scale, deci_digits); + } else + Assign("Overflow"); } +void UtilStr::AppendAsMeta(const UtilStr *inStr) { - - - - - - - - - - - - -void UtilStr::AppendAsMeta( const UtilStr* inStr ) { - - if ( inStr ) - AppendAsMeta( inStr -> getCStr(), inStr -> length() ); + if (inStr) + AppendAsMeta(inStr->getCStr(), inStr->length()); } +void UtilStr::AppendAsMeta(void *inPtr, unsigned long inLen) { + const unsigned char *ptr = (unsigned char *)inPtr; + unsigned char c; + Append('"'); + if (ptr) { + while (inLen > 0) { + c = *ptr; -void UtilStr::AppendAsMeta( void* inPtr, unsigned long inLen ) { - const unsigned char* ptr = (unsigned char*) inPtr; - unsigned char c; - - Append( '"' ); - - if ( ptr ) { - while ( inLen > 0 ) { - c = *ptr; + if (c == '"') // Our flag was detected... + Append((char)'"'); // Two flags in a row signal an actual " - if ( c == '"' ) // Our flag was detected... - Append( (char) '"' ); // Two flags in a row signal an actual " - - if ( c < 32 || c > 127 ) { - Append( (char) '"' ); - Append( (long) c ); - Append( (char) '"' ); } - else - Append( &c, 1 ); - inLen--; - ptr++; - } - } - Append( '"' ); + if (c < 32 || c > 127) { + Append((char)'"'); + Append((long)c); + Append((char)'"'); + } else + Append(&c, 1); + inLen--; + ptr++; + } + } + Append('"'); } +void UtilStr::AppendFromMeta(const void *inPtr, unsigned long inLen) { + const unsigned char *ptr = reinterpret_cast(inPtr); + unsigned char c; + // FIXME: ascNum was declared static but that caused xmms to + // segfault on exit. I'm not sure if declaring this static is + // a good idea, but the point is there may be a deeper problem. + UtilStr ascNum; + if (ptr) { + if (*ptr != '"') // First char should be a " + return; + inLen--; + ptr++; + while (inLen > 1) { // We stop 1 char early cuz last char should be a " + c = *ptr; -void UtilStr::AppendFromMeta( const void* inPtr, unsigned long inLen ) { - const unsigned char* ptr = reinterpret_cast (inPtr); - unsigned char c; - // FIXME: ascNum was declared static but that caused xmms to - // segfault on exit. I'm not sure if declaring this static is - // a good idea, but the point is there may be a deeper problem. - UtilStr ascNum; - - if ( ptr ) { - if ( *ptr != '"' ) // First char should be a " - return; - inLen--; - ptr++; - - while ( inLen > 1 ) { // We stop 1 char early cuz last char should be a " - c = *ptr; - - if ( c == '"' ) { // If the flag is detected... - inLen--; - ptr++; - c = *ptr; - if ( inLen > 1 && c != '"' ) { // Ignore double flags (they signify the flag char) - ascNum.Wipe(); - while ( c >= '0' && c <= '9' ) { - ascNum.Append( (char) c ); - inLen--; - ptr++; - c = *ptr; - } - c = ascNum.GetValue(); - } - } + if (c == '"') { // If the flag is detected... + inLen--; + ptr++; + c = *ptr; + if (inLen > 1 && + c != '"') { // Ignore double flags (they signify the flag char) + ascNum.Wipe(); + while (c >= '0' && c <= '9') { + ascNum.Append((char)c); + inLen--; + ptr++; + c = *ptr; + } + c = ascNum.GetValue(); + } + } - Append( (char) c ); + Append((char)c); - inLen--; - ptr++; - } - } + inLen--; + ptr++; + } + } } +UtilStr UtilStr::operator+(const UtilStr &inStr) { + UtilStr newStr(this); - - - - - -UtilStr UtilStr::operator + ( const UtilStr& inStr ) { - UtilStr newStr( this ); - - newStr.Append( &inStr ); - return newStr; + newStr.Append(&inStr); + return newStr; } +UtilStr UtilStr::operator+(const char *inCStr) { + UtilStr newStr(this); - -UtilStr UtilStr::operator + ( const char* inCStr ) { - UtilStr newStr( this ); - - newStr.Append( inCStr ); - return newStr; + newStr.Append(inCStr); + return newStr; } +UtilStr UtilStr::operator+(long inNum) { + UtilStr newStr(this); - -UtilStr UtilStr::operator + ( long inNum ) { - UtilStr newStr( this ); - - newStr.Append( inNum ); - return newStr; + newStr.Append(inNum); + return newStr; } +UtilStr &UtilStr::operator=(const UtilStr &inStr) { + Wipe(); - - -UtilStr& UtilStr::operator = ( const UtilStr& inStr ) { - Wipe(); - - Append( inStr.getCStr() ); - return *this; + Append(inStr.getCStr()); + return *this; } - - - - - - long UtilStr::Hash() const { - long hash = 0; - const char* stop = getCStr(); - const char* curPos = stop + mStrLen - 1; + long hash = 0; + const char *stop = getCStr(); + const char *curPos = stop + mStrLen - 1; - if ( mStrLen < 16 ) { - // Sample all the characters - while ( curPos >= stop ) { - hash = ( hash * 37 ) + *curPos; - curPos--; - } } - else { - // only sample some characters - int skip = mStrLen / 7; - while ( curPos >= stop ) { - hash = ( hash * 39 ) + *curPos; - curPos -= skip; - } - } + if (mStrLen < 16) { + // Sample all the characters + while (curPos >= stop) { + hash = (hash * 37) + *curPos; + curPos--; + } + } else { + // only sample some characters + int skip = mStrLen / 7; + while (curPos >= stop) { + hash = (hash * 39) + *curPos; + curPos -= skip; + } + } - return hash; + return hash; } +bool UtilStr::Equals(const Hashable *inComp) const { - -bool UtilStr::Equals( const Hashable* inComp ) const { - - return compareTo( (UtilStr*) inComp ) == 0; + return compareTo((UtilStr *)inComp) == 0; } +void UtilStr::AppendHex(char inB1, char inB2) { + unsigned char c; + if (inB1 >= '0' && inB1 <= '9') + inB1 -= '0'; + else + inB1 = (9 + inB1) & 0xF; + c = inB1 << 4; + if (inB2 >= '0' && inB2 <= '9') + c += (inB2 - '0'); + else + c += (9 + inB2) & 0xF; - -void UtilStr::AppendHex( char inB1, char inB2 ) { - unsigned char c; - - if ( inB1 >= '0' && inB1 <= '9' ) - inB1 -= '0'; - else - inB1 = (9 + inB1) & 0xF; - c = inB1 << 4; - - if ( inB2 >= '0' && inB2 <= '9' ) - c += (inB2 - '0'); - else - c += (9 + inB2) & 0xF; - - - Append( (char) c ); + Append((char)c); } - - - /* long UtilStr::Hash( const char* inStr, long inStrLen ) { - long hash = 0; - const char* curPos = inStr + inStrLen - 1; - - if ( inStrLen < 0 ) - inStrLen = inStr's len - - if ( inStrLen < 16 ) { - // Sample all the characters - while ( curPos >= inStr ) { - hash = ( hash * 37 ) + *curPos; - curPos--; - } } - else { - // only sample some characters - int skip = inStrLen / 7; - while ( curPos >= inStr ) { - hash = ( hash * 39 ) + *curPos; - curPos -= skip; - } - } - - return hash; + long hash = 0; + const char* curPos = inStr + inStrLen - 1; + + if ( inStrLen < 0 ) + inStrLen = inStr's len + + if ( inStrLen < 16 ) { + // Sample all the characters + while ( curPos >= inStr ) { + hash = ( hash * 37 ) + *curPos; + curPos--; + } } + else { + // only sample some characters + int skip = inStrLen / 7; + while ( curPos >= inStr ) { + hash = ( hash * 39 ) + *curPos; + curPos -= skip; + } + } + + return hash; }(*/ - - - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XFloatList.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XFloatList.cpp index 0751dfb73..e84f85d49 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XFloatList.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XFloatList.cpp @@ -5,305 +5,283 @@ #include #include -#define _MIN( a, b ) (( (a) > (b) ) ? (b) : (a) ) -#define _MAX( a, b ) (( (a) > (b) ) ? (a) : (b) ) +#define _MIN(a, b) (((a) > (b)) ? (b) : (a)) +#define _MAX(a, b) (((a) > (b)) ? (a) : (b)) +float XFloatList::sMask[MASK_MAX]; +UtilStr XFloatList::sTemp; -float XFloatList::sMask[ MASK_MAX ]; -UtilStr XFloatList::sTemp; +XFloatList::XFloatList(ListOrderingT inOrdering) : mList(inOrdering) { - - -XFloatList::XFloatList( ListOrderingT inOrdering ) : - mList( inOrdering ) { - - if ( inOrdering == cSortLowToHigh || inOrdering == cSortHighToLow ) - mList.SetCompFcn( sFloatComparitor, inOrdering == cSortLowToHigh ); + if (inOrdering == cSortLowToHigh || inOrdering == cSortHighToLow) + mList.SetCompFcn(sFloatComparitor, inOrdering == cSortLowToHigh); } - - - - - -void XFloatList::FindMeans( long inNumMeans, float outMeans[], float inSigmaScale ) const { - long start, end, m, i, n = mList.Count(); - float* srce = (float*) mList.getCStr(), *smoothed = new float[ n ], *temp = 0; - float sigma = 0.1 + inSigmaScale * ( (float) ( n / inNumMeans ) ); - float left, cen, right, sum; - - // We need all out numbers in order, we must sort them if they're no sorted - if ( mList.mOrdering != cSortHighToLow ) { - - // Copy all the array elements for sorting... - temp = new float[ n ]; - for ( i = 0; i < n; i++ ) - temp[ i ] = srce[ i ]; - - // Sort all the floats from this to temp - qsort( temp, n, 4, sQSFloatComparitor ); - srce = temp; - } - - // Smooth all the values (they're already sorted) - GaussSmooth( sigma, n, srce, smoothed ); - - // Compute the discrete 1st derivative - for ( i = 0; i < n - 1; i++ ) - smoothed[ i ] = fabs( smoothed[ i ] - smoothed[ i + 1 ] ); - - // We want to find the top local max of the 1st deravative - Hashtable sepCandidates; - cen = smoothed[ 0 ]; - right = smoothed[ 1 ]; - for ( i = 1; i < n - 2; i++ ) { - - left = cen; - cen = right; - right = smoothed[ i+1 ]; - - // If this a local max. (Note: this could/should be improved for neighbors that are equal) - if ( ( cen > left && cen >= right ) ) { - sepCandidates.Put( i, *((void**) &cen) ); - } - } - - // Pick out the 1st derative peaks, then dealloc what we no longer need - XPtrList rank; - sepCandidates.Rank( rank, sQSFloatComparitor, inNumMeans - 1 ); - delete []smoothed; - - XLongList quintiles( cSortLowToHigh ); - for ( i = 1; i < inNumMeans; i++ ) - quintiles.Add( (long) rank.Fetch( i ) ); - quintiles.Add( n ); - - // The means are the averages of the initial (sorted) data, divided by the serparating ranks - start = 0; - for ( m = 1; m <= inNumMeans; m++ ) { - end = quintiles.Fetch( m ); - for ( sum = 0, i = start; i < end; i++ ) - sum += srce[ i ]; - outMeans[ m - 1 ] = sum / ( (float) ( end - start ) ); - start = end + 1; - } - - // Cleanup - if ( temp ) - delete []temp; +void XFloatList::FindMeans(long inNumMeans, float outMeans[], + float inSigmaScale) const { + long start, end, m, i, n = mList.Count(); + float *srce = (float *)mList.getCStr(), *smoothed = new float[n], *temp = 0; + float sigma = 0.1 + inSigmaScale * ((float)(n / inNumMeans)); + float left, cen, right, sum; + + // We need all out numbers in order, we must sort them if they're no sorted + if (mList.mOrdering != cSortHighToLow) { + + // Copy all the array elements for sorting... + temp = new float[n]; + for (i = 0; i < n; i++) + temp[i] = srce[i]; + + // Sort all the floats from this to temp + qsort(temp, n, 4, sQSFloatComparitor); + srce = temp; + } + + // Smooth all the values (they're already sorted) + GaussSmooth(sigma, n, srce, smoothed); + + // Compute the discrete 1st derivative + for (i = 0; i < n - 1; i++) + smoothed[i] = fabs(smoothed[i] - smoothed[i + 1]); + + // We want to find the top local max of the 1st deravative + Hashtable sepCandidates; + cen = smoothed[0]; + right = smoothed[1]; + for (i = 1; i < n - 2; i++) { + + left = cen; + cen = right; + right = smoothed[i + 1]; + + // If this a local max. (Note: this could/should be improved for neighbors + // that are equal) + if ((cen > left && cen >= right)) { + sepCandidates.Put(i, *((void **)&cen)); + } + } + + // Pick out the 1st derative peaks, then dealloc what we no longer need + XPtrList rank; + sepCandidates.Rank(rank, sQSFloatComparitor, inNumMeans - 1); + delete[] smoothed; + + XLongList quintiles(cSortLowToHigh); + for (i = 1; i < inNumMeans; i++) + quintiles.Add((long)rank.Fetch(i)); + quintiles.Add(n); + + // The means are the averages of the initial (sorted) data, divided by the + // serparating ranks + start = 0; + for (m = 1; m <= inNumMeans; m++) { + end = quintiles.Fetch(m); + for (sum = 0, i = start; i < end; i++) + sum += srce[i]; + outMeans[m - 1] = sum / ((float)(end - start)); + start = end + 1; + } + + // Cleanup + if (temp) + delete[] temp; } - - - - - -#define _safeSmooth( xx ) \ - sum = 0; \ - factor = 1; \ - for ( i = - maskCtr; i <= maskCtr; i++ ) { \ - rx = xx + i; \ - if ( rx < 0 || rx >= inN ) \ - factor -= sMask[ i + maskCtr ]; \ - else \ - sum += sMask[ i + maskCtr ] * inSrce[ rx ]; \ - } \ - inDest[ xx ] = sum / factor; - - - -void XFloatList::GaussSmooth( float inSigma ) { - - GaussSmooth( inSigma, mList.Count(), (float*) mList.getCStr() ); - -} - - -void XFloatList::GaussSmooth( float inSigma, long inN, float inSrceDest[] ) { - float* temp = (float*) sTemp.Dim( inN * sizeof( float ) ); - - GaussSmooth( inSigma, inN, inSrceDest, temp ); - - for ( long i = 0; i < inN; i++ ) - inSrceDest[ i ] = temp[ i ]; +#define _safeSmooth(xx) \ + sum = 0; \ + factor = 1; \ + for (i = -maskCtr; i <= maskCtr; i++) { \ + rx = xx + i; \ + if (rx < 0 || rx >= inN) \ + factor -= sMask[i + maskCtr]; \ + else \ + sum += sMask[i + maskCtr] * inSrce[rx]; \ + } \ + inDest[xx] = sum / factor; + +void XFloatList::GaussSmooth(float inSigma) { + + GaussSmooth(inSigma, mList.Count(), (float *)mList.getCStr()); } +void XFloatList::GaussSmooth(float inSigma, long inN, float inSrceDest[]) { + float *temp = (float *)sTemp.Dim(inN * sizeof(float)); + GaussSmooth(inSigma, inN, inSrceDest, temp); + for (long i = 0; i < inN; i++) + inSrceDest[i] = temp[i]; +} -void XFloatList::SlopeSmooth( float inSmoothness, long inN, float ioData[] ) { - float slope = 0, accel = 0, prev = 0; - float newSlope, a0 = 1 - inSmoothness, predicted; - long x; - - for ( x = 0; x < inN; x++ ) { - predicted = prev + slope + accel; - ioData[ x ] = inSmoothness * predicted + a0 * ioData[ x ]; - newSlope = ( ioData[ x ] - prev ); - accel = ( newSlope - slope ); - prev = ioData[ x ]; - slope = newSlope; - } +void XFloatList::SlopeSmooth(float inSmoothness, long inN, float ioData[]) { + float slope = 0, accel = 0, prev = 0; + float newSlope, a0 = 1 - inSmoothness, predicted; + long x; + + for (x = 0; x < inN; x++) { + predicted = prev + slope + accel; + ioData[x] = inSmoothness * predicted + a0 * ioData[x]; + newSlope = (ioData[x] - prev); + accel = (newSlope - slope); + prev = ioData[x]; + slope = newSlope; + } } - - /* - int boxRight = inBoxSize / 2; - int boxLeft = inBoxSize - 1 - boxRight; - float boxSum; - float boxDiv = 1 / ( (float) inBoxSize ); - - boxSum = 0; - - for ( x = - boxRight; x < boxLeft; x++ ) { - i = x + boxRight; - if ( i >= 0 && i < inN ) - boxSum += inSrce[ i ]; - i = i - boxLeft; - if ( i >= 0 && i < inN ) - boxSum -= inSrce[ i ]; - if ( x >= 0 && x < inN ) - inDest[ x ] = boxSum * boxDiv; - } - - for ( x = boxLeft; x < inN - boxRight; x++ ) { - boxSum += inSrce[ x + boxRight ]; - boxSum -= inSrce[ x - boxLeft ]; - inDest[ x ] = boxSum * boxDiv; - } + int boxRight = inBoxSize / 2; + int boxLeft = inBoxSize - 1 - boxRight; + float boxSum; + float boxDiv = 1 / ( (float) inBoxSize ); + + boxSum = 0; + + for ( x = - boxRight; x < boxLeft; x++ ) { + i = x + boxRight; + if ( i >= 0 && i < inN ) + boxSum += inSrce[ i ]; + i = i - boxLeft; + if ( i >= 0 && i < inN ) + boxSum -= inSrce[ i ]; + if ( x >= 0 && x < inN ) + inDest[ x ] = boxSum * boxDiv; + } + + for ( x = boxLeft; x < inN - boxRight; x++ ) { + boxSum += inSrce[ x + boxRight ]; + boxSum -= inSrce[ x - boxLeft ]; + inDest[ x ] = boxSum * boxDiv; + } } */ -void XFloatList::GaussSmooth( float inSigma, long inN, float inSrce[], float inDest[] ) { - int maskSize = _MAX( 8.0 * inSigma, 4.0 ); - - if ( maskSize + 1 > MASK_MAX ) - maskSize = MASK_MAX; - - // Make sure the mask size is odd (so we have a 'center') - if ( maskSize % 2 == 0 ) - maskSize++; - int i, x, rx, xEnd; - int maskCtr = maskSize / 2; - float sqrt2PiSigma = sqrt( 2.0 * 3.14159 ) * inSigma; - float expon, sum, factor, *base; - - // Generate a normalizes gaussian mask out to 4*sigma on each side - // We have to adjust the center weight so that when sigma falls below 1.0ish so that the sample it - // takes at x = 0 doesn't represent the val of a gaussian for -.5 to .5 (when sigma is small - // a gaussian gets very 'high' at x=0 vs. x=+/- .5 when sigma is small - sum = 0; - for ( x = - maskCtr; x <= maskCtr; x++ ) { - expon = -0.5 * ((float) (x * x)) / ( inSigma * inSigma ); - sMask[ x + maskCtr ] = exp( expon ) / sqrt2PiSigma; - if ( x != 0 ) - sum += sMask[ x + maskCtr ]; - } - - // This forces normalized weights. - sMask[ maskCtr ] = 1.0 - sum; - - // Smooth the lefthand side of the sequence - xEnd = _MIN( maskCtr, inN ); - for ( x = 0; x < xEnd; x++ ) { - _safeSmooth( x ) - } - - // Smooth the center portion the sequence - xEnd = inN - maskCtr; - base = inSrce; - for ( x = maskCtr; x < xEnd; x++ ) { - - // For each pixel, apply the mask to its neighbors for a final value of that pixel - sum = 0; - for ( i = 0; i < maskSize; i++ ) - sum += sMask[ i ] * base[ i ]; - - base++; - inDest[ x ] = sum; - } - - // Smooth the righthand side of the sequence - for ( x = _MAX( maskCtr, inN - maskCtr ); x < inN; x++ ) { - _safeSmooth( x ) - } -} - - - -void XFloatList::Rank( XLongList& outRank, long inNumToRank ) const { - long *p, *temp; - float* srce; - long i, n = Count(); - - outRank.RemoveAll(); - - if ( inNumToRank < 0 ) - inNumToRank = n; - inNumToRank = _MIN( inNumToRank, n ); - - // Handle trivial cases of this lis already being sorted - if ( mList.mOrdering == cSortLowToHigh ) { - for ( i = 0; i < inNumToRank; i-- ) - outRank.Add( n - i ); } - - // Duh... still sorted... - else if ( mList.mOrdering == cSortHighToLow ) { - for ( i = 1; i <= inNumToRank; i++ ) - outRank.Add( i ); } - - else { - temp = new long[ 2 * n ]; - srce = (float*) mList.getCStr(); - - // To rank, we must sort, with a tag on each element saying where it came from - p = temp; - for ( i = 1; i <= n; i++ ) { - *((float*) p) = *srce; - p++; srce++; - *p = i; - p++; - } - - // Sort the floats - qsort( temp, n, 8, sQSFloatComparitor ); - - // Put the sorted results in the destination - p = temp + 1; - for ( i = 0; i < inNumToRank; i++ ) { - outRank.Add( *p ); - p += 2; - } - - // Cleanup - delete []temp; - } +void XFloatList::GaussSmooth(float inSigma, long inN, float inSrce[], + float inDest[]) { + int maskSize = _MAX(8.0 * inSigma, 4.0); + + if (maskSize + 1 > MASK_MAX) + maskSize = MASK_MAX; + + // Make sure the mask size is odd (so we have a 'center') + if (maskSize % 2 == 0) + maskSize++; + int i, x, rx, xEnd; + int maskCtr = maskSize / 2; + float sqrt2PiSigma = sqrt(2.0 * 3.14159) * inSigma; + float expon, sum, factor, *base; + + // Generate a normalizes gaussian mask out to 4*sigma on each side + // We have to adjust the center weight so that when sigma falls below 1.0ish + // so that the sample it takes at x = 0 doesn't represent the val of a + // gaussian for -.5 to .5 (when sigma is small a gaussian gets very 'high' at + // x=0 vs. x=+/- .5 when sigma is small + sum = 0; + for (x = -maskCtr; x <= maskCtr; x++) { + expon = -0.5 * ((float)(x * x)) / (inSigma * inSigma); + sMask[x + maskCtr] = exp(expon) / sqrt2PiSigma; + if (x != 0) + sum += sMask[x + maskCtr]; + } + + // This forces normalized weights. + sMask[maskCtr] = 1.0 - sum; + + // Smooth the lefthand side of the sequence + xEnd = _MIN(maskCtr, inN); + for (x = 0; x < xEnd; x++) { + _safeSmooth(x) + } + + // Smooth the center portion the sequence + xEnd = inN - maskCtr; + base = inSrce; + for (x = maskCtr; x < xEnd; x++) { + + // For each pixel, apply the mask to its neighbors for a final value of that + // pixel + sum = 0; + for (i = 0; i < maskSize; i++) + sum += sMask[i] * base[i]; + + base++; + inDest[x] = sum; + } + + // Smooth the righthand side of the sequence + for (x = _MAX(maskCtr, inN - maskCtr); x < inN; x++) { + _safeSmooth(x) + } } - - -int XFloatList::sQSFloatComparitor( const void* inA, const void* inB ) { - float diff = *((float*) inB) - *((float*) inA); - if ( diff > 0.0 ) - return 1; - else if ( diff < 0.0 ) - return -1; - else - return 0; +void XFloatList::Rank(XLongList &outRank, long inNumToRank) const { + long *p, *temp; + float *srce; + long i, n = Count(); + + outRank.RemoveAll(); + + if (inNumToRank < 0) + inNumToRank = n; + inNumToRank = _MIN(inNumToRank, n); + + // Handle trivial cases of this lis already being sorted + if (mList.mOrdering == cSortLowToHigh) { + for (i = 0; i < inNumToRank; i--) + outRank.Add(n - i); + } + + // Duh... still sorted... + else if (mList.mOrdering == cSortHighToLow) { + for (i = 1; i <= inNumToRank; i++) + outRank.Add(i); + } + + else { + temp = new long[2 * n]; + srce = (float *)mList.getCStr(); + + // To rank, we must sort, with a tag on each element saying where it came + // from + p = temp; + for (i = 1; i <= n; i++) { + *((float *)p) = *srce; + p++; + srce++; + *p = i; + p++; + } + + // Sort the floats + qsort(temp, n, 8, sQSFloatComparitor); + + // Put the sorted results in the destination + p = temp + 1; + for (i = 0; i < inNumToRank; i++) { + outRank.Add(*p); + p += 2; + } + + // Cleanup + delete[] temp; + } } - - -int XFloatList::sFloatComparitor( const void* inA, const void* inB ) { - float diff = *((float*) &inB) - *((float*) &inA); - if ( diff > 0.0 ) - return 1; - else if ( diff < 0.0 ) - return -1; - else - return 0; +int XFloatList::sQSFloatComparitor(const void *inA, const void *inB) { + float diff = *((float *)inB) - *((float *)inA); + if (diff > 0.0) + return 1; + else if (diff < 0.0) + return -1; + else + return 0; } - - +int XFloatList::sFloatComparitor(const void *inA, const void *inB) { + float diff = *((float *)&inB) - *((float *)&inA); + if (diff > 0.0) + return 1; + else if (diff < 0.0) + return -1; + else + return 0; +} diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XLongList.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XLongList.cpp index 79fb2dc02..53552ca83 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XLongList.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XLongList.cpp @@ -2,130 +2,109 @@ #include - -#define _MIN( a, b ) ( ( (a) < (b) ) ? (a) : (b) ) +#define _MIN(a, b) (((a) < (b)) ? (a) : (b)) long XLongList::sDummy = 0; -XLongList::XLongList( ListOrderingT inOrdering ) : - mList( inOrdering ) { +XLongList::XLongList(ListOrderingT inOrdering) : mList(inOrdering) { - if ( inOrdering == cSortLowToHigh || inOrdering == cSortHighToLow ) - mList.SetCompFcn( sLongComparitor, inOrdering == cSortLowToHigh ); + if (inOrdering == cSortLowToHigh || inOrdering == cSortHighToLow) + mList.SetCompFcn(sLongComparitor, inOrdering == cSortLowToHigh); } - - -int XLongList::sLongComparitor( const void* inA, const void* inB ) { - return ((long) inB - (long) inA); +int XLongList::sLongComparitor(const void *inA, const void *inB) { + return ((long)inB - (long)inA); } - - -int XLongList::sQSLongComparitor( const void* inA, const void* inB ) { - return (*((long*) inB) - *((long*) inA)); +int XLongList::sQSLongComparitor(const void *inA, const void *inB) { + return (*((long *)inB) - *((long *)inA)); } +void XLongList::SubtractRange(long inStart, long inEnd) { + long x, i = 1; - - - - - - -void XLongList::SubtractRange( long inStart, long inEnd ) { - long x, i = 1; - - while ( Fetch( i, &x ) ) { - if ( x >= inStart && x <= inEnd ) - Remove( x ); - else - i++; - } + while (Fetch(i, &x)) { + if (x >= inStart && x <= inEnd) + Remove(x); + else + i++; + } } +void XLongList::ApplyMask(long inStart, long inEnd) { + long x, i = 1; -void XLongList::ApplyMask( long inStart, long inEnd ) { - long x, i = 1; - - while ( Fetch( i, &x ) ) { - if ( x < inStart || x > inEnd ) - Remove( x ); - else - i++; - } + while (Fetch(i, &x)) { + if (x < inStart || x > inEnd) + Remove(x); + else + i++; + } } +long &XLongList::operator[](const long inIndex) { + long len; + if (inIndex >= 0) { + len = mList.mStrLen; + if (inIndex >= len >> 2) { + mList.Insert(len, '\0', (inIndex + 1) * 4 - len); + } - - -long& XLongList::operator[] ( const long inIndex ) { - long len; - - if ( inIndex >= 0 ) { - len = mList.mStrLen; - if ( inIndex >= len >> 2 ) { - mList.Insert( len, '\0', ( inIndex + 1 ) * 4 - len ); - } - - return *( (long*) ( mList.mBuf + inIndex * 4 + 1 ) ); } - else - return sDummy; + return *((long *)(mList.mBuf + inIndex * 4 + 1)); + } else + return sDummy; } - - - - - -void XLongList::Rank( XLongList& outRank, long inNumToRank ) const { - long *p, *temp; - long* srce; - long i, n = Count(); - - outRank.RemoveAll(); - - if ( inNumToRank < 0 ) - inNumToRank = n; - inNumToRank = _MIN( inNumToRank, n ); - - // Handle trivial cases of this lis already being sorted - if ( mList.mOrdering == cSortLowToHigh ) { - for ( i = 0; i < inNumToRank; i-- ) - outRank.Add( n - i ); } - - // Duh... still sorted... - else if ( mList.mOrdering == cSortHighToLow ) { - for ( i = 1; i <= inNumToRank; i++ ) - outRank.Add( i ); } - - else { - temp = new long[ 2 * n ]; - srce = (long*) mList.getCStr(); - - // To rank, we must sort, with a tag on each element saying where it came from - p = temp; - for ( i = 1; i <= n; i++ ) { - *p = *srce; - p++; srce++; - *p = i; - p++; - } - - // Sort the floats - qsort( temp, n, 8, sQSLongComparitor ); - - // Put the sorted results in the destination - p = temp + 1; - for ( i = 0; i < inNumToRank; i++ ) { - outRank.Add( *p ); - p += 2; - } - - // Cleanup - delete []temp; - } +void XLongList::Rank(XLongList &outRank, long inNumToRank) const { + long *p, *temp; + long *srce; + long i, n = Count(); + + outRank.RemoveAll(); + + if (inNumToRank < 0) + inNumToRank = n; + inNumToRank = _MIN(inNumToRank, n); + + // Handle trivial cases of this lis already being sorted + if (mList.mOrdering == cSortLowToHigh) { + for (i = 0; i < inNumToRank; i--) + outRank.Add(n - i); + } + + // Duh... still sorted... + else if (mList.mOrdering == cSortHighToLow) { + for (i = 1; i <= inNumToRank; i++) + outRank.Add(i); + } + + else { + temp = new long[2 * n]; + srce = (long *)mList.getCStr(); + + // To rank, we must sort, with a tag on each element saying where it came + // from + p = temp; + for (i = 1; i <= n; i++) { + *p = *srce; + p++; + srce++; + *p = i; + p++; + } + + // Sort the floats + qsort(temp, n, 8, sQSLongComparitor); + + // Put the sorted results in the destination + p = temp + 1; + for (i = 0; i < inNumToRank; i++) { + outRank.Add(*p); + p += 2; + } + + // Cleanup + delete[] temp; + } } - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XPtrList.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XPtrList.cpp index 049778688..89b406caa 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XPtrList.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XPtrList.cpp @@ -2,272 +2,222 @@ #include "XPtrList.h" #include "nodeClass.h" +void *XPtrList::sDummy = 0; -void* XPtrList::sDummy = 0; +XPtrList::XPtrList(ListOrderingT inOrdering) { - -XPtrList::XPtrList( ListOrderingT inOrdering ) { - - mOrdering = inOrdering; - mCompFcn = 0; + mOrdering = inOrdering; + mCompFcn = 0; } +void XPtrList::Assign(const XPtrList &inList) { UtilStr::Assign(inList); } +#define __ptr(idx) *((void **)(base + idx * sizeof(void *))) +long XPtrList::FetchPredIndex(const void *inPtr) const { + long M, L = 0, R = Count() - 1; + char *base = getCStr(); + int order = (mOrdering == cSortHighToLow) ? INT_MIN : 0; -void XPtrList::Assign( const XPtrList& inList ) { - - UtilStr::Assign( inList ); -} - - - -#define __ptr( idx ) *((void**) (base + idx * sizeof(void*))) + if (R < 0) + return 0; + else { + while (L <= R) { -long XPtrList::FetchPredIndex( const void* inPtr ) const { - long M, L = 0, R = Count()-1; - char* base = getCStr(); - int order = ( mOrdering == cSortHighToLow ) ? INT_MIN : 0; + M = (L + R) / 2; - if ( R < 0 ) - return 0; - else { - while (L <= R) { + if ((mCompFcn(inPtr, __ptr(M)) ^ order) >= 0) // If inPtr <= __ptr( M )... + R = M - 1; // Throw away right half + else + L = M + 1; // Throw away left half + } - M = (L + R) / 2; + if (L > R) // Catch the case where R+1==L + L = M; // In this case, M specifies the critical element - if ( (mCompFcn( inPtr, __ptr( M ) ) ^ order) >= 0 ) // If inPtr <= __ptr( M )... - R = M - 1; // Throw away right half - else - L = M + 1; // Throw away left half - } + // At this point, we know L is the critical element (case: L==R or L + // contains M from case above) + if (mCompFcn(inPtr, __ptr(L)) < 0) // If inPtr > __ptr( M )... + L++; - if ( L > R ) // Catch the case where R+1==L - L = M; // In this case, M specifies the critical element - - // At this point, we know L is the critical element (case: L==R or L contains M from case above) - if ( mCompFcn( inPtr, __ptr( L ) ) < 0 ) // If inPtr > __ptr( M )... - L++; - - return L; - } + return L; + } } +void XPtrList::SetCompFcn(CompFunctionT inFcn, bool inSortLowToHigh) { + mCompFcn = inFcn; -void XPtrList::SetCompFcn( CompFunctionT inFcn, bool inSortLowToHigh ) { - mCompFcn = inFcn; - - RemoveAll(); - - if ( inSortLowToHigh ) - mOrdering = cSortLowToHigh; - else - mOrdering = cSortHighToLow; + RemoveAll(); + if (inSortLowToHigh) + mOrdering = cSortLowToHigh; + else + mOrdering = cSortHighToLow; } +long XPtrList::FindIndexOf(const void *inMatch) const { + long i = 0; + char *curPtr, *endPtr; + void *ptr; + if (mCompFcn) { + i = FetchPredIndex(inMatch); + curPtr = getCStr() + sizeof(void *) * i; + endPtr = getCStr() + length(); + while (curPtr < endPtr) { + i++; + ptr = *((void **)curPtr); + if (ptr == inMatch) + return i; -long XPtrList::FindIndexOf( const void* inMatch ) const { - long i = 0; - char* curPtr, *endPtr; - void* ptr; - - if ( mCompFcn ) { - i = FetchPredIndex( inMatch ); - curPtr = getCStr() + sizeof(void*) * i; - endPtr = getCStr() + length(); - while ( curPtr < endPtr ) { - i++; - ptr = *((void**) curPtr); - if ( ptr == inMatch ) - return i; - - // Stop checking when we hit items that aren't equal to inMatch - else if ( mCompFcn( inMatch, ptr ) != 0 ) - break; - curPtr += sizeof(void*); - } } - else { - curPtr = getCStr(); - endPtr = curPtr + length(); - - while ( curPtr < endPtr ) { - i++; - if ( *((void**) curPtr) == inMatch ) - return i; - else - curPtr += sizeof(void*); - } - } - - return 0; -} - + // Stop checking when we hit items that aren't equal to inMatch + else if (mCompFcn(inMatch, ptr) != 0) + break; + curPtr += sizeof(void *); + } + } else { + curPtr = getCStr(); + endPtr = curPtr + length(); + while (curPtr < endPtr) { + i++; + if (*((void **)curPtr) == inMatch) + return i; + else + curPtr += sizeof(void *); + } + } - -long XPtrList::Add( const void* inPtrToAdd ) { - long i; - - if ( mCompFcn ) { - i = FetchPredIndex( inPtrToAdd ); - Insert( i*sizeof(void*), (char*) &inPtrToAdd, sizeof(void*) ); - return i+1; } - else { - UtilStr::Append( (char*) &inPtrToAdd, sizeof(void*) ); - return Count(); - } + return 0; } +long XPtrList::Add(const void *inPtrToAdd) { + long i; - - - -void XPtrList::Add( const void* inPtrToAdd, long inN ) { - - if ( inN < 0 ) - inN = 0; - - if ( inN > Count() ) - inN = Count(); - - Insert( inN * sizeof(void*), (char*) &inPtrToAdd, sizeof(void*) ); + if (mCompFcn) { + i = FetchPredIndex(inPtrToAdd); + Insert(i * sizeof(void *), (char *)&inPtrToAdd, sizeof(void *)); + return i + 1; + } else { + UtilStr::Append((char *)&inPtrToAdd, sizeof(void *)); + return Count(); + } } +void XPtrList::Add(const void *inPtrToAdd, long inN) { + if (inN < 0) + inN = 0; + if (inN > Count()) + inN = Count(); -void XPtrList::Add( const XPtrList& inList ) { - - if ( mOrdering == cOrderNotImportant ) - UtilStr::Append( inList ); - else { - int i, n = inList.Count(); - for ( i = 1; i <= n; i++ ) - Add( inList.Fetch( i ) ); - } + Insert(inN * sizeof(void *), (char *)&inPtrToAdd, sizeof(void *)); } +void XPtrList::Add(const XPtrList &inList) { - - -void*& XPtrList::operator[] ( long inIndex ) { - if ( inIndex >= 0 ) { - long len = mStrLen; - if ( inIndex >= len / long (sizeof(void*)) ) { - Insert( len, '\0', ( inIndex + 1 ) * sizeof(void*) - len ); - } - - return *( (void**) ( mBuf + inIndex * sizeof(void*) + 1 ) ); } - else - return sDummy; + if (mOrdering == cOrderNotImportant) + UtilStr::Append(inList); + else { + int i, n = inList.Count(); + for (i = 1; i <= n; i++) + Add(inList.Fetch(i)); + } } +void *&XPtrList::operator[](long inIndex) { + if (inIndex >= 0) { + long len = mStrLen; + if (inIndex >= len / long(sizeof(void *))) { + Insert(len, '\0', (inIndex + 1) * sizeof(void *) - len); + } - - - -bool XPtrList::Remove( const void* inMatchPtr ) { - long idx = FindIndexOf( inMatchPtr ); - - return RemoveElement( idx ); + return *((void **)(mBuf + inIndex * sizeof(void *) + 1)); + } else + return sDummy; } +bool XPtrList::Remove(const void *inMatchPtr) { + long idx = FindIndexOf(inMatchPtr); - -bool XPtrList::RemoveElement( long inIndex ) { - char* s; - - if ( inIndex > 0 && inIndex <= Count() ) { - inIndex--; - if ( mOrdering == cOrderNotImportant ) { - s = getCStr(); - *( (void**) (s + inIndex * sizeof(void*)) ) = *( (void**) (s + length() - sizeof(void*) ) ); - Trunc( sizeof(void*) ); } - else - UtilStr::Remove( inIndex * sizeof(void*) + 1, sizeof(void*) ); - return true; } - else - return false; + return RemoveElement(idx); } +bool XPtrList::RemoveElement(long inIndex) { + char *s; - - -bool XPtrList::RemoveLast() { - - if ( length() > 0 ) { - Trunc( sizeof(void*) ); - return true; } - else - return false; + if (inIndex > 0 && inIndex <= Count()) { + inIndex--; + if (mOrdering == cOrderNotImportant) { + s = getCStr(); + *((void **)(s + inIndex * sizeof(void *))) = + *((void **)(s + length() - sizeof(void *))); + Trunc(sizeof(void *)); + } else + UtilStr::Remove(inIndex * sizeof(void *) + 1, sizeof(void *)); + return true; + } else + return false; } +bool XPtrList::RemoveLast() { -void XPtrList::RemoveAll() { - Wipe(); + if (length() > 0) { + Trunc(sizeof(void *)); + return true; + } else + return false; } +void XPtrList::RemoveAll() { Wipe(); } +void XPtrList::MoveToHead(long inIndex) { + void *p; + char *s; - -void XPtrList::MoveToHead( long inIndex ) { - void* p; - char* s; - - if ( inIndex > 1 ) { - if ( Fetch( inIndex, &p ) ) { - inIndex--; - s = getCStr(); - if ( mOrdering == cOrderNotImportant ) - *( (void**) (s + inIndex * sizeof(void*)) ) = *( (void**) s); - else - UtilStr::Move( s+sizeof(void*), s, inIndex * sizeof(void*) ); - *( (void**) s) = p; - } - } + if (inIndex > 1) { + if (Fetch(inIndex, &p)) { + inIndex--; + s = getCStr(); + if (mOrdering == cOrderNotImportant) + *((void **)(s + inIndex * sizeof(void *))) = *((void **)s); + else + UtilStr::Move(s + sizeof(void *), s, inIndex * sizeof(void *)); + *((void **)s) = p; + } + } } - - - -void* XPtrList::Fetch( long inIndex ) const { - if ( inIndex >= 1 && inIndex <= long (length() / sizeof(void*)) ) - return *( (void**) (getCStr() + ( inIndex - 1 ) * sizeof(void*)) ); - else - return 0; +void *XPtrList::Fetch(long inIndex) const { + if (inIndex >= 1 && inIndex <= long(length() / sizeof(void *))) + return *((void **)(getCStr() + (inIndex - 1) * sizeof(void *))); + else + return 0; } +bool XPtrList::Fetch(long inIndex, void **ioPtrDest) const { -bool XPtrList::Fetch( long inIndex, void** ioPtrDest ) const { - - if ( ioPtrDest ) { - if ( inIndex >= 1 && inIndex <= long (length() / sizeof(void*)) ) { - *ioPtrDest = *( (void**) (getCStr() + ( inIndex - 1 ) * sizeof(void*)) ); - return true; } - else - *ioPtrDest = 0; - } + if (ioPtrDest) { + if (inIndex >= 1 && inIndex <= long(length() / sizeof(void *))) { + *ioPtrDest = *((void **)(getCStr() + (inIndex - 1) * sizeof(void *))); + return true; + } else + *ioPtrDest = 0; + } - return false; + return false; } - - - - - #include void XPtrList::Randomize() { - void* temp, **ptrArray = (void**) getCStr(); - long i, randIdx, n = Count(); - - for ( i = 0; i < n; i++ ) { - randIdx = nodeClass::Rnd( 1, n ); - temp = ptrArray[ i ]; - ptrArray[ i ] = ptrArray[ randIdx-1 ]; - ptrArray[ randIdx-1 ] = temp; - } -} + void *temp, **ptrArray = (void **)getCStr(); + long i, randIdx, n = Count(); + for (i = 0; i < n; i++) { + randIdx = nodeClass::Rnd(1, n); + temp = ptrArray[i]; + ptrArray[i] = ptrArray[randIdx - 1]; + ptrArray[randIdx - 1] = temp; + } +} diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XPtrMatrix.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XPtrMatrix.cpp index fa4866387..561ff40a4 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XPtrMatrix.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XPtrMatrix.cpp @@ -1,51 +1,44 @@ #include "XPtrMatrix.h" +XPtrMatrix::XPtrMatrix(bool inRowOrderImpt) : mColumns(cOrderImportant) { -XPtrMatrix::XPtrMatrix( bool inRowOrderImpt ) : - mColumns( cOrderImportant ) { - - mRowOrdering = inRowOrderImpt ? cOrderImportant : cOrderNotImportant; + mRowOrdering = inRowOrderImpt ? cOrderImportant : cOrderNotImportant; } - XPtrMatrix::~XPtrMatrix() { - XPtrList* list; - - while ( mColumns.FetchLast( (void **)(&list) ) ) { - delete list; - mColumns.RemoveLast(); - } + XPtrList *list; + + while (mColumns.FetchLast((void **)(&list))) { + delete list; + mColumns.RemoveLast(); + } } +XPtrList *XPtrMatrix::operator[](long inIndex) { + long i; -XPtrList* XPtrMatrix::operator[]( long inIndex ) { - long i; - - if ( inIndex < 0 ) - inIndex = 0; - - if ( inIndex >= mColumns.Count() ) { - for ( i = inIndex - mColumns.Count(); i >= 0; i-- ) - mColumns.Add( new XPtrList( mRowOrdering ) ); - } - - return (XPtrList*) mColumns.Fetch( inIndex + 1 ); -} + if (inIndex < 0) + inIndex = 0; + if (inIndex >= mColumns.Count()) { + for (i = inIndex - mColumns.Count(); i >= 0; i--) + mColumns.Add(new XPtrList(mRowOrdering)); + } + return (XPtrList *)mColumns.Fetch(inIndex + 1); +} -void XPtrMatrix::Add( long inColumn, void* inPtr ) { - XPtrList* col = (*this)[ inColumn ]; +void XPtrMatrix::Add(long inColumn, void *inPtr) { + XPtrList *col = (*this)[inColumn]; - col -> Add( inPtr ); + col->Add(inPtr); } - - + void XPtrMatrix::RemoveAll() { - long i; - XPtrList* col; - - for ( i = 1; mColumns.Fetch( i, (void **)(&col) ); i++ ) { - col -> RemoveAll(); - } + long i; + XPtrList *col; + + for (i = 1; mColumns.Fetch(i, (void **)(&col)); i++) { + col->RemoveAll(); + } } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XStrList.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XStrList.cpp index 4d924c995..5048f6fea 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XStrList.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/XStrList.cpp @@ -1,182 +1,158 @@ #include "XStrList.h" +XStrList::XStrList(XStrListOptsT inOption, ListOrderingT inOrdering) + : mStrings(inOrdering) { -XStrList::XStrList( XStrListOptsT inOption, ListOrderingT inOrdering ) : - mStrings( inOrdering ) { + mStrListOption = inOption; - mStrListOption = inOption; + bool lowToHigh = inOrdering == cSortLowToHigh; - bool lowToHigh = inOrdering == cSortLowToHigh; - - if ( inOrdering == cSortLowToHigh || inOrdering == cSortHighToLow ) { - if ( mStrListOption == cNoDuplicates_CaseInsensitive ) - mStrings.SetCompFcn( sStrComparitorCI, lowToHigh ); - else - mStrings.SetCompFcn( sStrComparitor, lowToHigh ); - } -} - - - -XStrList::~XStrList() { - - RemoveAll(); + if (inOrdering == cSortLowToHigh || inOrdering == cSortHighToLow) { + if (mStrListOption == cNoDuplicates_CaseInsensitive) + mStrings.SetCompFcn(sStrComparitorCI, lowToHigh); + else + mStrings.SetCompFcn(sStrComparitor, lowToHigh); + } } - +XStrList::~XStrList() { RemoveAll(); } void XStrList::RemoveAll() { - int i = 1; - UtilStr* str; - - while ( mStrings.Fetch( i, (void**) &str ) ) { - delete str; - i++; - } - mStrings.RemoveAll(); + int i = 1; + UtilStr *str; + + while (mStrings.Fetch(i, (void **)&str)) { + delete str; + i++; + } + mStrings.RemoveAll(); } +void XStrList::Remove(long inIndex) { + UtilStr *str; -void XStrList::Remove( long inIndex ) { - UtilStr* str; - - if ( mStrings.Fetch( inIndex, (void**) &str ) ) - delete str; + if (mStrings.Fetch(inIndex, (void **)&str)) + delete str; - mStrings.RemoveElement( inIndex ); + mStrings.RemoveElement(inIndex); } +long XStrList::Add(const void *inData, long inLen) { + UtilStr *s = new UtilStr(inData, inLen); + bool doAdd = true; -long XStrList::Add( const void* inData, long inLen ) { - UtilStr* s = new UtilStr( inData, inLen ); - bool doAdd = true; - - if ( mStrListOption != cDuplicatesAllowed ) - doAdd = FindIndexOf( *s ) == 0; + if (mStrListOption != cDuplicatesAllowed) + doAdd = FindIndexOf(*s) == 0; - if ( doAdd ) - return mStrings.Add( s ); - else { - delete s; - return 0; - } + if (doAdd) + return mStrings.Add(s); + else { + delete s; + return 0; + } } +long XStrList::Add(const char *inStr) { + UtilStr *s = new UtilStr(inStr); + bool doAdd = true; + if (mStrListOption != cDuplicatesAllowed) + doAdd = FindIndexOf(*s) == 0; -long XStrList::Add( const char* inStr ) { - UtilStr* s = new UtilStr( inStr ); - bool doAdd = true; - - if ( mStrListOption != cDuplicatesAllowed ) - doAdd = FindIndexOf( *s ) == 0; - - if ( doAdd ) - return mStrings.Add( s ); - else { - delete s; - return 0; - } + if (doAdd) + return mStrings.Add(s); + else { + delete s; + return 0; + } } +long XStrList::Add(const UtilStr &inStr) { + bool doAdd = true; + if (mStrListOption != cDuplicatesAllowed) + doAdd = FindIndexOf(inStr) == 0; -long XStrList::Add( const UtilStr& inStr ) { - bool doAdd = true; - - if ( mStrListOption != cDuplicatesAllowed ) - doAdd = FindIndexOf( inStr ) == 0; - - if ( doAdd ) - return mStrings.Add( new UtilStr( inStr ) ); - else - return 0; + if (doAdd) + return mStrings.Add(new UtilStr(inStr)); + else + return 0; } +long XStrList::FetchBestMatch(const UtilStr &inStr) { + long best, bestScore, score, i; + UtilStr *str; -long XStrList::FetchBestMatch( const UtilStr& inStr ) { - long best, bestScore, score, i; - UtilStr* str; - - best = 0; + best = 0; - for ( i = 1; mStrings.Fetch( i, (void**) &str ); i++ ) { - score = str -> LCSMatchScore( inStr ); - if ( score > bestScore || i == 1 ) { - best = i; - bestScore = score; - } - } + for (i = 1; mStrings.Fetch(i, (void **)&str); i++) { + score = str->LCSMatchScore(inStr); + if (score > bestScore || i == 1) { + best = i; + bestScore = score; + } + } - return best; + return best; } - /* long XStrList::FindIndexOf( const char* inStr ) const { - bool caseSens = mStrListOption != cNoDuplicates_CaseInsensitive; - static UtilStr sTemp; - int i = 1; - UtilStr* str; - - if ( mStrings.mCompFcn ) { - sTemp.Assign( inStr ); - return FindIndexOf( sTemp ); } - else { - while ( mStrings.Fetch( i, (void**) &str ) ) { - if ( str -> compareTo( inStr, caseSens ) == 0 ) - return i; - i++; - } - } - - return 0; + bool caseSens = mStrListOption != +cNoDuplicates_CaseInsensitive; static UtilStr sTemp; + int i = 1; + UtilStr* str; + + if ( mStrings.mCompFcn ) { + sTemp.Assign( inStr ); + return FindIndexOf( sTemp ); } + else { + while ( mStrings.Fetch( i, (void**) &str ) ) { + if ( str -> compareTo( inStr, caseSens ) == 0 ) + return i; + i++; + } + } + + return 0; } */ -long XStrList::FindIndexOf( const UtilStr& inStr ) const { - int i = 1; - UtilStr* str; - bool caseSens = mStrListOption != cNoDuplicates_CaseInsensitive; - - if ( mStrings.mCompFcn ) { - i = mStrings.FetchPredIndex( &inStr ) + 1; - if ( mStrings.Fetch( i, (void**) &str ) ) { - if ( str -> compareTo( &inStr, caseSens ) == 0 ) - return i; - } } - else - return FindIndexOf( inStr.getCStr() ); - - return 0; +long XStrList::FindIndexOf(const UtilStr &inStr) const { + int i = 1; + UtilStr *str; + bool caseSens = mStrListOption != cNoDuplicates_CaseInsensitive; + + if (mStrings.mCompFcn) { + i = mStrings.FetchPredIndex(&inStr) + 1; + if (mStrings.Fetch(i, (void **)&str)) { + if (str->compareTo(&inStr, caseSens) == 0) + return i; + } + } else + return FindIndexOf(inStr.getCStr()); + + return 0; } +bool XStrList::Fetch(long inIndex, UtilStr &outStr) const { + UtilStr *str; - -bool XStrList::Fetch( long inIndex, UtilStr& outStr ) const { - UtilStr* str; - - if ( mStrings.Fetch( inIndex, (void**) &str ) ) { - outStr.Assign( str ); - return true; } - else - return false; + if (mStrings.Fetch(inIndex, (void **)&str)) { + outStr.Assign(str); + return true; + } else + return false; } - -UtilStr* XStrList::Fetch( long inIndex ) const { - return (UtilStr*) mStrings.Fetch( inIndex ); +UtilStr *XStrList::Fetch(long inIndex) const { + return (UtilStr *)mStrings.Fetch(inIndex); } - - - - -int XStrList::sStrComparitor( const void* inA, const void* inB ) { - return ( (UtilStr*) inA ) -> compareTo( (UtilStr*) inB, true ); +int XStrList::sStrComparitor(const void *inA, const void *inB) { + return ((UtilStr *)inA)->compareTo((UtilStr *)inB, true); } -int XStrList::sStrComparitorCI( const void* inA, const void* inB ) { - return ( (UtilStr*) inA ) -> compareTo( (UtilStr*) inB, false ); +int XStrList::sStrComparitorCI(const void *inA, const void *inB) { + return ((UtilStr *)inA)->compareTo((UtilStr *)inB, false); } - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/nodeClass.cpp b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/nodeClass.cpp index 5edffb13d..89cd8118f 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/nodeClass.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/GeneralTools/nodeClass.cpp @@ -7,906 +7,752 @@ #include #include - #ifdef EG_DEBUG -nodeClass* nodeClass::sFirstDebug = 0; -long nodeClass::sCacheHitsA = 0; -long nodeClass::sCacheHitsB = 0; -long nodeClass::sCacheHitsC = 0; -long nodeClass::sCacheTrysA = 0; -long nodeClass::sCacheTrysB = 0; -long nodeClass::sCacheTrysC = 0; +nodeClass *nodeClass::sFirstDebug = 0; +long nodeClass::sCacheHitsA = 0; +long nodeClass::sCacheHitsB = 0; +long nodeClass::sCacheHitsC = 0; +long nodeClass::sCacheTrysA = 0; +long nodeClass::sCacheTrysB = 0; +long nodeClass::sCacheTrysC = 0; #pragma debug mode on #endif +long nodeClass::sClassIDs[30]; +CreatorFuncT nodeClass::sCreatorFunc[30]; +int nodeClass::sNumRegistered = 0; -long nodeClass::sClassIDs[ 30 ]; -CreatorFuncT nodeClass::sCreatorFunc[ 30 ]; -int nodeClass::sNumRegistered = 0; - +nodeClass::nodeClass() { initSelf(); } -nodeClass::nodeClass() { +nodeClass::nodeClass(nodeClass *inParentPtr) { - initSelf(); + initSelf(); + if (inParentPtr) + inParentPtr->addToTail(this); } +nodeClass::~nodeClass() { + deleteContents(); // Dispose of contained nodes + detach(); // Remove the node from the chain - - -nodeClass::nodeClass( nodeClass* inParentPtr ) { - - initSelf(); - if ( inParentPtr ) - inParentPtr -> addToTail( this ); +#ifdef EG_DEBUG + nodeClass *prevPtr = 0; + nodeClass *nodePtr = sFirstDebug; + + while (nodePtr != this) { + prevPtr = nodePtr; + nodePtr = nodePtr->mNextDebug; + } + + if (prevPtr) + prevPtr->mNextDebug = mNextDebug; + else + sFirstDebug = mNextDebug; +#endif } - - - - - - - -nodeClass::~nodeClass() { - deleteContents(); // Dispose of contained nodes - detach(); // Remove the node from the chain - - #ifdef EG_DEBUG - nodeClass* prevPtr = 0; - nodeClass* nodePtr = sFirstDebug; - - while ( nodePtr != this ) { - prevPtr = nodePtr; - nodePtr = nodePtr -> mNextDebug; - } - - if ( prevPtr ) - prevPtr -> mNextDebug = mNextDebug; - else - sFirstDebug = mNextDebug; - #endif -} - - -#ifdef EG_DEBUG +#ifdef EG_DEBUG void nodeClass::DebugBreak() { - int i = 0; - nodeClass* nodePtr = sFirstDebug; - - while ( nodePtr ) { - i++; // Break here! - nodePtr = nodePtr -> mNextDebug; - } + int i = 0; + nodeClass *nodePtr = sFirstDebug; + + while (nodePtr) { + i++; // Break here! + nodePtr = nodePtr->mNextDebug; + } - i = i + 0; + i = i + 0; } #endif +nodeClass *nodeClass::CreateNode(long inClassID, nodeClass *inParent) { + int i; + for (i = 0; i < sNumRegistered; i++) { + if (sClassIDs[i] == inClassID) + return sCreatorFunc[i](inParent); + } - -nodeClass* nodeClass::CreateNode( long inClassID, nodeClass* inParent ) { - int i; - - for ( i = 0; i < sNumRegistered; i++ ) { - if ( sClassIDs[ i ] == inClassID ) - return sCreatorFunc[ i ]( inParent ); - } - - return 0; + return 0; } - - -void nodeClass::RegisterNodeClass( long inID, CreatorFuncT inCreatorFunc ) { - sClassIDs[ sNumRegistered ] = inID; - sCreatorFunc[ sNumRegistered ] = inCreatorFunc; - sNumRegistered++; +void nodeClass::RegisterNodeClass(long inID, CreatorFuncT inCreatorFunc) { + sClassIDs[sNumRegistered] = inID; + sCreatorFunc[sNumRegistered] = inCreatorFunc; + sNumRegistered++; } - - void nodeClass::initSelf() { - mNext = 0; - mPrev = 0; - mParent = 0; - - mTail = 0; - mHead = 0; - - mFlags = 0; - mDeepCount = -1; - mShallowCount = 0; - - mType = nodeClassT; - - #ifdef EG_DEBUG - mNextDebug = sFirstDebug; - sFirstDebug = this; - #endif -} - - - - -void nodeClass::SetTreeSelected( bool inSelected ) { - nodeClass* nodePtr = mHead; - - SetSelected( inSelected ); - - while ( nodePtr ) { - nodePtr -> SetTreeSelected( inSelected ); - nodePtr = nodePtr -> GetNext(); - } -} - + mNext = 0; + mPrev = 0; + mParent = 0; + mTail = 0; + mHead = 0; + mFlags = 0; + mDeepCount = -1; + mShallowCount = 0; + mType = nodeClassT; - - -void nodeClass::DeleteSelected() { - nodeClass* nodePtr = mHead; - nodeClass* delPtr; - - while ( nodePtr ) { - if ( nodePtr -> IsSelected() ) { - nodePtr -> absorbAfter( nodePtr ); - delPtr = nodePtr; - nodePtr = nodePtr -> GetNext(); - delete delPtr; } - else { - nodePtr -> DeleteSelected(); - nodePtr = nodePtr -> GetNext(); - } - } -} - - - - - - -bool nodeClass::CheckInsertPt( long& ioNodeNum, long& ioDepth ) { - nodeClass* insertPt; - long min, max, n = deepCount(); - - if ( ioNodeNum > n ) - ioNodeNum = n; - - if ( ioDepth < 0 ) - ioDepth = 0; - - insertPt = findSubNode( ioNodeNum ); - - if ( insertPt ) { - max = insertPt -> CountDepth( this ); - - if ( ioDepth > max ) - ioDepth = max; - - if ( insertPt -> shallowCount() > 0 ) - min = max; - else - min = max - insertPt -> CountOverhang( this ) - 1; - - if ( ioDepth < min ) - ioDepth = min; - /* - the following moves the cursor around, moving it to valid insert positions like meterowerks' - project manager... it works great, but it's too advanced for our particular novice computer users. - - for ( n = 0; n <= max - ioDepth - 1; n++ ) { - ioNodeNum = findSubNode( insertPt ) + insertPt -> deepCount(); - insertPt = insertPt -> GetParent(); - }*/ - - } - else { - ioNodeNum = 0; - ioDepth = 0; - } - - return true; -} - - - -void nodeClass::MoveSelected( long afterItemNum, long inDepth ) { - nodeClass* nextPtr, *nodePtr; - nodeClass moveList; - nodeClass* insertPt = findSubNode( afterItemNum ); - long relDepth = 0; - - if ( insertPt ) { - if ( insertPt -> IsSelected() && insertPt -> PrevInChain( this ) == insertPt -> GetPrev() ) - insertPt = insertPt -> GetPrev(); // Allow special case - - if ( insertPt -> IsSelected() ) { // We can't insert the insert node! - while ( insertPt ? insertPt -> IsSelected() : false ) { // Make sure insert pt is not selected - insertPt = insertPt -> PrevInChain( this ); - } - } - - if ( insertPt ) { - relDepth = insertPt -> CountDepth( this ) - inDepth - 1; // How many levels we must rise - - while ( relDepth > 0 && insertPt ) { // Adj the insert node based on - insertPt = insertPt -> GetParent(); - relDepth--; - } - } - } - - if ( insertPt ) { - nodePtr = insertPt -> GetParent(); - while ( nodePtr && nodePtr != this ) { // Prevent circular containment by deselecting - nodePtr -> Unselect(); // parents of the insertion node - nodePtr = nodePtr -> GetParent(); - } } - else { // If no insert pt, we add to this' head. - insertPt = this; - relDepth = -1; // Signal to add to head - } - - - nodePtr = mHead; - while ( nodePtr ) { - if ( nodePtr -> IsSelected() ) { - nextPtr = nodePtr -> PrevInChain( this ); // Save where we'll resume - moveList.addToTail( nodePtr ); // Add the selected item (and its sub tree) to a temp list - if ( nextPtr ) // If we can resume where we left off... - nodePtr = nextPtr; - else // If nodePtr was at the head of this - nodePtr = mHead; } // Start over again - else - nodePtr = nodePtr -> NextInChain( this ); - } - - nodePtr = moveList.GetTail(); - while ( nodePtr ) { - if ( relDepth < 0 ) - insertPt -> addToHead( nodePtr ); - else - nodePtr -> insertAfter( insertPt ); - VerifyNode( nodePtr ); - - nodePtr = moveList.GetTail(); - } -} - - - - - - - - - -void nodeClass::VerifyNode( nodeClass* ) { - - -} - - - - -void nodeClass::absorbMarked( nodeClass* inSourceList ) { - nodeClass* nodePtr = 0; - nodeClass* nextPtr; - - if ( inSourceList ) - nodePtr = inSourceList -> GetHead(); - - while ( nodePtr ) { - nextPtr = nodePtr -> GetNext(); - if ( nodePtr -> IsSelected() ) - addToTail( nodePtr ); - else - absorbMarked( nodePtr ); - - nodePtr = nextPtr; - } - -} - - - -bool nodeClass::HasTheParent( const nodeClass* inMaybeParent ) const { - nodeClass* parPtr = mParent; - - if ( inMaybeParent ) { - while ( parPtr ) { - if ( parPtr == inMaybeParent ) - return true; - else - parPtr = parPtr -> GetParent(); - } - } - - return false; +#ifdef EG_DEBUG + mNextDebug = sFirstDebug; + sFirstDebug = this; +#endif } - - -void nodeClass::SetFlag( unsigned int inFlagNum, bool inVal ) { - unsigned short m; - - if ( inFlagNum >= 1 && inFlagNum <= 9 ) { - m = 0x1 << inFlagNum; - if ( inVal ) - mFlags |= m; - else - mFlags &= ~m; - } -} - +void nodeClass::SetTreeSelected(bool inSelected) { + nodeClass *nodePtr = mHead; + SetSelected(inSelected); -bool nodeClass::GetFlag( unsigned int inFlagNum ) const { - unsigned short m; - - if ( inFlagNum >= 1 && inFlagNum <= 9 ) { - m = 0x1 << inFlagNum; - return mFlags & m; } - else - return false; + while (nodePtr) { + nodePtr->SetTreeSelected(inSelected); + nodePtr = nodePtr->GetNext(); + } } +void nodeClass::DeleteSelected() { + nodeClass *nodePtr = mHead; + nodeClass *delPtr; + + while (nodePtr) { + if (nodePtr->IsSelected()) { + nodePtr->absorbAfter(nodePtr); + delPtr = nodePtr; + nodePtr = nodePtr->GetNext(); + delete delPtr; + } else { + nodePtr->DeleteSelected(); + nodePtr = nodePtr->GetNext(); + } + } +} + +bool nodeClass::CheckInsertPt(long &ioNodeNum, long &ioDepth) { + nodeClass *insertPt; + long min, max, n = deepCount(); + + if (ioNodeNum > n) + ioNodeNum = n; + + if (ioDepth < 0) + ioDepth = 0; + + insertPt = findSubNode(ioNodeNum); + + if (insertPt) { + max = insertPt->CountDepth(this); + + if (ioDepth > max) + ioDepth = max; + + if (insertPt->shallowCount() > 0) + min = max; + else + min = max - insertPt->CountOverhang(this) - 1; + + if (ioDepth < min) + ioDepth = min; + /* + the following moves the cursor around, moving it to valid insert + positions like meterowerks' project manager... it works great, but it's + too advanced for our particular novice computer users. + + for ( n = 0; n <= max - ioDepth - 1; n++ ) { + ioNodeNum = findSubNode( insertPt ) + insertPt -> + deepCount(); insertPt = insertPt -> GetParent(); + }*/ + + } else { + ioNodeNum = 0; + ioDepth = 0; + } + + return true; +} + +void nodeClass::MoveSelected(long afterItemNum, long inDepth) { + nodeClass *nextPtr, *nodePtr; + nodeClass moveList; + nodeClass *insertPt = findSubNode(afterItemNum); + long relDepth = 0; + + if (insertPt) { + if (insertPt->IsSelected() && + insertPt->PrevInChain(this) == insertPt->GetPrev()) + insertPt = insertPt->GetPrev(); // Allow special case + + if (insertPt->IsSelected()) { // We can't insert the insert node! + while (insertPt ? insertPt->IsSelected() + : false) { // Make sure insert pt is not selected + insertPt = insertPt->PrevInChain(this); + } + } + + if (insertPt) { + relDepth = insertPt->CountDepth(this) - inDepth - + 1; // How many levels we must rise + + while (relDepth > 0 && + insertPt) { // Adj the insert node based on + insertPt = insertPt->GetParent(); + relDepth--; + } + } + } + + if (insertPt) { + nodePtr = insertPt->GetParent(); + while (nodePtr && + nodePtr != this) { // Prevent circular containment by deselecting + nodePtr->Unselect(); // parents of the insertion node + nodePtr = nodePtr->GetParent(); + } + } else { // If no insert pt, we add to this' head. + insertPt = this; + relDepth = -1; // Signal to add to head + } + + nodePtr = mHead; + while (nodePtr) { + if (nodePtr->IsSelected()) { + nextPtr = nodePtr->PrevInChain(this); // Save where we'll resume + moveList.addToTail( + nodePtr); // Add the selected item (and its sub tree) to a temp list + if (nextPtr) // If we can resume where we left off... + nodePtr = nextPtr; + else // If nodePtr was at the head of this + nodePtr = mHead; + } // Start over again + else + nodePtr = nodePtr->NextInChain(this); + } + + nodePtr = moveList.GetTail(); + while (nodePtr) { + if (relDepth < 0) + insertPt->addToHead(nodePtr); + else + nodePtr->insertAfter(insertPt); + VerifyNode(nodePtr); + + nodePtr = moveList.GetTail(); + } +} + +void nodeClass::VerifyNode(nodeClass *) {} + +void nodeClass::absorbMarked(nodeClass *inSourceList) { + nodeClass *nodePtr = 0; + nodeClass *nextPtr; + + if (inSourceList) + nodePtr = inSourceList->GetHead(); + + while (nodePtr) { + nextPtr = nodePtr->GetNext(); + if (nodePtr->IsSelected()) + addToTail(nodePtr); + else + absorbMarked(nodePtr); + + nodePtr = nextPtr; + } +} + +bool nodeClass::HasTheParent(const nodeClass *inMaybeParent) const { + nodeClass *parPtr = mParent; + + if (inMaybeParent) { + while (parPtr) { + if (parPtr == inMaybeParent) + return true; + else + parPtr = parPtr->GetParent(); + } + } + + return false; +} + +void nodeClass::SetFlag(unsigned int inFlagNum, bool inVal) { + unsigned short m; + + if (inFlagNum >= 1 && inFlagNum <= 9) { + m = 0x1 << inFlagNum; + if (inVal) + mFlags |= m; + else + mFlags &= ~m; + } +} + +bool nodeClass::GetFlag(unsigned int inFlagNum) const { + unsigned short m; + + if (inFlagNum >= 1 && inFlagNum <= 9) { + m = 0x1 << inFlagNum; + return mFlags & m; + } else + return false; +} + +void nodeClass::UpdateCounts(int inShallowChange) { + if (inShallowChange != 0) + mShallowCount += inShallowChange; // Update shallow count - - -void nodeClass::UpdateCounts( int inShallowChange ) { - if ( inShallowChange != 0 ) - mShallowCount += inShallowChange; // Update shallow count - - mDeepCount = -1; // Invalidate deep count - - if ( mParent ) - mParent -> UpdateCounts( 0 ); // Propigate the dirty info + mDeepCount = -1; // Invalidate deep count + + if (mParent) + mParent->UpdateCounts(0); // Propigate the dirty info } - void nodeClass::detach() { - if ( mParent ) { - mParent -> UpdateCounts( -1 ); - - if ( mPrev ) // if a link proceeds... - mPrev -> mNext = mNext; // tell prev link where the new next link is - else // if this is the 1st item... - mParent -> mHead = mNext; // tell header where new 1st link is - - if ( mNext ) // if a link follows... - mNext -> mPrev = mPrev; // tell next link where the new prev link is - else // is this is the last item... - mParent -> mTail = mPrev; // tell header where new last link is - } - - mNext = 0; // if something still points here, - mPrev = 0; // the data remaining will be 0/bad; - mParent = 0; // be safe - -} - - + if (mParent) { + mParent->UpdateCounts(-1); + if (mPrev) // if a link proceeds... + mPrev->mNext = mNext; // tell prev link where the new next link is + else // if this is the 1st item... + mParent->mHead = mNext; // tell header where new 1st link is + if (mNext) // if a link follows... + mNext->mPrev = mPrev; // tell next link where the new prev link is + else // is this is the last item... + mParent->mTail = mPrev; // tell header where new last link is + } -void nodeClass::insertAfter( nodeClass* inBefore ) { - - if ( inBefore && inBefore != this ) { - if ( inBefore -> GetNext() != this ) { - detach(); // Detach this ob before we go attaching somewhere else - mParent = inBefore -> GetParent(); // set this object's parent group ptr - - if ( mParent ) { - mParent -> UpdateCounts( 1 ); - - if ( inBefore == mParent -> GetTail() ) // if inserting after the last ob in the group... - mParent -> mTail = this; // tell group that this is the new end ob in the group - - mPrev = inBefore; // set this ob's prev ob ptr to the ob we're inserting after - - mNext = inBefore -> GetNext(); // obtain the ob this is to be inserted before - if ( mNext ) // if a next ob exists... - mNext -> mPrev = this; // then tell it this is its new prev ob ptr - - mPrev -> mNext = this; // tell prev ob that this is its next ob - } - } - } + mNext = 0; // if something still points here, + mPrev = 0; // the data remaining will be 0/bad; + mParent = 0; // be safe } +void nodeClass::insertAfter(nodeClass *inBefore) { + if (inBefore && inBefore != this) { + if (inBefore->GetNext() != this) { + detach(); // Detach this ob before we go attaching somewhere else + mParent = inBefore->GetParent(); // set this object's parent group ptr -void nodeClass::insertAfter( long inAfterNode, nodeClass* inNodeToAdd ) { - nodeClass* insertPt = findSubNode( inAfterNode ); - - if ( inNodeToAdd ) { - if ( insertPt ) - inNodeToAdd -> insertAfter( insertPt ); - else if ( inAfterNode <= 0 ) - addToHead( inNodeToAdd ); - else - addToTail( inNodeToAdd ); - } -} - + if (mParent) { + mParent->UpdateCounts(1); + if (inBefore == + mParent + ->GetTail()) // if inserting after the last ob in the group... + mParent->mTail = + this; // tell group that this is the new end ob in the group + mPrev = inBefore; // set this ob's prev ob ptr to the ob we're inserting + // after + mNext = + inBefore->GetNext(); // obtain the ob this is to be inserted before + if (mNext) // if a next ob exists... + mNext->mPrev = this; // then tell it this is its new prev ob ptr -long nodeClass::findInstance() const { - long nodeCount = 0; - nodeClass* nodePtr; - int foundMatch = false; - - if ( mParent ) { - nodePtr = mParent -> GetHead(); - - while ( nodePtr && ! foundMatch ) { - nodeCount++; - if ( this == nodePtr ) - foundMatch = true; - nodePtr = nodePtr -> GetNext(); - } - } - - if ( foundMatch ) - return nodeCount; - else - return 0; + mPrev->mNext = this; // tell prev ob that this is its next ob + } + } + } } - - - - - -void nodeClass::absorbContents( nodeClass* inSourceList, int inPutAtHead ) { - nodeClass* nodePtr; - - if ( inSourceList ) { - do { - if ( inPutAtHead ) { - nodePtr = inSourceList -> mTail; - addToHead( nodePtr ); } - else { - nodePtr = inSourceList -> mHead; - addToTail( nodePtr ); - } - } while ( nodePtr ); - } +void nodeClass::insertAfter(long inAfterNode, nodeClass *inNodeToAdd) { + nodeClass *insertPt = findSubNode(inAfterNode); + if (inNodeToAdd) { + if (insertPt) + inNodeToAdd->insertAfter(insertPt); + else if (inAfterNode <= 0) + addToHead(inNodeToAdd); + else + addToTail(inNodeToAdd); + } } - - - - - -void nodeClass::absorbAfter( nodeClass* inSourceList ) { - nodeClass* nodePtr; - nodeClass* lastPtr = this; - - if ( inSourceList && mParent ) { - do { - nodePtr = inSourceList -> mHead; - if ( nodePtr ) { - nodePtr -> insertAfter( lastPtr ); - lastPtr = nodePtr; - } - } while ( nodePtr ); - } +long nodeClass::findInstance() const { + long nodeCount = 0; + nodeClass *nodePtr; + int foundMatch = false; + + if (mParent) { + nodePtr = mParent->GetHead(); + + while (nodePtr && !foundMatch) { + nodeCount++; + if (this == nodePtr) + foundMatch = true; + nodePtr = nodePtr->GetNext(); + } + } + + if (foundMatch) + return nodeCount; + else + return 0; +} + +void nodeClass::absorbContents(nodeClass *inSourceList, int inPutAtHead) { + nodeClass *nodePtr; + + if (inSourceList) { + do { + if (inPutAtHead) { + nodePtr = inSourceList->mTail; + addToHead(nodePtr); + } else { + nodePtr = inSourceList->mHead; + addToTail(nodePtr); + } + } while (nodePtr); + } +} + +void nodeClass::absorbAfter(nodeClass *inSourceList) { + nodeClass *nodePtr; + nodeClass *lastPtr = this; + + if (inSourceList && mParent) { + do { + nodePtr = inSourceList->mHead; + if (nodePtr) { + nodePtr->insertAfter(lastPtr); + lastPtr = nodePtr; + } + } while (nodePtr); + } } - - - - - void nodeClass::deleteContents() { - nodeClass* nodePtr = mHead; - nodeClass* nextNodePtr; - - while ( nodePtr ) { - nextNodePtr = nodePtr -> GetNext(); - delete nodePtr; - nodePtr = nextNodePtr; - } -} - - - - - - - - - - - - - - - - - - - - -void nodeClass::addToHead( nodeClass* nodeToAdd ) { - if ( nodeToAdd ) { - nodeToAdd -> detach(); // Detach it before we add it here - nodeToAdd -> mParent = this; // let ob know where parent group is - UpdateCounts( 1 ); - if ( mTail == 0) { // if this is the 1st item in the list to be... - nodeToAdd -> mPrev = 0; // there is no prev link - nodeToAdd -> mNext = 0; // there is no next link - mHead = mTail = nodeToAdd; } // let link header know where the 1st and last link is - else { // if there is already items in the list... - mHead -> mPrev = nodeToAdd; // let old first link know where new last link is - nodeToAdd -> mPrev = 0; // tell new last link there is no prev link - nodeToAdd -> mNext = mHead; // let new first link know where old last link is - mHead = nodeToAdd; // let link header know where new last link is - } - } + nodeClass *nodePtr = mHead; + nodeClass *nextNodePtr; + + while (nodePtr) { + nextNodePtr = nodePtr->GetNext(); + delete nodePtr; + nodePtr = nextNodePtr; + } +} + +void nodeClass::addToHead(nodeClass *nodeToAdd) { + if (nodeToAdd) { + nodeToAdd->detach(); // Detach it before we add it here + nodeToAdd->mParent = this; // let ob know where parent group is + UpdateCounts(1); + if (mTail == 0) { // if this is the 1st item in the list to be... + nodeToAdd->mPrev = 0; // there is no prev link + nodeToAdd->mNext = 0; // there is no next link + mHead = mTail = nodeToAdd; + } // let link header know where the 1st and last link is + else { // if there is already items in the list... + mHead->mPrev = + nodeToAdd; // let old first link know where new last link is + nodeToAdd->mPrev = 0; // tell new last link there is no prev link + nodeToAdd->mNext = + mHead; // let new first link know where old last link is + mHead = nodeToAdd; // let link header know where new last link is + } + } +} + +void nodeClass::addToTail(nodeClass *nodeToAdd) { + if (nodeToAdd) { // if i have a valid ptr... + nodeToAdd->detach(); // Detach it before we add it here + nodeToAdd->mParent = this; // let ob know where parent group is + UpdateCounts(1); + if (mHead) { // if there is already items in the list... + mTail->mNext = nodeToAdd; // let old last link know where new last link is + nodeToAdd->mPrev = mTail; // let new last link know where old last link is + nodeToAdd->mNext = 0; // tell new last link there is no next link + mTail = nodeToAdd; + } // let link header know where new last link is + else { // if this is the 1st item in the list to be... + nodeToAdd->mPrev = 0; // there is no prev link + nodeToAdd->mNext = 0; // there is no next link + mHead = nodeToAdd; // let link header know where the 1st link is + mTail = nodeToAdd; // let link header know where the last link is + } + } +} + +long nodeClass::CountDepth(const nodeClass *inCeiling) const { + nodeClass *nodePtr = mParent; + int count = 1; + + while (nodePtr && nodePtr != inCeiling) { + nodePtr = nodePtr->GetParent(); + count++; + } + + if (!nodePtr) + count--; + + return count; +} + +nodeClass *nodeClass::findNodeNum(long inNum) { + nodeClass *nodePtr = mHead; + int nodeCount = 0; + + while (nodePtr) { + nodeCount++; + if (nodeCount == inNum) + return nodePtr; + nodePtr = nodePtr->GetNext(); + } + + return 0; } +/* +nodeClass* nodeClass::findPrevNonMarkedSubNode( long inNum ) { + nodeStep i( this ); + nodeClass* start = findSubNode( inNum ); + nodeClass* nodePtr = i.GetNext(); + nodeClass* prevPtr = 0; + if ( start ) { + if ( start -> isMarked() ) { + while ( nodePtr != start ) { + if ( ! nodePtr -> isMarked() ) + prevPtr = nodePtr; + nodePtr = i.GetNext(); + } + start = prevPtr; + } + } - -void nodeClass::addToTail( nodeClass* nodeToAdd ) { - if ( nodeToAdd ) { // if i have a valid ptr... - nodeToAdd -> detach(); // Detach it before we add it here - nodeToAdd -> mParent = this; // let ob know where parent group is - UpdateCounts( 1 ); - if ( mHead ) { // if there is already items in the list... - mTail -> mNext = nodeToAdd; // let old last link know where new last link is - nodeToAdd -> mPrev = mTail; // let new last link know where old last link is - nodeToAdd -> mNext = 0; // tell new last link there is no next link - mTail = nodeToAdd; } // let link header know where new last link is - else { // if this is the 1st item in the list to be... - nodeToAdd -> mPrev = 0; // there is no prev link - nodeToAdd -> mNext = 0; // there is no next link - mHead = nodeToAdd; // let link header know where the 1st link is - mTail = nodeToAdd; // let link header know where the last link is - } - } -} - - - - - - - - - - - - - -long nodeClass::CountDepth( const nodeClass* inCeiling ) const { - nodeClass* nodePtr = mParent; - int count = 1; - - - while ( nodePtr && nodePtr != inCeiling ) { - nodePtr = nodePtr -> GetParent(); - count++; - } - - if ( ! nodePtr ) - count--; - - return count; -} - - - - - -nodeClass* nodeClass::findNodeNum( long inNum ) { - nodeClass* nodePtr = mHead; - int nodeCount = 0; - - while ( nodePtr ) { - nodeCount++; - if ( nodeCount == inNum ) - return nodePtr; - nodePtr = nodePtr -> GetNext(); - } - - return 0; - -} - - -/* - -nodeClass* nodeClass::findPrevNonMarkedSubNode( long inNum ) { - nodeStep i( this ); - nodeClass* start = findSubNode( inNum ); - nodeClass* nodePtr = i.GetNext(); - nodeClass* prevPtr = 0; - - if ( start ) { - if ( start -> isMarked() ) { - while ( nodePtr != start ) { - if ( ! nodePtr -> isMarked() ) - prevPtr = nodePtr; - - nodePtr = i.GetNext(); - } - start = prevPtr; - } - } - - return start; + return start; } */ +nodeClass *nodeClass::GetDeepTail() const { + nodeClass *retPtr = mTail; + if (retPtr) { + while (retPtr->mTail) + retPtr = retPtr->mTail; + } -nodeClass* nodeClass::GetDeepTail() const { - nodeClass* retPtr = mTail; - - if ( retPtr ) { - while ( retPtr -> mTail ) - retPtr = retPtr -> mTail; - } - - return retPtr; + return retPtr; } - /* Not Yet Tested: nodeClass* nodeClass::GetParentDeepTail( const nodeClass* inCeiling ) const { - nodeClass* retPtr = this; - int n = CountOverhang( inCeiling ); - - while ( n > 0 && retPtr ) - retPtr = retPtr -> GetParent(); + nodeClass* retPtr = this; + int n = CountOverhang( inCeiling ); + + while ( n > 0 && retPtr ) + retPtr = retPtr -> GetParent(); } */ -int nodeClass::CountOverhang( const nodeClass* inCeiling ) const { - const nodeClass* nodePtr = this; - int n = 0; - - while ( nodePtr && inCeiling != nodePtr ) { - if ( nodePtr -> GetNext() ) - return n; - nodePtr = nodePtr -> GetParent(); - n++; - } - - return n; -} - - -nodeClass* nodeClass::findSubNode( long inNum ) { - nodeClass* nodePtr = mHead; - long d, i = 0; - - if ( inNum > 0 ) { - while ( nodePtr ) { // Loop while there's nodes and we haven't found desired - i++; - if ( inNum == i ) // If we found the desired node - return nodePtr; - else { - d = nodePtr -> deepCount(); // See how big this sub tree is. - if ( inNum - i <= d ) // If stepping over it will miss our desired node - return nodePtr -> findSubNode( inNum - i ); // Then the node we want is inside this sub tree - else { - i += d; // We can step over this sub tree, baby. - nodePtr = nodePtr -> GetNext(); - } - } - } - // i contains the deep count if above loop terminated - mDeepCount = i; // If deepCount is invalid, we might as well use what we have - } - - return 0; -} - - - -long nodeClass::findSubNode( nodeClass* inNodePtr ) { - nodeClass* nodePtr = mHead; - long d, n = 0; - bool done = false; - - while ( nodePtr && ! done ) { // Loop till end of shallow list or until we found desired node - n++; // Count the shallow node we're on right now - if ( nodePtr == inNodePtr ) // Is the current (shallow) node our man? - done = true; - else { - d = nodePtr -> findSubNode( inNodePtr ); - if ( d > 0 ) { // If desired node was in the shallow node's deep tree - done = true; - n += d; } // Adjust n to be the correct num for - else { - n += nodePtr -> deepCount(); // Adjust n to reflect the current # of nodes checked - nodePtr = nodePtr -> GetNext(); // Move to the next shallow node - } - } - } - - if ( ! done ) { // If a match wasn't found... - if ( mDeepCount < 0 ) // If deep count # was invalid - mDeepCount = n; // We might as well use what we info we have - n = 0; - } - - return n; +int nodeClass::CountOverhang(const nodeClass *inCeiling) const { + const nodeClass *nodePtr = this; + int n = 0; + + while (nodePtr && inCeiling != nodePtr) { + if (nodePtr->GetNext()) + return n; + nodePtr = nodePtr->GetParent(); + n++; + } + + return n; +} + +nodeClass *nodeClass::findSubNode(long inNum) { + nodeClass *nodePtr = mHead; + long d, i = 0; + + if (inNum > 0) { + while (nodePtr) { // Loop while there's nodes and we haven't found desired + i++; + if (inNum == i) // If we found the desired node + return nodePtr; + else { + d = nodePtr->deepCount(); // See how big this sub tree is. + if (inNum - i <= d) // If stepping over it will miss our desired node + return nodePtr->findSubNode( + inNum - i); // Then the node we want is inside this sub tree + else { + i += d; // We can step over this sub tree, baby. + nodePtr = nodePtr->GetNext(); + } + } + } + // i contains the deep count if above loop terminated + mDeepCount = + i; // If deepCount is invalid, we might as well use what we have + } + + return 0; +} + +long nodeClass::findSubNode(nodeClass *inNodePtr) { + nodeClass *nodePtr = mHead; + long d, n = 0; + bool done = false; + + while ( + nodePtr && + !done) { // Loop till end of shallow list or until we found desired node + n++; // Count the shallow node we're on right now + if (nodePtr == inNodePtr) // Is the current (shallow) node our man? + done = true; + else { + d = nodePtr->findSubNode(inNodePtr); + if (d > 0) { // If desired node was in the shallow node's deep tree + done = true; + n += d; + } // Adjust n to be the correct num for + else { + n += nodePtr->deepCount(); // Adjust n to reflect the current # of nodes + // checked + nodePtr = nodePtr->GetNext(); // Move to the next shallow node + } + } + } + + if (!done) { // If a match wasn't found... + if (mDeepCount < 0) // If deep count # was invalid + mDeepCount = n; // We might as well use what we info we have + n = 0; + } + + return n; } - - - long nodeClass::deepCount() { - nodeClass* nodePtr; - - if ( mDeepCount < 0 ) { // If the cached counter was/is invalid - nodePtr = mHead; - mDeepCount = mShallowCount; // Prepare to recompute it - while ( nodePtr ) { - mDeepCount += nodePtr -> deepCount(); - nodePtr = nodePtr -> GetNext(); - } - } - - return mDeepCount; -} - - - - -nodeClass* nodeClass::NextInChain( const nodeClass* inCeiling ) const { - nodeClass* nodePtr, *retPtr; - - if ( mHead ) - return mHead; - else if ( this == inCeiling ) - return 0; - else if ( mNext ) - return mNext; - else { - nodePtr = mParent; - retPtr = 0; - while ( nodePtr && ! retPtr && inCeiling != nodePtr ) { - retPtr = nodePtr -> GetNext(); - nodePtr = nodePtr -> GetParent(); - } - return retPtr; - } -} - - - - - -nodeClass* nodeClass::PrevInChain( const nodeClass* inCeiling ) const { - nodeClass* retPtr; - - if ( mPrev ) { - retPtr = mPrev; - while ( retPtr -> mTail ) - retPtr = retPtr -> mTail; - return retPtr; } - else if ( mParent != inCeiling ) - return mParent; - else - return 0; + nodeClass *nodePtr; + + if (mDeepCount < 0) { // If the cached counter was/is invalid + nodePtr = mHead; + mDeepCount = mShallowCount; // Prepare to recompute it + while (nodePtr) { + mDeepCount += nodePtr->deepCount(); + nodePtr = nodePtr->GetNext(); + } + } + + return mDeepCount; +} + +nodeClass *nodeClass::NextInChain(const nodeClass *inCeiling) const { + nodeClass *nodePtr, *retPtr; + + if (mHead) + return mHead; + else if (this == inCeiling) + return 0; + else if (mNext) + return mNext; + else { + nodePtr = mParent; + retPtr = 0; + while (nodePtr && !retPtr && inCeiling != nodePtr) { + retPtr = nodePtr->GetNext(); + nodePtr = nodePtr->GetParent(); + } + return retPtr; + } +} + +nodeClass *nodeClass::PrevInChain(const nodeClass *inCeiling) const { + nodeClass *retPtr; + + if (mPrev) { + retPtr = mPrev; + while (retPtr->mTail) + retPtr = retPtr->mTail; + return retPtr; + } else if (mParent != inCeiling) + return mParent; + else + return 0; } - /* Is code-opposite of NextInChain(), but does not *do* the opposite: nodeClass* nodeClass::PrevInChain( const nodeClass* inCeiling ) const { - nodeClass* nodePtr, *retPtr; - - if ( mTail ) - return mTail; - else if ( mPrev ) - return mPrev; - else { - nodePtr = mParent; - retPtr = 0; - while ( nodePtr && ! retPtr && inCeiling != nodePtr ) { - retPtr = nodePtr -> GetPrev(); - nodePtr = nodePtr -> GetParent(); - } - return retPtr; - } + nodeClass* nodePtr, *retPtr; + + if ( mTail ) + return mTail; + else if ( mPrev ) + return mPrev; + else { + nodePtr = mParent; + retPtr = 0; + while ( nodePtr && ! retPtr && inCeiling != nodePtr ) { + retPtr = nodePtr -> GetPrev(); + nodePtr = nodePtr -> GetParent(); + } + return retPtr; + } } */ +void nodeClass::StartRead(CEgIStream *inStream) { - - - - - - - - -void nodeClass::StartRead( CEgIStream* inStream ) { - - if ( inStream ) { - if ( inStream -> noErr() ) { - inStream -> GetByte(); // Throw away type flag for head node to be read - ReadFrom( inStream ); - } - } + if (inStream) { + if (inStream->noErr()) { + inStream->GetByte(); // Throw away type flag for head node to be read + ReadFrom(inStream); + } + } } +void nodeClass::ReadFrom(CEgIStream *inStream) { + int kind; + nodeClass *nodePtr; + do { + kind = inStream->GetByte(); + if (kind != cEgSubEnd) { + nodePtr = CreateNode(kind, this); + if (nodePtr) + nodePtr->ReadFrom(inStream); + else + inStream->throwErr(cCorrupted); + } -void nodeClass::ReadFrom( CEgIStream* inStream ) { - int kind; - nodeClass* nodePtr; - - do { - kind = inStream -> GetByte(); - - if ( kind != cEgSubEnd ) { - nodePtr = CreateNode( kind, this ); - if ( nodePtr ) - nodePtr -> ReadFrom( inStream ); - else - inStream -> throwErr( cCorrupted ); - } - - } while ( inStream -> noErr() && kind != cEgSubEnd ); - + } while (inStream->noErr() && kind != cEgSubEnd); } +void nodeClass::WriteTo(CEgOStream *inStream) { + nodeClass *nodePtr = mHead; + inStream->PutByte(mType); - -void nodeClass::WriteTo( CEgOStream* inStream ) { - nodeClass* nodePtr = mHead; - - inStream -> PutByte( mType ); - - while ( nodePtr && inStream -> noErr() ) { - nodePtr -> WriteTo( inStream ); - nodePtr = nodePtr -> GetNext(); - } - inStream -> PutByte( cEgSubEnd ); + while (nodePtr && inStream->noErr()) { + nodePtr->WriteTo(inStream); + nodePtr = nodePtr->GetNext(); + } + inStream->PutByte(cEgSubEnd); } - - - - void nodeClass::RandomizeSubs() { - long rnd, i; - nodeClass* nodePtr; - nodeClass holder; - - for ( i = shallowCount(); i > 0; i-- ) { - rnd = Rnd( 1, i ); - nodePtr = findNodeNum( rnd ); - holder.addToTail( nodePtr ); - } - - absorbContents( &holder ); -} - + long rnd, i; + nodeClass *nodePtr; + nodeClass holder; + for (i = shallowCount(); i > 0; i--) { + rnd = Rnd(1, i); + nodePtr = findNodeNum(rnd); + holder.addToTail(nodePtr); + } + absorbContents(&holder); +} -long nodeClass::Rnd( long min, long max ) { - return LV::rand() % (max - min + 1) + min; +long nodeClass::Rnd(long min, long max) { + return LV::rand() % (max - min + 1) + min; } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/DrawXX.cpp b/libvisual-plugins/plugins/actor/gforce/Common/UI/DrawXX.cpp index 9f4faa234..a4d231d2b 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/DrawXX.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/DrawXX.cpp @@ -1,78 +1,98 @@ #if P_SZ == 1 - #define PIXTYPE unsigned char - #define REDSHIFT 4 - #define GRNSHIFT 2 - #define COLMASK 0x3 - #define _Line Line8 - #define _BoxBlur BoxBlur8 - #define _CrossBlur CrossBlur8 - #define _EraseRect EraseRect8 - #define __Clr(r,g,b) (r >> 8) +#define PIXTYPE unsigned char +#define REDSHIFT 4 +#define GRNSHIFT 2 +#define COLMASK 0x3 +#define _Line Line8 +#define _BoxBlur BoxBlur8 +#define _CrossBlur CrossBlur8 +#define _EraseRect EraseRect8 +#define __Clr(r, g, b) (r >> 8) #elif P_SZ == 2 - #define PIXTYPE unsigned short - #define REDSHIFT 10 - #define GRNSHIFT 5 - #define COLMASK 0x1F - #define _Line Line16 - #define _BoxBlur BoxBlur16 - #define _CrossBlur CrossBlur16 - #define _EraseRect EraseRect16 - #define __Clr(r,g,b) (((r & 0xF800) >> 1) | ((g & 0xF800) >> 6) | (b >> 11)) +#define PIXTYPE unsigned short +#define REDSHIFT 10 +#define GRNSHIFT 5 +#define COLMASK 0x1F +#define _Line Line16 +#define _BoxBlur BoxBlur16 +#define _CrossBlur CrossBlur16 +#define _EraseRect EraseRect16 +#define __Clr(r, g, b) (((r & 0xF800) >> 1) | ((g & 0xF800) >> 6) | (b >> 11)) #elif P_SZ == 4 - #define PIXTYPE uint32_t - #define REDSHIFT 16 - #define GRNSHIFT 8 - #define COLMASK 0xFF - #define _Line Line32 - #define _BoxBlur BoxBlur32 - #define _CrossBlur CrossBlur32 - #define _EraseRect EraseRect32 - #if EG_MAC || defined(UNIX_X) - #define __Clr(r,g,b) (((r & 0xFF00) << 8) | (g & 0xFF00) | (b >> 8)) - #elif EG_WIN - #define __Clr(r,g,b) __winRGB( b, g, r ) - #endif - +#define PIXTYPE uint32_t +#define REDSHIFT 16 +#define GRNSHIFT 8 +#define COLMASK 0xFF +#define _Line Line32 +#define _BoxBlur BoxBlur32 +#define _CrossBlur CrossBlur32 +#define _EraseRect EraseRect32 +#if EG_MAC || defined(UNIX_X) +#define __Clr(r, g, b) (((r & 0xFF00) << 8) | (g & 0xFF00) | (b >> 8)) +#elif EG_WIN +#define __Clr(r, g, b) __winRGB(b, g, r) #endif +#endif - - -#define __doXerr error_term += dy; \ - if ( error_term >= dx ) { \ - error_term -= dx; \ - basePtr += rowOffset; \ - ymov--; \ - } - - -#define __doYerr error_term += dx; \ - if ( error_term >= dy ) { \ - error_term -= dy; \ - basePtr += xDirection; \ - xmov--; \ - } - -#define __calcClr color = __Clr( R, G, B ); \ - R += dR; \ - G += dG; \ - B += dB; - - -#define __circ( dia, a ) switch ( (dia) ) { \ - case 2: a = "\0\0"; break; \ - case 3: a = "\1\0\1"; break; \ - case 4: a = "\1\0\0\1"; break; \ - case 5: a = "\1\0\0\0\1"; break; \ - case 6: a = "\1\0\0\0\0\1"; break; \ - case 7: a = "\2\1\0\0\0\1\2"; break; \ - case 8: a = "\2\1\0\0\0\0\1\2"; break; \ - case 9: a = "\3\1\1\0\0\0\1\1\3"; break; \ - case 10: a = "\3\1\1\0\0\0\0\1\1\3"; break; \ - case 11: a = "\4\2\1\1\0\0\0\1\1\2\4"; break; \ - case 12: a = "\4\2\1\1\0\0\0\0\1\1\2\4"; break; \ - } - +#define __doXerr \ + error_term += dy; \ + if (error_term >= dx) { \ + error_term -= dx; \ + basePtr += rowOffset; \ + ymov--; \ + } + +#define __doYerr \ + error_term += dx; \ + if (error_term >= dy) { \ + error_term -= dy; \ + basePtr += xDirection; \ + xmov--; \ + } + +#define __calcClr \ + color = __Clr(R, G, B); \ + R += dR; \ + G += dG; \ + B += dB; + +#define __circ(dia, a) \ + switch ((dia)) { \ + case 2: \ + a = "\0\0"; \ + break; \ + case 3: \ + a = "\1\0\1"; \ + break; \ + case 4: \ + a = "\1\0\0\1"; \ + break; \ + case 5: \ + a = "\1\0\0\0\1"; \ + break; \ + case 6: \ + a = "\1\0\0\0\0\1"; \ + break; \ + case 7: \ + a = "\2\1\0\0\0\1\2"; \ + break; \ + case 8: \ + a = "\2\1\0\0\0\0\1\2"; \ + break; \ + case 9: \ + a = "\3\1\1\0\0\0\1\1\3"; \ + break; \ + case 10: \ + a = "\3\1\1\0\0\0\0\1\1\3"; \ + break; \ + case 11: \ + a = "\4\2\1\1\0\0\0\1\1\2\4"; \ + break; \ + case 12: \ + a = "\4\2\1\1\0\0\0\0\1\1\2\4"; \ + break; \ + } #define CLR_INTERP 1 #include "LineXX.cpp" @@ -81,481 +101,481 @@ /* void PixPort::_Line( int sx, int sy, int ex, int ey, long inColor ) { - int xDirection, rowOffset, error_term; - char* basePtr; - int xmov, ymov, dx, dy, t; - - // Clipping: Set the pen loc to a point that's in and stop drawing once/if the pen moves out - if ( sx < 0 || sx > mX || sy < 0 || sy > mY ) { - t = ex; ex = sx; sx = t; - t = ey; ey = sy; sy = t; - } - - // Exit if the start pt is out of bounds (wimpy clipping, eh?) - if ( sx < 0 || sx > mX || sy < 0 || sy > mY ) - return; - - // In Win32, everything's upside down - #if EG_WIN - sy = mY - sy; - ey = mY - ey; - #endif - - dx = ex - sx; - dy = ey - sy; - - // moving left or right? - xmov = dx; - if ( dx < 0 ) { - xmov = -dx; - if ( sx - xmov < 0 ) - xmov = sx; - xDirection = - P_SZ; - dx = -dx; } - else if ( dx > 0 ) { - if ( sx + xmov > mX ) - xmov = mX - sx; - xDirection = P_SZ; } - else - xDirection = 0; - - // moving up or down? - ymov = dy; - if ( dy < 0 ) { - ymov = -dy; - if ( sy - ymov < 0 ) - ymov = sy; - rowOffset = - mBytesPerRow; - dy = -dy; } - else if ( dy > 0 ) { - if ( sy + ymov > mY ) - ymov = mY - sy; - rowOffset = mBytesPerRow; } - else - rowOffset = 0; - - basePtr = mBits + sy * mBytesPerRow + sx * P_SZ; - error_term = 0; - - // Draw the line - if ( dx >= dy ) { - - // Start counting off in x - for ( ; xmov >= 0 && ymov >= 0; xmov-- ) { - - *((PIXTYPE*) basePtr) = inColor; - basePtr += xDirection; - - // Check to see if we need to move the pixelOffset in the y direction. - error_term += dy; - if ( error_term >= dx ) { - error_term -= dx; - basePtr += rowOffset; - ymov--; - } - } } - else { - // Start counting off in y - for ( ; ymov >= 0 && xmov >= 0; ymov-- ) { - - *((PIXTYPE*) basePtr) = inColor; - basePtr += rowOffset; - - // Check to see if we need to move the pixelOffset in the y direction. - error_term += dx; - if ( error_term >= dy ) { - error_term -= dy; - basePtr += xDirection; - xmov--; - } - } - } + int xDirection, rowOffset, error_term; + char* basePtr; + int xmov, ymov, dx, dy, t; + + // Clipping: Set the pen loc to a point that's in and stop drawing +once/if the pen moves out if ( sx < 0 || sx > mX || sy < 0 || sy > mY ) { t = +ex; ex = sx; sx = t; t = ey; ey = sy; sy = t; + } + + // Exit if the start pt is out of bounds (wimpy clipping, eh?) + if ( sx < 0 || sx > mX || sy < 0 || sy > mY ) + return; + + // In Win32, everything's upside down + #if EG_WIN + sy = mY - sy; + ey = mY - ey; + #endif + + dx = ex - sx; + dy = ey - sy; + + // moving left or right? + xmov = dx; + if ( dx < 0 ) { + xmov = -dx; + if ( sx - xmov < 0 ) + xmov = sx; + xDirection = - P_SZ; + dx = -dx; } + else if ( dx > 0 ) { + if ( sx + xmov > mX ) + xmov = mX - sx; + xDirection = P_SZ; } + else + xDirection = 0; + + // moving up or down? + ymov = dy; + if ( dy < 0 ) { + ymov = -dy; + if ( sy - ymov < 0 ) + ymov = sy; + rowOffset = - mBytesPerRow; + dy = -dy; } + else if ( dy > 0 ) { + if ( sy + ymov > mY ) + ymov = mY - sy; + rowOffset = mBytesPerRow; } + else + rowOffset = 0; + + basePtr = mBits + sy * mBytesPerRow + sx * P_SZ; + error_term = 0; + + // Draw the line + if ( dx >= dy ) { + + // Start counting off in x + for ( ; xmov >= 0 && ymov >= 0; xmov-- ) { + + *((PIXTYPE*) basePtr) = inColor; + basePtr += xDirection; + + // Check to see if we need to move the pixelOffset in +the y direction. error_term += dy; if ( error_term >= dx ) { error_term -= dx; + basePtr += rowOffset; + ymov--; + } + } } + else { + // Start counting off in y + for ( ; ymov >= 0 && xmov >= 0; ymov-- ) { + + *((PIXTYPE*) basePtr) = inColor; + basePtr += rowOffset; + + // Check to see if we need to move the pixelOffset in +the y direction. error_term += dx; if ( error_term >= dy ) { error_term -= dy; + basePtr += xDirection; + xmov--; + } + } + } } */ - - /* -void PixPort::_LineW( int sx, int sy, int ex, int ey, int inWidth, long inColor ) { - int xDirection, rowOffset, error_term; - char* basePtr, *rowPtr; - int xmov, ymov, dx, dy, t, i, xDir, yDir; - - // Clipping: Set the pen loc to a point that's in and stop drawing once/if the pen moves out - if ( sx < 0 || sx > mX || sy < 0 || sy > mY ) { - t = ex; ex = sx; sx = t; - t = ey; ey = sy; sy = t; - } - - // Exit if the start pt is out of bounds (wimpy clipping, eh?) - if ( sx < 0 || sx > mX || sy < 0 || sy > mY ) - return; - - // In Win32, everything's upside down - #if EG_WIN - sy = mY - sy; - ey = mY - ey; - #endif - - dx = ex - sx; - dy = ey - sy; - - // moving left or right? - xmov = dx; - if ( dx < 0 ) { - xmov = -dx; - if ( sx - xmov < 0 ) - xmov = sx; - xDirection = - P_SZ; - xDir = -1; - dx = -dx; } - else if ( dx > 0 ) { - if ( sx + xmov > mX ) - xmov = mX - sx; - xDir = 1; - xDirection = P_SZ; } - else { - xDirection = 0; - xDir = 0; - } - - // moving up or down? - ymov = dy; - if ( dy < 0 ) { - ymov = -dy; - if ( sy - ymov < 0 ) - ymov = sy; - yDir = 1; - rowOffset = - mBytesPerRow; - dy = -dy; } - else if ( dy > 0 ) { - if ( sy + ymov > mY ) - ymov = mY - sy; - yDir = -1; - rowOffset = mBytesPerRow; } - else { - yDir = 0; - rowOffset = 0; - } - - - basePtr = mBits + sy * mBytesPerRow + sx * P_SZ; - error_term = 0; - - // Draw the line - if ( dx >= dy ) { - bool didRow = false; - int limx; - if ( xDirection > 0 ) - limx = ex; - else - limx = sx; - if ( limx > mX ) - limx = mX; - - - // Start counting off in x - for ( ; xmov >= 0 && ymov >= 0; xmov-- ) { - - if ( ! didRow ) { - for ( i = 0; i < inWidth && sx + i <= limx; i++ ) { - ((PIXTYPE*) basePtr)[i] = inColor; - } - didRow = true; - } - sx += xDir; - - basePtr += xDirection; - - // Check to see if we need to move the pixelOffset in the y direction. - error_term += dy; - if ( error_term >= dx ) { - error_term -= dx; - - // Finish the rest of the line width, making sure we don't go off the right - didRow = false; - basePtr += rowOffset; - ymov--; - } - } } - else { - - // Start counting off in y - for ( ; ymov >= 0 && xmov >= 0; ymov-- ) { - - // Do the whole line width, making sure we don't go off the right - for ( i = 0; i < inWidth && sx + i < mX; i++ ) - ((PIXTYPE*) basePtr)[i] = inColor; - basePtr += rowOffset; - - // Check to see if we need to move the pixelOffset in the y direction. - error_term += dx; - if ( error_term >= dy ) { - error_term -= dy; - basePtr += xDirection; - xmov--; - sx += xDir; - } - } - } +void PixPort::_LineW( int sx, int sy, int ex, int ey, int inWidth, long inColor +) { int xDirection, rowOffset, error_term; char* basePtr, *rowPtr; int xmov, +ymov, dx, dy, t, i, xDir, yDir; + + // Clipping: Set the pen loc to a point that's in and stop drawing +once/if the pen moves out if ( sx < 0 || sx > mX || sy < 0 || sy > mY ) { t = +ex; ex = sx; sx = t; t = ey; ey = sy; sy = t; + } + + // Exit if the start pt is out of bounds (wimpy clipping, eh?) + if ( sx < 0 || sx > mX || sy < 0 || sy > mY ) + return; + + // In Win32, everything's upside down + #if EG_WIN + sy = mY - sy; + ey = mY - ey; + #endif + + dx = ex - sx; + dy = ey - sy; + + // moving left or right? + xmov = dx; + if ( dx < 0 ) { + xmov = -dx; + if ( sx - xmov < 0 ) + xmov = sx; + xDirection = - P_SZ; + xDir = -1; + dx = -dx; } + else if ( dx > 0 ) { + if ( sx + xmov > mX ) + xmov = mX - sx; + xDir = 1; + xDirection = P_SZ; } + else { + xDirection = 0; + xDir = 0; + } + + // moving up or down? + ymov = dy; + if ( dy < 0 ) { + ymov = -dy; + if ( sy - ymov < 0 ) + ymov = sy; + yDir = 1; + rowOffset = - mBytesPerRow; + dy = -dy; } + else if ( dy > 0 ) { + if ( sy + ymov > mY ) + ymov = mY - sy; + yDir = -1; + rowOffset = mBytesPerRow; } + else { + yDir = 0; + rowOffset = 0; + } + + + basePtr = mBits + sy * mBytesPerRow + sx * P_SZ; + error_term = 0; + + // Draw the line + if ( dx >= dy ) { + bool didRow = false; + int limx; + if ( xDirection > 0 ) + limx = ex; + else + limx = sx; + if ( limx > mX ) + limx = mX; + + + // Start counting off in x + for ( ; xmov >= 0 && ymov >= 0; xmov-- ) { + + if ( ! didRow ) { + for ( i = 0; i < inWidth && sx + i <= limx; i++ +) { + ((PIXTYPE*) basePtr)[i] = inColor; + } + didRow = true; + } + sx += xDir; + + basePtr += xDirection; + + // Check to see if we need to move the pixelOffset in +the y direction. error_term += dy; if ( error_term >= dx ) { error_term -= dx; + + // Finish the rest of the line width, making +sure we don't go off the right didRow = false; basePtr += rowOffset; ymov--; + } + } } + else { + + // Start counting off in y + for ( ; ymov >= 0 && xmov >= 0; ymov-- ) { + + // Do the whole line width, making sure we don't go off +the right for ( i = 0; i < inWidth && sx + i < mX; i++ ) + ((PIXTYPE*) basePtr)[i] = inColor; + basePtr += rowOffset; + + // Check to see if we need to move the pixelOffset in +the y direction. error_term += dx; if ( error_term >= dy ) { error_term -= dy; + basePtr += xDirection; + xmov--; + sx += xDir; + } + } + } }*/ +void PixPort::_EraseRect(const Rect *inRect) { + int32_t width, height; + int x, y; + char *base; + Rect r; + + // Don't let us draw in random parts of memory -- clip inRect + if (inRect) { + r = *inRect; + __clipPt(r.left, r.top) __clipPt(r.right, r.bottom) + } else { + r = mClipRect; + } + + width = r.right - r.left; + height = r.bottom - r.top; + +// In Win32, everything's upside down +#if EG_WIN + r.top = mY - r.bottom; +#endif - -void PixPort::_EraseRect( const Rect* inRect ) { - int32_t width, height; - int x, y; - char* base; - Rect r; - - // Don't let us draw in random parts of memory -- clip inRect - if ( inRect ) { - r = *inRect; - __clipPt( r.left, r.top ) - __clipPt( r.right, r.bottom ) } - else { - r = mClipRect; - } - - width = r.right - r.left; - height = r.bottom - r.top; - - - // In Win32, everything's upside down - #if EG_WIN - r.top = mY - r.bottom; - #endif - - base = mBits + mBytesPerPix * r.left + r.top * mBytesPerRow; - for ( y = 0; y <= height; y++ ) { - for ( x = 0; x <= width; x++ ) { - *((PIXTYPE*) base) = mBackColor; - base += P_SZ; - } - base += mBytesPerRow - P_SZ * (width + 1); - } + base = mBits + mBytesPerPix * r.left + r.top * mBytesPerRow; + for (y = 0; y <= height; y++) { + for (x = 0; x <= width; x++) { + *((PIXTYPE *)base) = mBackColor; + base += P_SZ; + } + base += mBytesPerRow - P_SZ * (width + 1); + } } - - -void PixPort::_CrossBlur( char* inSrce, int inWidth, int inHeight, int inBytesPerRow, unsigned char* inRowBuf ) { - int32_t leftR, leftG, leftB, cenR, cenG, cenB, rightR, rightG, rightB; - int32_t topR, topG, topB, val, botR, botG, botB, x; - unsigned char *rowPos; - - // Init inRowBuf[] - rowPos = inRowBuf; - for ( x = 0; x < inWidth; x++ ) { - val = ((PIXTYPE*) inSrce)[ x ]; - rowPos[ 0 ] = val >> REDSHIFT; - rowPos[ 1 ] = (val >> GRNSHIFT) & COLMASK; - rowPos[ 2 ] = val & COLMASK; - rowPos += 3; - } - - // Go thru row by row in the source img - for ( ; inHeight > 0; inHeight-- ) { - - // Prime the x-loop and get left and cen pixels - val = *((PIXTYPE*) inSrce ); - leftR = cenR = val >> REDSHIFT; - leftG = cenG = (val >> GRNSHIFT) & COLMASK; - leftB = cenB = val & COLMASK; - - rowPos = inRowBuf; - - for ( x = 0; x < inWidth; x++ ) { - - // Get top pixel - topR = rowPos[ 0 ]; - topG = rowPos[ 1 ]; - topB = rowPos[ 2 ]; - - // Get right-most pixel - val = ((PIXTYPE*) inSrce)[ x + 1 ]; - rightR = val >> REDSHIFT; - rightG = (val >> GRNSHIFT) & COLMASK; - rightB = val & COLMASK; - - // Get bottom pixel - val = ((PIXTYPE*) (inSrce + inBytesPerRow))[ x ]; - botR = val >> REDSHIFT; - botG = (val >> GRNSHIFT) & COLMASK; - botB = val & COLMASK; - - *rowPos = cenR; rowPos++; - *rowPos = cenG; rowPos++; - *rowPos = cenB; rowPos++; - - botR = ( ( cenR << 2 ) + 3 * ( leftR + rightR + topR + botR ) ) >> 4; - botG = ( ( cenG << 2 ) + 3 * ( leftG + rightG + topG + botG ) ) >> 4; - botB = ( ( cenB << 2 ) + 3 * ( leftB + rightB + topB + botB ) ) >> 4; - ((PIXTYPE*) inSrce )[ x ] = ( botR << REDSHIFT ) | ( botG << GRNSHIFT ) | botB; - - // Re-use already-fetched memory - leftR = cenR; cenR = rightR; - leftG = cenG; cenG = rightG; - leftB = cenB; cenB = rightB; - } - - inSrce += inBytesPerRow; - } +void PixPort::_CrossBlur(char *inSrce, int inWidth, int inHeight, + int inBytesPerRow, unsigned char *inRowBuf) { + int32_t leftR, leftG, leftB, cenR, cenG, cenB, rightR, rightG, rightB; + int32_t topR, topG, topB, val, botR, botG, botB, x; + unsigned char *rowPos; + + // Init inRowBuf[] + rowPos = inRowBuf; + for (x = 0; x < inWidth; x++) { + val = ((PIXTYPE *)inSrce)[x]; + rowPos[0] = val >> REDSHIFT; + rowPos[1] = (val >> GRNSHIFT) & COLMASK; + rowPos[2] = val & COLMASK; + rowPos += 3; + } + + // Go thru row by row in the source img + for (; inHeight > 0; inHeight--) { + + // Prime the x-loop and get left and cen pixels + val = *((PIXTYPE *)inSrce); + leftR = cenR = val >> REDSHIFT; + leftG = cenG = (val >> GRNSHIFT) & COLMASK; + leftB = cenB = val & COLMASK; + + rowPos = inRowBuf; + + for (x = 0; x < inWidth; x++) { + + // Get top pixel + topR = rowPos[0]; + topG = rowPos[1]; + topB = rowPos[2]; + + // Get right-most pixel + val = ((PIXTYPE *)inSrce)[x + 1]; + rightR = val >> REDSHIFT; + rightG = (val >> GRNSHIFT) & COLMASK; + rightB = val & COLMASK; + + // Get bottom pixel + val = ((PIXTYPE *)(inSrce + inBytesPerRow))[x]; + botR = val >> REDSHIFT; + botG = (val >> GRNSHIFT) & COLMASK; + botB = val & COLMASK; + + *rowPos = cenR; + rowPos++; + *rowPos = cenG; + rowPos++; + *rowPos = cenB; + rowPos++; + + botR = ((cenR << 2) + 3 * (leftR + rightR + topR + botR)) >> 4; + botG = ((cenG << 2) + 3 * (leftG + rightG + topG + botG)) >> 4; + botB = ((cenB << 2) + 3 * (leftB + rightB + topB + botB)) >> 4; + ((PIXTYPE *)inSrce)[x] = (botR << REDSHIFT) | (botG << GRNSHIFT) | botB; + + // Re-use already-fetched memory + leftR = cenR; + cenR = rightR; + leftG = cenG; + cenG = rightG; + leftB = cenB; + cenB = rightB; + } + + inSrce += inBytesPerRow; + } } - - - - - - #define UL uint32_t #define DENOM_SHIFT 14 -void PixPort::_BoxBlur( char* inSrce, char* inDest, int inBoxWidth, int inWidth, int inHeight, int inSrceRowWidth, int inDestRowWidth, uint32_t* b, uint32_t inBackColor ) { - uint32_t* bEnd; - char *dest; - uint32_t b1R, b1G, b1B, b2R, b2G, b2B, b3R, b3G, b3B, val, box9W, i, numerator; - int x, half, useWidth; - - i = inBoxWidth * inBoxWidth * inBoxWidth; - numerator = ( 1 << DENOM_SHIFT ) / ( i ); - box9W = 9 * inBoxWidth; // 3 colors, 3 boxes - bEnd = b + box9W; - - b1R = 0; b1G = 0; b1B = 0; - b2R = 0; b2G = 0; b2B = 0; - b3R = i >> 1; b3G = b3R; b3B = b3R; // round up when > .5 - for ( i = 0; i < box9W; i++ ) { - b[ i ] = 0; - } - - half = 3 * inBoxWidth / 2 - 1; - inSrce += P_SZ * half; - useWidth = inWidth - half - inBoxWidth % 2; - - // Go thru row by row in the source img - for ( ; inHeight > 0; inHeight-- ) { - - // Go thru the row - dest = inDest; - - for ( x = - half - 5; x < inWidth; x++ ) { - - // Maintain the circular buffer - if ( b == bEnd ) - b -= box9W; - - // p = fetch next pix from b1 - if ( x >= 0 && x < useWidth ) { - val = *( (PIXTYPE*) inSrce ); - inSrce += P_SZ; } - else - val = inBackColor; - - // p' += new pix - end pix and store new pix - i = val >> REDSHIFT; b1R += i - b[0]; b[0] = i; - i = (val >> GRNSHIFT) & COLMASK; b1G += i - b[1]; b[1] = i; - i = val & COLMASK; b1B += i - b[2]; b[2] = i; - - // Store the b2's new pix and calc its new pixel - b2R += b1R - b[3]; b[3] = b1R; - b2G += b1G - b[4]; b[4] = b1G; - b2B += b1B - b[5]; b[5] = b1B; - - // Store the b3's new pix and calc its new pixel - b3R += b2R - b[6]; b[6] = b2R; - b3G += b2G - b[7]; b[7] = b2G; - b3B += b2B - b[8]; b[8] = b2B; - - // Transpose the final pixel calculations - if ( x >= 0 ) { - *((PIXTYPE*)dest) = ( (( numerator * b3R ) >> DENOM_SHIFT) << REDSHIFT ) | ( (( numerator * b3G ) >> DENOM_SHIFT) << GRNSHIFT ) | (( numerator * b3B ) >> DENOM_SHIFT); - dest += inDestRowWidth; - } - - // Maintain our circular buffer - b += 9; - - } - - // Do next row - inSrce += inSrceRowWidth - P_SZ * useWidth; - inDest += P_SZ; - } +void PixPort::_BoxBlur(char *inSrce, char *inDest, int inBoxWidth, int inWidth, + int inHeight, int inSrceRowWidth, int inDestRowWidth, + uint32_t *b, uint32_t inBackColor) { + uint32_t *bEnd; + char *dest; + uint32_t b1R, b1G, b1B, b2R, b2G, b2B, b3R, b3G, b3B, val, box9W, i, + numerator; + int x, half, useWidth; + + i = inBoxWidth * inBoxWidth * inBoxWidth; + numerator = (1 << DENOM_SHIFT) / (i); + box9W = 9 * inBoxWidth; // 3 colors, 3 boxes + bEnd = b + box9W; + + b1R = 0; + b1G = 0; + b1B = 0; + b2R = 0; + b2G = 0; + b2B = 0; + b3R = i >> 1; + b3G = b3R; + b3B = b3R; // round up when > .5 + for (i = 0; i < box9W; i++) { + b[i] = 0; + } + + half = 3 * inBoxWidth / 2 - 1; + inSrce += P_SZ * half; + useWidth = inWidth - half - inBoxWidth % 2; + + // Go thru row by row in the source img + for (; inHeight > 0; inHeight--) { + + // Go thru the row + dest = inDest; + + for (x = -half - 5; x < inWidth; x++) { + + // Maintain the circular buffer + if (b == bEnd) + b -= box9W; + + // p = fetch next pix from b1 + if (x >= 0 && x < useWidth) { + val = *((PIXTYPE *)inSrce); + inSrce += P_SZ; + } else + val = inBackColor; + + // p' += new pix - end pix and store new pix + i = val >> REDSHIFT; + b1R += i - b[0]; + b[0] = i; + i = (val >> GRNSHIFT) & COLMASK; + b1G += i - b[1]; + b[1] = i; + i = val & COLMASK; + b1B += i - b[2]; + b[2] = i; + + // Store the b2's new pix and calc its new pixel + b2R += b1R - b[3]; + b[3] = b1R; + b2G += b1G - b[4]; + b[4] = b1G; + b2B += b1B - b[5]; + b[5] = b1B; + + // Store the b3's new pix and calc its new pixel + b3R += b2R - b[6]; + b[6] = b2R; + b3G += b2G - b[7]; + b[7] = b2G; + b3B += b2B - b[8]; + b[8] = b2B; + + // Transpose the final pixel calculations + if (x >= 0) { + *((PIXTYPE *)dest) = (((numerator * b3R) >> DENOM_SHIFT) << REDSHIFT) | + (((numerator * b3G) >> DENOM_SHIFT) << GRNSHIFT) | + ((numerator * b3B) >> DENOM_SHIFT); + dest += inDestRowWidth; + } + + // Maintain our circular buffer + b += 9; + } + + // Do next row + inSrce += inSrceRowWidth - P_SZ * useWidth; + inDest += P_SZ; + } } - - /* this modification to BoxBlur only blurs the x row -void PixPort::_BoxBlur( char* inSrce, char*, int inBoxWidth, int inWidth, int inHeight, int inSrceRowWidth, int, char* b, unsigned long inBackColor ) { - - char *bEnd; - unsigned long b1R, b1G, b1B, b2R, b2G, b2B, b3R, b3G, b3B, val, box9W, i, denom; - int x, half, useWidth; - - - denom = inBoxWidth * inBoxWidth * inBoxWidth; - box9W = 36 * inBoxWidth; // 3 colors, 3 boxes, 4 bytes per long - bEnd = b + box9W; - - b1R = 0; b1G = 0; b1B = 0; - b2R = 0; b2G = 0; b2B = 0; - b3R = 0; b3G = 0; b3B = 0; - for ( i = 0; i < 9 * inBoxWidth; ) { - *((UL*) b + i) = 0; i++; - } - - half = 3 * inBoxWidth / 2 - 1; - inSrce += P_SZ * half; - useWidth = inWidth - half - inBoxWidth % 2; - - // Go thru row by row in the source img - for ( ; inHeight > 0; inHeight-- ) { - - for ( x = - half - 5; x < inWidth; x++ ) { - - // Maintain our circular buffer - if ( b == bEnd ) - b -= box9W; - - // p = fetch next pix from b1 - if ( x >= 0 && x < useWidth ) { - val = *( (PIXTYPE*) inSrce );} - else - val = inBackColor; - - // p' += new pix - end pix and store new pix - i = val >> REDSHIFT; b1R += i - *((UL*)b); *((UL*)b) = i; b += 4; - i = (val >> GRNSHIFT) & COLMASK; b1G += i - *((UL*)b); *((UL*)b) = i; b += 4; - i = val & COLMASK; b1B += i - *((UL*)b); *((UL*)b) = i; b += 4; - - // Store the b2's new pix and calc its new pixel - b2R += b1R - *((UL*)b); *((UL*)b) = b1R; b += 4; - b2G += b1G - *((UL*)b); *((UL*)b) = b1G; b += 4; - b2B += b1B - *((UL*)b); *((UL*)b) = b1B; b += 4; - - // Store the b3's new pix and calc its new pixel - b3R += b2R - *((UL*)b); *((UL*)b) = b2R; b += 4; - b3G += b2G - *((UL*)b); *((UL*)b) = b2G; b += 4; - b3B += b2B - *((UL*)b); *((UL*)b) = b2B; b += 4; - - // Transpose the final pixel calculations - if ( x >= 0 ) { - *((PIXTYPE*)inSrce) = ( (b3R/denom) << REDSHIFT ) | ( ( b3G/denom ) << GRNSHIFT ) | ( b3B/denom ); - inSrce += P_SZ; - } - } - - // Do next row - inSrce += inSrceRowWidth - P_SZ * inWidth; - } +void PixPort::_BoxBlur( char* inSrce, char*, int inBoxWidth, int inWidth, int +inHeight, int inSrceRowWidth, int, char* b, unsigned long inBackColor ) { + + char *bEnd; + unsigned long b1R, b1G, b1B, b2R, b2G, b2B, b3R, b3G, b3B, val, box9W, +i, denom; int x, half, useWidth; + + + denom = inBoxWidth * inBoxWidth * inBoxWidth; + box9W = 36 * inBoxWidth; // 3 colors, 3 boxes, 4 bytes +per long bEnd = b + box9W; + + b1R = 0; b1G = 0; b1B = 0; + b2R = 0; b2G = 0; b2B = 0; + b3R = 0; b3G = 0; b3B = 0; + for ( i = 0; i < 9 * inBoxWidth; ) { + *((UL*) b + i) = 0; i++; + } + + half = 3 * inBoxWidth / 2 - 1; + inSrce += P_SZ * half; + useWidth = inWidth - half - inBoxWidth % 2; + + // Go thru row by row in the source img + for ( ; inHeight > 0; inHeight-- ) { + + for ( x = - half - 5; x < inWidth; x++ ) { + + // Maintain our circular buffer + if ( b == bEnd ) + b -= box9W; + + // p = fetch next pix from b1 + if ( x >= 0 && x < useWidth ) { + val = *( (PIXTYPE*) inSrce );} + else + val = inBackColor; + + // p' += new pix - end pix and store new pix + i = val >> REDSHIFT; +b1R += i - *((UL*)b); *((UL*)b) = i; b += 4; i = (val >> GRNSHIFT) & +COLMASK; b1G += i - *((UL*)b); *((UL*)b) = i; b += 4; i = val +& COLMASK; b1B += i - *((UL*)b); +*((UL*)b) = i; b += 4; + + // Store the b2's new pix and calc its new pixel + b2R += b1R - *((UL*)b); *((UL*)b) = b1R; +b += 4; b2G += b1G - *((UL*)b); *((UL*)b) = b1G; b += 4; b2B += b1B - *((UL*)b); *((UL*)b) = b1B; b += 4; + + // Store the b3's new pix and calc its new pixel + b3R += b2R - *((UL*)b); *((UL*)b) = b2R; +b += 4; b3G += b2G - *((UL*)b); *((UL*)b) = b2G; b += 4; b3B += b2B - *((UL*)b); *((UL*)b) = b2B; b += 4; + + // Transpose the final pixel calculations + if ( x >= 0 ) { + *((PIXTYPE*)inSrce) = ( (b3R/denom) << REDSHIFT +) | ( ( b3G/denom ) << GRNSHIFT ) | ( b3B/denom ); inSrce += P_SZ; + } + } + + // Do next row + inSrce += inSrceRowWidth - P_SZ * inWidth; + } } */ - - #undef PIXTYPE #undef REDSHIFT #undef GRNSHIFT diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/EgOSUtils.cpp b/libvisual-plugins/plugins/actor/gforce/Common/UI/EgOSUtils.cpp index 61d8b2024..e599f2af3 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/EgOSUtils.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/EgOSUtils.cpp @@ -29,726 +29,674 @@ #include #endif +int EgOSUtils::sXdpi = 72; +int EgOSUtils::sYdpi = 72; +long EgOSUtils::sLastCursor = -1; +long EgOSUtils::sLastCursorChange = -1; +CEgFileSpec EgOSUtils::sAppSpec; +char EgOSUtils::sInitialDir[INITAL_DIR_STRLEN + 2]; +XStrList EgOSUtils::sFontList(cDuplicatesAllowed); + +void EgOSUtils::ShowFileErr(const UtilStr *inName, char *inErrMsg, + bool wasReading) { + UtilStr s; + + if (wasReading) + s.Assign("Error reading : "); + else + s.Assign("Error writing : "); + s.Append(inErrMsg); -int EgOSUtils::sXdpi = 72; -int EgOSUtils::sYdpi = 72; -long EgOSUtils::sLastCursor = -1; -long EgOSUtils::sLastCursorChange = -1; -CEgFileSpec EgOSUtils::sAppSpec; -char EgOSUtils::sInitialDir[ INITAL_DIR_STRLEN + 2 ]; -XStrList EgOSUtils::sFontList( cDuplicatesAllowed ); - - - - -void EgOSUtils::ShowFileErr( const UtilStr* inName, char* inErrMsg, bool wasReading ) { - UtilStr s; - - if ( wasReading ) - s.Assign( "Error reading : " ); - else - s.Assign( "Error writing : " ); - s.Append( inErrMsg ); - - #ifdef EG_MAC - s.Insert( 14, "��" ); - #else - s.Insert( 14, "\"\"" ); - #endif +#ifdef EG_MAC + s.Insert(14, "��"); +#else + s.Insert(14, "\"\""); +#endif - s.Insert( 15, inName ); - ShowMsg( s ); + s.Insert(15, inName); + ShowMsg(s); } +void EgOSUtils::ShowFileErr(const UtilStr *inName, CEgErr &inErr, + bool wasReading) { + UtilStr msg; -void EgOSUtils::ShowFileErr( const UtilStr* inName, CEgErr& inErr, bool wasReading ) { - UtilStr msg; - - inErr.GetErrStr( msg ); - ShowFileErr( inName, msg.getCStr(), wasReading ); + inErr.GetErrStr(msg); + ShowFileErr(inName, msg.getCStr(), wasReading); } +void EgOSUtils::ShowFileErr(const CEgFileSpec &inFileSpec, CEgErr &inErr, + bool wasReading) { + UtilStr msg, fileName; - -void EgOSUtils::ShowFileErr( const CEgFileSpec& inFileSpec, CEgErr& inErr, bool wasReading ) { - UtilStr msg, fileName; - - inFileSpec.GetFileName( fileName ); - inErr.GetErrStr( msg ); - ShowFileErr( &fileName, msg.getCStr(), wasReading ); + inFileSpec.GetFileName(fileName); + inErr.GetErrStr(msg); + ShowFileErr(&fileName, msg.getCStr(), wasReading); } +void EgOSUtils::Initialize(void *inModuleInstance) { +#if EG_MAC +#pragma unused(inModuleInstance) + OSStatus status; + FCBPBRec fcbPBRec; + Str255 appName; + FSSpec spec; + fcbPBRec.ioCompletion = nil; + fcbPBRec.ioFCBIndx = 0; + fcbPBRec.ioVRefNum = 0; + fcbPBRec.ioRefNum = ::CurResFile(); + fcbPBRec.ioNamePtr = appName; -void EgOSUtils::Initialize( void* inModuleInstance ) { - - #if EG_MAC - - #pragma unused( inModuleInstance ) - OSStatus status; - FCBPBRec fcbPBRec; - Str255 appName; - FSSpec spec; - - fcbPBRec.ioCompletion = nil; - fcbPBRec.ioFCBIndx = 0; - fcbPBRec.ioVRefNum = 0; - fcbPBRec.ioRefNum = ::CurResFile(); - fcbPBRec.ioNamePtr = appName; - - status = ::PBGetFCBInfoSync(&fcbPBRec); - - ::FSMakeFSSpec(fcbPBRec.ioFCBVRefNum, fcbPBRec.ioFCBParID, appName, &spec ); - sAppSpec.Assign( &spec, 0 ); - #endif + status = ::PBGetFCBInfoSync(&fcbPBRec); - #ifdef EG_WIN - HDC hDC = ::CreateDC( "DISPLAY", 0, 0, 0 ); - if ( hDC ) { - sXdpi = ::GetDeviceCaps( hDC, LOGPIXELSX ); - sYdpi = ::GetDeviceCaps( hDC, LOGPIXELSY ); - ::DeleteDC( hDC ); - } - - char path[ 700 ]; - long len = ::GetModuleFileName( (HINSTANCE) inModuleInstance, path, 699 ); - if ( len ) { - UtilStr fdir( path, len ); - fdir.Keep( fdir.FindLastInstanceOf( '\\' ) ); - sAppSpec.Assign( fdir.getCStr(), 0 ); - } - - - // Init timer accuracy... - ///::timeBeginPeriod( 1 ); + ::FSMakeFSSpec(fcbPBRec.ioFCBVRefNum, fcbPBRec.ioFCBParID, appName, &spec); + sAppSpec.Assign(&spec, 0); +#endif - // Remember the initial dir - ::GetCurrentDirectory( INITAL_DIR_STRLEN, sInitialDir ); - #endif +#ifdef EG_WIN + HDC hDC = ::CreateDC("DISPLAY", 0, 0, 0); + if (hDC) { + sXdpi = ::GetDeviceCaps(hDC, LOGPIXELSX); + sYdpi = ::GetDeviceCaps(hDC, LOGPIXELSY); + ::DeleteDC(hDC); + } + + char path[700]; + long len = ::GetModuleFileName((HINSTANCE)inModuleInstance, path, 699); + if (len) { + UtilStr fdir(path, len); + fdir.Keep(fdir.FindLastInstanceOf('\\')); + sAppSpec.Assign(fdir.getCStr(), 0); + } + + // Init timer accuracy... + ///::timeBeginPeriod( 1 ); + + // Remember the initial dir + ::GetCurrentDirectory(INITAL_DIR_STRLEN, sInitialDir); +#endif - // For mac, sXspi and sYdpi are already correct by default - #ifdef UNIX_X - sXdpi = sYdpi = 75; - #endif +// For mac, sXspi and sYdpi are already correct by default +#ifdef UNIX_X + sXdpi = sYdpi = 75; +#endif } - - - - void EgOSUtils::Shutdown() { - #ifdef UNIX_X -// xpce_CloseGraph(); - #endif - #if EG_WIN - - // Restore the initial dir - ::SetCurrentDirectory( sInitialDir ); +#ifdef UNIX_X + // xpce_CloseGraph(); +#endif +#if EG_WIN - // Init timer accuracy... - //::timeEndPeriod( 1 ); + // Restore the initial dir + ::SetCurrentDirectory(sInitialDir); - #endif + // Init timer accuracy... + //::timeEndPeriod( 1 ); +#endif } +bool EgOSUtils::AskSaveAs(const char *inPrompt, const char *inDefaultName, + CEgFileSpec &outSpec, long inFileType) { + UtilStr inName(inDefaultName); - - - - - -bool EgOSUtils::AskSaveAs( const char* inPrompt, const char* inDefaultName, CEgFileSpec& outSpec, long inFileType ) { - UtilStr inName( inDefaultName ); - - return AskSaveAs( inPrompt, inName, outSpec, inFileType ); + return AskSaveAs(inPrompt, inName, outSpec, inFileType); } - #ifdef EG_ZINC #include #endif +bool EgOSUtils::AskSaveAs(const char *inPrompt, const UtilStr &inDefaultName, + CEgFileSpec &outSpec, long inFileType) { + int doSave = false; + UtilStr prompt(inPrompt); +#ifdef EG_MAC + StandardFileReply reply; + //::UDesktop::Deactivate(); + ::StandardPutFile(prompt.getPasStr(), inDefaultName.getPasStr(), &reply); + //::UDesktop::Activate(); -bool EgOSUtils::AskSaveAs( const char* inPrompt, const UtilStr& inDefaultName, CEgFileSpec& outSpec, long inFileType ) { - int doSave = false; - UtilStr prompt( inPrompt ); - - #ifdef EG_MAC - StandardFileReply reply; - - //::UDesktop::Deactivate(); - ::StandardPutFile( prompt.getPasStr(), inDefaultName.getPasStr(), &reply ); - //::UDesktop::Activate(); - - if (reply.sfGood) { - outSpec.Assign( &reply.sfFile, inFileType ); - doSave = true; - } - #endif - - #if EG_WIN && EG_ZINC - UtilStr defName( inDefaultName ); - - ZafFileDialog fileDialog( 20, 5, 60, 14 ); + if (reply.sfGood) { + outSpec.Assign(&reply.sfFile, inFileType); + doSave = true; + } +#endif - if ( inFileType ) - CEgFileSpec::TypeToExt( defName, inFileType ); +#if EG_WIN && EG_ZINC + UtilStr defName(inDefaultName); - fileDialog.SetFile( defName.getCStr() ); + ZafFileDialog fileDialog(20, 5, 60, 14); - if ( fileDialog.GetFile( ZAF_FILE_DIALOG_SAVEAS ) == S_DLG_OK ) { - doSave = true; - outSpec.Assign( fileDialog.File(), inFileType ); - } - /* - unsigned char c; - UtilStr winFilter; - OPENFILENAME paramBlk; - char pathName[ 601 ]; + if (inFileType) + CEgFileSpec::TypeToExt(defName, inFileType); - inDefaultName.copyTo( pathName, 600 ); + fileDialog.SetFile(defName.getCStr()); - // See page 519 of Vol 5 in Win32 Ref for descrip of the lpstrFilter scheme. - winFilter.Append( "/0*" ); + if (fileDialog.GetFile(ZAF_FILE_DIALOG_SAVEAS) == S_DLG_OK) { + doSave = true; + outSpec.Assign(fileDialog.File(), inFileType); + } +/* +unsigned char c; +UtilStr winFilter; +OPENFILENAME paramBlk; +char pathName[ 601 ]; - // Append the ext mask... - for ( int d = 0; d <= 24; d += 8 ) { // Go thru each byte in ID num - c = ((inFileType << d) >> 24 ); - winFilter.Append( (char) c ); - } - winFilter.Append( (char) 0 ); // Windows exptects an extra NUL to end the filter +inDefaultName.copyTo( pathName, 600 ); - visual_mem_set( ¶mBlk, 0, sizeof(OPENFILENAME) ); - paramBlk.lStructSize = sizeof(OPENFILENAME); - paramBlk.lpstrFilter = winFilter.getCStr(); - paramBlk.lpstrFile = pathName; - paramBlk.nMaxFile = 600; - paramBlk.lpstrTitle = prompt.getCStr(); - if ( ::GetSaveFileName( ¶mBlk ) ) { - outSpec.Assign( pathName ); - doSave = true; - }*/ - #endif +// See page 519 of Vol 5 in Win32 Ref for descrip of the lpstrFilter scheme. +winFilter.Append( "/0*" ); - return doSave; +// Append the ext mask... +for ( int d = 0; d <= 24; d += 8 ) { // Go thru each byte in +ID num c = ((inFileType << d) >> 24 ); winFilter.Append( (char) c ); } +winFilter.Append( (char) 0 ); // Windows +exptects an extra NUL to end the filter + +visual_mem_set( ¶mBlk, 0, sizeof(OPENFILENAME) ); +paramBlk.lStructSize = sizeof(OPENFILENAME); +paramBlk.lpstrFilter = winFilter.getCStr(); +paramBlk.lpstrFile = pathName; +paramBlk.nMaxFile = 600; +paramBlk.lpstrTitle = prompt.getCStr(); +if ( ::GetSaveFileName( ¶mBlk ) ) { + outSpec.Assign( pathName ); + doSave = true; +}*/ +#endif - - - -bool EgOSUtils::AskOpen( const char* inPrompt, CEgFileSpec& outSpec, long inTypeMask ) { - bool didOpen = false; - UtilStr prompt( inPrompt ); - - #ifdef EG_MAC - StandardFileReply macFileReply; - SFTypeList typeList; - - // clear the rec - for ( int i = 0; i < sizeof( macFileReply ); i++ ) - ( (char*) &macFileReply )[ i ] = 0; - - //UDesktop::Deactivate(); - typeList[0] = inTypeMask; - ::StandardGetFile( 0, inTypeMask ? 1 : 0, typeList, &macFileReply ); - //UDesktop::Activate(); - - if ( macFileReply.sfGood ) { - outSpec.Assign( &macFileReply.sfFile ); - didOpen = true; - } - #endif - - #if EG_WIN && EG_ZINC - ZafFileDialog fileDialog( 5, 5, 60, 14 ); - UtilStr str( "*" ); - - if ( inTypeMask ) { - CEgFileSpec::TypeToExt( str, inTypeMask ); - fileDialog.SetFilter( str.getCStr() ); - } - - if ( fileDialog.GetFile( ZAF_FILE_DIALOG_OPEN ) == S_DLG_OK ) { - char path[ 401 ]; - didOpen = true; - - fileDialog.FullPath( path, 400 ); - outSpec.Assign( path ); - } - /* - unsigned char c; - UtilStr winFilter; - OPENFILENAME paramBlk; - char pathName[ 601 ]; - - // See page 519 of Vol 5 in Win32 Ref for descrip of the lpstrFilter scheme. - winFilter.Append( "/0*" ); - - // Append the ext mask... - for ( int d = 0; d <= 24; d += 8 ) { // Go thru each byte in ID num - c = ((inTypeMask << d) >> 24 ); - winFilter.Append( (char) c ); - } - winFilter.Append( (char) 0 ); // Windows exptects an extra NUL to end the filter - - visual_mem_set( ¶mBlk, 0, sizeof(OPENFILENAME) ); - paramBlk.lStructSize = sizeof(OPENFILENAME); - paramBlk.lpstrFilter = winFilter.getCStr(); - paramBlk.lpstrFile = pathName; - paramBlk.nMaxFile = 600; - paramBlk.lpstrTitle = prompt.getCStr(); - if ( ::GetOpenFileName( ¶mBlk ) ) { - outSpec.Assign( pathName ); - didOpen = true; - }*/ - #endif - - return didOpen; + return doSave; } +bool EgOSUtils::AskOpen(const char *inPrompt, CEgFileSpec &outSpec, + long inTypeMask) { + bool didOpen = false; + UtilStr prompt(inPrompt); -bool EgOSUtils::AreYouSure( const UtilStr& inMsg ) { - #ifdef EG_MAC - ::ParamText( inMsg.getPasStr(), "\p", "\p", "\p"); - //UDesktop::Deactivate(); - ans = ::CautionAlert( 2000, 0 ); - //UDesktop::Activate(); +#ifdef EG_MAC + StandardFileReply macFileReply; + SFTypeList typeList; + + // clear the rec + for (int i = 0; i < sizeof(macFileReply); i++) + ((char *)&macFileReply)[i] = 0; + + // UDesktop::Deactivate(); + typeList[0] = inTypeMask; + ::StandardGetFile(0, inTypeMask ? 1 : 0, typeList, &macFileReply); + // UDesktop::Activate(); + + if (macFileReply.sfGood) { + outSpec.Assign(&macFileReply.sfFile); + didOpen = true; + } +#endif - return ans == 1; //answer_Save; - #endif +#if EG_WIN && EG_ZINC + ZafFileDialog fileDialog(5, 5, 60, 14); + UtilStr str("*"); - #ifdef EG_WIN - int ans = ::MessageBox( 0, inMsg.getCStr(), "Examgen Message", MB_ICONEXCLAMATION | MB_YESNO | MB_SETFOREGROUND | MB_TASKMODAL ); - return ans == IDYES; - #endif + if (inTypeMask) { + CEgFileSpec::TypeToExt(str, inTypeMask); + fileDialog.SetFilter(str.getCStr()); + } - return true; -} + if (fileDialog.GetFile(ZAF_FILE_DIALOG_OPEN) == S_DLG_OK) { + char path[401]; + didOpen = true; + fileDialog.FullPath(path, 400); + outSpec.Assign(path); + } +/* +unsigned char c; +UtilStr winFilter; +OPENFILENAME paramBlk; +char pathName[ 601 ]; -bool EgOSUtils::AreYouSure( const char* inMsg ) { - UtilStr msg( inMsg ); +// See page 519 of Vol 5 in Win32 Ref for descrip of the lpstrFilter scheme. +winFilter.Append( "/0*" ); - return AreYouSure( msg ); +// Append the ext mask... +for ( int d = 0; d <= 24; d += 8 ) { // Go thru each byte in +ID num c = ((inTypeMask << d) >> 24 ); winFilter.Append( (char) c ); } +winFilter.Append( (char) 0 ); // Windows +exptects an extra NUL to end the filter + +visual_mem_set( ¶mBlk, 0, sizeof(OPENFILENAME) ); +paramBlk.lStructSize = sizeof(OPENFILENAME); +paramBlk.lpstrFilter = winFilter.getCStr(); +paramBlk.lpstrFile = pathName; +paramBlk.nMaxFile = 600; +paramBlk.lpstrTitle = prompt.getCStr(); +if ( ::GetOpenFileName( ¶mBlk ) ) { + outSpec.Assign( pathName ); + didOpen = true; +}*/ +#endif - - -int EgOSUtils::AskSaveChanges( const char* inName ) { - UtilStr name( inName ); - return AskSaveChanges( name ); + return didOpen; } +bool EgOSUtils::AreYouSure(const UtilStr &inMsg) { +#ifdef EG_MAC + ::ParamText(inMsg.getPasStr(), "\p", "\p", "\p"); + // UDesktop::Deactivate(); + ans = ::CautionAlert(2000, 0); + // UDesktop::Activate(); + return ans == 1; // answer_Save; +#endif -int EgOSUtils::AskSaveChanges( const UtilStr& inName ) { - #ifdef EG_MAC - ::ParamText( inName.getPasStr(), "\p", "\p", "\p" ); - //UDesktop::Deactivate(); - int ans = ::CautionAlert( 2001, 0 ); - //UDesktop::Activate(); +#ifdef EG_WIN + int ans = ::MessageBox(0, inMsg.getCStr(), "Examgen Message", + MB_ICONEXCLAMATION | MB_YESNO | MB_SETFOREGROUND | + MB_TASKMODAL); + return ans == IDYES; +#endif - return 2 - ans; - #endif + return true; +} - #ifdef EG_WIN - UtilStr msg( "Save changes to \"" ); - msg.Append( inName ); - msg.Append( "\" before closing?" ); - ans = ::MessageBox( 0, msg.getCStr(), "Examgen Message", MB_ICONEXCLAMATION | MB_YESNOCANCEL | MB_SETFOREGROUND | MB_TASKMODAL ); - if ( ans == IDYES ) - return 1; - else if ( ans == IDNO ) - return -1; - else - return 0; - #endif +bool EgOSUtils::AreYouSure(const char *inMsg) { + UtilStr msg(inMsg); - return 0; + return AreYouSure(msg); } - -void EgOSUtils::SpinCursor() { - long time = clock(); - - if ( sLastCursorChange == -1 ) - sLastCursorChange = time; - else if ( time - CLOCKS_PER_SEC / 3 > sLastCursorChange ) { // Every 1/3 second... - #ifdef EG_MAC - Handle cursHndl; - sLastCursor = ( sLastCursor + 1 ) % 8; // 8 Cursors - cursHndl = ::GetResource( 'CURS', 6500 + sLastCursor ); // 6500 = Base ID - sLastCursorChange = time; - if ( cursHndl ) - ::SetCursor( (Cursor*) *cursHndl ); - #endif - - #ifdef EG_WIN - SetCursor( ::LoadCursor( 0, IDC_WAIT ) ); - sLastCursor = 1; - #endif - } +int EgOSUtils::AskSaveChanges(const char *inName) { + UtilStr name(inName); + return AskSaveChanges(name); } +int EgOSUtils::AskSaveChanges(const UtilStr &inName) { +#ifdef EG_MAC + ::ParamText(inName.getPasStr(), "\p", "\p", "\p"); + // UDesktop::Deactivate(); + int ans = ::CautionAlert(2001, 0); + // UDesktop::Activate(); + return 2 - ans; +#endif +#ifdef EG_WIN + UtilStr msg("Save changes to \""); + msg.Append(inName); + msg.Append("\" before closing?"); + ans = ::MessageBox(0, msg.getCStr(), "Examgen Message", + MB_ICONEXCLAMATION | MB_YESNOCANCEL | MB_SETFOREGROUND | + MB_TASKMODAL); + if (ans == IDYES) + return 1; + else if (ans == IDNO) + return -1; + else + return 0; +#endif + return 0; +} +void EgOSUtils::SpinCursor() { + long time = clock(); + if (sLastCursorChange == -1) + sLastCursorChange = time; + else if (time - CLOCKS_PER_SEC / 3 > + sLastCursorChange) { // Every 1/3 second... +#ifdef EG_MAC + Handle cursHndl; + sLastCursor = (sLastCursor + 1) % 8; // 8 Cursors + cursHndl = ::GetResource('CURS', 6500 + sLastCursor); // 6500 = Base ID + sLastCursorChange = time; + if (cursHndl) + ::SetCursor((Cursor *)*cursHndl); +#endif +#ifdef EG_WIN + SetCursor(::LoadCursor(0, IDC_WAIT)); + sLastCursor = 1; +#endif + } +} void EgOSUtils::ShowCursor() { - #ifdef EG_MAC - ::ShowCursor(); - ::InitCursor(); - #endif +#ifdef EG_MAC + ::ShowCursor(); + ::InitCursor(); +#endif - #ifdef EG_WIN - ::SetCursor( ::LoadCursor( 0, IDC_ARROW ) ); - while ( ::ShowCursor( true ) < 0 ) { } - #endif +#ifdef EG_WIN + ::SetCursor(::LoadCursor(0, IDC_ARROW)); + while (::ShowCursor(true) < 0) { + } +#endif - sLastCursor = -1; - sLastCursorChange = -1; + sLastCursor = -1; + sLastCursorChange = -1; } - void EgOSUtils::HideCursor() { - #ifdef EG_MAC - ::HideCursor(); - #endif - - #ifdef EG_WIN - while ( ::ShowCursor( false ) >= 0 ) { } - #endif - - sLastCursor = -1; - sLastCursorChange = -1; -} - +#ifdef EG_MAC + ::HideCursor(); +#endif +#ifdef EG_WIN + while (::ShowCursor(false) >= 0) { + } +#endif -bool EgOSUtils::GetNextFile( const CEgFileSpec& folderSpec, CEgFileSpec& outSpec, bool inStartOver, bool inFolders ) { - bool ok; - - #ifdef EG_MAC - static int sLastIndex; - OSErr err; - HFileInfo pb; - FSSpec spec; - long parID; - Str255 str; - - parID = ( (FSSpec*) folderSpec.OSSpec() ) -> parID; - pb.ioVRefNum = ( (FSSpec*) folderSpec.OSSpec() ) -> vRefNum; - pb.ioNamePtr = str; - - if ( inStartOver ) - pb.ioFDirIndex = 1; - else - pb.ioFDirIndex = sLastIndex; - - ok = false; - do { - pb.ioDirID = parID; - err = PBGetCatInfoSync( (CInfoPBRec*) &pb ); - - if ( err == noErr && ( (pb.ioFlFndrInfo.fdFlags & fInvisible) == 0) /*&& pb.ioFlFndrInfo.fdCreator == cEGCreator*/ ) { - ok = ( (pb.ioFlAttrib & ioDirMask ) == 0 ); - if ( inFolders ) - ok = ! ok; - if ( ok ) { - if ( inFolders ) - pb.ioFlParID = pb.ioDirID; - ::FSMakeFSSpec( pb.ioVRefNum, pb.ioFlParID, str, &spec ); - outSpec.Assign( &spec, pb.ioFlFndrInfo.fdType ); - } - } - - pb.ioFDirIndex++; - sLastIndex = pb.ioFDirIndex; - } while ( err == noErr && ! ok ); - - #elif defined(EG_WIN) - - WIN32_FIND_DATA fileData; - static HANDLE hSearch; - UtilStr name; - bool isDir, tryAgain; - - do { - if ( inStartOver ) { - inStartOver = false; - if ( name.getChar( name.length() ) == '\\' ) - name.Trunc( 1 ); - ok = SetCurrentDirectory( name.getCStr() ); - if ( ok ) { - hSearch = ::FindFirstFile( "*.*", &fileData ); - ok = hSearch != INVALID_HANDLE_VALUE; - } } - else - ok = ::FindNextFile( hSearch, &fileData ); - if ( ok ) { - name.Assign( fileData.cFileName ); - isDir = ::GetFileAttributes( fileData.cFileName ) & FILE_ATTRIBUTE_DIRECTORY; - if ( isDir == inFolders ) { - tryAgain = name.compareTo( "." ) == 0 || name.compareTo( ".." ) == 0; - outSpec.Assign( folderSpec ); - if ( isDir ) - name.Append( "\\" ); - outSpec.Rename( name ); } - else - tryAgain = true; - } - } while ( ok && tryAgain ); - - #elif defined(UNIX_X) - - UtilStr name; - bool isDir, tryAgain; - UtilStr fullname; - - static DIR *d = 0; - struct dirent *de; - - ok = true; - do { - if ( inStartOver ) { - if (d != 0) { - closedir(d); - d = 0; - } - inStartOver = false; - name.Assign( (char*) folderSpec.OSSpec() ); - if ( name.getChar( name.length() ) == '/' ) - name.Trunc( 1 ); - d = opendir(name.getCStr()); - if (d == 0) return 0; - } - de = readdir(d); - if (de == 0) return 0; - name.Assign(de->d_name); - struct stat statdata; - fullname.Assign( (char*) folderSpec.OSSpec() ); - if ( fullname.getChar( name.length() ) != '/' ) - fullname.Append( '/' ); - fullname.Append(de->d_name); - if (stat(fullname.getCStr(), &statdata) != 0) - return 0; - if (S_ISDIR(statdata.st_mode)) - isDir = 1; - else - isDir = 0; - - if ( isDir == inFolders ) { - - tryAgain = name.compareTo( "." ) == 0 || name.compareTo( ".." ) == 0; - outSpec.Assign( folderSpec ); - if ( isDir ) - name.Append( "\\" ); - outSpec.Rename( name ); } - else - tryAgain = true; - } while ( ok && tryAgain ); - - #else - - ok = false; - - #endif - - return ok; + sLastCursor = -1; + sLastCursorChange = -1; } +bool EgOSUtils::GetNextFile(const CEgFileSpec &folderSpec, CEgFileSpec &outSpec, + bool inStartOver, bool inFolders) { + bool ok; +#ifdef EG_MAC + static int sLastIndex; + OSErr err; + HFileInfo pb; + FSSpec spec; + long parID; + Str255 str; + + parID = ((FSSpec *)folderSpec.OSSpec())->parID; + pb.ioVRefNum = ((FSSpec *)folderSpec.OSSpec())->vRefNum; + pb.ioNamePtr = str; + + if (inStartOver) + pb.ioFDirIndex = 1; + else + pb.ioFDirIndex = sLastIndex; + + ok = false; + do { + pb.ioDirID = parID; + err = PBGetCatInfoSync((CInfoPBRec *)&pb); + + if (err == noErr && ((pb.ioFlFndrInfo.fdFlags & fInvisible) == + 0) /*&& pb.ioFlFndrInfo.fdCreator == cEGCreator*/) { + ok = ((pb.ioFlAttrib & ioDirMask) == 0); + if (inFolders) + ok = !ok; + if (ok) { + if (inFolders) + pb.ioFlParID = pb.ioDirID; + ::FSMakeFSSpec(pb.ioVRefNum, pb.ioFlParID, str, &spec); + outSpec.Assign(&spec, pb.ioFlFndrInfo.fdType); + } + } + + pb.ioFDirIndex++; + sLastIndex = pb.ioFDirIndex; + } while (err == noErr && !ok); + +#elif defined(EG_WIN) + + WIN32_FIND_DATA fileData; + static HANDLE hSearch; + UtilStr name; + bool isDir, tryAgain; + + do { + if (inStartOver) { + inStartOver = false; + if (name.getChar(name.length()) == '\\') + name.Trunc(1); + ok = SetCurrentDirectory(name.getCStr()); + if (ok) { + hSearch = ::FindFirstFile("*.*", &fileData); + ok = hSearch != INVALID_HANDLE_VALUE; + } + } else + ok = ::FindNextFile(hSearch, &fileData); + if (ok) { + name.Assign(fileData.cFileName); + isDir = + ::GetFileAttributes(fileData.cFileName) & FILE_ATTRIBUTE_DIRECTORY; + if (isDir == inFolders) { + tryAgain = name.compareTo(".") == 0 || name.compareTo("..") == 0; + outSpec.Assign(folderSpec); + if (isDir) + name.Append("\\"); + outSpec.Rename(name); + } else + tryAgain = true; + } + } while (ok && tryAgain); + +#elif defined(UNIX_X) + + UtilStr name; + bool isDir, tryAgain; + UtilStr fullname; + + static DIR *d = 0; + struct dirent *de; + + ok = true; + do { + if (inStartOver) { + if (d != 0) { + closedir(d); + d = 0; + } + inStartOver = false; + name.Assign((char *)folderSpec.OSSpec()); + if (name.getChar(name.length()) == '/') + name.Trunc(1); + d = opendir(name.getCStr()); + if (d == 0) + return 0; + } + de = readdir(d); + if (de == 0) + return 0; + name.Assign(de->d_name); + struct stat statdata; + fullname.Assign((char *)folderSpec.OSSpec()); + if (fullname.getChar(name.length()) != '/') + fullname.Append('/'); + fullname.Append(de->d_name); + if (stat(fullname.getCStr(), &statdata) != 0) + return 0; + if (S_ISDIR(statdata.st_mode)) + isDir = 1; + else + isDir = 0; + + if (isDir == inFolders) { + + tryAgain = name.compareTo(".") == 0 || name.compareTo("..") == 0; + outSpec.Assign(folderSpec); + if (isDir) + name.Append("\\"); + outSpec.Rename(name); + } else + tryAgain = true; + } while (ok && tryAgain); + +#else + + ok = false; +#endif - - - - - + return ok; +} void EgOSUtils::Beep() { - #ifdef EG_MAC - ::SysBeep( 200 ); - #endif +#ifdef EG_MAC + ::SysBeep(200); +#endif - #ifdef EG_WIN - MessageBeep(0); - #endif +#ifdef EG_WIN + MessageBeep(0); +#endif } - long EgOSUtils::CurTimeMS() { - #if EG_WIN - return ::timeGetTime(); - #elif EG_MAC - return ::TickCount() * 16; - #else - struct timeval tv; - struct timezone tz; - tz.tz_minuteswest = 0; - tz.tz_dsttime = 0; - gettimeofday(&tv, &tz); - return ((tv.tv_sec * 1000) & 0x7fffffff) + tv.tv_usec / 1000; - #endif +#if EG_WIN + return ::timeGetTime(); +#elif EG_MAC + return ::TickCount() * 16; +#else + struct timeval tv; + struct timezone tz; + tz.tz_minuteswest = 0; + tz.tz_dsttime = 0; + gettimeofday(&tv, &tz); + return ((tv.tv_sec * 1000) & 0x7fffffff) + tv.tv_usec / 1000; +#endif } +void EgOSUtils::GetMouse(Point &outPt) { -void EgOSUtils::GetMouse( Point& outPt ) { - - #if EG_MAC - ::GetMouse( &outPt ); - ::LocalToGlobal( &outPt ); - #endif +#if EG_MAC + ::GetMouse(&outPt); + ::LocalToGlobal(&outPt); +#endif - #if EG_WIN - POINT p; - ::GetCursorPos( &p ); - outPt.h = p.x; - outPt.v = p.y; - #endif +#if EG_WIN + POINT p; + ::GetCursorPos(&p); + outPt.h = p.x; + outPt.v = p.y; +#endif - #ifdef UNIX_X - int x, y; +#ifdef UNIX_X + int x, y; -// xpce_QueryMouse(&x, &y); // FIXME replace this - x = 0; - y = 0; - outPt.h = x; - outPt.v = y; - #endif + // xpce_QueryMouse(&x, &y); // FIXME replace this + x = 0; + y = 0; + outPt.h = x; + outPt.v = y; +#endif } +void EgOSUtils::ShowMsg(const UtilStr &inMsg) { -void EgOSUtils::ShowMsg( const UtilStr& inMsg ) { - - #ifdef EG_MAC - //UDesktop::Deactivate(); - ::ParamText( inMsg.getPasStr(), "\p", "\p", "\p"); - ::StopAlert( 2002, 0 ); - //#pragma rem back in! - //UDesktop::Activate(); - #endif - - #ifdef EG_WIN - ::MessageBox( 0, inMsg.getCStr(), "Examgen Message", MB_ICONEXCLAMATION | MB_OK | MB_SETFOREGROUND | MB_APPLMODAL ); - //ZafMessageWindow* w = new ZafMessageWindow( "Message", ZAF_EXCLAMATION_ICON, ZAF_DIALOG_OK, ZAF_DIALOG_OK, inMsg.getCStr() ); - //zafWindowManager -> Add( w ); - //w -> Control(); - #endif +#ifdef EG_MAC + // UDesktop::Deactivate(); + ::ParamText(inMsg.getPasStr(), "\p", "\p", "\p"); + ::StopAlert(2002, 0); +// #pragma rem back in! +// UDesktop::Activate(); +#endif +#ifdef EG_WIN + ::MessageBox(0, inMsg.getCStr(), "Examgen Message", + MB_ICONEXCLAMATION | MB_OK | MB_SETFOREGROUND | MB_APPLMODAL); +// ZafMessageWindow* w = new ZafMessageWindow( "Message", ZAF_EXCLAMATION_ICON, +// ZAF_DIALOG_OK, ZAF_DIALOG_OK, inMsg.getCStr() ); zafWindowManager -> Add( w +// ); w -> Control(); +#endif } +void EgOSUtils::ShowMsg(const char *inMsg) { + UtilStr msg(inMsg); - -void EgOSUtils::ShowMsg( const char* inMsg ) { - UtilStr msg( inMsg ); - - ShowMsg( msg ); + ShowMsg(msg); } +long EgOSUtils::Rnd(long min, long max) { + long maxRnd = std::numeric_limits::max(); + long retNum = LV::rand() * (max - min + 1) / maxRnd + min; - -long EgOSUtils::Rnd( long min, long max ) { - long maxRnd = std::numeric_limits::max(); - long retNum = LV::rand() * ( max - min + 1 ) / maxRnd + min; - - if ( retNum >= max ) - return max; - else - return retNum; + if (retNum >= max) + return max; + else + return retNum; } +unsigned long EgOSUtils::RevBytes(unsigned long inNum) { - - -unsigned long EgOSUtils::RevBytes( unsigned long inNum ) { - - - return ( inNum << 24 ) | ( ( inNum & 0xFF00 ) << 8 ) | ( ( inNum & 0xFF0000 ) >> 8 ) | ( inNum >> 24 ); + return (inNum << 24) | ((inNum & 0xFF00) << 8) | ((inNum & 0xFF0000) >> 8) | + (inNum >> 24); } - - -#define __SET_RGB( R, G, B ) \ - if ( R < 0 ) \ - outRGB.red = 0; \ - else if ( R <= 0xFFFF ) \ - outRGB.red = R; \ - else \ - outRGB.red = 0xFFFF; \ - if ( G < 0 ) \ - outRGB.green = 0; \ - else if ( G <= 0xFFFF ) \ - outRGB.green = G; \ - else \ - outRGB.green = 0xFFFF; \ - if ( B < 0 ) \ - outRGB.blue = 0; \ - else if ( B <= 0xFFFF ) \ - outRGB.blue = B; \ - else \ - outRGB.blue = 0xFFFF; \ - break; - - - - - -void EgOSUtils::HSV2RGB( float H, float S, float V, RGBColor& outRGB ) { - - - // H is given on [0, 1] or WRAPPED. S and V are given on [0, 1]. - // RGB are each returned on [0, 1]. - long hexQuadrant, m, n, v; - H = ( H - floor( H ) ) * 6; // Wrap the Hue angle around 1.0, then find quadrant - - hexQuadrant = H; - float f = H - hexQuadrant; - - // Check sat bounds - if ( S < 0 ) - S = 0; - if ( S > 1 ) - S = 1; - - // Check val bounds - if ( V < 0 ) - V = 0; - if ( V > 1 ) - V = 1; - - if ( ! ( hexQuadrant & 1 ) ) - f = 1 - f; // hexQuadrant i is even - - V *= 65535.0; - v = V; - m = V * (1 - S); - n = V * (1 - S * f); - - switch ( hexQuadrant ) { - case 1: __SET_RGB( n, v, m ); - case 2: __SET_RGB( m, v, n ); - case 3: __SET_RGB( m, n, v ); - case 4: __SET_RGB( n, m, v ); - case 5: __SET_RGB( v, m, n ); - default: - __SET_RGB( v, n, m ); - } +#define __SET_RGB(R, G, B) \ + if (R < 0) \ + outRGB.red = 0; \ + else if (R <= 0xFFFF) \ + outRGB.red = R; \ + else \ + outRGB.red = 0xFFFF; \ + if (G < 0) \ + outRGB.green = 0; \ + else if (G <= 0xFFFF) \ + outRGB.green = G; \ + else \ + outRGB.green = 0xFFFF; \ + if (B < 0) \ + outRGB.blue = 0; \ + else if (B <= 0xFFFF) \ + outRGB.blue = B; \ + else \ + outRGB.blue = 0xFFFF; \ + break; + +void EgOSUtils::HSV2RGB(float H, float S, float V, RGBColor &outRGB) { + + // H is given on [0, 1] or WRAPPED. S and V are given on [0, 1]. + // RGB are each returned on [0, 1]. + long hexQuadrant, m, n, v; + H = (H - floor(H)) * 6; // Wrap the Hue angle around 1.0, then find quadrant + + hexQuadrant = H; + float f = H - hexQuadrant; + + // Check sat bounds + if (S < 0) + S = 0; + if (S > 1) + S = 1; + + // Check val bounds + if (V < 0) + V = 0; + if (V > 1) + V = 1; + + if (!(hexQuadrant & 1)) + f = 1 - f; // hexQuadrant i is even + + V *= 65535.0; + v = V; + m = V * (1 - S); + n = V * (1 - S * f); + + switch (hexQuadrant) { + case 1: + __SET_RGB(n, v, m); + case 2: + __SET_RGB(m, v, n); + case 3: + __SET_RGB(m, n, v); + case 4: + __SET_RGB(n, m, v); + case 5: + __SET_RGB(v, m, n); + default: + __SET_RGB(v, n, m); + } } - - /* #define RETURN_HSV(h, w, b) {HSV.H = h; HSV.S = s; HSV.V = v; return HSV;} @@ -756,7 +704,8 @@ void EgOSUtils::HSV2RGB( float H, float S, float V, RGBColor& outRGB ) { #define UNDEFINED -1 -// Theoretically, hue 0 (pure red) is identical to hue 6 in these transforms. Pure +// Theoretically, hue 0 (pure red) is identical to hue 6 in these transforms. +Pure // red always maps to 6 in this implementation. Therefore UNDEFINED can be @@ -814,4 +763,3 @@ HSV_to_RGB( HSVType HSV ) { } */ - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/EgOSUtils.h b/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/EgOSUtils.h index 5876489b5..b1c4aa3ee 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/EgOSUtils.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/EgOSUtils.h @@ -10,104 +10,123 @@ #include #endif -#define INITAL_DIR_STRLEN 502 +#define INITAL_DIR_STRLEN 502 class UtilStr; class CEgFileSpec; class CEgErr; class EgOSUtils { - - - public: - // Call this once at program startup/end!! - // If you're compiling under windows and making a DLL, pass the DLL instance otherwise 0 is fine. - static void Initialize( void* inModuleInstance = 0 ); - static void Shutdown(); - - // Post: Assigns spec info for the next file in the dir specified by . If the directory doesn't exist or there - // aren't any more files, is returned. If a next file is found, is returned and contains a spec to that file. - // If inFolders is true, only folders are retuned - static bool GetNextFile( const CEgFileSpec& folderSpec, CEgFileSpec& outSpec, bool inStartOver, bool inFolders ); - - // After Initialize, these contain the screen pixels per inch - static int sXdpi; - static int sYdpi; - - // Post: This static method will display the given C string in a window with an OK button. - static void ShowMsg( const char* inMsg ); - static void ShowMsg( const UtilStr& inMsg ); - - // Post: Prints in a dialog box with an "OK" button and a "cancel" button. - // is returned if the use selects the "OK" button - static bool AreYouSure( const UtilStr& inMsg ); - static bool AreYouSure( const char* inMsg ); - - // Post: Asks "Save changes to '' before closing?" - // Note: Returns 0 if Cancel button, 1 for OK, and -1 for Don't Save - static int AskSaveChanges( const UtilStr& inName ); - static int AskSaveChanges( const char* inName ); - - // Post: With the file dialog, this prompts the user for a file name, etc. If the func returns , - // contains the file spec the user just entered - static bool AskSaveAs( const char* inPrompt, const UtilStr& inDefaultName, CEgFileSpec& outSpec, long inFileType = 0 ); - static bool AskSaveAs( const char* inPrompt, const char* inDefaultName, CEgFileSpec& outSpec, long inFileType = 0 ); - - // Post: With the file dialog, this prompts the user to select a file.. If the func returns , - // contains the file spec the user just entered. - // Note: Only file of type are visible. Zero means to accept all files types. - static bool AskOpen( const char* inPrompt, CEgFileSpec& outSpec, long inFileType = 0 ); - - // Post: Puts the error message in a message box on the screen, saying - // "Error reading/writing "inName" -- inErrMsg - // determines chooses the word "reading" vs. "writing" - static void ShowFileErr( const UtilStr* inName, CEgErr& inErr, bool wasReading ); - static void ShowFileErr( const UtilStr* inName, char* inErrMsg, bool wasReading ); - static void ShowFileErr( const CEgFileSpec& inFileSpec, CEgErr& inErr, bool wasReading ); - - // Post: Makes the computer beep - static void Beep(); - - - // Pre: Designed to be called continously during a long process. - // Post: Displays a spinning curor after a certain period of time. - static void SpinCursor(); - - // Post: Call this to restore the cursor if it's been altered (ie, after a SpinCursor). - // Note: If This proc is installed in the main event loop, you can call SpinCursor() whenever things are intensive - static void ResetCursor() { if ( sLastCursor >= 0 ) EgOSUtils::ShowCursor(); } - - // Post: Hides/Shows the mouse cursor. - static void ShowCursor(); - static void HideCursor(); - - // Returns the current time in milliseconds since the system start. - static long CurTimeMS(); - - // Returns the global cords of the mouse - static void GetMouse( Point& outPt ); - - // Post: Returns a random number from to , inclusive. - static long Rnd( long min, long max ); - - // Post: Reverses the byte order of the given long - static unsigned long RevBytes( unsigned long inNum ); - - // Is the directory/folder of this app/lib - static CEgFileSpec sAppSpec; - - // Converts a float HSV (each component is 0 to 1) into a 3x16 bit RGB value - // H = .2 == 1.2 == 7.2 == -.8 == -3.8 (ie, H values are 'wrapped') - // S,V = 1.0 == 1.1 == 6.9 - // S,V = 0 == -.1 == -4 - static void HSV2RGB( float H, float S, float V, RGBColor& outRGB ); - - protected: - static XStrList sFontList; - static long sLastCursor; - static long sLastCursorChange; - static char sInitialDir[ INITAL_DIR_STRLEN + 2 ]; +public: + // Call this once at program startup/end!! + // If you're compiling under windows and making a DLL, pass the DLL instance + // otherwise 0 is fine. + static void Initialize(void *inModuleInstance = 0); + static void Shutdown(); + + // Post: Assigns spec info for the next file in the dir specified by + //. If the directory doesn't exist or there aren't any more + //files, is returned. If a next file is found, is returned and + // contains a spec to that file. If inFolders is true, only folders + //are retuned + static bool GetNextFile(const CEgFileSpec &folderSpec, CEgFileSpec &outSpec, + bool inStartOver, bool inFolders); + + // After Initialize, these contain the screen pixels per + //inch + static int sXdpi; + static int sYdpi; + + // Post: This static method will display the given C string in a window + // with an OK button. + static void ShowMsg(const char *inMsg); + static void ShowMsg(const UtilStr &inMsg); + + // Post: Prints in a dialog box with an "OK" button and a + //"cancel" button. is returned if the use selects the "OK" button + static bool AreYouSure(const UtilStr &inMsg); + static bool AreYouSure(const char *inMsg); + + // Post: Asks "Save changes to '' before closing?" + // Note: Returns 0 if Cancel button, 1 for OK, and -1 for Don't + //Save + static int AskSaveChanges(const UtilStr &inName); + static int AskSaveChanges(const char *inName); + + // Post: With the file dialog, this prompts the user for a file name, + //etc. If the func returns , contains the file spec the user + //just entered + static bool AskSaveAs(const char *inPrompt, const UtilStr &inDefaultName, + CEgFileSpec &outSpec, long inFileType = 0); + static bool AskSaveAs(const char *inPrompt, const char *inDefaultName, + CEgFileSpec &outSpec, long inFileType = 0); + + // Post: With the file dialog, this prompts the user to select a file.. + //If the func returns , contains the file spec the user just + //entered. + // Note: Only file of type are visible. Zero means to accept + //all files types. + static bool AskOpen(const char *inPrompt, CEgFileSpec &outSpec, + long inFileType = 0); + + // Post: Puts the error message in a message box on the screen, saying + // "Error reading/writing "inName" -- inErrMsg + // determines chooses the word "reading" vs. + //"writing" + static void ShowFileErr(const UtilStr *inName, CEgErr &inErr, + bool wasReading); + static void ShowFileErr(const UtilStr *inName, char *inErrMsg, + bool wasReading); + static void ShowFileErr(const CEgFileSpec &inFileSpec, CEgErr &inErr, + bool wasReading); + + // Post: Makes the computer beep + static void Beep(); + + // Pre: Designed to be called continously during a long process. + // Post: Displays a spinning curor after a certain period of time. + static void SpinCursor(); + + // Post: Call this to restore the cursor if it's been altered (ie, after + //a SpinCursor). + // Note: If This proc is installed in the main event loop, you can call + //SpinCursor() whenever things are intensive + static void ResetCursor() { + if (sLastCursor >= 0) + EgOSUtils::ShowCursor(); + } + + // Post: Hides/Shows the mouse cursor. + static void ShowCursor(); + static void HideCursor(); + + // Returns the current time in milliseconds since the system start. + static long CurTimeMS(); + + // Returns the global cords of the mouse + static void GetMouse(Point &outPt); + + // Post: Returns a random number from to , inclusive. + static long Rnd(long min, long max); + + // Post: Reverses the byte order of the given long + static unsigned long RevBytes(unsigned long inNum); + + // Is the directory/folder of this app/lib + static CEgFileSpec sAppSpec; + + // Converts a float HSV (each component is 0 to 1) into a 3x16 bit RGB value + // H = .2 == 1.2 == 7.2 == -.8 == -3.8 (ie, H values are 'wrapped') + // S,V = 1.0 == 1.1 == 6.9 + // S,V = 0 == -.1 == -4 + static void HSV2RGB(float H, float S, float V, RGBColor &outRGB); + +protected: + static XStrList sFontList; + static long sLastCursor; + static long sLastCursorChange; + static char sInitialDir[INITAL_DIR_STRLEN + 2]; }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/PixPort.h b/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/PixPort.h index 3ab788b4d..faeed5260 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/PixPort.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/PixPort.h @@ -19,238 +19,245 @@ struct PixPalEntry { }; #endif -enum { - REL_8_ROW = 5, - FIXED_16_ROW = 6 -}; +enum { REL_8_ROW = 5, FIXED_16_ROW = 6 }; class DeltaFieldData { - public: - - //long mNegYExtents; - const char* mField; - //char* mYExtentsBuf; +public: + // long mNegYExtents; + const char *mField; + // char* mYExtentsBuf; }; - - class PixTextStyle { - public: - int32_t mPointSize; - UtilStr mFontName; - int32_t mStyle; - int32_t mDeviceLineHeight; - long mOSFontID; - int32_t mOSStyle; +public: + int32_t mPointSize; + UtilStr mFontName; + int32_t mStyle; + int32_t mDeviceLineHeight; + long mOSFontID; + int32_t mOSStyle; }; -enum PixDrawMode { - SRC_OR, - SRC_BIC, - SRC_XOR -}; +enum PixDrawMode { SRC_OR, SRC_BIC, SRC_XOR }; -#define __Clr8(r,g,b) ( r >> 8 ) -#define __Clr16(r,g,b) ((( ((uint32_t) r) & 0xF800) >> 1) | ((((uint32_t) g) & 0xF800) >> 6) | (((uint32_t) b) >> 11)) +#define __Clr8(r, g, b) (r >> 8) +#define __Clr16(r, g, b) \ + (((((uint32_t)r) & 0xF800) >> 1) | ((((uint32_t)g) & 0xF800) >> 6) | \ + (((uint32_t)b) >> 11)) #if EG_MAC != 0 || defined(UNIX_X) -#define __Clr32(r,g,b) (((r & 0xFF00) << 8) | (g & 0xFF00) | (b >> 8)) +#define __Clr32(r, g, b) (((r & 0xFF00) << 8) | (g & 0xFF00) | (b >> 8)) #elif EG_WIN typedef RGBQUAD PixPalEntry; -#define __Clr32(r,g,b) __winRGB( b, g, r ) +#define __Clr32(r, g, b) __winRGB(b, g, r) #endif -#define __ClrREF( rgb ) __Clr32( rgb.red, rgb.green, rgb.blue ) +#define __ClrREF(rgb) __Clr32(rgb.red, rgb.green, rgb.blue) +/* PixPort is a platform indep drawing world/environment. You set the size of +one using Init() and then execute whatever drawing commands. When the drawing is +complete, CopyBits() copies pixel data from this world to the given destination +OS graphics world. */ +#define PP_PLAIN 0 +#define PP_BOLD 0x1 +#define PP_ITALIC 0x2 +#define PP_UNDERLINE 0x4 -/* PixPort is a platform indep drawing world/environment. You set the size of one using -Init() and then execute whatever drawing commands. When the drawing is complete, CopyBits() -copies pixel data from this world to the given destination OS graphics world. */ - -#define PP_PLAIN 0 -#define PP_BOLD 0x1 -#define PP_ITALIC 0x2 -#define PP_UNDERLINE 0x4 +class PixPort { +public: + // friend class PixPort; + PixPort(); + virtual ~PixPort(); + + // One or the other must be called before a PixPort is used. If inDepth is 0 + // or invalid, the current OS depth is used. Call Deactivate() or Init() to + // exit fullscreen mode. inWin is passed because PixPort may need the window + // that's going fullscreen + void Init(GrafPtr inPort); + void Init(int inWidth, int inHeight, int inDepth = 0); + + // Returns the current bit color depth from Init(). (8, 16, or 32) + int32_t GetDepth() { return mBytesPerPix * 8; } + + // See how many bytes there are per row + int32_t GetRowSize() { return mBytesPerRow; } + + // Sets the background colors (for erase rect and Blur() ) + // Returns the new pixel entry for the given color and this port + // Note: For 8 bit ports, the red 0-2^16 component maps directly to 0-255 + // pixel value + int32_t SetBackColor(const RGBColor &inColor); + int32_t SetBackColor(int32_t inR, int32_t inG, int32_t inB); + + // Blurs the rect given in this image, with a given box filter of size + //(1=no blur) If the dest is 0, the blur is applied to itself + void GaussBlur(int inBoxWidth, const Rect &inRect, void *inDestBits = 0); + + // A different, more primitive blur that doesn't look as good as GaussBlur, + void CrossBlur(const Rect &inRect); + + // Sets the width of the pen + void SetLineWidth(int32_t inWidth); + + // Draw a line. Use GetPortColor() to get a device color for a RGB + void Line(int sx, int sy, int ex, int ey, int32_t inColor); + void Line(int sx, int sy, int ex, int ey, const RGBColor &inS, + const RGBColor &inE); + + // Sets the clip rgn for all drawing operations. 0 for the cliprect means + //to remove all clipping. + void SetClipRect(const Rect *inRect = 0); + void SetClipRect(int32_t inSX, int32_t inSY, int32_t inEX, int32_t inEY); + + // Note: For 8 bit ports, the red 0-2^16 component maps directly to 0-255 + // pixel value + inline int32_t GetPortColor_inline(int32_t inR, int32_t inG, int32_t inB) { + if (mBytesPerPix == 2) + return __Clr16(inR, inG, inB); + else if (mBytesPerPix == 4) + return __Clr32(inB, inG, inR); + else + return __Clr8(inR, inG, inB); + } + + void SetTextMode(PixDrawMode inMode); + void SetTextColor(PixPalEntry &inColor); + void SetTextColor(RGBColor &inColor); + void DrawText(int32_t inX, int32_t inY, UtilStr &inStr) { + DrawText(inX, inY, inStr.getCStr()); + } + void DrawText(int32_t inX, int32_t inY, const char *inStr); + + // See how big some text is going to be... + void TextRect(const char *inStr, int32_t &outWidth, int32_t &outHeight); + + // Set the given rect to the current background color. If no rect is + //specified, the entire port rect is cleared. + void EraseRect(const Rect *inRect = 0); + + // Copies the pixels in a rectangle from this pixel rect to the + //destination. If the port is in fullscreen, inDestWin and inDest are + //ignored. + void CopyBits(unsigned char *inOutVideo, const Rect *inSrce, + const Rect *inDest); + void CopyBits(GrafPtr inDestPort, const Rect *inSrce, const Rect *inDest); + void CopyBits(PixPort &inDestPort, const Rect *inSrce, const Rect *inDest); + + // Gets a port/device color for a given RGB + // Note: For 8 bit ports, the red 0-2^16 component maps directly to 0-255 + // pixel value + int32_t GetPortColor(int32_t inR, int32_t inG, int32_t inB); + inline int32_t GetPortColor(const RGBColor &inColor) { + return GetPortColor(inColor.red, inColor.green, inColor.blue); + } + + // The guts for G-Force... This PixPort must be in 8-bit mode to do + //anything. +#if 0 + void Fade( DeltaFieldData* inGrad ) { Fade( mBits, mBytesPerRow, mX, mY, inGrad ); } +#endif + void Fade(PixPort &inDest, DeltaFieldData *inGrad) { + Fade(mBits, inDest.mBits, mBytesPerRow, mX, mY, (uint32_t *)inGrad->mField); + } + + // When this sprocket is set to 256 colors, you may change the palette it's + //using any time Pre: inColors[].rgb is the RGB of palette entry i. Post: The + //current palette is set to inColors[] If inSysWindow holds an OS window, + //SetPalette will set that particular window to the palette give in inColors + //and force the OS palette to this palette. + void SetPalette(PixPalEntry inPal[256]); + + // Set the given window to this PixPort's palette, assuming that the given + //window already has a matching palette to this PixPort + // This prevents the OS from recalculating palette info if we already know + // the two match. Note: if the given window or this port isn't in 8 bit mode, + // this fcn does nothing. + void PreventActivate(GrafPtr inSysWindow); + + // To draw in a new font, you: + // 1) Call CreateFont() and PixPort will return you a fontID + // 2) Call AssignFont() to set various font characteristic about it + // 3) Call SelectFont() to set it as the current font for subsequent + //text drawing + long CreateFont(); + void AssignFont(long inPixFontID, const char *inFontName, long inSize, + long inStyleFlags = PP_PLAIN); + void SelectFont(long inPixFontID); + + int32_t GetX() { return mX; } + int32_t GetY() { return mY; } + + static char *sTemp; + static int32_t sTempSize; +#if EG_MAC + PixMapHandle GetPixMap() { return mWorld->portPixMap; } +#endif -class PixPort { +#define MAX_LINE_WIDTH 32 +protected: + Rect mClipRect; + int32_t mBytesPerPix; + int32_t mBytesPerRow; + int32_t mX, mY; + int32_t mBackColor; + int32_t mLineWidth; - public: - - //friend class PixPort; - PixPort(); - virtual ~PixPort(); - - - - // One or the other must be called before a PixPort is used. If inDepth is 0 or invalid, - // the current OS depth is used. Call Deactivate() or Init() to exit fullscreen mode. - // inWin is passed because PixPort may need the window that's going fullscreen - void Init( GrafPtr inPort ); - void Init( int inWidth, int inHeight, int inDepth = 0 ); - - - - - // Returns the current bit color depth from Init(). (8, 16, or 32) - int32_t GetDepth(){ return mBytesPerPix * 8; } - - // See how many bytes there are per row - int32_t GetRowSize() { return mBytesPerRow; } - - - // Sets the background colors (for erase rect and Blur() ) - // Returns the new pixel entry for the given color and this port - // Note: For 8 bit ports, the red 0-2^16 component maps directly to 0-255 pixel value - int32_t SetBackColor( const RGBColor& inColor ); - int32_t SetBackColor( int32_t inR, int32_t inG, int32_t inB ); - - // Blurs the rect given in this image, with a given box filter of size (1=no blur) - // If the dest is 0, the blur is applied to itself - void GaussBlur( int inBoxWidth, const Rect& inRect, void* inDestBits = 0 ); - - // A different, more primitive blur that doesn't look as good as GaussBlur, - void CrossBlur( const Rect& inRect ); - - // Sets the width of the pen - void SetLineWidth( int32_t inWidth ); - - // Draw a line. Use GetPortColor() to get a device color for a RGB - void Line( int sx, int sy, int ex, int ey, int32_t inColor ); - void Line( int sx, int sy, int ex, int ey, const RGBColor& inS, const RGBColor& inE ); - - // Sets the clip rgn for all drawing operations. 0 for the cliprect means to remove all clipping. - void SetClipRect( const Rect* inRect = 0 ); - void SetClipRect( int32_t inSX, int32_t inSY, int32_t inEX, int32_t inEY ); - - // Note: For 8 bit ports, the red 0-2^16 component maps directly to 0-255 pixel value - inline int32_t GetPortColor_inline( int32_t inR, int32_t inG, int32_t inB ) { - if ( mBytesPerPix == 2 ) - return __Clr16( inR, inG, inB ); - else if ( mBytesPerPix == 4 ) - return __Clr32( inB, inG, inR ); - else - return __Clr8( inR, inG, inB ); - } - - void SetTextMode( PixDrawMode inMode ); - void SetTextColor( PixPalEntry& inColor ); - void SetTextColor( RGBColor& inColor ); - void DrawText( int32_t inX, int32_t inY, UtilStr& inStr ) { DrawText( inX, inY, inStr.getCStr() ); } - void DrawText( int32_t inX, int32_t inY, const char* inStr ); - - // See how big some text is going to be... - void TextRect( const char* inStr, int32_t& outWidth, int32_t& outHeight ); - - // Set the given rect to the current background color. If no rect is specified, the entire port rect is cleared. - void EraseRect( const Rect* inRect = 0 ); - - // Copies the pixels in a rectangle from this pixel rect to the destination. If the port is in fullscreen, inDestWin and inDest are ignored. - void CopyBits( unsigned char* inOutVideo, const Rect* inSrce, const Rect* inDest ); - void CopyBits( GrafPtr inDestPort, const Rect* inSrce, const Rect* inDest ); - void CopyBits( PixPort& inDestPort, const Rect* inSrce, const Rect* inDest ); - - // Gets a port/device color for a given RGB - // Note: For 8 bit ports, the red 0-2^16 component maps directly to 0-255 pixel value - int32_t GetPortColor( int32_t inR, int32_t inG, int32_t inB ); - inline int32_t GetPortColor( const RGBColor& inColor ) { return GetPortColor( inColor.red, inColor.green, inColor.blue ); } - - // The guts for G-Force... This PixPort must be in 8-bit mode to do anything. -#if 0 - void Fade( DeltaFieldData* inGrad ) { Fade( mBits, mBytesPerRow, mX, mY, inGrad ); } + char *mBits; + + PixMapHandle mBM; + GWorldPtr mWorld; + TempMem mBlurTemp; + + XPtrList mFonts; + long mCurFontID; + int32_t mDeviceLineHeight; + +#if EG_WIN + BITMAPINFO mInfo; #endif - void Fade( PixPort& inDest, DeltaFieldData* inGrad ) { Fade( mBits, inDest.mBits, mBytesPerRow, mX, mY, (uint32_t*) inGrad -> mField ); } - - - // When this sprocket is set to 256 colors, you may change the palette it's using any time - // Pre: inColors[].rgb is the RGB of palette entry i. - // Post: The current palette is set to inColors[] - // If inSysWindow holds an OS window, SetPalette will set that particular window to the palette give in inColors and force the OS palette to this palette. - void SetPalette( PixPalEntry inPal[ 256 ] ); - - // Set the given window to this PixPort's palette, assuming that the given window already has a matching palette to this PixPort - // This prevents the OS from recalculating palette info if we already know the two match. - // Note: if the given window or this port isn't in 8 bit mode, this fcn does nothing. - void PreventActivate( GrafPtr inSysWindow ); - - // To draw in a new font, you: - // 1) Call CreateFont() and PixPort will return you a fontID - // 2) Call AssignFont() to set various font characteristic about it - // 3) Call SelectFont() to set it as the current font for subsequent text drawing - long CreateFont(); - void AssignFont( long inPixFontID, const char* inFontName, long inSize, long inStyleFlags = PP_PLAIN ); - void SelectFont( long inPixFontID ); - - - int32_t GetX() { return mX; } - int32_t GetY() { return mY; } - - - static char* sTemp; - static int32_t sTempSize; - - - #if EG_MAC - PixMapHandle GetPixMap() { return mWorld -> portPixMap; } - #endif - - #define MAX_LINE_WIDTH 32 - - - protected: - - - Rect mClipRect; - int32_t mBytesPerPix; - int32_t mBytesPerRow; - int32_t mX, mY; - int32_t mBackColor; - int32_t mLineWidth; - - char* mBits; - - PixMapHandle mBM; - GWorldPtr mWorld; - - TempMem mBlurTemp; - - XPtrList mFonts; - long mCurFontID; - int32_t mDeviceLineHeight; - - #if EG_WIN - BITMAPINFO mInfo; - #endif - - void Un_Init(); - - void EraseRect8 ( const Rect* inRect ); - void EraseRect16( const Rect* inRect ); - void EraseRect32( const Rect* inRect ); - - static void BoxBlur8 ( char* inSrce, char* inDest, int inBoxWidth, int inWidth, int inHeight, int inSrceRowSize, int inDestRowSize, uint32_t* temp, uint32_t inBackColor ); - static void BoxBlur16( char* inSrce, char* inDest, int inBoxWidth, int inWidth, int inHeight, int inSrceRowSize, int inDestRowSize, uint32_t* temp, uint32_t inBackColor ); - static void BoxBlur32( char* inSrce, char* inDest, int inBoxWidth, int inWidth, int inHeight, int inSrceRowSize, int inDestRowSize, uint32_t* temp, uint32_t inBackColor ); - - static void CrossBlur8 ( char* inSrce, int inWidth, int inHeight, int inBytesPerRow, unsigned char* inRowBuf ); - static void CrossBlur16( char* inSrce, int inWidth, int inHeight, int inBytesPerRow, unsigned char* inRowBuf ); - static void CrossBlur32( char* inSrce, int inWidth, int inHeight, int inBytesPerRow, unsigned char* inRowBuf ); - - void Line8 ( int sx, int sy, int ex, int ey, int32_t inColor ); - void Line16( int sx, int sy, int ex, int ey, int32_t inColor ); - void Line32( int sx, int sy, int ex, int ey, int32_t inColor ); - - - void Line8 ( int sx, int sy, int ex, int ey, int32_t inR, int32_t dR ); - void Line16( int sx, int sy, int ex, int ey, const RGBColor& inS, int32_t dR, int32_t dG, int32_t dB ); - void Line32( int sx, int sy, int ex, int ey, const RGBColor& inS, int32_t dR, int32_t dG, int32_t dB ); - - static void Fade( const char* inSrce, char* inDest, int32_t inBytesPerRow, int32_t inX, int32_t inY, uint32_t* inGrad ); - static void Fade( char* ioPix, int32_t inBytesPerRow, int32_t inX, int32_t inY, DeltaFieldData* inGrad ); + + void Un_Init(); + + void EraseRect8(const Rect *inRect); + void EraseRect16(const Rect *inRect); + void EraseRect32(const Rect *inRect); + + static void BoxBlur8(char *inSrce, char *inDest, int inBoxWidth, int inWidth, + int inHeight, int inSrceRowSize, int inDestRowSize, + uint32_t *temp, uint32_t inBackColor); + static void BoxBlur16(char *inSrce, char *inDest, int inBoxWidth, int inWidth, + int inHeight, int inSrceRowSize, int inDestRowSize, + uint32_t *temp, uint32_t inBackColor); + static void BoxBlur32(char *inSrce, char *inDest, int inBoxWidth, int inWidth, + int inHeight, int inSrceRowSize, int inDestRowSize, + uint32_t *temp, uint32_t inBackColor); + + static void CrossBlur8(char *inSrce, int inWidth, int inHeight, + int inBytesPerRow, unsigned char *inRowBuf); + static void CrossBlur16(char *inSrce, int inWidth, int inHeight, + int inBytesPerRow, unsigned char *inRowBuf); + static void CrossBlur32(char *inSrce, int inWidth, int inHeight, + int inBytesPerRow, unsigned char *inRowBuf); + + void Line8(int sx, int sy, int ex, int ey, int32_t inColor); + void Line16(int sx, int sy, int ex, int ey, int32_t inColor); + void Line32(int sx, int sy, int ex, int ey, int32_t inColor); + + void Line8(int sx, int sy, int ex, int ey, int32_t inR, int32_t dR); + void Line16(int sx, int sy, int ex, int ey, const RGBColor &inS, int32_t dR, + int32_t dG, int32_t dB); + void Line32(int sx, int sy, int ex, int ey, const RGBColor &inS, int32_t dR, + int32_t dG, int32_t dB); + + static void Fade(const char *inSrce, char *inDest, int32_t inBytesPerRow, + int32_t inX, int32_t inY, uint32_t *inGrad); + static void Fade(char *ioPix, int32_t inBytesPerRow, int32_t inX, int32_t inY, + DeltaFieldData *inGrad); }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/ScreenDevice.h b/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/ScreenDevice.h index 6c38f6f38..dc8a8a2e1 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/ScreenDevice.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/ScreenDevice.h @@ -6,8 +6,10 @@ #include "PixPort.h" #endif -// ### If Mac, in your global header, define USE_DRAW_SPROCKETS 1 or USE_DISP_MGR 1 if you want full screeen ability!!! -// ### If Win, in your global header, define USE_DIRECTX 1 if you want full screeen ability!!! +// ### If Mac, in your global header, define USE_DRAW_SPROCKETS 1 or +// USE_DISP_MGR 1 if you want full screeen ability!!! +// ### If Win, in your global header, define USE_DIRECTX 1 if you want full +// screeen ability!!! #if EG_WIN @@ -21,8 +23,6 @@ typedef long LPDIRECTDRAWSURFACE; #endif #endif - - #if EG_MAC #include #include @@ -30,87 +30,80 @@ typedef long LPDIRECTDRAWSURFACE; typedef ColorSpec PixPalEntry; - #if USE_DISP_MGR - #undef USE_DRAW_SPROCKETS - #include "RequestVideo.h" +#undef USE_DRAW_SPROCKETS +#include "RequestVideo.h" #elif USE_DRAW_SPROCKETS - #include +#include #else - typedef long DSpContextReference; - struct DSpContextAttributes { }; +typedef long DSpContextReference; +struct DSpContextAttributes {}; #endif #else #endif - - - -/* An instance of a ScreenDevice represents a structure that can tell +/* An instance of a ScreenDevice represents a structure that can tell a screen device to go into full screen mode. */ class ScreenDevice { - - public: - - // Returns true if EnterFullscreen() can work for any device - //bool FullscreenAvail() { return mCanFullscreen; } - - - ScreenDevice(); - ~ScreenDevice(); - - // Two different ways to obtain a display ID... - // Use the long returned here for EnterFullscreen()... - // Returns the (inDeviceNum)th display ID - static long GetDisplayID( long inDeviceNum ); - // Returns a display ID that contains the given global coordinate - static long GetDisplayID( long inX, long inY ); - - // Returns true if this ScreenDevice is currently fullscreen (ie, if EnterFullscreen has been called) - inline bool IsFullscreen() { return mContextRef != 0; } - - // Use these fcns to enter & exit fullscreen mode. ioSize contains the desired screen size - // on entry and contains the final fullscreen res dimentions upon return. - // inWin expands to fit fullscreen size if in Windows *or* we're no using mac drawsprockets - bool EnterFullscreen( long inDispID, Point& ioSize, int inBitDepth, WindowPtr inWin ); - void ExitFullscreen(); - - // Encase these before using the port returned by GetPort(); - // Be sure this is called before and after *any* of the following calls - GrafPtr BeginFrame(); - void EndFrame(); - - void SetPalette( PixPalEntry inPal[ 256 ] ); - - static long sMinDepth; - static long sOSDepth; - - - protected: - - long mDispID; - long mBitDepth; - GrafPtr mFS_DC; - - #if USE_DRAW_SPROCKETS - DSpContextReference mContextRef; - DSpContextAttributes mContext; - #elif USE_DISP_MGR - GrafPtr mContextRef; - RgnHandle mMenuBarRgn; - long mMenuBarHeight; - #elif EG_WIN - LPDIRECTDRAWSURFACE mContextRef; - LPDIRECTDRAW mDDObj; - LPDIRECTDRAWPALETTE FAR mFS_Palette; - HWND mFS_Win; - #else - long mContextRef; - #endif - - +public: + // Returns true if EnterFullscreen() can work for any device + // bool FullscreenAvail() { return + // mCanFullscreen; } + + ScreenDevice(); + ~ScreenDevice(); + + // Two different ways to obtain a display ID... + // Use the long returned here for EnterFullscreen()... + // Returns the (inDeviceNum)th display ID + static long GetDisplayID(long inDeviceNum); + // Returns a display ID that contains the given global coordinate + static long GetDisplayID(long inX, long inY); + + // Returns true if this ScreenDevice is currently fullscreen (ie, if + // EnterFullscreen has been called) + inline bool IsFullscreen() { return mContextRef != 0; } + + // Use these fcns to enter & exit fullscreen mode. ioSize contains the + // desired screen size on entry and contains the final fullscreen res + // dimentions upon return. inWin expands to fit fullscreen size if in Windows + // *or* we're no using mac drawsprockets + bool EnterFullscreen(long inDispID, Point &ioSize, int inBitDepth, + WindowPtr inWin); + void ExitFullscreen(); + + // Encase these before using the port returned by GetPort(); + // Be sure this is called before and after *any* of the following calls + GrafPtr BeginFrame(); + void EndFrame(); + + void SetPalette(PixPalEntry inPal[256]); + + static long sMinDepth; + static long sOSDepth; + +protected: + long mDispID; + long mBitDepth; + GrafPtr mFS_DC; + +#if USE_DRAW_SPROCKETS + DSpContextReference mContextRef; + DSpContextAttributes mContext; +#elif USE_DISP_MGR + GrafPtr mContextRef; + RgnHandle mMenuBarRgn; + long mMenuBarHeight; +#elif EG_WIN + LPDIRECTDRAWSURFACE mContextRef; + LPDIRECTDRAW mDDObj; + LPDIRECTDRAWPALETTE FAR mFS_Palette; + HWND mFS_Win; +#else + long mContextRef; +#endif }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/SoundInputPort.h b/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/SoundInputPort.h index a1f86bfab..9b4766e65 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/SoundInputPort.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/Headers/SoundInputPort.h @@ -18,75 +18,65 @@ typedef LPWAVEIN SPB; #endif /* enum InputSampleRate { - - SI_44kHz, - SI_22kHz, - SI_11kHz, -};*/ + SI_44kHz, + SI_22kHz, + SI_11kHz, +};*/ -//Keep track of the info needed to record +// Keep track of the info needed to record typedef struct { - SPB recordRec; - Fixed sampleRate; - OSType compression; - //unsigned long totalBytes; - long mNumSampleSkip; - long myA5, - devBuffer, - soundRefNum; - short /*whichBuffer,*/ - numChannels, - sampleSize; - long mBufEnd; - char mInUse; - long mNumSamples; - short mSamples[ 1 ]; + SPB recordRec; + Fixed sampleRate; + OSType compression; + // unsigned long totalBytes; + long mNumSampleSkip; + long myA5, devBuffer, soundRefNum; + short /*whichBuffer,*/ + numChannels, + sampleSize; + long mBufEnd; + char mInUse; + long mNumSamples; + short mSamples[1]; } SoundInputRec; - - -pascal void MyRecInterrupt(SPB* inPB, short* buf, long peak, long size ); - - +pascal void MyRecInterrupt(SPB *inPB, short *buf, long peak, long size); class SoundInput { - - public: - SoundInput(); - virtual ~SoundInput(); - - // How we turn the port on and off. Call StartRecording() before you make calls to GetSamples() or GetSpectrum() - OSErr StartRecording(); - void StopRecording(); - - // Retrieves a sound clip, filling inF[] - // Returns false if the data was not returned - bool GetSamples( short outSamples[], long inN ); - bool GetSamples( float outSamples[], long inN ); - - // Tells the sound input how many samples are thrown away per sample taken. The default value is 0. - void SetSampleSkip( long inNumSamples ) { mParams -> mNumSampleSkip = inNumSamples; } - - // Retrieves a sound clip from the sound in and performs a fourier transform to get a freq spectrum. - // See FourierAnalyzer.h for a description of the params. - // Returns false if the data was not returned - bool GetSpectrum( long inBins, float inBinRange, float outFT[] ); - - - - protected: - FourierAnalyzer mAnalyzer; - UtilStr mParamBuf; - SoundInputRec* mParams; - bool mIsRecording; - - void DimBufSize( long inNumSamples ); - +public: + SoundInput(); + virtual ~SoundInput(); + + // How we turn the port on and off. Call StartRecording() before you make + // calls to GetSamples() or GetSpectrum() + OSErr StartRecording(); + void StopRecording(); + + // Retrieves a sound clip, filling inF[] + // Returns false if the data was not returned + bool GetSamples(short outSamples[], long inN); + bool GetSamples(float outSamples[], long inN); + + // Tells the sound input how many samples are thrown away per sample taken. + // The default value is 0. + void SetSampleSkip(long inNumSamples) { + mParams->mNumSampleSkip = inNumSamples; + } + + // Retrieves a sound clip from the sound in and performs a fourier transform + // to get a freq spectrum. See FourierAnalyzer.h for a description of the + // params. Returns false if the data was not returned + bool GetSpectrum(long inBins, float inBinRange, float outFT[]); + +protected: + FourierAnalyzer mAnalyzer; + UtilStr mParamBuf; + SoundInputRec *mParams; + bool mIsRecording; + + void DimBufSize(long inNumSamples); }; - #endif - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/LineXX.cpp b/libvisual-plugins/plugins/actor/gforce/Common/UI/LineXX.cpp index 363ac313a..b6a84c2b3 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/LineXX.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/LineXX.cpp @@ -1,283 +1,287 @@ #include #include +#if CLR_INTERP +#if P_SZ != 1 +void PixPort::_Line(int sx, int sy, int ex, int ey, const RGBColor &inS, + int32_t dR, int32_t dG, int32_t dB) { +#else +void PixPort::_Line(int sx, int sy, int ex, int ey, int32_t R, int32_t dR) { +#endif +#else +void PixPort::_Line(int sx, int sy, int ex, int ey, int32_t color) { +#endif + int32_t xDirection, rowOffset, error_term; + char *basePtr, *center; + int32_t xmov, ymov, dx, dy, t, j, lw; + int32_t penExtents; + +#if CLR_INTERP + int32_t color; +#if P_SZ != 1 + int32_t R = inS.red; + int32_t G = inS.green; + int32_t B = inS.blue; +#endif +#endif + + // Half the coordinte if it's large (we copy the sign bit in the 2^31 digit) + // To do: use float clipping + sx = (((int32_t)(sx & 0x80000000)) >> 1) | (sx & 0x3FFFFFFF); + ex = (((int32_t)(ex & 0x80000000)) >> 1) | (ex & 0x3FFFFFFF); + sy = (((int32_t)(sy & 0x80000000)) >> 1) | (sy & 0x3FFFFFFF); + ey = (((int32_t)(ey & 0x80000000)) >> 1) | (ey & 0x3FFFFFFF); + + // Modify the line width so that the actual width matches mLineWidth + lw = mLineWidth; + if (mLineWidth > 3) { + dx = ex - sx; + dx = dx * dx; + dy = ey - sy; + dy = dy * dy; + if (dx > 0 && dx >= dy) + lw = 128 + 55 * dy / dx; // 1/cos( atan( x ) ) is about 1+.43*x^2 from 0 + // to 1 (55 == .43 * 128) + else if (dy > 0 && dy > dx) + lw = 128 + 55 * dx / dy; // 1/cos( atan( x ) ) is about 1+.43*x^2 from 0 + // to 1 (55 == .43 * 128) + + if (dx > 0 || dy > 0) + lw = (mLineWidth * lw + 64) >> 7; // Add in order to round up + } + penExtents = lw >> 1; + + // Clipping: Set the pen loc to a point that's in and stop drawing once/if the + // pen moves out + if (sx < mClipRect.left + penExtents || sx >= mClipRect.right - penExtents || + sy < mClipRect.top + penExtents || sy >= mClipRect.bottom - penExtents) { + + // Exit if both points are out of bounds (wimpy clipping, eh?) + if (ex < mClipRect.left + penExtents || + ex >= mClipRect.right - penExtents || ey < mClipRect.top + penExtents || + ey >= mClipRect.bottom - penExtents) + return; + + t = ex; + ex = sx; + sx = t; + t = ey; + ey = sy; + sy = t; #if CLR_INTERP - #if P_SZ != 1 - void PixPort::_Line( int sx, int sy, int ex, int ey, const RGBColor& inS, int32_t dR, int32_t dG, int32_t dB ) { - #else - void PixPort::_Line( int sx, int sy, int ex, int ey, int32_t R, int32_t dR ) { - #endif + R += dR; + dR = -dR; +#if P_SZ != 1 + G += dG; + dG = -dG; + B += dB; + dB = -dB; +#endif +#endif + } + + dx = ex - sx; + dy = ey - sy; + +#if CLR_INTERP && P_SZ != 1 + int32_t len = sqrt(dx * dx + dy * dy) + 1; + dR /= len; + dG /= len; + dB /= len; + color = __Clr(R, G, B); +#elif CLR_INTERP && P_SZ == 1 + int32_t len = sqrt(dx * dx + dy * dy) + 1; + dR /= len; + color = __Clr(R, G, B); +#endif + + // moving left or right? + dx = ex - sx; + xmov = dx; + if (dx < 0) { + xmov = -dx; + if (sx - xmov < mClipRect.left + penExtents) + xmov = sx - (mClipRect.left + penExtents); + xDirection = -P_SZ; + dx = -dx; + } else if (dx > 0) { + if (sx + xmov >= mClipRect.right - penExtents) + xmov = mClipRect.right - penExtents - 1 - sx; + xDirection = P_SZ; + } else + xDirection = 0; + + // moving up or down? + ymov = dy; + if (dy < 0) { + ymov = -dy; + if (sy - ymov < mClipRect.top + penExtents) + ymov = sy - (mClipRect.top + penExtents); + rowOffset = -mBytesPerRow; + dy = -dy; + } else { + if (sy + ymov >= mClipRect.bottom - penExtents) + ymov = mClipRect.bottom - penExtents - sy - 1; + rowOffset = mBytesPerRow; + } + +// In Win32, everything's upside down +#if EG_WIN + sy = mY - sy - 1; + ey = mY - ey - 1; + rowOffset = -rowOffset; +#endif + + basePtr = mBits + sy * mBytesPerRow + sx * P_SZ; + error_term = 0; + + int32_t halfW; + + if (lw > 1) { + + // Make a circle for the pen + int32_t c_x, tw = mLineWidth; + halfW = (tw) >> 1; + + if (tw < 12) { + const char *c_shape; + __circ(tw, c_shape) for (j = 0; j < tw; j++) { + c_x = c_shape[j]; + center = basePtr + (j - halfW) * mBytesPerRow; + for (int k = c_x; k < tw - c_x; k++) { + ((PIXTYPE *)center)[k - halfW] = color; + } + } + } else { + + for (j = 0; j < tw; j++) { + int32_t tmp = j - halfW; + c_x = halfW - ((int32_t)sqrt(halfW * halfW - tmp * tmp)); + center = basePtr + (j - halfW) * mBytesPerRow; + for (int k = c_x; k < tw - c_x; k++) { + ((PIXTYPE *)center)[k - halfW] = color; + } + } + } + + halfW = lw >> 1; + + // Draw the line + if (dx > dy) { + + // Start counting off in x + for (; xmov >= 0 && ymov >= 0; xmov--) { + +#if CLR_INTERP +#if P_SZ == 1 + color = R >> 8; + R += dR; +#else + __calcClr +#endif +#endif + + // Draw the vertical leading edge of the pen + center = basePtr - halfW * mBytesPerRow; + for (j = 0; j < lw; j++) { + *((PIXTYPE *)center) = color; + center += mBytesPerRow; + } + /* + // Draw the horizontal leading edge of the pen + center = basePtr + halfW * ( rowOffset - P_SZ ); + for ( j = 0; j < lw; j++ ) { + *((PIXTYPE*) center) = color; + center += P_SZ; + }*/ + basePtr += xDirection; + + // Check to see if we need to move the pixelOffset in the y direction. + __doXerr + } + } else { + // Start counting off in y + for (; ymov >= 0 && xmov >= 0; ymov--) { + +#if CLR_INTERP +#if P_SZ == 1 + color = R >> 8; + R += dR; #else - void PixPort::_Line( int sx, int sy, int ex, int ey, int32_t color ) { + __calcClr +#endif #endif - int32_t xDirection, rowOffset, error_term; - char* basePtr, *center; - int32_t xmov, ymov, dx, dy, t, j, lw; - int32_t penExtents; - - #if CLR_INTERP - int32_t color; - #if P_SZ != 1 - int32_t R = inS.red; - int32_t G = inS.green; - int32_t B = inS.blue; - #endif - #endif - - // Half the coordinte if it's large (we copy the sign bit in the 2^31 digit) - // To do: use float clipping - sx = ( ( (int32_t) (sx & 0x80000000) ) >> 1 ) | ( sx & 0x3FFFFFFF ); - ex = ( ( (int32_t) (ex & 0x80000000) ) >> 1 ) | ( ex & 0x3FFFFFFF ); - sy = ( ( (int32_t) (sy & 0x80000000) ) >> 1 ) | ( sy & 0x3FFFFFFF ); - ey = ( ( (int32_t) (ey & 0x80000000) ) >> 1 ) | ( ey & 0x3FFFFFFF ); - - // Modify the line width so that the actual width matches mLineWidth - lw = mLineWidth; - if ( mLineWidth > 3 ) { - dx = ex - sx; dx = dx * dx; - dy = ey - sy; dy = dy * dy; - if ( dx > 0 && dx >= dy ) - lw = 128 + 55 * dy / dx; // 1/cos( atan( x ) ) is about 1+.43*x^2 from 0 to 1 (55 == .43 * 128) - else if ( dy > 0 && dy > dx ) - lw = 128 + 55 * dx / dy; // 1/cos( atan( x ) ) is about 1+.43*x^2 from 0 to 1 (55 == .43 * 128) - - if ( dx > 0 || dy > 0 ) - lw = ( mLineWidth * lw + 64 ) >> 7; // Add in order to round up - } - penExtents = lw >> 1; - - - - // Clipping: Set the pen loc to a point that's in and stop drawing once/if the pen moves out - if ( sx < mClipRect.left + penExtents || sx >= mClipRect.right - penExtents || sy < mClipRect.top + penExtents || sy >= mClipRect.bottom - penExtents ) { - - // Exit if both points are out of bounds (wimpy clipping, eh?) - if ( ex < mClipRect.left + penExtents || ex >= mClipRect.right - penExtents || ey < mClipRect.top + penExtents || ey >= mClipRect.bottom - penExtents ) - return; - - t = ex; ex = sx; sx = t; - t = ey; ey = sy; sy = t; - - #if CLR_INTERP - R += dR; dR = -dR; - #if P_SZ != 1 - G += dG; dG = -dG; - B += dB; dB = -dB; - #endif - #endif - - } - - dx = ex - sx; - dy = ey - sy; - - - #if CLR_INTERP && P_SZ != 1 - int32_t len = sqrt( dx * dx + dy * dy ) + 1; - dR /= len; - dG /= len; - dB /= len; - color = __Clr( R, G, B ); - #elif CLR_INTERP && P_SZ == 1 - int32_t len = sqrt( dx * dx + dy * dy ) + 1; - dR /= len; - color = __Clr( R, G, B ); - #endif - - - // moving left or right? - dx = ex - sx; - xmov = dx; - if ( dx < 0 ) { - xmov = -dx; - if ( sx - xmov < mClipRect.left + penExtents ) - xmov = sx - ( mClipRect.left + penExtents ); - xDirection = - P_SZ; - dx = -dx; } - else if ( dx > 0 ) { - if ( sx + xmov >= mClipRect.right - penExtents ) - xmov = mClipRect.right - penExtents - 1 - sx; - xDirection = P_SZ; } - else - xDirection = 0; - - - // moving up or down? - ymov = dy; - if ( dy < 0 ) { - ymov = -dy; - if ( sy - ymov < mClipRect.top + penExtents ) - ymov = sy - ( mClipRect.top + penExtents ); - rowOffset = - mBytesPerRow; - dy = -dy; } - else { - if ( sy + ymov >= mClipRect.bottom - penExtents ) - ymov = mClipRect.bottom - penExtents - sy - 1; - rowOffset = mBytesPerRow; - } - - // In Win32, everything's upside down - #if EG_WIN - sy = mY - sy - 1; - ey = mY - ey - 1; - rowOffset = - rowOffset; - #endif - - - basePtr = mBits + sy * mBytesPerRow + sx * P_SZ; - error_term = 0; - - int32_t halfW; - - if ( lw > 1 ) { - - // Make a circle for the pen - int32_t c_x, tw = mLineWidth; - halfW = ( tw ) >> 1; - - if ( tw < 12 ) { - const char* c_shape; - __circ( tw, c_shape ) - for ( j = 0; j < tw; j++ ) { - c_x = c_shape[ j ]; - center = basePtr + (j-halfW) * mBytesPerRow; - for ( int k = c_x; k < tw - c_x; k++ ){ - ((PIXTYPE*) center)[k-halfW] = color; - } - } } - else { - - for ( j = 0; j < tw; j++ ) { - int32_t tmp = j - halfW; - c_x = halfW - ( ( int32_t ) sqrt( halfW * halfW - tmp * tmp ) ); - center = basePtr + (j-halfW) * mBytesPerRow; - for ( int k = c_x; k < tw - c_x; k++ ){ - ((PIXTYPE*) center)[k-halfW] = color; - } - } - } - - - halfW = lw >> 1; - - // Draw the line - if ( dx > dy ) { - - // Start counting off in x - for ( ; xmov >= 0 && ymov >= 0; xmov-- ) { - - #if CLR_INTERP - #if P_SZ == 1 - color = R >> 8; - R += dR; - #else - __calcClr - #endif - #endif - - // Draw the vertical leading edge of the pen - center = basePtr - halfW * mBytesPerRow; - for ( j = 0; j < lw; j++ ) { - *((PIXTYPE*) center) = color; - center += mBytesPerRow; - } - /* - // Draw the horizontal leading edge of the pen - center = basePtr + halfW * ( rowOffset - P_SZ ); - for ( j = 0; j < lw; j++ ) { - *((PIXTYPE*) center) = color; - center += P_SZ; - }*/ - basePtr += xDirection; - - // Check to see if we need to move the pixelOffset in the y direction. - __doXerr - } } - else { - // Start counting off in y - for ( ; ymov >= 0 && xmov >= 0; ymov-- ) { - - #if CLR_INTERP - #if P_SZ == 1 - color = R >> 8; - R += dR; - #else - __calcClr - #endif - #endif - /* - // Draw the vertical leading edge of the pen - center = basePtr + xDirection * (halfW) - P_SZ - halfW * mBytesPerRow; - for ( j = 0; j < lw; j++ ) { - *((PIXTYPE*) center) = color; - center += mBytesPerRow; - }*/ - // Draw the horizontal leading edge of the pen - center = basePtr - ( halfW ) * P_SZ; - for ( j = 0; j < lw; j++ ) { - *((PIXTYPE*) center) = color; - center += P_SZ; - } - basePtr += rowOffset; - - // Check to see if we need to move the pixelOffset in the y direction. - __doYerr - } - } - - // If line len is 0, we don't need to draw ending pen circle - /* - if ( lw > 3 ) { - if ( dx != 0 || dy != 0 ) { - } - } */ - - } - else { - - // Draw the (single pixel) line - if ( dx >= dy ) { - - // Start counting off in x - for ( ; xmov >= 0 && ymov >= 0; xmov-- ) { - - #if CLR_INTERP - #if P_SZ == 1 - color = R >> 8; - R += dR; - #else - __calcClr - #endif - #endif - - *((PIXTYPE*) basePtr) = color; - - basePtr += xDirection; - - // Check to see if we need to move the pixelOffset in the y direction. - __doXerr - } } - else { - // Start counting off in y - for ( ; ymov >= 0 && xmov >= 0; ymov-- ) { - - #if CLR_INTERP - #if P_SZ == 1 - color = R >> 8; - R += dR; - #else - __calcClr - #endif - #endif - - *((PIXTYPE*) basePtr) = color; - basePtr += rowOffset; - - // Check to see if we need to move the pixelOffset in the y direction. - __doYerr - } - } - } + /* + // Draw the vertical leading edge of the pen + center = basePtr + xDirection * (halfW) - P_SZ - halfW * mBytesPerRow; + for ( j = 0; j < lw; j++ ) { + *((PIXTYPE*) center) = color; + center += mBytesPerRow; + }*/ + // Draw the horizontal leading edge of the pen + center = basePtr - (halfW)*P_SZ; + for (j = 0; j < lw; j++) { + *((PIXTYPE *)center) = color; + center += P_SZ; + } + basePtr += rowOffset; + + // Check to see if we need to move the pixelOffset in the y direction. + __doYerr + } + } + + // If line len is 0, we don't need to draw ending pen circle + /* + if ( lw > 3 ) { + if ( dx != 0 || dy != 0 ) { + } + } */ + + } else { + + // Draw the (single pixel) line + if (dx >= dy) { + + // Start counting off in x + for (; xmov >= 0 && ymov >= 0; xmov--) { + +#if CLR_INTERP +#if P_SZ == 1 + color = R >> 8; + R += dR; +#else + __calcClr +#endif +#endif + + *((PIXTYPE *)basePtr) = color; + + basePtr += xDirection; + + // Check to see if we need to move the pixelOffset in the y direction. + __doXerr + } + } else { + // Start counting off in y + for (; ymov >= 0 && xmov >= 0; ymov--) { + +#if CLR_INTERP +#if P_SZ == 1 + color = R >> 8; + R += dR; +#else + __calcClr +#endif +#endif + + *((PIXTYPE *)basePtr) = color; + basePtr += rowOffset; + // Check to see if we need to move the pixelOffset in the y direction. + __doYerr + } + } + } } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/PixPort.cpp b/libvisual-plugins/plugins/actor/gforce/Common/UI/PixPort.cpp index f5851c4e0..e4fc47335 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/PixPort.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/PixPort.cpp @@ -16,721 +16,659 @@ #include #include +#define __setupPort \ + GDHandle saveDev; \ + GWorldPtr savePort; \ + ::GetGWorld(&savePort, &saveDev); \ + ::SetGWorld(mWorld, 0); - -#define __setupPort GDHandle saveDev; \ - GWorldPtr savePort; \ - ::GetGWorld( &savePort, &saveDev ); \ - ::SetGWorld( mWorld, 0 ); - - -#define __restorePort ::SetGWorld( savePort, saveDev ); - - +#define __restorePort ::SetGWorld(savePort, saveDev); #endif #if EG_WIN == 1 || defined(UNIX_X) - #define __setupPort #define __restorePort #endif - -int32_t PixPort::sTempSize = 0; -char* PixPort::sTemp = 0; - - - - - +int32_t PixPort::sTempSize = 0; +char *PixPort::sTemp = 0; PixPort::PixPort() { - mBM = 0; - mWorld = 0; - mX = 0; - mY = 0; - mLineWidth = 1; - mBackColor = 0; - mBytesPerPix = 0; - mCurFontID = 0; - mDeviceLineHeight = 0; - - #if EG_WIN - mWorld = ::CreateCompatibleDC( 0 ); - mBM = 0; - #endif - - #ifdef UNIX_X - mBits = 0; // So we know if we need to delete it - #endif -} - - - -PixPort::~PixPort() { - PixTextStyle* font; - int i; - - Un_Init(); - - #if EG_WIN - ::SelectObject( mWorld, ::GetStockObject( SYSTEM_FONT ) ); - - // Dealloc HFONTs we made in windows - for ( i = 0; i < mFonts.Count(); i++ ) { - font = (PixTextStyle*) mFonts[ i ]; - ::DeleteObject( (HFONT) font -> mOSFontID ); - } - - if ( mWorld ) - ::DeleteDC( mWorld ); - - // Dealloc the offscreen bitmap we made - if ( mBM ) - ::DeleteObject( mBM ); - #endif - - #if UNIX_X - for ( i = 0; i < mFonts.Count(); i++ ) { - font = (PixTextStyle*) mFonts[ i ]; - mfl_DestroyFont((mfl_font)font->mOSFontID); - } - - #endif - - // Delete any info structures we may have created - for ( i = 0; i < mFonts.Count(); i++ ) { - font = (PixTextStyle*) mFonts[ i ]; - delete font; - } - - if ( sTemp ) { - delete []sTemp; - sTemp = 0; - sTempSize = 0; - } -} - - - - -void PixPort::Un_Init() { - + mBM = 0; + mWorld = 0; + mX = 0; + mY = 0; + mLineWidth = 1; + mBackColor = 0; + mBytesPerPix = 0; + mCurFontID = 0; + mDeviceLineHeight = 0; + +#if EG_WIN + mWorld = ::CreateCompatibleDC(0); + mBM = 0; +#endif - #if EG_MAC - if ( mWorld ) { - ::UnlockPixels( mBM ); - ::DisposeGWorld( mWorld ); - mWorld = 0; - } - #endif - - #ifdef UNIX_X - // Destroy font context - if (mWorld) { - mfl_DestroyContext(mWorld); - mWorld = 0; - } - - // Free buffer - if (mBits) { - delete[] mBits; - mBits = 0; - } - #endif - - // Invalidate the selected text style - mCurFontID = -1; +#ifdef UNIX_X + mBits = 0; // So we know if we need to delete it +#endif } +PixPort::~PixPort() { + PixTextStyle *font; + int i; + Un_Init(); -void PixPort::SetClipRect( const Rect* inRect ) { +#if EG_WIN + ::SelectObject(mWorld, ::GetStockObject(SYSTEM_FONT)); - mClipRect.top = 0; - mClipRect.left = 0; - mClipRect.right = mX; - mClipRect.bottom = mY; + // Dealloc HFONTs we made in windows + for (i = 0; i < mFonts.Count(); i++) { + font = (PixTextStyle *)mFonts[i]; + ::DeleteObject((HFONT)font->mOSFontID); + } - if ( inRect ) - SectRect( inRect, &mClipRect, &mClipRect ); + if (mWorld) + ::DeleteDC(mWorld); - if ( mWorld ) { - __setupPort + // Dealloc the offscreen bitmap we made + if (mBM) + ::DeleteObject(mBM); +#endif - #if EG_MAC - ::ClipRect( &mClipRect ); - #endif +#if UNIX_X + for (i = 0; i < mFonts.Count(); i++) { + font = (PixTextStyle *)mFonts[i]; + mfl_DestroyFont((mfl_font)font->mOSFontID); + } - #if EG_WIN - HRGN rgn = ::CreateRectRgn( mClipRect.left, mClipRect.top, mClipRect.right - 1, mClipRect.bottom - 1 ); - ::SelectObject( mWorld, rgn ); - ::DeleteObject( rgn ); - #endif +#endif - __restorePort - } + // Delete any info structures we may have created + for (i = 0; i < mFonts.Count(); i++) { + font = (PixTextStyle *)mFonts[i]; + delete font; + } + + if (sTemp) { + delete[] sTemp; + sTemp = 0; + sTempSize = 0; + } } +void PixPort::Un_Init() { -void PixPort::SetClipRect( int32_t inSX, int32_t inSY, int32_t inEX, int32_t inEY ) { +#if EG_MAC + if (mWorld) { + ::UnlockPixels(mBM); + ::DisposeGWorld(mWorld); + mWorld = 0; + } +#endif - Rect r; +#ifdef UNIX_X + // Destroy font context + if (mWorld) { + mfl_DestroyContext(mWorld); + mWorld = 0; + } + + // Free buffer + if (mBits) { + delete[] mBits; + mBits = 0; + } +#endif - SetRect( &r, inSX, inSY, inEX, inEY ); - SetClipRect( &r ); + // Invalidate the selected text style + mCurFontID = -1; } +void PixPort::SetClipRect(const Rect *inRect) { + mClipRect.top = 0; + mClipRect.left = 0; + mClipRect.right = mX; + mClipRect.bottom = mY; + if (inRect) + SectRect(inRect, &mClipRect, &mClipRect); + if (mWorld) { + __setupPort +#if EG_MAC + ::ClipRect(&mClipRect); +#endif +#if EG_WIN + HRGN rgn = ::CreateRectRgn(mClipRect.left, mClipRect.top, + mClipRect.right - 1, mClipRect.bottom - 1); + ::SelectObject(mWorld, rgn); + ::DeleteObject(rgn); +#endif + __restorePort + } +} +void PixPort::SetClipRect(int32_t inSX, int32_t inSY, int32_t inEX, + int32_t inEY) { + Rect r; - - - + SetRect(&r, inSX, inSY, inEX, inEY); + SetClipRect(&r); +} /* void PixPort::Init( GrafPtr inPort ) { - Un_Init(); + Un_Init(); - #if EG_MAC - mBM = ( (CGrafPtr) inPort ) -> portPixMap; - mBytesPerRow = (**mBM).rowBytes & 0xFFF; - mBytesPerPix = (**mBM).pixelSize / 8; - mX = (**mBM).bounds.right - (**mBM).bounds.left; - mY = (**mBM).bounds.bottom - (**mBM).bounds.top; - #endif + #if EG_MAC + mBM = ( (CGrafPtr) inPort ) -> portPixMap; + mBytesPerRow = (**mBM).rowBytes & 0xFFF; + mBytesPerPix = (**mBM).pixelSize / 8; + mX = (**mBM).bounds.right - (**mBM).bounds.left; + mY = (**mBM).bounds.bottom - (**mBM).bounds.top; + #endif } */ +void PixPort::Init(int inWidth, int inHeight, int inDepth) { -void PixPort::Init( int inWidth, int inHeight, int inDepth ) { - - if ( inWidth < 0 ) inWidth = 0; - if ( inHeight < 0 ) inHeight = 0; + if (inWidth < 0) + inWidth = 0; + if (inHeight < 0) + inHeight = 0; - // Catch any invalid depth levels. - if ( inDepth != 32 && inDepth != 16 && inDepth != 8 ) - inDepth = ScreenDevice::sOSDepth; + // Catch any invalid depth levels. + if (inDepth != 32 && inDepth != 16 && inDepth != 8) + inDepth = ScreenDevice::sOSDepth; - if ( inDepth < ScreenDevice::sMinDepth ) - inDepth = ScreenDevice::sMinDepth; + if (inDepth < ScreenDevice::sMinDepth) + inDepth = ScreenDevice::sMinDepth; + // If we don't need to do anything, then don't do anything! + if (mWorld && mBytesPerPix * 8 == inDepth && inWidth == mX && inHeight == mY) + return; - // If we don't need to do anything, then don't do anything! - if ( mWorld && mBytesPerPix * 8 == inDepth && inWidth == mX && inHeight == mY ) - return; - - // FIXME BUG again. Maybe we should use DWORD alignment + // FIXME BUG again. Maybe we should use DWORD alignment #if 0 mX = 4 * (( inWidth + 3 ) / 4 ); #endif - mX = inWidth; - mY = inHeight; - - Un_Init(); - - #if EG_MAC - - // Save current draw envir - __setupPort - - Rect r; - ::SetRect( &r, 0, 0, mX, mY+1 ); - ::NewGWorld( &mWorld, inDepth, &r, 0, 0, useTempMem ); - mBM = ::GetGWorldPixMap( mWorld ); - mBytesPerRow = (**mBM).rowBytes & 0xFFF; - mBytesPerPix = (**mBM).pixelSize / 8; - ::LockPixels( mBM ); - mBits = ::GetPixBaseAddr( mBM ); - - __restorePort - - #elif EG_WIN - - // Initialize a bmap info struct - mInfo.bmiHeader.biSize = sizeof( BITMAPINFOHEADER ); - mInfo.bmiHeader.biWidth = mX + 4; - mInfo.bmiHeader.biHeight = mY + 2; - mInfo.bmiHeader.biPlanes = 1; - mInfo.bmiHeader.biBitCount = inDepth; - mInfo.bmiHeader.biCompression = BI_RGB; - mInfo.bmiHeader.biSizeImage = 0; - mInfo.bmiHeader.biXPelsPerMeter = 0; - mInfo.bmiHeader.biYPelsPerMeter = 0; - mInfo.bmiHeader.biClrUsed = 0; - mInfo.bmiHeader.biClrImportant = 0; - - // Tell windows to make a bitmap and give us acess to its pixel data - mBM = ::CreateDIBSection( mWorld, &mInfo, DIB_RGB_COLORS, &mBits, 0, 0 ); - HGDIOBJ oldBM = ::SelectObject( mWorld, mBM ); - if ( oldBM ) - ::DeleteObject( oldBM ); - - BITMAP b; - ::GetObject( mBM, sizeof( BITMAP ), &b ); - mBytesPerRow = b.bmWidthBytes; - mBytesPerPix = b.bmBitsPixel / 8; - - ::SetTextAlign( mWorld, TA_BASELINE | TA_LEFT ); - ::SetBkMode( mWorld, TRANSPARENT ); - - #elif defined(UNIX_X) - // Setup bitmap - mBytesPerRow = mX; - mBytesPerPix = 1; - mBits = new char[mBytesPerRow * (mY + 2)]; - - // Setup font data - mWorld = mfl_CreateContext(mBits, mBytesPerPix * 8, - mBytesPerRow, mX, mY); - #endif - - SetClipRect(); - EraseRect(); -} - - - - - - -#define __clipPt( x, y ) \ - if ( x < mClipRect.left ) \ - x = mClipRect.left; \ - else if ( x > mClipRect.right ) \ - x = mClipRect.right; \ - if ( y < mClipRect.top ) \ - y = mClipRect.top; \ - else if ( y > mClipRect.bottom ) \ - y = mClipRect.bottom; - - - -#define __clipRect( inRect ) \ - Rect r = inRect; \ - __clipPt( r.left, r.top ) \ - __clipPt( r.right, r.bottom ) \ - int32_t width = r.right - r.left; \ - int32_t height = r.bottom - r.top; - - - - - - - + mX = inWidth; + mY = inHeight; + Un_Init(); +#if EG_MAC -int32_t PixPort::GetPortColor( int32_t inR, int32_t inG, int32_t inB ) { - int bitDepth =mBytesPerPix << 3; - - int32_t c; - - if ( inR > 0xFFFF ) inR = 0xFFFF; - if ( inG > 0xFFFF ) inG = 0xFFFF; - if ( inB > 0xFFFF ) inB = 0xFFFF; - if ( inR < 0 ) inR = 0; - if ( inG < 0 ) inG = 0; - if ( inB < 0 ) inB = 0; - - if ( bitDepth == 32 ) - c = __Clr32( inR, inG, inB ); - else if ( bitDepth == 16 ) - c = __Clr16( inR, inG, inB ); - else - c = __Clr8( inR, inG, inB ); + // Save current draw envir + __setupPort + + Rect r; + ::SetRect(&r, 0, 0, mX, mY + 1); + ::NewGWorld(&mWorld, inDepth, &r, 0, 0, useTempMem); + mBM = ::GetGWorldPixMap(mWorld); + mBytesPerRow = (**mBM).rowBytes & 0xFFF; + mBytesPerPix = (**mBM).pixelSize / 8; + ::LockPixels(mBM); + mBits = ::GetPixBaseAddr(mBM); + + __restorePort + +#elif EG_WIN + + // Initialize a bmap info struct + mInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + mInfo.bmiHeader.biWidth = mX + 4; + mInfo.bmiHeader.biHeight = mY + 2; + mInfo.bmiHeader.biPlanes = 1; + mInfo.bmiHeader.biBitCount = inDepth; + mInfo.bmiHeader.biCompression = BI_RGB; + mInfo.bmiHeader.biSizeImage = 0; + mInfo.bmiHeader.biXPelsPerMeter = 0; + mInfo.bmiHeader.biYPelsPerMeter = 0; + mInfo.bmiHeader.biClrUsed = 0; + mInfo.bmiHeader.biClrImportant = 0; + + // Tell windows to make a bitmap and give us acess to its pixel data + mBM = ::CreateDIBSection(mWorld, &mInfo, DIB_RGB_COLORS, &mBits, 0, 0); + HGDIOBJ oldBM = ::SelectObject(mWorld, mBM); + if (oldBM) + ::DeleteObject(oldBM); + + BITMAP b; + ::GetObject(mBM, sizeof(BITMAP), &b); + mBytesPerRow = b.bmWidthBytes; + mBytesPerPix = b.bmBitsPixel / 8; + + ::SetTextAlign(mWorld, TA_BASELINE | TA_LEFT); + ::SetBkMode(mWorld, TRANSPARENT); + +#elif defined(UNIX_X) + // Setup bitmap + mBytesPerRow = mX; + mBytesPerPix = 1; + mBits = new char[mBytesPerRow * (mY + 2)]; + + // Setup font data + mWorld = mfl_CreateContext(mBits, mBytesPerPix * 8, mBytesPerRow, mX, mY); +#endif - return c; + SetClipRect(); + EraseRect(); } - - - - -int32_t PixPort::SetBackColor( const RGBColor& RGB ) { - - mBackColor = GetPortColor( RGB ); - - return mBackColor; +#define __clipPt(x, y) \ + if (x < mClipRect.left) \ + x = mClipRect.left; \ + else if (x > mClipRect.right) \ + x = mClipRect.right; \ + if (y < mClipRect.top) \ + y = mClipRect.top; \ + else if (y > mClipRect.bottom) \ + y = mClipRect.bottom; + +#define __clipRect(inRect) \ + Rect r = inRect; \ + __clipPt(r.left, r.top) __clipPt(r.right, r.bottom) int32_t width = \ + r.right - r.left; \ + int32_t height = r.bottom - r.top; + +int32_t PixPort::GetPortColor(int32_t inR, int32_t inG, int32_t inB) { + int bitDepth = mBytesPerPix << 3; + + int32_t c; + + if (inR > 0xFFFF) + inR = 0xFFFF; + if (inG > 0xFFFF) + inG = 0xFFFF; + if (inB > 0xFFFF) + inB = 0xFFFF; + if (inR < 0) + inR = 0; + if (inG < 0) + inG = 0; + if (inB < 0) + inB = 0; + + if (bitDepth == 32) + c = __Clr32(inR, inG, inB); + else if (bitDepth == 16) + c = __Clr16(inR, inG, inB); + else + c = __Clr8(inR, inG, inB); + + return c; } +int32_t PixPort::SetBackColor(const RGBColor &RGB) { -int32_t PixPort::SetBackColor( int32_t inR, int32_t inG, int32_t inB ) { - mBackColor = GetPortColor( inR, inG, inB ); + mBackColor = GetPortColor(RGB); - return mBackColor; + return mBackColor; } +int32_t PixPort::SetBackColor(int32_t inR, int32_t inG, int32_t inB) { + mBackColor = GetPortColor(inR, inG, inB); -void PixPort::SetPalette( PixPalEntry inPal[ 256 ] ) { - - if ( mBytesPerPix != 1 ) - return; - - #if EG_WIN - ::SetDIBColorTable( mWorld, 0, 256, inPal ); - #endif - - - #if EG_MAC - CTabHandle myTable = (**mBM).pmTable; - - ::BlockMove( inPal, (**myTable).ctTable, 256 * sizeof( ColorSpec ) ); - ::CTabChanged( myTable ); - #endif - - #ifdef UNIX_X - #endif + return mBackColor; } +void PixPort::SetPalette(PixPalEntry inPal[256]) { -void PixPort::PreventActivate( GrafPtr inSysWindow ) { - - #if EG_MAC + if (mBytesPerPix != 1) + return; - if ( mBytesPerPix != 1 ) - return; +#if EG_WIN + ::SetDIBColorTable(mWorld, 0, 256, inPal); +#endif - /* - #if USE_DISP_MGR - if ( ! inSysWindow ) - inSysWindow = (GrafPort*) mContextRef; - #endif */ +#if EG_MAC + CTabHandle myTable = (**mBM).pmTable; - // Below prevents MacOS from reindexing the colors in our GWorld during CopyBits, thinking the colors in our GWorld - // index to the standard system colors. It's a hack, but then again, so is MacOS 8.x - CTabHandle myTable = (**mBM).pmTable; - if ( inSysWindow ) { - (**myTable).ctSeed = (**(*((CGrafPort* ) inSysWindow) -> portPixMap) -> pmTable).ctSeed; - } + ::BlockMove(inPal, (**myTable).ctTable, 256 * sizeof(ColorSpec)); + ::CTabChanged(myTable); +#endif - #endif +#ifdef UNIX_X +#endif } +void PixPort::PreventActivate(GrafPtr inSysWindow) { -void PixPort::GaussBlur( int inBoxWidth, const Rect& inRect, void* inDestBits ) { - - // Don't let us draw in random parts of memory -- clip inRect - __clipRect( inRect ) - - - if ( inBoxWidth <= 1 ) - return; - - // In Win32, everything's upside down - #if EG_WIN - r.top = mY - r.bottom; - #endif - - // 3 box convolutions, 3 colors per pixel, 4 bytes per color - int32_t boxTempSize = 36 * inBoxWidth; - char* tempBits = 0; - uint32_t* boxTemp; - int32_t imgOffset = mBytesPerPix * r.left + r.top * mBytesPerRow; - int32_t bytesNeeded = mBytesPerRow * (mY + 2) + boxTempSize; - +#if EG_MAC - // Resort to app's heap for temp mem if failed temp mem attempt or in win32 - tempBits = mBlurTemp.Dim( bytesNeeded ); + if (mBytesPerPix != 1) + return; - // Have the box temp and the pixel temp rgns use the same handle - boxTemp = (uint32_t*) tempBits; - tempBits += boxTempSize; + /* + #if USE_DISP_MGR + if ( ! inSysWindow ) + inSysWindow = (GrafPort*) mContextRef; + #endif */ - if ( ! inDestBits ) - inDestBits = mBits; + // Below prevents MacOS from reindexing the colors in our GWorld during + // CopyBits, thinking the colors in our GWorld index to the standard system + // colors. It's a hack, but then again, so is MacOS 8.x + CTabHandle myTable = (**mBM).pmTable; + if (inSysWindow) { + (**myTable).ctSeed = + (**(*((CGrafPort *)inSysWindow)->portPixMap)->pmTable).ctSeed; + } - // Do a box blur on the x axis, transposing the source rgn to the dest rgn - // Then o a box blur on the transposed image, effectively blurring the y cords, transposing it to the dest - if ( mBytesPerPix == 2 ) { - BoxBlur16( ( mBits + imgOffset), tempBits, inBoxWidth, width, height, mBytesPerRow, mBytesPerPix*height, boxTemp, mBackColor ); - BoxBlur16( tempBits, ((char*) inDestBits + imgOffset), inBoxWidth, height, width, mBytesPerPix*height, mBytesPerRow, boxTemp, mBackColor ); } - else if ( mBytesPerPix == 4 ) { - BoxBlur32( ( mBits + imgOffset), tempBits, inBoxWidth, width, height, mBytesPerRow, mBytesPerPix*height, boxTemp, mBackColor ); - BoxBlur32( tempBits, ((char*) inDestBits + imgOffset), inBoxWidth, height, width, mBytesPerPix*height, mBytesPerRow, boxTemp, mBackColor ); - } +#endif } +void PixPort::GaussBlur(int inBoxWidth, const Rect &inRect, void *inDestBits) { + // Don't let us draw in random parts of memory -- clip inRect + __clipRect(inRect) -void PixPort::CrossBlur( const Rect& inRect ) { + if (inBoxWidth <= 1) return; - // Don't let us draw in random parts of memory -- clip inRect - __clipRect( inRect ) +// In Win32, everything's upside down +#if EG_WIN + r.top = mY - r.bottom; +#endif + // 3 box convolutions, 3 colors per pixel, 4 bytes per color + int32_t boxTempSize = 36 * inBoxWidth; + char *tempBits = 0; + uint32_t *boxTemp; + int32_t imgOffset = mBytesPerPix * r.left + r.top * mBytesPerRow; + int32_t bytesNeeded = mBytesPerRow * (mY + 2) + boxTempSize; + + // Resort to app's heap for temp mem if failed temp mem attempt or in win32 + tempBits = mBlurTemp.Dim(bytesNeeded); + + // Have the box temp and the pixel temp rgns use the same handle + boxTemp = (uint32_t *)tempBits; + tempBits += boxTempSize; + + if (!inDestBits) + inDestBits = mBits; + + // Do a box blur on the x axis, transposing the source rgn to the dest rgn + // Then o a box blur on the transposed image, effectively blurring the y + // cords, transposing it to the dest + if (mBytesPerPix == 2) { + BoxBlur16((mBits + imgOffset), tempBits, inBoxWidth, width, height, + mBytesPerRow, mBytesPerPix * height, boxTemp, mBackColor); + BoxBlur16(tempBits, ((char *)inDestBits + imgOffset), inBoxWidth, height, + width, mBytesPerPix * height, mBytesPerRow, boxTemp, mBackColor); + } else if (mBytesPerPix == 4) { + BoxBlur32((mBits + imgOffset), tempBits, inBoxWidth, width, height, + mBytesPerRow, mBytesPerPix * height, boxTemp, mBackColor); + BoxBlur32(tempBits, ((char *)inDestBits + imgOffset), inBoxWidth, height, + width, mBytesPerPix * height, mBytesPerRow, boxTemp, mBackColor); + } +} - // In Win32, everything's upside down - #if EG_WIN - r.top = mY - r.bottom; - #endif +void PixPort::CrossBlur(const Rect &inRect) { - // 3 box convolutions, 3 colors per pixel, 4 bytes per color - int32_t imgOffset = mBytesPerPix * r.left + r.top * mBytesPerRow; + // Don't let us draw in random parts of memory -- clip inRect + __clipRect(inRect) - unsigned char* tempBits = (unsigned char*) mBlurTemp.Dim( mX * 3 ); +// In Win32, everything's upside down +#if EG_WIN + r.top = mY - r.bottom; +#endif + // 3 box convolutions, 3 colors per pixel, 4 bytes per color + int32_t imgOffset = mBytesPerPix * r.left + r.top * mBytesPerRow; - if ( mBytesPerPix == 2 ) - CrossBlur16( ( mBits + imgOffset), width, height, mBytesPerRow, tempBits ); - else if ( mBytesPerPix == 4 ) - CrossBlur32( ( mBits + imgOffset), width, height, mBytesPerRow, tempBits ); + unsigned char *tempBits = (unsigned char *)mBlurTemp.Dim(mX * 3); + if (mBytesPerPix == 2) + CrossBlur16((mBits + imgOffset), width, height, mBytesPerRow, tempBits); + else if (mBytesPerPix == 4) + CrossBlur32((mBits + imgOffset), width, height, mBytesPerRow, tempBits); } -void PixPort::CopyBits( unsigned char* inOutVideo, const Rect* inSrce, const Rect* inDest ) { +void PixPort::CopyBits(unsigned char *inOutVideo, const Rect *inSrce, + const Rect *inDest) { - if ( inSrce -> left <= inSrce -> right && inSrce -> top <= inSrce -> bottom && - inDest -> left <= inDest -> right && inDest -> top <= inDest -> bottom ) { + if (inSrce->left <= inSrce->right && inSrce->top <= inSrce->bottom && + inDest->left <= inDest->right && inDest->top <= inDest->bottom) { - // FIXME do this in a C++ visual_mem_copy way. - int i; - unsigned char *imgBits = (unsigned char *) mBits; + // FIXME do this in a C++ visual_mem_copy way. + int i; + unsigned char *imgBits = (unsigned char *)mBits; - for ( i = 0; i < mY * mBytesPerRow; i++) { - inOutVideo[ i ] = imgBits[ i ]; - } - } + for (i = 0; i < mY * mBytesPerRow; i++) { + inOutVideo[i] = imgBits[i]; + } + } } -void PixPort::CopyBits( GrafPtr inPort, const Rect* inSrce, const Rect* inDest ) { - - if ( inSrce -> left <= inSrce -> right && inSrce -> top <= inSrce -> bottom && - inDest -> left <= inDest -> right && inDest -> top <= inDest -> bottom ) { - +void PixPort::CopyBits(GrafPtr inPort, const Rect *inSrce, const Rect *inDest) { + if (inSrce->left <= inSrce->right && inSrce->top <= inSrce->bottom && + inDest->left <= inDest->right && inDest->top <= inDest->bottom) { - #if EG_MAC - ::CopyBits( (BitMap*) *mBM, &inPort->portBits, inSrce, inDest, srcCopy, 0 ); - - - #elif EG_WIN - //HDC hdc = ::GetDC( inDestWin ); - ::BitBlt( inPort, inDest -> left, inDest -> top, inDest -> right - inDest -> left, inDest -> bottom - inDest -> top, mWorld, inSrce -> left, inSrce -> top, SRCCOPY ); - //::ReleaseDC( inDestWin, hdc ); - #elif defined(UNIX_X) - // We don't handle this because we need private video buffer access - #endif - } +#if EG_MAC + ::CopyBits((BitMap *)*mBM, &inPort->portBits, inSrce, inDest, srcCopy, 0); + +#elif EG_WIN + // HDC hdc = ::GetDC( inDestWin ); + ::BitBlt(inPort, inDest->left, inDest->top, inDest->right - inDest->left, + inDest->bottom - inDest->top, mWorld, inSrce->left, inSrce->top, + SRCCOPY); +//::ReleaseDC( inDestWin, hdc ); +#elif defined(UNIX_X) +// We don't handle this because we need private video buffer access +#endif + } } +void PixPort::CopyBits(PixPort &inDestPort, const Rect *inSrce, + const Rect *inDest) { -void PixPort::CopyBits( PixPort& inDestPort, const Rect* inSrce, const Rect* inDest ) { - - if ( inSrce -> left <= inSrce -> right && inSrce -> top <= inSrce -> bottom && - inDest -> left <= inDest -> right && inDest -> top <= inDest -> bottom ) { + if (inSrce->left <= inSrce->right && inSrce->top <= inSrce->bottom && + inDest->left <= inDest->right && inDest->top <= inDest->bottom) { - #if EG_MAC - ::CopyBits( (BitMap*) *mBM, (BitMap*) *inDestPort.mBM, inSrce, inDest, srcCopy, 0 ); - #elif EG_WIN - ::BitBlt( inDestPort.mWorld, inDest -> left, inDest -> top, inDest -> right - inDest -> left, inDest -> bottom - inDest -> top, mWorld, inSrce -> left, inSrce -> top, SRCCOPY ); - #endif - } +#if EG_MAC + ::CopyBits((BitMap *)*mBM, (BitMap *)*inDestPort.mBM, inSrce, inDest, + srcCopy, 0); +#elif EG_WIN + ::BitBlt(inDestPort.mWorld, inDest->left, inDest->top, + inDest->right - inDest->left, inDest->bottom - inDest->top, mWorld, + inSrce->left, inSrce->top, SRCCOPY); +#endif + } } -void PixPort::Line( int sx, int sy, int ex, int ey, int32_t inColor ) { +void PixPort::Line(int sx, int sy, int ex, int ey, int32_t inColor) { - if ( mBytesPerPix == 2 ) - Line16( sx, sy, ex, ey, inColor ); - else if ( mBytesPerPix == 1 ) - Line8 ( sx, sy, ex, ey, inColor ); - else if ( mBytesPerPix == 4 ) - Line32( sx, sy, ex, ey, inColor ); + if (mBytesPerPix == 2) + Line16(sx, sy, ex, ey, inColor); + else if (mBytesPerPix == 1) + Line8(sx, sy, ex, ey, inColor); + else if (mBytesPerPix == 4) + Line32(sx, sy, ex, ey, inColor); } - -#define __ABS( n ) ( ( n > 0 ) ? (n) : (-n) ) -#define CLR_LINE_THR 520 - -void PixPort::Line( int sx, int sy, int ex, int ey, const RGBColor& inS, const RGBColor& inE ) { - int32_t R, G, B, dR, dG, dB; - - R = inS.red; - G = inS.green; - B = inS.blue; - dR = inE.red - R; - dG = inE.green - G; - dB = inE.blue - B; - - // If the endpoints have the same color, run the faster line procs (that just use one color) - if ( dR > - CLR_LINE_THR && dR < CLR_LINE_THR && - dG > - CLR_LINE_THR && dG < CLR_LINE_THR && - dB > - CLR_LINE_THR && dB < CLR_LINE_THR ) { - int32_t color; - - if ( mBytesPerPix == 2 ) { - color = __Clr16( R, G, B ); - Line16( sx, sy, ex, ey, color ); } - else if ( mBytesPerPix == 4 ) { - color = __Clr32( R, G, B ); - Line32( sx, sy, ex, ey, color ); } - else if ( mBytesPerPix == 1 ) { - color = __Clr8( R, G, B ); - Line8 ( sx, sy, ex, ey, color ); - } } - else { - if ( mBytesPerPix == 2 ) - Line16( sx, sy, ex, ey, inS, dR, dG, dB ); - else if ( mBytesPerPix == 4 ) - Line32( sx, sy, ex, ey, inS, dR, dG, dB ); - else if ( mBytesPerPix == 1 ) - Line8 ( sx, sy, ex, ey, inS.red, dR ); - } +#define __ABS(n) ((n > 0) ? (n) : (-n)) +#define CLR_LINE_THR 520 + +void PixPort::Line(int sx, int sy, int ex, int ey, const RGBColor &inS, + const RGBColor &inE) { + int32_t R, G, B, dR, dG, dB; + + R = inS.red; + G = inS.green; + B = inS.blue; + dR = inE.red - R; + dG = inE.green - G; + dB = inE.blue - B; + + // If the endpoints have the same color, run the faster line procs (that just + // use one color) + if (dR > -CLR_LINE_THR && dR < CLR_LINE_THR && dG > -CLR_LINE_THR && + dG < CLR_LINE_THR && dB > -CLR_LINE_THR && dB < CLR_LINE_THR) { + int32_t color; + + if (mBytesPerPix == 2) { + color = __Clr16(R, G, B); + Line16(sx, sy, ex, ey, color); + } else if (mBytesPerPix == 4) { + color = __Clr32(R, G, B); + Line32(sx, sy, ex, ey, color); + } else if (mBytesPerPix == 1) { + color = __Clr8(R, G, B); + Line8(sx, sy, ex, ey, color); + } + } else { + if (mBytesPerPix == 2) + Line16(sx, sy, ex, ey, inS, dR, dG, dB); + else if (mBytesPerPix == 4) + Line32(sx, sy, ex, ey, inS, dR, dG, dB); + else if (mBytesPerPix == 1) + Line8(sx, sy, ex, ey, inS.red, dR); + } } - - long PixPort::CreateFont() { - PixTextStyle* newFont = new PixTextStyle; + PixTextStyle *newFont = new PixTextStyle; - mFonts.Add( newFont ); + mFonts.Add(newFont); - newFont -> mOSFontID = 0; + newFont->mOSFontID = 0; - return (long) newFont; + return (long)newFont; } +void PixPort::AssignFont(long inPixFontID, const char *inFontName, long inSize, + long inStyleFlags) { + PixTextStyle *font = (PixTextStyle *)inPixFontID; + font->mFontName.Assign(inFontName); + font->mPointSize = inSize; + font->mStyle = inStyleFlags; + font->mOSStyle = 0; + font->mDeviceLineHeight = inSize; -void PixPort::AssignFont( long inPixFontID, const char* inFontName, long inSize, long inStyleFlags ) { - PixTextStyle* font = (PixTextStyle*) inPixFontID; - - font -> mFontName.Assign( inFontName ); - font -> mPointSize = inSize; - font -> mStyle = inStyleFlags; - font -> mOSStyle = 0; - font -> mDeviceLineHeight = inSize; - - #if EG_MAC - short fontNum; - ::GetFNum( font -> mFontName.getPasStr(), &fontNum ); - font -> mOSFontID = fontNum; - if ( font -> mStyle & PP_BOLD ) - font -> mOSStyle |= bold; - if ( font -> mStyle & PP_ITALIC ) - font -> mOSStyle |= italic; - if ( font -> mStyle & PP_UNDERLINE ) - font -> mOSStyle |= underline; - #endif - - - #if EG_WIN - long height = - MulDiv( inSize, ::GetDeviceCaps( mWorld, LOGPIXELSY ), 72 ); - font -> mFontName.Keep( 31 ); - font -> mOSFontID = (long) ::CreateFont( height, 0, 0, 0, - ( inStyleFlags & PP_BOLD ) ? FW_BOLD : FW_NORMAL, - ( inStyleFlags & PP_ITALIC ) ? true : false, - ( inStyleFlags & PP_UNDERLINE ) ? true : false, - 0, DEFAULT_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, - DEFAULT_PITCH | FF_DONTCARE, font -> mFontName.getCStr() ); - #endif - - #ifdef UNIX_X - font -> mOSFontID = (long)mfl_LoadRawFont(DATADIR "/deffont"); - #endif -} +#if EG_MAC + short fontNum; + ::GetFNum(font->mFontName.getPasStr(), &fontNum); + font->mOSFontID = fontNum; + if (font->mStyle & PP_BOLD) + font->mOSStyle |= bold; + if (font->mStyle & PP_ITALIC) + font->mOSStyle |= italic; + if (font->mStyle & PP_UNDERLINE) + font->mOSStyle |= underline; +#endif +#if EG_WIN + long height = -MulDiv(inSize, ::GetDeviceCaps(mWorld, LOGPIXELSY), 72); + font->mFontName.Keep(31); + font->mOSFontID = (long)::CreateFont( + height, 0, 0, 0, (inStyleFlags & PP_BOLD) ? FW_BOLD : FW_NORMAL, + (inStyleFlags & PP_ITALIC) ? true : false, + (inStyleFlags & PP_UNDERLINE) ? true : false, 0, DEFAULT_CHARSET, + OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, + DEFAULT_PITCH | FF_DONTCARE, font->mFontName.getCStr()); +#endif +#ifdef UNIX_X + font->mOSFontID = (long)mfl_LoadRawFont(DATADIR "/deffont"); +#endif +} +void PixPort::SelectFont(long inPixFontID) { + // Exit if we're already in in this text face + if (inPixFontID == mCurFontID) + return; + mCurFontID = inPixFontID; + PixTextStyle *font = (PixTextStyle *)inPixFontID; + mDeviceLineHeight = font->mDeviceLineHeight; -void PixPort::SelectFont( long inPixFontID ) { + __setupPort - // Exit if we're already in in this text face - if ( inPixFontID == mCurFontID ) - return; +#if EG_MAC + ::TextFont(font->mOSFontID); + ::TextSize(font->mPointSize); + ::TextFace(font->mOSStyle); +#endif - mCurFontID = inPixFontID; - PixTextStyle* font = (PixTextStyle*) inPixFontID; - mDeviceLineHeight = font -> mDeviceLineHeight; +#if EG_WIN + ::SelectObject(mWorld, (HFONT)font->mOSFontID); +#endif - __setupPort +#ifdef UNIX_X + mfl_SetFont(mWorld, (mfl_font)font->mOSFontID); +#endif - #if EG_MAC - ::TextFont( font -> mOSFontID ); - ::TextSize( font -> mPointSize ); - ::TextFace( font -> mOSStyle ); - #endif + __restorePort +} - #if EG_WIN - ::SelectObject( mWorld, (HFONT) font -> mOSFontID ); - #endif +#include +void PixPort::SetTextMode(PixDrawMode inMode) { - #ifdef UNIX_X - mfl_SetFont(mWorld, (mfl_font) font->mOSFontID); - #endif + __setupPort - __restorePort -} +#if EG_MAC + long mode = srcCopy; + if (inMode == SRC_OR) + mode = srcOr; + else if (inMode == SRC_BIC) + mode = srcBic; + else if (inMode == SRC_XOR) + mode = srcXor; + ::TextMode(mode); +#endif +#if EG_WIN + long mode = R2_COPYPEN; + if (inMode == SRC_BIC) + mode = R2_WHITE; + else if (inMode == SRC_XOR) + mode = R2_NOT; + ::SetROP2(mWorld, mode); +#endif -#include -void PixPort::SetTextMode( PixDrawMode inMode ) { - - __setupPort - - #if EG_MAC - long mode = srcCopy; - if ( inMode == SRC_OR ) - mode = srcOr; - else if ( inMode == SRC_BIC ) - mode = srcBic; - else if ( inMode == SRC_XOR ) - mode = srcXor; - ::TextMode( mode ); - #endif - - - #if EG_WIN - long mode = R2_COPYPEN; - if ( inMode == SRC_BIC ) - mode = R2_WHITE; - else if ( inMode == SRC_XOR ) - mode = R2_NOT; - ::SetROP2( mWorld, mode ); - #endif - - #ifdef UNIX_X - int mode = MFL_SETALL; - if ( inMode == SRC_OR ) - mode = MFL_OR; - else if ( inMode == SRC_BIC ) - mode = MFL_SETALL; - else if ( inMode == SRC_XOR ) - mode = MFL_XOR; - mfl_SetDrawMode(mWorld, mode); - #endif - - __restorePort -} +#ifdef UNIX_X + int mode = MFL_SETALL; + if (inMode == SRC_OR) + mode = MFL_OR; + else if (inMode == SRC_BIC) + mode = MFL_SETALL; + else if (inMode == SRC_XOR) + mode = MFL_XOR; + mfl_SetDrawMode(mWorld, mode); +#endif -void PixPort::SetTextColor( RGBColor& inColor ) { + __restorePort +} +void PixPort::SetTextColor(RGBColor &inColor) { - __setupPort + __setupPort - #if EG_MAC - ::RGBForeColor( &inColor ); - #endif +#if EG_MAC + ::RGBForeColor(&inColor); +#endif - #if EG_WIN - ::SetTextColor( mWorld, RGB( inColor.red >> 8, inColor.green >> 8, inColor.blue >> 8 ) ); - #endif +#if EG_WIN + ::SetTextColor(mWorld, + RGB(inColor.red >> 8, inColor.green >> 8, inColor.blue >> 8)); +#endif - #ifdef UNIX_X +#ifdef UNIX_X #if 0 /* This shouldn't ever happen. If it did, the only way a color * could be found would be by searching through the palette. @@ -738,219 +676,218 @@ void PixPort::SetTextColor( RGBColor& inColor ) { fprintf(stderr, "r=%i g=%i b=%i\n", inColor.red, inColor.green, inColor.blue); #endif - mfl_SetTextColor(mWorld, 255); - #endif - - __restorePort + mfl_SetTextColor(mWorld, 255); +#endif + __restorePort } -void PixPort::SetTextColor( PixPalEntry& inColor ) { +void PixPort::SetTextColor(PixPalEntry &inColor) { - #if EG_MAC - SetTextColor( inColor.rgb ); - #endif +#if EG_MAC + SetTextColor(inColor.rgb); +#endif - #if EG_WIN - ::SetTextColor( mWorld, RGB( inColor.rgbRed, inColor.rgbGreen, inColor.rgbBlue ) ); - #endif +#if EG_WIN + ::SetTextColor(mWorld, + RGB(inColor.rgbRed, inColor.rgbGreen, inColor.rgbBlue)); +#endif - #ifdef UNIX_X - /* Palette index got stored */ - mfl_SetTextColor(mWorld, *((int32_t *)&inColor) >> 24); - #endif +#ifdef UNIX_X + /* Palette index got stored */ + mfl_SetTextColor(mWorld, *((int32_t *)&inColor) >> 24); +#endif } -void PixPort::TextRect( const char* inStr, int32_t& outWidth, int32_t& outHeight ) { - int32_t width, pos; - char c; +void PixPort::TextRect(const char *inStr, int32_t &outWidth, + int32_t &outHeight) { + int32_t width, pos; + char c; - outWidth = 0; - outHeight = 0; + outWidth = 0; + outHeight = 0; - __setupPort + __setupPort - while ( *inStr ) { - c = inStr[ 0 ]; - pos = 0; + while (*inStr) { + c = inStr[0]; + pos = 0; - while ( c != '\r' && c ) { - pos++; - c = inStr[ pos ]; - } + while (c != '\r' && c) { + pos++; + c = inStr[pos]; + } - #if EG_MAC - width = ::TextWidth( inStr, 0, pos ); - #endif - - #if EG_WIN - SIZE dim; - ::GetTextExtentPoint( mWorld, inStr, pos, &dim ); - width = dim.cx; - #endif +#if EG_MAC + width = ::TextWidth(inStr, 0, pos); +#endif - #ifdef UNIX_X - width = mfl_GetTextWidthL(mWorld, inStr, pos); - #endif +#if EG_WIN + SIZE dim; + ::GetTextExtentPoint(mWorld, inStr, pos, &dim); + width = dim.cx; +#endif - if ( width > outWidth ) - outWidth = width; +#ifdef UNIX_X + width = mfl_GetTextWidthL(mWorld, inStr, pos); +#endif - outHeight += mDeviceLineHeight; + if (width > outWidth) + outWidth = width; - if ( c == 0 ) - break; + outHeight += mDeviceLineHeight; - inStr += pos + 1; - } + if (c == 0) + break; - __restorePort + inStr += pos + 1; + } + __restorePort } +void PixPort::DrawText(int32_t inX, int32_t inY, const char *inStr) { + int32_t pos; + char c; -void PixPort::DrawText( int32_t inX, int32_t inY, const char* inStr ) { - int32_t pos; - char c; - - __setupPort + __setupPort - while ( *inStr ) { - c = inStr[ 0 ]; - pos = 0; + while (*inStr) { + c = inStr[0]; + pos = 0; - while ( c != '\r' && c ) { - pos++; - c = inStr[ pos ]; - } + while (c != '\r' && c) { + pos++; + c = inStr[pos]; + } - #if EG_MAC - ::MoveTo( inX, inY ); - ::DrawText( inStr, 0, pos ); - #endif +#if EG_MAC + ::MoveTo(inX, inY); + ::DrawText(inStr, 0, pos); +#endif - #if EG_WIN - ::TextOut( mWorld, inX, inY, inStr, pos ); - #endif +#if EG_WIN + ::TextOut(mWorld, inX, inY, inStr, pos); +#endif - #ifdef UNIX_X - mfl_OutText8L(mWorld, inX, inY, inStr, pos); - #endif +#ifdef UNIX_X + mfl_OutText8L(mWorld, inX, inY, inStr, pos); +#endif - if ( c == 0 ) - break; + if (c == 0) + break; - inY += mDeviceLineHeight; - inStr += pos + 1; - } + inY += mDeviceLineHeight; + inStr += pos + 1; + } - __restorePort + __restorePort } -void PixPort::SetLineWidth( int32_t inLineWidth ) { - if ( inLineWidth <= 0 ) - mLineWidth = 1; - else if ( inLineWidth > MAX_LINE_WIDTH ) - mLineWidth = MAX_LINE_WIDTH; - else - mLineWidth = inLineWidth; +void PixPort::SetLineWidth(int32_t inLineWidth) { + if (inLineWidth <= 0) + mLineWidth = 1; + else if (inLineWidth > MAX_LINE_WIDTH) + mLineWidth = MAX_LINE_WIDTH; + else + mLineWidth = inLineWidth; } -void PixPort::EraseRect( const Rect* inRect ) { +void PixPort::EraseRect(const Rect *inRect) { - if ( mBytesPerPix == 2 ) - EraseRect16( inRect ); - else if ( mBytesPerPix == 1 ) - EraseRect8 ( inRect ); - else if ( mBytesPerPix == 4 ) - EraseRect32( inRect ); + if (mBytesPerPix == 2) + EraseRect16(inRect); + else if (mBytesPerPix == 1) + EraseRect8(inRect); + else if (mBytesPerPix == 4) + EraseRect32(inRect); } - - - -#define P_SZ 1 +#define P_SZ 1 #include "DrawXX.cpp" - #undef P_SZ -#define P_SZ 2 +#define P_SZ 2 #include "DrawXX.cpp" - #undef P_SZ -#define P_SZ 4 +#define P_SZ 4 #include "DrawXX.cpp" +#define HALFCORD \ + 0x007F /* 16 bits per cord, 8 bits for fixed decimal, 8 bits for whole \ + number */ +#define FIXED_BITS 8 -#define HALFCORD 0x007F /* 16 bits per cord, 8 bits for fixed decimal, 8 bits for whole number */ -#define FIXED_BITS 8 - - - -// Assembly note w/ branch prediction: the first block is chosen to be more probable +// Assembly note w/ branch prediction: the first block is chosen to be more +// probable #include -void PixPort::Fade( const char* inSrce, char* inDest, int32_t inBytesPerRow, int32_t inX, int32_t inY, uint32_t* grad ) { - uint32_t u, v, u1, v1, P1, P2, P3, P4, p; - const char* srceMap; - const char* srce; - - // FIXME FIXME MMX SYNAP: OWyeha this is THE hot spot for optimalization!!!! - - // Setup the source row base address and offset to allow for negative grad components - srce = inSrce - HALFCORD * inBytesPerRow - HALFCORD; - - // Start writing to the image... - for ( int y = 0; y < inY; y++ ) { - - for ( int x = 0; x < inX; x++ ) { - - // Format of each long: - // High byte: x (whole part), High-low byte: x (frac part) - // Low-high byte: y (whole part), Low byte: y (frac part) - u1 = *grad; - grad ++; - - p = 0; - - // 0xFFFFFFFF is a signal that this pixel is black. - if ( u1 != 0xFFFFFFFF ) { - - // Note that we use casting 3 times as an unsigned char to (smartly) get the compiler to do masking for us - // FIXME: BUG: Assumption that bytes per row equals width. Also see _G-Force\ Common/DeltaField.* - srceMap = srce + ( u1 >> 14 ); - v = ( u1 >> 7 ) & 0x7F; // frac part of x - u = ( u1 ) & 0x7F; // frac part of y - - // In the end, the pixel intensity will be 31/32 of its current (interpolated) value - v *= 31; - - /* Bilinear interpolation to approximate the source pixel value... */ - /* P1 - P2 */ - /* | | */ - /* P3 - P4 */ - P1 = ( (unsigned char*) srceMap )[0]; - P2 = ( (unsigned char*) srceMap )[1]; - u1 = 0x80 - u; - P1 *= u1; - P2 *= u1; - v1 = 3968 - v; // 3968 == 31 * 0x80 - P3 = ( (unsigned char*) srceMap )[ inBytesPerRow ]; - P4 = ( (unsigned char*) srceMap )[ inBytesPerRow + 1 ]; - P3 *= u; - P4 *= u; - - /* We can now calc the intensity of the pixel (truncating the fraction part of the pix value) */ - /* We divide by (7+7+5) decimal places because p is units squared (7 places per decimal) and 5 more dec places cuz of the mult by 31 */ - p = ( v * ( P2 + P4 ) + v1 * ( P1 + P3 ) ) >> 19; - } - ( (unsigned char*) inDest )[ x ] = p; - } - - inDest += inBytesPerRow; - srce += inBytesPerRow; - } +void PixPort::Fade(const char *inSrce, char *inDest, int32_t inBytesPerRow, + int32_t inX, int32_t inY, uint32_t *grad) { + uint32_t u, v, u1, v1, P1, P2, P3, P4, p; + const char *srceMap; + const char *srce; + + // FIXME FIXME MMX SYNAP: OWyeha this is THE hot spot for optimalization!!!! + + // Setup the source row base address and offset to allow for negative grad + // components + srce = inSrce - HALFCORD * inBytesPerRow - HALFCORD; + + // Start writing to the image... + for (int y = 0; y < inY; y++) { + + for (int x = 0; x < inX; x++) { + + // Format of each long: + // High byte: x (whole part), High-low byte: x (frac part) + // Low-high byte: y (whole part), Low byte: y (frac part) + u1 = *grad; + grad++; + + p = 0; + + // 0xFFFFFFFF is a signal that this pixel is black. + if (u1 != 0xFFFFFFFF) { + + // Note that we use casting 3 times as an unsigned char to (smartly) get + // the compiler to do masking for us + // FIXME: BUG: Assumption that bytes per row equals width. Also see + // _G-Force\ Common/DeltaField.* + srceMap = srce + (u1 >> 14); + v = (u1 >> 7) & 0x7F; // frac part of x + u = (u1)&0x7F; // frac part of y + + // In the end, the pixel intensity will be 31/32 of its current + // (interpolated) value + v *= 31; + + /* Bilinear interpolation to approximate the source pixel value... */ + /* P1 - P2 */ + /* | | */ + /* P3 - P4 */ + P1 = ((unsigned char *)srceMap)[0]; + P2 = ((unsigned char *)srceMap)[1]; + u1 = 0x80 - u; + P1 *= u1; + P2 *= u1; + v1 = 3968 - v; // 3968 == 31 * 0x80 + P3 = ((unsigned char *)srceMap)[inBytesPerRow]; + P4 = ((unsigned char *)srceMap)[inBytesPerRow + 1]; + P3 *= u; + P4 *= u; + + /* We can now calc the intensity of the pixel (truncating the fraction + * part of the pix value) */ + /* We divide by (7+7+5) decimal places because p is units squared (7 + * places per decimal) and 5 more dec places cuz of the mult by 31 */ + p = (v * (P2 + P4) + v1 * (P1 + P3)) >> 19; + } + ((unsigned char *)inDest)[x] = p; + } + + inDest += inBytesPerRow; + srce += inBytesPerRow; + } } - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/ScreenDevice.cpp b/libvisual-plugins/plugins/actor/gforce/Common/UI/ScreenDevice.cpp index 6d3089515..2e47c45c8 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/ScreenDevice.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/ScreenDevice.cpp @@ -1,498 +1,460 @@ #include "ScreenDevice.h" - #if EG_MAC #include #endif - -long ScreenDevice::sOSDepth = 16; -long ScreenDevice::sMinDepth = 16; - +long ScreenDevice::sOSDepth = 16; +long ScreenDevice::sMinDepth = 16; ScreenDevice::ScreenDevice() { - mContextRef = 0; - - #if USE_DIRECTX - HDC hdc = ::GetDC( 0 ); - sOSDepth = ::GetDeviceCaps( hdc, BITSPIXEL ); - ::ReleaseDC( 0, hdc ); - if ( sOSDepth == 24 ) - sOSDepth = 32; - #endif - - #if EG_WIN - mDDObj = 0; - mFS_DC = 0; - #endif - - - /* - GDHandle gDevice = ::GetMainDevice(); - if ( gDevice ) { - PixMapHandle pixMap = (**gDevice).gdPMap; - sOSDepth = (**pixMap).pixelSize; - if ( sOSDepth == 8 ) { - ::BlockMove( (**(**pixMap).pmTable).ctTable, sOSPalette, 256 * sizeof( ColorSpec ) ); - } } - else - sOSDepth = 16; - */ + mContextRef = 0; + +#if USE_DIRECTX + HDC hdc = ::GetDC(0); + sOSDepth = ::GetDeviceCaps(hdc, BITSPIXEL); + ::ReleaseDC(0, hdc); + if (sOSDepth == 24) + sOSDepth = 32; +#endif -} +#if EG_WIN + mDDObj = 0; + mFS_DC = 0; +#endif + /* + GDHandle gDevice = ::GetMainDevice(); + if ( gDevice ) { + PixMapHandle pixMap = (**gDevice).gdPMap; + sOSDepth = (**pixMap).pixelSize; + if ( sOSDepth == 8 ) { + ::BlockMove( (**(**pixMap).pmTable).ctTable, sOSPalette, 256 * + sizeof( ColorSpec ) ); } } else sOSDepth = 16; + */ +} ScreenDevice::~ScreenDevice() { + // EndFrame(); - //EndFrame(); - - ExitFullscreen(); + ExitFullscreen(); } +bool ScreenDevice::EnterFullscreen(long inDispID, Point &ioSize, int inBitDepth, + WindowPtr inWin) { + bool ok = false; + + // Check inBitDepth + if (inBitDepth != 8 && inBitDepth != 16 && inBitDepth != 32) + inBitDepth = sOSDepth; + if (inBitDepth < sMinDepth) + inBitDepth = sMinDepth; + + ExitFullscreen(); + mDispID = inDispID; + mBitDepth = inBitDepth; + +#if USE_DISP_MGR + Rect r; + GDHandle theGDevice; + + ::HideCursor(); + ::HideWindow(inWin); + + // Hide that pesky menubar... + RgnHandle grayRgn; + grayRgn = ::LMGetGrayRgn(); + mMenuBarHeight = ::LMGetMBarHeight(); + ::LMSetMBarHeight(0); + r = qd.screenBits.bounds; + r.bottom = r.top + mMenuBarHeight; + mMenuBarRgn = ::NewRgn(); + ::RectRgn(mMenuBarRgn, &r); + ::UnionRgn(grayRgn, mMenuBarRgn, grayRgn); + + // Fetch a ptr to the device given by inDispNum + if (::DMGetGDeviceByDisplayID(inDispNum, &theGDevice, false) != noErr) + theGDevice = 0; + if (!theGDevice) + theGDevice = ::GetMainDevice(); + + // Use RequestVideo.c to get the Disp Mgr to do what we want + VideoRequestRec requestRec; + requestRec.screenDevice = theGDevice; + requestRec.reqBitDepth = inBitDepth; + requestRec.reqHorizontal = ioSize.h; + requestRec.reqVertical = ioSize.v; + requestRec.displayMode = nil; // must init to nil + requestRec.depthMode = nil; // must init to nil + requestRec.requestFlags = 0; + if (RVRequestVideoSetting(&requestRec) == noErr) { + if (RVSetVideoRequest(&requestRec) == noErr) { + outSize.h = requestRec.availHorizontal; + outSize.v = requestRec.availVertical; + ok = true; + } + } + + if (ok) { + + // Make the window cover the device + ::MoveWindow(inWin, 0, 0, true); + ::SizeWindow(inWin, outSize.h, outSize.v, true); + ::ShowWindow(inWin); + + // Setup the window as the main grafport + mContextRef = inWin; + mX = outSize.h; + mY = outSize.v; + ::SetRect(&r, 0, 0, mX, mY + 2); + ::NewGWorld(&mWorld, inBitDepth, &r, 0, 0, useTempMem); + mBM = ::GetGWorldPixMap(mWorld); + mBytesPerRow = (**mBM).rowBytes & 0xFFF; + mBytesPerPix = (**mBM).pixelSize / 8; + } + +#elif USE_DRAW_SPROCKETS + DSpContextReference ref; + OSStatus err; + DSpContextAttributes context; + long bestWidth = 0x7FFFFFFF; + bool isInitted = false; + + err = ::DSpStartup(); + if (!err) { + err = ::DSpGetFirstContext(inDispID, &ref); + + // Look for smallest size w/ for given depth + while (!err && ref) { + err = DSpContext_GetAttributes(ref, &context); + if (!err && ref) { + if (context.displayBestDepth == inBitDepth) { + if (context.displayWidth == ioSize.h && + context.displayHeight == ioSize.v) { + mContextRef = ref; + isInitted = true; + break; + } else if (context.displayWidth <= bestWidth && + context.displayWidth >= 640) { + mContextRef = ref; + isInitted = true; + bestWidth = context.displayWidth; + } + } + + // Try the next context for this display + err = ::DSpGetNextContext(ref, &ref); + } + } + + if (!isInitted) { + mContextRef = 0; + ::DSpShutdown(); + return false; + } + + ::DSpContext_GetAttributes(mContextRef, &mContext); + ioSize.h = mContext.displayWidth; + ioSize.v = mContext.displayHeight; + + mContext.contextOptions = kDSpContextOption_DontSyncVBL; + mContext.frequency = 0; + mContext.reserved1 = 0; + mContext.reserved2 = 0; + mContext.gameMustConfirmSwitch = false; + mContext.reserved3[0] = 0; + mContext.reserved3[1] = 0; + mContext.reserved3[2] = 0; + mContext.reserved3[3] = 0; + mContext.colorTable = 0; + mContext.pageCount = 1; + mContext.colorNeeds = kDSpColorNeeds_Require; + + RGBColor back = {0, 0, 0}; + ::DSpSetBlankingColor(&back); + + // Try to reserve the device + err = ::DSpContext_Reserve(mContextRef, &mContext); + if (!err) { + + // If no errors, 'activate' the device into fullscreen + ::DSpContext_FadeGammaOut(mContextRef, 0); + ::HideCursor(); + + err = ::DSpContext_SetState(mContextRef, kDSpContextState_Active); + ::DSpContext_FadeGamma(mContextRef, 100, 0); + + if (err && err != kDSpConfirmSwitchWarning) { + ::DSpContext_Release(mContextRef); + ::DSpShutdown(); + } else { + ok = true; + +#pragma unused(inWin) + /* + // Make the window cover the device + ::MoveWindow( inWin, 0, 0, true ); + ::SizeWindow( inWin, ioSize.h, ioSize.v, true ); + ::ShowWindow( inWin ); + + // Setup the window as the main grafport + mFS_DC = inWin; */ + mFS_DC = 0; + } + } + } + +#elif USE_DIRECTX + if (inWin) { + HRESULT err = ::DirectDrawCreate(0, &mDDObj, 0); + if (err == DD_OK) { + LPDIRECTDRAWSURFACE context; + + err = mDDObj->SetCooperativeLevel(inWin, + DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + if (err == DD_OK) { + err = mDDObj->SetDisplayMode(ioSize.h, ioSize.v, inBitDepth); + if (err == DD_OK) { + mDDObj->Compact(); + DDSURFACEDESC ddsd; + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + err = mDDObj->CreateSurface(&ddsd, &context, 0); + } + } + + if (err == DD_OK) { + mContextRef = context; + ::SetForegroundWindow(inWin); + ::SetCapture(inWin); + mFS_Win = inWin; + + PALETTEENTRY pal[256]; + for (int j = 0; j < 256; j++) { + pal[j].peRed = j; + pal[j].peGreen = j; + pal[j].peBlue = j; + pal[j].peFlags = 0; + } + mDDObj->CreatePalette(DDPCAPS_8BIT, pal, &mFS_Palette, 0); + mContextRef->SetPalette(mFS_Palette); + ok = true; + } else { + mDDObj->Release(); + mDDObj = 0; + } + } + } +#endif + if (ok) { +#if EG_MAC + ::HideCursor(); +#elif EG_WIN + ::SetCursor(::LoadCursor(0, IDC_ARROW)); + while (::ShowCursor(false) >= 0) { + } +#endif + } else + mContextRef = 0; -bool ScreenDevice::EnterFullscreen( long inDispID, Point& ioSize, int inBitDepth, WindowPtr inWin ) { - bool ok = false; - - - // Check inBitDepth - if ( inBitDepth != 8 && inBitDepth != 16 && inBitDepth != 32 ) - inBitDepth = sOSDepth; - if ( inBitDepth < sMinDepth ) - inBitDepth = sMinDepth; - - - ExitFullscreen(); - mDispID = inDispID; - mBitDepth = inBitDepth; - - - #if USE_DISP_MGR - Rect r; - GDHandle theGDevice; - - ::HideCursor(); - ::HideWindow( inWin ); - - - // Hide that pesky menubar... - RgnHandle grayRgn; - grayRgn = ::LMGetGrayRgn(); - mMenuBarHeight = ::LMGetMBarHeight(); - ::LMSetMBarHeight( 0 ); - r = qd.screenBits.bounds; - r.bottom = r.top + mMenuBarHeight; - mMenuBarRgn = ::NewRgn(); - ::RectRgn( mMenuBarRgn, &r ); - ::UnionRgn( grayRgn, mMenuBarRgn, grayRgn ); - - // Fetch a ptr to the device given by inDispNum - if ( ::DMGetGDeviceByDisplayID( inDispNum, &theGDevice, false ) != noErr ) - theGDevice = 0; - if ( ! theGDevice ) - theGDevice = ::GetMainDevice(); - - // Use RequestVideo.c to get the Disp Mgr to do what we want - VideoRequestRec requestRec; - requestRec.screenDevice = theGDevice; - requestRec.reqBitDepth = inBitDepth; - requestRec.reqHorizontal = ioSize.h; - requestRec.reqVertical = ioSize.v; - requestRec.displayMode = nil; // must init to nil - requestRec.depthMode = nil; // must init to nil - requestRec.requestFlags = 0; - if ( RVRequestVideoSetting( &requestRec ) == noErr ) { - if ( RVSetVideoRequest( &requestRec ) == noErr ) { - outSize.h = requestRec.availHorizontal; - outSize.v = requestRec.availVertical; - ok = true; - } - } - - if ( ok ) { - - // Make the window cover the device - ::MoveWindow( inWin, 0, 0, true ); - ::SizeWindow( inWin, outSize.h, outSize.v, true ); - ::ShowWindow( inWin ); - - // Setup the window as the main grafport - mContextRef = inWin; - mX = outSize.h; - mY = outSize.v; - ::SetRect( &r, 0, 0, mX, mY+2 ); - ::NewGWorld( &mWorld, inBitDepth, &r, 0, 0, useTempMem ); - mBM = ::GetGWorldPixMap( mWorld ); - mBytesPerRow = (**mBM).rowBytes & 0xFFF; - mBytesPerPix = (**mBM).pixelSize / 8; - } - - - - #elif USE_DRAW_SPROCKETS - DSpContextReference ref; - OSStatus err; - DSpContextAttributes context; - long bestWidth = 0x7FFFFFFF; - bool isInitted = false; - - err = ::DSpStartup(); - if ( ! err ) { - err = ::DSpGetFirstContext( inDispID, &ref ); - - // Look for smallest size w/ for given depth - while ( ! err && ref ) { - err = DSpContext_GetAttributes( ref, &context ); - if ( ! err && ref ) { - if ( context.displayBestDepth == inBitDepth ) { - if ( context.displayWidth == ioSize.h && context.displayHeight == ioSize.v ) { - mContextRef = ref; - isInitted = true; - break; } - else if ( context.displayWidth <= bestWidth && context.displayWidth >= 640 ) { - mContextRef = ref; - isInitted = true; - bestWidth = context.displayWidth; - } - } - - // Try the next context for this display - err = ::DSpGetNextContext( ref, &ref ); - } - } - - if ( ! isInitted ) { - mContextRef = 0; - ::DSpShutdown(); - return false; - } - - ::DSpContext_GetAttributes( mContextRef, &mContext ); - ioSize.h = mContext.displayWidth; - ioSize.v = mContext.displayHeight; - - mContext.contextOptions = kDSpContextOption_DontSyncVBL; - mContext.frequency = 0; - mContext.reserved1 = 0; - mContext.reserved2 = 0; - mContext.gameMustConfirmSwitch = false; - mContext.reserved3[0] = 0; - mContext.reserved3[1] = 0; - mContext.reserved3[2] = 0; - mContext.reserved3[3] = 0; - mContext.colorTable = 0; - mContext.pageCount = 1; - mContext.colorNeeds = kDSpColorNeeds_Require; - - RGBColor back = { 0, 0, 0 }; - ::DSpSetBlankingColor( &back ); - - // Try to reserve the device - err = ::DSpContext_Reserve( mContextRef, &mContext ); - if ( ! err ) { - - // If no errors, 'activate' the device into fullscreen - ::DSpContext_FadeGammaOut( mContextRef, 0 ); - ::HideCursor(); - - err = ::DSpContext_SetState( mContextRef, kDSpContextState_Active ); - ::DSpContext_FadeGamma( mContextRef, 100, 0 ); - - if ( err && err != kDSpConfirmSwitchWarning ) { - ::DSpContext_Release( mContextRef ); - ::DSpShutdown(); } - else { - ok = true; - - #pragma unused( inWin ) - /* - // Make the window cover the device - ::MoveWindow( inWin, 0, 0, true ); - ::SizeWindow( inWin, ioSize.h, ioSize.v, true ); - ::ShowWindow( inWin ); - - // Setup the window as the main grafport - mFS_DC = inWin; */ - mFS_DC = 0; - } - } - } - - - #elif USE_DIRECTX - if ( inWin ) { - HRESULT err = ::DirectDrawCreate( 0, &mDDObj, 0 ); - if ( err == DD_OK ) { - LPDIRECTDRAWSURFACE context; - - err = mDDObj -> SetCooperativeLevel( inWin, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ); - if ( err == DD_OK ) { - err = mDDObj -> SetDisplayMode( ioSize.h, ioSize.v, inBitDepth ); - if ( err == DD_OK ) { - mDDObj -> Compact(); - DDSURFACEDESC ddsd; - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - err = mDDObj -> CreateSurface( &ddsd, &context, 0); - } - } - - if ( err == DD_OK ) { - mContextRef = context; - ::SetForegroundWindow( inWin ); - ::SetCapture( inWin ); - mFS_Win = inWin; - - PALETTEENTRY pal[ 256 ]; - for ( int j = 0; j < 256; j++ ) { - pal[ j ].peRed = j; - pal[ j ].peGreen = j; - pal[ j ].peBlue = j; - pal[ j ].peFlags = 0; - } - mDDObj -> CreatePalette( DDPCAPS_8BIT, pal, &mFS_Palette, 0 ); - mContextRef -> SetPalette( mFS_Palette ); - ok = true; } - else { - mDDObj -> Release(); - mDDObj = 0; - } - } - } - - #endif - - if ( ok ) { - #if EG_MAC - ::HideCursor(); - #elif EG_WIN - ::SetCursor( ::LoadCursor( 0, IDC_ARROW ) ); - while ( ::ShowCursor( false ) >= 0 ) { } - #endif - } - else - mContextRef = 0; - - - return ok; + return ok; } - - - void ScreenDevice::ExitFullscreen() { + EndFrame(); + if (!IsFullscreen()) + return; + +#if USE_DRAW_SPROCKETS + ::DSpContext_FadeGamma(mContextRef, 0, 0); + ::DSpContext_SetState(mContextRef, kDSpContextState_Inactive); + ::DSpContext_FadeGamma(mContextRef, 100, 0); + ::DSpContext_Release(mContextRef); + ::DSpShutdown(); + ::InitCursor(); +#endif - EndFrame(); - if ( ! IsFullscreen() ) - return; - - #if USE_DRAW_SPROCKETS - ::DSpContext_FadeGamma( mContextRef, 0, 0 ); - ::DSpContext_SetState( mContextRef, kDSpContextState_Inactive ); - ::DSpContext_FadeGamma( mContextRef, 100, 0 ); - ::DSpContext_Release( mContextRef ); - ::DSpShutdown(); - ::InitCursor(); - #endif - - - #if USE_DISP_MGR - RVSetVideoAsScreenPrefs(); - - // Make the menu bar visible again - RgnHandle grayRgn; - grayRgn = ::LMGetGrayRgn(); - ::LMSetMBarHeight( mMenuBarHeight ); - ::DiffRgn( grayRgn, mMenuBarRgn, grayRgn ); // remove the menu bar from the desktop - ::PaintOne( 0, mMenuBarRgn ); // redraw the menubar - ::DisposeRgn( mMenuBarRgn ); - - // Restore the original color table for the main device - if ( sOSDepth == 8 && mBytesPerPix == 1 ) - ::SetEntries( 0, 255, sOSPalette ); - ::InitCursor(); - #endif - - - #if USE_DIRECTX - if ( mFS_DC ) { - mContextRef -> ReleaseDC( mFS_DC ); - mFS_DC = 0; - } - if ( mContextRef ) { - mContextRef -> Release(); - mContextRef = 0; - } - if ( mDDObj ) { - mDDObj -> SetCooperativeLevel( mFS_Win, DDSCL_NORMAL ); - mDDObj -> Release(); - mDDObj = 0; - } - ::ReleaseCapture(); - while ( ::ShowCursor( true ) < 0 ) { } - #endif - - mContextRef = 0; - mFS_DC = 0; -} - - - - - - +#if USE_DISP_MGR + RVSetVideoAsScreenPrefs(); + + // Make the menu bar visible again + RgnHandle grayRgn; + grayRgn = ::LMGetGrayRgn(); + ::LMSetMBarHeight(mMenuBarHeight); + ::DiffRgn(grayRgn, mMenuBarRgn, + grayRgn); // remove the menu bar from the desktop + ::PaintOne(0, mMenuBarRgn); // redraw the menubar + ::DisposeRgn(mMenuBarRgn); + + // Restore the original color table for the main device + if (sOSDepth == 8 && mBytesPerPix == 1) + ::SetEntries(0, 255, sOSPalette); + ::InitCursor(); +#endif -void ScreenDevice::SetPalette( PixPalEntry inPal[ 256 ] ) { +#if USE_DIRECTX + if (mFS_DC) { + mContextRef->ReleaseDC(mFS_DC); + mFS_DC = 0; + } + if (mContextRef) { + mContextRef->Release(); + mContextRef = 0; + } + if (mDDObj) { + mDDObj->SetCooperativeLevel(mFS_Win, DDSCL_NORMAL); + mDDObj->Release(); + mDDObj = 0; + } + ::ReleaseCapture(); + while (::ShowCursor(true) < 0) { + } +#endif - if ( mBitDepth != 8 || ! IsFullscreen() ) - return; + mContextRef = 0; + mFS_DC = 0; +} - #if EG_WIN - PALETTEENTRY pal[ 256 ]; - for ( int i = 0; i < 256; i++ ) { - * ( (long*) &pal[ i ] ) = inPal[ i ].rgbRed | ( inPal[ i ].rgbGreen << 8 )| ( inPal[ i ].rgbBlue << 16 ) | ( PC_RESERVED << 24 ); - } - mFS_Palette -> SetEntries( 0, 0, 256, pal ); - #endif +void ScreenDevice::SetPalette(PixPalEntry inPal[256]) { + if (mBitDepth != 8 || !IsFullscreen()) + return; - #if EG_MAC - ::SetEntries( 0, 255, inPal ); +#if EG_WIN + PALETTEENTRY pal[256]; + for (int i = 0; i < 256; i++) { + *((long *)&pal[i]) = inPal[i].rgbRed | (inPal[i].rgbGreen << 8) | + (inPal[i].rgbBlue << 16) | (PC_RESERVED << 24); + } + mFS_Palette->SetEntries(0, 0, 256, pal); +#endif - /* CTabHandle myTable = (**mBM).pmTable; - ::BlockMove( inPalette, (**myTable).ctTable, 256 * sizeof( ColorSpec ) ); - ::CTabChanged( myTable ); */ - #endif +#if EG_MAC + ::SetEntries(0, 255, inPal); +/* CTabHandle myTable = (**mBM).pmTable; + ::BlockMove( inPalette, (**myTable).ctTable, 256 * sizeof( ColorSpec ) + ); + ::CTabChanged( myTable ); */ +#endif } - GrafPtr ScreenDevice::BeginFrame() { - if ( IsFullscreen() ) { - - #if USE_DRAW_SPROCKETS - OSErr err; - // err = ::DSpContext_GetBackBuffer( mContextRef, kDSpBufferKind_Normal, (CGrafPtr*) &mFS_DC ); - //if ( ! mFS_DC ) { - err = ::DSpContext_GetFrontBuffer( mContextRef, (CGrafPtr*) &mFS_DC ); - if ( mFS_DC ) - ::SetPort( mFS_DC ); - else - ExitFullscreen(); - //} - #endif - - - #if USE_DISP_MGR - mBM = ::GetGWorldPixMap( mWorld ); - fix me! - #endif - + if (IsFullscreen()) { + +#if USE_DRAW_SPROCKETS + OSErr err; + // err = ::DSpContext_GetBackBuffer( mContextRef, kDSpBufferKind_Normal, + //(CGrafPtr*) &mFS_DC ); if ( ! mFS_DC ) { + err = ::DSpContext_GetFrontBuffer(mContextRef, (CGrafPtr *)&mFS_DC); + if (mFS_DC) + ::SetPort(mFS_DC); + else + ExitFullscreen(); +//} +#endif - #if USE_DIRECTX - if ( mContextRef -> GetDC( &mFS_DC ) != DD_OK ) - mFS_DC = 0; - #endif +#if USE_DISP_MGR + mBM = ::GetGWorldPixMap(mWorld); + fix me ! +#endif - } +#if USE_DIRECTX + if (mContextRef->GetDC(&mFS_DC) != DD_OK) mFS_DC = 0; +#endif + } - return mFS_DC; + return mFS_DC; } - - void ScreenDevice::EndFrame() { - if ( IsFullscreen() ) { + if (IsFullscreen()) { - #if USE_DRAW_SPROCKETS - //::DSpContext_SwapBuffers( mContextRef, 0, 0 ); - mFS_DC = 0; - #endif +#if USE_DRAW_SPROCKETS + //::DSpContext_SwapBuffers( mContextRef, 0, 0 ); + mFS_DC = 0; +#endif - #if USE_DIRECTX - if ( mFS_DC ) { - mContextRef -> ReleaseDC( mFS_DC ); - mFS_DC = 0; - } - #endif - } +#if USE_DIRECTX + if (mFS_DC) { + mContextRef->ReleaseDC(mFS_DC); + mFS_DC = 0; + } +#endif + } } +long ScreenDevice::GetDisplayID(long inDeviceNum) { +#if EG_MAC + OSStatus err; + DisplayIDType id = 0; + GDHandle theGDevice = DMGetFirstScreenDevice(false); + while (theGDevice && inDeviceNum) { + inDeviceNum--; -long ScreenDevice::GetDisplayID( long inDeviceNum ) { - - - #if EG_MAC - OSStatus err; - DisplayIDType id = 0; - GDHandle theGDevice = DMGetFirstScreenDevice( false ); - while ( theGDevice && inDeviceNum ) { - inDeviceNum--; - - theGDevice = DMGetNextScreenDevice( theGDevice, false ); - } + theGDevice = DMGetNextScreenDevice(theGDevice, false); + } - if ( ! theGDevice ) - theGDevice = DMGetFirstScreenDevice( false ); + if (!theGDevice) + theGDevice = DMGetFirstScreenDevice(false); - err = DMGetDisplayIDByGDevice( theGDevice, &id, false ); + err = DMGetDisplayIDByGDevice(theGDevice, &id, false); - return ( err ) ? 0 : id; - #endif + return (err) ? 0 : id; +#endif - return 0; + return 0; } +long ScreenDevice::GetDisplayID(long inX, long inY) { +#if EG_MAC + OSStatus err; + DisplayIDType id = 0; + Point inPt; + + inPt.h = inX; + inPt.v = inY; + + GDHandle theGDevice; + + /* + ** Walk the list of display devices in the system. DrawSprocket is + ** centered around the DisplayIDType, which is used by the Display + ** Manager. The GDevice records are going to be in flux with future + ** versions of the system software, so it is best to make the change + ** now and make your software DisplayManager-centric. + */ + theGDevice = DMGetFirstScreenDevice(false); + while (theGDevice && !id) { + + if (::PtInRect(inPt, &(**theGDevice).gdRect)) { + + /* get the display ID */ + err = DMGetDisplayIDByGDevice(theGDevice, &id, false); + if (err) + id = 0; + } + + /* next device */ + theGDevice = DMGetNextScreenDevice(theGDevice, false); + } + /* + err = ::DSpFindContextFromPoint( inPt, &ref ); + if ( ! err ) + err = ::DSpContext_GetDisplayID( ref, &id ); + */ + return (err) ? 0 : id; +#endif -long ScreenDevice::GetDisplayID( long inX, long inY ) { - - #if EG_MAC - OSStatus err; - DisplayIDType id = 0; - Point inPt; - - inPt.h = inX; - inPt.v = inY; - - GDHandle theGDevice; - - /* - ** Walk the list of display devices in the system. DrawSprocket is - ** centered around the DisplayIDType, which is used by the Display - ** Manager. The GDevice records are going to be in flux with future - ** versions of the system software, so it is best to make the change - ** now and make your software DisplayManager-centric. - */ - theGDevice = DMGetFirstScreenDevice( false ); - while( theGDevice && ! id ) { - - if ( ::PtInRect( inPt, &(**theGDevice).gdRect ) ) { - - /* get the display ID */ - err = DMGetDisplayIDByGDevice( theGDevice, &id, false ); - if ( err ) - id = 0; - } - - /* next device */ - theGDevice = DMGetNextScreenDevice( theGDevice, false ); - } -/* - err = ::DSpFindContextFromPoint( inPt, &ref ); - if ( ! err ) - err = ::DSpContext_GetDisplayID( ref, &id ); -*/ - return ( err ) ? 0 : id; - #endif - - return 0; + return 0; } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgErr.cpp b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgErr.cpp index f577330a1..acc5154d8 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgErr.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgErr.cpp @@ -3,200 +3,173 @@ #include "CStrNode.h" +CEgErr::CEgErr(long inErr) : mErr(inErr), mOSErr(0) {} +bool CEgErr::noErr() { return getErr() == cNoErr; } -CEgErr::CEgErr( long inErr ) : - mErr( inErr ), - mOSErr( 0 ) { - -} - - - -bool CEgErr::noErr() { - return getErr() == cNoErr; -} +long CEgErr::getErr() { return mErr; } +void CEgErr::throwErr(long inErr) { - -long CEgErr::getErr() { - return mErr; + if (noErr() || inErr == cNoErr) { + mErr = inErr; + } } - - -void CEgErr::throwErr( long inErr ) { - - if ( noErr() || inErr == cNoErr ) { - mErr = inErr; - } +void CEgErr::GetErrStr(UtilStr &outStr) { + long err; + + if (mOSErr) { + err = mOSErr; + OSErrMsg(outStr); + } else { + err = getErr(); + switch (err) { + + case cNoErr: + outStr.Append("No error."); + break; + + case cBadPLVersion: + case cBadExamVersion: + outStr.Append("This file was made with a different version of Examgen or " + "is damaged and cannot be opened."); + break; + + case cCorrupted: + outStr.Append("This file appears to be corrupt."); + break; + + case cFileNotFound: + outStr.Append("File not found."); + break; + + case cEOFErr: + outStr.Append("End of file reached."); + break; + + case cEOSErr: + outStr.Append("End of file/stream reached."); + break; + + case cBitmapCorrupted: + outStr.Append("The bitmap information is corrupt."); + break; + + case cBitmapTooDeep: + outStr.Append("The bitmap must be 256 or less colors."); + break; + + case cBitmapNotMono: + outStr.Append("The bitmap must be monochrome."); + break; + + case cBadBitmapType: + outStr.Append("The file is not a BMP file."); + break; + + case cRLENotSupported: + outStr.Append("Compressed BMPs are not supported."); + break; + + default: + outStr.Append("Internal error."); + break; + } + } + + outStr.Append(" ("); + outStr.Append(err); + outStr.Append(')'); } - - - - -void CEgErr::GetErrStr( UtilStr& outStr ) { - long err; - - if ( mOSErr ) { - err = mOSErr; - OSErrMsg( outStr ); } - else { - err = getErr(); - switch ( err ) { - - case cNoErr: - outStr.Append( "No error." ); - break; - - case cBadPLVersion: - case cBadExamVersion: - outStr.Append( "This file was made with a different version of Examgen or is damaged and cannot be opened." ); - break; - - case cCorrupted: - outStr.Append( "This file appears to be corrupt." ); - break; - - case cFileNotFound: - outStr.Append( "File not found." ); - break; - - case cEOFErr: - outStr.Append( "End of file reached." ); - break; - - case cEOSErr: - outStr.Append( "End of file/stream reached." ); - break; - - case cBitmapCorrupted: - outStr.Append( "The bitmap information is corrupt." ); - break; - - case cBitmapTooDeep: - outStr.Append( "The bitmap must be 256 or less colors." ); - break; - - case cBitmapNotMono: - outStr.Append( "The bitmap must be monochrome." ); - break; - - case cBadBitmapType: - outStr.Append( "The file is not a BMP file." ); - break; - - case cRLENotSupported: - outStr.Append( "Compressed BMPs are not supported." ); - break; - - default: - outStr.Append( "Internal error." ); - break; - } - } - - outStr.Append( " (" ); - outStr.Append( err ); - outStr.Append( ')' ); -} - - - - #ifdef EG_MAC #include #endif -void CEgErr::OSErrMsg( UtilStr& ioStr ) { - - - switch ( mOSErr ) { - - #ifdef EG_MAC - case ioErr: - ioStr.Append( "I/O Error" ); - break; +void CEgErr::OSErrMsg(UtilStr &ioStr) { - case fnfErr: - ioStr.Append( "File not found" ); - break; + switch (mOSErr) { - case opWrErr: - ioStr.Append( "File is in use" ); - break; - - case fLckdErr: - case permErr: - ioStr.Append( "File is locked" ); - break; - - case vLckdErr: - case wPrErr: - ioStr.Append( "Disk is write protected" ); - break; - - case wrPermErr: - ioStr.Append( "File does not allow writing" ); - break; - - case dskFulErr: - ioStr.Append( "Disk full" ); - break; - #endif - - #ifdef EG_WIN - #include "winerror.h" - - case ERROR_FILE_NOT_FOUND: - ioStr.Append( "File not found" ); - break; +#ifdef EG_MAC + case ioErr: + ioStr.Append("I/O Error"); + break; + + case fnfErr: + ioStr.Append("File not found"); + break; + + case opWrErr: + ioStr.Append("File is in use"); + break; + + case fLckdErr: + case permErr: + ioStr.Append("File is locked"); + break; + + case vLckdErr: + case wPrErr: + ioStr.Append("Disk is write protected"); + break; + + case wrPermErr: + ioStr.Append("File does not allow writing"); + break; + + case dskFulErr: + ioStr.Append("Disk full"); + break; +#endif - case ERROR_PATH_NOT_FOUND: - ioStr.Append( "Path not found" ); - break; +#ifdef EG_WIN +#include "winerror.h" - case ERROR_ACCESS_DENIED: - ioStr.Append( "Access denied" ); - break; + case ERROR_FILE_NOT_FOUND: + ioStr.Append("File not found"); + break; - case ERROR_NOT_ENOUGH_MEMORY: - ioStr.Append( "Not enough memory" ); - break; + case ERROR_PATH_NOT_FOUND: + ioStr.Append("Path not found"); + break; - case ERROR_INVALID_BLOCK: - ioStr.Append( "Invalid block" ); - break; + case ERROR_ACCESS_DENIED: + ioStr.Append("Access denied"); + break; - case ERROR_INVALID_ACCESS: - ioStr.Append( "File not found" ); - break; + case ERROR_NOT_ENOUGH_MEMORY: + ioStr.Append("Not enough memory"); + break; - case ERROR_OUTOFMEMORY: - case ERROR_NO_MORE_FILES: - case ERROR_HANDLE_DISK_FULL: - ioStr.Append( "Disk Full" ); - break; + case ERROR_INVALID_BLOCK: + ioStr.Append("Invalid block"); + break; - case ERROR_WRITE_PROTECT: - ioStr.Append( "Disk is write protected" ); - break; + case ERROR_INVALID_ACCESS: + ioStr.Append("File not found"); + break; - case ERROR_NOT_READY: - ioStr.Append( "Disk not ready" ); - break; + case ERROR_OUTOFMEMORY: + case ERROR_NO_MORE_FILES: + case ERROR_HANDLE_DISK_FULL: + ioStr.Append("Disk Full"); + break; - case ERROR_DUP_NAME: - ioStr.Append( "Duplicate name" ); - break; - #endif + case ERROR_WRITE_PROTECT: + ioStr.Append("Disk is write protected"); + break; - default: - ioStr.Append( "OS Error" ); + case ERROR_NOT_READY: + ioStr.Append("Disk not ready"); + break; - } + case ERROR_DUP_NAME: + ioStr.Append("Duplicate name"); + break; +#endif + default: + ioStr.Append("OS Error"); + } } - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgFileSpec.cpp b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgFileSpec.cpp index 2c78d3025..b835c231e 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgFileSpec.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgFileSpec.cpp @@ -24,373 +24,310 @@ #include "EgOSUtils.h" - #ifdef EG_MAC #include #include #endif +CEgFileSpec::CEgFileSpec() { Assign(0, 0); } -CEgFileSpec::CEgFileSpec() { - - Assign( 0, 0 ); +CEgFileSpec::CEgFileSpec(const char *inFileName, long inType) { + Assign(0, 0); + AssignPathName(inFileName); + SetType(inType); } +CEgFileSpec::CEgFileSpec(const CEgFileSpec &inSpec) { Assign(inSpec); } -CEgFileSpec::CEgFileSpec( const char* inFileName, long inType ) { - Assign( 0, 0 ); - AssignPathName( inFileName ); - SetType( inType ); -} - - - +void CEgFileSpec::Assign(const CEgFileSpec &inSpec) { -CEgFileSpec::CEgFileSpec( const CEgFileSpec& inSpec ) { - - Assign( inSpec ); + Assign(inSpec.OSSpec(), inSpec.GetType()); } +void CEgFileSpec::Assign(const void *inOSSpecPtr, long inType) { + mFileType = inType; - - -void CEgFileSpec::Assign( const CEgFileSpec& inSpec ) { - - Assign( inSpec.OSSpec(), inSpec.GetType() ); +#ifdef EG_MAC + mSpecData.Assign((char *)inOSSpecPtr, sizeof(FSSpec) + 32); +#endif +#if EG_WIN || defined(UNIX_X) + mSpecData.Assign((char *)inOSSpecPtr); +#endif } +void CEgFileSpec::AssignPathName(const char *inPathName) { - - - -void CEgFileSpec::Assign( const void* inOSSpecPtr, long inType ) { - mFileType = inType; - - #ifdef EG_MAC - mSpecData.Assign( (char*) inOSSpecPtr, sizeof( FSSpec ) + 32 ); - #endif - #if EG_WIN || defined(UNIX_X) - mSpecData.Assign( (char*) inOSSpecPtr ); - #endif + if (inPathName) { +#ifdef EG_MAC + FSSpec spec; + UtilStr path(inPathName); + ::FSMakeFSSpec(0, 0, path.getPasStr(), &spec); + //__path2fss( inPathName, &spec ); + Assign(&spec, mFileType); +#endif +#if defined(EG_WIN) || defined(UNIX_X) + Assign(inPathName, 0); +#endif + } } +void CEgFileSpec::AssignFolder(const char *inFolderName) { -void CEgFileSpec::AssignPathName( const char* inPathName ) { - - if ( inPathName ) { - #ifdef EG_MAC - FSSpec spec; - UtilStr path( inPathName ); - ::FSMakeFSSpec( 0, 0, path.getPasStr(), &spec ); - //__path2fss( inPathName, &spec ); - Assign( &spec, mFileType ); - #endif - #if defined(EG_WIN) || defined(UNIX_X) - Assign( inPathName, 0 ); - #endif - } -} - +#ifdef EG_MAC + CInfoPBRec pb; + FSSpec spec; + Str255 name; + + UtilStr path; + if (inFolderName[0] != ':') + path.Append(':'); + path.Append(inFolderName); + path.copyTo(name, 255); + pb.hFileInfo.ioNamePtr = name; + pb.hFileInfo.ioVRefNum = ((FSSpec *)EgOSUtils::sAppSpec.OSSpec())->vRefNum; + pb.hFileInfo.ioDirID = ((FSSpec *)EgOSUtils::sAppSpec.OSSpec())->parID; + pb.hFileInfo.ioFDirIndex = 0; + + ::PBGetCatInfoSync(&pb); + spec.vRefNum = pb.hFileInfo.ioVRefNum; + spec.parID = pb.hFileInfo.ioDirID; + spec.name[0] = 0; + Assign(&spec, 0); +#endif -void CEgFileSpec::AssignFolder( const char* inFolderName ) { - - #ifdef EG_MAC - CInfoPBRec pb; - FSSpec spec; - Str255 name; - - UtilStr path; - if ( inFolderName[ 0 ] != ':' ) - path.Append( ':' ); - path.Append( inFolderName ); - path.copyTo( name, 255 ); - pb.hFileInfo.ioNamePtr = name; - pb.hFileInfo.ioVRefNum = ( (FSSpec*) EgOSUtils::sAppSpec.OSSpec() ) -> vRefNum; - pb.hFileInfo.ioDirID = ( (FSSpec*) EgOSUtils::sAppSpec.OSSpec() ) -> parID; - pb.hFileInfo.ioFDirIndex = 0; - - ::PBGetCatInfoSync( &pb ); - spec.vRefNum = pb.hFileInfo.ioVRefNum; - spec.parID = pb.hFileInfo.ioDirID; - spec.name[0] = 0; - Assign( &spec, 0 ); - #endif - - #if defined(EG_WIN) || defined(UNIX_X) - mSpecData.Assign( (char*) EgOSUtils::sAppSpec.OSSpec() ); +#if defined(EG_WIN) || defined(UNIX_X) + mSpecData.Assign((char *)EgOSUtils::sAppSpec.OSSpec()); #if 0 /* FIXME why the DIRSEP at the start */ if ( inFolderName[ 0 ] != DIRSEP && mSpecData.getChar( mSpecData.length() ) != DIRSEP ) mSpecData.Append( DIRSEP ); #endif - mSpecData.Append( inFolderName ); - if ( mSpecData.getChar( mSpecData.length() ) != DIRSEP ) - mSpecData.Append( DIRSEP ); - #endif + mSpecData.Append(inFolderName); + if (mSpecData.getChar(mSpecData.length()) != DIRSEP) + mSpecData.Append(DIRSEP); +#endif } - - - - long CEgFileSpec::GetType() const { - #ifdef EG_MAC - return mFileType; - #endif - - #if defined(EG_WIN) || defined(UNIX_X) - unsigned long i, j, len, type = 0; - - len = mSpecData.length(); - i = mSpecData.FindLastInstanceOf( '.' ); - #if defined(EG_WIN) - j = mSpecData.FindLastInstanceOf( '\\' ); - #elif defined(UNIX_X) - j = mSpecData.FindLastInstanceOf( '/' ); - #endif - - if ( i > 0 && len - i <= 3 && j < i ) { - for ( j = i; j <= len; j++ ) - type = ( type << 8 ) | mSpecData.getChar( j ); - } - - return type; - #endif - -} - +#ifdef EG_MAC + return mFileType; +#endif +#if defined(EG_WIN) || defined(UNIX_X) + unsigned long i, j, len, type = 0; + len = mSpecData.length(); + i = mSpecData.FindLastInstanceOf('.'); +#if defined(EG_WIN) + j = mSpecData.FindLastInstanceOf('\\'); +#elif defined(UNIX_X) + j = mSpecData.FindLastInstanceOf('/'); +#endif + if (i > 0 && len - i <= 3 && j < i) { + for (j = i; j <= len; j++) + type = (type << 8) | mSpecData.getChar(j); + } -void CEgFileSpec::SetType( long inType ) { - mFileType = inType; + return type; +#endif } - - - +void CEgFileSpec::SetType(long inType) { mFileType = inType; } void CEgFileSpec::Delete() const { - - if ( OSSpec() ) { - #ifdef EG_MAC - ::FSpDelete( (FSSpec*) mSpecData.getCStr() ); - #endif - #if defined(EG_WIN) - remove( mSpecData.getCStr() ); - #endif - #if defined(UNIX_X) - unlink( mSpecData.getCStr() ); - #endif - } -} - - - - - -void CEgFileSpec::Rename( const UtilStr& inNewName ) { - - - #ifdef EG_MAC - inNewName.copyTo( ((FSSpec*) OSSpec()) -> name, 32 ); - #endif - - #if defined(EG_WIN) || defined(UNIX_X) - int pos; - pos = mSpecData.FindLastInstanceOf( DIRSEP ); - mSpecData.Trunc( mSpecData.length() - pos ); - mSpecData.Append( inNewName ); - #endif + if (OSSpec()) { +#ifdef EG_MAC + ::FSpDelete((FSSpec *)mSpecData.getCStr()); +#endif +#if defined(EG_WIN) + remove(mSpecData.getCStr()); +#endif +#if defined(UNIX_X) + unlink(mSpecData.getCStr()); +#endif + } } +void CEgFileSpec::Rename(const UtilStr &inNewName) { +#ifdef EG_MAC + inNewName.copyTo(((FSSpec *)OSSpec())->name, 32); +#endif -void CEgFileSpec::MakeUnique() { - UtilStr origName, newName; - long i; - - // Make a copy of the original file name - GetFileName( origName ); - #if EG_MAC - origName.Keep( 29 ); - #endif - origName.Append( " " ); - - // Once this spec isn't taken/used, then we're done - for ( i = 1; i < 10000 && Exists(); i++ ) { - newName.Assign( origName ); - newName.Append( i ); - Rename( newName ); - } +#if defined(EG_WIN) || defined(UNIX_X) + int pos; + pos = mSpecData.FindLastInstanceOf(DIRSEP); + mSpecData.Trunc(mSpecData.length() - pos); + mSpecData.Append(inNewName); +#endif } +void CEgFileSpec::MakeUnique() { + UtilStr origName, newName; + long i; -void CEgFileSpec::GetFileName( UtilStr& outFileName ) const { - int pos; - - outFileName.Wipe(); - - if ( OSSpec() ) { - #ifdef EG_MAC - outFileName.Assign( ((FSSpec*) OSSpec()) -> name ); - #endif - #if defined(EG_WIN) || defined(UNIX_X) - - // If it's a folder, temporarily remove the end '\' - long len = mSpecData.length(); - bool isFolder = mSpecData.getChar( len ) == DIRSEP; - if ( isFolder ) { - pos = mSpecData.FindPrevInstanceOf( len - 1, DIRSEP ); - outFileName.Assign( mSpecData.getCStr() + pos, len - pos - 1 ); - } - else { - pos = mSpecData.FindLastInstanceOf( DIRSEP ); - outFileName.Assign( mSpecData.getCStr() + pos ); - } - #endif - } - - pos = outFileName.FindLastInstanceOf( '.' ); // Find where ext begins - - if ( pos > 0 ) - outFileName.Keep( pos - 1 ); // Strip extension + // Make a copy of the original file name + GetFileName(origName); +#if EG_MAC + origName.Keep(29); +#endif + origName.Append(" "); + + // Once this spec isn't taken/used, then we're done + for (i = 1; i < 10000 && Exists(); i++) { + newName.Assign(origName); + newName.Append(i); + Rename(newName); + } } +void CEgFileSpec::GetFileName(UtilStr &outFileName) const { + int pos; + outFileName.Wipe(); + if (OSSpec()) { +#ifdef EG_MAC + outFileName.Assign(((FSSpec *)OSSpec())->name); +#endif +#if defined(EG_WIN) || defined(UNIX_X) + + // If it's a folder, temporarily remove the end '\' + long len = mSpecData.length(); + bool isFolder = mSpecData.getChar(len) == DIRSEP; + if (isFolder) { + pos = mSpecData.FindPrevInstanceOf(len - 1, DIRSEP); + outFileName.Assign(mSpecData.getCStr() + pos, len - pos - 1); + } else { + pos = mSpecData.FindLastInstanceOf(DIRSEP); + outFileName.Assign(mSpecData.getCStr() + pos); + } +#endif + } + pos = outFileName.FindLastInstanceOf('.'); // Find where ext begins - -void CEgFileSpec::SaveAs( const CEgFileSpec& inDestSpec ) const { - - if ( OSSpec() && inDestSpec.OSSpec() ) { - #ifdef EG_MAC - ::FSpExchangeFiles ( (FSSpec*) OSSpec(), (FSSpec*) inDestSpec.OSSpec() ); - Delete(); - #endif - #if defined(EG_WIN) || defined(UNIX_X) - inDestSpec.Delete(); - rename( (char*) OSSpec(), (char*) inDestSpec.OSSpec() ); - #endif - } + if (pos > 0) + outFileName.Keep(pos - 1); // Strip extension } +void CEgFileSpec::SaveAs(const CEgFileSpec &inDestSpec) const { - -int CEgFileSpec::Exists() const { - CEgIFile iFile; - - #if EG_MAC - OSErr err; - HFileInfo pb; - FSSpec* spec = (FSSpec*) OSSpec(); - UtilStr fname; - - // Prep a str to receive un updated name change - fname.Dim( 40 ); - fname.Assign( spec -> name ); - - // See if we have a file - pb.ioDirID = spec -> parID; - pb.ioVRefNum = spec -> vRefNum; - pb.ioNamePtr = fname.getPasStr(); - pb.ioFDirIndex = 0; - err = ::PBGetCatInfoSync( (CInfoPBRec*) &pb ); - if ( err == noErr ) - return 1; - - // See if we have a dir - pb.ioDirID = spec -> parID; - pb.ioVRefNum = spec -> vRefNum; - pb.ioFDirIndex = -1; - err = ::PBGetCatInfoSync( (CInfoPBRec*) &pb ); - if ( err == noErr && fname.compareTo( spec -> name, false ) == 0 ) - return 2; - #endif - - #if EG_WIN - long attribs = ::GetFileAttributes( (char*) OSSpec() ); - - if ( attribs & FILE_ATTRIBUTE_DIRECTORY ) - return 2; - else if ( attribs & FILE_ATTRIBUTE_NORMAL ) - return 1; - #endif - - #ifdef UNIX_X - struct stat statdata; - if (stat((char *) OSSpec(), &statdata) != 0) - return 0; - if (S_ISDIR(statdata.st_mode)) - return 2; - else if (S_ISREG(statdata.st_mode)) - return 1; - #endif - - return 0; + if (OSSpec() && inDestSpec.OSSpec()) { +#ifdef EG_MAC + ::FSpExchangeFiles((FSSpec *)OSSpec(), (FSSpec *)inDestSpec.OSSpec()); + Delete(); +#endif +#if defined(EG_WIN) || defined(UNIX_X) + inDestSpec.Delete(); + rename((char *)OSSpec(), (char *)inDestSpec.OSSpec()); +#endif + } } +int CEgFileSpec::Exists() const { + CEgIFile iFile; + +#if EG_MAC + OSErr err; + HFileInfo pb; + FSSpec *spec = (FSSpec *)OSSpec(); + UtilStr fname; + + // Prep a str to receive un updated name change + fname.Dim(40); + fname.Assign(spec->name); + + // See if we have a file + pb.ioDirID = spec->parID; + pb.ioVRefNum = spec->vRefNum; + pb.ioNamePtr = fname.getPasStr(); + pb.ioFDirIndex = 0; + err = ::PBGetCatInfoSync((CInfoPBRec *)&pb); + if (err == noErr) + return 1; + + // See if we have a dir + pb.ioDirID = spec->parID; + pb.ioVRefNum = spec->vRefNum; + pb.ioFDirIndex = -1; + err = ::PBGetCatInfoSync((CInfoPBRec *)&pb); + if (err == noErr && fname.compareTo(spec->name, false) == 0) + return 2; +#endif +#if EG_WIN + long attribs = ::GetFileAttributes((char *)OSSpec()); -CEgErr CEgFileSpec::Duplicate( const CEgFileSpec& inDestSpec ) const { - CEgIOFile oFile; - CEgIFile iFile; - - // Open the source and destination files - iFile.open( this ); - iFile.seek( 0 ); - if ( ! iFile.noErr() ) - oFile.open( &inDestSpec ); - - long pos = 0, numBytes; - long size = iFile.size(); - CEgErr err; - - // Copy the file in 50k chunks - while ( pos < size && oFile.noErr() && iFile.noErr() ) { - numBytes = 50000; - if ( numBytes + pos > size ) - numBytes = size - pos; - oFile.CEgOStream::PutBlock( iFile, numBytes ); - pos += numBytes; - } - - if ( iFile.noErr() ) - err = oFile; - else - err = iFile; - - return err; -} - - + if (attribs & FILE_ATTRIBUTE_DIRECTORY) + return 2; + else if (attribs & FILE_ATTRIBUTE_NORMAL) + return 1; +#endif +#ifdef UNIX_X + struct stat statdata; + if (stat((char *)OSSpec(), &statdata) != 0) + return 0; + if (S_ISDIR(statdata.st_mode)) + return 2; + else if (S_ISREG(statdata.st_mode)) + return 1; +#endif -void CEgFileSpec::ChangeExt( const char* inExt ) { - UtilStr fileName; - long len; - - GetFileName( fileName ); - fileName.Append( '.' ); - len = fileName.length(); - fileName.Append( inExt ); - fileName.Keep( len + 3 ); - Rename( fileName ); - + return 0; } +CEgErr CEgFileSpec::Duplicate(const CEgFileSpec &inDestSpec) const { + CEgIOFile oFile; + CEgIFile iFile; + + // Open the source and destination files + iFile.open(this); + iFile.seek(0); + if (!iFile.noErr()) + oFile.open(&inDestSpec); + + long pos = 0, numBytes; + long size = iFile.size(); + CEgErr err; + + // Copy the file in 50k chunks + while (pos < size && oFile.noErr() && iFile.noErr()) { + numBytes = 50000; + if (numBytes + pos > size) + numBytes = size - pos; + oFile.CEgOStream::PutBlock(iFile, numBytes); + pos += numBytes; + } + + if (iFile.noErr()) + err = oFile; + else + err = iFile; + + return err; +} +void CEgFileSpec::ChangeExt(const char *inExt) { + UtilStr fileName; + long len; + GetFileName(fileName); + fileName.Append('.'); + len = fileName.length(); + fileName.Append(inExt); + fileName.Keep(len + 3); + Rename(fileName); +} +const void *CEgFileSpec::OSSpec() const { -const void* CEgFileSpec::OSSpec() const { - - if ( mSpecData.length() > 0 ) - return mSpecData.getCStr(); - else - return 0; + if (mSpecData.length() > 0) + return mSpecData.getCStr(); + else + return 0; } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIFile.cpp b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIFile.cpp index 9285ff76c..7cddd4068 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIFile.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIFile.cpp @@ -2,309 +2,253 @@ #include "CEgFileSpec.h" - #include "EgOSUtils.h" - - - - - #ifdef EG_MAC #include #include -#define __OSROpen( specPtr ) short int refNum; \ - mOSErr = ::FSpOpenDF( (FSSpec*) specPtr -> OSSpec(), fsRdPerm, &refNum ); \ - if ( mOSErr == ::noErr ) \ - mFile = refNum; - -#define __OSClose mOSErr = ::FSClose( mFile ); \ - if ( mOSErr != ::noErr ) \ - throwErr( cCloseErr ); - - -#define __OSRead( destPtr, ioBytes ) OSErr err = ::FSRead( mFile, &ioBytes, destPtr ); \ - if ( err != ::noErr && err != eofErr ) { \ - throwErr( cReadErr ); \ - mOSErr = err; \ - } +#define __OSROpen(specPtr) \ + short int refNum; \ + mOSErr = ::FSpOpenDF((FSSpec *)specPtr->OSSpec(), fsRdPerm, &refNum); \ + if (mOSErr == ::noErr) \ + mFile = refNum; + +#define __OSClose \ + mOSErr = ::FSClose(mFile); \ + if (mOSErr != ::noErr) \ + throwErr(cCloseErr); + +#define __OSRead(destPtr, ioBytes) \ + OSErr err = ::FSRead(mFile, &ioBytes, destPtr); \ + if (err != ::noErr && err != eofErr) { \ + throwErr(cReadErr); \ + mOSErr = err; \ + } #endif - - - - #if defined(EG_WIN16) || defined(UNIX_X) #include -#define __OSROpen( specPtr ) mFile = (long) fopen( (char*) (specPtr -> OSSpec()), "rb" ); \ - - -#define __OSClose if ( fclose( (FILE*) mFile ) != 0 ) { \ - throwErr( cCloseErr ); \ - } - - -#define __OSRead( destPtr, ioBytes ) unsigned long outRead = fread( destPtr, 1, ioBytes, (FILE*) mFile ); \ - if ( outRead > 0 || ioBytes == 0 ) \ - ioBytes = outRead; \ - else { \ - ioBytes = 0; \ - if (feof((FILE *) mFile)) { \ - clearerr((FILE *) mFile); \ - } else if (ferror((FILE *) mFile)) { \ - clearerr((FILE *) mFile); throwErr( cReadErr ); \ - } \ - } +#define __OSROpen(specPtr) \ + mFile = (long)fopen((char *)(specPtr->OSSpec()), "rb"); + +#define __OSClose \ + if (fclose((FILE *)mFile) != 0) { \ + throwErr(cCloseErr); \ + } + +#define __OSRead(destPtr, ioBytes) \ + unsigned long outRead = fread(destPtr, 1, ioBytes, (FILE *)mFile); \ + if (outRead > 0 || ioBytes == 0) \ + ioBytes = outRead; \ + else { \ + ioBytes = 0; \ + if (feof((FILE *)mFile)) { \ + clearerr((FILE *)mFile); \ + } else if (ferror((FILE *)mFile)) { \ + clearerr((FILE *)mFile); \ + throwErr(cReadErr); \ + } \ + } #endif - - - #ifdef EG_WIN32 - #ifndef EG_ZINC -#include // Otherwise a weird compile err deep in windows.h occurs +#include // Otherwise a weird compile err deep in windows.h occurs #endif #include - -#define __OSROpen( specPtr ) mFile = (long) ::CreateFile( (char*) (specPtr -> OSSpec()), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0 ); \ - if ( ((void*) mFile) == INVALID_HANDLE_VALUE ) { \ - mFile = 0; \ - mOSErr = ::GetLastError(); \ - } - -#define __OSClose if ( ! ::CloseHandle( (void*) mFile ) ) { \ - throwErr( cCloseErr ); \ - mOSErr = ::GetLastError(); \ - } - - -#define __OSRead( destPtr, ioBytes ) DWORD outRead; \ - if ( ::ReadFile( (void*) mFile, destPtr, ioBytes, &outRead, 0 ) ) \ - ioBytes = outRead; \ - else { \ - throwErr( cReadErr ); \ - mOSErr = ::GetLastError(); \ - } +#define __OSROpen(specPtr) \ + mFile = (long)::CreateFile((char *)(specPtr->OSSpec()), GENERIC_READ, 0, 0, \ + OPEN_EXISTING, 0, 0); \ + if (((void *)mFile) == INVALID_HANDLE_VALUE) { \ + mFile = 0; \ + mOSErr = ::GetLastError(); \ + } + +#define __OSClose \ + if (!::CloseHandle((void *)mFile)) { \ + throwErr(cCloseErr); \ + mOSErr = ::GetLastError(); \ + } + +#define __OSRead(destPtr, ioBytes) \ + DWORD outRead; \ + if (::ReadFile((void *)mFile, destPtr, ioBytes, &outRead, 0)) \ + ioBytes = outRead; \ + else { \ + throwErr(cReadErr); \ + mOSErr = ::GetLastError(); \ + } #endif +CEgIFile::CEgIFile(unsigned short int inBufSize) + : CEgIStream(inBufSize), mFile(0) {} - - -CEgIFile::CEgIFile( unsigned short int inBufSize ) : - CEgIStream( inBufSize ), - mFile( 0 ) { - -} - - - - - - -CEgIFile::~CEgIFile() { - - close(); -} - - - - - - - - - - +CEgIFile::~CEgIFile() { close(); } void CEgIFile::close() { - if ( is_open() ) { - __OSClose + if (is_open()) { + __OSClose - mFile = 0; - invalidateBuf(); - } + mFile = 0; + invalidateBuf(); + } } +void CEgIFile::open(const CEgFileSpec *inSpec) { + close(); + throwErr(cNoErr); + mPos = 0; + if (inSpec) { + __OSROpen(inSpec) + } - -void CEgIFile::open( const CEgFileSpec* inSpec ) { - - close(); - throwErr( cNoErr ); - mPos = 0; - - if ( inSpec ) { - __OSROpen( inSpec ) - } - - if ( mFile == 0 ) { - #if EG_MAC - if ( mOSErr == fnfErr ) - #elif EG_WIN - if ( mOSErr == ERROR_FILE_NOT_FOUND || mOSErr == ERROR_PATH_NOT_FOUND ) - #else - if (0) /* FIXME */ - #endif - throwErr( cFileNotFound ); - else - throwErr( cOpenErr ); - } - + if (mFile == 0) { +#if EG_MAC + if (mOSErr == fnfErr) +#elif EG_WIN + if (mOSErr == ERROR_FILE_NOT_FOUND || mOSErr == ERROR_PATH_NOT_FOUND) +#else + if (0) /* FIXME */ +#endif + throwErr(cFileNotFound); + else + throwErr(cOpenErr); + } } +void CEgIFile::open(const char *inFileName) { + CEgFileSpec fileSpec(inFileName); - -void CEgIFile::open( const char* inFileName ) { - CEgFileSpec fileSpec( inFileName ); - - open( &fileSpec ); + open(&fileSpec); } - - long CEgIFile::size() { - long retSize = 0; - long curPos = tell(); - - if ( mFile ) { - - #ifdef EG_MAC - ::GetEOF( mFile, &retSize ); - #endif - - #ifdef EG_WIN16 - if ( fseek( (FILE*) mFile, 0, SEEK_CUR ) == 0 ) - retSize = ftell( (FILE*) mFile ); - #endif - - #ifdef EG_WIN32 - retSize = ::SetFilePointer( (void*) mFile, 0, 0, FILE_END ); - #endif - } - - if ( curPos >= 0 && curPos <= retSize ) - seek( curPos ); - - return retSize; -} - + long retSize = 0; + long curPos = tell(); + if (mFile) { -void CEgIFile::seek( long inPos ) { - - mNextPtr = getCStr() + inPos - mBufPos; - mPos = inPos; -} - +#ifdef EG_MAC + ::GetEOF(mFile, &retSize); +#endif +#ifdef EG_WIN16 + if (fseek((FILE *)mFile, 0, SEEK_CUR) == 0) + retSize = ftell((FILE *)mFile); +#endif +#ifdef EG_WIN32 + retSize = ::SetFilePointer((void *)mFile, 0, 0, FILE_END); +#endif + } -long CEgIFile::tell() { + if (curPos >= 0 && curPos <= retSize) + seek(curPos); - return mPos; + return retSize; } +void CEgIFile::seek(long inPos) { - -void CEgIFile::seekEnd() { - - seek( size() ); + mNextPtr = getCStr() + inPos - mBufPos; + mPos = inPos; } +long CEgIFile::tell() { return mPos; } +void CEgIFile::seekEnd() { seek(size()); } -void CEgIFile::diskSeek( long inPos ) { +void CEgIFile::diskSeek(long inPos) { - if ( noErr() && mFile ) { + if (noErr() && mFile) { - #ifdef EG_MAC - mOSErr = ::SetFPos( mFile, fsFromStart, inPos ); - if ( mOSErr != ::noErr ) - throwErr( cSeekErr ); - #endif +#ifdef EG_MAC + mOSErr = ::SetFPos(mFile, fsFromStart, inPos); + if (mOSErr != ::noErr) + throwErr(cSeekErr); +#endif - #ifdef EG_WIN16 - fseek( (FILE*) mFile, inPos, SEEK_SET ); - if ( ferror( (FILE*) mFile ) ) - throwErr( cSeekErr ); - #endif +#ifdef EG_WIN16 + fseek((FILE *)mFile, inPos, SEEK_SET); + if (ferror((FILE *)mFile)) + throwErr(cSeekErr); +#endif - #ifdef EG_WIN32 - if ( ::SetFilePointer( (void*) mFile, inPos, 0, FILE_BEGIN ) != inPos ) - throwErr( cSeekErr ); - #endif - } +#ifdef EG_WIN32 + if (::SetFilePointer((void *)mFile, inPos, 0, FILE_BEGIN) != inPos) + throwErr(cSeekErr); +#endif + } } +void CEgIFile::fillBlock(unsigned long inStartPos, void *destPtr, + long &ioBytes) { + if (!mFile) + throwErr(cNotOpen); -void CEgIFile::fillBlock( unsigned long inStartPos, void* destPtr, long& ioBytes ) { - - if ( ! mFile ) - throwErr( cNotOpen ); + diskSeek(inStartPos); - diskSeek( inStartPos ); + if (noErr() && ioBytes > 0) { - if ( noErr() && ioBytes > 0 ) { - - __OSRead( destPtr, ioBytes ) - - - if ( noErr() && ioBytes <= 0 ) - throwErr( cEOFErr ); - } + __OSRead(destPtr, ioBytes) + if (noErr() && ioBytes <= 0) throwErr(cEOFErr); + } } +void CEgIFile::Search(UtilStr &inSearchStr, void *inProcArg, + bool inCaseSensitive, AddHitFcnT inAddHitFcn) { + unsigned char *buf = new unsigned char[cSearchBufSize]; + unsigned char *curPtr, *endPtr; + unsigned char srchChar, srchCharLC, c; + unsigned long strLen = inSearchStr.length(); + unsigned long bufLen, bufPos = 0, fileSize = size(); + + srchChar = inSearchStr.getChar(1); + if (srchChar >= 'a' && srchChar <= 'z') + srchChar -= 32; + srchCharLC = srchChar + 32; + + while (noErr() && bufPos + strLen < fileSize) { + EgOSUtils::SpinCursor(); + seek(bufPos); + bufLen = GetBlock(buf, cSearchBufSize); + if (bufLen >= strLen) { + curPtr = buf; + endPtr = buf + bufLen - strLen; + while (curPtr <= endPtr) { + c = *curPtr; + if ((c == srchChar) || (c == srchCharLC)) { + if (UtilStr::StrCmp(inSearchStr.getCStr(), (char *)curPtr, strLen, + inCaseSensitive) == 0) { + long reqSkip = inAddHitFcn( + inProcArg, + bufPos + curPtr - + buf); // Add hit and If client told us to abort search... + if (reqSkip < 0) { + curPtr = endPtr; // Exit inner loop + bufPos = fileSize; + } // Exit block reading loop + else + curPtr += reqSkip; + } + } + curPtr++; + } + bufPos += curPtr - buf + 1; + } + } - -void CEgIFile::Search( UtilStr& inSearchStr, void* inProcArg, bool inCaseSensitive, AddHitFcnT inAddHitFcn ) { - unsigned char* buf = new unsigned char[ cSearchBufSize ]; - unsigned char* curPtr, *endPtr; - unsigned char srchChar, srchCharLC, c; - unsigned long strLen = inSearchStr.length(); - unsigned long bufLen, bufPos = 0, fileSize = size(); - - srchChar = inSearchStr.getChar( 1 ); - if ( srchChar >= 'a' && srchChar <= 'z' ) - srchChar -= 32; - srchCharLC = srchChar + 32; - - while ( noErr() && bufPos + strLen < fileSize ) { - EgOSUtils::SpinCursor(); - seek( bufPos ); - bufLen = GetBlock( buf, cSearchBufSize ); - if ( bufLen >= strLen ) { - curPtr = buf; - endPtr = buf + bufLen - strLen; - while ( curPtr <= endPtr ) { - c = *curPtr; - if ( (c == srchChar) || (c == srchCharLC) ) { - if ( UtilStr::StrCmp( inSearchStr.getCStr(), (char*) curPtr, strLen, inCaseSensitive ) == 0 ) { - long reqSkip = inAddHitFcn( inProcArg, bufPos + curPtr - buf ); // Add hit and If client told us to abort search... - if ( reqSkip < 0 ) { - curPtr = endPtr; // Exit inner loop - bufPos = fileSize; } // Exit block reading loop - else - curPtr += reqSkip; - } - } - curPtr++; - } - bufPos += curPtr - buf + 1; - } - } - - delete []buf; + delete[] buf; } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIOFile.cpp b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIOFile.cpp index 9c89d2522..5789edee8 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIOFile.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIOFile.cpp @@ -1,233 +1,187 @@ #include "CEgIOFile.h" - #include "CEgFileSpec.h" - long CEgIOFile::sCreatorType = 0x3f3f3f3f; +CEgIOFile::CEgIOFile(int inDoTrunc, long inOBufSize) : mDoTrunc(inDoTrunc) { + mDoTrunc = inDoTrunc; + mOBufSize = inOBufSize; -CEgIOFile::CEgIOFile( int inDoTrunc, long inOBufSize ) : - mDoTrunc( inDoTrunc ) { - mDoTrunc = inDoTrunc; - mOBufSize = inOBufSize; - - if ( mOBufSize < 100 ) - mOBufSize = 100; + if (mOBufSize < 100) + mOBufSize = 100; } - - - -CEgIOFile::~CEgIOFile() { - - close(); -} - - +CEgIOFile::~CEgIOFile() { close(); } #ifdef EG_MAC #include #include -#define __OSWOpen( specPtr ) short int refNum; \ - short err = ::FSpCreate( (FSSpec*) inSpecPtr -> OSSpec(), sCreatorType, inSpecPtr -> GetType(), -1 ); \ - if ( err != ::noErr && err != dupFNErr ) { \ - throwErr( cCreateErr ); \ - CEgOStream::mOSErr = err; } \ - else { \ - CEgOStream::mOSErr = ::FSpOpenDF( (FSSpec*) specPtr -> OSSpec(), fsRdWrPerm, &refNum ); \ - if ( CEgOStream::mOSErr == ::noErr ) \ - mFile = refNum; \ - } - - -#define __OSWrite( srcePtr, ioBytes ) CEgOStream::mOSErr = ::FSWrite( mFile, &ioBytes, srcePtr ); \ - if ( CEgOStream::mOSErr != ::noErr ) \ - throwErr( cWriteErr ); - - - +#define __OSWOpen(specPtr) \ + short int refNum; \ + short err = ::FSpCreate((FSSpec *)inSpecPtr->OSSpec(), sCreatorType, \ + inSpecPtr->GetType(), -1); \ + if (err != ::noErr && err != dupFNErr) { \ + throwErr(cCreateErr); \ + CEgOStream::mOSErr = err; \ + } else { \ + CEgOStream::mOSErr = \ + ::FSpOpenDF((FSSpec *)specPtr->OSSpec(), fsRdWrPerm, &refNum); \ + if (CEgOStream::mOSErr == ::noErr) \ + mFile = refNum; \ + } + +#define __OSWrite(srcePtr, ioBytes) \ + CEgOStream::mOSErr = ::FSWrite(mFile, &ioBytes, srcePtr); \ + if (CEgOStream::mOSErr != ::noErr) \ + throwErr(cWriteErr); #endif - - - - - - - - #if defined(EG_WIN16) || defined(UNIX_X) #include -#define __OSWOpen( specPtr ) mFile = (long) fopen( (char*) (specPtr -> OSSpec()), "w+b" ); +#define __OSWOpen(specPtr) \ + mFile = (long)fopen((char *)(specPtr->OSSpec()), "w+b"); -#define __OSWrite( srcePtr, ioBytes ) unsigned long int wrote = fwrite( srcePtr, 1, ioBytes, (FILE*) mFile ); \ - if ( wrote > 0 || ioBytes == 0 ) \ - ioBytes = wrote; \ - else { \ - throwErr( cWriteErr ); \ - } +#define __OSWrite(srcePtr, ioBytes) \ + unsigned long int wrote = fwrite(srcePtr, 1, ioBytes, (FILE *)mFile); \ + if (wrote > 0 || ioBytes == 0) \ + ioBytes = wrote; \ + else { \ + throwErr(cWriteErr); \ + } #endif - - - - #ifdef EG_WIN32 #ifndef EG_ZINC -#include // Otherwise a weird compile err deep in windows.h occurs +#include // Otherwise a weird compile err deep in windows.h occurs #endif #include - - -#define __OSWOpen( specPtr ) mFile = (long) ::CreateFile( (char*) (specPtr -> OSSpec()), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_ALWAYS, 0, 0 ); \ - if ( ((void*) mFile) == INVALID_HANDLE_VALUE ) { \ - mFile = 0; \ - mOSErr = ::GetLastError(); \ - } - - - -#define __OSWrite( srcePtr, ioBytes ) DWORD wrote; \ - bool ok = ::WriteFile( (void*) mFile, srcePtr, ioBytes, &wrote, 0 ); \ - if ( ! ok || ioBytes != wrote ) { \ - throwErr( cWriteErr ); \ - mOSErr = ::GetLastError(); \ - } +#define __OSWOpen(specPtr) \ + mFile = (long)::CreateFile((char *)(specPtr->OSSpec()), \ + GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_ALWAYS, \ + 0, 0); \ + if (((void *)mFile) == INVALID_HANDLE_VALUE) { \ + mFile = 0; \ + mOSErr = ::GetLastError(); \ + } + +#define __OSWrite(srcePtr, ioBytes) \ + DWORD wrote; \ + bool ok = ::WriteFile((void *)mFile, srcePtr, ioBytes, &wrote, 0); \ + if (!ok || ioBytes != wrote) { \ + throwErr(cWriteErr); \ + mOSErr = ::GetLastError(); \ + } #endif +void CEgIOFile::open(const CEgFileSpec *inSpecPtr) { + close(); + throwErr(cNoErr); -void CEgIOFile::open( const CEgFileSpec* inSpecPtr ) { - - close(); - throwErr( cNoErr ); - - if ( inSpecPtr ) { - if ( mDoTrunc ) - inSpecPtr -> Delete(); + if (inSpecPtr) { + if (mDoTrunc) + inSpecPtr->Delete(); - __OSWOpen( inSpecPtr ) - } + __OSWOpen(inSpecPtr) + } - if ( mFile == 0 ) { - #if EG_MAC - if ( mOSErr == fnfErr ) - #elif defined(UNIX_X) - if (0) /* FIXME */ - #else - if ( mOSErr == ERROR_FILE_NOT_FOUND ) - #endif - throwErr( cFileNotFound ); - else - throwErr( cOpenErr ); - } + if (mFile == 0) { +#if EG_MAC + if (mOSErr == fnfErr) +#elif defined(UNIX_X) + if (0) /* FIXME */ +#else + if (mOSErr == ERROR_FILE_NOT_FOUND) +#endif + throwErr(cFileNotFound); + else + throwErr(cOpenErr); + } } +void CEgIOFile::PutBlock(const void *inSrce, long numBytes) { + CEgIFile::skip(numBytes); // Keep mPos up to date + // If we don't want to exceed our buffer limit... + if (numBytes + (long)mOBuf.length() > + mOBufSize) { // Uh oh, we actually have to write to disk + // Get rid of what we have waiting first + flush(); - - -void CEgIOFile::PutBlock( const void* inSrce, long numBytes ) { - - CEgIFile::skip( numBytes ); // Keep mPos up to date - - // If we don't want to exceed our buffer limit... - if ( numBytes + (long) mOBuf.length() > mOBufSize ) { // Uh oh, we actually have to write to disk - // Get rid of what we have waiting first - flush(); - - if ( numBytes > mOBufSize /4 && noErr() ) { - __OSWrite( inSrce, numBytes ) } - else - CEgOStream::PutBlock( inSrce, numBytes ); } - else - CEgOStream::PutBlock( inSrce, numBytes ); + if (numBytes > mOBufSize / 4 && noErr()) { + __OSWrite(inSrce, numBytes) + } else + CEgOStream::PutBlock(inSrce, numBytes); + } else + CEgOStream::PutBlock(inSrce, numBytes); } - /* void CEgIOFile::PutBlock( const void* inSrce, long numBytes ) { - CEgIFile::skip( numBytes ); // Keep mPos up to date - if ( numBytes + (long) mOBuf.length() >= cMaxOBufSize ) // Uh oh, we actually have to write to disk - flush(); // Dump our buf to disk + CEgIFile::skip( numBytes ); +// Keep mPos up to date if ( numBytes + (long) mOBuf.length() >= cMaxOBufSize ) +// Uh oh, we actually have to write to disk flush(); +// Dump our buf to disk - while ( numBytes > cMaxOBufSize ) { // We do this loop crap because to avoid code duplication/maintainance and - PutBlock( inSrce, cMaxOBufSize ); // to avoid giving OSWrite a 0 srce ptr (which is perfectly valid from a skip call) - if ( inSrce ) - inSrce = (char*) inSrce + cMaxOBufSize; - numBytes -= cMaxOBufSize; - } + while ( numBytes > cMaxOBufSize ) { +// We do this loop crap because to avoid code duplication/maintainance and + PutBlock( inSrce, cMaxOBufSize ); +// to avoid giving OSWrite a 0 srce ptr (which is perfectly valid from a skip +call) if ( inSrce ) inSrce = (char*) inSrce + cMaxOBufSize; numBytes -= +cMaxOBufSize; + } - CEgOStream::PutBlock( inSrce, numBytes ); + CEgOStream::PutBlock( inSrce, numBytes ); } */ - - - - - void CEgIOFile::flush() { - long ioBytes = mOBuf.length(); - - if ( ! mFile ) - throwErr( cNotOpen ); - else if ( ioBytes > 0 && noErr() ) { - __OSWrite( mOBuf.getCStr(), ioBytes ) - if ( noErr() ) { - invalidateBuf(); // Invalidate read buffer - mOBuf.Wipe(); // We're done with the out buffer - } - } + long ioBytes = mOBuf.length(); + + if (!mFile) + throwErr(cNotOpen); + else if (ioBytes > 0 && noErr()) { + __OSWrite(mOBuf.getCStr(), ioBytes) if (noErr()) { + invalidateBuf(); // Invalidate read buffer + mOBuf.Wipe(); // We're done with the out buffer + } + } } - - - long CEgIOFile::size() { - flush(); + flush(); - return CEgIFile::size(); + return CEgIFile::size(); } +void CEgIOFile::seek(long inPos) { + if (noErr()) { + flush(); // Write any pending data -void CEgIOFile::seek( long inPos ) { - - if ( noErr() ) { - flush(); // Write any pending data - - if ( noErr() ) { - CEgIFile::seek( inPos ); - diskSeek( inPos ); - } - } + if (noErr()) { + CEgIFile::seek(inPos); + diskSeek(inPos); + } + } } - - - - - void CEgIOFile::close() { - if ( is_open() ) { - flush(); + if (is_open()) { + flush(); - CEgIFile::close(); - } + CEgIFile::close(); + } } - - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIStream.cpp b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIStream.cpp index e8ac37d18..8cddce87e 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIStream.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgIStream.cpp @@ -1,364 +1,294 @@ #include "CEgIStream.h" -//#include - +// #include UtilStr CEgIStream::sTemp; +CEgIStream::CEgIStream(unsigned short int inBufSize) + : mIsTied(false), mReadBufSize(inBufSize), mBufPos(0), mPos(0) { -CEgIStream::CEgIStream( unsigned short int inBufSize ) : - mIsTied( false ), - mReadBufSize ( inBufSize ), - mBufPos( 0 ), - mPos ( 0 ) { - - Wipe(); + Wipe(); } - long CEgIStream::GetLong() { - unsigned long c, n = GetByte(); + unsigned long c, n = GetByte(); - c = GetByte(); - n = n | ( c << 8 ); + c = GetByte(); + n = n | (c << 8); - c = GetByte(); - n = n | ( c << 16 ); + c = GetByte(); + n = n | (c << 16); - c = GetByte(); + c = GetByte(); - return (long) (n | ( c << 24 )); + return (long)(n | (c << 24)); } - float CEgIStream::GetFloat() { - long v = GetLong(); - return *( (float*) &v ); + long v = GetLong(); + return *((float *)&v); } - - - short int CEgIStream::GetShort() { - unsigned long n = GetByte(); + unsigned long n = GetByte(); - return (short int) ((GetByte() << 8) | n); + return (short int)((GetByte() << 8) | n); } - - - - unsigned char CEgIStream::GetByte() { - unsigned char c; - - if ( mIsTied ) { - if ( mPos != 0 ) { - c = *((unsigned char*) mNextPtr); - mNextPtr++; - mPos++; } - else - throwErr( cTiedEOS ); } - else if ( mPos < long(mBufPos + mStrLen) && mPos >= mBufPos ) { - c = *((unsigned char*) mNextPtr); - mNextPtr++; - mPos++; } - else if ( noErr() ) { - fillBuf(); - c = GetByte(); - } - - return c; + unsigned char c; + + if (mIsTied) { + if (mPos != 0) { + c = *((unsigned char *)mNextPtr); + mNextPtr++; + mPos++; + } else + throwErr(cTiedEOS); + } else if (mPos < long(mBufPos + mStrLen) && mPos >= mBufPos) { + c = *((unsigned char *)mNextPtr); + mNextPtr++; + mPos++; + } else if (noErr()) { + fillBuf(); + c = GetByte(); + } + + return c; } - - unsigned char CEgIStream::PeekByte() { - unsigned char c; - - if ( mIsTied ) { - if ( mPos != 0 ) - c = *((unsigned char*) mNextPtr); } - else if ( mPos < long(mBufPos + mStrLen) && mPos >= mBufPos ) - c = *((unsigned char*) mNextPtr); - else if ( noErr() ) { - fillBuf(); - if ( noErr() ) - c = PeekByte(); - else - throwErr( cNoErr ); - } - - return c; + unsigned char c; + + if (mIsTied) { + if (mPos != 0) + c = *((unsigned char *)mNextPtr); + } else if (mPos < long(mBufPos + mStrLen) && mPos >= mBufPos) + c = *((unsigned char *)mNextPtr); + else if (noErr()) { + fillBuf(); + if (noErr()) + c = PeekByte(); + else + throwErr(cNoErr); + } + + return c; } - - - - - - /* float CEgIStream::GetFloat() { - //ah! + //ah! } double CEgIStream::GetDbl() { - ah! + ah! } */ +void CEgIStream::Readln(UtilStr *outStr) { + unsigned char p, c = GetByte(); -void CEgIStream::Readln( UtilStr* outStr ) { - unsigned char p, c = GetByte(); - - if ( outStr ) { - outStr -> Wipe(); + if (outStr) { + outStr->Wipe(); - while ( noErr() && c != 13 && c != 10 ) { // Stop on a CR or LF or error - outStr -> Append( (char) c ); - c = GetByte(); - } + while (noErr() && c != 13 && c != 10) { // Stop on a CR or LF or error + outStr->Append((char)c); + c = GetByte(); + } - p = PeekByte(); - if ( ( p == 13 && c == 10 ) || ( p == 10 && c == 13 ) ) - GetByte(); - } + p = PeekByte(); + if ((p == 13 && c == 10) || (p == 10 && c == 13)) + GetByte(); + } } - - - void CEgIStream::Readln() { - unsigned char p, c = GetByte(); + unsigned char p, c = GetByte(); - while ( noErr() && c != 13 && c != 10 ) // Stop on a CR or LFor error - c = GetByte(); - - p = PeekByte(); - if ( ( p == 13 && c == 10 ) || ( p == 10 && c == 13 ) ) - GetByte(); + while (noErr() && c != 13 && c != 10) // Stop on a CR or LFor error + c = GetByte(); + p = PeekByte(); + if ((p == 13 && c == 10) || (p == 10 && c == 13)) + GetByte(); } - - unsigned char CEgIStream::GetByteSW() { - unsigned char c = GetByte(); + unsigned char c = GetByte(); - while ( noErr() && (c == 13 || c == 10 || c == 32 || c == 9) ) - c = GetByte(); + while (noErr() && (c == 13 || c == 10 || c == 32 || c == 9)) + c = GetByte(); - return c; + return c; } +bool CEgIStream::Read(UtilStr &outStr) { + outStr.Wipe(); -bool CEgIStream::Read( UtilStr& outStr ) { - outStr.Wipe(); - - unsigned char c = GetByteSW(); + unsigned char c = GetByteSW(); - while ( noErr() && c != 13 && c != 9 && c != 32 && c != 10 ) { // Stop on a CR, LF, TAB, space or error - outStr.Append( (char) c ); - c = GetByte(); - } - return c == 13 || c == 10; + while (noErr() && c != 13 && c != 9 && c != 32 && + c != 10) { // Stop on a CR, LF, TAB, space or error + outStr.Append((char)c); + c = GetByte(); + } + return c == 13 || c == 10; } - - void CEgIStream::Read() { - unsigned char c = GetByteSW(); + unsigned char c = GetByteSW(); - while ( noErr() && c != 13 && c != 9 && c != 32 && c != 10 ) // Stop on a CR, LF, space or error - c = GetByte(); + while (noErr() && c != 13 && c != 9 && c != 32 && + c != 10) // Stop on a CR, LF, space or error + c = GetByte(); } - - - float CEgIStream::ReadFloat() { - Read( sTemp ); - return ((float) sTemp.GetValue( 100000 )) / 100000.0; + Read(sTemp); + return ((float)sTemp.GetValue(100000)) / 100000.0; } - long CEgIStream::ReadInt() { - Read( sTemp ); - return sTemp.GetValue(); + Read(sTemp); + return sTemp.GetValue(); } - - -void CEgIStream::Read( UtilStr& outStr, unsigned long inBytes ) { - outStr.Assign( 0, inBytes ); - GetBlock( outStr.getCStr(), inBytes ); +void CEgIStream::Read(UtilStr &outStr, unsigned long inBytes) { + outStr.Assign(0, inBytes); + GetBlock(outStr.getCStr(), inBytes); } +void CEgIStream::ReadNumber(UtilStr &outStr) { + outStr.Wipe(); + char c = GetByteSW(); -void CEgIStream::ReadNumber( UtilStr& outStr ) { - - outStr.Wipe(); - char c = GetByteSW(); - - while ( noErr() && ( c == '.' || (c >= '0' && c <= '9') ) ) { - outStr.Append( c ); - c = GetByte(); - } + while (noErr() && (c == '.' || (c >= '0' && c <= '9'))) { + outStr.Append(c); + c = GetByte(); + } } +bool CEgIStream::AssertToken(const char *inStr) { + char c = GetByteSW(); + // Check first byte + if (*inStr != c || !noErr()) + return false; + inStr++; + // Make sure following bytes in the stream match inStr + while (*inStr) { + c = GetByte(); + if (*inStr != c || !noErr()) + return false; + inStr++; + } - -bool CEgIStream::AssertToken( const char* inStr ) { - char c = GetByteSW(); - - // Check first byte - if ( *inStr != c || ! noErr() ) - return false; - inStr++; - - // Make sure following bytes in the stream match inStr - while ( *inStr ) { - c = GetByte(); - if ( *inStr != c || ! noErr() ) - return false; - inStr++; - } - - return true; + return true; } - - -long CEgIStream::GetBlock( void* destPtr, unsigned long inBytes ) { - long bytesRead = inBytes; - - if ( mIsTied ) { - if ( - mPos >= long(inBytes) ) - UtilStr::Move( destPtr, mNextPtr, bytesRead ); - else { - bytesRead = 0; - throwErr( cTiedEOS ); - } } - else if ( mPos >= mBufPos && mPos + bytesRead <= long(mBufPos + mStrLen) ) - UtilStr::Move( destPtr, mNextPtr, bytesRead ); - else - fillBlock( mPos, destPtr, bytesRead ); - - mPos += bytesRead; - mNextPtr += bytesRead; - - return bytesRead; +long CEgIStream::GetBlock(void *destPtr, unsigned long inBytes) { + long bytesRead = inBytes; + + if (mIsTied) { + if (-mPos >= long(inBytes)) + UtilStr::Move(destPtr, mNextPtr, bytesRead); + else { + bytesRead = 0; + throwErr(cTiedEOS); + } + } else if (mPos >= mBufPos && mPos + bytesRead <= long(mBufPos + mStrLen)) + UtilStr::Move(destPtr, mNextPtr, bytesRead); + else + fillBlock(mPos, destPtr, bytesRead); + + mPos += bytesRead; + mNextPtr += bytesRead; + + return bytesRead; } - - void CEgIStream::fillBuf() { - long bytes = mReadBufSize; - - Dim( bytes ); - mNextPtr = getCStr(); - mBufPos = mPos; - if ( long(length()) < bytes ) // Verify that we dimmed ok - bytes = length(); - fillBlock( mPos, getCStr(), bytes ); - if ( bytes <= 0 ) - throwErr( cEOSErr ); - mStrLen = bytes; // Our str len could have only gotten shorter + long bytes = mReadBufSize; + + Dim(bytes); + mNextPtr = getCStr(); + mBufPos = mPos; + if (long(length()) < bytes) // Verify that we dimmed ok + bytes = length(); + fillBlock(mPos, getCStr(), bytes); + if (bytes <= 0) + throwErr(cEOSErr); + mStrLen = bytes; // Our str len could have only gotten shorter } - - -void CEgIStream::fillBlock( unsigned long, void*, long& ioBytes ) { - ioBytes = 0; - +void CEgIStream::fillBlock(unsigned long, void *, long &ioBytes) { + ioBytes = 0; } +void CEgIStream::invalidateBuf() { Wipe(); } +void CEgIStream::skip(long inBytes) { -void CEgIStream::invalidateBuf() { - - Wipe(); + mPos += inBytes; + mNextPtr += inBytes; } - - - -void CEgIStream::skip( long inBytes ) { - - mPos += inBytes; - mNextPtr += inBytes; -} - - - - void CEgIStream::ResetBuf() { - throwErr( cNoErr ); + throwErr(cNoErr); - mIsTied = false; - mNextPtr = getCStr(); - mBufPos = 0; - mPos = 0; + mIsTied = false; + mNextPtr = getCStr(); + mBufPos = 0; + mPos = 0; } - -void CEgIStream::Assign( const UtilStr& inSrce ) { - Assign( inSrce.getCStr(), inSrce.length() ); +void CEgIStream::Assign(const UtilStr &inSrce) { + Assign(inSrce.getCStr(), inSrce.length()); } - -void CEgIStream::Assign( void* inSource, long inBytes ) { - UtilStr::Assign( inSource, inBytes ); - ResetBuf(); +void CEgIStream::Assign(void *inSource, long inBytes) { + UtilStr::Assign(inSource, inBytes); + ResetBuf(); } +void CEgIStream::Assign(CEgIStream *inSource, long inBytes) { -void CEgIStream::Assign( CEgIStream* inSource, long inBytes ) { + if (inSource) { + Dim(inBytes); + if (long(length()) < inBytes) + inBytes = length(); + inSource->GetBlock(getCStr(), inBytes); + } - - if ( inSource ) { - Dim( inBytes ); - if ( long(length()) < inBytes ) - inBytes = length(); - inSource -> GetBlock( getCStr(), inBytes ); - } - - ResetBuf(); + ResetBuf(); } +void CEgIStream::Tie(const UtilStr *inSource) { - -void CEgIStream::Tie( const UtilStr* inSource ) { - - Tie( inSource -> getCStr(), inSource -> length() ); + Tie(inSource->getCStr(), inSource->length()); } +void CEgIStream::Tie(const char *inSrce, long inNumBytes) { + throwErr(cNoErr); + mIsTied = true; + mPos = -inNumBytes; // When mPos reaches zero, we're at tied end of stream + mNextPtr = inSrce; // Set up our data ptr + // If -1 was passed in thru inNumBytes, must calc the length of the C str. + if (inNumBytes < 0) { + mPos = 0; + while (*inSrce) { + mPos--; + inSrce++; + } + } -void CEgIStream::Tie( const char* inSrce, long inNumBytes ) { - - throwErr( cNoErr ); - mIsTied = true; - mPos = - inNumBytes; // When mPos reaches zero, we're at tied end of stream - mNextPtr = inSrce; // Set up our data ptr - - // If -1 was passed in thru inNumBytes, must calc the length of the C str. - if ( inNumBytes < 0 ) { - mPos = 0; - while ( *inSrce ) { - mPos--; - inSrce++; - } - } - - if ( ! mNextPtr ) - mPos = 0; + if (!mNextPtr) + mPos = 0; } - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgOStream.cpp b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgOStream.cpp index 7c63286fc..475d96fff 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/CEgOStream.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/CEgOStream.cpp @@ -1,130 +1,93 @@ #include "CEgOStream.h" #include "CEgIStream.h" +CEgOStream::CEgOStream() {} +void CEgOStream::PutByte(unsigned char inChar) { PutBlock(&inChar, 1); } -CEgOStream::CEgOStream() { +void CEgOStream::PutLong(long inNum) { + unsigned long int u = inNum; + PutByte((unsigned char)(u & 0xFF)); + u /= 0x100; + PutByte((unsigned char)(u & 0xFF)); + u /= 0x100; + PutByte((unsigned char)(u & 0xFF)); + PutByte((unsigned char)(u / 0x100)); } +void CEgOStream::PutShort(signed short int inNum) { + unsigned short int u = inNum; - - - - - - -void CEgOStream::PutByte( unsigned char inChar ) { - - PutBlock( &inChar, 1 ); + PutByte((unsigned char)(u & 0xFF)); + PutByte((unsigned char)(u / 0x100)); } - - - -void CEgOStream::PutLong( long inNum ) { - unsigned long int u = inNum; - - PutByte( (unsigned char) (u & 0xFF) ); - u /= 0x100; - PutByte( (unsigned char) (u & 0xFF) ); - u /= 0x100; - PutByte( (unsigned char) (u & 0xFF) ); - PutByte( (unsigned char) (u / 0x100) ); -} - - - -void CEgOStream::PutShort( signed short int inNum ) { - unsigned short int u = inNum; - - PutByte( (unsigned char) (u & 0xFF) ); - PutByte( (unsigned char) (u / 0x100) ); +void CEgOStream::Writeln(const char *inStr) { + + if (noErr()) { + Write(inStr); +#ifdef UNIX_X + PutByte(10); +#else + PutByte(13); +#endif + +// Our readln() is set up so it doesn't matter if LFs are present or not. Since +// 99% of the time, files will be edited on the platform they were made on, put +// LFs in the windows files. +#if EG_WIN + PutByte(10); +#endif + } } +void CEgOStream::Writeln(const UtilStr &inStr) { + if (noErr()) + PutBlock(inStr.getCStr(), inStr.length()); // Put string - -void CEgOStream::Writeln( const char* inStr ) { - - if ( noErr() ) { - Write( inStr ); - #ifdef UNIX_X - PutByte( 10 ); - #else - PutByte( 13 ); - #endif - - // Our readln() is set up so it doesn't matter if LFs are present or not. Since 99% of the time, - // files will be edited on the platform they were made on, put LFs in the windows files. - #if EG_WIN - PutByte( 10 ); - #endif - } - - - -} -void CEgOStream::Writeln( const UtilStr& inStr ) { - - if ( noErr() ) - PutBlock( inStr.getCStr(), inStr.length() ); // Put string - - Writeln(); - + Writeln(); } +void CEgOStream::Write(const char *inStr) { + const char *s = inStr; -void CEgOStream::Write( const char* inStr ) { - const char* s = inStr; - - if ( inStr ) { - while ( *s ) - s++; + if (inStr) { + while (*s) + s++; - PutBlock( inStr, s - inStr ); - } + PutBlock(inStr, s - inStr); + } } +void CEgOStream::Write(const UtilStr *inData) { - -void CEgOStream::Write( const UtilStr* inData ) { - - if ( inData ) - PutBlock( inData -> getCStr(), inData -> length() ); + if (inData) + PutBlock(inData->getCStr(), inData->length()); } +void CEgOStream::PutBlock(const void *inSrce, long numBytes) { -void CEgOStream::PutBlock( const void* inSrce, long numBytes ) { - - mOBuf.Append( (char*) inSrce, numBytes ); + mOBuf.Append((char *)inSrce, numBytes); } +void CEgOStream::PutBlock(CEgIStream &inStream, long inBytes) { + static UtilStr buf; -void CEgOStream::PutBlock( CEgIStream& inStream, long inBytes ) { - static UtilStr buf; - - buf.Assign( inStream, inBytes ); - if ( inStream.noErr() ) - PutBlock( buf.getCStr(), inBytes ); - else - throwErr( cOStreamEOfIS ); + buf.Assign(inStream, inBytes); + if (inStream.noErr()) + PutBlock(buf.getCStr(), inBytes); + else + throwErr(cOStreamEOfIS); } +void CEgOStream::skip(long inBytes) { - - - -void CEgOStream::skip( long inBytes ) { - - if ( inBytes > 0 ) - PutBlock( 0, inBytes ); + if (inBytes > 0) + PutBlock(0, inBytes); } - - void CEgOStream::Reset() { - mOBuf.Wipe(); - throwErr( ::cNoErr ); + mOBuf.Wipe(); + throwErr(::cNoErr); } - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/ConfigFile.cpp b/libvisual-plugins/plugins/actor/gforce/Common/io/ConfigFile.cpp index 4831dfe05..c9ce2ae49 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/ConfigFile.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/ConfigFile.cpp @@ -4,42 +4,40 @@ #include "CEgIFile.h" #include "ArgList.h" +bool ConfigFile::Load(const CEgFileSpec *inSpec, ArgList &outArgs) { + UtilStr str, configText, num; + CEgIFile file; + int i, end; -bool ConfigFile::Load( const CEgFileSpec* inSpec, ArgList& outArgs ) { - UtilStr str, configText, num; - CEgIFile file; - int i, end; - - file.open( inSpec ); - - if ( file.noErr() ) { - - // Read the config and chuck any comments - while ( file.noErr() ) { - file.Readln( str ); - i = str.contains( "//" ); - if ( i > 0 ) - str.Keep( i - 1 ); - configText.Append( str ); - } - file.throwErr( cNoErr ); - - // Remove block comments - do { - i = configText.contains( "/*" ); - if ( i > 0 ) { - end = configText.contains( "*/" ); - if ( end > 0 ) - configText.Remove( i, end - i + 2 ); - } - } while ( i > 0 && end > 0 ); - - // Parse the args/dict... - outArgs.SetArgs( configText ); - - return true; } - else { - return false; - } -} + file.open(inSpec); + + if (file.noErr()) { + + // Read the config and chuck any comments + while (file.noErr()) { + file.Readln(str); + i = str.contains("//"); + if (i > 0) + str.Keep(i - 1); + configText.Append(str); + } + file.throwErr(cNoErr); + // Remove block comments + do { + i = configText.contains("/*"); + if (i > 0) { + end = configText.contains("*/"); + if (end > 0) + configText.Remove(i, end - i + 2); + } + } while (i > 0 && end > 0); + + // Parse the args/dict... + outArgs.SetArgs(configText); + + return true; + } else { + return false; + } +} diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgErr.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgErr.h index 123f3db54..a7c11e88a 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgErr.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgErr.h @@ -4,79 +4,74 @@ #define _CEGERR_ enum { - cNoErr = 0, - cBadClassID = -554, - cCorrupted = -555, - cBadExamVersion = -556, - cBadPLVersion = -557, - - - cEOFErr = -558, - cReadErr = -559, - cNotOpen = -560, - cOpenErr = -561, - cFileNotFound = -625, - cCloseErr = -562, - cCreateErr = -563, - cWriteErr = -564, - cSeekErr = -565, - - - cCantFetchPLFile = -566, - cPLItemNotFound = -567, - - cEOSErr = -568, - cTiedEOS = -569, - cOStreamEOfIS = -570, - - cResourceNotFound = -590, - cResHeaderCorrupt = -591, - cResourceInvalid = -592, - - cBitmapCorrupted = -595, - cBitmapNotMono = -596, - cBitmapTooDeep = -597, - cBadBitmapType = -598, - cPICTNotSupported = -599, - cRLENotSupported = -600, - cNoImageOnClip = -601, - cUnsupportedMetafileMM = -602, - - cBadPDFVersion = -650, - cNoStartXRefFound = -651, - cBadXRefLoad = -652, - cBadObjRefDef = -653, - cPStringExpected = -654, - - cBadParseDictValue = -660, - cNoEndDictFound = -661, - cNoStartDictFound = -662, - - cEndOfArrayExpected = -670, - - cStreamLoadErr = -680 -}; + cNoErr = 0, + cBadClassID = -554, + cCorrupted = -555, + cBadExamVersion = -556, + cBadPLVersion = -557, + + cEOFErr = -558, + cReadErr = -559, + cNotOpen = -560, + cOpenErr = -561, + cFileNotFound = -625, + cCloseErr = -562, + cCreateErr = -563, + cWriteErr = -564, + cSeekErr = -565, + + cCantFetchPLFile = -566, + cPLItemNotFound = -567, + + cEOSErr = -568, + cTiedEOS = -569, + cOStreamEOfIS = -570, + + cResourceNotFound = -590, + cResHeaderCorrupt = -591, + cResourceInvalid = -592, + cBitmapCorrupted = -595, + cBitmapNotMono = -596, + cBitmapTooDeep = -597, + cBadBitmapType = -598, + cPICTNotSupported = -599, + cRLENotSupported = -600, + cNoImageOnClip = -601, + cUnsupportedMetafileMM = -602, + + cBadPDFVersion = -650, + cNoStartXRefFound = -651, + cBadXRefLoad = -652, + cBadObjRefDef = -653, + cPStringExpected = -654, + + cBadParseDictValue = -660, + cNoEndDictFound = -661, + cNoStartDictFound = -662, + + cEndOfArrayExpected = -670, + + cStreamLoadErr = -680 +}; #include "UtilStr.h" class CEgErr { - protected: - short int mErr; - short mOSErr; +protected: + short int mErr; + short mOSErr; + void OSErrMsg(UtilStr &ioStr); - void OSErrMsg( UtilStr& ioStr ); - - public: - CEgErr( long inErr = cNoErr ); - - virtual bool noErr(); - virtual void throwErr( long inErr ); - virtual long getErr(); - virtual void GetErrStr( UtilStr& outStr ); +public: + CEgErr(long inErr = cNoErr); + virtual bool noErr(); + virtual void throwErr(long inErr); + virtual long getErr(); + virtual void GetErrStr(UtilStr &outStr); }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgFileSpec.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgFileSpec.h index 5e86f4a1f..6d3a9fe44 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgFileSpec.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgFileSpec.h @@ -1,59 +1,53 @@ #ifndef _CEGFILESPEC_ #define _CEGFILESPEC_ - #include "UtilStr.h" #include "CEgErr.h" -#define VAL(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) +#define VAL(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) class CEgFileSpec { - protected: - UtilStr mSpecData; - long mFileType; - - - public: - CEgFileSpec(); - CEgFileSpec( const char* inPathName, long inType = VAL('T','E','X','T') ); - CEgFileSpec( const CEgFileSpec& inSpec ); - +protected: + UtilStr mSpecData; + long mFileType; +public: + CEgFileSpec(); + CEgFileSpec(const char *inPathName, long inType = VAL('T', 'E', 'X', 'T')); + CEgFileSpec(const CEgFileSpec &inSpec); - // Returns 1 is the file is found, 2 if the folder is found, 0 if not found - int Exists() const; + // Returns 1 is the file is found, 2 if the folder is found, 0 if not found + int Exists() const; - // Appends "1", "2", "3", ... until the file name is unique/not taken - void MakeUnique(); + // Appends "1", "2", "3", ... until the file name is unique/not taken + void MakeUnique(); - void Assign( const CEgFileSpec& inSpec ); - void AssignPathName( const char* inPathName ); - void Assign( const void* inOSSpecPtr, long inType = VAL('T','E','X','T') ); + void Assign(const CEgFileSpec &inSpec); + void AssignPathName(const char *inPathName); + void Assign(const void *inOSSpecPtr, long inType = VAL('T', 'E', 'X', 'T')); - CEgErr Duplicate( const CEgFileSpec& inDestSpec ) const; - void SaveAs( const CEgFileSpec& inDestSpec ) const; - void ChangeExt( const char* inExt ); + CEgErr Duplicate(const CEgFileSpec &inDestSpec) const; + void SaveAs(const CEgFileSpec &inDestSpec) const; + void ChangeExt(const char *inExt); - void Delete() const; - long GetType() const; - void SetType( long inType ); + void Delete() const; + long GetType() const; + void SetType(long inType); - const void* OSSpec() const; + const void *OSSpec() const; - // Post: Returns the filename of this spec (without extension) - // Usgae: "Blah.BL" ==> Returns "Blah" in - void GetFileName( UtilStr& outFileName ) const; + // Post: Returns the filename of this spec (without extension) + // Usgae: "Blah.BL" ==> Returns "Blah" in + void GetFileName(UtilStr &outFileName) const; - // Post: Sets this spec's filename, keeping the path information the same. - void Rename( const UtilStr& inNewName ); + // Post: Sets this spec's filename, keeping the path information the + //same. + void Rename(const UtilStr &inNewName); - void AssignFolder( const char* inFolderName ); + void AssignFolder(const char *inFolderName); }; #undef VAL #endif - - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIFile.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIFile.h index c79b2b2fa..6fee9c7e2 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIFile.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIFile.h @@ -1,45 +1,43 @@ #ifndef _CEGIFILE_ #define _CEGIFILE_ - #include "CEgIStream.h" class CEgFileSpec; -// Pre: will contain the pre passed in as in ::Search(). -// is the file position were a match was found -// Note: Returns the number of bytes that should be skipped until resuming the search. Returns <0 if search should be stopped. -typedef long (*AddHitFcnT)(void* inProcArg, long inFilePos ); - +// Pre: will contain the pre passed in as in +//::Search(). is the file position were a match was found Note: +//Returns the number of bytes that should be skipped until resuming the search. +//Returns <0 if search should be stopped. +typedef long (*AddHitFcnT)(void *inProcArg, long inFilePos); class CEgIFile : public CEgIStream { - protected: - unsigned long mFile; - - void diskSeek( long inPos ); - virtual void fillBlock( unsigned long inStartPos, void* destPtr, long& ioBytes ); - - enum { - cSearchBufSize = 65000 - }; - - public: - CEgIFile( unsigned short int inBufSize = cDefaultBufSize ); - virtual ~CEgIFile(); - - // Client fcns... - virtual void open( const CEgFileSpec* inSpecPtr ); - void open( const char* inFileName ); - - virtual void close(); - inline bool is_open() { return mFile != 0; } - virtual long size(); - void seekEnd(); - virtual long tell(); - virtual void seek( long inPos ); - - void Search( UtilStr& inSearchStr, void* inProcArg, bool inCaseSensitive, AddHitFcnT inFcn ); -}; +protected: + unsigned long mFile; + + void diskSeek(long inPos); + virtual void fillBlock(unsigned long inStartPos, void *destPtr, + long &ioBytes); + + enum { cSearchBufSize = 65000 }; +public: + CEgIFile(unsigned short int inBufSize = cDefaultBufSize); + virtual ~CEgIFile(); + + // Client fcns... + virtual void open(const CEgFileSpec *inSpecPtr); + void open(const char *inFileName); + + virtual void close(); + inline bool is_open() { return mFile != 0; } + virtual long size(); + void seekEnd(); + virtual long tell(); + virtual void seek(long inPos); + + void Search(UtilStr &inSearchStr, void *inProcArg, bool inCaseSensitive, + AddHitFcnT inFcn); +}; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIOFile.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIOFile.h index 961f0da95..3fd73bf31 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIOFile.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIOFile.h @@ -5,40 +5,35 @@ #include "CEgIFile.h" /* *** Class usage note *** - Whenever the client switches modes (ie. from writing to reading or vice versa), the client *must* - call either seek() or seekEnd() (so that internal output buffer is flushed) + Whenever the client switches modes (ie. from writing to reading or vice + versa), the client *must* call either seek() or seekEnd() (so that internal + output buffer is flushed) */ class CEgIOFile : public CEgOStream, public CEgIFile { - private: +private: +protected: + int mDoTrunc; + long mOBufSize; - protected: + enum { cDefaultOBufSize = 70000 }; - int mDoTrunc; - long mOBufSize; +public: + CEgIOFile(int inDoTrunc = true, long inOBufSize = cDefaultOBufSize); + virtual ~CEgIOFile(); - enum { - cDefaultOBufSize = 70000 - }; + virtual void open(const CEgFileSpec *inSpecPtr); + virtual void close(); + void flush(); + // Overrides from CEgErr + virtual void seek(long inPos); + virtual long size(); + virtual void PutBlock(const void *inSrce, long numBytes); - public: - CEgIOFile( int inDoTrunc = true, long inOBufSize = cDefaultOBufSize ); - virtual ~CEgIOFile(); - - virtual void open( const CEgFileSpec* inSpecPtr ); - virtual void close(); - - void flush(); - - // Overrides from CEgErr - virtual void seek( long inPos ); - virtual long size(); - virtual void PutBlock( const void* inSrce, long numBytes ); - - static long sCreatorType; + static long sCreatorType; }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIStream.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIStream.h index ac2e99d2b..7d526b516 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIStream.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgIStream.h @@ -2,89 +2,76 @@ #ifndef _CEGISTREAM_ #define _CEGISTREAM_ - - - #include "UtilStr.h" #include "CEgErr.h" - - - - class CEgIStream : protected UtilStr, public virtual CEgErr { - protected: - enum { - cDefaultBufSize = 5500 - }; - - public: - - - CEgIStream( unsigned short int inBufSize = cDefaultBufSize ); - - // Client fcns... - long GetLong(); - signed short int GetShort(); - unsigned char GetByte(); - unsigned char PeekByte(); - float GetFloat(); - double GetDbl(); - inline void Readln( UtilStr& outStr ) { Readln( &outStr ); } - void Readln( UtilStr* outStr ); - void Readln(); - void Read( UtilStr& outStr, unsigned long inBytes ); - - // Post: Reads next token (tokens separated by a space or a CR,LF,TAB,SPACE). - // Note: For Read( UtilStr& ), true is returned if a new line was reached. - float ReadFloat(); - long ReadInt(); - bool Read( UtilStr& outStr ); - void Read(); - - long GetBlock( void* destPtr, unsigned long inBytes ); - virtual void skip( long inBytes ); - - - unsigned char GetByteSW(); - void ReadNumber( UtilStr& outStr ); - bool AssertToken( const char* inStr ); - - // Post: Reads worth of data from and resets this stream for that data (at pos = 0) - // Note: These fcns are *only* designed as tools for using CEgIStream as a memory (RAM) stream! - void Assign( CEgIStream* inSource, long inBytes ); - void Assign( void* inSource, long inBytes ); - void Assign( const UtilStr& inSrce ); - // Post: Resets this stream to the beginning of its buffer. This should *only* in conjuction following - // a call to Assign(). - void ResetBuf(); - - // Pre: *cannot*, for obvious reasons, be destroyed before this is. - // Post: All subsequent 'Get...', skip, and Readln fcns will all read from - // Note: Call this fcn each time you want to reset it. - // Note: See that the difference between Tie and Assign is that Assign makes an independent copy of the data - void Tie( const UtilStr* inSrce ); - void Tie( const char* inSrce, long inNumBytes = -1 ); - - - - protected: - bool mIsTied; - unsigned short mReadBufSize; - const char* mNextPtr; // Shortcut ptr to the data - long mBufPos; // File pos where buf begins at (0 = begin of file, etc) - long mPos; // Virtual stream/file position - - - void fillBuf(); - void invalidateBuf(); - virtual void fillBlock( unsigned long inStartPos, void* destPtr, long& ioBytes ); - - - static UtilStr sTemp; +protected: + enum { cDefaultBufSize = 5500 }; + +public: + CEgIStream(unsigned short int inBufSize = cDefaultBufSize); + + // Client fcns... + long GetLong(); + signed short int GetShort(); + unsigned char GetByte(); + unsigned char PeekByte(); + float GetFloat(); + double GetDbl(); + inline void Readln(UtilStr &outStr) { Readln(&outStr); } + void Readln(UtilStr *outStr); + void Readln(); + void Read(UtilStr &outStr, unsigned long inBytes); + + // Post: Reads next token (tokens separated by a space or a + //CR,LF,TAB,SPACE). Note: For Read( UtilStr& ), true is returned if a new + //line was reached. + float ReadFloat(); + long ReadInt(); + bool Read(UtilStr &outStr); + void Read(); + + long GetBlock(void *destPtr, unsigned long inBytes); + virtual void skip(long inBytes); + + unsigned char GetByteSW(); + void ReadNumber(UtilStr &outStr); + bool AssertToken(const char *inStr); + + // Post: Reads worth of data from and resets this + //stream for that data (at pos = 0) + // Note: These fcns are *only* designed as tools for using CEgIStream as + //a memory (RAM) stream! + void Assign(CEgIStream *inSource, long inBytes); + void Assign(void *inSource, long inBytes); + void Assign(const UtilStr &inSrce); + // Post: Resets this stream to the beginning of its buffer. This should + //*only* in conjuction following a call to Assign(). + void ResetBuf(); + + // Pre: *cannot*, for obvious reasons, be destroyed before this + //is. Post: All subsequent 'Get...', skip, and Readln fcns will all read + //from Note: Call this fcn each time you want to reset it. + // Note: See that the difference between Tie and Assign is that Assign + // makes an independent copy of the data + void Tie(const UtilStr *inSrce); + void Tie(const char *inSrce, long inNumBytes = -1); + +protected: + bool mIsTied; + unsigned short mReadBufSize; + const char *mNextPtr; // Shortcut ptr to the data + long mBufPos; // File pos where buf begins at (0 = begin of file, etc) + long mPos; // Virtual stream/file position + + void fillBuf(); + void invalidateBuf(); + virtual void fillBlock(unsigned long inStartPos, void *destPtr, + long &ioBytes); + + static UtilStr sTemp; }; - - #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgOStream.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgOStream.h index 1f6e59d9f..6a4ee961a 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgOStream.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgOStream.h @@ -3,37 +3,30 @@ #include "CEgErr.h" - #include "UtilStr.h" - class CEgOStream : public virtual CEgErr { - - protected: - - - public: - CEgOStream(); - - - // Client fcns... - void PutLong( long inNum ); - void PutShort( signed short int inNum ); - void PutByte( unsigned char inChar ); - virtual void PutBlock( const void* inPtr, long byteSize ); - void PutBlock( CEgIStream& inStream, long inBytes ); - void Write( const char* inStr ); - void Write( const UtilStr* inStr ); - void Writeln( const UtilStr& inStr ); - void Writeln( const char* inStr = 0 ); - - virtual void skip( long inBytes ); - - UtilStr mOBuf; - - virtual void Reset(); +protected: +public: + CEgOStream(); + + // Client fcns... + void PutLong(long inNum); + void PutShort(signed short int inNum); + void PutByte(unsigned char inChar); + virtual void PutBlock(const void *inPtr, long byteSize); + void PutBlock(CEgIStream &inStream, long inBytes); + void Write(const char *inStr); + void Write(const UtilStr *inStr); + void Writeln(const UtilStr &inStr); + void Writeln(const char *inStr = 0); + + virtual void skip(long inBytes); + + UtilStr mOBuf; + virtual void Reset(); }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgOStub.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgOStub.h index ea3f77ad6..17bb66a91 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgOStub.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgOStub.h @@ -3,21 +3,17 @@ #include "CEgOStream.h" -//#include "Eg_Consts.h" - +// #include "Eg_Consts.h" class CEgOStub : public CEgOStream { - - protected: - - public: - CEgOStub(); - - virtual void PutBlock( const void* inSrce, long numBytes ); - long mBytesPut; +protected: +public: + CEgOStub(); + virtual void PutBlock(const void *inSrce, long numBytes); + long mBytesPut; }; #endif \ No newline at end of file diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgPrefs.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgPrefs.h index 2df2c266a..11fef19a2 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgPrefs.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/CEgPrefs.h @@ -7,27 +7,25 @@ class CEgFileSpec; class Exam; class CEgPrefs { - - private: - - static CEgFileSpec sPrefsSpec; - - - public: - - static ArgList sPLFactoryDefaults; - static ArgList sPLDefaults; - static ArgList sFactoryPrefs; - static ArgList sPrefs; - - // Call this at program startup! - static void LoadPrefs(); - - // This is true if valid prefs were initally found - static bool sPrefsFound; - - // Saves Exam::sExamDefaults, sPLDefaults and sEgPrefs to disk. - static void SavePrefs(); + +private: + static CEgFileSpec sPrefsSpec; + +public: + static ArgList sPLFactoryDefaults; + static ArgList sPLDefaults; + static ArgList sFactoryPrefs; + static ArgList sPrefs; + + // Call this at program startup! + static void LoadPrefs(); + + // This is true if valid prefs were initally found + static bool sPrefsFound; + + // Saves Exam::sExamDefaults, sPLDefaults and sEgPrefs to + // disk. + static void SavePrefs(); }; #endif \ No newline at end of file diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/ConfigFile.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/ConfigFile.h index 90361d2ed..d933bd952 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/ConfigFile.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/ConfigFile.h @@ -6,10 +6,8 @@ class ArgList; class ConfigFile { - public: - static bool Load( const CEgFileSpec* inSpec, ArgList& outArgs ); +public: + static bool Load(const CEgFileSpec *inSpec, ArgList &outArgs); }; #endif - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/Prefs.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/Prefs.h index 595a5ffd8..e9a1cdef6 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/Prefs.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/Prefs.h @@ -6,40 +6,44 @@ class Prefs { +public: + // inSysStored == true means the this pref file stored within the system (mac + // -> pref folder, pc -> registry), + // otherwise, it's stored in the current folder. + // ** NOTE: registry store is unimplemented (in win32), so it just stores on + // the cur folder + Prefs(const char *inPrefsName, bool inSysStored); - public: - - // inSysStored == true means the this pref file stored within the system (mac -> pref folder, pc -> registry), - // otherwise, it's stored in the current folder. - // ** NOTE: registry store is unimplemented (in win32), so it just stores on the cur folder - Prefs( const char* inPrefsName, bool inSysStored ); - - // How a Prefs file accesses the disk. To use a pref file, Load() it first, and to save - // any changes of it to disk, call Store(). - CEgErr Load(); - CEgErr Store(); - - // Returns true if the pref ID was found - bool GetPref( long inID, UtilStr& outData ) { return mPrefs.GetArg( inID, outData ); } - long GetPref( long inID ) { return mPrefs.GetArg( inID ); } - float GetFloatPref( long inID ) { return mPrefs.GetFloat( inID ); } - - // Sets the given pref to the given data. - void SetPref( long inID, const UtilStr& inData ); - void SetPref( long inID, long inData ); - - // Overrides what this wants to do with the prefs on a Store(). - // For example, if you called SetNotDirty() right before a Store() call, nothing would ever get written to the prefs file. - // This fcn may be useful if you mess around with the loaded prefs then want to not save the changes on the next Store(). - void SetNotDirty() { mDirty = false; } - - - protected: - UtilStr mPrefName; - bool mSysStored; - bool mDirty; - CEgFileSpec mFileSpec; - ArgList mPrefs; + // How a Prefs file accesses the disk. To use a pref file, Load() it first, + // and to save + // any changes of it to disk, call Store(). + CEgErr Load(); + CEgErr Store(); + + // Returns true if the pref ID was found + bool GetPref(long inID, UtilStr &outData) { + return mPrefs.GetArg(inID, outData); + } + long GetPref(long inID) { return mPrefs.GetArg(inID); } + float GetFloatPref(long inID) { return mPrefs.GetFloat(inID); } + + // Sets the given pref to the given data. + void SetPref(long inID, const UtilStr &inData); + void SetPref(long inID, long inData); + + // Overrides what this wants to do with the prefs on a Store(). + // For example, if you called SetNotDirty() right before a Store() call, + // nothing would ever get written to the prefs file. + // This fcn may be useful if you mess around with the loaded prefs then + //want to not save the changes on the next Store(). + void SetNotDirty() { mDirty = false; } + +protected: + UtilStr mPrefName; + bool mSysStored; + bool mDirty; + CEgFileSpec mFileSpec; + ArgList mPrefs; }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/ResourceFile.h b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/ResourceFile.h index 92cb98266..8506394ea 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/ResourceFile.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Headers/ResourceFile.h @@ -8,168 +8,179 @@ // See end of this file for documentation. - class ResourceFile; - -struct RezT { // Purpose: linked list element that represents a record/resource located on disk. - long mSerialNum; // Unique ID number - long mLogicalSize; - long mPhysicalSize; - long mPos; // Where in the file still resource is located. - RezT* mNext; // Ptr to next item in the linked list. +struct RezT { // Purpose: linked list element that represents a record/resource + // located on disk. + long mSerialNum; // Unique ID number + long mLogicalSize; + long mPhysicalSize; + long mPos; // Where in the file still resource is located. + RezT *mNext; // Ptr to next item in the linked list. }; - - - - -typedef long RezRefNum; - +typedef long RezRefNum; enum RezWriteMode { - cSafeMode, // This write mode keeps the previous version of the resource so it can be recovered using RevertRes() - // cSafeMode is useful for very saving very important data. - cSafeReplaceMode, // This is the same as cSafeMode except that versions of the resource remains (accessable by RevertRes) - cReplaceMode // Overwrites the previous version of the resource (if it exists) + cSafeMode, // This write mode keeps the previous version of the resource so it + // can be recovered using RevertRes() cSafeMode is useful for very + // saving very important data. + cSafeReplaceMode, // This is the same as cSafeMode except that versions of the + // resource remains (accessable by RevertRes) + cReplaceMode // Overwrites the previous version of the resource (if it exists) }; - -typedef bool (*AddRefHitFcnT)(void* inProcArg, RezRefNum inRefNum ); - +typedef bool (*AddRefHitFcnT)(void *inProcArg, RezRefNum inRefNum); class ResourceFile { - - public: - ResourceFile(); - virtual ~ResourceFile(); - - // Post: Opens and loads the resource block headers from the resource block file . - // Note: If ANY error but cResHeaderCorrupt is returned, open must be called AGAIN before any subsequent to this. - // If cResHeaderCorrupt is returned, this ResourceFile can still be used (in hopes that the client can retrieve any surviving blocks via GetRes). - // Note: See EmergencyRecover() - // Note: Any file/stream err can be returned, including cResHeaderCorrupt - CEgErr open( CEgFileSpec* inSpec ); - - // Post: Issues a unique "ticket"/serial number for a new "resource block" in the file. This ticked is then used in SetRes() to store data blocks. - // Later, when the block needs to be retrieved, this ticket is used to claim/fetch the block. - // Note: Serial number between 1 and 255 inclusive are intended for client direct access (ie, they do not need to be issued). For example, a client - // that needs to store some master header table for his file would use, say, 25 because he needs a way to "know" where the master table is. - RezRefNum IssueNewRefNum(); - - // Post: Associates (and saves) the incoming data block with a resource reference number issued by ::IssueNewRefNum(). if is cReplaceMode, if there existed - // a resource block with an identical , it is overwritten. If is cSafeMode, if there existed a resource block with an identical , - // it is kept around and can be recovered using ::RevertRes() - // Note: Any file/stream err can be returned, including cResourceInvalid - CEgErr SetRes( RezRefNum inRefNum, const void* inData, unsigned long inSize, RezWriteMode inMode = cReplaceMode, unsigned short inSlop = 0 ); - CEgErr SetRes( RezRefNum inRefNum, const UtilStr* inData, RezWriteMode inMode = cReplaceMode, unsigned short inSlop = 0 ); - - // Post: Fetches/retieves the data block identified by and places it in . - // Note: Any file/stream err can be returned, including cResourceNotFound or cResourceInvalid - CEgErr GetRes( RezRefNum inRefNum, CEgIStream& outData ); - CEgErr GetRes( RezRefNum inRefNum, UtilStr& outData ); - - // Post: Gives some info about the block (ie, the block logical size) to the caller if != 0 - // Note: Possible errors returned: cResourceNotFound, cResourceInvalid - CEgErr GetResInfo( RezRefNum inRefNum, long* outSize ); - - // Post: This attempts to revert to an earlier version of the block reffed by (assuming the black was saved in cSafeMode). - // If successful, the most recent version of the block reffed by is "forgotten" and the 2nd most recent version - // will be used in future uses of . - // Note: Any file/stream err can be returned, including cResourceNotFound - CEgErr RevertRes( RezRefNum inRefNum ); - - // Post: Tells this that you no longer need the blocked reffed by . ReleaseRes() can be thought of as "free( ptr )" and SetRes() - // can be thought of like "ptr = malloc()". - // Note: CALL THIS when you're done with resource blocks or else they will be "file leaked" and will be uselessly toted around FOREVER! - void ReleaseRes( RezRefNum inRefNum ); - - // Post: This duplicates this resource block file to . - // Note: Garbage collection is effectly performed to the destination file. - // Note: Any valid file/stream error can be returned. - CEgErr Duplicate( CEgFileSpec& inDestSpec ); - - // Post: Attempts to reconstruct the master header of this resource file. A new - // ResourceFile is created using the given spec and the recovered resources are placed in the RF. - // Note: This is useful if cResHeaderCorrupt is returned from open(). - CEgErr EmergencyRecover( XLongList& inSearchList ); - - // Post: Returns the percent data garbage (ie, data blocks released) within this file. - // Note: 0 to 100 inclusive is returned. - int CalcPercentGarbage(); - - // Post: Accessor function to close the file this resource file mgr uses. - // Note: open() must be called if this file is to be used again after close() - void close() { mFile.close(); } - - // Pre: is a callback fcn that handles hits during the search, with given as its argument - // Post: Perfomrs a search for within all valid resource blocks. For each hit, the callback () is called. - void Search( UtilStr& inSearchStr, void* inProgArg, bool inCaseSensitive, AddRefHitFcnT inAddHitFcn ); - - - protected: - CEgIOFile mFile; - long mLargestSerialNum; - - RezT* mHead; // This holds our linked list of RezT, our list of records that represent the records on disk. - // In this list, if there are two or more elements with the same serial/ID rez num, the record appearing - // first in the list is the newest one. - - enum { - cCurFileVersion = 0x1111, - cRezBaseID = 255, - cRezHeaderSize = 20, - cMasterJumpPos = 64, - cRezFlag = 'GkkG' - }; - - struct SearchArgT { - ResourceFile* thisPtr; - void* refHitProcArg; - AddRefHitFcnT addRefHitFcn; - }; - - void ReleaseExtraVersions( RezRefNum inSerialNum, long inMaxNum ); - - static long sFilePosHitFcn( void* inProcArg, long inFilePos ); - long filePosHitFcn( void* inProcArg, long inFilePos, AddRefHitFcnT inRefHitFcn ); - - void readRezRefs(); - void deleteRezRefs(); - RezT* FetchRez( RezRefNum inSerialNum, RezT** outPrevRez, long inVersNum ); - - CEgErr releaseRez( RezT* inRez, RezT* prevPtr ); - - - // Used in EmergencyRecover() - long RecoverRez( long inPos, XLongList& inSearchList, long inOrigSize, CEgErr& outErr ); - static long RecoverRezFcn( void* inProcArg, long inFilePos ); - - +public: + ResourceFile(); + virtual ~ResourceFile(); + + // Post: Opens and loads the resource block headers from the resource + //block file . Note: If ANY error but cResHeaderCorrupt is returned, + //open must be called AGAIN before any subsequent to this. If + //cResHeaderCorrupt is returned, this ResourceFile can still be used (in hopes + //that the client can retrieve any surviving blocks via GetRes). + // Note: See EmergencyRecover() + // Note: Any file/stream err can be returned, including cResHeaderCorrupt + CEgErr open(CEgFileSpec *inSpec); + + // Post: Issues a unique "ticket"/serial number for a new "resource + //block" in the file. This ticked is then used in SetRes() to store data + //blocks. Later, when the block needs to be retrieved, this ticket is used to + //claim/fetch the block. + // Note: Serial number between 1 and 255 inclusive are intended for + //client direct access (ie, they do not need to be issued). For example, a + //client that needs to store some master header table for his file would use, + //say, 25 because he needs a way to "know" where the master table is. + RezRefNum IssueNewRefNum(); + + // Post: Associates (and saves) the incoming data block with a resource + //reference number issued by ::IssueNewRefNum(). if is cReplaceMode, + //if there existed a resource block with an identical , it is + //overwritten. If is cSafeMode, if there existed a resource block + //with an identical , it is kept around and can be recovered using + //::RevertRes() Note: Any file/stream err can be returned, including + //cResourceInvalid + CEgErr SetRes(RezRefNum inRefNum, const void *inData, unsigned long inSize, + RezWriteMode inMode = cReplaceMode, unsigned short inSlop = 0); + CEgErr SetRes(RezRefNum inRefNum, const UtilStr *inData, + RezWriteMode inMode = cReplaceMode, unsigned short inSlop = 0); + + // Post: Fetches/retieves the data block identified by and + //places it in . Note: Any file/stream err can be returned, + //including cResourceNotFound or cResourceInvalid + CEgErr GetRes(RezRefNum inRefNum, CEgIStream &outData); + CEgErr GetRes(RezRefNum inRefNum, UtilStr &outData); + + // Post: Gives some info about the block (ie, the block logical size) to + //the caller if != 0 Note: Possible errors returned: + //cResourceNotFound, cResourceInvalid + CEgErr GetResInfo(RezRefNum inRefNum, long *outSize); + + // Post: This attempts to revert to an earlier version of the block + //reffed by (assuming the black was saved in cSafeMode). If + //successful, the most recent version of the block reffed by is + //"forgotten" and the 2nd most recent version will be used in future uses of + //. Note: Any file/stream err can be returned, including + //cResourceNotFound + CEgErr RevertRes(RezRefNum inRefNum); + + // Post: Tells this that you no longer need the blocked reffed by + //. ReleaseRes() can be thought of as "free( ptr )" and SetRes() + // can be thought of like "ptr = malloc()". + // Note: CALL THIS when you're done with resource blocks or else they + //will be "file leaked" and will be uselessly toted around FOREVER! + void ReleaseRes(RezRefNum inRefNum); + + // Post: This duplicates this resource block file to . + // Note: Garbage collection is effectly performed to the destination + //file. Note: Any valid file/stream error can be returned. + CEgErr Duplicate(CEgFileSpec &inDestSpec); + + // Post: Attempts to reconstruct the master header of this resource file. + //A new ResourceFile is created using the given spec and the recovered + //resources are placed in the RF. + // Note: This is useful if cResHeaderCorrupt is returned from open(). + CEgErr EmergencyRecover(XLongList &inSearchList); + + // Post: Returns the percent data garbage (ie, data blocks released) + //within this file. Note: 0 to 100 inclusive is returned. + int CalcPercentGarbage(); + + // Post: Accessor function to close the file this resource file mgr uses. + // Note: open() must be called if this file is to be used again after + //close() + void close() { mFile.close(); } + + // Pre: is a callback fcn that handles hits during the + //search, with given as its argument + // Post: Perfomrs a search for within all valid resource + //blocks. For each hit, the callback () is called. + void Search(UtilStr &inSearchStr, void *inProgArg, bool inCaseSensitive, + AddRefHitFcnT inAddHitFcn); + +protected: + CEgIOFile mFile; + long mLargestSerialNum; + + RezT *mHead; // This holds our linked list of RezT, our list of records that + // represent the records on disk. In this list, if there are two + // or more elements with the same serial/ID rez num, the record + // appearing + // first in the list is the newest one. + + enum { + cCurFileVersion = 0x1111, + cRezBaseID = 255, + cRezHeaderSize = 20, + cMasterJumpPos = 64, + cRezFlag = 'GkkG' + }; + + struct SearchArgT { + ResourceFile *thisPtr; + void *refHitProcArg; + AddRefHitFcnT addRefHitFcn; + }; + + void ReleaseExtraVersions(RezRefNum inSerialNum, long inMaxNum); + + static long sFilePosHitFcn(void *inProcArg, long inFilePos); + long filePosHitFcn(void *inProcArg, long inFilePos, + AddRefHitFcnT inRefHitFcn); + + void readRezRefs(); + void deleteRezRefs(); + RezT *FetchRez(RezRefNum inSerialNum, RezT **outPrevRez, long inVersNum); + + CEgErr releaseRez(RezT *inRez, RezT *prevPtr); + + // Used in EmergencyRecover() + long RecoverRez(long inPos, XLongList &inSearchList, long inOrigSize, + CEgErr &outErr); + static long RecoverRezFcn(void *inProcArg, long inFilePos); }; - - - // Used for emergency recovert--used in EmergencyRecover() -struct RFRecoverParamT{ - long mOrigSize; - ResourceFile* mSourceRF; - XLongList* mSearchList; - CEgErr mErr; +struct RFRecoverParamT { + long mOrigSize; + ResourceFile *mSourceRF; + XLongList *mSearchList; + CEgErr mErr; }; - - /* The format of a ResourceFile is actually simple: (Note: All integers are LS Byte first in file) -File Offset Type Description +File Offset Type +Description -0..63 Reserved (not used) -64..67 Long file pos of first data record (0 if no recs) +0..63 Reserved (not used) 64..67 +Long file pos of first data record (0 if no recs) @@ -178,19 +189,19 @@ For a given data record: Record Offset Type Description -0..3 Long Constant Record marker, cRezFlag, for emergency corruption recover ability of a ResourceFile -4..7 Long File pos of next data record (they are singly linked). 0 is last record. -8..11 Long Serial Number of that data record (ie, the resource number, or "RezID") -12..15 Long Physical size of data record -16..19 Long Logical size of data record -20..20+Lgl Size Data The resource data -21+Lgl Size..20+Phys Size Junk +0..3 Long +Constant Record marker, cRezFlag, for emergency corruption recover ability of a +ResourceFile +4..7 Long +File pos of next data record (they are singly linked). 0 is last record. 8..11 +Long Serial Number of that data record (ie, the resource +number, or "RezID") +12..15 Long +Physical size of data record +16..19 Long +Logical size of data record +20..20+Lgl Size Data The resource +data 21+Lgl Size..20+Phys Size Junk */ - - #endif - - - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/io/Prefs.cpp b/libvisual-plugins/plugins/actor/gforce/Common/io/Prefs.cpp index 57d54e5e2..9922520a5 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/io/Prefs.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/io/Prefs.cpp @@ -12,121 +12,116 @@ #include #endif -Prefs::Prefs( const char* inPrefsName, bool inSysStored ) { - mSysStored = inSysStored; - mDirty = true; - - mPrefName.Assign( inPrefsName ); - - #ifdef EG_MAC - short int theVRef; - long theDirID; - short theErr; - FSSpec prefSpec; - - if ( inSysStored ) { - theErr = ::FindFolder( kOnSystemDisk, kPreferencesFolderType, kCreateFolder, &theVRef, &theDirID ); - if ( theErr != noErr ) { - theVRef = 0; - theDirID = 0; - } } - else { - theVRef = ( (FSSpec*) EgOSUtils::sAppSpec.OSSpec() ) -> vRefNum; - theDirID = ( (FSSpec*) EgOSUtils::sAppSpec.OSSpec() ) -> parID; - } - ::FSMakeFSSpec( theVRef, theDirID, mPrefName.getPasStr(), &prefSpec ); - mFileSpec.Assign( &prefSpec, 'TEXT' ); - #endif - - #ifdef EG_WIN - // Note: mSysStored == true is unimplmented--just continue as mSysStored == false - // (yah, right--like i'm gonna even *think* about touching the registry!) - UtilStr prefPath; - prefPath.Assign( (char*) EgOSUtils::sAppSpec.OSSpec() ); - prefPath.Append( mPrefName ); - mFileSpec.Assign( prefPath.getCStr(), 0 ); - #endif - - #ifdef UNIX_X - UtilStr prefPath; - prefPath.Assign( getenv("HOME") ); - prefPath.Append( '/' ); - prefPath.Append( mPrefName ); - mFileSpec.Assign( prefPath.getCStr(), 0 ); - #endif +Prefs::Prefs(const char *inPrefsName, bool inSysStored) { + mSysStored = inSysStored; + mDirty = true; -} + mPrefName.Assign(inPrefsName); +#ifdef EG_MAC + short int theVRef; + long theDirID; + short theErr; + FSSpec prefSpec; + + if (inSysStored) { + theErr = ::FindFolder(kOnSystemDisk, kPreferencesFolderType, kCreateFolder, + &theVRef, &theDirID); + if (theErr != noErr) { + theVRef = 0; + theDirID = 0; + } + } else { + theVRef = ((FSSpec *)EgOSUtils::sAppSpec.OSSpec())->vRefNum; + theDirID = ((FSSpec *)EgOSUtils::sAppSpec.OSSpec())->parID; + } + ::FSMakeFSSpec(theVRef, theDirID, mPrefName.getPasStr(), &prefSpec); + mFileSpec.Assign(&prefSpec, 'TEXT'); +#endif +#ifdef EG_WIN + // Note: mSysStored == true is unimplmented--just continue as mSysStored == + // false (yah, right--like i'm gonna even *think* about touching the + // registry!) + UtilStr prefPath; + prefPath.Assign((char *)EgOSUtils::sAppSpec.OSSpec()); + prefPath.Append(mPrefName); + mFileSpec.Assign(prefPath.getCStr(), 0); +#endif -CEgErr Prefs::Load() { - CEgIFile iFile; +#ifdef UNIX_X + UtilStr prefPath; + prefPath.Assign(getenv("HOME")); + prefPath.Append('/'); + prefPath.Append(mPrefName); + mFileSpec.Assign(prefPath.getCStr(), 0); +#endif +} - mPrefs.Clear(); - iFile.open( &mFileSpec ); - mPrefs.SetArgs( &iFile ); +CEgErr Prefs::Load() { + CEgIFile iFile; + mPrefs.Clear(); + iFile.open(&mFileSpec); + mPrefs.SetArgs(&iFile); - if ( iFile.noErr() ) - mDirty = false; + if (iFile.noErr()) + mDirty = false; - return iFile; + return iFile; } - CEgErr Prefs::Store() { - CEgIOFile oFile; - - if ( mDirty ) { - long origType = CEgIOFile::sCreatorType; - #if EG_MAC - CEgIOFile::sCreatorType = 0x74747874; - #elif EG_WIN - CEgIOFile::sCreatorType = 0x3f3f3f3f; - #endif + CEgIOFile oFile; + + if (mDirty) { + long origType = CEgIOFile::sCreatorType; +#if EG_MAC + CEgIOFile::sCreatorType = 0x74747874; +#elif EG_WIN + CEgIOFile::sCreatorType = 0x3f3f3f3f; +#endif - oFile.open( &mFileSpec ); + oFile.open(&mFileSpec); - if ( oFile.noErr() ) { + if (oFile.noErr()) { - mPrefs.ExportTo( &oFile, true ); - oFile.Writeln(); - } - mDirty = false; - CEgIOFile::sCreatorType = origType; - } + mPrefs.ExportTo(&oFile, true); + oFile.Writeln(); + } + mDirty = false; + CEgIOFile::sCreatorType = origType; + } - return oFile; + return oFile; } +void Prefs::SetPref(long inID, const UtilStr &inData) { -void Prefs::SetPref( long inID, const UtilStr& inData ) { - - if ( ! mDirty ) { - const UtilStr* str; + if (!mDirty) { + const UtilStr *str; - str = mPrefs.GetStr( inID ); - if ( str ) { - if ( str -> compareTo( &inData ) ) - mDirty = true; } - else - mDirty = true; - } + str = mPrefs.GetStr(inID); + if (str) { + if (str->compareTo(&inData)) + mDirty = true; + } else + mDirty = true; + } - mPrefs.SetArg( inID, inData ); + mPrefs.SetArg(inID, inData); } +void Prefs::SetPref(long inID, long inData) { + bool exists; + long num; -void Prefs::SetPref( long inID, long inData ) { - bool exists; - long num; - - if ( ! mDirty ) { + if (!mDirty) { - exists = mPrefs.GetArg( inID, num ); - if ( ! exists || num != inData ) - mDirty = true; - } + exists = mPrefs.GetArg(inID, num); + if (!exists || num != inData) + mDirty = true; + } - mPrefs.SetArg( inID, inData ); + mPrefs.SetArg(inID, inData); } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/ExprArray.cpp b/libvisual-plugins/plugins/actor/gforce/Common/math/ExprArray.cpp index 8633441ab..edc9216d2 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/ExprArray.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/ExprArray.cpp @@ -9,89 +9,78 @@ #include "Hashtable.h" ExprArray::ExprArray() { - mExprs = 0; - mVals = 0; - mNumExprs = 0; - mDimNumExprs = 0; + mExprs = 0; + mVals = 0; + mNumExprs = 0; + mDimNumExprs = 0; } - - - ExprArray::~ExprArray() { - if ( mVals ) - delete []mVals; + if (mVals) + delete[] mVals; - if ( mExprs ) - delete []mExprs; + if (mExprs) + delete[] mExprs; } - - - - - -void ExprArray::Compile( const ArgList& inArgs, long inID, ExpressionDict& ioDict ) { - UtilStr str; - unsigned long i; - - // Determine the name of this expression array - i = inID; - mIDStr.Wipe(); - while ( i > 0 ) { - mIDStr.Prepend( (char) ( i & 0xFF ) ); - i = i >> 8; - } - - // Maintain memory heap for arbitrary array size... - mNumExprs = inArgs.GetArraySize( inID ); - if ( mNumExprs > mDimNumExprs ) { - - if ( mVals ) - delete []mVals; - - if ( mExprs ) - delete []mExprs; - - mVals = new float[ mNumExprs + 1 ]; - mExprs = new Expression[ mNumExprs + 1 ]; - mDimNumExprs = mNumExprs; - } - - // Add/Insert the vars to the dict - for ( int i = 0; i < mNumExprs; i++ ) { - str.Assign( mIDStr ); - str.Append( (long) i ); - mVals[ i ] = 0; - ioDict.AddVar( str, &mVals[ i ] ); - } - - // Compile each expression array element - for ( int i = 0; i < mNumExprs; i++ ) { - inArgs.GetArg( inID, str, i ); - mExprs[ i ].Compile( str, ioDict ); - } +void ExprArray::Compile(const ArgList &inArgs, long inID, + ExpressionDict &ioDict) { + UtilStr str; + unsigned long i; + + // Determine the name of this expression array + i = inID; + mIDStr.Wipe(); + while (i > 0) { + mIDStr.Prepend((char)(i & 0xFF)); + i = i >> 8; + } + + // Maintain memory heap for arbitrary array size... + mNumExprs = inArgs.GetArraySize(inID); + if (mNumExprs > mDimNumExprs) { + + if (mVals) + delete[] mVals; + + if (mExprs) + delete[] mExprs; + + mVals = new float[mNumExprs + 1]; + mExprs = new Expression[mNumExprs + 1]; + mDimNumExprs = mNumExprs; + } + + // Add/Insert the vars to the dict + for (int i = 0; i < mNumExprs; i++) { + str.Assign(mIDStr); + str.Append((long)i); + mVals[i] = 0; + ioDict.AddVar(str, &mVals[i]); + } + + // Compile each expression array element + for (int i = 0; i < mNumExprs; i++) { + inArgs.GetArg(inID, str, i); + mExprs[i].Compile(str, ioDict); + } } - void ExprArray::Evaluate() { - int i; + int i; - for ( i = 0; i < mNumExprs; i++ ) - mVals[ i ] = mExprs[ i ].Evaluate(); + for (i = 0; i < mNumExprs; i++) + mVals[i] = mExprs[i].Evaluate(); } +bool ExprArray::IsDependent(const char *inStr) { + int i; -bool ExprArray::IsDependent( const char* inStr ) { - int i; - - for ( i = 0; i < mNumExprs; i++ ) { - if ( mExprs[ i ].IsDependent( inStr ) ) - return true; + for (i = 0; i < mNumExprs; i++) { + if (mExprs[i].IsDependent(inStr)) + return true; + } - } - - return false; + return false; } - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/ExprVirtualMachine.cpp b/libvisual-plugins/plugins/actor/gforce/Common/math/ExprVirtualMachine.cpp index 48487a260..0de8f1947 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/ExprVirtualMachine.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/ExprVirtualMachine.cpp @@ -22,482 +22,532 @@ #include #include - -#define __addInst( opcode, data16 ) long op = (opcode) | (data16); \ - mProgram.Append( &op, sizeof(long) ); - - -#define REG_IN_USE 0x1 -#define REG_USED 0x2 - -ExprUserFcn ExprVirtualMachine::sZeroFcn = { 0, { 0 } }; - -#define _fetch( r, val ) switch ( (r) ) { \ - case 0: val = FR0; break; \ - case 1: val = FR1; break; \ - case 2: val = FR2; break; \ - case 3: val = FR3; break; \ - case 4: val = FR4; break; \ - case 5: val = FR5; break; \ - case 6: val = FR6; break; \ - case 7: val = FR7; break; \ - default: val = mVirtFR[ r - NUM_PHYS_REGS ]; \ - } - /* - case 8: val = FR8; break; \ - case 9: val = FR9; break; \ - case 10: val = FR10; break; \ - case 11: val = FR11; break; \ - case 12: val = FR12; break; \ - case 13: val = FR13; break; \ - case 14: val = FR14; break; \ - case 15: val = FR15; break; \ - default: val = 0; break; \ - }*/ - -#define _store( r, val ) switch ( (r) ) { \ - case 0: FR0 = val; break; \ - case 1: FR1 = val; break; \ - case 2: FR2 = val; break; \ - case 3: FR3 = val; break; \ - case 4: FR4 = val; break; \ - case 5: FR5 = val; break; \ - case 6: FR6 = val; break; \ - case 7: FR7 = val; break; \ - default: mVirtFR[ r - NUM_PHYS_REGS ] = val; \ - } - /* - case 8: FR8 = val; break; \ - case 9: FR9 = val; break; \ - case 10: FR10 = val; break; \ - case 11: FR11 = val; break; \ - case 12: FR12 = val; break; \ - case 13: FR13 = val; break; \ - case 14: FR14 = val; break; \ - case 15: FR15 = val; break; \ - }*/ - - - - -#define _exeFn( r ) switch ( subop ) { \ - case cSQRT: r = sqrt( r ); break; \ - case cABS: r = fabs( r ); break; \ - case cSIN: r = sin( r ); break; \ - case cCOS: r = cos( r ); break; \ - case cSEED: i = *((long*) &r); \ - size = i % 31; \ - srand( ( i << size ) | ( i >> ( 32 - size ) ) ); break; \ - case cTAN: r = tan( r ); break; \ - case cSGN: r = ( r >= 0 ) ? 1 : -1; break; \ - case cLOG: r = log( r ); break; \ - case cEXP: r = exp( r ); break; \ - case cSQR: r = r * r; break; \ - case cATAN: r = atan( r ); break; \ - case cTRNC: r = trunc( r ); break; \ - case cWRAP: r = r - floor( r ); break; \ - case cRND: r = r * ( (float) LV::rand() ) / ( (float) std::numeric_limits::max() ); break; \ - case cSQWV: r = ( r >= -1 && r <= 1 ) ? 1 : 0; break; \ - case cTRWV: r = fabs( .5 * r ); r = 2 * ( r - floor( r ) ); if ( r > 1 ) r = 2 - r; break; \ - case cPOS: if ( r < 0 ) r = 0; break; \ - case cCLIP: if ( r < 0 ) r = 0; else if ( r > 1 ) r = 1; break; \ - case cFLOR: r = floor( r ); break; \ - } - - -#define _exeOp( r1, r2 ) switch ( subop ) { \ - case '+': r1 += r2; break; \ - case '-': r1 -= r2; break; \ - case '/': r1 /= r2; break; \ - case '*': r1 *= r2; break; \ - case '^': r1 = pow( r1, r2 ); break; \ - case '%': { long tt = r2; r1 = (tt != 0) ? (( (long) r1 ) % tt) : 0.0; break; } \ - } +#define __addInst(opcode, data16) \ + long op = (opcode) | (data16); \ + mProgram.Append(&op, sizeof(long)); + +#define REG_IN_USE 0x1 +#define REG_USED 0x2 + +ExprUserFcn ExprVirtualMachine::sZeroFcn = {0, {0}}; + +#define _fetch(r, val) \ + switch ((r)) { \ + case 0: \ + val = FR0; \ + break; \ + case 1: \ + val = FR1; \ + break; \ + case 2: \ + val = FR2; \ + break; \ + case 3: \ + val = FR3; \ + break; \ + case 4: \ + val = FR4; \ + break; \ + case 5: \ + val = FR5; \ + break; \ + case 6: \ + val = FR6; \ + break; \ + case 7: \ + val = FR7; \ + break; \ + default: \ + val = mVirtFR[r - NUM_PHYS_REGS]; \ + } +/* +case 8: val = FR8; break; \ +case 9: val = FR9; break; \ +case 10: val = FR10; break; \ +case 11: val = FR11; break; \ +case 12: val = FR12; break; \ +case 13: val = FR13; break; \ +case 14: val = FR14; break; \ +case 15: val = FR15; break; \ +default: val = 0; break; \ +}*/ + +#define _store(r, val) \ + switch ((r)) { \ + case 0: \ + FR0 = val; \ + break; \ + case 1: \ + FR1 = val; \ + break; \ + case 2: \ + FR2 = val; \ + break; \ + case 3: \ + FR3 = val; \ + break; \ + case 4: \ + FR4 = val; \ + break; \ + case 5: \ + FR5 = val; \ + break; \ + case 6: \ + FR6 = val; \ + break; \ + case 7: \ + FR7 = val; \ + break; \ + default: \ + mVirtFR[r - NUM_PHYS_REGS] = val; \ + } +/* + case 8: FR8 = val; break; \ + case 9: FR9 = val; break; \ + case 10: FR10 = val; break; \ + case 11: FR11 = val; break; \ + case 12: FR12 = val; break; \ + case 13: FR13 = val; break; \ + case 14: FR14 = val; break; \ + case 15: FR15 = val; break; \ +}*/ + +#define _exeFn(r) \ + switch (subop) { \ + case cSQRT: \ + r = sqrt(r); \ + break; \ + case cABS: \ + r = fabs(r); \ + break; \ + case cSIN: \ + r = sin(r); \ + break; \ + case cCOS: \ + r = cos(r); \ + break; \ + case cSEED: \ + i = *((long *)&r); \ + size = i % 31; \ + srand((i << size) | (i >> (32 - size))); \ + break; \ + case cTAN: \ + r = tan(r); \ + break; \ + case cSGN: \ + r = (r >= 0) ? 1 : -1; \ + break; \ + case cLOG: \ + r = log(r); \ + break; \ + case cEXP: \ + r = exp(r); \ + break; \ + case cSQR: \ + r = r * r; \ + break; \ + case cATAN: \ + r = atan(r); \ + break; \ + case cTRNC: \ + r = trunc(r); \ + break; \ + case cWRAP: \ + r = r - floor(r); \ + break; \ + case cRND: \ + r = r * ((float)LV::rand()) / \ + ((float)std::numeric_limits::max()); \ + break; \ + case cSQWV: \ + r = (r >= -1 && r <= 1) ? 1 : 0; \ + break; \ + case cTRWV: \ + r = fabs(.5 * r); \ + r = 2 * (r - floor(r)); \ + if (r > 1) \ + r = 2 - r; \ + break; \ + case cPOS: \ + if (r < 0) \ + r = 0; \ + break; \ + case cCLIP: \ + if (r < 0) \ + r = 0; \ + else if (r > 1) \ + r = 1; \ + break; \ + case cFLOR: \ + r = floor(r); \ + break; \ + } + +#define _exeOp(r1, r2) \ + switch (subop) { \ + case '+': \ + r1 += r2; \ + break; \ + case '-': \ + r1 -= r2; \ + break; \ + case '/': \ + r1 /= r2; \ + break; \ + case '*': \ + r1 *= r2; \ + break; \ + case '^': \ + r1 = pow(r1, r2); \ + break; \ + case '%': { \ + long tt = r2; \ + r1 = (tt != 0) ? (((long)r1) % tt) : 0.0; \ + break; \ + } \ + } ExprVirtualMachine::ExprVirtualMachine() { - mPCStart = 0; - mPCEnd = 0; + mPCStart = 0; + mPCEnd = 0; - sZeroFcn.mNumFcnBins = 1; - sZeroFcn.mFcn[ 0 ] = 0; + sZeroFcn.mNumFcnBins = 1; + sZeroFcn.mFcn[0] = 0; } - int ExprVirtualMachine::FindGlobalFreeReg() { - int reg = 1; - - // Look for a global free register - while ( ( mRegColor[ reg ] & REG_USED ) && reg < NUM_REGS ) - reg++; + int reg = 1; + // Look for a global free register + while ((mRegColor[reg] & REG_USED) && reg < NUM_REGS) + reg++; - return reg; + return reg; } - int ExprVirtualMachine::AllocReg() { - int reg = 0; + int reg = 0; - // Look for a free register (ie, find one not in use right now)... - while ( ( mRegColor[ reg ] & REG_IN_USE ) && reg < NUM_REGS ) - reg++; + // Look for a free register (ie, find one not in use right now)... + while ((mRegColor[reg] & REG_IN_USE) && reg < NUM_REGS) + reg++; - // Color it - if ( reg < NUM_REGS ) - mRegColor[ reg ] = REG_IN_USE | REG_USED; + // Color it + if (reg < NUM_REGS) + mRegColor[reg] = REG_IN_USE | REG_USED; - return reg; + return reg; } +void ExprVirtualMachine::DeallocReg(int inReg) { - -void ExprVirtualMachine::DeallocReg( int inReg ) { - - // Clear the bit that says the reg is allocated - mRegColor[ inReg ] &= ~REG_IN_USE; + // Clear the bit that says the reg is allocated + mRegColor[inReg] &= ~REG_IN_USE; } +void ExprVirtualMachine::DoOp(int inReg, int inReg2, char inOpCode) { -void ExprVirtualMachine::DoOp( int inReg, int inReg2, char inOpCode ) { - - __addInst( OP_OPER, ( inOpCode << 16 ) | ( inReg2 << 8 ) | inReg ) + __addInst(OP_OPER, (inOpCode << 16) | (inReg2 << 8) | inReg) } +void ExprVirtualMachine::Move(int inReg, int inDestReg) { - - - -void ExprVirtualMachine::Move( int inReg, int inDestReg ) { - - if ( inDestReg != inReg ) { - __addInst( OP_MOVE, ( inDestReg << 8 ) | inReg ) - } + if (inDestReg != inReg) { + __addInst(OP_MOVE, (inDestReg << 8) | inReg) + } } +void ExprVirtualMachine::Loadi(float inVal, int inReg) { - - -void ExprVirtualMachine::Loadi( float inVal, int inReg ) { - - __addInst( OP_LOADIMMED, inReg ) - mProgram.Append( &inVal, sizeof( float ) ); + __addInst(OP_LOADIMMED, inReg) mProgram.Append(&inVal, sizeof(float)); } +void ExprVirtualMachine::Loadi(float *inVal, int inReg) { -void ExprVirtualMachine::Loadi( float* inVal, int inReg ) { - - __addInst( OP_LOAD, inReg ) - mProgram.Append( &inVal, sizeof(float*) ); + __addInst(OP_LOAD, inReg) mProgram.Append(&inVal, sizeof(float *)); } +void ExprVirtualMachine::UserFcnOp(int inReg, ExprUserFcn **inFcn) { - -void ExprVirtualMachine::UserFcnOp( int inReg, ExprUserFcn** inFcn ) { - - if ( inFcn ) { - __addInst( OP_USER_FCN, inReg ) - mProgram.Append( &inFcn, sizeof(void*) ); } - else - Loadi( 0.0, inReg ); + if (inFcn) { + __addInst(OP_USER_FCN, inReg) mProgram.Append(&inFcn, sizeof(void *)); + } else + Loadi(0.0, inReg); } +void ExprVirtualMachine::MathOp(int inReg, char inFcnCode) { - -void ExprVirtualMachine::MathOp( int inReg, char inFcnCode ) { - - if ( inFcnCode ) { - __addInst( OP_MATHOP, ( inFcnCode << 16 ) | inReg ) - } + if (inFcnCode) { + __addInst(OP_MATHOP, (inFcnCode << 16) | inReg) + } } - - - - - - void ExprVirtualMachine::Clear() { - // Init register coloring - for ( int i = 0; i < NUM_REGS; i++ ) - mRegColor[ i ] = 0; + // Init register coloring + for (int i = 0; i < NUM_REGS; i++) + mRegColor[i] = 0; - mProgram.Wipe(); + mProgram.Wipe(); } - - void ExprVirtualMachine::PrepForExecution() { - mPCStart = mProgram.getCStr(); - mPCEnd = mPCStart + mProgram.length(); + mPCStart = mProgram.getCStr(); + mPCEnd = mPCStart + mProgram.length(); } - // An inst looks like: // 0-7: Inst opcode // 8-15: Sub opcode // 16-23: Source Reg // 24-31: Dest Register number -float ExprVirtualMachine::Execute/*_Inline*/() { - float FR0, FR1, FR2, FR3, FR4, FR5, FR6, FR7; // FR8, FR9, FR10, FR11, FR12, FR13, FR14, FR15; - float v1, v2; - const char* PC = mPCStart; - const char* end = mPCEnd; - unsigned long inst, opcode, subop, size, i, r2, r1; - float mVirtFR[ NUM_REGS - NUM_PHYS_REGS ]; - - while ( PC < end ) { - inst = *((long*) PC); - PC += sizeof(long); - - opcode = inst & 0xFF000000; - r1 = inst & 0xFF; - r2 = ( inst >> 8 ) & 0xFF; - - if ( opcode == OP_LOADIMMED ) { - v1 = *((float*) PC); - PC += sizeof(float); } - else if ( opcode == OP_LOAD ) { - v1 = **((float**) PC); - PC += sizeof(float*); } - else { - - _fetch( r1, v1 ) - - switch ( opcode ) { - - case OP_OPER: - subop = ( inst >> 16 ) & 0xFF; - _fetch( r2, v2 ) - _exeOp( v1, v2 ) - break; - - case OP_MATHOP: - subop = ( inst >> 16 ) & 0xFF; - _exeFn( v1 ) - break; - - case OP_MOVE: - r1 = r2; - break; - - case OP_USER_FCN: - { - ExprUserFcn* fcn = **((ExprUserFcn***) PC); - size = fcn -> mNumFcnBins; - i = v1 * size; - if ( i >= 0 && i < size ) - v1 = fcn -> mFcn[ i ]; - else if ( i < 0 ) - v1 = fcn -> mFcn[ 0 ]; - else - v1 = fcn -> mFcn[ size - 1 ]; - PC += sizeof(void*); - break; - } - case OP_WLINEAR: - case OP_WEIGHT: - _fetch( r2, v2 ) - float temp = **((float**) PC); - if ( opcode == OP_WEIGHT ) { - v1 = temp * v2 + ( 1.0 - temp ) * v1; - PC += sizeof(float*); } - else { - v1 = **((float**) PC) * v1 + **((float**) PC+4) * v2; - PC += sizeof(float*) * 2; - } - break; - - } - } - _store( r1, v1 ) - } - - return FR0; +float ExprVirtualMachine::Execute /*_Inline*/ () { + float FR0, FR1, FR2, FR3, FR4, FR5, FR6, + FR7; // FR8, FR9, FR10, FR11, FR12, FR13, FR14, FR15; + float v1, v2; + const char *PC = mPCStart; + const char *end = mPCEnd; + unsigned long inst, opcode, subop, size, i, r2, r1; + float mVirtFR[NUM_REGS - NUM_PHYS_REGS]; + + while (PC < end) { + inst = *((long *)PC); + PC += sizeof(long); + + opcode = inst & 0xFF000000; + r1 = inst & 0xFF; + r2 = (inst >> 8) & 0xFF; + + if (opcode == OP_LOADIMMED) { + v1 = *((float *)PC); + PC += sizeof(float); + } else if (opcode == OP_LOAD) { + v1 = **((float **)PC); + PC += sizeof(float *); + } else { + + _fetch(r1, v1) + + switch (opcode) { + + case OP_OPER: + subop = (inst >> 16) & 0xFF; + _fetch(r2, v2) _exeOp(v1, v2) break; + + case OP_MATHOP: + subop = (inst >> 16) & 0xFF; + _exeFn(v1) break; + + case OP_MOVE: + r1 = r2; + break; + + case OP_USER_FCN: { + ExprUserFcn *fcn = **((ExprUserFcn ***)PC); + size = fcn->mNumFcnBins; + i = v1 * size; + if (i >= 0 && i < size) + v1 = fcn->mFcn[i]; + else if (i < 0) + v1 = fcn->mFcn[0]; + else + v1 = fcn->mFcn[size - 1]; + PC += sizeof(void *); + break; + } + case OP_WLINEAR: + case OP_WEIGHT: + _fetch(r2, v2) float temp = **((float **)PC); + if (opcode == OP_WEIGHT) { + v1 = temp * v2 + (1.0 - temp) * v1; + PC += sizeof(float *); + } else { + v1 = **((float **)PC) * v1 + **((float **)PC + 4) * v2; + PC += sizeof(float *) * 2; + } + break; + } + } + _store(r1, v1) + } + + return FR0; } +void ExprVirtualMachine::Chain(ExprVirtualMachine &inVM, float *inC1, + float *inC2) { + int tempReg = inVM.FindGlobalFreeReg(); + // Move the output of this VM to a reg that won't get overwritten by inVM + Move(0, tempReg); + // Now execute inVM (we know it won't touch tempReg) + mProgram.Append(inVM.mProgram); + // Use the special weight op that combines the two outputs via an embedded + // addr to a 0 to 1 value Note that the output is moved to register 0 + if (inC2) { + __addInst(OP_WLINEAR, (tempReg << 8) | 0) + mProgram.Append(&inC1, sizeof(float *)); + mProgram.Append(&inC2, sizeof(float *)); + } else { + __addInst(OP_WEIGHT, (tempReg << 8) | 0) + mProgram.Append(&inC1, sizeof(float *)); + } -void ExprVirtualMachine::Chain( ExprVirtualMachine& inVM, float* inC1, float* inC2 ) { - int tempReg = inVM.FindGlobalFreeReg(); - - // Move the output of this VM to a reg that won't get overwritten by inVM - Move( 0, tempReg ); + // The reg coloring for this VM is the OR of the two's coloring + for (int i = 0; i < NUM_REGS; i++) + mRegColor[i] |= inVM.mRegColor[i]; - // Now execute inVM (we know it won't touch tempReg) - mProgram.Append( inVM.mProgram ); - - // Use the special weight op that combines the two outputs via an embedded addr to a 0 to 1 value - // Note that the output is moved to register 0 - if ( inC2 ) { - __addInst( OP_WLINEAR, ( tempReg << 8 ) | 0 ) - mProgram.Append( &inC1, sizeof(float*) ); - mProgram.Append( &inC2, sizeof(float*) ); } - else { - __addInst( OP_WEIGHT, ( tempReg << 8 ) | 0 ) - mProgram.Append( &inC1, sizeof(float*) ); - } - - // The reg coloring for this VM is the OR of the two's coloring - for ( int i = 0; i < NUM_REGS; i++ ) - mRegColor[ i ] |= inVM.mRegColor[ i ]; - - PrepForExecution(); + PrepForExecution(); } +void ExprVirtualMachine::Assign(ExprVirtualMachine &inExpr) { + mProgram.Assign(inExpr.mProgram); -void ExprVirtualMachine::Assign( ExprVirtualMachine& inExpr ) { - - mProgram.Assign( inExpr.mProgram ); - - for ( int i = 0; i < NUM_REGS; i++ ) - mRegColor[ i ] = inExpr.mRegColor[ i ]; + for (int i = 0; i < NUM_REGS; i++) + mRegColor[i] = inExpr.mRegColor[i]; - PrepForExecution(); + PrepForExecution(); } - - /* void ExprVirtualMachine::Neg() { - __addInst( OP_NEG, 0 ) + __addInst( OP_NEG, 0 ) } */ /* void ExprVirtualMachine::Optimize() { - char* base = mProgram.getCStr(); - long* PC = (long*) mProgram.getCStr(); - long* end = (long*) (((char*) PC) + mProgram.length()); - long reg, opcode; - long* start; - - while ( PC < end ) { - opcode = (*PC) & 0xFF000000; - start = PC; - PC++; - - // Maintain the PC - if ( opcode == OP_LOADIMMED ) - PC += 2; - else if ( opcode == OP_LOAD ) - PC++; - - // Look for a 'Load into r0, , Move from r0' sequence - if ( opcode == OP_LOADIMMED || opcode == OP_LOAD ) { - opcode = (*PC) & 0xFF000000; - if ( opcode == OP_MOVE_FR0 ) { - reg = *PC & 0xFF; // Extract the final dest register - *start = (*start) | reg; // Change the load so it loads right into the reg it needs to - mProgram.Remove( 1 + ( ((char*) PC) - base ), 4 ); } // Delete the move from fr0 inst - // ?? - else if ( opcode == OP_MATHOP ) { - opcode = (*(PC + 1)) & 0xFF000000; - if ( opcode == OP_MOVE_FR0 ) { - reg = *(PC + 1) & 0xFF; // Extract the final dest register - *start = (*start) | reg; // Change the load so it loads right into the reg it needs to - *PC = (*PC) | reg; // Change the math op so it operates on the proper reg (see above) - mProgram.Remove( 5 + ( ((char*) PC) - base ), 4 ); // Delete the move from fr0 inst - } - } // ?? - } - } - - // Minimzing pushes/pops via stack analysis - StackReduction( 0, mProgram.length() ); + char* base = mProgram.getCStr(); + long* PC = (long*) mProgram.getCStr(); + long* end = (long*) (((char*) PC) + mProgram.length()); + long reg, opcode; + long* start; + + while ( PC < end ) { + opcode = (*PC) & 0xFF000000; + start = PC; + PC++; + + // Maintain the PC + if ( opcode == OP_LOADIMMED ) + PC += 2; + else if ( opcode == OP_LOAD ) + PC++; + + // Look for a 'Load into r0, , Move from r0' sequence + if ( opcode == OP_LOADIMMED || opcode == OP_LOAD ) { + opcode = (*PC) & 0xFF000000; + if ( opcode == OP_MOVE_FR0 ) { + reg = *PC & 0xFF; +// Extract the final dest register *start = (*start) | reg; +// Change the load so it loads right into the reg it needs to mProgram.Remove( 1 ++ ( ((char*) PC) - base ), 4 ); } // Delete the move from fr0 inst + // ?? + else if ( opcode == OP_MATHOP ) { + opcode = (*(PC + 1)) & 0xFF000000; + if ( opcode == OP_MOVE_FR0 ) { + reg = *(PC + 1) & 0xFF; +// Extract the final dest register *start = (*start) | reg; +// Change the load so it loads right into the reg it needs to *PC = (*PC) | reg; +// Change the math op so it operates on the proper reg (see above) + mProgram.Remove( 5 + ( ((char*) PC) - +base ), 4 ); // Delete the move from fr0 inst + } + } // ?? + } + } + + // Minimzing pushes/pops via stack analysis + StackReduction( 0, mProgram.length() ); } long ExprVirtualMachine::StackReduction( long inStartPC, long inEndPC ) { - long regsInUse = 0, opcode, fcnDepth = 0, pushLoc, reg, regsToPush; - long PC = inStartPC, progLen, subRegs, *inst; - char* base = mProgram.getCStr(); - - while ( PC < inEndPC ) { - reg = *((long*) (PC + base)); - opcode = reg & 0xFF000000; // Extract the opcode - reg &= 0xFF; // Extract the dest reg - - // We're only interested in root level pop/pushes (ie, when fcnDepth == 0) - switch ( opcode ) { - - case OP_MASSPUSH: - if ( fcnDepth == 0 ) { - pushLoc = PC; - regsInUse = reg; // We know what's in use by what the compiler wanted us to push - } - fcnDepth++; - break; - - case OP_MASSPOP: - fcnDepth--; - break; - - case OP_LOADIMMED: - PC += 4; - case OP_LOAD: - PC += 4; - } - - // see what regs are in use--skip over insts not at the root level - if ( fcnDepth == 0 ) { - switch ( opcode ) { - - case OP_OPER: - regsInUse |= ( 2 << reg ); - case OP_LOADIMMED: - case OP_LOAD: - case OP_MATHOP: - case OP_MOVEUP: - case OP_MOVE_FR0: - regsInUse |= ( 1 << reg ); - break; - - // Catch the leaving a fcn at the root level - case OP_MASSPOP: - - // Get the regs that get sub-used (ie, used between pushLoc and PC) - progLen = mProgram.length(); - subRegs = StackReduction( pushLoc + 4, PC ); - - // StackReduction() may have elminated instructions, so adjust our PC - PC -= progLen - mProgram.length(); - inEndPC -= progLen - mProgram.length(); - - // Reassign what regs get pushed then popped. We must push the regs that get used in the sub fcn and we use here - regsToPush = subRegs & regsInUse; - if ( regsToPush ) { - inst = (long*) (base + pushLoc); - *inst = OP_MASSPUSH | regsToPush; // Reassign the push - inst = (long*) (base + PC); - *inst = OP_MASSPOP | regsToPush; } // Reassign the pop - - // If no regs need to get pushed, delete the pop and push insts - else { - mProgram.Remove( PC + 1, 4 ); - mProgram.Remove( pushLoc + 1, 4 ); - PC -= 8; - inEndPC -= 8; - } - break; - } - } - - // Move the PC along, for we just looked at an instruction - PC += 4; - } - - return regsInUse; + long regsInUse = 0, opcode, fcnDepth = 0, pushLoc, reg, regsToPush; + long PC = inStartPC, progLen, subRegs, *inst; + char* base = mProgram.getCStr(); + + while ( PC < inEndPC ) { + reg = *((long*) (PC + base)); + opcode = reg & 0xFF000000; // Extract the opcode + reg &= 0xFF; // Extract the +dest reg + + // We're only interested in root level pop/pushes (ie, when +fcnDepth == 0) switch ( opcode ) { + + case OP_MASSPUSH: + if ( fcnDepth == 0 ) { + pushLoc = PC; + regsInUse = reg; // We know +what's in use by what the compiler wanted us to push + } + fcnDepth++; + break; + + case OP_MASSPOP: + fcnDepth--; + break; + + case OP_LOADIMMED: + PC += 4; + case OP_LOAD: + PC += 4; + } + + // see what regs are in use--skip over insts not at the root +level if ( fcnDepth == 0 ) { switch ( opcode ) { + + case OP_OPER: + regsInUse |= ( 2 << reg ); + case OP_LOADIMMED: + case OP_LOAD: + case OP_MATHOP: + case OP_MOVEUP: + case OP_MOVE_FR0: + regsInUse |= ( 1 << reg ); + break; + + // Catch the leaving a fcn at the root level + case OP_MASSPOP: + + // Get the regs that get sub-used (ie, +used between pushLoc and PC) progLen = mProgram.length(); subRegs = +StackReduction( pushLoc + 4, PC ); + + // StackReduction() may have elminated +instructions, so adjust our PC PC -= progLen - mProgram.length(); + inEndPC -= progLen - mProgram.length(); + + // Reassign what regs get pushed then +popped. We must push the regs that get used in the sub fcn and we use here + regsToPush = subRegs & regsInUse; + if ( regsToPush ) { + inst = (long*) (base + pushLoc); + *inst = OP_MASSPUSH | +regsToPush; // Reassign the push inst = (long*) (base + PC); *inst = +OP_MASSPOP | regsToPush; } // Reassign the pop + + // If no regs need to get pushed, delete +the pop and push insts else { mProgram.Remove( PC + 1, 4 ); mProgram.Remove( +pushLoc + 1, 4 ); PC -= 8; inEndPC -= 8; + } + break; + } + } + + // Move the PC along, for we just looked at an instruction + PC += 4; + } + + return regsInUse; } */ - - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Expression.cpp b/libvisual-plugins/plugins/actor/gforce/Common/math/Expression.cpp index 6a9d9fcd4..28dc62ba8 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Expression.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Expression.cpp @@ -11,7 +11,6 @@ #include "ExpressionDict.h" #include "ExprVirtualMachine.h" - #if EG_WIN || defined(UNIX_X) #include "EgOSUtils.h" #endif @@ -20,190 +19,235 @@ #include "config.h" #endif - - -#define __collapseTwo \ - highestPriority = 0; \ - for ( i = 0; i < numExps-1; i++ ) { \ - priority = oper[ i ] & 0x0F00; \ - if ( priority > highestPriority ) { \ - highestPriority = priority; \ - collapse = i; \ - } \ - } \ - i = oper[ 0 ] & 0x0F00; \ - if ( numExps > 2 && i == 0x100 && ( (oper[ 1 ] & 0x0F00) == 0x100 ) ) \ - collapse = 0; /* Catch case: a + b + c * d ^ */ \ - i = collapse; \ - inVM.DoOp( expr[ i ], expr[ i + 1 ], oper[ i ] & 0xFF ); \ - inVM.DeallocReg( expr[ i + 1 ] ); \ - numExps--; \ - oper[ i ] = oper[ i+1 ]; \ - for ( i++; i < numExps; i++ ) { \ - oper[ i ] = oper[ i+1 ]; \ - expr[ i ] = expr[ i+1 ]; \ - } - - +#define __collapseTwo \ + highestPriority = 0; \ + for (i = 0; i < numExps - 1; i++) { \ + priority = oper[i] & 0x0F00; \ + if (priority > highestPriority) { \ + highestPriority = priority; \ + collapse = i; \ + } \ + } \ + i = oper[0] & 0x0F00; \ + if (numExps > 2 && i == 0x100 && ((oper[1] & 0x0F00) == 0x100)) \ + collapse = 0; /* Catch case: a + b + c * d ^ */ \ + i = collapse; \ + inVM.DoOp(expr[i], expr[i + 1], oper[i] & 0xFF); \ + inVM.DeallocReg(expr[i + 1]); \ + numExps--; \ + oper[i] = oper[i + 1]; \ + for (i++; i < numExps; i++) { \ + oper[i] = oper[i + 1]; \ + expr[i] = expr[i + 1]; \ + } // Pre: All whitespace and illegal chars are removed // Pre: Parens balence & all letters are capitalized -// Note: I normally don't write such huge, non-compartmentalized code, but speed is important -// Post: Allocates a register for the return value and returns that register -int Expression::Compile( const char* inStr, long inLen, ExpressionDict& inDict, ExprVirtualMachine& inVM ) { - bool hasLetters = false; - float* floatPtr, val; - long highestPriority, priority, i, numExps = 0, startPos = 0; - long fcnCall, collapse, c, pos, parens = 0, firstParen = -1; - short oper[ 4 ]; - short expr[ 4 ]; - ExprUserFcn** fcnPtr; - - // Catch a negated expression. Make it the same as 0-... - if ( inLen > 0 && *inStr == '-' ) { - expr[ 0 ] = inVM.AllocReg(); - oper[ 0 ] = 0x100 | '-'; - inVM.Loadi( 0.0, expr[ 0 ] ); - numExps = 1; - inStr++; - inLen--; - } - - // Make a pass thru of the string, finding the starts and ends of all root exprs - for ( pos = 0; pos < inLen; pos++ ) { - c = inStr[ pos ]; - - if ( c == '(' ) { - if ( firstParen < 0 ) - firstParen = pos; - parens++; } - else if ( c == ')' ) - parens--; - - // Don't consider any chars if we're not at the root level - if ( parens == 0 ) { - - if ( c >= 'A' && c <= 'Z' ) - hasLetters = true; - - // Operators are what separate exprs - switch ( c ) { - case '-': - case '+': priority = 0x0100; goto doOp; - case '/': - case '%': - case '*': priority = 0x0200; goto doOp; - case '^': priority = 0x0300; - - // Close cur expr -doOp: if ( pos > startPos && pos + 1 < inLen ) { +// Note: I normally don't write such huge, non-compartmentalized code, +//but speed is important Post: Allocates a register for the return value and +//returns that register +int Expression::Compile(const char *inStr, long inLen, ExpressionDict &inDict, + ExprVirtualMachine &inVM) { + bool hasLetters = false; + float *floatPtr, val; + long highestPriority, priority, i, numExps = 0, startPos = 0; + long fcnCall, collapse, c, pos, parens = 0, firstParen = -1; + short oper[4]; + short expr[4]; + ExprUserFcn **fcnPtr; + + // Catch a negated expression. Make it the same as 0-... + if (inLen > 0 && *inStr == '-') { + expr[0] = inVM.AllocReg(); + oper[0] = 0x100 | '-'; + inVM.Loadi(0.0, expr[0]); + numExps = 1; + inStr++; + inLen--; + } + + // Make a pass thru of the string, finding the starts and ends of all root + // exprs + for (pos = 0; pos < inLen; pos++) { + c = inStr[pos]; + + if (c == '(') { + if (firstParen < 0) + firstParen = pos; + parens++; + } else if (c == ')') + parens--; + + // Don't consider any chars if we're not at the root level + if (parens == 0) { + + if (c >= 'A' && c <= 'Z') + hasLetters = true; + + // Operators are what separate exprs + switch (c) { + case '-': + case '+': + priority = 0x0100; + goto doOp; + case '/': + case '%': + case '*': + priority = 0x0200; + goto doOp; + case '^': + priority = 0x0300; + + // Close cur expr + doOp: + if (pos > startPos && pos + 1 < inLen) { + + // Recurse + expr[numExps] = + Compile(inStr + startPos, pos - startPos, inDict, inVM); + oper[numExps] = c | priority; + numExps++; + startPos = pos + 1; + + // 4 exprs, given three priority operators, 4 exprs guaruntees we can + // collapse two into one expr + if (numExps == 4) { + __collapseTwo + } + } + } + } + } + + // Detect base case (ie, whole string is an expr) + if (numExps == 0) { + + // See if we found a fcn call or an unneeded paren pair: (...) + if (firstParen >= 0 && firstParen <= 4) { + + // Eval what's inside the parens + expr[0] = + Compile(inStr + firstParen + 1, inLen - firstParen - 2, inDict, inVM); + + // if we have a fcn (as opposed to just a paren pair) + if (firstParen > 0) { + + // Translate the string of the fcn to a (one byte) sub op code number + fcnCall = *((int32_t *)inStr); +#if EG_WIN || (defined(UNIX_X) && !defined(WORDS_BIGENDIAN)) + fcnCall = EgOSUtils::RevBytes(fcnCall); +#endif - // Recurse - expr[ numExps ] = Compile( inStr + startPos, pos - startPos, inDict, inVM ); - oper[ numExps ] = c | priority; - numExps++; - startPos = pos + 1; - - // 4 exprs, given three priority operators, 4 exprs guaruntees we can collapse two into one expr - if ( numExps == 4 ) { - __collapseTwo - } - } - } - } - } - - - // Detect base case (ie, whole string is an expr) - if ( numExps == 0 ) { - - // See if we found a fcn call or an unneeded paren pair: (...) - if ( firstParen >= 0 && firstParen <= 4 ) { - - // Eval what's inside the parens - expr[ 0 ] = Compile( inStr + firstParen + 1, inLen - firstParen - 2, inDict, inVM ); - - // if we have a fcn (as opposed to just a paren pair) - if ( firstParen > 0 ) { - - // Translate the string of the fcn to a (one byte) sub op code number - fcnCall = *((int32_t*) inStr); - #if EG_WIN || (defined(UNIX_X) && !defined(WORDS_BIGENDIAN)) - fcnCall = EgOSUtils::RevBytes( fcnCall ); - #endif - -#define VAL(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) - switch ( fcnCall ) { - case VAL('S','Q','R','T'): fcnCall = cSQRT; break; - case VAL('A','T','A','N'): fcnCall = cATAN; break; - case VAL('A','B','S','('): fcnCall = cABS; break; - case VAL('S','I','N','('): fcnCall = cSIN; break; - case VAL('C','O','S','('): fcnCall = cCOS; break; - case VAL('T','A','N','('): fcnCall = cTAN; break; - case VAL('L','O','G','('): fcnCall = cLOG; break; - case VAL('E','X','P','('): fcnCall = cEXP; break; - case VAL('S','Q','R','('): fcnCall = cSQR; break; - case VAL('S','Q','W','V'): fcnCall = cSQWV; break; - case VAL('F','L','O','R'): fcnCall = cFLOR; break; - case VAL('P','O','S','('): fcnCall = cPOS; break; - case VAL('R','A','N','D'): - case VAL('R','N','D','('): fcnCall = cRND; break; - case VAL('S','G','N','('): fcnCall = cSGN; break; - case VAL('T','R','W','V'): fcnCall = cTRWV; break; - case VAL('C','L','I','P'): fcnCall = cCLIP; break; - case VAL('S','E','E','D'): fcnCall = cSEED; break; - case VAL('W','R','A','P'): fcnCall = cWRAP; break; - case VAL('T','R','N','C'): fcnCall = cTRNC; break; - default: { - fcnCall = 0; - UtilStr temp( inStr, firstParen ); - fcnPtr = inDict.LookupFunc( temp ); - inVM.UserFcnOp( expr[ 0 ], fcnPtr ); - } - } +#define VAL(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) + switch (fcnCall) { + case VAL('S', 'Q', 'R', 'T'): + fcnCall = cSQRT; + break; + case VAL('A', 'T', 'A', 'N'): + fcnCall = cATAN; + break; + case VAL('A', 'B', 'S', '('): + fcnCall = cABS; + break; + case VAL('S', 'I', 'N', '('): + fcnCall = cSIN; + break; + case VAL('C', 'O', 'S', '('): + fcnCall = cCOS; + break; + case VAL('T', 'A', 'N', '('): + fcnCall = cTAN; + break; + case VAL('L', 'O', 'G', '('): + fcnCall = cLOG; + break; + case VAL('E', 'X', 'P', '('): + fcnCall = cEXP; + break; + case VAL('S', 'Q', 'R', '('): + fcnCall = cSQR; + break; + case VAL('S', 'Q', 'W', 'V'): + fcnCall = cSQWV; + break; + case VAL('F', 'L', 'O', 'R'): + fcnCall = cFLOR; + break; + case VAL('P', 'O', 'S', '('): + fcnCall = cPOS; + break; + case VAL('R', 'A', 'N', 'D'): + case VAL('R', 'N', 'D', '('): + fcnCall = cRND; + break; + case VAL('S', 'G', 'N', '('): + fcnCall = cSGN; + break; + case VAL('T', 'R', 'W', 'V'): + fcnCall = cTRWV; + break; + case VAL('C', 'L', 'I', 'P'): + fcnCall = cCLIP; + break; + case VAL('S', 'E', 'E', 'D'): + fcnCall = cSEED; + break; + case VAL('W', 'R', 'A', 'P'): + fcnCall = cWRAP; + break; + case VAL('T', 'R', 'N', 'C'): + fcnCall = cTRNC; + break; + default: { + fcnCall = 0; + UtilStr temp(inStr, firstParen); + fcnPtr = inDict.LookupFunc(temp); + inVM.UserFcnOp(expr[0], fcnPtr); + } + } #undef VAL - if ( fcnCall ) - inVM.MathOp( expr[ 0 ], fcnCall ); - } } - - // Catch the case where we have a number/immediate - else if ( ! hasLetters ) { - val = UtilStr::GetFloatVal( inStr, inLen ); - expr[ 0 ] = inVM.AllocReg(); - inVM.Loadi( val, expr[ 0 ] ); } - - // At this point we assume it's an identifier, so we'll look up its value - else { - UtilStr temp; - temp.Assign( inStr, inLen ); - expr[ 0 ] = inVM.AllocReg(); - floatPtr = inDict.LookupVar( temp ); - if ( floatPtr ) - inVM.Loadi( floatPtr, expr[ 0 ] ); - } } - - // If there more than one expression - else { - - // Finish the current expr - if ( startPos < inLen ) { - expr[ numExps ] = Compile( inStr + startPos, inLen - startPos, inDict, inVM ); - numExps++; - } - - // When there'll be no more exprs, we're free to collapse all the exprs into one - while ( numExps > 1 ) { - __collapseTwo - } - } - - return expr[ 0 ]; + if (fcnCall) + inVM.MathOp(expr[0], fcnCall); + } + } + + // Catch the case where we have a number/immediate + else if (!hasLetters) { + val = UtilStr::GetFloatVal(inStr, inLen); + expr[0] = inVM.AllocReg(); + inVM.Loadi(val, expr[0]); + } + + // At this point we assume it's an identifier, so we'll look up its value + else { + UtilStr temp; + temp.Assign(inStr, inLen); + expr[0] = inVM.AllocReg(); + floatPtr = inDict.LookupVar(temp); + if (floatPtr) + inVM.Loadi(floatPtr, expr[0]); + } + } + + // If there more than one expression + else { + + // Finish the current expr + if (startPos < inLen) { + expr[numExps] = Compile(inStr + startPos, inLen - startPos, inDict, inVM); + numExps++; + } + + // When there'll be no more exprs, we're free to collapse all the exprs into + // one + while (numExps > 1) { + __collapseTwo + } + } + + return expr[0]; } - - - - /* @@ -212,312 +256,301 @@ doOp: if ( pos > startPos && pos + 1 < inLen ) { -#define __collapseTwo \ - highestPriority = 0; \ - for ( i = 0; i < numExps-1; i++ ) { \ - priority = oper[ i ] & 0x0F00; \ - if ( priority > highestPriority ) { \ - highestPriority = priority; \ - collapse = i; \ - } \ - } \ - i = collapse; \ - inVM.DoOp( i, oper[ i ] & 0xFF ); \ - numExps--; \ - oper[ i ] = oper[ i+1 ]; \ - for ( i++; i < numExps; i++ ) { \ - inVM.MoveUp( i ); \ - oper[ i ] = oper[ i+1 ]; \ - } +#define __collapseTwo +\ + highestPriority = 0; +\ + for ( i = 0; i < numExps-1; i++ ) { +\ + priority = oper[ i ] & 0x0F00; +\ + if ( priority > highestPriority ) { +\ + highestPriority = priority; +\ + collapse = i; +\ + } +\ + } +\ + i = collapse; +\ + inVM.DoOp( i, oper[ i ] & 0xFF ); +\ + numExps--; +\ + oper[ i ] = oper[ i+1 ]; +\ + for ( i++; i < numExps; i++ ) { +\ + inVM.MoveUp( i ); +\ + oper[ i ] = oper[ i+1 ]; +\ + } // Pre: All whitespace and illegal chars are removed // Pre: Parens balence & all letters are capitalized -// Note: I normally don't write such huge, non-compartmentalized code, but speed is important -void Expression::Compile( char* inStr, long inLen, const Hashtable& inDict, ExprVirtualMachine& inVM ) { - bool hasLetters = false; - double* dblPtr, val; - long highestPriority, priority, i, numExps = 0, startPos = 0; - long fcnCall, collapse, c, pos, parens = 0, firstParen = -1; - short oper[ 4 ]; - short reg[ 4 ]; - - // Catch a negated expression - if ( inLen > 0 && *inStr == '-' ) { - inVM.Loadi( 0.0 ); - oper[ 0 ] = 0x100 | '-'; - numExps = 1; - inStr++; - inLen--; - } - - // Make a pass thru of the string, finding the starts and ends of all root exprs - for ( pos = 0; pos < inLen; pos++ ) { - c = inStr[ pos ]; - - if ( c == '(' ) { - if ( firstParen < 0 ) - firstParen = pos; - parens++; } - else if ( c == ')' ) - parens--; - - // Don't consider any chars if we're not at the root level - if ( parens == 0 ) { - - if ( c >= 'A' && c <= 'Z' ) - hasLetters = true; - - // Operators are what separate exprs - switch ( c ) { - case '-': - case '+': priority = 0x0100; goto doOp; - case '/': - case '%': - case '*': priority = 0x0200; goto doOp; - case '^': priority = 0x0300; - - // Close cur expr +// Note: I normally don't write such huge, non-compartmentalized code, +but speed is important void Expression::Compile( char* inStr, long inLen, const +Hashtable& inDict, ExprVirtualMachine& inVM ) { bool +hasLetters = false; double* dblPtr, val; long +highestPriority, priority, i, numExps = 0, startPos = 0; long +fcnCall, collapse, c, pos, parens = 0, firstParen = -1; short +oper[ 4 ]; short reg[ 4 ]; + + // Catch a negated expression + if ( inLen > 0 && *inStr == '-' ) { + inVM.Loadi( 0.0 ); + oper[ 0 ] = 0x100 | '-'; + numExps = 1; + inStr++; + inLen--; + } + + // Make a pass thru of the string, finding the starts and ends of all +root exprs for ( pos = 0; pos < inLen; pos++ ) { c = inStr[ pos ]; + + if ( c == '(' ) { + if ( firstParen < 0 ) + firstParen = pos; + parens++; } + else if ( c == ')' ) + parens--; + + // Don't consider any chars if we're not at the root level + if ( parens == 0 ) { + + if ( c >= 'A' && c <= 'Z' ) + hasLetters = true; + + // Operators are what separate exprs + switch ( c ) { + case '-': + case '+': priority = 0x0100; goto +doOp; case '/': case '%': case '*': priority = 0x0200; goto doOp; case +'^': priority = 0x0300; + + // Close cur expr doOp: if ( pos > startPos && pos + 1 < inLen ) { - // Push registers 0 thru (numExps-1), the registers in use - inVM.MassPush( numExps - 1 ); - - // Recurse - Compile( inStr + startPos, pos - startPos, inDict, inVM ); - oper[ numExps ] = c | priority; - numExps++; - startPos = pos + 1; - - // The return value is in reg 0. Also pop/restore the FP registers in use - inVM.Move( numExps - 1 ); - inVM.MassPop( numExps - 2 ); - - // 4 exprs, given three priority operators, 4 exprs guaruntees we can collapse two into one expr - if ( numExps == 4 ) { - __collapseTwo - } - } - } - } - } - - - // Detect base case (ie, whole string is an expr) - if ( numExps == 0 ) { - - // See if we found a fcn call or an unneeded paren pair: (...) - if ( firstParen >= 0 && firstParen <= 4 ) { - - // Eval what's inside the parens - Compile( inStr + firstParen + 1, inLen - firstParen - 2, inDict, inVM ); - - // Translate the string of the fcn to a (one byte) code number - fcnCall = *((long*) inStr); - switch ( fcnCall ) { - #if EG_MAC || (defined(UNIX_X) && defined(WORDS_BIGENDIAN)) - case 'SQRT': fcnCall = cSQRT; break; - case 'ATAN': fcnCall = cATAN; break; - case 'ABS(': fcnCall = cABS; break; - case 'SIN(': fcnCall = cSIN; break; - case 'COS(': fcnCall = cCOS; break; - case 'TAN(': fcnCall = cTAN; break; - case 'LOG(': fcnCall = cLOG; break; - case 'EXP(': fcnCall = cEXP; break; - case 'SQR(': fcnCall = cSQR; break; - case 'SQWV': fcnCall = cSQWV; break; - case 'POS(': fcnCall = cPOS; break; - case 'RND(': fcnCall = cRND; break; - #elif EG_WIN || (defined(UNIX_X) && !defined(WORDS_BIGENDIAN)) - case 'TRQS': fcnCall = cSQRT; break; - case 'NATA': fcnCall = cATAN; break; - case '(SBA': fcnCall = cABS; break; - case '(NIS': fcnCall = cSIN; break; - case '(SOC': fcnCall = cCOS; break; - case '(NAT': fcnCall = cTAN; break; - case '(GOL': fcnCall = cLOG; break; - case '(PXE': fcnCall = cEXP; break; - case '(RQS': fcnCall = cSQR; break; - case 'VWQS': fcnCall = cSQWV; break; - case '(SOP': fcnCall = cPOS; break; - case '(DNR': fcnCall = cRND; break; - #endif - default: fcnCall = 0; break; - } - inVM.MathOp( fcnCall ); } - - // Catch the case where we have a number/immediate - else if ( ! hasLetters ) { - val = UtilStr::GetFloatVal( inStr, inLen ); - inVM.Loadi( val ); } - - // At this point we assume it's an identifier, so we'll look up its value - else { - UtilStr temp; - temp.Assign( inStr, inLen ); - if ( inDict.Get( &temp, &dblPtr ) ) - inVM.Loadi( dblPtr ); - } } - - // If there more than one expression - else { - - // Push registers 0 thru (numExps-1), the registers in use - inVM.MassPush( numExps - 1 ); - - // Finish the current expr - if ( startPos < inLen ) { - Compile( inStr + startPos, inLen - startPos, inDict, inVM ); - numExps++; - } - - // The return value is in reg 0. Also pop/restore the FP registers in use - inVM.Move( numExps - 1 ); - inVM.MassPop( numExps - 2 ); - - // When there'll be no more exprs, we're free to collapse all the exprs into one - while ( numExps > 1 ) { - __collapseTwo - } - - } - - // Register 0 is the return value by convention + // Push registers 0 thru +(numExps-1), the registers in use inVM.MassPush( numExps - 1 ); + + // Recurse + Compile( inStr + startPos, pos - +startPos, inDict, inVM ); oper[ numExps ] = c | priority; numExps++; startPos = +pos + 1; + + // The return value is in reg 0. +Also pop/restore the FP registers in use inVM.Move( numExps - 1 ); inVM.MassPop( +numExps - 2 ); + + // 4 exprs, given three priority +operators, 4 exprs guaruntees we can collapse two into one expr if ( numExps == +4 ) { + __collapseTwo + } + } + } + } + } + + + // Detect base case (ie, whole string is an expr) + if ( numExps == 0 ) { + + // See if we found a fcn call or an unneeded paren pair: (...) + if ( firstParen >= 0 && firstParen <= 4 ) { + + // Eval what's inside the parens + Compile( inStr + firstParen + 1, inLen - firstParen - 2, +inDict, inVM ); + + // Translate the string of the fcn to a (one byte) code +number fcnCall = *((long*) inStr); switch ( fcnCall ) { #if EG_MAC || +(defined(UNIX_X) && defined(WORDS_BIGENDIAN)) case 'SQRT': fcnCall = cSQRT; +break; case 'ATAN': fcnCall = cATAN; break; case 'ABS(': +fcnCall = cABS; break; case 'SIN(': fcnCall = cSIN; +break; case 'COS(': fcnCall = cCOS; break; case 'TAN(': +fcnCall = cTAN; break; case 'LOG(': fcnCall = cLOG; +break; case 'EXP(': fcnCall = cEXP; break; case 'SQR(': +fcnCall = cSQR; break; case 'SQWV': fcnCall = cSQWV; +break; case 'POS(': fcnCall = cPOS; break; case 'RND(': +fcnCall = cRND; break; #elif EG_WIN || (defined(UNIX_X) && +!defined(WORDS_BIGENDIAN)) case 'TRQS': fcnCall = cSQRT; break; + case 'NATA': fcnCall = cATAN; +break; case '(SBA': fcnCall = cABS; break; case '(NIS': +fcnCall = cSIN; break; case '(SOC': fcnCall = cCOS; +break; case '(NAT': fcnCall = cTAN; break; case '(GOL': +fcnCall = cLOG; break; case '(PXE': fcnCall = cEXP; +break; case '(RQS': fcnCall = cSQR; break; case 'VWQS': +fcnCall = cSQWV; break; case '(SOP': fcnCall = cPOS; +break; case '(DNR': fcnCall = cRND; break; #endif default: +fcnCall = 0; break; + } + inVM.MathOp( fcnCall ); } + + // Catch the case where we have a number/immediate + else if ( ! hasLetters ) { + val = UtilStr::GetFloatVal( inStr, inLen ); + inVM.Loadi( val ); } + + // At this point we assume it's an identifier, so we'll look up +its value else { UtilStr temp; temp.Assign( inStr, inLen ); if ( inDict.Get( +&temp, &dblPtr ) ) inVM.Loadi( dblPtr ); } } + + // If there more than one expression + else { + + // Push registers 0 thru (numExps-1), the registers in use + inVM.MassPush( numExps - 1 ); + + // Finish the current expr + if ( startPos < inLen ) { + Compile( inStr + startPos, inLen - startPos, inDict, +inVM ); numExps++; + } + + // The return value is in reg 0. Also pop/restore the FP +registers in use inVM.Move( numExps - 1 ); inVM.MassPop( numExps - 2 ); + + // When there'll be no more exprs, we're free to collapse all +the exprs into one while ( numExps > 1 ) { + __collapseTwo + } + + } + + // Register 0 is the return value by convention } */ +bool Expression::GetNextToken(UtilStr &outStr, long &ioPos) { + char *str = mEquation.getCStr(); + long pos = ioPos, len = mEquation.length(); + char c; + if (ioPos < 0) + ioPos = 0; + c = str[pos]; + while ((c < 'A' || c > 'Z') && pos < len) { + pos++; + c = str[pos]; + } -bool Expression::GetNextToken( UtilStr& outStr, long& ioPos ) { - char* str = mEquation.getCStr(); - long pos = ioPos, len = mEquation.length(); - char c; - - if ( ioPos < 0 ) - ioPos = 0; - - c = str[ pos ]; - while ( ( c < 'A' || c > 'Z' ) && pos < len ) { - pos++; - c = str[ pos ]; - } - - outStr.Wipe(); - while ( ( ( c >= 'A' && c <= 'Z' ) || ( c == '_' ) || ( c >= '0' && c <= '9' ) ) && pos < len ) { - outStr.Append( c ); - pos++; - c = str[ pos ]; - } + outStr.Wipe(); + while (((c >= 'A' && c <= 'Z') || (c == '_') || (c >= '0' && c <= '9')) && + pos < len) { + outStr.Append(c); + pos++; + c = str[pos]; + } - ioPos = pos; + ioPos = pos; - return outStr.length() > 0; + return outStr.length() > 0; } +bool Expression::IsDependent(const char *inStr) { + long pos, len = 0, c; + while (inStr[len]) + len++; -bool Expression::IsDependent( const char* inStr ) { - long pos, len = 0, c; + pos = mEquation.contains(inStr, len, 0, false); + while (pos > 0) { - while ( inStr[ len ] ) - len++; + // This expr is depndent on inStr when we find a substring match that + // *isn't* a substring of another identifier + c = mEquation.getChar(pos - 1); + if (c < 'A' || c > 'Z') { + c = mEquation.getChar(pos + len); + if (c < 'A' || c > 'Z') + return true; + } + pos = mEquation.contains(inStr, len, pos, false); + } - pos = mEquation.contains( inStr, len, 0, false ); - while ( pos > 0 ) { - - // This expr is depndent on inStr when we find a substring match that *isn't* a substring of another identifier - c = mEquation.getChar( pos - 1 ); - if ( c < 'A' || c > 'Z' ) { - c = mEquation.getChar( pos + len ); - if ( c < 'A' || c > 'Z' ) - return true; - } - pos = mEquation.contains( inStr, len, pos, false ); - } - - return false; + return false; } +bool Expression::Weight(Expression &inExpr, float *inC1, float *inC2) { - - -bool Expression::Weight( Expression& inExpr, float* inC1, float* inC2 ) { - - if ( mIsCompiled && inExpr.mIsCompiled ) { - Chain( inExpr, inC1, inC2 ); - return true; } - else - return false; + if (mIsCompiled && inExpr.mIsCompiled) { + Chain(inExpr, inC1, inC2); + return true; + } else + return false; } +void Expression::Assign(Expression &inExpr) { + mEquation.Assign(inExpr.mEquation); + mIsCompiled = inExpr.mIsCompiled; - -void Expression::Assign( Expression& inExpr ) { - - mEquation.Assign( inExpr.mEquation ); - mIsCompiled = inExpr.mIsCompiled; - - if ( inExpr.mIsCompiled ) - ExprVirtualMachine::Assign( inExpr ); + if (inExpr.mIsCompiled) + ExprVirtualMachine::Assign(inExpr); } +bool Expression::Compile(const UtilStr &inStr, ExpressionDict &inDict) { + int i, c, parens, len; + mEquation.Assign(inStr); + // Case insensitive, remove all spaces + mEquation.Capitalize(); + mEquation.Remove(" "); + mEquation.Remove("\t"); -bool Expression::Compile( const UtilStr& inStr, ExpressionDict& inDict ) { - int i, c, parens, len; - - mEquation.Assign( inStr ); - - // Case insensitive, remove all spaces - mEquation.Capitalize(); - mEquation.Remove( " " ); - mEquation.Remove( "\t" ); + // Check for balenced parens + parens = 0; + len = mEquation.length(); + for (i = 1; i <= len && parens >= 0; i++) { + c = mEquation.getChar(i); - // Check for balenced parens - parens = 0; - len = mEquation.length(); - for ( i = 1; i <= len && parens >= 0; i++ ) { - c = mEquation.getChar( i ); + switch (c) { + case '(': + parens++; + break; + case ')': + parens--; + break; + } + } - switch ( c ) { - case '(': parens++; break; - case ')': parens--; break; - } - } + if (parens != 0) { + mEquation.Wipe(); + mIsCompiled = false; + } else { - if ( parens != 0 ) { - mEquation.Wipe(); - mIsCompiled = false; } - else { + // Wipe whatever program was in the VM before + Clear(); - // Wipe whatever program was in the VM before - Clear(); + if (len > 0) { - if ( len > 0 ) { + // Generate insts for the VM that evaluate mEquation + int retRegNum = + Compile(mEquation.getCStr(), mEquation.length(), inDict, *this); + Move(retRegNum, 0); + } else { - // Generate insts for the VM that evaluate mEquation - int retRegNum = Compile( mEquation.getCStr(), mEquation.length(), inDict, *this ); - Move( retRegNum, 0 ); } - else { + // Color register 0 as used + AllocReg(); - // Color register 0 as used - AllocReg(); + // If the expression is blank, make it return 0 + Loadi(0.0, 0); + } - // If the expression is blank, make it return 0 - Loadi( 0.0, 0 ); - } + PrepForExecution(); + mIsCompiled = true; + } - - PrepForExecution(); - mIsCompiled = true; - } - - return mIsCompiled; + return mIsCompiled; } - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/ExpressionDict.cpp b/libvisual-plugins/plugins/actor/gforce/Common/math/ExpressionDict.cpp index d690fa3d1..05295b317 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/ExpressionDict.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/ExpressionDict.cpp @@ -2,38 +2,28 @@ #include "UtilStr.h" +ExpressionDict::ExpressionDict() : mVarDict(true) {} -ExpressionDict::ExpressionDict() : - mVarDict( true ) { +void ExpressionDict::AddVar(const char *inKey, float *inPtr) { + mVarDict.Put(new UtilStr(inKey), inPtr); } +void ExpressionDict::AddFcn(const char *inKey, ExprUserFcn **inFcn) { - -void ExpressionDict::AddVar( const char* inKey, float* inPtr ) { - - mVarDict.Put( new UtilStr( inKey ), inPtr ); + mVarDict.Put(new UtilStr(inKey), inFcn); } +float *ExpressionDict::LookupVar(const UtilStr &inName) { + float *addr; -void ExpressionDict::AddFcn( const char* inKey, ExprUserFcn** inFcn ) { - - - mVarDict.Put( new UtilStr( inKey ), inFcn ); + if (mVarDict.Get(&inName, (void **)(&addr))) + return addr; + else + return 0; } +ExprUserFcn **ExpressionDict::LookupFunc(const UtilStr &inName) { -float* ExpressionDict::LookupVar( const UtilStr& inName ) { - float* addr; - - if ( mVarDict.Get( &inName, (void **)(&addr) ) ) - return addr; - else - return 0; -} - - -ExprUserFcn** ExpressionDict::LookupFunc( const UtilStr& inName ) { - - return (ExprUserFcn**) LookupVar( inName ); + return (ExprUserFcn **)LookupVar(inName); } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/FourierAnalyzer.cpp b/libvisual-plugins/plugins/actor/gforce/Common/math/FourierAnalyzer.cpp index 94237bfe5..968cd5e06 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/FourierAnalyzer.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/FourierAnalyzer.cpp @@ -2,78 +2,81 @@ #include - FourierAnalyzer::FourierAnalyzer() { - mTrigLookup = 0; - mSinFTSize = 0; - mSinFT = 0; - mBinRange = 0; - mN = 0; - mNumBins = 0; - + mTrigLookup = 0; + mSinFTSize = 0; + mSinFT = 0; + mBinRange = 0; + mN = 0; + mNumBins = 0; } - FourierAnalyzer::~FourierAnalyzer() { - if ( mSinFT ) - delete []mSinFT; - - if ( mTrigLookup ) - delete []mTrigLookup; + if (mSinFT) + delete[] mSinFT; + if (mTrigLookup) + delete[] mTrigLookup; } -void FourierAnalyzer::Transform( short inF[], long inN, long inNumBins, float inBinRange, float outFT[] ) { - float* trig, samp, t; - int i, j; +void FourierAnalyzer::Transform(short inF[], long inN, long inNumBins, + float inBinRange, float outFT[]) { + float *trig, samp, t; + int i, j; + + // Maintain our imaginary component freq spectrum + if (mSinFTSize < inNumBins) { + if (mSinFT) + delete[] mSinFT; + mSinFT = new float[inNumBins]; + mSinFTSize = inNumBins; + } + + // Regenerate trig lookup tables if client asks for different specs + if (inBinRange != mBinRange || mN != inN || inNumBins != mNumBins) { + if (mTrigLookup) + delete[] mTrigLookup; + mTrigLookup = new float[2 * inN * inNumBins]; + + mN = inN; + mNumBins = inNumBins; + mBinRange = inBinRange; + + // Compute all the sin and cos values and store them in the order they'll be + // needed + trig = mTrigLookup; + for (i = 0; i < inN; i++) { + for (j = 1; j <= inNumBins; j++) { + t = ((float)(j * i)) * inBinRange * 6.2831853071 / ((float)inN); + *trig = cos(t) / ((float)inN); + trig++; + *trig = sin(t) / ((float)inN); + trig++; + } + } + } + + // Init the output freq spectrums + for (i = 0; i < inNumBins; i++) + mSinFT[i] = 0; + for (i = 0; i < inNumBins; i++) + outFT[i] = 0; - // Maintain our imaginary component freq spectrum - if ( mSinFTSize < inNumBins ) { - if ( mSinFT ) - delete []mSinFT; - mSinFT = new float[ inNumBins ]; - mSinFTSize = inNumBins; - } - - // Regenerate trig lookup tables if client asks for different specs - if ( inBinRange != mBinRange || mN != inN || inNumBins != mNumBins ) { - if ( mTrigLookup ) - delete []mTrigLookup; - mTrigLookup = new float[ 2 * inN * inNumBins ]; - - mN = inN; - mNumBins = inNumBins; - mBinRange = inBinRange; - - // Compute all the sin and cos values and store them in the order they'll be needed - trig = mTrigLookup; - for ( i = 0; i < inN; i++ ) { - for ( j = 1; j <= inNumBins; j++ ) { - t = ( (float) (j * i) ) * inBinRange * 6.2831853071 / ( (float) inN ); - *trig = cos( t ) / ( (float) inN ); trig++; - *trig = sin( t ) / ( (float) inN ); trig++; - } - } - } - - // Init the output freq spectrums - for ( i = 0; i < inNumBins; i++ ) - mSinFT[ i ] = 0; - for ( i = 0; i < inNumBins; i++ ) - outFT [ i ] = 0; - - // Finally, we can do the fourier transform... - trig = mTrigLookup; - for ( i = 0; i < inN; i++ ) { - samp =inF[ i ]; - for ( j = 0; j < inNumBins; j++ ) { - outFT [ j ] += samp * (*trig); trig++; // *trig here is cos( j * 2pi * (i/inN) ) - mSinFT[ j ] += samp * (*trig); trig++; // *trig here is sin( j * 2pi * (i/inN) ) - } - } + // Finally, we can do the fourier transform... + trig = mTrigLookup; + for (i = 0; i < inN; i++) { + samp = inF[i]; + for (j = 0; j < inNumBins; j++) { + outFT[j] += samp * (*trig); + trig++; // *trig here is cos( j * 2pi * (i/inN) ) + mSinFT[j] += samp * (*trig); + trig++; // *trig here is sin( j * 2pi * (i/inN) ) + } + } - // The actual freq component is the magnitude of the sin and cos freq component vector - for ( j = 0; j < inNumBins; j++ ) - outFT [ j ] = sqrt( outFT [ j ] * outFT [ j ] + mSinFT[ j ] * mSinFT[ j ] ); + // The actual freq component is the magnitude of the sin and cos freq + // component vector + for (j = 0; j < inNumBins; j++) + outFT[j] = sqrt(outFT[j] * outFT[j] + mSinFT[j] * mSinFT[j]); } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Camera.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Camera.h index 88b1ce001..d8a77c3d9 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Camera.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Camera.h @@ -3,22 +3,16 @@ #include "V3.h" - class Camera { +public: + V3 mDir; // The direction we're looking + V3 mUpDir; // What direction is up + V3 mPos; // Where we are in space + float mXYScale; // Scales all the XY cords in he cam cord system + float mPersZ; // The dist added to the cam's z - public: - V3 mDir; // The direction we're looking - V3 mUpDir; // What direction is up - V3 mPos; // Where we are in space - float mXYScale; // Scales all the XY cords in he cam cord system - float mPersZ; // The dist added to the cam's z - - - void CalcTransMatrix( R3Matrix& outT ) const; + void CalcTransMatrix(R3Matrix &outT) const; }; #endif - - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprArray.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprArray.h index e1c1cfacf..f5d9981fb 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprArray.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprArray.h @@ -1,8 +1,6 @@ #ifndef _ExprArray_H #define _ExprArray_H - - #include "UtilStr.h" #include "Expression.h" @@ -12,41 +10,39 @@ class Hashtable; class XPtrList; class XLongList; -/* If an arglist has as an array of values (ex., ad1, ad2, ad3, ad4...), this class -helps extract them and evaluate them easily. */ +/* If an arglist has as an array of values (ex., ad1, ad2, ad3, ad4...), this +class helps extract them and evaluate them easily. */ class ExprArray { +public: + ExprArray(); + virtual ~ExprArray(); - public: - ExprArray(); - virtual ~ExprArray(); - - // Returns how many exrs are compiled/ready to be evaluated - inline long Count() const { return mNumExprs; } + // Returns how many exrs are compiled/ready to be evaluated + inline long Count() const { return mNumExprs; } - // Extracts a sequence of args from an arglist (ie., and array), and compiles them (with - // the given link dictionary). If an arglist was known to contain ad1, ad2, ad3, ad4..., - // we call: Compile( args, 'ad', theDict ); - // Post: Each identifier/element is added to ioDict. - virtual void Compile( const ArgList& inArgs, long inID, ExpressionDict& ioDict ); + // Extracts a sequence of args from an arglist (ie., and array), and compiles + // them (with the given link dictionary). If an arglist was known to contain + // ad1, ad2, ad3, ad4..., we call: Compile( args, 'ad', theDict ); Post: Each + // identifier/element is added to ioDict. + virtual void Compile(const ArgList &inArgs, long inID, + ExpressionDict &ioDict); - // Each loaded expression is evaluated and placed in mVals - void Evaluate(); + // Each loaded expression is evaluated and placed in mVals + void Evaluate(); - inline float Evaluate( long inN ) { return mExprs[ inN ].Evaluate(); } + inline float Evaluate(long inN) { return mExprs[inN].Evaluate(); } - // See Expression::IsDependent() - // Returns if any of the elements of this ExprArray are dependent - bool IsDependent( const char* inStr ); + // See Expression::IsDependent() + // Returns if any of the elements of this ExprArray are dependent + bool IsDependent(const char *inStr); - protected: - float* mVals; - Expression* mExprs; - long mNumExprs, mDimNumExprs; - UtilStr mIDStr; +protected: + float *mVals; + Expression *mExprs; + long mNumExprs, mDimNumExprs; + UtilStr mIDStr; }; - #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprArrayLinked.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprArrayLinked.h index b468dbafd..d42b25836 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprArrayLinked.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprArrayLinked.h @@ -1,56 +1,51 @@ #ifndef _ExprArrayLinked_H #define _ExprArrayLinked_H - #include "ExprArray.h" #include "XPtrMatrix.h" +Warning + : this code is untested -Warning: this code is untested - - -/* An ExprArray that has the ability to analyze itself, and group elements according to the -highest stength token an element may contain. - -Example usage: - -ExprArrayLinked mTempExprs; -mTempExprs.Compile( ); - -// Group the temp vars by strength, where the vars they use have a given strength -Hashtable strenthTable( true ); -strenthTable.Put( new UtilStr( "S" ), (void*) 2 ); -strenthTable.Put( new UtilStr( "T" ), (void*) 1 ); -mTempExprs.SetupStrengthGroups( strenthTable ); + /* An ExprArray that has the ability to analyze itself, and group elements + according to the highest stength token an element may contain. -// We can evaluate these now, since they don't depend on S or T -mTempExprs.EvaluateStrength( 0 ); -*/ + Example usage: -class ExprArrayLinked : public ExprArray { + ExprArrayLinked mTempExprs; + mTempExprs.Compile( ); - public: + // Group the temp vars by strength, where the vars they use have a given + strength Hashtable strenthTable( true ); strenthTable.Put( new UtilStr( + "S" ), (void*) 2 ); strenthTable.Put( new UtilStr( "T" ), (void*) 1 ); + mTempExprs.SetupStrengthGroups( strenthTable ); - // ExprArrayLinked(); - // virtual ~ExprArrayLinked(); + // We can evaluate these now, since they don't depend on S or T + mTempExprs.EvaluateStrength( 0 ); + */ - // Pre: ioVarList is an owning string-key hashtable, mapping to longs that represent a 'strength'. - // Priority n corresponds to ioVarPriority[n], an number array. An example works best: - // Input: ioVarList: ( ("t",1), ("dt",2), ("s",3) ), this: A0="99+s+t", A1="dt*7", A2="A0+dt", A3="t^3", A4="3.4+5" - // Ouput: ioVarList: ( ("t",1), ("dt",2), ("s",3), ("A0",3), ("A1",2), ("A2",3), ("A3", 1), ("A4",0) ), - // mStrengthGroups[]: [0]=4, [1]=3, [2]=1, [3]=0,2 - // This fcn should be called after Compile() and before EvaluateStrength() - // Note: strength 0 denotes all elements whose identifiers weren't found in ioVarList - void SetupStrengthGroups( Hashtable& ioVarList ); - + class ExprArrayLinked : public ExprArray { - // Evalutes all array elments of the given strength. - void EvaluateStrength( long inStength ); +public: + // ExprArrayLinked(); + // virtual ~ExprArrayLinked(); + // Pre: ioVarList is an owning string-key hashtable, mapping to longs that + // represent a 'strength'. Priority n corresponds to ioVarPriority[n], an + // number array. An example works best: Input: ioVarList: ( ("t",1), + // ("dt",2), ("s",3) ), this: A0="99+s+t", A1="dt*7", A2="A0+dt", A3="t^3", + // A4="3.4+5" Ouput: ioVarList: ( ("t",1), ("dt",2), ("s",3), ("A0",3), + // ("A1",2), ("A2",3), ("A3", 1), ("A4",0) ), mStrengthGroups[]: [0]=4, [1]=3, + // [2]=1, [3]=0,2 This fcn should be called after Compile() and before + // EvaluateStrength() Note: strength 0 denotes all elements whose identifiers + // weren't found in ioVarList + void SetupStrengthGroups(Hashtable &ioVarList); - protected: - XPtrMatrix mStrengthGroups; + // Evalutes all array elments of the given strength. + void EvaluateStrength(long inStength); +protected: + XPtrMatrix mStrengthGroups; }; #endif \ No newline at end of file diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprVirtualMachine.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprVirtualMachine.h index 8850aace2..e3d8a9dfd 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprVirtualMachine.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExprVirtualMachine.h @@ -3,121 +3,113 @@ #include "UtilStr.h" - // Valid math fcn calls for MathOp() enum { - cSQRT = 30, - cATAN = 31, - cABS = 32, - cSIN = 33, - cCOS = 34, - cTAN = 35, - cLOG = 36, - cEXP = 37, - cSQR = 38, - cSQWV = 39, - cPOS = 40, - cRND = 41, - cSGN = 42, - cTRWV = 43, - cCLIP = 44, - cSEED = 45, - cWRAP = 46, - cTRNC = 47, - cFLOR = 48 - -}; + cSQRT = 30, + cATAN = 31, + cABS = 32, + cSIN = 33, + cCOS = 34, + cTAN = 35, + cLOG = 36, + cEXP = 37, + cSQR = 38, + cSQWV = 39, + cPOS = 40, + cRND = 41, + cSGN = 42, + cTRWV = 43, + cCLIP = 44, + cSEED = 45, + cWRAP = 46, + cTRNC = 47, + cFLOR = 48 +}; struct ExprUserFcn { - long mNumFcnBins; - float mFcn[ 1 ]; + long mNumFcnBins; + float mFcn[1]; }; - class ExprVirtualMachine { +public: + ExprVirtualMachine(); - public: - ExprVirtualMachine(); - - // Effectively copies inVM into this - void Assign( ExprVirtualMachine& inVM ); - - // Clears the current program - void Clear(); - - // Call this once after new instructions are added - void PrepForExecution(); - - // Executes the current program loaded. FP register zero is returned. - float Execute(); // { return Execute_Inline(); } - //inline float Execute_Inline(); - - // Performs the op: FP[ inReg ] <- FP[ inReg ] FP[ inReg2 ] - // inReg is from 0 to 3, and inOpCode can be +,-,*,/,^,% - void DoOp( int inReg, int inReg2, char inOpCode ); - - // Moves the value of register zero to some other register - void Move( int inReg, int inDestReg ); - - // Sets the value of register zero - void Loadi( float inVal, int inReg ); - - // Sets the value of register zero, forever tying this VM to inVal until it's Cleared - // Note: This VM must be Cleared or deleted before the inVal becomes invalid! Otherwise, - // they'll be a dangling pointer in this VM! - void Loadi( float* inVal, int inReg ); - - // Perfroms one of the above fcns on register zero - void MathOp( int inReg, char inFcnCode ); - - // Allows a piecewise user functions - void UserFcnOp( int inReg, ExprUserFcn** inFcn ); - - // Use these to access/use a register/memory space - int AllocReg(); - void DeallocReg( int inReg ); - - // Returns a register that's globally free (ie, a reg that's never touched during Execute()) - int FindGlobalFreeReg(); - - /* Makes a copy of inVM and each call to Execute() from now on is equivilent to: - float v1 = this.Execute(); - float v2 = inVM.Execute(); - return ( *inC1 ) * v1 + ( *inC2 ) * v2; - Note: If inC2 is 0, *inC2 will be set to ( 1 - *inC1 ) */ - void Chain( ExprVirtualMachine& inVM, float* inC1, float* inC2 ); - - static ExprUserFcn sZeroFcn; - - - protected: - - enum { - OP_LOADIMMED = 0x02000000, - OP_LOAD = 0x03000000, - OP_OPER = 0x04000000, - OP_MATHOP = 0x05000000, - OP_USER_FCN = 0x06000000, - OP_MOVE = 0x0A000000, - OP_WEIGHT = 0x0B000000, - OP_WLINEAR = 0x0C000000, - - NUM_REGS = 32, - NUM_PHYS_REGS = 8 - }; - - UtilStr mProgram; - char mRegColor[ NUM_REGS ]; - - // Simple shortcut ptrs to save time. - const char* mPCStart; - const char* mPCEnd; + // Effectively copies inVM into this + void Assign(ExprVirtualMachine &inVM); -}; + // Clears the current program + void Clear(); + // Call this once after new instructions are added + void PrepForExecution(); -#endif + // Executes the current program loaded. FP register zero is returned. + float Execute(); // { return + //Execute_Inline(); } + // inline float Execute_Inline(); + + // Performs the op: FP[ inReg ] <- FP[ inReg ] FP[ inReg2 ] + // inReg is from 0 to 3, and inOpCode can be +,-,*,/,^,% + void DoOp(int inReg, int inReg2, char inOpCode); + + // Moves the value of register zero to some other register + void Move(int inReg, int inDestReg); + + // Sets the value of register zero + void Loadi(float inVal, int inReg); + + // Sets the value of register zero, forever tying this VM to inVal until it's + // Cleared Note: This VM must be Cleared or deleted before the inVal + // becomes invalid! Otherwise, + // they'll be a dangling pointer in this VM! + void Loadi(float *inVal, int inReg); + + // Perfroms one of the above fcns on register zero + void MathOp(int inReg, char inFcnCode); + + // Allows a piecewise user functions + void UserFcnOp(int inReg, ExprUserFcn **inFcn); + // Use these to access/use a register/memory space + int AllocReg(); + void DeallocReg(int inReg); + + // Returns a register that's globally free (ie, a reg that's never touched + // during Execute()) + int FindGlobalFreeReg(); + + /* Makes a copy of inVM and each call to Execute() from now on is equivilent + to: float v1 = this.Execute(); float v2 = inVM.Execute(); return ( *inC1 ) * + v1 + ( *inC2 ) * v2; Note: If inC2 is 0, *inC2 will be set to ( 1 - *inC1 ) */ + void Chain(ExprVirtualMachine &inVM, float *inC1, float *inC2); + + static ExprUserFcn sZeroFcn; + +protected: + enum { + OP_LOADIMMED = 0x02000000, + OP_LOAD = 0x03000000, + OP_OPER = 0x04000000, + OP_MATHOP = 0x05000000, + OP_USER_FCN = 0x06000000, + OP_MOVE = 0x0A000000, + OP_WEIGHT = 0x0B000000, + OP_WLINEAR = 0x0C000000, + + NUM_REGS = 32, + NUM_PHYS_REGS = 8 + }; + + UtilStr mProgram; + char mRegColor[NUM_REGS]; + + // Simple shortcut ptrs to save time. + const char *mPCStart; + const char *mPCEnd; +}; + +#endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Expression.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Expression.h index c9e71890e..be8b507e5 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Expression.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Expression.h @@ -1,42 +1,37 @@ #ifndef __Equation__ #define __Equation__ - #include "UtilStr.h" #include "ExprVirtualMachine.h" class ExpressionDict; - class Expression : protected ExprVirtualMachine { - public: - - /* Makes a copy of inExpr and each subsequent call to Evaluate() becomes equivilent to: - float v1 = this.Evaluate(); - float v2 = inExpr.Evaluate(); - return ( *inC1 ) * v1 + ( *inC2 ) * v2; */ - // Note: Weight() does *not* update this expression such that calls to IsDependent() also check inExpr - bool Weight( Expression& inExpr, float* inC1, float* inC2 ); +public: + /* Makes a copy of inExpr and each subsequent call to Evaluate() becomes + equivilent to: float v1 = this.Evaluate(); float v2 = inExpr.Evaluate(); + return ( *inC1 ) * v1 + ( *inC2 ) * v2; */ + // Note: Weight() does *not* update this expression such that calls to + // IsDependent() also check inExpr + bool Weight(Expression &inExpr, float *inC1, float *inC2); - bool Compile( const UtilStr& inStr, ExpressionDict& inDict ); + bool Compile(const UtilStr &inStr, ExpressionDict &inDict); - inline float Evaluate() { return Execute(); } + inline float Evaluate() { return Execute(); } - bool IsDependent( const char* inStr ); + bool IsDependent(const char *inStr); - bool GetNextToken( UtilStr& outStr, long& ioPos ); + bool GetNextToken(UtilStr &outStr, long &ioPos); - void Assign( Expression& inExpr ); + void Assign(Expression &inExpr); +protected: + UtilStr mEquation; + bool mIsCompiled; - protected: - UtilStr mEquation; - bool mIsCompiled; - - static int Compile( const char* inStr, long inLen, ExpressionDict& inDict, ExprVirtualMachine& inVM ); + static int Compile(const char *inStr, long inLen, ExpressionDict &inDict, + ExprVirtualMachine &inVM); }; - #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExpressionDict.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExpressionDict.h index b681f6615..921457d78 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExpressionDict.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/ExpressionDict.h @@ -5,39 +5,30 @@ #include "nodeClass.h" #include "ExprVirtualMachine.h" - class FcnEntry : public nodeClass { - public: - UtilStr mName; - long mSize; - float** mFcn; - +public: + UtilStr mName; + long mSize; + float **mFcn; }; - - class ExpressionDict { +public: + ExpressionDict(); - public: - ExpressionDict(); - + void AddVar(UtilStr &inKey, float *inPtr) { AddVar(inKey.getCStr(), inPtr); } + void AddVar(const char *inKey, float *inPtr); - void AddVar( UtilStr& inKey, float* inPtr ) { AddVar( inKey.getCStr(), inPtr ); } - void AddVar( const char* inKey, float* inPtr ); + void AddFcn(const char *inKey, ExprUserFcn **inFcn); - void AddFcn( const char* inKey, ExprUserFcn** inFcn ); - - - float* LookupVar( const UtilStr& inName ); - ExprUserFcn** LookupFunc( const UtilStr& inName ); - - protected: - Hashtable mVarDict; - nodeClass mFcnEntries; + float *LookupVar(const UtilStr &inName); + ExprUserFcn **LookupFunc(const UtilStr &inName); +protected: + Hashtable mVarDict; + nodeClass mFcnEntries; }; - #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/FourierAnalyzer.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/FourierAnalyzer.h index dfd1df5cc..9b7f7ba88 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/FourierAnalyzer.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/FourierAnalyzer.h @@ -1,35 +1,27 @@ #ifndef FourierAnalyzer_H #define FourierAnalyzer_H - - - - class FourierAnalyzer { - - public: - FourierAnalyzer(); - virtual ~FourierAnalyzer(); - - /* Performs a fourier transform of inF[]: - Pre: The function to be transformed is inF[] and is inN elements - Pre: outFT[] has at least inBins elements - Post: outFT[ x ] is the magnitude of the frequency component of frequency (inBinRange * ( x / inBins )) */ - void Transform( short inF[], long inN, long inBins, float inBinRange, float outFT[] ); - - - protected: - - float* mTrigLookup; - float* mSinFT; - long mSinFTSize; - - float mBinRange; - long mN, mNumBins; +public: + FourierAnalyzer(); + virtual ~FourierAnalyzer(); + + /* Performs a fourier transform of inF[]: + Pre: The function to be transformed is inF[] and is inN elements + Pre: outFT[] has at least inBins elements + Post: outFT[ x ] is the magnitude of the frequency component of frequency + (inBinRange * ( x / inBins )) */ + void Transform(short inF[], long inN, long inBins, float inBinRange, + float outFT[]); + +protected: + float *mTrigLookup; + float *mSinFT; + long mSinFTSize; + + float mBinRange; + long mN, mNumBins; }; - - #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Plane.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Plane.h index e3244dc01..6922e0716 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Plane.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/Plane.h @@ -3,34 +3,32 @@ #include "V3.h" - class Plane : public V3 { - public: - // Returns 1 if inPt is on same side of this plane as infinity - // Returns 0 if inPt is on this plane - // Returns -1 if inPt is on the same side as (0,0,0) - //int OnPlane( const Vector& inPt ); - - // Returns left hand side of equation. ie, the closer it is to zero, the closer - // inPt is to being on this plane. It's: (this.Dot( inPt ) - mD) - PFloat CheckZero( const V3& inPt ) const; - - // Assigns this plane so that all three pts lie on this plane - void set( const V3& inPt1, const V3& inPt2, const V3& inPt3 ); - - // Assigns this plane with a normal parellel to inNormal and so that it passes thru the pt: inD * unit(inNormal) - void set( const V3& inNormal, PFloat inD ); - void set( PFloat inX, PFloat inY, PFloat inZ, PFloat inD ); - - // Find intersecting line of this plane and another plane - void intersect( const Plane& inPl, V3& outDir, V3& outPos ); - - - - // Eq: mX x + mY y + mZ z = mD - // Convention: mD is *always* positive - PFloat mD; +public: + // Returns 1 if inPt is on same side of this plane as infinity + // Returns 0 if inPt is on this plane + // Returns -1 if inPt is on the same side as (0,0,0) + // int OnPlane( const Vector& inPt ); + + // Returns left hand side of equation. ie, the closer it is to zero, the + //closer inPt is to being on this plane. It's: (this.Dot( inPt ) - mD) + PFloat CheckZero(const V3 &inPt) const; + + // Assigns this plane so that all three pts lie on this plane + void set(const V3 &inPt1, const V3 &inPt2, const V3 &inPt3); + + // Assigns this plane with a normal parellel to inNormal and so that it + //passes thru the pt: inD * unit(inNormal) + void set(const V3 &inNormal, PFloat inD); + void set(PFloat inX, PFloat inY, PFloat inZ, PFloat inD); + + // Find intersecting line of this plane and another plane + void intersect(const Plane &inPl, V3 &outDir, V3 &outPos); + + // Eq: mX x + mY y + mZ z = mD + // Convention: mD is *always* positive + PFloat mD; }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/R3Matrix.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/R3Matrix.h index e3df4d5b3..9a05149e6 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/R3Matrix.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/R3Matrix.h @@ -3,26 +3,16 @@ #include "V3.h" - class R3Matrix { +public: + void setRow(int inRow, PFloat in1, PFloat in2, PFloat in3); - - public: - - void setRow( int inRow, PFloat in1, PFloat in2, PFloat in3 ); - - - void transform( R3Matrix& inMatrix ); - - - void scale( PFloat inScale ); - + void transform(R3Matrix &inMatrix); - PFloat mM[ 9 ]; + void scale(PFloat inScale); + PFloat mM[9]; }; #endif - - diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/V3.h b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/V3.h index 25bc0352d..25e3a03e5 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/V3.h +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/Headers/V3.h @@ -2,68 +2,99 @@ #define _V3_ #define PFloat float -#define PI 3.141592653589793 +#define PI 3.141592653589793 #include class R3Matrix; class Plane; - class XYCord { - public: - long mX, mY; +public: + long mX, mY; }; - class V3 { - public: - inline PFloat magnitudeSqr() const { return mX * mX + mY * mY + mZ * mZ; } - inline PFloat magnitude() const { return sqrt( mX * mX + mY * mY + mZ * mZ); } - - inline void set( const V3& inPt ) { *this = inPt; } - inline void set( PFloat inX, PFloat inY, PFloat inZ ) { mX = inX; mY = inY; mZ = inZ; } - - inline void scale( PFloat inS, const V3& inPt ) { mX = inS*inPt.mX; mY = inS*inPt.mY; mZ = inS*inPt.mZ; } - inline void scale( PFloat inS ) { mX *= inS; mY *= inS; mZ *= inS; } - void normalize(); - - - inline PFloat dot( const V3& inV ) const { return mX*inV.mX + mY*inV.mY + mZ*inV.mZ; } - - void transform( const R3Matrix& inMatrix ); - void transform( const R3Matrix& inMatrix, const V3& inPt ); - - // Transforms the vector like the above two, but then applies a perspective transformation on the x and y coords - void transform( const R3Matrix& inMatrix, float inPersZ ); - - inline void applyPerspective() { mX /= mZ; mY /= mZ; } - - - inline void subtract( const V3& inA ) { mX -= inA.mX; mY -= inA.mY; mZ -= inA.mZ; } - inline void subtract( const V3& inA, const V3& inB ) { mX = inA.mX-inB.mX; mY = inA.mY-inB.mY; mZ = inA.mZ-inB.mZ; } - - - inline void add( PFloat inX, PFloat inY, PFloat inZ ) { mX += inX; mY += inY; mZ += inZ; } - inline void add( const V3& inA, const V3& inB ) { mX = inA.mX+inB.mX; mY = inA.mY+inB.mY; mZ = inA.mZ+inB.mZ; } - inline void add( const V3& inA ) { mX += inA.mX; mY += inA.mY; mZ += inA.mZ; } - - - void toPlane( const V3& inNormal ); - void fromPlane( const V3& inNormal ); - - // Assigns intersection of a plane with a line to this pt - bool intersection( const Plane& inPlane, const V3& inLine, const V3& inPt ); - - // Rotates this pt around the line defined by inPt1 and inPt2 - void rotate( const V3& inPt1, const V3& inPt2, PFloat inAng ); - - void cross( const V3& inA ); - void cross( const V3& inA, const V3& inB ); - - PFloat mX, mY, mZ; - +public: + inline PFloat magnitudeSqr() const { return mX * mX + mY * mY + mZ * mZ; } + inline PFloat magnitude() const { return sqrt(mX * mX + mY * mY + mZ * mZ); } + + inline void set(const V3 &inPt) { *this = inPt; } + inline void set(PFloat inX, PFloat inY, PFloat inZ) { + mX = inX; + mY = inY; + mZ = inZ; + } + + inline void scale(PFloat inS, const V3 &inPt) { + mX = inS * inPt.mX; + mY = inS * inPt.mY; + mZ = inS * inPt.mZ; + } + inline void scale(PFloat inS) { + mX *= inS; + mY *= inS; + mZ *= inS; + } + void normalize(); + + inline PFloat dot(const V3 &inV) const { + return mX * inV.mX + mY * inV.mY + mZ * inV.mZ; + } + + void transform(const R3Matrix &inMatrix); + void transform(const R3Matrix &inMatrix, const V3 &inPt); + + // Transforms the vector like the above two, but then applies a perspective + // transformation on the x and y coords + void transform(const R3Matrix &inMatrix, float inPersZ); + + inline void applyPerspective() { + mX /= mZ; + mY /= mZ; + } + + inline void subtract(const V3 &inA) { + mX -= inA.mX; + mY -= inA.mY; + mZ -= inA.mZ; + } + inline void subtract(const V3 &inA, const V3 &inB) { + mX = inA.mX - inB.mX; + mY = inA.mY - inB.mY; + mZ = inA.mZ - inB.mZ; + } + + inline void add(PFloat inX, PFloat inY, PFloat inZ) { + mX += inX; + mY += inY; + mZ += inZ; + } + inline void add(const V3 &inA, const V3 &inB) { + mX = inA.mX + inB.mX; + mY = inA.mY + inB.mY; + mZ = inA.mZ + inB.mZ; + } + inline void add(const V3 &inA) { + mX += inA.mX; + mY += inA.mY; + mZ += inA.mZ; + } + + void toPlane(const V3 &inNormal); + void fromPlane(const V3 &inNormal); + + // Assigns intersection of a plane with a line to this pt + bool intersection(const Plane &inPlane, const V3 &inLine, const V3 &inPt); + + // Rotates this pt around the line defined by inPt1 and inPt2 + void rotate(const V3 &inPt1, const V3 &inPt2, PFloat inAng); + + void cross(const V3 &inA); + void cross(const V3 &inA, const V3 &inB); + + PFloat mX, mY, mZ; }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/R3Matrix.cpp b/libvisual-plugins/plugins/actor/gforce/Common/math/R3Matrix.cpp index 0fe33e3a4..f89d033db 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/R3Matrix.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/R3Matrix.cpp @@ -2,47 +2,43 @@ #include "R3Matrix.h" +void R3Matrix::setRow(int inRow, PFloat in1, PFloat in2, PFloat in3) { + int off = (inRow - 1) * 3; - -void R3Matrix::setRow( int inRow, PFloat in1, PFloat in2, PFloat in3 ) { - int off = (inRow-1) * 3; - - mM[ off ] = in1; - mM[ off+1 ] = in2; - mM[ off+2 ] = in3; -} - - -void R3Matrix::transform( R3Matrix& inM ) { - PFloat m[9]; - int i; - - for ( i = 0; i < 9; i++ ) - m[i] = mM[i]; - - mM[0] = inM.mM[0] * m[0] + inM.mM[1] * m[3] + inM.mM[2] * m[6]; - mM[1] = inM.mM[0] * m[1] + inM.mM[1] * m[4] + inM.mM[2] * m[7]; - mM[2] = inM.mM[0] * m[2] + inM.mM[1] * m[5] + inM.mM[2] * m[8]; - - mM[3] = inM.mM[3] * m[0] + inM.mM[4] * m[3] + inM.mM[5] * m[6]; - mM[4] = inM.mM[3] * m[1] + inM.mM[4] * m[4] + inM.mM[5] * m[7]; - mM[5] = inM.mM[3] * m[2] + inM.mM[4] * m[5] + inM.mM[5] * m[8]; - - mM[6] = inM.mM[6] * m[0] + inM.mM[7] * m[3] + inM.mM[8] * m[6]; - mM[7] = inM.mM[6] * m[1] + inM.mM[7] * m[4] + inM.mM[8] * m[7]; - mM[8] = inM.mM[6] * m[2] + inM.mM[7] * m[5] + inM.mM[8] * m[8]; + mM[off] = in1; + mM[off + 1] = in2; + mM[off + 2] = in3; } +void R3Matrix::transform(R3Matrix &inM) { + PFloat m[9]; + int i; + + for (i = 0; i < 9; i++) + m[i] = mM[i]; -void R3Matrix::scale( PFloat inScale ) { + mM[0] = inM.mM[0] * m[0] + inM.mM[1] * m[3] + inM.mM[2] * m[6]; + mM[1] = inM.mM[0] * m[1] + inM.mM[1] * m[4] + inM.mM[2] * m[7]; + mM[2] = inM.mM[0] * m[2] + inM.mM[1] * m[5] + inM.mM[2] * m[8]; + + mM[3] = inM.mM[3] * m[0] + inM.mM[4] * m[3] + inM.mM[5] * m[6]; + mM[4] = inM.mM[3] * m[1] + inM.mM[4] * m[4] + inM.mM[5] * m[7]; + mM[5] = inM.mM[3] * m[2] + inM.mM[4] * m[5] + inM.mM[5] * m[8]; + + mM[6] = inM.mM[6] * m[0] + inM.mM[7] * m[3] + inM.mM[8] * m[6]; + mM[7] = inM.mM[6] * m[1] + inM.mM[7] * m[4] + inM.mM[8] * m[7]; + mM[8] = inM.mM[6] * m[2] + inM.mM[7] * m[5] + inM.mM[8] * m[8]; +} - mM[0] *= inScale; - mM[1] *= inScale; - mM[2] *= inScale; - mM[3] *= inScale; - mM[4] *= inScale; - mM[5] *= inScale; - mM[6] *= inScale; - mM[7] *= inScale; - mM[8] *= inScale; +void R3Matrix::scale(PFloat inScale) { + + mM[0] *= inScale; + mM[1] *= inScale; + mM[2] *= inScale; + mM[3] *= inScale; + mM[4] *= inScale; + mM[5] *= inScale; + mM[6] *= inScale; + mM[7] *= inScale; + mM[8] *= inScale; } diff --git a/libvisual-plugins/plugins/actor/gforce/Common/math/V3.cpp b/libvisual-plugins/plugins/actor/gforce/Common/math/V3.cpp index da0a3d380..1780b62fc 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/math/V3.cpp +++ b/libvisual-plugins/plugins/actor/gforce/Common/math/V3.cpp @@ -3,142 +3,118 @@ #include "Plane.h" void V3::normalize() { - PFloat d; - - d = 1 / magnitude(); - mX *= d; - mY *= d; - mZ *= d; -} - - + PFloat d; - -void V3::transform( const R3Matrix& inMatrix ) { - PFloat y = mY, x = mX; - - mX = inMatrix.mM[0] * x + inMatrix.mM[1] * y + inMatrix.mM[2] * mZ; - mY = inMatrix.mM[3] * x + inMatrix.mM[4] * y + inMatrix.mM[5] * mZ; - mZ = inMatrix.mM[6] * x + inMatrix.mM[7] * y + inMatrix.mM[8] * mZ; + d = 1 / magnitude(); + mX *= d; + mY *= d; + mZ *= d; } +void V3::transform(const R3Matrix &inMatrix) { + PFloat y = mY, x = mX; - -void V3::transform( const R3Matrix& inMatrix, float inPerspectiveZ ) { - PFloat y = mY, x = mX; - PFloat xt, yt; - - xt = inMatrix.mM[0] * x + inMatrix.mM[1] * y + inMatrix.mM[2] * mZ; - yt = inMatrix.mM[3] * x + inMatrix.mM[4] * y + inMatrix.mM[5] * mZ; - mZ = inMatrix.mM[6] * x + inMatrix.mM[7] * y + inMatrix.mM[8] * mZ; - - // Catch float div by zeros... - x = mZ + inPerspectiveZ; - mX = xt / x; - mY = yt / x; + mX = inMatrix.mM[0] * x + inMatrix.mM[1] * y + inMatrix.mM[2] * mZ; + mY = inMatrix.mM[3] * x + inMatrix.mM[4] * y + inMatrix.mM[5] * mZ; + mZ = inMatrix.mM[6] * x + inMatrix.mM[7] * y + inMatrix.mM[8] * mZ; } +void V3::transform(const R3Matrix &inMatrix, float inPerspectiveZ) { + PFloat y = mY, x = mX; + PFloat xt, yt; + xt = inMatrix.mM[0] * x + inMatrix.mM[1] * y + inMatrix.mM[2] * mZ; + yt = inMatrix.mM[3] * x + inMatrix.mM[4] * y + inMatrix.mM[5] * mZ; + mZ = inMatrix.mM[6] * x + inMatrix.mM[7] * y + inMatrix.mM[8] * mZ; - -void V3::transform( const R3Matrix& inMatrix, const V3& inPt ) { - PFloat y = inPt.mY, x = inPt.mX, z = inPt.mZ; - - mX = inMatrix.mM[0] * x + inMatrix.mM[1] * y + inMatrix.mM[2] * z; - mY = inMatrix.mM[3] * x + inMatrix.mM[4] * y + inMatrix.mM[5] * z; - mZ = inMatrix.mM[6] * x + inMatrix.mM[7] * y + inMatrix.mM[8] * z; + // Catch float div by zeros... + x = mZ + inPerspectiveZ; + mX = xt / x; + mY = yt / x; } +void V3::transform(const R3Matrix &inMatrix, const V3 &inPt) { + PFloat y = inPt.mY, x = inPt.mX, z = inPt.mZ; - -void V3::cross( const V3& inV ) { - PFloat x = mX, y = mY; - - mX = inV.mZ * y - mZ * inV.mY; - mY = mZ * inV.mX - inV.mZ * x; - mZ = x * inV.mY - inV.mX * y; + mX = inMatrix.mM[0] * x + inMatrix.mM[1] * y + inMatrix.mM[2] * z; + mY = inMatrix.mM[3] * x + inMatrix.mM[4] * y + inMatrix.mM[5] * z; + mZ = inMatrix.mM[6] * x + inMatrix.mM[7] * y + inMatrix.mM[8] * z; } +void V3::cross(const V3 &inV) { + PFloat x = mX, y = mY; - - -void V3::cross( const V3& inA, const V3& inB ) { - - mX = inA.mZ * inB.mY - inB.mZ * inA.mY; - mY = inB.mZ * inA.mX - inA.mZ * inB.mX; - mZ = inB.mX * inA.mY - inA.mX * inB.mY; + mX = inV.mZ * y - mZ * inV.mY; + mY = mZ * inV.mX - inV.mZ * x; + mZ = x * inV.mY - inV.mX * y; } +void V3::cross(const V3 &inA, const V3 &inB) { -void V3::rotate( const V3& inPt1, const V3& inPt2, PFloat inAng ) { - PFloat x, s, c; - V3 line; - - line.set( inPt1 ); - line.subtract( inPt2 ); - subtract( inPt1 ); - toPlane( line ); - s = sin( inAng ); - c = cos( inAng ); - x = mX; - mX = x * c - mY * s; - mY = x * s + mY * c; - fromPlane( line ); - add( inPt1 ); + mX = inA.mZ * inB.mY - inB.mZ * inA.mY; + mY = inB.mZ * inA.mX - inA.mZ * inB.mX; + mZ = inB.mX * inA.mY - inA.mX * inB.mY; } -#define TOO_BIG 1.0e20 - - -bool V3::intersection( const Plane& inPlane, const V3& inLine, const V3& inPt ) { - - PFloat t = ( inPlane.mD - inPlane.dot( inPt ) ) / inPlane.dot( inLine ); - set( inLine ); - scale( t ); - add( inPt ); - - return t > - TOO_BIG && t < TOO_BIG; +void V3::rotate(const V3 &inPt1, const V3 &inPt2, PFloat inAng) { + PFloat x, s, c; + V3 line; + + line.set(inPt1); + line.subtract(inPt2); + subtract(inPt1); + toPlane(line); + s = sin(inAng); + c = cos(inAng); + x = mX; + mX = x * c - mY * s; + mY = x * s + mY * c; + fromPlane(line); + add(inPt1); } +#define TOO_BIG 1.0e20 +bool V3::intersection(const Plane &inPlane, const V3 &inLine, const V3 &inPt) { + PFloat t = (inPlane.mD - inPlane.dot(inPt)) / inPlane.dot(inLine); + set(inLine); + scale(t); + add(inPt); - -#define A inNormal.mX -#define B inNormal.mY -#define C inNormal.mZ - -void V3::toPlane( const V3& inNormal ) { - PFloat BC = sqrt( B*B + C*C ); - PFloat ABC = inNormal.magnitude(); - PFloat x = mX, y = mY; - - if ( BC > 0.0001 ) { - mX = x * BC / ABC - A * ( B*y + C*mZ ) / (ABC * BC); - mY = (C*y - B*mZ) / BC; - mZ = (A*x + B*y + C*mZ) / ABC; } - else { - mX = mZ; - mZ = - x; - } - + return t > -TOO_BIG && t < TOO_BIG; } - - - -void V3::fromPlane( const V3& inNormal ) { - PFloat BC = sqrt( B*B + C*C ); - PFloat ABC = inNormal.magnitude(); - PFloat x = mX, y = mY; - - if ( BC > 0.0001 ) { - mX = (x * BC + A * mZ ) / ABC; - mY = C * y / BC - A * B * x / ( BC*ABC ) + B * mZ / ABC; - mZ = - B * y / BC - A * C * x / ( BC*ABC ) + C * mZ / ABC; } - else { - mX = - mZ; - mZ = x; - } +#define A inNormal.mX +#define B inNormal.mY +#define C inNormal.mZ + +void V3::toPlane(const V3 &inNormal) { + PFloat BC = sqrt(B * B + C * C); + PFloat ABC = inNormal.magnitude(); + PFloat x = mX, y = mY; + + if (BC > 0.0001) { + mX = x * BC / ABC - A * (B * y + C * mZ) / (ABC * BC); + mY = (C * y - B * mZ) / BC; + mZ = (A * x + B * y + C * mZ) / ABC; + } else { + mX = mZ; + mZ = -x; + } } +void V3::fromPlane(const V3 &inNormal) { + PFloat BC = sqrt(B * B + C * C); + PFloat ABC = inNormal.magnitude(); + PFloat x = mX, y = mY; + + if (BC > 0.0001) { + mX = (x * BC + A * mZ) / ABC; + mY = C * y / BC - A * B * x / (BC * ABC) + B * mZ / ABC; + mZ = -B * y / BC - A * C * x / (BC * ABC) + C * mZ / ABC; + } else { + mX = -mZ; + mZ = x; + } +} diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/DeltaField.cpp b/libvisual-plugins/plugins/actor/gforce/GForceCommon/DeltaField.cpp index cd0bcc96b..4bfd76e0b 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/DeltaField.cpp +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/DeltaField.cpp @@ -6,219 +6,208 @@ #include #include "EgOSUtils.h" - DeltaField::DeltaField() { - // Init field map stuff - mDict.AddVar( "X", &mX_Cord ); - mDict.AddVar( "Y", &mY_Cord ); - mDict.AddVar( "R", &mR_Cord ); - mDict.AddVar( "PI", &mPI ); - mDict.AddVar( "THETA", &mT_Cord ); - mWidth = mHeight = mRowSize = 0; - mCurrentY = -1; - mPI = 3.141592653589793; + // Init field map stuff + mDict.AddVar("X", &mX_Cord); + mDict.AddVar("Y", &mY_Cord); + mDict.AddVar("R", &mR_Cord); + mDict.AddVar("PI", &mPI); + mDict.AddVar("THETA", &mT_Cord); + mWidth = mHeight = mRowSize = 0; + mCurrentY = -1; + mPI = 3.141592653589793; } - - #define DEC_SIZE 8 +DeltaFieldData *DeltaField::GetField() { + if (mCurrentY >= 0) { -DeltaFieldData* DeltaField::GetField() { - if ( mCurrentY >= 0 ) { - - if ( ! IsCalculated() ) { - - EgOSUtils::ShowCursor(); + if (!IsCalculated()) { - while ( ! IsCalculated() ) { - EgOSUtils::SpinCursor(); - CalcSome(); - } + EgOSUtils::ShowCursor(); - EgOSUtils::ShowCursor(); - } + while (!IsCalculated()) { + EgOSUtils::SpinCursor(); + CalcSome(); + } - return &mFieldData; - } + EgOSUtils::ShowCursor(); + } + return &mFieldData; + } - return 0; + return 0; } +void DeltaField::Assign(ArgList &inArgs, UtilStr &inName) { + UtilStr fx, fy; + mName.Assign(inName); + // Compile and link the temp exprs. By spec, A-vars are evaluated now + mAVars.Compile(inArgs, 'A', mDict); + mAVars.Evaluate(); -void DeltaField::Assign( ArgList& inArgs, UtilStr& inName ) { - UtilStr fx, fy; + mDVars.Compile(inArgs, 'D', mDict); - mName.Assign( inName ); +#define VAL(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) - // Compile and link the temp exprs. By spec, A-vars are evaluated now - mAVars.Compile( inArgs, 'A', mDict ); - mAVars.Evaluate(); + mAspect1to1 = inArgs.GetArg(VAL('A', 's', 'p', 'c')); + mPolar = inArgs.ArgExists(VAL('s', 'r', 'c', 'R')); - mDVars.Compile( inArgs, 'D', mDict ); - -#define VAL(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) - - mAspect1to1 = inArgs.GetArg( VAL('A','s','p','c') ); - mPolar = inArgs.ArgExists( VAL('s','r','c','R') ); - - // Compile the 2D vector field that expresses the source point for a given point - if ( mPolar ) { - inArgs.GetArg( VAL('s','r','c','R'), fx ); - inArgs.GetArg( VAL('s','r','c','T'), fy ); - } - else { - inArgs.GetArg( VAL('s','r','c','X'), fx ); - inArgs.GetArg( VAL('s','r','c','Y'), fy ); - } + // Compile the 2D vector field that expresses the source point for a given + // point + if (mPolar) { + inArgs.GetArg(VAL('s', 'r', 'c', 'R'), fx); + inArgs.GetArg(VAL('s', 'r', 'c', 'T'), fy); + } else { + inArgs.GetArg(VAL('s', 'r', 'c', 'X'), fx); + inArgs.GetArg(VAL('s', 'r', 'c', 'Y'), fy); + } #undef VAL - mXField.Compile( fx, mDict ); - mYField.Compile( fy, mDict ); + mXField.Compile(fx, mDict); + mYField.Compile(fy, mDict); - mHasRTerm = mXField.IsDependent( "R" ) || mYField.IsDependent( "R" ) || mDVars.IsDependent( "R" ); - mHasThetaTerm = mXField.IsDependent( "THETA" ) || mYField.IsDependent( "THETA" ) || mDVars.IsDependent( "THETA" ); + mHasRTerm = mXField.IsDependent("R") || mYField.IsDependent("R") || + mDVars.IsDependent("R"); + mHasThetaTerm = mXField.IsDependent("THETA") || + mYField.IsDependent("THETA") || mDVars.IsDependent("THETA"); - // Reset all computation of this delta field... - SetSize( mWidth, mHeight, mRowSize, true ); + // Reset all computation of this delta field... + SetSize(mWidth, mHeight, mRowSize, true); } +void DeltaField::SetSize(long inWidth, long inHeight, long inRowSize, + bool inForceRegen) { + // Only resize if the new size is different... + if (inWidth != mWidth || inHeight != mHeight || inForceRegen) { -void DeltaField::SetSize( long inWidth, long inHeight, long inRowSize, bool inForceRegen ) { - - // Only resize if the new size is different... - if ( inWidth != mWidth || inHeight != mHeight || inForceRegen ) { + mWidth = inWidth; + mHeight = inHeight; + mRowSize = inRowSize; - mWidth = inWidth; - mHeight = inHeight; - mRowSize = inRowSize; + // Each pixel needs 4 bytes of info per pixel (max) plus 4 shorts, 2 bytes + // per row (max) + mCurrentRow = mGradBuf.Dim(4 * mWidth * mHeight + 10 * mHeight + 64); + mFieldData.mField = mCurrentRow; - // Each pixel needs 4 bytes of info per pixel (max) plus 4 shorts, 2 bytes per row (max) - mCurrentRow = mGradBuf.Dim( 4 * mWidth * mHeight + 10 * mHeight + 64 ); - mFieldData.mField = mCurrentRow; + mXScale = 2.0 / ((float)mWidth); + mYScale = 2.0 / ((float)mHeight); - mXScale = 2.0 / ( (float) mWidth ); - mYScale = 2.0 / ( (float) mHeight ); + // If we're to keep the xy aspect ratio to 1, change the dim that will get + // stretched + if (mAspect1to1) { + if (mYScale > mXScale) + mXScale = mYScale; + else + mYScale = mXScale; + } - // If we're to keep the xy aspect ratio to 1, change the dim that will get stretched - if ( mAspect1to1 ) { - if ( mYScale > mXScale ) - mXScale = mYScale; - else - mYScale = mXScale; - } - - // Reset all computation of this delta field - mCurrentY = 0; - } + // Reset all computation of this delta field + mCurrentY = 0; + } } - - - - void DeltaField::CalcSome() { - float xscale2, yscale2, r, fx, fy; - long px, sx, sy, t; - unsigned long addrOffset; - char* g; - bool outOfBounds; - - // If we're still have stuff left to compute... - if ( mCurrentY >= 0 && mCurrentY < mHeight ) { - - // Calc the y we're currently at - mY_Cord = 0.5 * mYScale * ( mHeight - 2 * mCurrentY ); - - // Save some cycles by pre-computing indep stuff - xscale2 = ( (float) ( 1 << DEC_SIZE ) ) / mXScale; - yscale2 = ( (float) ( 1 << DEC_SIZE ) ) / mYScale; - - // Resume on the pixel we left off at - g = mCurrentRow; - - // Calc the mCurrentY row of the grad field - for ( px = 0; px < mWidth; px++ ) { - mX_Cord = 0.5 * mXScale * ( 2 * px - mWidth ); - - // Calculate R and THETA only if the field uses it (don't burn cycles on sqrt() and atan()) - if ( mHasRTerm ) - mR_Cord = sqrt( mX_Cord * mX_Cord + mY_Cord * mY_Cord ); - if( mHasThetaTerm ) - mT_Cord = atan2( mY_Cord, mX_Cord ); - - // Evaluate any temp variables - mDVars.Evaluate(); - - // Evaluate the source point for (mXCord, mYCord) - fx = mXField.Evaluate(); - fy = mYField.Evaluate(); - if ( mPolar ) { - r = fx; - fx = r * cos( fy ); - fy = r * sin( fy ); - } - sx = xscale2 * ( fx - mX_Cord ); - sy = yscale2 * ( mY_Cord - fy ); - - // See if the source cord for the current cord is out of the frame rect - outOfBounds = false; - t = px + ( sx >> DEC_SIZE ); - if ( t >= mWidth - 1 || t < 0 ) - outOfBounds = true; - t = mCurrentY + ( sy >> DEC_SIZE ); - if ( t >= mHeight - 1 || t < 0 ) - outOfBounds = true; - - // Get rid of negative numbers - sx += 0x7F00; - sy += 0x7F00; - - // Blacken this pixel if the vector is not encodable... - if ( sx > ( (long) 0xFF00 ) || sx < 0 || sy > ( (long) 0xFF00 ) || sy < 0 ) - outOfBounds = true; - - // If this cord is in bounds then encode it, otherwise signal PixPort::Fade() - if ( outOfBounds ) - *( ( unsigned long* ) g ) = 0xFFFFFFFF; - else { - - // Precompute the address of the souce quad-pixel fence - addrOffset = ( sx >> 8 ) + px + ( sy >> 8 ) * mRowSize; - - *( ( unsigned long* ) g ) = ( addrOffset << 14 ) | - ( ( sx & 0x00FE ) << 6 ) | - ( ( sy & 0x00FE ) >> 1 ); - } - - g += 4; - } - - // Store where this row ends - mCurrentRow = g; - - // Signal the compution of the next row - mCurrentY++; - } - - - if ( IsCalculated() ) { - - // Give PixPort some needed info and scrap ptrs - /*mFieldData.mNegYExtents = 1 - ( mNegYExtents >> DEC_SIZE ); - if ( mFieldData.mNegYExtents > mHeight ) - mFieldData.mNegYExtents = mHeight; - - // 8-bit pixels, so once byte per pixel - mFieldData.mYExtentsBuf = mYExtentsBuf.Dim( mFieldData.mNegYExtents * mWidth ); */ - } + float xscale2, yscale2, r, fx, fy; + long px, sx, sy, t; + unsigned long addrOffset; + char *g; + bool outOfBounds; + + // If we're still have stuff left to compute... + if (mCurrentY >= 0 && mCurrentY < mHeight) { + + // Calc the y we're currently at + mY_Cord = 0.5 * mYScale * (mHeight - 2 * mCurrentY); + + // Save some cycles by pre-computing indep stuff + xscale2 = ((float)(1 << DEC_SIZE)) / mXScale; + yscale2 = ((float)(1 << DEC_SIZE)) / mYScale; + + // Resume on the pixel we left off at + g = mCurrentRow; + + // Calc the mCurrentY row of the grad field + for (px = 0; px < mWidth; px++) { + mX_Cord = 0.5 * mXScale * (2 * px - mWidth); + + // Calculate R and THETA only if the field uses it (don't burn cycles on + // sqrt() and atan()) + if (mHasRTerm) + mR_Cord = sqrt(mX_Cord * mX_Cord + mY_Cord * mY_Cord); + if (mHasThetaTerm) + mT_Cord = atan2(mY_Cord, mX_Cord); + + // Evaluate any temp variables + mDVars.Evaluate(); + + // Evaluate the source point for (mXCord, mYCord) + fx = mXField.Evaluate(); + fy = mYField.Evaluate(); + if (mPolar) { + r = fx; + fx = r * cos(fy); + fy = r * sin(fy); + } + sx = xscale2 * (fx - mX_Cord); + sy = yscale2 * (mY_Cord - fy); + + // See if the source cord for the current cord is out of the frame rect + outOfBounds = false; + t = px + (sx >> DEC_SIZE); + if (t >= mWidth - 1 || t < 0) + outOfBounds = true; + t = mCurrentY + (sy >> DEC_SIZE); + if (t >= mHeight - 1 || t < 0) + outOfBounds = true; + + // Get rid of negative numbers + sx += 0x7F00; + sy += 0x7F00; + + // Blacken this pixel if the vector is not encodable... + if (sx > ((long)0xFF00) || sx < 0 || sy > ((long)0xFF00) || sy < 0) + outOfBounds = true; + + // If this cord is in bounds then encode it, otherwise signal + // PixPort::Fade() + if (outOfBounds) + *((unsigned long *)g) = 0xFFFFFFFF; + else { + + // Precompute the address of the souce quad-pixel fence + addrOffset = (sx >> 8) + px + (sy >> 8) * mRowSize; + + *((unsigned long *)g) = + (addrOffset << 14) | ((sx & 0x00FE) << 6) | ((sy & 0x00FE) >> 1); + } + + g += 4; + } + + // Store where this row ends + mCurrentRow = g; + + // Signal the compution of the next row + mCurrentY++; + } + + if (IsCalculated()) { + + // Give PixPort some needed info and scrap ptrs + /*mFieldData.mNegYExtents = 1 - ( mNegYExtents >> DEC_SIZE ); + if ( mFieldData.mNegYExtents > mHeight ) + mFieldData.mNegYExtents = mHeight; + + // 8-bit pixels, so once byte per pixel + mFieldData.mYExtentsBuf = mYExtentsBuf.Dim( mFieldData.mNegYExtents * mWidth + ); */ + } } - - - diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/G-Force.cpp b/libvisual-plugins/plugins/actor/gforce/GForceCommon/G-Force.cpp index cbe720ee7..c08021ae6 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/G-Force.cpp +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/G-Force.cpp @@ -11,11 +11,10 @@ #ifdef UNIX_X -#define __defaultTTFormat "" -#define __defaultFont "" - -#define __drawText( x, y, str ) fprintf(stderr,str->getCStr()); +#define __defaultTTFormat "" +#define __defaultFont "" +#define __drawText(x, y, str) fprintf(stderr, str->getCStr()); #include "RectUtils.h" #define __setupPort @@ -24,7 +23,6 @@ #endif - #include "CEgFileSpec.h" #include "EgOSUtils.h" #include @@ -34,1061 +32,1097 @@ #include "Hashtable.h" #include "ParticleGroup.h" -#define VAL(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) -#define VAL2(a,b) (((a)<<8)+(b)) +#define VAL(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) +#define VAL2(a, b) (((a) << 8) + (b)) -GForce::GForce( void* inRefCon ) : +GForce::GForce(void *inRefCon) + : #if defined(UNIX_X) - mPrefs( ".G-Force", true ), + mPrefs(".G-Force", true), #endif - mConsoleLines( cDuplicatesAllowed, cOrderImportant ), - mLineExpireTimes( cOrderImportant ), - mT( 0 ), - mPal1( mT, mIntensityParam ), - mPal2( mT, mIntensityParam ), - mDeltaFields ( cNoDuplicates_CaseInsensitive, cSortLowToHigh ), - mColorMaps ( cNoDuplicates_CaseInsensitive, cSortLowToHigh ), - mWaveShapes ( cNoDuplicates_CaseInsensitive, cSortLowToHigh ), - mParticles ( cNoDuplicates_CaseInsensitive, cSortLowToHigh ), - mWave1( mT ), - mWave2( mT ) -{ - // Do initting... - mWind = 0; - mOutPort = 0; - mRefCon = inRefCon; - mFrameCount = 0; - mT_MS_Base = EgOSUtils::CurTimeMS(); - mConsoleExpireTime = - mLastCursorUpdate = - mLastGetKeys = - mT_MS = 0; - mFrameCountStart = - mNextPaletteUpdate = 0; - mNextShapeChange = mT + 10; - mNextFieldChange = mT + 10; - mNextColorChange = mT + 10; - mLastSongStart = mT - 10000; - mLastKeyPollTime = mT; - mLastActiveTime = mT; - mDoingSetPortWin = false; - mNeedsPaneErased = true; - mShapeSlideShow = - mColorSlideShow = - mFieldSlideShow = true; - mAtFullScreen = false; - mMouseWillAwaken = false; - mTrackTextDur = 0; - - mPrefs.Load(); - if ( mPrefs.GetPref( VAL('V','e','r','s') ) != GFORCE_COMPAT_VERSION ) { - mConsoleDelay = 8; - mConsoleLineDur = 14; - mMagScale = 1; - mTransitionLo = 4; - mTransitionHi = 18; - mScrnSaverDelay = -1 * 60; // Factory: screen saver mode disabled - mPrefs.SetPref( VAL('V','e','r','s'), GFORCE_COMPAT_VERSION ); - mBorderlessWind = 0; - mHandleKeys = 1; - mNum_S_Steps = 200; - mFullscreenSize.h = 640; - mFullscreenSize.v = 480; - mFullscreenDepth = 8; - mFullscreenDevice = 0; - mMaxSize.h = 30000; - mMaxSize.v = 360; - mTrackTextPosMode = 5; - mTrackTextSize = 18; - mNormalizeInput = false; - mNewConfigNotify = false; - mParticlesOn = true; - mKeyMap .Assign( "TLRY`SNGFZXCQWE,.M[]{}P******!@#$%^&*()1234567890" ); - mFieldIntervalStr .Assign( "18 + rnd( 15 )" ); - mColorIntervalStr .Assign( "10 + rnd( 15 )" ); - mShapeIntervalStr .Assign( "10 + rnd( 15 )" ); - mTrackFont .Assign( __defaultFont ); - mTrackTextStartStr .Assign( "4 + LAST_SONG_START - t" ); - mTrackTextDurationStr .Assign( "5" ); - mTrackMetaText .Assign( __defaultTTFormat ); - mParticleDuration .Assign( "8 + rnd( 15 )" ); - mParticleProbability .Assign( ".09/((NUM_PARTICLES+1)^1.66)" ); - - - // Show the welcome msg for a pref rewrite... - Println( GFORCE_VERS_STR ); - Println( "Press '?' for help" ); - } - else { - mConsoleDelay = mPrefs.GetPref( VAL('C','D','u','r') ); - mConsoleLineDur = mPrefs.GetPref( VAL('C','L','i','n') ); - mMagScale = mPrefs.GetPref( VAL('M','S','c','l') ) / 1000.0; - mTransitionLo = mPrefs.GetPref( VAL('T','r','L','o') ); - mTransitionHi = mPrefs.GetPref( VAL('T','r','H','i') ); - mScrnSaverDelay = mPrefs.GetPref( VAL('S','S','v','r') ) * 60.0; - mBorderlessWind = mPrefs.GetPref( VAL('N','o','B','o') ); - mHandleKeys = mPrefs.GetPref( VAL('K','y','b','d') ); - mNum_S_Steps = mPrefs.GetPref( VAL('S','t','p','s') ); - mFullscreenSize.h = mPrefs.GetPref( VAL('F','S','_','X') ); - mFullscreenSize.v = mPrefs.GetPref( VAL('F','S','_','Y') ); - mFullscreenDepth = mPrefs.GetPref( VAL('F','S','_','D') ); - mFullscreenDevice = mPrefs.GetPref( VAL('F','S','_','#') ); - mParticlesOn = mPrefs.GetPref( VAL('P','_','O','n') ); - mNormalizeInput = mPrefs.GetPref( VAL('N','o','r','m') ); - mMaxSize.v = mPrefs.GetPref( VAL('M','a','x','Y') ); - mMaxSize.h = mPrefs.GetPref( VAL('M','a','x','X') ); - mNewConfigNotify = mPrefs.GetPref( VAL('S','h','w','T') ); - mTrackTextPosMode = mPrefs.GetPref( VAL('T','P','o','s') ); - mTrackTextSize = mPrefs.GetPref( VAL('T','S','z','e') ); - mPrefs.GetPref( VAL('W','I','n','t'), mShapeIntervalStr ); - mPrefs.GetPref( VAL('D','I','n','t'), mFieldIntervalStr ); - mPrefs.GetPref( VAL('C','I','n','t'), mColorIntervalStr ); - mPrefs.GetPref( VAL2('T','?'), mTrackTextStartStr ); - mPrefs.GetPref( VAL('T','D','u','r'), mTrackTextDurationStr ); - mPrefs.GetPref( VAL('T','F','n','t'), mTrackFont ); - mPrefs.GetPref( VAL('T','S','t','r'), mTrackMetaText ); - mPrefs.GetPref( VAL('P','D','u','r'), mParticleDuration ); - mPrefs.GetPref( VAL('P','P','r','b'), mParticleProbability ); - mPrefs.GetPref( VAL('K','M','a','p'), mKeyMap ); - } - - mPortA.SetTrackTextFont( mTrackFont, mTrackTextSize ); - mPortB.SetTrackTextFont( mTrackFont, mTrackTextSize ); - - // Catch any bad values for mNumSampleBins - if ( mNum_S_Steps < 1 || mNum_S_Steps > 10000 ) - mNum_S_Steps = 320; - - - mNum_FFT_Steps = 256; - - // Alloc/setup the data we'll have our virtual machines accessing... - SetNumSampleBins( mNum_S_Steps ); - SetNumFFTBins( mNum_FFT_Steps ); - - // Setup waveshape members - mWave1.SetMagFcn( (ExprUserFcn**) &mSampleFcn ); - mWave2.SetMagFcn( (ExprUserFcn**) &mSampleFcn ); - - // FIXME, use FFT data here - mWave1.SetFFTFcn( (ExprUserFcn**) &mFFTFcn ); - mWave2.SetFFTFcn( (ExprUserFcn**) &mFFTFcn ); - - // Init particle stuff - mDict.AddVar( "T", &mT ); - mDict.AddVar( "LAST_PARTICLE_START", &mLastParticleStart ); - mDict.AddVar( "NUM_PARTICLES", &mNumRunningParticles ); - mNumRunningParticles = 0; - mNextParticleCheck = mT + 1; - mParticleProbabilityFcn.Compile( mParticleProbability, mDict ); - mParticleDurationFcn.Compile( mParticleDuration, mDict ); - mShapeInterval.Compile( mShapeIntervalStr, mDict ); - mColorInterval.Compile( mColorIntervalStr, mDict ); - mFieldInterval.Compile( mFieldIntervalStr, mDict ); - - // Track Text stuff - mDict.AddVar( "LAST_SONG_START", &mLastSongStart ); - mTrackTextStartFcn.Compile( mTrackTextStartStr, mDict ); - mTrackTextDurFcn.Compile( mTrackTextDurationStr, mDict ); - - // Transition bookkeeping - mColorTransTime = -1; - mShapeTransTime = -1; - mGF_Palette = 0; - mWave = 0; - - - // Look in G-Force's support folders and see what we have to select from... - BuildConfigLists(); - - mField = &mField1; - mNextField = &mField2; - - for ( int i = 0; i < 4; i++ ) - mCurKeys[ i ] = 0; + mConsoleLines(cDuplicatesAllowed, cOrderImportant), + mLineExpireTimes(cOrderImportant), mT(0), mPal1(mT, mIntensityParam), + mPal2(mT, mIntensityParam), + mDeltaFields(cNoDuplicates_CaseInsensitive, cSortLowToHigh), + mColorMaps(cNoDuplicates_CaseInsensitive, cSortLowToHigh), + mWaveShapes(cNoDuplicates_CaseInsensitive, cSortLowToHigh), + mParticles(cNoDuplicates_CaseInsensitive, cSortLowToHigh), mWave1(mT), + mWave2(mT) { + // Do initting... + mWind = 0; + mOutPort = 0; + mRefCon = inRefCon; + mFrameCount = 0; + mT_MS_Base = EgOSUtils::CurTimeMS(); + mConsoleExpireTime = mLastCursorUpdate = mLastGetKeys = mT_MS = 0; + mFrameCountStart = mNextPaletteUpdate = 0; + mNextShapeChange = mT + 10; + mNextFieldChange = mT + 10; + mNextColorChange = mT + 10; + mLastSongStart = mT - 10000; + mLastKeyPollTime = mT; + mLastActiveTime = mT; + mDoingSetPortWin = false; + mNeedsPaneErased = true; + mShapeSlideShow = mColorSlideShow = mFieldSlideShow = true; + mAtFullScreen = false; + mMouseWillAwaken = false; + mTrackTextDur = 0; + + mPrefs.Load(); + if (mPrefs.GetPref(VAL('V', 'e', 'r', 's')) != GFORCE_COMPAT_VERSION) { + mConsoleDelay = 8; + mConsoleLineDur = 14; + mMagScale = 1; + mTransitionLo = 4; + mTransitionHi = 18; + mScrnSaverDelay = -1 * 60; // Factory: screen saver mode disabled + mPrefs.SetPref(VAL('V', 'e', 'r', 's'), GFORCE_COMPAT_VERSION); + mBorderlessWind = 0; + mHandleKeys = 1; + mNum_S_Steps = 200; + mFullscreenSize.h = 640; + mFullscreenSize.v = 480; + mFullscreenDepth = 8; + mFullscreenDevice = 0; + mMaxSize.h = 30000; + mMaxSize.v = 360; + mTrackTextPosMode = 5; + mTrackTextSize = 18; + mNormalizeInput = false; + mNewConfigNotify = false; + mParticlesOn = true; + mKeyMap.Assign("TLRY`SNGFZXCQWE,.M[]{}P******!@#$%^&*()1234567890"); + mFieldIntervalStr.Assign("18 + rnd( 15 )"); + mColorIntervalStr.Assign("10 + rnd( 15 )"); + mShapeIntervalStr.Assign("10 + rnd( 15 )"); + mTrackFont.Assign(__defaultFont); + mTrackTextStartStr.Assign("4 + LAST_SONG_START - t"); + mTrackTextDurationStr.Assign("5"); + mTrackMetaText.Assign(__defaultTTFormat); + mParticleDuration.Assign("8 + rnd( 15 )"); + mParticleProbability.Assign(".09/((NUM_PARTICLES+1)^1.66)"); + + // Show the welcome msg for a pref rewrite... + Println(GFORCE_VERS_STR); + Println("Press '?' for help"); + } else { + mConsoleDelay = mPrefs.GetPref(VAL('C', 'D', 'u', 'r')); + mConsoleLineDur = mPrefs.GetPref(VAL('C', 'L', 'i', 'n')); + mMagScale = mPrefs.GetPref(VAL('M', 'S', 'c', 'l')) / 1000.0; + mTransitionLo = mPrefs.GetPref(VAL('T', 'r', 'L', 'o')); + mTransitionHi = mPrefs.GetPref(VAL('T', 'r', 'H', 'i')); + mScrnSaverDelay = mPrefs.GetPref(VAL('S', 'S', 'v', 'r')) * 60.0; + mBorderlessWind = mPrefs.GetPref(VAL('N', 'o', 'B', 'o')); + mHandleKeys = mPrefs.GetPref(VAL('K', 'y', 'b', 'd')); + mNum_S_Steps = mPrefs.GetPref(VAL('S', 't', 'p', 's')); + mFullscreenSize.h = mPrefs.GetPref(VAL('F', 'S', '_', 'X')); + mFullscreenSize.v = mPrefs.GetPref(VAL('F', 'S', '_', 'Y')); + mFullscreenDepth = mPrefs.GetPref(VAL('F', 'S', '_', 'D')); + mFullscreenDevice = mPrefs.GetPref(VAL('F', 'S', '_', '#')); + mParticlesOn = mPrefs.GetPref(VAL('P', '_', 'O', 'n')); + mNormalizeInput = mPrefs.GetPref(VAL('N', 'o', 'r', 'm')); + mMaxSize.v = mPrefs.GetPref(VAL('M', 'a', 'x', 'Y')); + mMaxSize.h = mPrefs.GetPref(VAL('M', 'a', 'x', 'X')); + mNewConfigNotify = mPrefs.GetPref(VAL('S', 'h', 'w', 'T')); + mTrackTextPosMode = mPrefs.GetPref(VAL('T', 'P', 'o', 's')); + mTrackTextSize = mPrefs.GetPref(VAL('T', 'S', 'z', 'e')); + mPrefs.GetPref(VAL('W', 'I', 'n', 't'), mShapeIntervalStr); + mPrefs.GetPref(VAL('D', 'I', 'n', 't'), mFieldIntervalStr); + mPrefs.GetPref(VAL('C', 'I', 'n', 't'), mColorIntervalStr); + mPrefs.GetPref(VAL2('T', '?'), mTrackTextStartStr); + mPrefs.GetPref(VAL('T', 'D', 'u', 'r'), mTrackTextDurationStr); + mPrefs.GetPref(VAL('T', 'F', 'n', 't'), mTrackFont); + mPrefs.GetPref(VAL('T', 'S', 't', 'r'), mTrackMetaText); + mPrefs.GetPref(VAL('P', 'D', 'u', 'r'), mParticleDuration); + mPrefs.GetPref(VAL('P', 'P', 'r', 'b'), mParticleProbability); + mPrefs.GetPref(VAL('K', 'M', 'a', 'p'), mKeyMap); + } + + mPortA.SetTrackTextFont(mTrackFont, mTrackTextSize); + mPortB.SetTrackTextFont(mTrackFont, mTrackTextSize); + + // Catch any bad values for mNumSampleBins + if (mNum_S_Steps < 1 || mNum_S_Steps > 10000) + mNum_S_Steps = 320; + + mNum_FFT_Steps = 256; + + // Alloc/setup the data we'll have our virtual machines accessing... + SetNumSampleBins(mNum_S_Steps); + SetNumFFTBins(mNum_FFT_Steps); + + // Setup waveshape members + mWave1.SetMagFcn((ExprUserFcn **)&mSampleFcn); + mWave2.SetMagFcn((ExprUserFcn **)&mSampleFcn); + + // FIXME, use FFT data here + mWave1.SetFFTFcn((ExprUserFcn **)&mFFTFcn); + mWave2.SetFFTFcn((ExprUserFcn **)&mFFTFcn); + + // Init particle stuff + mDict.AddVar("T", &mT); + mDict.AddVar("LAST_PARTICLE_START", &mLastParticleStart); + mDict.AddVar("NUM_PARTICLES", &mNumRunningParticles); + mNumRunningParticles = 0; + mNextParticleCheck = mT + 1; + mParticleProbabilityFcn.Compile(mParticleProbability, mDict); + mParticleDurationFcn.Compile(mParticleDuration, mDict); + mShapeInterval.Compile(mShapeIntervalStr, mDict); + mColorInterval.Compile(mColorIntervalStr, mDict); + mFieldInterval.Compile(mFieldIntervalStr, mDict); + + // Track Text stuff + mDict.AddVar("LAST_SONG_START", &mLastSongStart); + mTrackTextStartFcn.Compile(mTrackTextStartStr, mDict); + mTrackTextDurFcn.Compile(mTrackTextDurationStr, mDict); + + // Transition bookkeeping + mColorTransTime = -1; + mShapeTransTime = -1; + mGF_Palette = 0; + mWave = 0; + + // Look in G-Force's support folders and see what we have to select from... + BuildConfigLists(); + + mField = &mField1; + mNextField = &mField2; + + for (int i = 0; i < 4; i++) + mCurKeys[i] = 0; } - - - GForce::~GForce() { - // Rewrite the prefs to disk... - mPrefs.SetPref( VAL('S','S','v','r'), mScrnSaverDelay / 60.0 ); - mPrefs.SetPref( VAL('T','r','H','i'), mTransitionHi ); - mPrefs.SetPref( VAL('T','r','L','o'), mTransitionLo ); - mPrefs.SetPref( VAL('M','S','c','l'), mMagScale * 1000 ); - mPrefs.SetPref( VAL('C','I','n','t'), mColorIntervalStr ); - mPrefs.SetPref( VAL('W','I','n','t'), mShapeIntervalStr ); - mPrefs.SetPref( VAL('D','I','n','t'), mFieldIntervalStr ); - mPrefs.SetPref( VAL('S','t','p','s'), mNum_S_Steps ); - mPrefs.SetPref( VAL('P','D','u','r'), mParticleDuration ); - mPrefs.SetPref( VAL('P','P','r','b'), mParticleProbability ); - mPrefs.SetPref( VAL('N','o','B','o'), mBorderlessWind ); - mPrefs.SetPref( VAL('K','y','b','d'), mHandleKeys ); - mPrefs.SetPref( VAL('F','S','_','X'), mFullscreenSize.h ); - mPrefs.SetPref( VAL('F','S','_','Y'), mFullscreenSize.v ); - mPrefs.SetPref( VAL('F','S','_','D'), mFullscreenDepth ); - mPrefs.SetPref( VAL('F','S','_','#'), mFullscreenDevice ); - mPrefs.SetPref( VAL('N','o','r','m'), mNormalizeInput ); - mPrefs.SetPref( VAL('M','a','x','Y'), mMaxSize.v ); - mPrefs.SetPref( VAL('M','a','x','X'), mMaxSize.h ); - mPrefs.SetPref( VAL('T','P','o','s'), mTrackTextPosMode ); - mPrefs.SetPref( VAL('T','S','z','e'), mTrackTextSize ); - mPrefs.SetPref( VAL('T','F','n','t'), mTrackFont ); - mPrefs.SetPref( VAL('T','S','t','r'), mTrackMetaText ); - mPrefs.SetPref( VAL2('T','?'), mTrackTextStartStr ); - mPrefs.SetPref( VAL('T','D','u','r'), mTrackTextDurationStr ); - mPrefs.SetPref( VAL('K','M','a','p'), mKeyMap ); - mPrefs.SetPref( VAL('P','_','O','n'), mParticlesOn ? 1 : 0 ); - mPrefs.SetPref( VAL('S','h','w','T'), mNewConfigNotify ? 1 : 0 ); - mPrefs.SetPref( VAL('C','D','u','r'), mConsoleDelay ); - mPrefs.SetPref( VAL('C','L','i','n'), mConsoleLineDur ); - - // Init the track text info - NewSong(); - - mPrefs.Store(); - + // Rewrite the prefs to disk... + mPrefs.SetPref(VAL('S', 'S', 'v', 'r'), mScrnSaverDelay / 60.0); + mPrefs.SetPref(VAL('T', 'r', 'H', 'i'), mTransitionHi); + mPrefs.SetPref(VAL('T', 'r', 'L', 'o'), mTransitionLo); + mPrefs.SetPref(VAL('M', 'S', 'c', 'l'), mMagScale * 1000); + mPrefs.SetPref(VAL('C', 'I', 'n', 't'), mColorIntervalStr); + mPrefs.SetPref(VAL('W', 'I', 'n', 't'), mShapeIntervalStr); + mPrefs.SetPref(VAL('D', 'I', 'n', 't'), mFieldIntervalStr); + mPrefs.SetPref(VAL('S', 't', 'p', 's'), mNum_S_Steps); + mPrefs.SetPref(VAL('P', 'D', 'u', 'r'), mParticleDuration); + mPrefs.SetPref(VAL('P', 'P', 'r', 'b'), mParticleProbability); + mPrefs.SetPref(VAL('N', 'o', 'B', 'o'), mBorderlessWind); + mPrefs.SetPref(VAL('K', 'y', 'b', 'd'), mHandleKeys); + mPrefs.SetPref(VAL('F', 'S', '_', 'X'), mFullscreenSize.h); + mPrefs.SetPref(VAL('F', 'S', '_', 'Y'), mFullscreenSize.v); + mPrefs.SetPref(VAL('F', 'S', '_', 'D'), mFullscreenDepth); + mPrefs.SetPref(VAL('F', 'S', '_', '#'), mFullscreenDevice); + mPrefs.SetPref(VAL('N', 'o', 'r', 'm'), mNormalizeInput); + mPrefs.SetPref(VAL('M', 'a', 'x', 'Y'), mMaxSize.v); + mPrefs.SetPref(VAL('M', 'a', 'x', 'X'), mMaxSize.h); + mPrefs.SetPref(VAL('T', 'P', 'o', 's'), mTrackTextPosMode); + mPrefs.SetPref(VAL('T', 'S', 'z', 'e'), mTrackTextSize); + mPrefs.SetPref(VAL('T', 'F', 'n', 't'), mTrackFont); + mPrefs.SetPref(VAL('T', 'S', 't', 'r'), mTrackMetaText); + mPrefs.SetPref(VAL2('T', '?'), mTrackTextStartStr); + mPrefs.SetPref(VAL('T', 'D', 'u', 'r'), mTrackTextDurationStr); + mPrefs.SetPref(VAL('K', 'M', 'a', 'p'), mKeyMap); + mPrefs.SetPref(VAL('P', '_', 'O', 'n'), mParticlesOn ? 1 : 0); + mPrefs.SetPref(VAL('S', 'h', 'w', 'T'), mNewConfigNotify ? 1 : 0); + mPrefs.SetPref(VAL('C', 'D', 'u', 'r'), mConsoleDelay); + mPrefs.SetPref(VAL('C', 'L', 'i', 'n'), mConsoleLineDur); + + // Init the track text info + NewSong(); + + mPrefs.Store(); } +void GForce::SetNumSampleBins(long inNumBins) { + float k; + if (inNumBins > 0 && inNumBins < 10000) { + mSampleFcn = (ExprUserFcn *)mSamplesBuf.Dim(sizeof(float) * inNumBins + + sizeof(ExprUserFcn) + 32); + mNum_S_Steps = inNumBins; + mSampleFcn->mNumFcnBins = inNumBins; + // A fast lookup table for a sine wave + mSine = (float *)mSineBuf.Dim(sizeof(float) * inNumBins); + k = 6.2831853071795 / ((float)inNumBins); - -void GForce::SetNumSampleBins( long inNumBins ) { - float k; - - if ( inNumBins > 0 && inNumBins < 10000 ) { - mSampleFcn = (ExprUserFcn*) mSamplesBuf.Dim( sizeof( float ) * inNumBins + sizeof( ExprUserFcn ) + 32 ); - mNum_S_Steps = inNumBins; - mSampleFcn -> mNumFcnBins = inNumBins; - - // A fast lookup table for a sine wave - mSine = (float*) mSineBuf.Dim( sizeof( float ) * inNumBins ); - k = 6.2831853071795 / ( (float) inNumBins ); - - for ( int i = 0; i < inNumBins; i++ ) { - mSampleFcn -> mFcn[ i ] = 0; - mSine[ i ] = sin( k * ( (float) i ) ); - } - } + for (int i = 0; i < inNumBins; i++) { + mSampleFcn->mFcn[i] = 0; + mSine[i] = sin(k * ((float)i)); + } + } } +void GForce::SetNumFFTBins(long inNumBins) { - - - -void GForce::SetNumFFTBins( long inNumBins ) { - - if ( inNumBins > 0 && inNumBins < 1000 ) { - mFFTFcn = (ExprUserFcn*) mFFTBuf.Dim( sizeof( float ) * inNumBins + sizeof( ExprUserFcn ) + 32); - mNum_FFT_Steps = inNumBins; - mFFTFcn -> mNumFcnBins = inNumBins; - } + if (inNumBins > 0 && inNumBins < 1000) { + mFFTFcn = (ExprUserFcn *)mFFTBuf.Dim(sizeof(float) * inNumBins + + sizeof(ExprUserFcn) + 32); + mNum_FFT_Steps = inNumBins; + mFFTFcn->mNumFcnBins = inNumBins; + } } - - -#define __setChar( n, ID ) s.setChar( n, mKeyMap.getChar( ID ) ) - +#define __setChar(n, ID) s.setChar(n, mKeyMap.getChar(ID)) void GForce::ShowHelp() { - UtilStr s; - - s.Assign( "X - Display track title" ); __setChar( 1, cDispTrackTitle ); Println( &s ); - s.Assign( "X - List configs" ); __setChar( 1, cGetConfigInfo ); Println( &s ); - s.Assign( "X - Frame Rate" ); __setChar( 1, cFrameRate ); Println( &s ); - s.Assign( "X - Particles on/off" ); __setChar( 1, cToggleParticles ); Println( &s ); - s.Assign( "X - Spawn new particle" ); __setChar( 1, cSpawnNewParticle ); Println( &s ); - s.Assign( "X - Fullscreen on/off" ); __setChar( 1, cToggleFullsceen ); Println( &s ); - s.Assign( "X - Show config titles on/off" ); __setChar( 1, cToggleConfigName ); Println( &s ); - s.Assign( "X - Normalize input on/off" ); __setChar( 1, cToggleNormalize ); Println( &s ); - - s.Assign( "X X - Freeze/Continue slideshow" ); __setChar( 1, cStopSlideshowAll ); __setChar( 3, cStartSlideshowAll ); Println( &s ); - s.Assign( "X X - +/- sound amplitude (See Extras docs)" ); __setChar( 1, cDecMagScale ); __setChar( 3, cIncMagScale ); Println( &s ); - s.Assign( "X X - +/- num of bins (Stps) (See Extras docs)" ); __setChar( 1, cDecNumSSteps ); __setChar( 3, cIncNumSSteps ); Println( &s ); - s.Assign( "X X X - Prev/Next/Hold DeltaField" ); __setChar( 1, cPrevDeltaField ); __setChar( 3, cNextDeltaField ); __setChar( 5, cToggleFieldShow ); Println( &s ); - s.Assign( "X X X - Prev/Next/Hold ColorMap" ); __setChar( 1, cPrevColorMap ); __setChar( 3, cNextColorMap ); __setChar( 5, cToggleColorShow ); Println( &s ); - s.Assign( "X X X - Prev/Next/Hold WaveShape" ); __setChar( 1, cPrevWaveShape ); __setChar( 3, cNextWaveShape ); __setChar( 5, cToggleShapeShow ); Println( &s ); - - Println( "" ); - Println( "Press SHIFT and a number to store the current ColorMap, Waveshape, and" ); - Println( " DeltaField, and press just the number to recall them." ); - - // Give the user more time than usual since this is help info - mConsoleExpireTime += 8000; + UtilStr s; + + s.Assign("X - Display track title"); + __setChar(1, cDispTrackTitle); + Println(&s); + s.Assign("X - List configs"); + __setChar(1, cGetConfigInfo); + Println(&s); + s.Assign("X - Frame Rate"); + __setChar(1, cFrameRate); + Println(&s); + s.Assign("X - Particles on/off"); + __setChar(1, cToggleParticles); + Println(&s); + s.Assign("X - Spawn new particle"); + __setChar(1, cSpawnNewParticle); + Println(&s); + s.Assign("X - Fullscreen on/off"); + __setChar(1, cToggleFullsceen); + Println(&s); + s.Assign("X - Show config titles on/off"); + __setChar(1, cToggleConfigName); + Println(&s); + s.Assign("X - Normalize input on/off"); + __setChar(1, cToggleNormalize); + Println(&s); + + s.Assign("X X - Freeze/Continue slideshow"); + __setChar(1, cStopSlideshowAll); + __setChar(3, cStartSlideshowAll); + Println(&s); + s.Assign("X X - +/- sound amplitude (See Extras docs)"); + __setChar(1, cDecMagScale); + __setChar(3, cIncMagScale); + Println(&s); + s.Assign("X X - +/- num of bins (Stps) (See Extras docs)"); + __setChar(1, cDecNumSSteps); + __setChar(3, cIncNumSSteps); + Println(&s); + s.Assign("X X X - Prev/Next/Hold DeltaField"); + __setChar(1, cPrevDeltaField); + __setChar(3, cNextDeltaField); + __setChar(5, cToggleFieldShow); + Println(&s); + s.Assign("X X X - Prev/Next/Hold ColorMap"); + __setChar(1, cPrevColorMap); + __setChar(3, cNextColorMap); + __setChar(5, cToggleColorShow); + Println(&s); + s.Assign("X X X - Prev/Next/Hold WaveShape"); + __setChar(1, cPrevWaveShape); + __setChar(3, cNextWaveShape); + __setChar(5, cToggleShapeShow); + Println(&s); + + Println(""); + Println( + "Press SHIFT and a number to store the current ColorMap, Waveshape, and"); + Println(" DeltaField, and press just the number to recall them."); + + // Give the user more time than usual since this is help info + mConsoleExpireTime += 8000; } -bool GForce::HandleKey( long inChar ) { - bool handled = true; - int n; - - // See if this keystroke is to be ignored - if ( ! mHandleKeys ) - return false; - - - if ( inChar >= 'a' && inChar <= 'z' ) - inChar = 'A' + ( inChar - 'a' ); - - if ( inChar == '/' || inChar == '?' ) - ShowHelp(); - else if ( inChar >= ' ' && inChar < 129 ) { - - inChar = mKeyMap.FindNextInstanceOf( 0, inChar ); - - switch ( inChar ) { - - case cDispTrackTitle: - StartTrackText(); - break; - - case cGetConfigInfo: - { - Print(_("WaveShape: ")); - Println( &mWaveShapeName ); - Print(_("ColorMap: ")); - Println( &mColorMapName ); - Print(_("DeltaField: ")); - Println( mField -> GetName() ); - ParticleGroup* particle = (ParticleGroup*) mRunningParticlePool.GetHead(); - if ( particle ) { - Print(_("Particles: ")); - - while ( particle ) { - Print( &particle -> mTitle ); - particle = (ParticleGroup*) particle -> GetNext(); - if ( particle ) - Print( ", " ); - } - Println( "" ); - } - break; - } - case cFrameRate: - mTemp.SetFloatValue( ( (float) mCurFrameRate ) / 10.0 ); - mTemp.Append(_(" frames/sec")); - Println( &mTemp ); - break; - - case cDecMagScale: - mMagScale /= 1.2; - mTemp.SetFloatValue( mMagScale ); - Print(_("Amplitude scale: ")); - Println( &mTemp ); - break; - - case cIncMagScale: - mMagScale *= 1.2; - mTemp.SetFloatValue( mMagScale ); - Print(_("Amplitude scale: ")); - Println( &mTemp ); - break; - - case cToggleParticles: - mParticlesOn = ! mParticlesOn; - if ( mParticlesOn ) - Println(_("Particles ON")); - else - Println(_("Particles OFF")); - break; - - case cSpawnNewParticle: - SpawnNewParticle(); - break; - - case cDecNumSSteps: - case cIncNumSSteps: - if ( inChar == cDecNumSSteps ) - n = - 4; - else - n = + 4; - SetNumSampleBins( mNum_S_Steps + n ); - mTemp.Assign(_("Number s steps: ")); - mTemp.Append( mNum_S_Steps ); - Println( &mTemp ); - break; - - case cToggleConfigName: - mNewConfigNotify = ! mNewConfigNotify; - if ( mNewConfigNotify ) - Println(_("Show names ON")); - else - Println(_("Show names OFF")); - break; - - case cToggleNormalize: - mNormalizeInput = ! mNormalizeInput; - if ( mNormalizeInput ) - Println(_("Normalize ON")); - else - Println(_("Normalize OFF")); - break; - - case cPrevDeltaField: - case cNextDeltaField: - n = mFieldPlayList.FindIndexOf( mCurFieldNum ); - if ( inChar == cPrevDeltaField ) - n = n + mFieldPlayList.Count() - 2; - - loadDeltaField( mFieldPlayList.Fetch( 1 + n % mFieldPlayList.Count() ) ); - - // If the pref says so, display that we're loading a new config - if ( mNewConfigNotify ) { - Print(_("Loading DeltaField: ")); - Println( mField -> GetName() ); - } - - // Turn field slide show off when we change deltafields manually - if ( ! mFieldSlideShow ) - break; - case cToggleFieldShow: - mFieldSlideShow = ! mFieldSlideShow; - mNextFieldChange = mT; - if ( mFieldSlideShow ) { - Println(_("DeltaField slideshow ON")); - mFieldPlayList.Randomize(); } - else - Println(_("DeltaField slideshow OFF")); - break; - - - case cStartSlideshowAll: - mFieldSlideShow = true; mNextFieldChange = mT; - mColorSlideShow = true; mNextColorChange = mT; - mShapeSlideShow = true; mNextShapeChange = mT; - Println(_("All slideshows ON")); - break; - - case cStopSlideshowAll: - mFieldSlideShow = false; - mColorSlideShow = false; - mShapeSlideShow = false; - Println(_("All slideshows OFF")); - break; - - - case cPrevColorMap: - case cNextColorMap: - n = mColorPlayList.FindIndexOf( mCurColorMapNum ); - if ( inChar == cPrevColorMap ) - n = n + mColorPlayList.Count() - 2; - - loadColorMap( mColorPlayList.Fetch( 1 + n % mColorPlayList.Count() ), false ); - - // Turn slide show off when we change colormaps manually - if ( ! mColorSlideShow ) - break; - case cToggleColorShow: - mColorSlideShow = ! mColorSlideShow; - mNextColorChange = mT; - if ( mColorSlideShow ) { - Println(_("ColorMap slideshow ON")); - mColorPlayList.Randomize(); } - else - Println(_("ColorMap slideshow OFF")); - break; - - case cPrevWaveShape: - case cNextWaveShape: - n = mShapePlayList.FindIndexOf( mCurShapeNum ); - if ( inChar == cPrevWaveShape ) - n = n + mShapePlayList.Count() - 2; - - loadWaveShape( mShapePlayList.Fetch( 1 + n % mShapePlayList.Count() ), false ); - - // Turn slide show off when we change shapes manually - if ( ! mShapeSlideShow ) - break; - case cToggleShapeShow: - mShapeSlideShow = ! mShapeSlideShow; - mNextShapeChange = mT; - if ( mShapeSlideShow ) { - Println(_("WaveShape slideshow ON")); - mShapePlayList.Randomize(); } - else - Println(_("WaveShape slideshow OFF")); - break; - - case cSetPreset0: StoreConfigState( VAL('S','E','T','0') ); break; - case cSetPreset1: StoreConfigState( VAL('S','E','T','1') ); break; - case cSetPreset2: StoreConfigState( VAL('S','E','T','2') ); break; - case cSetPreset3: StoreConfigState( VAL('S','E','T','3') ); break; - case cSetPreset4: StoreConfigState( VAL('S','E','T','4') ); break; - case cSetPreset5: StoreConfigState( VAL('S','E','T','5') ); break; - case cSetPreset6: StoreConfigState( VAL('S','E','T','6') ); break; - case cSetPreset7: StoreConfigState( VAL('S','E','T','7') ); break; - case cSetPreset8: StoreConfigState( VAL('S','E','T','8') ); break; - case cSetPreset9: StoreConfigState( VAL('S','E','T','9') ); break; - - - case cPreset0: handled = RestoreConfigState( VAL('S','E','T','0') ); break; - case cPreset1: handled = RestoreConfigState( VAL('S','E','T','1') ); break; - case cPreset2: handled = RestoreConfigState( VAL('S','E','T','2') ); break; - case cPreset3: handled = RestoreConfigState( VAL('S','E','T','3') ); break; - case cPreset4: handled = RestoreConfigState( VAL('S','E','T','4') ); break; - case cPreset5: handled = RestoreConfigState( VAL('S','E','T','5') ); break; - case cPreset6: handled = RestoreConfigState( VAL('S','E','T','6') ); break; - case cPreset7: handled = RestoreConfigState( VAL('S','E','T','7') ); break; - case cPreset8: handled = RestoreConfigState( VAL('S','E','T','8') ); break; - case cPreset9: handled = RestoreConfigState( VAL('S','E','T','9') ); break; - - default: - handled = false; - } } - else - handled = false; - - return handled; +bool GForce::HandleKey(long inChar) { + bool handled = true; + int n; + + // See if this keystroke is to be ignored + if (!mHandleKeys) + return false; + + if (inChar >= 'a' && inChar <= 'z') + inChar = 'A' + (inChar - 'a'); + + if (inChar == '/' || inChar == '?') + ShowHelp(); + else if (inChar >= ' ' && inChar < 129) { + + inChar = mKeyMap.FindNextInstanceOf(0, inChar); + + switch (inChar) { + + case cDispTrackTitle: + StartTrackText(); + break; + + case cGetConfigInfo: { + Print(_("WaveShape: ")); + Println(&mWaveShapeName); + Print(_("ColorMap: ")); + Println(&mColorMapName); + Print(_("DeltaField: ")); + Println(mField->GetName()); + ParticleGroup *particle = (ParticleGroup *)mRunningParticlePool.GetHead(); + if (particle) { + Print(_("Particles: ")); + + while (particle) { + Print(&particle->mTitle); + particle = (ParticleGroup *)particle->GetNext(); + if (particle) + Print(", "); + } + Println(""); + } + break; + } + case cFrameRate: + mTemp.SetFloatValue(((float)mCurFrameRate) / 10.0); + mTemp.Append(_(" frames/sec")); + Println(&mTemp); + break; + + case cDecMagScale: + mMagScale /= 1.2; + mTemp.SetFloatValue(mMagScale); + Print(_("Amplitude scale: ")); + Println(&mTemp); + break; + + case cIncMagScale: + mMagScale *= 1.2; + mTemp.SetFloatValue(mMagScale); + Print(_("Amplitude scale: ")); + Println(&mTemp); + break; + + case cToggleParticles: + mParticlesOn = !mParticlesOn; + if (mParticlesOn) + Println(_("Particles ON")); + else + Println(_("Particles OFF")); + break; + + case cSpawnNewParticle: + SpawnNewParticle(); + break; + + case cDecNumSSteps: + case cIncNumSSteps: + if (inChar == cDecNumSSteps) + n = -4; + else + n = +4; + SetNumSampleBins(mNum_S_Steps + n); + mTemp.Assign(_("Number s steps: ")); + mTemp.Append(mNum_S_Steps); + Println(&mTemp); + break; + + case cToggleConfigName: + mNewConfigNotify = !mNewConfigNotify; + if (mNewConfigNotify) + Println(_("Show names ON")); + else + Println(_("Show names OFF")); + break; + + case cToggleNormalize: + mNormalizeInput = !mNormalizeInput; + if (mNormalizeInput) + Println(_("Normalize ON")); + else + Println(_("Normalize OFF")); + break; + + case cPrevDeltaField: + case cNextDeltaField: + n = mFieldPlayList.FindIndexOf(mCurFieldNum); + if (inChar == cPrevDeltaField) + n = n + mFieldPlayList.Count() - 2; + + loadDeltaField(mFieldPlayList.Fetch(1 + n % mFieldPlayList.Count())); + + // If the pref says so, display that we're loading a new config + if (mNewConfigNotify) { + Print(_("Loading DeltaField: ")); + Println(mField->GetName()); + } + + // Turn field slide show off when we change deltafields manually + if (!mFieldSlideShow) + break; + case cToggleFieldShow: + mFieldSlideShow = !mFieldSlideShow; + mNextFieldChange = mT; + if (mFieldSlideShow) { + Println(_("DeltaField slideshow ON")); + mFieldPlayList.Randomize(); + } else + Println(_("DeltaField slideshow OFF")); + break; + + case cStartSlideshowAll: + mFieldSlideShow = true; + mNextFieldChange = mT; + mColorSlideShow = true; + mNextColorChange = mT; + mShapeSlideShow = true; + mNextShapeChange = mT; + Println(_("All slideshows ON")); + break; + + case cStopSlideshowAll: + mFieldSlideShow = false; + mColorSlideShow = false; + mShapeSlideShow = false; + Println(_("All slideshows OFF")); + break; + + case cPrevColorMap: + case cNextColorMap: + n = mColorPlayList.FindIndexOf(mCurColorMapNum); + if (inChar == cPrevColorMap) + n = n + mColorPlayList.Count() - 2; + + loadColorMap(mColorPlayList.Fetch(1 + n % mColorPlayList.Count()), false); + + // Turn slide show off when we change colormaps manually + if (!mColorSlideShow) + break; + case cToggleColorShow: + mColorSlideShow = !mColorSlideShow; + mNextColorChange = mT; + if (mColorSlideShow) { + Println(_("ColorMap slideshow ON")); + mColorPlayList.Randomize(); + } else + Println(_("ColorMap slideshow OFF")); + break; + + case cPrevWaveShape: + case cNextWaveShape: + n = mShapePlayList.FindIndexOf(mCurShapeNum); + if (inChar == cPrevWaveShape) + n = n + mShapePlayList.Count() - 2; + + loadWaveShape(mShapePlayList.Fetch(1 + n % mShapePlayList.Count()), + false); + + // Turn slide show off when we change shapes manually + if (!mShapeSlideShow) + break; + case cToggleShapeShow: + mShapeSlideShow = !mShapeSlideShow; + mNextShapeChange = mT; + if (mShapeSlideShow) { + Println(_("WaveShape slideshow ON")); + mShapePlayList.Randomize(); + } else + Println(_("WaveShape slideshow OFF")); + break; + + case cSetPreset0: + StoreConfigState(VAL('S', 'E', 'T', '0')); + break; + case cSetPreset1: + StoreConfigState(VAL('S', 'E', 'T', '1')); + break; + case cSetPreset2: + StoreConfigState(VAL('S', 'E', 'T', '2')); + break; + case cSetPreset3: + StoreConfigState(VAL('S', 'E', 'T', '3')); + break; + case cSetPreset4: + StoreConfigState(VAL('S', 'E', 'T', '4')); + break; + case cSetPreset5: + StoreConfigState(VAL('S', 'E', 'T', '5')); + break; + case cSetPreset6: + StoreConfigState(VAL('S', 'E', 'T', '6')); + break; + case cSetPreset7: + StoreConfigState(VAL('S', 'E', 'T', '7')); + break; + case cSetPreset8: + StoreConfigState(VAL('S', 'E', 'T', '8')); + break; + case cSetPreset9: + StoreConfigState(VAL('S', 'E', 'T', '9')); + break; + + case cPreset0: + handled = RestoreConfigState(VAL('S', 'E', 'T', '0')); + break; + case cPreset1: + handled = RestoreConfigState(VAL('S', 'E', 'T', '1')); + break; + case cPreset2: + handled = RestoreConfigState(VAL('S', 'E', 'T', '2')); + break; + case cPreset3: + handled = RestoreConfigState(VAL('S', 'E', 'T', '3')); + break; + case cPreset4: + handled = RestoreConfigState(VAL('S', 'E', 'T', '4')); + break; + case cPreset5: + handled = RestoreConfigState(VAL('S', 'E', 'T', '5')); + break; + case cPreset6: + handled = RestoreConfigState(VAL('S', 'E', 'T', '6')); + break; + case cPreset7: + handled = RestoreConfigState(VAL('S', 'E', 'T', '7')); + break; + case cPreset8: + handled = RestoreConfigState(VAL('S', 'E', 'T', '8')); + break; + case cPreset9: + handled = RestoreConfigState(VAL('S', 'E', 'T', '9')); + break; + + default: + handled = false; + } + } else + handled = false; + + return handled; } +void GForce::StoreConfigState(long inParamName) { + UtilStr str; + str.Assign(mWaveShapeName); + str.Append(','); + str.Append(mColorMapName); + str.Append(','); + str.Append(mField->GetName()); + str.Append(','); -void GForce::StoreConfigState( long inParamName ) { - UtilStr str; - - str.Assign( mWaveShapeName ); str.Append( ',' ); - str.Append( mColorMapName ); str.Append( ',' ); - str.Append( mField -> GetName() ); str.Append( ',' ); - - mPrefs.SetPref( inParamName, str ); - Println(_("State stored.")); + mPrefs.SetPref(inParamName, str); + Println(_("State stored.")); } - -bool GForce::RestoreConfigState( long inParamName ) { - UtilStr str, configName; - long pos, n, found = false; - - if ( mPrefs.GetPref( inParamName, str ) ) { - - // Parse the waveshape config name - pos = str.FindNextInstanceOf( 0, ',' ); - configName.Assign( str.getCStr(), pos - 1 ); - n = mWaveShapes.FetchBestMatch( configName ); - loadWaveShape( n, false ); - mShapeSlideShow = false; - - // Parse the colormap config name - str.Trunc( pos, false ); - pos = str.FindNextInstanceOf( 0, ',' ); - configName.Assign( str.getCStr(), pos - 1 ); - n = mColorMaps.FetchBestMatch( configName ); - loadColorMap( n, false ); - mColorSlideShow = false; - - // Parse the colormap config name - str.Trunc( pos, false ); - n = mDeltaFields.FetchBestMatch( str ); - loadDeltaField( n ); - mFieldSlideShow = false; - - found = true; - } - - return found; +bool GForce::RestoreConfigState(long inParamName) { + UtilStr str, configName; + long pos, n, found = false; + + if (mPrefs.GetPref(inParamName, str)) { + + // Parse the waveshape config name + pos = str.FindNextInstanceOf(0, ','); + configName.Assign(str.getCStr(), pos - 1); + n = mWaveShapes.FetchBestMatch(configName); + loadWaveShape(n, false); + mShapeSlideShow = false; + + // Parse the colormap config name + str.Trunc(pos, false); + pos = str.FindNextInstanceOf(0, ','); + configName.Assign(str.getCStr(), pos - 1); + n = mColorMaps.FetchBestMatch(configName); + loadColorMap(n, false); + mColorSlideShow = false; + + // Parse the colormap config name + str.Trunc(pos, false); + n = mDeltaFields.FetchBestMatch(str); + loadDeltaField(n); + mFieldSlideShow = false; + + found = true; + } + + return found; } - - void GForce::ManageColorChanges() { - int i; - - // If in a ColorMap transition/morph - if ( mColorTransTime > 0 ) { - - // If we've the ColorMap transition is over, end it - if ( mT_MS > mColorTransEnd ) { - GF_Palette* temp = mGF_Palette; - mGF_Palette = mNextPal; - mNextPal = temp; - mColorTransTime = -1; - mNextColorChange = mT + mColorInterval.Evaluate(); - } - } - - // Time for a color map change? - else if ( mT > mNextColorChange && mColorSlideShow ) { - - // Load the next config in the (randomized) config list... - i = mColorPlayList.FindIndexOf( mCurColorMapNum ); - - // Make a new play list if we've reached the end of the list... - if ( i >= mColorPlayList.Count() ) { - mColorPlayList.Randomize(); - i = 0; - } - loadColorMap( mColorPlayList.Fetch( i + 1 ), true ); - } - - // Update the screen palette if it's time - if ( mT > mNextPaletteUpdate ) { - - // If in a ColorMap transition/morph then we must set mColorTrans, for it's linked into mGF_Palette - if ( mColorTransTime > 0 ) { - float t = (float) ( mColorTransEnd - mT_MS ) / ( (float) mColorTransTime ); - mColorTrans = pow( t, TRANSITION_ALPHA ); - } - - // Evaluate the palette at this time - mGF_Palette -> Evaluate( mPalette ); - - // Set our offscreen ports to the right palette... - mPortA.SetPalette( mPalette ); - mPortB.SetPalette( mPalette ); - - // If we're at fullsceen, the screen device may need the current palette too - if ( mAtFullScreen && mFullscreenDepth == 8 ) { - mScreen.SetPalette( mPalette ); - mPortA.PreventActivate( mOutPort ); - mPortB.PreventActivate( mOutPort ); - } - - // Reevaluate the palette a short time from now - mNextPaletteUpdate = mT + .1; - } + int i; + + // If in a ColorMap transition/morph + if (mColorTransTime > 0) { + + // If we've the ColorMap transition is over, end it + if (mT_MS > mColorTransEnd) { + GF_Palette *temp = mGF_Palette; + mGF_Palette = mNextPal; + mNextPal = temp; + mColorTransTime = -1; + mNextColorChange = mT + mColorInterval.Evaluate(); + } + } + + // Time for a color map change? + else if (mT > mNextColorChange && mColorSlideShow) { + + // Load the next config in the (randomized) config list... + i = mColorPlayList.FindIndexOf(mCurColorMapNum); + + // Make a new play list if we've reached the end of the list... + if (i >= mColorPlayList.Count()) { + mColorPlayList.Randomize(); + i = 0; + } + loadColorMap(mColorPlayList.Fetch(i + 1), true); + } + + // Update the screen palette if it's time + if (mT > mNextPaletteUpdate) { + + // If in a ColorMap transition/morph then we must set mColorTrans, for it's + // linked into mGF_Palette + if (mColorTransTime > 0) { + float t = (float)(mColorTransEnd - mT_MS) / ((float)mColorTransTime); + mColorTrans = pow(t, TRANSITION_ALPHA); + } + + // Evaluate the palette at this time + mGF_Palette->Evaluate(mPalette); + + // Set our offscreen ports to the right palette... + mPortA.SetPalette(mPalette); + mPortB.SetPalette(mPalette); + + // If we're at fullsceen, the screen device may need the current palette too + if (mAtFullScreen && mFullscreenDepth == 8) { + mScreen.SetPalette(mPalette); + mPortA.PreventActivate(mOutPort); + mPortB.PreventActivate(mOutPort); + } + + // Reevaluate the palette a short time from now + mNextPaletteUpdate = mT + .1; + } } - - void GForce::ManageShapeChanges() { - int i; - - // If in a WaveShape transition/morph - if ( mShapeTransTime > 0 ) { - - // If we've the ColorMap transition is over, end it - if ( mT_MS > mShapeTransEnd ) { - WaveShape* temp = mWave; - mWave = mNextWave; - mNextWave = temp; - mShapeTransTime = -1; - mNextShapeChange = mT + mShapeInterval.Evaluate(); - } } - - // Time for a wave shape change? - else if ( mT > mNextShapeChange && mShapeSlideShow ) { - - // Load the next config in the (randomized) config list... - i = mShapePlayList.FindIndexOf( mCurShapeNum ); - - // Make a new play list if we've reached the end of the list... - if ( i >= mShapePlayList.Count() ) { - mShapePlayList.Randomize(); - i = 0; - } - loadWaveShape( mShapePlayList.Fetch( i + 1 ), true ); - } - + int i; + + // If in a WaveShape transition/morph + if (mShapeTransTime > 0) { + + // If we've the ColorMap transition is over, end it + if (mT_MS > mShapeTransEnd) { + WaveShape *temp = mWave; + mWave = mNextWave; + mNextWave = temp; + mShapeTransTime = -1; + mNextShapeChange = mT + mShapeInterval.Evaluate(); + } + } + + // Time for a wave shape change? + else if (mT > mNextShapeChange && mShapeSlideShow) { + + // Load the next config in the (randomized) config list... + i = mShapePlayList.FindIndexOf(mCurShapeNum); + + // Make a new play list if we've reached the end of the list... + if (i >= mShapePlayList.Count()) { + mShapePlayList.Randomize(); + i = 0; + } + loadWaveShape(mShapePlayList.Fetch(i + 1), true); + } } - void GForce::ManageFieldChanges() { - long i; - - // If we have have a delta field in mid-calculation, chip away at it... - if ( ! mNextField -> IsCalculated() ) - mNextField -> CalcSome(); - - if ( mT > mNextFieldChange && mNextField -> IsCalculated() && mFieldSlideShow ) { - - // Load the next field in the (randomized) field list... - i = mFieldPlayList.FindIndexOf( mCurFieldNum ); - - // Make a new play list if we've reached the end of the list... - if ( i >= mFieldPlayList.Count() ) { - mFieldPlayList.Randomize(); - i = 0; - } - - // loadGradField() will initiate computation on mField with a new grad field... - loadDeltaField( mFieldPlayList.Fetch( i + 1 ) ); - DeltaField* temp = mField; - mField = mNextField; - mNextField = temp; - - // If the pref says so, display that we're loading a new config - if ( mNewConfigNotify ) { - Print( "Loaded DeltaField: " ); - Println( mField -> GetName() ); - } - } + long i; + + // If we have have a delta field in mid-calculation, chip away at it... + if (!mNextField->IsCalculated()) + mNextField->CalcSome(); + + if (mT > mNextFieldChange && mNextField->IsCalculated() && mFieldSlideShow) { + + // Load the next field in the (randomized) field list... + i = mFieldPlayList.FindIndexOf(mCurFieldNum); + + // Make a new play list if we've reached the end of the list... + if (i >= mFieldPlayList.Count()) { + mFieldPlayList.Randomize(); + i = 0; + } + + // loadGradField() will initiate computation on mField with a new grad + // field... + loadDeltaField(mFieldPlayList.Fetch(i + 1)); + DeltaField *temp = mField; + mField = mNextField; + mNextField = temp; + + // If the pref says so, display that we're loading a new config + if (mNewConfigNotify) { + Print("Loaded DeltaField: "); + Println(mField->GetName()); + } + } } - - void GForce::ManageParticleChanges() { - float rndVar; + float rndVar; - if ( mT > mNextParticleCheck && mParticlesOn ) { + if (mT > mNextParticleCheck && mParticlesOn) { - // Generate a random probability value. - rndVar = ( (float) LV::rand() ) / ( (float) std::numeric_limits::max() ); + // Generate a random probability value. + rndVar = + ((float)LV::rand()) / ((float)std::numeric_limits::max()); - // Comparing that to the evalated probability of a new particle being spawned determines if a new one *should* be spawned - if ( rndVar < mParticleProbabilityFcn.Evaluate() ) { + // Comparing that to the evalated probability of a new particle being + // spawned determines if a new one *should* be spawned + if (rndVar < mParticleProbabilityFcn.Evaluate()) { - SpawnNewParticle(); - } + SpawnNewParticle(); + } - // Check to make a new particle one second from now - mNextParticleCheck = mT + 1; - } + // Check to make a new particle one second from now + mNextParticleCheck = mT + 1; + } } +void GForce::DrawParticles(PixPort &inPort) { + // Draw all the particles + ParticleGroup *particle, *next; + particle = (ParticleGroup *)mRunningParticlePool.GetHead(); + while (particle) { + next = (ParticleGroup *)particle->GetNext(); -void GForce::DrawParticles( PixPort& inPort ) { + // When particles stop, move them to a holding/stopped list + if (!particle->IsExpired()) + particle->DrawGroup(inPort); + else { + mStoppedParticlePool.addToHead(particle); - // Draw all the particles - ParticleGroup* particle, *next; - particle = (ParticleGroup*) mRunningParticlePool.GetHead(); - while ( particle ) { - next = (ParticleGroup*) particle -> GetNext(); - - // When particles stop, move them to a holding/stopped list - if ( ! particle -> IsExpired() ) - particle -> DrawGroup( inPort ); - else { - mStoppedParticlePool.addToHead( particle ); - - // Update the var that holds how many particles are running (and is accessible in the PPrb expr) - mNumRunningParticles = mRunningParticlePool.shallowCount(); - } - - particle = next; - } + // Update the var that holds how many particles are running (and is + // accessible in the PPrb expr) + mNumRunningParticles = mRunningParticlePool.shallowCount(); + } + particle = next; + } } +void GForce::RecordZeroSample(long inCurTime) { + int i; + for (i = 0; i < mNum_S_Steps; i++) + mSampleFcn->mFcn[i] = 0; - -void GForce::RecordZeroSample( long inCurTime ) { - int i; - - for ( i = 0; i < mNum_S_Steps; i++ ) - mSampleFcn -> mFcn[ i ] = 0; - - RecordSample( inCurTime ); + RecordSample(inCurTime); } - - /* void GForce::RecordSample( long inCurTime, float* inFourier, long inNumBins ) { - long w, s, n; - float sample; - ExprUserFcn* fcn; + long w, s, n; + float sample; + ExprUserFcn* fcn; - // Now write the sample to memory, adjusted for amplitude... - fcn = (ExprUserFcn*) mSampleFcn; - fcn -> mNumFcnBins = mNum_S_Steps; + // Now write the sample to memory, adjusted for amplitude... + fcn = (ExprUserFcn*) mSampleFcn; + fcn -> mNumFcnBins = mNum_S_Steps; - for ( s = 0; s < mNum_S_Steps; s++ ) { + for ( s = 0; s < mNum_S_Steps; s++ ) { - sample = 0; - for ( w = 0; w < inNumBins; w++ ) { - n = ( 2.42322211 * w + 1.9 ) * ((float) s) + 1.23231121211 * w; - sample += inFourier[ w ] * mSine[ n % mNum_S_Steps ]; - } + sample = 0; + for ( w = 0; w < inNumBins; w++ ) { + n = ( 2.42322211 * w + 1.9 ) * ((float) s) ++ 1.23231121211 * w; sample += inFourier[ w ] * mSine[ n % mNum_S_Steps ]; + } - fcn -> mFcn[ s ] = sample; - } + fcn -> mFcn[ s ] = sample; + } - RecordSample( inCurTime ); + RecordSample( inCurTime ); } */ - void GForce::IdleMonitor() { - bool kybdPress = false; - float pollDelay; - float secsUntilSleep = mScrnSaverDelay - ( mT - mLastActiveTime ); - Point pt; - - // Calc time till next kybd poll (Don't waste time checking the kybd unless we've been idle a while) - if ( IsFullscreen() ) - pollDelay = .6; - - // Don't bother rapildly checking the kybd until we're really close to going into screen saver mode - else if ( secsUntilSleep < 90 ) - pollDelay = secsUntilSleep / 120.0; - else - pollDelay = 10; - - // If it's time to poll for activity... - if ( mT > mLastKeyPollTime + pollDelay ) { - - mLastKeyPollTime = mT; - - // Check the mouse pos and record it as active if its been moved. - EgOSUtils::GetMouse( pt ); - if ( pt.h != mLastMousePt.h || pt.v != mLastMousePt.v || kybdPress ) { - mLastMousePt = pt; - mLastActiveTime = mT; - } - - // If we're elligible to enter fullscreen then do it - if ( ! mAtFullScreen && mT - mLastActiveTime > mScrnSaverDelay ) { - mMouseWillAwaken = true; - } - } + bool kybdPress = false; + float pollDelay; + float secsUntilSleep = mScrnSaverDelay - (mT - mLastActiveTime); + Point pt; + + // Calc time till next kybd poll (Don't waste time checking the kybd unless + // we've been idle a while) + if (IsFullscreen()) + pollDelay = .6; + + // Don't bother rapildly checking the kybd until we're really close to going + // into screen saver mode + else if (secsUntilSleep < 90) + pollDelay = secsUntilSleep / 120.0; + else + pollDelay = 10; + + // If it's time to poll for activity... + if (mT > mLastKeyPollTime + pollDelay) { + + mLastKeyPollTime = mT; + + // Check the mouse pos and record it as active if its been moved. + EgOSUtils::GetMouse(pt); + if (pt.h != mLastMousePt.h || pt.v != mLastMousePt.v || kybdPress) { + mLastMousePt = pt; + mLastActiveTime = mT; + } + + // If we're elligible to enter fullscreen then do it + if (!mAtFullScreen && mT - mLastActiveTime > mScrnSaverDelay) { + mMouseWillAwaken = true; + } + } } - - -void GForce::RecordSample( long inCurTime, float* inSound, float inScale, long inNumBins, float* inFFT, float inFFTScale, long inFFTNumBins) { - float mag, sum; - int i, n; - ExprUserFcn* fcn; - - // Only use/process bins we'll actually use - if ( inNumBins > mNum_S_Steps ) - inNumBins = mNum_S_Steps; - - - - // Calc a 1/RMS avg value... - if ( mNormalizeInput ) { - - // Find an RMS amplitude for the sample - for ( sum = 0.0001, i = 0; i < inNumBins; i++ ) { - mag = inSound[ i ]; - sum += mag * mag; - } - inScale = mMagScale * .009 * ( (float) inNumBins ) / ( sqrt( sum ) ); } - else - inScale *= mMagScale; - - - // Now write the sample to memory, adjusted for amplitude... - fcn = (ExprUserFcn*) mSampleFcn; - fcn -> mNumFcnBins = inNumBins; - for ( i = 0; i < inNumBins; i++ ) { - mag = inSound[ i ]; - fcn -> mFcn[ i ] = inSound[ i ] * inScale; - } - - XFloatList::GaussSmooth( 1.3, inNumBins, fcn -> mFcn ); - - // Flatten the ends of the sample... - n = inNumBins / 20 + 1; - if ( n <= inNumBins ) { - for ( i = 0; i < n; i++ ) { - mag = sin( .5 * 3.1 * i / n ); - fcn -> mFcn[ i ] *= mag; - fcn -> mFcn[ inNumBins - i - 1 ] *= mag; - } - } - - // Now write the FFT data to memory, adjusted for amplitude... - fcn = (ExprUserFcn*) mFFTFcn; - fcn -> mNumFcnBins = inFFTNumBins; - - for ( i = 0; i < inFFTNumBins; i++ ) { - fcn -> mFcn[ i ] = inFFT[ i ] * inFFTScale; - } - - - RecordSample( inCurTime ); +void GForce::RecordSample(long inCurTime, float *inSound, float inScale, + long inNumBins, float *inFFT, float inFFTScale, + long inFFTNumBins) { + float mag, sum; + int i, n; + ExprUserFcn *fcn; + + // Only use/process bins we'll actually use + if (inNumBins > mNum_S_Steps) + inNumBins = mNum_S_Steps; + + // Calc a 1/RMS avg value... + if (mNormalizeInput) { + + // Find an RMS amplitude for the sample + for (sum = 0.0001, i = 0; i < inNumBins; i++) { + mag = inSound[i]; + sum += mag * mag; + } + inScale = mMagScale * .009 * ((float)inNumBins) / (sqrt(sum)); + } else + inScale *= mMagScale; + + // Now write the sample to memory, adjusted for amplitude... + fcn = (ExprUserFcn *)mSampleFcn; + fcn->mNumFcnBins = inNumBins; + for (i = 0; i < inNumBins; i++) { + mag = inSound[i]; + fcn->mFcn[i] = inSound[i] * inScale; + } + + XFloatList::GaussSmooth(1.3, inNumBins, fcn->mFcn); + + // Flatten the ends of the sample... + n = inNumBins / 20 + 1; + if (n <= inNumBins) { + for (i = 0; i < n; i++) { + mag = sin(.5 * 3.1 * i / n); + fcn->mFcn[i] *= mag; + fcn->mFcn[inNumBins - i - 1] *= mag; + } + } + + // Now write the FFT data to memory, adjusted for amplitude... + fcn = (ExprUserFcn *)mFFTFcn; + fcn->mNumFcnBins = inFFTNumBins; + + for (i = 0; i < inFFTNumBins; i++) { + fcn->mFcn[i] = inFFT[i] * inFFTScale; + } + + RecordSample(inCurTime); } - - - - -void GForce::RecordSample( long inCurTime ) { - long intensity; - float t; - - if ( &mPortA == mCurPort ) - mCurPort = &mPortB; - else - mCurPort = &mPortA; - - // All the waveshape virtual machines are linked to our time index - mT_MS = inCurTime - mT_MS_Base; - mT = ( (float) inCurTime ) / 1000.0; - - // Don't bother doing mouse or kybd poll if sceeen saver mode is disabled - if ( mScrnSaverDelay > 0 ) - IdleMonitor(); - - ManageColorChanges(); - ManageShapeChanges(); - ManageFieldChanges(); - ManageParticleChanges(); - - // Do the blur operation, a fcn of what's oqn the screen, and the current delta field - - if ( mCurPort == &mPortA ) - mPortB.Fade( mPortA, mField -> GetField() ); - else - mPortA.Fade( mPortB, mField -> GetField() ); - - /* This redraws the image */ - - // Draw all the current particles - DrawParticles( *mCurPort ); - - // Draw the current wave shape for the current music sample playing - // If there's a morph going, drawing is a mix of both waves - if ( mShapeTransTime > 0 ) { - float morphPct = (float) ( mShapeTransEnd - mT_MS ) / ( (float) mShapeTransTime ); - mWave -> Draw( mNum_S_Steps, *mCurPort, 1, mNextWave, morphPct ); } - else - mWave -> Draw( mNum_S_Steps, *mCurPort, 1, 0, 0 ); - - - // If we're not currently drawing track text, check to see if we start new text - if ( mTrackTextDur == 0 && mTrackTextPosMode ) { - if ( mTrackTextStartFcn.Evaluate() > 0 ) - StartTrackText(); - } - - // If we already have a t.t. draw in progress, draw the text in the (full) foreground color - if ( mTrackTextDur > 0 ) { - - // From 0 to 1, how far are we into the text display interval? - t = ( mT - mTrackTextStartTime ) / mTrackTextDur; - - // Decrease the text intensity thru time - intensity = 255 * ( 1.2 - .3*t ); - if ( intensity > 255 ) - intensity = 255; - - mCurPort -> SetTextColor( mPalette[ intensity ] ); - mCurPort -> SetTrackTextFont(); - mCurPort -> DrawText( mTrackTextPos.h, mTrackTextPos.v, mTrackText ); - } - - // Draw the console text to the offscreen image. Then copy the image to the OS out port - if ( mT_MS < mConsoleExpireTime ) { - - // To ensure the console text is readable, we erase it when we're done - mCurPort -> SetTextMode( SRC_XOR ); - mCurPort -> SetTextColor( mPalette[ 255 ] ); - mCurPort -> SetConsoleFont(); - DrawConsole(); - DrawFrame(); - mCurPort -> SetTextColor( mPalette[ 0 ] ); - DrawConsole(); - mCurPort -> SetTextMode( SRC_OR ); } - else - DrawFrame(); - - // We need to avoid text all bluring together so we overwrite the foreground text we just drew - // with text of a lower intensity... - if ( mTrackTextDur > 0 ) { - - // Is the text is about to expire? if not, continue drawing. - if ( t <= 1 ) { - - intensity = 255.5 * pow( t, 1.5 ); - mCurPort -> SetTextColor( mPalette[ intensity ] ); - mCurPort -> SetTrackTextFont(); - mCurPort -> DrawText( mTrackTextPos.h, mTrackTextPos.v, mTrackText ); } - else { - - // The text's duration is up so turn the draw flag off - mTrackTextDur = 0; - } - } - - - // Maintain the frame rate - mFrameCount++; - if ( mT_MS - mFrameCountStart >= 1500 ) { - mCurFrameRate = 10000 * mFrameCount / ( mT_MS - mFrameCountStart ); - mFrameCountStart = mT_MS; - mFrameCount = 0; - } - - if ( mT_MS - mLastCursorUpdate > 3000 ) { - mLastCursorUpdate = mT_MS; - if ( IsFullscreen() ) - EgOSUtils::HideCursor(); - } +void GForce::RecordSample(long inCurTime) { + long intensity; + float t; + + if (&mPortA == mCurPort) + mCurPort = &mPortB; + else + mCurPort = &mPortA; + + // All the waveshape virtual machines are linked to our time index + mT_MS = inCurTime - mT_MS_Base; + mT = ((float)inCurTime) / 1000.0; + + // Don't bother doing mouse or kybd poll if sceeen saver mode is disabled + if (mScrnSaverDelay > 0) + IdleMonitor(); + + ManageColorChanges(); + ManageShapeChanges(); + ManageFieldChanges(); + ManageParticleChanges(); + + // Do the blur operation, a fcn of what's oqn the screen, and the current + // delta field + + if (mCurPort == &mPortA) + mPortB.Fade(mPortA, mField->GetField()); + else + mPortA.Fade(mPortB, mField->GetField()); + + /* This redraws the image */ + + // Draw all the current particles + DrawParticles(*mCurPort); + + // Draw the current wave shape for the current music sample playing + // If there's a morph going, drawing is a mix of both waves + if (mShapeTransTime > 0) { + float morphPct = (float)(mShapeTransEnd - mT_MS) / ((float)mShapeTransTime); + mWave->Draw(mNum_S_Steps, *mCurPort, 1, mNextWave, morphPct); + } else + mWave->Draw(mNum_S_Steps, *mCurPort, 1, 0, 0); + + // If we're not currently drawing track text, check to see if we start new + // text + if (mTrackTextDur == 0 && mTrackTextPosMode) { + if (mTrackTextStartFcn.Evaluate() > 0) + StartTrackText(); + } + + // If we already have a t.t. draw in progress, draw the text in the (full) + // foreground color + if (mTrackTextDur > 0) { + + // From 0 to 1, how far are we into the text display interval? + t = (mT - mTrackTextStartTime) / mTrackTextDur; + + // Decrease the text intensity thru time + intensity = 255 * (1.2 - .3 * t); + if (intensity > 255) + intensity = 255; + + mCurPort->SetTextColor(mPalette[intensity]); + mCurPort->SetTrackTextFont(); + mCurPort->DrawText(mTrackTextPos.h, mTrackTextPos.v, mTrackText); + } + + // Draw the console text to the offscreen image. Then copy the image to the + // OS out port + if (mT_MS < mConsoleExpireTime) { + + // To ensure the console text is readable, we erase it when we're done + mCurPort->SetTextMode(SRC_XOR); + mCurPort->SetTextColor(mPalette[255]); + mCurPort->SetConsoleFont(); + DrawConsole(); + DrawFrame(); + mCurPort->SetTextColor(mPalette[0]); + DrawConsole(); + mCurPort->SetTextMode(SRC_OR); + } else + DrawFrame(); + + // We need to avoid text all bluring together so we overwrite the foreground + // text we just drew + // with text of a lower intensity... + if (mTrackTextDur > 0) { + + // Is the text is about to expire? if not, continue drawing. + if (t <= 1) { + + intensity = 255.5 * pow(t, 1.5); + mCurPort->SetTextColor(mPalette[intensity]); + mCurPort->SetTrackTextFont(); + mCurPort->DrawText(mTrackTextPos.h, mTrackTextPos.v, mTrackText); + } else { + + // The text's duration is up so turn the draw flag off + mTrackTextDur = 0; + } + } + + // Maintain the frame rate + mFrameCount++; + if (mT_MS - mFrameCountStart >= 1500) { + mCurFrameRate = 10000 * mFrameCount / (mT_MS - mFrameCountStart); + mFrameCountStart = mT_MS; + mFrameCount = 0; + } + + if (mT_MS - mLastCursorUpdate > 3000) { + mLastCursorUpdate = mT_MS; + if (IsFullscreen()) + EgOSUtils::HideCursor(); + } } - void GForce::StartTrackText() { - if ( mTrackTextPosMode ) { - CalcTrackTextPos(); - mTrackTextDur = mTrackTextDurFcn.Evaluate(); - mTrackTextStartTime = mT; - } + if (mTrackTextPosMode) { + CalcTrackTextPos(); + mTrackTextDur = mTrackTextDurFcn.Evaluate(); + mTrackTextStartTime = mT; + } } void GForce::DrawFrame() { + __setupPort - __setupPort - - // If we're fullscreen, follow the API (the screen may need to do something to finish) - if ( mScreen.IsFullscreen() ) - mOutPort = mScreen.BeginFrame(); + // If we're fullscreen, follow the API (the screen may need to do + // something to finish) + if (mScreen.IsFullscreen()) mOutPort = mScreen.BeginFrame(); - // Someone may have asked to clear the GF window/pane - if ( mNeedsPaneErased ) { - ErasePane(); - mNeedsPaneErased = false; - } + // Someone may have asked to clear the GF window/pane + if (mNeedsPaneErased) { + ErasePane(); + mNeedsPaneErased = false; + } - // Blt our offscreen world to the output device - Rect r; - r.left = r.top = 0; - r.right = mDispRect.right - mDispRect.left; - r.bottom = mDispRect.bottom - mDispRect.top; -// mCurPort -> CopyBits( mOutPort, &r, &mDispRect ); - mCurPort -> CopyBits( mVideoBuffer, &r, &mDispRect ); + // Blt our offscreen world to the output device + Rect r; + r.left = r.top = 0; + r.right = mDispRect.right - mDispRect.left; + r.bottom = mDispRect.bottom - mDispRect.top; + // mCurPort -> CopyBits( mOutPort, &r, &mDispRect ); + mCurPort->CopyBits(mVideoBuffer, &r, &mDispRect); - // If we're fullscreen, follow the API (the screen may need to do something to finish) - if ( mScreen.IsFullscreen() ) - mScreen.EndFrame(); + // If we're fullscreen, follow the API (the screen may need to do something to + // finish) + if (mScreen.IsFullscreen()) + mScreen.EndFrame(); - __restorePort + __restorePort } -void GForce::SetOutVideoBuffer( unsigned char *inVideoBuffer ) { - mVideoBuffer = inVideoBuffer; +void GForce::SetOutVideoBuffer(unsigned char *inVideoBuffer) { + mVideoBuffer = inVideoBuffer; } -#define __loadFolder( folderName, specList, playList ) \ - startOver = true; \ - folder.AssignFolder( folderName ); \ - while ( EgOSUtils::GetNextFile( folder, spec, startOver, false ) ) { \ - specList.AddCopy( spec ); \ - startOver = false; \ - } \ - /* Build a 'play' list */ \ - playList.RemoveAll(); \ - for ( i = 1; i <= specList.Count(); i++ ) { \ - playList.Add( i ); \ - } \ - playList.Randomize(); - +#define __loadFolder(folderName, specList, playList) \ + startOver = true; \ + folder.AssignFolder(folderName); \ + while (EgOSUtils::GetNextFile(folder, spec, startOver, false)) { \ + specList.AddCopy(spec); \ + startOver = false; \ + } \ + /* Build a 'play' list */ \ + playList.RemoveAll(); \ + for (i = 1; i <= specList.Count(); i++) { \ + playList.Add(i); \ + } \ + playList.Randomize(); void GForce::BuildConfigLists() { - CEgFileSpec folder, spec; - int i; - bool startOver; + CEgFileSpec folder, spec; + int i; + bool startOver; - __loadFolder( DATADIR "/GForceDeltaFields", mDeltaFields, mFieldPlayList ) + __loadFolder(DATADIR "/GForceDeltaFields", mDeltaFields, mFieldPlayList) - __loadFolder( DATADIR "/GForceWaveShapes", mWaveShapes, mShapePlayList ) + __loadFolder(DATADIR "/GForceWaveShapes", mWaveShapes, mShapePlayList) - __loadFolder( DATADIR "/GForceColorMaps", mColorMaps, mColorPlayList ) + __loadFolder(DATADIR "/GForceColorMaps", mColorMaps, mColorPlayList) - __loadFolder( DATADIR "/GForceParticles", mParticles, mParticlePlayList ) + __loadFolder(DATADIR "/GForceParticles", mParticles, + mParticlePlayList) } - // A linear spread is the default field -#define __FIELD_FACTORY "\ +#define __FIELD_FACTORY \ + "\ Aspc=0,\ srcX=\"x * .9\",\ srcY=\"y * .9\",\ @@ -1096,7 +1130,8 @@ Vers=100\ " // A centered circle is the default shape -#define __SHAPE_FACTORY "\ +#define __SHAPE_FACTORY \ + "\ Stps=-1,\ B0=\"t * 0.0003\",\ Aspc=1,\ @@ -1108,426 +1143,385 @@ Vers=100\ " // A single color is the defaut color -#define __COLOR_FACTORY "\ +#define __COLOR_FACTORY \ + "\ H=\".9\",\ S=\".8\",\ V=\"i\",\ Vers=100\ " - - - -void GForce::loadColorMap( long inColorMapNum, bool inAllowMorph ) { - const CEgFileSpec* spec; - int ok = false, vers; - ArgList args; - - // Fetch the spec for our config file or folder - spec = mColorMaps.FetchSpec( inColorMapNum ); - - if ( spec ) { - mCurColorMapNum = inColorMapNum; - - ok = ConfigFile::Load( spec, args ); - if ( ok ) { - vers = args.GetArg( VAL('V','e','r','s') ); - ok = vers >= 100 && vers < 110; - spec -> GetFileName( mColorMapName ); - } - } - - - if ( ! ok ) { - args.SetArgs( __COLOR_FACTORY ); - mColorMapName.Assign( "" ); - } - - // If the pref says so, display that we're loading a new config - if ( mNewConfigNotify ) { - Print( "Loaded ColorMap: " ); - Println( &mColorMapName ); - } - - - // If first time load, don't do any transition/morph, otherwise set up the morph - if ( mGF_Palette == 0 || ! inAllowMorph ) { - mGF_Palette = &mPal1; - mNextPal = &mPal2; - mGF_Palette -> Assign( args ); - mColorTransTime = -1; - mNextColorChange = mT + mColorInterval.Evaluate(); } - else { - mNextPal -> Assign( args ); - mGF_Palette -> SetupTransition( *mNextPal, mColorTrans ); - - // Calculate how long this transition/morph will be - mColorTransTime = EgOSUtils::Rnd( mTransitionLo * 1000, mTransitionHi * 1000 ); - mColorTransEnd = mT_MS + mColorTransTime; - } +void GForce::loadColorMap(long inColorMapNum, bool inAllowMorph) { + const CEgFileSpec *spec; + int ok = false, vers; + ArgList args; + + // Fetch the spec for our config file or folder + spec = mColorMaps.FetchSpec(inColorMapNum); + + if (spec) { + mCurColorMapNum = inColorMapNum; + + ok = ConfigFile::Load(spec, args); + if (ok) { + vers = args.GetArg(VAL('V', 'e', 'r', 's')); + ok = vers >= 100 && vers < 110; + spec->GetFileName(mColorMapName); + } + } + + if (!ok) { + args.SetArgs(__COLOR_FACTORY); + mColorMapName.Assign(""); + } + + // If the pref says so, display that we're loading a new config + if (mNewConfigNotify) { + Print("Loaded ColorMap: "); + Println(&mColorMapName); + } + + // If first time load, don't do any transition/morph, otherwise set up the + // morph + if (mGF_Palette == 0 || !inAllowMorph) { + mGF_Palette = &mPal1; + mNextPal = &mPal2; + mGF_Palette->Assign(args); + mColorTransTime = -1; + mNextColorChange = mT + mColorInterval.Evaluate(); + } else { + mNextPal->Assign(args); + mGF_Palette->SetupTransition(*mNextPal, mColorTrans); + + // Calculate how long this transition/morph will be + mColorTransTime = + EgOSUtils::Rnd(mTransitionLo * 1000, mTransitionHi * 1000); + mColorTransEnd = mT_MS + mColorTransTime; + } } - - - - #define DEC_SIZE 6 -void GForce::loadDeltaField( long inFieldNum ) { - const CEgFileSpec* spec; - int ok = false, vers; - ArgList args; - UtilStr name; +void GForce::loadDeltaField(long inFieldNum) { + const CEgFileSpec *spec; + int ok = false, vers; + ArgList args; + UtilStr name; - // Fetch the spec for our config file or folder - spec = mDeltaFields.FetchSpec( inFieldNum ); + // Fetch the spec for our config file or folder + spec = mDeltaFields.FetchSpec(inFieldNum); - if ( spec ) { + if (spec) { - // Know what to put a check mark next to in the popup menu - mCurFieldNum = inFieldNum; + // Know what to put a check mark next to in the popup menu + mCurFieldNum = inFieldNum; - ok = ConfigFile::Load( spec, args ); - if ( ok ) { - vers = args.GetArg( VAL('V','e','r','s') ); - ok = vers >= 100 && vers < 110; - spec -> GetFileName( name ); - } - } + ok = ConfigFile::Load(spec, args); + if (ok) { + vers = args.GetArg(VAL('V', 'e', 'r', 's')); + ok = vers >= 100 && vers < 110; + spec->GetFileName(name); + } + } - if ( ! ok ) { - args.SetArgs( __FIELD_FACTORY ); - name.Assign( "" ); - } + if (!ok) { + args.SetArgs(__FIELD_FACTORY); + name.Assign(""); + } - // Initiate recomputation of mField - mField -> Assign( args, name ); - mNextFieldChange = mT + mFieldInterval.Evaluate(); + // Initiate recomputation of mField + mField->Assign(args, name); + mNextFieldChange = mT + mFieldInterval.Evaluate(); } - - - - -void GForce::loadWaveShape( long inShapeNum, bool inAllowMorph ) { - const CEgFileSpec* spec; - int ok = false, vers; - ArgList args; - - // Fetch the spec for our config file or folder - spec = mWaveShapes.FetchSpec( inShapeNum ); - - if ( spec ) { - // Know what to put a check mark next to in the popup menu - mCurShapeNum = inShapeNum; - - ok = ConfigFile::Load( spec, args ); - - if ( ok ) { - vers = args.GetArg( VAL('V','e','r','s') ); - ok = vers >= 100 && vers < 110; - spec -> GetFileName( mWaveShapeName ); - } - } - - - if ( ! ok ) { - args.SetArgs( __SHAPE_FACTORY ); - mWaveShapeName.Assign( "" ); - } - - // If the pref says so, display that we're loading a new config - if ( mNewConfigNotify ) { - Print( "Loaded WaveShape: " ); - Println( &mWaveShapeName ); - } - - - // If first time load, don't do any transition/morph, otherwise set up the morph - if ( mWave == 0 || ! inAllowMorph ) { - mWave = &mWave1; - mNextWave = &mWave2; - mWave -> Load( args, mNum_S_Steps ); - mNextShapeChange = mT + mShapeInterval.Evaluate(); - mShapeTransTime = -1; } - else { - mNextWave -> Load( args, mNum_S_Steps ); - mWave -> SetupTransition( mNextWave ); - - // Calculate how long this transition/morph will take - mShapeTransTime = EgOSUtils::Rnd( mTransitionLo * 1000, mTransitionHi * 1000 ); - mShapeTransEnd = mT_MS + mShapeTransTime; - } - +void GForce::loadWaveShape(long inShapeNum, bool inAllowMorph) { + const CEgFileSpec *spec; + int ok = false, vers; + ArgList args; + + // Fetch the spec for our config file or folder + spec = mWaveShapes.FetchSpec(inShapeNum); + + if (spec) { + // Know what to put a check mark next to in the popup menu + mCurShapeNum = inShapeNum; + + ok = ConfigFile::Load(spec, args); + + if (ok) { + vers = args.GetArg(VAL('V', 'e', 'r', 's')); + ok = vers >= 100 && vers < 110; + spec->GetFileName(mWaveShapeName); + } + } + + if (!ok) { + args.SetArgs(__SHAPE_FACTORY); + mWaveShapeName.Assign(""); + } + + // If the pref says so, display that we're loading a new config + if (mNewConfigNotify) { + Print("Loaded WaveShape: "); + Println(&mWaveShapeName); + } + + // If first time load, don't do any transition/morph, otherwise set up the + // morph + if (mWave == 0 || !inAllowMorph) { + mWave = &mWave1; + mNextWave = &mWave2; + mWave->Load(args, mNum_S_Steps); + mNextShapeChange = mT + mShapeInterval.Evaluate(); + mShapeTransTime = -1; + } else { + mNextWave->Load(args, mNum_S_Steps); + mWave->SetupTransition(mNextWave); + + // Calculate how long this transition/morph will take + mShapeTransTime = + EgOSUtils::Rnd(mTransitionLo * 1000, mTransitionHi * 1000); + mShapeTransEnd = mT_MS + mShapeTransTime; + } } +void GForce::loadParticle(long inParticleNum) { + const CEgFileSpec *spec; + int ok = false, vers; + ArgList args; + ParticleGroup *newParticle; + UtilStr name; + // Fetch the spec for our config file or folder + spec = mParticles.FetchSpec(inParticleNum); + if (spec) { + mCurParticleNum = inParticleNum; + ok = ConfigFile::Load(spec, args); + if (ok) { + vers = args.GetArg(VAL('V', 'e', 'r', 's')); + ok = vers >= 100 && vers < 110; + spec->GetFileName(name); -void GForce::loadParticle( long inParticleNum ) { - const CEgFileSpec* spec; - int ok = false, vers; - ArgList args; - ParticleGroup* newParticle; - UtilStr name; - - // Fetch the spec for our config file or folder - spec = mParticles.FetchSpec( inParticleNum ); - - if ( spec ) { - - mCurParticleNum = inParticleNum; - ok = ConfigFile::Load( spec, args ); - if ( ok ) { - vers = args.GetArg( VAL('V','e','r','s') ); - ok = vers >= 100 && vers < 110; - - spec -> GetFileName( name ); - - // If the pref says so, display that we're loading a new config - if ( mNewConfigNotify ) { - Print( "Loaded Particle: " ); - Println( &name ); - } - } - } + // If the pref says so, display that we're loading a new config + if (mNewConfigNotify) { + Print("Loaded Particle: "); + Println(&name); + } + } + } + if (ok) { - if ( ok ) { + // Avoid having to reallocate mem... + newParticle = (ParticleGroup *)mStoppedParticlePool.GetHead(); - // Avoid having to reallocate mem... - newParticle = (ParticleGroup*) mStoppedParticlePool.GetHead(); + // If there weren'y any particles already expired, make a new instance + if (!newParticle) + newParticle = new ParticleGroup(&mT, (ExprUserFcn **)&mSampleFcn); - // If there weren'y any particles already expired, make a new instance - if ( ! newParticle ) - newParticle = new ParticleGroup( &mT, (ExprUserFcn**) &mSampleFcn ); + // Add the new particle to the group that gets executed each frame + newParticle->mTitle.Assign(name); + mRunningParticlePool.addToHead(newParticle); - // Add the new particle to the group that gets executed each frame - newParticle -> mTitle.Assign( name ); - mRunningParticlePool.addToHead( newParticle ); + // The GF particle probability fcn has access to these variables + mNumRunningParticles = mRunningParticlePool.shallowCount(); + mLastParticleStart = mT; - // The GF particle probability fcn has access to these variables - mNumRunningParticles = mRunningParticlePool.shallowCount(); - mLastParticleStart = mT; + // Determine how long this particle will be around + newParticle->SetDuration(mParticleDurationFcn.Evaluate()); - // Determine how long this particle will be around - newParticle -> SetDuration( mParticleDurationFcn.Evaluate() ); - - // Tell the particle to compile it's config text - newParticle -> Load( args ); - } + // Tell the particle to compile it's config text + newParticle->Load(args); + } } - void GForce::NewSong() { - mTrackText.Assign( mTrackMetaText ); - mTrackText.Replace( "\\r", "\r" ); - mTrackText.Replace( "#ARTIST#", mArtist.getCStr(), false ); - mTrackText.Replace( "#ALBUM#", mAlbum.getCStr(), false ); - mTrackText.Replace( "#TITLE#", mSongTitle.getCStr(), false ); + mTrackText.Assign(mTrackMetaText); + mTrackText.Replace("\\r", "\r"); + mTrackText.Replace("#ARTIST#", mArtist.getCStr(), false); + mTrackText.Replace("#ALBUM#", mAlbum.getCStr(), false); + mTrackText.Replace("#TITLE#", mSongTitle.getCStr(), false); - CalcTrackTextPos(); + CalcTrackTextPos(); - mLastSongStart = mT; + mLastSongStart = mT; } - - void GForce::CalcTrackTextPos() { - int32_t height, width; - int32_t x = mCurPort -> GetX(); - int32_t y = mCurPort -> GetY(); - - mCurPort -> TextRect( mTrackText.getCStr(), width, height ); - - switch ( mTrackTextPosMode ) { - - case 1: // Upper-left corner - mTrackTextPos.h = 5; - mTrackTextPos.v = mTrackTextSize + 5; - break; - - case 2: // Bottom-left corner - mTrackTextPos.h = 5; - mTrackTextPos.v = y - height - 3; - break; - - case 3: // Centered - mTrackTextPos.h = ( x - width ) / 2; - mTrackTextPos.v = ( y - height ) / 2; - break; - - default: // Random Position - mTrackTextPos.h = EgOSUtils::Rnd( 5, x - width ); - mTrackTextPos.v = EgOSUtils::Rnd( mTrackTextSize + 5, y - height ); - break; - } + int32_t height, width; + int32_t x = mCurPort->GetX(); + int32_t y = mCurPort->GetY(); + + mCurPort->TextRect(mTrackText.getCStr(), width, height); + + switch (mTrackTextPosMode) { + + case 1: // Upper-left corner + mTrackTextPos.h = 5; + mTrackTextPos.v = mTrackTextSize + 5; + break; + + case 2: // Bottom-left corner + mTrackTextPos.h = 5; + mTrackTextPos.v = y - height - 3; + break; + + case 3: // Centered + mTrackTextPos.h = (x - width) / 2; + mTrackTextPos.v = (y - height) / 2; + break; + + default: // Random Position + mTrackTextPos.h = EgOSUtils::Rnd(5, x - width); + mTrackTextPos.v = EgOSUtils::Rnd(mTrackTextSize + 5, y - height); + break; + } } - - void GForce::SpawnNewParticle() { - int i; + int i; - // Load the next particle in the (randomized) play list... - i = mParticlePlayList.FindIndexOf( mCurParticleNum ); + // Load the next particle in the (randomized) play list... + i = mParticlePlayList.FindIndexOf(mCurParticleNum); - // Make a new play list if we've reached the end of the list... - if ( i >= mParticlePlayList.Count() ) { - mParticlePlayList.Randomize(); - i = 0; - } + // Make a new play list if we've reached the end of the list... + if (i >= mParticlePlayList.Count()) { + mParticlePlayList.Randomize(); + i = 0; + } - // loadGradField() will initiate computation on mField with a new grad field... - loadParticle( mParticlePlayList.Fetch( i + 1 ) ); + // loadGradField() will initiate computation on mField with a new grad + // field... + loadParticle(mParticlePlayList.Fetch(i + 1)); } +void GForce::Print(const char *inStr) { + long num = mConsoleLines.Count(); + UtilStr *lastLine = mConsoleLines.Fetch(num); + // Append the text to the console text.. + if (lastLine) + lastLine->Append(inStr); + else { + mConsoleLines.Add(inStr); + num = 1; + } + // Setup when this line will be deleted + mLineExpireTimes[num - 1] = mT_MS + mConsoleLineDur * 1000; - -void GForce::Print( const char* inStr ) { - long num = mConsoleLines.Count(); - UtilStr* lastLine = mConsoleLines.Fetch( num ); - - // Append the text to the console text.. - if ( lastLine ) - lastLine -> Append( inStr ); - else { - mConsoleLines.Add( inStr ); - num = 1; - } - - // Setup when this line will be deleted - mLineExpireTimes[ num - 1 ] = mT_MS + mConsoleLineDur * 1000; - - // Make the console visible for the next few seconds - mConsoleExpireTime = mT_MS + mConsoleDelay * 1000; + // Make the console visible for the next few seconds + mConsoleExpireTime = mT_MS + mConsoleDelay * 1000; } +void GForce::Println(const char *inStr) { + Print(inStr); -void GForce::Println( const char* inStr ) { - Print( inStr ); - - mConsoleLines.Add( "" ); + mConsoleLines.Add(""); } // This is stupid! #define PIX_PER_LINE 10 void GForce::DrawConsole() { - long i, start, num = mConsoleLines.Count(); - long x = mDispRect.left + 5; - long top = PIX_PER_LINE + 3; - UtilStr* theLine; - - if ( mConsoleLines.Count() == 0 ) - return; - - // Delete console lines that are too old... - while ( mLineExpireTimes.Fetch( 1 ) < mT_MS && num > 0 ) { - mConsoleLines.Remove( 1 ); - mLineExpireTimes.RemoveElement( 1 ); - num--; - } - - // Check if console runs off the display rect... - if ( num * PIX_PER_LINE > mDispRect.bottom - mDispRect.top - top) - start = num - ( mDispRect.bottom - mDispRect.top - top) / PIX_PER_LINE; - else - start = 1; - - // Draw each line of the console... - for ( i = start; i <= num; i++ ) { - theLine = mConsoleLines.Fetch( i ); - mCurPort -> DrawText( x, top + (i-start) * PIX_PER_LINE, *theLine ); - } -} - - - - - - -void GForce::ErasePane() { - + long i, start, num = mConsoleLines.Count(); + long x = mDispRect.left + 5; + long top = PIX_PER_LINE + 3; + UtilStr *theLine; + + if (mConsoleLines.Count() == 0) + return; + + // Delete console lines that are too old... + while (mLineExpireTimes.Fetch(1) < mT_MS && num > 0) { + mConsoleLines.Remove(1); + mLineExpireTimes.RemoveElement(1); + num--; + } + + // Check if console runs off the display rect... + if (num * PIX_PER_LINE > mDispRect.bottom - mDispRect.top - top) + start = num - (mDispRect.bottom - mDispRect.top - top) / PIX_PER_LINE; + else + start = 1; + + // Draw each line of the console... + for (i = start; i <= num; i++) { + theLine = mConsoleLines.Fetch(i); + mCurPort->DrawText(x, top + (i - start) * PIX_PER_LINE, *theLine); + } } +void GForce::ErasePane() {} +void GForce::SetWinPort(WindowPtr inWin, const Rect *inRect) { + Rect r; -void GForce::SetWinPort( WindowPtr inWin, const Rect* inRect ) { - Rect r; - - // mDoingSetPortWin == true is a signal that another thread is in SetWinPort() - if ( mDoingSetPortWin ) - return; - mDoingSetPortWin = true; - mWind = inWin; + // mDoingSetPortWin == true is a signal that another thread is in SetWinPort() + if (mDoingSetPortWin) + return; + mDoingSetPortWin = true; + mWind = inWin; - if ( inRect ) - r = *inRect; + if (inRect) + r = *inRect; - SetPort( 0, r, false ); + SetPort(0, r, false); - // Signal that this thread is done with SetPortWin() - mDoingSetPortWin = false; + // Signal that this thread is done with SetPortWin() + mDoingSetPortWin = false; } +void GForce::SetPort(GrafPtr inPort, const Rect &inRect, bool inFullScreen) { + int32_t x = inRect.right - inRect.left; + int32_t y = inRect.bottom - inRect.top; + mOutPort = inPort; + mAtFullScreen = inFullScreen; + // The pane rect is the rect within inPort th plugin frame occupies + mPaneRect = inRect; -void GForce::SetPort( GrafPtr inPort, const Rect& inRect, bool inFullScreen ) { - int32_t x = inRect.right - inRect.left; - int32_t y = inRect.bottom - inRect.top; - - mOutPort = inPort; - mAtFullScreen = inFullScreen; - - - // The pane rect is the rect within inPort th plugin frame occupies - mPaneRect = inRect; + // mDispRect is the rect within inPort G-Force is drawing in (ex, the + // letterbox) Change the disp rect if the desired size exceeds the pixel + // ceiling + mDispRect = inRect; - // mDispRect is the rect within inPort G-Force is drawing in (ex, the letterbox) - // Change the disp rect if the desired size exceeds the pixel ceiling - mDispRect = inRect; + // Setup the offscreen port + mPortA.Init(x, y, 8); + mPortB.Init(x, y, 8); + mCurPort = &mPortA; - // Setup the offscreen port - mPortA.Init( x, y, 8 ); - mPortB.Init( x, y, 8 ); - mCurPort = &mPortA; + // Erase/init our output window + mNeedsPaneErased = true; - // Erase/init our output window - mNeedsPaneErased = true; + // If setting port for the first time... + if (mWave == 0) { + loadWaveShape(mShapePlayList.Fetch(1), false); + loadColorMap(mColorPlayList.Fetch(1), false); - // If setting port for the first time... - if ( mWave == 0 ) { - loadWaveShape( mShapePlayList.Fetch( 1 ), false ); - loadColorMap( mColorPlayList.Fetch( 1 ), false ); + // loadGradField() will initiate computation on mField with a new grad + // field... + loadDeltaField(mFieldPlayList.Fetch(1)); + DeltaField *temp = mField; + mField = mNextField; + mNextField = temp; + loadDeltaField(mFieldPlayList.Fetch(2)); + } - // loadGradField() will initiate computation on mField with a new grad field... - loadDeltaField( mFieldPlayList.Fetch( 1 ) ); - DeltaField* temp = mField; - mField = mNextField; - mNextField = temp; - loadDeltaField( mFieldPlayList.Fetch( 2 ) ); - } + // The grad fields have to know the pixel dimentions + mField1.SetSize(x, y, mPortA.GetRowSize()); + mField2.SetSize(x, y, mPortA.GetRowSize()); - // The grad fields have to know the pixel dimentions - mField1.SetSize( x, y, mPortA.GetRowSize() ); - mField2.SetSize( x, y, mPortA.GetRowSize() ); - - // The track text may depend on the port size - CalcTrackTextPos(); - - // Changing the port (and the resolution) may change the mouse cords - EgOSUtils::GetMouse( mLastMousePt ); - -} + // The track text may depend on the port size + CalcTrackTextPos(); -void GForce::GetWinRect( Rect& outRect ) { - SetRect( &outRect, 0, 0, 0, 0 ); + // Changing the port (and the resolution) may change the mouse cords + EgOSUtils::GetMouse(mLastMousePt); } +void GForce::GetWinRect(Rect &outRect) { SetRect(&outRect, 0, 0, 0, 0); } diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/GF_Palette.cpp b/libvisual-plugins/plugins/actor/gforce/GForceCommon/GF_Palette.cpp index 3ae1acc02..95918d567 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/GF_Palette.cpp +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/GF_Palette.cpp @@ -6,75 +6,78 @@ #include #include -GF_Palette::GF_Palette( float& inT, float& inIntensity ) { +GF_Palette::GF_Palette(float &inT, float &inIntensity) { - mIntensity = &inIntensity; - mDict.AddVar( "I", &inIntensity ); - mDict.AddVar( "T", &inT ); - - mPI = 3.14159265358979; - mDict.AddVar( "PI", &mPI ); + mIntensity = &inIntensity; + mDict.AddVar("I", &inIntensity); + mDict.AddVar("T", &inT); + mPI = 3.14159265358979; + mDict.AddVar("PI", &mPI); } +void GF_Palette::Assign(const ArgList &inArgs) { + UtilStr str; -void GF_Palette::Assign( const ArgList& inArgs ) { - UtilStr str; - - // Mix up the rnd seed - srand( clock() ); - - // Compile and link the temp exprs. By spec, A-vars are evaluated now - mAVars.Compile( inArgs, 'A', mDict ); - mAVars.Evaluate(); + // Mix up the rnd seed + srand(clock()); - inArgs.GetArg( 'H', str ); mH.Compile( str, mDict ); - inArgs.GetArg( 'S', str ); mS.Compile( str, mDict ); - inArgs.GetArg( 'V', str ); mV.Compile( str, mDict ); + // Compile and link the temp exprs. By spec, A-vars are evaluated now + mAVars.Compile(inArgs, 'A', mDict); + mAVars.Evaluate(); - mH_I_Dep = mH.IsDependent( "I" ); - mS_I_Dep = mS.IsDependent( "I" ); - mV_I_Dep = mV.IsDependent( "I" ); + inArgs.GetArg('H', str); + mH.Compile(str, mDict); + inArgs.GetArg('S', str); + mS.Compile(str, mDict); + inArgs.GetArg('V', str); + mV.Compile(str, mDict); + mH_I_Dep = mH.IsDependent("I"); + mS_I_Dep = mS.IsDependent("I"); + mV_I_Dep = mV.IsDependent("I"); } - -void GF_Palette::Evaluate( PixPalEntry outPalette[ 256 ] ) { - int i; - float H, S, V, inc = 1.0 / 255.0; - - *mIntensity = 0; - - // Prep to save evaluation time for vars indep of i - if ( ! mH_I_Dep ) H = mH.Evaluate(); - if ( ! mS_I_Dep ) S = mS.Evaluate(); - if ( ! mV_I_Dep ) V = mV.Evaluate(); - - for ( i = 0; i < 256; i++, *mIntensity += inc ) { - - // Don't reevaluate vars that are indep of i - if ( mH_I_Dep ) H = mH.Evaluate(); - if ( mS_I_Dep ) S = mS.Evaluate(); - if ( mV_I_Dep ) V = mV.Evaluate(); - - - RGBColor rgb; - EgOSUtils::HSV2RGB( H, S, V, rgb ); - outPalette[i].red = rgb.red >> 8; - outPalette[i].green = rgb.green >> 8; - outPalette[i].blue = rgb.blue >> 8; - outPalette[i].x = i; - } +void GF_Palette::Evaluate(PixPalEntry outPalette[256]) { + int i; + float H, S, V, inc = 1.0 / 255.0; + + *mIntensity = 0; + + // Prep to save evaluation time for vars indep of i + if (!mH_I_Dep) + H = mH.Evaluate(); + if (!mS_I_Dep) + S = mS.Evaluate(); + if (!mV_I_Dep) + V = mV.Evaluate(); + + for (i = 0; i < 256; i++, *mIntensity += inc) { + + // Don't reevaluate vars that are indep of i + if (mH_I_Dep) + H = mH.Evaluate(); + if (mS_I_Dep) + S = mS.Evaluate(); + if (mV_I_Dep) + V = mV.Evaluate(); + + RGBColor rgb; + EgOSUtils::HSV2RGB(H, S, V, rgb); + outPalette[i].red = rgb.red >> 8; + outPalette[i].green = rgb.green >> 8; + outPalette[i].blue = rgb.blue >> 8; + outPalette[i].x = i; + } } +void GF_Palette::SetupTransition(GF_Palette &inDest, float &inC) { -void GF_Palette::SetupTransition( GF_Palette& inDest, float& inC ) { - - mH.Weight( inDest.mH, &inC, 0 ); - mS.Weight( inDest.mS, &inC, 0 ); - mV.Weight( inDest.mV, &inC, 0 ); + mH.Weight(inDest.mH, &inC, 0); + mS.Weight(inDest.mS, &inC, 0); + mV.Weight(inDest.mV, &inC, 0); - mH_I_Dep = mH_I_Dep || inDest.mH_I_Dep; - mS_I_Dep = mS_I_Dep || inDest.mS_I_Dep; - mV_I_Dep = mV_I_Dep || inDest.mV_I_Dep; + mH_I_Dep = mH_I_Dep || inDest.mH_I_Dep; + mS_I_Dep = mS_I_Dep || inDest.mS_I_Dep; + mV_I_Dep = mV_I_Dep || inDest.mV_I_Dep; } diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/GForcePixPort.cpp b/libvisual-plugins/plugins/actor/gforce/GForceCommon/GForcePixPort.cpp index d1b94ab46..38fc1e668 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/GForcePixPort.cpp +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/GForcePixPort.cpp @@ -1,17 +1,14 @@ #include "GForcePixPort.h" - GForcePixPort::GForcePixPort() { - mConsoleFontID = CreateFont(); - AssignFont( mConsoleFontID, "", 9 ); - - mTrackTextFontID = CreateFont(); -} + mConsoleFontID = CreateFont(); + AssignFont(mConsoleFontID, "", 9); + mTrackTextFontID = CreateFont(); +} -void GForcePixPort::SetTrackTextFont( UtilStr& inName, long inSize ) { +void GForcePixPort::SetTrackTextFont(UtilStr &inName, long inSize) { - AssignFont( mTrackTextFontID, inName.getCStr(), inSize ); + AssignFont(mTrackTextFontID, inName.getCStr(), inSize); } - diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/DeltaField.h b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/DeltaField.h index a6f38f469..9a87b958a 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/DeltaField.h +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/DeltaField.h @@ -1,62 +1,57 @@ #ifndef __DeltaField__ #define __DeltaField__ - #include "ExpressionDict.h" #include "ExprArray.h" #include "TempMem.h" #include "PixPort.h" - - class ArgList; class DeltaField { - - public: - DeltaField(); - - // Suck in a new grad field. Note: Resize must be called after Assign() - void Assign( ArgList& inArgs, UtilStr& inName ); - - // Reinitiate/reset the computation of this grad field. - void SetSize( long inWidth, long inHeight, long inRowSize, bool inForceRegen = false ); - - // Compute a small portion of the grad field. Call GetField() to see if the field finished. - void CalcSome(); - - // See if this delta field is 100% calculated - bool IsCalculated() { return mCurrentY == mHeight; } - - // Returns a ptr to the buf of this grad field. - // Note: If the field is not 100% calculated, it will finish calculating and may take a couple seconds. - DeltaFieldData* GetField(); - - char* GetName() { return mName.getCStr(); } - - protected: - - - long mCurrentY; - ExpressionDict mDict; - float mX_Cord, mY_Cord, mR_Cord, mT_Cord; - float mXScale, mYScale; - float mPI; - Expression mXField, mYField; - bool mPolar, mHasRTerm, mHasThetaTerm; - long mWidth, mHeight, mRowSize; - long mAspect1to1; - ExprArray mAVars, mDVars; - UtilStr mName; - TempMem mGradBuf; - //TempMem mYExtentsBuf; - //long mNegYExtents; - DeltaFieldData mFieldData; - - char* mCurrentRow; +public: + DeltaField(); + + // Suck in a new grad field. Note: Resize must be called after Assign() + void Assign(ArgList &inArgs, UtilStr &inName); + + // Reinitiate/reset the computation of this grad field. + void SetSize(long inWidth, long inHeight, long inRowSize, + bool inForceRegen = false); + + // Compute a small portion of the grad field. Call GetField() to see if the + // field finished. + void CalcSome(); + + // See if this delta field is 100% calculated + bool IsCalculated() { return mCurrentY == mHeight; } + + // Returns a ptr to the buf of this grad field. + // Note: If the field is not 100% calculated, it will finish calculating + //and may take a couple seconds. + DeltaFieldData *GetField(); + + char *GetName() { return mName.getCStr(); } + +protected: + long mCurrentY; + ExpressionDict mDict; + float mX_Cord, mY_Cord, mR_Cord, mT_Cord; + float mXScale, mYScale; + float mPI; + Expression mXField, mYField; + bool mPolar, mHasRTerm, mHasThetaTerm; + long mWidth, mHeight, mRowSize; + long mAspect1to1; + ExprArray mAVars, mDVars; + UtilStr mName; + TempMem mGradBuf; + // TempMem mYExtentsBuf; + // long mNegYExtents; + DeltaFieldData mFieldData; + + char *mCurrentRow; }; - #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/G-Force.h b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/G-Force.h index 31499a57b..92d549bad 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/G-Force.h +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/G-Force.h @@ -13,270 +13,267 @@ #include "Prefs.h" - enum { - - cDispTrackTitle = 1, - cGetConfigInfo = 2, - cFrameRate = 3, - cSpawnNewParticle = 4, - cToggleFullsceen = 5, - cToggleConfigName = 6, - cToggleNormalize = 7, - cStartSlideshowAll = 8, - cStopSlideshowAll = 9, - cPrevDeltaField = 10, - cNextDeltaField = 11, - cToggleFieldShow = 12, - cPrevColorMap = 13, - cNextColorMap = 14, - cToggleColorShow = 15, - cPrevWaveShape = 16, - cNextWaveShape = 17, - cToggleShapeShow = 18, - cDecMagScale = 19, - cIncMagScale = 20, - cDecNumSSteps = 21, - cIncNumSSteps = 22, - cToggleParticles = 23, - cSetPreset0 = 30, - cSetPreset1 = 31, - cSetPreset2 = 32, - cSetPreset3 = 33, - cSetPreset4 = 34, - cSetPreset5 = 35, - cSetPreset6 = 36, - cSetPreset7 = 37, - cSetPreset8 = 38, - cSetPreset9 = 39, - cPreset0 = 40, - cPreset1 = 41, - cPreset2 = 42, - cPreset3 = 43, - cPreset4 = 44, - cPreset5 = 45, - cPreset6 = 46, - cPreset7 = 47, - cPreset8 = 48, - cPreset9 = 49 + + cDispTrackTitle = 1, + cGetConfigInfo = 2, + cFrameRate = 3, + cSpawnNewParticle = 4, + cToggleFullsceen = 5, + cToggleConfigName = 6, + cToggleNormalize = 7, + cStartSlideshowAll = 8, + cStopSlideshowAll = 9, + cPrevDeltaField = 10, + cNextDeltaField = 11, + cToggleFieldShow = 12, + cPrevColorMap = 13, + cNextColorMap = 14, + cToggleColorShow = 15, + cPrevWaveShape = 16, + cNextWaveShape = 17, + cToggleShapeShow = 18, + cDecMagScale = 19, + cIncMagScale = 20, + cDecNumSSteps = 21, + cIncNumSSteps = 22, + cToggleParticles = 23, + cSetPreset0 = 30, + cSetPreset1 = 31, + cSetPreset2 = 32, + cSetPreset3 = 33, + cSetPreset4 = 34, + cSetPreset5 = 35, + cSetPreset6 = 36, + cSetPreset7 = 37, + cSetPreset8 = 38, + cSetPreset9 = 39, + cPreset0 = 40, + cPreset1 = 41, + cPreset2 = 42, + cPreset3 = 43, + cPreset4 = 44, + cPreset5 = 45, + cPreset6 = 46, + cPreset7 = 47, + cPreset8 = 48, + cPreset9 = 49 }; +class GForce { +public: + GForce(void *inRefCon = 0); + ~GForce(); -class GForce { + void SetOutVideoBuffer(unsigned char *inVideoBuffer); + PixPalEntry *GetPalette() { return mPalette; } + + void SetFullscreen(bool inFullScreen); + inline bool IsFullscreen() { return mAtFullScreen; } + + // Pre: mSample[] has contains a sample/copy of the freq spectrum + // void RecordSample( long inCurTime, float* inFourier, + //long inNumBins ); + void RecordSample(long inCurTime, float *inSound, float inScale, + long inNumBins, float *inFFT, float inFFTScale, + long inFFTNumBin); + void RecordZeroSample(long inCurTime); + + bool BorderlessWindow() { return mBorderlessWind; } + + // This blackens the entire plugin/window area + void Refresh() { mNeedsPaneErased = true; } + + bool HandleKey(long inChar); + + void StoreWinRect() { + if (!IsFullscreen()) + GetWinRect(mWinRectHolder); + } + + void SetPort(GrafPtr inPort, const Rect &inRect, bool inAtFullsceen); + + void SetWinPort(WindowPtr inPort, const Rect *inRect = 0); + + void GetWinRect(Rect &outRect); + + long DefaultNum_FFT_Steps() { return mNum_FFT_Steps; } + + long DefaultNum_S_Steps() { return mNum_S_Steps; } + + Point GetFullscreenSize() { return mFullscreenSize; } + long GetFullscreenDepth() { return mFullscreenDepth; } + + /* NewSong() tells GForce a new track has started and that the following four + * strings may contain info. */ + UtilStr mArtist; + UtilStr mAlbum; + UtilStr mSongTitle; + void NewSong(); + +protected: + unsigned char *mVideoBuffer; + GrafPtr mOutPort; + WindowPtr mWind; + + void *mRefCon; + bool mDoingSetPortWin; // true when a thread is currently inside SetPortWin() + Rect mWinRectHolder; // Win rect holder while we're n FS mode + Rect mDispRect; // Local cords rect that specify where the blt area is + Rect mPaneRect; // Local cords rect within mOSPort we can draw in + Prefs mPrefs; + + GForcePixPort mPortA, mPortB; + GForcePixPort *mCurPort; + + // Console related members + XStrList mConsoleLines; + XLongList mLineExpireTimes; + UtilStr mTemp; + long mConsoleDelay; + long mConsoleLineDur; + long mConsoleExpireTime; + void DrawConsole(); + void Print(const char *inStr); + void Print(UtilStr *inStr) { + if (inStr) + Print(inStr->getCStr()); + } + void Println(const char *inStr); + void Println(UtilStr *inStr) { Println(inStr ? inStr->getCStr() : 0); } + + // Linked dict vars/addressed data spaces + float mT; + + // Palette stuff + PixPalEntry mPalette[256]; + GF_Palette mPal1, mPal2, *mGF_Palette, *mNextPal; + float mNextPaletteUpdate; + float mIntensityParam; + + // Plugin prefs + float mScrnSaverDelay; + long mTransitionLo; + long mTransitionHi; + long mHandleKeys; + float mMagScale; + long mBorderlessWind; + long mNum_S_Steps; + long mNum_FFT_Steps; + bool mNewConfigNotify; + bool mNormalizeInput; + bool mParticlesOn; + Point mMaxSize; + Point mFullscreenSize; + long mFullscreenDepth; + long mFullscreenDevice; + UtilStr mKeyMap; + UtilStr mParticleDuration; // Num secs a particle will stay around + UtilStr mParticleProbability; // Probability a new sausage will start + UtilStr mTrackMetaText; + UtilStr mTrackFont; + UtilStr mTrackTextStartStr; + UtilStr mTrackTextDurationStr; + long mTrackTextPosMode; + long mTrackTextSize; + + // Particle stuff + long mNextParticleCheck; + float mLastParticleStart; // LAST_PARTICLE_START + float mNumRunningParticles; // NUM_PARTICLES + Expression mParticleProbabilityFcn; // mParticleProbability compiled + Expression mParticleDurationFcn; // mParticleDuration compiles + ExpressionDict mDict; + nodeClass mStoppedParticlePool; + nodeClass mRunningParticlePool; + + FileSpecList mDeltaFields, mColorMaps, mWaveShapes, mParticles; + long mCurFieldNum, mCurColorMapNum, mCurShapeNum, mCurParticleNum; + float mNextFieldChange, mNextColorChange, mNextShapeChange; + XLongList mFieldPlayList, mColorPlayList, mShapePlayList, mParticlePlayList; + UtilStr mFieldIntervalStr, mColorIntervalStr, mShapeIntervalStr; + long mColorTransEnd, mShapeTransEnd; + long mColorTransTime, mShapeTransTime; // When > 0, transition is in progress + float mColorTrans; + bool mFieldSlideShow, mColorSlideShow, mShapeSlideShow; + UtilStr mColorMapName, mWaveShapeName; + Expression mFieldInterval, mColorInterval, mShapeInterval; +#define TRANSITION_ALPHA 1.45 + + // Field stuff + DeltaField *mField, *mNextField; + DeltaField mField1, mField2; + + // WaveShape stuff + float mWaveXScale; + float mWaveYScale; + WaveShape mWave1, mWave2, *mWave, *mNextWave; + long mT_MS, mT_MS_Base; + UtilStr mSamplesBuf; + UtilStr mFFTBuf; + UtilStr mSineBuf; + float *mSine; + + ExprUserFcn *mSampleFcn; + ExprUserFcn *mFFTFcn; + + ScreenDevice mScreen; + + void loadDeltaField(long inFieldNum); + void loadWaveShape(long inShapeNum, bool inAllowMorph); + void loadColorMap(long inColorMapNum, bool inAllowMorph); + void loadParticle(long inParticleNum); + + void RecordSample(long inCurTime); + void BuildConfigLists(); + void DrawWave(PixPort &inDest); + + // Frame rate/calc members + long mCurFrameRate; + float mFrameCountStart; + long mFrameCount; + + // Stuff dealing with full screen & screensaver mode + bool mAtFullScreen; + bool mMouseWillAwaken; + Point mLastMousePt; + float mLastActiveTime, mLastKeyPollTime; + KeyMap mCurKeys, mPastKeys; + void IdleMonitor(); + + // GUI related stuff + long mLastCursorUpdate; + long mLastGetKeys; + bool mNeedsPaneErased; + void ErasePane(); + void DrawFrame(); + + void StoreConfigState(long inParamName); + bool RestoreConfigState(long inParamName); + void ShowHelp(); + + // Track text related + float mLastSongStart; + float mTrackTextStartTime; + float mTrackTextDur; + Expression mTrackTextStartFcn, mTrackTextDurFcn; + Point mTrackTextPos; + UtilStr mTrackText; + void CalcTrackTextPos(); + void StartTrackText(); + + void DrawParticles(PixPort &inPort); + + void SetNumSampleBins(long inNumBins); + void SetNumFFTBins(long inNumBins); - public: - GForce( void* inRefCon = 0 ); - ~GForce(); - - - void SetOutVideoBuffer( unsigned char *inVideoBuffer); - PixPalEntry* GetPalette() { return mPalette; } - - void SetFullscreen( bool inFullScreen ); - inline bool IsFullscreen() { return mAtFullScreen; } - - // Pre: mSample[] has contains a sample/copy of the freq spectrum - // void RecordSample( long inCurTime, float* inFourier, long inNumBins ); - void RecordSample( long inCurTime, float* inSound, float inScale, long inNumBins, float* inFFT, float inFFTScale, long inFFTNumBin ); - void RecordZeroSample( long inCurTime ); - - bool BorderlessWindow() { return mBorderlessWind; } - - // This blackens the entire plugin/window area - void Refresh() { mNeedsPaneErased = true; } - - bool HandleKey( long inChar ); - - - void StoreWinRect() { if ( ! IsFullscreen() ) GetWinRect( mWinRectHolder ); } - - void SetPort( GrafPtr inPort, const Rect& inRect, bool inAtFullsceen ); - - void SetWinPort( WindowPtr inPort, const Rect* inRect = 0 ); - - void GetWinRect( Rect& outRect ); - - long DefaultNum_FFT_Steps() { return mNum_FFT_Steps; } - - long DefaultNum_S_Steps() { return mNum_S_Steps; } - - - Point GetFullscreenSize() { return mFullscreenSize; } - long GetFullscreenDepth() { return mFullscreenDepth; } - - /* NewSong() tells GForce a new track has started and that the following four strings may contain info. */ - UtilStr mArtist; - UtilStr mAlbum; - UtilStr mSongTitle; - void NewSong(); - - protected: - unsigned char* mVideoBuffer; - GrafPtr mOutPort; - WindowPtr mWind; - - void* mRefCon; - bool mDoingSetPortWin; // true when a thread is currently inside SetPortWin() - Rect mWinRectHolder; // Win rect holder while we're n FS mode - Rect mDispRect; // Local cords rect that specify where the blt area is - Rect mPaneRect; // Local cords rect within mOSPort we can draw in - Prefs mPrefs; - - - GForcePixPort mPortA, mPortB; - GForcePixPort* mCurPort; - - // Console related members - XStrList mConsoleLines; - XLongList mLineExpireTimes; - UtilStr mTemp; - long mConsoleDelay; - long mConsoleLineDur; - long mConsoleExpireTime; - void DrawConsole(); - void Print( const char* inStr ); - void Print( UtilStr* inStr ) { if ( inStr ) Print( inStr -> getCStr() ); } - void Println( const char* inStr ); - void Println( UtilStr* inStr ) { Println( inStr ? inStr -> getCStr() : 0 ); } - - // Linked dict vars/addressed data spaces - float mT; - - // Palette stuff - PixPalEntry mPalette[ 256 ]; - GF_Palette mPal1, mPal2, *mGF_Palette, *mNextPal; - float mNextPaletteUpdate; - float mIntensityParam; - - - // Plugin prefs - float mScrnSaverDelay; - long mTransitionLo; - long mTransitionHi; - long mHandleKeys; - float mMagScale; - long mBorderlessWind; - long mNum_S_Steps; - long mNum_FFT_Steps; - bool mNewConfigNotify; - bool mNormalizeInput; - bool mParticlesOn; - Point mMaxSize; - Point mFullscreenSize; - long mFullscreenDepth; - long mFullscreenDevice; - UtilStr mKeyMap; - UtilStr mParticleDuration; // Num secs a particle will stay around - UtilStr mParticleProbability; // Probability a new sausage will start - UtilStr mTrackMetaText; - UtilStr mTrackFont; - UtilStr mTrackTextStartStr; - UtilStr mTrackTextDurationStr; - long mTrackTextPosMode; - long mTrackTextSize; - - - // Particle stuff - long mNextParticleCheck; - float mLastParticleStart; // LAST_PARTICLE_START - float mNumRunningParticles; // NUM_PARTICLES - Expression mParticleProbabilityFcn; // mParticleProbability compiled - Expression mParticleDurationFcn; // mParticleDuration compiles - ExpressionDict mDict; - nodeClass mStoppedParticlePool; - nodeClass mRunningParticlePool; - - FileSpecList mDeltaFields, mColorMaps, mWaveShapes, mParticles; - long mCurFieldNum, mCurColorMapNum, mCurShapeNum, mCurParticleNum; - float mNextFieldChange, mNextColorChange, mNextShapeChange; - XLongList mFieldPlayList, mColorPlayList, mShapePlayList, mParticlePlayList; - UtilStr mFieldIntervalStr, mColorIntervalStr, mShapeIntervalStr; - long mColorTransEnd, mShapeTransEnd; - long mColorTransTime, mShapeTransTime; // When > 0, transition is in progress - float mColorTrans; - bool mFieldSlideShow, mColorSlideShow, mShapeSlideShow; - UtilStr mColorMapName, mWaveShapeName; - Expression mFieldInterval, mColorInterval, mShapeInterval; - #define TRANSITION_ALPHA 1.45 - - // Field stuff - DeltaField* mField, *mNextField; - DeltaField mField1, mField2; - - // WaveShape stuff - float mWaveXScale; - float mWaveYScale; - WaveShape mWave1, mWave2, *mWave, *mNextWave; - long mT_MS, mT_MS_Base; - UtilStr mSamplesBuf; - UtilStr mFFTBuf; - UtilStr mSineBuf; - float* mSine; - - ExprUserFcn* mSampleFcn; - ExprUserFcn* mFFTFcn; - - ScreenDevice mScreen; - - void loadDeltaField( long inFieldNum ); - void loadWaveShape( long inShapeNum, bool inAllowMorph ); - void loadColorMap( long inColorMapNum, bool inAllowMorph ); - void loadParticle( long inParticleNum ); - - - void RecordSample( long inCurTime ); - void BuildConfigLists(); - void DrawWave( PixPort& inDest ); - - // Frame rate/calc members - long mCurFrameRate; - float mFrameCountStart; - long mFrameCount; - - // Stuff dealing with full screen & screensaver mode - bool mAtFullScreen; - bool mMouseWillAwaken; - Point mLastMousePt; - float mLastActiveTime, mLastKeyPollTime; - KeyMap mCurKeys, mPastKeys; - void IdleMonitor(); - - - - // GUI related stuff - long mLastCursorUpdate; - long mLastGetKeys; - bool mNeedsPaneErased; - void ErasePane(); - void DrawFrame(); - - void StoreConfigState( long inParamName ); - bool RestoreConfigState( long inParamName ); - void ShowHelp(); - - // Track text related - float mLastSongStart; - float mTrackTextStartTime; - float mTrackTextDur; - Expression mTrackTextStartFcn, mTrackTextDurFcn; - Point mTrackTextPos; - UtilStr mTrackText; - void CalcTrackTextPos(); - void StartTrackText(); - - void DrawParticles( PixPort& inPort ); - - void SetNumSampleBins( long inNumBins ); - void SetNumFFTBins( long inNumBins ); - - void ManageColorChanges(); - void ManageShapeChanges(); - void ManageFieldChanges(); - void ManageParticleChanges(); - - void SpawnNewParticle(); + void ManageColorChanges(); + void ManageShapeChanges(); + void ManageFieldChanges(); + void ManageParticleChanges(); + void SpawnNewParticle(); }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/G-Force_Proj.h b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/G-Force_Proj.h index 23c7181d4..48fe6883e 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/G-Force_Proj.h +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/G-Force_Proj.h @@ -2,19 +2,12 @@ #include "EgCommon.h" +#define GFORCE 1 - - -#define GFORCE 1 - - - - -#define MAX_WAVES_PER_SHAPE 15 +#define MAX_WAVES_PER_SHAPE 15 #define GFORCE_COMPAT_VERSION 116 #define GFORCE_VERS_STR "Welcome to G-Force 1.1.6" -#define cGForceID 'g4ce' -#define cPluginAuthor 'Av55' - +#define cGForceID 'g4ce' +#define cPluginAuthor 'Av55' diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/GF_Palette.h b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/GF_Palette.h index 0f35a09af..da29b7466 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/GF_Palette.h +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/GF_Palette.h @@ -7,37 +7,30 @@ class ArgList; -/* Takes an arg list, looks for 'H', 'S', 'V' in terms of T, and I. T represents the system time -index (in seconds) and I is the intensity param value, ranging from 0 to 1, where all line -drawing drawing draws an intensity of 1. */ +/* Takes an arg list, looks for 'H', 'S', 'V' in terms of T, and I. T +represents the system time index (in seconds) and I is the intensity param +value, ranging from 0 to 1, where all line drawing drawing draws an intensity +of 1. */ class GF_Palette { - public: - GF_Palette( float& inT, float& inIntensity ); +public: + GF_Palette(float &inT, float &inIntensity); - // Compile the 'H', 'S', and 'V' expressions. - void Assign( const ArgList& inArgs ); + // Compile the 'H', 'S', and 'V' expressions. + void Assign(const ArgList &inArgs); + // Evaluates the palette based on the current time + void Evaluate(PixPalEntry outPalette[256]); - // Evaluates the palette based on the current time - void Evaluate( PixPalEntry outPalette[ 256 ] ); - - void SetupTransition( GF_Palette& inDest, float& inC ); - - - protected: - float* mIntensity, mPI; - Expression mH, mS, mV; - ExpressionDict mDict; - bool mH_I_Dep, mS_I_Dep, mV_I_Dep; - ExprArray mAVars; + void SetupTransition(GF_Palette &inDest, float &inC); +protected: + float *mIntensity, mPI; + Expression mH, mS, mV; + ExpressionDict mDict; + bool mH_I_Dep, mS_I_Dep, mV_I_Dep; + ExprArray mAVars; }; - #endif - - - - diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/GForcePixPort.h b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/GForcePixPort.h index e5fdfcf35..97a5997cf 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/GForcePixPort.h +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/GForcePixPort.h @@ -4,29 +4,19 @@ #include "PixPort.h" - - class GForcePixPort : public PixPort { +public: + GForcePixPort(); + void SetTrackTextFont(UtilStr &inName, long inSize); - public: - GForcePixPort(); - - void SetTrackTextFont( UtilStr& inName, long inSize ); - - void SetConsoleFont() { SelectFont( mConsoleFontID ); } - void SetTrackTextFont() { SelectFont( mTrackTextFontID ); } - - - protected: - long mTrackTextFontID; - long mConsoleFontID; - + void SetConsoleFont() { SelectFont(mConsoleFontID); } + void SetTrackTextFont() { SelectFont(mTrackTextFontID); } +protected: + long mTrackTextFontID; + long mConsoleFontID; }; - - #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/ParticleGroup.h b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/ParticleGroup.h index 59af080eb..c03891a05 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/ParticleGroup.h +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/ParticleGroup.h @@ -3,30 +3,26 @@ #include "WaveShape.h" - class ParticleGroup : public WaveShape, public nodeClass { - public: - +public: + ParticleGroup(float *inTPtr, ExprUserFcn **inMagFcn); - ParticleGroup( float* inTPtr, ExprUserFcn** inMagFcn ); + void Load(ArgList &inArgs); - void Load( ArgList& inArgs ); + void SetDuration(float inSecs) { mEndTime = *mTPtr + inSecs; } + inline bool IsExpired() { return *mTPtr > mEndTime; } - void SetDuration( float inSecs ) { mEndTime = *mTPtr + inSecs; } - inline bool IsExpired() { return *mTPtr > mEndTime; } + void DrawGroup(PixPort &inDest); - void DrawGroup( PixPort& inDest ); + UtilStr mTitle; - UtilStr mTitle; +protected: + const float *mTPtr; - protected: - const float* mTPtr; - - float mID, mNumInstances; - float mEndTime, mStartTime; - float mFadeTime; + float mID, mNumInstances; + float mEndTime, mStartTime; + float mFadeTime; }; #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/WaveShape.h b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/WaveShape.h index 90f1c5b47..1cd54b7b6 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/WaveShape.h +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/Headers/WaveShape.h @@ -4,64 +4,57 @@ #include "ExprArray.h" #include "ExpressionDict.h" - class ArgList; class PixPort; class WaveShape { - public: - - - WaveShape( float& inTPtr ); - - void SetMagFcn( ExprUserFcn** inMagFcn ); - - void SetFFTFcn( ExprUserFcn** InFFTFcn ); - - void Load( ArgList& inArgs, long inDefaultNumSteps ); - - - void SetupTransition( WaveShape* inDest ); +public: + WaveShape(float &inTPtr); - #define SHAPE_MORPH_ALPHA 1.7 + void SetMagFcn(ExprUserFcn **inMagFcn); + void SetFFTFcn(ExprUserFcn **InFFTFcn); - void Draw( long inNumSteps, PixPort& inDest, float inFader, WaveShape* inWave2, float inMorphPct ); + void Load(ArgList &inArgs, long inDefaultNumSteps); - protected: + void SetupTransition(WaveShape *inDest); - // Holds a copy of the ptr to the external time index - float* mTPtr; +#define SHAPE_MORPH_ALPHA 1.7 + void Draw(long inNumSteps, PixPort &inDest, float inFader, WaveShape *inWave2, + float inMorphPct); - // Dict vars - float mPI, mNumSampleBins, mNumFFTBins; - float mMouseX, mMouseY; +protected: + // Holds a copy of the ptr to the external time index + float *mTPtr; - ExpressionDict mDict; - float mShapeTrans; - long mNumWaves; - bool mAspect1to1; - bool mConnectBins, mConnectBinsOrig; - bool mConnectFirstLast, mConnectFirstLastOrig; - ExprArray mA, mB, mC; - ExprArray mWaveY; - ExprArray mWaveX; - Expression mLineWidth; - Expression mNum_S_Steps; - Expression mIntensity; - bool mPen_Dep_S; - bool mLineWidth_Dep_S; + // Dict vars + float mPI, mNumSampleBins, mNumFFTBins; + float mMouseX, mMouseY; + ExpressionDict mDict; + float mShapeTrans; + long mNumWaves; + bool mAspect1to1; + bool mConnectBins, mConnectBinsOrig; + bool mConnectFirstLast, mConnectFirstLastOrig; + ExprArray mA, mB, mC; + ExprArray mWaveY; + ExprArray mWaveX; + Expression mLineWidth; + Expression mNum_S_Steps; + Expression mIntensity; + bool mPen_Dep_S; + bool mLineWidth_Dep_S; - void SetupFrame( WaveShape* inDest, float inW ); + void SetupFrame(WaveShape *inDest, float inW); - static float sS; - static long sXY[ 2 * MAX_WAVES_PER_SHAPE ]; - static long sStartXY[ 2 * MAX_WAVES_PER_SHAPE ]; + static float sS; + static long sXY[2 * MAX_WAVES_PER_SHAPE]; + static long sStartXY[2 * MAX_WAVES_PER_SHAPE]; - void CalcNumS_Steps( WaveShape* inWave2, long inDefaultNumBins ); + void CalcNumS_Steps(WaveShape *inWave2, long inDefaultNumBins); }; #endif diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/ParticleGroup.cpp b/libvisual-plugins/plugins/actor/gforce/GForceCommon/ParticleGroup.cpp index f1ac702d4..31244886c 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/ParticleGroup.cpp +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/ParticleGroup.cpp @@ -10,63 +10,57 @@ #include "trunc.h" #endif -ParticleGroup::ParticleGroup( float* inTPtr, ExprUserFcn** inMagFcn ) : - WaveShape( *inTPtr ) { +ParticleGroup::ParticleGroup(float *inTPtr, ExprUserFcn **inMagFcn) + : WaveShape(*inTPtr) { - SetMagFcn( inMagFcn ); + SetMagFcn(inMagFcn); - mDict.AddVar( "ID", &mID ); - mDict.AddVar( "NUM", &mNumInstances ); - mDict.AddVar( "END_TIME", &mEndTime ); + mDict.AddVar("ID", &mID); + mDict.AddVar("NUM", &mNumInstances); + mDict.AddVar("END_TIME", &mEndTime); - mTPtr = inTPtr; + mTPtr = inTPtr; } +void ParticleGroup::Load(ArgList &inArgs) { + UtilStr str; + Expression expr; + // User may access the DT var + mStartTime = *mTPtr; + mFadeTime = ((float)EgOSUtils::Rnd(200, 350)) / 100.0; - - -void ParticleGroup::Load( ArgList& inArgs ) { - UtilStr str; - Expression expr; - - // User may access the DT var - mStartTime = *mTPtr; - mFadeTime = ( (float) EgOSUtils::Rnd( 200, 350 ) ) / 100.0; - - // Calculate how many interations/instances of this particle + // Calculate how many interations/instances of this particle #define VAL(a, b, c) ((a << 16) + (b << 8) + c) - inArgs.GetArg( VAL('N','U','M'), str ); + inArgs.GetArg(VAL('N', 'U', 'M'), str); #undef VAL - expr.Compile( str, mDict ); - mNumInstances = trunc( expr.Evaluate() ); - if ( mNumInstances < 1 ) - mNumInstances = 1; + expr.Compile(str, mDict); + mNumInstances = trunc(expr.Evaluate()); + if (mNumInstances < 1) + mNumInstances = 1; - // A vars shouldn't be accessing the ID global var, but zero it anyway - mID = 0; + // A vars shouldn't be accessing the ID global var, but zero it anyway + mID = 0; - // Load everything else in the wave - WaveShape::Load( inArgs, 32 ); + // Load everything else in the wave + WaveShape::Load(inArgs, 32); } - - -void ParticleGroup::DrawGroup( PixPort& inDest ) { - float fader; - - // User may access the DURATION var - if ( *mTPtr - mStartTime < mFadeTime ) { - fader = ( *mTPtr - mStartTime ) / mFadeTime; - fader = .1 + .9 * sin( 3.14159 * fader / 2 ); } - else if ( mEndTime - *mTPtr < mFadeTime ) { - fader = ( mEndTime - *mTPtr ) / mFadeTime; - fader = 1 - .9 * sin( 3.14159 * ( .5 + fader / 2 ) ); } - else - fader = 1; - - // Remember mID can be accessed be accesed byt he particle - for ( mID = 0; mID < mNumInstances; mID += 1 ) { - Draw( 32, inDest, fader, 0, 0 ); - } +void ParticleGroup::DrawGroup(PixPort &inDest) { + float fader; + + // User may access the DURATION var + if (*mTPtr - mStartTime < mFadeTime) { + fader = (*mTPtr - mStartTime) / mFadeTime; + fader = .1 + .9 * sin(3.14159 * fader / 2); + } else if (mEndTime - *mTPtr < mFadeTime) { + fader = (mEndTime - *mTPtr) / mFadeTime; + fader = 1 - .9 * sin(3.14159 * (.5 + fader / 2)); + } else + fader = 1; + + // Remember mID can be accessed be accesed byt he particle + for (mID = 0; mID < mNumInstances; mID += 1) { + Draw(32, inDest, fader, 0, 0); + } } diff --git a/libvisual-plugins/plugins/actor/gforce/GForceCommon/WaveShape.cpp b/libvisual-plugins/plugins/actor/gforce/GForceCommon/WaveShape.cpp index 5df2304e6..9a4612f7d 100644 --- a/libvisual-plugins/plugins/actor/gforce/GForceCommon/WaveShape.cpp +++ b/libvisual-plugins/plugins/actor/gforce/GForceCommon/WaveShape.cpp @@ -13,330 +13,321 @@ #include "EgOSUtils.h" #include "PixPort.h" +long WaveShape::sXY[2 * MAX_WAVES_PER_SHAPE]; +long WaveShape::sStartXY[2 * MAX_WAVES_PER_SHAPE]; +float WaveShape::sS; -long WaveShape::sXY[ 2 * MAX_WAVES_PER_SHAPE ]; -long WaveShape::sStartXY[ 2 * MAX_WAVES_PER_SHAPE ]; -float WaveShape::sS; +WaveShape::WaveShape(float &inTPtr) { + UtilStr str; + mNumWaves = 0; + mMouseX = 0; + mMouseY = 0; -WaveShape::WaveShape( float& inTPtr ) { - UtilStr str; + mNumFFTBins = 255; - mNumWaves = 0; - mMouseX = 0; - mMouseY = 0; + mDict.AddVar("S", &sS); + mDict.AddVar("T", &inTPtr); + mDict.AddVar("NUM_SAMPLE_BINS", &mNumSampleBins); + // FIXME, use fft here! + mDict.AddVar("NUM_FFT_BINS", &mNumFFTBins); + mDict.AddVar("MOUSEX", &mMouseX); + mDict.AddVar("MOUSEY", &mMouseY); - mNumFFTBins = 255; + mTPtr = &inTPtr; + mPI = 3.14159265358979; - mDict.AddVar( "S", &sS ); - mDict.AddVar( "T", &inTPtr ); - mDict.AddVar( "NUM_SAMPLE_BINS", &mNumSampleBins ); - // FIXME, use fft here! - mDict.AddVar( "NUM_FFT_BINS", &mNumFFTBins ); - mDict.AddVar( "MOUSEX", &mMouseX ); - mDict.AddVar( "MOUSEY", &mMouseY ); - - mTPtr = &inTPtr; - mPI = 3.14159265358979; - - mDict.AddVar( "PI", &mPI ); + mDict.AddVar("PI", &mPI); } +void WaveShape::SetMagFcn(ExprUserFcn **inMagFcn) { - -void WaveShape::SetMagFcn( ExprUserFcn** inMagFcn ) { - - mDict.AddFcn( "MAG", inMagFcn ); + mDict.AddFcn("MAG", inMagFcn); } -void WaveShape::SetFFTFcn( ExprUserFcn** inFFTFcn ) { +void WaveShape::SetFFTFcn(ExprUserFcn **inFFTFcn) { - mDict.AddFcn( "FFT", inFFTFcn ); + mDict.AddFcn("FFT", inFFTFcn); } -#define _assignOrig( field ) field##Orig = field; +#define _assignOrig(field) field##Orig = field; +void WaveShape::Load(ArgList &inArgs, long inDefaultNumSteps) { +#define VAL(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) +#define VAL2(a, b, c) (((a) << 16) + ((b) << 8) + (c)) -void WaveShape::Load( ArgList& inArgs, long inDefaultNumSteps ) { + UtilStr str; -#define VAL(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) -#define VAL2(a,b,c) (((a)<<16)+((b)<<8)+(c)) + // Mix up the rnd seed + srand(clock()); - UtilStr str; + // Calculate mNumSampleBins -- How many pieces we chop the 0-1 s interval into + inArgs.GetArg(VAL('S', 't', 'p', 's'), str); - // Mix up the rnd seed - srand( clock() ); + mNum_S_Steps.Compile(str, mDict); + CalcNumS_Steps(0, inDefaultNumSteps); - // Calculate mNumSampleBins -- How many pieces we chop the 0-1 s interval into - inArgs.GetArg( VAL('S','t','p','s'), str ); + // Compile and link all the temp exprs. By their spec, A vars can be + // evaluated now + mA.Compile(inArgs, 'A', mDict); + mA.Evaluate(); + mB.Compile(inArgs, 'B', mDict); + mC.Compile(inArgs, 'C', mDict); - mNum_S_Steps.Compile( str, mDict ); - CalcNumS_Steps( 0, inDefaultNumSteps ); + // The intensity fcn allows drawing of arbitrary intensity + if (!inArgs.GetArg(VAL2('P', 'e', 'n'), str)) + str.Assign("1"); + mIntensity.Compile(str, mDict); - // Compile and link all the temp exprs. By their spec, A vars can be evaluated now - mA.Compile( inArgs, 'A', mDict ); - mA.Evaluate(); - mB.Compile( inArgs, 'B', mDict ); - mC.Compile( inArgs, 'C', mDict ); + // If a user doesn't enter a line widh for a wave, assume width 1 + if (!inArgs.GetArg(VAL('L', 'W', 'd', 't'), str)) + str.Assign("1"); + mLineWidth.Compile(str, mDict); - // The intensity fcn allows drawing of arbitrary intensity - if ( ! inArgs.GetArg( VAL2('P','e','n'), str ) ) - str.Assign( "1" ); - mIntensity.Compile( str, mDict ); + mPen_Dep_S = mIntensity.IsDependent("s") || mIntensity.IsDependent("c") || + mIntensity.IsDependent("rnd"); + mLineWidth_Dep_S = mLineWidth.IsDependent("s") || + mLineWidth.IsDependent("c") || + mLineWidth.IsDependent("rnd"); - // If a user doesn't enter a line widh for a wave, assume width 1 - if ( ! inArgs.GetArg( VAL('L','W','d','t'), str ) ) - str.Assign( "1" ); - mLineWidth.Compile( str, mDict ); + // Compile and link waves + mWaveX.Compile(inArgs, 'X', mDict); + mWaveY.Compile(inArgs, 'Y', mDict); - mPen_Dep_S = mIntensity.IsDependent( "s" ) || mIntensity.IsDependent( "c" ) || mIntensity.IsDependent( "rnd" ); - mLineWidth_Dep_S = mLineWidth.IsDependent( "s" ) || mLineWidth.IsDependent( "c" ) || mLineWidth.IsDependent( "rnd" ); + // Init all the wave shape var counters + mNumWaves = mWaveX.Count(); - // Compile and link waves - mWaveX.Compile( inArgs, 'X', mDict ); - mWaveY.Compile( inArgs, 'Y', mDict ); + mConnectBins = inArgs.GetArg(VAL('C', 'o', 'n', 'B')); + mConnectFirstLast = inArgs.GetArg(VAL('C', 'o', 'n', 'B')) > 1; - // Init all the wave shape var counters - mNumWaves = mWaveX.Count(); + // Make copies/save original values (morph will write over the nonOrg vars) + _assignOrig(mConnectBins) _assignOrig(mConnectFirstLast) - mConnectBins = inArgs.GetArg( VAL('C','o','n','B') ); - mConnectFirstLast = inArgs.GetArg( VAL('C','o','n','B') ) > 1; - - // Make copies/save original values (morph will write over the nonOrg vars) - _assignOrig( mConnectBins ) - _assignOrig( mConnectFirstLast ) - - mAspect1to1 = inArgs.GetArg( VAL('A','s','p','c') ); + mAspect1to1 = inArgs.GetArg(VAL('A', 's', 'p', 'c')); #undef VAL2 #undef VAL1 } - - /* void WaveShape::SetSize( long inWidth, long inHeight ) { - mXScale = inWidth / 2; - mYScale = inHeight / 2; + mXScale = inWidth / 2; + mYScale = inHeight / 2; - if ( mAspect1to1 ) { + if ( mAspect1to1 ) { - // Keep the xy aspect ratio to 1, change the dim that will get stretched - if ( mYScale < mXScale ) - mXScale = mYScale; - else - mYScale = mXScale; - } + // Keep the xy aspect ratio to 1, change the dim that will get +stretched if ( mYScale < mXScale ) mXScale = mYScale; else mYScale = mXScale; + } } */ +void WaveShape::SetupTransition(WaveShape *inDest) { -void WaveShape::SetupTransition( WaveShape* inDest ) { - - mIntensity.Weight( inDest -> mIntensity, &mShapeTrans, 0 ); - mLineWidth.Weight( inDest -> mLineWidth, &mShapeTrans, 0 ); + mIntensity.Weight(inDest->mIntensity, &mShapeTrans, 0); + mLineWidth.Weight(inDest->mLineWidth, &mShapeTrans, 0); - mPen_Dep_S = mPen_Dep_S || inDest -> mPen_Dep_S; - mLineWidth_Dep_S = mLineWidth_Dep_S|| inDest -> mLineWidth_Dep_S; + mPen_Dep_S = mPen_Dep_S || inDest->mPen_Dep_S; + mLineWidth_Dep_S = mLineWidth_Dep_S || inDest->mLineWidth_Dep_S; } - - -#define __evalIntensity( var ) clr = 65535.0 * mIntensity.Evaluate() * inFader; \ - var = clr; \ - if ( clr < 0 ) var = 0; \ - else if ( clr > 0xFFFF ) var = 0xFFFF; - - - -void WaveShape::CalcNumS_Steps( WaveShape* inWave2, long inDefaultNumBins ) { - int n; - - // See if this shape has an overriding number of s steps - mNumSampleBins = inDefaultNumBins; - mNumSampleBins = mNum_S_Steps.Evaluate(); - if ( mNumSampleBins <= 0 ) - mNumSampleBins = inDefaultNumBins; - - - if ( inWave2 ) { - n = inWave2 -> mNum_S_Steps.Evaluate(); - if ( n <= 0 ) - n = inDefaultNumBins; - - mNumSampleBins = ( 1 - mShapeTrans ) * n + mShapeTrans * mNumSampleBins; - } +#define __evalIntensity(var) \ + clr = 65535.0 * mIntensity.Evaluate() * inFader; \ + var = clr; \ + if (clr < 0) \ + var = 0; \ + else if (clr > 0xFFFF) \ + var = 0xFFFF; + +void WaveShape::CalcNumS_Steps(WaveShape *inWave2, long inDefaultNumBins) { + int n; + + // See if this shape has an overriding number of s steps + mNumSampleBins = inDefaultNumBins; + mNumSampleBins = mNum_S_Steps.Evaluate(); + if (mNumSampleBins <= 0) + mNumSampleBins = inDefaultNumBins; + + if (inWave2) { + n = inWave2->mNum_S_Steps.Evaluate(); + if (n <= 0) + n = inDefaultNumBins; + + mNumSampleBins = (1 - mShapeTrans) * n + mShapeTrans * mNumSampleBins; + } } - -void WaveShape::Draw( long inNumSteps, PixPort& inDest, float inFader, WaveShape* inWave2, float inMorphPct ) { - long i, x, y; - long xoff = inDest.GetX() >> 1; - long yoff = inDest.GetY() >> 1; - long maxWaves, w2Waves, clr; - float dialate, tx, ty, stepSize; - float xscale, yscale, xscaleW2, yscaleW2 ; - RGBColor rgb, rgbPrev, rgbStart; - - // Calc the x and y scale factors - xscale = xoff; - yscale = yoff; - if ( mAspect1to1 ) { - if ( yscale < xscale ) - xscale = yscale; - else - yscale = xscale; - } - - // See if this shape has an overriding number of s steps - CalcNumS_Steps( inWave2, inNumSteps ); - - // Setup default step size--inv of how many bins are available - if ( mNumSampleBins > 1 ) - stepSize = 1.0 / ( mNumSampleBins - 1.0 ); - else - stepSize = 1; - - // If we're not in a transition/morph - if ( ! inWave2 ) { - dialate = 1; - maxWaves = mNumWaves; - w2Waves = 0; - } - - // If we're transitioning from one waveshape to another - else { - w2Waves = inWave2 -> mNumWaves; - dialate = inMorphPct; - mShapeTrans = pow( dialate, SHAPE_MORPH_ALPHA ); - SetupFrame( inWave2, mShapeTrans ); - - if ( mNumWaves > w2Waves ) { - maxWaves = mNumWaves; - dialate = 1.0 - dialate; } - else - maxWaves = w2Waves; - - // Set the wave scale factor to the wave leaving/arriving - dialate = 20.0 * pow( dialate, 4.0 ) + 1.0; - - // Calc the x and y scale factors for wave 2 - xscaleW2 = xoff; - yscaleW2 = yoff; - if ( inWave2 -> mAspect1to1 ) { - if ( yscaleW2 < xscaleW2 ) - xscaleW2 = yscaleW2; - else - yscaleW2 = xscaleW2; - } - } - - // Setup/store the mouse position for possible virtual machine access - Point mousePt; - EgOSUtils::GetMouse( mousePt ); - mMouseX = ( (float) mousePt.h ) / xscale; - mMouseY = ( (float) mousePt.v ) / yscale; - - // Evaluate the expressions dependent on 't'/the current frame - mB.Evaluate(); - if ( inWave2 ) - inWave2 -> mB.Evaluate(); - - // Calc linewidth, add a little to make .999 into 1. If it's not dep on s, we can evaluate it now - if ( ! mLineWidth_Dep_S ) - inDest.SetLineWidth( mLineWidth.Evaluate() + 0.001 ); - - // Calc pen intensity. If it's not dep on s, we can evaluate it now. - if ( ! mPen_Dep_S ) { - __evalIntensity( rgb.red ); - rgbPrev = rgb; - } - - // Step thru s (the xy exprs will give us the cords) - for ( sS = 0; sS <= 1.0; sS += stepSize ) { - - // Evaluate the expressions dependent on 's' - mC.Evaluate(); - if ( inWave2 ) - inWave2 -> mC.Evaluate(); - - // Calc linewidth, add a little to make .999 into 1. - if ( mLineWidth_Dep_S ) - inDest.SetLineWidth( mLineWidth.Evaluate() + 0.001 ); - - // Calc pen intensity - if ( mPen_Dep_S ) { - rgbPrev = rgb; - __evalIntensity( rgb.red ); - } - - // Draw all the waves - for ( i = 0; i < maxWaves; i++ ) { - - if ( i < mNumWaves ) { - - // Find the cords for waveshape1, wave number i - tx = xscale * mWaveX.Evaluate( i ); - ty = yscale * mWaveY.Evaluate( i ); - - // If we have two waves to mix... - if ( i < w2Waves ) { - tx = mShapeTrans * tx + ( 1.0 - mShapeTrans ) * xscaleW2 * inWave2 -> mWaveX.Evaluate( i ); - ty = mShapeTrans * ty + ( 1.0 - mShapeTrans ) * yscaleW2 * inWave2 -> mWaveY.Evaluate( i ); } - else { - tx *= dialate; - ty *= dialate; - } } - else { - - // Find the cords for waveshape2, wave number i - tx = dialate * xscaleW2 * inWave2 -> mWaveX.Evaluate( i ); - ty = dialate * yscaleW2 * inWave2 -> mWaveY.Evaluate( i ); - } - - // Switch to screen cords, baby, and draw the line segment - x = xoff + tx; - y = yoff - ty; - - if ( mConnectBins ) { - if ( sS > 0 ) - inDest.Line( sXY[ 2 * i ], sXY[ 2 * i + 1 ], x, y, rgbPrev, rgb ); - else { - sStartXY[ 2 * i ] = x; - sStartXY[ 2 * i + 1 ] = y; - rgbStart = rgb; - } - sXY[ 2 * i ] = x; - sXY[ 2 * i + 1 ] = y; } - else - inDest.Line( x, y, x, y, rgb, rgb ); - } - } - - // Draw all the first-last segments for each wave - if ( mConnectFirstLast ) { - for ( i = 0; i < maxWaves; i++ ) - inDest.Line( sXY[ 2 * i ], sXY[ 2 * i + 1 ], sStartXY[ 2 * i ], sStartXY[ 2 * i + 1 ], rgb, rgbStart ); - } - - // Make sure we restore a random seed (one of the virtual machines could be seeding to the same value) - srand( *((long*) mTPtr) ); - +void WaveShape::Draw(long inNumSteps, PixPort &inDest, float inFader, + WaveShape *inWave2, float inMorphPct) { + long i, x, y; + long xoff = inDest.GetX() >> 1; + long yoff = inDest.GetY() >> 1; + long maxWaves, w2Waves, clr; + float dialate, tx, ty, stepSize; + float xscale, yscale, xscaleW2, yscaleW2; + RGBColor rgb, rgbPrev, rgbStart; + + // Calc the x and y scale factors + xscale = xoff; + yscale = yoff; + if (mAspect1to1) { + if (yscale < xscale) + xscale = yscale; + else + yscale = xscale; + } + + // See if this shape has an overriding number of s steps + CalcNumS_Steps(inWave2, inNumSteps); + + // Setup default step size--inv of how many bins are available + if (mNumSampleBins > 1) + stepSize = 1.0 / (mNumSampleBins - 1.0); + else + stepSize = 1; + + // If we're not in a transition/morph + if (!inWave2) { + dialate = 1; + maxWaves = mNumWaves; + w2Waves = 0; + } + + // If we're transitioning from one waveshape to another + else { + w2Waves = inWave2->mNumWaves; + dialate = inMorphPct; + mShapeTrans = pow(dialate, SHAPE_MORPH_ALPHA); + SetupFrame(inWave2, mShapeTrans); + + if (mNumWaves > w2Waves) { + maxWaves = mNumWaves; + dialate = 1.0 - dialate; + } else + maxWaves = w2Waves; + + // Set the wave scale factor to the wave leaving/arriving + dialate = 20.0 * pow(dialate, 4.0) + 1.0; + + // Calc the x and y scale factors for wave 2 + xscaleW2 = xoff; + yscaleW2 = yoff; + if (inWave2->mAspect1to1) { + if (yscaleW2 < xscaleW2) + xscaleW2 = yscaleW2; + else + yscaleW2 = xscaleW2; + } + } + + // Setup/store the mouse position for possible virtual machine access + Point mousePt; + EgOSUtils::GetMouse(mousePt); + mMouseX = ((float)mousePt.h) / xscale; + mMouseY = ((float)mousePt.v) / yscale; + + // Evaluate the expressions dependent on 't'/the current frame + mB.Evaluate(); + if (inWave2) + inWave2->mB.Evaluate(); + + // Calc linewidth, add a little to make .999 into 1. If it's not dep on s, we + // can evaluate it now + if (!mLineWidth_Dep_S) + inDest.SetLineWidth(mLineWidth.Evaluate() + 0.001); + + // Calc pen intensity. If it's not dep on s, we can evaluate it now. + if (!mPen_Dep_S) { + __evalIntensity(rgb.red); + rgbPrev = rgb; + } + + // Step thru s (the xy exprs will give us the cords) + for (sS = 0; sS <= 1.0; sS += stepSize) { + + // Evaluate the expressions dependent on 's' + mC.Evaluate(); + if (inWave2) + inWave2->mC.Evaluate(); + + // Calc linewidth, add a little to make .999 into 1. + if (mLineWidth_Dep_S) + inDest.SetLineWidth(mLineWidth.Evaluate() + 0.001); + + // Calc pen intensity + if (mPen_Dep_S) { + rgbPrev = rgb; + __evalIntensity(rgb.red); + } + + // Draw all the waves + for (i = 0; i < maxWaves; i++) { + + if (i < mNumWaves) { + + // Find the cords for waveshape1, wave number i + tx = xscale * mWaveX.Evaluate(i); + ty = yscale * mWaveY.Evaluate(i); + + // If we have two waves to mix... + if (i < w2Waves) { + tx = mShapeTrans * tx + + (1.0 - mShapeTrans) * xscaleW2 * inWave2->mWaveX.Evaluate(i); + ty = mShapeTrans * ty + + (1.0 - mShapeTrans) * yscaleW2 * inWave2->mWaveY.Evaluate(i); + } else { + tx *= dialate; + ty *= dialate; + } + } else { + + // Find the cords for waveshape2, wave number i + tx = dialate * xscaleW2 * inWave2->mWaveX.Evaluate(i); + ty = dialate * yscaleW2 * inWave2->mWaveY.Evaluate(i); + } + + // Switch to screen cords, baby, and draw the line segment + x = xoff + tx; + y = yoff - ty; + + if (mConnectBins) { + if (sS > 0) + inDest.Line(sXY[2 * i], sXY[2 * i + 1], x, y, rgbPrev, rgb); + else { + sStartXY[2 * i] = x; + sStartXY[2 * i + 1] = y; + rgbStart = rgb; + } + sXY[2 * i] = x; + sXY[2 * i + 1] = y; + } else + inDest.Line(x, y, x, y, rgb, rgb); + } + } + + // Draw all the first-last segments for each wave + if (mConnectFirstLast) { + for (i = 0; i < maxWaves; i++) + inDest.Line(sXY[2 * i], sXY[2 * i + 1], sStartXY[2 * i], + sStartXY[2 * i + 1], rgb, rgbStart); + } + + // Make sure we restore a random seed (one of the virtual machines could be + // seeding to the same value) + srand(*((long *)mTPtr)); } +#define __weightFLT(field) \ + field = (inW * ((float)field##Orig) + w1 * ((float)inDest->field)); +#define __weightINT(field) \ + field = (0.5 + inW * ((float)field##Orig) + w1 * ((float)inDest->field)); +#define __weightBOL(field) \ + field = .5 < (inW * (field##Orig ? 1.0 : 0.0) + \ + w1 * (inDest->field ? 1.0 : 0.0)); +void WaveShape::SetupFrame(WaveShape *inDest, float inW) { + float w1 = 1.0 - inW; - -#define __weightFLT( field ) field = ( inW * ( (float) field##Orig ) + w1 * ( (float) inDest -> field ) ); -#define __weightINT( field ) field = ( 0.5 + inW * ( (float) field##Orig ) + w1 * ( (float) inDest -> field ) ); -#define __weightBOL( field ) field = .5 < ( inW * ( field##Orig ? 1.0 : 0.0 ) + w1 * ( inDest -> field ? 1.0 : 0.0 ) ); - - -void WaveShape::SetupFrame( WaveShape* inDest, float inW ) { - float w1 = 1.0 - inW; - - __weightBOL( mConnectBins ) - __weightBOL( mConnectFirstLast ) + __weightBOL(mConnectBins) __weightBOL(mConnectFirstLast) } - diff --git a/libvisual-plugins/plugins/actor/gforce/unix/Headers/trunc.h b/libvisual-plugins/plugins/actor/gforce/unix/Headers/trunc.h index be0f1ac17..2b25c4c4b 100644 --- a/libvisual-plugins/plugins/actor/gforce/unix/Headers/trunc.h +++ b/libvisual-plugins/plugins/actor/gforce/unix/Headers/trunc.h @@ -25,4 +25,3 @@ double trunc(double); #endif #endif - diff --git a/libvisual-plugins/plugins/actor/gforce/unix/libmfl/libmfl.h b/libvisual-plugins/plugins/actor/gforce/unix/libmfl/libmfl.h index ef3a8551c..73b17d385 100644 --- a/libvisual-plugins/plugins/actor/gforce/unix/libmfl/libmfl.h +++ b/libvisual-plugins/plugins/actor/gforce/unix/libmfl/libmfl.h @@ -44,28 +44,23 @@ mfl_font mfl_LoadRawFont(const char *fname); void mfl_DestroyFont(mfl_font f); /* Context management */ -mfl_context mfl_CreateContext(void *buf, unsigned int bpp, - unsigned int bpl, unsigned int width, - unsigned int height); +mfl_context mfl_CreateContext(void *buf, unsigned int bpp, unsigned int bpl, + unsigned int width, unsigned int height); void mfl_SetTextColor(mfl_context cx, unsigned long c); void mfl_SetFont(mfl_context cx, mfl_font f); void mfl_DestroyContext(mfl_context cx); void mfl_SetDrawMode(mfl_context cx, int mode); /* Info */ -unsigned int mfl_GetTextWidth(const mfl_context cx, - const char *s); -unsigned int mfl_GetTextWidthL(const mfl_context cx, - const char *s, int l); +unsigned int mfl_GetTextWidth(const mfl_context cx, const char *s); +unsigned int mfl_GetTextWidthL(const mfl_context cx, const char *s, int l); /* Character drawing */ void mfl_OutChar8(const mfl_context cx, int x, int y, char c); /* String drawing */ -void mfl_OutText8L(const mfl_context cx, int x, int y, - const char *s, int l); -void mfl_OutText8(const mfl_context cx, int x, int y, - const char *s); +void mfl_OutText8L(const mfl_context cx, int x, int y, const char *s, int l); +void mfl_OutText8(const mfl_context cx, int x, int y, const char *s); #if defined(__cplusplus) || defined(c_plusplus) // This is a C library, and this allows it to be used in C++ programs diff --git a/libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c b/libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c index cc476868c..86525717d 100644 --- a/libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c +++ b/libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c @@ -52,38 +52,41 @@ mfl_font mfl_LoadRawFont(const char *fname) { /* Open font file */ ff = fopen(fname, "rb"); if (ff == NULL) { - visual_log (VISUAL_LOG_WARNING, "Unable to open font file: %s", fname); + visual_log(VISUAL_LOG_WARNING, "Unable to open font file: %s", fname); goto lrf_open_fault; } /* Get length of font file */ - if (fseek(ff, 0, SEEK_END) != 0) goto lrf_fault; + if (fseek(ff, 0, SEEK_END) != 0) + goto lrf_fault; l = ftell(ff); /* Seek to start */ - if (fseek(ff, 0, SEEK_SET) != 0) goto lrf_fault; + if (fseek(ff, 0, SEEK_SET) != 0) + goto lrf_fault; /* Determine font height */ - if (l & 0xff) goto lrf_fault; /* Unknown length */ + if (l & 0xff) + goto lrf_fault; /* Unknown length */ /* Allocate data, fill out structure */ f = malloc(sizeof(struct mfl_font_s)); f->height = l >> 8; f->data = malloc(l); - + /* Read font data */ if (fread(f->data, 1, l, ff) != l) { - visual_log (VISUAL_LOG_WARNING, "Unable to fully read font file: %s", fname); + visual_log(VISUAL_LOG_WARNING, "Unable to fully read font file: %s", fname); free(f->data); free(f); f = NULL; } - lrf_fault: +lrf_fault: /* Close input file */ fclose(ff); - lrf_open_fault: +lrf_open_fault: return f; } @@ -95,12 +98,10 @@ void mfl_DestroyFont(mfl_font f) { free(f); } - -mfl_context mfl_CreateContext(void *buf, unsigned int bpp, - unsigned int bpl, unsigned int width, - unsigned int height) { +mfl_context mfl_CreateContext(void *buf, unsigned int bpp, unsigned int bpl, + unsigned int width, unsigned int height) { mfl_context cx = malloc(sizeof(struct mfl_context_s)); - + cx->buf = buf; cx->bpp = bpp; cx->bpl = bpl; @@ -113,24 +114,16 @@ mfl_context mfl_CreateContext(void *buf, unsigned int bpp, return cx; } -void mfl_DestroyContext(mfl_context cx) { - free(cx); -} +void mfl_DestroyContext(mfl_context cx) { free(cx); } -void mfl_SetTextColor(mfl_context cx, unsigned long c) { - cx->color = c; -} +void mfl_SetTextColor(mfl_context cx, unsigned long c) { cx->color = c; } -void mfl_SetFont(mfl_context cx, mfl_font f) { - cx->font = f; -} +void mfl_SetFont(mfl_context cx, mfl_font f) { cx->font = f; } -void mfl_SetDrawMode(mfl_context cx, int mode) { - cx->opmode = mode; -} +void mfl_SetDrawMode(mfl_context cx, int mode) { cx->opmode = mode; } -inline unsigned int mfl_GetTextWidthL(const mfl_context cx, - const char *s, int l) { +inline unsigned int mfl_GetTextWidthL(const mfl_context cx, const char *s, + int l) { return l * 8; } @@ -145,12 +138,13 @@ void mfl_OutChar8(const mfl_context cx, int x, int y, char c) { unsigned char *fp; unsigned char *dp, *ndp; unsigned char *dpe; - - if (cx->font == NULL) return; + + if (cx->font == NULL) + return; /* Setup pointers */ - fp = cx->font->data + (cx->font->height * c); - + fp = cx->font->data + (cx->font->height * c); + if (y < 0) { rows = cx->font->height + y; fp -= y; @@ -161,13 +155,15 @@ void mfl_OutChar8(const mfl_context cx, int x, int y, char c) { if (y + rows >= cx->height) { rows = cx->height - y; } - if (rows <= 0) return; + if (rows <= 0) + return; smask = 0x80; if (x < 0) { smask >>= -x; x = 0; - if (smask == 0) return; + if (smask == 0) + return; } dp = (unsigned char *)cx->buf + (y * cx->bpl) + x; @@ -178,14 +174,22 @@ void mfl_OutChar8(const mfl_context cx, int x, int y, char c) { ndp = dp + cx->bpl; for (j = smask; j > 0 && dp < dpe; j >>= 1) { if (*fp & j) { - switch(cx->opmode) { - case MFL_XOR: *dp ^= cx->color; break; - case MFL_OR: *dp |= cx->color; break; - case MFL_SETALL: *dp = 0xff; break; - /* If we don't recognize the style, revert to normal */ - default: *dp = cx->color; break; - } - } + switch (cx->opmode) { + case MFL_XOR: + *dp ^= cx->color; + break; + case MFL_OR: + *dp |= cx->color; + break; + case MFL_SETALL: + *dp = 0xff; + break; + /* If we don't recognize the style, revert to normal */ + default: + *dp = cx->color; + break; + } + } dp++; } fp++; @@ -195,11 +199,11 @@ void mfl_OutChar8(const mfl_context cx, int x, int y, char c) { void mfl_OutText8L(const mfl_context cx, int x, int y, const char *s, int l) { const char *esp = s + l; - + while (s < esp) { mfl_OutChar8(cx, x, y, *s); s++; - x+=8; + x += 8; } } @@ -209,9 +213,9 @@ void mfl_OutText8(const mfl_context cx, int x, int y, const char *s) { #ifdef MFL_TEST main(int argc, char **argv) { - #define SCREEN_X 78 - #define SCREEN_Y 22 - #define SCREEN_BPL (SCREEN_X + 1) +#define SCREEN_X 78 +#define SCREEN_Y 22 +#define SCREEN_BPL (SCREEN_X + 1) mfl_font f; mfl_context c; @@ -219,7 +223,7 @@ main(int argc, char **argv) { int y; char screen[SCREEN_BPL * SCREEN_Y + 1]; - + for (i = 0; i < SCREEN_Y; i++) { visual_mem_set(&(screen[i * SCREEN_BPL]), '.', SCREEN_X); screen[i * SCREEN_BPL + SCREEN_X] = '\n'; @@ -240,6 +244,3 @@ main(int argc, char **argv) { puts(screen); } #endif - - - diff --git a/libvisual-plugins/plugins/actor/gforce/unix/libvisual/actor_gforce.cpp b/libvisual-plugins/plugins/actor/gforce/unix/libvisual/actor_gforce.cpp index 669d9a882..f23b0b0d9 100644 --- a/libvisual-plugins/plugins/actor/gforce/unix/libvisual/actor_gforce.cpp +++ b/libvisual-plugins/plugins/actor/gforce/unix/libvisual/actor_gforce.cpp @@ -45,192 +45,191 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #define SAMPSKIP 1 typedef struct { - LV::Palette *pal; - GForce *gGF; + LV::Palette *pal; + GForce *gGF; } GForcePrivate; -static int lv_gforce_init (VisPluginData *plugin); -static void lv_gforce_cleanup (VisPluginData *plugin); -static void lv_gforce_requisition (VisPluginData *plugin, int *width, int *height); -static void lv_gforce_resize (VisPluginData *plugin, int width, int height); -static int lv_gforce_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_gforce_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_gforce_palette (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info () -{ - static VisActorPlugin actor; - - actor.requisition = lv_gforce_requisition; - actor.palette = lv_gforce_palette; - actor.render = lv_gforce_render; - actor.vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT; - - static VisPluginInfo info; - - info.type = VISUAL_PLUGIN_TYPE_ACTOR; - info.plugname = "gforce"; - info.name = "libvisual G-Force plugin"; - info.author = "Winamp version: Andy O'Meara, Unix port: Boris Gjenero, Libvisual port and cleanups: Dennis Smit pal = new LV::Palette (256); + priv->pal = new LV::Palette(256); - EgOSUtils::Initialize (0); - ScreenDevice::sMinDepth = 8; + EgOSUtils::Initialize(0); + ScreenDevice::sMinDepth = 8; - /* Randomize the seed */ - srand (EgOSUtils::CurTimeMS ()); + /* Randomize the seed */ + srand(EgOSUtils::CurTimeMS()); - priv->gGF = new GForce; + priv->gGF = new GForce; - Rect r; - SetRect (&r, 0, 0, 64, 64); + Rect r; + SetRect(&r, 0, 0, 64, 64); - priv->gGF->SetWinPort (0, &r); - priv->gGF->StoreWinRect (); + priv->gGF->SetWinPort(0, &r); + priv->gGF->StoreWinRect(); - return true; + return true; } -void lv_gforce_cleanup (VisPluginData *plugin) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_gforce_cleanup(VisPluginData *plugin) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - if (priv->gGF) - delete priv->gGF; + if (priv->gGF) + delete priv->gGF; - EgOSUtils::Shutdown (); + EgOSUtils::Shutdown(); - delete priv->pal; + delete priv->pal; - delete priv; + delete priv; } -void lv_gforce_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +void lv_gforce_requisition(VisPluginData *plugin, int *width, int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - while (reqw % 4) - reqw--; + while (reqw % 4) + reqw--; - while (reqh % 4) - reqh--; + while (reqh % 4) + reqh--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -void lv_gforce_resize (VisPluginData *plugin, int width, int height) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_gforce_resize(VisPluginData *plugin, int width, int height) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - Rect r; - SetRect (&r, 0, 0, width, height); - priv->gGF->SetWinPort (0, &r); + Rect r; + SetRect(&r, 0, 0, width, height); + priv->gGF->SetWinPort(0, &r); } -int lv_gforce_events (VisPluginData *plugin, VisEventQueue *events) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +int lv_gforce_events(VisPluginData *plugin, VisEventQueue *events) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - VisEvent ev; + VisEvent ev; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_gforce_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_gforce_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; - case VISUAL_EVENT_MOUSEMOTION: - break; + case VISUAL_EVENT_MOUSEMOTION: + break; - case VISUAL_EVENT_MOUSEBUTTONDOWN: - case VISUAL_EVENT_MOUSEBUTTONUP: - break; + case VISUAL_EVENT_MOUSEBUTTONDOWN: + case VISUAL_EVENT_MOUSEBUTTONUP: + break; - case VISUAL_EVENT_KEYDOWN: - priv->gGF->HandleKey (ev.event.keyboard.keysym.sym); - break; + case VISUAL_EVENT_KEYDOWN: + priv->gGF->HandleKey(ev.event.keyboard.keysym.sym); + break; - default: - break; - } - } + default: + break; + } + } - return true; + return true; } -VisPalette *lv_gforce_palette (VisPluginData *plugin) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +VisPalette *lv_gforce_palette(VisPluginData *plugin) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - PixPalEntry *GFpal; - int i; + PixPalEntry *GFpal; + int i; - GFpal = priv->gGF->GetPalette (); + GFpal = priv->gGF->GetPalette(); - for (i = 0; i < 256; i++) { - priv->pal->colors[i].r = GFpal[i].red; - priv->pal->colors[i].g = GFpal[i].green; - priv->pal->colors[i].b = GFpal[i].blue; - } + for (i = 0; i < 256; i++) { + priv->pal->colors[i].r = GFpal[i].red; + priv->pal->colors[i].g = GFpal[i].green; + priv->pal->colors[i].b = GFpal[i].blue; + } - return priv->pal; + return priv->pal; } -void lv_gforce_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_gforce_render(VisPluginData *plugin, VisVideo *video, VisAudio *audio) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - int i; - long time; - float gSoundBuf[SND_BUF_SIZE]; - float gFFTBuf[FFT_BUF_SIZE]; + int i; + long time; + float gSoundBuf[SND_BUF_SIZE]; + float gFFTBuf[FFT_BUF_SIZE]; - LV::BufferPtr pcmbuf = LV::Buffer::create (); - LV::BufferPtr freqbuf = LV::Buffer::create (); + LV::BufferPtr pcmbuf = LV::Buffer::create(); + LV::BufferPtr freqbuf = LV::Buffer::create(); - pcmbuf->set (gSoundBuf, sizeof (gSoundBuf)); - audio->get_sample_mixed_simple (pcmbuf, 2, VISUAL_AUDIO_CHANNEL_LEFT, VISUAL_AUDIO_CHANNEL_RIGHT); + pcmbuf->set(gSoundBuf, sizeof(gSoundBuf)); + audio->get_sample_mixed_simple(pcmbuf, 2, VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); - freqbuf->set (gFFTBuf, sizeof (gFFTBuf)); - audio->get_spectrum_for_sample (freqbuf, pcmbuf, true, 3.0); + freqbuf->set(gFFTBuf, sizeof(gFFTBuf)); + audio->get_spectrum_for_sample(freqbuf, pcmbuf, true, 3.0); - // Increase volume - for (i = 0; i < SND_BUF_SIZE; i++) - gSoundBuf[i] *= 32768; + // Increase volume + for (i = 0; i < SND_BUF_SIZE; i++) + gSoundBuf[i] *= 32768; - // Set the video buffer - priv->gGF->SetOutVideoBuffer ((unsigned char *) video->get_pixels ()); + // Set the video buffer + priv->gGF->SetOutVideoBuffer((unsigned char *)video->get_pixels()); - time = EgOSUtils::CurTimeMS (); - priv->gGF->RecordSample (time, gSoundBuf, .000043, NUMSAMPLES, gFFTBuf, 1, FFT_BUF_SIZE); + time = EgOSUtils::CurTimeMS(); + priv->gGF->RecordSample(time, gSoundBuf, .000043, NUMSAMPLES, gFFTBuf, 1, + FFT_BUF_SIZE); } diff --git a/libvisual-plugins/plugins/actor/goom2k4/actor_goom2k4.c b/libvisual-plugins/plugins/actor/goom2k4/actor_goom2k4.c index fbe9462bb..09fa7984f 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/actor_goom2k4.c +++ b/libvisual-plugins/plugins/actor/goom2k4/actor_goom2k4.c @@ -27,156 +27,151 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR typedef struct { - PluginInfo *goominfo; /* The goom internal private struct */ + PluginInfo *goominfo; /* The goom internal private struct */ } GoomPrivate; -static int lv_goom_init (VisPluginData *plugin); -static void lv_goom_cleanup (VisPluginData *plugin); -static void lv_goom_requisition (VisPluginData *plugin, int *width, int *height); -static void lv_goom_resize (VisPluginData *plugin, int width, int height); -static int lv_goom_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_goom_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_goom_palette (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = lv_goom_requisition, - .palette = lv_goom_palette, - .render = lv_goom_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_32BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "goom2k4", - .name = "libvisual goom2k4 plugin", - .author = "Dennis Smit , goom2k4 by: Jean-Christophe Hoelt ", - .version = "0.1", - .about = N_("Libvisual goom2k4 plugin"), - .help = N_("This plugin adds support for the supercool goom2k4 plugin that is simply awesome"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_goom_init, - .cleanup = lv_goom_cleanup, - .events = lv_goom_events, - .plugin = &actor - }; - - return &info; +static int lv_goom_init(VisPluginData *plugin); +static void lv_goom_cleanup(VisPluginData *plugin); +static void lv_goom_requisition(VisPluginData *plugin, int *width, int *height); +static void lv_goom_resize(VisPluginData *plugin, int width, int height); +static int lv_goom_events(VisPluginData *plugin, VisEventQueue *events); +static void lv_goom_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *lv_goom_palette(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = lv_goom_requisition, + .palette = lv_goom_palette, + .render = lv_goom_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_32BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "goom2k4", + .name = "libvisual goom2k4 plugin", + .author = "Dennis Smit , goom2k4 by: " + "Jean-Christophe Hoelt ", + .version = "0.1", + .about = N_("Libvisual goom2k4 plugin"), + .help = N_("This plugin adds support for the supercool goom2k4 plugin " + "that is simply awesome"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_goom_init, + .cleanup = lv_goom_cleanup, + .events = lv_goom_events, + .plugin = &actor}; + + return &info; } -static int lv_goom_init (VisPluginData *plugin) -{ - GoomPrivate *priv; +static int lv_goom_init(VisPluginData *plugin) { + GoomPrivate *priv; #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - priv = visual_mem_new0 (GoomPrivate, 1); - visual_plugin_set_private (plugin, priv); + priv = visual_mem_new0(GoomPrivate, 1); + visual_plugin_set_private(plugin, priv); - priv->goominfo = goom_init (128, 128); + priv->goominfo = goom_init(128, 128); - return TRUE; + return TRUE; } -static void lv_goom_cleanup (VisPluginData *plugin) -{ - GoomPrivate *priv = visual_plugin_get_private (plugin); +static void lv_goom_cleanup(VisPluginData *plugin) { + GoomPrivate *priv = visual_plugin_get_private(plugin); - if (priv->goominfo != NULL) - goom_close (priv->goominfo); + if (priv->goominfo != NULL) + goom_close(priv->goominfo); - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_goom_requisition (VisPluginData *plugin, int *width, int *height) -{ - /* We don't change the value, we can handle anything */ +static void lv_goom_requisition(VisPluginData *plugin, int *width, + int *height) { + /* We don't change the value, we can handle anything */ } -static void lv_goom_resize (VisPluginData *plugin, int width, int height) -{ - GoomPrivate *priv = visual_plugin_get_private (plugin); +static void lv_goom_resize(VisPluginData *plugin, int width, int height) { + GoomPrivate *priv = visual_plugin_get_private(plugin); - goom_set_resolution (priv->goominfo, width, height); + goom_set_resolution(priv->goominfo, width, height); } -static int lv_goom_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; +static int lv_goom_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_goom_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_goom_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; - default: /* to avoid warnings */ - break; - } - } + default: /* to avoid warnings */ + break; + } + } - return TRUE; + return TRUE; } -static VisPalette *lv_goom_palette (VisPluginData *plugin) -{ - return NULL; -} +static VisPalette *lv_goom_palette(VisPluginData *plugin) { return NULL; } -static void lv_goom_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - GoomPrivate *priv = visual_plugin_get_private (plugin); +static void lv_goom_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + GoomPrivate *priv = visual_plugin_get_private(plugin); - const int showinfo = TRUE; + const int showinfo = TRUE; - VisBuffer *pcmbuf1 = visual_buffer_new_allocate(sizeof (float) * 512); - visual_audio_get_sample (audio, pcmbuf1, VISUAL_AUDIO_CHANNEL_LEFT); + VisBuffer *pcmbuf1 = visual_buffer_new_allocate(sizeof(float) * 512); + visual_audio_get_sample(audio, pcmbuf1, VISUAL_AUDIO_CHANNEL_LEFT); - VisBuffer *pcmbuf2 = visual_buffer_new_allocate(sizeof (float) * 512); - visual_audio_get_sample (audio, pcmbuf2, VISUAL_AUDIO_CHANNEL_RIGHT); + VisBuffer *pcmbuf2 = visual_buffer_new_allocate(sizeof(float) * 512); + visual_audio_get_sample(audio, pcmbuf2, VISUAL_AUDIO_CHANNEL_RIGHT); - float *buf1 = visual_buffer_get_data(pcmbuf1); - float *buf2 = visual_buffer_get_data(pcmbuf2); + float *buf1 = visual_buffer_get_data(pcmbuf1); + float *buf2 = visual_buffer_get_data(pcmbuf2); - short pcmdata[2][512]; + short pcmdata[2][512]; - for (int i = 0; i < 512; i++) { - pcmdata[0][i] = buf1[i] * 32767; - pcmdata[1][i] = buf2[i] * 32767; - } + for (int i = 0; i < 512; i++) { + pcmdata[0][i] = buf1[i] * 32767; + pcmdata[1][i] = buf2[i] * 32767; + } - visual_buffer_unref(pcmbuf1); - visual_buffer_unref(pcmbuf2); + visual_buffer_unref(pcmbuf1); + visual_buffer_unref(pcmbuf2); - /* Retrieve the songinfo */ - VisSongInfo *songinfo = ((VisActorPlugin *) visual_plugin_get_specific (plugin))->songinfo; + /* Retrieve the songinfo */ + VisSongInfo *songinfo = + ((VisActorPlugin *)visual_plugin_get_specific(plugin))->songinfo; - uint32_t *buf; + uint32_t *buf; - /* FIXME goom should support setting a pointer, so we don't need that final visual_mem_copy */ - if (songinfo != NULL && visual_songinfo_get_age (songinfo) <= 1 && showinfo == TRUE) { - VisSongInfoType songinfo_type = visual_songinfo_get_type (songinfo); + /* FIXME goom should support setting a pointer, so we don't need that final + * visual_mem_copy */ + if (songinfo != NULL && visual_songinfo_get_age(songinfo) <= 1 && + showinfo == TRUE) { + VisSongInfoType songinfo_type = visual_songinfo_get_type(songinfo); - if (songinfo_type == VISUAL_SONGINFO_TYPE_SIMPLE) - buf = goom_update (priv->goominfo, pcmdata, 0, 0, visual_songinfo_get_simple_name (songinfo), NULL); - else if (songinfo_type == VISUAL_SONGINFO_TYPE_ADVANCED) - buf = goom_update (priv->goominfo, pcmdata, 0, 0, visual_songinfo_get_song (songinfo), NULL); - else - buf = goom_update (priv->goominfo, pcmdata, 0, 0, NULL, NULL); - } - else { - buf = goom_update (priv->goominfo, pcmdata, 0, 0, NULL, NULL); - } + if (songinfo_type == VISUAL_SONGINFO_TYPE_SIMPLE) + buf = goom_update(priv->goominfo, pcmdata, 0, 0, + visual_songinfo_get_simple_name(songinfo), NULL); + else if (songinfo_type == VISUAL_SONGINFO_TYPE_ADVANCED) + buf = goom_update(priv->goominfo, pcmdata, 0, 0, + visual_songinfo_get_song(songinfo), NULL); + else + buf = goom_update(priv->goominfo, pcmdata, 0, 0, NULL, NULL); + } else { + buf = goom_update(priv->goominfo, pcmdata, 0, 0, NULL, NULL); + } - uint8_t *vidbuf = visual_video_get_pixels (video); + uint8_t *vidbuf = visual_video_get_pixels(video); - visual_mem_copy_pitch (vidbuf, buf, visual_video_get_pitch (video), - visual_video_get_pitch (video), - visual_video_get_pitch (video), - visual_video_get_height (video)); + visual_mem_copy_pitch( + vidbuf, buf, visual_video_get_pitch(video), visual_video_get_pitch(video), + visual_video_get_pitch(video), visual_video_get_height(video)); } diff --git a/libvisual-plugins/plugins/actor/goom2k4/config_param.c b/libvisual-plugins/plugins/actor/goom2k4/config_param.c index e5927d601..f7b2b341d 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/config_param.c +++ b/libvisual-plugins/plugins/actor/goom2k4/config_param.c @@ -15,8 +15,7 @@ /* TODO: Ajouter goom_ devant ces fonctions */ -static void empty_fct(PluginParam *dummy) { -} +static void empty_fct(PluginParam *dummy) {} PluginParam goom_secure_param() { PluginParam p; @@ -46,11 +45,11 @@ PluginParam goom_secure_f_feedback(char *name) { } PluginParam goom_secure_s_param(char *name) { - PluginParam p = secure_param(); - p.name = name; - p.type = PARAM_STRVAL; - SVAL(p) = 0; - return p; + PluginParam p = secure_param(); + p.name = name; + p.type = PARAM_STRVAL; + SVAL(p) = 0; + return p; } PluginParam goom_secure_b_param(char *name, int value) { @@ -83,30 +82,29 @@ PluginParameters goom_plugin_parameters(const char *name, int nb) { p.name = (char *)name; p.desc = ""; p.nbParams = nb; - p.params = (PluginParam**)malloc(nb*sizeof(PluginParam*)); + p.params = (PluginParam **)malloc(nb * sizeof(PluginParam *)); return p; } /*---------------------------------------------------------------------------*/ void goom_set_str_param_value(PluginParam *p, const char *str) { - int len = strlen(str); - if (SVAL(*p)) - SVAL(*p) = (char*)realloc(SVAL(*p), len+1); - else - SVAL(*p) = (char*)malloc(len+1); - visual_mem_copy(SVAL(*p), str, len+1); + int len = strlen(str); + if (SVAL(*p)) + SVAL(*p) = (char *)realloc(SVAL(*p), len + 1); + else + SVAL(*p) = (char *)malloc(len + 1); + visual_mem_copy(SVAL(*p), str, len + 1); } void goom_set_list_param_value(PluginParam *p, const char *str) { - int len = strlen(str); + int len = strlen(str); #ifdef VERBOSE - printf("%s: %d\n", str, len); + printf("%s: %d\n", str, len); #endif - if (LVAL(*p)) - LVAL(*p) = (char*)realloc(LVAL(*p), len+1); - else - LVAL(*p) = (char*)malloc(len+1); - visual_mem_copy(LVAL(*p), str, len+1); + if (LVAL(*p)) + LVAL(*p) = (char *)realloc(LVAL(*p), len + 1); + else + LVAL(*p) = (char *)malloc(len + 1); + visual_mem_copy(LVAL(*p), str, len + 1); } - diff --git a/libvisual-plugins/plugins/actor/goom2k4/convolve_fx.c b/libvisual-plugins/plugins/actor/goom2k4/convolve_fx.c index bad324401..2192603a8 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/convolve_fx.c +++ b/libvisual-plugins/plugins/actor/goom2k4/convolve_fx.c @@ -9,8 +9,8 @@ #include -//#define CONV_MOTIF_W 32 -//#define CONV_MOTIF_WMASK 0x1f +// #define CONV_MOTIF_W 32 +// #define CONV_MOTIF_WMASK 0x1f #define CONV_MOTIF_W 128 #define CONV_MOTIF_WMASK 0x7f @@ -24,7 +24,7 @@ typedef char Motif[CONV_MOTIF_W][CONV_MOTIF_W]; #define MAX 2.0f -typedef struct _CONV_DATA{ +typedef struct _CONV_DATA { PluginParam light; PluginParam factor_adj_p; PluginParam factor_p; @@ -33,50 +33,51 @@ typedef struct _CONV_DATA{ GoomSL *script; /* rotozoom */ - int theta; + int theta; float ftheta; - int h_sin[NB_THETA]; - int h_cos[NB_THETA]; - int h_height; + int h_sin[NB_THETA]; + int h_cos[NB_THETA]; + int h_height; float visibility; Motif conv_motif; - int inverse_motif; - + int inverse_motif; + } ConvData; /* init rotozoom tables */ -static void compute_tables(VisualFX *_this, PluginInfo *info) -{ - ConvData *data = (ConvData*)_this->fx_data; +static void compute_tables(VisualFX *_this, PluginInfo *info) { + ConvData *data = (ConvData *)_this->fx_data; double screen_coef; int i; double h; double radian; - if (data->h_height == info->screen.height) return; + if (data->h_height == info->screen.height) + return; screen_coef = 2.0 * 300.0 / (double)info->screen.height; data->h_height = info->screen.height; - for ( i=0 ; ih_cos[i] = 0x10000 * (-h * cos (radian) * cos(radian)); - data->h_sin[i] = 0x10000 * (h * sin (radian + 1.57) * sin(radian)); + for (i = 0; i < NB_THETA; i++) { + radian = 2 * i * M_PI / NB_THETA; + h = (0.2 + cos(radian) / 15.0 * sin(radian * 2.0 + 12.123)) * screen_coef; + data->h_cos[i] = 0x10000 * (-h * cos(radian) * cos(radian)); + data->h_sin[i] = 0x10000 * (h * sin(radian + 1.57) * sin(radian)); } } -static void set_motif(ConvData *data, Motif motif) -{ - int i,j; - for (i=0;iconv_motif[i][j] = motif[CONV_MOTIF_W-i-1][CONV_MOTIF_W-j-1]; +static void set_motif(ConvData *data, Motif motif) { + int i, j; + for (i = 0; i < CONV_MOTIF_W; ++i) + for (j = 0; j < CONV_MOTIF_W; ++j) + data->conv_motif[i][j] = + motif[CONV_MOTIF_W - i - 1][CONV_MOTIF_W - j - 1]; } static void convolve_init(VisualFX *_this, PluginInfo *info) { ConvData *data; - data = (ConvData*)malloc(sizeof(ConvData)); - _this->fx_data = (void*)data; + data = (ConvData *)malloc(sizeof(ConvData)); + _this->fx_data = (void *)data; data->h_height = 0; @@ -92,7 +93,7 @@ static void convolve_init(VisualFX *_this, PluginInfo *info) { data->factor_p = secure_f_feedback("Factor"); - data->params = plugin_parameters ("Bright Flash", 5); + data->params = plugin_parameters("Bright Flash", 5); data->params.params[0] = &data->light; data->params.params[1] = &data->factor_adj_p; data->params.params[2] = 0; @@ -110,26 +111,24 @@ static void convolve_init(VisualFX *_this, PluginInfo *info) { _this->params = &data->params; } -static void convolve_free(VisualFX *_this) { - free (_this->fx_data); -} +static void convolve_free(VisualFX *_this) { free(_this->fx_data); } -static void create_output_with_brightness(VisualFX *_this, Pixel *src, Pixel *dest, - PluginInfo *info, int iff) -{ - ConvData *data = (ConvData*)_this->fx_data; - - int x,y; - int i = 0;//info->screen.height * info->screen.width - 1; +static void create_output_with_brightness(VisualFX *_this, Pixel *src, + Pixel *dest, PluginInfo *info, + int iff) { + ConvData *data = (ConvData *)_this->fx_data; + + int x, y; + int i = 0; // info->screen.height * info->screen.width - 1; - const int c = data->h_cos [data->theta]; - const int s = data->h_sin [data->theta]; + const int c = data->h_cos[data->theta]; + const int s = data->h_sin[data->theta]; - const int xi = -(info->screen.width/2) * c; - const int yi = (info->screen.width/2) * s; + const int xi = -(info->screen.width / 2) * c; + const int yi = (info->screen.width / 2) * s; - const int xj = -(info->screen.height/2) * s; - const int yj = -(info->screen.height/2) * c; + const int xj = -(info->screen.height / 2) * s; + const int yj = -(info->screen.height / 2) * c; int xprime = xj; int yprime = yj; @@ -137,135 +136,131 @@ static void create_output_with_brightness(VisualFX *_this, Pixel *src, Pixel *de int ifftab[16]; if (data->inverse_motif) { int i; - for (i=0;i<16;++i) + for (i = 0; i < 16; ++i) ifftab[i] = (double)iff * (1.0 + data->visibility * (15.0 - i) / 15.0); - } - else { + } else { int i; - for (i=0;i<16;++i) + for (i = 0; i < 16; ++i) ifftab[i] = (double)iff / (1.0 + data->visibility * (15.0 - i) / 15.0); } - if (visual_cpu_has_mmx ()) { + if (visual_cpu_has_mmx()) { #if defined(VISUAL_ARCH_X86) - for (y=info->screen.height;y--;) { - int xtex,ytex; - - xtex = xprime + xi + CONV_MOTIF_W * 0x10000 / 2; - xprime += s; - - ytex = yprime + yi + CONV_MOTIF_W * 0x10000 / 2; - yprime += c; - - __asm__ __volatile__ - ("\n\t pxor %%mm7, %%mm7" /* mm7 = 0 */ - "\n\t movd %[xtex], %%mm2" - "\n\t movd %[ytex], %%mm3" - "\n\t punpckldq %%mm3, %%mm2" /* mm2 = [ ytex | xtex ] */ - "\n\t movd %[c], %%mm4" - "\n\t movd %[s], %%mm6" - "\n\t pxor %%mm5, %%mm5" - "\n\t psubd %%mm6, %%mm5" - "\n\t punpckldq %%mm5, %%mm4" /* mm4 = [ -s | c ] */ - "\n\t movd %[motif], %%mm6" /* mm6 = motif */ - - ::[xtex]"g"(xtex) ,[ytex]"g"(ytex) - , [c]"g"(c), [s]"g"(s) - , [motif] "g"(&data->conv_motif[0][0])); - - for (x=info->screen.width;x--;) - { - __asm__ __volatile__ - ( - "\n\t movd %[src], %%mm0" /* mm0 = src */ - "\n\t paddd %%mm4, %%mm2" /* [ ytex | xtex ] += [ -s | s ] */ - "\n\t movd %%esi, %%mm5" /* save esi into mm5 */ - "\n\t movq %%mm2, %%mm3" - "\n\t psrld $16, %%mm3" /* mm3 = [ (ytex>>16) | (xtex>>16) ] */ - "\n\t movd %%mm3, %%eax" /* eax = xtex' */ - - "\n\t psrlq $25, %%mm3" - "\n\t movd %%mm3, %%ecx" /* ecx = ytex' << 7 */ - - "\n\t andl $127, %%eax" - "\n\t andl $16256, %%ecx" - - "\n\t addl %%ecx, %%eax" - "\n\t movd %%mm6, %%esi" /* esi = motif */ - "\n\t xorl %%ecx, %%ecx" - "\n\t movb (%%eax,%%esi), %%cl" - - "\n\t movl %[ifftab], %%eax" - "\n\t movd %%mm5, %%esi" /* restore esi from mm5 */ - "\n\t movd (%%eax,%%ecx,4), %%mm1" /* mm1 = [0|0|0|iff2] */ - - "\n\t punpcklwd %%mm1, %%mm1" - "\n\t punpcklbw %%mm7, %%mm0" - "\n\t punpckldq %%mm1, %%mm1" - "\n\t psrlw $1, %%mm0" - "\n\t psrlw $2, %%mm1" - "\n\t pmullw %%mm1, %%mm0" - "\n\t psrlw $5, %%mm0" - "\n\t packuswb %%mm7, %%mm0" - "\n\t movd %%mm0, %[dest]" - : [dest] "=g" (dest[i].val) - : [src] "g" (src[i].val) - , [ifftab]"g"(&ifftab[0]) - : "eax","ecx"); - - i++; - } - } - - __asm__ __volatile__ ("\n\t emms"); + for (y = info->screen.height; y--;) { + int xtex, ytex; + + xtex = xprime + xi + CONV_MOTIF_W * 0x10000 / 2; + xprime += s; + + ytex = yprime + yi + CONV_MOTIF_W * 0x10000 / 2; + yprime += c; + + __asm__ __volatile__( + "\n\t pxor %%mm7, %%mm7" /* mm7 = 0 */ + "\n\t movd %[xtex], %%mm2" + "\n\t movd %[ytex], %%mm3" + "\n\t punpckldq %%mm3, %%mm2" /* mm2 = [ ytex | xtex ] */ + "\n\t movd %[c], %%mm4" + "\n\t movd %[s], %%mm6" + "\n\t pxor %%mm5, %%mm5" + "\n\t psubd %%mm6, %%mm5" + "\n\t punpckldq %%mm5, %%mm4" /* mm4 = [ -s | c ] */ + "\n\t movd %[motif], %%mm6" /* mm6 = motif */ + + ::[xtex] "g"(xtex), + [ytex] "g"(ytex), [c] "g"(c), [s] "g"(s), + [motif] "g"(&data->conv_motif[0][0])); + + for (x = info->screen.width; x--;) { + __asm__ __volatile__( + "\n\t movd %[src], %%mm0" /* mm0 = src */ + "\n\t paddd %%mm4, %%mm2" /* [ ytex | xtex ] += [ -s | s ] */ + "\n\t movd %%esi, %%mm5" /* save esi into mm5 */ + "\n\t movq %%mm2, %%mm3" + "\n\t psrld $16, %%mm3" /* mm3 = [ (ytex>>16) | (xtex>>16) ] */ + "\n\t movd %%mm3, %%eax" /* eax = xtex' */ + + "\n\t psrlq $25, %%mm3" + "\n\t movd %%mm3, %%ecx" /* ecx = ytex' << 7 */ + + "\n\t andl $127, %%eax" + "\n\t andl $16256, %%ecx" + + "\n\t addl %%ecx, %%eax" + "\n\t movd %%mm6, %%esi" /* esi = motif */ + "\n\t xorl %%ecx, %%ecx" + "\n\t movb (%%eax,%%esi), %%cl" + + "\n\t movl %[ifftab], %%eax" + "\n\t movd %%mm5, %%esi" /* restore esi from mm5 */ + "\n\t movd (%%eax,%%ecx,4), %%mm1" /* mm1 = [0|0|0|iff2] */ + + "\n\t punpcklwd %%mm1, %%mm1" + "\n\t punpcklbw %%mm7, %%mm0" + "\n\t punpckldq %%mm1, %%mm1" + "\n\t psrlw $1, %%mm0" + "\n\t psrlw $2, %%mm1" + "\n\t pmullw %%mm1, %%mm0" + "\n\t psrlw $5, %%mm0" + "\n\t packuswb %%mm7, %%mm0" + "\n\t movd %%mm0, %[dest]" + : [dest] "=g"(dest[i].val) + : [src] "g"(src[i].val), [ifftab] "g"(&ifftab[0]) + : "eax", "ecx"); + + i++; + } + } + + __asm__ __volatile__("\n\t emms"); #endif /* VISUAL_ARCH_X86 */ } else { - for (y=info->screen.height;y--;) { - int xtex,ytex; - - xtex = xprime + xi + CONV_MOTIF_W * 0x10000 / 2; - xprime += s; - - ytex = yprime + yi + CONV_MOTIF_W * 0x10000 / 2; - yprime += c; - - - for (x=info->screen.width;x--;) { - - int iff2; - unsigned int f0,f1,f2,f3; - - xtex += c; - ytex -= s; - - iff2 = ifftab[(int)data->conv_motif[(ytex >>16) & CONV_MOTIF_WMASK][(xtex >> 16) & CONV_MOTIF_WMASK]]; - -#define sat(a) ((a)>0xFF?0xFF:(a)) - f0 = src[i].val; - f1 = ((f0 >> R_OFFSET) & 0xFF) * iff2 >> 8; - f2 = ((f0 >> G_OFFSET) & 0xFF) * iff2 >> 8; - f3 = ((f0 >> B_OFFSET) & 0xFF) * iff2 >> 8; - dest[i].val = (sat(f1) << R_OFFSET) | (sat(f2) << G_OFFSET) | (sat(f3) << B_OFFSET); - /* - f0 = (src[i].cop[0] * iff2) >> 8; - f1 = (src[i].cop[1] * iff2) >> 8; - f2 = (src[i].cop[2] * iff2) >> 8; - f3 = (src[i].cop[3] * iff2) >> 8; - - dest[i].cop[0] = (f0 & 0xffffff00) ? 0xff : (unsigned char)f0; - dest[i].cop[1] = (f1 & 0xffffff00) ? 0xff : (unsigned char)f1; - dest[i].cop[2] = (f2 & 0xffffff00) ? 0xff : (unsigned char)f2; - dest[i].cop[3] = (f3 & 0xffffff00) ? 0xff : (unsigned char)f3; - */ - i++; - } - } + for (y = info->screen.height; y--;) { + int xtex, ytex; + + xtex = xprime + xi + CONV_MOTIF_W * 0x10000 / 2; + xprime += s; + + ytex = yprime + yi + CONV_MOTIF_W * 0x10000 / 2; + yprime += c; + + for (x = info->screen.width; x--;) { + + int iff2; + unsigned int f0, f1, f2, f3; + + xtex += c; + ytex -= s; + + iff2 = ifftab[(int)data->conv_motif[(ytex >> 16) & CONV_MOTIF_WMASK] + [(xtex >> 16) & CONV_MOTIF_WMASK]]; + +#define sat(a) ((a) > 0xFF ? 0xFF : (a)) + f0 = src[i].val; + f1 = ((f0 >> R_OFFSET) & 0xFF) * iff2 >> 8; + f2 = ((f0 >> G_OFFSET) & 0xFF) * iff2 >> 8; + f3 = ((f0 >> B_OFFSET) & 0xFF) * iff2 >> 8; + dest[i].val = (sat(f1) << R_OFFSET) | (sat(f2) << G_OFFSET) | + (sat(f3) << B_OFFSET); + /* + f0 = (src[i].cop[0] * iff2) >> 8; + f1 = (src[i].cop[1] * iff2) >> 8; + f2 = (src[i].cop[2] * iff2) >> 8; + f3 = (src[i].cop[3] * iff2) >> 8; + + dest[i].cop[0] = (f0 & 0xffffff00) ? 0xff : (unsigned char)f0; + dest[i].cop[1] = (f1 & 0xffffff00) ? 0xff : (unsigned char)f1; + dest[i].cop[2] = (f2 & 0xffffff00) ? 0xff : (unsigned char)f2; + dest[i].cop[3] = (f3 & 0xffffff00) ? 0xff : (unsigned char)f3; + */ + i++; + } + } } compute_tables(_this, info); } - /*#include static uint64_t GetTick() @@ -275,14 +270,15 @@ static uint64_t GetTick() return x; }*/ +static void convolve_apply(VisualFX *_this, Pixel *src, Pixel *dest, + PluginInfo *info) { -static void convolve_apply(VisualFX *_this, Pixel *src, Pixel *dest, PluginInfo *info) { - - ConvData *data = (ConvData*)_this->fx_data; + ConvData *data = (ConvData *)_this->fx_data; float ff; int iff; - - ff = (FVAL(data->factor_p) * FVAL(data->factor_adj_p) + FVAL(data->light) ) / 100.0f; + + ff = (FVAL(data->factor_p) * FVAL(data->factor_adj_p) + FVAL(data->light)) / + 100.0f; iff = (unsigned int)(ff * 256); { @@ -296,56 +292,61 @@ static void convolve_apply(VisualFX *_this, Pixel *src, Pixel *dest, PluginInfo rotate_param = FVAL(info->sound.last_goom_p); if (rotate_param < 0.0) - rotate_param = 0.0; + rotate_param = 0.0; rotate_param += FVAL(info->sound.goom_power_p); - - rotate_coef = 4.0 + FVAL(info->sound.goom_power_p) * 6.0; + + rotate_coef = 4.0 + FVAL(info->sound.goom_power_p) * 6.0; data->ftheta = (data->ftheta + rotate_coef * sin(rotate_param * 6.3)); - data->theta = ((unsigned int)data->ftheta) % NB_THETA; - data->visibility = (cos(fcycle * 0.001 + 1.5) * sin(fcycle * 0.008) + cos(fcycle * 0.011 + 5.0) - 0.8 + info->sound.speedvar) * 1.5; - if (data->visibility < 0.0) data->visibility = 0.0; + data->theta = ((unsigned int)data->ftheta) % NB_THETA; + data->visibility = + (cos(fcycle * 0.001 + 1.5) * sin(fcycle * 0.008) + + cos(fcycle * 0.011 + 5.0) - 0.8 + info->sound.speedvar) * + 1.5; + if (data->visibility < 0.0) + data->visibility = 0.0; data->factor_p.change_listener(&data->factor_p); } if (data->visibility < 0.01) { - switch (goom_irand(info->gRandom, 300)) - { - case 1: - set_motif(data, CONV_MOTIF1); data->inverse_motif = 1; break; - case 2: - set_motif(data, CONV_MOTIF2); data->inverse_motif = 0; break; + switch (goom_irand(info->gRandom, 300)) { + case 1: + set_motif(data, CONV_MOTIF1); + data->inverse_motif = 1; + break; + case 2: + set_motif(data, CONV_MOTIF2); + data->inverse_motif = 0; + break; } } if ((ff > 0.98f) && (ff < 1.02f)) visual_mem_copy(dest, src, info->screen.size * sizeof(Pixel)); else - create_output_with_brightness(_this,src,dest,info,iff); -/* -// Benching suite... - { - uint64_t before, after; - double timed; - static double stimed = 10000.0; - before = GetTick(); - data->visibility = 1.0; - create_output_with_brightness(_this,src,dest,info,iff); - after = GetTick(); - timed = (double)((after-before) / info->screen.size); - if (timed < stimed) { - stimed = timed; - printf ("CLK = %3.0f CPP\n", stimed); + create_output_with_brightness(_this, src, dest, info, iff); + /* + // Benching suite... + { + uint64_t before, after; + double timed; + static double stimed = 10000.0; + before = GetTick(); + data->visibility = 1.0; + create_output_with_brightness(_this,src,dest,info,iff); + after = GetTick(); + timed = (double)((after-before) / info->screen.size); + if (timed < stimed) { + stimed = timed; + printf ("CLK = %3.0f CPP\n", stimed); + } } - } -*/ + */ } VisualFX convolve_create(void) { - VisualFX vfx = { - .init = convolve_init, - .free = convolve_free, - .apply = convolve_apply, - .fx_data = 0 - }; + VisualFX vfx = {.init = convolve_init, + .free = convolve_free, + .apply = convolve_apply, + .fx_data = 0}; return vfx; } diff --git a/libvisual-plugins/plugins/actor/goom2k4/cpu_info.c b/libvisual-plugins/plugins/actor/goom2k4/cpu_info.c index 14e150e15..d09d681de 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/cpu_info.c +++ b/libvisual-plugins/plugins/actor/goom2k4/cpu_info.c @@ -22,50 +22,51 @@ static unsigned int CPU_FLAVOUR = 0; static unsigned int CPU_NUMBER = 1; static unsigned int CPU_DETECTED = 0; -static void autoset_cpu_info (void) -{ - CPU_DETECTED = 1; - +static void autoset_cpu_info(void) { + CPU_DETECTED = 1; + #ifdef CPU_POWERPC - int result; - size_t size; - - result = 0; - size = 4; - if (sysctlbyname("hw.optional.altivec",&result,&size,NULL,NULL) == 0) - { - if (result != 0) CPU_FLAVOUR |= CPU_OPTION_ALTIVEC; - } - - result = 0; - size = 4; - if (sysctlbyname("hw.optional.64bitops",&result,&size,NULL,NULL) == 0) - { - if (result != 0) CPU_FLAVOUR |= CPU_OPTION_64_BITS; - } - - result = 0; - size = 4; - if (sysctlbyname("hw.ncpu",&result,&size,NULL,NULL) == 0) - { - if (result != 0) CPU_NUMBER = result; - } + int result; + size_t size; + + result = 0; + size = 4; + if (sysctlbyname("hw.optional.altivec", &result, &size, NULL, NULL) == 0) { + if (result != 0) + CPU_FLAVOUR |= CPU_OPTION_ALTIVEC; + } + + result = 0; + size = 4; + if (sysctlbyname("hw.optional.64bitops", &result, &size, NULL, NULL) == 0) { + if (result != 0) + CPU_FLAVOUR |= CPU_OPTION_64_BITS; + } + + result = 0; + size = 4; + if (sysctlbyname("hw.ncpu", &result, &size, NULL, NULL) == 0) { + if (result != 0) + CPU_NUMBER = result; + } #endif /* CPU_POWERPC */ - + #ifdef CPU_X86 - if (mmx_supported()) CPU_FLAVOUR |= CPU_OPTION_MMX; - if (xmmx_supported()) CPU_FLAVOUR |= CPU_OPTION_XMMX; + if (mmx_supported()) + CPU_FLAVOUR |= CPU_OPTION_MMX; + if (xmmx_supported()) + CPU_FLAVOUR |= CPU_OPTION_XMMX; #endif /* CPU_X86 */ } -unsigned int cpu_flavour (void) -{ - if (CPU_DETECTED == 0) autoset_cpu_info(); - return CPU_FLAVOUR; +unsigned int cpu_flavour(void) { + if (CPU_DETECTED == 0) + autoset_cpu_info(); + return CPU_FLAVOUR; } -unsigned int cpu_number (void) -{ - if (CPU_DETECTED == 0) autoset_cpu_info(); - return CPU_NUMBER; +unsigned int cpu_number(void) { + if (CPU_DETECTED == 0) + autoset_cpu_info(); + return CPU_NUMBER; } diff --git a/libvisual-plugins/plugins/actor/goom2k4/cpu_info.h b/libvisual-plugins/plugins/actor/goom2k4/cpu_info.h index 81e66b5f1..5729bf6fd 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/cpu_info.h +++ b/libvisual-plugins/plugins/actor/goom2k4/cpu_info.h @@ -17,18 +17,17 @@ #endif /* Returns the CPU flavour described with the constants below */ -unsigned int cpu_flavour (void); - -#define CPU_OPTION_ALTIVEC 0x1 -#define CPU_OPTION_64_BITS 0x2 -#define CPU_OPTION_MMX 0x4 -#define CPU_OPTION_XMMX 0x8 -#define CPU_OPTION_SSE 0x10 -#define CPU_OPTION_SSE2 0x20 -#define CPU_OPTION_3DNOW 0x40 +unsigned int cpu_flavour(void); +#define CPU_OPTION_ALTIVEC 0x1 +#define CPU_OPTION_64_BITS 0x2 +#define CPU_OPTION_MMX 0x4 +#define CPU_OPTION_XMMX 0x8 +#define CPU_OPTION_SSE 0x10 +#define CPU_OPTION_SSE2 0x20 +#define CPU_OPTION_3DNOW 0x40 /* Returns the CPU number */ -unsigned int cpu_number (void); +unsigned int cpu_number(void); #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/drawmethods.c b/libvisual-plugins/plugins/actor/goom2k4/drawmethods.c index f5cdec4fd..3e51f6981 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/drawmethods.c +++ b/libvisual-plugins/plugins/actor/goom2k4/drawmethods.c @@ -1,33 +1,38 @@ #include "drawmethods.h" -#define DRAWMETHOD_PLUS(_out,_backbuf,_col) \ -{\ - int tra=0,i=0;\ - unsigned char *bra = (unsigned char*)&(_backbuf);\ - unsigned char *dra = (unsigned char*)&(_out);\ - unsigned char *cra = (unsigned char*)&(_col);\ - for (;i<4;i++) {\ - tra = *cra;\ - tra += *bra;\ - if (tra>255) tra=255;\ - *dra = tra;\ - ++dra;++cra;++bra;\ - }\ -} +#define DRAWMETHOD_PLUS(_out, _backbuf, _col) \ + { \ + int tra = 0, i = 0; \ + unsigned char *bra = (unsigned char *)&(_backbuf); \ + unsigned char *dra = (unsigned char *)&(_out); \ + unsigned char *cra = (unsigned char *)&(_col); \ + for (; i < 4; i++) { \ + tra = *cra; \ + tra += *bra; \ + if (tra > 255) \ + tra = 255; \ + *dra = tra; \ + ++dra; \ + ++cra; \ + ++bra; \ + } \ + } + +#define DRAWMETHOD DRAWMETHOD_PLUS(*p, *p, col) -#define DRAWMETHOD DRAWMETHOD_PLUS(*p,*p,col) +void draw_line(Pixel *data, int x1, int y1, int x2, int y2, int col, + int screenx, int screeny) { + int x, y, dx, dy, yy, xx; + Pixel *p; -void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny) -{ - int x, y, dx, dy, yy, xx; - Pixel *p; + if ((y1 < 0) || (y2 < 0) || (x1 < 0) || (x2 < 0) || (y1 >= screeny) || + (y2 >= screeny) || (x1 >= screenx) || (x2 >= screenx)) + return; - if ((y1 < 0) || (y2 < 0) || (x1 < 0) || (x2 < 0) || (y1 >= screeny) || (y2 >= screeny) || (x1 >= screenx) || (x2 >= screenx)) return; - - /* clip to top edge + /* clip to top edge if ((y1 < 0) && (y2 < 0)) return; - + if (y1 < 0) { x1 += (y1 * (x1 - x2)) / (y2 - y1); y1 = 0; @@ -36,8 +41,8 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen x2 += (y2 * (x1 - x2)) / (y2 - y1); y2 = 0; } - - clip to bottom edge + + clip to bottom edge if ((y1 >= screeny) && (y2 >= screeny)) return; if (y1 >= screeny) { @@ -48,7 +53,7 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen x2 -= ((screeny - y2) * (x1 - x2)) / (y2 - y1); y2 = screeny - 1; } - clip to left edge + clip to left edge if ((x1 < 0) && (x2 < 0)) return; if (x1 < 0) { @@ -59,7 +64,7 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen y2 += (x2 * (y1 - y2)) / (x2 - x1); x2 = 0; } - clip to right edge + clip to right edge if ((x1 >= screenx) && (x2 >= screenx)) return; if (x1 >= screenx) { @@ -71,11 +76,11 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen x2 = screenx - 1; } */ - + dx = x2 - x1; dy = y2 - y1; if (x1 > x2) { - int tmp; + int tmp; tmp = x1; x1 = x2; @@ -92,15 +97,14 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen if (y1 < y2) { p = &(data[(screenx * y1) + x1]); for (y = y1; y <= y2; y++) { - DRAWMETHOD; - p += screenx; + DRAWMETHOD; + p += screenx; } - } - else { + } else { p = &(data[(screenx * y2) + x1]); for (y = y2; y <= y1; y++) { - DRAWMETHOD; - p += screenx; + DRAWMETHOD; + p += screenx; } } return; @@ -110,16 +114,15 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen if (x1 < x2) { p = &(data[(screenx * y1) + x1]); for (x = x1; x <= x2; x++) { - DRAWMETHOD; - p++; + DRAWMETHOD; + p++; } return; - } - else { + } else { p = &(data[(screenx * y1) + x2]); for (x = x2; x <= x1; x++) { - DRAWMETHOD; - p++; + DRAWMETHOD; + p++; } return; } @@ -134,14 +137,14 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen dx = ((dx << 16) / dy); x = x1 << 16; for (y = y1; y <= y2; y++) { - xx = x >> 16; - p = &(data[(screenx * y) + xx]); - DRAWMETHOD; - if (xx < (screenx - 1)) { - p++; - /* DRAWMETHOD; */ - } - x += dx; + xx = x >> 16; + p = &(data[(screenx * y) + xx]); + DRAWMETHOD; + if (xx < (screenx - 1)) { + p++; + /* DRAWMETHOD; */ + } + x += dx; } return; } @@ -150,14 +153,14 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen dy = ((dy << 16) / dx); y = y1 << 16; for (x = x1; x <= x2; x++) { - yy = y >> 16; - p = &(data[(screenx * yy) + x]); - DRAWMETHOD; - if (yy < (screeny - 1)) { - p += screeny; - /* DRAWMETHOD; */ - } - y += dy; + yy = y >> 16; + p = &(data[(screenx * yy) + x]); + DRAWMETHOD; + if (yy < (screeny - 1)) { + p += screeny; + /* DRAWMETHOD; */ + } + y += dy; } } } @@ -171,14 +174,14 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen dx = ((dx << 16) / -dy); x = (x1 + 1) << 16; for (y = y1; y >= y2; y--) { - xx = x >> 16; - p = &(data[(screenx * y) + xx]); - DRAWMETHOD; - if (xx < (screenx - 1)) { - p--; - /* DRAWMETHOD; */ - } - x += dx; + xx = x >> 16; + p = &(data[(screenx * y) + xx]); + DRAWMETHOD; + if (xx < (screenx - 1)) { + p--; + /* DRAWMETHOD; */ + } + x += dx; } return; } @@ -187,17 +190,16 @@ void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screen dy = ((dy << 16) / dx); y = y1 << 16; for (x = x1; x <= x2; x++) { - yy = y >> 16; - p = &(data[(screenx * yy) + x]); - DRAWMETHOD; - if (yy < (screeny - 1)) { - p += screeny; - /* DRAWMETHOD; */ - } - y += dy; + yy = y >> 16; + p = &(data[(screenx * yy) + x]); + DRAWMETHOD; + if (yy < (screeny - 1)) { + p += screeny; + /* DRAWMETHOD; */ + } + y += dy; } return; } } } - diff --git a/libvisual-plugins/plugins/actor/goom2k4/drawmethods.h b/libvisual-plugins/plugins/actor/goom2k4/drawmethods.h index 76ad6ca09..adfb53285 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/drawmethods.h +++ b/libvisual-plugins/plugins/actor/goom2k4/drawmethods.h @@ -4,6 +4,7 @@ #include "goom_config.h" #include "goom_graphic.h" -void draw_line (Pixel *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny); +void draw_line(Pixel *data, int x1, int y1, int x2, int y2, int col, + int screenx, int screeny); #endif /* _DRAWMETHODS_H */ diff --git a/libvisual-plugins/plugins/actor/goom2k4/filters.c b/libvisual-plugins/plugins/actor/goom2k4/filters.c index 05efe4878..dfc106331 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/filters.c +++ b/libvisual-plugins/plugins/actor/goom2k4/filters.c @@ -1,16 +1,17 @@ // --- CHUI EN TRAIN DE SUPPRIMER LES EXTERN RESOLX ET C_RESOLY --- /* filter.c version 0.7 -* contient les filtres applicable a un buffer -* creation : 01/10/2000 -* -ajout de sinFilter() -* -ajout de zoomFilter() -* -copie de zoomFilter() en zoomFilterRGB(), gerant les 3 couleurs -* -optimisation de sinFilter (utilisant une table de sin) -* -asm -* -optimisation de la procedure de generation du buffer de transformation -* la vitesse est maintenant comprise dans [0..128] au lieu de [0..100] -*/ + * contient les filtres applicable a un buffer + * creation : 01/10/2000 + * -ajout de sinFilter() + * -ajout de zoomFilter() + * -copie de zoomFilter() en zoomFilterRGB(), gerant les 3 couleurs + * -optimisation de sinFilter (utilisant une table de sin) + * -asm + * -optimisation de la procedure de generation du buffer de transformation + * la vitesse est maintenant comprise dans [0..128] au lieu de + *[0..100] + */ /* #define _DEBUG_PIXEL */ @@ -30,26 +31,27 @@ #include "v3d.h" /* TODO : MOVE THIS AWAY !!! */ -/* jeko: j'ai essayer de le virer, mais si on veut les laisser inline c'est un peu lourdo... */ -static inline void setPixelRGB (PluginInfo *goomInfo, Pixel *buffer, Uint x, Uint y, Color c) -{ - Pixel i; - - i.channels.b = c.b; - i.channels.g = c.v; - i.channels.r = c.r; - *(buffer + (x + y * goomInfo->screen.width)) = i; +/* jeko: j'ai essayer de le virer, mais si on veut les laisser inline c'est un + * peu lourdo... */ +static inline void setPixelRGB(PluginInfo *goomInfo, Pixel *buffer, Uint x, + Uint y, Color c) { + Pixel i; + + i.channels.b = c.b; + i.channels.g = c.v; + i.channels.r = c.r; + *(buffer + (x + y * goomInfo->screen.width)) = i; } -static inline void setPixelRGB_ (Pixel *buffer, Uint x, Color c) -{ - buffer[x].channels.r = c.r; - buffer[x].channels.g = c.v; - buffer[x].channels.b = c.b; +static inline void setPixelRGB_(Pixel *buffer, Uint x, Color c) { + buffer[x].channels.r = c.r; + buffer[x].channels.g = c.v; + buffer[x].channels.b = c.b; } /* UNUSED */ -// static inline void getPixelRGB (PluginInfo *goomInfo, Pixel *buffer, Uint x, Uint y, Color * c) +// static inline void getPixelRGB (PluginInfo *goomInfo, Pixel *buffer, Uint x, +// Uint y, Color * c) // { // Pixel i = *(buffer + (x + y * goomInfo->screen.width)); // c->b = i.channels.b; @@ -57,23 +59,21 @@ static inline void setPixelRGB_ (Pixel *buffer, Uint x, Color c) // c->r = i.channels.r; //} -static inline void getPixelRGB_ (Pixel *buffer, Uint x, Color * c) -{ - Pixel i = *(buffer + x); - c->b = i.channels.b; - c->v = i.channels.g; - c->r = i.channels.r; +static inline void getPixelRGB_(Pixel *buffer, Uint x, Color *c) { + Pixel i = *(buffer + x); + c->b = i.channels.b; + c->v = i.channels.g; + c->r = i.channels.r; } /* END TODO */ - /* DEPRECATED */ // retourne x>>s , en testant le signe de x -//#define ShiftRight(_x,_s) (((_x)<0) ? -(-(_x)>>(_s)) : ((_x)>>(_s))) -//#define EFFECT_DISTORS 4 -//#define EFFECT_DISTORS_SL 2 -//#define INTERLACE_ADD 9 -//#define INTERLACE_AND 0xf +// #define ShiftRight(_x,_s) (((_x)<0) ? -(-(_x)>>(_s)) : ((_x)>>(_s))) +// #define EFFECT_DISTORS 4 +// #define EFFECT_DISTORS_SL 2 +// #define INTERLACE_ADD 9 +// #define INTERLACE_AND 0xf /* END DEPRECATED */ #define BUFFPOINTNB 16 @@ -87,149 +87,146 @@ static inline void getPixelRGB_ (Pixel *buffer, Uint x, Color * c) #define PERTEDEC 4 /* pure c version of the zoom filter */ -static void c_zoom (Pixel *expix1, Pixel *expix2, unsigned int prevX, unsigned int prevY, signed int *brutS, signed int *brutD, int buffratio, int precalCoef[BUFFPOINTNB][BUFFPOINTNB]); +static void c_zoom(Pixel *expix1, Pixel *expix2, unsigned int prevX, + unsigned int prevY, signed int *brutS, signed int *brutD, + int buffratio, int precalCoef[BUFFPOINTNB][BUFFPOINTNB]); /* simple wrapper to give it the same proto than the others */ -void zoom_filter_c (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]) { - c_zoom(src, dest, sizeX, sizeY, brutS, brutD, buffratio, precalCoef); +void zoom_filter_c(int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, + int *brutD, int buffratio, int precalCoef[16][16]) { + c_zoom(src, dest, sizeX, sizeY, brutS, brutD, buffratio, precalCoef); } -static void generatePrecalCoef (int precalCoef[BUFFPOINTNB][BUFFPOINTNB]); - +static void generatePrecalCoef(int precalCoef[BUFFPOINTNB][BUFFPOINTNB]); typedef struct _ZOOM_FILTER_FX_WRAPPER_DATA { - - PluginParam enabled_bp; - PluginParameters params; - - unsigned int *coeffs, *freecoeffs; - - signed int *brutS, *freebrutS; /* source */ - signed int *brutD, *freebrutD; /* dest */ - signed int *brutT, *freebrutT; /* temp (en cours de generation) */ - - uint32_t zoom_width; - - unsigned int prevX, prevY; - - float general_speed; - int reverse; /* reverse the speed */ - char theMode; - int waveEffect; - int hypercosEffect; - int vPlaneEffect; - int hPlaneEffect; - char noisify; - int middleX, middleY; - - int mustInitBuffers; - int interlace_start; - - /** modif by jeko : fixedpoint : buffration = (16:16) (donc 0<=buffration<=2^16) */ - int buffratio; - int *firedec; - - /** modif d'optim by Jeko : precalcul des 4 coefs resultant des 2 pos */ - int precalCoef[BUFFPOINTNB][BUFFPOINTNB]; - - /** calculatePXandPY statics */ - int wave; - int wavesp; - -} ZoomFilterFXWrapperData; + PluginParam enabled_bp; + PluginParameters params; + unsigned int *coeffs, *freecoeffs; + signed int *brutS, *freebrutS; /* source */ + signed int *brutD, *freebrutD; /* dest */ + signed int *brutT, *freebrutT; /* temp (en cours de generation) */ -static inline v2g zoomVector(ZoomFilterFXWrapperData *data, float X, float Y) -{ - v2g vecteur; - float vx, vy; - float sq_dist = X*X + Y*Y; - - /* sx = (X < 0.0f) ? -1.0f : 1.0f; - sy = (Y < 0.0f) ? -1.0f : 1.0f; - */ - float coefVitesse = (1.0f+ data->general_speed) / 50.0f; - - // Effects - - /* Centralized FX */ - - switch (data->theMode) { - case CRYSTAL_BALL_MODE: - coefVitesse -= (sq_dist-0.3f)/15.0f; - break; - case AMULETTE_MODE: - coefVitesse += sq_dist * 3.5f; - break; - case WAVE_MODE: - coefVitesse += sin(sq_dist*20.0f) / 100.0f; - break; - case SCRUNCH_MODE: - coefVitesse += sq_dist / 10.0f; - break; - //case HYPERCOS1_MODE: - break; - //case HYPERCOS2_MODE: - break; - //case YONLY_MODE: - break; - case SPEEDWAY_MODE: - coefVitesse *= 4.0f * Y; - break; - default: - break; - } - - if (coefVitesse < -2.01f) - coefVitesse = -2.01f; - if (coefVitesse > 2.01f) - coefVitesse = 2.01f; - - vx = coefVitesse * X; - vy = coefVitesse * Y; - - /* Amulette 2 */ - // vx = X * tan(dist); - // vy = Y * tan(dist); - - /* Rotate */ - //vx = (X+Y)*0.1; - //vy = (Y-X)*0.1; - - - // Effects adds-on - - /* Noise */ - if (data->noisify) - { - vx += (((float)visual_rand()) / ((float)UINT32_MAX) - 0.5f) / 50.0f; - vy += (((float)visual_rand()) / ((float)UINT32_MAX) - 0.5f) / 50.0f; - } - - /* Hypercos */ - if (data->hypercosEffect) - { - vx += sin(Y*10.0f)/120.0f; - vy += sin(X*10.0f)/120.0f; - } - - /* H Plane */ - if (data->hPlaneEffect) vx += Y * 0.0025f * data->hPlaneEffect; - - /* V Plane */ - if (data->vPlaneEffect) vy += X * 0.0025f * data->vPlaneEffect; - - /* TODO : Water Mode */ - // if (data->waveEffect) - - vecteur.x = vx; - vecteur.y = vy; - - return vecteur; -} + uint32_t zoom_width; + + unsigned int prevX, prevY; + + float general_speed; + int reverse; /* reverse the speed */ + char theMode; + int waveEffect; + int hypercosEffect; + int vPlaneEffect; + int hPlaneEffect; + char noisify; + int middleX, middleY; + + int mustInitBuffers; + int interlace_start; + /** modif by jeko : fixedpoint : buffration = (16:16) (donc + * 0<=buffration<=2^16) */ + int buffratio; + int *firedec; + + /** modif d'optim by Jeko : precalcul des 4 coefs resultant des 2 pos */ + int precalCoef[BUFFPOINTNB][BUFFPOINTNB]; + + /** calculatePXandPY statics */ + int wave; + int wavesp; + +} ZoomFilterFXWrapperData; + +static inline v2g zoomVector(ZoomFilterFXWrapperData *data, float X, float Y) { + v2g vecteur; + float vx, vy; + float sq_dist = X * X + Y * Y; + + /* sx = (X < 0.0f) ? -1.0f : 1.0f; + sy = (Y < 0.0f) ? -1.0f : 1.0f; + */ + float coefVitesse = (1.0f + data->general_speed) / 50.0f; + + // Effects + + /* Centralized FX */ + + switch (data->theMode) { + case CRYSTAL_BALL_MODE: + coefVitesse -= (sq_dist - 0.3f) / 15.0f; + break; + case AMULETTE_MODE: + coefVitesse += sq_dist * 3.5f; + break; + case WAVE_MODE: + coefVitesse += sin(sq_dist * 20.0f) / 100.0f; + break; + case SCRUNCH_MODE: + coefVitesse += sq_dist / 10.0f; + break; + // case HYPERCOS1_MODE: + break; + // case HYPERCOS2_MODE: + break; + // case YONLY_MODE: + break; + case SPEEDWAY_MODE: + coefVitesse *= 4.0f * Y; + break; + default: + break; + } + + if (coefVitesse < -2.01f) + coefVitesse = -2.01f; + if (coefVitesse > 2.01f) + coefVitesse = 2.01f; + + vx = coefVitesse * X; + vy = coefVitesse * Y; + + /* Amulette 2 */ + // vx = X * tan(dist); + // vy = Y * tan(dist); + + /* Rotate */ + // vx = (X+Y)*0.1; + // vy = (Y-X)*0.1; + + // Effects adds-on + + /* Noise */ + if (data->noisify) { + vx += (((float)visual_rand()) / ((float)UINT32_MAX) - 0.5f) / 50.0f; + vy += (((float)visual_rand()) / ((float)UINT32_MAX) - 0.5f) / 50.0f; + } + + /* Hypercos */ + if (data->hypercosEffect) { + vx += sin(Y * 10.0f) / 120.0f; + vy += sin(X * 10.0f) / 120.0f; + } + + /* H Plane */ + if (data->hPlaneEffect) + vx += Y * 0.0025f * data->hPlaneEffect; + + /* V Plane */ + if (data->vPlaneEffect) + vy += X * 0.0025f * data->vPlaneEffect; + + /* TODO : Water Mode */ + // if (data->waveEffect) + + vecteur.x = vx; + vecteur.y = vy; + + return vecteur; +} /* * Makes a stripe of a transform buffer (brutT) @@ -238,533 +235,541 @@ static inline v2g zoomVector(ZoomFilterFXWrapperData *data, float X, float Y) * Translation (-data->middleX, -data->middleY) * Homothetie (Center : 0,0 Coeff : 2/data->prevX) */ -static void makeZoomBufferStripe(ZoomFilterFXWrapperData * data, int INTERLACE_INCR) -{ - // Position of the pixel to compute in pixmap coordinates - Uint x, y; - // Where (verticaly) to stop generating the buffer stripe - int maxEnd = (data->interlace_start + INTERLACE_INCR); - // Ratio from pixmap to normalized coordinates - float ratio = 2.0f/((float)data->prevX); - // Ratio from normalized to virtual pixmap coordinates - float inv_ratio = BUFFPOINTNBF/ratio; - float min = ratio/BUFFPOINTNBF; - // Y position of the pixel to compute in normalized coordinates - float Y = ((float)(data->interlace_start - data->middleY)) * ratio; - - maxEnd = data->prevY; - if (maxEnd > (data->interlace_start + INTERLACE_INCR)) - maxEnd = (data->interlace_start + INTERLACE_INCR); - - for (y = data->interlace_start; (y < data->prevY) && ((signed int)yprevX * 2; - float X = - ((float)data->middleX) * ratio; - for (x = 0; x < data->prevX; x++) - { - v2g vector = zoomVector (data, X, Y); - - /* Finish and avoid null displacement */ - if (fabs(vector.x) < min) vector.x = (vector.x < 0.0f) ? -min : min; - if (fabs(vector.y) < min) vector.y = (vector.y < 0.0f) ? -min : min; - - data->brutT[premul_y_prevX] = ((int)((X-vector.x)*inv_ratio)+((int)(data->middleX*BUFFPOINTNB))); - data->brutT[premul_y_prevX+1] = ((int)((Y-vector.y)*inv_ratio)+((int)(data->middleY*BUFFPOINTNB))); - premul_y_prevX += 2; - X += ratio; - } - Y += ratio; +static void makeZoomBufferStripe(ZoomFilterFXWrapperData *data, + int INTERLACE_INCR) { + // Position of the pixel to compute in pixmap coordinates + Uint x, y; + // Where (verticaly) to stop generating the buffer stripe + int maxEnd = (data->interlace_start + INTERLACE_INCR); + // Ratio from pixmap to normalized coordinates + float ratio = 2.0f / ((float)data->prevX); + // Ratio from normalized to virtual pixmap coordinates + float inv_ratio = BUFFPOINTNBF / ratio; + float min = ratio / BUFFPOINTNBF; + // Y position of the pixel to compute in normalized coordinates + float Y = ((float)(data->interlace_start - data->middleY)) * ratio; + + maxEnd = data->prevY; + if (maxEnd > (data->interlace_start + INTERLACE_INCR)) + maxEnd = (data->interlace_start + INTERLACE_INCR); + + for (y = data->interlace_start; (y < data->prevY) && ((signed int)y < maxEnd); + y++) { + Uint premul_y_prevX = y * data->prevX * 2; + float X = -((float)data->middleX) * ratio; + for (x = 0; x < data->prevX; x++) { + v2g vector = zoomVector(data, X, Y); + + /* Finish and avoid null displacement */ + if (fabs(vector.x) < min) + vector.x = (vector.x < 0.0f) ? -min : min; + if (fabs(vector.y) < min) + vector.y = (vector.y < 0.0f) ? -min : min; + + data->brutT[premul_y_prevX] = ((int)((X - vector.x) * inv_ratio) + + ((int)(data->middleX * BUFFPOINTNB))); + data->brutT[premul_y_prevX + 1] = ((int)((Y - vector.y) * inv_ratio) + + ((int)(data->middleY * BUFFPOINTNB))); + premul_y_prevX += 2; + X += ratio; } - data->interlace_start += INTERLACE_INCR; - if (y >= data->prevY-1) data->interlace_start = -1; + Y += ratio; + } + data->interlace_start += INTERLACE_INCR; + if (y >= data->prevY - 1) + data->interlace_start = -1; } - /* * calculer px et py en fonction de x,y,middleX,middleY et theMode * px et py indique la nouvelle position (en sqrtperte ieme de pixel) * (valeur * 16) - - inline void calculatePXandPY (PluginInfo *goomInfo, ZoomFilterFXWrapperData *data, int x, int y, int *px, int *py) + + inline void calculatePXandPY (PluginInfo *goomInfo, ZoomFilterFXWrapperData + *data, int x, int y, int *px, int *py) { if (data->theMode == WATER_MODE) { int yy; - - yy = y + goom_irand(goomInfo->gRandom, 4) - goom_irand(goomInfo->gRandom, 4) + data->wave / 10; - if (yy < 0) - yy = 0; - if (yy >= (signed int)goomInfo->screen.height) - yy = goomInfo->screen.height - 1; - + + yy = y + goom_irand(goomInfo->gRandom, 4) - + goom_irand(goomInfo->gRandom, 4) + data->wave / 10; if (yy < 0) yy = 0; if (yy + >= (signed int)goomInfo->screen.height) yy = goomInfo->screen.height - 1; + *px = (x << 4) + data->firedec[yy] + (data->wave / 10); *py = (y << 4) + 132 - ((data->vitesse < 131) ? data->vitesse : 130); - - data->wavesp += goom_irand(goomInfo->gRandom, 3) - goom_irand(goomInfo->gRandom, 3); - if (data->wave < -10) - data->wavesp += 2; - if (data->wave > 10) - data->wavesp -= 2; - data->wave += (data->wavesp / 10) + goom_irand(goomInfo->gRandom, 3) - goom_irand(goomInfo->gRandom, 3); - if (data->wavesp > 100) - data->wavesp = (data->wavesp * 9) / 10; + + data->wavesp += goom_irand(goomInfo->gRandom, 3) - + goom_irand(goomInfo->gRandom, 3); if (data->wave < -10) data->wavesp += 2; if + (data->wave > 10) data->wavesp -= 2; data->wave += (data->wavesp / 10) + + goom_irand(goomInfo->gRandom, 3) - goom_irand(goomInfo->gRandom, 3); if + (data->wavesp > 100) data->wavesp = (data->wavesp * 9) / 10; } else { int dist = 0, vx9, vy9; int vx, vy; int ppx, ppy; int fvitesse = data->vitesse << 4; - + if (data->noisify) { - x += goom_irand(goomInfo->gRandom, data->noisify) - goom_irand(goomInfo->gRandom, data->noisify); - y += goom_irand(goomInfo->gRandom, data->noisify) - goom_irand(goomInfo->gRandom, data->noisify); + x += goom_irand(goomInfo->gRandom, data->noisify) - + goom_irand(goomInfo->gRandom, data->noisify); y += + goom_irand(goomInfo->gRandom, data->noisify) - goom_irand(goomInfo->gRandom, + data->noisify); } vx = (x - data->middleX) << 9; vy = (y - data->middleY) << 9; - + if (data->hPlaneEffect) vx += data->hPlaneEffect * (y - data->middleY); - + if (data->vPlaneEffect) vy += data->vPlaneEffect * (x - data->middleX); - + if (data->waveEffect) { fvitesse *= 1024 + ShiftRight (goomInfo->sintable - [(unsigned short) (dist * 0xffff + EFFECT_DISTORS)], 6); - fvitesse /= 1024; + [(unsigned short) (dist * 0xffff + EFFECT_DISTORS)], + 6); fvitesse /= 1024; } - + if (data->hypercosEffect) { vx += ShiftRight (goomInfo->sintable[(-vy + dist) & 0xffff], 1); vy += ShiftRight (goomInfo->sintable[(vx + dist) & 0xffff], 1); } - + vx9 = ShiftRight (vx, 9); vy9 = ShiftRight (vy, 9); dist = vx9 * vx9 + vy9 * vy9; - + switch (data->theMode) { case WAVE_MODE: fvitesse *= 1024 + ShiftRight (goomInfo->sintable - [(unsigned short) (dist * 0xffff * EFFECT_DISTORS)], 6); - fvitesse>>=10; - break; - case CRYSTAL_BALL_MODE: - fvitesse += (dist >> (10-EFFECT_DISTORS_SL)); - break; - case AMULETTE_MODE: - fvitesse -= (dist >> (4 - EFFECT_DISTORS_SL)); - break; - case SCRUNCH_MODE: - fvitesse -= (dist >> (10 - EFFECT_DISTORS_SL)); - break; - case HYPERCOS1_MODE: - vx = vx + ShiftRight (goomInfo->sintable[(-vy + dist) & 0xffff], 1); - vy = vy + ShiftRight (goomInfo->sintable[(vx + dist) & 0xffff], 1); - break; - case HYPERCOS2_MODE: - vx = - vx + ShiftRight (goomInfo->sintable[(-ShiftRight (vy, 1) + dist) & 0xffff], 0); - vy = - vy + ShiftRight (goomInfo->sintable[(ShiftRight (vx, 1) + dist) & 0xffff], 0); - fvitesse = 128 << 4; - break; - case YONLY_MODE: - fvitesse *= 1024 + ShiftRight (goomInfo->sintable[vy & 0xffff], 6); - fvitesse >>= 10; + [(unsigned short) (dist * 0xffff * + EFFECT_DISTORS)], 6); fvitesse>>=10; break; case CRYSTAL_BALL_MODE: fvitesse += + (dist >> (10-EFFECT_DISTORS_SL)); break; case AMULETTE_MODE: fvitesse -= (dist + >> (4 - EFFECT_DISTORS_SL)); break; case SCRUNCH_MODE: fvitesse -= (dist >> (10 + - EFFECT_DISTORS_SL)); break; case HYPERCOS1_MODE: vx = vx + ShiftRight + (goomInfo->sintable[(-vy + dist) & 0xffff], 1); vy = vy + ShiftRight + (goomInfo->sintable[(vx + dist) & 0xffff], 1); break; case HYPERCOS2_MODE: vx = + vx + ShiftRight (goomInfo->sintable[(-ShiftRight (vy, 1) + + dist) & 0xffff], 0); vy = vy + ShiftRight (goomInfo->sintable[(ShiftRight (vx, + 1) + dist) & 0xffff], 0); fvitesse = 128 << 4; break; case YONLY_MODE: fvitesse + *= 1024 + ShiftRight (goomInfo->sintable[vy & 0xffff], 6); fvitesse >>= 10; break; case SPEEDWAY_MODE: fvitesse -= (ShiftRight(vy,10-EFFECT_DISTORS_SL)); break; } - + if (fvitesse < -3024) fvitesse = -3024; - - if (vx < 0) // pb avec decalage sur nb negatif - ppx = -(-(vx * fvitesse) >> 16); - // 16 = 9 + 7 (7 = nb chiffre virgule de vitesse * (v = 128 => immobile) - // * * * * * 9 = nb chiffre virgule de vx) + + if (vx < 0) + // pb avec decalage sur nb negatif ppx = -(-(vx * fvitesse) >> 16); + // 16 = 9 + 7 (7 = nb chiffre virgule de vitesse * (v = 128 => + immobile) + // * * * * * 9 = nb chiffre virgule de vx) else ppx = ((vx * fvitesse) >> 16); - + if (vy < 0) ppy = -(-(vy * fvitesse) >> 16); else ppy = ((vy * fvitesse) >> 16); - + *px = (data->middleX << 4) + ppx; *py = (data->middleY << 4) + ppy; } } */ +static void c_zoom(Pixel *expix1, Pixel *expix2, unsigned int prevX, + unsigned int prevY, signed int *brutS, signed int *brutD, + int buffratio, int precalCoef[16][16]) { + int myPos, myPos2; + Color couleur; + + unsigned int ax = (prevX - 1) << PERTEDEC, ay = (prevY - 1) << PERTEDEC; + + int bufsize = prevX * prevY * 2; + int bufwidth = prevX; + + expix1[0].val = expix1[prevX - 1].val = expix1[prevX * prevY - 1].val = + expix1[prevX * prevY - prevX].val = 0; + for (myPos = 0; myPos < bufsize; myPos += 2) { + Color col1, col2, col3, col4; + int c1, c2, c3, c4, px, py; + int pos; + int coeffs; -static void c_zoom (Pixel *expix1, Pixel *expix2, unsigned int prevX, unsigned int prevY, signed int *brutS, signed int *brutD, - int buffratio, int precalCoef[16][16]) -{ - int myPos, myPos2; - Color couleur; - - unsigned int ax = (prevX - 1) << PERTEDEC, ay = (prevY - 1) << PERTEDEC; - - int bufsize = prevX * prevY * 2; - int bufwidth = prevX; - - expix1[0].val=expix1[prevX-1].val=expix1[prevX*prevY-1].val=expix1[prevX*prevY-prevX].val=0; - - for (myPos = 0; myPos < bufsize; myPos += 2) { - Color col1, col2, col3, col4; - int c1, c2, c3, c4, px, py; - int pos; - int coeffs; - - int brutSmypos = brutS[myPos]; - - myPos2 = myPos + 1; - - px = brutSmypos + (((brutD[myPos] - brutSmypos) * buffratio) >> BUFFPOINTNB); - brutSmypos = brutS[myPos2]; - py = brutSmypos + (((brutD[myPos2] - brutSmypos) * buffratio) >> BUFFPOINTNB); - - if ((py >= ay) || (px >= ax)) { - pos = coeffs = 0; - } else { - pos = ((px >> PERTEDEC) + prevX * (py >> PERTEDEC)); - /* coef en modulo 15 */ - coeffs = precalCoef[px & PERTEMASK][py & PERTEMASK]; - } - getPixelRGB_ (expix1, pos, &col1); - getPixelRGB_ (expix1, pos + 1, &col2); - getPixelRGB_ (expix1, pos + bufwidth, &col3); - getPixelRGB_ (expix1, pos + bufwidth + 1, &col4); - - c1 = coeffs; - c2 = (c1 >> 8) & 0xFF; - c3 = (c1 >> 16) & 0xFF; - c4 = (c1 >> 24) & 0xFF; - c1 = c1 & 0xff; - - couleur.r = col1.r * c1 + col2.r * c2 + col3.r * c3 + col4.r * c4; - if (couleur.r > 5) - couleur.r -= 5; - couleur.r >>= 8; - - couleur.v = col1.v * c1 + col2.v * c2 + col3.v * c3 + col4.v * c4; - if (couleur.v > 5) - couleur.v -= 5; - couleur.v >>= 8; - - couleur.b = col1.b * c1 + col2.b * c2 + col3.b * c3 + col4.b * c4; - if (couleur.b > 5) - couleur.b -= 5; - couleur.b >>= 8; - - setPixelRGB_ (expix2, myPos >> 1, couleur); + int brutSmypos = brutS[myPos]; + + myPos2 = myPos + 1; + + px = + brutSmypos + (((brutD[myPos] - brutSmypos) * buffratio) >> BUFFPOINTNB); + brutSmypos = brutS[myPos2]; + py = brutSmypos + + (((brutD[myPos2] - brutSmypos) * buffratio) >> BUFFPOINTNB); + + if ((py >= ay) || (px >= ax)) { + pos = coeffs = 0; + } else { + pos = ((px >> PERTEDEC) + prevX * (py >> PERTEDEC)); + /* coef en modulo 15 */ + coeffs = precalCoef[px & PERTEMASK][py & PERTEMASK]; } + getPixelRGB_(expix1, pos, &col1); + getPixelRGB_(expix1, pos + 1, &col2); + getPixelRGB_(expix1, pos + bufwidth, &col3); + getPixelRGB_(expix1, pos + bufwidth + 1, &col4); + + c1 = coeffs; + c2 = (c1 >> 8) & 0xFF; + c3 = (c1 >> 16) & 0xFF; + c4 = (c1 >> 24) & 0xFF; + c1 = c1 & 0xff; + + couleur.r = col1.r * c1 + col2.r * c2 + col3.r * c3 + col4.r * c4; + if (couleur.r > 5) + couleur.r -= 5; + couleur.r >>= 8; + + couleur.v = col1.v * c1 + col2.v * c2 + col3.v * c3 + col4.v * c4; + if (couleur.v > 5) + couleur.v -= 5; + couleur.v >>= 8; + + couleur.b = col1.b * c1 + col2.b * c2 + col3.b * c3 + col4.b * c4; + if (couleur.b > 5) + couleur.b -= 5; + couleur.b >>= 8; + + setPixelRGB_(expix2, myPos >> 1, couleur); + } } /** generate the water fx horizontal direction buffer */ -static void generateTheWaterFXHorizontalDirectionBuffer(PluginInfo *goomInfo, ZoomFilterFXWrapperData *data) { - - int loopv; - int decc = goom_irand(goomInfo->gRandom, 8) - 4; - int spdc = goom_irand(goomInfo->gRandom, 8) - 4; - int accel = goom_irand(goomInfo->gRandom, 8) - 4; - - for (loopv = data->prevY; loopv != 0;) { - - loopv--; - data->firedec[loopv] = decc; - decc += spdc / 10; - spdc += goom_irand(goomInfo->gRandom, 3) - goom_irand(goomInfo->gRandom, 3); - - if (decc > 4) - spdc -= 1; - if (decc < -4) - spdc += 1; - - if (spdc > 30) - spdc = spdc - goom_irand(goomInfo->gRandom, 3) + accel / 10; - if (spdc < -30) - spdc = spdc + goom_irand(goomInfo->gRandom, 3) + accel / 10; - - if (decc > 8 && spdc > 1) - spdc -= goom_irand(goomInfo->gRandom, 3) - 2; - - if (decc < -8 && spdc < -1) - spdc += goom_irand(goomInfo->gRandom, 3) + 2; - - if (decc > 8 || decc < -8) - decc = decc * 8 / 9; - - accel += goom_irand(goomInfo->gRandom, 2) - goom_irand(goomInfo->gRandom, 2); - if (accel > 20) - accel -= 2; - if (accel < -20) - accel += 2; - } +static void +generateTheWaterFXHorizontalDirectionBuffer(PluginInfo *goomInfo, + ZoomFilterFXWrapperData *data) { + + int loopv; + int decc = goom_irand(goomInfo->gRandom, 8) - 4; + int spdc = goom_irand(goomInfo->gRandom, 8) - 4; + int accel = goom_irand(goomInfo->gRandom, 8) - 4; + + for (loopv = data->prevY; loopv != 0;) { + + loopv--; + data->firedec[loopv] = decc; + decc += spdc / 10; + spdc += goom_irand(goomInfo->gRandom, 3) - goom_irand(goomInfo->gRandom, 3); + + if (decc > 4) + spdc -= 1; + if (decc < -4) + spdc += 1; + + if (spdc > 30) + spdc = spdc - goom_irand(goomInfo->gRandom, 3) + accel / 10; + if (spdc < -30) + spdc = spdc + goom_irand(goomInfo->gRandom, 3) + accel / 10; + + if (decc > 8 && spdc > 1) + spdc -= goom_irand(goomInfo->gRandom, 3) - 2; + + if (decc < -8 && spdc < -1) + spdc += goom_irand(goomInfo->gRandom, 3) + 2; + + if (decc > 8 || decc < -8) + decc = decc * 8 / 9; + + accel += + goom_irand(goomInfo->gRandom, 2) - goom_irand(goomInfo->gRandom, 2); + if (accel > 20) + accel -= 2; + if (accel < -20) + accel += 2; + } } - - /** -* Main work for the dynamic displacement map. - * + * Main work for the dynamic displacement map. + * * Reads data from pix1, write to pix2. * * Useful datas for this FX are stored in ZoomFilterData. - * - * If you think that this is a strange function name, let me say that a long time ago, - * there has been a slow version and a gray-level only one. Then came these function, - * fast and workin in RGB colorspace ! nice but it only was applying a zoom to the image. - * So that is why you have this name, for the nostalgy of the first days of goom - * when it was just a tiny program writen in Turbo Pascal on my i486... + * + * If you think that this is a strange function name, let me say that a long + * time ago, there has been a slow version and a gray-level only one. Then came + * these function, fast and workin in RGB colorspace ! nice but it only was + * applying a zoom to the image. So that is why you have this name, for the + * nostalgy of the first days of goom when it was just a tiny program writen in + * Turbo Pascal on my i486... */ -void zoomFilterFastRGB (PluginInfo *goomInfo, Pixel * pix1, Pixel * pix2, ZoomFilterData * zf, Uint resx, Uint resy, int switchIncr, float switchMult) -{ - Uint x, y; - - ZoomFilterFXWrapperData *data = (ZoomFilterFXWrapperData*)goomInfo->zoomFilter_fx.fx_data; - - if (!BVAL(data->enabled_bp)) return; - - /** changement de taille **/ - if ((data->prevX != resx) || (data->prevY != resy)) { - data->prevX = resx; - data->prevY = resy; - - if (data->brutS) free (data->freebrutS); - data->brutS = 0; - if (data->brutD) free (data->freebrutD); - data->brutD = 0; - if (data->brutT) free (data->freebrutT); - data->brutT = 0; - - data->middleX = resx / 2; - data->middleY = resy / 2; - data->mustInitBuffers = 1; - if (data->firedec) free (data->firedec); - data->firedec = 0; - } - - if (data->interlace_start != -2) - zf = NULL; - - /** changement de config **/ - if (zf) { - data->reverse = zf->reverse; - data->general_speed = (float)(zf->vitesse-128)/128.0f; - if (data->reverse) data->general_speed = -data->general_speed; - data->middleX = zf->middleX; - data->middleY = zf->middleY; - data->theMode = zf->mode; - data->hPlaneEffect = zf->hPlaneEffect; - data->vPlaneEffect = zf->vPlaneEffect; - data->waveEffect = zf->waveEffect; - data->hypercosEffect = zf->hypercosEffect; - data->noisify = zf->noisify; - data->interlace_start = 0; - } - - - if (data->mustInitBuffers) { - - data->mustInitBuffers = 0; - data->freebrutS = (signed int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int)); - data->brutS = (int32_t *) ((1 + ((uintptr_t) (data->freebrutS)) / 128) * 128); - - data->freebrutD = (signed int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int)); - data->brutD = (int32_t *) ((1 + ((uintptr_t) (data->freebrutD)) / 128) * 128); - - data->freebrutT = (signed int *) calloc (resx * resy * 2 + 128, sizeof(unsigned int)); - data->brutT = (int32_t *) ((1 + ((uintptr_t) (data->freebrutT)) / 128) * 128); - - data->buffratio = 0; - - data->firedec = (int *) malloc (data->prevY * sizeof (int)); - generateTheWaterFXHorizontalDirectionBuffer(goomInfo, data); - - data->interlace_start = 0; - makeZoomBufferStripe(data,resy); - - /* Copy the data from temp to dest and source */ - visual_mem_copy(data->brutS,data->brutT,resx * resy * 2 * sizeof(int)); - visual_mem_copy(data->brutD,data->brutT,resx * resy * 2 * sizeof(int)); - } - - /* generation du buffer de trans */ - if (data->interlace_start == -1) { - - /* sauvegarde de l'etat actuel dans la nouvelle source - * TODO: write that in MMX (has been done in previous version, but did not follow some new fonctionnalities) */ - y = data->prevX * data->prevY * 2; - for (x = 0; x < y; x += 2) { - int brutSmypos = data->brutS[x]; - int x2 = x + 1; - - data->brutS[x] = brutSmypos + (((data->brutD[x] - brutSmypos) * data->buffratio) >> BUFFPOINTNB); - brutSmypos = data->brutS[x2]; - data->brutS[x2] = brutSmypos + (((data->brutD[x2] - brutSmypos) * data->buffratio) >> BUFFPOINTNB); - } - data->buffratio = 0; - } - - if (data->interlace_start == -1) { - signed int * tmp; - tmp = data->brutD; - data->brutD=data->brutT; - data->brutT=tmp; - tmp = data->freebrutD; - data->freebrutD=data->freebrutT; - data->freebrutT=tmp; - data->interlace_start = -2; - } - - if (data->interlace_start>=0) - { - /* creation de la nouvelle destination */ - makeZoomBufferStripe(data,resy/16); - } - - if (switchIncr != 0) { - data->buffratio += switchIncr; - if (data->buffratio > BUFFPOINTMASK) - data->buffratio = BUFFPOINTMASK; - } - - if (switchMult != 1.0f) { - data->buffratio = (int) ((float) BUFFPOINTMASK * (1.0f - switchMult) + - (float) data->buffratio * switchMult); - } - - data->zoom_width = data->prevX; - - goomInfo->methods.zoom_filter (data->prevX, data->prevY, pix1, pix2, - data->brutS, data->brutD, data->buffratio, data->precalCoef); -} +void zoomFilterFastRGB(PluginInfo *goomInfo, Pixel *pix1, Pixel *pix2, + ZoomFilterData *zf, Uint resx, Uint resy, int switchIncr, + float switchMult) { + Uint x, y; -static void generatePrecalCoef (int precalCoef[16][16]) -{ - int coefh, coefv; - - for (coefh = 0; coefh < 16; coefh++) { - for (coefv = 0; coefv < 16; coefv++) { - - int i; - int diffcoeffh; - int diffcoeffv; - - diffcoeffh = sqrtperte - coefh; - diffcoeffv = sqrtperte - coefv; - - if (!(coefh || coefv)) { - i = 255; - } - else { - int i1, i2, i3, i4; - - i1 = diffcoeffh * diffcoeffv; - i2 = coefh * diffcoeffv; - i3 = diffcoeffh * coefv; - i4 = coefh * coefv; - - // TODO: faire mieux... - if (i1) i1--; - if (i2) i2--; - if (i3) i3--; - if (i4) i4--; - - i = (i1) | (i2 << 8) | (i3 << 16) | (i4 << 24); - } - precalCoef[coefh][coefv] = i; - } - } -} + ZoomFilterFXWrapperData *data = + (ZoomFilterFXWrapperData *)goomInfo->zoomFilter_fx.fx_data; -/* VisualFX Wrapper */ + if (!BVAL(data->enabled_bp)) + return; + + /** changement de taille **/ + if ((data->prevX != resx) || (data->prevY != resy)) { + data->prevX = resx; + data->prevY = resy; -static void zoomFilterVisualFXWrapper_init (struct _VISUAL_FX *_this, PluginInfo *info) -{ - ZoomFilterFXWrapperData *data = (ZoomFilterFXWrapperData*)malloc(sizeof(ZoomFilterFXWrapperData)); - - data->coeffs = 0; - data->freecoeffs = 0; + if (data->brutS) + free(data->freebrutS); data->brutS = 0; - data->freebrutS = 0; + if (data->brutD) + free(data->freebrutD); data->brutD = 0; - data->freebrutD = 0; + if (data->brutT) + free(data->freebrutT); data->brutT = 0; - data->freebrutT = 0; - data->prevX = 0; - data->prevY = 0; - + + data->middleX = resx / 2; + data->middleY = resy / 2; data->mustInitBuffers = 1; - data->interlace_start = -2; - - data->general_speed = 0.0f; - data->reverse = 0; - data->theMode = AMULETTE_MODE; - data->waveEffect = 0; - data->hypercosEffect = 0; - data->vPlaneEffect = 0; - data->hPlaneEffect = 0; - data->noisify = 2; - - /** modif by jeko : fixedpoint : buffration = (16:16) (donc 0<=buffration<=2^16) */ - data->buffratio = 0; + if (data->firedec) + free(data->firedec); data->firedec = 0; - - data->wave = data->wavesp = 0; - - data->enabled_bp = secure_b_param("Enabled", 1); - - data->params = plugin_parameters ("Zoom Filter", 1); - data->params.params[0] = &data->enabled_bp; - - _this->params = &data->params; - _this->fx_data = (void*)data; - - /** modif d'optim by Jeko : precalcul des 4 coefs resultant des 2 pos */ - generatePrecalCoef(data->precalCoef); + } + + if (data->interlace_start != -2) + zf = NULL; + + /** changement de config **/ + if (zf) { + data->reverse = zf->reverse; + data->general_speed = (float)(zf->vitesse - 128) / 128.0f; + if (data->reverse) + data->general_speed = -data->general_speed; + data->middleX = zf->middleX; + data->middleY = zf->middleY; + data->theMode = zf->mode; + data->hPlaneEffect = zf->hPlaneEffect; + data->vPlaneEffect = zf->vPlaneEffect; + data->waveEffect = zf->waveEffect; + data->hypercosEffect = zf->hypercosEffect; + data->noisify = zf->noisify; + data->interlace_start = 0; + } + + if (data->mustInitBuffers) { + + data->mustInitBuffers = 0; + data->freebrutS = + (signed int *)calloc(resx * resy * 2 + 128, sizeof(unsigned int)); + data->brutS = (int32_t *)((1 + ((uintptr_t)(data->freebrutS)) / 128) * 128); + + data->freebrutD = + (signed int *)calloc(resx * resy * 2 + 128, sizeof(unsigned int)); + data->brutD = (int32_t *)((1 + ((uintptr_t)(data->freebrutD)) / 128) * 128); + + data->freebrutT = + (signed int *)calloc(resx * resy * 2 + 128, sizeof(unsigned int)); + data->brutT = (int32_t *)((1 + ((uintptr_t)(data->freebrutT)) / 128) * 128); + + data->buffratio = 0; + + data->firedec = (int *)malloc(data->prevY * sizeof(int)); + generateTheWaterFXHorizontalDirectionBuffer(goomInfo, data); + + data->interlace_start = 0; + makeZoomBufferStripe(data, resy); + + /* Copy the data from temp to dest and source */ + visual_mem_copy(data->brutS, data->brutT, resx * resy * 2 * sizeof(int)); + visual_mem_copy(data->brutD, data->brutT, resx * resy * 2 * sizeof(int)); + } + + /* generation du buffer de trans */ + if (data->interlace_start == -1) { + + /* sauvegarde de l'etat actuel dans la nouvelle source + * TODO: write that in MMX (has been done in previous version, but did not + * follow some new fonctionnalities) */ + y = data->prevX * data->prevY * 2; + for (x = 0; x < y; x += 2) { + int brutSmypos = data->brutS[x]; + int x2 = x + 1; + + data->brutS[x] = + brutSmypos + + (((data->brutD[x] - brutSmypos) * data->buffratio) >> BUFFPOINTNB); + brutSmypos = data->brutS[x2]; + data->brutS[x2] = + brutSmypos + + (((data->brutD[x2] - brutSmypos) * data->buffratio) >> BUFFPOINTNB); + } + data->buffratio = 0; + } + + if (data->interlace_start == -1) { + signed int *tmp; + tmp = data->brutD; + data->brutD = data->brutT; + data->brutT = tmp; + tmp = data->freebrutD; + data->freebrutD = data->freebrutT; + data->freebrutT = tmp; + data->interlace_start = -2; + } + + if (data->interlace_start >= 0) { + /* creation de la nouvelle destination */ + makeZoomBufferStripe(data, resy / 16); + } + + if (switchIncr != 0) { + data->buffratio += switchIncr; + if (data->buffratio > BUFFPOINTMASK) + data->buffratio = BUFFPOINTMASK; + } + + if (switchMult != 1.0f) { + data->buffratio = (int)((float)BUFFPOINTMASK * (1.0f - switchMult) + + (float)data->buffratio * switchMult); + } + + data->zoom_width = data->prevX; + + goomInfo->methods.zoom_filter(data->prevX, data->prevY, pix1, pix2, + data->brutS, data->brutD, data->buffratio, + data->precalCoef); } -static void zoomFilterVisualFXWrapper_free (struct _VISUAL_FX *_this) -{ - free(_this->fx_data); +static void generatePrecalCoef(int precalCoef[16][16]) { + int coefh, coefv; + + for (coefh = 0; coefh < 16; coefh++) { + for (coefv = 0; coefv < 16; coefv++) { + + int i; + int diffcoeffh; + int diffcoeffv; + + diffcoeffh = sqrtperte - coefh; + diffcoeffv = sqrtperte - coefv; + + if (!(coefh || coefv)) { + i = 255; + } else { + int i1, i2, i3, i4; + + i1 = diffcoeffh * diffcoeffv; + i2 = coefh * diffcoeffv; + i3 = diffcoeffh * coefv; + i4 = coefh * coefv; + + // TODO: faire mieux... + if (i1) + i1--; + if (i2) + i2--; + if (i3) + i3--; + if (i4) + i4--; + + i = (i1) | (i2 << 8) | (i3 << 16) | (i4 << 24); + } + precalCoef[coefh][coefv] = i; + } + } } -static void zoomFilterVisualFXWrapper_apply (struct _VISUAL_FX *_this, Pixel *src, Pixel *dest, PluginInfo *info) -{ +/* VisualFX Wrapper */ + +static void zoomFilterVisualFXWrapper_init(struct _VISUAL_FX *_this, + PluginInfo *info) { + ZoomFilterFXWrapperData *data = + (ZoomFilterFXWrapperData *)malloc(sizeof(ZoomFilterFXWrapperData)); + + data->coeffs = 0; + data->freecoeffs = 0; + data->brutS = 0; + data->freebrutS = 0; + data->brutD = 0; + data->freebrutD = 0; + data->brutT = 0; + data->freebrutT = 0; + data->prevX = 0; + data->prevY = 0; + + data->mustInitBuffers = 1; + data->interlace_start = -2; + + data->general_speed = 0.0f; + data->reverse = 0; + data->theMode = AMULETTE_MODE; + data->waveEffect = 0; + data->hypercosEffect = 0; + data->vPlaneEffect = 0; + data->hPlaneEffect = 0; + data->noisify = 2; + + /** modif by jeko : fixedpoint : buffration = (16:16) (donc + * 0<=buffration<=2^16) */ + data->buffratio = 0; + data->firedec = 0; + + data->wave = data->wavesp = 0; + + data->enabled_bp = secure_b_param("Enabled", 1); + + data->params = plugin_parameters("Zoom Filter", 1); + data->params.params[0] = &data->enabled_bp; + + _this->params = &data->params; + _this->fx_data = (void *)data; + + /** modif d'optim by Jeko : precalcul des 4 coefs resultant des 2 pos */ + generatePrecalCoef(data->precalCoef); } -VisualFX zoomFilterVisualFXWrapper_create(void) -{ - VisualFX fx; - fx.init = zoomFilterVisualFXWrapper_init; - fx.free = zoomFilterVisualFXWrapper_free; - fx.apply = zoomFilterVisualFXWrapper_apply; - return fx; +static void zoomFilterVisualFXWrapper_free(struct _VISUAL_FX *_this) { + free(_this->fx_data); } +static void zoomFilterVisualFXWrapper_apply(struct _VISUAL_FX *_this, + Pixel *src, Pixel *dest, + PluginInfo *info) {} + +VisualFX zoomFilterVisualFXWrapper_create(void) { + VisualFX fx; + fx.init = zoomFilterVisualFXWrapper_init; + fx.free = zoomFilterVisualFXWrapper_free; + fx.apply = zoomFilterVisualFXWrapper_apply; + return fx; +} /* TODO : MOVE THIS AWAY */ -void pointFilter (PluginInfo *goomInfo, Pixel * pix1, Color c, float t1, float t2, float t3, float t4, Uint cycle) -{ - Uint x = (Uint) ((int) (goomInfo->screen.width / 2) - + (int) (t1 * cos ((float) cycle / t3))); - Uint y = (Uint) ((int) (goomInfo->screen.height/2) - + (int) (t2 * sin ((float) cycle / t4))); - - if ((x > 1) && (y > 1) && (x < goomInfo->screen.width - 2) && (y < goomInfo->screen.height - 2)) { - setPixelRGB (goomInfo, pix1, x + 1, y, c); - setPixelRGB (goomInfo, pix1, x, y + 1, c); - setPixelRGB (goomInfo, pix1, x + 1, y + 1, WHITE); - setPixelRGB (goomInfo, pix1, x + 2, y + 1, c); - setPixelRGB (goomInfo, pix1, x + 1, y + 2, c); - } +void pointFilter(PluginInfo *goomInfo, Pixel *pix1, Color c, float t1, float t2, + float t3, float t4, Uint cycle) { + Uint x = (Uint)((int)(goomInfo->screen.width / 2) + + (int)(t1 * cos((float)cycle / t3))); + Uint y = (Uint)((int)(goomInfo->screen.height / 2) + + (int)(t2 * sin((float)cycle / t4))); + + if ((x > 1) && (y > 1) && (x < goomInfo->screen.width - 2) && + (y < goomInfo->screen.height - 2)) { + setPixelRGB(goomInfo, pix1, x + 1, y, c); + setPixelRGB(goomInfo, pix1, x, y + 1, c); + setPixelRGB(goomInfo, pix1, x + 1, y + 1, WHITE); + setPixelRGB(goomInfo, pix1, x + 2, y + 1, c); + setPixelRGB(goomInfo, pix1, x + 1, y + 2, c); + } } diff --git a/libvisual-plugins/plugins/actor/goom2k4/flying_stars_fx.c b/libvisual-plugins/plugins/actor/goom2k4/flying_stars_fx.c index 232db1036..0366064b2 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/flying_stars_fx.c +++ b/libvisual-plugins/plugins/actor/goom2k4/flying_stars_fx.c @@ -26,24 +26,10 @@ 0 }; */ -static const int colval[] = { - 0x1416181a, - 0x1419181a, - 0x141f181a, - 0x1426181a, - 0x142a181a, - 0x142f181a, - 0x1436181a, - 0x142f1819, - 0x14261615, - 0x13201411, - 0x111a100a, - 0x0c180508, - 0x08100304, - 0x00050101, - 0x0 -}; - +static const int colval[] = {0x1416181a, 0x1419181a, 0x141f181a, 0x1426181a, + 0x142a181a, 0x142f181a, 0x1436181a, 0x142f1819, + 0x14261615, 0x13201411, 0x111a100a, 0x0c180508, + 0x08100304, 0x00050101, 0x0}; /* The different modes of the visual FX. * Put this values on fx_mode */ @@ -53,262 +39,259 @@ static const int colval[] = { #define LAST_FX 3 typedef struct _FS_STAR { - float x,y; - float vx,vy; - float ax,ay; - float age,vage; + float x, y; + float vx, vy; + float ax, ay; + float age, vage; } Star; -typedef struct _FS_DATA{ +typedef struct _FS_DATA { - int fx_mode; - int nbStars; + int fx_mode; + int nbStars; - int maxStars; - Star *stars; + int maxStars; + Star *stars; - float min_age; - float max_age; + float min_age; + float max_age; - PluginParam min_age_p; - PluginParam max_age_p; - PluginParam nbStars_p; - PluginParam nbStars_limit_p; - PluginParam fx_mode_p; + PluginParam min_age_p; + PluginParam max_age_p; + PluginParam nbStars_p; + PluginParam nbStars_limit_p; + PluginParam fx_mode_p; - PluginParameters params; + PluginParameters params; } FSData; static void fs_init(VisualFX *_this, PluginInfo *info) { - - FSData *data; - data = (FSData*)malloc(sizeof(FSData)); - - data->fx_mode = FIREWORKS_FX; - data->maxStars = 4096; - data->stars = (Star*)malloc(data->maxStars * sizeof(Star)); - data->nbStars = 0; - - data->max_age_p = secure_i_param ("Fireworks Smallest Bombs"); - IVAL(data->max_age_p) = 80; - IMIN(data->max_age_p) = 0; - IMAX(data->max_age_p) = 100; - ISTEP(data->max_age_p) = 1; - - data->min_age_p = secure_i_param ("Fireworks Largest Bombs"); - IVAL(data->min_age_p) = 99; - IMIN(data->min_age_p) = 0; - IMAX(data->min_age_p) = 100; - ISTEP(data->min_age_p) = 1; - - data->nbStars_limit_p = secure_i_param ("Max Number of Particules"); - IVAL(data->nbStars_limit_p) = 512; - IMIN(data->nbStars_limit_p) = 0; - IMAX(data->nbStars_limit_p) = data->maxStars; - ISTEP(data->nbStars_limit_p) = 64; - - data->fx_mode_p = secure_i_param ("FX Mode"); - IVAL(data->fx_mode_p) = data->fx_mode; - IMIN(data->fx_mode_p) = 1; - IMAX(data->fx_mode_p) = 3; - ISTEP(data->fx_mode_p) = 1; - - data->nbStars_p = secure_f_feedback ("Number of Particules (% of Max)"); - - data->params = plugin_parameters ("Particule System", 7); - data->params.params[0] = &data->fx_mode_p; - data->params.params[1] = &data->nbStars_limit_p; - data->params.params[2] = 0; - data->params.params[3] = &data->min_age_p; - data->params.params[4] = &data->max_age_p; - data->params.params[5] = 0; - data->params.params[6] = &data->nbStars_p; - - _this->params = &data->params; - _this->fx_data = (void*)data; -} -static void fs_free(VisualFX *_this) { - free (_this->fx_data); + FSData *data; + data = (FSData *)malloc(sizeof(FSData)); + + data->fx_mode = FIREWORKS_FX; + data->maxStars = 4096; + data->stars = (Star *)malloc(data->maxStars * sizeof(Star)); + data->nbStars = 0; + + data->max_age_p = secure_i_param("Fireworks Smallest Bombs"); + IVAL(data->max_age_p) = 80; + IMIN(data->max_age_p) = 0; + IMAX(data->max_age_p) = 100; + ISTEP(data->max_age_p) = 1; + + data->min_age_p = secure_i_param("Fireworks Largest Bombs"); + IVAL(data->min_age_p) = 99; + IMIN(data->min_age_p) = 0; + IMAX(data->min_age_p) = 100; + ISTEP(data->min_age_p) = 1; + + data->nbStars_limit_p = secure_i_param("Max Number of Particules"); + IVAL(data->nbStars_limit_p) = 512; + IMIN(data->nbStars_limit_p) = 0; + IMAX(data->nbStars_limit_p) = data->maxStars; + ISTEP(data->nbStars_limit_p) = 64; + + data->fx_mode_p = secure_i_param("FX Mode"); + IVAL(data->fx_mode_p) = data->fx_mode; + IMIN(data->fx_mode_p) = 1; + IMAX(data->fx_mode_p) = 3; + ISTEP(data->fx_mode_p) = 1; + + data->nbStars_p = secure_f_feedback("Number of Particules (% of Max)"); + + data->params = plugin_parameters("Particule System", 7); + data->params.params[0] = &data->fx_mode_p; + data->params.params[1] = &data->nbStars_limit_p; + data->params.params[2] = 0; + data->params.params[3] = &data->min_age_p; + data->params.params[4] = &data->max_age_p; + data->params.params[5] = 0; + data->params.params[6] = &data->nbStars_p; + + _this->params = &data->params; + _this->fx_data = (void *)data; } +static void fs_free(VisualFX *_this) { free(_this->fx_data); } /** - * Cree une nouvelle 'bombe', c'est a dire une particule appartenant a une fusee d'artifice. + * Cree une nouvelle 'bombe', c'est a dire une particule appartenant a une fusee + * d'artifice. */ -static void addABomb (FSData *fs, int mx, int my, float radius, float vage, float gravity, PluginInfo *info) { +static void addABomb(FSData *fs, int mx, int my, float radius, float vage, + float gravity, PluginInfo *info) { - int i = fs->nbStars; - float ro; - int theta; + int i = fs->nbStars; + float ro; + int theta; - if (fs->nbStars >= fs->maxStars) - return; - fs->nbStars++; + if (fs->nbStars >= fs->maxStars) + return; + fs->nbStars++; - fs->stars[i].x = mx; - fs->stars[i].y = my; + fs->stars[i].x = mx; + fs->stars[i].y = my; - ro = radius * (float)goom_irand(info->gRandom,100) / 100.0f; - ro *= (float)goom_irand(info->gRandom,100)/100.0f + 1.0f; - theta = goom_irand(info->gRandom,256); + ro = radius * (float)goom_irand(info->gRandom, 100) / 100.0f; + ro *= (float)goom_irand(info->gRandom, 100) / 100.0f + 1.0f; + theta = goom_irand(info->gRandom, 256); - fs->stars[i].vx = ro * cos256[theta]; - fs->stars[i].vy = -0.2f + ro * sin256[theta]; + fs->stars[i].vx = ro * cos256[theta]; + fs->stars[i].vy = -0.2f + ro * sin256[theta]; - fs->stars[i].ax = 0; - fs->stars[i].ay = gravity; + fs->stars[i].ax = 0; + fs->stars[i].ay = gravity; - fs->stars[i].age = 0; - if (vage < fs->min_age) - vage=fs->min_age; - fs->stars[i].vage = vage; + fs->stars[i].age = 0; + if (vage < fs->min_age) + vage = fs->min_age; + fs->stars[i].vage = vage; } - /** * Met a jour la position et vitesse d'une particule. */ -static void updateStar (Star *s) { - s->x+=s->vx; - s->y+=s->vy; - s->vx+=s->ax; - s->vy+=s->ay; - s->age+=s->vage; +static void updateStar(Star *s) { + s->x += s->vx; + s->y += s->vy; + s->vx += s->ax; + s->vy += s->ay; + s->age += s->vage; } - /** * Ajoute de nouvelles particules au moment d'un evenement sonore. */ static void fs_sound_event_occured(VisualFX *_this, PluginInfo *info) { - FSData *data = (FSData*)_this->fx_data; - int i; - - int max = (int)((1.0f+info->sound.goomPower)*goom_irand(info->gRandom,150)) + 100; - float radius = (1.0f+info->sound.goomPower) * (float)(goom_irand(info->gRandom,150)+50)/300; - int mx; - int my; - float vage, gravity = 0.02f; - - switch (data->fx_mode) { - case FIREWORKS_FX: - { - double dx,dy; - do { - mx = goom_irand(info->gRandom,info->screen.width); - my = goom_irand(info->gRandom,info->screen.height); - dx = (mx - info->screen.width/2); - dy = (my - info->screen.height/2); - } while (dx*dx + dy*dy < (info->screen.height/2)*(info->screen.height/2)); - vage = data->max_age * (1.0f - info->sound.goomPower); - } - break; - case RAIN_FX: - mx = goom_irand(info->gRandom,info->screen.width); - if (mx > info->screen.width/2) - mx = info->screen.width; - else - mx = 0; - my = -(info->screen.height/3)-goom_irand(info->gRandom,info->screen.width/3); - radius *= 1.5; - vage = 0.002f; - break; - case FOUNTAIN_FX: - my = info->screen.height+2; - vage = 0.001f; - radius += 1.0f; - mx = info->screen.width / 2; - gravity = 0.04f; - break; - default: - return; - /* my = i R A N D (info->screen.height); vage = 0.01f; */ - } - - radius *= info->screen.height / 200.0f; /* why 200 ? because the FX was developped on 320x200 */ - max *= info->screen.height / 200.0f; - - if (info->sound.timeSinceLastBigGoom < 1) { - radius *= 1.5; - max *= 2; - } - for (i=0;ifx_data; + int i; + + int max = + (int)((1.0f + info->sound.goomPower) * goom_irand(info->gRandom, 150)) + + 100; + float radius = (1.0f + info->sound.goomPower) * + (float)(goom_irand(info->gRandom, 150) + 50) / 300; + int mx; + int my; + float vage, gravity = 0.02f; + + switch (data->fx_mode) { + case FIREWORKS_FX: { + double dx, dy; + do { + mx = goom_irand(info->gRandom, info->screen.width); + my = goom_irand(info->gRandom, info->screen.height); + dx = (mx - info->screen.width / 2); + dy = (my - info->screen.height / 2); + } while (dx * dx + dy * dy < + (info->screen.height / 2) * (info->screen.height / 2)); + vage = data->max_age * (1.0f - info->sound.goomPower); + } break; + case RAIN_FX: + mx = goom_irand(info->gRandom, info->screen.width); + if (mx > info->screen.width / 2) + mx = info->screen.width; + else + mx = 0; + my = -(info->screen.height / 3) - + goom_irand(info->gRandom, info->screen.width / 3); + radius *= 1.5; + vage = 0.002f; + break; + case FOUNTAIN_FX: + my = info->screen.height + 2; + vage = 0.001f; + radius += 1.0f; + mx = info->screen.width / 2; + gravity = 0.04f; + break; + default: + return; + /* my = i R A N D (info->screen.height); vage = 0.01f; */ + } + + radius *= info->screen.height / + 200.0f; /* why 200 ? because the FX was developped on 320x200 */ + max *= info->screen.height / 200.0f; + + if (info->sound.timeSinceLastBigGoom < 1) { + radius *= 1.5; + max *= 2; + } + for (i = 0; i < max; ++i) + addABomb(data, mx, my, radius, vage, gravity, info); } - /** * Main methode of the FX. */ -static void fs_apply(VisualFX *_this, Pixel *src, Pixel *dest, PluginInfo *info) { - - int i; - int col; - FSData *data = (FSData*)_this->fx_data; - - /* Get the new parameters values */ - data->min_age = 1.0f - (float)IVAL(data->min_age_p)/100.0f; - data->max_age = 1.0f - (float)IVAL(data->max_age_p)/100.0f; - FVAL(data->nbStars_p) = (float)data->nbStars / (float)data->maxStars; - data->nbStars_p.change_listener(&data->nbStars_p); - data->maxStars = IVAL(data->nbStars_limit_p); - data->fx_mode = IVAL(data->fx_mode_p); - - /* look for events */ - if (info->sound.timeSinceLastGoom < 1) { - fs_sound_event_occured(_this, info); - if (goom_irand(info->gRandom,20)==1) { - IVAL(data->fx_mode_p) = goom_irand(info->gRandom,(LAST_FX*3)); - data->fx_mode_p.change_listener(&data->fx_mode_p); - } - } - - /* update particules */ - for (i=0;inbStars;++i) { - updateStar(&data->stars[i]); - - /* dead particule */ - if (data->stars[i].age>=NCOL) - continue; - - /* choose the color of the particule */ - col = colval[(int)data->stars[i].age]; - - /* draws the particule */ - info->methods.draw_line(dest,(int)data->stars[i].x,(int)data->stars[i].y, - (int)(data->stars[i].x-data->stars[i].vx*6), - (int)(data->stars[i].y-data->stars[i].vy*6), - col, - (int)info->screen.width, (int)info->screen.height); - info->methods.draw_line(dest,(int)data->stars[i].x,(int)data->stars[i].y, - (int)(data->stars[i].x-data->stars[i].vx*2), - (int)(data->stars[i].y-data->stars[i].vy*2), - col, - (int)info->screen.width, (int)info->screen.height); - } - - /* look for dead particules */ - for (i=0;inbStars;) { - - if ((data->stars[i].x > info->screen.width + 64) - ||((data->stars[i].vy>=0)&&(data->stars[i].y - 16*data->stars[i].vy > info->screen.height)) - ||(data->stars[i].x < -64) - ||(data->stars[i].age>=NCOL)) { - data->stars[i] = data->stars[data->nbStars-1]; - data->nbStars--; - } - else ++i; - } +static void fs_apply(VisualFX *_this, Pixel *src, Pixel *dest, + PluginInfo *info) { + + int i; + int col; + FSData *data = (FSData *)_this->fx_data; + + /* Get the new parameters values */ + data->min_age = 1.0f - (float)IVAL(data->min_age_p) / 100.0f; + data->max_age = 1.0f - (float)IVAL(data->max_age_p) / 100.0f; + FVAL(data->nbStars_p) = (float)data->nbStars / (float)data->maxStars; + data->nbStars_p.change_listener(&data->nbStars_p); + data->maxStars = IVAL(data->nbStars_limit_p); + data->fx_mode = IVAL(data->fx_mode_p); + + /* look for events */ + if (info->sound.timeSinceLastGoom < 1) { + fs_sound_event_occured(_this, info); + if (goom_irand(info->gRandom, 20) == 1) { + IVAL(data->fx_mode_p) = goom_irand(info->gRandom, (LAST_FX * 3)); + data->fx_mode_p.change_listener(&data->fx_mode_p); + } + } + + /* update particules */ + for (i = 0; i < data->nbStars; ++i) { + updateStar(&data->stars[i]); + + /* dead particule */ + if (data->stars[i].age >= NCOL) + continue; + + /* choose the color of the particule */ + col = colval[(int)data->stars[i].age]; + + /* draws the particule */ + info->methods.draw_line(dest, (int)data->stars[i].x, (int)data->stars[i].y, + (int)(data->stars[i].x - data->stars[i].vx * 6), + (int)(data->stars[i].y - data->stars[i].vy * 6), + col, (int)info->screen.width, + (int)info->screen.height); + info->methods.draw_line(dest, (int)data->stars[i].x, (int)data->stars[i].y, + (int)(data->stars[i].x - data->stars[i].vx * 2), + (int)(data->stars[i].y - data->stars[i].vy * 2), + col, (int)info->screen.width, + (int)info->screen.height); + } + + /* look for dead particules */ + for (i = 0; i < data->nbStars;) { + + if ((data->stars[i].x > info->screen.width + 64) || + ((data->stars[i].vy >= 0) && + (data->stars[i].y - 16 * data->stars[i].vy > info->screen.height)) || + (data->stars[i].x < -64) || (data->stars[i].age >= NCOL)) { + data->stars[i] = data->stars[data->nbStars - 1]; + data->nbStars--; + } else + ++i; + } } VisualFX flying_star_create(void) { - VisualFX vfx = { - .init = fs_init, - .free = fs_free, - .apply = fs_apply, - .fx_data = 0 - }; - return vfx; + VisualFX vfx = { + .init = fs_init, .free = fs_free, .apply = fs_apply, .fx_data = 0}; + return vfx; } diff --git a/libvisual-plugins/plugins/actor/goom2k4/gfontlib.c b/libvisual-plugins/plugins/actor/goom2k4/gfontlib.c index 884788c63..5333a1b1a 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/gfontlib.c +++ b/libvisual-plugins/plugins/actor/goom2k4/gfontlib.c @@ -4,242 +4,260 @@ #include #include -static Pixel ***font_chars; -static int *font_width; -static int *font_height; -static Pixel ***small_font_chars; -static int *small_font_width; -static int *small_font_height; - -void gfont_load (void) { - unsigned char *gfont; - unsigned int i = 0, j = 0; - unsigned int nba = 0; - unsigned int current = 32; - int *font_pos; - /* decompress le rle */ - - gfont = malloc (the_font.width*the_font.height*the_font.bytes_per_pixel); - while (i>2)<<(ROUGE*8))| - (((g1 + g2 + g3 + g4)>>2)<<(VERT*8))| - (((b1 + b2 + b3 + b4)>>2)<<(BLEU*8))| - (((a1 + a2 + a3 + a4)>>2)<<(ALPHA*8)); - } - } - } - - /* definir les lettres restantes */ - - for (i=0;i<256;i++) { - if (font_chars[i]==0) { - font_chars[i]=font_chars[42]; - small_font_chars[i]=small_font_chars[42]; - font_width[i]=font_width[42]; - font_pos[i]=font_pos[42]; - font_height[i]=font_height[42]; - small_font_width[i]=small_font_width[42]; - small_font_height[i]=small_font_height[42]; - } - } - - font_width [32] = (the_font.height / 2) - 1; - small_font_width [32] = font_width [32]/2; - font_chars [32] = 0; - small_font_chars [32] = 0; - - free (font_pos); - free (gfont); +static Pixel ***font_chars; +static int *font_width; +static int *font_height; +static Pixel ***small_font_chars; +static int *small_font_width; +static int *small_font_height; + +void gfont_load(void) { + unsigned char *gfont; + unsigned int i = 0, j = 0; + unsigned int nba = 0; + unsigned int current = 32; + int *font_pos; + /* decompress le rle */ + + gfont = malloc(the_font.width * the_font.height * the_font.bytes_per_pixel); + while (i < the_font.rle_size) { + unsigned char c = the_font.rle_pixel[i++]; + if (c == 0) { + unsigned int nb = the_font.rle_pixel[i++]; + while (nb--) + gfont[j++] = 0; + } else + gfont[j++] = c; + } + + /* determiner les positions de chaque lettre. */ + + font_height = calloc(256, sizeof(int)); + small_font_height = calloc(256, sizeof(int)); + font_width = calloc(256, sizeof(int)); + small_font_width = calloc(256, sizeof(int)); + font_chars = calloc(256, sizeof(int **)); + small_font_chars = calloc(256, sizeof(int **)); + font_pos = calloc(256, sizeof(int)); + + for (i = 0; i < the_font.width; i++) { + unsigned char a = gfont[i * 4 + 3]; + if (a) + nba++; + else + nba = 0; + if (nba == 2) { + font_width[current] = i - font_pos[current]; + small_font_width[current] = font_width[current] / 2; + font_pos[++current] = i; + font_height[current] = the_font.height - 2; + small_font_height[current] = font_height[current] / 2; + } + } + font_pos[current] = 0; + font_height[current] = 0; + small_font_height[current] = 0; + + /* charger les lettres et convertir au format de la machine */ + + for (i = 33; i < current; i++) { + int x; + int y; + font_chars[i] = malloc(font_height[i] * sizeof(int *)); + small_font_chars[i] = malloc(font_height[i] * sizeof(int *) / 2); + for (y = 0; y < font_height[i]; y++) { + font_chars[i][y] = malloc(font_width[i] * sizeof(int)); + for (x = 0; x < font_width[i]; x++) { + unsigned int r, g, b, a; + r = gfont[(y + 2) * (the_font.width * 4) + (x * 4 + font_pos[i] * 4)]; + g = gfont[(y + 2) * (the_font.width * 4) + + (x * 4 + font_pos[i] * 4 + 1)]; + b = gfont[(y + 2) * (the_font.width * 4) + + (x * 4 + font_pos[i] * 4 + 2)]; + a = gfont[(y + 2) * (the_font.width * 4) + + (x * 4 + font_pos[i] * 4 + 3)]; + font_chars[i][y][x].val = (r << (ROUGE * 8)) | (g << (VERT * 8)) | + (b << (BLEU * 8)) | (a << (ALPHA * 8)); + } + } + for (y = 0; y < font_height[i] / 2; y++) { + small_font_chars[i][y] = malloc(font_width[i] * sizeof(int) / 2); + for (x = 0; x < font_width[i] / 2; x++) { + unsigned int r1, g1, b1, a1, r2, g2, b2, a2, r3, g3, b3, a3, r4, g4, b4, + a4; + r1 = gfont[2 * (y + 1) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4)]; + g1 = gfont[2 * (y + 1) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 1)]; + b1 = gfont[2 * (y + 1) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 2)]; + a1 = gfont[2 * (y + 1) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 3)]; + r2 = gfont[(2 * y + 3) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 4)]; + g2 = gfont[(2 * y + 3) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 5)]; + b2 = gfont[(2 * y + 3) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 6)]; + a2 = gfont[(2 * y + 3) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 7)]; + r3 = gfont[(2 * y + 3) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4)]; + g3 = gfont[(2 * y + 3) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 1)]; + b3 = gfont[(2 * y + 3) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 2)]; + a3 = gfont[(2 * y + 3) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 3)]; + r4 = gfont[2 * (y + 1) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 4)]; + g4 = gfont[2 * (y + 1) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 5)]; + b4 = gfont[2 * (y + 1) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 6)]; + a4 = gfont[2 * (y + 1) * (the_font.width * 4) + + (x * 8 + font_pos[i] * 4 + 7)]; + small_font_chars[i][y][x].val = + (((r1 + r2 + r3 + r4) >> 2) << (ROUGE * 8)) | + (((g1 + g2 + g3 + g4) >> 2) << (VERT * 8)) | + (((b1 + b2 + b3 + b4) >> 2) << (BLEU * 8)) | + (((a1 + a2 + a3 + a4) >> 2) << (ALPHA * 8)); + } + } + } + + /* definir les lettres restantes */ + + for (i = 0; i < 256; i++) { + if (font_chars[i] == 0) { + font_chars[i] = font_chars[42]; + small_font_chars[i] = small_font_chars[42]; + font_width[i] = font_width[42]; + font_pos[i] = font_pos[42]; + font_height[i] = font_height[42]; + small_font_width[i] = small_font_width[42]; + small_font_height[i] = small_font_height[42]; + } + } + + font_width[32] = (the_font.height / 2) - 1; + small_font_width[32] = font_width[32] / 2; + font_chars[32] = 0; + small_font_chars[32] = 0; + + free(font_pos); + free(gfont); } -void gfont_unload () -{ - free (font_height); - free (small_font_height); - free (font_width); - free (small_font_width); - free (font_chars); - free (small_font_chars); +void gfont_unload() { + free(font_height); + free(small_font_height); + free(font_width); + free(small_font_width); + free(font_chars); + free(small_font_chars); } -void goom_draw_text (Pixel * buf, int resolx, int resoly, - int x, int y, const char *str, float charspace, int center) { - - float fx = (float) x; - int fin = 0; - - Pixel ***cur_font_chars; - int *cur_font_width; - int *cur_font_height; - - if (resolx>320) - { - /* printf("use big\n"); */ - cur_font_chars = font_chars; - cur_font_width = font_width; - cur_font_height = font_height; - } - else - { - /* printf ("use small\n"); */ - cur_font_chars = small_font_chars; - cur_font_width = small_font_width; - cur_font_height = small_font_height; - } - - if (cur_font_chars == NULL) - return; - - if (center) { - unsigned char *tmp = (unsigned char*)str; - float lg = -charspace; - - while (*tmp != '\0') - lg += cur_font_width[*(tmp++)] + charspace; - - fx -= lg / 2; - } - - while (!fin) { - unsigned char c = *str; - - x = (int) fx; - - if (c == '\0') - fin = 1; - else if (cur_font_chars[c]==0) { - fx += cur_font_width[c] + charspace; - } - else { - int xx, yy; - int xmin = x; - int xmax = x + cur_font_width[c]; - int ymin = y - cur_font_height[c]; - int ymax = y; - - yy = ymin; - - if (xmin < 0) - xmin = 0; - - if (xmin >= resolx - 1) - return; - - if (xmax >= (int) resolx) - xmax = resolx - 1; - - if (yy < 0) - yy = 0; - - if (yy <= (int) resoly - 1) { - if (ymax >= (int) resoly - 1) - ymax = resoly - 1; - - for (; yy < ymax; yy++) - { - for (xx = xmin; xx < xmax; xx++) - { - Pixel color = cur_font_chars[c][yy - ymin][xx - x]; - Pixel transparency; - transparency.val = color.val & A_CHANNEL; - if (transparency.val) - { - if (transparency.val==A_CHANNEL) - { - buf[yy * resolx + xx] = color; - } - else - { - Pixel back = buf[yy * resolx + xx]; - unsigned int a1 = color.channels.a; - unsigned int a2 = 255 - a1; - buf[yy * resolx + xx].channels.r = (unsigned char)((((unsigned int)color.channels.r * a1) + ((unsigned int)back.channels.r * a2)) >> 8); - buf[yy * resolx + xx].channels.g = (unsigned char)((((unsigned int)color.channels.g * a1) + ((unsigned int)back.channels.g * a2)) >> 8); - buf[yy * resolx + xx].channels.b = (unsigned char)((((unsigned int)color.channels.b * a1) + ((unsigned int)back.channels.b * a2)) >> 8); - } - } - } - } - } - fx += cur_font_width[c] + charspace; - } - str++; - } +void goom_draw_text(Pixel *buf, int resolx, int resoly, int x, int y, + const char *str, float charspace, int center) { + + float fx = (float)x; + int fin = 0; + + Pixel ***cur_font_chars; + int *cur_font_width; + int *cur_font_height; + + if (resolx > 320) { + /* printf("use big\n"); */ + cur_font_chars = font_chars; + cur_font_width = font_width; + cur_font_height = font_height; + } else { + /* printf ("use small\n"); */ + cur_font_chars = small_font_chars; + cur_font_width = small_font_width; + cur_font_height = small_font_height; + } + + if (cur_font_chars == NULL) + return; + + if (center) { + unsigned char *tmp = (unsigned char *)str; + float lg = -charspace; + + while (*tmp != '\0') + lg += cur_font_width[*(tmp++)] + charspace; + + fx -= lg / 2; + } + + while (!fin) { + unsigned char c = *str; + + x = (int)fx; + + if (c == '\0') + fin = 1; + else if (cur_font_chars[c] == 0) { + fx += cur_font_width[c] + charspace; + } else { + int xx, yy; + int xmin = x; + int xmax = x + cur_font_width[c]; + int ymin = y - cur_font_height[c]; + int ymax = y; + + yy = ymin; + + if (xmin < 0) + xmin = 0; + + if (xmin >= resolx - 1) + return; + + if (xmax >= (int)resolx) + xmax = resolx - 1; + + if (yy < 0) + yy = 0; + + if (yy <= (int)resoly - 1) { + if (ymax >= (int)resoly - 1) + ymax = resoly - 1; + + for (; yy < ymax; yy++) { + for (xx = xmin; xx < xmax; xx++) { + Pixel color = cur_font_chars[c][yy - ymin][xx - x]; + Pixel transparency; + transparency.val = color.val & A_CHANNEL; + if (transparency.val) { + if (transparency.val == A_CHANNEL) { + buf[yy * resolx + xx] = color; + } else { + Pixel back = buf[yy * resolx + xx]; + unsigned int a1 = color.channels.a; + unsigned int a2 = 255 - a1; + buf[yy * resolx + xx].channels.r = + (unsigned char)((((unsigned int)color.channels.r * a1) + + ((unsigned int)back.channels.r * a2)) >> + 8); + buf[yy * resolx + xx].channels.g = + (unsigned char)((((unsigned int)color.channels.g * a1) + + ((unsigned int)back.channels.g * a2)) >> + 8); + buf[yy * resolx + xx].channels.b = + (unsigned char)((((unsigned int)color.channels.b * a1) + + ((unsigned int)back.channels.b * a2)) >> + 8); + } + } + } + } + } + fx += cur_font_width[c] + charspace; + } + str++; + } } diff --git a/libvisual-plugins/plugins/actor/goom2k4/gfontlib.h b/libvisual-plugins/plugins/actor/goom2k4/gfontlib.h index 50df780cf..d9c938dcb 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/gfontlib.h +++ b/libvisual-plugins/plugins/actor/goom2k4/gfontlib.h @@ -3,9 +3,9 @@ #include "goom_graphic.h" -void gfont_load (void); -void gfont_unload (void); -void goom_draw_text (Pixel * buf,int resolx,int resoly, int x, int y, - const char *str, float chspace, int center); +void gfont_load(void); +void gfont_unload(void); +void goom_draw_text(Pixel *buf, int resolx, int resoly, int x, int y, + const char *str, float chspace, int center); #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/gfontrle.c b/libvisual-plugins/plugins/actor/goom2k4/gfontrle.c index 8a4b32cd0..3348fcba6 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/gfontrle.c +++ b/libvisual-plugins/plugins/actor/goom2k4/gfontrle.c @@ -5,2496 +5,3564 @@ const struct { unsigned int height; unsigned int bytes_per_pixel; unsigned int rle_size; - unsigned char rle_pixel [49725]; + unsigned char rle_pixel[49725]; } the_font = { -1277, 21, 4, 49725, { -121,17,164,255,121,17,164,255,121,17,164,255,121,17,164,255,0,8,121,17, -164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,36,121,17,164, -0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,52,121,17,164,0, -1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1, -121,17,164,255,121,17,164,255,121,17,164,255,0,52,121,17,164,0,1,121, -17,164,255,121,17,164,255,121,17,164,255,0,52,121,17,164,0,1,121,17, -164,255,121,17,164,255,121,17,164,255,0,12,121,17,164,0,1,121,17,164, -255,121,17,164,255,121,17,164,255,0,20,121,17,164,0,1,121,17,164,255, -121,17,164,255,121,17,164,255,0,20,121,17,164,0,1,121,17,164,255,121, -17,164,255,121,17,164,255,0,52,121,17,164,0,1,121,17,164,255,121,17, -164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164, -255,121,17,164,255,0,12,121,17,164,0,1,121,17,164,255,121,17,164,255, -121,17,164,255,0,36,121,17,164,0,1,121,17,164,255,121,17,164,255,121, -17,164,255,0,12,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17, -164,255,0,36,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164, -255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255, -0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0, -44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44, -121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121, -17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17, -164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164, -0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0, -1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1, -121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121, -17,164,255,121,17,164,255,121,17,164,255,0,12,121,17,164,0,1,121,17, -164,255,121,17,164,255,121,17,164,255,0,12,121,17,164,0,1,121,17,164, -255,121,17,164,255,121,17,164,255,0,36,121,17,164,0,1,121,17,164,255, -121,17,164,255,121,17,164,255,0,36,121,17,164,0,1,121,17,164,255,121, -17,164,255,121,17,164,255,0,36,121,17,164,0,1,121,17,164,255,121,17, -164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164, -255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255, -121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121, -17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17, -164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164, -255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255, -0,36,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0, -36,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44, -121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121, -17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,12,121,17, -164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164, -0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0, -1,121,17,164,255,121,17,164,255,121,17,164,255,0,36,121,17,164,0,1, -121,17,164,255,121,17,164,255,121,17,164,255,0,52,121,17,164,0,1,121, -17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17, -164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164, -255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255, -121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121, -17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17, -164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164, -255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255, -121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121, -17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17, -164,255,0,52,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164, -255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255, -0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0, -44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,20, -121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,36,121, -17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,20,121,17, -164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,36,121,17,164, -0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,36,121,17,164,0, -1,121,17,164,255,121,17,164,255,121,17,164,255,0,12,121,17,164,0,1, -121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121, -17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17, -164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164, -255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255, -121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121, -17,164,255,121,17,164,255,0,28,121,17,164,0,1,121,17,164,255,121,17, -164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164, -255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255, -121,17,164,255,0,12,121,17,164,0,1,121,17,164,255,121,17,164,255,121, -17,164,255,0,28,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17, -164,255,0,44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164, -255,0,12,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255, -0,52,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0, -44,121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44, -121,17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121, -17,164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17, -164,0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164, -0,1,121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0, -1,121,17,164,255,121,17,164,255,121,17,164,255,0,28,121,17,164,0,1, -121,17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121, -17,164,255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17, -164,255,121,17,164,255,121,17,164,255,0,52,121,17,164,0,1,121,17,164, -255,121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255, -121,17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121, -17,164,255,121,17,164,255,0,44,121,17,164,0,1,121,17,164,255,121,17, -164,255,121,17,164,255,0,28,121,17,164,0,1,121,17,164,255,121,17,164, -255,121,17,164,255,0,12,121,17,164,0,1,121,17,164,255,121,17,164,255, -121,17,164,255,0,28,121,17,164,0,1,121,17,164,255,121,17,164,255,121, -17,164,255,121,17,164,255,121,17,164,255,0,56,121,17,164,0,1,121,17, -164,255,121,17,164,255,13,4,17,0,1,13,4,17,0,1,13,4,17,0, -1,16,5,22,0,13,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -41,16,5,22,0,1,14,4,19,0,1,16,5,22,0,57,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,57,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -57,16,5,22,0,1,14,4,19,0,1,16,5,22,0,17,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,25,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,25,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -57,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,17,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,41,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -17,16,5,22,0,1,14,4,19,0,1,16,5,22,0,41,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -17,16,5,22,0,1,14,4,19,0,1,16,5,22,0,17,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,41,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,41,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -41,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,41,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -41,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,17,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,41,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,57,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,57,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,25,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,41,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,25,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -41,16,5,22,0,1,14,4,19,0,1,16,5,22,0,41,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,17,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -33,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,17,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -33,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,17,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,57,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,49,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,33,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,57,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,49,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,49,16,5,22,0,1,14,4,19,0,1,16,5,22,0, -49,16,5,22,0,1,14,4,19,0,1,16,5,22,0,33,16,5,22,0, -1,14,4,19,0,1,16,5,22,0,17,16,5,22,0,1,14,4,19,0, -1,16,5,22,0,33,16,5,22,0,1,14,4,19,0,1,13,4,17,0, -1,13,4,17,0,1,16,5,22,0,61,16,5,22,0,1,14,4,19,0, -255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, -255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, -25,8,6,3,57,10,8,5,85,9,7,4,76,0,12,8,6,3,54,9, -8,4,96,9,7,4,85,0,12,8,6,3,57,9,8,4,96,9,7,4, -85,0,24,8,6,3,57,11,8,4,85,9,7,4,79,0,12,8,6,3, -51,10,8,5,85,8,6,3,85,0,40,8,6,3,57,11,8,4,85,8, -6,3,85,0,32,8,6,3,57,10,8,5,85,9,7,4,85,0,28,5, -4,2,14,8,6,3,85,9,7,4,85,0,24,8,6,3,74,9,7,4, -113,8,6,3,167,8,6,3,139,9,7,4,85,5,4,2,14,0,36,8, -6,3,57,9,8,4,110,9,7,4,85,0,24,5,4,2,20,9,7,4, -85,9,8,4,85,0,16,9,8,4,57,9,8,4,85,6,5,3,48,0, -255,0,29,5,4,2,17,8,6,3,85,9,7,4,82,0,20,5,4,2, -3,8,6,3,85,9,7,4,93,8,6,3,153,8,6,3,161,8,6,3, -110,9,8,4,85,8,6,3,85,6,5,3,31,0,32,5,4,2,3,8, -6,3,85,10,8,5,85,10,7,5,85,0,36,5,4,2,57,8,6,3, -85,9,7,4,91,8,6,3,153,8,6,3,170,8,6,3,164,8,6,3, -108,8,6,3,85,6,5,3,71,0,24,5,4,2,42,8,6,3,85,9, -7,4,91,8,6,3,153,8,6,3,170,8,6,3,164,8,6,3,108,8, -6,3,85,6,5,3,71,0,48,5,4,2,3,8,6,3,85,9,8,4, -85,9,7,4,74,0,16,8,6,3,42,9,7,4,85,8,6,3,85,9, -7,4,85,8,6,3,125,8,6,3,170,7,6,4,170,9,7,4,170,12, -9,7,170,19,14,10,170,19,13,10,142,8,6,5,28,0,16,5,4,2, -51,8,6,3,85,9,7,4,91,8,6,3,153,8,6,3,170,8,6,3, -164,8,6,3,108,8,6,3,85,6,5,3,71,0,20,10,8,5,57,9, -7,4,170,8,6,3,170,8,6,3,170,8,6,3,161,8,6,3,142,9, -7,4,96,9,7,4,85,8,6,3,85,9,7,4,85,9,7,4,74,0, -20,5,4,2,42,8,6,3,85,9,7,4,91,8,6,3,153,8,6,3, -170,8,6,3,164,8,6,3,108,8,6,3,85,6,5,3,76,0,24,8, -6,5,82,10,8,7,133,12,9,7,170,15,11,8,170,15,11,8,170,15, -11,8,170,13,10,8,170,10,8,7,161,10,8,7,85,6,5,5,28,0, -96,8,6,3,74,9,8,4,85,8,6,3,57,0,68,7,6,4,28,9, -7,4,85,9,7,4,85,5,4,2,17,0,40,5,4,2,42,8,6,3, -85,9,7,4,91,8,6,3,153,8,6,3,170,8,6,3,164,8,6,3, -108,8,6,3,85,6,5,3,85,0,24,8,6,5,85,10,8,7,133,12, -9,7,170,15,10,8,170,15,11,8,170,15,11,8,170,13,10,8,170,10, -8,7,150,8,6,5,62,0,24,8,6,5,82,10,8,7,133,12,9,7, -170,15,10,8,170,14,10,7,170,9,7,4,170,8,6,5,147,10,8,5, -85,7,6,4,85,5,4,4,3,0,16,12,9,7,57,11,8,6,161,9, -7,6,170,10,8,7,170,13,10,8,170,14,10,7,170,13,10,8,170,12, -9,7,170,10,8,7,156,10,8,7,85,6,5,5,25,0,20,6,5,3, -57,8,7,5,85,9,7,4,110,9,7,4,170,10,8,5,170,10,8,5, -170,11,8,6,170,10,8,7,150,10,8,7,85,6,5,5,25,0,16,15, -11,8,57,11,8,6,170,9,7,6,170,10,8,7,170,13,10,8,170,15, -11,8,170,15,11,8,170,13,10,8,170,10,8,7,159,10,8,7,85,6, -5,5,25,0,16,15,11,8,59,11,9,6,170,9,7,4,125,10,8,5, -85,8,6,3,133,8,6,3,167,8,6,3,170,8,6,3,170,9,8,4, -113,0,16,8,6,3,42,10,8,5,85,10,7,5,85,9,7,4,125,10, -8,5,170,12,10,7,170,14,11,7,170,19,14,10,170,19,14,10,142,8, -6,5,28,0,16,8,6,5,82,10,8,7,133,12,9,7,170,15,11,8, -170,15,11,8,170,15,11,8,170,13,10,8,170,10,8,7,161,10,8,7, -85,6,5,5,25,0,16,12,10,7,74,14,10,7,170,12,9,7,139,7, -6,4,28,0,16,10,8,7,110,14,10,7,170,13,10,8,125,0,16,13, -10,8,71,15,11,8,170,13,10,8,130,5,5,4,8,0,44,11,8,6, -85,9,7,4,170,10,8,5,93,0,16,12,9,7,57,10,8,5,167,11, -8,6,110,6,5,3,8,0,16,11,8,6,57,10,7,5,159,11,8,6, -102,0,16,8,6,3,51,10,8,5,85,9,7,4,85,0,40,10,7,5, -57,11,9,6,85,7,6,4,57,0,28,7,5,4,28,10,8,5,85,11, -8,6,85,0,16,8,6,3,48,10,8,5,85,8,6,3,85,0,20,8, -6,3,57,11,8,4,85,9,7,4,79,0,20,5,4,2,45,8,6,3, -85,9,7,4,85,9,7,4,88,9,7,4,108,9,8,4,93,9,7,4, -85,8,6,3,85,6,5,3,74,0,20,8,6,3,45,9,7,4,85,8, -6,3,85,9,7,4,85,8,6,3,125,8,6,3,170,8,6,3,164,8, -6,3,108,8,6,3,85,6,5,3,74,0,24,6,5,3,57,8,7,5, -85,10,8,5,85,9,7,4,119,8,6,3,142,9,7,4,130,10,8,5, -91,10,7,5,85,6,5,3,85,0,20,9,7,4,57,10,8,5,85,10, -7,5,85,10,8,5,85,8,6,3,144,8,6,3,170,8,6,3,164,8, -6,3,108,8,6,3,85,6,5,3,71,0,24,5,4,2,45,8,6,3, -85,9,7,4,91,8,6,3,153,8,6,3,170,8,6,3,164,9,7,4, -105,8,6,3,85,6,5,3,74,0,20,11,8,4,59,9,7,4,170,8, -6,3,164,9,7,4,91,8,6,3,85,8,6,3,85,8,6,3,85,9, -7,4,85,8,6,3,142,9,6,4,170,9,8,4,116,0,16,8,6,3, -48,10,8,5,85,9,7,4,85,0,20,8,6,3,57,11,8,4,85,9, -7,4,76,0,16,8,6,3,48,10,8,5,85,9,7,4,85,0,20,8, -6,3,57,11,8,4,85,9,7,4,76,0,16,8,6,3,48,10,8,5, -85,9,7,4,85,0,28,8,6,3,57,11,8,4,85,9,7,4,76,0, -16,8,6,3,54,9,8,4,96,9,7,4,85,0,20,8,6,3,57,9, -8,4,96,9,7,4,85,0,16,10,8,5,57,10,7,5,153,10,8,5, -93,0,20,10,8,7,93,14,11,7,170,13,10,8,136,0,16,11,8,6, -91,11,8,6,170,9,7,4,170,9,7,4,170,8,6,5,170,8,6,3, -119,9,7,4,85,8,6,3,85,8,6,3,85,9,7,4,85,9,7,4, -76,0,16,8,6,3,42,9,7,4,85,8,6,3,85,8,6,3,122,9, -8,4,102,0,16,8,6,3,51,9,7,4,85,6,5,3,45,0,40,12, -8,5,57,8,6,3,156,10,7,5,93,11,8,6,85,11,8,6,85,0, -28,6,5,5,14,13,10,8,85,8,7,5,45,0,80,10,8,5,57,10, -7,5,156,10,8,5,96,0,76,9,7,4,57,10,8,5,93,10,8,5, -85,0,140,10,8,7,110,13,10,8,170,12,9,7,133,5,5,4,6,0, -84,8,6,5,79,10,8,7,127,13,10,8,170,16,12,9,142,8,7,5, -28,0,72,8,6,3,57,10,8,5,85,9,6,4,85,0,48,15,11,8, -113,25,18,12,170,20,15,11,142,8,7,5,28,0,28,15,11,8,130,22, -16,11,170,20,15,11,142,7,6,6,23,0,12,13,10,8,68,12,9,7, -170,11,8,6,116,6,5,3,8,0,44,12,9,7,82,15,10,8,170,13, -10,8,130,5,5,4,8,0,255,0,197,6,5,3,57,8,6,3,85,0, -255,0,149,5,4,2,6,8,6,3,85,8,6,3,156,9,8,4,113,0, -16,8,6,3,48,9,8,4,91,9,7,4,76,0,16,10,8,5,57,9, -6,4,170,8,6,3,99,5,4,2,34,0,36,8,6,3,71,9,8,4, -93,9,8,4,96,8,6,3,85,6,5,3,45,0,12,8,6,3,76,0, -44,8,6,3,57,58,31,9,255,93,50,12,255,88,45,11,255,12,10,5, -113,0,4,7,6,4,28,54,29,9,255,93,46,12,255,88,45,11,255,12, -9,5,122,0,4,7,5,4,37,54,29,9,255,93,46,12,255,88,45,11, -255,14,10,5,142,0,16,8,6,3,85,58,31,9,255,93,50,12,255,88, -44,11,255,9,7,4,170,0,4,5,4,2,85,52,28,9,255,93,48,12, -255,88,44,11,255,12,10,5,170,0,32,7,6,4,85,58,31,9,255,93, -50,12,255,88,45,11,255,12,9,5,170,0,24,8,6,3,57,58,31,9, -255,93,50,12,255,88,45,11,255,14,10,5,142,0,20,6,5,3,28,19, -12,6,227,76,37,11,255,88,45,11,255,14,10,5,139,0,16,9,8,4, -170,69,35,10,255,92,47,11,255,92,47,11,255,88,45,11,255,88,45,11, -255,16,11,5,227,7,5,4,28,0,28,8,6,3,57,58,31,9,255,93, -46,12,255,88,45,11,255,14,10,5,142,0,16,6,5,3,28,19,12,6, -227,82,39,11,255,92,47,11,255,14,10,5,105,0,8,7,5,4,20,54, -29,9,255,100,50,13,255,30,19,7,255,8,6,3,85,0,255,0,21,6, -5,3,28,19,12,6,227,76,37,11,255,88,45,11,255,14,10,5,130,0, -12,7,6,4,65,17,11,6,227,71,37,10,255,88,45,11,255,92,47,11, -255,92,47,11,255,88,45,11,255,88,44,11,255,88,44,11,255,25,16,6, -255,8,6,3,142,0,24,7,5,4,85,17,12,6,229,77,39,12,255,107, -51,14,255,113,55,16,255,20,14,9,178,0,28,14,11,7,170,29,18,8, -255,74,39,11,255,88,45,11,255,88,45,11,255,92,47,11,255,92,47,11, -255,88,45,11,255,88,44,11,255,41,23,8,255,12,9,5,227,5,5,4, -23,0,12,9,7,4,170,26,17,6,255,74,39,11,255,88,45,11,255,88, -45,11,255,92,47,11,255,92,47,11,255,88,45,11,255,88,44,11,255,41, -24,8,255,12,9,5,227,6,5,3,28,0,36,6,5,3,85,16,11,5, -227,71,37,10,255,88,45,11,255,88,44,11,255,12,10,5,113,0,8,8, -6,3,28,54,29,9,255,92,47,11,255,88,44,11,255,88,45,11,255,92, -46,13,255,100,52,13,255,109,53,16,255,121,63,20,255,158,74,23,255,180, -88,27,255,183,90,28,255,26,17,11,142,0,12,10,7,5,170,26,17,6, -255,74,39,11,255,88,45,11,255,92,47,11,255,92,47,11,255,92,47,11, -255,88,45,11,255,88,45,11,255,41,24,8,255,12,9,5,227,6,5,3, -28,0,8,7,6,4,8,61,32,10,255,102,51,13,255,92,46,13,255,92, -46,13,255,92,46,13,255,92,46,13,255,92,46,13,255,90,45,11,255,84, -44,11,255,88,45,11,255,88,44,11,255,14,10,5,119,0,12,9,7,4, -153,26,17,6,255,74,39,11,255,88,45,11,255,92,47,11,255,92,47,11, -255,92,47,11,255,88,45,11,255,88,44,11,255,45,25,8,255,13,10,6, -227,7,6,4,28,0,12,17,13,10,170,64,39,21,255,155,78,26,255,169, -83,26,255,165,80,24,255,161,79,24,255,145,71,22,255,136,70,21,255,134, -69,21,255,88,50,23,255,22,17,11,232,9,8,6,31,0,84,4,4,3, -23,12,9,5,173,71,34,10,255,92,43,13,255,33,20,8,255,10,8,5, -57,0,64,20,14,7,227,83,42,12,255,92,46,13,255,19,13,6,227,6, -5,3,34,0,32,10,8,5,170,26,17,6,255,76,37,11,255,90,46,11, -255,92,46,13,255,92,46,13,255,90,45,11,255,90,45,11,255,88,44,11, -255,46,26,9,255,18,13,9,227,8,7,5,28,0,12,15,12,8,170,58, -35,19,255,134,73,23,255,153,76,24,255,142,69,21,255,131,64,20,255,121, -59,18,255,121,59,18,255,121,62,18,255,43,27,12,255,11,9,6,170,0, -16,17,13,10,170,64,39,21,255,164,85,27,255,177,86,26,255,154,75,23, -255,121,62,18,255,115,56,16,255,119,61,18,255,123,61,20,255,80,45,19, -255,22,16,11,227,8,7,5,28,0,8,13,10,8,57,96,48,19,255,165, -80,24,255,159,78,24,255,159,78,24,255,165,80,24,255,165,80,24,255,165, -80,24,255,159,78,24,255,164,81,25,255,91,52,24,255,22,17,11,227,8, -7,5,28,0,12,13,10,8,170,38,24,11,255,99,47,16,255,116,59,17, -255,126,65,21,255,142,69,21,255,153,76,24,255,157,74,24,255,155,76,24, -255,91,52,24,255,23,18,12,227,8,7,5,28,0,8,13,10,8,57,104, -52,21,255,171,84,26,255,155,76,24,255,164,81,25,255,173,81,26,255,180, -88,27,255,180,88,27,255,177,86,26,255,169,80,26,255,92,55,25,255,22, -17,11,227,8,7,5,28,0,8,13,10,8,57,114,63,25,255,177,86,26, -255,114,56,17,255,92,46,13,255,92,47,11,255,93,46,12,255,92,46,13, -255,96,48,13,255,92,46,13,255,18,12,5,91,0,8,8,6,3,40,55, -29,10,255,108,50,15,255,114,56,17,255,130,67,21,255,153,76,24,255,161, -82,24,255,171,84,26,255,179,84,26,255,179,84,26,255,25,17,10,142,0, -12,15,12,8,170,64,39,21,255,162,84,27,255,179,88,28,255,183,90,28, -255,181,89,28,255,181,89,28,255,172,88,27,255,156,77,25,255,88,50,23, -255,22,17,11,227,8,7,5,28,0,8,13,9,6,57,96,48,19,255,153, -71,22,255,134,69,21,255,20,14,9,193,0,12,11,8,6,113,124,62,25, -255,185,91,28,255,169,80,26,255,22,15,9,142,0,8,11,8,6,57,111, -61,24,255,184,90,27,255,177,86,26,255,23,16,10,173,0,40,11,8,6, -113,114,59,23,255,144,73,21,255,126,63,21,255,20,14,9,142,0,8,11, -9,6,57,97,51,20,255,152,71,23,255,134,69,21,255,20,14,9,187,0, -12,12,9,7,96,97,48,18,255,140,71,21,255,138,71,21,255,20,15,9, -142,0,8,8,6,3,40,52,28,9,255,93,50,12,255,88,45,11,255,14, -10,5,142,0,32,13,10,8,82,91,48,16,255,132,71,21,255,63,36,18, -255,10,8,7,136,0,20,7,6,6,62,31,21,12,244,124,66,23,255,134, -69,21,255,20,15,9,142,0,8,8,6,3,28,54,29,9,255,93,46,12, -255,80,39,11,255,14,10,5,142,0,12,8,6,3,57,58,31,9,255,93, -50,12,255,88,44,11,255,14,10,5,116,0,12,9,7,4,153,26,17,6, -255,74,39,11,255,88,45,11,255,88,45,11,255,88,45,11,255,88,45,11, -255,88,44,11,255,88,44,11,255,41,23,8,255,12,9,5,227,5,4,4, -17,0,8,8,6,3,34,54,29,9,255,92,43,11,255,88,44,11,255,88, -45,11,255,92,43,11,255,92,47,11,255,92,47,11,255,88,45,11,255,88, -44,11,255,45,25,8,255,12,10,5,227,6,5,3,28,0,12,13,10,6, -170,40,24,11,255,97,48,16,255,113,55,16,255,115,56,16,255,116,57,17, -255,116,57,17,255,113,55,16,255,113,55,16,255,60,33,13,255,18,14,9, -227,8,6,5,28,0,8,12,9,7,57,77,38,14,255,118,57,17,255,116, -59,17,255,118,60,17,255,109,53,16,255,98,47,13,255,92,47,11,255,88, -45,11,255,88,44,11,255,41,23,8,255,12,9,5,227,6,5,3,28,0, -12,10,8,5,170,28,18,7,255,76,37,11,255,90,45,11,255,92,46,13, -255,94,45,13,255,94,45,13,255,92,46,13,255,92,46,13,255,46,26,9, -255,13,10,6,227,6,5,5,28,0,8,7,6,4,8,61,32,10,255,100, -50,13,255,92,46,13,255,92,46,13,255,92,46,13,255,92,46,13,255,92, -46,13,255,92,46,13,255,94,47,13,255,98,49,13,255,94,47,13,255,18, -12,5,93,0,8,8,6,3,42,60,32,9,255,96,48,13,255,88,45,11, -255,14,10,5,142,0,12,8,6,3,57,58,31,9,255,93,50,12,255,88, -44,11,255,12,10,5,113,0,8,8,6,3,28,54,29,9,255,93,50,12, -255,88,44,11,255,14,10,5,142,0,12,8,6,3,57,58,31,9,255,93, -50,12,255,88,44,11,255,12,10,5,113,0,8,8,6,3,28,54,29,9, -255,93,50,12,255,88,44,11,255,14,10,5,142,0,20,8,6,3,57,58, -31,9,255,93,50,12,255,88,44,11,255,12,10,5,113,0,8,7,6,4, -28,54,29,9,255,93,50,12,255,88,45,11,255,14,10,5,142,0,12,8, -7,3,57,60,31,9,255,96,48,13,255,92,46,13,255,14,10,5,127,0, -8,10,8,5,57,82,42,15,255,135,66,20,255,121,60,20,255,20,15,9, -176,0,12,11,9,6,108,107,56,22,255,172,84,25,255,158,74,23,255,22, -15,9,142,0,8,11,8,6,54,98,51,19,255,142,72,21,255,136,70,21, -255,138,71,21,255,121,59,18,255,100,52,13,255,90,46,11,255,88,44,11, -255,88,44,11,255,88,44,11,255,88,45,11,255,12,10,5,113,0,8,8, -6,3,28,54,29,9,255,92,47,11,255,88,44,11,255,92,47,11,255,92, -47,11,255,18,12,5,85,0,8,7,6,4,45,54,30,9,255,94,47,13, -255,31,20,8,255,9,7,4,85,0,32,8,6,3,48,65,33,10,255,114, -55,15,255,119,58,18,255,126,63,21,255,128,66,21,255,22,15,9,164,0, -20,5,5,4,28,19,14,10,227,141,72,26,255,43,27,16,255,7,6,6, -85,0,72,14,10,7,71,96,49,17,255,138,71,21,255,130,67,21,255,22, -15,9,164,0,68,12,9,7,76,77,39,14,255,118,57,17,255,109,53,16, -255,22,15,9,153,0,132,11,8,6,96,103,53,20,255,144,73,21,255,121, -60,20,255,24,16,9,153,0,80,15,12,8,184,61,36,20,255,141,68,24, -255,168,82,25,255,171,84,26,255,26,18,11,159,0,68,9,7,4,57,60, -32,9,255,96,48,13,255,92,46,13,255,19,12,6,142,0,40,14,10,7, -76,129,67,26,255,190,97,29,255,180,88,27,255,26,17,11,161,0,24,14, -10,7,85,129,67,26,255,190,97,29,255,180,88,27,255,25,17,10,125,0, -8,11,8,6,57,109,60,24,255,175,86,26,255,142,73,23,255,20,14,9, -187,0,40,12,9,7,93,121,65,24,255,183,89,26,255,168,82,25,255,21, -15,10,178,0,255,0,193,10,8,5,170,39,23,8,255,78,41,11,255,16, -11,5,142,0,255,0,141,6,5,3,85,16,11,5,227,71,37,10,255,92, -47,11,255,92,47,11,255,18,12,5,85,0,8,8,6,3,28,54,29,9, -255,93,46,12,255,88,45,11,255,12,10,5,113,0,12,58,31,9,255,93, -50,12,255,88,45,11,255,25,17,6,255,8,6,3,142,0,24,4,4,3, -25,10,8,5,173,65,33,10,255,92,46,13,255,92,46,13,255,67,34,10, -255,27,18,8,255,9,7,4,156,3,3,2,85,10,8,5,184,69,35,10, -255,19,13,6,147,0,40,9,7,4,113,112,55,13,255,141,69,16,255,141, -75,16,255,18,13,5,170,0,4,8,6,3,85,110,54,13,255,143,76,16, -255,139,68,16,255,19,13,6,170,0,4,8,6,3,85,110,54,13,255,143, -76,16,255,141,72,16,255,23,15,6,170,0,12,10,9,5,110,35,21,8, -255,129,63,14,255,141,69,16,255,139,68,16,255,52,27,9,255,9,7,4, -255,27,17,8,255,135,66,16,255,154,75,17,255,155,79,18,255,91,50,16, -255,20,15,9,207,10,9,7,28,0,16,5,4,4,20,8,6,3,127,31, -20,8,255,130,66,15,255,143,76,16,255,143,76,16,255,67,34,10,255,10, -8,5,215,10,8,5,170,13,10,6,142,7,5,4,23,0,8,12,9,5, -85,115,59,14,255,149,72,16,255,143,76,16,255,18,12,5,235,0,16,7, -6,4,28,14,10,5,227,92,46,13,255,143,73,16,255,143,70,16,255,18, -13,5,170,0,12,14,10,5,170,53,28,10,255,114,56,13,255,56,29,9, -255,16,11,5,255,34,20,7,255,112,55,13,255,87,42,12,255,19,13,6, -235,8,7,5,40,0,24,10,8,5,85,114,56,13,255,143,70,16,255,141, -72,16,255,23,15,6,170,0,12,7,6,4,28,14,10,5,227,90,44,13, -255,112,57,13,255,47,26,8,255,11,8,4,57,0,12,25,16,6,227,96, -48,13,255,112,57,13,255,26,16,7,255,8,6,5,85,0,24,13,10,6, -85,8,7,5,57,0,20,6,5,3,28,15,11,6,85,9,7,4,28,0, -36,9,7,4,105,10,8,5,170,10,8,5,130,6,5,3,23,0,156,8, -6,3,136,77,39,12,255,143,73,16,255,139,74,16,255,18,12,5,170,0, -12,21,14,6,227,112,57,13,255,141,69,16,255,80,40,11,255,16,11,5, -255,14,10,5,227,18,13,5,255,72,35,11,255,136,69,15,255,130,66,15, -255,46,26,9,255,8,6,3,105,0,16,8,7,5,57,42,27,13,255,150, -79,21,255,184,94,21,255,195,99,22,255,199,106,24,255,26,18,11,255,0, -24,10,8,7,99,83,45,18,255,144,74,17,255,143,70,16,255,94,47,13, -255,18,13,5,255,16,11,5,173,14,10,5,227,52,27,9,255,132,67,15, -255,139,68,16,255,75,39,12,255,10,7,5,116,0,8,6,5,3,57,52, -27,9,255,137,73,16,255,143,76,16,255,94,47,13,255,18,13,5,255,16, -11,5,173,14,10,5,227,52,27,9,255,132,67,15,255,139,74,16,255,75, -39,12,255,10,8,5,142,0,32,8,6,5,85,22,15,7,255,102,51,13, -255,137,67,16,255,140,71,15,255,141,75,16,255,20,13,5,170,0,8,9, -6,4,85,108,55,13,255,141,69,16,255,139,74,16,255,74,36,11,255,18, -12,7,255,20,13,7,181,22,15,9,207,20,13,9,238,18,13,9,252,23, -16,10,255,31,21,12,218,14,11,7,42,0,8,7,6,4,57,40,22,9, -255,130,66,15,255,141,75,16,255,84,42,11,255,18,12,5,255,16,12,5, -181,14,10,5,241,69,35,10,255,140,69,17,255,154,78,17,255,117,60,18, -255,17,13,8,142,0,12,21,14,8,190,28,18,9,255,23,15,8,255,21, -14,8,255,21,14,8,255,23,15,8,255,38,24,11,255,98,53,17,255,151, -74,18,255,150,76,17,255,141,75,16,255,21,15,6,170,0,8,5,4,2, -28,33,20,8,255,130,66,15,255,141,72,16,255,84,42,11,255,18,12,5, -255,18,12,5,176,14,10,5,235,57,29,10,255,140,72,17,255,165,85,20, -255,121,67,24,255,14,11,7,142,0,8,8,6,5,57,72,46,23,255,198, -113,29,255,200,102,23,255,131,68,22,255,33,21,12,255,17,13,8,255,21, -14,8,255,88,47,19,255,192,99,23,255,203,113,26,255,146,87,29,255,13, -11,8,164,0,12,10,8,5,85,13,10,6,170,11,9,6,142,7,6,4, -28,0,12,13,10,8,113,18,14,9,170,16,13,9,147,10,8,7,28,0, -24,10,8,7,28,20,15,11,227,104,62,21,255,184,94,21,255,117,62,22, -255,17,12,8,227,7,5,4,28,0,64,11,8,6,170,67,35,16,255,164, -85,21,255,115,58,16,255,20,14,7,252,8,6,5,85,0,24,9,7,4, -82,66,37,13,255,145,75,18,255,154,78,17,255,115,58,16,255,29,18,8, -255,14,10,7,255,16,11,7,255,65,34,12,255,150,74,19,255,189,97,22, -255,138,79,27,255,14,12,9,142,0,8,7,6,6,57,55,33,16,255,158, -81,19,255,162,80,19,255,102,53,17,255,24,15,7,255,19,12,6,170,14, -10,5,204,46,26,9,255,137,67,16,255,139,71,16,255,49,27,10,255,7, -6,4,105,0,8,7,6,6,62,72,46,23,255,199,115,32,255,205,111,28, -255,155,84,26,255,41,24,14,255,18,13,9,255,25,16,10,255,110,61,25, -255,199,100,28,255,205,112,30,255,146,87,29,255,13,11,8,142,0,8,10, -8,7,147,180,87,25,255,206,111,27,255,203,105,26,255,164,85,27,255,40, -24,15,255,20,14,9,255,26,17,11,255,121,64,26,255,201,101,28,255,205, -112,30,255,146,87,29,255,14,11,7,142,0,8,8,6,5,57,71,44,22, -255,192,108,25,255,198,101,23,255,150,78,25,255,41,24,14,255,32,21,13, -255,74,41,21,255,184,105,27,255,202,104,25,255,202,118,27,255,174,102,31, -255,17,14,10,142,0,8,11,9,6,136,182,92,25,255,206,112,29,255,205, -111,28,255,166,79,27,255,43,25,16,255,21,15,10,255,29,19,12,255,116, -67,27,255,202,107,31,255,206,113,31,255,146,87,29,255,12,10,7,142,0, -8,11,8,6,144,185,93,26,255,202,103,23,255,157,77,18,255,83,42,12, -255,19,13,6,255,13,10,6,255,20,13,7,255,27,17,8,255,28,18,9, -227,10,8,5,45,0,8,11,9,6,142,139,73,20,255,198,96,21,255,199, -106,24,255,155,78,26,255,41,25,14,255,21,15,10,255,28,18,11,255,38, -24,15,255,40,24,15,227,14,10,7,62,0,8,8,7,5,57,65,41,20, -255,197,108,28,255,205,111,28,255,170,88,27,255,43,27,16,255,19,14,10, -255,29,19,12,255,123,66,24,255,181,84,20,255,170,87,19,255,114,60,17, -255,11,10,6,142,0,8,11,9,6,85,119,60,15,255,154,75,17,255,154, -78,17,255,18,13,7,255,0,12,13,10,8,170,191,102,30,255,209,118,30, -255,207,113,30,255,28,19,11,201,0,8,13,10,8,105,166,87,23,255,198, -101,23,255,198,97,23,255,26,18,11,255,0,40,13,10,8,170,189,100,28, -255,206,111,27,255,204,102,27,255,28,20,11,201,0,8,12,10,7,116,184, -93,27,255,206,107,27,255,203,113,26,255,23,17,10,255,0,8,6,5,5, -28,25,18,12,244,192,105,27,255,206,112,29,255,207,117,30,255,32,22,13, -170,0,8,11,9,6,88,112,57,13,255,143,70,16,255,141,69,16,255,17, -12,6,227,0,32,14,11,9,170,184,92,25,255,206,111,27,255,192,111,31, -255,49,33,18,255,10,8,7,122,0,12,7,7,6,59,22,16,11,232,167, -100,28,255,205,112,30,255,205,116,30,255,26,18,11,210,0,8,8,7,3, -85,110,54,13,255,141,69,16,255,141,75,16,255,25,16,6,255,5,4,4, -40,0,8,10,8,5,85,112,55,13,255,141,75,16,255,141,75,16,255,20, -13,5,170,0,8,5,4,2,28,33,20,8,255,130,66,15,255,141,72,16, -255,112,55,13,255,45,25,8,255,26,17,6,255,33,20,8,255,94,47,13, -255,141,69,16,255,144,71,17,255,80,40,13,255,9,7,4,125,0,8,10, -8,5,85,112,57,13,255,148,79,17,255,141,75,16,255,87,42,12,255,19, -13,6,255,14,10,5,215,15,10,6,255,60,31,11,255,143,71,18,255,160, -82,19,255,96,54,17,255,12,9,7,142,0,8,8,6,5,57,71,44,22, -255,192,100,25,255,199,106,24,255,185,93,26,255,91,50,22,255,58,33,17, -255,72,41,19,255,158,81,25,255,199,106,24,255,199,106,24,255,138,79,27, -255,13,11,8,142,0,8,10,8,7,147,166,87,23,255,203,108,24,255,202, -108,25,255,153,77,26,255,38,22,13,255,15,11,6,255,14,10,5,255,52, -28,9,255,132,70,15,255,141,75,16,255,80,41,13,255,10,8,5,139,0, -8,7,6,6,57,48,29,13,255,154,79,19,255,160,85,19,255,108,56,17, -255,30,18,9,255,16,11,7,255,24,15,9,255,96,51,17,255,167,86,20, -255,181,88,20,255,140,75,23,255,18,14,9,144,0,12,22,14,7,193,22, -13,7,255,20,13,7,255,78,40,15,255,165,81,20,255,177,90,20,255,177, -90,20,255,115,58,20,255,32,20,11,255,24,15,9,255,30,19,9,227,11, -8,6,54,0,8,11,9,6,142,139,68,20,255,166,78,19,255,144,71,17, -255,19,12,6,215,0,12,9,7,4,136,114,56,13,255,143,70,16,255,139, -68,16,255,19,13,6,170,0,8,10,7,5,85,112,55,13,255,143,70,16, -255,139,74,16,255,17,11,6,221,0,12,9,7,4,136,114,56,13,255,143, -70,16,255,141,75,16,255,20,13,5,170,0,8,9,6,4,85,110,54,13, -255,141,69,16,255,141,72,16,255,17,11,6,221,0,20,9,7,4,136,114, -56,13,255,143,73,16,255,139,74,16,255,19,13,6,170,0,8,8,6,3, -85,110,54,13,255,143,76,16,255,141,69,16,255,18,12,5,252,0,12,11, -9,6,170,131,69,18,255,170,87,19,255,168,86,19,255,28,19,9,170,0, -8,11,8,6,85,145,74,26,255,204,102,27,255,203,105,26,255,52,33,17, -255,6,5,5,57,0,8,17,14,10,227,190,107,25,255,204,113,25,255,174, -86,27,255,18,13,9,170,0,12,28,18,11,198,37,23,14,255,32,21,13, -255,21,15,10,255,20,14,9,255,38,23,11,255,87,44,12,255,137,70,16, -255,141,72,16,255,143,70,16,255,141,72,16,255,18,12,5,170,0,8,9, -6,4,85,110,54,13,255,145,74,16,255,141,69,16,255,94,47,13,255,27, -17,8,227,12,8,5,28,0,8,14,10,7,85,121,62,18,255,172,87,19, -255,139,69,18,255,20,15,9,227,0,36,21,14,8,227,117,61,24,255,199, -100,28,255,205,106,26,255,204,110,27,255,26,18,11,255,0,16,8,7,5, -28,20,15,11,227,135,73,22,255,192,97,21,255,165,83,22,255,33,22,12, -255,10,9,7,85,0,68,11,9,6,170,184,97,27,255,206,112,29,255,204, -110,27,255,28,19,11,255,0,68,14,11,7,170,179,93,24,255,202,103,23, -255,198,97,23,255,22,15,9,255,0,132,9,7,6,170,125,63,18,255,158, -77,17,255,146,75,17,255,17,12,6,255,0,76,8,6,5,76,72,46,23, -255,197,108,28,255,201,107,24,255,164,85,27,255,37,22,14,227,13,9,6, -48,0,68,12,9,7,170,138,67,19,255,170,79,19,255,168,86,19,255,20, -14,9,255,0,40,8,7,5,20,21,15,10,184,26,17,11,255,26,17,11, -215,12,9,7,74,0,24,8,7,5,20,21,15,10,184,26,17,11,255,31, -21,12,207,18,13,9,28,0,8,11,9,8,156,184,93,27,255,208,105,29, -255,205,111,28,255,28,19,11,255,0,40,14,11,7,170,184,92,25,255,203, -104,24,255,200,98,23,255,26,18,11,255,0,255,0,189,8,7,5,57,51, -29,12,255,152,75,19,255,162,86,19,255,19,13,8,246,0,255,0,137,6, -5,3,28,19,13,6,249,92,46,13,255,123,63,14,255,78,39,11,255,21, -15,6,227,9,8,4,28,0,8,9,8,4,85,110,59,13,255,141,69,16, -255,141,75,16,255,21,14,6,170,0,12,16,11,5,170,52,28,9,255,115, -59,14,255,116,60,15,255,43,26,10,255,9,7,6,125,0,16,8,7,5, -28,21,17,10,227,109,59,18,255,160,82,19,255,121,64,18,255,62,34,13, -255,94,53,17,255,149,78,20,255,102,54,19,255,32,22,11,255,72,39,15, -255,121,62,18,255,24,17,9,187,0,40,8,6,3,167,128,66,15,255,161, -85,17,255,159,81,18,255,24,15,7,178,0,4,6,5,3,37,48,28,11, -255,173,92,20,255,181,96,20,255,21,15,8,221,0,4,6,5,3,28,40, -24,9,255,143,74,18,255,158,80,17,255,21,15,6,181,0,8,10,8,5, -54,107,51,14,255,157,83,18,255,164,84,19,255,176,89,19,255,189,92,20, -255,191,98,22,255,190,106,23,255,197,110,26,255,203,108,24,255,203,117,24, -255,205,119,26,255,207,122,30,255,199,118,32,255,32,23,13,170,0,12,7, -6,4,85,22,15,7,232,113,54,14,255,146,75,17,255,158,80,17,255,154, -78,17,255,158,80,17,255,148,76,17,255,139,71,16,255,135,66,16,255,135, -66,16,255,21,14,6,136,0,8,10,8,5,85,128,66,15,255,161,85,17, -255,158,80,17,255,25,16,6,204,0,12,7,6,4,28,25,16,8,227,102, -50,15,255,148,76,17,255,142,73,17,255,84,45,13,255,10,8,5,113,0, -8,9,7,4,82,107,53,14,255,146,75,17,255,84,41,13,255,8,7,5, -198,3,2,2,23,5,4,4,136,38,23,9,255,136,70,17,255,140,72,17, -255,21,15,6,178,0,24,7,6,4,57,45,26,10,255,143,74,18,255,158, -80,17,255,26,17,6,170,0,12,24,16,7,227,115,58,16,255,148,76,17, -255,46,26,9,255,7,6,4,156,0,16,5,4,4,71,19,13,6,255,139, -71,16,255,140,72,17,255,43,26,10,255,9,8,4,85,0,16,14,10,5, -85,109,52,14,255,38,23,9,255,6,5,3,85,0,12,4,4,3,28,15, -12,6,227,115,56,16,255,29,19,8,170,0,32,13,10,6,113,122,64,21, -255,164,85,21,255,138,71,17,255,21,15,6,161,0,156,13,10,6,227,137, -67,16,255,154,75,17,255,84,45,13,255,10,8,5,116,0,8,9,7,4, -85,111,55,14,255,158,87,17,255,158,80,17,255,19,13,6,255,4,4,3, -28,0,4,3,3,2,113,17,12,6,255,139,71,16,255,161,85,17,255,146, -75,17,255,20,14,7,210,0,16,16,13,9,110,184,105,27,255,209,123,30, -255,210,124,31,255,208,123,31,255,207,122,30,255,27,20,12,255,0,24,13, -11,8,147,143,75,20,255,161,85,17,255,158,80,17,255,27,18,8,227,5, -4,2,28,0,8,10,7,5,198,131,65,16,255,161,85,17,255,150,76,17, -255,21,14,6,170,0,8,10,8,5,85,123,61,16,255,163,83,18,255,158, -80,17,255,27,18,8,227,5,4,2,28,0,8,9,7,4,198,130,66,15, -255,163,83,18,255,148,76,17,255,21,14,6,193,0,28,7,6,4,85,22, -15,7,255,131,65,16,255,154,78,17,255,154,78,17,255,154,78,17,255,154, -78,17,255,21,15,6,170,0,8,10,8,5,85,129,64,16,255,163,86,18, -255,180,91,19,255,29,20,10,255,3,3,2,93,0,36,10,8,5,122,121, -60,16,255,161,85,17,255,159,81,18,255,24,15,7,255,4,4,3,34,0, -4,2,2,1,6,17,13,8,181,181,93,22,255,203,108,24,255,205,114,26, -255,32,23,13,210,0,36,5,4,4,161,30,22,13,255,198,116,29,255,206, -106,25,255,191,96,20,255,26,17,7,170,0,8,9,7,4,85,116,60,15, -255,161,85,17,255,158,80,17,255,21,14,6,255,5,4,2,28,0,4,2, -2,1,3,12,9,7,215,190,107,25,255,211,124,30,255,208,134,37,255,32, -22,13,178,0,8,13,11,8,96,187,112,32,255,209,123,30,255,191,96,20, -255,28,19,9,255,4,3,3,74,0,4,3,2,2,28,13,10,8,227,196, -120,31,255,211,124,30,255,199,106,24,255,27,19,10,170,0,8,13,10,6, -57,114,61,19,255,178,91,21,255,182,102,23,255,23,17,10,173,0,8,11, -9,6,91,146,85,25,255,198,113,29,255,196,120,31,255,27,20,12,207,0, -20,5,5,4,28,21,17,12,227,190,118,33,255,209,131,40,255,161,100,34, -255,17,14,10,227,5,5,4,28,0,72,9,8,6,170,91,59,28,255,189, -94,24,255,162,83,19,255,39,25,12,255,7,7,6,85,0,20,13,11,8, -142,183,103,24,255,203,112,24,255,203,112,24,255,42,26,13,249,5,4,4, -62,0,4,3,2,2,25,12,9,7,227,195,115,30,255,212,127,35,255,211, -132,38,255,32,22,13,181,0,8,12,10,7,85,124,65,17,255,161,85,17, -255,159,78,18,255,21,14,6,255,5,4,2,28,0,8,7,6,4,224,133, -68,16,255,159,81,18,255,146,72,17,255,22,14,7,170,0,8,13,11,8, -91,185,111,32,255,210,125,33,255,205,114,26,255,37,26,14,255,4,4,3, -85,0,4,4,4,4,28,13,10,8,227,193,105,26,255,206,111,27,255,202, -118,27,255,32,22,13,170,0,8,11,9,6,127,174,91,23,255,202,102,21, -255,200,105,21,255,36,23,13,255,4,4,3,85,0,4,3,3,2,28,13, -11,8,227,198,118,33,255,212,127,35,255,208,128,33,255,31,22,12,181,0, -8,13,11,8,91,185,114,30,255,211,124,30,255,208,122,29,255,34,24,13, -255,4,4,3,85,0,4,7,6,6,113,32,24,13,255,185,95,22,255,202, -98,21,255,198,97,23,255,33,22,12,170,0,8,10,8,7,156,190,108,27, -255,212,126,33,255,211,127,36,255,40,26,15,255,4,4,3,85,0,4,3, -3,2,28,13,11,8,227,198,118,33,255,214,129,37,255,211,132,38,255,32, -23,13,173,0,8,10,8,7,144,167,87,22,255,185,94,20,255,165,87,18, -255,25,17,8,255,3,3,2,57,0,28,13,11,8,170,195,112,30,255,210, -125,33,255,208,117,29,255,39,26,14,255,4,4,3,85,0,28,12,10,7, -150,184,108,27,255,211,124,30,255,211,127,36,255,40,27,15,255,4,4,3, -85,0,4,3,3,2,28,17,13,8,178,138,71,17,255,161,85,17,255,155, -79,18,255,21,14,6,170,0,8,10,8,5,85,124,61,15,255,169,89,18, -255,180,91,19,255,25,18,10,255,0,12,13,11,8,170,196,113,31,255,211, -124,30,255,205,119,26,255,26,18,11,204,0,8,11,9,6,88,134,70,19, -255,173,87,18,255,168,86,19,255,20,13,7,255,0,40,13,11,8,170,196, -113,31,255,210,125,33,255,207,122,30,255,24,18,11,212,0,8,11,9,6, -119,180,93,23,255,203,108,24,255,202,103,23,255,20,15,9,255,0,8,15, -13,10,195,101,63,26,255,202,117,25,255,206,128,35,255,160,106,35,255,15, -13,10,142,0,8,10,8,5,147,139,70,20,255,191,96,20,255,200,105,21, -255,25,18,10,255,0,32,13,10,8,170,189,99,26,255,206,115,27,255,205, -106,26,255,185,106,28,255,79,52,26,255,10,9,7,122,0,4,7,6,6, -42,36,27,17,244,172,106,35,255,207,128,34,255,211,126,34,255,211,127,36, -255,24,18,11,227,0,8,10,8,5,85,124,64,15,255,159,81,18,255,158, -80,17,255,76,40,13,255,11,8,6,210,0,8,12,9,5,85,129,64,16, -255,161,85,17,255,158,80,17,255,26,16,7,170,0,8,9,7,4,85,115, -56,16,255,161,85,17,255,159,81,18,255,49,27,10,255,7,6,4,170,5, -4,4,85,6,5,3,113,26,19,11,255,185,95,22,255,202,102,21,255,197, -104,22,255,28,20,11,173,0,8,13,10,6,102,167,87,22,255,200,101,21, -255,201,102,22,255,32,21,11,255,4,3,3,65,0,4,2,2,1,17,12, -10,7,221,190,98,23,255,208,116,27,255,204,110,27,255,30,21,11,181,0, -8,13,11,8,91,185,114,30,255,211,124,30,255,209,123,30,255,86,55,25, -255,9,8,6,187,6,6,5,85,7,6,6,130,32,24,15,255,200,122,31, -255,209,123,30,255,206,122,31,255,32,23,13,173,0,8,10,8,7,144,191, -113,30,255,212,127,35,255,210,126,35,255,40,27,15,255,4,4,3,85,0, -4,2,2,1,8,11,9,6,212,157,81,20,255,189,92,20,255,190,97,21, -255,27,19,10,178,0,8,12,10,7,96,183,105,28,255,209,123,30,255,205, -114,26,255,36,24,13,255,4,4,3,85,0,4,4,4,4,28,18,14,9, -187,195,115,30,255,211,124,30,255,210,130,35,255,35,26,14,210,0,20,3, -2,2,28,12,10,7,227,195,115,30,255,211,124,30,255,209,123,30,255,38, -25,15,255,4,4,3,85,0,20,13,11,8,170,194,115,31,255,209,122,28, -255,196,99,21,255,21,15,8,255,0,12,11,9,6,170,153,79,20,255,187, -91,20,255,181,96,20,255,30,20,9,178,0,8,13,10,6,96,151,79,20, -255,187,91,20,255,181,96,20,255,22,16,9,255,0,12,12,9,7,170,146, -76,19,255,167,88,18,255,158,77,17,255,23,15,6,170,0,8,10,8,5, -85,133,66,16,255,167,88,18,255,168,86,19,255,22,16,9,255,0,20,12, -9,7,170,155,80,20,255,185,94,20,255,181,96,20,255,22,16,9,221,0, -8,6,6,5,42,51,29,12,255,150,81,19,255,165,87,18,255,42,26,11, -255,5,5,4,108,0,4,5,5,4,28,18,15,11,255,195,114,28,255,207, -123,32,255,158,94,31,255,17,13,10,142,0,8,6,5,5,57,50,34,19, -255,191,111,32,255,208,117,29,255,113,73,30,255,10,10,9,227,6,6,5, -125,7,7,6,198,42,29,17,255,187,96,22,255,166,87,23,255,42,27,15, -255,8,6,5,110,0,32,5,5,4,184,21,16,8,255,106,54,15,255,154, -78,17,255,151,77,18,255,92,48,15,255,11,9,6,119,0,8,10,8,5, -93,131,69,18,255,189,92,20,255,200,105,21,255,33,22,12,255,5,4,4, -54,0,12,9,8,6,85,76,53,25,255,200,118,31,255,204,114,27,255,65, -43,22,255,6,6,5,113,0,32,4,3,3,17,14,11,9,227,195,111,28, -255,206,115,27,255,204,105,25,255,24,17,11,255,0,12,5,5,4,28,13, -10,6,227,125,66,18,255,165,84,18,255,161,85,17,255,161,85,17,255,155, -79,18,255,28,19,9,255,6,5,3,85,0,64,11,9,8,68,86,56,27, -255,204,126,33,255,210,125,33,255,30,21,13,255,0,68,13,11,8,170,195, -115,30,255,209,123,30,255,207,122,30,255,27,19,12,255,3,3,2,28,0, -128,7,6,4,184,131,65,16,255,161,85,17,255,154,78,17,255,15,11,6, -249,0,76,10,8,7,173,166,87,23,255,198,104,21,255,196,99,21,255,35, -23,12,255,3,3,2,85,0,72,13,11,8,170,194,115,31,255,211,124,30, -255,207,122,30,255,27,19,12,255,3,3,2,28,0,108,13,11,8,170,196, -113,31,255,213,132,36,255,211,127,36,255,30,21,13,255,0,40,11,9,6, -170,155,80,20,255,185,94,20,255,180,91,19,255,21,15,8,255,0,255,0, -189,10,8,7,184,183,100,26,255,208,116,27,255,204,114,27,255,26,18,11, -255,4,4,4,28,0,255,0,133,10,8,5,127,119,60,15,255,160,85,19, -255,91,48,16,255,10,8,5,227,4,4,3,28,0,12,9,7,4,161,131, -67,16,255,159,81,18,255,159,78,18,255,18,13,7,249,0,16,7,6,4, -170,57,34,14,255,176,90,21,255,195,95,22,255,26,19,11,232,0,16,17, -14,10,99,179,106,28,255,207,122,30,255,180,109,33,255,25,20,12,255,7, -6,6,170,20,17,11,255,196,114,27,255,208,117,29,255,203,124,30,255,172, -106,35,255,53,36,20,255,10,9,7,108,0,40,9,8,6,170,159,82,20, -255,202,103,23,255,206,111,27,255,22,17,11,255,0,8,10,9,7,139,115, -74,30,255,213,133,48,255,39,28,16,255,0,8,9,8,4,113,67,39,14, -255,181,92,20,255,24,18,9,255,0,12,28,19,9,227,139,79,26,255,206, -117,31,255,212,123,37,255,214,126,41,255,172,106,35,255,53,34,18,255,122, -78,31,255,211,127,44,255,217,136,50,255,216,135,49,255,190,122,41,255,65, -43,22,255,14,11,7,85,0,8,7,6,4,28,29,21,10,249,153,79,20, -255,174,85,19,255,103,53,16,255,17,12,6,244,19,13,6,170,21,14,6, -170,27,17,6,170,21,14,6,212,21,14,6,255,25,17,6,224,12,9,5, -45,0,12,24,16,7,153,22,15,7,255,26,16,7,210,12,9,5,40,0, -8,8,7,5,28,17,13,8,227,114,61,19,255,174,85,19,255,154,79,19, -255,60,33,13,255,11,9,6,170,0,12,10,8,5,170,146,79,19,255,180, -87,19,255,67,39,14,255,8,6,5,85,0,8,24,17,9,255,143,75,20, -255,162,80,19,255,22,15,7,215,0,28,8,7,5,110,60,33,13,255,166, -78,19,255,22,15,7,227,0,8,7,6,4,85,91,51,16,255,174,88,19, -255,169,78,18,255,25,17,8,255,3,3,2,8,0,20,11,9,6,178,143, -74,18,255,177,89,18,255,138,75,19,255,18,13,7,176,0,16,9,7,4, -28,29,19,8,232,41,25,10,255,17,13,8,255,9,8,6,116,0,4,7, -6,4,59,14,11,7,227,32,21,9,255,40,24,9,255,12,9,5,105,0, -32,14,11,9,170,199,124,36,255,213,119,36,255,202,102,21,255,20,14,7, -246,0,152,8,7,5,142,53,31,12,255,162,86,19,255,121,64,18,255,19, -14,8,252,6,5,3,28,0,8,10,8,5,125,142,74,19,255,180,91,19, -255,183,89,19,255,19,14,8,255,0,4,5,5,4,6,15,13,10,193,69, -42,18,255,171,91,20,255,189,88,20,255,200,101,21,255,31,21,12,255,0, -16,10,8,7,28,30,21,13,227,150,92,35,255,208,121,37,255,211,115,30, -255,208,117,29,255,28,21,13,255,0,24,10,8,7,28,22,15,7,198,26, -17,7,255,24,15,7,221,9,7,4,57,0,12,8,7,5,156,171,89,22, -255,202,107,23,255,202,103,23,255,23,18,10,249,0,12,26,18,9,198,29, -19,8,255,24,16,7,215,10,8,5,51,0,12,10,8,5,85,134,70,19, -255,175,88,18,255,173,87,18,255,20,14,7,255,0,24,10,8,5,85,26, -19,9,255,107,58,18,255,154,83,19,255,168,79,19,255,169,78,18,255,173, -87,18,255,172,80,19,255,26,17,7,170,0,8,11,10,8,136,189,99,26, -255,210,115,31,255,216,129,45,255,143,96,40,255,15,13,10,227,12,12,11, -170,15,13,12,170,13,12,10,170,13,12,10,136,9,8,8,85,0,16,11, -9,6,170,169,91,22,255,202,103,23,255,203,108,24,255,18,15,9,255,0, -12,6,5,5,23,28,19,11,156,31,22,12,255,34,24,13,227,14,11,7, -85,0,36,9,8,8,142,72,54,31,255,215,147,60,255,218,146,61,255,174, -100,35,255,14,11,7,142,0,8,11,8,6,102,142,74,19,255,185,86,20, -255,195,98,20,255,18,14,9,249,0,12,10,8,7,170,202,131,47,255,220, -152,63,255,220,151,61,255,22,19,13,252,0,8,11,9,8,167,203,135,46, -255,217,139,48,255,210,120,33,255,18,14,9,255,0,12,9,8,6,170,198, -117,37,255,211,115,30,255,202,102,21,255,34,22,11,176,0,8,13,11,8, -170,202,122,37,255,218,144,49,255,217,144,50,255,28,21,13,255,0,8,12, -11,9,170,204,122,41,255,217,135,46,255,215,136,42,255,46,33,19,255,0, -16,10,9,7,28,21,19,14,227,153,104,46,255,214,149,55,255,158,103,39, -255,16,14,11,221,7,6,6,28,0,20,20,18,13,142,31,26,18,170,25, -21,16,170,24,20,15,170,24,20,15,170,24,20,15,170,24,21,15,170,31, -26,18,170,25,21,16,170,14,12,9,31,0,20,10,9,7,167,75,51,26, -255,202,117,33,255,186,120,43,255,41,32,20,255,12,11,9,85,0,16,11, -9,8,28,31,22,12,215,49,33,18,255,41,27,16,227,12,10,7,85,0, -12,14,12,9,170,204,137,51,255,220,152,63,255,220,151,61,255,23,19,12, -252,0,8,11,10,6,85,136,70,17,255,175,88,18,255,169,78,18,255,15, -11,6,255,0,8,9,8,6,85,26,19,9,255,153,82,18,255,177,89,18, -255,180,84,19,255,24,17,9,218,0,8,11,9,8,147,196,115,35,255,215, -125,38,255,214,125,39,255,20,16,11,255,0,12,9,8,6,159,165,86,22, -255,197,99,20,255,195,90,20,255,32,21,11,170,0,8,12,10,7,85,145, -76,20,255,189,92,20,255,191,96,20,255,18,14,9,255,0,12,9,8,6, -170,199,126,39,255,217,133,50,255,217,144,50,255,23,18,12,252,0,8,11, -10,8,142,191,105,28,255,206,111,27,255,203,104,24,255,19,15,10,255,0, -12,9,8,6,57,21,15,8,198,28,19,9,255,32,21,11,227,11,9,6, -76,0,8,11,9,8,170,203,125,42,255,220,146,59,255,219,146,60,255,24, -19,13,255,0,12,11,10,8,170,204,136,47,255,220,146,59,255,218,147,55, -255,25,19,12,232,0,8,11,10,8,119,161,87,22,255,195,98,20,255,202, -103,23,255,18,15,9,255,0,32,14,12,9,170,200,125,37,255,214,124,37, -255,205,106,26,255,20,16,9,221,0,32,16,13,9,170,205,130,42,255,219, -144,56,255,219,146,60,255,24,19,13,255,0,12,6,5,3,23,21,14,6, -170,26,16,7,255,26,17,7,224,14,10,5,31,0,8,11,9,6,125,170, -89,23,255,211,115,30,255,214,126,41,255,23,19,12,255,0,12,11,10,8, -170,195,112,30,255,206,106,25,255,200,105,21,255,29,20,10,170,0,8,11, -9,6,85,134,70,19,255,177,85,18,255,172,80,19,255,18,13,7,255,0, -40,14,12,9,170,195,112,30,255,206,111,27,255,202,103,23,255,31,22,10, -170,0,8,13,10,6,85,151,79,20,255,189,92,20,255,183,89,19,255,17, -13,8,255,0,4,8,7,5,59,57,34,16,255,184,97,27,255,198,115,33, -255,114,77,33,255,16,14,11,210,6,5,5,8,0,8,12,10,7,170,195, -113,32,255,215,123,42,255,217,133,50,255,32,24,15,255,0,32,12,11,7, -170,175,90,22,255,198,104,21,255,189,92,20,255,192,97,21,255,189,97,22, -255,45,29,14,255,10,9,7,210,22,17,11,255,183,102,30,255,212,121,41, -255,216,135,49,255,217,137,52,255,214,125,39,255,29,21,12,204,0,8,11, -9,6,85,143,75,20,255,193,97,20,255,195,98,20,255,180,93,23,255,88, -54,23,255,11,10,8,113,0,4,14,12,7,85,170,89,23,255,202,103,23, -255,202,102,21,255,32,22,11,178,0,8,12,10,7,113,176,91,23,255,205, -105,24,255,209,117,28,255,39,28,16,255,5,5,5,28,0,8,15,14,10, -198,206,132,45,255,217,133,50,255,215,133,44,255,25,19,12,232,0,8,11, -10,8,125,198,118,39,255,218,145,51,255,218,146,53,255,20,17,11,255,0, -12,9,8,6,170,198,124,37,255,216,134,45,255,214,139,41,255,22,18,11, -255,0,8,11,10,8,136,191,105,28,255,206,111,27,255,206,106,25,255,36, -26,15,255,5,5,4,28,0,8,15,13,10,198,192,105,27,255,206,106,25, -255,204,105,25,255,23,17,10,232,0,8,12,10,7,125,196,119,37,255,218, -141,51,255,218,139,55,255,20,16,11,255,0,12,9,8,6,170,196,110,33, -255,215,126,40,255,214,125,39,255,23,18,12,252,0,8,11,9,8,167,201, -123,40,255,217,133,50,255,214,136,43,255,20,16,11,255,0,12,6,5,5, -23,29,21,12,153,32,22,13,255,35,25,14,227,15,12,8,85,0,24,12, -10,9,170,198,124,37,255,215,125,38,255,213,124,38,255,23,18,12,255,0, -24,14,12,9,170,204,132,47,255,219,144,56,255,211,127,36,255,28,21,13, -255,0,12,14,12,9,170,198,117,37,255,215,123,42,255,214,125,39,255,25, -20,12,215,0,8,11,10,8,130,198,119,35,255,215,126,40,255,212,123,37, -255,30,22,13,255,0,12,14,12,9,170,196,114,33,255,206,106,25,255,200, -105,21,255,30,21,11,184,0,8,13,11,8,99,184,100,25,255,209,117,28, -255,210,115,31,255,28,21,13,255,0,20,14,12,9,170,198,117,37,255,215, -126,40,255,214,126,41,255,25,19,12,255,0,12,10,9,7,125,61,42,22, -255,190,107,33,255,153,98,38,255,29,23,16,255,13,12,10,255,17,15,10, -255,108,74,37,255,210,144,59,255,153,98,38,255,16,14,11,224,6,6,5, -17,0,12,15,13,8,227,115,67,24,255,197,100,22,255,150,81,25,255,32, -24,13,255,15,13,8,255,19,15,10,255,85,48,18,255,178,95,21,255,115, -65,20,255,15,12,8,255,5,5,4,34,0,32,10,9,7,198,69,46,22, -255,186,103,29,255,195,111,28,255,92,58,25,255,15,12,8,198,0,12,10, -9,7,170,194,112,31,255,215,125,38,255,218,146,53,255,24,19,13,255,0, -20,15,14,10,227,159,103,42,255,212,127,43,255,177,118,48,255,19,17,12, -227,6,6,5,28,0,32,11,10,8,170,182,98,23,255,202,106,21,255,195, -98,20,255,24,17,9,212,0,12,18,14,9,227,102,54,19,255,157,83,18, -255,85,46,14,255,19,13,6,255,47,27,10,255,150,81,19,255,131,67,20, -255,39,26,14,255,12,11,9,85,0,64,10,9,7,170,118,75,33,255,215, -141,54,255,44,33,19,255,0,16,9,9,8,108,19,17,12,170,27,23,16, -170,23,21,16,170,23,21,16,170,24,20,15,170,20,18,13,170,15,14,10, -170,10,9,7,113,7,6,6,28,0,12,12,11,9,170,189,99,26,255,209, -110,30,255,211,118,36,255,141,88,36,255,19,17,12,227,20,18,13,170,24, -20,15,170,21,19,14,170,16,14,11,170,10,9,7,113,6,6,5,28,0, -20,8,7,5,65,11,10,8,142,16,14,11,170,24,21,15,170,25,22,16, -170,23,21,16,170,21,19,14,170,16,14,11,170,11,10,8,113,7,7,6, -28,0,20,8,7,5,62,10,9,5,136,12,10,7,170,14,11,7,170,13, -10,6,170,11,9,6,198,31,21,10,255,153,82,18,255,177,85,18,255,169, -78,18,255,22,15,7,204,0,16,8,7,5,57,11,10,6,142,19,17,12, -170,23,21,16,170,25,22,16,170,23,21,16,170,21,19,14,170,15,14,10, -170,10,10,9,113,7,6,6,28,0,16,12,10,7,153,55,32,14,255,175, -93,20,255,185,94,20,255,183,89,19,255,80,44,17,255,13,11,8,187,7, -6,6,25,0,16,8,7,5,62,11,10,6,142,16,14,11,170,23,19,14, -170,25,22,16,170,23,21,16,170,19,17,12,170,15,14,10,170,17,15,10, -170,19,17,12,142,9,8,8,28,0,8,12,10,9,170,204,137,49,255,220, -146,59,255,218,146,53,255,141,91,38,255,19,17,12,227,19,17,12,170,24, -20,15,170,21,19,14,170,15,14,10,170,10,10,9,113,7,6,6,28,0, -16,12,10,7,57,14,12,7,102,14,11,7,85,0,32,12,10,7,57,13, -11,8,105,15,13,8,85,0,12,12,11,9,170,204,136,47,255,220,146,59, -255,218,153,59,255,24,19,13,255,0,12,8,7,5,82,11,10,6,156,11, -9,6,170,10,9,7,91,0,12,10,8,5,127,144,78,19,255,180,87,19, -255,174,81,19,255,24,15,7,210,0,12,14,11,7,68,12,10,7,170,12, -10,7,170,17,15,10,170,24,20,15,170,19,17,12,170,15,14,10,170,18, -15,11,170,24,21,15,170,21,19,14,170,15,14,10,170,11,10,8,113,7, -7,6,28,0,16,15,13,10,119,17,15,12,170,15,13,10,170,16,14,11, -170,19,17,12,170,21,18,12,170,18,15,11,170,15,13,8,170,11,9,6, -170,10,8,7,88,6,5,5,23,0,20,10,9,7,85,14,12,9,170,19, -17,12,170,21,19,14,170,21,19,14,170,21,19,14,170,19,17,12,170,15, -14,10,170,11,10,8,116,7,7,6,28,0,16,15,14,10,119,18,15,11, -170,15,14,10,170,18,15,11,170,21,19,14,170,25,22,16,170,23,21,16, -170,21,19,14,170,16,14,11,170,11,10,8,113,7,7,6,28,0,20,10, -9,7,85,14,12,9,170,19,17,12,170,20,18,13,170,20,18,13,170,23, -19,14,170,19,17,12,170,15,14,10,170,17,14,10,170,19,17,12,142,10, -9,7,28,0,12,15,13,10,113,18,15,11,170,15,14,10,170,18,15,11, -170,21,19,14,170,25,22,16,170,23,21,16,170,20,18,13,170,16,14,11, -170,11,10,8,113,7,7,6,28,0,20,7,7,6,82,11,10,6,142,16, -13,9,170,19,17,12,170,21,19,14,170,24,21,15,170,25,22,16,170,25, -22,16,170,15,13,10,170,12,11,9,57,0,16,15,13,10,170,97,65,34, -255,209,132,42,255,214,136,43,255,214,127,43,255,159,103,42,255,21,19,14, -227,11,10,8,28,0,12,16,14,11,113,21,19,14,170,18,15,11,153,11, -10,8,28,0,16,15,14,10,125,21,19,14,170,19,17,12,142,10,9,7, -28,0,12,15,14,10,113,21,19,14,170,18,16,11,153,11,10,8,28,0, -16,15,13,10,125,21,19,14,170,19,17,12,142,10,9,7,28,0,12,15, -14,10,113,21,19,14,170,18,16,11,153,11,10,8,28,0,24,15,14,10, -125,21,19,14,170,19,17,12,142,9,9,8,28,0,12,17,14,10,130,27, -24,16,170,21,19,14,142,10,9,7,28,0,16,16,14,11,113,28,24,17, -170,24,21,15,161,12,11,9,28,0,12,16,14,11,113,21,19,14,170,18, -15,11,153,11,10,8,28,0,16,15,13,10,125,21,19,14,170,19,17,12, -142,9,8,6,28,0,12,18,15,11,136,19,16,10,170,16,13,9,170,16, -14,9,170,15,13,8,170,13,11,8,170,12,11,9,170,13,12,8,170,15, -14,10,170,14,13,11,170,11,11,10,113,0,20,13,11,8,170,190,98,23, -255,204,116,31,255,74,52,27,255,9,8,8,113,0,16,13,11,8,170,192, -106,29,255,208,112,27,255,208,117,29,255,27,21,12,255,0,16,5,5,4, -28,27,23,16,255,199,121,44,255,214,139,41,255,31,23,14,255,0,16,13, -11,8,28,32,24,13,227,36,26,15,255,19,16,12,198,8,8,7,51,0, -4,8,8,7,57,29,21,12,218,48,32,17,255,45,30,16,255,20,16,11, -218,10,9,7,105,0,44,14,12,9,170,204,130,51,255,224,153,77,255,225, -169,88,255,33,27,18,255,0,12,21,19,14,215,217,163,86,255,61,46,28, -255,0,12,19,16,12,201,203,121,40,255,51,38,22,255,0,12,4,4,3, -25,16,14,11,227,212,147,71,255,224,160,77,255,223,161,80,255,31,25,16, -255,4,4,4,102,10,10,9,215,206,133,55,255,223,156,70,255,224,164,85, -255,51,39,24,255,5,5,4,82,0,12,15,12,8,110,178,98,27,255,211, -115,30,255,211,121,34,255,36,26,15,255,3,3,2,85,0,60,8,8,5, -28,27,20,10,232,125,73,22,255,190,97,21,255,180,92,21,255,97,56,20, -255,14,11,7,170,0,16,12,10,7,142,165,89,22,255,198,104,21,255,84, -50,19,255,7,6,4,159,0,4,5,5,4,82,32,23,11,255,121,69,22, -255,97,56,20,255,15,13,8,142,0,32,14,12,7,198,172,92,21,255,28, -19,9,207,0,8,11,10,6,85,148,78,21,255,198,104,21,255,192,97,21, -255,21,15,8,255,0,24,10,9,5,170,167,90,22,255,202,93,21,255,202, -103,23,255,21,16,10,255,0,20,4,3,3,133,20,16,9,255,151,80,22, -255,75,42,16,255,10,8,7,255,32,22,11,255,164,86,23,255,60,39,17, -255,5,5,4,252,0,36,12,11,9,198,213,155,80,255,224,166,83,255,211, -121,34,255,20,16,9,255,3,3,2,28,0,144,6,6,5,51,27,20,10, -255,160,84,23,255,198,104,21,255,67,40,16,255,8,7,5,125,0,12,12, -10,9,170,195,112,30,255,215,125,38,255,217,133,50,255,49,35,22,255,5, -5,4,133,13,12,10,210,189,119,50,255,211,127,44,255,212,121,41,255,218, -135,53,255,220,148,63,255,34,27,17,255,0,20,4,4,4,17,13,12,10, -227,196,113,31,255,212,118,35,255,214,123,43,255,33,26,16,255,0,56,12, -11,9,187,208,134,55,255,223,146,70,255,221,152,70,255,34,26,17,255,0, -40,8,7,5,164,165,86,22,255,202,98,21,255,198,96,21,255,22,16,9, -255,0,20,8,8,5,85,32,22,11,255,167,87,22,255,160,84,23,255,93, -54,20,255,120,65,21,255,188,96,21,255,196,99,21,255,200,105,21,255,24, -19,11,207,0,8,15,14,10,110,208,152,71,255,227,174,98,255,228,179,103, -255,225,176,98,255,217,169,94,255,213,166,92,255,215,167,92,255,213,155,80, -255,204,136,55,255,138,89,37,255,25,22,16,227,9,9,8,28,0,8,11, -10,8,170,203,129,50,255,223,149,70,255,222,158,75,255,31,25,16,255,4, -4,4,28,0,60,8,8,7,57,49,40,26,255,206,152,83,255,224,169,91, -255,194,140,71,255,31,27,20,255,9,8,8,28,0,8,12,10,9,161,196, -110,33,255,218,130,51,255,222,158,75,255,31,25,16,255,4,4,4,28,0, -8,11,10,8,198,213,160,84,255,228,180,105,255,227,175,100,255,33,28,18, -207,0,8,12,11,9,130,210,155,77,255,228,169,99,255,226,172,95,255,30, -25,17,255,4,4,4,28,0,8,11,10,8,198,204,129,49,255,214,127,43, -255,213,125,40,255,23,19,12,232,0,8,14,13,9,125,208,152,71,255,223, -159,76,255,218,153,59,255,33,26,16,210,0,8,13,12,10,127,198,118,39, -255,215,127,42,255,213,126,42,255,41,31,18,227,0,12,6,6,5,28,25, -21,16,227,204,150,79,255,223,171,98,255,175,122,60,255,18,15,11,218,5, -4,4,17,0,20,20,18,13,85,177,101,34,255,204,123,37,255,199,117,36, -255,199,117,36,255,202,122,37,255,199,117,36,255,198,114,31,255,198,110,31, -255,202,118,35,255,46,33,21,170,0,24,10,9,7,153,110,78,37,255,213, -162,82,255,218,164,87,255,67,51,30,255,9,8,8,85,0,40,6,5,5, -28,21,19,14,255,217,166,92,255,227,175,100,255,224,169,91,255,31,25,16, -215,0,8,12,10,7,85,154,80,21,255,197,99,20,255,192,97,21,255,28, -20,9,255,4,3,3,110,11,9,6,170,117,63,20,255,184,94,21,255,198, -104,21,255,203,104,24,255,210,122,37,255,21,17,12,252,0,8,10,9,7, -161,203,129,50,255,224,160,77,255,225,169,88,255,30,25,17,255,4,4,4, -28,0,8,8,7,5,190,165,86,22,255,198,104,21,255,196,99,21,255,28, -19,9,170,0,8,13,11,8,85,176,91,23,255,208,112,27,255,210,121,35, -255,27,22,14,255,4,4,4,28,0,8,11,10,8,198,211,149,76,255,224, -168,87,255,224,162,81,255,32,26,17,210,0,8,12,10,7,113,176,91,23, -255,202,107,23,255,202,95,23,255,20,16,9,255,0,40,15,13,10,170,213, -160,84,255,228,180,105,255,227,174,98,255,33,26,18,255,0,12,15,13,10, -170,213,155,80,255,226,172,95,255,224,167,85,255,23,20,14,244,0,8,11, -10,8,127,189,104,28,255,214,127,43,255,221,148,70,255,31,25,16,255,4, -4,4,28,0,28,14,12,9,170,195,113,32,255,209,117,28,255,202,103,23, -255,20,15,9,252,3,3,3,14,0,28,15,14,10,170,213,155,80,255,226, -172,95,255,221,152,70,255,28,24,15,255,0,40,14,12,9,170,208,141,61, -255,225,162,88,255,227,174,98,255,33,26,18,255,4,4,4,28,0,8,10, -8,7,198,182,98,23,255,202,103,23,255,198,104,21,255,28,19,9,170,0, -8,11,10,6,85,154,80,21,255,202,98,21,255,202,103,23,255,25,20,12, -255,0,40,12,10,7,170,186,100,23,255,202,99,23,255,200,105,21,255,30, -21,9,170,0,8,12,9,7,85,154,80,21,255,198,104,21,255,196,99,21, -255,28,20,9,255,4,4,3,113,11,10,6,227,183,100,26,255,212,127,43, -255,167,117,52,255,17,15,12,215,5,5,5,14,0,12,15,13,10,170,211, -149,76,255,224,166,83,255,223,161,80,255,34,26,17,255,0,32,10,9,7, -170,167,87,22,255,198,92,21,255,196,99,21,255,196,95,21,255,198,92,21, -255,195,99,22,255,192,106,29,255,206,127,43,255,217,141,60,255,223,146,70, -255,224,165,81,255,220,148,63,255,212,124,39,255,25,19,12,215,0,8,12, -11,9,116,196,116,37,255,218,141,51,255,218,139,55,255,218,142,61,255,215, -143,58,255,24,19,13,212,0,4,10,9,7,156,203,129,50,255,221,150,66, -255,220,148,63,255,25,21,14,227,0,8,10,10,7,159,204,134,59,255,225, -160,84,255,225,169,88,255,36,29,19,255,0,12,15,14,10,170,204,130,51, -255,220,142,59,255,218,139,55,255,21,18,12,249,0,8,11,10,8,142,206, -145,67,255,226,172,95,255,227,174,98,255,32,26,17,255,4,4,4,28,0, -8,11,10,8,198,198,117,37,255,215,125,38,255,211,122,36,255,28,21,13, -215,0,8,13,11,8,96,174,91,23,255,202,107,23,255,202,103,23,255,22, -17,9,255,0,12,11,10,6,170,176,91,23,255,202,103,23,255,203,108,24, -255,21,15,10,238,0,8,11,10,8,142,206,145,67,255,226,170,91,255,224, -160,85,255,30,24,17,255,4,4,4,28,0,8,11,10,8,198,209,149,70, -255,224,160,77,255,222,158,75,255,31,25,16,212,0,8,12,11,9,127,198, -116,35,255,215,125,38,255,211,122,36,255,28,21,13,255,4,4,4,28,0, -52,13,12,8,170,195,112,30,255,209,110,30,255,207,105,30,255,25,20,12, -255,0,24,15,14,10,170,213,158,80,255,226,172,95,255,224,164,85,255,33, -27,18,255,0,12,15,14,10,170,210,143,65,255,224,168,87,255,224,165,81, -255,25,21,14,232,0,8,10,10,9,153,208,147,67,255,224,166,83,255,222, -158,75,255,34,26,17,255,0,12,15,14,10,170,211,149,76,255,223,149,70, -255,219,146,60,255,25,20,14,235,0,8,10,10,9,150,204,134,59,255,224, -156,83,255,224,165,81,255,33,27,18,255,0,20,15,14,10,170,211,150,70, -255,226,170,91,255,226,172,95,255,33,26,18,255,0,16,9,9,8,150,101, -74,38,255,198,145,77,255,206,157,87,255,202,151,79,255,197,141,74,255,200, -146,75,255,180,126,57,255,21,19,14,227,5,5,4,28,0,16,8,7,5, -113,43,28,14,255,187,96,22,255,181,93,22,255,98,55,21,255,68,42,17, -255,77,46,18,255,129,72,22,255,174,89,21,255,83,47,18,255,11,9,6, -221,0,28,6,6,5,28,16,14,11,195,108,76,35,255,210,141,59,255,218, -162,81,255,167,118,54,255,16,14,11,221,5,5,5,14,0,12,15,13,10, -170,211,149,76,255,224,168,87,255,223,154,80,255,31,25,16,255,0,20,6, -6,5,57,34,27,17,255,203,122,36,255,208,124,41,255,109,76,34,255,13, -12,10,142,0,32,13,11,8,170,176,91,23,255,202,93,21,255,196,99,21, -255,28,19,9,170,0,8,11,9,6,85,132,71,21,255,195,99,22,255,103, -59,20,255,11,10,6,170,3,3,2,25,6,6,5,110,55,35,16,255,198, -113,29,255,212,134,51,255,41,32,20,210,0,68,21,19,14,215,217,163,86, -255,49,38,24,255,0,12,11,10,8,82,54,43,27,255,200,135,59,255,210, -137,59,255,207,131,50,255,205,127,44,255,199,117,36,255,195,111,28,255,187, -101,24,255,93,54,22,255,19,15,10,227,7,6,6,28,0,8,10,9,7, -170,195,109,32,255,218,138,53,255,224,158,81,255,223,173,95,255,219,167,94, -255,217,169,94,255,218,171,97,255,217,166,92,255,208,136,59,255,110,68,27, -255,19,15,10,227,6,6,5,28,0,12,12,11,7,170,61,42,20,255,188, -106,33,255,208,134,55,255,215,163,82,255,217,166,92,255,216,167,88,255,216, -167,89,255,211,150,70,255,146,94,39,255,26,21,15,229,9,8,6,28,0, -12,12,10,7,170,51,32,14,255,151,80,22,255,169,91,22,255,173,86,22, -255,169,88,22,255,173,86,22,255,180,92,21,255,194,98,21,255,196,95,21, -255,192,97,21,255,31,21,10,170,0,12,12,10,7,170,57,37,18,255,189, -107,34,255,212,149,67,255,217,166,92,255,217,166,92,255,218,171,97,255,215, -163,82,255,205,126,48,255,116,72,29,255,20,16,11,227,6,6,5,28,0, -8,11,9,6,68,126,68,21,255,191,98,22,255,194,98,21,255,192,97,21, -255,192,97,21,255,191,98,22,255,177,91,22,255,26,19,9,142,0,12,12, -10,7,170,58,37,17,255,185,107,30,255,208,134,55,255,216,167,88,255,218, -171,97,255,217,166,92,255,213,148,72,255,204,130,51,255,209,141,60,255,211, -159,76,255,30,25,17,170,0,8,10,10,7,167,210,155,77,255,228,178,99, -255,224,165,81,255,221,165,86,255,217,166,92,255,218,169,93,255,217,166,92, -255,214,156,81,255,206,135,51,255,116,72,29,255,20,16,11,227,6,6,5, -28,0,8,13,10,6,57,115,62,20,255,169,91,22,255,165,86,22,255,24, -18,9,167,0,24,12,10,7,88,117,63,20,255,186,100,23,255,191,107,32, -255,35,27,16,144,0,8,10,10,7,170,210,155,77,255,228,178,99,255,221, -152,70,255,24,19,13,255,0,8,12,10,7,170,58,36,15,255,157,79,22, -255,151,80,22,255,58,35,15,255,11,9,6,57,0,8,12,10,7,85,157, -81,20,255,197,99,20,255,192,97,21,255,28,20,9,170,0,8,11,9,6, -57,115,62,20,255,189,94,24,255,198,117,37,255,213,157,76,255,218,171,97, -255,217,169,94,255,214,161,85,255,213,157,76,255,212,149,67,255,208,134,55, -255,205,126,48,255,143,96,40,255,28,26,19,229,8,8,7,28,0,8,13, -12,8,85,141,74,24,255,190,94,23,255,183,95,24,255,183,95,24,255,187, -93,24,255,189,97,22,255,181,93,22,255,177,91,22,255,169,88,22,255,89, -52,20,255,21,18,12,227,9,9,8,28,0,12,18,17,13,181,103,74,40, -255,207,146,74,255,214,156,81,255,210,144,67,255,208,138,55,255,207,129,52, -255,205,133,48,255,205,126,48,255,151,101,42,255,28,26,19,232,9,8,8, -28,0,8,13,12,10,110,186,127,63,255,214,156,81,255,213,158,80,255,213, -155,80,255,214,156,81,255,214,153,75,255,213,148,72,255,213,148,72,255,211, -150,70,255,159,111,54,255,28,25,19,241,9,8,8,31,0,12,18,17,13, -181,103,74,40,255,208,156,81,255,214,156,81,255,208,138,55,255,209,137,60, -255,213,158,80,255,213,155,80,255,213,160,84,255,215,160,88,255,213,163,84, -255,30,24,17,178,0,8,12,11,9,93,178,121,53,255,213,158,80,255,210, -143,65,255,211,146,62,255,213,148,72,255,215,163,82,255,213,158,80,255,212, -149,67,255,209,141,60,255,153,106,49,255,28,25,19,235,9,9,8,31,0, -12,18,15,11,173,66,43,21,255,187,101,32,255,207,132,52,255,210,144,67, -255,213,148,72,255,214,156,81,255,216,167,88,255,214,156,81,255,176,128,65, -255,46,39,27,255,0,12,15,14,10,85,181,111,42,255,215,136,52,255,213, -125,40,255,211,122,36,255,212,123,37,255,210,123,39,255,202,122,37,255,31, -24,14,170,0,8,12,11,9,88,164,89,29,255,203,122,36,255,199,117,36, -255,30,23,15,212,0,12,15,13,10,127,187,133,62,255,213,148,72,255,208, -138,55,255,31,24,16,170,0,8,13,12,10,85,172,104,37,255,209,134,54, -255,206,135,51,255,32,25,17,212,0,12,15,13,10,127,181,116,46,255,211, -143,62,255,210,153,71,255,29,24,16,178,0,8,13,12,10,91,178,121,53, -255,213,154,70,255,208,134,55,255,31,25,16,210,0,20,15,14,10,125,179, -110,42,255,210,135,55,255,208,139,65,255,26,21,15,184,0,8,14,13,9, -85,179,117,44,255,217,165,82,255,213,163,84,255,27,23,16,221,0,12,14, -12,9,136,174,103,39,255,206,127,43,255,199,117,36,255,31,24,14,170,0, -8,12,11,9,88,164,89,29,255,202,118,35,255,196,114,33,255,29,22,14, -210,0,12,14,12,9,125,169,95,30,255,202,119,37,255,199,119,39,255,24, -19,13,190,0,8,14,12,9,85,170,95,29,255,198,113,29,255,199,116,34, -255,204,128,47,255,206,135,51,255,204,129,49,255,204,129,49,255,208,134,55, -255,211,149,76,255,192,140,73,255,95,74,39,255,17,15,12,85,0,16,14, -12,9,198,211,150,70,255,206,152,81,255,31,26,20,255,7,7,6,48,0, -16,15,13,10,170,211,149,76,255,226,170,91,255,226,172,95,255,35,28,18, -255,0,20,15,14,12,218,171,120,60,255,219,154,70,255,41,31,20,255,4, -4,3,28,0,104,17,16,12,170,219,179,116,255,232,193,137,255,232,199,135, -255,40,33,23,255,0,12,10,10,9,76,62,50,31,255,20,18,13,167,0, -12,11,10,8,76,58,46,29,255,20,18,13,167,0,16,13,12,10,170,210, -150,71,255,223,147,72,255,221,150,66,255,26,21,15,210,0,4,11,10,8, -119,211,159,84,255,229,184,114,255,230,186,123,255,30,26,19,255,0,16,12, -11,9,93,137,90,40,255,223,167,94,255,228,180,111,255,167,133,80,255,17, -16,14,227,11,11,10,170,12,11,9,170,12,11,9,170,12,11,9,119,7, -7,6,57,0,36,7,7,6,62,21,18,12,227,157,92,28,255,203,105,26, -255,197,106,26,255,82,48,21,255,14,12,7,173,5,5,4,8,0,16,8, -7,5,28,26,19,11,227,103,68,25,255,158,96,29,255,57,41,22,255,13, -12,10,241,33,26,16,255,146,88,31,255,66,47,23,255,12,10,9,201,6, -5,5,14,0,32,8,7,5,57,30,22,11,255,15,12,8,96,0,8,10, -10,7,130,190,104,27,255,209,118,30,255,211,117,34,255,27,21,14,255,0, -24,13,12,10,170,199,122,39,255,218,130,51,255,223,146,70,255,30,24,17, -255,0,12,23,22,18,139,30,27,21,170,16,15,11,255,89,59,26,255,203, -110,28,255,196,113,31,255,122,81,33,255,186,117,43,255,216,129,51,255,184, -126,57,255,38,34,25,255,24,22,19,221,33,30,24,170,15,15,12,28,0, -12,24,22,19,142,32,31,25,170,21,20,16,198,90,71,45,255,223,179,110, -255,226,172,95,255,221,150,66,255,143,100,44,255,22,21,17,227,28,27,21, -170,29,28,22,170,13,13,12,42,0,36,8,8,8,11,25,24,20,142,39, -35,28,170,30,28,23,170,29,27,22,170,29,27,22,170,29,27,22,170,29, -27,22,170,29,27,20,170,23,21,16,170,14,13,11,34,0,52,13,12,10, -159,142,86,31,255,208,116,35,255,201,119,38,255,32,26,17,255,5,5,4, -28,0,12,14,13,11,170,216,167,97,255,231,184,124,255,231,193,128,255,181, -146,92,255,52,44,33,255,90,71,45,255,201,155,88,255,223,173,102,255,228, -179,115,255,230,183,123,255,230,184,119,255,39,32,22,255,0,24,12,12,11, -170,206,139,61,255,226,164,91,255,228,174,103,255,39,32,22,255,0,48,6, -6,5,28,9,9,8,142,56,46,31,255,222,180,113,255,230,187,119,255,222, -180,113,255,23,21,16,255,0,36,15,14,12,164,79,59,30,255,209,128,42, -255,211,127,44,255,171,117,46,255,18,15,11,170,0,16,9,9,8,116,33, -28,16,255,161,94,28,255,199,107,26,255,65,40,18,255,8,7,5,255,25, -20,12,255,198,113,29,255,210,120,33,255,217,133,50,255,27,23,16,255,0, -8,7,7,6,23,34,28,19,198,46,36,25,255,39,31,22,255,41,33,22, -255,59,46,28,255,51,40,26,255,61,47,28,255,180,133,71,255,227,175,100, -255,226,175,103,255,181,143,88,255,17,16,12,142,0,8,11,11,10,170,214, -166,97,255,229,179,114,255,228,185,111,255,161,121,68,255,23,21,16,227,23, -22,18,170,22,21,17,170,16,15,13,170,11,11,8,147,8,8,7,85,0, -40,14,13,11,170,181,143,88,255,228,185,123,255,218,168,97,255,70,54,35, -255,9,9,8,113,0,12,11,10,8,85,120,87,45,255,223,183,120,255,231, -190,132,255,167,135,80,255,24,22,19,227,19,18,16,170,19,18,16,198,95, -80,46,255,226,193,129,255,228,187,129,255,186,148,87,255,15,14,12,170,0, -8,10,10,9,85,155,113,64,255,229,196,132,255,232,191,133,255,179,142,90, -255,27,25,20,227,18,18,15,170,19,18,16,198,90,71,45,255,222,175,101, -255,227,174,98,255,228,185,111,255,28,25,19,255,0,8,7,7,6,23,34, -28,19,198,49,35,22,255,39,29,18,227,12,11,9,85,0,8,8,7,7, -28,33,26,16,198,52,39,23,255,47,35,22,227,13,12,8,85,0,8,8, -8,7,28,33,30,24,227,201,157,100,255,230,186,123,255,181,137,74,255,16, -15,11,207,6,6,5,23,0,24,11,10,8,28,27,21,12,193,26,19,11, -255,23,18,10,255,23,18,10,255,24,18,11,255,24,18,11,255,26,20,11, -255,35,27,16,255,42,31,19,241,17,14,10,85,0,28,9,9,8,144,91, -67,36,255,217,154,72,255,211,150,70,255,69,55,34,255,15,14,12,85,0, -28,6,6,5,11,11,11,10,142,24,22,19,255,167,135,80,255,225,172,104, -255,224,166,83,255,193,126,54,255,16,14,11,170,0,8,13,12,8,85,185, -97,26,255,207,112,28,255,204,110,27,255,71,46,22,255,8,8,7,255,28, -22,13,255,198,107,27,255,193,111,30,255,126,78,31,255,199,139,62,255,226, -184,111,255,27,24,18,255,0,8,11,10,8,170,214,166,97,255,230,187,119, -255,228,179,103,255,143,102,48,255,17,16,12,227,12,12,9,170,13,12,10, -198,46,33,17,255,199,112,28,255,206,111,27,255,204,110,27,255,32,23,13, -176,0,8,12,11,9,136,204,134,59,255,226,172,95,255,228,181,107,255,162, -125,73,255,24,22,19,227,19,18,16,170,19,18,16,198,95,80,46,255,224, -179,109,255,223,173,95,255,173,117,50,255,15,13,10,156,0,8,12,11,7, -99,185,97,26,255,208,112,27,255,204,110,27,255,22,18,11,255,0,40,16, -15,13,170,219,179,116,255,232,194,133,255,231,193,128,255,40,33,23,255,0, -12,16,15,13,170,219,177,112,255,230,187,119,255,224,159,83,255,24,21,15, -255,0,8,11,10,8,164,211,158,82,255,229,184,114,255,230,191,123,255,166, -127,77,255,22,21,17,227,22,21,17,170,20,19,13,170,14,13,11,28,0, -16,12,11,9,170,195,112,30,255,209,106,30,255,206,111,27,255,101,63,26, -255,16,14,11,227,23,21,16,170,29,27,22,170,13,13,12,42,0,16,16, -15,13,170,216,167,97,255,224,158,87,255,216,125,45,255,24,20,13,255,0, -40,17,16,12,170,219,177,112,255,232,195,137,255,231,189,128,255,162,125,73, -255,22,21,17,227,14,14,11,170,13,12,10,198,50,35,19,255,199,112,28, -255,206,111,27,255,204,110,27,255,32,24,13,170,0,8,13,12,8,93,194, -109,33,255,219,139,54,255,224,158,81,255,39,32,22,255,0,40,11,10,8, -170,190,104,27,255,208,112,27,255,204,110,27,255,32,24,13,170,0,8,13, -12,8,85,184,96,25,255,207,112,28,255,204,102,27,255,129,78,28,255,31, -26,16,255,127,84,34,255,219,147,70,255,173,122,62,255,15,14,12,212,6, -6,5,25,0,16,16,15,13,170,213,155,80,255,221,144,68,255,217,130,52, -255,31,25,16,255,0,32,10,9,7,170,189,99,26,255,208,112,27,255,204, -110,27,255,155,87,26,255,72,46,21,255,179,103,36,255,223,156,76,255,216, -170,97,255,134,96,47,255,174,127,71,255,221,167,90,255,223,147,72,255,222, -158,75,255,23,19,14,252,0,8,11,10,8,170,214,166,97,255,231,187,124, -255,230,191,123,255,228,182,117,255,222,175,101,255,64,50,33,255,7,7,6, -229,26,23,19,255,220,175,105,255,228,183,113,255,228,188,117,255,25,21,16, -255,0,8,11,10,8,170,217,176,112,255,232,197,137,255,232,199,135,255,37, -31,22,255,0,12,13,12,10,170,198,117,37,255,215,127,42,255,217,130,52, -255,21,19,14,255,0,8,11,10,8,167,215,172,104,255,232,191,133,255,231, -190,132,255,166,127,77,255,23,21,16,227,18,17,15,170,17,16,12,198,74, -52,27,255,204,117,33,255,211,111,30,255,173,93,28,255,15,12,8,164,0, -8,13,12,8,88,185,97,26,255,208,112,27,255,204,110,27,255,19,16,10, -255,0,12,10,9,7,170,190,104,27,255,212,118,35,255,216,136,51,255,21, -19,14,252,0,8,11,10,8,167,215,172,104,255,232,194,127,255,231,193,128, -255,166,129,77,255,23,21,16,227,19,18,16,170,19,18,14,198,81,59,34, -255,213,144,62,255,215,140,60,255,165,108,40,255,13,12,10,167,0,8,8, -8,7,85,101,63,26,255,206,114,33,255,212,121,33,255,155,92,36,255,23, -21,16,227,22,21,17,170,28,26,21,170,21,20,18,170,13,13,12,164,10, -10,9,85,6,6,6,6,0,28,12,11,9,170,194,112,31,255,212,119,37, -255,216,134,45,255,35,28,18,255,0,24,16,15,13,170,217,171,106,255,231, -187,124,255,228,181,107,255,39,32,22,255,0,12,16,15,11,170,208,134,55, -255,223,156,70,255,221,148,70,255,23,20,14,238,0,8,11,10,8,170,204, -136,55,255,223,156,70,255,222,158,75,255,34,28,19,255,0,12,14,13,11, -170,217,171,106,255,232,189,127,255,230,186,123,255,25,22,16,255,0,8,10, -10,9,167,210,155,77,255,226,172,95,255,224,165,81,255,31,26,18,255,0, -20,15,13,12,170,217,173,104,255,232,191,133,255,231,195,132,255,40,33,23, -255,0,20,10,9,9,133,73,58,36,255,225,184,120,255,231,193,128,255,228, -180,111,255,147,102,48,255,15,13,10,227,8,7,7,28,0,24,12,11,7, -198,100,59,23,255,169,93,26,255,156,91,27,255,174,96,27,255,180,99,27, -255,168,97,27,255,105,62,24,255,18,15,9,255,7,6,6,48,0,24,7, -7,7,28,15,15,12,227,144,114,67,255,219,177,112,255,223,176,102,255,153, -113,62,255,17,16,12,227,7,7,6,28,0,16,16,15,13,170,213,155,80, -255,223,146,70,255,217,129,50,255,27,22,14,255,0,24,12,10,9,195,161, -94,28,255,207,114,32,255,193,114,36,255,23,20,16,255,0,32,12,11,9, -170,191,105,28,255,207,100,28,255,204,110,27,255,26,20,11,204,0,8,6, -5,5,3,26,19,9,198,24,18,9,246,15,12,8,142,0,12,15,13,10, -91,31,24,16,244,51,39,24,255,21,19,14,91,0,68,10,10,9,76,61, -49,30,255,20,18,13,156,0,16,17,15,12,142,27,22,14,232,30,22,13, -255,25,20,12,255,22,18,11,238,21,16,10,255,99,58,22,255,203,113,26, -255,205,111,28,255,131,80,30,255,12,11,9,142,0,8,11,10,8,170,212, -160,85,255,232,191,127,255,231,195,132,255,196,155,91,255,81,59,34,255,41, -32,20,255,54,43,27,255,180,133,71,255,216,144,59,255,208,115,33,255,129, -78,28,255,12,11,7,142,0,8,8,7,7,57,72,52,29,255,215,155,78, -255,227,174,98,255,207,158,94,255,85,63,34,255,36,29,19,255,57,43,26, -255,189,130,66,255,219,149,66,255,212,121,41,255,172,105,33,255,17,15,10, -147,0,8,7,6,6,54,58,40,21,255,198,113,29,255,206,103,27,255,165, -87,24,255,42,28,13,255,21,16,8,255,27,20,10,255,95,60,22,255,202, -105,27,255,206,100,29,255,204,110,27,255,35,24,12,170,0,8,7,7,6, -54,70,50,27,255,212,145,65,255,227,174,98,255,201,155,88,255,59,44,28, -255,23,20,14,255,34,28,19,255,157,104,48,255,211,126,42,255,208,115,33, -255,132,82,29,255,13,11,8,142,0,12,24,18,9,221,108,61,23,255,201, -112,26,255,207,112,28,255,204,110,27,255,158,91,25,255,46,29,13,249,11, -10,6,57,0,8,8,8,7,57,70,50,27,255,212,142,59,255,226,172,95, -255,207,158,94,255,85,63,34,255,41,32,20,255,57,43,26,255,174,124,59, -255,224,170,93,255,229,184,114,255,231,196,128,255,28,25,19,255,0,8,10, -10,9,167,215,169,102,255,232,191,127,255,231,193,128,255,196,154,87,255,77, -59,34,255,41,31,20,255,54,43,27,255,168,113,49,255,212,121,41,255,206, -114,33,255,132,82,29,255,12,11,9,130,0,8,12,11,7,110,188,98,25, -255,206,111,27,255,206,106,25,255,26,19,11,255,0,24,14,12,9,170,199, -117,36,255,221,148,62,255,227,174,98,255,28,26,19,255,0,8,10,10,9, -167,212,161,89,255,224,166,83,255,217,129,50,255,32,24,15,255,5,5,4, -31,7,7,6,136,65,44,22,255,192,106,29,255,203,108,24,255,114,66,23, -255,17,13,8,221,0,12,10,9,7,139,185,97,26,255,208,112,27,255,208, -117,29,255,32,24,13,170,0,8,15,13,8,91,189,99,26,255,215,123,42, -255,226,172,95,255,198,152,87,255,81,58,34,255,176,133,71,255,224,168,95, -255,197,138,62,255,65,47,26,255,133,81,30,255,208,121,37,255,212,115,37, -255,152,98,35,255,12,11,9,142,0,8,10,9,7,147,190,107,25,255,206, -111,27,255,206,106,25,255,158,91,25,255,42,28,13,255,21,15,8,255,26, -19,9,255,114,66,23,255,204,113,25,255,208,115,33,255,173,122,62,255,16, -15,13,150,0,8,8,8,7,71,110,87,51,255,222,180,113,255,224,166,83, -255,209,137,60,255,133,84,32,255,77,50,24,255,89,59,26,255,181,109,32, -255,210,121,35,255,212,121,41,255,171,116,52,255,15,14,12,142,0,8,14, -13,11,170,219,177,112,255,231,187,124,255,228,180,111,255,205,158,90,255,79, -58,32,255,38,29,19,255,49,35,22,255,167,114,46,255,217,146,62,255,219, -154,70,255,169,117,56,255,15,13,12,156,0,8,8,8,7,71,104,80,45, -255,224,183,119,255,232,191,127,255,210,166,97,255,81,60,32,255,39,30,18, -255,52,40,25,255,175,128,66,255,225,173,98,255,228,180,105,255,226,175,95, -255,29,25,18,255,0,8,12,12,11,170,208,138,55,255,222,145,63,255,220, -139,59,255,193,121,50,255,68,50,29,255,38,28,19,255,48,35,23,255,175, -112,44,255,217,142,54,255,217,144,66,255,191,137,66,255,19,16,12,170,0, -8,9,8,8,74,111,82,40,255,216,155,75,255,226,172,95,255,200,151,81, -255,57,41,26,255,27,23,16,255,35,28,18,255,41,32,20,255,39,30,20, -255,25,22,16,227,15,14,10,142,0,12,10,9,7,28,33,24,14,227,135, -81,28,255,206,117,31,255,210,108,33,255,208,110,31,255,171,92,28,255,49, -33,16,252,13,11,8,68,0,8,11,10,8,170,195,108,30,255,212,118,35, -255,217,137,52,255,42,33,23,255,0,12,20,18,15,170,214,156,81,255,221, -148,62,255,214,127,43,255,23,19,12,238,0,8,10,10,7,159,196,109,31, -255,213,119,36,255,212,123,37,255,31,24,14,255,0,12,15,14,10,170,209, -137,60,255,228,172,99,255,230,189,119,255,28,26,19,255,0,8,12,12,11, -170,208,134,55,255,218,137,51,255,214,127,43,255,35,27,16,255,0,20,16, -14,11,170,199,116,34,255,217,132,48,255,224,166,83,255,32,26,19,255,0, -8,10,10,7,34,81,58,34,255,224,178,105,255,226,172,95,255,129,92,40, -255,9,9,8,170,6,6,6,85,6,6,5,113,35,27,16,255,204,117,33, -255,208,117,29,255,110,69,25,255,14,12,7,108,0,8,10,10,7,170,195, -112,30,255,211,115,30,255,211,115,30,255,30,23,13,255,0,12,14,12,9, -170,196,113,31,255,211,120,32,255,214,126,41,255,33,26,18,255,0,8,9, -8,6,28,44,33,19,212,60,42,23,255,46,35,21,255,74,53,31,255,156, -109,53,255,216,167,97,255,228,179,109,255,229,177,110,255,227,184,108,255,168, -123,69,255,23,21,16,227,9,8,8,28,0,12,17,16,14,170,134,98,51, -255,223,166,92,255,132,100,53,255,9,9,8,133,0,20,16,15,13,170,219, -177,112,255,232,191,133,255,231,195,132,255,40,33,23,255,0,20,6,6,5, -45,39,32,22,255,210,129,49,255,172,106,35,255,20,17,13,227,11,11,8, -28,0,100,17,17,14,170,221,189,132,255,235,205,154,255,234,205,155,255,42, -39,29,255,0,16,9,9,8,25,0,20,9,8,8,25,0,20,14,14,11, -170,208,141,61,255,224,168,87,255,228,174,103,255,31,26,20,221,0,4,13, -12,12,130,218,185,127,255,234,202,147,255,232,198,139,255,40,33,25,255,0, -20,17,17,14,176,140,115,71,255,230,202,147,255,232,202,149,255,218,170,101, -255,200,124,43,255,198,117,37,255,198,117,37,255,196,116,37,255,72,52,27, -255,12,11,9,170,0,28,8,8,7,85,37,31,20,255,174,110,41,255,210, -123,39,255,204,120,37,255,130,87,31,255,15,13,10,190,0,28,5,5,4, -113,28,26,19,255,210,143,65,255,220,163,81,255,217,166,92,255,222,173,97, -255,225,176,98,255,42,37,25,255,4,4,4,74,0,56,13,12,10,170,208, -141,61,255,226,172,95,255,228,183,111,255,40,34,25,255,0,24,17,16,14, -170,219,177,112,255,232,194,133,255,233,202,148,255,27,24,20,255,0,8,16, -15,13,85,199,161,102,255,220,166,89,255,211,143,62,255,217,154,72,255,223, -161,80,255,224,169,91,255,225,185,114,255,229,188,124,255,231,190,132,255,231, -200,143,255,227,195,140,255,227,196,138,255,225,195,136,255,44,37,27,170,0, -8,17,16,14,85,200,165,109,255,227,198,142,255,225,191,132,255,227,195,134, -255,231,199,136,255,231,197,132,255,231,194,124,255,229,191,130,255,225,195,136, -255,225,195,136,255,225,191,132,255,49,42,30,198,0,36,18,17,13,105,193, -135,66,255,221,175,102,255,222,186,123,255,223,190,132,255,224,192,135,255,223, -190,132,255,222,186,123,255,221,178,110,255,218,172,105,255,46,39,27,195,0, -48,6,6,6,28,27,26,20,255,216,170,97,255,225,178,104,255,176,136,83, -255,16,15,13,198,0,16,17,17,14,170,221,188,130,255,235,205,154,255,234, -205,155,255,232,204,149,255,228,199,143,255,171,144,96,255,64,57,41,255,154, -126,81,255,227,189,122,255,230,184,119,255,227,171,98,255,34,30,21,255,0, -24,17,16,14,170,221,186,126,255,234,202,147,255,232,192,135,255,44,39,27, -255,0,44,9,9,8,142,25,24,20,255,114,95,53,255,207,169,102,255,227, -187,118,255,226,188,123,255,178,148,95,255,19,18,16,170,0,32,24,22,19, -85,197,145,84,255,227,187,118,255,231,194,124,255,207,173,114,255,61,55,38, -255,8,8,8,136,0,12,10,10,9,108,45,36,21,255,195,116,38,255,207, -122,38,255,139,90,32,255,13,12,8,170,0,4,10,10,9,198,208,140,59, -255,226,170,91,255,231,193,128,255,40,35,27,255,0,36,4,4,3,28,18, -17,13,227,222,189,131,255,234,201,143,255,229,191,130,255,34,30,23,204,0, -8,11,11,10,170,211,158,82,255,226,170,91,255,224,165,81,255,219,154,70, -255,208,132,51,255,206,128,45,255,204,122,41,255,201,120,40,255,196,116,37, -255,111,74,30,255,20,18,13,227,8,8,7,28,0,28,6,6,6,28,28, -26,21,255,222,186,123,255,229,196,132,255,181,144,92,255,16,15,13,212,0, -16,6,6,6,85,25,24,20,255,180,149,101,255,231,205,154,255,232,204,149, -255,227,198,142,255,223,192,138,255,223,193,136,255,230,199,139,255,232,197,141, -255,211,176,122,255,64,57,41,255,8,8,7,113,0,8,6,6,5,14,33, -31,24,227,186,155,107,255,232,204,149,255,233,205,152,255,227,197,140,255,221, -189,132,255,224,192,135,255,228,198,141,255,232,201,141,255,232,192,135,255,231, -197,132,255,41,35,26,255,0,64,17,16,14,139,211,178,120,255,233,202,148, -255,233,202,148,255,56,48,33,255,4,4,4,85,0,104,11,11,10,255,216, -164,89,255,230,191,123,255,227,195,134,255,40,35,27,227,0,28,16,15,13, -227,126,105,69,255,217,176,112,255,225,175,104,255,223,159,76,255,189,124,49, -255,43,35,20,255,9,8,8,57,0,8,10,10,9,133,194,109,33,255,215, -125,38,255,212,124,39,255,144,93,33,255,29,24,16,255,68,53,29,255,186, -123,49,255,128,95,47,255,25,24,20,255,143,119,78,255,230,201,145,255,33, -30,24,255,0,8,11,11,10,170,217,176,112,255,228,182,109,255,222,158,75, -255,212,134,51,255,204,122,41,255,198,117,37,255,200,118,37,255,208,123,39, -255,212,123,37,255,214,121,39,255,217,133,50,255,24,21,15,244,0,8,11, -11,10,170,218,185,127,255,235,203,148,255,233,202,148,255,230,201,145,255,227, -197,140,255,221,187,128,255,221,184,120,255,224,178,105,255,224,164,85,255,189, -129,58,255,39,32,20,255,7,7,6,85,0,8,11,10,8,125,194,109,33, -255,215,125,38,255,213,125,40,255,29,24,16,255,0,40,17,17,14,170,221, -188,130,255,235,201,152,255,232,201,141,255,42,36,27,255,0,12,17,17,14, -170,219,179,116,255,231,187,124,255,228,183,111,255,24,22,17,255,0,8,11, -11,10,170,218,185,127,255,232,197,137,255,227,179,104,255,219,155,72,255,208, -132,51,255,204,122,41,255,202,120,39,255,38,31,19,170,0,16,12,11,9, -170,196,110,33,255,215,113,38,255,213,122,42,255,215,143,58,255,217,166,92, -255,222,186,123,255,225,195,136,255,52,44,33,198,0,16,17,16,14,170,211, -150,70,255,219,140,56,255,213,126,42,255,25,21,14,255,0,40,17,17,14, -170,221,187,128,255,232,199,141,255,228,180,111,255,219,155,72,255,207,128,44, -255,199,119,39,255,200,118,37,255,208,123,39,255,212,123,37,255,214,125,39, -255,212,124,39,255,34,26,15,181,0,8,11,10,10,161,215,172,104,255,234, -201,143,255,234,206,151,255,42,39,29,255,0,40,12,11,9,170,196,110,33, -255,215,125,38,255,212,124,39,255,36,28,17,170,0,8,15,14,10,85,194, -109,33,255,215,125,38,255,212,124,39,255,210,128,41,255,211,135,54,255,225, -176,98,255,231,197,132,255,56,48,33,255,4,4,4,85,0,20,17,16,14, -170,206,135,51,255,217,133,50,255,213,122,42,255,25,21,14,255,0,32,12, -11,9,170,196,110,33,255,215,125,38,255,213,122,42,255,67,51,28,255,6, -6,5,255,40,34,25,255,226,190,127,255,138,110,69,255,7,7,7,255,25, -24,20,255,221,179,112,255,232,191,127,255,232,201,141,255,26,23,19,255,0, -8,11,11,10,170,214,168,101,255,230,187,119,255,228,188,117,255,212,173,105, -255,150,118,67,255,102,86,47,255,111,90,50,255,185,145,88,255,227,187,118, -255,231,195,132,255,232,201,141,255,26,23,19,255,0,8,11,11,10,170,219, -184,128,255,235,205,154,255,234,206,151,255,42,36,27,255,0,12,15,15,12, -170,213,158,80,255,228,182,109,255,230,191,123,255,27,23,18,255,0,8,11, -11,10,170,219,189,132,255,235,205,154,255,232,197,141,255,225,185,114,255,215, -155,78,255,206,135,51,255,205,126,42,255,209,128,42,255,212,121,41,255,181, -111,36,255,39,30,18,255,8,8,7,57,0,8,10,10,9,136,194,109,33, -255,215,125,38,255,212,124,39,255,24,20,13,255,0,12,15,14,12,170,210, -146,71,255,229,183,110,255,231,197,132,255,26,23,19,255,0,8,11,11,10, -170,218,189,127,255,234,199,143,255,231,197,132,255,225,176,106,255,214,153,75, -255,208,138,55,255,205,133,48,255,210,127,45,255,214,134,49,255,179,119,42, -255,37,30,18,255,7,7,6,85,0,12,23,20,14,227,161,115,50,255,222, -167,89,255,227,186,114,255,225,190,130,255,223,198,136,255,227,198,142,255,224, -196,141,255,221,191,134,255,161,130,86,255,33,30,24,229,10,10,9,42,0, -24,15,15,12,170,211,149,76,255,228,182,109,255,231,189,128,255,44,39,27, -255,0,24,17,17,14,170,216,170,97,255,226,172,95,255,224,165,81,255,31, -26,18,255,0,12,13,12,10,170,201,120,40,255,217,133,50,255,216,125,45, -255,25,21,14,212,0,8,11,10,8,144,203,130,52,255,224,166,83,255,228, -174,103,255,40,34,25,255,0,12,17,16,14,170,221,187,128,255,234,201,143, -255,230,191,123,255,28,25,19,244,0,8,10,10,9,164,203,122,50,255,220, -148,63,255,217,141,52,255,23,20,14,255,0,8,14,13,11,108,10,10,9, -28,0,4,13,13,12,170,221,189,134,255,235,205,154,255,234,206,151,255,42, -37,27,255,0,24,11,11,10,255,222,189,131,255,232,195,131,255,224,162,81, -255,36,29,19,255,4,4,4,54,0,28,7,7,6,28,19,17,12,232,93, -66,30,255,183,112,36,255,209,122,38,255,212,120,39,255,159,102,34,255,22, -19,13,255,7,7,6,85,0,24,6,6,5,28,17,16,14,227,149,122,84, -255,227,195,140,255,227,191,134,255,179,142,90,255,17,16,14,227,5,5,4, -25,0,20,15,14,12,170,204,129,49,255,218,141,51,255,213,126,42,255,25, -21,14,255,0,24,8,7,7,91,68,48,25,255,205,127,44,255,220,153,75, -255,99,78,44,255,8,8,7,113,0,28,12,11,9,170,196,110,33,255,215, -125,38,255,212,124,39,255,24,20,13,255,0,124,9,9,8,25,0,40,2, -2,1,23,9,8,6,255,199,116,34,255,215,125,38,255,212,128,45,255,27, -24,16,207,0,8,11,11,10,170,219,184,128,255,235,205,154,255,234,205,155, -255,58,49,35,255,5,5,4,85,0,4,4,4,3,28,16,15,11,227,204, -122,41,255,215,126,40,255,210,123,39,255,32,25,15,170,0,8,13,13,12, -122,208,168,99,255,234,199,143,255,234,204,151,255,63,54,38,255,5,5,4, -85,0,4,4,4,3,28,18,17,13,215,204,127,45,255,214,125,39,255,212, -121,41,255,34,27,15,170,0,8,13,12,10,85,185,112,34,255,215,125,38, -255,212,123,37,255,35,28,16,255,4,4,3,85,0,4,3,3,2,28,12, -10,9,224,198,117,37,255,215,125,38,255,212,124,39,255,34,27,15,178,0, -8,14,13,11,113,206,162,94,255,232,199,141,255,234,207,155,255,63,53,36, -255,4,4,3,113,0,4,3,3,3,28,10,10,9,255,200,118,37,255,215, -125,38,255,210,123,39,255,27,22,14,227,0,12,3,3,2,6,13,11,8, -221,199,116,34,255,215,125,38,255,212,124,39,255,35,27,16,255,5,4,4, -57,0,12,15,14,12,147,206,154,87,255,232,195,137,255,234,204,151,255,63, -54,38,255,5,5,4,85,0,4,4,4,3,28,18,16,13,227,222,189,131, -255,235,205,152,255,234,205,155,255,27,24,20,255,0,8,11,11,10,170,219, -184,130,255,235,205,152,255,234,205,155,255,58,49,35,255,5,5,4,85,0, -4,4,4,3,28,14,12,9,227,199,117,36,255,215,113,38,255,210,123,39, -255,32,25,15,170,0,8,12,12,9,102,194,109,33,255,215,125,38,255,212, -124,39,255,27,22,14,255,0,24,18,16,13,170,217,176,110,255,234,196,143, -255,234,204,151,255,27,24,20,255,0,8,11,10,10,170,204,134,59,255,219, -136,54,255,213,122,42,255,72,50,27,255,8,8,7,255,25,22,14,255,195, -116,38,255,208,123,39,255,142,91,31,255,16,14,9,193,4,4,3,17,0, -12,11,11,8,170,198,117,37,255,219,133,56,255,221,152,70,255,27,23,16, -221,0,8,13,12,10,99,193,113,34,255,223,156,70,255,231,193,128,255,40, -34,25,255,4,3,3,113,17,16,12,227,208,136,59,255,45,36,21,255,4, -3,3,113,10,9,7,207,196,110,33,255,215,125,38,255,210,128,41,255,32, -25,15,170,0,8,12,11,9,108,194,109,33,255,215,125,38,255,212,124,39, -255,35,27,16,255,4,4,3,85,0,4,3,3,2,28,12,11,9,227,199, -117,36,255,221,150,66,255,229,191,126,255,32,29,23,210,0,8,13,13,12, -122,204,150,79,255,223,159,76,255,217,141,52,255,84,57,29,255,9,8,6, -170,5,5,4,85,6,6,5,113,27,22,14,255,207,128,44,255,223,147,72, -255,227,187,118,255,34,30,23,207,0,8,12,11,11,170,218,180,119,255,229, -184,114,255,224,167,85,255,50,40,25,255,5,5,4,85,0,4,4,4,3, -28,14,12,9,227,203,125,42,255,217,128,48,255,213,128,45,255,35,27,16, -173,0,8,12,12,11,130,209,163,98,255,235,203,148,255,233,202,148,255,63, -54,36,255,5,5,4,85,0,4,4,4,3,28,15,15,12,227,209,137,60, -255,221,151,68,255,219,147,62,255,23,20,14,238,0,8,10,10,9,150,196, -121,41,255,217,128,48,255,215,133,44,255,40,31,19,255,5,5,5,85,0, -4,4,4,3,28,16,14,11,207,201,120,40,255,217,133,50,255,221,161,76, -255,57,44,28,170,0,8,15,14,12,105,211,165,98,255,232,197,137,255,232, -199,141,255,58,49,35,255,4,4,3,113,0,40,3,3,2,17,12,11,9, -227,199,116,34,255,215,125,38,255,212,124,39,255,35,27,16,255,4,4,3, -62,0,12,12,11,9,170,200,120,41,255,223,159,76,255,230,191,123,255,44, -37,27,255,0,12,18,17,15,170,208,140,59,255,217,133,50,255,213,125,40, -255,27,23,14,195,0,8,12,11,9,108,194,109,33,255,215,125,38,255,212, -124,39,255,25,21,14,255,0,12,17,16,14,170,219,179,116,255,235,201,152, -255,234,204,151,255,27,24,20,255,0,8,10,10,9,170,198,122,41,255,215, -127,42,255,213,125,40,255,27,22,14,255,0,20,12,11,9,170,201,120,40, -255,224,156,83,255,231,190,132,255,40,33,25,255,0,12,10,10,9,85,52, -42,29,255,200,142,59,255,183,119,44,255,72,52,27,255,39,30,18,255,49, -37,22,255,150,99,33,255,196,116,37,255,77,50,24,255,10,9,7,144,0, -12,10,10,9,170,196,115,35,255,215,125,38,255,212,124,39,255,25,21,14, -255,0,12,12,11,9,170,196,110,33,255,214,127,43,255,222,158,75,255,41, -34,24,255,0,24,5,5,4,85,11,11,10,255,130,101,59,255,223,176,102, -255,224,176,101,255,177,137,74,255,18,17,13,227,6,5,5,28,0,12,20, -19,15,85,186,120,49,255,217,142,62,255,217,139,56,255,34,29,19,255,4, -4,3,17,0,20,17,17,14,170,221,188,130,255,235,205,152,255,234,205,155, -255,42,39,29,255,0,24,13,13,10,181,199,119,39,255,212,121,41,255,203, -121,40,255,35,29,17,170,0,100,20,18,15,170,222,186,123,255,234,201,143, -255,232,197,135,255,47,40,28,255,0,64,14,13,11,170,213,160,84,255,230, -187,119,255,231,197,132,255,35,30,22,198,0,4,14,13,11,108,217,176,112, -255,232,193,137,255,231,197,132,255,33,28,22,255,0,24,12,12,11,113,31, -29,22,210,40,35,27,255,41,34,24,255,29,24,16,255,32,26,17,255,146, -92,35,255,214,134,49,255,212,128,45,255,123,81,36,255,15,13,10,142,0, -20,7,7,6,85,28,26,19,252,194,140,71,255,212,127,43,255,202,118,35, -255,97,66,30,255,15,14,10,207,6,6,5,25,0,24,6,6,5,8,15, -13,12,227,111,86,50,255,209,168,102,255,176,136,83,255,85,67,44,255,163, -129,80,255,221,186,126,255,83,69,44,255,7,7,6,170,5,5,5,8,0, -4,9,9,8,108,20,18,13,170,13,12,10,51,0,36,16,15,13,170,217, -176,110,255,232,194,133,255,232,198,139,255,36,33,25,255,0,24,15,15,12, -170,219,179,116,255,232,193,137,255,232,199,135,255,31,26,20,255,0,8,11, -11,10,28,56,48,33,227,98,76,45,255,104,80,45,255,195,154,96,255,227, -186,114,255,226,189,125,255,207,173,114,255,222,188,123,255,231,190,132,255,217, -188,124,255,137,109,70,255,99,86,54,255,78,64,43,255,21,20,16,85,0, -8,12,12,11,28,54,48,35,227,86,72,47,255,74,63,43,255,171,137,84, -255,229,191,130,255,230,191,123,255,230,186,123,255,202,164,105,255,97,80,50, -255,75,64,44,255,72,61,39,255,22,21,17,102,0,36,12,11,11,45,55, -45,30,227,90,71,45,255,78,63,41,255,72,61,39,255,74,63,43,255,72, -61,39,255,72,61,39,255,91,74,46,255,78,63,41,255,22,20,17,102,0, -48,12,12,11,176,132,106,61,255,228,188,125,255,210,172,113,255,42,37,29, -255,9,9,8,62,0,16,17,16,14,170,221,186,124,255,234,199,143,255,232, -201,141,255,232,201,141,255,221,189,134,255,52,46,33,255,6,7,6,227,24, -23,17,255,208,132,51,255,215,133,44,255,212,124,39,255,24,20,13,255,0, -24,17,16,12,170,219,177,112,255,231,187,124,255,228,182,109,255,40,33,23, -255,0,36,9,9,8,74,17,15,12,227,67,51,28,255,162,107,43,255,200, -142,67,255,204,157,91,255,177,140,86,255,74,63,43,255,19,17,16,198,9, -9,8,28,0,32,14,14,11,31,56,46,31,227,192,157,103,255,229,194,128, -255,225,188,124,255,146,112,67,255,11,10,8,164,0,8,7,7,6,28,34, -27,17,255,190,107,33,255,210,121,35,255,146,95,35,255,16,14,11,187,0, -8,9,9,8,170,214,164,93,255,232,194,127,255,231,195,132,255,40,34,25, -255,0,40,13,13,10,170,213,157,84,255,224,166,83,255,221,150,66,255,23, -20,14,246,0,8,12,11,9,113,194,109,33,255,212,119,37,255,210,113,35, -255,168,103,33,255,56,42,23,255,27,23,14,255,38,31,19,255,149,92,30, -255,207,118,32,255,207,113,30,255,124,75,27,255,13,11,8,161,0,28,12, -12,11,176,130,99,59,255,229,191,126,255,211,174,116,255,43,37,28,255,9, -9,8,59,0,16,8,8,7,85,68,58,37,255,214,177,119,255,231,196,136, -255,207,171,114,255,97,80,50,255,54,47,35,255,66,59,41,255,178,148,95, -255,228,189,121,255,224,187,123,255,146,112,67,255,12,12,11,170,0,12,10, -10,9,28,16,15,13,147,29,28,22,221,48,42,31,255,70,61,41,255,66, -57,39,255,70,61,41,255,171,140,92,255,224,170,101,255,224,168,87,255,224, -165,81,255,39,32,22,255,0,64,14,13,11,57,100,82,51,255,222,186,123, -255,226,172,95,255,113,82,38,255,9,8,8,127,0,32,11,9,6,102,11, -10,6,170,11,10,8,170,12,11,9,170,15,13,10,170,15,13,10,170,15, -14,10,170,18,15,11,170,18,15,11,156,12,11,9,28,0,28,6,6,5, -65,40,34,25,255,224,183,119,255,229,195,136,255,171,140,92,255,21,20,18, -142,0,24,11,10,8,102,131,92,46,255,213,145,56,255,214,119,43,255,210, -128,41,255,151,94,32,255,23,21,14,255,10,10,9,85,0,12,10,9,7, -170,191,106,30,255,211,115,30,255,208,114,31,255,141,87,30,255,36,31,19, -255,121,90,42,255,217,168,92,255,205,163,102,255,132,102,59,255,213,172,108, -255,231,193,128,255,35,30,22,255,0,8,11,11,10,164,203,129,50,255,215, -127,42,255,211,117,34,255,166,97,29,255,54,40,21,255,29,23,14,255,38, -31,19,255,120,78,29,255,206,118,33,255,214,127,43,255,224,155,81,255,23, -21,16,255,0,8,11,10,10,170,217,183,116,255,234,201,143,255,232,198,139, -255,202,166,109,255,97,78,50,255,52,46,33,255,58,50,33,255,150,96,39, -255,208,121,37,255,195,112,30,255,83,53,24,255,9,8,6,113,0,8,13, -12,8,96,189,104,28,255,210,120,33,255,214,132,45,255,34,29,19,255,0, -40,17,16,12,170,217,172,102,255,228,180,105,255,228,181,107,255,40,33,23, -255,0,12,17,15,12,170,216,171,101,255,232,191,127,255,231,197,132,255,24, -22,17,255,0,8,11,11,10,167,209,146,72,255,221,151,68,255,213,126,42, -255,172,106,35,255,57,41,22,255,42,32,19,255,43,33,20,252,18,15,11, -85,0,16,11,10,8,170,193,111,30,255,215,113,38,255,220,144,63,255,197, -145,84,255,91,71,44,255,75,62,42,255,75,64,44,255,22,21,17,99,0, -16,14,13,11,170,196,110,33,255,210,115,31,255,210,115,31,255,22,19,11, -227,0,8,16,13,9,113,24,21,15,170,17,15,12,170,18,15,13,170,19, -17,12,142,9,8,8,28,0,8,14,13,11,170,210,146,71,255,220,142,59, -255,213,125,40,255,168,103,33,255,54,40,21,255,29,23,14,255,38,31,19, -255,119,78,30,255,204,116,31,255,210,119,31,255,210,115,31,255,26,20,13, -210,0,8,11,11,10,170,217,179,120,255,234,202,147,255,232,201,141,255,40, -35,25,255,0,40,11,10,8,170,193,111,30,255,211,115,30,255,210,115,31, -255,36,25,13,170,0,8,14,12,9,85,190,105,29,255,210,107,31,255,208, -114,31,255,187,124,42,255,143,111,56,255,210,171,109,255,229,187,128,255,131, -99,54,255,8,8,7,156,0,20,13,12,10,170,194,112,31,255,210,107,31, -255,210,115,31,255,22,19,11,255,0,32,11,10,8,170,193,111,30,255,215, -125,38,255,218,141,59,255,39,33,22,255,5,5,5,28,12,12,11,170,156, -126,83,255,27,24,20,227,5,5,5,23,14,13,11,198,219,177,112,255,232, -191,127,255,230,191,123,255,25,22,16,249,0,8,11,10,8,153,200,120,41, -255,214,127,43,255,213,126,42,255,93,66,32,255,11,11,10,255,34,31,23, -255,206,152,81,255,226,179,111,255,231,189,128,255,232,192,135,255,232,201,141, -255,25,22,18,255,0,8,11,10,10,170,215,171,102,255,228,174,105,255,222, -158,75,255,27,24,16,255,0,12,15,15,12,170,219,177,112,255,232,193,137, -255,232,201,141,255,25,22,18,255,0,8,11,10,10,170,215,172,104,255,228, -182,109,255,221,155,70,255,177,114,46,255,55,42,24,255,35,28,18,255,41, -31,18,255,35,28,17,255,27,22,14,255,17,16,12,187,9,9,8,79,0, -12,10,9,7,170,191,106,30,255,211,115,30,255,210,115,31,255,33,25,14, -255,0,12,21,20,16,170,221,180,116,255,232,193,137,255,232,201,141,255,25, -22,18,255,0,8,11,11,10,170,212,160,85,255,224,156,83,255,218,141,59, -255,175,115,44,255,55,42,24,255,31,25,16,255,38,30,19,255,127,82,30, -255,204,116,31,255,195,112,30,255,82,55,25,255,11,10,8,150,0,12,9, -9,8,28,15,14,12,142,28,25,19,221,46,40,29,255,71,60,38,255,66, -57,39,255,70,61,41,255,193,159,106,255,227,184,108,255,221,153,72,255,155, -98,36,255,13,12,10,170,0,24,17,15,12,170,219,180,112,255,232,197,137, -255,232,201,141,255,40,35,25,255,0,24,14,13,11,170,198,117,37,255,213, -124,38,255,210,121,35,255,23,19,12,255,0,12,11,10,8,170,193,111,30, -255,211,115,30,255,208,114,31,255,23,19,12,207,0,8,14,13,11,85,181, -132,68,255,228,185,117,255,231,193,128,255,54,46,31,255,5,5,4,8,0, -8,21,20,16,178,215,160,88,255,223,147,72,255,206,135,51,255,23,20,14, -170,0,8,12,11,9,102,192,111,31,255,210,108,33,255,208,114,31,255,22, -18,11,255,0,4,10,10,9,113,79,61,38,255,17,16,12,198,0,4,16, -15,13,170,219,179,116,255,231,187,124,255,224,169,91,255,33,28,20,255,0, -20,9,8,8,85,39,33,24,255,217,166,92,255,219,140,56,255,210,121,35, -255,66,44,21,255,7,7,6,133,0,32,6,6,5,74,19,18,12,255,183, -102,30,255,207,105,30,255,210,111,31,255,73,51,24,255,8,8,7,116,0, -24,6,6,6,28,15,13,12,227,144,112,61,255,221,180,116,255,224,178,113, -255,152,116,65,255,18,17,13,221,8,8,7,28,0,24,12,10,9,170,193, -111,30,255,210,107,31,255,210,115,31,255,22,19,11,255,0,28,16,15,13, -227,164,122,63,255,225,185,114,255,192,153,97,255,21,19,16,232,7,7,6, -28,0,24,11,10,8,170,193,111,30,255,211,115,30,255,210,115,31,255,23, -19,12,255,0,148,6,6,5,51,11,9,6,85,12,10,7,102,10,8,5, -156,10,8,5,127,8,7,5,184,27,22,12,255,198,105,29,255,211,122,36, -255,220,136,61,255,25,22,16,255,0,8,10,10,9,170,218,181,123,255,234, -202,147,255,232,197,141,255,30,27,21,255,0,12,9,8,6,170,191,106,30, -255,211,115,30,255,210,111,31,255,39,27,14,170,0,8,12,11,11,170,218, -180,119,255,234,196,143,255,232,201,141,255,29,26,20,255,0,12,7,7,6, -28,27,22,14,156,25,22,14,255,32,25,15,210,22,18,11,28,0,8,10, -9,7,150,195,112,30,255,211,115,30,255,210,115,31,255,19,15,10,252,0, -12,9,9,8,170,191,106,30,255,211,111,30,255,208,114,31,255,25,20,12, -204,0,8,12,11,11,170,218,180,119,255,234,202,147,255,232,201,141,255,142, -111,63,255,14,12,9,227,10,9,7,127,8,7,5,181,35,25,14,255,199, -112,28,255,209,118,30,255,209,117,28,255,30,22,13,255,0,16,9,8,6, -167,191,106,30,255,211,115,30,255,210,115,31,255,19,15,10,252,0,16,21, -19,16,170,220,178,113,255,232,197,137,255,232,201,141,255,26,23,19,255,0, -12,11,11,10,170,218,181,123,255,234,201,143,255,231,197,132,255,24,22,17, -255,0,8,11,10,10,170,218,181,123,255,234,201,143,255,231,197,132,255,30, -26,21,255,0,12,9,8,6,167,191,106,30,255,211,115,30,255,210,111,31, -255,39,27,14,170,0,8,13,12,8,85,190,105,29,255,213,119,36,255,214, -132,45,255,32,26,17,255,0,24,17,16,14,170,221,186,124,255,234,202,147, -255,232,199,135,255,25,22,18,252,0,8,11,10,8,127,192,111,31,255,210, -107,31,255,208,114,31,255,161,94,28,255,65,43,20,255,145,85,26,255,207, -117,30,255,122,75,29,255,15,14,10,170,5,5,4,8,0,16,11,10,8, -170,196,115,35,255,223,146,70,255,228,183,111,255,25,22,16,252,0,8,14, -12,9,85,190,105,29,255,215,125,38,255,218,141,59,255,30,24,17,195,0, -4,10,10,7,170,193,111,30,255,20,17,11,252,0,4,11,10,8,85,188, -103,27,255,211,115,30,255,209,106,30,255,39,27,14,170,0,8,13,12,8, -85,190,105,29,255,211,115,30,255,210,115,31,255,19,15,10,255,0,12,9, -8,6,167,192,111,31,255,218,137,51,255,227,175,100,255,27,24,18,255,0, -8,11,10,8,147,196,106,33,255,210,108,33,255,210,115,31,255,30,23,13, -255,4,4,3,14,0,8,15,14,12,195,211,149,76,255,229,184,114,255,232, -199,135,255,28,25,19,255,0,8,11,10,8,167,203,129,50,255,215,127,42, -255,210,121,35,255,20,17,11,232,0,12,9,8,6,139,190,105,29,255,211, -111,30,255,209,114,30,255,30,22,13,198,0,8,13,12,10,170,217,173,104, -255,232,193,137,255,232,194,139,255,25,22,18,255,0,12,9,8,8,156,192, -111,31,255,210,108,33,255,210,115,31,255,32,24,13,173,0,8,13,12,8, -88,190,105,29,255,211,115,30,255,208,114,31,255,19,15,10,255,0,12,7, -7,6,28,27,22,14,198,45,36,21,255,52,43,29,244,14,13,11,85,0, -8,13,13,12,88,177,143,90,255,230,194,131,255,226,172,95,255,137,91,36, -255,10,9,7,227,8,8,5,161,10,9,7,167,10,9,7,136,13,10,6, -85,7,6,6,74,0,24,9,8,6,167,191,106,30,255,211,115,30,255,210, -115,31,255,19,15,10,252,0,16,12,11,9,170,208,141,61,255,230,187,119, -255,232,201,141,255,40,34,25,255,0,12,14,12,9,170,196,109,31,255,210, -107,31,255,210,115,31,255,36,25,13,170,0,8,10,9,7,85,155,91,28, -255,208,114,31,255,209,106,30,255,30,22,13,255,0,12,22,21,17,176,222, -186,123,255,234,199,143,255,226,195,135,255,35,29,22,178,0,8,12,11,9, -105,190,105,29,255,211,115,30,255,208,114,31,255,23,19,12,210,0,8,15, -12,8,59,7,6,4,3,0,4,9,9,8,159,204,134,59,255,230,182,119, -255,232,198,139,255,39,33,24,255,0,16,10,10,9,34,15,14,10,198,52, -40,21,255,165,96,28,255,198,113,29,255,185,102,28,255,80,53,25,255,19, -17,12,227,10,9,7,76,0,16,11,10,8,170,195,112,30,255,211,115,30, -255,210,115,31,255,20,16,11,255,0,12,10,9,7,170,192,111,31,255,215, -125,38,255,224,159,83,255,41,33,24,255,0,24,7,7,6,108,24,20,13, -255,146,88,31,255,195,127,38,255,113,77,34,255,15,14,12,210,7,7,6, -28,0,16,12,12,11,28,37,30,18,227,168,99,31,255,206,114,33,255,51, -34,18,255,6,5,5,71,0,20,17,16,14,170,221,186,124,255,234,202,147, -255,232,201,141,255,40,35,25,255,0,24,17,15,10,227,198,105,29,255,194, -109,33,255,62,44,23,255,16,14,11,85,0,100,19,17,12,142,214,171,97, -255,228,183,113,255,227,186,108,255,50,40,25,227,0,64,12,11,9,198,214, -158,85,255,229,183,110,255,228,181,107,255,21,19,14,249,2,2,1,20,8, -8,7,181,210,156,79,255,226,169,95,255,224,155,81,255,33,26,18,255,4, -4,4,28,0,40,3,3,2,28,11,10,8,255,209,138,62,255,223,154,72, -255,221,164,82,255,27,23,16,249,0,16,7,7,6,79,46,38,25,255,197, -151,84,255,222,161,89,255,209,128,42,255,141,91,32,255,15,13,10,218,5, -5,5,11,0,28,15,13,10,139,191,131,60,255,220,168,93,255,168,123,69, -255,14,13,11,227,5,5,5,85,9,9,8,170,105,78,40,255,162,116,61, -255,88,66,37,255,23,21,16,255,11,11,10,255,78,58,35,255,208,150,75, -255,61,46,28,181,0,36,15,13,10,170,216,170,97,255,230,187,119,255,228, -178,113,255,34,28,19,255,0,24,15,13,10,170,215,167,92,255,229,179,114, -255,228,181,107,255,32,27,19,255,0,16,6,6,6,25,5,5,4,198,52, -42,27,255,220,169,97,255,189,142,76,255,35,31,22,255,134,96,51,255,225, -176,106,255,140,106,53,255,6,6,5,255,6,6,6,51,0,28,5,5,5, -28,15,13,10,227,208,136,59,255,218,138,53,255,213,122,42,255,43,31,18, -255,5,5,4,85,0,136,9,8,8,57,57,47,30,255,212,163,93,255,224, -157,85,255,124,90,45,255,10,10,9,147,0,20,15,13,10,170,216,170,97, -255,228,181,107,255,224,165,81,255,194,136,61,255,58,46,29,255,12,12,11, -85,0,4,10,9,7,156,174,91,23,255,202,103,23,255,202,102,21,255,20, -16,9,255,0,24,15,13,10,170,213,155,80,255,227,175,100,255,227,171,98, -255,35,29,20,255,0,32,7,7,6,85,49,33,18,255,183,108,34,255,209, -128,42,255,209,137,60,255,186,134,67,255,95,74,39,255,22,20,15,229,8, -8,7,105,0,44,5,4,4,28,17,15,12,227,216,167,89,255,228,181,107, -255,223,176,102,255,34,28,19,184,0,8,12,11,9,108,180,106,33,255,214, -125,39,255,217,141,52,255,42,33,21,255,4,4,4,85,0,8,11,10,8, -198,211,149,76,255,224,160,77,255,220,144,63,255,34,27,17,255,0,40,12, -10,7,170,189,99,26,255,206,102,25,255,203,100,24,255,30,21,11,176,0, -8,12,10,7,85,167,87,22,255,202,103,23,255,202,102,21,255,27,20,10, -255,4,4,3,68,0,4,4,4,4,28,12,10,7,215,176,91,23,255,203, -104,24,255,202,105,27,255,28,21,13,249,0,24,9,8,8,57,57,47,30, -255,213,167,94,255,228,184,115,255,126,92,47,255,9,9,8,147,0,20,13, -12,10,167,199,131,58,255,220,148,63,255,219,147,62,255,49,38,24,255,6, -6,6,85,0,4,5,5,5,28,15,14,12,227,217,169,94,255,228,183,111, -255,225,174,102,255,31,25,18,241,0,36,5,5,5,28,15,13,10,227,204, -127,45,255,219,133,56,255,221,150,66,255,35,28,18,255,0,68,10,9,9, -85,45,34,21,255,201,110,30,255,192,100,25,255,57,35,16,255,12,10,7, -85,0,24,13,11,6,79,126,68,21,255,191,100,26,255,198,117,37,255,208, -139,65,255,213,155,80,255,214,161,85,255,215,167,92,255,216,167,89,255,215, -160,88,255,49,38,24,170,0,24,7,7,6,76,45,36,24,249,207,164,90, -255,228,183,111,255,143,111,56,255,13,12,10,170,0,28,13,12,8,142,182, -99,25,255,203,108,24,255,202,102,21,255,112,65,23,255,15,13,8,227,6, -6,5,45,0,16,10,8,7,170,171,89,22,255,202,95,23,255,202,103,23, -255,103,64,26,255,20,18,13,255,79,61,36,255,222,173,97,255,227,179,104, -255,224,172,97,255,226,171,99,255,224,176,93,255,36,29,19,207,0,8,12, -10,7,113,176,91,23,255,202,95,23,255,202,102,21,255,27,20,10,255,4, -4,3,74,0,4,4,4,4,28,11,9,6,215,187,101,24,255,216,134,45, -255,226,172,95,255,23,21,16,241,0,8,10,10,9,161,212,160,85,255,226, -172,95,255,222,158,75,255,51,39,24,255,6,6,6,85,0,4,4,4,3, -28,11,10,6,215,176,91,23,255,202,102,21,255,191,102,22,255,22,17,9, -170,0,8,12,10,7,85,167,87,22,255,204,105,25,255,217,133,50,255,35, -28,18,255,0,40,15,13,10,170,199,116,34,255,212,114,35,255,218,139,55, -255,33,27,18,255,0,12,15,13,10,170,213,160,84,255,227,175,100,255,224, -165,81,255,25,21,14,235,0,8,13,11,8,108,184,96,25,255,203,96,24, -255,202,95,23,255,27,20,10,255,4,4,3,71,0,28,10,9,7,170,187, -101,24,255,216,134,45,255,224,167,85,255,54,42,27,255,6,6,6,85,0, -28,10,9,7,170,171,89,22,255,202,103,23,255,202,102,21,255,29,21,10, -170,0,4,11,9,6,42,137,77,24,255,211,136,56,255,215,167,92,255,216, -166,95,255,213,163,84,255,33,28,18,161,0,8,11,10,8,130,184,100,25, -255,203,100,24,255,202,102,21,255,27,20,10,255,4,4,3,74,0,4,4, -4,4,28,11,9,6,215,176,91,23,255,202,103,23,255,202,95,23,255,28, -21,11,190,0,8,10,10,9,161,212,161,89,255,228,174,105,255,223,161,80, -255,33,28,18,255,0,40,10,9,7,167,171,89,22,255,202,103,23,255,202, -102,21,255,29,21,10,170,0,8,12,10,7,85,167,87,22,255,202,103,23, -255,203,108,24,255,68,47,25,255,6,6,5,255,31,26,20,255,220,168,93, -255,220,177,101,255,110,80,41,255,12,11,9,150,0,16,10,9,7,170,171, -89,22,255,202,103,23,255,202,102,21,255,20,16,9,255,0,32,10,9,7, -170,193,111,30,255,219,136,54,255,224,165,81,255,27,24,16,255,0,4,7, -7,7,28,21,20,16,181,10,10,9,85,0,4,12,11,9,170,204,130,51, -255,218,141,51,255,211,122,36,255,32,23,13,187,0,8,13,11,8,85,167, -87,22,255,203,100,24,255,208,105,29,255,23,19,12,255,4,4,3,28,11, -10,8,181,211,158,82,255,229,183,110,255,228,183,111,255,228,183,113,255,228, -181,107,255,27,23,16,229,0,8,10,10,9,150,192,111,31,255,208,112,27, -255,203,108,24,255,21,17,10,255,0,12,15,13,10,170,216,170,97,255,229, -183,110,255,228,181,107,255,25,21,16,235,0,8,11,10,8,142,194,116,33, -255,209,106,30,255,203,108,24,255,27,20,10,255,4,4,3,74,0,36,10, -8,7,170,171,89,22,255,202,103,23,255,202,102,21,255,42,28,13,255,6, -5,5,48,0,4,6,6,6,28,21,19,14,255,221,175,102,255,229,179,114, -255,228,181,107,255,24,20,15,246,0,8,12,11,9,127,190,104,27,255,206, -106,25,255,202,103,23,255,27,20,10,255,4,4,3,74,0,4,4,4,4, -28,11,10,6,215,176,91,23,255,204,105,25,255,207,122,38,255,28,22,15, -238,0,36,5,5,5,28,15,13,10,227,195,111,28,255,204,105,25,255,197, -100,22,255,22,17,9,224,0,24,15,13,10,170,216,170,97,255,229,184,114, -255,228,181,107,255,34,28,19,255,0,24,10,9,7,170,174,91,23,255,202, -103,23,255,202,102,21,255,20,16,9,252,0,12,10,9,7,170,171,89,22, -255,202,107,23,255,206,111,27,255,22,17,11,252,0,8,8,7,7,45,73, -59,36,255,218,174,105,255,228,178,107,255,89,67,36,255,7,7,6,113,0, -4,5,5,4,28,20,18,13,255,199,110,30,255,202,105,27,255,88,54,23, -255,10,9,7,113,0,8,13,11,6,85,167,87,22,255,202,95,23,255,202, -90,23,255,32,24,13,255,4,4,3,178,19,16,12,238,212,163,93,255,66, -52,31,255,5,5,5,184,14,13,11,255,205,133,48,255,212,114,35,255,208, -117,29,255,29,22,14,255,0,16,12,11,9,85,101,74,38,255,189,121,49, -255,185,104,32,255,180,98,25,255,180,93,23,255,154,82,23,255,75,44,18, -255,11,9,6,144,0,32,10,9,7,170,157,79,22,255,202,102,21,255,202, -102,21,255,22,17,9,255,0,28,14,13,11,224,136,98,53,255,217,165,82, -255,213,145,56,255,150,92,35,255,19,16,12,173,5,5,5,8,0,28,10, -8,7,170,171,89,22,255,202,103,23,255,202,102,21,255,20,16,9,252,0, -28,7,7,6,59,43,35,24,255,221,175,102,255,223,178,106,255,134,98,51, -255,14,13,11,142,0,24,10,9,7,167,171,89,22,255,202,103,23,255,202, -102,21,255,20,16,9,255,0,144,12,10,7,170,46,29,13,255,140,74,21, -255,165,86,22,255,167,87,22,255,165,86,22,255,167,87,22,255,185,95,22, -255,198,97,23,255,206,111,27,255,221,146,66,255,23,19,14,249,0,8,10, -10,9,153,212,161,89,255,229,183,110,255,224,165,81,255,28,23,15,255,0, -12,10,8,7,156,171,89,22,255,202,103,23,255,202,102,21,255,31,21,10, -170,0,8,10,10,9,167,212,160,85,255,228,177,105,255,222,158,75,255,27, -23,16,255,0,40,10,8,7,170,167,87,22,255,202,103,23,255,202,102,21, -255,20,16,9,238,0,12,10,8,7,164,171,89,22,255,202,103,23,255,203, -100,24,255,22,18,11,235,0,8,10,10,9,167,214,164,93,255,228,182,109, -255,223,154,80,255,207,120,36,255,189,94,24,255,167,87,22,255,167,87,22, -255,187,96,22,255,198,93,23,255,202,93,21,255,198,96,21,255,26,19,9, -227,0,16,10,8,7,167,171,89,22,255,202,103,23,255,202,102,21,255,20, -15,9,252,0,16,17,15,12,170,216,170,97,255,229,183,110,255,224,164,85, -255,29,24,16,255,3,3,2,28,0,8,12,11,9,198,211,149,76,255,221, -151,68,255,219,146,60,255,22,19,13,246,0,8,10,10,9,161,210,155,77, -255,223,147,72,255,213,122,42,255,23,18,12,255,0,12,10,8,7,167,171, -89,22,255,202,103,23,255,202,102,21,255,29,21,10,170,0,8,12,10,7, -85,166,87,23,255,209,118,30,255,218,139,55,255,33,27,18,255,0,24,15, -13,10,170,215,159,92,255,226,169,95,255,218,141,59,255,34,26,15,190,0, -8,13,10,6,85,167,87,22,255,202,103,23,255,198,96,21,255,197,96,22, -255,189,97,22,255,198,96,21,255,198,96,21,255,25,19,10,255,4,4,3, -28,0,20,10,9,7,170,178,92,23,255,210,107,31,255,215,128,44,255,33, -24,14,193,0,8,12,10,7,85,167,87,22,255,202,95,23,255,202,103,23, -255,32,22,11,170,0,4,10,8,7,170,171,89,22,255,24,17,9,249,0, -4,12,10,7,85,163,82,22,255,202,103,23,255,202,102,21,255,29,21,10, -170,0,8,12,10,7,85,166,87,23,255,202,103,23,255,202,102,21,255,20, -15,9,255,0,12,10,8,7,167,170,89,23,255,206,106,25,255,208,115,33, -255,28,21,13,207,0,8,13,10,6,85,167,87,22,255,202,95,23,255,202, -102,21,255,20,16,9,255,0,12,15,13,10,170,214,158,85,255,229,183,110, -255,228,185,111,255,24,20,15,249,0,8,12,11,9,108,176,91,23,255,202, -95,23,255,202,102,21,255,18,15,9,255,2,2,1,8,0,8,8,7,5, -184,171,89,22,255,202,95,23,255,202,102,21,255,34,23,11,173,0,8,12, -11,9,136,212,160,85,255,228,180,105,255,225,165,88,255,31,25,18,255,3, -3,2,28,0,8,8,7,5,178,171,89,22,255,202,103,23,255,202,102,21, -255,30,21,11,170,0,8,12,10,7,85,167,87,22,255,202,103,23,255,202, -102,21,255,20,15,9,255,0,40,7,7,6,28,30,27,21,238,167,111,50, -255,206,110,33,255,199,102,24,255,175,90,22,255,165,86,22,255,167,87,22, -255,167,87,22,255,161,87,22,255,84,48,19,255,18,15,9,227,8,7,5, -28,0,16,10,8,7,167,171,89,22,255,202,103,23,255,202,102,21,255,20, -15,9,252,0,16,15,13,10,170,211,159,76,255,229,180,110,255,228,182,109, -255,34,28,19,255,0,12,10,9,7,170,171,89,22,255,202,103,23,255,202, -102,21,255,31,22,10,170,0,8,7,6,6,28,48,31,15,255,189,93,22, -255,202,102,21,255,45,29,14,255,5,5,4,113,0,4,5,5,4,28,22, -20,15,255,220,169,97,255,226,178,103,255,167,118,54,255,15,13,10,133,0, -8,13,11,6,85,167,87,22,255,202,103,23,255,202,102,21,255,19,15,8, -215,0,4,11,9,6,105,121,65,20,255,26,18,9,190,0,4,9,9,8, -167,208,150,75,255,229,183,110,255,228,181,113,255,37,29,20,255,0,24,8, -8,5,218,167,87,22,255,202,93,21,255,198,104,21,255,23,18,10,255,3, -3,2,51,0,20,10,9,7,153,171,89,22,255,202,95,23,255,202,102,21, -255,20,15,9,255,2,2,1,17,0,8,8,7,5,181,184,100,25,255,215, -119,42,255,224,160,85,255,34,28,19,255,0,20,9,8,6,85,31,22,12, -255,166,87,23,255,189,97,22,255,99,60,22,255,15,13,8,170,0,28,4, -3,3,23,13,11,8,227,182,94,23,255,149,87,26,255,19,17,12,227,7, -7,7,23,0,16,15,13,10,170,216,170,97,255,229,179,114,255,228,182,109, -255,34,28,19,255,0,20,9,8,6,130,69,42,18,255,195,95,22,255,35, -24,12,255,5,5,4,76,0,104,10,9,7,28,27,24,16,184,32,27,19, -255,39,29,20,212,13,12,10,85,0,60,13,11,8,170,81,54,28,255,216, -148,67,255,223,161,72,255,220,147,61,255,117,76,32,255,13,11,8,255,44, -33,19,255,207,123,40,255,217,136,50,255,218,142,53,255,156,100,39,255,18, -15,11,227,10,8,7,28,0,12,15,13,8,125,19,14,10,170,14,11,7, -170,10,8,7,170,11,9,6,122,13,10,8,85,8,7,5,153,46,33,21, -255,212,138,51,255,221,151,68,255,191,132,62,255,19,17,12,176,0,12,7, -7,6,76,26,22,15,241,189,129,58,255,219,152,72,255,217,154,72,255,133, -87,38,255,15,13,10,221,6,6,5,28,0,8,15,12,8,113,20,16,11, -170,17,14,10,142,7,6,6,28,0,8,19,16,12,170,200,117,35,255,212, -123,37,255,115,74,30,255,9,8,6,113,0,8,12,11,9,178,104,73,37, -255,206,147,63,255,178,121,53,255,58,46,29,255,46,36,25,255,40,32,21, -252,19,17,12,85,0,36,12,10,9,164,191,131,60,255,223,161,80,255,221, -151,68,255,46,34,21,255,4,4,3,3,0,20,19,16,12,173,208,134,55, -255,223,156,70,255,216,160,81,255,21,19,14,255,0,16,6,5,5,25,17, -14,10,227,67,48,28,255,94,67,35,255,20,17,13,227,6,6,5,113,12, -11,9,198,67,51,30,255,85,62,32,255,25,20,14,255,9,8,6,82,0, -32,10,8,5,170,161,87,22,255,195,90,20,255,187,91,20,255,19,14,8, -255,0,28,15,12,8,119,20,16,11,170,17,14,10,156,10,8,7,28,0, -64,15,12,8,122,18,15,11,170,17,14,10,144,10,8,7,28,0,16,13, -12,10,170,157,96,36,255,211,123,38,255,199,116,34,255,31,24,16,255,6, -6,6,28,0,20,16,13,11,170,197,110,32,255,209,110,30,255,202,103,23, -255,58,36,15,255,8,7,5,113,0,8,10,8,5,85,137,68,18,255,185, -86,20,255,174,88,19,255,18,13,7,255,0,24,12,10,9,170,204,129,49, -255,220,144,63,255,217,133,50,255,26,20,13,255,0,28,7,6,6,76,23, -19,12,244,185,113,36,255,207,129,52,255,173,117,50,255,59,46,28,255,18, -15,13,198,9,9,8,113,6,6,6,11,0,24,15,12,8,133,22,17,11, -170,17,14,10,142,8,7,5,28,0,12,9,8,6,170,202,128,49,255,220, -148,63,255,219,140,56,255,22,19,13,255,0,8,12,10,9,170,200,125,37, -255,218,141,51,255,220,147,61,255,138,86,35,255,13,10,8,227,11,9,6, -170,13,11,8,198,61,41,22,255,202,111,31,255,204,105,25,255,200,105,21, -255,22,17,9,221,0,12,11,9,6,108,14,11,7,170,11,9,6,139,6, -5,3,17,0,12,9,7,6,133,144,75,19,255,185,86,20,255,178,86,19, -255,27,18,8,170,0,8,11,9,6,85,134,70,19,255,181,88,20,255,180, -87,19,255,24,15,7,178,0,12,10,8,5,99,165,86,22,255,206,111,27, -255,213,124,38,255,36,27,17,255,0,24,10,10,9,133,167,112,48,255,222, -166,77,255,223,157,72,255,54,39,23,255,5,5,4,37,0,20,13,11,8, -170,181,93,22,255,206,111,27,255,214,127,43,255,20,16,11,255,0,12,9, -8,8,170,203,129,50,255,222,145,63,255,220,147,61,255,33,26,16,255,0, -12,12,10,7,113,15,12,8,170,13,10,8,122,0,16,10,8,7,170,200, -120,41,255,220,142,59,255,219,146,60,255,27,21,14,255,0,12,13,11,8, -113,18,15,11,170,17,14,10,142,8,7,5,28,0,12,14,12,9,113,20, -15,11,170,17,14,10,153,10,8,7,28,0,16,9,8,6,85,29,21,10, -255,119,62,20,255,153,79,20,255,40,25,11,255,9,8,6,85,0,20,10, -8,7,28,32,24,13,218,68,47,25,255,61,43,24,255,61,46,28,255,61, -47,28,255,61,47,28,255,66,50,29,255,73,55,32,255,66,48,29,255,24, -20,15,85,0,20,7,6,6,79,32,26,17,244,199,132,54,255,208,150,75, -255,122,87,41,255,17,15,10,170,0,32,10,9,7,28,32,23,11,227,53, -33,14,255,34,23,11,255,12,10,7,190,6,5,5,28,0,20,9,7,4, -170,146,76,19,255,197,99,20,255,204,110,27,255,59,41,22,255,6,6,6, -170,10,9,9,113,31,26,18,184,30,25,17,255,29,25,18,255,34,27,19, -255,37,28,18,221,13,11,8,57,0,8,13,10,6,88,144,75,19,255,185, -86,20,255,178,90,19,255,20,14,7,212,0,12,9,7,4,125,157,81,20, -255,212,117,33,255,220,148,63,255,27,21,14,218,0,8,12,10,9,127,192, -111,31,255,208,112,27,255,202,103,23,255,22,16,9,204,0,12,10,8,5, -93,137,68,18,255,185,94,20,255,180,91,19,255,30,20,9,170,0,8,11, -9,6,85,140,67,19,255,202,106,21,255,214,125,39,255,25,20,14,255,0, -12,6,6,5,28,13,11,8,139,20,16,11,170,19,15,10,142,8,7,5, -28,0,8,10,9,5,142,153,79,20,255,195,90,20,255,206,111,27,255,24, -20,13,255,0,12,12,10,9,170,195,113,32,255,211,115,30,255,203,108,24, -255,31,21,10,173,0,8,11,9,6,85,140,70,19,255,185,86,20,255,180, -87,19,255,24,15,7,181,0,32,9,8,6,170,174,91,23,255,215,123,42, -255,221,150,66,255,25,20,14,255,0,32,9,7,4,170,148,77,19,255,181, -92,20,255,180,87,19,255,25,17,8,170,0,8,34,24,13,170,161,102,38, -255,219,154,70,255,220,142,59,255,213,124,38,255,32,24,13,198,0,8,11, -9,6,85,140,70,19,255,185,86,20,255,178,90,19,255,20,14,7,212,0, -12,8,7,5,127,144,78,19,255,185,86,20,255,180,87,19,255,29,19,10, -170,0,8,13,11,8,116,194,116,33,255,209,110,30,255,202,95,23,255,22, -17,9,221,0,12,10,8,5,85,12,9,5,170,10,8,5,130,6,5,3, -8,0,12,10,8,5,110,144,78,19,255,185,86,20,255,178,86,19,255,27, -18,8,170,0,8,11,8,6,85,137,68,18,255,185,86,20,255,200,105,21, -255,29,21,12,255,4,4,4,25,10,9,7,139,154,100,47,255,215,148,70, -255,198,131,45,255,46,34,19,255,11,9,6,88,0,12,10,8,5,119,144, -78,19,255,185,86,20,255,180,87,19,255,21,15,8,210,0,32,13,11,8, -170,199,119,39,255,220,144,63,255,221,155,70,255,27,21,14,255,0,20,10, -9,7,170,171,89,22,255,195,98,20,255,183,89,19,255,29,20,8,170,0, -8,11,9,6,85,139,70,20,255,202,103,23,255,211,118,36,255,28,21,13, -201,0,4,8,8,7,57,118,84,39,255,215,159,86,255,219,149,66,255,216, -129,45,255,211,121,34,255,34,25,13,178,0,8,11,10,6,88,146,76,19, -255,185,94,20,255,178,90,19,255,24,18,9,255,0,12,18,15,11,170,203, -122,42,255,215,126,40,255,209,106,30,255,32,22,13,184,0,8,12,10,7, -85,143,72,20,255,185,94,20,255,178,90,19,255,20,14,7,210,0,40,9, -7,4,170,148,77,19,255,180,87,19,255,178,86,19,255,30,21,9,255,5, -5,4,37,8,7,5,28,20,17,13,227,133,89,38,255,215,142,56,255,216, -129,45,255,209,115,32,255,26,19,11,210,0,8,11,9,6,85,142,74,19, -255,185,86,20,255,178,90,19,255,20,14,7,210,0,12,9,7,4,122,143, -75,20,255,203,108,24,255,216,129,45,255,30,23,15,255,0,12,12,10,7, -110,16,13,9,170,13,10,8,122,0,16,9,8,6,105,142,74,19,255,185, -86,20,255,180,87,19,255,23,16,8,255,0,24,15,13,10,170,203,122,42, -255,215,126,40,255,209,118,30,255,24,17,11,255,0,24,9,8,4,170,148, -77,19,255,181,92,20,255,180,87,19,255,23,16,8,198,0,12,9,7,6, -139,159,82,20,255,203,100,24,255,212,121,33,255,28,21,13,255,0,12,12, -11,9,119,81,59,34,255,216,153,71,255,173,117,50,255,21,18,14,255,10, -10,9,244,11,10,8,255,60,35,15,255,173,85,20,255,84,49,17,255,13, -10,6,170,0,12,10,8,5,130,146,79,19,255,193,89,20,255,203,104,24, -255,120,77,31,255,19,17,12,255,117,80,36,255,219,154,70,255,178,121,53, -255,20,17,13,255,45,33,18,255,184,94,21,255,195,90,20,255,205,106,26, -255,30,22,13,255,0,12,7,7,6,82,35,28,18,255,196,114,33,255,148, -80,25,255,32,22,11,255,20,15,9,255,26,18,9,255,88,49,17,255,149, -78,20,255,40,26,11,255,9,7,4,85,0,28,9,7,4,127,140,70,19, -255,181,88,20,255,180,87,19,255,18,13,7,235,0,24,10,9,7,93,104, -69,35,255,201,131,48,255,194,109,33,255,65,42,20,255,12,10,7,170,0, -36,9,7,4,170,146,79,19,255,181,88,20,255,180,87,19,255,23,16,8, -198,0,32,15,14,10,198,188,133,61,255,219,149,66,255,194,115,37,255,17, -15,10,244,0,24,10,8,5,113,144,78,19,255,185,86,20,255,180,87,19, -255,18,13,7,255,0,140,7,6,4,65,53,31,12,255,162,83,19,255,185, -94,20,255,130,70,21,255,31,22,10,255,25,19,10,198,22,17,9,246,70, -40,15,255,169,87,20,255,200,105,21,255,212,123,37,255,28,21,13,221,0, -8,12,10,9,133,200,127,41,255,210,120,33,255,202,95,23,255,19,14,8, -238,0,12,10,8,5,110,144,78,19,255,185,86,20,255,178,86,19,255,28, -19,9,170,0,8,12,10,9,133,194,112,31,255,209,110,30,255,202,102,21, -255,21,15,8,235,0,16,9,7,4,57,12,10,5,88,10,8,5,85,0, -12,10,8,5,125,146,79,19,255,181,88,20,255,180,87,19,255,25,17,8, -195,0,12,10,8,5,119,144,78,19,255,185,94,20,255,200,105,21,255,23, -18,10,221,0,8,11,9,8,153,200,123,41,255,212,117,33,255,202,103,23, -255,111,63,20,255,27,20,10,255,20,16,9,246,22,17,9,249,28,20,9, -198,30,21,9,170,24,17,9,215,28,20,9,201,10,8,5,85,0,16,9, -7,4,170,146,79,19,255,181,88,20,255,180,87,19,255,18,13,7,255,0, -16,11,10,8,113,152,104,47,255,214,134,49,255,204,105,25,255,98,54,19, -255,18,13,9,227,13,10,8,170,14,12,9,198,60,41,21,255,199,112,28, -255,202,102,21,255,202,103,23,255,26,19,11,204,0,8,12,11,9,116,187, -101,24,255,202,93,21,255,187,91,20,255,18,13,7,255,0,12,9,7,4, -170,146,79,19,255,181,88,20,255,178,90,19,255,27,17,8,170,0,8,11, -9,6,85,139,70,20,255,202,103,23,255,212,123,37,255,32,24,15,255,0, -24,13,12,10,170,196,114,33,255,206,106,25,255,196,99,21,255,28,19,9, -170,0,8,11,8,6,85,137,68,18,255,181,88,20,255,178,86,19,255,164, -85,21,255,138,73,21,255,175,93,20,255,178,86,19,255,46,28,11,255,6, -5,3,108,0,20,9,7,4,170,146,76,19,255,189,88,20,255,189,88,20, -255,28,19,9,170,0,8,11,9,6,85,137,68,18,255,185,86,20,255,178, -90,19,255,27,17,8,170,0,4,9,7,4,167,146,79,19,255,20,14,7, -252,0,4,11,9,6,85,137,68,18,255,185,94,20,255,178,90,19,255,27, -17,8,170,0,8,11,9,6,85,137,68,18,255,185,86,20,255,180,87,19, -255,18,13,7,255,0,12,9,7,4,170,146,79,19,255,185,94,20,255,183, -85,19,255,27,19,8,170,0,8,11,9,6,85,140,73,19,255,181,88,20, -255,178,90,19,255,20,15,7,255,0,12,16,14,11,170,208,143,59,255,223, -156,70,255,216,135,49,255,28,22,13,210,0,8,11,9,6,85,140,70,19, -255,185,94,20,255,178,90,19,255,72,39,13,255,10,8,5,218,8,6,3, -170,9,7,4,193,39,24,10,255,160,82,19,255,185,94,20,255,144,74,23, -255,16,13,9,170,0,8,10,9,7,85,145,101,48,255,218,149,67,255,210, -115,31,255,99,57,19,255,10,8,5,227,8,6,3,170,9,7,4,190,30, -20,9,255,158,81,19,255,185,94,20,255,178,90,19,255,27,17,8,170,0, -8,11,8,6,85,137,68,18,255,185,86,20,255,180,87,19,255,18,13,7, -255,0,44,9,9,8,28,13,12,8,142,27,20,10,170,29,21,10,193,24, -17,9,252,22,17,9,232,22,17,9,255,87,49,18,255,181,88,20,255,178, -90,19,255,100,54,17,255,11,10,6,150,0,16,9,7,4,170,146,79,19, -255,181,88,20,255,180,87,19,255,18,13,7,255,0,16,15,13,10,170,208, -141,55,255,223,156,70,255,217,133,50,255,23,19,12,255,0,12,10,8,5, -122,144,78,19,255,185,86,20,255,180,87,19,255,30,20,9,176,0,12,12, -10,7,85,39,26,12,255,155,80,20,255,99,55,19,255,19,16,12,255,12, -11,9,255,18,15,11,255,119,84,38,255,209,137,60,255,138,86,35,255,18, -15,11,178,0,12,10,8,5,130,144,78,19,255,181,92,20,255,178,90,19, -255,39,24,10,255,6,5,3,210,29,20,8,255,169,87,20,255,97,53,18, -255,8,7,5,255,26,21,15,255,212,142,59,255,221,151,68,255,218,142,53, -255,34,25,15,255,0,20,5,5,4,82,16,12,7,255,160,82,19,255,185, -86,20,255,185,86,20,255,52,29,11,255,7,6,4,170,0,20,8,7,5, -85,83,46,16,255,181,92,20,255,178,86,19,255,87,47,14,255,10,8,5, -224,8,6,3,170,9,7,4,190,29,20,8,255,195,104,24,255,217,136,50, -255,221,155,70,255,30,23,15,255,0,16,8,7,5,85,26,18,9,255,107, -59,20,255,151,80,22,255,60,34,15,255,11,9,6,170,0,36,8,7,5, -170,159,82,20,255,202,118,35,255,66,51,29,255,9,9,8,96,0,16,15, -13,10,170,208,140,59,255,223,156,70,255,215,133,44,255,27,20,12,255,0, -20,14,12,7,244,131,67,20,255,176,89,19,255,17,12,6,255,0,184,17, -14,10,85,171,95,28,255,206,123,33,255,208,123,31,255,207,112,28,255,202, -107,23,255,191,98,22,255,170,91,21,255,195,107,22,255,209,123,30,255,212, -132,37,255,214,134,39,255,211,133,40,255,202,121,35,255,29,21,12,164,0, -8,12,10,7,82,168,98,29,255,202,121,35,255,196,120,31,255,194,115,31, -255,190,115,27,255,185,101,26,255,184,100,25,255,199,107,26,255,208,123,31, -255,168,105,37,255,25,21,14,227,9,8,8,28,0,8,8,8,7,28,39, -30,18,249,183,122,42,255,211,133,40,255,210,133,43,255,161,106,41,255,15, -13,10,221,5,4,4,17,0,8,14,11,7,113,148,83,25,255,193,108,24, -255,180,93,23,255,27,18,10,153,0,8,12,9,7,122,144,78,19,255,180, -91,19,255,83,46,16,255,7,6,4,184,0,8,4,4,3,85,28,21,13, -255,202,121,35,255,209,132,42,255,131,87,36,255,10,9,7,255,5,5,5, -28,0,40,10,9,7,68,86,62,31,255,206,131,43,255,214,130,39,255,76, -50,25,255,7,6,6,113,0,16,5,5,4,28,21,17,12,255,202,121,35, -255,210,135,37,255,157,100,38,255,18,15,11,150,0,16,18,15,9,91,161, -88,24,255,105,64,28,255,11,10,8,170,0,12,8,7,7,85,40,28,17, -255,174,91,23,255,42,27,13,173,0,32,10,8,5,116,133,66,16,255,161, -85,17,255,161,78,17,255,25,16,8,221,0,24,15,12,8,119,170,99,29, -255,203,126,36,255,199,127,34,255,27,20,12,210,0,60,13,11,8,122,170, -99,29,255,204,127,37,255,199,119,34,255,27,20,12,198,0,12,4,4,3, -11,18,13,9,255,154,79,19,255,174,88,19,255,92,51,17,255,12,10,7, -198,0,24,11,9,6,147,142,74,19,255,171,90,18,255,159,81,18,255,17, -12,6,255,0,12,8,7,5,142,133,66,16,255,161,85,17,255,161,85,17, -255,21,14,6,215,0,24,10,9,7,198,190,107,25,255,203,104,24,255,196, -99,21,255,21,15,8,255,2,2,1,14,0,20,9,8,6,37,35,28,18, -255,183,112,36,255,212,132,37,255,178,118,41,255,27,23,16,255,5,5,4, -198,0,32,15,12,8,105,142,79,23,255,189,97,22,255,160,83,21,255,18, -13,7,218,0,12,10,8,7,198,196,114,33,255,214,129,37,255,212,132,37, -255,27,21,12,210,0,8,13,11,8,116,192,114,31,255,210,125,33,255,209, -123,30,255,203,113,26,255,177,91,22,255,159,82,20,255,160,83,21,255,165, -85,20,255,168,89,19,255,163,86,18,255,161,78,17,255,23,15,6,170,0, -8,9,7,4,57,99,48,14,255,142,73,17,255,133,66,16,255,19,13,6, -190,0,12,7,6,4,164,135,66,16,255,161,85,17,255,161,85,17,255,25, -16,6,170,0,8,10,8,5,85,131,65,16,255,161,85,17,255,161,85,17, -255,19,13,6,227,0,12,10,8,5,176,190,107,25,255,212,127,35,255,214, -134,39,255,30,21,13,255,0,24,12,10,7,170,194,109,33,255,213,132,36, -255,208,122,29,255,28,20,11,255,0,24,9,7,4,147,136,70,17,255,202, -98,21,255,211,126,34,255,27,20,12,255,3,3,2,28,0,8,10,8,7, -195,180,93,23,255,202,102,21,255,202,102,21,255,25,17,10,221,0,8,13, -11,8,65,129,70,22,255,172,88,21,255,144,78,19,255,22,15,7,176,0, -12,10,8,7,198,198,124,37,255,215,136,42,255,214,134,39,255,27,21,12, -212,0,8,12,10,7,79,151,88,26,255,198,116,29,255,192,109,27,255,25, -18,10,167,0,8,12,9,7,82,119,62,20,255,174,89,21,255,154,79,19, -255,22,15,7,181,0,20,5,5,4,68,20,14,7,249,142,73,17,255,143, -74,18,255,45,26,10,255,10,8,5,85,0,76,7,6,6,85,39,30,18, -255,196,121,41,255,213,135,42,255,115,72,30,255,10,9,7,170,0,40,5, -5,4,17,6,5,5,85,5,5,4,45,0,28,9,7,4,142,146,79,19, -255,204,108,23,255,212,126,33,255,30,22,13,255,3,3,3,40,0,36,10, -8,5,125,133,66,16,255,161,85,17,255,161,85,17,255,19,13,6,212,0, -12,10,8,5,127,136,70,17,255,193,97,20,255,203,108,24,255,30,21,11, -193,0,8,13,10,6,85,134,70,19,255,171,90,18,255,159,81,18,255,17, -12,6,238,0,12,8,6,5,144,135,66,16,255,161,85,17,255,161,85,17, -255,23,15,6,170,0,8,10,7,5,85,133,66,16,255,185,94,20,255,209, -123,30,255,23,18,12,255,3,3,2,28,0,4,5,5,4,28,18,15,11, -227,134,72,21,255,158,81,19,255,143,74,18,255,22,15,7,142,0,8,10, -8,5,85,131,65,16,255,163,79,18,255,178,90,19,255,22,16,9,255,3, -2,2,20,0,8,9,7,6,176,144,78,19,255,175,88,18,255,163,79,18, -255,26,16,7,170,0,8,10,8,5,85,129,64,16,255,161,85,17,255,161, -78,17,255,19,13,6,229,0,32,8,7,5,156,144,78,19,255,202,102,21, -255,206,111,27,255,27,20,12,255,0,32,10,8,5,133,135,66,16,255,161, -85,17,255,161,85,17,255,19,13,6,227,0,12,8,7,5,255,172,85,21, -255,189,92,20,255,172,87,19,255,24,16,7,170,0,8,10,8,5,85,129, -64,16,255,161,85,17,255,161,85,17,255,19,13,6,212,0,12,10,8,5, -127,135,66,16,255,161,85,17,255,161,85,17,255,26,16,7,170,0,8,11, -9,6,85,134,70,19,255,171,90,18,255,159,78,18,255,23,15,6,170,0, -8,9,7,4,57,98,49,13,255,139,71,16,255,133,66,16,255,19,13,6, -193,0,12,7,6,4,176,133,66,16,255,161,85,17,255,161,85,17,255,23, -15,6,170,0,8,10,8,5,85,129,64,16,255,165,87,18,255,180,91,19, -255,20,15,9,255,0,4,5,5,4,17,26,21,15,227,126,75,25,255,178, -95,21,255,142,74,19,255,46,28,11,255,10,8,5,57,0,8,10,8,5, -85,131,65,16,255,161,85,17,255,161,85,17,255,17,12,6,252,2,1,1, -8,0,28,13,11,8,170,199,119,34,255,215,136,42,255,214,139,41,255,28, -20,13,255,0,20,8,7,5,170,135,66,16,255,161,85,17,255,161,85,17, -255,23,15,6,170,0,8,10,8,5,85,131,67,16,255,202,102,21,255,211, -127,36,255,22,17,11,249,0,8,16,14,11,201,101,67,28,255,191,98,22, -255,185,94,20,255,172,87,19,255,26,17,7,170,0,8,10,8,5,85,129, -64,16,255,161,85,17,255,161,85,17,255,31,20,8,255,5,5,4,102,0, -4,5,4,4,28,16,13,9,255,164,85,21,255,180,91,19,255,165,87,18, -255,26,17,7,170,0,8,10,8,5,85,129,64,16,255,161,85,17,255,161, -85,17,255,19,13,6,212,0,40,10,8,5,133,135,66,16,255,161,85,17, -255,161,85,17,255,26,17,7,255,3,3,2,136,9,7,4,227,131,67,20, -255,197,104,22,255,198,104,21,255,183,93,19,255,172,87,19,255,26,17,7, -170,0,8,10,8,5,85,129,64,16,255,161,85,17,255,161,85,17,255,19, -13,6,212,0,12,10,8,5,127,135,66,16,255,193,97,20,255,209,123,30, -255,19,15,10,252,0,8,13,11,8,65,125,68,22,255,174,86,21,255,146, -76,19,255,22,14,7,178,0,12,8,6,5,144,135,66,16,255,161,85,17, -255,161,85,17,255,19,14,6,238,0,24,13,11,8,170,163,87,20,255,180, -91,19,255,165,87,18,255,17,12,6,255,0,24,9,7,4,139,135,66,16, -255,161,85,17,255,161,85,17,255,15,11,6,246,0,12,9,7,6,184,180, -93,23,255,211,115,30,255,213,133,38,255,28,20,13,255,0,16,12,11,9, -170,152,91,31,255,188,105,31,255,115,66,22,255,91,50,16,255,84,46,15, -255,116,59,17,255,118,62,17,255,15,11,6,221,0,16,10,8,5,116,146, -79,19,255,202,103,23,255,209,128,32,255,200,127,41,255,167,106,40,255,197, -122,42,255,210,130,35,255,186,106,27,255,88,51,19,255,102,55,17,255,157, -83,18,255,189,92,20,255,209,123,30,255,29,21,12,224,0,8,7,6,6, -28,41,31,18,235,160,84,23,255,170,87,19,255,45,26,10,255,5,5,4, -170,4,4,4,8,4,4,3,99,15,12,6,255,140,72,17,255,138,71,17, -255,45,26,10,255,10,8,5,85,0,24,8,7,5,142,133,66,16,255,161, -85,17,255,161,85,17,255,19,13,6,229,0,24,13,11,8,170,160,86,21, -255,185,90,20,255,91,50,16,255,7,6,4,255,0,40,8,7,5,150,133, -66,16,255,161,85,17,255,161,85,17,255,15,11,6,246,0,32,8,8,7, -110,74,52,27,255,191,103,24,255,176,89,19,255,34,22,9,255,6,5,3, -57,0,20,8,6,5,161,133,66,16,255,161,85,17,255,161,78,17,255,15, -11,6,252,0,140,12,10,5,85,123,61,16,255,161,85,17,255,161,85,17, -255,22,15,7,255,2,2,1,85,0,8,7,6,4,244,133,66,16,255,167, -88,18,255,189,92,20,255,27,19,10,195,0,8,12,10,7,110,160,83,21, -255,177,85,18,255,161,78,17,255,15,11,6,252,0,12,7,6,4,161,133, -66,16,255,161,85,17,255,161,85,17,255,23,15,6,170,0,8,11,9,6, -85,134,70,19,255,171,90,18,255,159,78,18,255,15,11,6,249,0,12,10, -8,5,85,98,49,13,255,135,72,16,255,133,66,16,255,19,13,6,139,0, -8,10,8,5,85,131,65,16,255,161,85,17,255,161,85,17,255,15,11,6, -246,0,12,7,6,4,164,133,66,16,255,165,87,18,255,178,90,19,255,24, -17,9,212,0,8,13,11,8,105,165,86,22,255,180,91,19,255,159,81,18, -255,19,14,6,255,2,2,1,79,0,44,8,6,5,167,133,66,16,255,161, -85,17,255,161,85,17,255,15,11,6,252,0,16,7,6,6,28,24,19,13, -227,103,59,20,255,157,83,18,255,154,78,17,255,150,81,19,255,154,79,19, -255,158,81,19,255,162,83,19,255,161,85,17,255,159,81,18,255,163,86,18, -255,27,18,8,170,0,8,11,9,6,85,131,67,16,255,165,87,18,255,161, -85,17,255,15,11,6,252,0,12,8,6,5,167,133,66,16,255,161,85,17, -255,161,85,17,255,23,15,6,170,0,8,10,8,5,85,131,65,16,255,175, -88,18,255,191,96,20,255,25,18,10,255,0,24,11,9,6,170,148,77,19, -255,169,82,18,255,161,85,17,255,23,15,6,170,0,8,10,8,5,85,129, -64,16,255,161,85,17,255,161,85,17,255,87,47,14,255,23,17,8,255,65, -34,12,255,150,76,17,255,132,68,17,255,41,25,10,255,10,8,5,85,0, -16,8,7,5,150,133,66,16,255,161,85,17,255,161,78,17,255,23,15,6, -170,0,8,10,8,5,85,129,64,16,255,161,85,17,255,161,85,17,255,23, -15,6,170,0,4,8,7,5,153,133,66,16,255,19,13,6,238,0,4,10, -8,5,85,129,64,16,255,161,85,17,255,161,85,17,255,23,15,6,170,0, -8,10,8,5,85,129,64,16,255,161,85,17,255,161,85,17,255,15,11,6, -252,0,12,8,6,5,167,133,66,16,255,161,85,17,255,161,85,17,255,23, -15,6,170,0,8,10,8,5,85,129,64,16,255,161,85,17,255,161,85,17, -255,31,20,8,255,5,4,4,85,0,4,5,4,4,40,17,14,10,255,200, -120,35,255,207,112,28,255,195,98,20,255,29,20,8,170,0,8,10,8,5, -85,131,65,16,255,163,86,18,255,159,81,18,255,150,76,17,255,137,70,16, -255,135,72,16,255,135,66,16,255,146,75,17,255,159,81,18,255,131,67,20, -255,42,31,17,255,10,9,7,62,0,8,5,5,4,8,26,21,15,227,137, -79,28,255,174,88,19,255,158,83,17,255,137,70,16,255,135,72,16,255,135, -66,16,255,146,75,17,255,159,81,18,255,161,85,17,255,161,85,17,255,23, -15,6,170,0,8,10,8,5,85,131,67,16,255,163,86,18,255,159,81,18, -255,17,12,6,255,0,68,2,1,1,8,7,6,4,249,137,67,16,255,165, -80,18,255,154,78,17,255,27,18,8,170,0,16,8,6,5,167,133,66,16, -255,161,85,17,255,161,85,17,255,15,11,6,252,0,16,13,11,8,170,199, -124,36,255,211,125,32,255,200,105,21,255,18,13,7,255,0,12,7,6,4, -164,133,66,16,255,161,85,17,255,161,78,17,255,19,13,6,227,0,16,8, -7,5,122,68,38,13,255,150,83,23,255,174,107,35,255,181,112,38,255,190, -117,39,255,193,114,36,255,143,84,26,255,15,12,8,212,4,4,3,6,0, -12,10,8,5,108,135,66,16,255,161,85,17,255,161,85,17,255,125,65,16, -255,90,47,13,255,121,60,16,255,164,84,19,255,189,97,22,255,177,104,32, -255,194,123,39,255,212,134,41,255,210,124,31,255,200,105,21,255,23,17,8, -218,0,16,10,8,5,167,56,31,11,255,110,55,15,255,118,62,17,255,115, -58,16,255,115,58,16,255,120,63,17,255,95,46,14,255,17,13,6,227,7, -6,4,28,0,16,14,12,7,227,87,43,14,255,154,78,17,255,152,77,17, -255,139,71,16,255,135,72,16,255,135,66,16,255,146,75,17,255,200,105,21, -255,211,127,36,255,214,134,39,255,23,18,12,255,0,12,7,6,4,85,26, -16,7,255,131,67,16,255,145,75,18,255,78,43,15,255,7,6,4,255,0, -40,10,8,5,136,157,81,20,255,210,129,33,255,139,89,36,255,10,9,7, -198,0,16,13,11,8,170,196,113,31,255,206,114,25,255,189,92,20,255,18, -13,7,244,0,16,5,4,4,88,27,19,8,255,141,73,18,255,161,85,17, -255,21,14,6,218,0,112,12,9,7,99,11,8,6,170,10,8,5,91,0, -60,11,10,8,28,32,23,13,227,108,57,19,255,153,82,18,255,154,78,17, -255,146,75,17,255,97,47,14,255,36,24,11,255,108,64,25,255,203,111,30, -255,207,118,32,255,207,118,32,255,189,110,32,255,63,41,20,255,15,12,8, -76,0,8,9,8,6,28,38,27,15,218,51,33,18,255,48,32,17,255,131, -74,24,255,182,97,21,255,176,89,19,255,170,87,19,255,134,72,21,255,37, -25,14,255,15,13,8,144,7,7,6,28,0,12,11,9,8,127,171,99,28, -255,208,123,31,255,203,124,30,255,104,63,27,255,15,13,10,212,7,6,6, -28,0,12,14,11,7,170,142,74,19,255,161,85,17,255,159,81,18,255,27, -18,8,184,0,8,6,5,3,28,27,17,8,227,92,46,13,255,111,55,14, -255,31,20,8,255,8,6,3,198,9,7,4,170,10,8,5,227,22,16,9, -255,61,39,18,255,107,64,26,255,108,66,25,255,32,22,11,255,9,7,6, -170,0,44,10,9,7,156,56,36,19,255,191,114,32,255,175,98,30,255,41, -27,16,255,11,9,6,57,0,12,21,15,10,227,100,56,21,255,160,83,21, -255,80,44,17,255,14,12,7,190,7,6,6,28,0,16,13,10,6,28,29, -20,10,212,21,15,10,144,0,20,12,9,7,85,39,24,10,173,16,12,7, -85,0,32,6,5,3,20,19,13,6,173,21,14,6,255,21,15,6,215,10, -8,5,85,0,24,15,12,8,170,190,98,23,255,203,108,24,255,202,111,23, -255,23,17,10,255,0,60,17,13,10,170,195,112,30,255,211,124,30,255,205, -106,26,255,31,21,12,255,0,12,8,6,5,139,44,25,9,255,135,72,16, -255,104,54,13,255,15,11,6,249,7,6,4,28,0,24,7,6,4,57,44, -25,9,255,137,73,16,255,143,70,16,255,49,25,8,255,8,6,3,184,8, -6,3,85,8,6,3,142,23,16,6,255,130,66,15,255,145,77,16,255,87, -44,12,255,10,8,5,142,0,20,11,9,8,164,53,31,14,255,150,74,19, -255,154,78,17,255,148,76,17,255,65,33,10,255,10,8,5,184,6,5,5, -28,0,16,11,9,6,142,175,102,30,255,207,123,32,255,208,114,31,255,196, -114,33,255,89,56,26,255,17,13,10,255,11,8,6,170,9,7,6,170,11, -8,6,170,15,11,8,170,18,13,9,142,8,6,5,28,0,8,10,8,5, -93,102,53,17,255,159,81,18,255,154,78,17,255,72,37,11,255,11,8,6, -227,9,7,6,170,11,8,6,198,61,36,20,255,196,107,27,255,204,114,27, -255,182,102,31,255,19,14,10,170,0,8,6,6,5,20,26,19,11,198,28, -20,11,255,22,16,9,255,23,16,8,255,27,18,8,255,24,16,7,255,24, -16,7,255,74,39,11,255,139,68,16,255,143,70,16,255,143,70,16,255,20, -13,5,170,0,8,7,6,4,74,87,44,12,255,155,79,18,255,151,73,16, -255,67,34,10,255,9,7,4,198,9,7,4,96,8,6,5,159,27,17,8, -255,137,67,16,255,158,80,17,255,112,56,15,255,10,8,5,167,0,8,7, -5,4,85,74,36,11,255,150,83,17,255,145,77,16,255,55,29,10,255,8, -6,3,198,8,6,3,88,7,6,4,153,39,24,12,255,199,112,28,255,210, -115,31,255,184,108,33,255,17,14,10,198,0,24,11,9,6,170,139,69,18, -255,168,86,19,255,154,78,17,255,17,12,6,235,0,24,7,6,4,85,64, -32,11,255,162,80,19,255,198,96,21,255,109,63,26,255,15,11,8,227,10, -8,7,170,8,7,5,195,29,18,8,255,137,67,16,255,154,78,17,255,114, -59,15,255,11,10,6,164,0,8,9,7,6,85,97,50,16,255,159,81,18, -255,152,77,17,255,74,36,11,255,10,8,5,198,7,6,4,125,10,8,5, -198,61,36,20,255,200,105,29,255,209,122,28,255,180,104,29,255,16,12,9, -170,0,8,12,10,7,170,160,83,21,255,183,89,19,255,174,88,19,255,28, -19,9,187,0,8,14,10,7,85,143,75,20,255,195,98,20,255,189,92,20, -255,21,15,8,224,0,24,7,6,4,85,26,16,7,255,111,55,14,255,132, -67,15,255,39,23,8,255,8,6,3,113,0,68,9,7,6,85,32,22,13, -255,188,112,31,255,193,114,30,255,94,57,25,255,17,13,10,170,0,44,9, -7,4,142,10,8,5,255,10,8,5,198,6,5,3,28,0,24,8,7,5, -85,88,48,19,255,204,114,27,255,208,118,31,255,111,62,26,255,11,8,6, -227,8,7,5,150,10,8,5,116,10,8,5,88,9,7,4,85,6,5,3, -74,0,16,10,8,5,99,114,56,13,255,143,70,16,255,143,70,16,255,18, -12,5,215,0,12,8,7,3,130,118,60,13,255,148,76,17,255,150,76,17, -255,24,16,7,170,0,8,9,7,4,85,114,56,13,255,145,74,16,255,143, -70,16,255,52,28,9,255,8,6,3,198,8,6,3,88,8,6,3,144,23, -15,6,255,130,66,15,255,151,80,16,255,111,55,14,255,10,8,5,144,0, -8,6,5,3,59,59,32,10,255,157,83,18,255,185,90,20,255,97,54,22, -255,14,10,7,227,13,10,6,170,13,10,6,255,84,41,13,255,148,76,17, -255,155,82,18,255,135,66,16,255,14,10,5,159,0,8,9,7,4,85,114, -56,13,255,145,77,16,255,145,74,16,255,55,28,10,255,9,7,4,198,8, -6,3,93,8,6,3,147,25,16,6,255,130,64,15,255,151,80,16,255,111, -55,14,255,10,8,5,142,0,8,9,7,4,85,114,56,13,255,145,77,16, -255,143,70,16,255,52,28,9,255,8,6,3,198,8,6,3,102,8,6,3, -139,8,6,3,170,9,8,4,113,0,12,10,8,5,91,114,56,13,255,150, -76,17,255,150,76,17,255,17,12,6,252,0,32,7,6,4,85,64,33,11, -255,145,77,16,255,143,70,16,255,56,29,9,255,8,6,3,198,8,6,3, -85,6,5,3,119,14,11,5,255,128,66,15,255,151,73,16,255,143,76,16, -255,20,13,5,170,0,8,9,7,4,85,114,56,13,255,143,70,16,255,143, -70,16,255,18,12,5,215,0,12,8,7,3,130,114,56,13,255,143,70,16, -255,143,70,16,255,20,13,5,170,0,8,9,7,4,85,114,56,13,255,143, -70,16,255,143,70,16,255,20,13,5,170,0,8,7,6,4,71,87,44,12, -255,158,87,17,255,161,85,17,255,103,53,20,255,15,11,8,227,10,8,7, -170,10,8,7,195,33,20,10,255,137,67,16,255,151,73,16,255,111,55,14, -255,10,8,5,142,0,8,9,7,4,85,114,56,13,255,143,70,16,255,146, -75,17,255,18,13,7,255,0,8,7,6,6,74,24,16,7,255,132,67,15, -255,145,77,16,255,135,72,16,255,14,10,5,170,0,8,9,7,4,85,114, -56,13,255,145,77,16,255,143,70,16,255,58,31,11,255,11,8,6,227,11, -9,6,170,11,8,6,170,10,7,5,170,9,8,4,113,0,12,11,9,6, -161,175,92,24,255,203,108,24,255,198,101,23,255,25,18,10,255,0,20,8, -6,3,147,114,56,13,255,143,70,16,255,143,70,16,255,20,13,5,170,0, -8,9,7,4,85,114,56,13,255,170,87,19,255,199,106,24,255,24,17,11, -255,0,8,6,6,5,28,15,12,6,255,128,66,15,255,145,74,16,255,143, -70,16,255,20,13,5,170,0,8,6,5,3,57,57,31,10,255,145,77,16, -255,143,70,16,255,90,44,13,255,19,13,6,255,10,8,5,255,13,10,6, -255,62,33,11,255,135,72,16,255,151,73,16,255,108,53,13,255,10,8,5, -142,0,8,9,7,4,85,114,56,13,255,143,70,16,255,143,70,16,255,18, -12,5,215,0,40,7,6,4,85,64,33,11,255,145,77,16,255,143,70,16, -255,67,34,10,255,14,10,5,255,49,27,9,255,140,72,17,255,160,85,19, -255,160,85,19,255,110,55,15,255,31,20,8,255,9,7,4,57,0,8,9, -8,4,85,114,56,13,255,143,70,16,255,143,70,16,255,18,12,5,215,0, -12,8,7,3,136,118,60,13,255,154,75,17,255,172,87,19,255,24,17,9, -204,0,8,8,7,5,85,95,49,16,255,161,85,17,255,152,77,17,255,71, -34,10,255,9,7,4,198,8,6,3,88,8,6,3,142,23,15,6,255,130, -66,15,255,151,80,16,255,111,55,14,255,14,10,5,170,0,24,9,7,4, -164,118,56,15,255,145,74,16,255,143,70,16,255,16,12,5,224,0,24,9, -7,4,85,85,43,12,255,151,80,16,255,143,70,16,255,55,29,10,255,8, -6,3,198,8,6,3,93,8,6,5,173,45,27,14,255,199,112,28,255,210, -124,31,255,199,119,34,255,19,15,10,221,0,20,13,11,8,170,46,28,11, -255,131,65,16,255,145,74,16,255,137,67,16,255,70,35,11,255,12,10,5, -224,7,6,4,28,0,16,8,6,5,34,37,25,14,255,181,100,28,255,206, -113,31,255,207,123,32,255,199,119,34,255,107,67,28,255,28,20,11,255,28, -19,9,255,84,41,13,255,141,75,16,255,145,74,16,255,159,82,20,255,88, -53,25,255,13,11,8,99,0,8,13,10,6,85,114,60,17,255,148,76,17, -255,143,70,16,255,21,14,6,255,0,12,10,8,5,170,119,61,14,255,145, -77,16,255,135,72,16,255,19,13,6,170,0,24,8,7,3,142,114,56,13, -255,143,70,16,255,143,70,16,255,16,12,5,218,0,24,11,8,6,170,126, -62,15,255,151,80,16,255,112,57,13,255,19,13,6,255,8,6,3,144,8, -6,3,85,9,7,4,113,8,6,3,167,8,6,3,170,8,6,3,170,9, -8,4,113,0,12,10,8,5,91,114,56,13,255,145,74,16,255,143,70,16, -255,61,32,10,255,9,8,4,170,0,32,12,10,7,207,74,36,11,255,139, -74,16,255,79,40,12,255,10,8,5,210,0,16,9,7,4,85,27,17,6, -255,130,66,15,255,143,70,16,255,143,76,16,255,16,12,5,221,0,140,8, -6,3,85,74,39,11,255,145,77,16,255,143,70,16,255,41,23,8,255,7, -6,4,173,5,5,2,85,6,5,3,113,14,10,5,255,129,65,14,255,145, -74,16,255,145,74,16,255,24,16,7,170,0,8,10,8,5,85,112,57,13, -255,145,77,16,255,143,70,16,255,52,28,9,255,8,6,3,198,8,6,3, -88,8,6,3,144,23,15,6,255,130,66,15,255,151,80,16,255,111,55,14, -255,10,8,5,144,0,8,6,5,3,59,63,34,10,255,145,77,16,255,143, -70,16,255,55,29,10,255,8,6,3,198,8,6,3,85,8,6,3,144,32, -19,7,255,139,74,16,255,155,79,18,255,135,66,16,255,14,10,5,170,0, -8,6,5,3,57,57,31,10,255,145,77,16,255,143,70,16,255,55,29,10, -255,8,6,3,198,8,6,3,88,8,6,3,144,21,15,6,255,130,66,15, -255,143,76,16,255,146,75,17,255,24,15,7,184,0,8,7,6,4,71,66, -33,11,255,148,79,17,255,143,70,16,255,45,25,8,255,7,5,4,176,7, -5,4,85,8,6,3,85,9,7,4,85,8,6,3,82,0,28,8,7,3, -136,114,56,13,255,143,70,16,255,143,70,16,255,16,12,5,221,0,20,7, -6,4,28,10,8,5,130,19,13,6,170,29,19,8,173,24,16,7,212,27, -18,8,193,20,13,7,246,55,29,10,255,139,74,16,255,143,70,16,255,143, -70,16,255,18,13,5,170,0,8,9,7,4,85,115,54,14,255,143,70,16, -255,143,70,16,255,16,12,5,221,0,12,8,7,3,136,114,56,13,255,143, -70,16,255,143,70,16,255,20,13,5,170,0,8,9,7,4,85,114,56,13, -255,145,74,16,255,145,74,16,255,17,11,6,252,0,24,10,8,5,170,119, -61,14,255,145,74,16,255,143,70,16,255,18,13,5,170,0,8,9,7,4, -85,114,56,13,255,143,70,16,255,143,70,16,255,33,20,8,255,5,4,4, -195,8,6,5,198,46,26,9,255,126,62,15,255,132,67,15,255,35,22,8, -255,9,7,4,93,0,12,10,8,5,93,114,56,13,255,143,70,16,255,143, -70,16,255,20,13,5,170,0,8,9,7,4,85,114,56,13,255,143,70,16, -255,143,70,16,255,20,13,5,170,0,4,9,7,4,125,114,56,13,255,21, -13,6,210,0,4,9,7,4,85,114,56,13,255,143,70,16,255,143,70,16, -255,20,13,5,170,0,8,9,7,4,85,114,56,13,255,143,70,16,255,143, -70,16,255,16,12,5,221,0,12,8,7,3,136,114,56,13,255,143,70,16, -255,143,70,16,255,20,13,5,170,0,8,6,5,3,57,57,31,10,255,145, -77,16,255,143,70,16,255,90,44,13,255,17,12,6,255,12,9,5,255,20, -15,9,255,97,51,20,255,169,87,20,255,161,85,17,255,112,54,15,255,10, -8,5,142,0,8,9,7,4,85,121,60,16,255,174,88,19,255,176,89,19, -255,112,59,17,255,37,23,10,255,26,16,7,255,25,18,8,255,24,15,7, -255,23,16,8,255,18,13,9,198,10,9,7,99,0,16,9,8,6,34,12, -10,7,167,20,14,7,210,21,15,6,255,26,17,7,255,24,16,7,255,26, -17,7,255,70,35,11,255,142,73,17,255,148,76,17,255,152,77,17,255,24, -15,7,170,0,8,13,10,6,96,129,65,18,255,170,87,19,255,170,87,19, -255,24,16,9,255,0,48,5,4,2,76,8,6,3,85,8,6,3,85,8, -6,3,85,7,5,4,85,6,5,3,119,16,11,5,255,129,65,14,255,151, -73,16,255,118,61,15,255,14,10,5,170,0,16,8,7,3,136,114,56,13, -255,143,70,16,255,143,70,16,255,16,12,5,221,0,16,10,8,7,113,109, -67,26,255,184,90,21,255,148,76,17,255,52,28,9,255,8,6,3,198,8, -6,3,88,8,6,3,144,21,15,6,255,130,66,15,255,143,76,16,255,143, -76,16,255,16,12,5,227,0,20,9,8,6,170,67,42,20,255,202,124,31, -255,208,128,33,255,205,106,26,255,104,58,21,255,14,11,7,218,6,5,5, -28,0,16,7,6,4,28,27,17,8,229,102,51,13,255,139,68,16,255,143, -73,16,255,145,74,16,255,71,37,12,255,26,18,9,255,80,50,23,255,204, -122,33,255,208,115,33,255,202,104,25,255,149,78,20,255,52,30,11,255,10, -8,5,85,0,12,14,10,5,170,85,43,12,255,137,73,16,255,77,39,12, -255,14,10,5,227,10,8,5,170,10,8,5,198,46,26,9,255,137,73,16, -255,115,59,14,255,25,16,6,232,8,6,3,31,0,12,6,5,3,28,10, -8,5,119,19,13,6,170,29,19,8,173,26,16,7,210,27,18,8,187,17, -12,6,246,58,30,11,255,151,77,18,255,192,97,21,255,192,97,21,255,24, -16,9,207,0,8,4,4,3,3,25,16,6,235,115,59,14,255,143,73,16, -255,145,77,16,255,108,53,13,255,21,14,6,255,7,6,4,164,10,7,5, -85,8,7,5,147,9,7,4,136,8,6,5,76,0,20,8,6,5,57,58, -33,13,255,188,107,27,255,192,111,31,255,85,51,24,255,18,13,9,187,6, -5,5,20,0,8,11,9,6,156,139,69,18,255,158,83,17,255,148,76,17, -255,23,15,6,170,0,12,9,7,4,85,19,13,6,255,102,51,13,255,128, -66,15,255,81,41,12,255,12,9,5,142,0,108,13,10,8,85,115,60,24, -255,162,75,23,255,121,60,20,255,23,15,8,142,0,60,3,3,2,6,10, -8,5,170,93,48,12,255,123,65,14,255,123,60,14,255,14,10,5,227,3, -3,2,85,12,10,7,170,163,83,24,255,199,99,26,255,193,96,24,255,41, -26,14,227,6,6,5,45,0,24,3,3,2,28,11,8,6,170,106,50,13, -255,129,63,14,255,129,63,14,255,29,18,8,227,6,5,5,31,0,20,13, -10,8,136,144,73,21,255,182,89,21,255,99,55,19,255,14,11,7,187,4, -4,3,3,0,16,9,7,4,113,93,46,12,255,131,66,14,255,121,62,14, -255,16,11,5,170,0,12,7,6,4,28,14,10,5,227,100,50,13,255,110, -59,13,255,103,52,14,255,121,59,18,255,134,69,21,255,32,21,11,255,6, -5,5,198,10,8,7,227,46,28,13,255,104,51,15,255,96,46,13,255,14, -10,5,139,0,44,10,8,7,108,63,37,18,255,176,88,23,255,160,80,21, -255,20,14,9,170,0,8,8,6,5,79,85,41,12,255,131,65,16,255,66, -34,11,255,10,8,5,170,0,144,9,7,4,167,115,56,16,255,165,85,20, -255,112,65,23,255,18,13,9,142,0,60,13,10,8,142,132,68,21,255,162, -80,19,255,141,70,18,255,17,12,6,181,0,12,17,12,6,255,103,54,14, -255,130,66,15,255,31,20,8,255,6,5,3,113,0,32,8,6,3,156,35, -22,8,255,114,58,13,255,110,59,13,255,88,45,11,255,88,42,11,255,92, -47,11,255,104,54,13,255,119,58,14,255,61,32,10,255,10,8,5,224,5, -4,4,20,0,16,11,8,6,85,113,58,22,255,180,90,23,255,140,69,17, -255,123,63,14,255,123,60,14,255,119,56,14,255,120,61,17,255,24,15,9, -167,0,16,12,10,7,133,180,88,27,255,203,107,30,255,199,100,28,255,197, -104,28,255,191,93,28,255,167,78,24,255,132,68,21,255,121,62,18,255,117, -60,18,255,118,57,17,255,108,50,15,255,17,12,6,113,0,12,14,10,5, -227,65,33,10,255,115,59,14,255,115,59,14,255,109,52,14,255,116,57,17, -255,121,59,18,255,139,68,20,255,154,73,19,255,115,62,20,255,33,23,12, -255,9,8,6,71,0,36,2,2,1,8,8,6,3,170,93,50,12,255,125, -64,14,255,123,60,14,255,14,10,5,159,0,12,14,10,5,224,65,33,10, -255,115,59,14,255,115,59,14,255,109,52,14,255,119,61,18,255,129,66,20, -255,148,75,21,255,170,84,21,255,129,67,22,255,37,25,14,255,8,7,5, -57,0,8,5,5,4,23,24,17,9,255,103,54,18,255,132,63,17,255,120, -62,15,255,98,49,13,255,90,45,11,255,94,45,13,255,124,60,17,255,172, -81,21,255,150,78,25,255,44,29,17,255,9,8,6,91,0,24,8,7,3, -102,93,46,12,255,125,64,14,255,121,62,14,255,18,12,5,170,0,28,12, -10,5,227,64,33,11,255,132,66,17,255,158,79,21,255,151,70,22,255,130, -67,21,255,110,53,15,255,108,53,13,255,118,60,13,255,85,43,12,255,21, -14,6,255,7,6,4,57,0,12,14,10,5,227,65,33,10,255,131,65,16, -255,149,72,20,255,133,68,20,255,111,54,16,255,110,53,15,255,138,72,19, -255,163,81,20,255,112,58,19,255,28,20,9,255,8,7,5,57,0,8,9, -7,4,91,96,48,13,255,132,70,15,255,123,60,14,255,14,10,5,161,0, -8,13,10,6,85,148,73,23,255,202,101,27,255,129,67,26,255,18,13,9, -142,0,28,6,5,3,48,17,12,6,227,108,55,13,255,112,55,13,255,35, -22,8,255,9,7,4,57,0,64,32,22,13,255,137,68,22,255,154,73,19, -255,45,26,10,255,8,6,5,144,0,44,8,6,3,68,67,34,10,255,115, -56,16,255,109,52,14,255,16,11,5,147,0,24,5,4,4,11,22,17,11, -227,129,76,28,255,195,95,28,255,186,84,23,255,121,59,18,255,107,51,14, -255,96,46,13,255,90,45,11,255,88,45,11,255,41,24,8,255,12,10,5, -176,0,12,8,6,3,76,88,44,11,255,125,66,14,255,123,60,14,255,18, -12,5,170,0,12,9,7,4,85,92,47,11,255,125,64,14,255,123,60,14, -255,16,11,5,150,0,8,8,6,3,62,88,45,11,255,125,64,14,255,123, -60,14,255,114,58,13,255,93,50,12,255,88,44,11,255,92,47,11,255,104, -54,13,255,119,58,14,255,85,43,12,255,21,15,6,255,7,6,4,51,0, -12,12,10,5,221,61,32,10,255,120,62,15,255,123,61,16,255,109,52,14, -255,96,46,13,255,102,51,13,255,115,59,14,255,123,65,14,255,85,43,12, -255,25,16,6,255,7,6,4,51,0,8,8,6,3,74,88,45,11,255,125, -64,14,255,123,60,14,255,114,58,13,255,93,50,12,255,88,45,11,255,92, -47,11,255,104,52,13,255,118,60,13,255,85,43,12,255,21,15,6,255,7, -5,4,40,0,8,8,6,3,74,88,45,11,255,125,64,14,255,123,60,14, -255,114,58,13,255,93,50,12,255,88,45,11,255,92,43,11,255,93,50,12, -255,93,50,12,255,20,13,5,85,0,8,8,6,3,65,88,45,11,255,125, -64,14,255,121,62,14,255,18,13,5,170,0,36,12,10,5,227,59,31,10, -255,115,62,14,255,114,58,13,255,93,50,12,255,88,44,11,255,88,44,11, -255,104,54,13,255,118,60,13,255,123,60,14,255,123,60,14,255,14,10,5, -150,0,8,8,6,3,65,88,45,11,255,125,66,14,255,123,60,14,255,18, -12,5,170,0,12,9,7,4,85,92,47,11,255,125,66,14,255,123,65,14, -255,14,10,5,150,0,8,8,6,3,65,88,45,11,255,125,66,14,255,123, -65,14,255,14,10,5,159,0,12,14,10,5,221,70,35,11,255,155,74,20, -255,193,89,26,255,185,91,28,255,172,85,27,255,165,80,24,255,155,78,22, -255,132,66,17,255,90,44,13,255,21,15,6,255,7,5,4,40,0,8,8, -6,3,74,88,45,11,255,125,64,14,255,121,62,14,255,19,13,6,176,0, -12,9,6,4,133,93,50,12,255,131,66,14,255,123,65,14,255,14,11,5, -150,0,8,8,6,3,62,88,45,11,255,125,64,14,255,123,60,14,255,118, -56,15,255,120,61,17,255,136,67,21,255,118,57,17,255,96,48,13,255,92, -47,11,255,18,12,5,85,0,8,9,7,4,79,104,51,15,255,140,66,17, -255,135,66,16,255,17,12,6,198,0,20,9,7,4,85,92,47,11,255,125, -66,14,255,123,65,14,255,14,10,5,150,0,8,8,6,3,65,88,45,11, -255,135,66,16,255,136,67,17,255,22,14,7,198,0,12,8,6,3,119,88, -45,11,255,125,64,14,255,123,60,14,255,14,10,5,159,0,12,12,10,5, -210,59,31,10,255,115,62,14,255,118,60,13,255,104,54,13,255,100,50,13, -255,100,50,13,255,114,58,13,255,119,63,14,255,85,43,12,255,21,15,6, -255,7,5,4,40,0,8,8,6,3,74,88,45,11,255,125,66,14,255,123, -60,14,255,18,12,5,170,0,44,12,10,5,227,59,31,10,255,115,62,14, -255,114,58,13,255,100,50,13,255,114,56,13,255,133,66,16,255,160,80,21, -255,176,83,21,255,45,27,12,255,6,5,3,170,0,12,8,6,3,82,88, -45,11,255,125,66,14,255,123,60,14,255,18,12,5,170,0,12,9,7,4, -85,92,47,11,255,131,61,14,255,126,62,15,255,17,11,6,170,0,12,14, -10,5,227,65,33,10,255,115,59,14,255,115,62,14,255,93,50,12,255,88, -44,11,255,92,47,11,255,104,54,13,255,119,58,14,255,85,43,12,255,21, -15,6,255,7,6,4,57,0,24,9,7,4,85,92,47,11,255,125,66,14, -255,123,60,14,255,18,12,5,170,0,24,5,5,4,28,19,13,6,255,84, -42,11,255,115,62,14,255,110,59,13,255,93,50,12,255,84,44,11,255,106, -54,15,255,176,84,23,255,199,100,28,255,188,101,31,255,90,54,25,255,13, -10,8,142,0,24,8,6,3,164,72,37,11,255,131,66,14,255,110,54,13, -255,12,9,5,224,3,3,2,17,0,24,7,6,6,85,30,20,13,255,190, -96,27,255,199,98,24,255,121,69,22,255,13,10,6,190,4,3,3,28,5, -4,2,105,27,17,6,255,114,56,13,255,125,64,14,255,45,26,10,255,8, -7,5,153,0,12,10,7,5,85,96,48,13,255,125,64,14,255,123,60,14, -255,16,11,5,195,0,12,8,6,3,110,92,47,11,255,131,66,14,255,123, -65,14,255,18,13,5,170,0,24,9,7,4,85,92,47,11,255,125,66,14, -255,123,60,14,255,18,12,5,170,0,24,8,7,3,99,93,50,12,255,125, -66,14,255,115,59,14,255,104,54,13,255,88,45,11,255,88,44,11,255,92, -43,11,255,92,43,11,255,92,43,11,255,93,50,12,255,93,50,12,255,20, -13,5,85,0,8,8,6,3,65,88,45,11,255,125,64,14,255,123,60,14, -255,115,62,14,255,93,46,12,255,16,11,5,127,0,28,5,4,4,28,12, -10,5,246,104,54,13,255,115,59,14,255,39,23,8,255,8,6,3,82,0, -12,58,31,9,255,114,58,13,255,119,63,14,255,123,60,14,255,123,65,14, -255,18,12,5,170,0,144,14,10,5,227,59,31,10,255,115,62,14,255,110, -59,13,255,88,44,11,255,80,42,11,255,88,44,11,255,104,54,13,255,115, -59,14,255,123,60,14,255,123,60,14,255,16,11,5,150,0,8,8,6,3, -65,88,44,11,255,125,64,14,255,123,60,14,255,114,58,13,255,93,50,12, -255,88,44,11,255,92,47,11,255,104,54,13,255,119,58,14,255,85,43,12, -255,21,15,6,255,7,6,4,51,0,12,12,9,5,224,63,32,10,255,115, -62,14,255,114,56,13,255,93,50,12,255,88,44,11,255,88,45,11,255,110, -59,13,255,119,61,14,255,85,43,12,255,25,16,6,255,7,6,4,57,0, -12,12,10,5,221,59,31,10,255,115,62,14,255,114,56,13,255,93,50,12, -255,88,44,11,255,92,47,11,255,104,54,13,255,115,59,14,255,123,60,14, -255,121,62,14,255,16,11,5,167,0,12,12,10,5,218,59,31,10,255,115, -62,14,255,110,59,13,255,88,44,11,255,80,42,11,255,88,44,11,255,88, -45,11,255,88,44,11,255,16,11,5,105,0,24,9,7,4,85,92,47,11, -255,125,66,14,255,123,60,14,255,18,12,5,170,0,48,7,5,4,198,93, -50,12,255,125,66,14,255,123,60,14,255,12,10,5,170,0,8,8,6,3, -65,88,45,11,255,125,66,14,255,123,65,14,255,18,12,5,170,0,12,9, -7,4,85,92,47,11,255,125,66,14,255,123,65,14,255,14,10,5,150,0, -8,8,6,3,65,88,45,11,255,125,66,14,255,123,60,14,255,18,13,5, -170,0,20,3,3,2,11,9,7,4,227,100,50,13,255,123,60,14,255,123, -60,14,255,12,10,5,170,0,8,8,6,3,62,88,45,11,255,125,66,14, -255,123,60,14,255,14,10,5,198,0,8,8,6,3,170,35,22,8,255,115, -59,14,255,112,55,13,255,33,21,8,255,8,6,3,37,0,8,8,6,3, -74,88,45,11,255,125,66,14,255,123,65,14,255,14,10,5,150,0,8,8, -6,3,65,88,45,11,255,125,66,14,255,123,65,14,255,14,11,5,147,0, -4,9,7,4,85,92,47,11,255,20,13,5,170,0,4,8,6,3,62,88, -45,11,255,125,66,14,255,123,65,14,255,14,10,5,150,0,8,8,6,3, -65,88,45,11,255,125,66,14,255,123,60,14,255,18,12,5,170,0,12,9, -7,4,85,92,47,11,255,125,66,14,255,123,60,14,255,14,10,5,159,0, -12,12,10,5,210,59,31,10,255,115,59,14,255,118,60,13,255,104,54,13, -255,102,51,13,255,112,53,13,255,122,63,15,255,123,58,14,255,85,43,12, -255,21,15,6,255,7,5,4,45,0,8,8,6,3,85,113,55,16,255,196, -92,23,255,195,96,24,255,25,17,10,255,4,3,3,79,0,64,3,2,2, -28,10,8,5,227,138,71,21,255,177,87,20,255,174,86,21,255,24,16,9, -170,0,8,13,10,8,85,142,73,23,255,195,96,24,255,194,91,23,255,24, -17,11,227,0,44,12,9,5,150,35,22,8,255,80,42,11,255,84,44,11, -255,88,44,11,255,80,42,11,255,88,44,11,255,97,50,12,255,118,60,13, -255,85,43,12,255,21,15,6,255,8,6,3,57,0,16,9,7,4,85,92, -47,11,255,125,66,14,255,123,60,14,255,18,12,5,170,0,16,6,5,5, -28,17,13,8,227,68,34,11,255,115,59,14,255,110,59,13,255,93,50,12, -255,88,44,11,255,92,47,11,255,104,54,13,255,115,59,14,255,123,60,14, -255,123,65,14,255,18,12,5,170,0,24,12,9,7,170,131,69,24,255,191, -90,22,255,136,71,19,255,15,11,6,227,4,3,3,17,0,24,7,6,4, -31,16,11,5,227,104,52,13,255,131,66,14,255,98,49,13,255,10,8,5, -193,3,2,2,68,8,7,5,170,121,66,26,255,195,96,24,255,156,74,19, -255,34,21,9,255,9,7,4,85,0,12,8,6,3,51,69,35,10,255,121, -62,14,255,123,60,14,255,16,11,5,227,4,3,3,28,0,8,8,6,3, -170,92,47,11,255,125,64,14,255,108,55,13,255,14,10,5,164,0,40,7, -5,4,198,96,48,13,255,134,65,15,255,133,66,16,255,15,11,6,170,0, -8,7,5,4,85,78,39,11,255,130,64,15,255,130,64,15,255,134,65,15, -255,136,67,17,255,124,62,17,255,114,56,17,255,113,55,16,255,118,60,17, -255,107,55,20,255,48,29,15,255,12,10,7,85,0,20,9,8,6,170,45, -27,12,255,139,70,20,255,131,66,18,255,107,53,14,255,19,13,6,99,0, -8,8,6,5,85,92,46,13,255,131,61,14,255,125,64,14,255,14,10,5, -170,0,12,58,31,9,255,110,59,13,255,115,59,14,255,56,29,9,255,10, -8,5,227,5,4,4,23,0,108,10,8,7,28,28,18,11,212,49,28,16, -255,35,21,12,241,13,10,6,85,0,68,14,10,5,142,20,14,5,170,16, -12,5,164,8,6,3,28,0,8,24,16,9,142,21,15,8,252,23,15,8, -184,11,8,6,34,0,36,14,10,5,142,20,14,5,170,16,11,5,170,10, -8,5,28,0,24,7,6,4,25,20,13,7,147,22,15,7,170,10,8,5, -142,5,4,4,3,0,24,14,10,5,142,20,13,5,170,16,11,5,170,9, -7,4,28,0,16,7,5,4,28,14,10,5,156,14,10,5,229,24,15,9, -255,32,20,11,255,28,18,11,244,12,9,7,108,0,8,10,8,5,142,19, -13,8,235,24,15,7,227,10,8,5,59,0,48,10,8,5,93,23,15,8, -170,28,18,9,173,15,11,6,28,0,12,18,12,5,142,21,14,6,170,9, -7,4,133,0,148,8,6,5,113,89,44,14,255,100,51,21,255,13,10,8, -227,6,5,5,28,0,60,6,5,5,8,17,12,6,142,26,16,7,170,18, -12,5,170,9,7,4,28,0,8,6,5,3,85,54,28,11,255,136,66,19, -255,121,59,18,255,15,10,6,241,0,40,8,6,3,57,12,9,5,170,18, -13,5,178,14,10,5,241,14,10,5,255,14,10,5,252,16,11,5,195,16, -11,5,170,8,6,3,113,0,24,8,6,5,28,24,16,9,204,24,17,9, -255,17,12,6,210,14,10,5,170,16,11,5,170,17,11,6,246,27,17,10, -246,14,10,7,85,0,16,8,6,5,28,21,14,10,195,22,15,11,255,18, -13,9,255,18,13,9,255,22,15,9,255,19,13,8,255,17,12,6,255,17, -11,6,255,15,11,6,255,17,12,6,255,19,13,6,204,12,9,5,28,0, -12,5,4,2,25,8,6,3,122,14,10,5,170,18,13,5,176,14,10,5, -235,15,11,6,255,15,11,6,255,19,12,6,204,19,13,6,170,10,8,5, -170,8,6,5,57,0,48,14,10,5,142,21,13,6,170,16,11,5,170,9, -7,4,28,0,12,5,4,2,25,8,6,3,125,14,10,5,170,14,10,5, -210,23,15,8,255,30,20,11,255,30,20,11,255,23,17,10,255,20,14,9, -244,16,12,9,170,9,8,6,79,0,16,9,7,6,65,15,11,8,170,17, -12,8,232,21,14,8,255,26,16,9,255,23,15,8,255,21,14,8,255,15, -11,6,255,22,15,7,178,11,9,6,170,10,8,7,57,0,32,12,10,5, -142,20,13,5,170,16,11,5,170,9,7,4,28,0,28,5,5,4,28,8, -6,3,133,15,11,6,193,20,15,9,255,28,18,11,255,30,20,11,255,26, -16,9,255,14,10,5,238,16,11,5,170,9,7,4,153,7,5,4,57,0, -16,5,4,2,28,8,6,3,142,18,12,7,207,22,15,9,255,28,18,11, -255,27,18,10,255,18,13,7,255,15,11,6,227,21,13,6,170,10,7,5, -164,7,6,4,57,0,16,14,10,5,142,20,13,5,170,16,12,5,170,9, -7,4,28,0,8,10,8,7,119,149,64,26,255,131,63,26,255,14,11,7, -227,6,5,5,28,0,32,7,5,4,28,14,10,5,156,20,13,5,170,12, -9,5,142,6,5,3,6,0,64,12,10,7,142,24,15,7,170,21,13,6, -170,8,6,3,76,0,48,9,7,6,85,83,43,16,255,176,88,23,255,130, -62,21,255,16,11,7,170,0,28,9,8,6,28,13,10,8,164,23,16,10, -190,16,11,7,252,15,11,6,255,14,10,5,255,14,10,5,255,14,10,5, -255,16,11,5,232,14,10,5,170,8,6,3,85,0,16,14,10,5,142,21, -13,6,170,16,11,5,170,9,7,4,28,0,16,14,10,5,142,20,13,5, -170,16,11,5,170,9,7,4,28,0,12,14,10,5,136,16,12,5,170,16, -11,5,170,18,12,5,170,16,11,5,210,14,10,5,255,14,10,5,249,16, -12,5,193,16,11,5,170,9,7,4,153,7,5,4,57,0,16,5,5,4, -28,8,6,3,125,14,10,5,170,18,12,5,176,14,10,5,238,14,10,5, -246,16,12,5,195,18,13,5,170,16,11,5,170,9,7,4,150,7,5,4, -54,0,16,14,10,5,142,16,12,5,170,16,11,5,170,18,12,5,170,16, -11,5,210,14,10,5,255,14,10,5,249,16,12,5,193,16,11,5,170,9, -7,4,153,7,6,4,57,0,16,14,10,5,142,16,12,5,170,16,11,5, -170,18,12,5,170,16,11,5,210,14,10,5,252,12,9,5,255,16,11,5, -255,20,13,5,201,11,9,4,28,0,12,14,10,5,139,20,13,5,170,16, -11,5,170,9,7,4,28,0,36,5,5,4,28,8,6,3,125,14,10,5, -170,18,13,5,176,14,10,5,238,14,10,5,255,16,11,5,235,18,13,5, -173,16,11,5,170,16,12,5,170,16,11,5,164,9,7,4,28,0,12,12, -9,5,142,21,13,6,170,16,11,5,170,9,7,4,28,0,16,14,10,5, -142,20,13,5,170,16,11,5,170,9,7,4,28,0,12,12,9,5,142,21, -13,6,170,16,11,5,170,9,7,4,28,0,12,6,5,3,28,8,7,5, -139,19,13,8,193,21,15,10,255,31,21,12,255,32,21,13,255,31,20,12, -255,23,17,10,255,18,12,7,212,10,8,5,159,7,6,4,57,0,16,14, -10,5,142,21,13,6,170,16,11,5,170,9,7,4,28,0,16,14,10,5, -142,21,13,6,170,16,12,5,170,9,7,4,28,0,12,14,10,5,136,16, -12,5,170,16,11,5,170,18,12,5,176,17,12,6,252,21,14,8,255,17, -12,6,255,16,11,5,255,20,13,5,204,11,9,4,28,0,12,14,10,5, -142,21,14,6,170,18,12,5,170,9,8,4,28,0,24,14,10,5,142,20, -13,5,170,16,11,5,170,9,7,4,28,0,12,12,9,5,142,21,13,6, -170,16,12,5,170,10,8,5,28,0,16,12,9,5,142,20,13,5,170,16, -11,5,170,9,7,4,28,0,12,5,5,4,28,8,6,3,125,14,10,5, -170,18,12,5,170,20,14,5,173,16,12,5,193,20,13,5,178,20,13,5, -170,16,11,5,170,9,7,4,153,7,6,4,57,0,16,14,10,5,142,21, -13,6,170,16,11,5,170,9,7,4,28,0,44,5,5,4,28,8,6,3, -125,14,10,5,170,18,13,5,170,20,14,5,170,18,12,5,170,13,10,6, -227,72,38,19,255,185,86,32,255,144,64,29,255,20,15,11,232,8,7,7, -28,0,12,14,10,5,142,21,13,6,170,16,11,5,170,9,7,4,28,0, -16,14,10,5,142,20,13,5,170,16,11,5,170,9,7,4,28,0,12,5, -4,2,25,8,6,3,122,14,10,5,170,18,13,5,176,14,10,5,238,14, -10,5,255,14,10,5,249,16,12,5,193,16,11,5,170,9,7,4,153,7, -5,4,57,0,32,14,10,5,142,21,13,6,170,16,11,5,170,9,7,4, -28,0,28,8,6,3,57,9,7,4,164,14,10,5,170,18,13,5,173,14, -10,5,229,14,10,5,255,17,12,6,255,22,15,9,255,20,14,9,252,21, -15,10,176,11,9,6,139,0,32,11,8,4,122,18,12,5,170,14,10,5, -150,7,5,4,28,0,32,8,7,7,57,24,16,11,173,26,18,9,190,13, -10,6,142,5,4,4,11,0,8,8,7,3,68,14,10,5,170,16,11,5, -170,9,7,4,74,0,20,14,10,5,142,20,14,5,170,16,11,5,170,9, -7,4,28,0,16,14,10,5,142,20,14,5,170,16,11,5,170,9,8,4, -28,0,28,14,10,5,142,20,13,5,170,16,11,5,170,9,7,4,28,0, -28,14,10,5,142,18,13,5,170,16,12,5,170,18,13,5,173,14,10,5, -227,14,10,5,255,14,10,5,252,12,9,5,255,12,9,5,255,16,11,5, -255,20,13,5,201,11,9,4,28,0,12,12,10,5,136,16,12,5,170,16, -11,5,170,16,11,5,193,21,15,6,184,14,10,5,31,0,32,8,6,3, -139,54,30,9,255,107,50,12,255,78,39,11,255,9,7,4,161,0,12,20, -13,5,142,18,12,5,210,16,11,5,170,16,11,5,170,16,11,5,170,9, -7,4,28,0,64,13,10,8,57,9,7,6,159,8,6,5,159,10,8,7, -130,10,8,7,119,9,7,6,133,9,7,6,167,10,8,7,170,11,9,8, -113,0,44,5,4,2,28,8,6,3,125,14,10,5,170,18,13,5,176,14, -10,5,238,14,10,5,255,16,11,5,235,18,13,5,173,16,11,5,170,16, -12,5,170,16,11,5,164,9,7,4,28,0,12,14,10,5,136,16,12,5, -170,16,11,5,170,18,12,5,170,16,11,5,210,14,10,5,255,14,10,5, -249,16,12,5,193,16,11,5,170,9,7,4,153,7,5,4,57,0,16,5, -5,4,28,8,6,3,125,14,10,5,170,18,13,5,176,14,10,5,238,14, -10,5,255,14,10,5,249,16,11,5,193,16,11,5,170,9,7,4,150,7, -5,4,57,0,16,5,5,4,28,8,6,3,125,14,10,5,170,18,13,5, -176,14,10,5,238,14,10,5,255,14,10,5,235,18,13,5,173,16,11,5, -170,16,12,5,170,16,11,5,170,9,7,4,28,0,12,5,5,4,28,8, -6,3,125,14,10,5,170,18,13,5,176,14,10,5,235,14,10,5,255,14, -10,5,255,16,11,5,255,20,13,5,207,12,9,5,34,0,28,14,10,5, -142,20,13,5,170,16,11,5,170,9,7,4,28,0,28,6,5,3,85,7, -5,4,85,6,5,3,85,5,4,4,85,5,4,4,105,9,8,4,241,72, -37,11,255,110,54,13,255,67,34,10,255,8,6,3,144,0,12,14,10,5, -142,21,14,6,170,16,12,5,170,9,8,4,28,0,16,14,10,5,142,21, -13,6,170,16,11,5,170,9,7,4,28,0,12,12,9,5,142,21,13,6, -170,16,11,5,170,9,7,4,28,0,12,7,5,2,37,8,6,3,142,8, -6,3,227,25,15,6,255,75,36,10,255,99,51,12,255,66,33,9,255,8, -6,3,130,0,12,14,10,5,139,21,13,6,170,16,11,5,170,9,7,4, -28,0,12,8,6,3,79,14,10,5,170,18,13,5,170,12,9,5,142,0, -16,14,10,5,142,21,13,6,170,16,11,5,170,9,7,4,28,0,12,12, -9,5,142,21,13,6,170,16,11,5,170,9,7,4,28,0,8,20,13,5, -85,11,8,4,28,0,8,12,9,5,142,21,13,6,170,16,11,5,170,9, -7,4,28,0,12,12,9,5,142,21,13,6,170,16,11,5,170,9,7,4, -28,0,16,14,10,5,142,20,13,5,170,16,11,5,170,9,7,4,28,0, -12,5,5,4,28,8,6,3,125,14,10,5,170,18,12,5,170,20,14,5, -173,16,12,5,193,20,13,5,178,20,13,5,170,16,11,5,170,9,7,4, -161,7,6,4,57,0,12,8,6,3,85,84,40,13,255,164,73,23,255,184, -79,27,255,15,11,8,246,0,72,11,10,10,170,176,83,37,255,196,87,33, -255,192,88,31,255,22,15,11,193,0,12,21,15,10,159,26,17,11,255,24, -17,11,221,10,8,7,85,0,44,8,7,3,59,12,9,5,170,16,11,5, -210,14,10,5,255,14,10,5,255,14,10,5,255,14,10,5,246,16,12,5, -193,16,11,5,170,9,7,4,153,6,5,3,57,0,24,14,10,5,142,20, -13,5,170,16,11,5,170,9,7,4,28,0,20,6,5,3,28,8,6,3, -127,14,10,5,170,18,13,5,176,14,10,5,238,14,10,5,255,14,10,5, -235,18,13,5,173,16,11,5,170,16,12,5,170,16,11,5,170,9,7,4, -28,0,28,14,11,7,142,29,19,8,170,17,11,6,159,8,6,3,28,0, -32,7,5,4,28,14,10,5,150,20,13,5,170,12,9,5,142,5,4,2, -14,0,8,15,11,8,142,26,18,9,178,19,13,6,170,8,6,3,68,0, -20,18,12,5,142,16,11,5,238,16,11,5,170,9,7,4,28,0,16,12, -9,5,142,16,11,5,215,18,13,5,187,11,9,4,28,0,16,4,4,3, -6,5,4,2,82,5,4,2,85,5,4,2,85,5,4,2,85,5,4,2, -99,9,7,4,241,72,37,11,255,112,53,13,255,77,39,12,255,10,8,5, -170,0,12,19,13,8,184,20,14,9,255,16,11,7,255,14,11,7,255,17, -12,8,255,22,15,9,255,27,17,10,255,30,19,11,255,28,18,11,255,21, -15,10,255,15,12,8,198,9,7,6,28,0,24,8,6,5,91,15,11,6, -170,14,11,5,238,19,13,6,198,12,9,5,28,0,8,6,5,3,85,54, -29,9,255,100,48,13,255,109,52,14,255,15,11,6,170,0,12,19,13,6, -144,14,10,5,255,16,11,5,178,8,6,3,119,0,255,0,255,0,174,12, -9,7,88,99,44,20,255,26,16,11,232,5,4,4,28,0,92,6,5,3, -57,60,28,11,255,158,67,23,255,88,44,23,255,11,9,6,142,0,255,0, -255,0,150,12,9,7,110,126,51,25,255,25,17,12,232,5,4,4,28,0, -184,6,5,5,28,19,14,10,227,52,29,17,255,30,20,13,255,9,8,6, -82,0,255,0,255,0,255,0,255,0,8,12,10,9,170,172,81,49,255,213, -125,94,255,185,88,58,255,23,16,14,159,0,255,0,255,0,106,5,4,2, -28,16,11,5,244,68,34,9,255,62,33,9,255,9,8,4,139,0,96,10, -8,7,48,71,33,18,255,108,47,23,255,107,48,22,255,113,51,24,255,109, -50,24,255,104,45,21,255,104,45,21,255,113,49,24,255,115,50,24,255,18, -13,9,136,0,255,0,129,9,7,6,34,18,13,9,244,66,31,15,255,84, -37,17,255,83,36,16,255,75,34,14,255,73,35,14,255,91,41,16,255,110, -47,19,255,79,40,16,255,24,16,9,255,8,6,5,57,0,100,22,14,5, -244,40,23,7,255,42,23,7,255,54,28,9,255,60,31,9,255,36,22,7, -255,12,9,5,244,6,5,3,28,0,255,0,29,9,7,6,85,72,34,13, -255,126,56,21,255,148,63,25,255,25,17,14,190,0,72,15,12,12,133,178, -86,57,255,200,89,55,255,194,82,47,255,30,20,17,187,0,255,0,169,9, -7,4,99,17,12,6,255,42,22,9,255,49,25,9,255,54,26,11,255,52, -26,11,255,59,28,12,255,82,37,15,255,111,49,18,255,84,39,17,255,25, -17,10,255,8,7,5,57,0,112,6,5,3,57,38,22,7,255,85,39,12, -255,124,52,21,255,20,13,9,170,0,255,0,255,0,202,8,6,5,28,26, -16,11,170,11,8,6,85,0,100,12,8,5,119,20,14,9,170,12,9,7, -142,0,255,0,255,0,154,9,7,6,28,27,17,12,170,11,9,8,85,0, -192,7,6,6,28,8,7,5,85,8,6,5,57,0,255,0,255,0,255,0, -255,0,16,25,17,16,161,41,27,26,255,40,26,23,235,14,12,11,82,0, -255,0,255,0,110,8,6,3,37,9,7,4,142,9,7,4,136,6,5,3, -6,0,100,23,15,10,153,19,13,10,255,16,11,9,255,16,11,9,255,16, -11,9,255,16,11,9,255,16,11,9,255,18,13,9,255,24,16,11,204,16, -11,9,31,0,255,0,133,10,8,7,142,18,12,9,207,18,13,9,255,16, -11,9,255,15,11,8,255,15,11,8,252,18,13,9,195,18,12,9,170,11, -8,6,167,8,7,5,57,0,104,9,8,4,142,14,10,5,170,13,10,6, -170,13,9,6,170,11,8,6,170,7,6,4,130,6,5,3,28,0,255,0, -37,14,10,7,142,21,14,10,170,19,13,10,170,14,11,9,31,0,72,8, -7,8,14,25,17,16,142,27,18,16,193,26,18,15,170,15,11,10,34,0, -255,0,169,9,7,4,28,11,8,6,170,14,10,7,232,15,10,8,255,15, -10,8,255,15,10,8,255,15,10,8,252,18,12,9,195,18,12,9,170,11, -8,6,167,9,7,6,57,0,120,9,7,4,91,16,11,7,170,20,13,9, -170,13,10,8,28,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, -255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, -255,0,255,0,255}}; - /* Created by MiniCompress.. an iOS RLE compressor. - * Compress Rate : 46.36 % - */ + 1277, + 21, + 4, + 49725, + {121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, + 164, 255, 0, 8, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, + 17, 164, 255, 121, 17, 164, 255, 0, 36, 121, 17, 164, 0, 1, + 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 52, + 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, + 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, + 121, 17, 164, 255, 121, 17, 164, 255, 0, 52, 121, 17, 164, 0, + 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, + 52, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, + 121, 17, 164, 255, 0, 12, 121, 17, 164, 0, 1, 121, 17, 164, + 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 20, 121, 17, 164, + 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, + 0, 20, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, + 255, 121, 17, 164, 255, 0, 52, 121, 17, 164, 0, 1, 121, 17, + 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, + 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, + 255, 0, 12, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, + 164, 255, 121, 17, 164, 255, 0, 36, 121, 17, 164, 0, 1, 121, + 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 12, 121, + 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, + 164, 255, 0, 36, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, + 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, + 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, + 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, + 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, + 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, + 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, + 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, + 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, + 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, + 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, + 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, + 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, + 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, + 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, + 255, 0, 12, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, + 164, 255, 121, 17, 164, 255, 0, 12, 121, 17, 164, 0, 1, 121, + 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 36, 121, + 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, + 164, 255, 0, 36, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, + 17, 164, 255, 121, 17, 164, 255, 0, 36, 121, 17, 164, 0, 1, + 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, + 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, + 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, + 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, + 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, + 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, + 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, + 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, + 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, + 0, 36, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, + 255, 121, 17, 164, 255, 0, 36, 121, 17, 164, 0, 1, 121, 17, + 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, + 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, + 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, + 164, 255, 121, 17, 164, 255, 0, 12, 121, 17, 164, 0, 1, 121, + 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, + 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, + 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, + 17, 164, 255, 121, 17, 164, 255, 0, 36, 121, 17, 164, 0, 1, + 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 52, + 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, + 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, + 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, + 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, + 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, + 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, + 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, + 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, + 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, + 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, + 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, + 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, + 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, + 164, 255, 121, 17, 164, 255, 0, 52, 121, 17, 164, 0, 1, 121, + 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, + 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, + 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, + 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, + 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 20, + 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, + 17, 164, 255, 0, 36, 121, 17, 164, 0, 1, 121, 17, 164, 255, + 121, 17, 164, 255, 121, 17, 164, 255, 0, 20, 121, 17, 164, 0, + 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, + 36, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, + 121, 17, 164, 255, 0, 36, 121, 17, 164, 0, 1, 121, 17, 164, + 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 12, 121, 17, 164, + 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, + 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, + 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, + 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, + 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, + 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, + 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, + 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 28, 121, + 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, + 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, + 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, + 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 12, + 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, + 17, 164, 255, 0, 28, 121, 17, 164, 0, 1, 121, 17, 164, 255, + 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, + 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, + 12, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, + 121, 17, 164, 255, 0, 52, 121, 17, 164, 0, 1, 121, 17, 164, + 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, + 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, + 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, + 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, + 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, + 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, + 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, + 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, + 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 28, 121, + 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, + 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, + 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, + 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 52, + 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, + 17, 164, 255, 0, 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, + 121, 17, 164, 255, 121, 17, 164, 255, 0, 44, 121, 17, 164, 0, + 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, + 44, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, + 121, 17, 164, 255, 0, 28, 121, 17, 164, 0, 1, 121, 17, 164, + 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, 12, 121, 17, 164, + 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, + 0, 28, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, + 255, 121, 17, 164, 255, 121, 17, 164, 255, 121, 17, 164, 255, 0, + 56, 121, 17, 164, 0, 1, 121, 17, 164, 255, 121, 17, 164, 255, + 13, 4, 17, 0, 1, 13, 4, 17, 0, 1, 13, 4, 17, 0, + 1, 16, 5, 22, 0, 13, 16, 5, 22, 0, 1, 14, 4, 19, + 0, 1, 16, 5, 22, 0, 41, 16, 5, 22, 0, 1, 14, 4, + 19, 0, 1, 16, 5, 22, 0, 57, 16, 5, 22, 0, 1, 14, + 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, + 14, 4, 19, 0, 1, 16, 5, 22, 0, 57, 16, 5, 22, 0, + 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 57, 16, 5, 22, + 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 17, 16, 5, + 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 25, 16, + 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 25, + 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, + 57, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, + 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, + 22, 0, 17, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, + 5, 22, 0, 41, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, + 16, 5, 22, 0, 17, 16, 5, 22, 0, 1, 14, 4, 19, 0, + 1, 16, 5, 22, 0, 41, 16, 5, 22, 0, 1, 14, 4, 19, + 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, + 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, + 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, + 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, + 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, + 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, + 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, + 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, + 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, + 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, + 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, + 22, 0, 17, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, + 5, 22, 0, 17, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, + 16, 5, 22, 0, 41, 16, 5, 22, 0, 1, 14, 4, 19, 0, + 1, 16, 5, 22, 0, 41, 16, 5, 22, 0, 1, 14, 4, 19, + 0, 1, 16, 5, 22, 0, 41, 16, 5, 22, 0, 1, 14, 4, + 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, + 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, + 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, + 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, + 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, + 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, + 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 41, + 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, + 41, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, + 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, + 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, + 5, 22, 0, 17, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, + 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, + 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, + 0, 1, 16, 5, 22, 0, 41, 16, 5, 22, 0, 1, 14, 4, + 19, 0, 1, 16, 5, 22, 0, 57, 16, 5, 22, 0, 1, 14, + 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, + 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, + 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, + 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, + 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, + 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, + 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, + 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, + 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, + 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, + 5, 22, 0, 57, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, + 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, + 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, + 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, + 19, 0, 1, 16, 5, 22, 0, 25, 16, 5, 22, 0, 1, 14, + 4, 19, 0, 1, 16, 5, 22, 0, 41, 16, 5, 22, 0, 1, + 14, 4, 19, 0, 1, 16, 5, 22, 0, 25, 16, 5, 22, 0, + 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 41, 16, 5, 22, + 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 41, 16, 5, + 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 17, 16, + 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, + 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, + 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, + 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, + 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, + 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, + 16, 5, 22, 0, 33, 16, 5, 22, 0, 1, 14, 4, 19, 0, + 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, + 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, + 19, 0, 1, 16, 5, 22, 0, 17, 16, 5, 22, 0, 1, 14, + 4, 19, 0, 1, 16, 5, 22, 0, 33, 16, 5, 22, 0, 1, + 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, + 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 17, 16, 5, 22, + 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 57, 16, 5, + 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, + 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, + 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, + 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, + 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, + 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, + 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, + 16, 5, 22, 0, 33, 16, 5, 22, 0, 1, 14, 4, 19, 0, + 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, 19, + 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, 14, 4, + 19, 0, 1, 16, 5, 22, 0, 57, 16, 5, 22, 0, 1, 14, + 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, 1, + 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, 0, + 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 49, 16, 5, 22, + 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 33, 16, 5, + 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 17, 16, + 5, 22, 0, 1, 14, 4, 19, 0, 1, 16, 5, 22, 0, 33, + 16, 5, 22, 0, 1, 14, 4, 19, 0, 1, 13, 4, 17, 0, + 1, 13, 4, 17, 0, 1, 16, 5, 22, 0, 61, 16, 5, 22, + 0, 1, 14, 4, 19, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 255, 0, 255, 0, 25, 8, 6, 3, 57, 10, 8, 5, 85, 9, + 7, 4, 76, 0, 12, 8, 6, 3, 54, 9, 8, 4, 96, 9, + 7, 4, 85, 0, 12, 8, 6, 3, 57, 9, 8, 4, 96, 9, + 7, 4, 85, 0, 24, 8, 6, 3, 57, 11, 8, 4, 85, 9, + 7, 4, 79, 0, 12, 8, 6, 3, 51, 10, 8, 5, 85, 8, + 6, 3, 85, 0, 40, 8, 6, 3, 57, 11, 8, 4, 85, 8, + 6, 3, 85, 0, 32, 8, 6, 3, 57, 10, 8, 5, 85, 9, + 7, 4, 85, 0, 28, 5, 4, 2, 14, 8, 6, 3, 85, 9, + 7, 4, 85, 0, 24, 8, 6, 3, 74, 9, 7, 4, 113, 8, + 6, 3, 167, 8, 6, 3, 139, 9, 7, 4, 85, 5, 4, 2, + 14, 0, 36, 8, 6, 3, 57, 9, 8, 4, 110, 9, 7, 4, + 85, 0, 24, 5, 4, 2, 20, 9, 7, 4, 85, 9, 8, 4, + 85, 0, 16, 9, 8, 4, 57, 9, 8, 4, 85, 6, 5, 3, + 48, 0, 255, 0, 29, 5, 4, 2, 17, 8, 6, 3, 85, 9, + 7, 4, 82, 0, 20, 5, 4, 2, 3, 8, 6, 3, 85, 9, + 7, 4, 93, 8, 6, 3, 153, 8, 6, 3, 161, 8, 6, 3, + 110, 9, 8, 4, 85, 8, 6, 3, 85, 6, 5, 3, 31, 0, + 32, 5, 4, 2, 3, 8, 6, 3, 85, 10, 8, 5, 85, 10, + 7, 5, 85, 0, 36, 5, 4, 2, 57, 8, 6, 3, 85, 9, + 7, 4, 91, 8, 6, 3, 153, 8, 6, 3, 170, 8, 6, 3, + 164, 8, 6, 3, 108, 8, 6, 3, 85, 6, 5, 3, 71, 0, + 24, 5, 4, 2, 42, 8, 6, 3, 85, 9, 7, 4, 91, 8, + 6, 3, 153, 8, 6, 3, 170, 8, 6, 3, 164, 8, 6, 3, + 108, 8, 6, 3, 85, 6, 5, 3, 71, 0, 48, 5, 4, 2, + 3, 8, 6, 3, 85, 9, 8, 4, 85, 9, 7, 4, 74, 0, + 16, 8, 6, 3, 42, 9, 7, 4, 85, 8, 6, 3, 85, 9, + 7, 4, 85, 8, 6, 3, 125, 8, 6, 3, 170, 7, 6, 4, + 170, 9, 7, 4, 170, 12, 9, 7, 170, 19, 14, 10, 170, 19, + 13, 10, 142, 8, 6, 5, 28, 0, 16, 5, 4, 2, 51, 8, + 6, 3, 85, 9, 7, 4, 91, 8, 6, 3, 153, 8, 6, 3, + 170, 8, 6, 3, 164, 8, 6, 3, 108, 8, 6, 3, 85, 6, + 5, 3, 71, 0, 20, 10, 8, 5, 57, 9, 7, 4, 170, 8, + 6, 3, 170, 8, 6, 3, 170, 8, 6, 3, 161, 8, 6, 3, + 142, 9, 7, 4, 96, 9, 7, 4, 85, 8, 6, 3, 85, 9, + 7, 4, 85, 9, 7, 4, 74, 0, 20, 5, 4, 2, 42, 8, + 6, 3, 85, 9, 7, 4, 91, 8, 6, 3, 153, 8, 6, 3, + 170, 8, 6, 3, 164, 8, 6, 3, 108, 8, 6, 3, 85, 6, + 5, 3, 76, 0, 24, 8, 6, 5, 82, 10, 8, 7, 133, 12, + 9, 7, 170, 15, 11, 8, 170, 15, 11, 8, 170, 15, 11, 8, + 170, 13, 10, 8, 170, 10, 8, 7, 161, 10, 8, 7, 85, 6, + 5, 5, 28, 0, 96, 8, 6, 3, 74, 9, 8, 4, 85, 8, + 6, 3, 57, 0, 68, 7, 6, 4, 28, 9, 7, 4, 85, 9, + 7, 4, 85, 5, 4, 2, 17, 0, 40, 5, 4, 2, 42, 8, + 6, 3, 85, 9, 7, 4, 91, 8, 6, 3, 153, 8, 6, 3, + 170, 8, 6, 3, 164, 8, 6, 3, 108, 8, 6, 3, 85, 6, + 5, 3, 85, 0, 24, 8, 6, 5, 85, 10, 8, 7, 133, 12, + 9, 7, 170, 15, 10, 8, 170, 15, 11, 8, 170, 15, 11, 8, + 170, 13, 10, 8, 170, 10, 8, 7, 150, 8, 6, 5, 62, 0, + 24, 8, 6, 5, 82, 10, 8, 7, 133, 12, 9, 7, 170, 15, + 10, 8, 170, 14, 10, 7, 170, 9, 7, 4, 170, 8, 6, 5, + 147, 10, 8, 5, 85, 7, 6, 4, 85, 5, 4, 4, 3, 0, + 16, 12, 9, 7, 57, 11, 8, 6, 161, 9, 7, 6, 170, 10, + 8, 7, 170, 13, 10, 8, 170, 14, 10, 7, 170, 13, 10, 8, + 170, 12, 9, 7, 170, 10, 8, 7, 156, 10, 8, 7, 85, 6, + 5, 5, 25, 0, 20, 6, 5, 3, 57, 8, 7, 5, 85, 9, + 7, 4, 110, 9, 7, 4, 170, 10, 8, 5, 170, 10, 8, 5, + 170, 11, 8, 6, 170, 10, 8, 7, 150, 10, 8, 7, 85, 6, + 5, 5, 25, 0, 16, 15, 11, 8, 57, 11, 8, 6, 170, 9, + 7, 6, 170, 10, 8, 7, 170, 13, 10, 8, 170, 15, 11, 8, + 170, 15, 11, 8, 170, 13, 10, 8, 170, 10, 8, 7, 159, 10, + 8, 7, 85, 6, 5, 5, 25, 0, 16, 15, 11, 8, 59, 11, + 9, 6, 170, 9, 7, 4, 125, 10, 8, 5, 85, 8, 6, 3, + 133, 8, 6, 3, 167, 8, 6, 3, 170, 8, 6, 3, 170, 9, + 8, 4, 113, 0, 16, 8, 6, 3, 42, 10, 8, 5, 85, 10, + 7, 5, 85, 9, 7, 4, 125, 10, 8, 5, 170, 12, 10, 7, + 170, 14, 11, 7, 170, 19, 14, 10, 170, 19, 14, 10, 142, 8, + 6, 5, 28, 0, 16, 8, 6, 5, 82, 10, 8, 7, 133, 12, + 9, 7, 170, 15, 11, 8, 170, 15, 11, 8, 170, 15, 11, 8, + 170, 13, 10, 8, 170, 10, 8, 7, 161, 10, 8, 7, 85, 6, + 5, 5, 25, 0, 16, 12, 10, 7, 74, 14, 10, 7, 170, 12, + 9, 7, 139, 7, 6, 4, 28, 0, 16, 10, 8, 7, 110, 14, + 10, 7, 170, 13, 10, 8, 125, 0, 16, 13, 10, 8, 71, 15, + 11, 8, 170, 13, 10, 8, 130, 5, 5, 4, 8, 0, 44, 11, + 8, 6, 85, 9, 7, 4, 170, 10, 8, 5, 93, 0, 16, 12, + 9, 7, 57, 10, 8, 5, 167, 11, 8, 6, 110, 6, 5, 3, + 8, 0, 16, 11, 8, 6, 57, 10, 7, 5, 159, 11, 8, 6, + 102, 0, 16, 8, 6, 3, 51, 10, 8, 5, 85, 9, 7, 4, + 85, 0, 40, 10, 7, 5, 57, 11, 9, 6, 85, 7, 6, 4, + 57, 0, 28, 7, 5, 4, 28, 10, 8, 5, 85, 11, 8, 6, + 85, 0, 16, 8, 6, 3, 48, 10, 8, 5, 85, 8, 6, 3, + 85, 0, 20, 8, 6, 3, 57, 11, 8, 4, 85, 9, 7, 4, + 79, 0, 20, 5, 4, 2, 45, 8, 6, 3, 85, 9, 7, 4, + 85, 9, 7, 4, 88, 9, 7, 4, 108, 9, 8, 4, 93, 9, + 7, 4, 85, 8, 6, 3, 85, 6, 5, 3, 74, 0, 20, 8, + 6, 3, 45, 9, 7, 4, 85, 8, 6, 3, 85, 9, 7, 4, + 85, 8, 6, 3, 125, 8, 6, 3, 170, 8, 6, 3, 164, 8, + 6, 3, 108, 8, 6, 3, 85, 6, 5, 3, 74, 0, 24, 6, + 5, 3, 57, 8, 7, 5, 85, 10, 8, 5, 85, 9, 7, 4, + 119, 8, 6, 3, 142, 9, 7, 4, 130, 10, 8, 5, 91, 10, + 7, 5, 85, 6, 5, 3, 85, 0, 20, 9, 7, 4, 57, 10, + 8, 5, 85, 10, 7, 5, 85, 10, 8, 5, 85, 8, 6, 3, + 144, 8, 6, 3, 170, 8, 6, 3, 164, 8, 6, 3, 108, 8, + 6, 3, 85, 6, 5, 3, 71, 0, 24, 5, 4, 2, 45, 8, + 6, 3, 85, 9, 7, 4, 91, 8, 6, 3, 153, 8, 6, 3, + 170, 8, 6, 3, 164, 9, 7, 4, 105, 8, 6, 3, 85, 6, + 5, 3, 74, 0, 20, 11, 8, 4, 59, 9, 7, 4, 170, 8, + 6, 3, 164, 9, 7, 4, 91, 8, 6, 3, 85, 8, 6, 3, + 85, 8, 6, 3, 85, 9, 7, 4, 85, 8, 6, 3, 142, 9, + 6, 4, 170, 9, 8, 4, 116, 0, 16, 8, 6, 3, 48, 10, + 8, 5, 85, 9, 7, 4, 85, 0, 20, 8, 6, 3, 57, 11, + 8, 4, 85, 9, 7, 4, 76, 0, 16, 8, 6, 3, 48, 10, + 8, 5, 85, 9, 7, 4, 85, 0, 20, 8, 6, 3, 57, 11, + 8, 4, 85, 9, 7, 4, 76, 0, 16, 8, 6, 3, 48, 10, + 8, 5, 85, 9, 7, 4, 85, 0, 28, 8, 6, 3, 57, 11, + 8, 4, 85, 9, 7, 4, 76, 0, 16, 8, 6, 3, 54, 9, + 8, 4, 96, 9, 7, 4, 85, 0, 20, 8, 6, 3, 57, 9, + 8, 4, 96, 9, 7, 4, 85, 0, 16, 10, 8, 5, 57, 10, + 7, 5, 153, 10, 8, 5, 93, 0, 20, 10, 8, 7, 93, 14, + 11, 7, 170, 13, 10, 8, 136, 0, 16, 11, 8, 6, 91, 11, + 8, 6, 170, 9, 7, 4, 170, 9, 7, 4, 170, 8, 6, 5, + 170, 8, 6, 3, 119, 9, 7, 4, 85, 8, 6, 3, 85, 8, + 6, 3, 85, 9, 7, 4, 85, 9, 7, 4, 76, 0, 16, 8, + 6, 3, 42, 9, 7, 4, 85, 8, 6, 3, 85, 8, 6, 3, + 122, 9, 8, 4, 102, 0, 16, 8, 6, 3, 51, 9, 7, 4, + 85, 6, 5, 3, 45, 0, 40, 12, 8, 5, 57, 8, 6, 3, + 156, 10, 7, 5, 93, 11, 8, 6, 85, 11, 8, 6, 85, 0, + 28, 6, 5, 5, 14, 13, 10, 8, 85, 8, 7, 5, 45, 0, + 80, 10, 8, 5, 57, 10, 7, 5, 156, 10, 8, 5, 96, 0, + 76, 9, 7, 4, 57, 10, 8, 5, 93, 10, 8, 5, 85, 0, + 140, 10, 8, 7, 110, 13, 10, 8, 170, 12, 9, 7, 133, 5, + 5, 4, 6, 0, 84, 8, 6, 5, 79, 10, 8, 7, 127, 13, + 10, 8, 170, 16, 12, 9, 142, 8, 7, 5, 28, 0, 72, 8, + 6, 3, 57, 10, 8, 5, 85, 9, 6, 4, 85, 0, 48, 15, + 11, 8, 113, 25, 18, 12, 170, 20, 15, 11, 142, 8, 7, 5, + 28, 0, 28, 15, 11, 8, 130, 22, 16, 11, 170, 20, 15, 11, + 142, 7, 6, 6, 23, 0, 12, 13, 10, 8, 68, 12, 9, 7, + 170, 11, 8, 6, 116, 6, 5, 3, 8, 0, 44, 12, 9, 7, + 82, 15, 10, 8, 170, 13, 10, 8, 130, 5, 5, 4, 8, 0, + 255, 0, 197, 6, 5, 3, 57, 8, 6, 3, 85, 0, 255, 0, + 149, 5, 4, 2, 6, 8, 6, 3, 85, 8, 6, 3, 156, 9, + 8, 4, 113, 0, 16, 8, 6, 3, 48, 9, 8, 4, 91, 9, + 7, 4, 76, 0, 16, 10, 8, 5, 57, 9, 6, 4, 170, 8, + 6, 3, 99, 5, 4, 2, 34, 0, 36, 8, 6, 3, 71, 9, + 8, 4, 93, 9, 8, 4, 96, 8, 6, 3, 85, 6, 5, 3, + 45, 0, 12, 8, 6, 3, 76, 0, 44, 8, 6, 3, 57, 58, + 31, 9, 255, 93, 50, 12, 255, 88, 45, 11, 255, 12, 10, 5, + 113, 0, 4, 7, 6, 4, 28, 54, 29, 9, 255, 93, 46, 12, + 255, 88, 45, 11, 255, 12, 9, 5, 122, 0, 4, 7, 5, 4, + 37, 54, 29, 9, 255, 93, 46, 12, 255, 88, 45, 11, 255, 14, + 10, 5, 142, 0, 16, 8, 6, 3, 85, 58, 31, 9, 255, 93, + 50, 12, 255, 88, 44, 11, 255, 9, 7, 4, 170, 0, 4, 5, + 4, 2, 85, 52, 28, 9, 255, 93, 48, 12, 255, 88, 44, 11, + 255, 12, 10, 5, 170, 0, 32, 7, 6, 4, 85, 58, 31, 9, + 255, 93, 50, 12, 255, 88, 45, 11, 255, 12, 9, 5, 170, 0, + 24, 8, 6, 3, 57, 58, 31, 9, 255, 93, 50, 12, 255, 88, + 45, 11, 255, 14, 10, 5, 142, 0, 20, 6, 5, 3, 28, 19, + 12, 6, 227, 76, 37, 11, 255, 88, 45, 11, 255, 14, 10, 5, + 139, 0, 16, 9, 8, 4, 170, 69, 35, 10, 255, 92, 47, 11, + 255, 92, 47, 11, 255, 88, 45, 11, 255, 88, 45, 11, 255, 16, + 11, 5, 227, 7, 5, 4, 28, 0, 28, 8, 6, 3, 57, 58, + 31, 9, 255, 93, 46, 12, 255, 88, 45, 11, 255, 14, 10, 5, + 142, 0, 16, 6, 5, 3, 28, 19, 12, 6, 227, 82, 39, 11, + 255, 92, 47, 11, 255, 14, 10, 5, 105, 0, 8, 7, 5, 4, + 20, 54, 29, 9, 255, 100, 50, 13, 255, 30, 19, 7, 255, 8, + 6, 3, 85, 0, 255, 0, 21, 6, 5, 3, 28, 19, 12, 6, + 227, 76, 37, 11, 255, 88, 45, 11, 255, 14, 10, 5, 130, 0, + 12, 7, 6, 4, 65, 17, 11, 6, 227, 71, 37, 10, 255, 88, + 45, 11, 255, 92, 47, 11, 255, 92, 47, 11, 255, 88, 45, 11, + 255, 88, 44, 11, 255, 88, 44, 11, 255, 25, 16, 6, 255, 8, + 6, 3, 142, 0, 24, 7, 5, 4, 85, 17, 12, 6, 229, 77, + 39, 12, 255, 107, 51, 14, 255, 113, 55, 16, 255, 20, 14, 9, + 178, 0, 28, 14, 11, 7, 170, 29, 18, 8, 255, 74, 39, 11, + 255, 88, 45, 11, 255, 88, 45, 11, 255, 92, 47, 11, 255, 92, + 47, 11, 255, 88, 45, 11, 255, 88, 44, 11, 255, 41, 23, 8, + 255, 12, 9, 5, 227, 5, 5, 4, 23, 0, 12, 9, 7, 4, + 170, 26, 17, 6, 255, 74, 39, 11, 255, 88, 45, 11, 255, 88, + 45, 11, 255, 92, 47, 11, 255, 92, 47, 11, 255, 88, 45, 11, + 255, 88, 44, 11, 255, 41, 24, 8, 255, 12, 9, 5, 227, 6, + 5, 3, 28, 0, 36, 6, 5, 3, 85, 16, 11, 5, 227, 71, + 37, 10, 255, 88, 45, 11, 255, 88, 44, 11, 255, 12, 10, 5, + 113, 0, 8, 8, 6, 3, 28, 54, 29, 9, 255, 92, 47, 11, + 255, 88, 44, 11, 255, 88, 45, 11, 255, 92, 46, 13, 255, 100, + 52, 13, 255, 109, 53, 16, 255, 121, 63, 20, 255, 158, 74, 23, + 255, 180, 88, 27, 255, 183, 90, 28, 255, 26, 17, 11, 142, 0, + 12, 10, 7, 5, 170, 26, 17, 6, 255, 74, 39, 11, 255, 88, + 45, 11, 255, 92, 47, 11, 255, 92, 47, 11, 255, 92, 47, 11, + 255, 88, 45, 11, 255, 88, 45, 11, 255, 41, 24, 8, 255, 12, + 9, 5, 227, 6, 5, 3, 28, 0, 8, 7, 6, 4, 8, 61, + 32, 10, 255, 102, 51, 13, 255, 92, 46, 13, 255, 92, 46, 13, + 255, 92, 46, 13, 255, 92, 46, 13, 255, 92, 46, 13, 255, 90, + 45, 11, 255, 84, 44, 11, 255, 88, 45, 11, 255, 88, 44, 11, + 255, 14, 10, 5, 119, 0, 12, 9, 7, 4, 153, 26, 17, 6, + 255, 74, 39, 11, 255, 88, 45, 11, 255, 92, 47, 11, 255, 92, + 47, 11, 255, 92, 47, 11, 255, 88, 45, 11, 255, 88, 44, 11, + 255, 45, 25, 8, 255, 13, 10, 6, 227, 7, 6, 4, 28, 0, + 12, 17, 13, 10, 170, 64, 39, 21, 255, 155, 78, 26, 255, 169, + 83, 26, 255, 165, 80, 24, 255, 161, 79, 24, 255, 145, 71, 22, + 255, 136, 70, 21, 255, 134, 69, 21, 255, 88, 50, 23, 255, 22, + 17, 11, 232, 9, 8, 6, 31, 0, 84, 4, 4, 3, 23, 12, + 9, 5, 173, 71, 34, 10, 255, 92, 43, 13, 255, 33, 20, 8, + 255, 10, 8, 5, 57, 0, 64, 20, 14, 7, 227, 83, 42, 12, + 255, 92, 46, 13, 255, 19, 13, 6, 227, 6, 5, 3, 34, 0, + 32, 10, 8, 5, 170, 26, 17, 6, 255, 76, 37, 11, 255, 90, + 46, 11, 255, 92, 46, 13, 255, 92, 46, 13, 255, 90, 45, 11, + 255, 90, 45, 11, 255, 88, 44, 11, 255, 46, 26, 9, 255, 18, + 13, 9, 227, 8, 7, 5, 28, 0, 12, 15, 12, 8, 170, 58, + 35, 19, 255, 134, 73, 23, 255, 153, 76, 24, 255, 142, 69, 21, + 255, 131, 64, 20, 255, 121, 59, 18, 255, 121, 59, 18, 255, 121, + 62, 18, 255, 43, 27, 12, 255, 11, 9, 6, 170, 0, 16, 17, + 13, 10, 170, 64, 39, 21, 255, 164, 85, 27, 255, 177, 86, 26, + 255, 154, 75, 23, 255, 121, 62, 18, 255, 115, 56, 16, 255, 119, + 61, 18, 255, 123, 61, 20, 255, 80, 45, 19, 255, 22, 16, 11, + 227, 8, 7, 5, 28, 0, 8, 13, 10, 8, 57, 96, 48, 19, + 255, 165, 80, 24, 255, 159, 78, 24, 255, 159, 78, 24, 255, 165, + 80, 24, 255, 165, 80, 24, 255, 165, 80, 24, 255, 159, 78, 24, + 255, 164, 81, 25, 255, 91, 52, 24, 255, 22, 17, 11, 227, 8, + 7, 5, 28, 0, 12, 13, 10, 8, 170, 38, 24, 11, 255, 99, + 47, 16, 255, 116, 59, 17, 255, 126, 65, 21, 255, 142, 69, 21, + 255, 153, 76, 24, 255, 157, 74, 24, 255, 155, 76, 24, 255, 91, + 52, 24, 255, 23, 18, 12, 227, 8, 7, 5, 28, 0, 8, 13, + 10, 8, 57, 104, 52, 21, 255, 171, 84, 26, 255, 155, 76, 24, + 255, 164, 81, 25, 255, 173, 81, 26, 255, 180, 88, 27, 255, 180, + 88, 27, 255, 177, 86, 26, 255, 169, 80, 26, 255, 92, 55, 25, + 255, 22, 17, 11, 227, 8, 7, 5, 28, 0, 8, 13, 10, 8, + 57, 114, 63, 25, 255, 177, 86, 26, 255, 114, 56, 17, 255, 92, + 46, 13, 255, 92, 47, 11, 255, 93, 46, 12, 255, 92, 46, 13, + 255, 96, 48, 13, 255, 92, 46, 13, 255, 18, 12, 5, 91, 0, + 8, 8, 6, 3, 40, 55, 29, 10, 255, 108, 50, 15, 255, 114, + 56, 17, 255, 130, 67, 21, 255, 153, 76, 24, 255, 161, 82, 24, + 255, 171, 84, 26, 255, 179, 84, 26, 255, 179, 84, 26, 255, 25, + 17, 10, 142, 0, 12, 15, 12, 8, 170, 64, 39, 21, 255, 162, + 84, 27, 255, 179, 88, 28, 255, 183, 90, 28, 255, 181, 89, 28, + 255, 181, 89, 28, 255, 172, 88, 27, 255, 156, 77, 25, 255, 88, + 50, 23, 255, 22, 17, 11, 227, 8, 7, 5, 28, 0, 8, 13, + 9, 6, 57, 96, 48, 19, 255, 153, 71, 22, 255, 134, 69, 21, + 255, 20, 14, 9, 193, 0, 12, 11, 8, 6, 113, 124, 62, 25, + 255, 185, 91, 28, 255, 169, 80, 26, 255, 22, 15, 9, 142, 0, + 8, 11, 8, 6, 57, 111, 61, 24, 255, 184, 90, 27, 255, 177, + 86, 26, 255, 23, 16, 10, 173, 0, 40, 11, 8, 6, 113, 114, + 59, 23, 255, 144, 73, 21, 255, 126, 63, 21, 255, 20, 14, 9, + 142, 0, 8, 11, 9, 6, 57, 97, 51, 20, 255, 152, 71, 23, + 255, 134, 69, 21, 255, 20, 14, 9, 187, 0, 12, 12, 9, 7, + 96, 97, 48, 18, 255, 140, 71, 21, 255, 138, 71, 21, 255, 20, + 15, 9, 142, 0, 8, 8, 6, 3, 40, 52, 28, 9, 255, 93, + 50, 12, 255, 88, 45, 11, 255, 14, 10, 5, 142, 0, 32, 13, + 10, 8, 82, 91, 48, 16, 255, 132, 71, 21, 255, 63, 36, 18, + 255, 10, 8, 7, 136, 0, 20, 7, 6, 6, 62, 31, 21, 12, + 244, 124, 66, 23, 255, 134, 69, 21, 255, 20, 15, 9, 142, 0, + 8, 8, 6, 3, 28, 54, 29, 9, 255, 93, 46, 12, 255, 80, + 39, 11, 255, 14, 10, 5, 142, 0, 12, 8, 6, 3, 57, 58, + 31, 9, 255, 93, 50, 12, 255, 88, 44, 11, 255, 14, 10, 5, + 116, 0, 12, 9, 7, 4, 153, 26, 17, 6, 255, 74, 39, 11, + 255, 88, 45, 11, 255, 88, 45, 11, 255, 88, 45, 11, 255, 88, + 45, 11, 255, 88, 44, 11, 255, 88, 44, 11, 255, 41, 23, 8, + 255, 12, 9, 5, 227, 5, 4, 4, 17, 0, 8, 8, 6, 3, + 34, 54, 29, 9, 255, 92, 43, 11, 255, 88, 44, 11, 255, 88, + 45, 11, 255, 92, 43, 11, 255, 92, 47, 11, 255, 92, 47, 11, + 255, 88, 45, 11, 255, 88, 44, 11, 255, 45, 25, 8, 255, 12, + 10, 5, 227, 6, 5, 3, 28, 0, 12, 13, 10, 6, 170, 40, + 24, 11, 255, 97, 48, 16, 255, 113, 55, 16, 255, 115, 56, 16, + 255, 116, 57, 17, 255, 116, 57, 17, 255, 113, 55, 16, 255, 113, + 55, 16, 255, 60, 33, 13, 255, 18, 14, 9, 227, 8, 6, 5, + 28, 0, 8, 12, 9, 7, 57, 77, 38, 14, 255, 118, 57, 17, + 255, 116, 59, 17, 255, 118, 60, 17, 255, 109, 53, 16, 255, 98, + 47, 13, 255, 92, 47, 11, 255, 88, 45, 11, 255, 88, 44, 11, + 255, 41, 23, 8, 255, 12, 9, 5, 227, 6, 5, 3, 28, 0, + 12, 10, 8, 5, 170, 28, 18, 7, 255, 76, 37, 11, 255, 90, + 45, 11, 255, 92, 46, 13, 255, 94, 45, 13, 255, 94, 45, 13, + 255, 92, 46, 13, 255, 92, 46, 13, 255, 46, 26, 9, 255, 13, + 10, 6, 227, 6, 5, 5, 28, 0, 8, 7, 6, 4, 8, 61, + 32, 10, 255, 100, 50, 13, 255, 92, 46, 13, 255, 92, 46, 13, + 255, 92, 46, 13, 255, 92, 46, 13, 255, 92, 46, 13, 255, 92, + 46, 13, 255, 94, 47, 13, 255, 98, 49, 13, 255, 94, 47, 13, + 255, 18, 12, 5, 93, 0, 8, 8, 6, 3, 42, 60, 32, 9, + 255, 96, 48, 13, 255, 88, 45, 11, 255, 14, 10, 5, 142, 0, + 12, 8, 6, 3, 57, 58, 31, 9, 255, 93, 50, 12, 255, 88, + 44, 11, 255, 12, 10, 5, 113, 0, 8, 8, 6, 3, 28, 54, + 29, 9, 255, 93, 50, 12, 255, 88, 44, 11, 255, 14, 10, 5, + 142, 0, 12, 8, 6, 3, 57, 58, 31, 9, 255, 93, 50, 12, + 255, 88, 44, 11, 255, 12, 10, 5, 113, 0, 8, 8, 6, 3, + 28, 54, 29, 9, 255, 93, 50, 12, 255, 88, 44, 11, 255, 14, + 10, 5, 142, 0, 20, 8, 6, 3, 57, 58, 31, 9, 255, 93, + 50, 12, 255, 88, 44, 11, 255, 12, 10, 5, 113, 0, 8, 7, + 6, 4, 28, 54, 29, 9, 255, 93, 50, 12, 255, 88, 45, 11, + 255, 14, 10, 5, 142, 0, 12, 8, 7, 3, 57, 60, 31, 9, + 255, 96, 48, 13, 255, 92, 46, 13, 255, 14, 10, 5, 127, 0, + 8, 10, 8, 5, 57, 82, 42, 15, 255, 135, 66, 20, 255, 121, + 60, 20, 255, 20, 15, 9, 176, 0, 12, 11, 9, 6, 108, 107, + 56, 22, 255, 172, 84, 25, 255, 158, 74, 23, 255, 22, 15, 9, + 142, 0, 8, 11, 8, 6, 54, 98, 51, 19, 255, 142, 72, 21, + 255, 136, 70, 21, 255, 138, 71, 21, 255, 121, 59, 18, 255, 100, + 52, 13, 255, 90, 46, 11, 255, 88, 44, 11, 255, 88, 44, 11, + 255, 88, 44, 11, 255, 88, 45, 11, 255, 12, 10, 5, 113, 0, + 8, 8, 6, 3, 28, 54, 29, 9, 255, 92, 47, 11, 255, 88, + 44, 11, 255, 92, 47, 11, 255, 92, 47, 11, 255, 18, 12, 5, + 85, 0, 8, 7, 6, 4, 45, 54, 30, 9, 255, 94, 47, 13, + 255, 31, 20, 8, 255, 9, 7, 4, 85, 0, 32, 8, 6, 3, + 48, 65, 33, 10, 255, 114, 55, 15, 255, 119, 58, 18, 255, 126, + 63, 21, 255, 128, 66, 21, 255, 22, 15, 9, 164, 0, 20, 5, + 5, 4, 28, 19, 14, 10, 227, 141, 72, 26, 255, 43, 27, 16, + 255, 7, 6, 6, 85, 0, 72, 14, 10, 7, 71, 96, 49, 17, + 255, 138, 71, 21, 255, 130, 67, 21, 255, 22, 15, 9, 164, 0, + 68, 12, 9, 7, 76, 77, 39, 14, 255, 118, 57, 17, 255, 109, + 53, 16, 255, 22, 15, 9, 153, 0, 132, 11, 8, 6, 96, 103, + 53, 20, 255, 144, 73, 21, 255, 121, 60, 20, 255, 24, 16, 9, + 153, 0, 80, 15, 12, 8, 184, 61, 36, 20, 255, 141, 68, 24, + 255, 168, 82, 25, 255, 171, 84, 26, 255, 26, 18, 11, 159, 0, + 68, 9, 7, 4, 57, 60, 32, 9, 255, 96, 48, 13, 255, 92, + 46, 13, 255, 19, 12, 6, 142, 0, 40, 14, 10, 7, 76, 129, + 67, 26, 255, 190, 97, 29, 255, 180, 88, 27, 255, 26, 17, 11, + 161, 0, 24, 14, 10, 7, 85, 129, 67, 26, 255, 190, 97, 29, + 255, 180, 88, 27, 255, 25, 17, 10, 125, 0, 8, 11, 8, 6, + 57, 109, 60, 24, 255, 175, 86, 26, 255, 142, 73, 23, 255, 20, + 14, 9, 187, 0, 40, 12, 9, 7, 93, 121, 65, 24, 255, 183, + 89, 26, 255, 168, 82, 25, 255, 21, 15, 10, 178, 0, 255, 0, + 193, 10, 8, 5, 170, 39, 23, 8, 255, 78, 41, 11, 255, 16, + 11, 5, 142, 0, 255, 0, 141, 6, 5, 3, 85, 16, 11, 5, + 227, 71, 37, 10, 255, 92, 47, 11, 255, 92, 47, 11, 255, 18, + 12, 5, 85, 0, 8, 8, 6, 3, 28, 54, 29, 9, 255, 93, + 46, 12, 255, 88, 45, 11, 255, 12, 10, 5, 113, 0, 12, 58, + 31, 9, 255, 93, 50, 12, 255, 88, 45, 11, 255, 25, 17, 6, + 255, 8, 6, 3, 142, 0, 24, 4, 4, 3, 25, 10, 8, 5, + 173, 65, 33, 10, 255, 92, 46, 13, 255, 92, 46, 13, 255, 67, + 34, 10, 255, 27, 18, 8, 255, 9, 7, 4, 156, 3, 3, 2, + 85, 10, 8, 5, 184, 69, 35, 10, 255, 19, 13, 6, 147, 0, + 40, 9, 7, 4, 113, 112, 55, 13, 255, 141, 69, 16, 255, 141, + 75, 16, 255, 18, 13, 5, 170, 0, 4, 8, 6, 3, 85, 110, + 54, 13, 255, 143, 76, 16, 255, 139, 68, 16, 255, 19, 13, 6, + 170, 0, 4, 8, 6, 3, 85, 110, 54, 13, 255, 143, 76, 16, + 255, 141, 72, 16, 255, 23, 15, 6, 170, 0, 12, 10, 9, 5, + 110, 35, 21, 8, 255, 129, 63, 14, 255, 141, 69, 16, 255, 139, + 68, 16, 255, 52, 27, 9, 255, 9, 7, 4, 255, 27, 17, 8, + 255, 135, 66, 16, 255, 154, 75, 17, 255, 155, 79, 18, 255, 91, + 50, 16, 255, 20, 15, 9, 207, 10, 9, 7, 28, 0, 16, 5, + 4, 4, 20, 8, 6, 3, 127, 31, 20, 8, 255, 130, 66, 15, + 255, 143, 76, 16, 255, 143, 76, 16, 255, 67, 34, 10, 255, 10, + 8, 5, 215, 10, 8, 5, 170, 13, 10, 6, 142, 7, 5, 4, + 23, 0, 8, 12, 9, 5, 85, 115, 59, 14, 255, 149, 72, 16, + 255, 143, 76, 16, 255, 18, 12, 5, 235, 0, 16, 7, 6, 4, + 28, 14, 10, 5, 227, 92, 46, 13, 255, 143, 73, 16, 255, 143, + 70, 16, 255, 18, 13, 5, 170, 0, 12, 14, 10, 5, 170, 53, + 28, 10, 255, 114, 56, 13, 255, 56, 29, 9, 255, 16, 11, 5, + 255, 34, 20, 7, 255, 112, 55, 13, 255, 87, 42, 12, 255, 19, + 13, 6, 235, 8, 7, 5, 40, 0, 24, 10, 8, 5, 85, 114, + 56, 13, 255, 143, 70, 16, 255, 141, 72, 16, 255, 23, 15, 6, + 170, 0, 12, 7, 6, 4, 28, 14, 10, 5, 227, 90, 44, 13, + 255, 112, 57, 13, 255, 47, 26, 8, 255, 11, 8, 4, 57, 0, + 12, 25, 16, 6, 227, 96, 48, 13, 255, 112, 57, 13, 255, 26, + 16, 7, 255, 8, 6, 5, 85, 0, 24, 13, 10, 6, 85, 8, + 7, 5, 57, 0, 20, 6, 5, 3, 28, 15, 11, 6, 85, 9, + 7, 4, 28, 0, 36, 9, 7, 4, 105, 10, 8, 5, 170, 10, + 8, 5, 130, 6, 5, 3, 23, 0, 156, 8, 6, 3, 136, 77, + 39, 12, 255, 143, 73, 16, 255, 139, 74, 16, 255, 18, 12, 5, + 170, 0, 12, 21, 14, 6, 227, 112, 57, 13, 255, 141, 69, 16, + 255, 80, 40, 11, 255, 16, 11, 5, 255, 14, 10, 5, 227, 18, + 13, 5, 255, 72, 35, 11, 255, 136, 69, 15, 255, 130, 66, 15, + 255, 46, 26, 9, 255, 8, 6, 3, 105, 0, 16, 8, 7, 5, + 57, 42, 27, 13, 255, 150, 79, 21, 255, 184, 94, 21, 255, 195, + 99, 22, 255, 199, 106, 24, 255, 26, 18, 11, 255, 0, 24, 10, + 8, 7, 99, 83, 45, 18, 255, 144, 74, 17, 255, 143, 70, 16, + 255, 94, 47, 13, 255, 18, 13, 5, 255, 16, 11, 5, 173, 14, + 10, 5, 227, 52, 27, 9, 255, 132, 67, 15, 255, 139, 68, 16, + 255, 75, 39, 12, 255, 10, 7, 5, 116, 0, 8, 6, 5, 3, + 57, 52, 27, 9, 255, 137, 73, 16, 255, 143, 76, 16, 255, 94, + 47, 13, 255, 18, 13, 5, 255, 16, 11, 5, 173, 14, 10, 5, + 227, 52, 27, 9, 255, 132, 67, 15, 255, 139, 74, 16, 255, 75, + 39, 12, 255, 10, 8, 5, 142, 0, 32, 8, 6, 5, 85, 22, + 15, 7, 255, 102, 51, 13, 255, 137, 67, 16, 255, 140, 71, 15, + 255, 141, 75, 16, 255, 20, 13, 5, 170, 0, 8, 9, 6, 4, + 85, 108, 55, 13, 255, 141, 69, 16, 255, 139, 74, 16, 255, 74, + 36, 11, 255, 18, 12, 7, 255, 20, 13, 7, 181, 22, 15, 9, + 207, 20, 13, 9, 238, 18, 13, 9, 252, 23, 16, 10, 255, 31, + 21, 12, 218, 14, 11, 7, 42, 0, 8, 7, 6, 4, 57, 40, + 22, 9, 255, 130, 66, 15, 255, 141, 75, 16, 255, 84, 42, 11, + 255, 18, 12, 5, 255, 16, 12, 5, 181, 14, 10, 5, 241, 69, + 35, 10, 255, 140, 69, 17, 255, 154, 78, 17, 255, 117, 60, 18, + 255, 17, 13, 8, 142, 0, 12, 21, 14, 8, 190, 28, 18, 9, + 255, 23, 15, 8, 255, 21, 14, 8, 255, 21, 14, 8, 255, 23, + 15, 8, 255, 38, 24, 11, 255, 98, 53, 17, 255, 151, 74, 18, + 255, 150, 76, 17, 255, 141, 75, 16, 255, 21, 15, 6, 170, 0, + 8, 5, 4, 2, 28, 33, 20, 8, 255, 130, 66, 15, 255, 141, + 72, 16, 255, 84, 42, 11, 255, 18, 12, 5, 255, 18, 12, 5, + 176, 14, 10, 5, 235, 57, 29, 10, 255, 140, 72, 17, 255, 165, + 85, 20, 255, 121, 67, 24, 255, 14, 11, 7, 142, 0, 8, 8, + 6, 5, 57, 72, 46, 23, 255, 198, 113, 29, 255, 200, 102, 23, + 255, 131, 68, 22, 255, 33, 21, 12, 255, 17, 13, 8, 255, 21, + 14, 8, 255, 88, 47, 19, 255, 192, 99, 23, 255, 203, 113, 26, + 255, 146, 87, 29, 255, 13, 11, 8, 164, 0, 12, 10, 8, 5, + 85, 13, 10, 6, 170, 11, 9, 6, 142, 7, 6, 4, 28, 0, + 12, 13, 10, 8, 113, 18, 14, 9, 170, 16, 13, 9, 147, 10, + 8, 7, 28, 0, 24, 10, 8, 7, 28, 20, 15, 11, 227, 104, + 62, 21, 255, 184, 94, 21, 255, 117, 62, 22, 255, 17, 12, 8, + 227, 7, 5, 4, 28, 0, 64, 11, 8, 6, 170, 67, 35, 16, + 255, 164, 85, 21, 255, 115, 58, 16, 255, 20, 14, 7, 252, 8, + 6, 5, 85, 0, 24, 9, 7, 4, 82, 66, 37, 13, 255, 145, + 75, 18, 255, 154, 78, 17, 255, 115, 58, 16, 255, 29, 18, 8, + 255, 14, 10, 7, 255, 16, 11, 7, 255, 65, 34, 12, 255, 150, + 74, 19, 255, 189, 97, 22, 255, 138, 79, 27, 255, 14, 12, 9, + 142, 0, 8, 7, 6, 6, 57, 55, 33, 16, 255, 158, 81, 19, + 255, 162, 80, 19, 255, 102, 53, 17, 255, 24, 15, 7, 255, 19, + 12, 6, 170, 14, 10, 5, 204, 46, 26, 9, 255, 137, 67, 16, + 255, 139, 71, 16, 255, 49, 27, 10, 255, 7, 6, 4, 105, 0, + 8, 7, 6, 6, 62, 72, 46, 23, 255, 199, 115, 32, 255, 205, + 111, 28, 255, 155, 84, 26, 255, 41, 24, 14, 255, 18, 13, 9, + 255, 25, 16, 10, 255, 110, 61, 25, 255, 199, 100, 28, 255, 205, + 112, 30, 255, 146, 87, 29, 255, 13, 11, 8, 142, 0, 8, 10, + 8, 7, 147, 180, 87, 25, 255, 206, 111, 27, 255, 203, 105, 26, + 255, 164, 85, 27, 255, 40, 24, 15, 255, 20, 14, 9, 255, 26, + 17, 11, 255, 121, 64, 26, 255, 201, 101, 28, 255, 205, 112, 30, + 255, 146, 87, 29, 255, 14, 11, 7, 142, 0, 8, 8, 6, 5, + 57, 71, 44, 22, 255, 192, 108, 25, 255, 198, 101, 23, 255, 150, + 78, 25, 255, 41, 24, 14, 255, 32, 21, 13, 255, 74, 41, 21, + 255, 184, 105, 27, 255, 202, 104, 25, 255, 202, 118, 27, 255, 174, + 102, 31, 255, 17, 14, 10, 142, 0, 8, 11, 9, 6, 136, 182, + 92, 25, 255, 206, 112, 29, 255, 205, 111, 28, 255, 166, 79, 27, + 255, 43, 25, 16, 255, 21, 15, 10, 255, 29, 19, 12, 255, 116, + 67, 27, 255, 202, 107, 31, 255, 206, 113, 31, 255, 146, 87, 29, + 255, 12, 10, 7, 142, 0, 8, 11, 8, 6, 144, 185, 93, 26, + 255, 202, 103, 23, 255, 157, 77, 18, 255, 83, 42, 12, 255, 19, + 13, 6, 255, 13, 10, 6, 255, 20, 13, 7, 255, 27, 17, 8, + 255, 28, 18, 9, 227, 10, 8, 5, 45, 0, 8, 11, 9, 6, + 142, 139, 73, 20, 255, 198, 96, 21, 255, 199, 106, 24, 255, 155, + 78, 26, 255, 41, 25, 14, 255, 21, 15, 10, 255, 28, 18, 11, + 255, 38, 24, 15, 255, 40, 24, 15, 227, 14, 10, 7, 62, 0, + 8, 8, 7, 5, 57, 65, 41, 20, 255, 197, 108, 28, 255, 205, + 111, 28, 255, 170, 88, 27, 255, 43, 27, 16, 255, 19, 14, 10, + 255, 29, 19, 12, 255, 123, 66, 24, 255, 181, 84, 20, 255, 170, + 87, 19, 255, 114, 60, 17, 255, 11, 10, 6, 142, 0, 8, 11, + 9, 6, 85, 119, 60, 15, 255, 154, 75, 17, 255, 154, 78, 17, + 255, 18, 13, 7, 255, 0, 12, 13, 10, 8, 170, 191, 102, 30, + 255, 209, 118, 30, 255, 207, 113, 30, 255, 28, 19, 11, 201, 0, + 8, 13, 10, 8, 105, 166, 87, 23, 255, 198, 101, 23, 255, 198, + 97, 23, 255, 26, 18, 11, 255, 0, 40, 13, 10, 8, 170, 189, + 100, 28, 255, 206, 111, 27, 255, 204, 102, 27, 255, 28, 20, 11, + 201, 0, 8, 12, 10, 7, 116, 184, 93, 27, 255, 206, 107, 27, + 255, 203, 113, 26, 255, 23, 17, 10, 255, 0, 8, 6, 5, 5, + 28, 25, 18, 12, 244, 192, 105, 27, 255, 206, 112, 29, 255, 207, + 117, 30, 255, 32, 22, 13, 170, 0, 8, 11, 9, 6, 88, 112, + 57, 13, 255, 143, 70, 16, 255, 141, 69, 16, 255, 17, 12, 6, + 227, 0, 32, 14, 11, 9, 170, 184, 92, 25, 255, 206, 111, 27, + 255, 192, 111, 31, 255, 49, 33, 18, 255, 10, 8, 7, 122, 0, + 12, 7, 7, 6, 59, 22, 16, 11, 232, 167, 100, 28, 255, 205, + 112, 30, 255, 205, 116, 30, 255, 26, 18, 11, 210, 0, 8, 8, + 7, 3, 85, 110, 54, 13, 255, 141, 69, 16, 255, 141, 75, 16, + 255, 25, 16, 6, 255, 5, 4, 4, 40, 0, 8, 10, 8, 5, + 85, 112, 55, 13, 255, 141, 75, 16, 255, 141, 75, 16, 255, 20, + 13, 5, 170, 0, 8, 5, 4, 2, 28, 33, 20, 8, 255, 130, + 66, 15, 255, 141, 72, 16, 255, 112, 55, 13, 255, 45, 25, 8, + 255, 26, 17, 6, 255, 33, 20, 8, 255, 94, 47, 13, 255, 141, + 69, 16, 255, 144, 71, 17, 255, 80, 40, 13, 255, 9, 7, 4, + 125, 0, 8, 10, 8, 5, 85, 112, 57, 13, 255, 148, 79, 17, + 255, 141, 75, 16, 255, 87, 42, 12, 255, 19, 13, 6, 255, 14, + 10, 5, 215, 15, 10, 6, 255, 60, 31, 11, 255, 143, 71, 18, + 255, 160, 82, 19, 255, 96, 54, 17, 255, 12, 9, 7, 142, 0, + 8, 8, 6, 5, 57, 71, 44, 22, 255, 192, 100, 25, 255, 199, + 106, 24, 255, 185, 93, 26, 255, 91, 50, 22, 255, 58, 33, 17, + 255, 72, 41, 19, 255, 158, 81, 25, 255, 199, 106, 24, 255, 199, + 106, 24, 255, 138, 79, 27, 255, 13, 11, 8, 142, 0, 8, 10, + 8, 7, 147, 166, 87, 23, 255, 203, 108, 24, 255, 202, 108, 25, + 255, 153, 77, 26, 255, 38, 22, 13, 255, 15, 11, 6, 255, 14, + 10, 5, 255, 52, 28, 9, 255, 132, 70, 15, 255, 141, 75, 16, + 255, 80, 41, 13, 255, 10, 8, 5, 139, 0, 8, 7, 6, 6, + 57, 48, 29, 13, 255, 154, 79, 19, 255, 160, 85, 19, 255, 108, + 56, 17, 255, 30, 18, 9, 255, 16, 11, 7, 255, 24, 15, 9, + 255, 96, 51, 17, 255, 167, 86, 20, 255, 181, 88, 20, 255, 140, + 75, 23, 255, 18, 14, 9, 144, 0, 12, 22, 14, 7, 193, 22, + 13, 7, 255, 20, 13, 7, 255, 78, 40, 15, 255, 165, 81, 20, + 255, 177, 90, 20, 255, 177, 90, 20, 255, 115, 58, 20, 255, 32, + 20, 11, 255, 24, 15, 9, 255, 30, 19, 9, 227, 11, 8, 6, + 54, 0, 8, 11, 9, 6, 142, 139, 68, 20, 255, 166, 78, 19, + 255, 144, 71, 17, 255, 19, 12, 6, 215, 0, 12, 9, 7, 4, + 136, 114, 56, 13, 255, 143, 70, 16, 255, 139, 68, 16, 255, 19, + 13, 6, 170, 0, 8, 10, 7, 5, 85, 112, 55, 13, 255, 143, + 70, 16, 255, 139, 74, 16, 255, 17, 11, 6, 221, 0, 12, 9, + 7, 4, 136, 114, 56, 13, 255, 143, 70, 16, 255, 141, 75, 16, + 255, 20, 13, 5, 170, 0, 8, 9, 6, 4, 85, 110, 54, 13, + 255, 141, 69, 16, 255, 141, 72, 16, 255, 17, 11, 6, 221, 0, + 20, 9, 7, 4, 136, 114, 56, 13, 255, 143, 73, 16, 255, 139, + 74, 16, 255, 19, 13, 6, 170, 0, 8, 8, 6, 3, 85, 110, + 54, 13, 255, 143, 76, 16, 255, 141, 69, 16, 255, 18, 12, 5, + 252, 0, 12, 11, 9, 6, 170, 131, 69, 18, 255, 170, 87, 19, + 255, 168, 86, 19, 255, 28, 19, 9, 170, 0, 8, 11, 8, 6, + 85, 145, 74, 26, 255, 204, 102, 27, 255, 203, 105, 26, 255, 52, + 33, 17, 255, 6, 5, 5, 57, 0, 8, 17, 14, 10, 227, 190, + 107, 25, 255, 204, 113, 25, 255, 174, 86, 27, 255, 18, 13, 9, + 170, 0, 12, 28, 18, 11, 198, 37, 23, 14, 255, 32, 21, 13, + 255, 21, 15, 10, 255, 20, 14, 9, 255, 38, 23, 11, 255, 87, + 44, 12, 255, 137, 70, 16, 255, 141, 72, 16, 255, 143, 70, 16, + 255, 141, 72, 16, 255, 18, 12, 5, 170, 0, 8, 9, 6, 4, + 85, 110, 54, 13, 255, 145, 74, 16, 255, 141, 69, 16, 255, 94, + 47, 13, 255, 27, 17, 8, 227, 12, 8, 5, 28, 0, 8, 14, + 10, 7, 85, 121, 62, 18, 255, 172, 87, 19, 255, 139, 69, 18, + 255, 20, 15, 9, 227, 0, 36, 21, 14, 8, 227, 117, 61, 24, + 255, 199, 100, 28, 255, 205, 106, 26, 255, 204, 110, 27, 255, 26, + 18, 11, 255, 0, 16, 8, 7, 5, 28, 20, 15, 11, 227, 135, + 73, 22, 255, 192, 97, 21, 255, 165, 83, 22, 255, 33, 22, 12, + 255, 10, 9, 7, 85, 0, 68, 11, 9, 6, 170, 184, 97, 27, + 255, 206, 112, 29, 255, 204, 110, 27, 255, 28, 19, 11, 255, 0, + 68, 14, 11, 7, 170, 179, 93, 24, 255, 202, 103, 23, 255, 198, + 97, 23, 255, 22, 15, 9, 255, 0, 132, 9, 7, 6, 170, 125, + 63, 18, 255, 158, 77, 17, 255, 146, 75, 17, 255, 17, 12, 6, + 255, 0, 76, 8, 6, 5, 76, 72, 46, 23, 255, 197, 108, 28, + 255, 201, 107, 24, 255, 164, 85, 27, 255, 37, 22, 14, 227, 13, + 9, 6, 48, 0, 68, 12, 9, 7, 170, 138, 67, 19, 255, 170, + 79, 19, 255, 168, 86, 19, 255, 20, 14, 9, 255, 0, 40, 8, + 7, 5, 20, 21, 15, 10, 184, 26, 17, 11, 255, 26, 17, 11, + 215, 12, 9, 7, 74, 0, 24, 8, 7, 5, 20, 21, 15, 10, + 184, 26, 17, 11, 255, 31, 21, 12, 207, 18, 13, 9, 28, 0, + 8, 11, 9, 8, 156, 184, 93, 27, 255, 208, 105, 29, 255, 205, + 111, 28, 255, 28, 19, 11, 255, 0, 40, 14, 11, 7, 170, 184, + 92, 25, 255, 203, 104, 24, 255, 200, 98, 23, 255, 26, 18, 11, + 255, 0, 255, 0, 189, 8, 7, 5, 57, 51, 29, 12, 255, 152, + 75, 19, 255, 162, 86, 19, 255, 19, 13, 8, 246, 0, 255, 0, + 137, 6, 5, 3, 28, 19, 13, 6, 249, 92, 46, 13, 255, 123, + 63, 14, 255, 78, 39, 11, 255, 21, 15, 6, 227, 9, 8, 4, + 28, 0, 8, 9, 8, 4, 85, 110, 59, 13, 255, 141, 69, 16, + 255, 141, 75, 16, 255, 21, 14, 6, 170, 0, 12, 16, 11, 5, + 170, 52, 28, 9, 255, 115, 59, 14, 255, 116, 60, 15, 255, 43, + 26, 10, 255, 9, 7, 6, 125, 0, 16, 8, 7, 5, 28, 21, + 17, 10, 227, 109, 59, 18, 255, 160, 82, 19, 255, 121, 64, 18, + 255, 62, 34, 13, 255, 94, 53, 17, 255, 149, 78, 20, 255, 102, + 54, 19, 255, 32, 22, 11, 255, 72, 39, 15, 255, 121, 62, 18, + 255, 24, 17, 9, 187, 0, 40, 8, 6, 3, 167, 128, 66, 15, + 255, 161, 85, 17, 255, 159, 81, 18, 255, 24, 15, 7, 178, 0, + 4, 6, 5, 3, 37, 48, 28, 11, 255, 173, 92, 20, 255, 181, + 96, 20, 255, 21, 15, 8, 221, 0, 4, 6, 5, 3, 28, 40, + 24, 9, 255, 143, 74, 18, 255, 158, 80, 17, 255, 21, 15, 6, + 181, 0, 8, 10, 8, 5, 54, 107, 51, 14, 255, 157, 83, 18, + 255, 164, 84, 19, 255, 176, 89, 19, 255, 189, 92, 20, 255, 191, + 98, 22, 255, 190, 106, 23, 255, 197, 110, 26, 255, 203, 108, 24, + 255, 203, 117, 24, 255, 205, 119, 26, 255, 207, 122, 30, 255, 199, + 118, 32, 255, 32, 23, 13, 170, 0, 12, 7, 6, 4, 85, 22, + 15, 7, 232, 113, 54, 14, 255, 146, 75, 17, 255, 158, 80, 17, + 255, 154, 78, 17, 255, 158, 80, 17, 255, 148, 76, 17, 255, 139, + 71, 16, 255, 135, 66, 16, 255, 135, 66, 16, 255, 21, 14, 6, + 136, 0, 8, 10, 8, 5, 85, 128, 66, 15, 255, 161, 85, 17, + 255, 158, 80, 17, 255, 25, 16, 6, 204, 0, 12, 7, 6, 4, + 28, 25, 16, 8, 227, 102, 50, 15, 255, 148, 76, 17, 255, 142, + 73, 17, 255, 84, 45, 13, 255, 10, 8, 5, 113, 0, 8, 9, + 7, 4, 82, 107, 53, 14, 255, 146, 75, 17, 255, 84, 41, 13, + 255, 8, 7, 5, 198, 3, 2, 2, 23, 5, 4, 4, 136, 38, + 23, 9, 255, 136, 70, 17, 255, 140, 72, 17, 255, 21, 15, 6, + 178, 0, 24, 7, 6, 4, 57, 45, 26, 10, 255, 143, 74, 18, + 255, 158, 80, 17, 255, 26, 17, 6, 170, 0, 12, 24, 16, 7, + 227, 115, 58, 16, 255, 148, 76, 17, 255, 46, 26, 9, 255, 7, + 6, 4, 156, 0, 16, 5, 4, 4, 71, 19, 13, 6, 255, 139, + 71, 16, 255, 140, 72, 17, 255, 43, 26, 10, 255, 9, 8, 4, + 85, 0, 16, 14, 10, 5, 85, 109, 52, 14, 255, 38, 23, 9, + 255, 6, 5, 3, 85, 0, 12, 4, 4, 3, 28, 15, 12, 6, + 227, 115, 56, 16, 255, 29, 19, 8, 170, 0, 32, 13, 10, 6, + 113, 122, 64, 21, 255, 164, 85, 21, 255, 138, 71, 17, 255, 21, + 15, 6, 161, 0, 156, 13, 10, 6, 227, 137, 67, 16, 255, 154, + 75, 17, 255, 84, 45, 13, 255, 10, 8, 5, 116, 0, 8, 9, + 7, 4, 85, 111, 55, 14, 255, 158, 87, 17, 255, 158, 80, 17, + 255, 19, 13, 6, 255, 4, 4, 3, 28, 0, 4, 3, 3, 2, + 113, 17, 12, 6, 255, 139, 71, 16, 255, 161, 85, 17, 255, 146, + 75, 17, 255, 20, 14, 7, 210, 0, 16, 16, 13, 9, 110, 184, + 105, 27, 255, 209, 123, 30, 255, 210, 124, 31, 255, 208, 123, 31, + 255, 207, 122, 30, 255, 27, 20, 12, 255, 0, 24, 13, 11, 8, + 147, 143, 75, 20, 255, 161, 85, 17, 255, 158, 80, 17, 255, 27, + 18, 8, 227, 5, 4, 2, 28, 0, 8, 10, 7, 5, 198, 131, + 65, 16, 255, 161, 85, 17, 255, 150, 76, 17, 255, 21, 14, 6, + 170, 0, 8, 10, 8, 5, 85, 123, 61, 16, 255, 163, 83, 18, + 255, 158, 80, 17, 255, 27, 18, 8, 227, 5, 4, 2, 28, 0, + 8, 9, 7, 4, 198, 130, 66, 15, 255, 163, 83, 18, 255, 148, + 76, 17, 255, 21, 14, 6, 193, 0, 28, 7, 6, 4, 85, 22, + 15, 7, 255, 131, 65, 16, 255, 154, 78, 17, 255, 154, 78, 17, + 255, 154, 78, 17, 255, 154, 78, 17, 255, 21, 15, 6, 170, 0, + 8, 10, 8, 5, 85, 129, 64, 16, 255, 163, 86, 18, 255, 180, + 91, 19, 255, 29, 20, 10, 255, 3, 3, 2, 93, 0, 36, 10, + 8, 5, 122, 121, 60, 16, 255, 161, 85, 17, 255, 159, 81, 18, + 255, 24, 15, 7, 255, 4, 4, 3, 34, 0, 4, 2, 2, 1, + 6, 17, 13, 8, 181, 181, 93, 22, 255, 203, 108, 24, 255, 205, + 114, 26, 255, 32, 23, 13, 210, 0, 36, 5, 4, 4, 161, 30, + 22, 13, 255, 198, 116, 29, 255, 206, 106, 25, 255, 191, 96, 20, + 255, 26, 17, 7, 170, 0, 8, 9, 7, 4, 85, 116, 60, 15, + 255, 161, 85, 17, 255, 158, 80, 17, 255, 21, 14, 6, 255, 5, + 4, 2, 28, 0, 4, 2, 2, 1, 3, 12, 9, 7, 215, 190, + 107, 25, 255, 211, 124, 30, 255, 208, 134, 37, 255, 32, 22, 13, + 178, 0, 8, 13, 11, 8, 96, 187, 112, 32, 255, 209, 123, 30, + 255, 191, 96, 20, 255, 28, 19, 9, 255, 4, 3, 3, 74, 0, + 4, 3, 2, 2, 28, 13, 10, 8, 227, 196, 120, 31, 255, 211, + 124, 30, 255, 199, 106, 24, 255, 27, 19, 10, 170, 0, 8, 13, + 10, 6, 57, 114, 61, 19, 255, 178, 91, 21, 255, 182, 102, 23, + 255, 23, 17, 10, 173, 0, 8, 11, 9, 6, 91, 146, 85, 25, + 255, 198, 113, 29, 255, 196, 120, 31, 255, 27, 20, 12, 207, 0, + 20, 5, 5, 4, 28, 21, 17, 12, 227, 190, 118, 33, 255, 209, + 131, 40, 255, 161, 100, 34, 255, 17, 14, 10, 227, 5, 5, 4, + 28, 0, 72, 9, 8, 6, 170, 91, 59, 28, 255, 189, 94, 24, + 255, 162, 83, 19, 255, 39, 25, 12, 255, 7, 7, 6, 85, 0, + 20, 13, 11, 8, 142, 183, 103, 24, 255, 203, 112, 24, 255, 203, + 112, 24, 255, 42, 26, 13, 249, 5, 4, 4, 62, 0, 4, 3, + 2, 2, 25, 12, 9, 7, 227, 195, 115, 30, 255, 212, 127, 35, + 255, 211, 132, 38, 255, 32, 22, 13, 181, 0, 8, 12, 10, 7, + 85, 124, 65, 17, 255, 161, 85, 17, 255, 159, 78, 18, 255, 21, + 14, 6, 255, 5, 4, 2, 28, 0, 8, 7, 6, 4, 224, 133, + 68, 16, 255, 159, 81, 18, 255, 146, 72, 17, 255, 22, 14, 7, + 170, 0, 8, 13, 11, 8, 91, 185, 111, 32, 255, 210, 125, 33, + 255, 205, 114, 26, 255, 37, 26, 14, 255, 4, 4, 3, 85, 0, + 4, 4, 4, 4, 28, 13, 10, 8, 227, 193, 105, 26, 255, 206, + 111, 27, 255, 202, 118, 27, 255, 32, 22, 13, 170, 0, 8, 11, + 9, 6, 127, 174, 91, 23, 255, 202, 102, 21, 255, 200, 105, 21, + 255, 36, 23, 13, 255, 4, 4, 3, 85, 0, 4, 3, 3, 2, + 28, 13, 11, 8, 227, 198, 118, 33, 255, 212, 127, 35, 255, 208, + 128, 33, 255, 31, 22, 12, 181, 0, 8, 13, 11, 8, 91, 185, + 114, 30, 255, 211, 124, 30, 255, 208, 122, 29, 255, 34, 24, 13, + 255, 4, 4, 3, 85, 0, 4, 7, 6, 6, 113, 32, 24, 13, + 255, 185, 95, 22, 255, 202, 98, 21, 255, 198, 97, 23, 255, 33, + 22, 12, 170, 0, 8, 10, 8, 7, 156, 190, 108, 27, 255, 212, + 126, 33, 255, 211, 127, 36, 255, 40, 26, 15, 255, 4, 4, 3, + 85, 0, 4, 3, 3, 2, 28, 13, 11, 8, 227, 198, 118, 33, + 255, 214, 129, 37, 255, 211, 132, 38, 255, 32, 23, 13, 173, 0, + 8, 10, 8, 7, 144, 167, 87, 22, 255, 185, 94, 20, 255, 165, + 87, 18, 255, 25, 17, 8, 255, 3, 3, 2, 57, 0, 28, 13, + 11, 8, 170, 195, 112, 30, 255, 210, 125, 33, 255, 208, 117, 29, + 255, 39, 26, 14, 255, 4, 4, 3, 85, 0, 28, 12, 10, 7, + 150, 184, 108, 27, 255, 211, 124, 30, 255, 211, 127, 36, 255, 40, + 27, 15, 255, 4, 4, 3, 85, 0, 4, 3, 3, 2, 28, 17, + 13, 8, 178, 138, 71, 17, 255, 161, 85, 17, 255, 155, 79, 18, + 255, 21, 14, 6, 170, 0, 8, 10, 8, 5, 85, 124, 61, 15, + 255, 169, 89, 18, 255, 180, 91, 19, 255, 25, 18, 10, 255, 0, + 12, 13, 11, 8, 170, 196, 113, 31, 255, 211, 124, 30, 255, 205, + 119, 26, 255, 26, 18, 11, 204, 0, 8, 11, 9, 6, 88, 134, + 70, 19, 255, 173, 87, 18, 255, 168, 86, 19, 255, 20, 13, 7, + 255, 0, 40, 13, 11, 8, 170, 196, 113, 31, 255, 210, 125, 33, + 255, 207, 122, 30, 255, 24, 18, 11, 212, 0, 8, 11, 9, 6, + 119, 180, 93, 23, 255, 203, 108, 24, 255, 202, 103, 23, 255, 20, + 15, 9, 255, 0, 8, 15, 13, 10, 195, 101, 63, 26, 255, 202, + 117, 25, 255, 206, 128, 35, 255, 160, 106, 35, 255, 15, 13, 10, + 142, 0, 8, 10, 8, 5, 147, 139, 70, 20, 255, 191, 96, 20, + 255, 200, 105, 21, 255, 25, 18, 10, 255, 0, 32, 13, 10, 8, + 170, 189, 99, 26, 255, 206, 115, 27, 255, 205, 106, 26, 255, 185, + 106, 28, 255, 79, 52, 26, 255, 10, 9, 7, 122, 0, 4, 7, + 6, 6, 42, 36, 27, 17, 244, 172, 106, 35, 255, 207, 128, 34, + 255, 211, 126, 34, 255, 211, 127, 36, 255, 24, 18, 11, 227, 0, + 8, 10, 8, 5, 85, 124, 64, 15, 255, 159, 81, 18, 255, 158, + 80, 17, 255, 76, 40, 13, 255, 11, 8, 6, 210, 0, 8, 12, + 9, 5, 85, 129, 64, 16, 255, 161, 85, 17, 255, 158, 80, 17, + 255, 26, 16, 7, 170, 0, 8, 9, 7, 4, 85, 115, 56, 16, + 255, 161, 85, 17, 255, 159, 81, 18, 255, 49, 27, 10, 255, 7, + 6, 4, 170, 5, 4, 4, 85, 6, 5, 3, 113, 26, 19, 11, + 255, 185, 95, 22, 255, 202, 102, 21, 255, 197, 104, 22, 255, 28, + 20, 11, 173, 0, 8, 13, 10, 6, 102, 167, 87, 22, 255, 200, + 101, 21, 255, 201, 102, 22, 255, 32, 21, 11, 255, 4, 3, 3, + 65, 0, 4, 2, 2, 1, 17, 12, 10, 7, 221, 190, 98, 23, + 255, 208, 116, 27, 255, 204, 110, 27, 255, 30, 21, 11, 181, 0, + 8, 13, 11, 8, 91, 185, 114, 30, 255, 211, 124, 30, 255, 209, + 123, 30, 255, 86, 55, 25, 255, 9, 8, 6, 187, 6, 6, 5, + 85, 7, 6, 6, 130, 32, 24, 15, 255, 200, 122, 31, 255, 209, + 123, 30, 255, 206, 122, 31, 255, 32, 23, 13, 173, 0, 8, 10, + 8, 7, 144, 191, 113, 30, 255, 212, 127, 35, 255, 210, 126, 35, + 255, 40, 27, 15, 255, 4, 4, 3, 85, 0, 4, 2, 2, 1, + 8, 11, 9, 6, 212, 157, 81, 20, 255, 189, 92, 20, 255, 190, + 97, 21, 255, 27, 19, 10, 178, 0, 8, 12, 10, 7, 96, 183, + 105, 28, 255, 209, 123, 30, 255, 205, 114, 26, 255, 36, 24, 13, + 255, 4, 4, 3, 85, 0, 4, 4, 4, 4, 28, 18, 14, 9, + 187, 195, 115, 30, 255, 211, 124, 30, 255, 210, 130, 35, 255, 35, + 26, 14, 210, 0, 20, 3, 2, 2, 28, 12, 10, 7, 227, 195, + 115, 30, 255, 211, 124, 30, 255, 209, 123, 30, 255, 38, 25, 15, + 255, 4, 4, 3, 85, 0, 20, 13, 11, 8, 170, 194, 115, 31, + 255, 209, 122, 28, 255, 196, 99, 21, 255, 21, 15, 8, 255, 0, + 12, 11, 9, 6, 170, 153, 79, 20, 255, 187, 91, 20, 255, 181, + 96, 20, 255, 30, 20, 9, 178, 0, 8, 13, 10, 6, 96, 151, + 79, 20, 255, 187, 91, 20, 255, 181, 96, 20, 255, 22, 16, 9, + 255, 0, 12, 12, 9, 7, 170, 146, 76, 19, 255, 167, 88, 18, + 255, 158, 77, 17, 255, 23, 15, 6, 170, 0, 8, 10, 8, 5, + 85, 133, 66, 16, 255, 167, 88, 18, 255, 168, 86, 19, 255, 22, + 16, 9, 255, 0, 20, 12, 9, 7, 170, 155, 80, 20, 255, 185, + 94, 20, 255, 181, 96, 20, 255, 22, 16, 9, 221, 0, 8, 6, + 6, 5, 42, 51, 29, 12, 255, 150, 81, 19, 255, 165, 87, 18, + 255, 42, 26, 11, 255, 5, 5, 4, 108, 0, 4, 5, 5, 4, + 28, 18, 15, 11, 255, 195, 114, 28, 255, 207, 123, 32, 255, 158, + 94, 31, 255, 17, 13, 10, 142, 0, 8, 6, 5, 5, 57, 50, + 34, 19, 255, 191, 111, 32, 255, 208, 117, 29, 255, 113, 73, 30, + 255, 10, 10, 9, 227, 6, 6, 5, 125, 7, 7, 6, 198, 42, + 29, 17, 255, 187, 96, 22, 255, 166, 87, 23, 255, 42, 27, 15, + 255, 8, 6, 5, 110, 0, 32, 5, 5, 4, 184, 21, 16, 8, + 255, 106, 54, 15, 255, 154, 78, 17, 255, 151, 77, 18, 255, 92, + 48, 15, 255, 11, 9, 6, 119, 0, 8, 10, 8, 5, 93, 131, + 69, 18, 255, 189, 92, 20, 255, 200, 105, 21, 255, 33, 22, 12, + 255, 5, 4, 4, 54, 0, 12, 9, 8, 6, 85, 76, 53, 25, + 255, 200, 118, 31, 255, 204, 114, 27, 255, 65, 43, 22, 255, 6, + 6, 5, 113, 0, 32, 4, 3, 3, 17, 14, 11, 9, 227, 195, + 111, 28, 255, 206, 115, 27, 255, 204, 105, 25, 255, 24, 17, 11, + 255, 0, 12, 5, 5, 4, 28, 13, 10, 6, 227, 125, 66, 18, + 255, 165, 84, 18, 255, 161, 85, 17, 255, 161, 85, 17, 255, 155, + 79, 18, 255, 28, 19, 9, 255, 6, 5, 3, 85, 0, 64, 11, + 9, 8, 68, 86, 56, 27, 255, 204, 126, 33, 255, 210, 125, 33, + 255, 30, 21, 13, 255, 0, 68, 13, 11, 8, 170, 195, 115, 30, + 255, 209, 123, 30, 255, 207, 122, 30, 255, 27, 19, 12, 255, 3, + 3, 2, 28, 0, 128, 7, 6, 4, 184, 131, 65, 16, 255, 161, + 85, 17, 255, 154, 78, 17, 255, 15, 11, 6, 249, 0, 76, 10, + 8, 7, 173, 166, 87, 23, 255, 198, 104, 21, 255, 196, 99, 21, + 255, 35, 23, 12, 255, 3, 3, 2, 85, 0, 72, 13, 11, 8, + 170, 194, 115, 31, 255, 211, 124, 30, 255, 207, 122, 30, 255, 27, + 19, 12, 255, 3, 3, 2, 28, 0, 108, 13, 11, 8, 170, 196, + 113, 31, 255, 213, 132, 36, 255, 211, 127, 36, 255, 30, 21, 13, + 255, 0, 40, 11, 9, 6, 170, 155, 80, 20, 255, 185, 94, 20, + 255, 180, 91, 19, 255, 21, 15, 8, 255, 0, 255, 0, 189, 10, + 8, 7, 184, 183, 100, 26, 255, 208, 116, 27, 255, 204, 114, 27, + 255, 26, 18, 11, 255, 4, 4, 4, 28, 0, 255, 0, 133, 10, + 8, 5, 127, 119, 60, 15, 255, 160, 85, 19, 255, 91, 48, 16, + 255, 10, 8, 5, 227, 4, 4, 3, 28, 0, 12, 9, 7, 4, + 161, 131, 67, 16, 255, 159, 81, 18, 255, 159, 78, 18, 255, 18, + 13, 7, 249, 0, 16, 7, 6, 4, 170, 57, 34, 14, 255, 176, + 90, 21, 255, 195, 95, 22, 255, 26, 19, 11, 232, 0, 16, 17, + 14, 10, 99, 179, 106, 28, 255, 207, 122, 30, 255, 180, 109, 33, + 255, 25, 20, 12, 255, 7, 6, 6, 170, 20, 17, 11, 255, 196, + 114, 27, 255, 208, 117, 29, 255, 203, 124, 30, 255, 172, 106, 35, + 255, 53, 36, 20, 255, 10, 9, 7, 108, 0, 40, 9, 8, 6, + 170, 159, 82, 20, 255, 202, 103, 23, 255, 206, 111, 27, 255, 22, + 17, 11, 255, 0, 8, 10, 9, 7, 139, 115, 74, 30, 255, 213, + 133, 48, 255, 39, 28, 16, 255, 0, 8, 9, 8, 4, 113, 67, + 39, 14, 255, 181, 92, 20, 255, 24, 18, 9, 255, 0, 12, 28, + 19, 9, 227, 139, 79, 26, 255, 206, 117, 31, 255, 212, 123, 37, + 255, 214, 126, 41, 255, 172, 106, 35, 255, 53, 34, 18, 255, 122, + 78, 31, 255, 211, 127, 44, 255, 217, 136, 50, 255, 216, 135, 49, + 255, 190, 122, 41, 255, 65, 43, 22, 255, 14, 11, 7, 85, 0, + 8, 7, 6, 4, 28, 29, 21, 10, 249, 153, 79, 20, 255, 174, + 85, 19, 255, 103, 53, 16, 255, 17, 12, 6, 244, 19, 13, 6, + 170, 21, 14, 6, 170, 27, 17, 6, 170, 21, 14, 6, 212, 21, + 14, 6, 255, 25, 17, 6, 224, 12, 9, 5, 45, 0, 12, 24, + 16, 7, 153, 22, 15, 7, 255, 26, 16, 7, 210, 12, 9, 5, + 40, 0, 8, 8, 7, 5, 28, 17, 13, 8, 227, 114, 61, 19, + 255, 174, 85, 19, 255, 154, 79, 19, 255, 60, 33, 13, 255, 11, + 9, 6, 170, 0, 12, 10, 8, 5, 170, 146, 79, 19, 255, 180, + 87, 19, 255, 67, 39, 14, 255, 8, 6, 5, 85, 0, 8, 24, + 17, 9, 255, 143, 75, 20, 255, 162, 80, 19, 255, 22, 15, 7, + 215, 0, 28, 8, 7, 5, 110, 60, 33, 13, 255, 166, 78, 19, + 255, 22, 15, 7, 227, 0, 8, 7, 6, 4, 85, 91, 51, 16, + 255, 174, 88, 19, 255, 169, 78, 18, 255, 25, 17, 8, 255, 3, + 3, 2, 8, 0, 20, 11, 9, 6, 178, 143, 74, 18, 255, 177, + 89, 18, 255, 138, 75, 19, 255, 18, 13, 7, 176, 0, 16, 9, + 7, 4, 28, 29, 19, 8, 232, 41, 25, 10, 255, 17, 13, 8, + 255, 9, 8, 6, 116, 0, 4, 7, 6, 4, 59, 14, 11, 7, + 227, 32, 21, 9, 255, 40, 24, 9, 255, 12, 9, 5, 105, 0, + 32, 14, 11, 9, 170, 199, 124, 36, 255, 213, 119, 36, 255, 202, + 102, 21, 255, 20, 14, 7, 246, 0, 152, 8, 7, 5, 142, 53, + 31, 12, 255, 162, 86, 19, 255, 121, 64, 18, 255, 19, 14, 8, + 252, 6, 5, 3, 28, 0, 8, 10, 8, 5, 125, 142, 74, 19, + 255, 180, 91, 19, 255, 183, 89, 19, 255, 19, 14, 8, 255, 0, + 4, 5, 5, 4, 6, 15, 13, 10, 193, 69, 42, 18, 255, 171, + 91, 20, 255, 189, 88, 20, 255, 200, 101, 21, 255, 31, 21, 12, + 255, 0, 16, 10, 8, 7, 28, 30, 21, 13, 227, 150, 92, 35, + 255, 208, 121, 37, 255, 211, 115, 30, 255, 208, 117, 29, 255, 28, + 21, 13, 255, 0, 24, 10, 8, 7, 28, 22, 15, 7, 198, 26, + 17, 7, 255, 24, 15, 7, 221, 9, 7, 4, 57, 0, 12, 8, + 7, 5, 156, 171, 89, 22, 255, 202, 107, 23, 255, 202, 103, 23, + 255, 23, 18, 10, 249, 0, 12, 26, 18, 9, 198, 29, 19, 8, + 255, 24, 16, 7, 215, 10, 8, 5, 51, 0, 12, 10, 8, 5, + 85, 134, 70, 19, 255, 175, 88, 18, 255, 173, 87, 18, 255, 20, + 14, 7, 255, 0, 24, 10, 8, 5, 85, 26, 19, 9, 255, 107, + 58, 18, 255, 154, 83, 19, 255, 168, 79, 19, 255, 169, 78, 18, + 255, 173, 87, 18, 255, 172, 80, 19, 255, 26, 17, 7, 170, 0, + 8, 11, 10, 8, 136, 189, 99, 26, 255, 210, 115, 31, 255, 216, + 129, 45, 255, 143, 96, 40, 255, 15, 13, 10, 227, 12, 12, 11, + 170, 15, 13, 12, 170, 13, 12, 10, 170, 13, 12, 10, 136, 9, + 8, 8, 85, 0, 16, 11, 9, 6, 170, 169, 91, 22, 255, 202, + 103, 23, 255, 203, 108, 24, 255, 18, 15, 9, 255, 0, 12, 6, + 5, 5, 23, 28, 19, 11, 156, 31, 22, 12, 255, 34, 24, 13, + 227, 14, 11, 7, 85, 0, 36, 9, 8, 8, 142, 72, 54, 31, + 255, 215, 147, 60, 255, 218, 146, 61, 255, 174, 100, 35, 255, 14, + 11, 7, 142, 0, 8, 11, 8, 6, 102, 142, 74, 19, 255, 185, + 86, 20, 255, 195, 98, 20, 255, 18, 14, 9, 249, 0, 12, 10, + 8, 7, 170, 202, 131, 47, 255, 220, 152, 63, 255, 220, 151, 61, + 255, 22, 19, 13, 252, 0, 8, 11, 9, 8, 167, 203, 135, 46, + 255, 217, 139, 48, 255, 210, 120, 33, 255, 18, 14, 9, 255, 0, + 12, 9, 8, 6, 170, 198, 117, 37, 255, 211, 115, 30, 255, 202, + 102, 21, 255, 34, 22, 11, 176, 0, 8, 13, 11, 8, 170, 202, + 122, 37, 255, 218, 144, 49, 255, 217, 144, 50, 255, 28, 21, 13, + 255, 0, 8, 12, 11, 9, 170, 204, 122, 41, 255, 217, 135, 46, + 255, 215, 136, 42, 255, 46, 33, 19, 255, 0, 16, 10, 9, 7, + 28, 21, 19, 14, 227, 153, 104, 46, 255, 214, 149, 55, 255, 158, + 103, 39, 255, 16, 14, 11, 221, 7, 6, 6, 28, 0, 20, 20, + 18, 13, 142, 31, 26, 18, 170, 25, 21, 16, 170, 24, 20, 15, + 170, 24, 20, 15, 170, 24, 20, 15, 170, 24, 21, 15, 170, 31, + 26, 18, 170, 25, 21, 16, 170, 14, 12, 9, 31, 0, 20, 10, + 9, 7, 167, 75, 51, 26, 255, 202, 117, 33, 255, 186, 120, 43, + 255, 41, 32, 20, 255, 12, 11, 9, 85, 0, 16, 11, 9, 8, + 28, 31, 22, 12, 215, 49, 33, 18, 255, 41, 27, 16, 227, 12, + 10, 7, 85, 0, 12, 14, 12, 9, 170, 204, 137, 51, 255, 220, + 152, 63, 255, 220, 151, 61, 255, 23, 19, 12, 252, 0, 8, 11, + 10, 6, 85, 136, 70, 17, 255, 175, 88, 18, 255, 169, 78, 18, + 255, 15, 11, 6, 255, 0, 8, 9, 8, 6, 85, 26, 19, 9, + 255, 153, 82, 18, 255, 177, 89, 18, 255, 180, 84, 19, 255, 24, + 17, 9, 218, 0, 8, 11, 9, 8, 147, 196, 115, 35, 255, 215, + 125, 38, 255, 214, 125, 39, 255, 20, 16, 11, 255, 0, 12, 9, + 8, 6, 159, 165, 86, 22, 255, 197, 99, 20, 255, 195, 90, 20, + 255, 32, 21, 11, 170, 0, 8, 12, 10, 7, 85, 145, 76, 20, + 255, 189, 92, 20, 255, 191, 96, 20, 255, 18, 14, 9, 255, 0, + 12, 9, 8, 6, 170, 199, 126, 39, 255, 217, 133, 50, 255, 217, + 144, 50, 255, 23, 18, 12, 252, 0, 8, 11, 10, 8, 142, 191, + 105, 28, 255, 206, 111, 27, 255, 203, 104, 24, 255, 19, 15, 10, + 255, 0, 12, 9, 8, 6, 57, 21, 15, 8, 198, 28, 19, 9, + 255, 32, 21, 11, 227, 11, 9, 6, 76, 0, 8, 11, 9, 8, + 170, 203, 125, 42, 255, 220, 146, 59, 255, 219, 146, 60, 255, 24, + 19, 13, 255, 0, 12, 11, 10, 8, 170, 204, 136, 47, 255, 220, + 146, 59, 255, 218, 147, 55, 255, 25, 19, 12, 232, 0, 8, 11, + 10, 8, 119, 161, 87, 22, 255, 195, 98, 20, 255, 202, 103, 23, + 255, 18, 15, 9, 255, 0, 32, 14, 12, 9, 170, 200, 125, 37, + 255, 214, 124, 37, 255, 205, 106, 26, 255, 20, 16, 9, 221, 0, + 32, 16, 13, 9, 170, 205, 130, 42, 255, 219, 144, 56, 255, 219, + 146, 60, 255, 24, 19, 13, 255, 0, 12, 6, 5, 3, 23, 21, + 14, 6, 170, 26, 16, 7, 255, 26, 17, 7, 224, 14, 10, 5, + 31, 0, 8, 11, 9, 6, 125, 170, 89, 23, 255, 211, 115, 30, + 255, 214, 126, 41, 255, 23, 19, 12, 255, 0, 12, 11, 10, 8, + 170, 195, 112, 30, 255, 206, 106, 25, 255, 200, 105, 21, 255, 29, + 20, 10, 170, 0, 8, 11, 9, 6, 85, 134, 70, 19, 255, 177, + 85, 18, 255, 172, 80, 19, 255, 18, 13, 7, 255, 0, 40, 14, + 12, 9, 170, 195, 112, 30, 255, 206, 111, 27, 255, 202, 103, 23, + 255, 31, 22, 10, 170, 0, 8, 13, 10, 6, 85, 151, 79, 20, + 255, 189, 92, 20, 255, 183, 89, 19, 255, 17, 13, 8, 255, 0, + 4, 8, 7, 5, 59, 57, 34, 16, 255, 184, 97, 27, 255, 198, + 115, 33, 255, 114, 77, 33, 255, 16, 14, 11, 210, 6, 5, 5, + 8, 0, 8, 12, 10, 7, 170, 195, 113, 32, 255, 215, 123, 42, + 255, 217, 133, 50, 255, 32, 24, 15, 255, 0, 32, 12, 11, 7, + 170, 175, 90, 22, 255, 198, 104, 21, 255, 189, 92, 20, 255, 192, + 97, 21, 255, 189, 97, 22, 255, 45, 29, 14, 255, 10, 9, 7, + 210, 22, 17, 11, 255, 183, 102, 30, 255, 212, 121, 41, 255, 216, + 135, 49, 255, 217, 137, 52, 255, 214, 125, 39, 255, 29, 21, 12, + 204, 0, 8, 11, 9, 6, 85, 143, 75, 20, 255, 193, 97, 20, + 255, 195, 98, 20, 255, 180, 93, 23, 255, 88, 54, 23, 255, 11, + 10, 8, 113, 0, 4, 14, 12, 7, 85, 170, 89, 23, 255, 202, + 103, 23, 255, 202, 102, 21, 255, 32, 22, 11, 178, 0, 8, 12, + 10, 7, 113, 176, 91, 23, 255, 205, 105, 24, 255, 209, 117, 28, + 255, 39, 28, 16, 255, 5, 5, 5, 28, 0, 8, 15, 14, 10, + 198, 206, 132, 45, 255, 217, 133, 50, 255, 215, 133, 44, 255, 25, + 19, 12, 232, 0, 8, 11, 10, 8, 125, 198, 118, 39, 255, 218, + 145, 51, 255, 218, 146, 53, 255, 20, 17, 11, 255, 0, 12, 9, + 8, 6, 170, 198, 124, 37, 255, 216, 134, 45, 255, 214, 139, 41, + 255, 22, 18, 11, 255, 0, 8, 11, 10, 8, 136, 191, 105, 28, + 255, 206, 111, 27, 255, 206, 106, 25, 255, 36, 26, 15, 255, 5, + 5, 4, 28, 0, 8, 15, 13, 10, 198, 192, 105, 27, 255, 206, + 106, 25, 255, 204, 105, 25, 255, 23, 17, 10, 232, 0, 8, 12, + 10, 7, 125, 196, 119, 37, 255, 218, 141, 51, 255, 218, 139, 55, + 255, 20, 16, 11, 255, 0, 12, 9, 8, 6, 170, 196, 110, 33, + 255, 215, 126, 40, 255, 214, 125, 39, 255, 23, 18, 12, 252, 0, + 8, 11, 9, 8, 167, 201, 123, 40, 255, 217, 133, 50, 255, 214, + 136, 43, 255, 20, 16, 11, 255, 0, 12, 6, 5, 5, 23, 29, + 21, 12, 153, 32, 22, 13, 255, 35, 25, 14, 227, 15, 12, 8, + 85, 0, 24, 12, 10, 9, 170, 198, 124, 37, 255, 215, 125, 38, + 255, 213, 124, 38, 255, 23, 18, 12, 255, 0, 24, 14, 12, 9, + 170, 204, 132, 47, 255, 219, 144, 56, 255, 211, 127, 36, 255, 28, + 21, 13, 255, 0, 12, 14, 12, 9, 170, 198, 117, 37, 255, 215, + 123, 42, 255, 214, 125, 39, 255, 25, 20, 12, 215, 0, 8, 11, + 10, 8, 130, 198, 119, 35, 255, 215, 126, 40, 255, 212, 123, 37, + 255, 30, 22, 13, 255, 0, 12, 14, 12, 9, 170, 196, 114, 33, + 255, 206, 106, 25, 255, 200, 105, 21, 255, 30, 21, 11, 184, 0, + 8, 13, 11, 8, 99, 184, 100, 25, 255, 209, 117, 28, 255, 210, + 115, 31, 255, 28, 21, 13, 255, 0, 20, 14, 12, 9, 170, 198, + 117, 37, 255, 215, 126, 40, 255, 214, 126, 41, 255, 25, 19, 12, + 255, 0, 12, 10, 9, 7, 125, 61, 42, 22, 255, 190, 107, 33, + 255, 153, 98, 38, 255, 29, 23, 16, 255, 13, 12, 10, 255, 17, + 15, 10, 255, 108, 74, 37, 255, 210, 144, 59, 255, 153, 98, 38, + 255, 16, 14, 11, 224, 6, 6, 5, 17, 0, 12, 15, 13, 8, + 227, 115, 67, 24, 255, 197, 100, 22, 255, 150, 81, 25, 255, 32, + 24, 13, 255, 15, 13, 8, 255, 19, 15, 10, 255, 85, 48, 18, + 255, 178, 95, 21, 255, 115, 65, 20, 255, 15, 12, 8, 255, 5, + 5, 4, 34, 0, 32, 10, 9, 7, 198, 69, 46, 22, 255, 186, + 103, 29, 255, 195, 111, 28, 255, 92, 58, 25, 255, 15, 12, 8, + 198, 0, 12, 10, 9, 7, 170, 194, 112, 31, 255, 215, 125, 38, + 255, 218, 146, 53, 255, 24, 19, 13, 255, 0, 20, 15, 14, 10, + 227, 159, 103, 42, 255, 212, 127, 43, 255, 177, 118, 48, 255, 19, + 17, 12, 227, 6, 6, 5, 28, 0, 32, 11, 10, 8, 170, 182, + 98, 23, 255, 202, 106, 21, 255, 195, 98, 20, 255, 24, 17, 9, + 212, 0, 12, 18, 14, 9, 227, 102, 54, 19, 255, 157, 83, 18, + 255, 85, 46, 14, 255, 19, 13, 6, 255, 47, 27, 10, 255, 150, + 81, 19, 255, 131, 67, 20, 255, 39, 26, 14, 255, 12, 11, 9, + 85, 0, 64, 10, 9, 7, 170, 118, 75, 33, 255, 215, 141, 54, + 255, 44, 33, 19, 255, 0, 16, 9, 9, 8, 108, 19, 17, 12, + 170, 27, 23, 16, 170, 23, 21, 16, 170, 23, 21, 16, 170, 24, + 20, 15, 170, 20, 18, 13, 170, 15, 14, 10, 170, 10, 9, 7, + 113, 7, 6, 6, 28, 0, 12, 12, 11, 9, 170, 189, 99, 26, + 255, 209, 110, 30, 255, 211, 118, 36, 255, 141, 88, 36, 255, 19, + 17, 12, 227, 20, 18, 13, 170, 24, 20, 15, 170, 21, 19, 14, + 170, 16, 14, 11, 170, 10, 9, 7, 113, 6, 6, 5, 28, 0, + 20, 8, 7, 5, 65, 11, 10, 8, 142, 16, 14, 11, 170, 24, + 21, 15, 170, 25, 22, 16, 170, 23, 21, 16, 170, 21, 19, 14, + 170, 16, 14, 11, 170, 11, 10, 8, 113, 7, 7, 6, 28, 0, + 20, 8, 7, 5, 62, 10, 9, 5, 136, 12, 10, 7, 170, 14, + 11, 7, 170, 13, 10, 6, 170, 11, 9, 6, 198, 31, 21, 10, + 255, 153, 82, 18, 255, 177, 85, 18, 255, 169, 78, 18, 255, 22, + 15, 7, 204, 0, 16, 8, 7, 5, 57, 11, 10, 6, 142, 19, + 17, 12, 170, 23, 21, 16, 170, 25, 22, 16, 170, 23, 21, 16, + 170, 21, 19, 14, 170, 15, 14, 10, 170, 10, 10, 9, 113, 7, + 6, 6, 28, 0, 16, 12, 10, 7, 153, 55, 32, 14, 255, 175, + 93, 20, 255, 185, 94, 20, 255, 183, 89, 19, 255, 80, 44, 17, + 255, 13, 11, 8, 187, 7, 6, 6, 25, 0, 16, 8, 7, 5, + 62, 11, 10, 6, 142, 16, 14, 11, 170, 23, 19, 14, 170, 25, + 22, 16, 170, 23, 21, 16, 170, 19, 17, 12, 170, 15, 14, 10, + 170, 17, 15, 10, 170, 19, 17, 12, 142, 9, 8, 8, 28, 0, + 8, 12, 10, 9, 170, 204, 137, 49, 255, 220, 146, 59, 255, 218, + 146, 53, 255, 141, 91, 38, 255, 19, 17, 12, 227, 19, 17, 12, + 170, 24, 20, 15, 170, 21, 19, 14, 170, 15, 14, 10, 170, 10, + 10, 9, 113, 7, 6, 6, 28, 0, 16, 12, 10, 7, 57, 14, + 12, 7, 102, 14, 11, 7, 85, 0, 32, 12, 10, 7, 57, 13, + 11, 8, 105, 15, 13, 8, 85, 0, 12, 12, 11, 9, 170, 204, + 136, 47, 255, 220, 146, 59, 255, 218, 153, 59, 255, 24, 19, 13, + 255, 0, 12, 8, 7, 5, 82, 11, 10, 6, 156, 11, 9, 6, + 170, 10, 9, 7, 91, 0, 12, 10, 8, 5, 127, 144, 78, 19, + 255, 180, 87, 19, 255, 174, 81, 19, 255, 24, 15, 7, 210, 0, + 12, 14, 11, 7, 68, 12, 10, 7, 170, 12, 10, 7, 170, 17, + 15, 10, 170, 24, 20, 15, 170, 19, 17, 12, 170, 15, 14, 10, + 170, 18, 15, 11, 170, 24, 21, 15, 170, 21, 19, 14, 170, 15, + 14, 10, 170, 11, 10, 8, 113, 7, 7, 6, 28, 0, 16, 15, + 13, 10, 119, 17, 15, 12, 170, 15, 13, 10, 170, 16, 14, 11, + 170, 19, 17, 12, 170, 21, 18, 12, 170, 18, 15, 11, 170, 15, + 13, 8, 170, 11, 9, 6, 170, 10, 8, 7, 88, 6, 5, 5, + 23, 0, 20, 10, 9, 7, 85, 14, 12, 9, 170, 19, 17, 12, + 170, 21, 19, 14, 170, 21, 19, 14, 170, 21, 19, 14, 170, 19, + 17, 12, 170, 15, 14, 10, 170, 11, 10, 8, 116, 7, 7, 6, + 28, 0, 16, 15, 14, 10, 119, 18, 15, 11, 170, 15, 14, 10, + 170, 18, 15, 11, 170, 21, 19, 14, 170, 25, 22, 16, 170, 23, + 21, 16, 170, 21, 19, 14, 170, 16, 14, 11, 170, 11, 10, 8, + 113, 7, 7, 6, 28, 0, 20, 10, 9, 7, 85, 14, 12, 9, + 170, 19, 17, 12, 170, 20, 18, 13, 170, 20, 18, 13, 170, 23, + 19, 14, 170, 19, 17, 12, 170, 15, 14, 10, 170, 17, 14, 10, + 170, 19, 17, 12, 142, 10, 9, 7, 28, 0, 12, 15, 13, 10, + 113, 18, 15, 11, 170, 15, 14, 10, 170, 18, 15, 11, 170, 21, + 19, 14, 170, 25, 22, 16, 170, 23, 21, 16, 170, 20, 18, 13, + 170, 16, 14, 11, 170, 11, 10, 8, 113, 7, 7, 6, 28, 0, + 20, 7, 7, 6, 82, 11, 10, 6, 142, 16, 13, 9, 170, 19, + 17, 12, 170, 21, 19, 14, 170, 24, 21, 15, 170, 25, 22, 16, + 170, 25, 22, 16, 170, 15, 13, 10, 170, 12, 11, 9, 57, 0, + 16, 15, 13, 10, 170, 97, 65, 34, 255, 209, 132, 42, 255, 214, + 136, 43, 255, 214, 127, 43, 255, 159, 103, 42, 255, 21, 19, 14, + 227, 11, 10, 8, 28, 0, 12, 16, 14, 11, 113, 21, 19, 14, + 170, 18, 15, 11, 153, 11, 10, 8, 28, 0, 16, 15, 14, 10, + 125, 21, 19, 14, 170, 19, 17, 12, 142, 10, 9, 7, 28, 0, + 12, 15, 14, 10, 113, 21, 19, 14, 170, 18, 16, 11, 153, 11, + 10, 8, 28, 0, 16, 15, 13, 10, 125, 21, 19, 14, 170, 19, + 17, 12, 142, 10, 9, 7, 28, 0, 12, 15, 14, 10, 113, 21, + 19, 14, 170, 18, 16, 11, 153, 11, 10, 8, 28, 0, 24, 15, + 14, 10, 125, 21, 19, 14, 170, 19, 17, 12, 142, 9, 9, 8, + 28, 0, 12, 17, 14, 10, 130, 27, 24, 16, 170, 21, 19, 14, + 142, 10, 9, 7, 28, 0, 16, 16, 14, 11, 113, 28, 24, 17, + 170, 24, 21, 15, 161, 12, 11, 9, 28, 0, 12, 16, 14, 11, + 113, 21, 19, 14, 170, 18, 15, 11, 153, 11, 10, 8, 28, 0, + 16, 15, 13, 10, 125, 21, 19, 14, 170, 19, 17, 12, 142, 9, + 8, 6, 28, 0, 12, 18, 15, 11, 136, 19, 16, 10, 170, 16, + 13, 9, 170, 16, 14, 9, 170, 15, 13, 8, 170, 13, 11, 8, + 170, 12, 11, 9, 170, 13, 12, 8, 170, 15, 14, 10, 170, 14, + 13, 11, 170, 11, 11, 10, 113, 0, 20, 13, 11, 8, 170, 190, + 98, 23, 255, 204, 116, 31, 255, 74, 52, 27, 255, 9, 8, 8, + 113, 0, 16, 13, 11, 8, 170, 192, 106, 29, 255, 208, 112, 27, + 255, 208, 117, 29, 255, 27, 21, 12, 255, 0, 16, 5, 5, 4, + 28, 27, 23, 16, 255, 199, 121, 44, 255, 214, 139, 41, 255, 31, + 23, 14, 255, 0, 16, 13, 11, 8, 28, 32, 24, 13, 227, 36, + 26, 15, 255, 19, 16, 12, 198, 8, 8, 7, 51, 0, 4, 8, + 8, 7, 57, 29, 21, 12, 218, 48, 32, 17, 255, 45, 30, 16, + 255, 20, 16, 11, 218, 10, 9, 7, 105, 0, 44, 14, 12, 9, + 170, 204, 130, 51, 255, 224, 153, 77, 255, 225, 169, 88, 255, 33, + 27, 18, 255, 0, 12, 21, 19, 14, 215, 217, 163, 86, 255, 61, + 46, 28, 255, 0, 12, 19, 16, 12, 201, 203, 121, 40, 255, 51, + 38, 22, 255, 0, 12, 4, 4, 3, 25, 16, 14, 11, 227, 212, + 147, 71, 255, 224, 160, 77, 255, 223, 161, 80, 255, 31, 25, 16, + 255, 4, 4, 4, 102, 10, 10, 9, 215, 206, 133, 55, 255, 223, + 156, 70, 255, 224, 164, 85, 255, 51, 39, 24, 255, 5, 5, 4, + 82, 0, 12, 15, 12, 8, 110, 178, 98, 27, 255, 211, 115, 30, + 255, 211, 121, 34, 255, 36, 26, 15, 255, 3, 3, 2, 85, 0, + 60, 8, 8, 5, 28, 27, 20, 10, 232, 125, 73, 22, 255, 190, + 97, 21, 255, 180, 92, 21, 255, 97, 56, 20, 255, 14, 11, 7, + 170, 0, 16, 12, 10, 7, 142, 165, 89, 22, 255, 198, 104, 21, + 255, 84, 50, 19, 255, 7, 6, 4, 159, 0, 4, 5, 5, 4, + 82, 32, 23, 11, 255, 121, 69, 22, 255, 97, 56, 20, 255, 15, + 13, 8, 142, 0, 32, 14, 12, 7, 198, 172, 92, 21, 255, 28, + 19, 9, 207, 0, 8, 11, 10, 6, 85, 148, 78, 21, 255, 198, + 104, 21, 255, 192, 97, 21, 255, 21, 15, 8, 255, 0, 24, 10, + 9, 5, 170, 167, 90, 22, 255, 202, 93, 21, 255, 202, 103, 23, + 255, 21, 16, 10, 255, 0, 20, 4, 3, 3, 133, 20, 16, 9, + 255, 151, 80, 22, 255, 75, 42, 16, 255, 10, 8, 7, 255, 32, + 22, 11, 255, 164, 86, 23, 255, 60, 39, 17, 255, 5, 5, 4, + 252, 0, 36, 12, 11, 9, 198, 213, 155, 80, 255, 224, 166, 83, + 255, 211, 121, 34, 255, 20, 16, 9, 255, 3, 3, 2, 28, 0, + 144, 6, 6, 5, 51, 27, 20, 10, 255, 160, 84, 23, 255, 198, + 104, 21, 255, 67, 40, 16, 255, 8, 7, 5, 125, 0, 12, 12, + 10, 9, 170, 195, 112, 30, 255, 215, 125, 38, 255, 217, 133, 50, + 255, 49, 35, 22, 255, 5, 5, 4, 133, 13, 12, 10, 210, 189, + 119, 50, 255, 211, 127, 44, 255, 212, 121, 41, 255, 218, 135, 53, + 255, 220, 148, 63, 255, 34, 27, 17, 255, 0, 20, 4, 4, 4, + 17, 13, 12, 10, 227, 196, 113, 31, 255, 212, 118, 35, 255, 214, + 123, 43, 255, 33, 26, 16, 255, 0, 56, 12, 11, 9, 187, 208, + 134, 55, 255, 223, 146, 70, 255, 221, 152, 70, 255, 34, 26, 17, + 255, 0, 40, 8, 7, 5, 164, 165, 86, 22, 255, 202, 98, 21, + 255, 198, 96, 21, 255, 22, 16, 9, 255, 0, 20, 8, 8, 5, + 85, 32, 22, 11, 255, 167, 87, 22, 255, 160, 84, 23, 255, 93, + 54, 20, 255, 120, 65, 21, 255, 188, 96, 21, 255, 196, 99, 21, + 255, 200, 105, 21, 255, 24, 19, 11, 207, 0, 8, 15, 14, 10, + 110, 208, 152, 71, 255, 227, 174, 98, 255, 228, 179, 103, 255, 225, + 176, 98, 255, 217, 169, 94, 255, 213, 166, 92, 255, 215, 167, 92, + 255, 213, 155, 80, 255, 204, 136, 55, 255, 138, 89, 37, 255, 25, + 22, 16, 227, 9, 9, 8, 28, 0, 8, 11, 10, 8, 170, 203, + 129, 50, 255, 223, 149, 70, 255, 222, 158, 75, 255, 31, 25, 16, + 255, 4, 4, 4, 28, 0, 60, 8, 8, 7, 57, 49, 40, 26, + 255, 206, 152, 83, 255, 224, 169, 91, 255, 194, 140, 71, 255, 31, + 27, 20, 255, 9, 8, 8, 28, 0, 8, 12, 10, 9, 161, 196, + 110, 33, 255, 218, 130, 51, 255, 222, 158, 75, 255, 31, 25, 16, + 255, 4, 4, 4, 28, 0, 8, 11, 10, 8, 198, 213, 160, 84, + 255, 228, 180, 105, 255, 227, 175, 100, 255, 33, 28, 18, 207, 0, + 8, 12, 11, 9, 130, 210, 155, 77, 255, 228, 169, 99, 255, 226, + 172, 95, 255, 30, 25, 17, 255, 4, 4, 4, 28, 0, 8, 11, + 10, 8, 198, 204, 129, 49, 255, 214, 127, 43, 255, 213, 125, 40, + 255, 23, 19, 12, 232, 0, 8, 14, 13, 9, 125, 208, 152, 71, + 255, 223, 159, 76, 255, 218, 153, 59, 255, 33, 26, 16, 210, 0, + 8, 13, 12, 10, 127, 198, 118, 39, 255, 215, 127, 42, 255, 213, + 126, 42, 255, 41, 31, 18, 227, 0, 12, 6, 6, 5, 28, 25, + 21, 16, 227, 204, 150, 79, 255, 223, 171, 98, 255, 175, 122, 60, + 255, 18, 15, 11, 218, 5, 4, 4, 17, 0, 20, 20, 18, 13, + 85, 177, 101, 34, 255, 204, 123, 37, 255, 199, 117, 36, 255, 199, + 117, 36, 255, 202, 122, 37, 255, 199, 117, 36, 255, 198, 114, 31, + 255, 198, 110, 31, 255, 202, 118, 35, 255, 46, 33, 21, 170, 0, + 24, 10, 9, 7, 153, 110, 78, 37, 255, 213, 162, 82, 255, 218, + 164, 87, 255, 67, 51, 30, 255, 9, 8, 8, 85, 0, 40, 6, + 5, 5, 28, 21, 19, 14, 255, 217, 166, 92, 255, 227, 175, 100, + 255, 224, 169, 91, 255, 31, 25, 16, 215, 0, 8, 12, 10, 7, + 85, 154, 80, 21, 255, 197, 99, 20, 255, 192, 97, 21, 255, 28, + 20, 9, 255, 4, 3, 3, 110, 11, 9, 6, 170, 117, 63, 20, + 255, 184, 94, 21, 255, 198, 104, 21, 255, 203, 104, 24, 255, 210, + 122, 37, 255, 21, 17, 12, 252, 0, 8, 10, 9, 7, 161, 203, + 129, 50, 255, 224, 160, 77, 255, 225, 169, 88, 255, 30, 25, 17, + 255, 4, 4, 4, 28, 0, 8, 8, 7, 5, 190, 165, 86, 22, + 255, 198, 104, 21, 255, 196, 99, 21, 255, 28, 19, 9, 170, 0, + 8, 13, 11, 8, 85, 176, 91, 23, 255, 208, 112, 27, 255, 210, + 121, 35, 255, 27, 22, 14, 255, 4, 4, 4, 28, 0, 8, 11, + 10, 8, 198, 211, 149, 76, 255, 224, 168, 87, 255, 224, 162, 81, + 255, 32, 26, 17, 210, 0, 8, 12, 10, 7, 113, 176, 91, 23, + 255, 202, 107, 23, 255, 202, 95, 23, 255, 20, 16, 9, 255, 0, + 40, 15, 13, 10, 170, 213, 160, 84, 255, 228, 180, 105, 255, 227, + 174, 98, 255, 33, 26, 18, 255, 0, 12, 15, 13, 10, 170, 213, + 155, 80, 255, 226, 172, 95, 255, 224, 167, 85, 255, 23, 20, 14, + 244, 0, 8, 11, 10, 8, 127, 189, 104, 28, 255, 214, 127, 43, + 255, 221, 148, 70, 255, 31, 25, 16, 255, 4, 4, 4, 28, 0, + 28, 14, 12, 9, 170, 195, 113, 32, 255, 209, 117, 28, 255, 202, + 103, 23, 255, 20, 15, 9, 252, 3, 3, 3, 14, 0, 28, 15, + 14, 10, 170, 213, 155, 80, 255, 226, 172, 95, 255, 221, 152, 70, + 255, 28, 24, 15, 255, 0, 40, 14, 12, 9, 170, 208, 141, 61, + 255, 225, 162, 88, 255, 227, 174, 98, 255, 33, 26, 18, 255, 4, + 4, 4, 28, 0, 8, 10, 8, 7, 198, 182, 98, 23, 255, 202, + 103, 23, 255, 198, 104, 21, 255, 28, 19, 9, 170, 0, 8, 11, + 10, 6, 85, 154, 80, 21, 255, 202, 98, 21, 255, 202, 103, 23, + 255, 25, 20, 12, 255, 0, 40, 12, 10, 7, 170, 186, 100, 23, + 255, 202, 99, 23, 255, 200, 105, 21, 255, 30, 21, 9, 170, 0, + 8, 12, 9, 7, 85, 154, 80, 21, 255, 198, 104, 21, 255, 196, + 99, 21, 255, 28, 20, 9, 255, 4, 4, 3, 113, 11, 10, 6, + 227, 183, 100, 26, 255, 212, 127, 43, 255, 167, 117, 52, 255, 17, + 15, 12, 215, 5, 5, 5, 14, 0, 12, 15, 13, 10, 170, 211, + 149, 76, 255, 224, 166, 83, 255, 223, 161, 80, 255, 34, 26, 17, + 255, 0, 32, 10, 9, 7, 170, 167, 87, 22, 255, 198, 92, 21, + 255, 196, 99, 21, 255, 196, 95, 21, 255, 198, 92, 21, 255, 195, + 99, 22, 255, 192, 106, 29, 255, 206, 127, 43, 255, 217, 141, 60, + 255, 223, 146, 70, 255, 224, 165, 81, 255, 220, 148, 63, 255, 212, + 124, 39, 255, 25, 19, 12, 215, 0, 8, 12, 11, 9, 116, 196, + 116, 37, 255, 218, 141, 51, 255, 218, 139, 55, 255, 218, 142, 61, + 255, 215, 143, 58, 255, 24, 19, 13, 212, 0, 4, 10, 9, 7, + 156, 203, 129, 50, 255, 221, 150, 66, 255, 220, 148, 63, 255, 25, + 21, 14, 227, 0, 8, 10, 10, 7, 159, 204, 134, 59, 255, 225, + 160, 84, 255, 225, 169, 88, 255, 36, 29, 19, 255, 0, 12, 15, + 14, 10, 170, 204, 130, 51, 255, 220, 142, 59, 255, 218, 139, 55, + 255, 21, 18, 12, 249, 0, 8, 11, 10, 8, 142, 206, 145, 67, + 255, 226, 172, 95, 255, 227, 174, 98, 255, 32, 26, 17, 255, 4, + 4, 4, 28, 0, 8, 11, 10, 8, 198, 198, 117, 37, 255, 215, + 125, 38, 255, 211, 122, 36, 255, 28, 21, 13, 215, 0, 8, 13, + 11, 8, 96, 174, 91, 23, 255, 202, 107, 23, 255, 202, 103, 23, + 255, 22, 17, 9, 255, 0, 12, 11, 10, 6, 170, 176, 91, 23, + 255, 202, 103, 23, 255, 203, 108, 24, 255, 21, 15, 10, 238, 0, + 8, 11, 10, 8, 142, 206, 145, 67, 255, 226, 170, 91, 255, 224, + 160, 85, 255, 30, 24, 17, 255, 4, 4, 4, 28, 0, 8, 11, + 10, 8, 198, 209, 149, 70, 255, 224, 160, 77, 255, 222, 158, 75, + 255, 31, 25, 16, 212, 0, 8, 12, 11, 9, 127, 198, 116, 35, + 255, 215, 125, 38, 255, 211, 122, 36, 255, 28, 21, 13, 255, 4, + 4, 4, 28, 0, 52, 13, 12, 8, 170, 195, 112, 30, 255, 209, + 110, 30, 255, 207, 105, 30, 255, 25, 20, 12, 255, 0, 24, 15, + 14, 10, 170, 213, 158, 80, 255, 226, 172, 95, 255, 224, 164, 85, + 255, 33, 27, 18, 255, 0, 12, 15, 14, 10, 170, 210, 143, 65, + 255, 224, 168, 87, 255, 224, 165, 81, 255, 25, 21, 14, 232, 0, + 8, 10, 10, 9, 153, 208, 147, 67, 255, 224, 166, 83, 255, 222, + 158, 75, 255, 34, 26, 17, 255, 0, 12, 15, 14, 10, 170, 211, + 149, 76, 255, 223, 149, 70, 255, 219, 146, 60, 255, 25, 20, 14, + 235, 0, 8, 10, 10, 9, 150, 204, 134, 59, 255, 224, 156, 83, + 255, 224, 165, 81, 255, 33, 27, 18, 255, 0, 20, 15, 14, 10, + 170, 211, 150, 70, 255, 226, 170, 91, 255, 226, 172, 95, 255, 33, + 26, 18, 255, 0, 16, 9, 9, 8, 150, 101, 74, 38, 255, 198, + 145, 77, 255, 206, 157, 87, 255, 202, 151, 79, 255, 197, 141, 74, + 255, 200, 146, 75, 255, 180, 126, 57, 255, 21, 19, 14, 227, 5, + 5, 4, 28, 0, 16, 8, 7, 5, 113, 43, 28, 14, 255, 187, + 96, 22, 255, 181, 93, 22, 255, 98, 55, 21, 255, 68, 42, 17, + 255, 77, 46, 18, 255, 129, 72, 22, 255, 174, 89, 21, 255, 83, + 47, 18, 255, 11, 9, 6, 221, 0, 28, 6, 6, 5, 28, 16, + 14, 11, 195, 108, 76, 35, 255, 210, 141, 59, 255, 218, 162, 81, + 255, 167, 118, 54, 255, 16, 14, 11, 221, 5, 5, 5, 14, 0, + 12, 15, 13, 10, 170, 211, 149, 76, 255, 224, 168, 87, 255, 223, + 154, 80, 255, 31, 25, 16, 255, 0, 20, 6, 6, 5, 57, 34, + 27, 17, 255, 203, 122, 36, 255, 208, 124, 41, 255, 109, 76, 34, + 255, 13, 12, 10, 142, 0, 32, 13, 11, 8, 170, 176, 91, 23, + 255, 202, 93, 21, 255, 196, 99, 21, 255, 28, 19, 9, 170, 0, + 8, 11, 9, 6, 85, 132, 71, 21, 255, 195, 99, 22, 255, 103, + 59, 20, 255, 11, 10, 6, 170, 3, 3, 2, 25, 6, 6, 5, + 110, 55, 35, 16, 255, 198, 113, 29, 255, 212, 134, 51, 255, 41, + 32, 20, 210, 0, 68, 21, 19, 14, 215, 217, 163, 86, 255, 49, + 38, 24, 255, 0, 12, 11, 10, 8, 82, 54, 43, 27, 255, 200, + 135, 59, 255, 210, 137, 59, 255, 207, 131, 50, 255, 205, 127, 44, + 255, 199, 117, 36, 255, 195, 111, 28, 255, 187, 101, 24, 255, 93, + 54, 22, 255, 19, 15, 10, 227, 7, 6, 6, 28, 0, 8, 10, + 9, 7, 170, 195, 109, 32, 255, 218, 138, 53, 255, 224, 158, 81, + 255, 223, 173, 95, 255, 219, 167, 94, 255, 217, 169, 94, 255, 218, + 171, 97, 255, 217, 166, 92, 255, 208, 136, 59, 255, 110, 68, 27, + 255, 19, 15, 10, 227, 6, 6, 5, 28, 0, 12, 12, 11, 7, + 170, 61, 42, 20, 255, 188, 106, 33, 255, 208, 134, 55, 255, 215, + 163, 82, 255, 217, 166, 92, 255, 216, 167, 88, 255, 216, 167, 89, + 255, 211, 150, 70, 255, 146, 94, 39, 255, 26, 21, 15, 229, 9, + 8, 6, 28, 0, 12, 12, 10, 7, 170, 51, 32, 14, 255, 151, + 80, 22, 255, 169, 91, 22, 255, 173, 86, 22, 255, 169, 88, 22, + 255, 173, 86, 22, 255, 180, 92, 21, 255, 194, 98, 21, 255, 196, + 95, 21, 255, 192, 97, 21, 255, 31, 21, 10, 170, 0, 12, 12, + 10, 7, 170, 57, 37, 18, 255, 189, 107, 34, 255, 212, 149, 67, + 255, 217, 166, 92, 255, 217, 166, 92, 255, 218, 171, 97, 255, 215, + 163, 82, 255, 205, 126, 48, 255, 116, 72, 29, 255, 20, 16, 11, + 227, 6, 6, 5, 28, 0, 8, 11, 9, 6, 68, 126, 68, 21, + 255, 191, 98, 22, 255, 194, 98, 21, 255, 192, 97, 21, 255, 192, + 97, 21, 255, 191, 98, 22, 255, 177, 91, 22, 255, 26, 19, 9, + 142, 0, 12, 12, 10, 7, 170, 58, 37, 17, 255, 185, 107, 30, + 255, 208, 134, 55, 255, 216, 167, 88, 255, 218, 171, 97, 255, 217, + 166, 92, 255, 213, 148, 72, 255, 204, 130, 51, 255, 209, 141, 60, + 255, 211, 159, 76, 255, 30, 25, 17, 170, 0, 8, 10, 10, 7, + 167, 210, 155, 77, 255, 228, 178, 99, 255, 224, 165, 81, 255, 221, + 165, 86, 255, 217, 166, 92, 255, 218, 169, 93, 255, 217, 166, 92, + 255, 214, 156, 81, 255, 206, 135, 51, 255, 116, 72, 29, 255, 20, + 16, 11, 227, 6, 6, 5, 28, 0, 8, 13, 10, 6, 57, 115, + 62, 20, 255, 169, 91, 22, 255, 165, 86, 22, 255, 24, 18, 9, + 167, 0, 24, 12, 10, 7, 88, 117, 63, 20, 255, 186, 100, 23, + 255, 191, 107, 32, 255, 35, 27, 16, 144, 0, 8, 10, 10, 7, + 170, 210, 155, 77, 255, 228, 178, 99, 255, 221, 152, 70, 255, 24, + 19, 13, 255, 0, 8, 12, 10, 7, 170, 58, 36, 15, 255, 157, + 79, 22, 255, 151, 80, 22, 255, 58, 35, 15, 255, 11, 9, 6, + 57, 0, 8, 12, 10, 7, 85, 157, 81, 20, 255, 197, 99, 20, + 255, 192, 97, 21, 255, 28, 20, 9, 170, 0, 8, 11, 9, 6, + 57, 115, 62, 20, 255, 189, 94, 24, 255, 198, 117, 37, 255, 213, + 157, 76, 255, 218, 171, 97, 255, 217, 169, 94, 255, 214, 161, 85, + 255, 213, 157, 76, 255, 212, 149, 67, 255, 208, 134, 55, 255, 205, + 126, 48, 255, 143, 96, 40, 255, 28, 26, 19, 229, 8, 8, 7, + 28, 0, 8, 13, 12, 8, 85, 141, 74, 24, 255, 190, 94, 23, + 255, 183, 95, 24, 255, 183, 95, 24, 255, 187, 93, 24, 255, 189, + 97, 22, 255, 181, 93, 22, 255, 177, 91, 22, 255, 169, 88, 22, + 255, 89, 52, 20, 255, 21, 18, 12, 227, 9, 9, 8, 28, 0, + 12, 18, 17, 13, 181, 103, 74, 40, 255, 207, 146, 74, 255, 214, + 156, 81, 255, 210, 144, 67, 255, 208, 138, 55, 255, 207, 129, 52, + 255, 205, 133, 48, 255, 205, 126, 48, 255, 151, 101, 42, 255, 28, + 26, 19, 232, 9, 8, 8, 28, 0, 8, 13, 12, 10, 110, 186, + 127, 63, 255, 214, 156, 81, 255, 213, 158, 80, 255, 213, 155, 80, + 255, 214, 156, 81, 255, 214, 153, 75, 255, 213, 148, 72, 255, 213, + 148, 72, 255, 211, 150, 70, 255, 159, 111, 54, 255, 28, 25, 19, + 241, 9, 8, 8, 31, 0, 12, 18, 17, 13, 181, 103, 74, 40, + 255, 208, 156, 81, 255, 214, 156, 81, 255, 208, 138, 55, 255, 209, + 137, 60, 255, 213, 158, 80, 255, 213, 155, 80, 255, 213, 160, 84, + 255, 215, 160, 88, 255, 213, 163, 84, 255, 30, 24, 17, 178, 0, + 8, 12, 11, 9, 93, 178, 121, 53, 255, 213, 158, 80, 255, 210, + 143, 65, 255, 211, 146, 62, 255, 213, 148, 72, 255, 215, 163, 82, + 255, 213, 158, 80, 255, 212, 149, 67, 255, 209, 141, 60, 255, 153, + 106, 49, 255, 28, 25, 19, 235, 9, 9, 8, 31, 0, 12, 18, + 15, 11, 173, 66, 43, 21, 255, 187, 101, 32, 255, 207, 132, 52, + 255, 210, 144, 67, 255, 213, 148, 72, 255, 214, 156, 81, 255, 216, + 167, 88, 255, 214, 156, 81, 255, 176, 128, 65, 255, 46, 39, 27, + 255, 0, 12, 15, 14, 10, 85, 181, 111, 42, 255, 215, 136, 52, + 255, 213, 125, 40, 255, 211, 122, 36, 255, 212, 123, 37, 255, 210, + 123, 39, 255, 202, 122, 37, 255, 31, 24, 14, 170, 0, 8, 12, + 11, 9, 88, 164, 89, 29, 255, 203, 122, 36, 255, 199, 117, 36, + 255, 30, 23, 15, 212, 0, 12, 15, 13, 10, 127, 187, 133, 62, + 255, 213, 148, 72, 255, 208, 138, 55, 255, 31, 24, 16, 170, 0, + 8, 13, 12, 10, 85, 172, 104, 37, 255, 209, 134, 54, 255, 206, + 135, 51, 255, 32, 25, 17, 212, 0, 12, 15, 13, 10, 127, 181, + 116, 46, 255, 211, 143, 62, 255, 210, 153, 71, 255, 29, 24, 16, + 178, 0, 8, 13, 12, 10, 91, 178, 121, 53, 255, 213, 154, 70, + 255, 208, 134, 55, 255, 31, 25, 16, 210, 0, 20, 15, 14, 10, + 125, 179, 110, 42, 255, 210, 135, 55, 255, 208, 139, 65, 255, 26, + 21, 15, 184, 0, 8, 14, 13, 9, 85, 179, 117, 44, 255, 217, + 165, 82, 255, 213, 163, 84, 255, 27, 23, 16, 221, 0, 12, 14, + 12, 9, 136, 174, 103, 39, 255, 206, 127, 43, 255, 199, 117, 36, + 255, 31, 24, 14, 170, 0, 8, 12, 11, 9, 88, 164, 89, 29, + 255, 202, 118, 35, 255, 196, 114, 33, 255, 29, 22, 14, 210, 0, + 12, 14, 12, 9, 125, 169, 95, 30, 255, 202, 119, 37, 255, 199, + 119, 39, 255, 24, 19, 13, 190, 0, 8, 14, 12, 9, 85, 170, + 95, 29, 255, 198, 113, 29, 255, 199, 116, 34, 255, 204, 128, 47, + 255, 206, 135, 51, 255, 204, 129, 49, 255, 204, 129, 49, 255, 208, + 134, 55, 255, 211, 149, 76, 255, 192, 140, 73, 255, 95, 74, 39, + 255, 17, 15, 12, 85, 0, 16, 14, 12, 9, 198, 211, 150, 70, + 255, 206, 152, 81, 255, 31, 26, 20, 255, 7, 7, 6, 48, 0, + 16, 15, 13, 10, 170, 211, 149, 76, 255, 226, 170, 91, 255, 226, + 172, 95, 255, 35, 28, 18, 255, 0, 20, 15, 14, 12, 218, 171, + 120, 60, 255, 219, 154, 70, 255, 41, 31, 20, 255, 4, 4, 3, + 28, 0, 104, 17, 16, 12, 170, 219, 179, 116, 255, 232, 193, 137, + 255, 232, 199, 135, 255, 40, 33, 23, 255, 0, 12, 10, 10, 9, + 76, 62, 50, 31, 255, 20, 18, 13, 167, 0, 12, 11, 10, 8, + 76, 58, 46, 29, 255, 20, 18, 13, 167, 0, 16, 13, 12, 10, + 170, 210, 150, 71, 255, 223, 147, 72, 255, 221, 150, 66, 255, 26, + 21, 15, 210, 0, 4, 11, 10, 8, 119, 211, 159, 84, 255, 229, + 184, 114, 255, 230, 186, 123, 255, 30, 26, 19, 255, 0, 16, 12, + 11, 9, 93, 137, 90, 40, 255, 223, 167, 94, 255, 228, 180, 111, + 255, 167, 133, 80, 255, 17, 16, 14, 227, 11, 11, 10, 170, 12, + 11, 9, 170, 12, 11, 9, 170, 12, 11, 9, 119, 7, 7, 6, + 57, 0, 36, 7, 7, 6, 62, 21, 18, 12, 227, 157, 92, 28, + 255, 203, 105, 26, 255, 197, 106, 26, 255, 82, 48, 21, 255, 14, + 12, 7, 173, 5, 5, 4, 8, 0, 16, 8, 7, 5, 28, 26, + 19, 11, 227, 103, 68, 25, 255, 158, 96, 29, 255, 57, 41, 22, + 255, 13, 12, 10, 241, 33, 26, 16, 255, 146, 88, 31, 255, 66, + 47, 23, 255, 12, 10, 9, 201, 6, 5, 5, 14, 0, 32, 8, + 7, 5, 57, 30, 22, 11, 255, 15, 12, 8, 96, 0, 8, 10, + 10, 7, 130, 190, 104, 27, 255, 209, 118, 30, 255, 211, 117, 34, + 255, 27, 21, 14, 255, 0, 24, 13, 12, 10, 170, 199, 122, 39, + 255, 218, 130, 51, 255, 223, 146, 70, 255, 30, 24, 17, 255, 0, + 12, 23, 22, 18, 139, 30, 27, 21, 170, 16, 15, 11, 255, 89, + 59, 26, 255, 203, 110, 28, 255, 196, 113, 31, 255, 122, 81, 33, + 255, 186, 117, 43, 255, 216, 129, 51, 255, 184, 126, 57, 255, 38, + 34, 25, 255, 24, 22, 19, 221, 33, 30, 24, 170, 15, 15, 12, + 28, 0, 12, 24, 22, 19, 142, 32, 31, 25, 170, 21, 20, 16, + 198, 90, 71, 45, 255, 223, 179, 110, 255, 226, 172, 95, 255, 221, + 150, 66, 255, 143, 100, 44, 255, 22, 21, 17, 227, 28, 27, 21, + 170, 29, 28, 22, 170, 13, 13, 12, 42, 0, 36, 8, 8, 8, + 11, 25, 24, 20, 142, 39, 35, 28, 170, 30, 28, 23, 170, 29, + 27, 22, 170, 29, 27, 22, 170, 29, 27, 22, 170, 29, 27, 22, + 170, 29, 27, 20, 170, 23, 21, 16, 170, 14, 13, 11, 34, 0, + 52, 13, 12, 10, 159, 142, 86, 31, 255, 208, 116, 35, 255, 201, + 119, 38, 255, 32, 26, 17, 255, 5, 5, 4, 28, 0, 12, 14, + 13, 11, 170, 216, 167, 97, 255, 231, 184, 124, 255, 231, 193, 128, + 255, 181, 146, 92, 255, 52, 44, 33, 255, 90, 71, 45, 255, 201, + 155, 88, 255, 223, 173, 102, 255, 228, 179, 115, 255, 230, 183, 123, + 255, 230, 184, 119, 255, 39, 32, 22, 255, 0, 24, 12, 12, 11, + 170, 206, 139, 61, 255, 226, 164, 91, 255, 228, 174, 103, 255, 39, + 32, 22, 255, 0, 48, 6, 6, 5, 28, 9, 9, 8, 142, 56, + 46, 31, 255, 222, 180, 113, 255, 230, 187, 119, 255, 222, 180, 113, + 255, 23, 21, 16, 255, 0, 36, 15, 14, 12, 164, 79, 59, 30, + 255, 209, 128, 42, 255, 211, 127, 44, 255, 171, 117, 46, 255, 18, + 15, 11, 170, 0, 16, 9, 9, 8, 116, 33, 28, 16, 255, 161, + 94, 28, 255, 199, 107, 26, 255, 65, 40, 18, 255, 8, 7, 5, + 255, 25, 20, 12, 255, 198, 113, 29, 255, 210, 120, 33, 255, 217, + 133, 50, 255, 27, 23, 16, 255, 0, 8, 7, 7, 6, 23, 34, + 28, 19, 198, 46, 36, 25, 255, 39, 31, 22, 255, 41, 33, 22, + 255, 59, 46, 28, 255, 51, 40, 26, 255, 61, 47, 28, 255, 180, + 133, 71, 255, 227, 175, 100, 255, 226, 175, 103, 255, 181, 143, 88, + 255, 17, 16, 12, 142, 0, 8, 11, 11, 10, 170, 214, 166, 97, + 255, 229, 179, 114, 255, 228, 185, 111, 255, 161, 121, 68, 255, 23, + 21, 16, 227, 23, 22, 18, 170, 22, 21, 17, 170, 16, 15, 13, + 170, 11, 11, 8, 147, 8, 8, 7, 85, 0, 40, 14, 13, 11, + 170, 181, 143, 88, 255, 228, 185, 123, 255, 218, 168, 97, 255, 70, + 54, 35, 255, 9, 9, 8, 113, 0, 12, 11, 10, 8, 85, 120, + 87, 45, 255, 223, 183, 120, 255, 231, 190, 132, 255, 167, 135, 80, + 255, 24, 22, 19, 227, 19, 18, 16, 170, 19, 18, 16, 198, 95, + 80, 46, 255, 226, 193, 129, 255, 228, 187, 129, 255, 186, 148, 87, + 255, 15, 14, 12, 170, 0, 8, 10, 10, 9, 85, 155, 113, 64, + 255, 229, 196, 132, 255, 232, 191, 133, 255, 179, 142, 90, 255, 27, + 25, 20, 227, 18, 18, 15, 170, 19, 18, 16, 198, 90, 71, 45, + 255, 222, 175, 101, 255, 227, 174, 98, 255, 228, 185, 111, 255, 28, + 25, 19, 255, 0, 8, 7, 7, 6, 23, 34, 28, 19, 198, 49, + 35, 22, 255, 39, 29, 18, 227, 12, 11, 9, 85, 0, 8, 8, + 7, 7, 28, 33, 26, 16, 198, 52, 39, 23, 255, 47, 35, 22, + 227, 13, 12, 8, 85, 0, 8, 8, 8, 7, 28, 33, 30, 24, + 227, 201, 157, 100, 255, 230, 186, 123, 255, 181, 137, 74, 255, 16, + 15, 11, 207, 6, 6, 5, 23, 0, 24, 11, 10, 8, 28, 27, + 21, 12, 193, 26, 19, 11, 255, 23, 18, 10, 255, 23, 18, 10, + 255, 24, 18, 11, 255, 24, 18, 11, 255, 26, 20, 11, 255, 35, + 27, 16, 255, 42, 31, 19, 241, 17, 14, 10, 85, 0, 28, 9, + 9, 8, 144, 91, 67, 36, 255, 217, 154, 72, 255, 211, 150, 70, + 255, 69, 55, 34, 255, 15, 14, 12, 85, 0, 28, 6, 6, 5, + 11, 11, 11, 10, 142, 24, 22, 19, 255, 167, 135, 80, 255, 225, + 172, 104, 255, 224, 166, 83, 255, 193, 126, 54, 255, 16, 14, 11, + 170, 0, 8, 13, 12, 8, 85, 185, 97, 26, 255, 207, 112, 28, + 255, 204, 110, 27, 255, 71, 46, 22, 255, 8, 8, 7, 255, 28, + 22, 13, 255, 198, 107, 27, 255, 193, 111, 30, 255, 126, 78, 31, + 255, 199, 139, 62, 255, 226, 184, 111, 255, 27, 24, 18, 255, 0, + 8, 11, 10, 8, 170, 214, 166, 97, 255, 230, 187, 119, 255, 228, + 179, 103, 255, 143, 102, 48, 255, 17, 16, 12, 227, 12, 12, 9, + 170, 13, 12, 10, 198, 46, 33, 17, 255, 199, 112, 28, 255, 206, + 111, 27, 255, 204, 110, 27, 255, 32, 23, 13, 176, 0, 8, 12, + 11, 9, 136, 204, 134, 59, 255, 226, 172, 95, 255, 228, 181, 107, + 255, 162, 125, 73, 255, 24, 22, 19, 227, 19, 18, 16, 170, 19, + 18, 16, 198, 95, 80, 46, 255, 224, 179, 109, 255, 223, 173, 95, + 255, 173, 117, 50, 255, 15, 13, 10, 156, 0, 8, 12, 11, 7, + 99, 185, 97, 26, 255, 208, 112, 27, 255, 204, 110, 27, 255, 22, + 18, 11, 255, 0, 40, 16, 15, 13, 170, 219, 179, 116, 255, 232, + 194, 133, 255, 231, 193, 128, 255, 40, 33, 23, 255, 0, 12, 16, + 15, 13, 170, 219, 177, 112, 255, 230, 187, 119, 255, 224, 159, 83, + 255, 24, 21, 15, 255, 0, 8, 11, 10, 8, 164, 211, 158, 82, + 255, 229, 184, 114, 255, 230, 191, 123, 255, 166, 127, 77, 255, 22, + 21, 17, 227, 22, 21, 17, 170, 20, 19, 13, 170, 14, 13, 11, + 28, 0, 16, 12, 11, 9, 170, 195, 112, 30, 255, 209, 106, 30, + 255, 206, 111, 27, 255, 101, 63, 26, 255, 16, 14, 11, 227, 23, + 21, 16, 170, 29, 27, 22, 170, 13, 13, 12, 42, 0, 16, 16, + 15, 13, 170, 216, 167, 97, 255, 224, 158, 87, 255, 216, 125, 45, + 255, 24, 20, 13, 255, 0, 40, 17, 16, 12, 170, 219, 177, 112, + 255, 232, 195, 137, 255, 231, 189, 128, 255, 162, 125, 73, 255, 22, + 21, 17, 227, 14, 14, 11, 170, 13, 12, 10, 198, 50, 35, 19, + 255, 199, 112, 28, 255, 206, 111, 27, 255, 204, 110, 27, 255, 32, + 24, 13, 170, 0, 8, 13, 12, 8, 93, 194, 109, 33, 255, 219, + 139, 54, 255, 224, 158, 81, 255, 39, 32, 22, 255, 0, 40, 11, + 10, 8, 170, 190, 104, 27, 255, 208, 112, 27, 255, 204, 110, 27, + 255, 32, 24, 13, 170, 0, 8, 13, 12, 8, 85, 184, 96, 25, + 255, 207, 112, 28, 255, 204, 102, 27, 255, 129, 78, 28, 255, 31, + 26, 16, 255, 127, 84, 34, 255, 219, 147, 70, 255, 173, 122, 62, + 255, 15, 14, 12, 212, 6, 6, 5, 25, 0, 16, 16, 15, 13, + 170, 213, 155, 80, 255, 221, 144, 68, 255, 217, 130, 52, 255, 31, + 25, 16, 255, 0, 32, 10, 9, 7, 170, 189, 99, 26, 255, 208, + 112, 27, 255, 204, 110, 27, 255, 155, 87, 26, 255, 72, 46, 21, + 255, 179, 103, 36, 255, 223, 156, 76, 255, 216, 170, 97, 255, 134, + 96, 47, 255, 174, 127, 71, 255, 221, 167, 90, 255, 223, 147, 72, + 255, 222, 158, 75, 255, 23, 19, 14, 252, 0, 8, 11, 10, 8, + 170, 214, 166, 97, 255, 231, 187, 124, 255, 230, 191, 123, 255, 228, + 182, 117, 255, 222, 175, 101, 255, 64, 50, 33, 255, 7, 7, 6, + 229, 26, 23, 19, 255, 220, 175, 105, 255, 228, 183, 113, 255, 228, + 188, 117, 255, 25, 21, 16, 255, 0, 8, 11, 10, 8, 170, 217, + 176, 112, 255, 232, 197, 137, 255, 232, 199, 135, 255, 37, 31, 22, + 255, 0, 12, 13, 12, 10, 170, 198, 117, 37, 255, 215, 127, 42, + 255, 217, 130, 52, 255, 21, 19, 14, 255, 0, 8, 11, 10, 8, + 167, 215, 172, 104, 255, 232, 191, 133, 255, 231, 190, 132, 255, 166, + 127, 77, 255, 23, 21, 16, 227, 18, 17, 15, 170, 17, 16, 12, + 198, 74, 52, 27, 255, 204, 117, 33, 255, 211, 111, 30, 255, 173, + 93, 28, 255, 15, 12, 8, 164, 0, 8, 13, 12, 8, 88, 185, + 97, 26, 255, 208, 112, 27, 255, 204, 110, 27, 255, 19, 16, 10, + 255, 0, 12, 10, 9, 7, 170, 190, 104, 27, 255, 212, 118, 35, + 255, 216, 136, 51, 255, 21, 19, 14, 252, 0, 8, 11, 10, 8, + 167, 215, 172, 104, 255, 232, 194, 127, 255, 231, 193, 128, 255, 166, + 129, 77, 255, 23, 21, 16, 227, 19, 18, 16, 170, 19, 18, 14, + 198, 81, 59, 34, 255, 213, 144, 62, 255, 215, 140, 60, 255, 165, + 108, 40, 255, 13, 12, 10, 167, 0, 8, 8, 8, 7, 85, 101, + 63, 26, 255, 206, 114, 33, 255, 212, 121, 33, 255, 155, 92, 36, + 255, 23, 21, 16, 227, 22, 21, 17, 170, 28, 26, 21, 170, 21, + 20, 18, 170, 13, 13, 12, 164, 10, 10, 9, 85, 6, 6, 6, + 6, 0, 28, 12, 11, 9, 170, 194, 112, 31, 255, 212, 119, 37, + 255, 216, 134, 45, 255, 35, 28, 18, 255, 0, 24, 16, 15, 13, + 170, 217, 171, 106, 255, 231, 187, 124, 255, 228, 181, 107, 255, 39, + 32, 22, 255, 0, 12, 16, 15, 11, 170, 208, 134, 55, 255, 223, + 156, 70, 255, 221, 148, 70, 255, 23, 20, 14, 238, 0, 8, 11, + 10, 8, 170, 204, 136, 55, 255, 223, 156, 70, 255, 222, 158, 75, + 255, 34, 28, 19, 255, 0, 12, 14, 13, 11, 170, 217, 171, 106, + 255, 232, 189, 127, 255, 230, 186, 123, 255, 25, 22, 16, 255, 0, + 8, 10, 10, 9, 167, 210, 155, 77, 255, 226, 172, 95, 255, 224, + 165, 81, 255, 31, 26, 18, 255, 0, 20, 15, 13, 12, 170, 217, + 173, 104, 255, 232, 191, 133, 255, 231, 195, 132, 255, 40, 33, 23, + 255, 0, 20, 10, 9, 9, 133, 73, 58, 36, 255, 225, 184, 120, + 255, 231, 193, 128, 255, 228, 180, 111, 255, 147, 102, 48, 255, 15, + 13, 10, 227, 8, 7, 7, 28, 0, 24, 12, 11, 7, 198, 100, + 59, 23, 255, 169, 93, 26, 255, 156, 91, 27, 255, 174, 96, 27, + 255, 180, 99, 27, 255, 168, 97, 27, 255, 105, 62, 24, 255, 18, + 15, 9, 255, 7, 6, 6, 48, 0, 24, 7, 7, 7, 28, 15, + 15, 12, 227, 144, 114, 67, 255, 219, 177, 112, 255, 223, 176, 102, + 255, 153, 113, 62, 255, 17, 16, 12, 227, 7, 7, 6, 28, 0, + 16, 16, 15, 13, 170, 213, 155, 80, 255, 223, 146, 70, 255, 217, + 129, 50, 255, 27, 22, 14, 255, 0, 24, 12, 10, 9, 195, 161, + 94, 28, 255, 207, 114, 32, 255, 193, 114, 36, 255, 23, 20, 16, + 255, 0, 32, 12, 11, 9, 170, 191, 105, 28, 255, 207, 100, 28, + 255, 204, 110, 27, 255, 26, 20, 11, 204, 0, 8, 6, 5, 5, + 3, 26, 19, 9, 198, 24, 18, 9, 246, 15, 12, 8, 142, 0, + 12, 15, 13, 10, 91, 31, 24, 16, 244, 51, 39, 24, 255, 21, + 19, 14, 91, 0, 68, 10, 10, 9, 76, 61, 49, 30, 255, 20, + 18, 13, 156, 0, 16, 17, 15, 12, 142, 27, 22, 14, 232, 30, + 22, 13, 255, 25, 20, 12, 255, 22, 18, 11, 238, 21, 16, 10, + 255, 99, 58, 22, 255, 203, 113, 26, 255, 205, 111, 28, 255, 131, + 80, 30, 255, 12, 11, 9, 142, 0, 8, 11, 10, 8, 170, 212, + 160, 85, 255, 232, 191, 127, 255, 231, 195, 132, 255, 196, 155, 91, + 255, 81, 59, 34, 255, 41, 32, 20, 255, 54, 43, 27, 255, 180, + 133, 71, 255, 216, 144, 59, 255, 208, 115, 33, 255, 129, 78, 28, + 255, 12, 11, 7, 142, 0, 8, 8, 7, 7, 57, 72, 52, 29, + 255, 215, 155, 78, 255, 227, 174, 98, 255, 207, 158, 94, 255, 85, + 63, 34, 255, 36, 29, 19, 255, 57, 43, 26, 255, 189, 130, 66, + 255, 219, 149, 66, 255, 212, 121, 41, 255, 172, 105, 33, 255, 17, + 15, 10, 147, 0, 8, 7, 6, 6, 54, 58, 40, 21, 255, 198, + 113, 29, 255, 206, 103, 27, 255, 165, 87, 24, 255, 42, 28, 13, + 255, 21, 16, 8, 255, 27, 20, 10, 255, 95, 60, 22, 255, 202, + 105, 27, 255, 206, 100, 29, 255, 204, 110, 27, 255, 35, 24, 12, + 170, 0, 8, 7, 7, 6, 54, 70, 50, 27, 255, 212, 145, 65, + 255, 227, 174, 98, 255, 201, 155, 88, 255, 59, 44, 28, 255, 23, + 20, 14, 255, 34, 28, 19, 255, 157, 104, 48, 255, 211, 126, 42, + 255, 208, 115, 33, 255, 132, 82, 29, 255, 13, 11, 8, 142, 0, + 12, 24, 18, 9, 221, 108, 61, 23, 255, 201, 112, 26, 255, 207, + 112, 28, 255, 204, 110, 27, 255, 158, 91, 25, 255, 46, 29, 13, + 249, 11, 10, 6, 57, 0, 8, 8, 8, 7, 57, 70, 50, 27, + 255, 212, 142, 59, 255, 226, 172, 95, 255, 207, 158, 94, 255, 85, + 63, 34, 255, 41, 32, 20, 255, 57, 43, 26, 255, 174, 124, 59, + 255, 224, 170, 93, 255, 229, 184, 114, 255, 231, 196, 128, 255, 28, + 25, 19, 255, 0, 8, 10, 10, 9, 167, 215, 169, 102, 255, 232, + 191, 127, 255, 231, 193, 128, 255, 196, 154, 87, 255, 77, 59, 34, + 255, 41, 31, 20, 255, 54, 43, 27, 255, 168, 113, 49, 255, 212, + 121, 41, 255, 206, 114, 33, 255, 132, 82, 29, 255, 12, 11, 9, + 130, 0, 8, 12, 11, 7, 110, 188, 98, 25, 255, 206, 111, 27, + 255, 206, 106, 25, 255, 26, 19, 11, 255, 0, 24, 14, 12, 9, + 170, 199, 117, 36, 255, 221, 148, 62, 255, 227, 174, 98, 255, 28, + 26, 19, 255, 0, 8, 10, 10, 9, 167, 212, 161, 89, 255, 224, + 166, 83, 255, 217, 129, 50, 255, 32, 24, 15, 255, 5, 5, 4, + 31, 7, 7, 6, 136, 65, 44, 22, 255, 192, 106, 29, 255, 203, + 108, 24, 255, 114, 66, 23, 255, 17, 13, 8, 221, 0, 12, 10, + 9, 7, 139, 185, 97, 26, 255, 208, 112, 27, 255, 208, 117, 29, + 255, 32, 24, 13, 170, 0, 8, 15, 13, 8, 91, 189, 99, 26, + 255, 215, 123, 42, 255, 226, 172, 95, 255, 198, 152, 87, 255, 81, + 58, 34, 255, 176, 133, 71, 255, 224, 168, 95, 255, 197, 138, 62, + 255, 65, 47, 26, 255, 133, 81, 30, 255, 208, 121, 37, 255, 212, + 115, 37, 255, 152, 98, 35, 255, 12, 11, 9, 142, 0, 8, 10, + 9, 7, 147, 190, 107, 25, 255, 206, 111, 27, 255, 206, 106, 25, + 255, 158, 91, 25, 255, 42, 28, 13, 255, 21, 15, 8, 255, 26, + 19, 9, 255, 114, 66, 23, 255, 204, 113, 25, 255, 208, 115, 33, + 255, 173, 122, 62, 255, 16, 15, 13, 150, 0, 8, 8, 8, 7, + 71, 110, 87, 51, 255, 222, 180, 113, 255, 224, 166, 83, 255, 209, + 137, 60, 255, 133, 84, 32, 255, 77, 50, 24, 255, 89, 59, 26, + 255, 181, 109, 32, 255, 210, 121, 35, 255, 212, 121, 41, 255, 171, + 116, 52, 255, 15, 14, 12, 142, 0, 8, 14, 13, 11, 170, 219, + 177, 112, 255, 231, 187, 124, 255, 228, 180, 111, 255, 205, 158, 90, + 255, 79, 58, 32, 255, 38, 29, 19, 255, 49, 35, 22, 255, 167, + 114, 46, 255, 217, 146, 62, 255, 219, 154, 70, 255, 169, 117, 56, + 255, 15, 13, 12, 156, 0, 8, 8, 8, 7, 71, 104, 80, 45, + 255, 224, 183, 119, 255, 232, 191, 127, 255, 210, 166, 97, 255, 81, + 60, 32, 255, 39, 30, 18, 255, 52, 40, 25, 255, 175, 128, 66, + 255, 225, 173, 98, 255, 228, 180, 105, 255, 226, 175, 95, 255, 29, + 25, 18, 255, 0, 8, 12, 12, 11, 170, 208, 138, 55, 255, 222, + 145, 63, 255, 220, 139, 59, 255, 193, 121, 50, 255, 68, 50, 29, + 255, 38, 28, 19, 255, 48, 35, 23, 255, 175, 112, 44, 255, 217, + 142, 54, 255, 217, 144, 66, 255, 191, 137, 66, 255, 19, 16, 12, + 170, 0, 8, 9, 8, 8, 74, 111, 82, 40, 255, 216, 155, 75, + 255, 226, 172, 95, 255, 200, 151, 81, 255, 57, 41, 26, 255, 27, + 23, 16, 255, 35, 28, 18, 255, 41, 32, 20, 255, 39, 30, 20, + 255, 25, 22, 16, 227, 15, 14, 10, 142, 0, 12, 10, 9, 7, + 28, 33, 24, 14, 227, 135, 81, 28, 255, 206, 117, 31, 255, 210, + 108, 33, 255, 208, 110, 31, 255, 171, 92, 28, 255, 49, 33, 16, + 252, 13, 11, 8, 68, 0, 8, 11, 10, 8, 170, 195, 108, 30, + 255, 212, 118, 35, 255, 217, 137, 52, 255, 42, 33, 23, 255, 0, + 12, 20, 18, 15, 170, 214, 156, 81, 255, 221, 148, 62, 255, 214, + 127, 43, 255, 23, 19, 12, 238, 0, 8, 10, 10, 7, 159, 196, + 109, 31, 255, 213, 119, 36, 255, 212, 123, 37, 255, 31, 24, 14, + 255, 0, 12, 15, 14, 10, 170, 209, 137, 60, 255, 228, 172, 99, + 255, 230, 189, 119, 255, 28, 26, 19, 255, 0, 8, 12, 12, 11, + 170, 208, 134, 55, 255, 218, 137, 51, 255, 214, 127, 43, 255, 35, + 27, 16, 255, 0, 20, 16, 14, 11, 170, 199, 116, 34, 255, 217, + 132, 48, 255, 224, 166, 83, 255, 32, 26, 19, 255, 0, 8, 10, + 10, 7, 34, 81, 58, 34, 255, 224, 178, 105, 255, 226, 172, 95, + 255, 129, 92, 40, 255, 9, 9, 8, 170, 6, 6, 6, 85, 6, + 6, 5, 113, 35, 27, 16, 255, 204, 117, 33, 255, 208, 117, 29, + 255, 110, 69, 25, 255, 14, 12, 7, 108, 0, 8, 10, 10, 7, + 170, 195, 112, 30, 255, 211, 115, 30, 255, 211, 115, 30, 255, 30, + 23, 13, 255, 0, 12, 14, 12, 9, 170, 196, 113, 31, 255, 211, + 120, 32, 255, 214, 126, 41, 255, 33, 26, 18, 255, 0, 8, 9, + 8, 6, 28, 44, 33, 19, 212, 60, 42, 23, 255, 46, 35, 21, + 255, 74, 53, 31, 255, 156, 109, 53, 255, 216, 167, 97, 255, 228, + 179, 109, 255, 229, 177, 110, 255, 227, 184, 108, 255, 168, 123, 69, + 255, 23, 21, 16, 227, 9, 8, 8, 28, 0, 12, 17, 16, 14, + 170, 134, 98, 51, 255, 223, 166, 92, 255, 132, 100, 53, 255, 9, + 9, 8, 133, 0, 20, 16, 15, 13, 170, 219, 177, 112, 255, 232, + 191, 133, 255, 231, 195, 132, 255, 40, 33, 23, 255, 0, 20, 6, + 6, 5, 45, 39, 32, 22, 255, 210, 129, 49, 255, 172, 106, 35, + 255, 20, 17, 13, 227, 11, 11, 8, 28, 0, 100, 17, 17, 14, + 170, 221, 189, 132, 255, 235, 205, 154, 255, 234, 205, 155, 255, 42, + 39, 29, 255, 0, 16, 9, 9, 8, 25, 0, 20, 9, 8, 8, + 25, 0, 20, 14, 14, 11, 170, 208, 141, 61, 255, 224, 168, 87, + 255, 228, 174, 103, 255, 31, 26, 20, 221, 0, 4, 13, 12, 12, + 130, 218, 185, 127, 255, 234, 202, 147, 255, 232, 198, 139, 255, 40, + 33, 25, 255, 0, 20, 17, 17, 14, 176, 140, 115, 71, 255, 230, + 202, 147, 255, 232, 202, 149, 255, 218, 170, 101, 255, 200, 124, 43, + 255, 198, 117, 37, 255, 198, 117, 37, 255, 196, 116, 37, 255, 72, + 52, 27, 255, 12, 11, 9, 170, 0, 28, 8, 8, 7, 85, 37, + 31, 20, 255, 174, 110, 41, 255, 210, 123, 39, 255, 204, 120, 37, + 255, 130, 87, 31, 255, 15, 13, 10, 190, 0, 28, 5, 5, 4, + 113, 28, 26, 19, 255, 210, 143, 65, 255, 220, 163, 81, 255, 217, + 166, 92, 255, 222, 173, 97, 255, 225, 176, 98, 255, 42, 37, 25, + 255, 4, 4, 4, 74, 0, 56, 13, 12, 10, 170, 208, 141, 61, + 255, 226, 172, 95, 255, 228, 183, 111, 255, 40, 34, 25, 255, 0, + 24, 17, 16, 14, 170, 219, 177, 112, 255, 232, 194, 133, 255, 233, + 202, 148, 255, 27, 24, 20, 255, 0, 8, 16, 15, 13, 85, 199, + 161, 102, 255, 220, 166, 89, 255, 211, 143, 62, 255, 217, 154, 72, + 255, 223, 161, 80, 255, 224, 169, 91, 255, 225, 185, 114, 255, 229, + 188, 124, 255, 231, 190, 132, 255, 231, 200, 143, 255, 227, 195, 140, + 255, 227, 196, 138, 255, 225, 195, 136, 255, 44, 37, 27, 170, 0, + 8, 17, 16, 14, 85, 200, 165, 109, 255, 227, 198, 142, 255, 225, + 191, 132, 255, 227, 195, 134, 255, 231, 199, 136, 255, 231, 197, 132, + 255, 231, 194, 124, 255, 229, 191, 130, 255, 225, 195, 136, 255, 225, + 195, 136, 255, 225, 191, 132, 255, 49, 42, 30, 198, 0, 36, 18, + 17, 13, 105, 193, 135, 66, 255, 221, 175, 102, 255, 222, 186, 123, + 255, 223, 190, 132, 255, 224, 192, 135, 255, 223, 190, 132, 255, 222, + 186, 123, 255, 221, 178, 110, 255, 218, 172, 105, 255, 46, 39, 27, + 195, 0, 48, 6, 6, 6, 28, 27, 26, 20, 255, 216, 170, 97, + 255, 225, 178, 104, 255, 176, 136, 83, 255, 16, 15, 13, 198, 0, + 16, 17, 17, 14, 170, 221, 188, 130, 255, 235, 205, 154, 255, 234, + 205, 155, 255, 232, 204, 149, 255, 228, 199, 143, 255, 171, 144, 96, + 255, 64, 57, 41, 255, 154, 126, 81, 255, 227, 189, 122, 255, 230, + 184, 119, 255, 227, 171, 98, 255, 34, 30, 21, 255, 0, 24, 17, + 16, 14, 170, 221, 186, 126, 255, 234, 202, 147, 255, 232, 192, 135, + 255, 44, 39, 27, 255, 0, 44, 9, 9, 8, 142, 25, 24, 20, + 255, 114, 95, 53, 255, 207, 169, 102, 255, 227, 187, 118, 255, 226, + 188, 123, 255, 178, 148, 95, 255, 19, 18, 16, 170, 0, 32, 24, + 22, 19, 85, 197, 145, 84, 255, 227, 187, 118, 255, 231, 194, 124, + 255, 207, 173, 114, 255, 61, 55, 38, 255, 8, 8, 8, 136, 0, + 12, 10, 10, 9, 108, 45, 36, 21, 255, 195, 116, 38, 255, 207, + 122, 38, 255, 139, 90, 32, 255, 13, 12, 8, 170, 0, 4, 10, + 10, 9, 198, 208, 140, 59, 255, 226, 170, 91, 255, 231, 193, 128, + 255, 40, 35, 27, 255, 0, 36, 4, 4, 3, 28, 18, 17, 13, + 227, 222, 189, 131, 255, 234, 201, 143, 255, 229, 191, 130, 255, 34, + 30, 23, 204, 0, 8, 11, 11, 10, 170, 211, 158, 82, 255, 226, + 170, 91, 255, 224, 165, 81, 255, 219, 154, 70, 255, 208, 132, 51, + 255, 206, 128, 45, 255, 204, 122, 41, 255, 201, 120, 40, 255, 196, + 116, 37, 255, 111, 74, 30, 255, 20, 18, 13, 227, 8, 8, 7, + 28, 0, 28, 6, 6, 6, 28, 28, 26, 21, 255, 222, 186, 123, + 255, 229, 196, 132, 255, 181, 144, 92, 255, 16, 15, 13, 212, 0, + 16, 6, 6, 6, 85, 25, 24, 20, 255, 180, 149, 101, 255, 231, + 205, 154, 255, 232, 204, 149, 255, 227, 198, 142, 255, 223, 192, 138, + 255, 223, 193, 136, 255, 230, 199, 139, 255, 232, 197, 141, 255, 211, + 176, 122, 255, 64, 57, 41, 255, 8, 8, 7, 113, 0, 8, 6, + 6, 5, 14, 33, 31, 24, 227, 186, 155, 107, 255, 232, 204, 149, + 255, 233, 205, 152, 255, 227, 197, 140, 255, 221, 189, 132, 255, 224, + 192, 135, 255, 228, 198, 141, 255, 232, 201, 141, 255, 232, 192, 135, + 255, 231, 197, 132, 255, 41, 35, 26, 255, 0, 64, 17, 16, 14, + 139, 211, 178, 120, 255, 233, 202, 148, 255, 233, 202, 148, 255, 56, + 48, 33, 255, 4, 4, 4, 85, 0, 104, 11, 11, 10, 255, 216, + 164, 89, 255, 230, 191, 123, 255, 227, 195, 134, 255, 40, 35, 27, + 227, 0, 28, 16, 15, 13, 227, 126, 105, 69, 255, 217, 176, 112, + 255, 225, 175, 104, 255, 223, 159, 76, 255, 189, 124, 49, 255, 43, + 35, 20, 255, 9, 8, 8, 57, 0, 8, 10, 10, 9, 133, 194, + 109, 33, 255, 215, 125, 38, 255, 212, 124, 39, 255, 144, 93, 33, + 255, 29, 24, 16, 255, 68, 53, 29, 255, 186, 123, 49, 255, 128, + 95, 47, 255, 25, 24, 20, 255, 143, 119, 78, 255, 230, 201, 145, + 255, 33, 30, 24, 255, 0, 8, 11, 11, 10, 170, 217, 176, 112, + 255, 228, 182, 109, 255, 222, 158, 75, 255, 212, 134, 51, 255, 204, + 122, 41, 255, 198, 117, 37, 255, 200, 118, 37, 255, 208, 123, 39, + 255, 212, 123, 37, 255, 214, 121, 39, 255, 217, 133, 50, 255, 24, + 21, 15, 244, 0, 8, 11, 11, 10, 170, 218, 185, 127, 255, 235, + 203, 148, 255, 233, 202, 148, 255, 230, 201, 145, 255, 227, 197, 140, + 255, 221, 187, 128, 255, 221, 184, 120, 255, 224, 178, 105, 255, 224, + 164, 85, 255, 189, 129, 58, 255, 39, 32, 20, 255, 7, 7, 6, + 85, 0, 8, 11, 10, 8, 125, 194, 109, 33, 255, 215, 125, 38, + 255, 213, 125, 40, 255, 29, 24, 16, 255, 0, 40, 17, 17, 14, + 170, 221, 188, 130, 255, 235, 201, 152, 255, 232, 201, 141, 255, 42, + 36, 27, 255, 0, 12, 17, 17, 14, 170, 219, 179, 116, 255, 231, + 187, 124, 255, 228, 183, 111, 255, 24, 22, 17, 255, 0, 8, 11, + 11, 10, 170, 218, 185, 127, 255, 232, 197, 137, 255, 227, 179, 104, + 255, 219, 155, 72, 255, 208, 132, 51, 255, 204, 122, 41, 255, 202, + 120, 39, 255, 38, 31, 19, 170, 0, 16, 12, 11, 9, 170, 196, + 110, 33, 255, 215, 113, 38, 255, 213, 122, 42, 255, 215, 143, 58, + 255, 217, 166, 92, 255, 222, 186, 123, 255, 225, 195, 136, 255, 52, + 44, 33, 198, 0, 16, 17, 16, 14, 170, 211, 150, 70, 255, 219, + 140, 56, 255, 213, 126, 42, 255, 25, 21, 14, 255, 0, 40, 17, + 17, 14, 170, 221, 187, 128, 255, 232, 199, 141, 255, 228, 180, 111, + 255, 219, 155, 72, 255, 207, 128, 44, 255, 199, 119, 39, 255, 200, + 118, 37, 255, 208, 123, 39, 255, 212, 123, 37, 255, 214, 125, 39, + 255, 212, 124, 39, 255, 34, 26, 15, 181, 0, 8, 11, 10, 10, + 161, 215, 172, 104, 255, 234, 201, 143, 255, 234, 206, 151, 255, 42, + 39, 29, 255, 0, 40, 12, 11, 9, 170, 196, 110, 33, 255, 215, + 125, 38, 255, 212, 124, 39, 255, 36, 28, 17, 170, 0, 8, 15, + 14, 10, 85, 194, 109, 33, 255, 215, 125, 38, 255, 212, 124, 39, + 255, 210, 128, 41, 255, 211, 135, 54, 255, 225, 176, 98, 255, 231, + 197, 132, 255, 56, 48, 33, 255, 4, 4, 4, 85, 0, 20, 17, + 16, 14, 170, 206, 135, 51, 255, 217, 133, 50, 255, 213, 122, 42, + 255, 25, 21, 14, 255, 0, 32, 12, 11, 9, 170, 196, 110, 33, + 255, 215, 125, 38, 255, 213, 122, 42, 255, 67, 51, 28, 255, 6, + 6, 5, 255, 40, 34, 25, 255, 226, 190, 127, 255, 138, 110, 69, + 255, 7, 7, 7, 255, 25, 24, 20, 255, 221, 179, 112, 255, 232, + 191, 127, 255, 232, 201, 141, 255, 26, 23, 19, 255, 0, 8, 11, + 11, 10, 170, 214, 168, 101, 255, 230, 187, 119, 255, 228, 188, 117, + 255, 212, 173, 105, 255, 150, 118, 67, 255, 102, 86, 47, 255, 111, + 90, 50, 255, 185, 145, 88, 255, 227, 187, 118, 255, 231, 195, 132, + 255, 232, 201, 141, 255, 26, 23, 19, 255, 0, 8, 11, 11, 10, + 170, 219, 184, 128, 255, 235, 205, 154, 255, 234, 206, 151, 255, 42, + 36, 27, 255, 0, 12, 15, 15, 12, 170, 213, 158, 80, 255, 228, + 182, 109, 255, 230, 191, 123, 255, 27, 23, 18, 255, 0, 8, 11, + 11, 10, 170, 219, 189, 132, 255, 235, 205, 154, 255, 232, 197, 141, + 255, 225, 185, 114, 255, 215, 155, 78, 255, 206, 135, 51, 255, 205, + 126, 42, 255, 209, 128, 42, 255, 212, 121, 41, 255, 181, 111, 36, + 255, 39, 30, 18, 255, 8, 8, 7, 57, 0, 8, 10, 10, 9, + 136, 194, 109, 33, 255, 215, 125, 38, 255, 212, 124, 39, 255, 24, + 20, 13, 255, 0, 12, 15, 14, 12, 170, 210, 146, 71, 255, 229, + 183, 110, 255, 231, 197, 132, 255, 26, 23, 19, 255, 0, 8, 11, + 11, 10, 170, 218, 189, 127, 255, 234, 199, 143, 255, 231, 197, 132, + 255, 225, 176, 106, 255, 214, 153, 75, 255, 208, 138, 55, 255, 205, + 133, 48, 255, 210, 127, 45, 255, 214, 134, 49, 255, 179, 119, 42, + 255, 37, 30, 18, 255, 7, 7, 6, 85, 0, 12, 23, 20, 14, + 227, 161, 115, 50, 255, 222, 167, 89, 255, 227, 186, 114, 255, 225, + 190, 130, 255, 223, 198, 136, 255, 227, 198, 142, 255, 224, 196, 141, + 255, 221, 191, 134, 255, 161, 130, 86, 255, 33, 30, 24, 229, 10, + 10, 9, 42, 0, 24, 15, 15, 12, 170, 211, 149, 76, 255, 228, + 182, 109, 255, 231, 189, 128, 255, 44, 39, 27, 255, 0, 24, 17, + 17, 14, 170, 216, 170, 97, 255, 226, 172, 95, 255, 224, 165, 81, + 255, 31, 26, 18, 255, 0, 12, 13, 12, 10, 170, 201, 120, 40, + 255, 217, 133, 50, 255, 216, 125, 45, 255, 25, 21, 14, 212, 0, + 8, 11, 10, 8, 144, 203, 130, 52, 255, 224, 166, 83, 255, 228, + 174, 103, 255, 40, 34, 25, 255, 0, 12, 17, 16, 14, 170, 221, + 187, 128, 255, 234, 201, 143, 255, 230, 191, 123, 255, 28, 25, 19, + 244, 0, 8, 10, 10, 9, 164, 203, 122, 50, 255, 220, 148, 63, + 255, 217, 141, 52, 255, 23, 20, 14, 255, 0, 8, 14, 13, 11, + 108, 10, 10, 9, 28, 0, 4, 13, 13, 12, 170, 221, 189, 134, + 255, 235, 205, 154, 255, 234, 206, 151, 255, 42, 37, 27, 255, 0, + 24, 11, 11, 10, 255, 222, 189, 131, 255, 232, 195, 131, 255, 224, + 162, 81, 255, 36, 29, 19, 255, 4, 4, 4, 54, 0, 28, 7, + 7, 6, 28, 19, 17, 12, 232, 93, 66, 30, 255, 183, 112, 36, + 255, 209, 122, 38, 255, 212, 120, 39, 255, 159, 102, 34, 255, 22, + 19, 13, 255, 7, 7, 6, 85, 0, 24, 6, 6, 5, 28, 17, + 16, 14, 227, 149, 122, 84, 255, 227, 195, 140, 255, 227, 191, 134, + 255, 179, 142, 90, 255, 17, 16, 14, 227, 5, 5, 4, 25, 0, + 20, 15, 14, 12, 170, 204, 129, 49, 255, 218, 141, 51, 255, 213, + 126, 42, 255, 25, 21, 14, 255, 0, 24, 8, 7, 7, 91, 68, + 48, 25, 255, 205, 127, 44, 255, 220, 153, 75, 255, 99, 78, 44, + 255, 8, 8, 7, 113, 0, 28, 12, 11, 9, 170, 196, 110, 33, + 255, 215, 125, 38, 255, 212, 124, 39, 255, 24, 20, 13, 255, 0, + 124, 9, 9, 8, 25, 0, 40, 2, 2, 1, 23, 9, 8, 6, + 255, 199, 116, 34, 255, 215, 125, 38, 255, 212, 128, 45, 255, 27, + 24, 16, 207, 0, 8, 11, 11, 10, 170, 219, 184, 128, 255, 235, + 205, 154, 255, 234, 205, 155, 255, 58, 49, 35, 255, 5, 5, 4, + 85, 0, 4, 4, 4, 3, 28, 16, 15, 11, 227, 204, 122, 41, + 255, 215, 126, 40, 255, 210, 123, 39, 255, 32, 25, 15, 170, 0, + 8, 13, 13, 12, 122, 208, 168, 99, 255, 234, 199, 143, 255, 234, + 204, 151, 255, 63, 54, 38, 255, 5, 5, 4, 85, 0, 4, 4, + 4, 3, 28, 18, 17, 13, 215, 204, 127, 45, 255, 214, 125, 39, + 255, 212, 121, 41, 255, 34, 27, 15, 170, 0, 8, 13, 12, 10, + 85, 185, 112, 34, 255, 215, 125, 38, 255, 212, 123, 37, 255, 35, + 28, 16, 255, 4, 4, 3, 85, 0, 4, 3, 3, 2, 28, 12, + 10, 9, 224, 198, 117, 37, 255, 215, 125, 38, 255, 212, 124, 39, + 255, 34, 27, 15, 178, 0, 8, 14, 13, 11, 113, 206, 162, 94, + 255, 232, 199, 141, 255, 234, 207, 155, 255, 63, 53, 36, 255, 4, + 4, 3, 113, 0, 4, 3, 3, 3, 28, 10, 10, 9, 255, 200, + 118, 37, 255, 215, 125, 38, 255, 210, 123, 39, 255, 27, 22, 14, + 227, 0, 12, 3, 3, 2, 6, 13, 11, 8, 221, 199, 116, 34, + 255, 215, 125, 38, 255, 212, 124, 39, 255, 35, 27, 16, 255, 5, + 4, 4, 57, 0, 12, 15, 14, 12, 147, 206, 154, 87, 255, 232, + 195, 137, 255, 234, 204, 151, 255, 63, 54, 38, 255, 5, 5, 4, + 85, 0, 4, 4, 4, 3, 28, 18, 16, 13, 227, 222, 189, 131, + 255, 235, 205, 152, 255, 234, 205, 155, 255, 27, 24, 20, 255, 0, + 8, 11, 11, 10, 170, 219, 184, 130, 255, 235, 205, 152, 255, 234, + 205, 155, 255, 58, 49, 35, 255, 5, 5, 4, 85, 0, 4, 4, + 4, 3, 28, 14, 12, 9, 227, 199, 117, 36, 255, 215, 113, 38, + 255, 210, 123, 39, 255, 32, 25, 15, 170, 0, 8, 12, 12, 9, + 102, 194, 109, 33, 255, 215, 125, 38, 255, 212, 124, 39, 255, 27, + 22, 14, 255, 0, 24, 18, 16, 13, 170, 217, 176, 110, 255, 234, + 196, 143, 255, 234, 204, 151, 255, 27, 24, 20, 255, 0, 8, 11, + 10, 10, 170, 204, 134, 59, 255, 219, 136, 54, 255, 213, 122, 42, + 255, 72, 50, 27, 255, 8, 8, 7, 255, 25, 22, 14, 255, 195, + 116, 38, 255, 208, 123, 39, 255, 142, 91, 31, 255, 16, 14, 9, + 193, 4, 4, 3, 17, 0, 12, 11, 11, 8, 170, 198, 117, 37, + 255, 219, 133, 56, 255, 221, 152, 70, 255, 27, 23, 16, 221, 0, + 8, 13, 12, 10, 99, 193, 113, 34, 255, 223, 156, 70, 255, 231, + 193, 128, 255, 40, 34, 25, 255, 4, 3, 3, 113, 17, 16, 12, + 227, 208, 136, 59, 255, 45, 36, 21, 255, 4, 3, 3, 113, 10, + 9, 7, 207, 196, 110, 33, 255, 215, 125, 38, 255, 210, 128, 41, + 255, 32, 25, 15, 170, 0, 8, 12, 11, 9, 108, 194, 109, 33, + 255, 215, 125, 38, 255, 212, 124, 39, 255, 35, 27, 16, 255, 4, + 4, 3, 85, 0, 4, 3, 3, 2, 28, 12, 11, 9, 227, 199, + 117, 36, 255, 221, 150, 66, 255, 229, 191, 126, 255, 32, 29, 23, + 210, 0, 8, 13, 13, 12, 122, 204, 150, 79, 255, 223, 159, 76, + 255, 217, 141, 52, 255, 84, 57, 29, 255, 9, 8, 6, 170, 5, + 5, 4, 85, 6, 6, 5, 113, 27, 22, 14, 255, 207, 128, 44, + 255, 223, 147, 72, 255, 227, 187, 118, 255, 34, 30, 23, 207, 0, + 8, 12, 11, 11, 170, 218, 180, 119, 255, 229, 184, 114, 255, 224, + 167, 85, 255, 50, 40, 25, 255, 5, 5, 4, 85, 0, 4, 4, + 4, 3, 28, 14, 12, 9, 227, 203, 125, 42, 255, 217, 128, 48, + 255, 213, 128, 45, 255, 35, 27, 16, 173, 0, 8, 12, 12, 11, + 130, 209, 163, 98, 255, 235, 203, 148, 255, 233, 202, 148, 255, 63, + 54, 36, 255, 5, 5, 4, 85, 0, 4, 4, 4, 3, 28, 15, + 15, 12, 227, 209, 137, 60, 255, 221, 151, 68, 255, 219, 147, 62, + 255, 23, 20, 14, 238, 0, 8, 10, 10, 9, 150, 196, 121, 41, + 255, 217, 128, 48, 255, 215, 133, 44, 255, 40, 31, 19, 255, 5, + 5, 5, 85, 0, 4, 4, 4, 3, 28, 16, 14, 11, 207, 201, + 120, 40, 255, 217, 133, 50, 255, 221, 161, 76, 255, 57, 44, 28, + 170, 0, 8, 15, 14, 12, 105, 211, 165, 98, 255, 232, 197, 137, + 255, 232, 199, 141, 255, 58, 49, 35, 255, 4, 4, 3, 113, 0, + 40, 3, 3, 2, 17, 12, 11, 9, 227, 199, 116, 34, 255, 215, + 125, 38, 255, 212, 124, 39, 255, 35, 27, 16, 255, 4, 4, 3, + 62, 0, 12, 12, 11, 9, 170, 200, 120, 41, 255, 223, 159, 76, + 255, 230, 191, 123, 255, 44, 37, 27, 255, 0, 12, 18, 17, 15, + 170, 208, 140, 59, 255, 217, 133, 50, 255, 213, 125, 40, 255, 27, + 23, 14, 195, 0, 8, 12, 11, 9, 108, 194, 109, 33, 255, 215, + 125, 38, 255, 212, 124, 39, 255, 25, 21, 14, 255, 0, 12, 17, + 16, 14, 170, 219, 179, 116, 255, 235, 201, 152, 255, 234, 204, 151, + 255, 27, 24, 20, 255, 0, 8, 10, 10, 9, 170, 198, 122, 41, + 255, 215, 127, 42, 255, 213, 125, 40, 255, 27, 22, 14, 255, 0, + 20, 12, 11, 9, 170, 201, 120, 40, 255, 224, 156, 83, 255, 231, + 190, 132, 255, 40, 33, 25, 255, 0, 12, 10, 10, 9, 85, 52, + 42, 29, 255, 200, 142, 59, 255, 183, 119, 44, 255, 72, 52, 27, + 255, 39, 30, 18, 255, 49, 37, 22, 255, 150, 99, 33, 255, 196, + 116, 37, 255, 77, 50, 24, 255, 10, 9, 7, 144, 0, 12, 10, + 10, 9, 170, 196, 115, 35, 255, 215, 125, 38, 255, 212, 124, 39, + 255, 25, 21, 14, 255, 0, 12, 12, 11, 9, 170, 196, 110, 33, + 255, 214, 127, 43, 255, 222, 158, 75, 255, 41, 34, 24, 255, 0, + 24, 5, 5, 4, 85, 11, 11, 10, 255, 130, 101, 59, 255, 223, + 176, 102, 255, 224, 176, 101, 255, 177, 137, 74, 255, 18, 17, 13, + 227, 6, 5, 5, 28, 0, 12, 20, 19, 15, 85, 186, 120, 49, + 255, 217, 142, 62, 255, 217, 139, 56, 255, 34, 29, 19, 255, 4, + 4, 3, 17, 0, 20, 17, 17, 14, 170, 221, 188, 130, 255, 235, + 205, 152, 255, 234, 205, 155, 255, 42, 39, 29, 255, 0, 24, 13, + 13, 10, 181, 199, 119, 39, 255, 212, 121, 41, 255, 203, 121, 40, + 255, 35, 29, 17, 170, 0, 100, 20, 18, 15, 170, 222, 186, 123, + 255, 234, 201, 143, 255, 232, 197, 135, 255, 47, 40, 28, 255, 0, + 64, 14, 13, 11, 170, 213, 160, 84, 255, 230, 187, 119, 255, 231, + 197, 132, 255, 35, 30, 22, 198, 0, 4, 14, 13, 11, 108, 217, + 176, 112, 255, 232, 193, 137, 255, 231, 197, 132, 255, 33, 28, 22, + 255, 0, 24, 12, 12, 11, 113, 31, 29, 22, 210, 40, 35, 27, + 255, 41, 34, 24, 255, 29, 24, 16, 255, 32, 26, 17, 255, 146, + 92, 35, 255, 214, 134, 49, 255, 212, 128, 45, 255, 123, 81, 36, + 255, 15, 13, 10, 142, 0, 20, 7, 7, 6, 85, 28, 26, 19, + 252, 194, 140, 71, 255, 212, 127, 43, 255, 202, 118, 35, 255, 97, + 66, 30, 255, 15, 14, 10, 207, 6, 6, 5, 25, 0, 24, 6, + 6, 5, 8, 15, 13, 12, 227, 111, 86, 50, 255, 209, 168, 102, + 255, 176, 136, 83, 255, 85, 67, 44, 255, 163, 129, 80, 255, 221, + 186, 126, 255, 83, 69, 44, 255, 7, 7, 6, 170, 5, 5, 5, + 8, 0, 4, 9, 9, 8, 108, 20, 18, 13, 170, 13, 12, 10, + 51, 0, 36, 16, 15, 13, 170, 217, 176, 110, 255, 232, 194, 133, + 255, 232, 198, 139, 255, 36, 33, 25, 255, 0, 24, 15, 15, 12, + 170, 219, 179, 116, 255, 232, 193, 137, 255, 232, 199, 135, 255, 31, + 26, 20, 255, 0, 8, 11, 11, 10, 28, 56, 48, 33, 227, 98, + 76, 45, 255, 104, 80, 45, 255, 195, 154, 96, 255, 227, 186, 114, + 255, 226, 189, 125, 255, 207, 173, 114, 255, 222, 188, 123, 255, 231, + 190, 132, 255, 217, 188, 124, 255, 137, 109, 70, 255, 99, 86, 54, + 255, 78, 64, 43, 255, 21, 20, 16, 85, 0, 8, 12, 12, 11, + 28, 54, 48, 35, 227, 86, 72, 47, 255, 74, 63, 43, 255, 171, + 137, 84, 255, 229, 191, 130, 255, 230, 191, 123, 255, 230, 186, 123, + 255, 202, 164, 105, 255, 97, 80, 50, 255, 75, 64, 44, 255, 72, + 61, 39, 255, 22, 21, 17, 102, 0, 36, 12, 11, 11, 45, 55, + 45, 30, 227, 90, 71, 45, 255, 78, 63, 41, 255, 72, 61, 39, + 255, 74, 63, 43, 255, 72, 61, 39, 255, 72, 61, 39, 255, 91, + 74, 46, 255, 78, 63, 41, 255, 22, 20, 17, 102, 0, 48, 12, + 12, 11, 176, 132, 106, 61, 255, 228, 188, 125, 255, 210, 172, 113, + 255, 42, 37, 29, 255, 9, 9, 8, 62, 0, 16, 17, 16, 14, + 170, 221, 186, 124, 255, 234, 199, 143, 255, 232, 201, 141, 255, 232, + 201, 141, 255, 221, 189, 134, 255, 52, 46, 33, 255, 6, 7, 6, + 227, 24, 23, 17, 255, 208, 132, 51, 255, 215, 133, 44, 255, 212, + 124, 39, 255, 24, 20, 13, 255, 0, 24, 17, 16, 12, 170, 219, + 177, 112, 255, 231, 187, 124, 255, 228, 182, 109, 255, 40, 33, 23, + 255, 0, 36, 9, 9, 8, 74, 17, 15, 12, 227, 67, 51, 28, + 255, 162, 107, 43, 255, 200, 142, 67, 255, 204, 157, 91, 255, 177, + 140, 86, 255, 74, 63, 43, 255, 19, 17, 16, 198, 9, 9, 8, + 28, 0, 32, 14, 14, 11, 31, 56, 46, 31, 227, 192, 157, 103, + 255, 229, 194, 128, 255, 225, 188, 124, 255, 146, 112, 67, 255, 11, + 10, 8, 164, 0, 8, 7, 7, 6, 28, 34, 27, 17, 255, 190, + 107, 33, 255, 210, 121, 35, 255, 146, 95, 35, 255, 16, 14, 11, + 187, 0, 8, 9, 9, 8, 170, 214, 164, 93, 255, 232, 194, 127, + 255, 231, 195, 132, 255, 40, 34, 25, 255, 0, 40, 13, 13, 10, + 170, 213, 157, 84, 255, 224, 166, 83, 255, 221, 150, 66, 255, 23, + 20, 14, 246, 0, 8, 12, 11, 9, 113, 194, 109, 33, 255, 212, + 119, 37, 255, 210, 113, 35, 255, 168, 103, 33, 255, 56, 42, 23, + 255, 27, 23, 14, 255, 38, 31, 19, 255, 149, 92, 30, 255, 207, + 118, 32, 255, 207, 113, 30, 255, 124, 75, 27, 255, 13, 11, 8, + 161, 0, 28, 12, 12, 11, 176, 130, 99, 59, 255, 229, 191, 126, + 255, 211, 174, 116, 255, 43, 37, 28, 255, 9, 9, 8, 59, 0, + 16, 8, 8, 7, 85, 68, 58, 37, 255, 214, 177, 119, 255, 231, + 196, 136, 255, 207, 171, 114, 255, 97, 80, 50, 255, 54, 47, 35, + 255, 66, 59, 41, 255, 178, 148, 95, 255, 228, 189, 121, 255, 224, + 187, 123, 255, 146, 112, 67, 255, 12, 12, 11, 170, 0, 12, 10, + 10, 9, 28, 16, 15, 13, 147, 29, 28, 22, 221, 48, 42, 31, + 255, 70, 61, 41, 255, 66, 57, 39, 255, 70, 61, 41, 255, 171, + 140, 92, 255, 224, 170, 101, 255, 224, 168, 87, 255, 224, 165, 81, + 255, 39, 32, 22, 255, 0, 64, 14, 13, 11, 57, 100, 82, 51, + 255, 222, 186, 123, 255, 226, 172, 95, 255, 113, 82, 38, 255, 9, + 8, 8, 127, 0, 32, 11, 9, 6, 102, 11, 10, 6, 170, 11, + 10, 8, 170, 12, 11, 9, 170, 15, 13, 10, 170, 15, 13, 10, + 170, 15, 14, 10, 170, 18, 15, 11, 170, 18, 15, 11, 156, 12, + 11, 9, 28, 0, 28, 6, 6, 5, 65, 40, 34, 25, 255, 224, + 183, 119, 255, 229, 195, 136, 255, 171, 140, 92, 255, 21, 20, 18, + 142, 0, 24, 11, 10, 8, 102, 131, 92, 46, 255, 213, 145, 56, + 255, 214, 119, 43, 255, 210, 128, 41, 255, 151, 94, 32, 255, 23, + 21, 14, 255, 10, 10, 9, 85, 0, 12, 10, 9, 7, 170, 191, + 106, 30, 255, 211, 115, 30, 255, 208, 114, 31, 255, 141, 87, 30, + 255, 36, 31, 19, 255, 121, 90, 42, 255, 217, 168, 92, 255, 205, + 163, 102, 255, 132, 102, 59, 255, 213, 172, 108, 255, 231, 193, 128, + 255, 35, 30, 22, 255, 0, 8, 11, 11, 10, 164, 203, 129, 50, + 255, 215, 127, 42, 255, 211, 117, 34, 255, 166, 97, 29, 255, 54, + 40, 21, 255, 29, 23, 14, 255, 38, 31, 19, 255, 120, 78, 29, + 255, 206, 118, 33, 255, 214, 127, 43, 255, 224, 155, 81, 255, 23, + 21, 16, 255, 0, 8, 11, 10, 10, 170, 217, 183, 116, 255, 234, + 201, 143, 255, 232, 198, 139, 255, 202, 166, 109, 255, 97, 78, 50, + 255, 52, 46, 33, 255, 58, 50, 33, 255, 150, 96, 39, 255, 208, + 121, 37, 255, 195, 112, 30, 255, 83, 53, 24, 255, 9, 8, 6, + 113, 0, 8, 13, 12, 8, 96, 189, 104, 28, 255, 210, 120, 33, + 255, 214, 132, 45, 255, 34, 29, 19, 255, 0, 40, 17, 16, 12, + 170, 217, 172, 102, 255, 228, 180, 105, 255, 228, 181, 107, 255, 40, + 33, 23, 255, 0, 12, 17, 15, 12, 170, 216, 171, 101, 255, 232, + 191, 127, 255, 231, 197, 132, 255, 24, 22, 17, 255, 0, 8, 11, + 11, 10, 167, 209, 146, 72, 255, 221, 151, 68, 255, 213, 126, 42, + 255, 172, 106, 35, 255, 57, 41, 22, 255, 42, 32, 19, 255, 43, + 33, 20, 252, 18, 15, 11, 85, 0, 16, 11, 10, 8, 170, 193, + 111, 30, 255, 215, 113, 38, 255, 220, 144, 63, 255, 197, 145, 84, + 255, 91, 71, 44, 255, 75, 62, 42, 255, 75, 64, 44, 255, 22, + 21, 17, 99, 0, 16, 14, 13, 11, 170, 196, 110, 33, 255, 210, + 115, 31, 255, 210, 115, 31, 255, 22, 19, 11, 227, 0, 8, 16, + 13, 9, 113, 24, 21, 15, 170, 17, 15, 12, 170, 18, 15, 13, + 170, 19, 17, 12, 142, 9, 8, 8, 28, 0, 8, 14, 13, 11, + 170, 210, 146, 71, 255, 220, 142, 59, 255, 213, 125, 40, 255, 168, + 103, 33, 255, 54, 40, 21, 255, 29, 23, 14, 255, 38, 31, 19, + 255, 119, 78, 30, 255, 204, 116, 31, 255, 210, 119, 31, 255, 210, + 115, 31, 255, 26, 20, 13, 210, 0, 8, 11, 11, 10, 170, 217, + 179, 120, 255, 234, 202, 147, 255, 232, 201, 141, 255, 40, 35, 25, + 255, 0, 40, 11, 10, 8, 170, 193, 111, 30, 255, 211, 115, 30, + 255, 210, 115, 31, 255, 36, 25, 13, 170, 0, 8, 14, 12, 9, + 85, 190, 105, 29, 255, 210, 107, 31, 255, 208, 114, 31, 255, 187, + 124, 42, 255, 143, 111, 56, 255, 210, 171, 109, 255, 229, 187, 128, + 255, 131, 99, 54, 255, 8, 8, 7, 156, 0, 20, 13, 12, 10, + 170, 194, 112, 31, 255, 210, 107, 31, 255, 210, 115, 31, 255, 22, + 19, 11, 255, 0, 32, 11, 10, 8, 170, 193, 111, 30, 255, 215, + 125, 38, 255, 218, 141, 59, 255, 39, 33, 22, 255, 5, 5, 5, + 28, 12, 12, 11, 170, 156, 126, 83, 255, 27, 24, 20, 227, 5, + 5, 5, 23, 14, 13, 11, 198, 219, 177, 112, 255, 232, 191, 127, + 255, 230, 191, 123, 255, 25, 22, 16, 249, 0, 8, 11, 10, 8, + 153, 200, 120, 41, 255, 214, 127, 43, 255, 213, 126, 42, 255, 93, + 66, 32, 255, 11, 11, 10, 255, 34, 31, 23, 255, 206, 152, 81, + 255, 226, 179, 111, 255, 231, 189, 128, 255, 232, 192, 135, 255, 232, + 201, 141, 255, 25, 22, 18, 255, 0, 8, 11, 10, 10, 170, 215, + 171, 102, 255, 228, 174, 105, 255, 222, 158, 75, 255, 27, 24, 16, + 255, 0, 12, 15, 15, 12, 170, 219, 177, 112, 255, 232, 193, 137, + 255, 232, 201, 141, 255, 25, 22, 18, 255, 0, 8, 11, 10, 10, + 170, 215, 172, 104, 255, 228, 182, 109, 255, 221, 155, 70, 255, 177, + 114, 46, 255, 55, 42, 24, 255, 35, 28, 18, 255, 41, 31, 18, + 255, 35, 28, 17, 255, 27, 22, 14, 255, 17, 16, 12, 187, 9, + 9, 8, 79, 0, 12, 10, 9, 7, 170, 191, 106, 30, 255, 211, + 115, 30, 255, 210, 115, 31, 255, 33, 25, 14, 255, 0, 12, 21, + 20, 16, 170, 221, 180, 116, 255, 232, 193, 137, 255, 232, 201, 141, + 255, 25, 22, 18, 255, 0, 8, 11, 11, 10, 170, 212, 160, 85, + 255, 224, 156, 83, 255, 218, 141, 59, 255, 175, 115, 44, 255, 55, + 42, 24, 255, 31, 25, 16, 255, 38, 30, 19, 255, 127, 82, 30, + 255, 204, 116, 31, 255, 195, 112, 30, 255, 82, 55, 25, 255, 11, + 10, 8, 150, 0, 12, 9, 9, 8, 28, 15, 14, 12, 142, 28, + 25, 19, 221, 46, 40, 29, 255, 71, 60, 38, 255, 66, 57, 39, + 255, 70, 61, 41, 255, 193, 159, 106, 255, 227, 184, 108, 255, 221, + 153, 72, 255, 155, 98, 36, 255, 13, 12, 10, 170, 0, 24, 17, + 15, 12, 170, 219, 180, 112, 255, 232, 197, 137, 255, 232, 201, 141, + 255, 40, 35, 25, 255, 0, 24, 14, 13, 11, 170, 198, 117, 37, + 255, 213, 124, 38, 255, 210, 121, 35, 255, 23, 19, 12, 255, 0, + 12, 11, 10, 8, 170, 193, 111, 30, 255, 211, 115, 30, 255, 208, + 114, 31, 255, 23, 19, 12, 207, 0, 8, 14, 13, 11, 85, 181, + 132, 68, 255, 228, 185, 117, 255, 231, 193, 128, 255, 54, 46, 31, + 255, 5, 5, 4, 8, 0, 8, 21, 20, 16, 178, 215, 160, 88, + 255, 223, 147, 72, 255, 206, 135, 51, 255, 23, 20, 14, 170, 0, + 8, 12, 11, 9, 102, 192, 111, 31, 255, 210, 108, 33, 255, 208, + 114, 31, 255, 22, 18, 11, 255, 0, 4, 10, 10, 9, 113, 79, + 61, 38, 255, 17, 16, 12, 198, 0, 4, 16, 15, 13, 170, 219, + 179, 116, 255, 231, 187, 124, 255, 224, 169, 91, 255, 33, 28, 20, + 255, 0, 20, 9, 8, 8, 85, 39, 33, 24, 255, 217, 166, 92, + 255, 219, 140, 56, 255, 210, 121, 35, 255, 66, 44, 21, 255, 7, + 7, 6, 133, 0, 32, 6, 6, 5, 74, 19, 18, 12, 255, 183, + 102, 30, 255, 207, 105, 30, 255, 210, 111, 31, 255, 73, 51, 24, + 255, 8, 8, 7, 116, 0, 24, 6, 6, 6, 28, 15, 13, 12, + 227, 144, 112, 61, 255, 221, 180, 116, 255, 224, 178, 113, 255, 152, + 116, 65, 255, 18, 17, 13, 221, 8, 8, 7, 28, 0, 24, 12, + 10, 9, 170, 193, 111, 30, 255, 210, 107, 31, 255, 210, 115, 31, + 255, 22, 19, 11, 255, 0, 28, 16, 15, 13, 227, 164, 122, 63, + 255, 225, 185, 114, 255, 192, 153, 97, 255, 21, 19, 16, 232, 7, + 7, 6, 28, 0, 24, 11, 10, 8, 170, 193, 111, 30, 255, 211, + 115, 30, 255, 210, 115, 31, 255, 23, 19, 12, 255, 0, 148, 6, + 6, 5, 51, 11, 9, 6, 85, 12, 10, 7, 102, 10, 8, 5, + 156, 10, 8, 5, 127, 8, 7, 5, 184, 27, 22, 12, 255, 198, + 105, 29, 255, 211, 122, 36, 255, 220, 136, 61, 255, 25, 22, 16, + 255, 0, 8, 10, 10, 9, 170, 218, 181, 123, 255, 234, 202, 147, + 255, 232, 197, 141, 255, 30, 27, 21, 255, 0, 12, 9, 8, 6, + 170, 191, 106, 30, 255, 211, 115, 30, 255, 210, 111, 31, 255, 39, + 27, 14, 170, 0, 8, 12, 11, 11, 170, 218, 180, 119, 255, 234, + 196, 143, 255, 232, 201, 141, 255, 29, 26, 20, 255, 0, 12, 7, + 7, 6, 28, 27, 22, 14, 156, 25, 22, 14, 255, 32, 25, 15, + 210, 22, 18, 11, 28, 0, 8, 10, 9, 7, 150, 195, 112, 30, + 255, 211, 115, 30, 255, 210, 115, 31, 255, 19, 15, 10, 252, 0, + 12, 9, 9, 8, 170, 191, 106, 30, 255, 211, 111, 30, 255, 208, + 114, 31, 255, 25, 20, 12, 204, 0, 8, 12, 11, 11, 170, 218, + 180, 119, 255, 234, 202, 147, 255, 232, 201, 141, 255, 142, 111, 63, + 255, 14, 12, 9, 227, 10, 9, 7, 127, 8, 7, 5, 181, 35, + 25, 14, 255, 199, 112, 28, 255, 209, 118, 30, 255, 209, 117, 28, + 255, 30, 22, 13, 255, 0, 16, 9, 8, 6, 167, 191, 106, 30, + 255, 211, 115, 30, 255, 210, 115, 31, 255, 19, 15, 10, 252, 0, + 16, 21, 19, 16, 170, 220, 178, 113, 255, 232, 197, 137, 255, 232, + 201, 141, 255, 26, 23, 19, 255, 0, 12, 11, 11, 10, 170, 218, + 181, 123, 255, 234, 201, 143, 255, 231, 197, 132, 255, 24, 22, 17, + 255, 0, 8, 11, 10, 10, 170, 218, 181, 123, 255, 234, 201, 143, + 255, 231, 197, 132, 255, 30, 26, 21, 255, 0, 12, 9, 8, 6, + 167, 191, 106, 30, 255, 211, 115, 30, 255, 210, 111, 31, 255, 39, + 27, 14, 170, 0, 8, 13, 12, 8, 85, 190, 105, 29, 255, 213, + 119, 36, 255, 214, 132, 45, 255, 32, 26, 17, 255, 0, 24, 17, + 16, 14, 170, 221, 186, 124, 255, 234, 202, 147, 255, 232, 199, 135, + 255, 25, 22, 18, 252, 0, 8, 11, 10, 8, 127, 192, 111, 31, + 255, 210, 107, 31, 255, 208, 114, 31, 255, 161, 94, 28, 255, 65, + 43, 20, 255, 145, 85, 26, 255, 207, 117, 30, 255, 122, 75, 29, + 255, 15, 14, 10, 170, 5, 5, 4, 8, 0, 16, 11, 10, 8, + 170, 196, 115, 35, 255, 223, 146, 70, 255, 228, 183, 111, 255, 25, + 22, 16, 252, 0, 8, 14, 12, 9, 85, 190, 105, 29, 255, 215, + 125, 38, 255, 218, 141, 59, 255, 30, 24, 17, 195, 0, 4, 10, + 10, 7, 170, 193, 111, 30, 255, 20, 17, 11, 252, 0, 4, 11, + 10, 8, 85, 188, 103, 27, 255, 211, 115, 30, 255, 209, 106, 30, + 255, 39, 27, 14, 170, 0, 8, 13, 12, 8, 85, 190, 105, 29, + 255, 211, 115, 30, 255, 210, 115, 31, 255, 19, 15, 10, 255, 0, + 12, 9, 8, 6, 167, 192, 111, 31, 255, 218, 137, 51, 255, 227, + 175, 100, 255, 27, 24, 18, 255, 0, 8, 11, 10, 8, 147, 196, + 106, 33, 255, 210, 108, 33, 255, 210, 115, 31, 255, 30, 23, 13, + 255, 4, 4, 3, 14, 0, 8, 15, 14, 12, 195, 211, 149, 76, + 255, 229, 184, 114, 255, 232, 199, 135, 255, 28, 25, 19, 255, 0, + 8, 11, 10, 8, 167, 203, 129, 50, 255, 215, 127, 42, 255, 210, + 121, 35, 255, 20, 17, 11, 232, 0, 12, 9, 8, 6, 139, 190, + 105, 29, 255, 211, 111, 30, 255, 209, 114, 30, 255, 30, 22, 13, + 198, 0, 8, 13, 12, 10, 170, 217, 173, 104, 255, 232, 193, 137, + 255, 232, 194, 139, 255, 25, 22, 18, 255, 0, 12, 9, 8, 8, + 156, 192, 111, 31, 255, 210, 108, 33, 255, 210, 115, 31, 255, 32, + 24, 13, 173, 0, 8, 13, 12, 8, 88, 190, 105, 29, 255, 211, + 115, 30, 255, 208, 114, 31, 255, 19, 15, 10, 255, 0, 12, 7, + 7, 6, 28, 27, 22, 14, 198, 45, 36, 21, 255, 52, 43, 29, + 244, 14, 13, 11, 85, 0, 8, 13, 13, 12, 88, 177, 143, 90, + 255, 230, 194, 131, 255, 226, 172, 95, 255, 137, 91, 36, 255, 10, + 9, 7, 227, 8, 8, 5, 161, 10, 9, 7, 167, 10, 9, 7, + 136, 13, 10, 6, 85, 7, 6, 6, 74, 0, 24, 9, 8, 6, + 167, 191, 106, 30, 255, 211, 115, 30, 255, 210, 115, 31, 255, 19, + 15, 10, 252, 0, 16, 12, 11, 9, 170, 208, 141, 61, 255, 230, + 187, 119, 255, 232, 201, 141, 255, 40, 34, 25, 255, 0, 12, 14, + 12, 9, 170, 196, 109, 31, 255, 210, 107, 31, 255, 210, 115, 31, + 255, 36, 25, 13, 170, 0, 8, 10, 9, 7, 85, 155, 91, 28, + 255, 208, 114, 31, 255, 209, 106, 30, 255, 30, 22, 13, 255, 0, + 12, 22, 21, 17, 176, 222, 186, 123, 255, 234, 199, 143, 255, 226, + 195, 135, 255, 35, 29, 22, 178, 0, 8, 12, 11, 9, 105, 190, + 105, 29, 255, 211, 115, 30, 255, 208, 114, 31, 255, 23, 19, 12, + 210, 0, 8, 15, 12, 8, 59, 7, 6, 4, 3, 0, 4, 9, + 9, 8, 159, 204, 134, 59, 255, 230, 182, 119, 255, 232, 198, 139, + 255, 39, 33, 24, 255, 0, 16, 10, 10, 9, 34, 15, 14, 10, + 198, 52, 40, 21, 255, 165, 96, 28, 255, 198, 113, 29, 255, 185, + 102, 28, 255, 80, 53, 25, 255, 19, 17, 12, 227, 10, 9, 7, + 76, 0, 16, 11, 10, 8, 170, 195, 112, 30, 255, 211, 115, 30, + 255, 210, 115, 31, 255, 20, 16, 11, 255, 0, 12, 10, 9, 7, + 170, 192, 111, 31, 255, 215, 125, 38, 255, 224, 159, 83, 255, 41, + 33, 24, 255, 0, 24, 7, 7, 6, 108, 24, 20, 13, 255, 146, + 88, 31, 255, 195, 127, 38, 255, 113, 77, 34, 255, 15, 14, 12, + 210, 7, 7, 6, 28, 0, 16, 12, 12, 11, 28, 37, 30, 18, + 227, 168, 99, 31, 255, 206, 114, 33, 255, 51, 34, 18, 255, 6, + 5, 5, 71, 0, 20, 17, 16, 14, 170, 221, 186, 124, 255, 234, + 202, 147, 255, 232, 201, 141, 255, 40, 35, 25, 255, 0, 24, 17, + 15, 10, 227, 198, 105, 29, 255, 194, 109, 33, 255, 62, 44, 23, + 255, 16, 14, 11, 85, 0, 100, 19, 17, 12, 142, 214, 171, 97, + 255, 228, 183, 113, 255, 227, 186, 108, 255, 50, 40, 25, 227, 0, + 64, 12, 11, 9, 198, 214, 158, 85, 255, 229, 183, 110, 255, 228, + 181, 107, 255, 21, 19, 14, 249, 2, 2, 1, 20, 8, 8, 7, + 181, 210, 156, 79, 255, 226, 169, 95, 255, 224, 155, 81, 255, 33, + 26, 18, 255, 4, 4, 4, 28, 0, 40, 3, 3, 2, 28, 11, + 10, 8, 255, 209, 138, 62, 255, 223, 154, 72, 255, 221, 164, 82, + 255, 27, 23, 16, 249, 0, 16, 7, 7, 6, 79, 46, 38, 25, + 255, 197, 151, 84, 255, 222, 161, 89, 255, 209, 128, 42, 255, 141, + 91, 32, 255, 15, 13, 10, 218, 5, 5, 5, 11, 0, 28, 15, + 13, 10, 139, 191, 131, 60, 255, 220, 168, 93, 255, 168, 123, 69, + 255, 14, 13, 11, 227, 5, 5, 5, 85, 9, 9, 8, 170, 105, + 78, 40, 255, 162, 116, 61, 255, 88, 66, 37, 255, 23, 21, 16, + 255, 11, 11, 10, 255, 78, 58, 35, 255, 208, 150, 75, 255, 61, + 46, 28, 181, 0, 36, 15, 13, 10, 170, 216, 170, 97, 255, 230, + 187, 119, 255, 228, 178, 113, 255, 34, 28, 19, 255, 0, 24, 15, + 13, 10, 170, 215, 167, 92, 255, 229, 179, 114, 255, 228, 181, 107, + 255, 32, 27, 19, 255, 0, 16, 6, 6, 6, 25, 5, 5, 4, + 198, 52, 42, 27, 255, 220, 169, 97, 255, 189, 142, 76, 255, 35, + 31, 22, 255, 134, 96, 51, 255, 225, 176, 106, 255, 140, 106, 53, + 255, 6, 6, 5, 255, 6, 6, 6, 51, 0, 28, 5, 5, 5, + 28, 15, 13, 10, 227, 208, 136, 59, 255, 218, 138, 53, 255, 213, + 122, 42, 255, 43, 31, 18, 255, 5, 5, 4, 85, 0, 136, 9, + 8, 8, 57, 57, 47, 30, 255, 212, 163, 93, 255, 224, 157, 85, + 255, 124, 90, 45, 255, 10, 10, 9, 147, 0, 20, 15, 13, 10, + 170, 216, 170, 97, 255, 228, 181, 107, 255, 224, 165, 81, 255, 194, + 136, 61, 255, 58, 46, 29, 255, 12, 12, 11, 85, 0, 4, 10, + 9, 7, 156, 174, 91, 23, 255, 202, 103, 23, 255, 202, 102, 21, + 255, 20, 16, 9, 255, 0, 24, 15, 13, 10, 170, 213, 155, 80, + 255, 227, 175, 100, 255, 227, 171, 98, 255, 35, 29, 20, 255, 0, + 32, 7, 7, 6, 85, 49, 33, 18, 255, 183, 108, 34, 255, 209, + 128, 42, 255, 209, 137, 60, 255, 186, 134, 67, 255, 95, 74, 39, + 255, 22, 20, 15, 229, 8, 8, 7, 105, 0, 44, 5, 4, 4, + 28, 17, 15, 12, 227, 216, 167, 89, 255, 228, 181, 107, 255, 223, + 176, 102, 255, 34, 28, 19, 184, 0, 8, 12, 11, 9, 108, 180, + 106, 33, 255, 214, 125, 39, 255, 217, 141, 52, 255, 42, 33, 21, + 255, 4, 4, 4, 85, 0, 8, 11, 10, 8, 198, 211, 149, 76, + 255, 224, 160, 77, 255, 220, 144, 63, 255, 34, 27, 17, 255, 0, + 40, 12, 10, 7, 170, 189, 99, 26, 255, 206, 102, 25, 255, 203, + 100, 24, 255, 30, 21, 11, 176, 0, 8, 12, 10, 7, 85, 167, + 87, 22, 255, 202, 103, 23, 255, 202, 102, 21, 255, 27, 20, 10, + 255, 4, 4, 3, 68, 0, 4, 4, 4, 4, 28, 12, 10, 7, + 215, 176, 91, 23, 255, 203, 104, 24, 255, 202, 105, 27, 255, 28, + 21, 13, 249, 0, 24, 9, 8, 8, 57, 57, 47, 30, 255, 213, + 167, 94, 255, 228, 184, 115, 255, 126, 92, 47, 255, 9, 9, 8, + 147, 0, 20, 13, 12, 10, 167, 199, 131, 58, 255, 220, 148, 63, + 255, 219, 147, 62, 255, 49, 38, 24, 255, 6, 6, 6, 85, 0, + 4, 5, 5, 5, 28, 15, 14, 12, 227, 217, 169, 94, 255, 228, + 183, 111, 255, 225, 174, 102, 255, 31, 25, 18, 241, 0, 36, 5, + 5, 5, 28, 15, 13, 10, 227, 204, 127, 45, 255, 219, 133, 56, + 255, 221, 150, 66, 255, 35, 28, 18, 255, 0, 68, 10, 9, 9, + 85, 45, 34, 21, 255, 201, 110, 30, 255, 192, 100, 25, 255, 57, + 35, 16, 255, 12, 10, 7, 85, 0, 24, 13, 11, 6, 79, 126, + 68, 21, 255, 191, 100, 26, 255, 198, 117, 37, 255, 208, 139, 65, + 255, 213, 155, 80, 255, 214, 161, 85, 255, 215, 167, 92, 255, 216, + 167, 89, 255, 215, 160, 88, 255, 49, 38, 24, 170, 0, 24, 7, + 7, 6, 76, 45, 36, 24, 249, 207, 164, 90, 255, 228, 183, 111, + 255, 143, 111, 56, 255, 13, 12, 10, 170, 0, 28, 13, 12, 8, + 142, 182, 99, 25, 255, 203, 108, 24, 255, 202, 102, 21, 255, 112, + 65, 23, 255, 15, 13, 8, 227, 6, 6, 5, 45, 0, 16, 10, + 8, 7, 170, 171, 89, 22, 255, 202, 95, 23, 255, 202, 103, 23, + 255, 103, 64, 26, 255, 20, 18, 13, 255, 79, 61, 36, 255, 222, + 173, 97, 255, 227, 179, 104, 255, 224, 172, 97, 255, 226, 171, 99, + 255, 224, 176, 93, 255, 36, 29, 19, 207, 0, 8, 12, 10, 7, + 113, 176, 91, 23, 255, 202, 95, 23, 255, 202, 102, 21, 255, 27, + 20, 10, 255, 4, 4, 3, 74, 0, 4, 4, 4, 4, 28, 11, + 9, 6, 215, 187, 101, 24, 255, 216, 134, 45, 255, 226, 172, 95, + 255, 23, 21, 16, 241, 0, 8, 10, 10, 9, 161, 212, 160, 85, + 255, 226, 172, 95, 255, 222, 158, 75, 255, 51, 39, 24, 255, 6, + 6, 6, 85, 0, 4, 4, 4, 3, 28, 11, 10, 6, 215, 176, + 91, 23, 255, 202, 102, 21, 255, 191, 102, 22, 255, 22, 17, 9, + 170, 0, 8, 12, 10, 7, 85, 167, 87, 22, 255, 204, 105, 25, + 255, 217, 133, 50, 255, 35, 28, 18, 255, 0, 40, 15, 13, 10, + 170, 199, 116, 34, 255, 212, 114, 35, 255, 218, 139, 55, 255, 33, + 27, 18, 255, 0, 12, 15, 13, 10, 170, 213, 160, 84, 255, 227, + 175, 100, 255, 224, 165, 81, 255, 25, 21, 14, 235, 0, 8, 13, + 11, 8, 108, 184, 96, 25, 255, 203, 96, 24, 255, 202, 95, 23, + 255, 27, 20, 10, 255, 4, 4, 3, 71, 0, 28, 10, 9, 7, + 170, 187, 101, 24, 255, 216, 134, 45, 255, 224, 167, 85, 255, 54, + 42, 27, 255, 6, 6, 6, 85, 0, 28, 10, 9, 7, 170, 171, + 89, 22, 255, 202, 103, 23, 255, 202, 102, 21, 255, 29, 21, 10, + 170, 0, 4, 11, 9, 6, 42, 137, 77, 24, 255, 211, 136, 56, + 255, 215, 167, 92, 255, 216, 166, 95, 255, 213, 163, 84, 255, 33, + 28, 18, 161, 0, 8, 11, 10, 8, 130, 184, 100, 25, 255, 203, + 100, 24, 255, 202, 102, 21, 255, 27, 20, 10, 255, 4, 4, 3, + 74, 0, 4, 4, 4, 4, 28, 11, 9, 6, 215, 176, 91, 23, + 255, 202, 103, 23, 255, 202, 95, 23, 255, 28, 21, 11, 190, 0, + 8, 10, 10, 9, 161, 212, 161, 89, 255, 228, 174, 105, 255, 223, + 161, 80, 255, 33, 28, 18, 255, 0, 40, 10, 9, 7, 167, 171, + 89, 22, 255, 202, 103, 23, 255, 202, 102, 21, 255, 29, 21, 10, + 170, 0, 8, 12, 10, 7, 85, 167, 87, 22, 255, 202, 103, 23, + 255, 203, 108, 24, 255, 68, 47, 25, 255, 6, 6, 5, 255, 31, + 26, 20, 255, 220, 168, 93, 255, 220, 177, 101, 255, 110, 80, 41, + 255, 12, 11, 9, 150, 0, 16, 10, 9, 7, 170, 171, 89, 22, + 255, 202, 103, 23, 255, 202, 102, 21, 255, 20, 16, 9, 255, 0, + 32, 10, 9, 7, 170, 193, 111, 30, 255, 219, 136, 54, 255, 224, + 165, 81, 255, 27, 24, 16, 255, 0, 4, 7, 7, 7, 28, 21, + 20, 16, 181, 10, 10, 9, 85, 0, 4, 12, 11, 9, 170, 204, + 130, 51, 255, 218, 141, 51, 255, 211, 122, 36, 255, 32, 23, 13, + 187, 0, 8, 13, 11, 8, 85, 167, 87, 22, 255, 203, 100, 24, + 255, 208, 105, 29, 255, 23, 19, 12, 255, 4, 4, 3, 28, 11, + 10, 8, 181, 211, 158, 82, 255, 229, 183, 110, 255, 228, 183, 111, + 255, 228, 183, 113, 255, 228, 181, 107, 255, 27, 23, 16, 229, 0, + 8, 10, 10, 9, 150, 192, 111, 31, 255, 208, 112, 27, 255, 203, + 108, 24, 255, 21, 17, 10, 255, 0, 12, 15, 13, 10, 170, 216, + 170, 97, 255, 229, 183, 110, 255, 228, 181, 107, 255, 25, 21, 16, + 235, 0, 8, 11, 10, 8, 142, 194, 116, 33, 255, 209, 106, 30, + 255, 203, 108, 24, 255, 27, 20, 10, 255, 4, 4, 3, 74, 0, + 36, 10, 8, 7, 170, 171, 89, 22, 255, 202, 103, 23, 255, 202, + 102, 21, 255, 42, 28, 13, 255, 6, 5, 5, 48, 0, 4, 6, + 6, 6, 28, 21, 19, 14, 255, 221, 175, 102, 255, 229, 179, 114, + 255, 228, 181, 107, 255, 24, 20, 15, 246, 0, 8, 12, 11, 9, + 127, 190, 104, 27, 255, 206, 106, 25, 255, 202, 103, 23, 255, 27, + 20, 10, 255, 4, 4, 3, 74, 0, 4, 4, 4, 4, 28, 11, + 10, 6, 215, 176, 91, 23, 255, 204, 105, 25, 255, 207, 122, 38, + 255, 28, 22, 15, 238, 0, 36, 5, 5, 5, 28, 15, 13, 10, + 227, 195, 111, 28, 255, 204, 105, 25, 255, 197, 100, 22, 255, 22, + 17, 9, 224, 0, 24, 15, 13, 10, 170, 216, 170, 97, 255, 229, + 184, 114, 255, 228, 181, 107, 255, 34, 28, 19, 255, 0, 24, 10, + 9, 7, 170, 174, 91, 23, 255, 202, 103, 23, 255, 202, 102, 21, + 255, 20, 16, 9, 252, 0, 12, 10, 9, 7, 170, 171, 89, 22, + 255, 202, 107, 23, 255, 206, 111, 27, 255, 22, 17, 11, 252, 0, + 8, 8, 7, 7, 45, 73, 59, 36, 255, 218, 174, 105, 255, 228, + 178, 107, 255, 89, 67, 36, 255, 7, 7, 6, 113, 0, 4, 5, + 5, 4, 28, 20, 18, 13, 255, 199, 110, 30, 255, 202, 105, 27, + 255, 88, 54, 23, 255, 10, 9, 7, 113, 0, 8, 13, 11, 6, + 85, 167, 87, 22, 255, 202, 95, 23, 255, 202, 90, 23, 255, 32, + 24, 13, 255, 4, 4, 3, 178, 19, 16, 12, 238, 212, 163, 93, + 255, 66, 52, 31, 255, 5, 5, 5, 184, 14, 13, 11, 255, 205, + 133, 48, 255, 212, 114, 35, 255, 208, 117, 29, 255, 29, 22, 14, + 255, 0, 16, 12, 11, 9, 85, 101, 74, 38, 255, 189, 121, 49, + 255, 185, 104, 32, 255, 180, 98, 25, 255, 180, 93, 23, 255, 154, + 82, 23, 255, 75, 44, 18, 255, 11, 9, 6, 144, 0, 32, 10, + 9, 7, 170, 157, 79, 22, 255, 202, 102, 21, 255, 202, 102, 21, + 255, 22, 17, 9, 255, 0, 28, 14, 13, 11, 224, 136, 98, 53, + 255, 217, 165, 82, 255, 213, 145, 56, 255, 150, 92, 35, 255, 19, + 16, 12, 173, 5, 5, 5, 8, 0, 28, 10, 8, 7, 170, 171, + 89, 22, 255, 202, 103, 23, 255, 202, 102, 21, 255, 20, 16, 9, + 252, 0, 28, 7, 7, 6, 59, 43, 35, 24, 255, 221, 175, 102, + 255, 223, 178, 106, 255, 134, 98, 51, 255, 14, 13, 11, 142, 0, + 24, 10, 9, 7, 167, 171, 89, 22, 255, 202, 103, 23, 255, 202, + 102, 21, 255, 20, 16, 9, 255, 0, 144, 12, 10, 7, 170, 46, + 29, 13, 255, 140, 74, 21, 255, 165, 86, 22, 255, 167, 87, 22, + 255, 165, 86, 22, 255, 167, 87, 22, 255, 185, 95, 22, 255, 198, + 97, 23, 255, 206, 111, 27, 255, 221, 146, 66, 255, 23, 19, 14, + 249, 0, 8, 10, 10, 9, 153, 212, 161, 89, 255, 229, 183, 110, + 255, 224, 165, 81, 255, 28, 23, 15, 255, 0, 12, 10, 8, 7, + 156, 171, 89, 22, 255, 202, 103, 23, 255, 202, 102, 21, 255, 31, + 21, 10, 170, 0, 8, 10, 10, 9, 167, 212, 160, 85, 255, 228, + 177, 105, 255, 222, 158, 75, 255, 27, 23, 16, 255, 0, 40, 10, + 8, 7, 170, 167, 87, 22, 255, 202, 103, 23, 255, 202, 102, 21, + 255, 20, 16, 9, 238, 0, 12, 10, 8, 7, 164, 171, 89, 22, + 255, 202, 103, 23, 255, 203, 100, 24, 255, 22, 18, 11, 235, 0, + 8, 10, 10, 9, 167, 214, 164, 93, 255, 228, 182, 109, 255, 223, + 154, 80, 255, 207, 120, 36, 255, 189, 94, 24, 255, 167, 87, 22, + 255, 167, 87, 22, 255, 187, 96, 22, 255, 198, 93, 23, 255, 202, + 93, 21, 255, 198, 96, 21, 255, 26, 19, 9, 227, 0, 16, 10, + 8, 7, 167, 171, 89, 22, 255, 202, 103, 23, 255, 202, 102, 21, + 255, 20, 15, 9, 252, 0, 16, 17, 15, 12, 170, 216, 170, 97, + 255, 229, 183, 110, 255, 224, 164, 85, 255, 29, 24, 16, 255, 3, + 3, 2, 28, 0, 8, 12, 11, 9, 198, 211, 149, 76, 255, 221, + 151, 68, 255, 219, 146, 60, 255, 22, 19, 13, 246, 0, 8, 10, + 10, 9, 161, 210, 155, 77, 255, 223, 147, 72, 255, 213, 122, 42, + 255, 23, 18, 12, 255, 0, 12, 10, 8, 7, 167, 171, 89, 22, + 255, 202, 103, 23, 255, 202, 102, 21, 255, 29, 21, 10, 170, 0, + 8, 12, 10, 7, 85, 166, 87, 23, 255, 209, 118, 30, 255, 218, + 139, 55, 255, 33, 27, 18, 255, 0, 24, 15, 13, 10, 170, 215, + 159, 92, 255, 226, 169, 95, 255, 218, 141, 59, 255, 34, 26, 15, + 190, 0, 8, 13, 10, 6, 85, 167, 87, 22, 255, 202, 103, 23, + 255, 198, 96, 21, 255, 197, 96, 22, 255, 189, 97, 22, 255, 198, + 96, 21, 255, 198, 96, 21, 255, 25, 19, 10, 255, 4, 4, 3, + 28, 0, 20, 10, 9, 7, 170, 178, 92, 23, 255, 210, 107, 31, + 255, 215, 128, 44, 255, 33, 24, 14, 193, 0, 8, 12, 10, 7, + 85, 167, 87, 22, 255, 202, 95, 23, 255, 202, 103, 23, 255, 32, + 22, 11, 170, 0, 4, 10, 8, 7, 170, 171, 89, 22, 255, 24, + 17, 9, 249, 0, 4, 12, 10, 7, 85, 163, 82, 22, 255, 202, + 103, 23, 255, 202, 102, 21, 255, 29, 21, 10, 170, 0, 8, 12, + 10, 7, 85, 166, 87, 23, 255, 202, 103, 23, 255, 202, 102, 21, + 255, 20, 15, 9, 255, 0, 12, 10, 8, 7, 167, 170, 89, 23, + 255, 206, 106, 25, 255, 208, 115, 33, 255, 28, 21, 13, 207, 0, + 8, 13, 10, 6, 85, 167, 87, 22, 255, 202, 95, 23, 255, 202, + 102, 21, 255, 20, 16, 9, 255, 0, 12, 15, 13, 10, 170, 214, + 158, 85, 255, 229, 183, 110, 255, 228, 185, 111, 255, 24, 20, 15, + 249, 0, 8, 12, 11, 9, 108, 176, 91, 23, 255, 202, 95, 23, + 255, 202, 102, 21, 255, 18, 15, 9, 255, 2, 2, 1, 8, 0, + 8, 8, 7, 5, 184, 171, 89, 22, 255, 202, 95, 23, 255, 202, + 102, 21, 255, 34, 23, 11, 173, 0, 8, 12, 11, 9, 136, 212, + 160, 85, 255, 228, 180, 105, 255, 225, 165, 88, 255, 31, 25, 18, + 255, 3, 3, 2, 28, 0, 8, 8, 7, 5, 178, 171, 89, 22, + 255, 202, 103, 23, 255, 202, 102, 21, 255, 30, 21, 11, 170, 0, + 8, 12, 10, 7, 85, 167, 87, 22, 255, 202, 103, 23, 255, 202, + 102, 21, 255, 20, 15, 9, 255, 0, 40, 7, 7, 6, 28, 30, + 27, 21, 238, 167, 111, 50, 255, 206, 110, 33, 255, 199, 102, 24, + 255, 175, 90, 22, 255, 165, 86, 22, 255, 167, 87, 22, 255, 167, + 87, 22, 255, 161, 87, 22, 255, 84, 48, 19, 255, 18, 15, 9, + 227, 8, 7, 5, 28, 0, 16, 10, 8, 7, 167, 171, 89, 22, + 255, 202, 103, 23, 255, 202, 102, 21, 255, 20, 15, 9, 252, 0, + 16, 15, 13, 10, 170, 211, 159, 76, 255, 229, 180, 110, 255, 228, + 182, 109, 255, 34, 28, 19, 255, 0, 12, 10, 9, 7, 170, 171, + 89, 22, 255, 202, 103, 23, 255, 202, 102, 21, 255, 31, 22, 10, + 170, 0, 8, 7, 6, 6, 28, 48, 31, 15, 255, 189, 93, 22, + 255, 202, 102, 21, 255, 45, 29, 14, 255, 5, 5, 4, 113, 0, + 4, 5, 5, 4, 28, 22, 20, 15, 255, 220, 169, 97, 255, 226, + 178, 103, 255, 167, 118, 54, 255, 15, 13, 10, 133, 0, 8, 13, + 11, 6, 85, 167, 87, 22, 255, 202, 103, 23, 255, 202, 102, 21, + 255, 19, 15, 8, 215, 0, 4, 11, 9, 6, 105, 121, 65, 20, + 255, 26, 18, 9, 190, 0, 4, 9, 9, 8, 167, 208, 150, 75, + 255, 229, 183, 110, 255, 228, 181, 113, 255, 37, 29, 20, 255, 0, + 24, 8, 8, 5, 218, 167, 87, 22, 255, 202, 93, 21, 255, 198, + 104, 21, 255, 23, 18, 10, 255, 3, 3, 2, 51, 0, 20, 10, + 9, 7, 153, 171, 89, 22, 255, 202, 95, 23, 255, 202, 102, 21, + 255, 20, 15, 9, 255, 2, 2, 1, 17, 0, 8, 8, 7, 5, + 181, 184, 100, 25, 255, 215, 119, 42, 255, 224, 160, 85, 255, 34, + 28, 19, 255, 0, 20, 9, 8, 6, 85, 31, 22, 12, 255, 166, + 87, 23, 255, 189, 97, 22, 255, 99, 60, 22, 255, 15, 13, 8, + 170, 0, 28, 4, 3, 3, 23, 13, 11, 8, 227, 182, 94, 23, + 255, 149, 87, 26, 255, 19, 17, 12, 227, 7, 7, 7, 23, 0, + 16, 15, 13, 10, 170, 216, 170, 97, 255, 229, 179, 114, 255, 228, + 182, 109, 255, 34, 28, 19, 255, 0, 20, 9, 8, 6, 130, 69, + 42, 18, 255, 195, 95, 22, 255, 35, 24, 12, 255, 5, 5, 4, + 76, 0, 104, 10, 9, 7, 28, 27, 24, 16, 184, 32, 27, 19, + 255, 39, 29, 20, 212, 13, 12, 10, 85, 0, 60, 13, 11, 8, + 170, 81, 54, 28, 255, 216, 148, 67, 255, 223, 161, 72, 255, 220, + 147, 61, 255, 117, 76, 32, 255, 13, 11, 8, 255, 44, 33, 19, + 255, 207, 123, 40, 255, 217, 136, 50, 255, 218, 142, 53, 255, 156, + 100, 39, 255, 18, 15, 11, 227, 10, 8, 7, 28, 0, 12, 15, + 13, 8, 125, 19, 14, 10, 170, 14, 11, 7, 170, 10, 8, 7, + 170, 11, 9, 6, 122, 13, 10, 8, 85, 8, 7, 5, 153, 46, + 33, 21, 255, 212, 138, 51, 255, 221, 151, 68, 255, 191, 132, 62, + 255, 19, 17, 12, 176, 0, 12, 7, 7, 6, 76, 26, 22, 15, + 241, 189, 129, 58, 255, 219, 152, 72, 255, 217, 154, 72, 255, 133, + 87, 38, 255, 15, 13, 10, 221, 6, 6, 5, 28, 0, 8, 15, + 12, 8, 113, 20, 16, 11, 170, 17, 14, 10, 142, 7, 6, 6, + 28, 0, 8, 19, 16, 12, 170, 200, 117, 35, 255, 212, 123, 37, + 255, 115, 74, 30, 255, 9, 8, 6, 113, 0, 8, 12, 11, 9, + 178, 104, 73, 37, 255, 206, 147, 63, 255, 178, 121, 53, 255, 58, + 46, 29, 255, 46, 36, 25, 255, 40, 32, 21, 252, 19, 17, 12, + 85, 0, 36, 12, 10, 9, 164, 191, 131, 60, 255, 223, 161, 80, + 255, 221, 151, 68, 255, 46, 34, 21, 255, 4, 4, 3, 3, 0, + 20, 19, 16, 12, 173, 208, 134, 55, 255, 223, 156, 70, 255, 216, + 160, 81, 255, 21, 19, 14, 255, 0, 16, 6, 5, 5, 25, 17, + 14, 10, 227, 67, 48, 28, 255, 94, 67, 35, 255, 20, 17, 13, + 227, 6, 6, 5, 113, 12, 11, 9, 198, 67, 51, 30, 255, 85, + 62, 32, 255, 25, 20, 14, 255, 9, 8, 6, 82, 0, 32, 10, + 8, 5, 170, 161, 87, 22, 255, 195, 90, 20, 255, 187, 91, 20, + 255, 19, 14, 8, 255, 0, 28, 15, 12, 8, 119, 20, 16, 11, + 170, 17, 14, 10, 156, 10, 8, 7, 28, 0, 64, 15, 12, 8, + 122, 18, 15, 11, 170, 17, 14, 10, 144, 10, 8, 7, 28, 0, + 16, 13, 12, 10, 170, 157, 96, 36, 255, 211, 123, 38, 255, 199, + 116, 34, 255, 31, 24, 16, 255, 6, 6, 6, 28, 0, 20, 16, + 13, 11, 170, 197, 110, 32, 255, 209, 110, 30, 255, 202, 103, 23, + 255, 58, 36, 15, 255, 8, 7, 5, 113, 0, 8, 10, 8, 5, + 85, 137, 68, 18, 255, 185, 86, 20, 255, 174, 88, 19, 255, 18, + 13, 7, 255, 0, 24, 12, 10, 9, 170, 204, 129, 49, 255, 220, + 144, 63, 255, 217, 133, 50, 255, 26, 20, 13, 255, 0, 28, 7, + 6, 6, 76, 23, 19, 12, 244, 185, 113, 36, 255, 207, 129, 52, + 255, 173, 117, 50, 255, 59, 46, 28, 255, 18, 15, 13, 198, 9, + 9, 8, 113, 6, 6, 6, 11, 0, 24, 15, 12, 8, 133, 22, + 17, 11, 170, 17, 14, 10, 142, 8, 7, 5, 28, 0, 12, 9, + 8, 6, 170, 202, 128, 49, 255, 220, 148, 63, 255, 219, 140, 56, + 255, 22, 19, 13, 255, 0, 8, 12, 10, 9, 170, 200, 125, 37, + 255, 218, 141, 51, 255, 220, 147, 61, 255, 138, 86, 35, 255, 13, + 10, 8, 227, 11, 9, 6, 170, 13, 11, 8, 198, 61, 41, 22, + 255, 202, 111, 31, 255, 204, 105, 25, 255, 200, 105, 21, 255, 22, + 17, 9, 221, 0, 12, 11, 9, 6, 108, 14, 11, 7, 170, 11, + 9, 6, 139, 6, 5, 3, 17, 0, 12, 9, 7, 6, 133, 144, + 75, 19, 255, 185, 86, 20, 255, 178, 86, 19, 255, 27, 18, 8, + 170, 0, 8, 11, 9, 6, 85, 134, 70, 19, 255, 181, 88, 20, + 255, 180, 87, 19, 255, 24, 15, 7, 178, 0, 12, 10, 8, 5, + 99, 165, 86, 22, 255, 206, 111, 27, 255, 213, 124, 38, 255, 36, + 27, 17, 255, 0, 24, 10, 10, 9, 133, 167, 112, 48, 255, 222, + 166, 77, 255, 223, 157, 72, 255, 54, 39, 23, 255, 5, 5, 4, + 37, 0, 20, 13, 11, 8, 170, 181, 93, 22, 255, 206, 111, 27, + 255, 214, 127, 43, 255, 20, 16, 11, 255, 0, 12, 9, 8, 8, + 170, 203, 129, 50, 255, 222, 145, 63, 255, 220, 147, 61, 255, 33, + 26, 16, 255, 0, 12, 12, 10, 7, 113, 15, 12, 8, 170, 13, + 10, 8, 122, 0, 16, 10, 8, 7, 170, 200, 120, 41, 255, 220, + 142, 59, 255, 219, 146, 60, 255, 27, 21, 14, 255, 0, 12, 13, + 11, 8, 113, 18, 15, 11, 170, 17, 14, 10, 142, 8, 7, 5, + 28, 0, 12, 14, 12, 9, 113, 20, 15, 11, 170, 17, 14, 10, + 153, 10, 8, 7, 28, 0, 16, 9, 8, 6, 85, 29, 21, 10, + 255, 119, 62, 20, 255, 153, 79, 20, 255, 40, 25, 11, 255, 9, + 8, 6, 85, 0, 20, 10, 8, 7, 28, 32, 24, 13, 218, 68, + 47, 25, 255, 61, 43, 24, 255, 61, 46, 28, 255, 61, 47, 28, + 255, 61, 47, 28, 255, 66, 50, 29, 255, 73, 55, 32, 255, 66, + 48, 29, 255, 24, 20, 15, 85, 0, 20, 7, 6, 6, 79, 32, + 26, 17, 244, 199, 132, 54, 255, 208, 150, 75, 255, 122, 87, 41, + 255, 17, 15, 10, 170, 0, 32, 10, 9, 7, 28, 32, 23, 11, + 227, 53, 33, 14, 255, 34, 23, 11, 255, 12, 10, 7, 190, 6, + 5, 5, 28, 0, 20, 9, 7, 4, 170, 146, 76, 19, 255, 197, + 99, 20, 255, 204, 110, 27, 255, 59, 41, 22, 255, 6, 6, 6, + 170, 10, 9, 9, 113, 31, 26, 18, 184, 30, 25, 17, 255, 29, + 25, 18, 255, 34, 27, 19, 255, 37, 28, 18, 221, 13, 11, 8, + 57, 0, 8, 13, 10, 6, 88, 144, 75, 19, 255, 185, 86, 20, + 255, 178, 90, 19, 255, 20, 14, 7, 212, 0, 12, 9, 7, 4, + 125, 157, 81, 20, 255, 212, 117, 33, 255, 220, 148, 63, 255, 27, + 21, 14, 218, 0, 8, 12, 10, 9, 127, 192, 111, 31, 255, 208, + 112, 27, 255, 202, 103, 23, 255, 22, 16, 9, 204, 0, 12, 10, + 8, 5, 93, 137, 68, 18, 255, 185, 94, 20, 255, 180, 91, 19, + 255, 30, 20, 9, 170, 0, 8, 11, 9, 6, 85, 140, 67, 19, + 255, 202, 106, 21, 255, 214, 125, 39, 255, 25, 20, 14, 255, 0, + 12, 6, 6, 5, 28, 13, 11, 8, 139, 20, 16, 11, 170, 19, + 15, 10, 142, 8, 7, 5, 28, 0, 8, 10, 9, 5, 142, 153, + 79, 20, 255, 195, 90, 20, 255, 206, 111, 27, 255, 24, 20, 13, + 255, 0, 12, 12, 10, 9, 170, 195, 113, 32, 255, 211, 115, 30, + 255, 203, 108, 24, 255, 31, 21, 10, 173, 0, 8, 11, 9, 6, + 85, 140, 70, 19, 255, 185, 86, 20, 255, 180, 87, 19, 255, 24, + 15, 7, 181, 0, 32, 9, 8, 6, 170, 174, 91, 23, 255, 215, + 123, 42, 255, 221, 150, 66, 255, 25, 20, 14, 255, 0, 32, 9, + 7, 4, 170, 148, 77, 19, 255, 181, 92, 20, 255, 180, 87, 19, + 255, 25, 17, 8, 170, 0, 8, 34, 24, 13, 170, 161, 102, 38, + 255, 219, 154, 70, 255, 220, 142, 59, 255, 213, 124, 38, 255, 32, + 24, 13, 198, 0, 8, 11, 9, 6, 85, 140, 70, 19, 255, 185, + 86, 20, 255, 178, 90, 19, 255, 20, 14, 7, 212, 0, 12, 8, + 7, 5, 127, 144, 78, 19, 255, 185, 86, 20, 255, 180, 87, 19, + 255, 29, 19, 10, 170, 0, 8, 13, 11, 8, 116, 194, 116, 33, + 255, 209, 110, 30, 255, 202, 95, 23, 255, 22, 17, 9, 221, 0, + 12, 10, 8, 5, 85, 12, 9, 5, 170, 10, 8, 5, 130, 6, + 5, 3, 8, 0, 12, 10, 8, 5, 110, 144, 78, 19, 255, 185, + 86, 20, 255, 178, 86, 19, 255, 27, 18, 8, 170, 0, 8, 11, + 8, 6, 85, 137, 68, 18, 255, 185, 86, 20, 255, 200, 105, 21, + 255, 29, 21, 12, 255, 4, 4, 4, 25, 10, 9, 7, 139, 154, + 100, 47, 255, 215, 148, 70, 255, 198, 131, 45, 255, 46, 34, 19, + 255, 11, 9, 6, 88, 0, 12, 10, 8, 5, 119, 144, 78, 19, + 255, 185, 86, 20, 255, 180, 87, 19, 255, 21, 15, 8, 210, 0, + 32, 13, 11, 8, 170, 199, 119, 39, 255, 220, 144, 63, 255, 221, + 155, 70, 255, 27, 21, 14, 255, 0, 20, 10, 9, 7, 170, 171, + 89, 22, 255, 195, 98, 20, 255, 183, 89, 19, 255, 29, 20, 8, + 170, 0, 8, 11, 9, 6, 85, 139, 70, 20, 255, 202, 103, 23, + 255, 211, 118, 36, 255, 28, 21, 13, 201, 0, 4, 8, 8, 7, + 57, 118, 84, 39, 255, 215, 159, 86, 255, 219, 149, 66, 255, 216, + 129, 45, 255, 211, 121, 34, 255, 34, 25, 13, 178, 0, 8, 11, + 10, 6, 88, 146, 76, 19, 255, 185, 94, 20, 255, 178, 90, 19, + 255, 24, 18, 9, 255, 0, 12, 18, 15, 11, 170, 203, 122, 42, + 255, 215, 126, 40, 255, 209, 106, 30, 255, 32, 22, 13, 184, 0, + 8, 12, 10, 7, 85, 143, 72, 20, 255, 185, 94, 20, 255, 178, + 90, 19, 255, 20, 14, 7, 210, 0, 40, 9, 7, 4, 170, 148, + 77, 19, 255, 180, 87, 19, 255, 178, 86, 19, 255, 30, 21, 9, + 255, 5, 5, 4, 37, 8, 7, 5, 28, 20, 17, 13, 227, 133, + 89, 38, 255, 215, 142, 56, 255, 216, 129, 45, 255, 209, 115, 32, + 255, 26, 19, 11, 210, 0, 8, 11, 9, 6, 85, 142, 74, 19, + 255, 185, 86, 20, 255, 178, 90, 19, 255, 20, 14, 7, 210, 0, + 12, 9, 7, 4, 122, 143, 75, 20, 255, 203, 108, 24, 255, 216, + 129, 45, 255, 30, 23, 15, 255, 0, 12, 12, 10, 7, 110, 16, + 13, 9, 170, 13, 10, 8, 122, 0, 16, 9, 8, 6, 105, 142, + 74, 19, 255, 185, 86, 20, 255, 180, 87, 19, 255, 23, 16, 8, + 255, 0, 24, 15, 13, 10, 170, 203, 122, 42, 255, 215, 126, 40, + 255, 209, 118, 30, 255, 24, 17, 11, 255, 0, 24, 9, 8, 4, + 170, 148, 77, 19, 255, 181, 92, 20, 255, 180, 87, 19, 255, 23, + 16, 8, 198, 0, 12, 9, 7, 6, 139, 159, 82, 20, 255, 203, + 100, 24, 255, 212, 121, 33, 255, 28, 21, 13, 255, 0, 12, 12, + 11, 9, 119, 81, 59, 34, 255, 216, 153, 71, 255, 173, 117, 50, + 255, 21, 18, 14, 255, 10, 10, 9, 244, 11, 10, 8, 255, 60, + 35, 15, 255, 173, 85, 20, 255, 84, 49, 17, 255, 13, 10, 6, + 170, 0, 12, 10, 8, 5, 130, 146, 79, 19, 255, 193, 89, 20, + 255, 203, 104, 24, 255, 120, 77, 31, 255, 19, 17, 12, 255, 117, + 80, 36, 255, 219, 154, 70, 255, 178, 121, 53, 255, 20, 17, 13, + 255, 45, 33, 18, 255, 184, 94, 21, 255, 195, 90, 20, 255, 205, + 106, 26, 255, 30, 22, 13, 255, 0, 12, 7, 7, 6, 82, 35, + 28, 18, 255, 196, 114, 33, 255, 148, 80, 25, 255, 32, 22, 11, + 255, 20, 15, 9, 255, 26, 18, 9, 255, 88, 49, 17, 255, 149, + 78, 20, 255, 40, 26, 11, 255, 9, 7, 4, 85, 0, 28, 9, + 7, 4, 127, 140, 70, 19, 255, 181, 88, 20, 255, 180, 87, 19, + 255, 18, 13, 7, 235, 0, 24, 10, 9, 7, 93, 104, 69, 35, + 255, 201, 131, 48, 255, 194, 109, 33, 255, 65, 42, 20, 255, 12, + 10, 7, 170, 0, 36, 9, 7, 4, 170, 146, 79, 19, 255, 181, + 88, 20, 255, 180, 87, 19, 255, 23, 16, 8, 198, 0, 32, 15, + 14, 10, 198, 188, 133, 61, 255, 219, 149, 66, 255, 194, 115, 37, + 255, 17, 15, 10, 244, 0, 24, 10, 8, 5, 113, 144, 78, 19, + 255, 185, 86, 20, 255, 180, 87, 19, 255, 18, 13, 7, 255, 0, + 140, 7, 6, 4, 65, 53, 31, 12, 255, 162, 83, 19, 255, 185, + 94, 20, 255, 130, 70, 21, 255, 31, 22, 10, 255, 25, 19, 10, + 198, 22, 17, 9, 246, 70, 40, 15, 255, 169, 87, 20, 255, 200, + 105, 21, 255, 212, 123, 37, 255, 28, 21, 13, 221, 0, 8, 12, + 10, 9, 133, 200, 127, 41, 255, 210, 120, 33, 255, 202, 95, 23, + 255, 19, 14, 8, 238, 0, 12, 10, 8, 5, 110, 144, 78, 19, + 255, 185, 86, 20, 255, 178, 86, 19, 255, 28, 19, 9, 170, 0, + 8, 12, 10, 9, 133, 194, 112, 31, 255, 209, 110, 30, 255, 202, + 102, 21, 255, 21, 15, 8, 235, 0, 16, 9, 7, 4, 57, 12, + 10, 5, 88, 10, 8, 5, 85, 0, 12, 10, 8, 5, 125, 146, + 79, 19, 255, 181, 88, 20, 255, 180, 87, 19, 255, 25, 17, 8, + 195, 0, 12, 10, 8, 5, 119, 144, 78, 19, 255, 185, 94, 20, + 255, 200, 105, 21, 255, 23, 18, 10, 221, 0, 8, 11, 9, 8, + 153, 200, 123, 41, 255, 212, 117, 33, 255, 202, 103, 23, 255, 111, + 63, 20, 255, 27, 20, 10, 255, 20, 16, 9, 246, 22, 17, 9, + 249, 28, 20, 9, 198, 30, 21, 9, 170, 24, 17, 9, 215, 28, + 20, 9, 201, 10, 8, 5, 85, 0, 16, 9, 7, 4, 170, 146, + 79, 19, 255, 181, 88, 20, 255, 180, 87, 19, 255, 18, 13, 7, + 255, 0, 16, 11, 10, 8, 113, 152, 104, 47, 255, 214, 134, 49, + 255, 204, 105, 25, 255, 98, 54, 19, 255, 18, 13, 9, 227, 13, + 10, 8, 170, 14, 12, 9, 198, 60, 41, 21, 255, 199, 112, 28, + 255, 202, 102, 21, 255, 202, 103, 23, 255, 26, 19, 11, 204, 0, + 8, 12, 11, 9, 116, 187, 101, 24, 255, 202, 93, 21, 255, 187, + 91, 20, 255, 18, 13, 7, 255, 0, 12, 9, 7, 4, 170, 146, + 79, 19, 255, 181, 88, 20, 255, 178, 90, 19, 255, 27, 17, 8, + 170, 0, 8, 11, 9, 6, 85, 139, 70, 20, 255, 202, 103, 23, + 255, 212, 123, 37, 255, 32, 24, 15, 255, 0, 24, 13, 12, 10, + 170, 196, 114, 33, 255, 206, 106, 25, 255, 196, 99, 21, 255, 28, + 19, 9, 170, 0, 8, 11, 8, 6, 85, 137, 68, 18, 255, 181, + 88, 20, 255, 178, 86, 19, 255, 164, 85, 21, 255, 138, 73, 21, + 255, 175, 93, 20, 255, 178, 86, 19, 255, 46, 28, 11, 255, 6, + 5, 3, 108, 0, 20, 9, 7, 4, 170, 146, 76, 19, 255, 189, + 88, 20, 255, 189, 88, 20, 255, 28, 19, 9, 170, 0, 8, 11, + 9, 6, 85, 137, 68, 18, 255, 185, 86, 20, 255, 178, 90, 19, + 255, 27, 17, 8, 170, 0, 4, 9, 7, 4, 167, 146, 79, 19, + 255, 20, 14, 7, 252, 0, 4, 11, 9, 6, 85, 137, 68, 18, + 255, 185, 94, 20, 255, 178, 90, 19, 255, 27, 17, 8, 170, 0, + 8, 11, 9, 6, 85, 137, 68, 18, 255, 185, 86, 20, 255, 180, + 87, 19, 255, 18, 13, 7, 255, 0, 12, 9, 7, 4, 170, 146, + 79, 19, 255, 185, 94, 20, 255, 183, 85, 19, 255, 27, 19, 8, + 170, 0, 8, 11, 9, 6, 85, 140, 73, 19, 255, 181, 88, 20, + 255, 178, 90, 19, 255, 20, 15, 7, 255, 0, 12, 16, 14, 11, + 170, 208, 143, 59, 255, 223, 156, 70, 255, 216, 135, 49, 255, 28, + 22, 13, 210, 0, 8, 11, 9, 6, 85, 140, 70, 19, 255, 185, + 94, 20, 255, 178, 90, 19, 255, 72, 39, 13, 255, 10, 8, 5, + 218, 8, 6, 3, 170, 9, 7, 4, 193, 39, 24, 10, 255, 160, + 82, 19, 255, 185, 94, 20, 255, 144, 74, 23, 255, 16, 13, 9, + 170, 0, 8, 10, 9, 7, 85, 145, 101, 48, 255, 218, 149, 67, + 255, 210, 115, 31, 255, 99, 57, 19, 255, 10, 8, 5, 227, 8, + 6, 3, 170, 9, 7, 4, 190, 30, 20, 9, 255, 158, 81, 19, + 255, 185, 94, 20, 255, 178, 90, 19, 255, 27, 17, 8, 170, 0, + 8, 11, 8, 6, 85, 137, 68, 18, 255, 185, 86, 20, 255, 180, + 87, 19, 255, 18, 13, 7, 255, 0, 44, 9, 9, 8, 28, 13, + 12, 8, 142, 27, 20, 10, 170, 29, 21, 10, 193, 24, 17, 9, + 252, 22, 17, 9, 232, 22, 17, 9, 255, 87, 49, 18, 255, 181, + 88, 20, 255, 178, 90, 19, 255, 100, 54, 17, 255, 11, 10, 6, + 150, 0, 16, 9, 7, 4, 170, 146, 79, 19, 255, 181, 88, 20, + 255, 180, 87, 19, 255, 18, 13, 7, 255, 0, 16, 15, 13, 10, + 170, 208, 141, 55, 255, 223, 156, 70, 255, 217, 133, 50, 255, 23, + 19, 12, 255, 0, 12, 10, 8, 5, 122, 144, 78, 19, 255, 185, + 86, 20, 255, 180, 87, 19, 255, 30, 20, 9, 176, 0, 12, 12, + 10, 7, 85, 39, 26, 12, 255, 155, 80, 20, 255, 99, 55, 19, + 255, 19, 16, 12, 255, 12, 11, 9, 255, 18, 15, 11, 255, 119, + 84, 38, 255, 209, 137, 60, 255, 138, 86, 35, 255, 18, 15, 11, + 178, 0, 12, 10, 8, 5, 130, 144, 78, 19, 255, 181, 92, 20, + 255, 178, 90, 19, 255, 39, 24, 10, 255, 6, 5, 3, 210, 29, + 20, 8, 255, 169, 87, 20, 255, 97, 53, 18, 255, 8, 7, 5, + 255, 26, 21, 15, 255, 212, 142, 59, 255, 221, 151, 68, 255, 218, + 142, 53, 255, 34, 25, 15, 255, 0, 20, 5, 5, 4, 82, 16, + 12, 7, 255, 160, 82, 19, 255, 185, 86, 20, 255, 185, 86, 20, + 255, 52, 29, 11, 255, 7, 6, 4, 170, 0, 20, 8, 7, 5, + 85, 83, 46, 16, 255, 181, 92, 20, 255, 178, 86, 19, 255, 87, + 47, 14, 255, 10, 8, 5, 224, 8, 6, 3, 170, 9, 7, 4, + 190, 29, 20, 8, 255, 195, 104, 24, 255, 217, 136, 50, 255, 221, + 155, 70, 255, 30, 23, 15, 255, 0, 16, 8, 7, 5, 85, 26, + 18, 9, 255, 107, 59, 20, 255, 151, 80, 22, 255, 60, 34, 15, + 255, 11, 9, 6, 170, 0, 36, 8, 7, 5, 170, 159, 82, 20, + 255, 202, 118, 35, 255, 66, 51, 29, 255, 9, 9, 8, 96, 0, + 16, 15, 13, 10, 170, 208, 140, 59, 255, 223, 156, 70, 255, 215, + 133, 44, 255, 27, 20, 12, 255, 0, 20, 14, 12, 7, 244, 131, + 67, 20, 255, 176, 89, 19, 255, 17, 12, 6, 255, 0, 184, 17, + 14, 10, 85, 171, 95, 28, 255, 206, 123, 33, 255, 208, 123, 31, + 255, 207, 112, 28, 255, 202, 107, 23, 255, 191, 98, 22, 255, 170, + 91, 21, 255, 195, 107, 22, 255, 209, 123, 30, 255, 212, 132, 37, + 255, 214, 134, 39, 255, 211, 133, 40, 255, 202, 121, 35, 255, 29, + 21, 12, 164, 0, 8, 12, 10, 7, 82, 168, 98, 29, 255, 202, + 121, 35, 255, 196, 120, 31, 255, 194, 115, 31, 255, 190, 115, 27, + 255, 185, 101, 26, 255, 184, 100, 25, 255, 199, 107, 26, 255, 208, + 123, 31, 255, 168, 105, 37, 255, 25, 21, 14, 227, 9, 8, 8, + 28, 0, 8, 8, 8, 7, 28, 39, 30, 18, 249, 183, 122, 42, + 255, 211, 133, 40, 255, 210, 133, 43, 255, 161, 106, 41, 255, 15, + 13, 10, 221, 5, 4, 4, 17, 0, 8, 14, 11, 7, 113, 148, + 83, 25, 255, 193, 108, 24, 255, 180, 93, 23, 255, 27, 18, 10, + 153, 0, 8, 12, 9, 7, 122, 144, 78, 19, 255, 180, 91, 19, + 255, 83, 46, 16, 255, 7, 6, 4, 184, 0, 8, 4, 4, 3, + 85, 28, 21, 13, 255, 202, 121, 35, 255, 209, 132, 42, 255, 131, + 87, 36, 255, 10, 9, 7, 255, 5, 5, 5, 28, 0, 40, 10, + 9, 7, 68, 86, 62, 31, 255, 206, 131, 43, 255, 214, 130, 39, + 255, 76, 50, 25, 255, 7, 6, 6, 113, 0, 16, 5, 5, 4, + 28, 21, 17, 12, 255, 202, 121, 35, 255, 210, 135, 37, 255, 157, + 100, 38, 255, 18, 15, 11, 150, 0, 16, 18, 15, 9, 91, 161, + 88, 24, 255, 105, 64, 28, 255, 11, 10, 8, 170, 0, 12, 8, + 7, 7, 85, 40, 28, 17, 255, 174, 91, 23, 255, 42, 27, 13, + 173, 0, 32, 10, 8, 5, 116, 133, 66, 16, 255, 161, 85, 17, + 255, 161, 78, 17, 255, 25, 16, 8, 221, 0, 24, 15, 12, 8, + 119, 170, 99, 29, 255, 203, 126, 36, 255, 199, 127, 34, 255, 27, + 20, 12, 210, 0, 60, 13, 11, 8, 122, 170, 99, 29, 255, 204, + 127, 37, 255, 199, 119, 34, 255, 27, 20, 12, 198, 0, 12, 4, + 4, 3, 11, 18, 13, 9, 255, 154, 79, 19, 255, 174, 88, 19, + 255, 92, 51, 17, 255, 12, 10, 7, 198, 0, 24, 11, 9, 6, + 147, 142, 74, 19, 255, 171, 90, 18, 255, 159, 81, 18, 255, 17, + 12, 6, 255, 0, 12, 8, 7, 5, 142, 133, 66, 16, 255, 161, + 85, 17, 255, 161, 85, 17, 255, 21, 14, 6, 215, 0, 24, 10, + 9, 7, 198, 190, 107, 25, 255, 203, 104, 24, 255, 196, 99, 21, + 255, 21, 15, 8, 255, 2, 2, 1, 14, 0, 20, 9, 8, 6, + 37, 35, 28, 18, 255, 183, 112, 36, 255, 212, 132, 37, 255, 178, + 118, 41, 255, 27, 23, 16, 255, 5, 5, 4, 198, 0, 32, 15, + 12, 8, 105, 142, 79, 23, 255, 189, 97, 22, 255, 160, 83, 21, + 255, 18, 13, 7, 218, 0, 12, 10, 8, 7, 198, 196, 114, 33, + 255, 214, 129, 37, 255, 212, 132, 37, 255, 27, 21, 12, 210, 0, + 8, 13, 11, 8, 116, 192, 114, 31, 255, 210, 125, 33, 255, 209, + 123, 30, 255, 203, 113, 26, 255, 177, 91, 22, 255, 159, 82, 20, + 255, 160, 83, 21, 255, 165, 85, 20, 255, 168, 89, 19, 255, 163, + 86, 18, 255, 161, 78, 17, 255, 23, 15, 6, 170, 0, 8, 9, + 7, 4, 57, 99, 48, 14, 255, 142, 73, 17, 255, 133, 66, 16, + 255, 19, 13, 6, 190, 0, 12, 7, 6, 4, 164, 135, 66, 16, + 255, 161, 85, 17, 255, 161, 85, 17, 255, 25, 16, 6, 170, 0, + 8, 10, 8, 5, 85, 131, 65, 16, 255, 161, 85, 17, 255, 161, + 85, 17, 255, 19, 13, 6, 227, 0, 12, 10, 8, 5, 176, 190, + 107, 25, 255, 212, 127, 35, 255, 214, 134, 39, 255, 30, 21, 13, + 255, 0, 24, 12, 10, 7, 170, 194, 109, 33, 255, 213, 132, 36, + 255, 208, 122, 29, 255, 28, 20, 11, 255, 0, 24, 9, 7, 4, + 147, 136, 70, 17, 255, 202, 98, 21, 255, 211, 126, 34, 255, 27, + 20, 12, 255, 3, 3, 2, 28, 0, 8, 10, 8, 7, 195, 180, + 93, 23, 255, 202, 102, 21, 255, 202, 102, 21, 255, 25, 17, 10, + 221, 0, 8, 13, 11, 8, 65, 129, 70, 22, 255, 172, 88, 21, + 255, 144, 78, 19, 255, 22, 15, 7, 176, 0, 12, 10, 8, 7, + 198, 198, 124, 37, 255, 215, 136, 42, 255, 214, 134, 39, 255, 27, + 21, 12, 212, 0, 8, 12, 10, 7, 79, 151, 88, 26, 255, 198, + 116, 29, 255, 192, 109, 27, 255, 25, 18, 10, 167, 0, 8, 12, + 9, 7, 82, 119, 62, 20, 255, 174, 89, 21, 255, 154, 79, 19, + 255, 22, 15, 7, 181, 0, 20, 5, 5, 4, 68, 20, 14, 7, + 249, 142, 73, 17, 255, 143, 74, 18, 255, 45, 26, 10, 255, 10, + 8, 5, 85, 0, 76, 7, 6, 6, 85, 39, 30, 18, 255, 196, + 121, 41, 255, 213, 135, 42, 255, 115, 72, 30, 255, 10, 9, 7, + 170, 0, 40, 5, 5, 4, 17, 6, 5, 5, 85, 5, 5, 4, + 45, 0, 28, 9, 7, 4, 142, 146, 79, 19, 255, 204, 108, 23, + 255, 212, 126, 33, 255, 30, 22, 13, 255, 3, 3, 3, 40, 0, + 36, 10, 8, 5, 125, 133, 66, 16, 255, 161, 85, 17, 255, 161, + 85, 17, 255, 19, 13, 6, 212, 0, 12, 10, 8, 5, 127, 136, + 70, 17, 255, 193, 97, 20, 255, 203, 108, 24, 255, 30, 21, 11, + 193, 0, 8, 13, 10, 6, 85, 134, 70, 19, 255, 171, 90, 18, + 255, 159, 81, 18, 255, 17, 12, 6, 238, 0, 12, 8, 6, 5, + 144, 135, 66, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 23, + 15, 6, 170, 0, 8, 10, 7, 5, 85, 133, 66, 16, 255, 185, + 94, 20, 255, 209, 123, 30, 255, 23, 18, 12, 255, 3, 3, 2, + 28, 0, 4, 5, 5, 4, 28, 18, 15, 11, 227, 134, 72, 21, + 255, 158, 81, 19, 255, 143, 74, 18, 255, 22, 15, 7, 142, 0, + 8, 10, 8, 5, 85, 131, 65, 16, 255, 163, 79, 18, 255, 178, + 90, 19, 255, 22, 16, 9, 255, 3, 2, 2, 20, 0, 8, 9, + 7, 6, 176, 144, 78, 19, 255, 175, 88, 18, 255, 163, 79, 18, + 255, 26, 16, 7, 170, 0, 8, 10, 8, 5, 85, 129, 64, 16, + 255, 161, 85, 17, 255, 161, 78, 17, 255, 19, 13, 6, 229, 0, + 32, 8, 7, 5, 156, 144, 78, 19, 255, 202, 102, 21, 255, 206, + 111, 27, 255, 27, 20, 12, 255, 0, 32, 10, 8, 5, 133, 135, + 66, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 19, 13, 6, + 227, 0, 12, 8, 7, 5, 255, 172, 85, 21, 255, 189, 92, 20, + 255, 172, 87, 19, 255, 24, 16, 7, 170, 0, 8, 10, 8, 5, + 85, 129, 64, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 19, + 13, 6, 212, 0, 12, 10, 8, 5, 127, 135, 66, 16, 255, 161, + 85, 17, 255, 161, 85, 17, 255, 26, 16, 7, 170, 0, 8, 11, + 9, 6, 85, 134, 70, 19, 255, 171, 90, 18, 255, 159, 78, 18, + 255, 23, 15, 6, 170, 0, 8, 9, 7, 4, 57, 98, 49, 13, + 255, 139, 71, 16, 255, 133, 66, 16, 255, 19, 13, 6, 193, 0, + 12, 7, 6, 4, 176, 133, 66, 16, 255, 161, 85, 17, 255, 161, + 85, 17, 255, 23, 15, 6, 170, 0, 8, 10, 8, 5, 85, 129, + 64, 16, 255, 165, 87, 18, 255, 180, 91, 19, 255, 20, 15, 9, + 255, 0, 4, 5, 5, 4, 17, 26, 21, 15, 227, 126, 75, 25, + 255, 178, 95, 21, 255, 142, 74, 19, 255, 46, 28, 11, 255, 10, + 8, 5, 57, 0, 8, 10, 8, 5, 85, 131, 65, 16, 255, 161, + 85, 17, 255, 161, 85, 17, 255, 17, 12, 6, 252, 2, 1, 1, + 8, 0, 28, 13, 11, 8, 170, 199, 119, 34, 255, 215, 136, 42, + 255, 214, 139, 41, 255, 28, 20, 13, 255, 0, 20, 8, 7, 5, + 170, 135, 66, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 23, + 15, 6, 170, 0, 8, 10, 8, 5, 85, 131, 67, 16, 255, 202, + 102, 21, 255, 211, 127, 36, 255, 22, 17, 11, 249, 0, 8, 16, + 14, 11, 201, 101, 67, 28, 255, 191, 98, 22, 255, 185, 94, 20, + 255, 172, 87, 19, 255, 26, 17, 7, 170, 0, 8, 10, 8, 5, + 85, 129, 64, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 31, + 20, 8, 255, 5, 5, 4, 102, 0, 4, 5, 4, 4, 28, 16, + 13, 9, 255, 164, 85, 21, 255, 180, 91, 19, 255, 165, 87, 18, + 255, 26, 17, 7, 170, 0, 8, 10, 8, 5, 85, 129, 64, 16, + 255, 161, 85, 17, 255, 161, 85, 17, 255, 19, 13, 6, 212, 0, + 40, 10, 8, 5, 133, 135, 66, 16, 255, 161, 85, 17, 255, 161, + 85, 17, 255, 26, 17, 7, 255, 3, 3, 2, 136, 9, 7, 4, + 227, 131, 67, 20, 255, 197, 104, 22, 255, 198, 104, 21, 255, 183, + 93, 19, 255, 172, 87, 19, 255, 26, 17, 7, 170, 0, 8, 10, + 8, 5, 85, 129, 64, 16, 255, 161, 85, 17, 255, 161, 85, 17, + 255, 19, 13, 6, 212, 0, 12, 10, 8, 5, 127, 135, 66, 16, + 255, 193, 97, 20, 255, 209, 123, 30, 255, 19, 15, 10, 252, 0, + 8, 13, 11, 8, 65, 125, 68, 22, 255, 174, 86, 21, 255, 146, + 76, 19, 255, 22, 14, 7, 178, 0, 12, 8, 6, 5, 144, 135, + 66, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 19, 14, 6, + 238, 0, 24, 13, 11, 8, 170, 163, 87, 20, 255, 180, 91, 19, + 255, 165, 87, 18, 255, 17, 12, 6, 255, 0, 24, 9, 7, 4, + 139, 135, 66, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 15, + 11, 6, 246, 0, 12, 9, 7, 6, 184, 180, 93, 23, 255, 211, + 115, 30, 255, 213, 133, 38, 255, 28, 20, 13, 255, 0, 16, 12, + 11, 9, 170, 152, 91, 31, 255, 188, 105, 31, 255, 115, 66, 22, + 255, 91, 50, 16, 255, 84, 46, 15, 255, 116, 59, 17, 255, 118, + 62, 17, 255, 15, 11, 6, 221, 0, 16, 10, 8, 5, 116, 146, + 79, 19, 255, 202, 103, 23, 255, 209, 128, 32, 255, 200, 127, 41, + 255, 167, 106, 40, 255, 197, 122, 42, 255, 210, 130, 35, 255, 186, + 106, 27, 255, 88, 51, 19, 255, 102, 55, 17, 255, 157, 83, 18, + 255, 189, 92, 20, 255, 209, 123, 30, 255, 29, 21, 12, 224, 0, + 8, 7, 6, 6, 28, 41, 31, 18, 235, 160, 84, 23, 255, 170, + 87, 19, 255, 45, 26, 10, 255, 5, 5, 4, 170, 4, 4, 4, + 8, 4, 4, 3, 99, 15, 12, 6, 255, 140, 72, 17, 255, 138, + 71, 17, 255, 45, 26, 10, 255, 10, 8, 5, 85, 0, 24, 8, + 7, 5, 142, 133, 66, 16, 255, 161, 85, 17, 255, 161, 85, 17, + 255, 19, 13, 6, 229, 0, 24, 13, 11, 8, 170, 160, 86, 21, + 255, 185, 90, 20, 255, 91, 50, 16, 255, 7, 6, 4, 255, 0, + 40, 8, 7, 5, 150, 133, 66, 16, 255, 161, 85, 17, 255, 161, + 85, 17, 255, 15, 11, 6, 246, 0, 32, 8, 8, 7, 110, 74, + 52, 27, 255, 191, 103, 24, 255, 176, 89, 19, 255, 34, 22, 9, + 255, 6, 5, 3, 57, 0, 20, 8, 6, 5, 161, 133, 66, 16, + 255, 161, 85, 17, 255, 161, 78, 17, 255, 15, 11, 6, 252, 0, + 140, 12, 10, 5, 85, 123, 61, 16, 255, 161, 85, 17, 255, 161, + 85, 17, 255, 22, 15, 7, 255, 2, 2, 1, 85, 0, 8, 7, + 6, 4, 244, 133, 66, 16, 255, 167, 88, 18, 255, 189, 92, 20, + 255, 27, 19, 10, 195, 0, 8, 12, 10, 7, 110, 160, 83, 21, + 255, 177, 85, 18, 255, 161, 78, 17, 255, 15, 11, 6, 252, 0, + 12, 7, 6, 4, 161, 133, 66, 16, 255, 161, 85, 17, 255, 161, + 85, 17, 255, 23, 15, 6, 170, 0, 8, 11, 9, 6, 85, 134, + 70, 19, 255, 171, 90, 18, 255, 159, 78, 18, 255, 15, 11, 6, + 249, 0, 12, 10, 8, 5, 85, 98, 49, 13, 255, 135, 72, 16, + 255, 133, 66, 16, 255, 19, 13, 6, 139, 0, 8, 10, 8, 5, + 85, 131, 65, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 15, + 11, 6, 246, 0, 12, 7, 6, 4, 164, 133, 66, 16, 255, 165, + 87, 18, 255, 178, 90, 19, 255, 24, 17, 9, 212, 0, 8, 13, + 11, 8, 105, 165, 86, 22, 255, 180, 91, 19, 255, 159, 81, 18, + 255, 19, 14, 6, 255, 2, 2, 1, 79, 0, 44, 8, 6, 5, + 167, 133, 66, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 15, + 11, 6, 252, 0, 16, 7, 6, 6, 28, 24, 19, 13, 227, 103, + 59, 20, 255, 157, 83, 18, 255, 154, 78, 17, 255, 150, 81, 19, + 255, 154, 79, 19, 255, 158, 81, 19, 255, 162, 83, 19, 255, 161, + 85, 17, 255, 159, 81, 18, 255, 163, 86, 18, 255, 27, 18, 8, + 170, 0, 8, 11, 9, 6, 85, 131, 67, 16, 255, 165, 87, 18, + 255, 161, 85, 17, 255, 15, 11, 6, 252, 0, 12, 8, 6, 5, + 167, 133, 66, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 23, + 15, 6, 170, 0, 8, 10, 8, 5, 85, 131, 65, 16, 255, 175, + 88, 18, 255, 191, 96, 20, 255, 25, 18, 10, 255, 0, 24, 11, + 9, 6, 170, 148, 77, 19, 255, 169, 82, 18, 255, 161, 85, 17, + 255, 23, 15, 6, 170, 0, 8, 10, 8, 5, 85, 129, 64, 16, + 255, 161, 85, 17, 255, 161, 85, 17, 255, 87, 47, 14, 255, 23, + 17, 8, 255, 65, 34, 12, 255, 150, 76, 17, 255, 132, 68, 17, + 255, 41, 25, 10, 255, 10, 8, 5, 85, 0, 16, 8, 7, 5, + 150, 133, 66, 16, 255, 161, 85, 17, 255, 161, 78, 17, 255, 23, + 15, 6, 170, 0, 8, 10, 8, 5, 85, 129, 64, 16, 255, 161, + 85, 17, 255, 161, 85, 17, 255, 23, 15, 6, 170, 0, 4, 8, + 7, 5, 153, 133, 66, 16, 255, 19, 13, 6, 238, 0, 4, 10, + 8, 5, 85, 129, 64, 16, 255, 161, 85, 17, 255, 161, 85, 17, + 255, 23, 15, 6, 170, 0, 8, 10, 8, 5, 85, 129, 64, 16, + 255, 161, 85, 17, 255, 161, 85, 17, 255, 15, 11, 6, 252, 0, + 12, 8, 6, 5, 167, 133, 66, 16, 255, 161, 85, 17, 255, 161, + 85, 17, 255, 23, 15, 6, 170, 0, 8, 10, 8, 5, 85, 129, + 64, 16, 255, 161, 85, 17, 255, 161, 85, 17, 255, 31, 20, 8, + 255, 5, 4, 4, 85, 0, 4, 5, 4, 4, 40, 17, 14, 10, + 255, 200, 120, 35, 255, 207, 112, 28, 255, 195, 98, 20, 255, 29, + 20, 8, 170, 0, 8, 10, 8, 5, 85, 131, 65, 16, 255, 163, + 86, 18, 255, 159, 81, 18, 255, 150, 76, 17, 255, 137, 70, 16, + 255, 135, 72, 16, 255, 135, 66, 16, 255, 146, 75, 17, 255, 159, + 81, 18, 255, 131, 67, 20, 255, 42, 31, 17, 255, 10, 9, 7, + 62, 0, 8, 5, 5, 4, 8, 26, 21, 15, 227, 137, 79, 28, + 255, 174, 88, 19, 255, 158, 83, 17, 255, 137, 70, 16, 255, 135, + 72, 16, 255, 135, 66, 16, 255, 146, 75, 17, 255, 159, 81, 18, + 255, 161, 85, 17, 255, 161, 85, 17, 255, 23, 15, 6, 170, 0, + 8, 10, 8, 5, 85, 131, 67, 16, 255, 163, 86, 18, 255, 159, + 81, 18, 255, 17, 12, 6, 255, 0, 68, 2, 1, 1, 8, 7, + 6, 4, 249, 137, 67, 16, 255, 165, 80, 18, 255, 154, 78, 17, + 255, 27, 18, 8, 170, 0, 16, 8, 6, 5, 167, 133, 66, 16, + 255, 161, 85, 17, 255, 161, 85, 17, 255, 15, 11, 6, 252, 0, + 16, 13, 11, 8, 170, 199, 124, 36, 255, 211, 125, 32, 255, 200, + 105, 21, 255, 18, 13, 7, 255, 0, 12, 7, 6, 4, 164, 133, + 66, 16, 255, 161, 85, 17, 255, 161, 78, 17, 255, 19, 13, 6, + 227, 0, 16, 8, 7, 5, 122, 68, 38, 13, 255, 150, 83, 23, + 255, 174, 107, 35, 255, 181, 112, 38, 255, 190, 117, 39, 255, 193, + 114, 36, 255, 143, 84, 26, 255, 15, 12, 8, 212, 4, 4, 3, + 6, 0, 12, 10, 8, 5, 108, 135, 66, 16, 255, 161, 85, 17, + 255, 161, 85, 17, 255, 125, 65, 16, 255, 90, 47, 13, 255, 121, + 60, 16, 255, 164, 84, 19, 255, 189, 97, 22, 255, 177, 104, 32, + 255, 194, 123, 39, 255, 212, 134, 41, 255, 210, 124, 31, 255, 200, + 105, 21, 255, 23, 17, 8, 218, 0, 16, 10, 8, 5, 167, 56, + 31, 11, 255, 110, 55, 15, 255, 118, 62, 17, 255, 115, 58, 16, + 255, 115, 58, 16, 255, 120, 63, 17, 255, 95, 46, 14, 255, 17, + 13, 6, 227, 7, 6, 4, 28, 0, 16, 14, 12, 7, 227, 87, + 43, 14, 255, 154, 78, 17, 255, 152, 77, 17, 255, 139, 71, 16, + 255, 135, 72, 16, 255, 135, 66, 16, 255, 146, 75, 17, 255, 200, + 105, 21, 255, 211, 127, 36, 255, 214, 134, 39, 255, 23, 18, 12, + 255, 0, 12, 7, 6, 4, 85, 26, 16, 7, 255, 131, 67, 16, + 255, 145, 75, 18, 255, 78, 43, 15, 255, 7, 6, 4, 255, 0, + 40, 10, 8, 5, 136, 157, 81, 20, 255, 210, 129, 33, 255, 139, + 89, 36, 255, 10, 9, 7, 198, 0, 16, 13, 11, 8, 170, 196, + 113, 31, 255, 206, 114, 25, 255, 189, 92, 20, 255, 18, 13, 7, + 244, 0, 16, 5, 4, 4, 88, 27, 19, 8, 255, 141, 73, 18, + 255, 161, 85, 17, 255, 21, 14, 6, 218, 0, 112, 12, 9, 7, + 99, 11, 8, 6, 170, 10, 8, 5, 91, 0, 60, 11, 10, 8, + 28, 32, 23, 13, 227, 108, 57, 19, 255, 153, 82, 18, 255, 154, + 78, 17, 255, 146, 75, 17, 255, 97, 47, 14, 255, 36, 24, 11, + 255, 108, 64, 25, 255, 203, 111, 30, 255, 207, 118, 32, 255, 207, + 118, 32, 255, 189, 110, 32, 255, 63, 41, 20, 255, 15, 12, 8, + 76, 0, 8, 9, 8, 6, 28, 38, 27, 15, 218, 51, 33, 18, + 255, 48, 32, 17, 255, 131, 74, 24, 255, 182, 97, 21, 255, 176, + 89, 19, 255, 170, 87, 19, 255, 134, 72, 21, 255, 37, 25, 14, + 255, 15, 13, 8, 144, 7, 7, 6, 28, 0, 12, 11, 9, 8, + 127, 171, 99, 28, 255, 208, 123, 31, 255, 203, 124, 30, 255, 104, + 63, 27, 255, 15, 13, 10, 212, 7, 6, 6, 28, 0, 12, 14, + 11, 7, 170, 142, 74, 19, 255, 161, 85, 17, 255, 159, 81, 18, + 255, 27, 18, 8, 184, 0, 8, 6, 5, 3, 28, 27, 17, 8, + 227, 92, 46, 13, 255, 111, 55, 14, 255, 31, 20, 8, 255, 8, + 6, 3, 198, 9, 7, 4, 170, 10, 8, 5, 227, 22, 16, 9, + 255, 61, 39, 18, 255, 107, 64, 26, 255, 108, 66, 25, 255, 32, + 22, 11, 255, 9, 7, 6, 170, 0, 44, 10, 9, 7, 156, 56, + 36, 19, 255, 191, 114, 32, 255, 175, 98, 30, 255, 41, 27, 16, + 255, 11, 9, 6, 57, 0, 12, 21, 15, 10, 227, 100, 56, 21, + 255, 160, 83, 21, 255, 80, 44, 17, 255, 14, 12, 7, 190, 7, + 6, 6, 28, 0, 16, 13, 10, 6, 28, 29, 20, 10, 212, 21, + 15, 10, 144, 0, 20, 12, 9, 7, 85, 39, 24, 10, 173, 16, + 12, 7, 85, 0, 32, 6, 5, 3, 20, 19, 13, 6, 173, 21, + 14, 6, 255, 21, 15, 6, 215, 10, 8, 5, 85, 0, 24, 15, + 12, 8, 170, 190, 98, 23, 255, 203, 108, 24, 255, 202, 111, 23, + 255, 23, 17, 10, 255, 0, 60, 17, 13, 10, 170, 195, 112, 30, + 255, 211, 124, 30, 255, 205, 106, 26, 255, 31, 21, 12, 255, 0, + 12, 8, 6, 5, 139, 44, 25, 9, 255, 135, 72, 16, 255, 104, + 54, 13, 255, 15, 11, 6, 249, 7, 6, 4, 28, 0, 24, 7, + 6, 4, 57, 44, 25, 9, 255, 137, 73, 16, 255, 143, 70, 16, + 255, 49, 25, 8, 255, 8, 6, 3, 184, 8, 6, 3, 85, 8, + 6, 3, 142, 23, 16, 6, 255, 130, 66, 15, 255, 145, 77, 16, + 255, 87, 44, 12, 255, 10, 8, 5, 142, 0, 20, 11, 9, 8, + 164, 53, 31, 14, 255, 150, 74, 19, 255, 154, 78, 17, 255, 148, + 76, 17, 255, 65, 33, 10, 255, 10, 8, 5, 184, 6, 5, 5, + 28, 0, 16, 11, 9, 6, 142, 175, 102, 30, 255, 207, 123, 32, + 255, 208, 114, 31, 255, 196, 114, 33, 255, 89, 56, 26, 255, 17, + 13, 10, 255, 11, 8, 6, 170, 9, 7, 6, 170, 11, 8, 6, + 170, 15, 11, 8, 170, 18, 13, 9, 142, 8, 6, 5, 28, 0, + 8, 10, 8, 5, 93, 102, 53, 17, 255, 159, 81, 18, 255, 154, + 78, 17, 255, 72, 37, 11, 255, 11, 8, 6, 227, 9, 7, 6, + 170, 11, 8, 6, 198, 61, 36, 20, 255, 196, 107, 27, 255, 204, + 114, 27, 255, 182, 102, 31, 255, 19, 14, 10, 170, 0, 8, 6, + 6, 5, 20, 26, 19, 11, 198, 28, 20, 11, 255, 22, 16, 9, + 255, 23, 16, 8, 255, 27, 18, 8, 255, 24, 16, 7, 255, 24, + 16, 7, 255, 74, 39, 11, 255, 139, 68, 16, 255, 143, 70, 16, + 255, 143, 70, 16, 255, 20, 13, 5, 170, 0, 8, 7, 6, 4, + 74, 87, 44, 12, 255, 155, 79, 18, 255, 151, 73, 16, 255, 67, + 34, 10, 255, 9, 7, 4, 198, 9, 7, 4, 96, 8, 6, 5, + 159, 27, 17, 8, 255, 137, 67, 16, 255, 158, 80, 17, 255, 112, + 56, 15, 255, 10, 8, 5, 167, 0, 8, 7, 5, 4, 85, 74, + 36, 11, 255, 150, 83, 17, 255, 145, 77, 16, 255, 55, 29, 10, + 255, 8, 6, 3, 198, 8, 6, 3, 88, 7, 6, 4, 153, 39, + 24, 12, 255, 199, 112, 28, 255, 210, 115, 31, 255, 184, 108, 33, + 255, 17, 14, 10, 198, 0, 24, 11, 9, 6, 170, 139, 69, 18, + 255, 168, 86, 19, 255, 154, 78, 17, 255, 17, 12, 6, 235, 0, + 24, 7, 6, 4, 85, 64, 32, 11, 255, 162, 80, 19, 255, 198, + 96, 21, 255, 109, 63, 26, 255, 15, 11, 8, 227, 10, 8, 7, + 170, 8, 7, 5, 195, 29, 18, 8, 255, 137, 67, 16, 255, 154, + 78, 17, 255, 114, 59, 15, 255, 11, 10, 6, 164, 0, 8, 9, + 7, 6, 85, 97, 50, 16, 255, 159, 81, 18, 255, 152, 77, 17, + 255, 74, 36, 11, 255, 10, 8, 5, 198, 7, 6, 4, 125, 10, + 8, 5, 198, 61, 36, 20, 255, 200, 105, 29, 255, 209, 122, 28, + 255, 180, 104, 29, 255, 16, 12, 9, 170, 0, 8, 12, 10, 7, + 170, 160, 83, 21, 255, 183, 89, 19, 255, 174, 88, 19, 255, 28, + 19, 9, 187, 0, 8, 14, 10, 7, 85, 143, 75, 20, 255, 195, + 98, 20, 255, 189, 92, 20, 255, 21, 15, 8, 224, 0, 24, 7, + 6, 4, 85, 26, 16, 7, 255, 111, 55, 14, 255, 132, 67, 15, + 255, 39, 23, 8, 255, 8, 6, 3, 113, 0, 68, 9, 7, 6, + 85, 32, 22, 13, 255, 188, 112, 31, 255, 193, 114, 30, 255, 94, + 57, 25, 255, 17, 13, 10, 170, 0, 44, 9, 7, 4, 142, 10, + 8, 5, 255, 10, 8, 5, 198, 6, 5, 3, 28, 0, 24, 8, + 7, 5, 85, 88, 48, 19, 255, 204, 114, 27, 255, 208, 118, 31, + 255, 111, 62, 26, 255, 11, 8, 6, 227, 8, 7, 5, 150, 10, + 8, 5, 116, 10, 8, 5, 88, 9, 7, 4, 85, 6, 5, 3, + 74, 0, 16, 10, 8, 5, 99, 114, 56, 13, 255, 143, 70, 16, + 255, 143, 70, 16, 255, 18, 12, 5, 215, 0, 12, 8, 7, 3, + 130, 118, 60, 13, 255, 148, 76, 17, 255, 150, 76, 17, 255, 24, + 16, 7, 170, 0, 8, 9, 7, 4, 85, 114, 56, 13, 255, 145, + 74, 16, 255, 143, 70, 16, 255, 52, 28, 9, 255, 8, 6, 3, + 198, 8, 6, 3, 88, 8, 6, 3, 144, 23, 15, 6, 255, 130, + 66, 15, 255, 151, 80, 16, 255, 111, 55, 14, 255, 10, 8, 5, + 144, 0, 8, 6, 5, 3, 59, 59, 32, 10, 255, 157, 83, 18, + 255, 185, 90, 20, 255, 97, 54, 22, 255, 14, 10, 7, 227, 13, + 10, 6, 170, 13, 10, 6, 255, 84, 41, 13, 255, 148, 76, 17, + 255, 155, 82, 18, 255, 135, 66, 16, 255, 14, 10, 5, 159, 0, + 8, 9, 7, 4, 85, 114, 56, 13, 255, 145, 77, 16, 255, 145, + 74, 16, 255, 55, 28, 10, 255, 9, 7, 4, 198, 8, 6, 3, + 93, 8, 6, 3, 147, 25, 16, 6, 255, 130, 64, 15, 255, 151, + 80, 16, 255, 111, 55, 14, 255, 10, 8, 5, 142, 0, 8, 9, + 7, 4, 85, 114, 56, 13, 255, 145, 77, 16, 255, 143, 70, 16, + 255, 52, 28, 9, 255, 8, 6, 3, 198, 8, 6, 3, 102, 8, + 6, 3, 139, 8, 6, 3, 170, 9, 8, 4, 113, 0, 12, 10, + 8, 5, 91, 114, 56, 13, 255, 150, 76, 17, 255, 150, 76, 17, + 255, 17, 12, 6, 252, 0, 32, 7, 6, 4, 85, 64, 33, 11, + 255, 145, 77, 16, 255, 143, 70, 16, 255, 56, 29, 9, 255, 8, + 6, 3, 198, 8, 6, 3, 85, 6, 5, 3, 119, 14, 11, 5, + 255, 128, 66, 15, 255, 151, 73, 16, 255, 143, 76, 16, 255, 20, + 13, 5, 170, 0, 8, 9, 7, 4, 85, 114, 56, 13, 255, 143, + 70, 16, 255, 143, 70, 16, 255, 18, 12, 5, 215, 0, 12, 8, + 7, 3, 130, 114, 56, 13, 255, 143, 70, 16, 255, 143, 70, 16, + 255, 20, 13, 5, 170, 0, 8, 9, 7, 4, 85, 114, 56, 13, + 255, 143, 70, 16, 255, 143, 70, 16, 255, 20, 13, 5, 170, 0, + 8, 7, 6, 4, 71, 87, 44, 12, 255, 158, 87, 17, 255, 161, + 85, 17, 255, 103, 53, 20, 255, 15, 11, 8, 227, 10, 8, 7, + 170, 10, 8, 7, 195, 33, 20, 10, 255, 137, 67, 16, 255, 151, + 73, 16, 255, 111, 55, 14, 255, 10, 8, 5, 142, 0, 8, 9, + 7, 4, 85, 114, 56, 13, 255, 143, 70, 16, 255, 146, 75, 17, + 255, 18, 13, 7, 255, 0, 8, 7, 6, 6, 74, 24, 16, 7, + 255, 132, 67, 15, 255, 145, 77, 16, 255, 135, 72, 16, 255, 14, + 10, 5, 170, 0, 8, 9, 7, 4, 85, 114, 56, 13, 255, 145, + 77, 16, 255, 143, 70, 16, 255, 58, 31, 11, 255, 11, 8, 6, + 227, 11, 9, 6, 170, 11, 8, 6, 170, 10, 7, 5, 170, 9, + 8, 4, 113, 0, 12, 11, 9, 6, 161, 175, 92, 24, 255, 203, + 108, 24, 255, 198, 101, 23, 255, 25, 18, 10, 255, 0, 20, 8, + 6, 3, 147, 114, 56, 13, 255, 143, 70, 16, 255, 143, 70, 16, + 255, 20, 13, 5, 170, 0, 8, 9, 7, 4, 85, 114, 56, 13, + 255, 170, 87, 19, 255, 199, 106, 24, 255, 24, 17, 11, 255, 0, + 8, 6, 6, 5, 28, 15, 12, 6, 255, 128, 66, 15, 255, 145, + 74, 16, 255, 143, 70, 16, 255, 20, 13, 5, 170, 0, 8, 6, + 5, 3, 57, 57, 31, 10, 255, 145, 77, 16, 255, 143, 70, 16, + 255, 90, 44, 13, 255, 19, 13, 6, 255, 10, 8, 5, 255, 13, + 10, 6, 255, 62, 33, 11, 255, 135, 72, 16, 255, 151, 73, 16, + 255, 108, 53, 13, 255, 10, 8, 5, 142, 0, 8, 9, 7, 4, + 85, 114, 56, 13, 255, 143, 70, 16, 255, 143, 70, 16, 255, 18, + 12, 5, 215, 0, 40, 7, 6, 4, 85, 64, 33, 11, 255, 145, + 77, 16, 255, 143, 70, 16, 255, 67, 34, 10, 255, 14, 10, 5, + 255, 49, 27, 9, 255, 140, 72, 17, 255, 160, 85, 19, 255, 160, + 85, 19, 255, 110, 55, 15, 255, 31, 20, 8, 255, 9, 7, 4, + 57, 0, 8, 9, 8, 4, 85, 114, 56, 13, 255, 143, 70, 16, + 255, 143, 70, 16, 255, 18, 12, 5, 215, 0, 12, 8, 7, 3, + 136, 118, 60, 13, 255, 154, 75, 17, 255, 172, 87, 19, 255, 24, + 17, 9, 204, 0, 8, 8, 7, 5, 85, 95, 49, 16, 255, 161, + 85, 17, 255, 152, 77, 17, 255, 71, 34, 10, 255, 9, 7, 4, + 198, 8, 6, 3, 88, 8, 6, 3, 142, 23, 15, 6, 255, 130, + 66, 15, 255, 151, 80, 16, 255, 111, 55, 14, 255, 14, 10, 5, + 170, 0, 24, 9, 7, 4, 164, 118, 56, 15, 255, 145, 74, 16, + 255, 143, 70, 16, 255, 16, 12, 5, 224, 0, 24, 9, 7, 4, + 85, 85, 43, 12, 255, 151, 80, 16, 255, 143, 70, 16, 255, 55, + 29, 10, 255, 8, 6, 3, 198, 8, 6, 3, 93, 8, 6, 5, + 173, 45, 27, 14, 255, 199, 112, 28, 255, 210, 124, 31, 255, 199, + 119, 34, 255, 19, 15, 10, 221, 0, 20, 13, 11, 8, 170, 46, + 28, 11, 255, 131, 65, 16, 255, 145, 74, 16, 255, 137, 67, 16, + 255, 70, 35, 11, 255, 12, 10, 5, 224, 7, 6, 4, 28, 0, + 16, 8, 6, 5, 34, 37, 25, 14, 255, 181, 100, 28, 255, 206, + 113, 31, 255, 207, 123, 32, 255, 199, 119, 34, 255, 107, 67, 28, + 255, 28, 20, 11, 255, 28, 19, 9, 255, 84, 41, 13, 255, 141, + 75, 16, 255, 145, 74, 16, 255, 159, 82, 20, 255, 88, 53, 25, + 255, 13, 11, 8, 99, 0, 8, 13, 10, 6, 85, 114, 60, 17, + 255, 148, 76, 17, 255, 143, 70, 16, 255, 21, 14, 6, 255, 0, + 12, 10, 8, 5, 170, 119, 61, 14, 255, 145, 77, 16, 255, 135, + 72, 16, 255, 19, 13, 6, 170, 0, 24, 8, 7, 3, 142, 114, + 56, 13, 255, 143, 70, 16, 255, 143, 70, 16, 255, 16, 12, 5, + 218, 0, 24, 11, 8, 6, 170, 126, 62, 15, 255, 151, 80, 16, + 255, 112, 57, 13, 255, 19, 13, 6, 255, 8, 6, 3, 144, 8, + 6, 3, 85, 9, 7, 4, 113, 8, 6, 3, 167, 8, 6, 3, + 170, 8, 6, 3, 170, 9, 8, 4, 113, 0, 12, 10, 8, 5, + 91, 114, 56, 13, 255, 145, 74, 16, 255, 143, 70, 16, 255, 61, + 32, 10, 255, 9, 8, 4, 170, 0, 32, 12, 10, 7, 207, 74, + 36, 11, 255, 139, 74, 16, 255, 79, 40, 12, 255, 10, 8, 5, + 210, 0, 16, 9, 7, 4, 85, 27, 17, 6, 255, 130, 66, 15, + 255, 143, 70, 16, 255, 143, 76, 16, 255, 16, 12, 5, 221, 0, + 140, 8, 6, 3, 85, 74, 39, 11, 255, 145, 77, 16, 255, 143, + 70, 16, 255, 41, 23, 8, 255, 7, 6, 4, 173, 5, 5, 2, + 85, 6, 5, 3, 113, 14, 10, 5, 255, 129, 65, 14, 255, 145, + 74, 16, 255, 145, 74, 16, 255, 24, 16, 7, 170, 0, 8, 10, + 8, 5, 85, 112, 57, 13, 255, 145, 77, 16, 255, 143, 70, 16, + 255, 52, 28, 9, 255, 8, 6, 3, 198, 8, 6, 3, 88, 8, + 6, 3, 144, 23, 15, 6, 255, 130, 66, 15, 255, 151, 80, 16, + 255, 111, 55, 14, 255, 10, 8, 5, 144, 0, 8, 6, 5, 3, + 59, 63, 34, 10, 255, 145, 77, 16, 255, 143, 70, 16, 255, 55, + 29, 10, 255, 8, 6, 3, 198, 8, 6, 3, 85, 8, 6, 3, + 144, 32, 19, 7, 255, 139, 74, 16, 255, 155, 79, 18, 255, 135, + 66, 16, 255, 14, 10, 5, 170, 0, 8, 6, 5, 3, 57, 57, + 31, 10, 255, 145, 77, 16, 255, 143, 70, 16, 255, 55, 29, 10, + 255, 8, 6, 3, 198, 8, 6, 3, 88, 8, 6, 3, 144, 21, + 15, 6, 255, 130, 66, 15, 255, 143, 76, 16, 255, 146, 75, 17, + 255, 24, 15, 7, 184, 0, 8, 7, 6, 4, 71, 66, 33, 11, + 255, 148, 79, 17, 255, 143, 70, 16, 255, 45, 25, 8, 255, 7, + 5, 4, 176, 7, 5, 4, 85, 8, 6, 3, 85, 9, 7, 4, + 85, 8, 6, 3, 82, 0, 28, 8, 7, 3, 136, 114, 56, 13, + 255, 143, 70, 16, 255, 143, 70, 16, 255, 16, 12, 5, 221, 0, + 20, 7, 6, 4, 28, 10, 8, 5, 130, 19, 13, 6, 170, 29, + 19, 8, 173, 24, 16, 7, 212, 27, 18, 8, 193, 20, 13, 7, + 246, 55, 29, 10, 255, 139, 74, 16, 255, 143, 70, 16, 255, 143, + 70, 16, 255, 18, 13, 5, 170, 0, 8, 9, 7, 4, 85, 115, + 54, 14, 255, 143, 70, 16, 255, 143, 70, 16, 255, 16, 12, 5, + 221, 0, 12, 8, 7, 3, 136, 114, 56, 13, 255, 143, 70, 16, + 255, 143, 70, 16, 255, 20, 13, 5, 170, 0, 8, 9, 7, 4, + 85, 114, 56, 13, 255, 145, 74, 16, 255, 145, 74, 16, 255, 17, + 11, 6, 252, 0, 24, 10, 8, 5, 170, 119, 61, 14, 255, 145, + 74, 16, 255, 143, 70, 16, 255, 18, 13, 5, 170, 0, 8, 9, + 7, 4, 85, 114, 56, 13, 255, 143, 70, 16, 255, 143, 70, 16, + 255, 33, 20, 8, 255, 5, 4, 4, 195, 8, 6, 5, 198, 46, + 26, 9, 255, 126, 62, 15, 255, 132, 67, 15, 255, 35, 22, 8, + 255, 9, 7, 4, 93, 0, 12, 10, 8, 5, 93, 114, 56, 13, + 255, 143, 70, 16, 255, 143, 70, 16, 255, 20, 13, 5, 170, 0, + 8, 9, 7, 4, 85, 114, 56, 13, 255, 143, 70, 16, 255, 143, + 70, 16, 255, 20, 13, 5, 170, 0, 4, 9, 7, 4, 125, 114, + 56, 13, 255, 21, 13, 6, 210, 0, 4, 9, 7, 4, 85, 114, + 56, 13, 255, 143, 70, 16, 255, 143, 70, 16, 255, 20, 13, 5, + 170, 0, 8, 9, 7, 4, 85, 114, 56, 13, 255, 143, 70, 16, + 255, 143, 70, 16, 255, 16, 12, 5, 221, 0, 12, 8, 7, 3, + 136, 114, 56, 13, 255, 143, 70, 16, 255, 143, 70, 16, 255, 20, + 13, 5, 170, 0, 8, 6, 5, 3, 57, 57, 31, 10, 255, 145, + 77, 16, 255, 143, 70, 16, 255, 90, 44, 13, 255, 17, 12, 6, + 255, 12, 9, 5, 255, 20, 15, 9, 255, 97, 51, 20, 255, 169, + 87, 20, 255, 161, 85, 17, 255, 112, 54, 15, 255, 10, 8, 5, + 142, 0, 8, 9, 7, 4, 85, 121, 60, 16, 255, 174, 88, 19, + 255, 176, 89, 19, 255, 112, 59, 17, 255, 37, 23, 10, 255, 26, + 16, 7, 255, 25, 18, 8, 255, 24, 15, 7, 255, 23, 16, 8, + 255, 18, 13, 9, 198, 10, 9, 7, 99, 0, 16, 9, 8, 6, + 34, 12, 10, 7, 167, 20, 14, 7, 210, 21, 15, 6, 255, 26, + 17, 7, 255, 24, 16, 7, 255, 26, 17, 7, 255, 70, 35, 11, + 255, 142, 73, 17, 255, 148, 76, 17, 255, 152, 77, 17, 255, 24, + 15, 7, 170, 0, 8, 13, 10, 6, 96, 129, 65, 18, 255, 170, + 87, 19, 255, 170, 87, 19, 255, 24, 16, 9, 255, 0, 48, 5, + 4, 2, 76, 8, 6, 3, 85, 8, 6, 3, 85, 8, 6, 3, + 85, 7, 5, 4, 85, 6, 5, 3, 119, 16, 11, 5, 255, 129, + 65, 14, 255, 151, 73, 16, 255, 118, 61, 15, 255, 14, 10, 5, + 170, 0, 16, 8, 7, 3, 136, 114, 56, 13, 255, 143, 70, 16, + 255, 143, 70, 16, 255, 16, 12, 5, 221, 0, 16, 10, 8, 7, + 113, 109, 67, 26, 255, 184, 90, 21, 255, 148, 76, 17, 255, 52, + 28, 9, 255, 8, 6, 3, 198, 8, 6, 3, 88, 8, 6, 3, + 144, 21, 15, 6, 255, 130, 66, 15, 255, 143, 76, 16, 255, 143, + 76, 16, 255, 16, 12, 5, 227, 0, 20, 9, 8, 6, 170, 67, + 42, 20, 255, 202, 124, 31, 255, 208, 128, 33, 255, 205, 106, 26, + 255, 104, 58, 21, 255, 14, 11, 7, 218, 6, 5, 5, 28, 0, + 16, 7, 6, 4, 28, 27, 17, 8, 229, 102, 51, 13, 255, 139, + 68, 16, 255, 143, 73, 16, 255, 145, 74, 16, 255, 71, 37, 12, + 255, 26, 18, 9, 255, 80, 50, 23, 255, 204, 122, 33, 255, 208, + 115, 33, 255, 202, 104, 25, 255, 149, 78, 20, 255, 52, 30, 11, + 255, 10, 8, 5, 85, 0, 12, 14, 10, 5, 170, 85, 43, 12, + 255, 137, 73, 16, 255, 77, 39, 12, 255, 14, 10, 5, 227, 10, + 8, 5, 170, 10, 8, 5, 198, 46, 26, 9, 255, 137, 73, 16, + 255, 115, 59, 14, 255, 25, 16, 6, 232, 8, 6, 3, 31, 0, + 12, 6, 5, 3, 28, 10, 8, 5, 119, 19, 13, 6, 170, 29, + 19, 8, 173, 26, 16, 7, 210, 27, 18, 8, 187, 17, 12, 6, + 246, 58, 30, 11, 255, 151, 77, 18, 255, 192, 97, 21, 255, 192, + 97, 21, 255, 24, 16, 9, 207, 0, 8, 4, 4, 3, 3, 25, + 16, 6, 235, 115, 59, 14, 255, 143, 73, 16, 255, 145, 77, 16, + 255, 108, 53, 13, 255, 21, 14, 6, 255, 7, 6, 4, 164, 10, + 7, 5, 85, 8, 7, 5, 147, 9, 7, 4, 136, 8, 6, 5, + 76, 0, 20, 8, 6, 5, 57, 58, 33, 13, 255, 188, 107, 27, + 255, 192, 111, 31, 255, 85, 51, 24, 255, 18, 13, 9, 187, 6, + 5, 5, 20, 0, 8, 11, 9, 6, 156, 139, 69, 18, 255, 158, + 83, 17, 255, 148, 76, 17, 255, 23, 15, 6, 170, 0, 12, 9, + 7, 4, 85, 19, 13, 6, 255, 102, 51, 13, 255, 128, 66, 15, + 255, 81, 41, 12, 255, 12, 9, 5, 142, 0, 108, 13, 10, 8, + 85, 115, 60, 24, 255, 162, 75, 23, 255, 121, 60, 20, 255, 23, + 15, 8, 142, 0, 60, 3, 3, 2, 6, 10, 8, 5, 170, 93, + 48, 12, 255, 123, 65, 14, 255, 123, 60, 14, 255, 14, 10, 5, + 227, 3, 3, 2, 85, 12, 10, 7, 170, 163, 83, 24, 255, 199, + 99, 26, 255, 193, 96, 24, 255, 41, 26, 14, 227, 6, 6, 5, + 45, 0, 24, 3, 3, 2, 28, 11, 8, 6, 170, 106, 50, 13, + 255, 129, 63, 14, 255, 129, 63, 14, 255, 29, 18, 8, 227, 6, + 5, 5, 31, 0, 20, 13, 10, 8, 136, 144, 73, 21, 255, 182, + 89, 21, 255, 99, 55, 19, 255, 14, 11, 7, 187, 4, 4, 3, + 3, 0, 16, 9, 7, 4, 113, 93, 46, 12, 255, 131, 66, 14, + 255, 121, 62, 14, 255, 16, 11, 5, 170, 0, 12, 7, 6, 4, + 28, 14, 10, 5, 227, 100, 50, 13, 255, 110, 59, 13, 255, 103, + 52, 14, 255, 121, 59, 18, 255, 134, 69, 21, 255, 32, 21, 11, + 255, 6, 5, 5, 198, 10, 8, 7, 227, 46, 28, 13, 255, 104, + 51, 15, 255, 96, 46, 13, 255, 14, 10, 5, 139, 0, 44, 10, + 8, 7, 108, 63, 37, 18, 255, 176, 88, 23, 255, 160, 80, 21, + 255, 20, 14, 9, 170, 0, 8, 8, 6, 5, 79, 85, 41, 12, + 255, 131, 65, 16, 255, 66, 34, 11, 255, 10, 8, 5, 170, 0, + 144, 9, 7, 4, 167, 115, 56, 16, 255, 165, 85, 20, 255, 112, + 65, 23, 255, 18, 13, 9, 142, 0, 60, 13, 10, 8, 142, 132, + 68, 21, 255, 162, 80, 19, 255, 141, 70, 18, 255, 17, 12, 6, + 181, 0, 12, 17, 12, 6, 255, 103, 54, 14, 255, 130, 66, 15, + 255, 31, 20, 8, 255, 6, 5, 3, 113, 0, 32, 8, 6, 3, + 156, 35, 22, 8, 255, 114, 58, 13, 255, 110, 59, 13, 255, 88, + 45, 11, 255, 88, 42, 11, 255, 92, 47, 11, 255, 104, 54, 13, + 255, 119, 58, 14, 255, 61, 32, 10, 255, 10, 8, 5, 224, 5, + 4, 4, 20, 0, 16, 11, 8, 6, 85, 113, 58, 22, 255, 180, + 90, 23, 255, 140, 69, 17, 255, 123, 63, 14, 255, 123, 60, 14, + 255, 119, 56, 14, 255, 120, 61, 17, 255, 24, 15, 9, 167, 0, + 16, 12, 10, 7, 133, 180, 88, 27, 255, 203, 107, 30, 255, 199, + 100, 28, 255, 197, 104, 28, 255, 191, 93, 28, 255, 167, 78, 24, + 255, 132, 68, 21, 255, 121, 62, 18, 255, 117, 60, 18, 255, 118, + 57, 17, 255, 108, 50, 15, 255, 17, 12, 6, 113, 0, 12, 14, + 10, 5, 227, 65, 33, 10, 255, 115, 59, 14, 255, 115, 59, 14, + 255, 109, 52, 14, 255, 116, 57, 17, 255, 121, 59, 18, 255, 139, + 68, 20, 255, 154, 73, 19, 255, 115, 62, 20, 255, 33, 23, 12, + 255, 9, 8, 6, 71, 0, 36, 2, 2, 1, 8, 8, 6, 3, + 170, 93, 50, 12, 255, 125, 64, 14, 255, 123, 60, 14, 255, 14, + 10, 5, 159, 0, 12, 14, 10, 5, 224, 65, 33, 10, 255, 115, + 59, 14, 255, 115, 59, 14, 255, 109, 52, 14, 255, 119, 61, 18, + 255, 129, 66, 20, 255, 148, 75, 21, 255, 170, 84, 21, 255, 129, + 67, 22, 255, 37, 25, 14, 255, 8, 7, 5, 57, 0, 8, 5, + 5, 4, 23, 24, 17, 9, 255, 103, 54, 18, 255, 132, 63, 17, + 255, 120, 62, 15, 255, 98, 49, 13, 255, 90, 45, 11, 255, 94, + 45, 13, 255, 124, 60, 17, 255, 172, 81, 21, 255, 150, 78, 25, + 255, 44, 29, 17, 255, 9, 8, 6, 91, 0, 24, 8, 7, 3, + 102, 93, 46, 12, 255, 125, 64, 14, 255, 121, 62, 14, 255, 18, + 12, 5, 170, 0, 28, 12, 10, 5, 227, 64, 33, 11, 255, 132, + 66, 17, 255, 158, 79, 21, 255, 151, 70, 22, 255, 130, 67, 21, + 255, 110, 53, 15, 255, 108, 53, 13, 255, 118, 60, 13, 255, 85, + 43, 12, 255, 21, 14, 6, 255, 7, 6, 4, 57, 0, 12, 14, + 10, 5, 227, 65, 33, 10, 255, 131, 65, 16, 255, 149, 72, 20, + 255, 133, 68, 20, 255, 111, 54, 16, 255, 110, 53, 15, 255, 138, + 72, 19, 255, 163, 81, 20, 255, 112, 58, 19, 255, 28, 20, 9, + 255, 8, 7, 5, 57, 0, 8, 9, 7, 4, 91, 96, 48, 13, + 255, 132, 70, 15, 255, 123, 60, 14, 255, 14, 10, 5, 161, 0, + 8, 13, 10, 6, 85, 148, 73, 23, 255, 202, 101, 27, 255, 129, + 67, 26, 255, 18, 13, 9, 142, 0, 28, 6, 5, 3, 48, 17, + 12, 6, 227, 108, 55, 13, 255, 112, 55, 13, 255, 35, 22, 8, + 255, 9, 7, 4, 57, 0, 64, 32, 22, 13, 255, 137, 68, 22, + 255, 154, 73, 19, 255, 45, 26, 10, 255, 8, 6, 5, 144, 0, + 44, 8, 6, 3, 68, 67, 34, 10, 255, 115, 56, 16, 255, 109, + 52, 14, 255, 16, 11, 5, 147, 0, 24, 5, 4, 4, 11, 22, + 17, 11, 227, 129, 76, 28, 255, 195, 95, 28, 255, 186, 84, 23, + 255, 121, 59, 18, 255, 107, 51, 14, 255, 96, 46, 13, 255, 90, + 45, 11, 255, 88, 45, 11, 255, 41, 24, 8, 255, 12, 10, 5, + 176, 0, 12, 8, 6, 3, 76, 88, 44, 11, 255, 125, 66, 14, + 255, 123, 60, 14, 255, 18, 12, 5, 170, 0, 12, 9, 7, 4, + 85, 92, 47, 11, 255, 125, 64, 14, 255, 123, 60, 14, 255, 16, + 11, 5, 150, 0, 8, 8, 6, 3, 62, 88, 45, 11, 255, 125, + 64, 14, 255, 123, 60, 14, 255, 114, 58, 13, 255, 93, 50, 12, + 255, 88, 44, 11, 255, 92, 47, 11, 255, 104, 54, 13, 255, 119, + 58, 14, 255, 85, 43, 12, 255, 21, 15, 6, 255, 7, 6, 4, + 51, 0, 12, 12, 10, 5, 221, 61, 32, 10, 255, 120, 62, 15, + 255, 123, 61, 16, 255, 109, 52, 14, 255, 96, 46, 13, 255, 102, + 51, 13, 255, 115, 59, 14, 255, 123, 65, 14, 255, 85, 43, 12, + 255, 25, 16, 6, 255, 7, 6, 4, 51, 0, 8, 8, 6, 3, + 74, 88, 45, 11, 255, 125, 64, 14, 255, 123, 60, 14, 255, 114, + 58, 13, 255, 93, 50, 12, 255, 88, 45, 11, 255, 92, 47, 11, + 255, 104, 52, 13, 255, 118, 60, 13, 255, 85, 43, 12, 255, 21, + 15, 6, 255, 7, 5, 4, 40, 0, 8, 8, 6, 3, 74, 88, + 45, 11, 255, 125, 64, 14, 255, 123, 60, 14, 255, 114, 58, 13, + 255, 93, 50, 12, 255, 88, 45, 11, 255, 92, 43, 11, 255, 93, + 50, 12, 255, 93, 50, 12, 255, 20, 13, 5, 85, 0, 8, 8, + 6, 3, 65, 88, 45, 11, 255, 125, 64, 14, 255, 121, 62, 14, + 255, 18, 13, 5, 170, 0, 36, 12, 10, 5, 227, 59, 31, 10, + 255, 115, 62, 14, 255, 114, 58, 13, 255, 93, 50, 12, 255, 88, + 44, 11, 255, 88, 44, 11, 255, 104, 54, 13, 255, 118, 60, 13, + 255, 123, 60, 14, 255, 123, 60, 14, 255, 14, 10, 5, 150, 0, + 8, 8, 6, 3, 65, 88, 45, 11, 255, 125, 66, 14, 255, 123, + 60, 14, 255, 18, 12, 5, 170, 0, 12, 9, 7, 4, 85, 92, + 47, 11, 255, 125, 66, 14, 255, 123, 65, 14, 255, 14, 10, 5, + 150, 0, 8, 8, 6, 3, 65, 88, 45, 11, 255, 125, 66, 14, + 255, 123, 65, 14, 255, 14, 10, 5, 159, 0, 12, 14, 10, 5, + 221, 70, 35, 11, 255, 155, 74, 20, 255, 193, 89, 26, 255, 185, + 91, 28, 255, 172, 85, 27, 255, 165, 80, 24, 255, 155, 78, 22, + 255, 132, 66, 17, 255, 90, 44, 13, 255, 21, 15, 6, 255, 7, + 5, 4, 40, 0, 8, 8, 6, 3, 74, 88, 45, 11, 255, 125, + 64, 14, 255, 121, 62, 14, 255, 19, 13, 6, 176, 0, 12, 9, + 6, 4, 133, 93, 50, 12, 255, 131, 66, 14, 255, 123, 65, 14, + 255, 14, 11, 5, 150, 0, 8, 8, 6, 3, 62, 88, 45, 11, + 255, 125, 64, 14, 255, 123, 60, 14, 255, 118, 56, 15, 255, 120, + 61, 17, 255, 136, 67, 21, 255, 118, 57, 17, 255, 96, 48, 13, + 255, 92, 47, 11, 255, 18, 12, 5, 85, 0, 8, 9, 7, 4, + 79, 104, 51, 15, 255, 140, 66, 17, 255, 135, 66, 16, 255, 17, + 12, 6, 198, 0, 20, 9, 7, 4, 85, 92, 47, 11, 255, 125, + 66, 14, 255, 123, 65, 14, 255, 14, 10, 5, 150, 0, 8, 8, + 6, 3, 65, 88, 45, 11, 255, 135, 66, 16, 255, 136, 67, 17, + 255, 22, 14, 7, 198, 0, 12, 8, 6, 3, 119, 88, 45, 11, + 255, 125, 64, 14, 255, 123, 60, 14, 255, 14, 10, 5, 159, 0, + 12, 12, 10, 5, 210, 59, 31, 10, 255, 115, 62, 14, 255, 118, + 60, 13, 255, 104, 54, 13, 255, 100, 50, 13, 255, 100, 50, 13, + 255, 114, 58, 13, 255, 119, 63, 14, 255, 85, 43, 12, 255, 21, + 15, 6, 255, 7, 5, 4, 40, 0, 8, 8, 6, 3, 74, 88, + 45, 11, 255, 125, 66, 14, 255, 123, 60, 14, 255, 18, 12, 5, + 170, 0, 44, 12, 10, 5, 227, 59, 31, 10, 255, 115, 62, 14, + 255, 114, 58, 13, 255, 100, 50, 13, 255, 114, 56, 13, 255, 133, + 66, 16, 255, 160, 80, 21, 255, 176, 83, 21, 255, 45, 27, 12, + 255, 6, 5, 3, 170, 0, 12, 8, 6, 3, 82, 88, 45, 11, + 255, 125, 66, 14, 255, 123, 60, 14, 255, 18, 12, 5, 170, 0, + 12, 9, 7, 4, 85, 92, 47, 11, 255, 131, 61, 14, 255, 126, + 62, 15, 255, 17, 11, 6, 170, 0, 12, 14, 10, 5, 227, 65, + 33, 10, 255, 115, 59, 14, 255, 115, 62, 14, 255, 93, 50, 12, + 255, 88, 44, 11, 255, 92, 47, 11, 255, 104, 54, 13, 255, 119, + 58, 14, 255, 85, 43, 12, 255, 21, 15, 6, 255, 7, 6, 4, + 57, 0, 24, 9, 7, 4, 85, 92, 47, 11, 255, 125, 66, 14, + 255, 123, 60, 14, 255, 18, 12, 5, 170, 0, 24, 5, 5, 4, + 28, 19, 13, 6, 255, 84, 42, 11, 255, 115, 62, 14, 255, 110, + 59, 13, 255, 93, 50, 12, 255, 84, 44, 11, 255, 106, 54, 15, + 255, 176, 84, 23, 255, 199, 100, 28, 255, 188, 101, 31, 255, 90, + 54, 25, 255, 13, 10, 8, 142, 0, 24, 8, 6, 3, 164, 72, + 37, 11, 255, 131, 66, 14, 255, 110, 54, 13, 255, 12, 9, 5, + 224, 3, 3, 2, 17, 0, 24, 7, 6, 6, 85, 30, 20, 13, + 255, 190, 96, 27, 255, 199, 98, 24, 255, 121, 69, 22, 255, 13, + 10, 6, 190, 4, 3, 3, 28, 5, 4, 2, 105, 27, 17, 6, + 255, 114, 56, 13, 255, 125, 64, 14, 255, 45, 26, 10, 255, 8, + 7, 5, 153, 0, 12, 10, 7, 5, 85, 96, 48, 13, 255, 125, + 64, 14, 255, 123, 60, 14, 255, 16, 11, 5, 195, 0, 12, 8, + 6, 3, 110, 92, 47, 11, 255, 131, 66, 14, 255, 123, 65, 14, + 255, 18, 13, 5, 170, 0, 24, 9, 7, 4, 85, 92, 47, 11, + 255, 125, 66, 14, 255, 123, 60, 14, 255, 18, 12, 5, 170, 0, + 24, 8, 7, 3, 99, 93, 50, 12, 255, 125, 66, 14, 255, 115, + 59, 14, 255, 104, 54, 13, 255, 88, 45, 11, 255, 88, 44, 11, + 255, 92, 43, 11, 255, 92, 43, 11, 255, 92, 43, 11, 255, 93, + 50, 12, 255, 93, 50, 12, 255, 20, 13, 5, 85, 0, 8, 8, + 6, 3, 65, 88, 45, 11, 255, 125, 64, 14, 255, 123, 60, 14, + 255, 115, 62, 14, 255, 93, 46, 12, 255, 16, 11, 5, 127, 0, + 28, 5, 4, 4, 28, 12, 10, 5, 246, 104, 54, 13, 255, 115, + 59, 14, 255, 39, 23, 8, 255, 8, 6, 3, 82, 0, 12, 58, + 31, 9, 255, 114, 58, 13, 255, 119, 63, 14, 255, 123, 60, 14, + 255, 123, 65, 14, 255, 18, 12, 5, 170, 0, 144, 14, 10, 5, + 227, 59, 31, 10, 255, 115, 62, 14, 255, 110, 59, 13, 255, 88, + 44, 11, 255, 80, 42, 11, 255, 88, 44, 11, 255, 104, 54, 13, + 255, 115, 59, 14, 255, 123, 60, 14, 255, 123, 60, 14, 255, 16, + 11, 5, 150, 0, 8, 8, 6, 3, 65, 88, 44, 11, 255, 125, + 64, 14, 255, 123, 60, 14, 255, 114, 58, 13, 255, 93, 50, 12, + 255, 88, 44, 11, 255, 92, 47, 11, 255, 104, 54, 13, 255, 119, + 58, 14, 255, 85, 43, 12, 255, 21, 15, 6, 255, 7, 6, 4, + 51, 0, 12, 12, 9, 5, 224, 63, 32, 10, 255, 115, 62, 14, + 255, 114, 56, 13, 255, 93, 50, 12, 255, 88, 44, 11, 255, 88, + 45, 11, 255, 110, 59, 13, 255, 119, 61, 14, 255, 85, 43, 12, + 255, 25, 16, 6, 255, 7, 6, 4, 57, 0, 12, 12, 10, 5, + 221, 59, 31, 10, 255, 115, 62, 14, 255, 114, 56, 13, 255, 93, + 50, 12, 255, 88, 44, 11, 255, 92, 47, 11, 255, 104, 54, 13, + 255, 115, 59, 14, 255, 123, 60, 14, 255, 121, 62, 14, 255, 16, + 11, 5, 167, 0, 12, 12, 10, 5, 218, 59, 31, 10, 255, 115, + 62, 14, 255, 110, 59, 13, 255, 88, 44, 11, 255, 80, 42, 11, + 255, 88, 44, 11, 255, 88, 45, 11, 255, 88, 44, 11, 255, 16, + 11, 5, 105, 0, 24, 9, 7, 4, 85, 92, 47, 11, 255, 125, + 66, 14, 255, 123, 60, 14, 255, 18, 12, 5, 170, 0, 48, 7, + 5, 4, 198, 93, 50, 12, 255, 125, 66, 14, 255, 123, 60, 14, + 255, 12, 10, 5, 170, 0, 8, 8, 6, 3, 65, 88, 45, 11, + 255, 125, 66, 14, 255, 123, 65, 14, 255, 18, 12, 5, 170, 0, + 12, 9, 7, 4, 85, 92, 47, 11, 255, 125, 66, 14, 255, 123, + 65, 14, 255, 14, 10, 5, 150, 0, 8, 8, 6, 3, 65, 88, + 45, 11, 255, 125, 66, 14, 255, 123, 60, 14, 255, 18, 13, 5, + 170, 0, 20, 3, 3, 2, 11, 9, 7, 4, 227, 100, 50, 13, + 255, 123, 60, 14, 255, 123, 60, 14, 255, 12, 10, 5, 170, 0, + 8, 8, 6, 3, 62, 88, 45, 11, 255, 125, 66, 14, 255, 123, + 60, 14, 255, 14, 10, 5, 198, 0, 8, 8, 6, 3, 170, 35, + 22, 8, 255, 115, 59, 14, 255, 112, 55, 13, 255, 33, 21, 8, + 255, 8, 6, 3, 37, 0, 8, 8, 6, 3, 74, 88, 45, 11, + 255, 125, 66, 14, 255, 123, 65, 14, 255, 14, 10, 5, 150, 0, + 8, 8, 6, 3, 65, 88, 45, 11, 255, 125, 66, 14, 255, 123, + 65, 14, 255, 14, 11, 5, 147, 0, 4, 9, 7, 4, 85, 92, + 47, 11, 255, 20, 13, 5, 170, 0, 4, 8, 6, 3, 62, 88, + 45, 11, 255, 125, 66, 14, 255, 123, 65, 14, 255, 14, 10, 5, + 150, 0, 8, 8, 6, 3, 65, 88, 45, 11, 255, 125, 66, 14, + 255, 123, 60, 14, 255, 18, 12, 5, 170, 0, 12, 9, 7, 4, + 85, 92, 47, 11, 255, 125, 66, 14, 255, 123, 60, 14, 255, 14, + 10, 5, 159, 0, 12, 12, 10, 5, 210, 59, 31, 10, 255, 115, + 59, 14, 255, 118, 60, 13, 255, 104, 54, 13, 255, 102, 51, 13, + 255, 112, 53, 13, 255, 122, 63, 15, 255, 123, 58, 14, 255, 85, + 43, 12, 255, 21, 15, 6, 255, 7, 5, 4, 45, 0, 8, 8, + 6, 3, 85, 113, 55, 16, 255, 196, 92, 23, 255, 195, 96, 24, + 255, 25, 17, 10, 255, 4, 3, 3, 79, 0, 64, 3, 2, 2, + 28, 10, 8, 5, 227, 138, 71, 21, 255, 177, 87, 20, 255, 174, + 86, 21, 255, 24, 16, 9, 170, 0, 8, 13, 10, 8, 85, 142, + 73, 23, 255, 195, 96, 24, 255, 194, 91, 23, 255, 24, 17, 11, + 227, 0, 44, 12, 9, 5, 150, 35, 22, 8, 255, 80, 42, 11, + 255, 84, 44, 11, 255, 88, 44, 11, 255, 80, 42, 11, 255, 88, + 44, 11, 255, 97, 50, 12, 255, 118, 60, 13, 255, 85, 43, 12, + 255, 21, 15, 6, 255, 8, 6, 3, 57, 0, 16, 9, 7, 4, + 85, 92, 47, 11, 255, 125, 66, 14, 255, 123, 60, 14, 255, 18, + 12, 5, 170, 0, 16, 6, 5, 5, 28, 17, 13, 8, 227, 68, + 34, 11, 255, 115, 59, 14, 255, 110, 59, 13, 255, 93, 50, 12, + 255, 88, 44, 11, 255, 92, 47, 11, 255, 104, 54, 13, 255, 115, + 59, 14, 255, 123, 60, 14, 255, 123, 65, 14, 255, 18, 12, 5, + 170, 0, 24, 12, 9, 7, 170, 131, 69, 24, 255, 191, 90, 22, + 255, 136, 71, 19, 255, 15, 11, 6, 227, 4, 3, 3, 17, 0, + 24, 7, 6, 4, 31, 16, 11, 5, 227, 104, 52, 13, 255, 131, + 66, 14, 255, 98, 49, 13, 255, 10, 8, 5, 193, 3, 2, 2, + 68, 8, 7, 5, 170, 121, 66, 26, 255, 195, 96, 24, 255, 156, + 74, 19, 255, 34, 21, 9, 255, 9, 7, 4, 85, 0, 12, 8, + 6, 3, 51, 69, 35, 10, 255, 121, 62, 14, 255, 123, 60, 14, + 255, 16, 11, 5, 227, 4, 3, 3, 28, 0, 8, 8, 6, 3, + 170, 92, 47, 11, 255, 125, 64, 14, 255, 108, 55, 13, 255, 14, + 10, 5, 164, 0, 40, 7, 5, 4, 198, 96, 48, 13, 255, 134, + 65, 15, 255, 133, 66, 16, 255, 15, 11, 6, 170, 0, 8, 7, + 5, 4, 85, 78, 39, 11, 255, 130, 64, 15, 255, 130, 64, 15, + 255, 134, 65, 15, 255, 136, 67, 17, 255, 124, 62, 17, 255, 114, + 56, 17, 255, 113, 55, 16, 255, 118, 60, 17, 255, 107, 55, 20, + 255, 48, 29, 15, 255, 12, 10, 7, 85, 0, 20, 9, 8, 6, + 170, 45, 27, 12, 255, 139, 70, 20, 255, 131, 66, 18, 255, 107, + 53, 14, 255, 19, 13, 6, 99, 0, 8, 8, 6, 5, 85, 92, + 46, 13, 255, 131, 61, 14, 255, 125, 64, 14, 255, 14, 10, 5, + 170, 0, 12, 58, 31, 9, 255, 110, 59, 13, 255, 115, 59, 14, + 255, 56, 29, 9, 255, 10, 8, 5, 227, 5, 4, 4, 23, 0, + 108, 10, 8, 7, 28, 28, 18, 11, 212, 49, 28, 16, 255, 35, + 21, 12, 241, 13, 10, 6, 85, 0, 68, 14, 10, 5, 142, 20, + 14, 5, 170, 16, 12, 5, 164, 8, 6, 3, 28, 0, 8, 24, + 16, 9, 142, 21, 15, 8, 252, 23, 15, 8, 184, 11, 8, 6, + 34, 0, 36, 14, 10, 5, 142, 20, 14, 5, 170, 16, 11, 5, + 170, 10, 8, 5, 28, 0, 24, 7, 6, 4, 25, 20, 13, 7, + 147, 22, 15, 7, 170, 10, 8, 5, 142, 5, 4, 4, 3, 0, + 24, 14, 10, 5, 142, 20, 13, 5, 170, 16, 11, 5, 170, 9, + 7, 4, 28, 0, 16, 7, 5, 4, 28, 14, 10, 5, 156, 14, + 10, 5, 229, 24, 15, 9, 255, 32, 20, 11, 255, 28, 18, 11, + 244, 12, 9, 7, 108, 0, 8, 10, 8, 5, 142, 19, 13, 8, + 235, 24, 15, 7, 227, 10, 8, 5, 59, 0, 48, 10, 8, 5, + 93, 23, 15, 8, 170, 28, 18, 9, 173, 15, 11, 6, 28, 0, + 12, 18, 12, 5, 142, 21, 14, 6, 170, 9, 7, 4, 133, 0, + 148, 8, 6, 5, 113, 89, 44, 14, 255, 100, 51, 21, 255, 13, + 10, 8, 227, 6, 5, 5, 28, 0, 60, 6, 5, 5, 8, 17, + 12, 6, 142, 26, 16, 7, 170, 18, 12, 5, 170, 9, 7, 4, + 28, 0, 8, 6, 5, 3, 85, 54, 28, 11, 255, 136, 66, 19, + 255, 121, 59, 18, 255, 15, 10, 6, 241, 0, 40, 8, 6, 3, + 57, 12, 9, 5, 170, 18, 13, 5, 178, 14, 10, 5, 241, 14, + 10, 5, 255, 14, 10, 5, 252, 16, 11, 5, 195, 16, 11, 5, + 170, 8, 6, 3, 113, 0, 24, 8, 6, 5, 28, 24, 16, 9, + 204, 24, 17, 9, 255, 17, 12, 6, 210, 14, 10, 5, 170, 16, + 11, 5, 170, 17, 11, 6, 246, 27, 17, 10, 246, 14, 10, 7, + 85, 0, 16, 8, 6, 5, 28, 21, 14, 10, 195, 22, 15, 11, + 255, 18, 13, 9, 255, 18, 13, 9, 255, 22, 15, 9, 255, 19, + 13, 8, 255, 17, 12, 6, 255, 17, 11, 6, 255, 15, 11, 6, + 255, 17, 12, 6, 255, 19, 13, 6, 204, 12, 9, 5, 28, 0, + 12, 5, 4, 2, 25, 8, 6, 3, 122, 14, 10, 5, 170, 18, + 13, 5, 176, 14, 10, 5, 235, 15, 11, 6, 255, 15, 11, 6, + 255, 19, 12, 6, 204, 19, 13, 6, 170, 10, 8, 5, 170, 8, + 6, 5, 57, 0, 48, 14, 10, 5, 142, 21, 13, 6, 170, 16, + 11, 5, 170, 9, 7, 4, 28, 0, 12, 5, 4, 2, 25, 8, + 6, 3, 125, 14, 10, 5, 170, 14, 10, 5, 210, 23, 15, 8, + 255, 30, 20, 11, 255, 30, 20, 11, 255, 23, 17, 10, 255, 20, + 14, 9, 244, 16, 12, 9, 170, 9, 8, 6, 79, 0, 16, 9, + 7, 6, 65, 15, 11, 8, 170, 17, 12, 8, 232, 21, 14, 8, + 255, 26, 16, 9, 255, 23, 15, 8, 255, 21, 14, 8, 255, 15, + 11, 6, 255, 22, 15, 7, 178, 11, 9, 6, 170, 10, 8, 7, + 57, 0, 32, 12, 10, 5, 142, 20, 13, 5, 170, 16, 11, 5, + 170, 9, 7, 4, 28, 0, 28, 5, 5, 4, 28, 8, 6, 3, + 133, 15, 11, 6, 193, 20, 15, 9, 255, 28, 18, 11, 255, 30, + 20, 11, 255, 26, 16, 9, 255, 14, 10, 5, 238, 16, 11, 5, + 170, 9, 7, 4, 153, 7, 5, 4, 57, 0, 16, 5, 4, 2, + 28, 8, 6, 3, 142, 18, 12, 7, 207, 22, 15, 9, 255, 28, + 18, 11, 255, 27, 18, 10, 255, 18, 13, 7, 255, 15, 11, 6, + 227, 21, 13, 6, 170, 10, 7, 5, 164, 7, 6, 4, 57, 0, + 16, 14, 10, 5, 142, 20, 13, 5, 170, 16, 12, 5, 170, 9, + 7, 4, 28, 0, 8, 10, 8, 7, 119, 149, 64, 26, 255, 131, + 63, 26, 255, 14, 11, 7, 227, 6, 5, 5, 28, 0, 32, 7, + 5, 4, 28, 14, 10, 5, 156, 20, 13, 5, 170, 12, 9, 5, + 142, 6, 5, 3, 6, 0, 64, 12, 10, 7, 142, 24, 15, 7, + 170, 21, 13, 6, 170, 8, 6, 3, 76, 0, 48, 9, 7, 6, + 85, 83, 43, 16, 255, 176, 88, 23, 255, 130, 62, 21, 255, 16, + 11, 7, 170, 0, 28, 9, 8, 6, 28, 13, 10, 8, 164, 23, + 16, 10, 190, 16, 11, 7, 252, 15, 11, 6, 255, 14, 10, 5, + 255, 14, 10, 5, 255, 14, 10, 5, 255, 16, 11, 5, 232, 14, + 10, 5, 170, 8, 6, 3, 85, 0, 16, 14, 10, 5, 142, 21, + 13, 6, 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, 16, 14, + 10, 5, 142, 20, 13, 5, 170, 16, 11, 5, 170, 9, 7, 4, + 28, 0, 12, 14, 10, 5, 136, 16, 12, 5, 170, 16, 11, 5, + 170, 18, 12, 5, 170, 16, 11, 5, 210, 14, 10, 5, 255, 14, + 10, 5, 249, 16, 12, 5, 193, 16, 11, 5, 170, 9, 7, 4, + 153, 7, 5, 4, 57, 0, 16, 5, 5, 4, 28, 8, 6, 3, + 125, 14, 10, 5, 170, 18, 12, 5, 176, 14, 10, 5, 238, 14, + 10, 5, 246, 16, 12, 5, 195, 18, 13, 5, 170, 16, 11, 5, + 170, 9, 7, 4, 150, 7, 5, 4, 54, 0, 16, 14, 10, 5, + 142, 16, 12, 5, 170, 16, 11, 5, 170, 18, 12, 5, 170, 16, + 11, 5, 210, 14, 10, 5, 255, 14, 10, 5, 249, 16, 12, 5, + 193, 16, 11, 5, 170, 9, 7, 4, 153, 7, 6, 4, 57, 0, + 16, 14, 10, 5, 142, 16, 12, 5, 170, 16, 11, 5, 170, 18, + 12, 5, 170, 16, 11, 5, 210, 14, 10, 5, 252, 12, 9, 5, + 255, 16, 11, 5, 255, 20, 13, 5, 201, 11, 9, 4, 28, 0, + 12, 14, 10, 5, 139, 20, 13, 5, 170, 16, 11, 5, 170, 9, + 7, 4, 28, 0, 36, 5, 5, 4, 28, 8, 6, 3, 125, 14, + 10, 5, 170, 18, 13, 5, 176, 14, 10, 5, 238, 14, 10, 5, + 255, 16, 11, 5, 235, 18, 13, 5, 173, 16, 11, 5, 170, 16, + 12, 5, 170, 16, 11, 5, 164, 9, 7, 4, 28, 0, 12, 12, + 9, 5, 142, 21, 13, 6, 170, 16, 11, 5, 170, 9, 7, 4, + 28, 0, 16, 14, 10, 5, 142, 20, 13, 5, 170, 16, 11, 5, + 170, 9, 7, 4, 28, 0, 12, 12, 9, 5, 142, 21, 13, 6, + 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, 12, 6, 5, 3, + 28, 8, 7, 5, 139, 19, 13, 8, 193, 21, 15, 10, 255, 31, + 21, 12, 255, 32, 21, 13, 255, 31, 20, 12, 255, 23, 17, 10, + 255, 18, 12, 7, 212, 10, 8, 5, 159, 7, 6, 4, 57, 0, + 16, 14, 10, 5, 142, 21, 13, 6, 170, 16, 11, 5, 170, 9, + 7, 4, 28, 0, 16, 14, 10, 5, 142, 21, 13, 6, 170, 16, + 12, 5, 170, 9, 7, 4, 28, 0, 12, 14, 10, 5, 136, 16, + 12, 5, 170, 16, 11, 5, 170, 18, 12, 5, 176, 17, 12, 6, + 252, 21, 14, 8, 255, 17, 12, 6, 255, 16, 11, 5, 255, 20, + 13, 5, 204, 11, 9, 4, 28, 0, 12, 14, 10, 5, 142, 21, + 14, 6, 170, 18, 12, 5, 170, 9, 8, 4, 28, 0, 24, 14, + 10, 5, 142, 20, 13, 5, 170, 16, 11, 5, 170, 9, 7, 4, + 28, 0, 12, 12, 9, 5, 142, 21, 13, 6, 170, 16, 12, 5, + 170, 10, 8, 5, 28, 0, 16, 12, 9, 5, 142, 20, 13, 5, + 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, 12, 5, 5, 4, + 28, 8, 6, 3, 125, 14, 10, 5, 170, 18, 12, 5, 170, 20, + 14, 5, 173, 16, 12, 5, 193, 20, 13, 5, 178, 20, 13, 5, + 170, 16, 11, 5, 170, 9, 7, 4, 153, 7, 6, 4, 57, 0, + 16, 14, 10, 5, 142, 21, 13, 6, 170, 16, 11, 5, 170, 9, + 7, 4, 28, 0, 44, 5, 5, 4, 28, 8, 6, 3, 125, 14, + 10, 5, 170, 18, 13, 5, 170, 20, 14, 5, 170, 18, 12, 5, + 170, 13, 10, 6, 227, 72, 38, 19, 255, 185, 86, 32, 255, 144, + 64, 29, 255, 20, 15, 11, 232, 8, 7, 7, 28, 0, 12, 14, + 10, 5, 142, 21, 13, 6, 170, 16, 11, 5, 170, 9, 7, 4, + 28, 0, 16, 14, 10, 5, 142, 20, 13, 5, 170, 16, 11, 5, + 170, 9, 7, 4, 28, 0, 12, 5, 4, 2, 25, 8, 6, 3, + 122, 14, 10, 5, 170, 18, 13, 5, 176, 14, 10, 5, 238, 14, + 10, 5, 255, 14, 10, 5, 249, 16, 12, 5, 193, 16, 11, 5, + 170, 9, 7, 4, 153, 7, 5, 4, 57, 0, 32, 14, 10, 5, + 142, 21, 13, 6, 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, + 28, 8, 6, 3, 57, 9, 7, 4, 164, 14, 10, 5, 170, 18, + 13, 5, 173, 14, 10, 5, 229, 14, 10, 5, 255, 17, 12, 6, + 255, 22, 15, 9, 255, 20, 14, 9, 252, 21, 15, 10, 176, 11, + 9, 6, 139, 0, 32, 11, 8, 4, 122, 18, 12, 5, 170, 14, + 10, 5, 150, 7, 5, 4, 28, 0, 32, 8, 7, 7, 57, 24, + 16, 11, 173, 26, 18, 9, 190, 13, 10, 6, 142, 5, 4, 4, + 11, 0, 8, 8, 7, 3, 68, 14, 10, 5, 170, 16, 11, 5, + 170, 9, 7, 4, 74, 0, 20, 14, 10, 5, 142, 20, 14, 5, + 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, 16, 14, 10, 5, + 142, 20, 14, 5, 170, 16, 11, 5, 170, 9, 8, 4, 28, 0, + 28, 14, 10, 5, 142, 20, 13, 5, 170, 16, 11, 5, 170, 9, + 7, 4, 28, 0, 28, 14, 10, 5, 142, 18, 13, 5, 170, 16, + 12, 5, 170, 18, 13, 5, 173, 14, 10, 5, 227, 14, 10, 5, + 255, 14, 10, 5, 252, 12, 9, 5, 255, 12, 9, 5, 255, 16, + 11, 5, 255, 20, 13, 5, 201, 11, 9, 4, 28, 0, 12, 12, + 10, 5, 136, 16, 12, 5, 170, 16, 11, 5, 170, 16, 11, 5, + 193, 21, 15, 6, 184, 14, 10, 5, 31, 0, 32, 8, 6, 3, + 139, 54, 30, 9, 255, 107, 50, 12, 255, 78, 39, 11, 255, 9, + 7, 4, 161, 0, 12, 20, 13, 5, 142, 18, 12, 5, 210, 16, + 11, 5, 170, 16, 11, 5, 170, 16, 11, 5, 170, 9, 7, 4, + 28, 0, 64, 13, 10, 8, 57, 9, 7, 6, 159, 8, 6, 5, + 159, 10, 8, 7, 130, 10, 8, 7, 119, 9, 7, 6, 133, 9, + 7, 6, 167, 10, 8, 7, 170, 11, 9, 8, 113, 0, 44, 5, + 4, 2, 28, 8, 6, 3, 125, 14, 10, 5, 170, 18, 13, 5, + 176, 14, 10, 5, 238, 14, 10, 5, 255, 16, 11, 5, 235, 18, + 13, 5, 173, 16, 11, 5, 170, 16, 12, 5, 170, 16, 11, 5, + 164, 9, 7, 4, 28, 0, 12, 14, 10, 5, 136, 16, 12, 5, + 170, 16, 11, 5, 170, 18, 12, 5, 170, 16, 11, 5, 210, 14, + 10, 5, 255, 14, 10, 5, 249, 16, 12, 5, 193, 16, 11, 5, + 170, 9, 7, 4, 153, 7, 5, 4, 57, 0, 16, 5, 5, 4, + 28, 8, 6, 3, 125, 14, 10, 5, 170, 18, 13, 5, 176, 14, + 10, 5, 238, 14, 10, 5, 255, 14, 10, 5, 249, 16, 11, 5, + 193, 16, 11, 5, 170, 9, 7, 4, 150, 7, 5, 4, 57, 0, + 16, 5, 5, 4, 28, 8, 6, 3, 125, 14, 10, 5, 170, 18, + 13, 5, 176, 14, 10, 5, 238, 14, 10, 5, 255, 14, 10, 5, + 235, 18, 13, 5, 173, 16, 11, 5, 170, 16, 12, 5, 170, 16, + 11, 5, 170, 9, 7, 4, 28, 0, 12, 5, 5, 4, 28, 8, + 6, 3, 125, 14, 10, 5, 170, 18, 13, 5, 176, 14, 10, 5, + 235, 14, 10, 5, 255, 14, 10, 5, 255, 16, 11, 5, 255, 20, + 13, 5, 207, 12, 9, 5, 34, 0, 28, 14, 10, 5, 142, 20, + 13, 5, 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, 28, 6, + 5, 3, 85, 7, 5, 4, 85, 6, 5, 3, 85, 5, 4, 4, + 85, 5, 4, 4, 105, 9, 8, 4, 241, 72, 37, 11, 255, 110, + 54, 13, 255, 67, 34, 10, 255, 8, 6, 3, 144, 0, 12, 14, + 10, 5, 142, 21, 14, 6, 170, 16, 12, 5, 170, 9, 8, 4, + 28, 0, 16, 14, 10, 5, 142, 21, 13, 6, 170, 16, 11, 5, + 170, 9, 7, 4, 28, 0, 12, 12, 9, 5, 142, 21, 13, 6, + 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, 12, 7, 5, 2, + 37, 8, 6, 3, 142, 8, 6, 3, 227, 25, 15, 6, 255, 75, + 36, 10, 255, 99, 51, 12, 255, 66, 33, 9, 255, 8, 6, 3, + 130, 0, 12, 14, 10, 5, 139, 21, 13, 6, 170, 16, 11, 5, + 170, 9, 7, 4, 28, 0, 12, 8, 6, 3, 79, 14, 10, 5, + 170, 18, 13, 5, 170, 12, 9, 5, 142, 0, 16, 14, 10, 5, + 142, 21, 13, 6, 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, + 12, 12, 9, 5, 142, 21, 13, 6, 170, 16, 11, 5, 170, 9, + 7, 4, 28, 0, 8, 20, 13, 5, 85, 11, 8, 4, 28, 0, + 8, 12, 9, 5, 142, 21, 13, 6, 170, 16, 11, 5, 170, 9, + 7, 4, 28, 0, 12, 12, 9, 5, 142, 21, 13, 6, 170, 16, + 11, 5, 170, 9, 7, 4, 28, 0, 16, 14, 10, 5, 142, 20, + 13, 5, 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, 12, 5, + 5, 4, 28, 8, 6, 3, 125, 14, 10, 5, 170, 18, 12, 5, + 170, 20, 14, 5, 173, 16, 12, 5, 193, 20, 13, 5, 178, 20, + 13, 5, 170, 16, 11, 5, 170, 9, 7, 4, 161, 7, 6, 4, + 57, 0, 12, 8, 6, 3, 85, 84, 40, 13, 255, 164, 73, 23, + 255, 184, 79, 27, 255, 15, 11, 8, 246, 0, 72, 11, 10, 10, + 170, 176, 83, 37, 255, 196, 87, 33, 255, 192, 88, 31, 255, 22, + 15, 11, 193, 0, 12, 21, 15, 10, 159, 26, 17, 11, 255, 24, + 17, 11, 221, 10, 8, 7, 85, 0, 44, 8, 7, 3, 59, 12, + 9, 5, 170, 16, 11, 5, 210, 14, 10, 5, 255, 14, 10, 5, + 255, 14, 10, 5, 255, 14, 10, 5, 246, 16, 12, 5, 193, 16, + 11, 5, 170, 9, 7, 4, 153, 6, 5, 3, 57, 0, 24, 14, + 10, 5, 142, 20, 13, 5, 170, 16, 11, 5, 170, 9, 7, 4, + 28, 0, 20, 6, 5, 3, 28, 8, 6, 3, 127, 14, 10, 5, + 170, 18, 13, 5, 176, 14, 10, 5, 238, 14, 10, 5, 255, 14, + 10, 5, 235, 18, 13, 5, 173, 16, 11, 5, 170, 16, 12, 5, + 170, 16, 11, 5, 170, 9, 7, 4, 28, 0, 28, 14, 11, 7, + 142, 29, 19, 8, 170, 17, 11, 6, 159, 8, 6, 3, 28, 0, + 32, 7, 5, 4, 28, 14, 10, 5, 150, 20, 13, 5, 170, 12, + 9, 5, 142, 5, 4, 2, 14, 0, 8, 15, 11, 8, 142, 26, + 18, 9, 178, 19, 13, 6, 170, 8, 6, 3, 68, 0, 20, 18, + 12, 5, 142, 16, 11, 5, 238, 16, 11, 5, 170, 9, 7, 4, + 28, 0, 16, 12, 9, 5, 142, 16, 11, 5, 215, 18, 13, 5, + 187, 11, 9, 4, 28, 0, 16, 4, 4, 3, 6, 5, 4, 2, + 82, 5, 4, 2, 85, 5, 4, 2, 85, 5, 4, 2, 85, 5, + 4, 2, 99, 9, 7, 4, 241, 72, 37, 11, 255, 112, 53, 13, + 255, 77, 39, 12, 255, 10, 8, 5, 170, 0, 12, 19, 13, 8, + 184, 20, 14, 9, 255, 16, 11, 7, 255, 14, 11, 7, 255, 17, + 12, 8, 255, 22, 15, 9, 255, 27, 17, 10, 255, 30, 19, 11, + 255, 28, 18, 11, 255, 21, 15, 10, 255, 15, 12, 8, 198, 9, + 7, 6, 28, 0, 24, 8, 6, 5, 91, 15, 11, 6, 170, 14, + 11, 5, 238, 19, 13, 6, 198, 12, 9, 5, 28, 0, 8, 6, + 5, 3, 85, 54, 29, 9, 255, 100, 48, 13, 255, 109, 52, 14, + 255, 15, 11, 6, 170, 0, 12, 19, 13, 6, 144, 14, 10, 5, + 255, 16, 11, 5, 178, 8, 6, 3, 119, 0, 255, 0, 255, 0, + 174, 12, 9, 7, 88, 99, 44, 20, 255, 26, 16, 11, 232, 5, + 4, 4, 28, 0, 92, 6, 5, 3, 57, 60, 28, 11, 255, 158, + 67, 23, 255, 88, 44, 23, 255, 11, 9, 6, 142, 0, 255, 0, + 255, 0, 150, 12, 9, 7, 110, 126, 51, 25, 255, 25, 17, 12, + 232, 5, 4, 4, 28, 0, 184, 6, 5, 5, 28, 19, 14, 10, + 227, 52, 29, 17, 255, 30, 20, 13, 255, 9, 8, 6, 82, 0, + 255, 0, 255, 0, 255, 0, 255, 0, 8, 12, 10, 9, 170, 172, + 81, 49, 255, 213, 125, 94, 255, 185, 88, 58, 255, 23, 16, 14, + 159, 0, 255, 0, 255, 0, 106, 5, 4, 2, 28, 16, 11, 5, + 244, 68, 34, 9, 255, 62, 33, 9, 255, 9, 8, 4, 139, 0, + 96, 10, 8, 7, 48, 71, 33, 18, 255, 108, 47, 23, 255, 107, + 48, 22, 255, 113, 51, 24, 255, 109, 50, 24, 255, 104, 45, 21, + 255, 104, 45, 21, 255, 113, 49, 24, 255, 115, 50, 24, 255, 18, + 13, 9, 136, 0, 255, 0, 129, 9, 7, 6, 34, 18, 13, 9, + 244, 66, 31, 15, 255, 84, 37, 17, 255, 83, 36, 16, 255, 75, + 34, 14, 255, 73, 35, 14, 255, 91, 41, 16, 255, 110, 47, 19, + 255, 79, 40, 16, 255, 24, 16, 9, 255, 8, 6, 5, 57, 0, + 100, 22, 14, 5, 244, 40, 23, 7, 255, 42, 23, 7, 255, 54, + 28, 9, 255, 60, 31, 9, 255, 36, 22, 7, 255, 12, 9, 5, + 244, 6, 5, 3, 28, 0, 255, 0, 29, 9, 7, 6, 85, 72, + 34, 13, 255, 126, 56, 21, 255, 148, 63, 25, 255, 25, 17, 14, + 190, 0, 72, 15, 12, 12, 133, 178, 86, 57, 255, 200, 89, 55, + 255, 194, 82, 47, 255, 30, 20, 17, 187, 0, 255, 0, 169, 9, + 7, 4, 99, 17, 12, 6, 255, 42, 22, 9, 255, 49, 25, 9, + 255, 54, 26, 11, 255, 52, 26, 11, 255, 59, 28, 12, 255, 82, + 37, 15, 255, 111, 49, 18, 255, 84, 39, 17, 255, 25, 17, 10, + 255, 8, 7, 5, 57, 0, 112, 6, 5, 3, 57, 38, 22, 7, + 255, 85, 39, 12, 255, 124, 52, 21, 255, 20, 13, 9, 170, 0, + 255, 0, 255, 0, 202, 8, 6, 5, 28, 26, 16, 11, 170, 11, + 8, 6, 85, 0, 100, 12, 8, 5, 119, 20, 14, 9, 170, 12, + 9, 7, 142, 0, 255, 0, 255, 0, 154, 9, 7, 6, 28, 27, + 17, 12, 170, 11, 9, 8, 85, 0, 192, 7, 6, 6, 28, 8, + 7, 5, 85, 8, 6, 5, 57, 0, 255, 0, 255, 0, 255, 0, + 255, 0, 16, 25, 17, 16, 161, 41, 27, 26, 255, 40, 26, 23, + 235, 14, 12, 11, 82, 0, 255, 0, 255, 0, 110, 8, 6, 3, + 37, 9, 7, 4, 142, 9, 7, 4, 136, 6, 5, 3, 6, 0, + 100, 23, 15, 10, 153, 19, 13, 10, 255, 16, 11, 9, 255, 16, + 11, 9, 255, 16, 11, 9, 255, 16, 11, 9, 255, 16, 11, 9, + 255, 18, 13, 9, 255, 24, 16, 11, 204, 16, 11, 9, 31, 0, + 255, 0, 133, 10, 8, 7, 142, 18, 12, 9, 207, 18, 13, 9, + 255, 16, 11, 9, 255, 15, 11, 8, 255, 15, 11, 8, 252, 18, + 13, 9, 195, 18, 12, 9, 170, 11, 8, 6, 167, 8, 7, 5, + 57, 0, 104, 9, 8, 4, 142, 14, 10, 5, 170, 13, 10, 6, + 170, 13, 9, 6, 170, 11, 8, 6, 170, 7, 6, 4, 130, 6, + 5, 3, 28, 0, 255, 0, 37, 14, 10, 7, 142, 21, 14, 10, + 170, 19, 13, 10, 170, 14, 11, 9, 31, 0, 72, 8, 7, 8, + 14, 25, 17, 16, 142, 27, 18, 16, 193, 26, 18, 15, 170, 15, + 11, 10, 34, 0, 255, 0, 169, 9, 7, 4, 28, 11, 8, 6, + 170, 14, 10, 7, 232, 15, 10, 8, 255, 15, 10, 8, 255, 15, + 10, 8, 255, 15, 10, 8, 252, 18, 12, 9, 195, 18, 12, 9, + 170, 11, 8, 6, 167, 9, 7, 6, 57, 0, 120, 9, 7, 4, + 91, 16, 11, 7, 170, 20, 13, 9, 170, 13, 10, 8, 28, 0, + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255}}; +/* Created by MiniCompress.. an iOS RLE compressor. + * Compress Rate : 46.36 % + */ diff --git a/libvisual-plugins/plugins/actor/goom2k4/gfontrle.h b/libvisual-plugins/plugins/actor/goom2k4/gfontrle.h index 41e2462fd..8d03ef079 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/gfontrle.h +++ b/libvisual-plugins/plugins/actor/goom2k4/gfontrle.h @@ -1,7 +1,7 @@ extern const struct { - unsigned int width; - unsigned int height; - unsigned int bytes_per_pixel; - unsigned int rle_size; - unsigned char rle_pixel [49725]; -} the_font ; + unsigned int width; + unsigned int height; + unsigned int bytes_per_pixel; + unsigned int rle_size; + unsigned char rle_pixel[49725]; +} the_font; diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom.h b/libvisual-plugins/plugins/actor/goom2k4/goom.h index 3cb8bd9fc..0489b2a6a 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom.h @@ -7,8 +7,8 @@ #define NB_FX 10 -PluginInfo *goom_init (uint32_t resx, uint32_t resy); -void goom_set_resolution (PluginInfo *goomInfo, uint32_t resx, uint32_t resy); +PluginInfo *goom_init(uint32_t resx, uint32_t resy); +void goom_set_resolution(PluginInfo *goomInfo, uint32_t resx, uint32_t resy); /* * forceMode == 0 : do nothing @@ -19,12 +19,12 @@ void goom_set_resolution (PluginInfo *goomInfo, uint32_t resx, uint32_t resy); * - NULL if it is not the start of the song * - only have a value at the start of the song */ -uint32_t *goom_update (PluginInfo *goomInfo, int16_t data[2][512], int forceMode, float fps, - const char *songTitle, const char *message); +uint32_t *goom_update(PluginInfo *goomInfo, int16_t data[2][512], int forceMode, + float fps, const char *songTitle, const char *message); /* returns 0 if the buffer wasn't accepted */ int goom_set_screenbuffer(PluginInfo *goomInfo, void *buffer); -void goom_close (PluginInfo *goomInfo); +void goom_close(PluginInfo *goomInfo); #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_config.h b/libvisual-plugins/plugins/actor/goom2k4/goom_config.h index 71e3f6943..1b93b6f4f 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_config.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_config.h @@ -7,15 +7,15 @@ #if 1 /* ndef COLOR_BGRA */ /** position des composantes **/ - #define BLEU 0 - #define VERT 1 - #define ROUGE 2 - #define ALPHA 3 +#define BLEU 0 +#define VERT 1 +#define ROUGE 2 +#define ALPHA 3 #else - #define ROUGE 1 - #define BLEU 3 - #define VERT 2 - #define ALPHA 0 +#define ROUGE 1 +#define BLEU 3 +#define VERT 2 +#define ALPHA 0 #endif #include diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_config_param.h b/libvisual-plugins/plugins/actor/goom2k4/goom_config_param.h index 3c6838d30..8141e10d3 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_config_param.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_config_param.h @@ -42,7 +42,6 @@ struct BoolVal { int value; }; - typedef struct _PARAM { char *name; char *desc; @@ -55,13 +54,13 @@ typedef struct _PARAM { struct ListVal slist; struct BoolVal bval; } param; - + /* used by the core to inform the GUI of a change */ void (*change_listener)(struct _PARAM *_this); /* used by the GUI to inform the core of a change */ void (*changed)(struct _PARAM *_this); - + void *user_data; /* can be used by the GUI */ } PluginParam; @@ -91,7 +90,7 @@ PluginParam goom_secure_i_feedback(char *name); void goom_set_str_param_value(PluginParam *p, const char *str); void goom_set_list_param_value(PluginParam *p, const char *str); - + typedef struct _PARAMETERS { char *name; char *desc; diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_core.c b/libvisual-plugins/plugins/actor/goom2k4/goom_core.c index a94f350cd..9cdb8f128 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_core.c +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_core.c @@ -1,5 +1,5 @@ /** -* file: goom_core.c + * file: goom_core.c * author: Jean-Christophe Hoelt (which is not so proud of it) * * Contains the core of goom's work. @@ -34,107 +34,103 @@ /* TODO: put that as variable in PluginInfo */ #define TIME_BTW_CHG 300 -static void choose_a_goom_line (PluginInfo *goomInfo, float *param1, float *param2, int *couleur, - int *mode, float *amplitude, int far); +static void choose_a_goom_line(PluginInfo *goomInfo, float *param1, + float *param2, int *couleur, int *mode, + float *amplitude, int far); -static void update_message (PluginInfo *goomInfo, const char *message); +static void update_message(PluginInfo *goomInfo, const char *message); -static void init_buffers(PluginInfo *goomInfo, int buffsize) -{ - goomInfo->pixel = (uint32_t *) malloc (buffsize * sizeof (uint32_t) + 128); - memset (goomInfo->pixel, 0, buffsize * sizeof (uint32_t) + 128); - goomInfo->back = (uint32_t *) malloc (buffsize * sizeof (uint32_t) + 128); - memset (goomInfo->back, 0, buffsize * sizeof (uint32_t) + 128); - goomInfo->conv = (Pixel *) malloc (buffsize * sizeof (uint32_t) + 128); - memset (goomInfo->conv, 0, buffsize * sizeof (uint32_t) + 128); +static void init_buffers(PluginInfo *goomInfo, int buffsize) { + goomInfo->pixel = (uint32_t *)malloc(buffsize * sizeof(uint32_t) + 128); + memset(goomInfo->pixel, 0, buffsize * sizeof(uint32_t) + 128); + goomInfo->back = (uint32_t *)malloc(buffsize * sizeof(uint32_t) + 128); + memset(goomInfo->back, 0, buffsize * sizeof(uint32_t) + 128); + goomInfo->conv = (Pixel *)malloc(buffsize * sizeof(uint32_t) + 128); + memset(goomInfo->conv, 0, buffsize * sizeof(uint32_t) + 128); - goomInfo->outputBuf = goomInfo->conv; + goomInfo->outputBuf = goomInfo->conv; - goomInfo->p1 = (Pixel *) ((1 + ((uintptr_t) (goomInfo->pixel)) / 128) * 128); - goomInfo->p2 = (Pixel *) ((1 + ((uintptr_t) (goomInfo->back)) / 128) * 128); + goomInfo->p1 = (Pixel *)((1 + ((uintptr_t)(goomInfo->pixel)) / 128) * 128); + goomInfo->p2 = (Pixel *)((1 + ((uintptr_t)(goomInfo->back)) / 128) * 128); } /************************** -* INIT * -**************************/ -PluginInfo *goom_init (uint32_t resx, uint32_t resy) -{ - PluginInfo *goomInfo = (PluginInfo*)malloc(sizeof(PluginInfo)); + * INIT * + **************************/ +PluginInfo *goom_init(uint32_t resx, uint32_t resy) { + PluginInfo *goomInfo = (PluginInfo *)malloc(sizeof(PluginInfo)); #ifdef VERBOSE - printf ("GOOM: init (%d, %d);\n", resx, resy); + printf("GOOM: init (%d, %d);\n", resx, resy); #endif - plugin_info_init(goomInfo,4); + plugin_info_init(goomInfo, 4); - goomInfo->screen.width = resx; - goomInfo->screen.height = resy; - goomInfo->screen.size = resx * resy; + goomInfo->screen.width = resx; + goomInfo->screen.height = resy; + goomInfo->screen.size = resx * resy; - goomInfo->star_fx = flying_star_create(); - goomInfo->star_fx.init(&goomInfo->star_fx, goomInfo); + goomInfo->star_fx = flying_star_create(); + goomInfo->star_fx.init(&goomInfo->star_fx, goomInfo); - goomInfo->zoomFilter_fx = zoomFilterVisualFXWrapper_create (); - goomInfo->zoomFilter_fx.init(&goomInfo->zoomFilter_fx, goomInfo); + goomInfo->zoomFilter_fx = zoomFilterVisualFXWrapper_create(); + goomInfo->zoomFilter_fx.init(&goomInfo->zoomFilter_fx, goomInfo); - goomInfo->tentacles_fx = tentacle_fx_create(); - goomInfo->tentacles_fx.init(&goomInfo->tentacles_fx, goomInfo); + goomInfo->tentacles_fx = tentacle_fx_create(); + goomInfo->tentacles_fx.init(&goomInfo->tentacles_fx, goomInfo); - goomInfo->convolve_fx = convolve_create(); - goomInfo->convolve_fx.init(&goomInfo->convolve_fx, goomInfo); + goomInfo->convolve_fx = convolve_create(); + goomInfo->convolve_fx.init(&goomInfo->convolve_fx, goomInfo); - plugin_info_add_visual (goomInfo, 0, &goomInfo->zoomFilter_fx); - plugin_info_add_visual (goomInfo, 1, &goomInfo->tentacles_fx); - plugin_info_add_visual (goomInfo, 2, &goomInfo->star_fx); - plugin_info_add_visual (goomInfo, 3, &goomInfo->convolve_fx); + plugin_info_add_visual(goomInfo, 0, &goomInfo->zoomFilter_fx); + plugin_info_add_visual(goomInfo, 1, &goomInfo->tentacles_fx); + plugin_info_add_visual(goomInfo, 2, &goomInfo->star_fx); + plugin_info_add_visual(goomInfo, 3, &goomInfo->convolve_fx); - init_buffers(goomInfo, goomInfo->screen.size); - goomInfo->gRandom = goom_random_init((uintptr_t)goomInfo->pixel); + init_buffers(goomInfo, goomInfo->screen.size); + goomInfo->gRandom = goom_random_init((uintptr_t)goomInfo->pixel); - goomInfo->cycle = 0; + goomInfo->cycle = 0; - goomInfo->ifs_fx = ifs_visualfx_create(); - goomInfo->ifs_fx.init(&goomInfo->ifs_fx, goomInfo); + goomInfo->ifs_fx = ifs_visualfx_create(); + goomInfo->ifs_fx.init(&goomInfo->ifs_fx, goomInfo); - goomInfo->gmline1 = goom_lines_init (goomInfo, resx, goomInfo->screen.height, - GML_HLINE, goomInfo->screen.height, GML_BLACK, - GML_CIRCLE, 0.4f * (float) goomInfo->screen.height, GML_VERT); - goomInfo->gmline2 = goom_lines_init (goomInfo, resx, goomInfo->screen.height, - GML_HLINE, 0, GML_BLACK, - GML_CIRCLE, 0.2f * (float) goomInfo->screen.height, GML_RED); + goomInfo->gmline1 = + goom_lines_init(goomInfo, resx, goomInfo->screen.height, GML_HLINE, + goomInfo->screen.height, GML_BLACK, GML_CIRCLE, + 0.4f * (float)goomInfo->screen.height, GML_VERT); + goomInfo->gmline2 = goom_lines_init( + goomInfo, resx, goomInfo->screen.height, GML_HLINE, 0, GML_BLACK, + GML_CIRCLE, 0.2f * (float)goomInfo->screen.height, GML_RED); - gfont_load (); + gfont_load(); - /* goom_set_main_script(goomInfo, goomInfo->main_script_str); */ + /* goom_set_main_script(goomInfo, goomInfo->main_script_str); */ - return goomInfo; + return goomInfo; } +void goom_set_resolution(PluginInfo *goomInfo, uint32_t resx, uint32_t resy) { + free(goomInfo->pixel); + free(goomInfo->back); + free(goomInfo->conv); + goomInfo->screen.width = resx; + goomInfo->screen.height = resy; + goomInfo->screen.size = resx * resy; -void goom_set_resolution (PluginInfo *goomInfo, uint32_t resx, uint32_t resy) -{ - free (goomInfo->pixel); - free (goomInfo->back); - free (goomInfo->conv); + init_buffers(goomInfo, goomInfo->screen.size); - goomInfo->screen.width = resx; - goomInfo->screen.height = resy; - goomInfo->screen.size = resx * resy; + /* init_ifs (goomInfo, resx, goomInfo->screen.height); */ + goomInfo->ifs_fx.free(&goomInfo->ifs_fx); + goomInfo->ifs_fx.init(&goomInfo->ifs_fx, goomInfo); - init_buffers(goomInfo, goomInfo->screen.size); - - /* init_ifs (goomInfo, resx, goomInfo->screen.height); */ - goomInfo->ifs_fx.free(&goomInfo->ifs_fx); - goomInfo->ifs_fx.init(&goomInfo->ifs_fx, goomInfo); - - goom_lines_set_res (goomInfo->gmline1, resx, goomInfo->screen.height); - goom_lines_set_res (goomInfo->gmline2, resx, goomInfo->screen.height); + goom_lines_set_res(goomInfo->gmline1, resx, goomInfo->screen.height); + goom_lines_set_res(goomInfo->gmline2, resx, goomInfo->screen.height); } -int goom_set_screenbuffer(PluginInfo *goomInfo, void *buffer) -{ - goomInfo->outputBuf = (Pixel*)buffer; +int goom_set_screenbuffer(PluginInfo *goomInfo, void *buffer) { + goomInfo->outputBuf = (Pixel *)buffer; return 1; } @@ -144,685 +140,726 @@ int goom_set_screenbuffer(PluginInfo *goomInfo, void *buffer) * WARNING: this is a 600 lines function ! (21-11-2003) */ -uint32_t *goom_update (PluginInfo *goomInfo, int16_t data[2][512], - int forceMode, float fps, const char *songTitle, const char *message) -{ - Pixel *return_val; - uint32_t pointWidth; - uint32_t pointHeight; - int i; - float largfactor; /* elargissement de l'intervalle d'�volution des points */ - Pixel *tmp; - - ZoomFilterData *pzfd; - - /* test if the config has changed, update it if so */ - pointWidth = (goomInfo->screen.width * 2) / 5; - pointHeight = ((goomInfo->screen.height) * 2) / 5; - - /* ! etude du signal ... */ - evaluate_sound (data, &(goomInfo->sound)); - - /* goom_execute_main_script(goomInfo); */ - - /* ! calcul du deplacement des petits points ... */ - largfactor = goomInfo->sound.speedvar / 150.0f + goomInfo->sound.volume / 1.5f; - - if (largfactor > 1.5f) - largfactor = 1.5f; - - goomInfo->update.decay_ifs--; - if (goomInfo->update.decay_ifs > 0) - goomInfo->update.ifs_incr += 2; - if (goomInfo->update.decay_ifs == 0) - goomInfo->update.ifs_incr = 0; - - if (goomInfo->update.recay_ifs) { - goomInfo->update.ifs_incr -= 2; - goomInfo->update.recay_ifs--; - if ((goomInfo->update.recay_ifs == 0)&&(goomInfo->update.ifs_incr<=0)) - goomInfo->update.ifs_incr = 1; - } - - if (goomInfo->update.ifs_incr > 0) - goomInfo->ifs_fx.apply(&goomInfo->ifs_fx, goomInfo->p2, goomInfo->p1, goomInfo); - - if (goomInfo->curGState->drawPoints) { - for (i = 1; i * 15 <= goomInfo->sound.speedvar*80.0f + 15; i++) { - goomInfo->update.loopvar += goomInfo->sound.speedvar*50 + 1; - - pointFilter (goomInfo, goomInfo->p1, - YELLOW, - ((pointWidth - 6.0f) * largfactor + 5.0f), - ((pointHeight - 6.0f) * largfactor + 5.0f), - i * 152.0f, 128.0f, goomInfo->update.loopvar + i * 2032); - pointFilter (goomInfo, goomInfo->p1, ORANGE, - ((pointWidth / 2) * largfactor) / i + 10.0f * i, - ((pointHeight / 2) * largfactor) / i + 10.0f * i, - 96.0f, i * 80.0f, goomInfo->update.loopvar / i); - pointFilter (goomInfo, goomInfo->p1, VIOLET, - ((pointHeight / 3 + 5.0f) * largfactor) / i + 10.0f * i, - ((pointHeight / 3 + 5.0f) * largfactor) / i + 10.0f * i, - i + 122.0f, 134.0f, goomInfo->update.loopvar / i); - pointFilter (goomInfo, goomInfo->p1, BLACK, - ((pointHeight / 3) * largfactor + 20.0f), - ((pointHeight / 3) * largfactor + 20.0f), - 58.0f, i * 66.0f, goomInfo->update.loopvar / i); - pointFilter (goomInfo, goomInfo->p1, WHITE, - (pointHeight * largfactor + 10.0f * i) / i, - (pointHeight * largfactor + 10.0f * i) / i, - 66.0f, 74.0f, goomInfo->update.loopvar + i * 500); - } +uint32_t *goom_update(PluginInfo *goomInfo, int16_t data[2][512], int forceMode, + float fps, const char *songTitle, const char *message) { + Pixel *return_val; + uint32_t pointWidth; + uint32_t pointHeight; + int i; + float largfactor; /* elargissement de l'intervalle d'�volution des points */ + Pixel *tmp; + + ZoomFilterData *pzfd; + + /* test if the config has changed, update it if so */ + pointWidth = (goomInfo->screen.width * 2) / 5; + pointHeight = ((goomInfo->screen.height) * 2) / 5; + + /* ! etude du signal ... */ + evaluate_sound(data, &(goomInfo->sound)); + + /* goom_execute_main_script(goomInfo); */ + + /* ! calcul du deplacement des petits points ... */ + largfactor = + goomInfo->sound.speedvar / 150.0f + goomInfo->sound.volume / 1.5f; + + if (largfactor > 1.5f) + largfactor = 1.5f; + + goomInfo->update.decay_ifs--; + if (goomInfo->update.decay_ifs > 0) + goomInfo->update.ifs_incr += 2; + if (goomInfo->update.decay_ifs == 0) + goomInfo->update.ifs_incr = 0; + + if (goomInfo->update.recay_ifs) { + goomInfo->update.ifs_incr -= 2; + goomInfo->update.recay_ifs--; + if ((goomInfo->update.recay_ifs == 0) && (goomInfo->update.ifs_incr <= 0)) + goomInfo->update.ifs_incr = 1; + } + + if (goomInfo->update.ifs_incr > 0) + goomInfo->ifs_fx.apply(&goomInfo->ifs_fx, goomInfo->p2, goomInfo->p1, + goomInfo); + + if (goomInfo->curGState->drawPoints) { + for (i = 1; i * 15 <= goomInfo->sound.speedvar * 80.0f + 15; i++) { + goomInfo->update.loopvar += goomInfo->sound.speedvar * 50 + 1; + + pointFilter(goomInfo, goomInfo->p1, YELLOW, + ((pointWidth - 6.0f) * largfactor + 5.0f), + ((pointHeight - 6.0f) * largfactor + 5.0f), i * 152.0f, + 128.0f, goomInfo->update.loopvar + i * 2032); + pointFilter(goomInfo, goomInfo->p1, ORANGE, + ((pointWidth / 2) * largfactor) / i + 10.0f * i, + ((pointHeight / 2) * largfactor) / i + 10.0f * i, 96.0f, + i * 80.0f, goomInfo->update.loopvar / i); + pointFilter(goomInfo, goomInfo->p1, VIOLET, + ((pointHeight / 3 + 5.0f) * largfactor) / i + 10.0f * i, + ((pointHeight / 3 + 5.0f) * largfactor) / i + 10.0f * i, + i + 122.0f, 134.0f, goomInfo->update.loopvar / i); + pointFilter(goomInfo, goomInfo->p1, BLACK, + ((pointHeight / 3) * largfactor + 20.0f), + ((pointHeight / 3) * largfactor + 20.0f), 58.0f, i * 66.0f, + goomInfo->update.loopvar / i); + pointFilter(goomInfo, goomInfo->p1, WHITE, + (pointHeight * largfactor + 10.0f * i) / i, + (pointHeight * largfactor + 10.0f * i) / i, 66.0f, 74.0f, + goomInfo->update.loopvar + i * 500); } + } - /* par d�faut pas de changement de zoom */ - pzfd = NULL; + /* par d�faut pas de changement de zoom */ + pzfd = NULL; - /* - * Test forceMode - */ + /* + * Test forceMode + */ #ifdef VERBOSE - if (forceMode != 0) { - printf ("forcemode = %d\n", forceMode); - } + if (forceMode != 0) { + printf("forcemode = %d\n", forceMode); + } #endif + /* diminuer de 1 le temps de lockage */ + /* note pour ceux qui n'ont pas suivis : le lockvar permet d'empecher un */ + /* changement d'etat du plugin juste apres un autre changement d'etat. oki */ + if (--goomInfo->update.lockvar < 0) + goomInfo->update.lockvar = 0; + + /* on verifie qu'il ne se pas un truc interressant avec le son. */ + if ((goomInfo->sound.timeSinceLastGoom == 0) || (forceMode > 0) || + (goomInfo->update.cyclesSinceLastChange > TIME_BTW_CHG)) { + + /* changement eventuel de mode */ + if (goom_irand(goomInfo->gRandom, 16) == 0) + switch (goom_irand(goomInfo->gRandom, 34)) { + case 0: + case 10: + goomInfo->update.zoomFilterData.hypercosEffect = + goom_irand(goomInfo->gRandom, 2); + case 13: + case 20: + case 21: + goomInfo->update.zoomFilterData.mode = WAVE_MODE; + goomInfo->update.zoomFilterData.reverse = 0; + goomInfo->update.zoomFilterData.waveEffect = + (goom_irand(goomInfo->gRandom, 3) == 0); + if (goom_irand(goomInfo->gRandom, 2)) + goomInfo->update.zoomFilterData.vitesse = + (goomInfo->update.zoomFilterData.vitesse + 127) >> 1; + break; + case 1: + case 11: + goomInfo->update.zoomFilterData.mode = CRYSTAL_BALL_MODE; + goomInfo->update.zoomFilterData.waveEffect = 0; + goomInfo->update.zoomFilterData.hypercosEffect = 0; + break; + case 2: + case 12: + goomInfo->update.zoomFilterData.mode = AMULETTE_MODE; + goomInfo->update.zoomFilterData.waveEffect = 0; + goomInfo->update.zoomFilterData.hypercosEffect = 0; + break; + case 3: + goomInfo->update.zoomFilterData.mode = WATER_MODE; + goomInfo->update.zoomFilterData.waveEffect = 0; + goomInfo->update.zoomFilterData.hypercosEffect = 0; + break; + case 4: + case 14: + goomInfo->update.zoomFilterData.mode = SCRUNCH_MODE; + goomInfo->update.zoomFilterData.waveEffect = 0; + goomInfo->update.zoomFilterData.hypercosEffect = 0; + break; + case 5: + case 15: + case 22: + goomInfo->update.zoomFilterData.mode = HYPERCOS1_MODE; + goomInfo->update.zoomFilterData.waveEffect = 0; + goomInfo->update.zoomFilterData.hypercosEffect = + (goom_irand(goomInfo->gRandom, 3) == 0); + break; + case 6: + case 16: + goomInfo->update.zoomFilterData.mode = HYPERCOS2_MODE; + goomInfo->update.zoomFilterData.waveEffect = 0; + goomInfo->update.zoomFilterData.hypercosEffect = 0; + break; + case 7: + case 17: + goomInfo->update.zoomFilterData.mode = CRYSTAL_BALL_MODE; + goomInfo->update.zoomFilterData.waveEffect = + (goom_irand(goomInfo->gRandom, 4) == 0); + goomInfo->update.zoomFilterData.hypercosEffect = + goom_irand(goomInfo->gRandom, 2); + break; + case 8: + case 18: + case 19: + goomInfo->update.zoomFilterData.mode = SCRUNCH_MODE; + goomInfo->update.zoomFilterData.waveEffect = 1; + goomInfo->update.zoomFilterData.hypercosEffect = 1; + break; + case 29: + case 30: + goomInfo->update.zoomFilterData.mode = YONLY_MODE; + break; + case 31: + case 32: + case 33: + goomInfo->update.zoomFilterData.mode = SPEEDWAY_MODE; + break; + default: + goomInfo->update.zoomFilterData.mode = NORMAL_MODE; + goomInfo->update.zoomFilterData.waveEffect = 0; + goomInfo->update.zoomFilterData.hypercosEffect = 0; + } + } + + /* tout ceci ne sera fait qu'en cas de non-blocage */ + if (goomInfo->update.lockvar == 0) { + /* reperage de goom (acceleration forte de l'acceleration du volume) */ + /* -> coup de boost de la vitesse si besoin.. */ + if (goomInfo->sound.timeSinceLastGoom == 0) { + + int i; + goomInfo->update.goomvar++; + + /* SELECTION OF THE GOOM STATE */ + if ((!goomInfo->update.stateSelectionBlocker) && + (goom_irand(goomInfo->gRandom, 3))) { + goomInfo->update.stateSelectionRnd = + goom_irand(goomInfo->gRandom, goomInfo->statesRangeMax); + goomInfo->update.stateSelectionBlocker = 3; + } else if (goomInfo->update.stateSelectionBlocker) + goomInfo->update.stateSelectionBlocker--; + + for (i = 0; i < goomInfo->statesNumber; i++) + if ((goomInfo->update.stateSelectionRnd >= + goomInfo->states[i].rangemin) && + (goomInfo->update.stateSelectionRnd <= + goomInfo->states[i].rangemax)) + goomInfo->curGState = &(goomInfo->states[i]); + + if ((goomInfo->curGState->drawIFS) && (goomInfo->update.ifs_incr <= 0)) { + goomInfo->update.recay_ifs = 5; + goomInfo->update.ifs_incr = 11; + } + + if ((!goomInfo->curGState->drawIFS) && (goomInfo->update.ifs_incr > 0) && + (goomInfo->update.decay_ifs <= 0)) + goomInfo->update.decay_ifs = 100; + + if (!goomInfo->curGState->drawScope) + goomInfo->update.stop_lines = 0xf000 & 5; + + if (!goomInfo->curGState->drawScope) { + goomInfo->update.stop_lines = 0; + goomInfo->update.lineMode = goomInfo->update.drawLinesDuration; + } + + /* if (goomInfo->update.goomvar % 1 == 0) */ + { + uint32_t vtmp; + uint32_t newvit; + + goomInfo->update.lockvar = 50; + newvit = STOP_SPEED + 1 - + ((float)3.5f * log10(goomInfo->sound.speedvar * 60 + 1)); + /* retablir le zoom avant.. */ + if ((goomInfo->update.zoomFilterData.reverse) && + (!(goomInfo->cycle % 13)) && (visual_rand() % 5 == 0)) { + goomInfo->update.zoomFilterData.reverse = 0; + goomInfo->update.zoomFilterData.vitesse = STOP_SPEED - 2; + goomInfo->update.lockvar = 75; + } + if (goom_irand(goomInfo->gRandom, 10) == 0) { + goomInfo->update.zoomFilterData.reverse = 1; + goomInfo->update.lockvar = 100; + } - /* diminuer de 1 le temps de lockage */ - /* note pour ceux qui n'ont pas suivis : le lockvar permet d'empecher un */ - /* changement d'etat du plugin juste apres un autre changement d'etat. oki */ - if (--goomInfo->update.lockvar < 0) - goomInfo->update.lockvar = 0; - - /* on verifie qu'il ne se pas un truc interressant avec le son. */ - if ((goomInfo->sound.timeSinceLastGoom == 0) - || (forceMode > 0) - || (goomInfo->update.cyclesSinceLastChange > TIME_BTW_CHG)) { - - /* changement eventuel de mode */ - if (goom_irand(goomInfo->gRandom,16) == 0) - switch (goom_irand(goomInfo->gRandom,34)) { - case 0: - case 10: - goomInfo->update.zoomFilterData.hypercosEffect = goom_irand(goomInfo->gRandom,2); - case 13: - case 20: - case 21: - goomInfo->update.zoomFilterData.mode = WAVE_MODE; - goomInfo->update.zoomFilterData.reverse = 0; - goomInfo->update.zoomFilterData.waveEffect = (goom_irand(goomInfo->gRandom,3) == 0); - if (goom_irand(goomInfo->gRandom,2)) - goomInfo->update.zoomFilterData.vitesse = (goomInfo->update.zoomFilterData.vitesse + 127) >> 1; - break; - case 1: - case 11: - goomInfo->update.zoomFilterData.mode = CRYSTAL_BALL_MODE; - goomInfo->update.zoomFilterData.waveEffect = 0; - goomInfo->update.zoomFilterData.hypercosEffect = 0; - break; - case 2: - case 12: - goomInfo->update.zoomFilterData.mode = AMULETTE_MODE; - goomInfo->update.zoomFilterData.waveEffect = 0; - goomInfo->update.zoomFilterData.hypercosEffect = 0; - break; - case 3: - goomInfo->update.zoomFilterData.mode = WATER_MODE; - goomInfo->update.zoomFilterData.waveEffect = 0; - goomInfo->update.zoomFilterData.hypercosEffect = 0; - break; - case 4: - case 14: - goomInfo->update.zoomFilterData.mode = SCRUNCH_MODE; - goomInfo->update.zoomFilterData.waveEffect = 0; - goomInfo->update.zoomFilterData.hypercosEffect = 0; - break; - case 5: - case 15: - case 22: - goomInfo->update.zoomFilterData.mode = HYPERCOS1_MODE; - goomInfo->update.zoomFilterData.waveEffect = 0; - goomInfo->update.zoomFilterData.hypercosEffect = (goom_irand(goomInfo->gRandom,3) == 0); - break; - case 6: - case 16: - goomInfo->update.zoomFilterData.mode = HYPERCOS2_MODE; - goomInfo->update.zoomFilterData.waveEffect = 0; - goomInfo->update.zoomFilterData.hypercosEffect = 0; - break; - case 7: - case 17: - goomInfo->update.zoomFilterData.mode = CRYSTAL_BALL_MODE; - goomInfo->update.zoomFilterData.waveEffect = (goom_irand(goomInfo->gRandom,4) == 0); - goomInfo->update.zoomFilterData.hypercosEffect = goom_irand(goomInfo->gRandom,2); - break; - case 8: - case 18: - case 19: - goomInfo->update.zoomFilterData.mode = SCRUNCH_MODE; - goomInfo->update.zoomFilterData.waveEffect = 1; - goomInfo->update.zoomFilterData.hypercosEffect = 1; - break; - case 29: - case 30: - goomInfo->update.zoomFilterData.mode = YONLY_MODE; - break; - case 31: - case 32: - case 33: - goomInfo->update.zoomFilterData.mode = SPEEDWAY_MODE; - break; - default: - goomInfo->update.zoomFilterData.mode = NORMAL_MODE; - goomInfo->update.zoomFilterData.waveEffect = 0; - goomInfo->update.zoomFilterData.hypercosEffect = 0; - } - } + if (goom_irand(goomInfo->gRandom, 10) == 0) + goomInfo->update.zoomFilterData.vitesse = STOP_SPEED - 1; + if (goom_irand(goomInfo->gRandom, 12) == 0) + goomInfo->update.zoomFilterData.vitesse = STOP_SPEED + 1; + + /* changement de milieu.. */ + switch (goom_irand(goomInfo->gRandom, 25)) { + case 0: + case 3: + case 6: + goomInfo->update.zoomFilterData.middleY = goomInfo->screen.height - 1; + goomInfo->update.zoomFilterData.middleX = goomInfo->screen.width / 2; + break; + case 1: + case 4: + goomInfo->update.zoomFilterData.middleX = goomInfo->screen.width - 1; + break; + case 2: + case 5: + goomInfo->update.zoomFilterData.middleX = 1; + break; + default: + goomInfo->update.zoomFilterData.middleY = goomInfo->screen.height / 2; + goomInfo->update.zoomFilterData.middleX = goomInfo->screen.width / 2; + } - /* tout ceci ne sera fait qu'en cas de non-blocage */ - if (goomInfo->update.lockvar == 0) { - /* reperage de goom (acceleration forte de l'acceleration du volume) */ - /* -> coup de boost de la vitesse si besoin.. */ - if (goomInfo->sound.timeSinceLastGoom == 0) { - - int i; - goomInfo->update.goomvar++; - - /* SELECTION OF THE GOOM STATE */ - if ((!goomInfo->update.stateSelectionBlocker)&&(goom_irand(goomInfo->gRandom,3))) { - goomInfo->update.stateSelectionRnd = goom_irand(goomInfo->gRandom,goomInfo->statesRangeMax); - goomInfo->update.stateSelectionBlocker = 3; - } - else if (goomInfo->update.stateSelectionBlocker) goomInfo->update.stateSelectionBlocker--; - - for (i=0;istatesNumber;i++) - if ((goomInfo->update.stateSelectionRnd >= goomInfo->states[i].rangemin) - && (goomInfo->update.stateSelectionRnd <= goomInfo->states[i].rangemax)) - goomInfo->curGState = &(goomInfo->states[i]); - - if ((goomInfo->curGState->drawIFS) && (goomInfo->update.ifs_incr<=0)) { - goomInfo->update.recay_ifs = 5; - goomInfo->update.ifs_incr = 11; - } - - if ((!goomInfo->curGState->drawIFS) && (goomInfo->update.ifs_incr>0) && (goomInfo->update.decay_ifs<=0)) - goomInfo->update.decay_ifs = 100; - - if (!goomInfo->curGState->drawScope) - goomInfo->update.stop_lines = 0xf000 & 5; - - if (!goomInfo->curGState->drawScope) { - goomInfo->update.stop_lines = 0; - goomInfo->update.lineMode = goomInfo->update.drawLinesDuration; - } - - /* if (goomInfo->update.goomvar % 1 == 0) */ - { - uint32_t vtmp; - uint32_t newvit; - - goomInfo->update.lockvar = 50; - newvit = STOP_SPEED + 1 - ((float)3.5f * log10(goomInfo->sound.speedvar * 60 + 1)); - /* retablir le zoom avant.. */ - if ((goomInfo->update.zoomFilterData.reverse) && (!(goomInfo->cycle % 13)) && (visual_rand () % 5 == 0)) { - goomInfo->update.zoomFilterData.reverse = 0; - goomInfo->update.zoomFilterData.vitesse = STOP_SPEED - 2; - goomInfo->update.lockvar = 75; - } - if (goom_irand(goomInfo->gRandom,10) == 0) { - goomInfo->update.zoomFilterData.reverse = 1; - goomInfo->update.lockvar = 100; - } - - if (goom_irand(goomInfo->gRandom,10) == 0) - goomInfo->update.zoomFilterData.vitesse = STOP_SPEED - 1; - if (goom_irand(goomInfo->gRandom,12) == 0) - goomInfo->update.zoomFilterData.vitesse = STOP_SPEED + 1; - - /* changement de milieu.. */ - switch (goom_irand(goomInfo->gRandom,25)) { - case 0: - case 3: - case 6: - goomInfo->update.zoomFilterData.middleY = goomInfo->screen.height - 1; - goomInfo->update.zoomFilterData.middleX = goomInfo->screen.width / 2; - break; - case 1: - case 4: - goomInfo->update.zoomFilterData.middleX = goomInfo->screen.width - 1; - break; - case 2: - case 5: - goomInfo->update.zoomFilterData.middleX = 1; - break; - default: - goomInfo->update.zoomFilterData.middleY = goomInfo->screen.height / 2; - goomInfo->update.zoomFilterData.middleX = goomInfo->screen.width / 2; - } - - if ((goomInfo->update.zoomFilterData.mode == WATER_MODE) - || (goomInfo->update.zoomFilterData.mode == YONLY_MODE) - || (goomInfo->update.zoomFilterData.mode == AMULETTE_MODE)) { - goomInfo->update.zoomFilterData.middleX = goomInfo->screen.width / 2; - goomInfo->update.zoomFilterData.middleY = goomInfo->screen.height / 2; - } - - switch (vtmp = (goom_irand(goomInfo->gRandom,15))) { - case 0: - goomInfo->update.zoomFilterData.vPlaneEffect = goom_irand(goomInfo->gRandom,3) - - goom_irand(goomInfo->gRandom,3); - goomInfo->update.zoomFilterData.hPlaneEffect = goom_irand(goomInfo->gRandom,3) - - goom_irand(goomInfo->gRandom,3); - break; - case 3: - goomInfo->update.zoomFilterData.vPlaneEffect = 0; - goomInfo->update.zoomFilterData.hPlaneEffect = goom_irand(goomInfo->gRandom,8) - - goom_irand(goomInfo->gRandom,8); - break; - case 4: - case 5: - case 6: - case 7: - goomInfo->update.zoomFilterData.vPlaneEffect = goom_irand(goomInfo->gRandom,5) - - goom_irand(goomInfo->gRandom,5); - goomInfo->update.zoomFilterData.hPlaneEffect = -goomInfo->update.zoomFilterData.vPlaneEffect; - break; - case 8: - goomInfo->update.zoomFilterData.hPlaneEffect = 5 + goom_irand(goomInfo->gRandom,8); - goomInfo->update.zoomFilterData.vPlaneEffect = -goomInfo->update.zoomFilterData.hPlaneEffect; - break; - case 9: - goomInfo->update.zoomFilterData.vPlaneEffect = 5 + goom_irand(goomInfo->gRandom,8); - goomInfo->update.zoomFilterData.hPlaneEffect = -goomInfo->update.zoomFilterData.hPlaneEffect; - break; - case 13: - goomInfo->update.zoomFilterData.hPlaneEffect = 0; - goomInfo->update.zoomFilterData.vPlaneEffect = goom_irand(goomInfo->gRandom,10) - - goom_irand(goomInfo->gRandom,10); - break; - case 14: - goomInfo->update.zoomFilterData.hPlaneEffect = goom_irand(goomInfo->gRandom,10) - - goom_irand(goomInfo->gRandom,10); - goomInfo->update.zoomFilterData.vPlaneEffect = goom_irand(goomInfo->gRandom,10) - - goom_irand(goomInfo->gRandom,10); - break; - default: - if (vtmp < 10) { - goomInfo->update.zoomFilterData.vPlaneEffect = 0; - goomInfo->update.zoomFilterData.hPlaneEffect = 0; - } - } - - if (goom_irand(goomInfo->gRandom,5) != 0) - goomInfo->update.zoomFilterData.noisify = 0; - else { - goomInfo->update.zoomFilterData.noisify = goom_irand(goomInfo->gRandom,2) + 1; - goomInfo->update.lockvar *= 2; - } - - if (goomInfo->update.zoomFilterData.mode == AMULETTE_MODE) { - goomInfo->update.zoomFilterData.vPlaneEffect = 0; - goomInfo->update.zoomFilterData.hPlaneEffect = 0; - goomInfo->update.zoomFilterData.noisify = 0; - } - - if ((goomInfo->update.zoomFilterData.middleX == 1) || (goomInfo->update.zoomFilterData.middleX == (signed int)goomInfo->screen.width - 1)) { - goomInfo->update.zoomFilterData.vPlaneEffect = 0; - if (goom_irand(goomInfo->gRandom,2)) - goomInfo->update.zoomFilterData.hPlaneEffect = 0; - } - - if ((signed int)newvit < goomInfo->update.zoomFilterData.vitesse) /* on accelere */ - { - pzfd = &goomInfo->update.zoomFilterData; - if (((newvit < STOP_SPEED - 7) && - (goomInfo->update.zoomFilterData.vitesse < STOP_SPEED - 6) && - (goomInfo->cycle % 3 == 0)) || (goom_irand(goomInfo->gRandom,40) == 0)) { - goomInfo->update.zoomFilterData.vitesse = STOP_SPEED - goom_irand(goomInfo->gRandom,2) - + goom_irand(goomInfo->gRandom,2); - goomInfo->update.zoomFilterData.reverse = !goomInfo->update.zoomFilterData.reverse; - } - else { - goomInfo->update.zoomFilterData.vitesse = (newvit + goomInfo->update.zoomFilterData.vitesse * 7) / 8; - } - goomInfo->update.lockvar += 50; - } - } - - if (goomInfo->update.lockvar > 150) { - goomInfo->update.switchIncr = goomInfo->update.switchIncrAmount; - goomInfo->update.switchMult = 1.0f; - } - } - /* mode mega-lent */ - if (goom_irand(goomInfo->gRandom,700) == 0) { - /* - * printf ("coup du sort...\n") ; - */ - pzfd = &goomInfo->update.zoomFilterData; - goomInfo->update.zoomFilterData.vitesse = STOP_SPEED - 1; - goomInfo->update.zoomFilterData.pertedec = 8; - goomInfo->update.zoomFilterData.sqrtperte = 16; - goomInfo->update.goomvar = 1; - goomInfo->update.lockvar += 50; - goomInfo->update.switchIncr = goomInfo->update.switchIncrAmount; - goomInfo->update.switchMult = 1.0f; - } + if ((goomInfo->update.zoomFilterData.mode == WATER_MODE) || + (goomInfo->update.zoomFilterData.mode == YONLY_MODE) || + (goomInfo->update.zoomFilterData.mode == AMULETTE_MODE)) { + goomInfo->update.zoomFilterData.middleX = goomInfo->screen.width / 2; + goomInfo->update.zoomFilterData.middleY = goomInfo->screen.height / 2; } - /* - * gros frein si la musique est calme - */ - if ((goomInfo->sound.speedvar < 0.01f) - && (goomInfo->update.zoomFilterData.vitesse < STOP_SPEED - 4) - && (goomInfo->cycle % 16 == 0)) { - pzfd = &goomInfo->update.zoomFilterData; - goomInfo->update.zoomFilterData.vitesse += 3; - goomInfo->update.zoomFilterData.pertedec = 8; - goomInfo->update.zoomFilterData.sqrtperte = 16; - goomInfo->update.goomvar = 0; + switch (vtmp = (goom_irand(goomInfo->gRandom, 15))) { + case 0: + goomInfo->update.zoomFilterData.vPlaneEffect = + goom_irand(goomInfo->gRandom, 3) - + goom_irand(goomInfo->gRandom, 3); + goomInfo->update.zoomFilterData.hPlaneEffect = + goom_irand(goomInfo->gRandom, 3) - + goom_irand(goomInfo->gRandom, 3); + break; + case 3: + goomInfo->update.zoomFilterData.vPlaneEffect = 0; + goomInfo->update.zoomFilterData.hPlaneEffect = + goom_irand(goomInfo->gRandom, 8) - + goom_irand(goomInfo->gRandom, 8); + break; + case 4: + case 5: + case 6: + case 7: + goomInfo->update.zoomFilterData.vPlaneEffect = + goom_irand(goomInfo->gRandom, 5) - + goom_irand(goomInfo->gRandom, 5); + goomInfo->update.zoomFilterData.hPlaneEffect = + -goomInfo->update.zoomFilterData.vPlaneEffect; + break; + case 8: + goomInfo->update.zoomFilterData.hPlaneEffect = + 5 + goom_irand(goomInfo->gRandom, 8); + goomInfo->update.zoomFilterData.vPlaneEffect = + -goomInfo->update.zoomFilterData.hPlaneEffect; + break; + case 9: + goomInfo->update.zoomFilterData.vPlaneEffect = + 5 + goom_irand(goomInfo->gRandom, 8); + goomInfo->update.zoomFilterData.hPlaneEffect = + -goomInfo->update.zoomFilterData.hPlaneEffect; + break; + case 13: + goomInfo->update.zoomFilterData.hPlaneEffect = 0; + goomInfo->update.zoomFilterData.vPlaneEffect = + goom_irand(goomInfo->gRandom, 10) - + goom_irand(goomInfo->gRandom, 10); + break; + case 14: + goomInfo->update.zoomFilterData.hPlaneEffect = + goom_irand(goomInfo->gRandom, 10) - + goom_irand(goomInfo->gRandom, 10); + goomInfo->update.zoomFilterData.vPlaneEffect = + goom_irand(goomInfo->gRandom, 10) - + goom_irand(goomInfo->gRandom, 10); + break; + default: + if (vtmp < 10) { + goomInfo->update.zoomFilterData.vPlaneEffect = 0; + goomInfo->update.zoomFilterData.hPlaneEffect = 0; + } } - /* - * baisser regulierement la vitesse... - */ - if ((goomInfo->cycle % 73 == 0) && (goomInfo->update.zoomFilterData.vitesse < STOP_SPEED - 5)) { - pzfd = &goomInfo->update.zoomFilterData; - goomInfo->update.zoomFilterData.vitesse++; + if (goom_irand(goomInfo->gRandom, 5) != 0) + goomInfo->update.zoomFilterData.noisify = 0; + else { + goomInfo->update.zoomFilterData.noisify = + goom_irand(goomInfo->gRandom, 2) + 1; + goomInfo->update.lockvar *= 2; } - /* - * arreter de decr�menter au bout d'un certain temps - */ - if ((goomInfo->cycle % 101 == 0) && (goomInfo->update.zoomFilterData.pertedec == 7)) { - pzfd = &goomInfo->update.zoomFilterData; - goomInfo->update.zoomFilterData.pertedec = 8; - goomInfo->update.zoomFilterData.sqrtperte = 16; + if (goomInfo->update.zoomFilterData.mode == AMULETTE_MODE) { + goomInfo->update.zoomFilterData.vPlaneEffect = 0; + goomInfo->update.zoomFilterData.hPlaneEffect = 0; + goomInfo->update.zoomFilterData.noisify = 0; } - /* - * Permet de forcer un effet. - */ - if ((forceMode > 0) && (forceMode <= NB_FX)) { - pzfd = &goomInfo->update.zoomFilterData; - pzfd->mode = forceMode - 1; + if ((goomInfo->update.zoomFilterData.middleX == 1) || + (goomInfo->update.zoomFilterData.middleX == + (signed int)goomInfo->screen.width - 1)) { + goomInfo->update.zoomFilterData.vPlaneEffect = 0; + if (goom_irand(goomInfo->gRandom, 2)) + goomInfo->update.zoomFilterData.hPlaneEffect = 0; } - if (forceMode == -1) { - pzfd = NULL; + if ((signed int)newvit < + goomInfo->update.zoomFilterData.vitesse) /* on accelere */ + { + pzfd = &goomInfo->update.zoomFilterData; + if (((newvit < STOP_SPEED - 7) && + (goomInfo->update.zoomFilterData.vitesse < STOP_SPEED - 6) && + (goomInfo->cycle % 3 == 0)) || + (goom_irand(goomInfo->gRandom, 40) == 0)) { + goomInfo->update.zoomFilterData.vitesse = + STOP_SPEED - goom_irand(goomInfo->gRandom, 2) + + goom_irand(goomInfo->gRandom, 2); + goomInfo->update.zoomFilterData.reverse = + !goomInfo->update.zoomFilterData.reverse; + } else { + goomInfo->update.zoomFilterData.vitesse = + (newvit + goomInfo->update.zoomFilterData.vitesse * 7) / 8; + } + goomInfo->update.lockvar += 50; } + } - /* - * Changement d'effet de zoom ! - */ - if (pzfd != NULL) { - int dif; + if (goomInfo->update.lockvar > 150) { + goomInfo->update.switchIncr = goomInfo->update.switchIncrAmount; + goomInfo->update.switchMult = 1.0f; + } + } + /* mode mega-lent */ + if (goom_irand(goomInfo->gRandom, 700) == 0) { + /* + * printf ("coup du sort...\n") ; + */ + pzfd = &goomInfo->update.zoomFilterData; + goomInfo->update.zoomFilterData.vitesse = STOP_SPEED - 1; + goomInfo->update.zoomFilterData.pertedec = 8; + goomInfo->update.zoomFilterData.sqrtperte = 16; + goomInfo->update.goomvar = 1; + goomInfo->update.lockvar += 50; + goomInfo->update.switchIncr = goomInfo->update.switchIncrAmount; + goomInfo->update.switchMult = 1.0f; + } + } + + /* + * gros frein si la musique est calme + */ + if ((goomInfo->sound.speedvar < 0.01f) && + (goomInfo->update.zoomFilterData.vitesse < STOP_SPEED - 4) && + (goomInfo->cycle % 16 == 0)) { + pzfd = &goomInfo->update.zoomFilterData; + goomInfo->update.zoomFilterData.vitesse += 3; + goomInfo->update.zoomFilterData.pertedec = 8; + goomInfo->update.zoomFilterData.sqrtperte = 16; + goomInfo->update.goomvar = 0; + } + + /* + * baisser regulierement la vitesse... + */ + if ((goomInfo->cycle % 73 == 0) && + (goomInfo->update.zoomFilterData.vitesse < STOP_SPEED - 5)) { + pzfd = &goomInfo->update.zoomFilterData; + goomInfo->update.zoomFilterData.vitesse++; + } + + /* + * arreter de decr�menter au bout d'un certain temps + */ + if ((goomInfo->cycle % 101 == 0) && + (goomInfo->update.zoomFilterData.pertedec == 7)) { + pzfd = &goomInfo->update.zoomFilterData; + goomInfo->update.zoomFilterData.pertedec = 8; + goomInfo->update.zoomFilterData.sqrtperte = 16; + } + + /* + * Permet de forcer un effet. + */ + if ((forceMode > 0) && (forceMode <= NB_FX)) { + pzfd = &goomInfo->update.zoomFilterData; + pzfd->mode = forceMode - 1; + } + + if (forceMode == -1) { + pzfd = NULL; + } - goomInfo->update.cyclesSinceLastChange = 0; + /* + * Changement d'effet de zoom ! + */ + if (pzfd != NULL) { + int dif; - goomInfo->update.switchIncr = goomInfo->update.switchIncrAmount; + goomInfo->update.cyclesSinceLastChange = 0; - dif = goomInfo->update.zoomFilterData.vitesse - goomInfo->update.previousZoomSpeed; - if (dif < 0) - dif = -dif; + goomInfo->update.switchIncr = goomInfo->update.switchIncrAmount; - if (dif > 2) { - goomInfo->update.switchIncr *= (dif + 2) / 2; - } - goomInfo->update.previousZoomSpeed = goomInfo->update.zoomFilterData.vitesse; - goomInfo->update.switchMult = 1.0f; + dif = goomInfo->update.zoomFilterData.vitesse - + goomInfo->update.previousZoomSpeed; + if (dif < 0) + dif = -dif; - if (((goomInfo->sound.timeSinceLastGoom == 0) - && (goomInfo->sound.totalgoom < 2)) || (forceMode > 0)) { - goomInfo->update.switchIncr = 0; - goomInfo->update.switchMult = goomInfo->update.switchMultAmount; - } - } - else { - if (goomInfo->update.cyclesSinceLastChange > TIME_BTW_CHG) { - pzfd = &goomInfo->update.zoomFilterData; - goomInfo->update.cyclesSinceLastChange = 0; - } - else - goomInfo->update.cyclesSinceLastChange++; - } + if (dif > 2) { + goomInfo->update.switchIncr *= (dif + 2) / 2; + } + goomInfo->update.previousZoomSpeed = + goomInfo->update.zoomFilterData.vitesse; + goomInfo->update.switchMult = 1.0f; + + if (((goomInfo->sound.timeSinceLastGoom == 0) && + (goomInfo->sound.totalgoom < 2)) || + (forceMode > 0)) { + goomInfo->update.switchIncr = 0; + goomInfo->update.switchMult = goomInfo->update.switchMultAmount; + } + } else { + if (goomInfo->update.cyclesSinceLastChange > TIME_BTW_CHG) { + pzfd = &goomInfo->update.zoomFilterData; + goomInfo->update.cyclesSinceLastChange = 0; + } else + goomInfo->update.cyclesSinceLastChange++; + } #ifdef VERBOSE - if (pzfd) { - printf ("GOOM: pzfd->mode = %d\n", pzfd->mode); - } + if (pzfd) { + printf("GOOM: pzfd->mode = %d\n", pzfd->mode); + } #endif - /* Zoom here ! */ - zoomFilterFastRGB (goomInfo, goomInfo->p1, goomInfo->p2, pzfd, goomInfo->screen.width, goomInfo->screen.height, - goomInfo->update.switchIncr, goomInfo->update.switchMult); + /* Zoom here ! */ + zoomFilterFastRGB(goomInfo, goomInfo->p1, goomInfo->p2, pzfd, + goomInfo->screen.width, goomInfo->screen.height, + goomInfo->update.switchIncr, goomInfo->update.switchMult); - /* - * Affichage tentacule - */ + /* + * Affichage tentacule + */ - goomInfo->tentacles_fx.apply(&goomInfo->tentacles_fx, goomInfo->p1, goomInfo->p2, goomInfo); - goomInfo->star_fx.apply (&goomInfo->star_fx,goomInfo->p2,goomInfo->p1,goomInfo); + goomInfo->tentacles_fx.apply(&goomInfo->tentacles_fx, goomInfo->p1, + goomInfo->p2, goomInfo); + goomInfo->star_fx.apply(&goomInfo->star_fx, goomInfo->p2, goomInfo->p1, + goomInfo); - /* - * Affichage de texte - */ - { - /*char title[1024];*/ - char text[64]; - - /* - * Le message - */ - update_message (goomInfo, message); - - if (fps > 0) { - sprintf (text, "%2.0f fps", fps); - goom_draw_text (goomInfo->p1,goomInfo->screen.width,goomInfo->screen.height, - 10, 24, text, 1, 0); - } - - /* - * Le titre - */ - if (songTitle != NULL) { - strncpy (goomInfo->update.titleText, songTitle, 1023); - goomInfo->update.titleText[1023]=0; - goomInfo->update.timeOfTitleDisplay = 200; - } - - if (goomInfo->update.timeOfTitleDisplay) { - goom_draw_text (goomInfo->p1,goomInfo->screen.width,goomInfo->screen.height, - goomInfo->screen.width / 2, goomInfo->screen.height / 2 + 7, goomInfo->update.titleText, - ((float) (190 - goomInfo->update.timeOfTitleDisplay) / 10.0f), 1); - goomInfo->update.timeOfTitleDisplay--; - if (goomInfo->update.timeOfTitleDisplay < 4) - goom_draw_text (goomInfo->p2,goomInfo->screen.width,goomInfo->screen.height, - goomInfo->screen.width / 2, goomInfo->screen.height / 2 + 7, goomInfo->update.titleText, - ((float) (190 - goomInfo->update.timeOfTitleDisplay) / 10.0f), 1); - } - } - - /* - * Gestion du Scope - */ + /* + * Affichage de texte + */ + { + /*char title[1024];*/ + char text[64]; - /* - * arret demande - */ - if ((goomInfo->update.stop_lines & 0xf000)||(!goomInfo->curGState->drawScope)) { - float param1, param2, amplitude; - int couleur; - int mode; - - choose_a_goom_line (goomInfo, ¶m1, ¶m2, &couleur, &mode, &litude,1); - couleur = GML_BLACK; + /* + * Le message + */ + update_message(goomInfo, message); - goom_lines_switch_to (goomInfo->gmline1, mode, param1, amplitude, couleur); - goom_lines_switch_to (goomInfo->gmline2, mode, param2, amplitude, couleur); - goomInfo->update.stop_lines &= 0x0fff; - } + if (fps > 0) { + sprintf(text, "%2.0f fps", fps); + goom_draw_text(goomInfo->p1, goomInfo->screen.width, + goomInfo->screen.height, 10, 24, text, 1, 0); + } - /* - * arret aleatore.. changement de mode de ligne.. - */ - if (goomInfo->update.lineMode != goomInfo->update.drawLinesDuration) { - goomInfo->update.lineMode--; - if (goomInfo->update.lineMode == -1) - goomInfo->update.lineMode = 0; - } - else - if ((goomInfo->cycle%80==0)&&(goom_irand(goomInfo->gRandom,5)==0)&&goomInfo->update.lineMode) - goomInfo->update.lineMode--; - - if ((goomInfo->cycle % 120 == 0) - && (goom_irand(goomInfo->gRandom,4) == 0) - && (goomInfo->curGState->drawScope)) { - if (goomInfo->update.lineMode == 0) - goomInfo->update.lineMode = goomInfo->update.drawLinesDuration; - else if (goomInfo->update.lineMode == goomInfo->update.drawLinesDuration) { - float param1, param2, amplitude; - int couleur1,couleur2; - int mode; - - goomInfo->update.lineMode--; - choose_a_goom_line (goomInfo, ¶m1, ¶m2, &couleur1, - &mode, &litude,goomInfo->update.stop_lines); - - couleur2 = 5-couleur1; - if (goomInfo->update.stop_lines) { - goomInfo->update.stop_lines--; - if (goom_irand(goomInfo->gRandom,2)) - couleur2=couleur1 = GML_BLACK; - } - - goom_lines_switch_to (goomInfo->gmline1, mode, param1, amplitude, couleur1); - goom_lines_switch_to (goomInfo->gmline2, mode, param2, amplitude, couleur2); - } - } + /* + * Le titre + */ + if (songTitle != NULL) { + strncpy(goomInfo->update.titleText, songTitle, 1023); + goomInfo->update.titleText[1023] = 0; + goomInfo->update.timeOfTitleDisplay = 200; + } - /* - * si on est dans un goom : afficher les lignes... - */ - if ((goomInfo->update.lineMode != 0) || (goomInfo->sound.timeSinceLastGoom < 5)) { - goomInfo->gmline2->power = goomInfo->gmline1->power; - - goom_lines_draw (goomInfo, goomInfo->gmline1, data[0], goomInfo->p2); - goom_lines_draw (goomInfo, goomInfo->gmline2, data[1], goomInfo->p2); - - if (((goomInfo->cycle % 121) == 9) && (goom_irand(goomInfo->gRandom,3) == 1) - && ((goomInfo->update.lineMode == 0) || (goomInfo->update.lineMode == goomInfo->update.drawLinesDuration))) { - float param1, param2, amplitude; - int couleur1,couleur2; - int mode; - - choose_a_goom_line (goomInfo, ¶m1, ¶m2, &couleur1, - &mode, &litude, goomInfo->update.stop_lines); - couleur2 = 5-couleur1; - - if (goomInfo->update.stop_lines) { - goomInfo->update.stop_lines--; - if (goom_irand(goomInfo->gRandom,2)) - couleur2=couleur1 = GML_BLACK; - } - goom_lines_switch_to (goomInfo->gmline1, mode, param1, amplitude, couleur1); - goom_lines_switch_to (goomInfo->gmline2, mode, param2, amplitude, couleur2); - } - } + if (goomInfo->update.timeOfTitleDisplay) { + goom_draw_text( + goomInfo->p1, goomInfo->screen.width, goomInfo->screen.height, + goomInfo->screen.width / 2, goomInfo->screen.height / 2 + 7, + goomInfo->update.titleText, + ((float)(190 - goomInfo->update.timeOfTitleDisplay) / 10.0f), 1); + goomInfo->update.timeOfTitleDisplay--; + if (goomInfo->update.timeOfTitleDisplay < 4) + goom_draw_text( + goomInfo->p2, goomInfo->screen.width, goomInfo->screen.height, + goomInfo->screen.width / 2, goomInfo->screen.height / 2 + 7, + goomInfo->update.titleText, + ((float)(190 - goomInfo->update.timeOfTitleDisplay) / 10.0f), 1); + } + } + + /* + * Gestion du Scope + */ + + /* + * arret demande + */ + if ((goomInfo->update.stop_lines & 0xf000) || + (!goomInfo->curGState->drawScope)) { + float param1, param2, amplitude; + int couleur; + int mode; + + choose_a_goom_line(goomInfo, ¶m1, ¶m2, &couleur, &mode, &litude, + 1); + couleur = GML_BLACK; + + goom_lines_switch_to(goomInfo->gmline1, mode, param1, amplitude, couleur); + goom_lines_switch_to(goomInfo->gmline2, mode, param2, amplitude, couleur); + goomInfo->update.stop_lines &= 0x0fff; + } + + /* + * arret aleatore.. changement de mode de ligne.. + */ + if (goomInfo->update.lineMode != goomInfo->update.drawLinesDuration) { + goomInfo->update.lineMode--; + if (goomInfo->update.lineMode == -1) + goomInfo->update.lineMode = 0; + } else if ((goomInfo->cycle % 80 == 0) && + (goom_irand(goomInfo->gRandom, 5) == 0) && + goomInfo->update.lineMode) + goomInfo->update.lineMode--; + + if ((goomInfo->cycle % 120 == 0) && (goom_irand(goomInfo->gRandom, 4) == 0) && + (goomInfo->curGState->drawScope)) { + if (goomInfo->update.lineMode == 0) + goomInfo->update.lineMode = goomInfo->update.drawLinesDuration; + else if (goomInfo->update.lineMode == goomInfo->update.drawLinesDuration) { + float param1, param2, amplitude; + int couleur1, couleur2; + int mode; + + goomInfo->update.lineMode--; + choose_a_goom_line(goomInfo, ¶m1, ¶m2, &couleur1, &mode, + &litude, goomInfo->update.stop_lines); + + couleur2 = 5 - couleur1; + if (goomInfo->update.stop_lines) { + goomInfo->update.stop_lines--; + if (goom_irand(goomInfo->gRandom, 2)) + couleur2 = couleur1 = GML_BLACK; + } + + goom_lines_switch_to(goomInfo->gmline1, mode, param1, amplitude, + couleur1); + goom_lines_switch_to(goomInfo->gmline2, mode, param2, amplitude, + couleur2); + } + } + + /* + * si on est dans un goom : afficher les lignes... + */ + if ((goomInfo->update.lineMode != 0) || + (goomInfo->sound.timeSinceLastGoom < 5)) { + goomInfo->gmline2->power = goomInfo->gmline1->power; + + goom_lines_draw(goomInfo, goomInfo->gmline1, data[0], goomInfo->p2); + goom_lines_draw(goomInfo, goomInfo->gmline2, data[1], goomInfo->p2); + + if (((goomInfo->cycle % 121) == 9) && + (goom_irand(goomInfo->gRandom, 3) == 1) && + ((goomInfo->update.lineMode == 0) || + (goomInfo->update.lineMode == goomInfo->update.drawLinesDuration))) { + float param1, param2, amplitude; + int couleur1, couleur2; + int mode; + + choose_a_goom_line(goomInfo, ¶m1, ¶m2, &couleur1, &mode, + &litude, goomInfo->update.stop_lines); + couleur2 = 5 - couleur1; + + if (goomInfo->update.stop_lines) { + goomInfo->update.stop_lines--; + if (goom_irand(goomInfo->gRandom, 2)) + couleur2 = couleur1 = GML_BLACK; + } + goom_lines_switch_to(goomInfo->gmline1, mode, param1, amplitude, + couleur1); + goom_lines_switch_to(goomInfo->gmline2, mode, param2, amplitude, + couleur2); + } + } - return_val = goomInfo->p1; - tmp = goomInfo->p1; - goomInfo->p1 = goomInfo->p2; - goomInfo->p2 = tmp; + return_val = goomInfo->p1; + tmp = goomInfo->p1; + goomInfo->p1 = goomInfo->p2; + goomInfo->p2 = tmp; - /* affichage et swappage des buffers.. */ - goomInfo->cycle++; + /* affichage et swappage des buffers.. */ + goomInfo->cycle++; - goomInfo->convolve_fx.apply(&goomInfo->convolve_fx,return_val,goomInfo->outputBuf,goomInfo); + goomInfo->convolve_fx.apply(&goomInfo->convolve_fx, return_val, + goomInfo->outputBuf, goomInfo); - return (uint32_t*)goomInfo->outputBuf; + return (uint32_t *)goomInfo->outputBuf; } /**************************************** -* CLOSE * -****************************************/ -void goom_close (PluginInfo *goomInfo) -{ - if (goomInfo->pixel != NULL) - free (goomInfo->pixel); - if (goomInfo->back != NULL) - free (goomInfo->back); - if (goomInfo->conv != NULL) - free (goomInfo->conv); - - goomInfo->pixel = goomInfo->back = NULL; - goomInfo->conv = NULL; - goom_random_free(goomInfo->gRandom); - goom_lines_free (&goomInfo->gmline1); - goom_lines_free (&goomInfo->gmline2); - - /* release_ifs (); */ - goomInfo->ifs_fx.free(&goomInfo->ifs_fx); - goomInfo->convolve_fx.free(&goomInfo->convolve_fx); - goomInfo->star_fx.free(&goomInfo->star_fx); - goomInfo->tentacles_fx.free(&goomInfo->tentacles_fx); - goomInfo->zoomFilter_fx.free(&goomInfo->zoomFilter_fx); - - gfont_unload (); - - free(goomInfo); + * CLOSE * + ****************************************/ +void goom_close(PluginInfo *goomInfo) { + if (goomInfo->pixel != NULL) + free(goomInfo->pixel); + if (goomInfo->back != NULL) + free(goomInfo->back); + if (goomInfo->conv != NULL) + free(goomInfo->conv); + + goomInfo->pixel = goomInfo->back = NULL; + goomInfo->conv = NULL; + goom_random_free(goomInfo->gRandom); + goom_lines_free(&goomInfo->gmline1); + goom_lines_free(&goomInfo->gmline2); + + /* release_ifs (); */ + goomInfo->ifs_fx.free(&goomInfo->ifs_fx); + goomInfo->convolve_fx.free(&goomInfo->convolve_fx); + goomInfo->star_fx.free(&goomInfo->star_fx); + goomInfo->tentacles_fx.free(&goomInfo->tentacles_fx); + goomInfo->zoomFilter_fx.free(&goomInfo->zoomFilter_fx); + + gfont_unload(); + + free(goomInfo); } - /* *** */ -void -choose_a_goom_line (PluginInfo *goomInfo, float *param1, float *param2, int *couleur, int *mode, - float *amplitude, int far) -{ - *mode = goom_irand(goomInfo->gRandom,3); - *amplitude = 1.0f; - switch (*mode) { - case GML_CIRCLE: - if (far) { - *param1 = *param2 = 0.47f; - *amplitude = 0.8f; - break; - } - if (goom_irand(goomInfo->gRandom,3) == 0) { - *param1 = *param2 = 0; - *amplitude = 3.0f; - } - else if (goom_irand(goomInfo->gRandom,2)) { - *param1 = 0.40f * goomInfo->screen.height; - *param2 = 0.22f * goomInfo->screen.height; - } - else { - *param1 = *param2 = goomInfo->screen.height * 0.35; - } - break; - case GML_HLINE: - if (goom_irand(goomInfo->gRandom,4) || far) { - *param1 = goomInfo->screen.height / 7; - *param2 = 6.0f * goomInfo->screen.height / 7.0f; - } - else { - *param1 = *param2 = goomInfo->screen.height / 2.0f; - *amplitude = 2.0f; - } - break; - case GML_VLINE: - if (goom_irand(goomInfo->gRandom,3) || far) { - *param1 = goomInfo->screen.width / 7.0f; - *param2 = 6.0f * goomInfo->screen.width / 7.0f; - } - else { - *param1 = *param2 = goomInfo->screen.width / 2.0f; - *amplitude = 1.5f; - } - break; +void choose_a_goom_line(PluginInfo *goomInfo, float *param1, float *param2, + int *couleur, int *mode, float *amplitude, int far) { + *mode = goom_irand(goomInfo->gRandom, 3); + *amplitude = 1.0f; + switch (*mode) { + case GML_CIRCLE: + if (far) { + *param1 = *param2 = 0.47f; + *amplitude = 0.8f; + break; } + if (goom_irand(goomInfo->gRandom, 3) == 0) { + *param1 = *param2 = 0; + *amplitude = 3.0f; + } else if (goom_irand(goomInfo->gRandom, 2)) { + *param1 = 0.40f * goomInfo->screen.height; + *param2 = 0.22f * goomInfo->screen.height; + } else { + *param1 = *param2 = goomInfo->screen.height * 0.35; + } + break; + case GML_HLINE: + if (goom_irand(goomInfo->gRandom, 4) || far) { + *param1 = goomInfo->screen.height / 7; + *param2 = 6.0f * goomInfo->screen.height / 7.0f; + } else { + *param1 = *param2 = goomInfo->screen.height / 2.0f; + *amplitude = 2.0f; + } + break; + case GML_VLINE: + if (goom_irand(goomInfo->gRandom, 3) || far) { + *param1 = goomInfo->screen.width / 7.0f; + *param2 = 6.0f * goomInfo->screen.width / 7.0f; + } else { + *param1 = *param2 = goomInfo->screen.width / 2.0f; + *amplitude = 1.5f; + } + break; + } - *couleur = goom_irand(goomInfo->gRandom,6); + *couleur = goom_irand(goomInfo->gRandom, 6); } #define ECART_VARIATION 1.5 @@ -832,59 +869,60 @@ choose_a_goom_line (PluginInfo *goomInfo, float *param1, float *param2, int *cou /* * Met a jour l'affichage du message defilant */ -void update_message (PluginInfo *goomInfo, const char *message) { - - int fin = 0; - - if (message) { - int i=1,j=0; - sprintf (goomInfo->update_message.message, "%s", message); - for (j=0;goomInfo->update_message.message[j];j++) - if (goomInfo->update_message.message[j]=='\n') - i++; - goomInfo->update_message.numberOfLinesInMessage = i; - goomInfo->update_message.affiche = goomInfo->screen.height + goomInfo->update_message.numberOfLinesInMessage * 25 + 105; - goomInfo->update_message.longueur = strlen(goomInfo->update_message.message); - } - if (goomInfo->update_message.affiche) { - int i = 0; - char *msg = malloc(goomInfo->update_message.longueur + 1); - char *ptr = msg; - int pos; - float ecart; - message = msg; - sprintf (msg, "%s", goomInfo->update_message.message); - - while (!fin) { - while (1) { - if (*ptr == 0) { - fin = 1; - break; - } - if (*ptr == '\n') { - *ptr = 0; - break; - } - ++ptr; - } - pos = goomInfo->update_message.affiche - (goomInfo->update_message.numberOfLinesInMessage - i)*25; - pos += POS_VARIATION * (cos((double)pos / 20.0)); - pos -= SCROLLING_SPEED; - ecart = (ECART_VARIATION * sin((double)pos / 20.0)); - if ((fin) && (2 * pos < (int)goomInfo->screen.height)) - pos = (int)goomInfo->screen.height / 2; - pos += 7; - - goom_draw_text(goomInfo->p1,goomInfo->screen.width,goomInfo->screen.height, - goomInfo->screen.width/2, pos, - message, - ecart, - 1); - message = ++ptr; - i++; +void update_message(PluginInfo *goomInfo, const char *message) { + + int fin = 0; + + if (message) { + int i = 1, j = 0; + sprintf(goomInfo->update_message.message, "%s", message); + for (j = 0; goomInfo->update_message.message[j]; j++) + if (goomInfo->update_message.message[j] == '\n') + i++; + goomInfo->update_message.numberOfLinesInMessage = i; + goomInfo->update_message.affiche = + goomInfo->screen.height + + goomInfo->update_message.numberOfLinesInMessage * 25 + 105; + goomInfo->update_message.longueur = + strlen(goomInfo->update_message.message); + } + if (goomInfo->update_message.affiche) { + int i = 0; + char *msg = malloc(goomInfo->update_message.longueur + 1); + char *ptr = msg; + int pos; + float ecart; + message = msg; + sprintf(msg, "%s", goomInfo->update_message.message); + + while (!fin) { + while (1) { + if (*ptr == 0) { + fin = 1; + break; + } + if (*ptr == '\n') { + *ptr = 0; + break; } - goomInfo->update_message.affiche --; - free (msg); + ++ptr; + } + pos = goomInfo->update_message.affiche - + (goomInfo->update_message.numberOfLinesInMessage - i) * 25; + pos += POS_VARIATION * (cos((double)pos / 20.0)); + pos -= SCROLLING_SPEED; + ecart = (ECART_VARIATION * sin((double)pos / 20.0)); + if ((fin) && (2 * pos < (int)goomInfo->screen.height)) + pos = (int)goomInfo->screen.height / 2; + pos += 7; + + goom_draw_text(goomInfo->p1, goomInfo->screen.width, + goomInfo->screen.height, goomInfo->screen.width / 2, pos, + message, ecart, 1); + message = ++ptr; + i++; } + goomInfo->update_message.affiche--; + free(msg); + } } - diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_filters.h b/libvisual-plugins/plugins/actor/goom2k4/goom_filters.h index 808b92102..6c398ff72 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_filters.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_filters.h @@ -8,23 +8,22 @@ VisualFX zoomFilterVisualFXWrapper_create(void); -struct _ZOOM_FILTER_DATA -{ - int vitesse; /* 128 = vitesse nule... * * 256 = en arriere - * hyper vite.. * * 0 = en avant hype vite. */ - unsigned char pertedec; - unsigned char sqrtperte; - int middleX, middleY; /* milieu de l'effet */ - char reverse; /* inverse la vitesse */ - char mode; /* type d'effet � appliquer (cf les #define) */ - /** @since June 2001 */ - int hPlaneEffect; /* deviation horitontale */ - int vPlaneEffect; /* deviation verticale */ - /** @since April 2002 */ - int waveEffect; /* applique une "surcouche" de wave effect */ - int hypercosEffect; /* applique une "surcouche de hypercos effect */ - - char noisify; /* ajoute un bruit a la transformation */ +struct _ZOOM_FILTER_DATA { + int vitesse; /* 128 = vitesse nule... * * 256 = en arriere + * hyper vite.. * * 0 = en avant hype vite. */ + unsigned char pertedec; + unsigned char sqrtperte; + int middleX, middleY; /* milieu de l'effet */ + char reverse; /* inverse la vitesse */ + char mode; /* type d'effet � appliquer (cf les #define) */ + /** @since June 2001 */ + int hPlaneEffect; /* deviation horitontale */ + int vPlaneEffect; /* deviation verticale */ + /** @since April 2002 */ + int waveEffect; /* applique une "surcouche" de wave effect */ + int hypercosEffect; /* applique une "surcouche de hypercos effect */ + + char noisify; /* ajoute un bruit a la transformation */ }; #define NORMAL_MODE 0 @@ -38,15 +37,16 @@ struct _ZOOM_FILTER_DATA #define YONLY_MODE 8 #define SPEEDWAY_MODE 9 -void pointFilter (PluginInfo *goomInfo, Pixel * pix1, Color c, - float t1, float t2, float t3, float t4, uint32_t cycle); +void pointFilter(PluginInfo *goomInfo, Pixel *pix1, Color c, float t1, float t2, + float t3, float t4, uint32_t cycle); /* filtre de zoom : * le contenu de pix1 est copie dans pix2. * zf : si non NULL, configure l'effet. * resx,resy : taille des buffers. */ -void zoomFilterFastRGB (PluginInfo *goomInfo, Pixel * pix1, Pixel * pix2, ZoomFilterData * zf, uint32_t resx, - uint32_t resy, int switchIncr, float switchMult); +void zoomFilterFastRGB(PluginInfo *goomInfo, Pixel *pix1, Pixel *pix2, + ZoomFilterData *zf, uint32_t resx, uint32_t resy, + int switchIncr, float switchMult); #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_fx.h b/libvisual-plugins/plugins/actor/goom2k4/goom_fx.h index 5597b35b5..f5aa85033 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_fx.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_fx.h @@ -4,9 +4,10 @@ #include "goom_visual_fx.h" #include "goom_plugin_info.h" -VisualFX convolve_create (void); -VisualFX flying_star_create (void); +VisualFX convolve_create(void); +VisualFX flying_star_create(void); -void zoom_filter_c(int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); +void zoom_filter_c(int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, + int *brutD, int buffratio, int precalCoef[16][16]); #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_graphic.h b/libvisual-plugins/plugins/actor/goom2k4/goom_graphic.h index 9deaf5a91..31597dd48 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_graphic.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_graphic.h @@ -3,11 +3,9 @@ typedef unsigned int Uint; -typedef struct -{ +typedef struct { unsigned short r, v, b; -} -Color; +} Color; extern const Color BLACK; extern const Color WHITE; @@ -18,17 +16,16 @@ extern const Color YELLOW; extern const Color ORANGE; extern const Color VIOLET; - #ifdef COLOR_BGRA #define B_CHANNEL 0xFF000000 #define G_CHANNEL 0x00FF0000 #define R_CHANNEL 0x0000FF00 #define A_CHANNEL 0x000000FF -#define B_OFFSET 24 -#define G_OFFSET 16 -#define R_OFFSET 8 -#define A_OFFSET 0 +#define B_OFFSET 24 +#define G_OFFSET 16 +#define R_OFFSET 8 +#define A_OFFSET 0 typedef union _PIXEL { struct { @@ -47,10 +44,10 @@ typedef union _PIXEL { #define R_CHANNEL 0x00FF0000 #define G_CHANNEL 0x0000FF00 #define B_CHANNEL 0x000000FF -#define A_OFFSET 24 -#define R_OFFSET 16 -#define G_OFFSET 8 -#define B_OFFSET 0 +#define A_OFFSET 24 +#define R_OFFSET 16 +#define G_OFFSET 8 +#define B_OFFSET 0 typedef union _PIXEL { struct { @@ -70,5 +67,4 @@ inline void setPixelRGB (Pixel * buffer, Uint x, Uint y, Color c); inline void getPixelRGB (Pixel * buffer, Uint x, Uint y, Color * c); */ - #endif /* GRAPHIC_H */ diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_hash.c b/libvisual-plugins/plugins/actor/goom2k4/goom_hash.c index f21a6d6c3..62b39f5d6 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_hash.c +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_hash.c @@ -4,97 +4,93 @@ static GoomHashEntry *entry_new(const char *key, HashValue value) { - GoomHashEntry *entry = (GoomHashEntry*)malloc(sizeof(GoomHashEntry)); + GoomHashEntry *entry = (GoomHashEntry *)malloc(sizeof(GoomHashEntry)); - entry->key = (char *)malloc(strlen(key)+1); - strcpy(entry->key,key); - entry->value = value; - entry->lower = NULL; - entry->upper = NULL; + entry->key = (char *)malloc(strlen(key) + 1); + strcpy(entry->key, key); + entry->value = value; + entry->lower = NULL; + entry->upper = NULL; - return entry; + return entry; } static void entry_free(GoomHashEntry *entry) { - if (entry!=NULL) { - entry_free(entry->lower); - entry_free(entry->upper); - free(entry->key); - free(entry); - } + if (entry != NULL) { + entry_free(entry->lower); + entry_free(entry->upper); + free(entry->key); + free(entry); + } } static void entry_put(GoomHashEntry *entry, const char *key, HashValue value) { - int cmp = strcmp(key,entry->key); - if (cmp==0) { - entry->value = value; - } - else if (cmp > 0) { - if (entry->upper == NULL) - entry->upper = entry_new(key,value); - else - entry_put(entry->upper, key, value); - } - else { - if (entry->lower == NULL) - entry->lower = entry_new(key,value); - else - entry_put(entry->lower, key, value); - } + int cmp = strcmp(key, entry->key); + if (cmp == 0) { + entry->value = value; + } else if (cmp > 0) { + if (entry->upper == NULL) + entry->upper = entry_new(key, value); + else + entry_put(entry->upper, key, value); + } else { + if (entry->lower == NULL) + entry->lower = entry_new(key, value); + else + entry_put(entry->lower, key, value); + } } static HashValue *entry_get(GoomHashEntry *entry, const char *key) { - int cmp; - if (entry==NULL) - return NULL; - cmp = strcmp(key,entry->key); - if (cmp > 0) - return entry_get(entry->upper, key); - else if (cmp < 0) - return entry_get(entry->lower, key); - else - return &(entry->value); + int cmp; + if (entry == NULL) + return NULL; + cmp = strcmp(key, entry->key); + if (cmp > 0) + return entry_get(entry->upper, key); + else if (cmp < 0) + return entry_get(entry->lower, key); + else + return &(entry->value); } GoomHash *goom_hash_new(void) { - GoomHash *_this = (GoomHash*)malloc(sizeof(GoomHash)); - _this->root = NULL; - return _this; + GoomHash *_this = (GoomHash *)malloc(sizeof(GoomHash)); + _this->root = NULL; + return _this; } void goom_hash_free(GoomHash *_this) { - entry_free(_this->root); - free(_this); + entry_free(_this->root); + free(_this); } void goom_hash_put(GoomHash *_this, const char *key, HashValue value) { - if (_this->root == NULL) - _this->root = entry_new(key,value); - else - entry_put(_this->root,key,value); + if (_this->root == NULL) + _this->root = entry_new(key, value); + else + entry_put(_this->root, key, value); } HashValue *goom_hash_get(GoomHash *_this, const char *key) { - return entry_get(_this->root,key); + return entry_get(_this->root, key); } void goom_hash_put_int(GoomHash *_this, const char *key, int i) { - HashValue value; - value.i = i; - goom_hash_put(_this,key,value); + HashValue value; + value.i = i; + goom_hash_put(_this, key, value); } void goom_hash_put_float(GoomHash *_this, const char *key, float f) { - HashValue value; - value.f = f; - goom_hash_put(_this,key,value); + HashValue value; + value.f = f; + goom_hash_put(_this, key, value); } void goom_hash_put_ptr(GoomHash *_this, const char *key, void *ptr) { - HashValue value; - value.ptr = ptr; - goom_hash_put(_this,key,value); + HashValue value; + value.ptr = ptr; + goom_hash_put(_this, key, value); } - - diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_hash.h b/libvisual-plugins/plugins/actor/goom2k4/goom_hash.h index c8eae37ed..4b8b91704 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_hash.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_hash.h @@ -5,20 +5,20 @@ typedef struct GOOM_HASH_ENTRY GoomHashEntry; typedef struct GOOM_HASH GoomHash; typedef union { - void *ptr; - int i; - float f; + void *ptr; + int i; + float f; } HashValue; struct GOOM_HASH_ENTRY { - char *key; - HashValue value; - GoomHashEntry *lower; - GoomHashEntry *upper; + char *key; + HashValue value; + GoomHashEntry *lower; + GoomHashEntry *upper; }; struct GOOM_HASH { - GoomHashEntry *root; + GoomHashEntry *root; }; GoomHash *goom_hash_new(void); diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_plugin_info.h b/libvisual-plugins/plugins/actor/goom2k4/goom_plugin_info.h index d74749a1a..cd50a006c 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_plugin_info.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_plugin_info.h @@ -13,15 +13,15 @@ #include "goomsl.h" typedef struct { - char drawIFS; - char drawPoints; - char drawTentacle; + char drawIFS; + char drawPoints; + char drawTentacle; - char drawScope; - int farScope; + char drawScope; + int farScope; - int rangemin; - int rangemax; + int rangemin; + int rangemax; } GoomState; #define STATES_MAX_NB 128 @@ -31,144 +31,148 @@ typedef struct { */ struct _SOUND_INFO { - /* nota : a Goom is just a sound event... */ + /* nota : a Goom is just a sound event... */ - int timeSinceLastGoom; /* >= 0 */ - float goomPower; /* power of the last Goom [0..1] */ + int timeSinceLastGoom; /* >= 0 */ + float goomPower; /* power of the last Goom [0..1] */ - int timeSinceLastBigGoom; /* >= 0 */ + int timeSinceLastBigGoom; /* >= 0 */ - float volume; /* [0..1] */ - short samples[2][512]; + float volume; /* [0..1] */ + short samples[2][512]; - /* other "internal" datas for the sound_tester */ - float goom_limit; /* auto-updated limit of goom_detection */ - float bigGoomLimit; - float accelvar; /* acceleration of the sound - [0..1] */ - float speedvar; /* speed of the sound - [0..100] */ - int allTimesMax; - int totalgoom; /* number of goom since last reset - * (a reset every 64 cycles) */ + /* other "internal" datas for the sound_tester */ + float goom_limit; /* auto-updated limit of goom_detection */ + float bigGoomLimit; + float accelvar; /* acceleration of the sound - [0..1] */ + float speedvar; /* speed of the sound - [0..100] */ + int allTimesMax; + int totalgoom; /* number of goom since last reset + * (a reset every 64 cycles) */ - float prov_max; /* accel max since last reset */ + float prov_max; /* accel max since last reset */ - int cycle; + int cycle; - /* private */ - PluginParam volume_p; - PluginParam speed_p; - PluginParam accel_p; - PluginParam goom_limit_p; - PluginParam goom_power_p; - PluginParam last_goom_p; - PluginParam last_biggoom_p; - PluginParam biggoom_speed_limit_p; - PluginParam biggoom_factor_p; + /* private */ + PluginParam volume_p; + PluginParam speed_p; + PluginParam accel_p; + PluginParam goom_limit_p; + PluginParam goom_power_p; + PluginParam last_goom_p; + PluginParam last_biggoom_p; + PluginParam biggoom_speed_limit_p; + PluginParam biggoom_factor_p; - PluginParameters params; /* contains the previously defined parameters. */ + PluginParameters params; /* contains the previously defined parameters. */ }; - /** * Allows FXs to know the current state of the plugin. */ struct _PLUGIN_INFO { - /* public datas */ + /* public datas */ - int nbParams; - PluginParameters *params; + int nbParams; + PluginParameters *params; - /* private datas */ + /* private datas */ - struct _SIZE_TYPE { - int width; - int height; - int size; /* == screen.height * screen.width. */ - } screen; + struct _SIZE_TYPE { + int width; + int height; + int size; /* == screen.height * screen.width. */ + } screen; - SoundInfo sound; + SoundInfo sound; - int nbVisuals; - VisualFX **visuals; /* pointers on all the visual fx */ + int nbVisuals; + VisualFX **visuals; /* pointers on all the visual fx */ - /** The known FX */ - VisualFX convolve_fx; - VisualFX star_fx; - VisualFX zoomFilter_fx; - VisualFX tentacles_fx; - VisualFX ifs_fx; + /** The known FX */ + VisualFX convolve_fx; + VisualFX star_fx; + VisualFX zoomFilter_fx; + VisualFX tentacles_fx; + VisualFX ifs_fx; - /** image buffers */ - uint32_t *pixel; - uint32_t *back; - Pixel *p1, *p2; - Pixel *conv; + /** image buffers */ + uint32_t *pixel; + uint32_t *back; + Pixel *p1, *p2; + Pixel *conv; Pixel *outputBuf; - /** state of goom */ - uint32_t cycle; - GoomState states[STATES_MAX_NB]; - int statesNumber; - int statesRangeMax; - - GoomState *curGState; - - /** effet de ligne.. */ - GMLine *gmline1; - GMLine *gmline2; - - /** sinus table */ - int sintable[0x10000]; - - /* INTERNALS */ - - /** goom_update internals. - * I took all static variables from goom_update and put them here.. for the moment. - */ - struct { - int lockvar; /* pour empecher de nouveaux changements */ - int goomvar; /* boucle des gooms */ - int loopvar; /* mouvement des points */ - int stop_lines; - int ifs_incr; /* dessiner l'ifs (0 = non: > = increment) */ - int decay_ifs; /* disparition de l'ifs */ - int recay_ifs; /* dedisparition de l'ifs */ - int cyclesSinceLastChange; /* nombre de Cycle Depuis Dernier Changement */ - int drawLinesDuration; /* duree de la transition entre afficher les lignes ou pas */ - int lineMode; /* l'effet lineaire a dessiner */ - float switchMultAmount; /* SWITCHMULT (29.0f/30.0f) */ - int switchIncrAmount; /* 0x7f */ - float switchMult; /* 1.0f */ - int switchIncr; /* = SWITCHINCR; */ - int stateSelectionRnd; - int stateSelectionBlocker; - int previousZoomSpeed; - int timeOfTitleDisplay; - char titleText[1024]; - ZoomFilterData zoomFilterData; - } update; - - struct { - int numberOfLinesInMessage; - char message[0x800]; - int affiche; - int longueur; - } update_message; - - struct { - void (*draw_line) (Pixel *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny); - void (*zoom_filter) (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); - } methods; - - GoomRandom *gRandom; - - GoomSL *scanner; - GoomSL *main_scanner; - const char *main_script_str; + /** state of goom */ + uint32_t cycle; + GoomState states[STATES_MAX_NB]; + int statesNumber; + int statesRangeMax; + + GoomState *curGState; + + /** effet de ligne.. */ + GMLine *gmline1; + GMLine *gmline2; + + /** sinus table */ + int sintable[0x10000]; + + /* INTERNALS */ + + /** goom_update internals. + * I took all static variables from goom_update and put them here.. for the + * moment. + */ + struct { + int lockvar; /* pour empecher de nouveaux changements */ + int goomvar; /* boucle des gooms */ + int loopvar; /* mouvement des points */ + int stop_lines; + int ifs_incr; /* dessiner l'ifs (0 = non: > = increment) */ + int decay_ifs; /* disparition de l'ifs */ + int recay_ifs; /* dedisparition de l'ifs */ + int cyclesSinceLastChange; /* nombre de Cycle Depuis Dernier Changement */ + int drawLinesDuration; /* duree de la transition entre afficher les lignes + ou pas */ + int lineMode; /* l'effet lineaire a dessiner */ + float switchMultAmount; /* SWITCHMULT (29.0f/30.0f) */ + int switchIncrAmount; /* 0x7f */ + float switchMult; /* 1.0f */ + int switchIncr; /* = SWITCHINCR; */ + int stateSelectionRnd; + int stateSelectionBlocker; + int previousZoomSpeed; + int timeOfTitleDisplay; + char titleText[1024]; + ZoomFilterData zoomFilterData; + } update; + + struct { + int numberOfLinesInMessage; + char message[0x800]; + int affiche; + int longueur; + } update_message; + + struct { + void (*draw_line)(Pixel *data, int x1, int y1, int x2, int y2, int col, + int screenx, int screeny); + void (*zoom_filter)(int sizeX, int sizeY, Pixel *src, Pixel *dest, + int *brutS, int *brutD, int buffratio, + int precalCoef[16][16]); + } methods; + + GoomRandom *gRandom; + + GoomSL *scanner; + GoomSL *main_scanner; + const char *main_script_str; }; -void plugin_info_init(PluginInfo *p, int nbVisual); +void plugin_info_init(PluginInfo *p, int nbVisual); /* i = [0..p->nbVisual-1] */ void plugin_info_add_visual(PluginInfo *p, int i, VisualFX *visual); diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_tools.c b/libvisual-plugins/plugins/actor/goom2k4/goom_tools.c index 9a1874189..5f8b858f5 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_tools.c +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_tools.c @@ -3,19 +3,17 @@ #include GoomRandom *goom_random_init(int i) { - GoomRandom *grandom = (GoomRandom*)malloc(sizeof(GoomRandom)); - grandom->pos = 1; - goom_random_update_array(grandom, GOOM_NB_RAND); - return grandom; + GoomRandom *grandom = (GoomRandom *)malloc(sizeof(GoomRandom)); + grandom->pos = 1; + goom_random_update_array(grandom, GOOM_NB_RAND); + return grandom; } -void goom_random_free(GoomRandom *grandom) { - free(grandom); -} +void goom_random_free(GoomRandom *grandom) { free(grandom); } void goom_random_update_array(GoomRandom *grandom, int numberOfValuesToChange) { - while (numberOfValuesToChange > 0) { - grandom->array[grandom->pos++] = visual_rand() / 127; - numberOfValuesToChange--; - } + while (numberOfValuesToChange > 0) { + grandom->array[grandom->pos++] = visual_rand() / 127; + numberOfValuesToChange--; + } } diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_tools.h b/libvisual-plugins/plugins/actor/goom2k4/goom_tools.h index 31d044e4a..66b4f44c9 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_tools.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_tools.h @@ -8,26 +8,27 @@ #define GOOM_NB_RAND 0x10000 typedef struct _GOOM_RANDOM { - int array[GOOM_NB_RAND]; - unsigned short pos; + int array[GOOM_NB_RAND]; + unsigned short pos; } GoomRandom; GoomRandom *goom_random_init(int i); void goom_random_free(GoomRandom *grandom); inline static int goom_random(GoomRandom *grandom) { - - grandom->pos++; /* works because pos is an unsigned short */ - return grandom->array[grandom->pos]; + + grandom->pos++; /* works because pos is an unsigned short */ + return grandom->array[grandom->pos]; } inline static int goom_irand(GoomRandom *grandom, int i) { - grandom->pos++; - return grandom->array[grandom->pos] % i; + grandom->pos++; + return grandom->array[grandom->pos] % i; } -/* called to change the specified number of value in the array, so that the array does not remain the same*/ +/* called to change the specified number of value in the array, so that the + * array does not remain the same*/ void goom_random_update_array(GoomRandom *grandom, int numberOfValuesToChange); #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/goom_visual_fx.h b/libvisual-plugins/plugins/actor/goom2k4/goom_visual_fx.h index 6939ac804..52e7d2ef8 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goom_visual_fx.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goom_visual_fx.h @@ -15,9 +15,10 @@ #include "goom_typedefs.h" struct _VISUAL_FX { - void (*init) (struct _VISUAL_FX *_this, PluginInfo *info); - void (*free) (struct _VISUAL_FX *_this); - void (*apply) (struct _VISUAL_FX *_this, Pixel *src, Pixel *dest, PluginInfo *info); + void (*init)(struct _VISUAL_FX *_this, PluginInfo *info); + void (*free)(struct _VISUAL_FX *_this); + void (*apply)(struct _VISUAL_FX *_this, Pixel *src, Pixel *dest, + PluginInfo *info); void *fx_data; PluginParameters *params; diff --git a/libvisual-plugins/plugins/actor/goom2k4/goomsl.c b/libvisual-plugins/plugins/actor/goom2k4/goomsl.c index 8584f694f..c3ae01e4f 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goomsl.c +++ b/libvisual-plugins/plugins/actor/goom2k4/goomsl.c @@ -8,57 +8,57 @@ /*#define TRACE_SCRIPT*/ - /* {{{ definition of the instructions number */ -#define INSTR_SETI_VAR_INTEGER 1 -#define INSTR_SETI_VAR_VAR 2 -#define INSTR_SETF_VAR_FLOAT 3 -#define INSTR_SETF_VAR_VAR 4 -#define INSTR_NOP 5 +/* {{{ definition of the instructions number */ +#define INSTR_SETI_VAR_INTEGER 1 +#define INSTR_SETI_VAR_VAR 2 +#define INSTR_SETF_VAR_FLOAT 3 +#define INSTR_SETF_VAR_VAR 4 +#define INSTR_NOP 5 /* #define INSTR_JUMP 6 */ -#define INSTR_SETP_VAR_PTR 7 -#define INSTR_SETP_VAR_VAR 8 -#define INSTR_SUBI_VAR_INTEGER 9 -#define INSTR_SUBI_VAR_VAR 10 -#define INSTR_SUBF_VAR_FLOAT 11 -#define INSTR_SUBF_VAR_VAR 12 -#define INSTR_ISLOWERF_VAR_VAR 13 -#define INSTR_ISLOWERF_VAR_FLOAT 14 -#define INSTR_ISLOWERI_VAR_VAR 15 +#define INSTR_SETP_VAR_PTR 7 +#define INSTR_SETP_VAR_VAR 8 +#define INSTR_SUBI_VAR_INTEGER 9 +#define INSTR_SUBI_VAR_VAR 10 +#define INSTR_SUBF_VAR_FLOAT 11 +#define INSTR_SUBF_VAR_VAR 12 +#define INSTR_ISLOWERF_VAR_VAR 13 +#define INSTR_ISLOWERF_VAR_FLOAT 14 +#define INSTR_ISLOWERI_VAR_VAR 15 #define INSTR_ISLOWERI_VAR_INTEGER 16 -#define INSTR_ADDI_VAR_INTEGER 17 -#define INSTR_ADDI_VAR_VAR 18 -#define INSTR_ADDF_VAR_FLOAT 19 -#define INSTR_ADDF_VAR_VAR 20 -#define INSTR_MULI_VAR_INTEGER 21 -#define INSTR_MULI_VAR_VAR 22 -#define INSTR_MULF_VAR_FLOAT 23 -#define INSTR_MULF_VAR_VAR 24 -#define INSTR_DIVI_VAR_INTEGER 25 -#define INSTR_DIVI_VAR_VAR 26 -#define INSTR_DIVF_VAR_FLOAT 27 -#define INSTR_DIVF_VAR_VAR 28 +#define INSTR_ADDI_VAR_INTEGER 17 +#define INSTR_ADDI_VAR_VAR 18 +#define INSTR_ADDF_VAR_FLOAT 19 +#define INSTR_ADDF_VAR_VAR 20 +#define INSTR_MULI_VAR_INTEGER 21 +#define INSTR_MULI_VAR_VAR 22 +#define INSTR_MULF_VAR_FLOAT 23 +#define INSTR_MULF_VAR_VAR 24 +#define INSTR_DIVI_VAR_INTEGER 25 +#define INSTR_DIVI_VAR_VAR 26 +#define INSTR_DIVF_VAR_FLOAT 27 +#define INSTR_DIVF_VAR_VAR 28 /* #define INSTR_JZERO 29 */ -#define INSTR_ISEQUALP_VAR_VAR 30 -#define INSTR_ISEQUALP_VAR_PTR 31 -#define INSTR_ISEQUALI_VAR_VAR 32 +#define INSTR_ISEQUALP_VAR_VAR 30 +#define INSTR_ISEQUALP_VAR_PTR 31 +#define INSTR_ISEQUALI_VAR_VAR 32 #define INSTR_ISEQUALI_VAR_INTEGER 33 -#define INSTR_ISEQUALF_VAR_VAR 34 -#define INSTR_ISEQUALF_VAR_FLOAT 35 +#define INSTR_ISEQUALF_VAR_VAR 34 +#define INSTR_ISEQUALF_VAR_FLOAT 35 /* #define INSTR_CALL 36 */ /* #define INSTR_RET 37 */ /* #define INSTR_EXT_CALL 38 */ -#define INSTR_NOT_VAR 39 +#define INSTR_NOT_VAR 39 /* #define INSTR_JNZERO 40 */ -#define INSTR_SETS_VAR_VAR 41 -#define INSTR_ISEQUALS_VAR_VAR 42 -#define INSTR_ADDS_VAR_VAR 43 -#define INSTR_SUBS_VAR_VAR 44 -#define INSTR_MULS_VAR_VAR 45 -#define INSTR_DIVS_VAR_VAR 46 - - /* }}} */ +#define INSTR_SETS_VAR_VAR 41 +#define INSTR_ISEQUALS_VAR_VAR 42 +#define INSTR_ADDS_VAR_VAR 43 +#define INSTR_SUBS_VAR_VAR 44 +#define INSTR_MULS_VAR_VAR 45 +#define INSTR_DIVS_VAR_VAR 46 + +/* }}} */ /* {{{ definition of the validation error types */ -static const char *VALIDATE_OK = "ok"; +static const char *VALIDATE_OK = "ok"; #define VALIDATE_ERROR "error while validating " #define VALIDATE_TODO "todo" #define VALIDATE_SYNTHAX_ERROR "synthax error" @@ -68,8 +68,8 @@ static const char *VALIDATE_OK = "ok"; #define VALIDATE_NO_SUCH_SRC_VAR "no such src variable" /* }}} */ - /***********************************/ - /* PROTOTYPE OF INTERNAL FUNCTIONS */ +/***********************************/ +/* PROTOTYPE OF INTERNAL FUNCTIONS */ /***********************************/ /* {{{ */ @@ -84,65 +84,61 @@ static void iflow_free(InstructionFlow *_this); static void iflow_execute(FastInstructionFlow *_this, GoomSL *gsl); /* }}} */ - /************************************/ - /* DEFINITION OF INTERNAL FUNCTIONS */ +/************************************/ +/* DEFINITION OF INTERNAL FUNCTIONS */ /************************************/ -void iflow_free(InstructionFlow *_this) -{ /* {{{ */ +void iflow_free(InstructionFlow *_this) { /* {{{ */ goom_hash_free(_this->labels); free(_this); /*TODO: finir cette fonction */ } /* }}} */ -void iflow_clean(InstructionFlow *_this) -{ /* {{{ */ +void iflow_clean(InstructionFlow *_this) { /* {{{ */ /* TODO: clean chaque instruction du flot */ _this->number = 0; goom_hash_free(_this->labels); _this->labels = goom_hash_new(); } /* }}} */ -InstructionFlow *iflow_new(void) -{ /* {{{ */ - InstructionFlow *_this = (InstructionFlow*)malloc(sizeof(InstructionFlow)); +InstructionFlow *iflow_new(void) { /* {{{ */ + InstructionFlow *_this = (InstructionFlow *)malloc(sizeof(InstructionFlow)); _this->number = 0; _this->tabsize = 6; - _this->instr = (Instruction**)malloc(_this->tabsize * sizeof(Instruction*)); + _this->instr = (Instruction **)malloc(_this->tabsize * sizeof(Instruction *)); _this->labels = goom_hash_new(); return _this; } /* }}} */ -void iflow_add_instr(InstructionFlow *_this, Instruction *instr) -{ /* {{{ */ +void iflow_add_instr(InstructionFlow *_this, Instruction *instr) { /* {{{ */ if (_this->number == _this->tabsize) { _this->tabsize *= 2; - _this->instr = (Instruction**)realloc(_this->instr, _this->tabsize * sizeof(Instruction*)); + _this->instr = (Instruction **)realloc( + _this->instr, _this->tabsize * sizeof(Instruction *)); } _this->instr[_this->number] = instr; instr->address = _this->number; _this->number++; } /* }}} */ -void gsl_instr_set_namespace(Instruction *_this, GoomHash *ns) -{ /* {{{ */ +void gsl_instr_set_namespace(Instruction *_this, GoomHash *ns) { /* {{{ */ if (_this->cur_param <= 0) { - fprintf(stderr, "ERROR: Line %d, No more params to instructions\n", _this->line_number); + fprintf(stderr, "ERROR: Line %d, No more params to instructions\n", + _this->line_number); exit(1); } - _this->vnamespace[_this->cur_param-1] = ns; + _this->vnamespace[_this->cur_param - 1] = ns; } /* }}} */ -void gsl_instr_add_param(Instruction *instr, char *param, int type) -{ /* {{{ */ +void gsl_instr_add_param(Instruction *instr, char *param, int type) { /* {{{ */ int len; - if (instr==NULL) + if (instr == NULL) return; - if (instr->cur_param==0) + if (instr->cur_param == 0) return; --instr->cur_param; len = strlen(param); - instr->params[instr->cur_param] = (char*)malloc(len+1); + instr->params[instr->cur_param] = (char *)malloc(len + 1); strcpy(instr->params[instr->cur_param], param); instr->types[instr->cur_param] = type; if (instr->cur_param == 0) { @@ -167,12 +163,12 @@ void gsl_instr_add_param(Instruction *instr, char *param, int type) } } /* }}} */ -Instruction *gsl_instr_init(GoomSL *parent, const char *name, int id, int nb_param, int line_number) -{ /* {{{ */ - Instruction *instr = (Instruction*)malloc(sizeof(Instruction)); - instr->params = (char**)malloc(nb_param*sizeof(char*)); - instr->vnamespace = (GoomHash**)malloc(nb_param*sizeof(GoomHash*)); - instr->types = (int*)malloc(nb_param*sizeof(int)); +Instruction *gsl_instr_init(GoomSL *parent, const char *name, int id, + int nb_param, int line_number) { /* {{{ */ + Instruction *instr = (Instruction *)malloc(sizeof(Instruction)); + instr->params = (char **)malloc(nb_param * sizeof(char *)); + instr->vnamespace = (GoomHash **)malloc(nb_param * sizeof(GoomHash *)); + instr->types = (int *)malloc(nb_param * sizeof(int)); instr->cur_param = instr->nb_param = nb_param; instr->parent = parent; instr->id = id; @@ -182,34 +178,31 @@ Instruction *gsl_instr_init(GoomSL *parent, const char *name, int id, int nb_par return instr; } /* }}} */ -void gsl_instr_free(Instruction *_this) -{ /* {{{ */ +void gsl_instr_free(Instruction *_this) { /* {{{ */ int i; free(_this->types); - for (i=_this->cur_param; i<_this->nb_param; ++i) + for (i = _this->cur_param; i < _this->nb_param; ++i) free(_this->params[i]); free(_this->params); free(_this); } /* }}} */ -void gsl_instr_display(Instruction *_this) -{ /* {{{ */ - int i=_this->nb_param-1; +void gsl_instr_display(Instruction *_this) { /* {{{ */ + int i = _this->nb_param - 1; printf("%s", _this->name); - while(i>=_this->cur_param) { + while (i >= _this->cur_param) { printf(" %s", _this->params[i]); --i; } } /* }}} */ - /****************************************/ - /* VALIDATION OF INSTRUCTION PARAMETERS */ +/****************************************/ +/* VALIDATION OF INSTRUCTION PARAMETERS */ /****************************************/ -static const char *validate_v_v(Instruction *_this) -{ /* {{{ */ +static const char *validate_v_v(Instruction *_this) { /* {{{ */ HashValue *dest = goom_hash_get(_this->vnamespace[1], _this->params[1]); - HashValue *src = goom_hash_get(_this->vnamespace[0], _this->params[0]); + HashValue *src = goom_hash_get(_this->vnamespace[0], _this->params[0]); if (dest == NULL) { return VALIDATE_NO_SUCH_DEST_VAR; @@ -218,14 +211,13 @@ static const char *validate_v_v(Instruction *_this) return VALIDATE_NO_SUCH_SRC_VAR; } _this->data.udest.var = dest->ptr; - _this->data.usrc.var = src->ptr; + _this->data.usrc.var = src->ptr; return VALIDATE_OK; } /* }}} */ -static const char *validate_v_i(Instruction *_this) -{ /* {{{ */ - HashValue *dest = goom_hash_get(_this->vnamespace[1], _this->params[1]); - _this->data.usrc.value_int = strtol(_this->params[0],NULL,0); +static const char *validate_v_i(Instruction *_this) { /* {{{ */ + HashValue *dest = goom_hash_get(_this->vnamespace[1], _this->params[1]); + _this->data.usrc.value_int = strtol(_this->params[0], NULL, 0); if (dest == NULL) { return VALIDATE_NO_SUCH_INT; @@ -234,10 +226,9 @@ static const char *validate_v_i(Instruction *_this) return VALIDATE_OK; } /* }}} */ -static const char *validate_v_p(Instruction *_this) -{ /* {{{ */ - HashValue *dest = goom_hash_get(_this->vnamespace[1], _this->params[1]); - _this->data.usrc.value_ptr = strtol(_this->params[0],NULL,0); +static const char *validate_v_p(Instruction *_this) { /* {{{ */ + HashValue *dest = goom_hash_get(_this->vnamespace[1], _this->params[1]); + _this->data.usrc.value_ptr = strtol(_this->params[0], NULL, 0); if (dest == NULL) { return VALIDATE_NO_SUCH_INT; @@ -246,9 +237,8 @@ static const char *validate_v_p(Instruction *_this) return VALIDATE_OK; } /* }}} */ -static const char *validate_v_f(Instruction *_this) -{ /* {{{ */ - HashValue *dest = goom_hash_get(_this->vnamespace[1], _this->params[1]); +static const char *validate_v_f(Instruction *_this) { /* {{{ */ + HashValue *dest = goom_hash_get(_this->vnamespace[1], _this->params[1]); _this->data.usrc.value_float = atof(_this->params[0]); if (dest == NULL) { @@ -258,52 +248,46 @@ static const char *validate_v_f(Instruction *_this) return VALIDATE_OK; } /* }}} */ -static const char *validate(Instruction *_this, - int vf_f_id, int vf_v_id, - int vi_i_id, int vi_v_id, - int vp_p_id, int vp_v_id, - int vs_v_id) -{ /* {{{ */ +static const char *validate(Instruction *_this, int vf_f_id, int vf_v_id, + int vi_i_id, int vi_v_id, int vp_p_id, int vp_v_id, + int vs_v_id) { /* {{{ */ if ((_this->types[1] == TYPE_FVAR) && (_this->types[0] == TYPE_FLOAT)) { _this->id = vf_f_id; return validate_v_f(_this); - } - else if ((_this->types[1] == TYPE_FVAR) && (_this->types[0] == TYPE_FVAR)) { + } else if ((_this->types[1] == TYPE_FVAR) && (_this->types[0] == TYPE_FVAR)) { _this->id = vf_v_id; return validate_v_v(_this); - } - else if ((_this->types[1] == TYPE_IVAR) && (_this->types[0] == TYPE_INTEGER)) { + } else if ((_this->types[1] == TYPE_IVAR) && + (_this->types[0] == TYPE_INTEGER)) { _this->id = vi_i_id; return validate_v_i(_this); - } - else if ((_this->types[1] == TYPE_IVAR) && (_this->types[0] == TYPE_IVAR)) { + } else if ((_this->types[1] == TYPE_IVAR) && (_this->types[0] == TYPE_IVAR)) { _this->id = vi_v_id; return validate_v_v(_this); - } - else if ((_this->types[1] == TYPE_PVAR) && (_this->types[0] == TYPE_PTR)) { - if (vp_p_id == INSTR_NOP) return VALIDATE_ERROR; + } else if ((_this->types[1] == TYPE_PVAR) && (_this->types[0] == TYPE_PTR)) { + if (vp_p_id == INSTR_NOP) + return VALIDATE_ERROR; _this->id = vp_p_id; return validate_v_p(_this); - } - else if ((_this->types[1] == TYPE_PVAR) && (_this->types[0] == TYPE_PVAR)) { + } else if ((_this->types[1] == TYPE_PVAR) && (_this->types[0] == TYPE_PVAR)) { _this->id = vp_v_id; - if (vp_v_id == INSTR_NOP) return VALIDATE_ERROR; + if (vp_v_id == INSTR_NOP) + return VALIDATE_ERROR; return validate_v_v(_this); - } - else if ((_this->types[1] < FIRST_RESERVED) && (_this->types[1] >= 0) && (_this->types[0] == _this->types[1])) { + } else if ((_this->types[1] < FIRST_RESERVED) && (_this->types[1] >= 0) && + (_this->types[0] == _this->types[1])) { _this->id = vs_v_id; - if (vs_v_id == INSTR_NOP) return "Impossible operation to perform between two structs"; + if (vs_v_id == INSTR_NOP) + return "Impossible operation to perform between two structs"; return validate_v_v(_this); } return VALIDATE_ERROR; } /* }}} */ -const char *gsl_instr_validate(Instruction *_this) -{ /* {{{ */ +const char *gsl_instr_validate(Instruction *_this) { /* {{{ */ if (_this->id != INSTR_EXT_CALL) { int i = _this->nb_param; - while (i>0) - { + while (i > 0) { i--; if (_this->types[i] == TYPE_VAR) { int type = gsl_type_of_var(_this->vnamespace[i], _this->params[i]); @@ -316,137 +300,129 @@ const char *gsl_instr_validate(Instruction *_this) _this->types[i] = TYPE_PVAR; else if ((type >= 0) && (type < FIRST_RESERVED)) _this->types[i] = type; - else fprintf(stderr,"WARNING: Line %d, %s has no namespace\n", _this->line_number, _this->params[i]); + else + fprintf(stderr, "WARNING: Line %d, %s has no namespace\n", + _this->line_number, _this->params[i]); } } } switch (_this->id) { - /* set */ - case INSTR_SET: - return validate(_this, - INSTR_SETF_VAR_FLOAT, INSTR_SETF_VAR_VAR, - INSTR_SETI_VAR_INTEGER, INSTR_SETI_VAR_VAR, - INSTR_SETP_VAR_PTR, INSTR_SETP_VAR_VAR, - INSTR_SETS_VAR_VAR); - - /* extcall */ - case INSTR_EXT_CALL: - if (_this->types[0] == TYPE_VAR) { - HashValue *fval = goom_hash_get(_this->parent->functions, _this->params[0]); - if (fval) { - _this->data.udest.external_function = (struct _ExternalFunctionStruct*)fval->ptr; - return VALIDATE_OK; - } - } - return VALIDATE_ERROR; - - /* call */ - case INSTR_CALL: - if (_this->types[0] == TYPE_LABEL) { - _this->jump_label = _this->params[0]; + /* set */ + case INSTR_SET: + return validate(_this, INSTR_SETF_VAR_FLOAT, INSTR_SETF_VAR_VAR, + INSTR_SETI_VAR_INTEGER, INSTR_SETI_VAR_VAR, + INSTR_SETP_VAR_PTR, INSTR_SETP_VAR_VAR, INSTR_SETS_VAR_VAR); + + /* extcall */ + case INSTR_EXT_CALL: + if (_this->types[0] == TYPE_VAR) { + HashValue *fval = + goom_hash_get(_this->parent->functions, _this->params[0]); + if (fval) { + _this->data.udest.external_function = + (struct _ExternalFunctionStruct *)fval->ptr; return VALIDATE_OK; } - return VALIDATE_ERROR; + } + return VALIDATE_ERROR; - /* ret */ - case INSTR_RET: + /* call */ + case INSTR_CALL: + if (_this->types[0] == TYPE_LABEL) { + _this->jump_label = _this->params[0]; return VALIDATE_OK; + } + return VALIDATE_ERROR; - /* jump */ - case INSTR_JUMP: - - if (_this->types[0] == TYPE_LABEL) { - _this->jump_label = _this->params[0]; - return VALIDATE_OK; - } - return VALIDATE_ERROR; - - /* jzero / jnzero */ - case INSTR_JZERO: - case INSTR_JNZERO: + /* ret */ + case INSTR_RET: + return VALIDATE_OK; - if (_this->types[0] == TYPE_LABEL) { - _this->jump_label = _this->params[0]; - return VALIDATE_OK; - } - return VALIDATE_ERROR; + /* jump */ + case INSTR_JUMP: - /* label */ - case INSTR_LABEL: + if (_this->types[0] == TYPE_LABEL) { + _this->jump_label = _this->params[0]; + return VALIDATE_OK; + } + return VALIDATE_ERROR; - if (_this->types[0] == TYPE_LABEL) { - _this->id = INSTR_NOP; - _this->nop_label = _this->params[0]; - goom_hash_put_int(_this->parent->iflow->labels, _this->params[0], _this->parent->iflow->number); - return VALIDATE_OK; - } - return VALIDATE_ERROR; + /* jzero / jnzero */ + case INSTR_JZERO: + case INSTR_JNZERO: - /* isequal */ - case INSTR_ISEQUAL: - return validate(_this, - INSTR_ISEQUALF_VAR_FLOAT, INSTR_ISEQUALF_VAR_VAR, - INSTR_ISEQUALI_VAR_INTEGER, INSTR_ISEQUALI_VAR_VAR, - INSTR_ISEQUALP_VAR_PTR, INSTR_ISEQUALP_VAR_VAR, - INSTR_ISEQUALS_VAR_VAR); - - /* not */ - case INSTR_NOT: - _this->id = INSTR_NOT_VAR; + if (_this->types[0] == TYPE_LABEL) { + _this->jump_label = _this->params[0]; return VALIDATE_OK; + } + return VALIDATE_ERROR; - /* islower */ - case INSTR_ISLOWER: - return validate(_this, - INSTR_ISLOWERF_VAR_FLOAT, INSTR_ISLOWERF_VAR_VAR, - INSTR_ISLOWERI_VAR_INTEGER, INSTR_ISLOWERI_VAR_VAR, - INSTR_NOP, INSTR_NOP, INSTR_NOP); - - /* add */ - case INSTR_ADD: - return validate(_this, - INSTR_ADDF_VAR_FLOAT, INSTR_ADDF_VAR_VAR, - INSTR_ADDI_VAR_INTEGER, INSTR_ADDI_VAR_VAR, - INSTR_NOP, INSTR_NOP, - INSTR_ADDS_VAR_VAR); - - /* mul */ - case INSTR_MUL: - return validate(_this, - INSTR_MULF_VAR_FLOAT, INSTR_MULF_VAR_VAR, - INSTR_MULI_VAR_INTEGER, INSTR_MULI_VAR_VAR, - INSTR_NOP, INSTR_NOP, - INSTR_MULS_VAR_VAR); - - /* sub */ - case INSTR_SUB: - return validate(_this, - INSTR_SUBF_VAR_FLOAT, INSTR_SUBF_VAR_VAR, - INSTR_SUBI_VAR_INTEGER, INSTR_SUBI_VAR_VAR, - INSTR_NOP, INSTR_NOP, - INSTR_SUBS_VAR_VAR); - - /* div */ - case INSTR_DIV: - return validate(_this, - INSTR_DIVF_VAR_FLOAT, INSTR_DIVF_VAR_VAR, - INSTR_DIVI_VAR_INTEGER, INSTR_DIVI_VAR_VAR, - INSTR_NOP,INSTR_NOP, - INSTR_DIVS_VAR_VAR); + /* label */ + case INSTR_LABEL: - default: - return VALIDATE_TODO; + if (_this->types[0] == TYPE_LABEL) { + _this->id = INSTR_NOP; + _this->nop_label = _this->params[0]; + goom_hash_put_int(_this->parent->iflow->labels, _this->params[0], + _this->parent->iflow->number); + return VALIDATE_OK; + } + return VALIDATE_ERROR; + + /* isequal */ + case INSTR_ISEQUAL: + return validate(_this, INSTR_ISEQUALF_VAR_FLOAT, INSTR_ISEQUALF_VAR_VAR, + INSTR_ISEQUALI_VAR_INTEGER, INSTR_ISEQUALI_VAR_VAR, + INSTR_ISEQUALP_VAR_PTR, INSTR_ISEQUALP_VAR_VAR, + INSTR_ISEQUALS_VAR_VAR); + + /* not */ + case INSTR_NOT: + _this->id = INSTR_NOT_VAR; + return VALIDATE_OK; + + /* islower */ + case INSTR_ISLOWER: + return validate(_this, INSTR_ISLOWERF_VAR_FLOAT, INSTR_ISLOWERF_VAR_VAR, + INSTR_ISLOWERI_VAR_INTEGER, INSTR_ISLOWERI_VAR_VAR, + INSTR_NOP, INSTR_NOP, INSTR_NOP); + + /* add */ + case INSTR_ADD: + return validate(_this, INSTR_ADDF_VAR_FLOAT, INSTR_ADDF_VAR_VAR, + INSTR_ADDI_VAR_INTEGER, INSTR_ADDI_VAR_VAR, INSTR_NOP, + INSTR_NOP, INSTR_ADDS_VAR_VAR); + + /* mul */ + case INSTR_MUL: + return validate(_this, INSTR_MULF_VAR_FLOAT, INSTR_MULF_VAR_VAR, + INSTR_MULI_VAR_INTEGER, INSTR_MULI_VAR_VAR, INSTR_NOP, + INSTR_NOP, INSTR_MULS_VAR_VAR); + + /* sub */ + case INSTR_SUB: + return validate(_this, INSTR_SUBF_VAR_FLOAT, INSTR_SUBF_VAR_VAR, + INSTR_SUBI_VAR_INTEGER, INSTR_SUBI_VAR_VAR, INSTR_NOP, + INSTR_NOP, INSTR_SUBS_VAR_VAR); + + /* div */ + case INSTR_DIV: + return validate(_this, INSTR_DIVF_VAR_FLOAT, INSTR_DIVF_VAR_VAR, + INSTR_DIVI_VAR_INTEGER, INSTR_DIVI_VAR_VAR, INSTR_NOP, + INSTR_NOP, INSTR_DIVS_VAR_VAR); + + default: + return VALIDATE_TODO; } return VALIDATE_ERROR; } /* }}} */ - /*************/ - /* EXECUTION */ /*************/ -void iflow_execute(FastInstructionFlow *_this, GoomSL *gsl) -{ /* {{{ */ +/* EXECUTION */ +/*************/ +void iflow_execute(FastInstructionFlow *_this, GoomSL *gsl) { /* {{{ */ int flag = 0; int ip = 0; FastInstruction *instr = _this->instr; @@ -456,361 +432,409 @@ void iflow_execute(FastInstructionFlow *_this, GoomSL *gsl) stack[stack_pointer++] = -1; /* Quelques Macro pour rendre le code plus lisible */ -#define pSRC_VAR instr[ip].data.usrc.var -#define SRC_VAR_INT *instr[ip].data.usrc.var_int -#define SRC_VAR_FLOAT *instr[ip].data.usrc.var_float -#define SRC_VAR_PTR *instr[ip].data.usrc.var_ptr +#define pSRC_VAR instr[ip].data.usrc.var +#define SRC_VAR_INT *instr[ip].data.usrc.var_int +#define SRC_VAR_FLOAT *instr[ip].data.usrc.var_float +#define SRC_VAR_PTR *instr[ip].data.usrc.var_ptr -#define pDEST_VAR instr[ip].data.udest.var -#define DEST_VAR_INT *instr[ip].data.udest.var_int +#define pDEST_VAR instr[ip].data.udest.var +#define DEST_VAR_INT *instr[ip].data.udest.var_int #define DEST_VAR_FLOAT *instr[ip].data.udest.var_float -#define DEST_VAR_PTR *instr[ip].data.udest.var_ptr +#define DEST_VAR_PTR *instr[ip].data.udest.var_ptr -#define VALUE_INT instr[ip].data.usrc.value_int -#define VALUE_FLOAT instr[ip].data.usrc.value_float -#define VALUE_PTR instr[ip].data.usrc.value_ptr +#define VALUE_INT instr[ip].data.usrc.value_int +#define VALUE_FLOAT instr[ip].data.usrc.value_float +#define VALUE_PTR instr[ip].data.usrc.value_ptr -#define JUMP_OFFSET instr[ip].data.udest.jump_offset +#define JUMP_OFFSET instr[ip].data.udest.jump_offset -#define SRC_STRUCT_ID instr[ip].data.usrc.var_int[-1] +#define SRC_STRUCT_ID instr[ip].data.usrc.var_int[-1] #define DEST_STRUCT_ID instr[ip].data.udest.var_int[-1] -#define SRC_STRUCT_IBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i] -#define SRC_STRUCT_FBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i] +#define SRC_STRUCT_IBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i] +#define SRC_STRUCT_FBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i] #define DEST_STRUCT_IBLOCK(i) gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i] #define DEST_STRUCT_FBLOCK(i) gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i] -#define DEST_STRUCT_IBLOCK_VAR(i,j) \ - ((int*)((char*)pDEST_VAR + gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i].data))[j] -#define DEST_STRUCT_FBLOCK_VAR(i,j) \ - ((float*)((char*)pDEST_VAR + gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i].data))[j] -#define SRC_STRUCT_IBLOCK_VAR(i,j) \ - ((int*)((char*)pSRC_VAR + gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i].data))[j] -#define SRC_STRUCT_FBLOCK_VAR(i,j) \ - ((float*)((char*)pSRC_VAR + gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i].data))[j] -#define DEST_STRUCT_SIZE gsl->gsl_struct[DEST_STRUCT_ID]->size - - while (1) - { +#define DEST_STRUCT_IBLOCK_VAR(i, j) \ + ((int *)((char *)pDEST_VAR + \ + gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i].data))[j] +#define DEST_STRUCT_FBLOCK_VAR(i, j) \ + ((float *)((char *)pDEST_VAR + \ + gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i].data))[j] +#define SRC_STRUCT_IBLOCK_VAR(i, j) \ + ((int *)((char *)pSRC_VAR + \ + gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i].data))[j] +#define SRC_STRUCT_FBLOCK_VAR(i, j) \ + ((float *)((char *)pSRC_VAR + \ + gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i].data))[j] +#define DEST_STRUCT_SIZE gsl->gsl_struct[DEST_STRUCT_ID]->size + + while (1) { int i; -#ifdef TRACE_SCRIPT - printf("execute "); gsl_instr_display(instr[ip].proto); printf("\n"); +#ifdef TRACE_SCRIPT + printf("execute "); + gsl_instr_display(instr[ip].proto); + printf("\n"); #endif switch (instr[ip].id) { - /* SET.I */ - case INSTR_SETI_VAR_INTEGER: - DEST_VAR_INT = VALUE_INT; - ++ip; break; - - case INSTR_SETI_VAR_VAR: - DEST_VAR_INT = SRC_VAR_INT; - ++ip; break; - - /* SET.F */ - case INSTR_SETF_VAR_FLOAT: - DEST_VAR_FLOAT = VALUE_FLOAT; - ++ip; break; - - case INSTR_SETF_VAR_VAR: - DEST_VAR_FLOAT = SRC_VAR_FLOAT; - ++ip; break; - - /* SET.P */ - case INSTR_SETP_VAR_VAR: - DEST_VAR_PTR = SRC_VAR_PTR; - ++ip; break; - - case INSTR_SETP_VAR_PTR: - DEST_VAR_PTR = VALUE_PTR; - ++ip; break; - - /* JUMP */ - case INSTR_JUMP: - ip += JUMP_OFFSET; break; - - /* JZERO */ - case INSTR_JZERO: - ip += (flag ? 1 : JUMP_OFFSET); break; - - case INSTR_NOP: - ++ip; break; - - /* ISEQUAL.P */ - case INSTR_ISEQUALP_VAR_VAR: - flag = (DEST_VAR_PTR == SRC_VAR_PTR); - ++ip; break; - - case INSTR_ISEQUALP_VAR_PTR: - flag = (DEST_VAR_PTR == VALUE_PTR); - ++ip; break; - - /* ISEQUAL.I */ - case INSTR_ISEQUALI_VAR_VAR: - flag = (DEST_VAR_INT == SRC_VAR_INT); - ++ip; break; - - case INSTR_ISEQUALI_VAR_INTEGER: - flag = (DEST_VAR_INT == VALUE_INT); - ++ip; break; - - /* ISEQUAL.F */ - case INSTR_ISEQUALF_VAR_VAR: - flag = (DEST_VAR_FLOAT == SRC_VAR_FLOAT); - ++ip; break; - - case INSTR_ISEQUALF_VAR_FLOAT: - flag = (DEST_VAR_FLOAT == VALUE_FLOAT); - ++ip; break; - - /* ISLOWER.I */ - case INSTR_ISLOWERI_VAR_VAR: - flag = (DEST_VAR_INT < SRC_VAR_INT); - ++ip; break; - - case INSTR_ISLOWERI_VAR_INTEGER: - flag = (DEST_VAR_INT < VALUE_INT); - ++ip; break; - - /* ISLOWER.F */ - case INSTR_ISLOWERF_VAR_VAR: - flag = (DEST_VAR_FLOAT < SRC_VAR_FLOAT); - ++ip; break; - - case INSTR_ISLOWERF_VAR_FLOAT: - flag = (DEST_VAR_FLOAT < VALUE_FLOAT); - ++ip; break; - - /* ADD.I */ - case INSTR_ADDI_VAR_VAR: - DEST_VAR_INT += SRC_VAR_INT; - ++ip; break; - - case INSTR_ADDI_VAR_INTEGER: - DEST_VAR_INT += VALUE_INT; - ++ip; break; - - /* ADD.F */ - case INSTR_ADDF_VAR_VAR: - DEST_VAR_FLOAT += SRC_VAR_FLOAT; - ++ip; break; - - case INSTR_ADDF_VAR_FLOAT: - DEST_VAR_FLOAT += VALUE_FLOAT; - ++ip; break; - - /* MUL.I */ - case INSTR_MULI_VAR_VAR: - DEST_VAR_INT *= SRC_VAR_INT; - ++ip; break; - - case INSTR_MULI_VAR_INTEGER: - DEST_VAR_INT *= VALUE_INT; - ++ip; break; - - /* MUL.F */ - case INSTR_MULF_VAR_FLOAT: - DEST_VAR_FLOAT *= VALUE_FLOAT; - ++ip; break; - - case INSTR_MULF_VAR_VAR: - DEST_VAR_FLOAT *= SRC_VAR_FLOAT; - ++ip; break; - - /* DIV.I */ - case INSTR_DIVI_VAR_VAR: - DEST_VAR_INT /= SRC_VAR_INT; - ++ip; break; - - case INSTR_DIVI_VAR_INTEGER: - DEST_VAR_INT /= VALUE_INT; - ++ip; break; - - /* DIV.F */ - case INSTR_DIVF_VAR_FLOAT: - DEST_VAR_FLOAT /= VALUE_FLOAT; - ++ip; break; - - case INSTR_DIVF_VAR_VAR: - DEST_VAR_FLOAT /= SRC_VAR_FLOAT; - ++ip; break; - - /* SUB.I */ - case INSTR_SUBI_VAR_VAR: - DEST_VAR_INT -= SRC_VAR_INT; - ++ip; break; - - case INSTR_SUBI_VAR_INTEGER: - DEST_VAR_INT -= VALUE_INT; - ++ip; break; - - /* SUB.F */ - case INSTR_SUBF_VAR_FLOAT: - DEST_VAR_FLOAT -= VALUE_FLOAT; - ++ip; break; - - case INSTR_SUBF_VAR_VAR: - DEST_VAR_FLOAT -= SRC_VAR_FLOAT; - ++ip; break; - - /* CALL */ - case INSTR_CALL: - stack[stack_pointer++] = ip + 1; - ip += JUMP_OFFSET; break; - - /* RET */ - case INSTR_RET: - ip = stack[--stack_pointer]; - if (ip<0) return; - break; - - /* EXT_CALL */ - case INSTR_EXT_CALL: - instr[ip].data.udest.external_function->function(gsl, gsl->vars, instr[ip].data.udest.external_function->vars); - ++ip; break; - - /* NOT */ - case INSTR_NOT_VAR: - flag = !flag; - ++ip; break; - - /* JNZERO */ - case INSTR_JNZERO: - ip += (flag ? JUMP_OFFSET : 1); break; - - case INSTR_SETS_VAR_VAR: - memcpy(pDEST_VAR, pSRC_VAR, DEST_STRUCT_SIZE); - ++ip; break; - - case INSTR_ISEQUALS_VAR_VAR: - break; - - case INSTR_ADDS_VAR_VAR: - /* process integers */ - i=0; - while (DEST_STRUCT_IBLOCK(i).size > 0) { - int j=DEST_STRUCT_IBLOCK(i).size; - while (j--) { - DEST_STRUCT_IBLOCK_VAR(i,j) += SRC_STRUCT_IBLOCK_VAR(i,j); - } - ++i; + /* SET.I */ + case INSTR_SETI_VAR_INTEGER: + DEST_VAR_INT = VALUE_INT; + ++ip; + break; + + case INSTR_SETI_VAR_VAR: + DEST_VAR_INT = SRC_VAR_INT; + ++ip; + break; + + /* SET.F */ + case INSTR_SETF_VAR_FLOAT: + DEST_VAR_FLOAT = VALUE_FLOAT; + ++ip; + break; + + case INSTR_SETF_VAR_VAR: + DEST_VAR_FLOAT = SRC_VAR_FLOAT; + ++ip; + break; + + /* SET.P */ + case INSTR_SETP_VAR_VAR: + DEST_VAR_PTR = SRC_VAR_PTR; + ++ip; + break; + + case INSTR_SETP_VAR_PTR: + DEST_VAR_PTR = VALUE_PTR; + ++ip; + break; + + /* JUMP */ + case INSTR_JUMP: + ip += JUMP_OFFSET; + break; + + /* JZERO */ + case INSTR_JZERO: + ip += (flag ? 1 : JUMP_OFFSET); + break; + + case INSTR_NOP: + ++ip; + break; + + /* ISEQUAL.P */ + case INSTR_ISEQUALP_VAR_VAR: + flag = (DEST_VAR_PTR == SRC_VAR_PTR); + ++ip; + break; + + case INSTR_ISEQUALP_VAR_PTR: + flag = (DEST_VAR_PTR == VALUE_PTR); + ++ip; + break; + + /* ISEQUAL.I */ + case INSTR_ISEQUALI_VAR_VAR: + flag = (DEST_VAR_INT == SRC_VAR_INT); + ++ip; + break; + + case INSTR_ISEQUALI_VAR_INTEGER: + flag = (DEST_VAR_INT == VALUE_INT); + ++ip; + break; + + /* ISEQUAL.F */ + case INSTR_ISEQUALF_VAR_VAR: + flag = (DEST_VAR_FLOAT == SRC_VAR_FLOAT); + ++ip; + break; + + case INSTR_ISEQUALF_VAR_FLOAT: + flag = (DEST_VAR_FLOAT == VALUE_FLOAT); + ++ip; + break; + + /* ISLOWER.I */ + case INSTR_ISLOWERI_VAR_VAR: + flag = (DEST_VAR_INT < SRC_VAR_INT); + ++ip; + break; + + case INSTR_ISLOWERI_VAR_INTEGER: + flag = (DEST_VAR_INT < VALUE_INT); + ++ip; + break; + + /* ISLOWER.F */ + case INSTR_ISLOWERF_VAR_VAR: + flag = (DEST_VAR_FLOAT < SRC_VAR_FLOAT); + ++ip; + break; + + case INSTR_ISLOWERF_VAR_FLOAT: + flag = (DEST_VAR_FLOAT < VALUE_FLOAT); + ++ip; + break; + + /* ADD.I */ + case INSTR_ADDI_VAR_VAR: + DEST_VAR_INT += SRC_VAR_INT; + ++ip; + break; + + case INSTR_ADDI_VAR_INTEGER: + DEST_VAR_INT += VALUE_INT; + ++ip; + break; + + /* ADD.F */ + case INSTR_ADDF_VAR_VAR: + DEST_VAR_FLOAT += SRC_VAR_FLOAT; + ++ip; + break; + + case INSTR_ADDF_VAR_FLOAT: + DEST_VAR_FLOAT += VALUE_FLOAT; + ++ip; + break; + + /* MUL.I */ + case INSTR_MULI_VAR_VAR: + DEST_VAR_INT *= SRC_VAR_INT; + ++ip; + break; + + case INSTR_MULI_VAR_INTEGER: + DEST_VAR_INT *= VALUE_INT; + ++ip; + break; + + /* MUL.F */ + case INSTR_MULF_VAR_FLOAT: + DEST_VAR_FLOAT *= VALUE_FLOAT; + ++ip; + break; + + case INSTR_MULF_VAR_VAR: + DEST_VAR_FLOAT *= SRC_VAR_FLOAT; + ++ip; + break; + + /* DIV.I */ + case INSTR_DIVI_VAR_VAR: + DEST_VAR_INT /= SRC_VAR_INT; + ++ip; + break; + + case INSTR_DIVI_VAR_INTEGER: + DEST_VAR_INT /= VALUE_INT; + ++ip; + break; + + /* DIV.F */ + case INSTR_DIVF_VAR_FLOAT: + DEST_VAR_FLOAT /= VALUE_FLOAT; + ++ip; + break; + + case INSTR_DIVF_VAR_VAR: + DEST_VAR_FLOAT /= SRC_VAR_FLOAT; + ++ip; + break; + + /* SUB.I */ + case INSTR_SUBI_VAR_VAR: + DEST_VAR_INT -= SRC_VAR_INT; + ++ip; + break; + + case INSTR_SUBI_VAR_INTEGER: + DEST_VAR_INT -= VALUE_INT; + ++ip; + break; + + /* SUB.F */ + case INSTR_SUBF_VAR_FLOAT: + DEST_VAR_FLOAT -= VALUE_FLOAT; + ++ip; + break; + + case INSTR_SUBF_VAR_VAR: + DEST_VAR_FLOAT -= SRC_VAR_FLOAT; + ++ip; + break; + + /* CALL */ + case INSTR_CALL: + stack[stack_pointer++] = ip + 1; + ip += JUMP_OFFSET; + break; + + /* RET */ + case INSTR_RET: + ip = stack[--stack_pointer]; + if (ip < 0) + return; + break; + + /* EXT_CALL */ + case INSTR_EXT_CALL: + instr[ip].data.udest.external_function->function( + gsl, gsl->vars, instr[ip].data.udest.external_function->vars); + ++ip; + break; + + /* NOT */ + case INSTR_NOT_VAR: + flag = !flag; + ++ip; + break; + + /* JNZERO */ + case INSTR_JNZERO: + ip += (flag ? JUMP_OFFSET : 1); + break; + + case INSTR_SETS_VAR_VAR: + memcpy(pDEST_VAR, pSRC_VAR, DEST_STRUCT_SIZE); + ++ip; + break; + + case INSTR_ISEQUALS_VAR_VAR: + break; + + case INSTR_ADDS_VAR_VAR: + /* process integers */ + i = 0; + while (DEST_STRUCT_IBLOCK(i).size > 0) { + int j = DEST_STRUCT_IBLOCK(i).size; + while (j--) { + DEST_STRUCT_IBLOCK_VAR(i, j) += SRC_STRUCT_IBLOCK_VAR(i, j); } - /* process floats */ - i=0; - while (DEST_STRUCT_FBLOCK(i).size > 0) { - int j=DEST_STRUCT_FBLOCK(i).size; - while (j--) { - DEST_STRUCT_FBLOCK_VAR(i,j) += SRC_STRUCT_FBLOCK_VAR(i,j); - } - ++i; + ++i; + } + /* process floats */ + i = 0; + while (DEST_STRUCT_FBLOCK(i).size > 0) { + int j = DEST_STRUCT_FBLOCK(i).size; + while (j--) { + DEST_STRUCT_FBLOCK_VAR(i, j) += SRC_STRUCT_FBLOCK_VAR(i, j); } - ++ip; break; - - case INSTR_SUBS_VAR_VAR: - /* process integers */ - i=0; - while (DEST_STRUCT_IBLOCK(i).size > 0) { - int j=DEST_STRUCT_IBLOCK(i).size; - while (j--) { - DEST_STRUCT_IBLOCK_VAR(i,j) -= SRC_STRUCT_IBLOCK_VAR(i,j); - } - ++i; + ++i; + } + ++ip; + break; + + case INSTR_SUBS_VAR_VAR: + /* process integers */ + i = 0; + while (DEST_STRUCT_IBLOCK(i).size > 0) { + int j = DEST_STRUCT_IBLOCK(i).size; + while (j--) { + DEST_STRUCT_IBLOCK_VAR(i, j) -= SRC_STRUCT_IBLOCK_VAR(i, j); } - /* process floats */ - i=0; - while (DEST_STRUCT_FBLOCK(i).size > 0) { - int j=DEST_STRUCT_FBLOCK(i).size; - while (j--) { - DEST_STRUCT_FBLOCK_VAR(i,j) -= SRC_STRUCT_FBLOCK_VAR(i,j); - } - ++i; + ++i; + } + /* process floats */ + i = 0; + while (DEST_STRUCT_FBLOCK(i).size > 0) { + int j = DEST_STRUCT_FBLOCK(i).size; + while (j--) { + DEST_STRUCT_FBLOCK_VAR(i, j) -= SRC_STRUCT_FBLOCK_VAR(i, j); } - ++ip; break; - - case INSTR_MULS_VAR_VAR: - /* process integers */ - i=0; - while (DEST_STRUCT_IBLOCK(i).size > 0) { - int j=DEST_STRUCT_IBLOCK(i).size; - while (j--) { - DEST_STRUCT_IBLOCK_VAR(i,j) *= SRC_STRUCT_IBLOCK_VAR(i,j); - } - ++i; + ++i; + } + ++ip; + break; + + case INSTR_MULS_VAR_VAR: + /* process integers */ + i = 0; + while (DEST_STRUCT_IBLOCK(i).size > 0) { + int j = DEST_STRUCT_IBLOCK(i).size; + while (j--) { + DEST_STRUCT_IBLOCK_VAR(i, j) *= SRC_STRUCT_IBLOCK_VAR(i, j); } - /* process floats */ - i=0; - while (DEST_STRUCT_FBLOCK(i).size > 0) { - int j=DEST_STRUCT_FBLOCK(i).size; - while (j--) { - DEST_STRUCT_FBLOCK_VAR(i,j) *= SRC_STRUCT_FBLOCK_VAR(i,j); - } - ++i; + ++i; + } + /* process floats */ + i = 0; + while (DEST_STRUCT_FBLOCK(i).size > 0) { + int j = DEST_STRUCT_FBLOCK(i).size; + while (j--) { + DEST_STRUCT_FBLOCK_VAR(i, j) *= SRC_STRUCT_FBLOCK_VAR(i, j); } - ++ip; break; - - case INSTR_DIVS_VAR_VAR: - /* process integers */ - i=0; - while (DEST_STRUCT_IBLOCK(i).size > 0) { - int j=DEST_STRUCT_IBLOCK(i).size; - while (j--) { - DEST_STRUCT_IBLOCK_VAR(i,j) /= SRC_STRUCT_IBLOCK_VAR(i,j); - } - ++i; + ++i; + } + ++ip; + break; + + case INSTR_DIVS_VAR_VAR: + /* process integers */ + i = 0; + while (DEST_STRUCT_IBLOCK(i).size > 0) { + int j = DEST_STRUCT_IBLOCK(i).size; + while (j--) { + DEST_STRUCT_IBLOCK_VAR(i, j) /= SRC_STRUCT_IBLOCK_VAR(i, j); } - /* process floats */ - i=0; - while (DEST_STRUCT_FBLOCK(i).size > 0) { - int j=DEST_STRUCT_FBLOCK(i).size; - while (j--) { - DEST_STRUCT_FBLOCK_VAR(i,j) /= SRC_STRUCT_FBLOCK_VAR(i,j); - } - ++i; + ++i; + } + /* process floats */ + i = 0; + while (DEST_STRUCT_FBLOCK(i).size > 0) { + int j = DEST_STRUCT_FBLOCK(i).size; + while (j--) { + DEST_STRUCT_FBLOCK_VAR(i, j) /= SRC_STRUCT_FBLOCK_VAR(i, j); } - ++ip; break; + ++i; + } + ++ip; + break; - default: - printf("NOT IMPLEMENTED : %d\n", instr[ip].id); - ++ip; - exit(1); + default: + printf("NOT IMPLEMENTED : %d\n", instr[ip].id); + ++ip; + exit(1); } } } /* }}} */ -int gsl_malloc(GoomSL *_this, int size) -{ /* {{{ */ +int gsl_malloc(GoomSL *_this, int size) { /* {{{ */ if (_this->nbPtr >= _this->ptrArraySize) { _this->ptrArraySize *= 2; - _this->ptrArray = (void**)realloc(_this->ptrArray, sizeof(void*) * _this->ptrArraySize); + _this->ptrArray = + (void **)realloc(_this->ptrArray, sizeof(void *) * _this->ptrArraySize); } _this->ptrArray[_this->nbPtr] = malloc(size); return _this->nbPtr++; } /* }}} */ -void *gsl_get_ptr(GoomSL *_this, int id) -{ /* {{{ */ - if ((id>=0)&&(id<_this->nbPtr)) +void *gsl_get_ptr(GoomSL *_this, int id) { /* {{{ */ + if ((id >= 0) && (id < _this->nbPtr)) return _this->ptrArray[id]; - fprintf(stderr,"INVALID GET PTR 0x%08x\n", id); + fprintf(stderr, "INVALID GET PTR 0x%08x\n", id); return NULL; } /* }}} */ -void gsl_free_ptr(GoomSL *_this, int id) -{ /* {{{ */ - if ((id>=0)&&(id<_this->nbPtr)) { +void gsl_free_ptr(GoomSL *_this, int id) { /* {{{ */ + if ((id >= 0) && (id < _this->nbPtr)) { free(_this->ptrArray[id]); _this->ptrArray[id] = 0; } } /* }}} */ -void gsl_enternamespace(const char *name) -{ /* {{{ */ +void gsl_enternamespace(const char *name) { /* {{{ */ HashValue *val = goom_hash_get(currentGoomSL->functions, name); if (val) { - ExternalFunctionStruct *function = (ExternalFunctionStruct*)val->ptr; + ExternalFunctionStruct *function = (ExternalFunctionStruct *)val->ptr; currentGoomSL->currentNS++; currentGoomSL->namespaces[currentGoomSL->currentNS] = function->vars; - } - else { - fprintf(stderr, "ERROR: Line %d, Could not find namespace: %s\n", currentGoomSL->num_lines, name); + } else { + fprintf(stderr, "ERROR: Line %d, Could not find namespace: %s\n", + currentGoomSL->num_lines, name); exit(1); } } /* }}} */ @@ -820,53 +844,49 @@ void gsl_reenternamespace(GoomHash *nsinfo) { currentGoomSL->namespaces[currentGoomSL->currentNS] = nsinfo; } -GoomHash *gsl_leavenamespace(void) -{ /* {{{ */ +GoomHash *gsl_leavenamespace(void) { /* {{{ */ currentGoomSL->currentNS--; - return currentGoomSL->namespaces[currentGoomSL->currentNS+1]; + return currentGoomSL->namespaces[currentGoomSL->currentNS + 1]; } /* }}} */ -GoomHash *gsl_find_namespace(const char *name) -{ /* {{{ */ +GoomHash *gsl_find_namespace(const char *name) { /* {{{ */ int i; - for (i=currentGoomSL->currentNS;i>=0;--i) { + for (i = currentGoomSL->currentNS; i >= 0; --i) { if (goom_hash_get(currentGoomSL->namespaces[i], name)) return currentGoomSL->namespaces[i]; } return NULL; } /* }}} */ -void gsl_declare_task(const char *name) -{ /* {{{ */ +void gsl_declare_task(const char *name) { /* {{{ */ if (goom_hash_get(currentGoomSL->functions, name)) { return; - } - else { - ExternalFunctionStruct *gef = (ExternalFunctionStruct*)malloc(sizeof(ExternalFunctionStruct)); + } else { + ExternalFunctionStruct *gef = + (ExternalFunctionStruct *)malloc(sizeof(ExternalFunctionStruct)); gef->function = 0; gef->vars = goom_hash_new(); gef->is_extern = 0; - goom_hash_put_ptr(currentGoomSL->functions, name, (void*)gef); + goom_hash_put_ptr(currentGoomSL->functions, name, (void *)gef); } } /* }}} */ -void gsl_declare_external_task(const char *name) -{ /* {{{ */ +void gsl_declare_external_task(const char *name) { /* {{{ */ if (goom_hash_get(currentGoomSL->functions, name)) { - fprintf(stderr, "ERROR: Line %d, Duplicate declaration of %s\n", currentGoomSL->num_lines, name); + fprintf(stderr, "ERROR: Line %d, Duplicate declaration of %s\n", + currentGoomSL->num_lines, name); return; - } - else { - ExternalFunctionStruct *gef = (ExternalFunctionStruct*)malloc(sizeof(ExternalFunctionStruct)); + } else { + ExternalFunctionStruct *gef = + (ExternalFunctionStruct *)malloc(sizeof(ExternalFunctionStruct)); gef->function = 0; gef->vars = goom_hash_new(); gef->is_extern = 1; - goom_hash_put_ptr(currentGoomSL->functions, name, (void*)gef); + goom_hash_put_ptr(currentGoomSL->functions, name, (void *)gef); } } /* }}} */ -static void reset_scanner(GoomSL *gss) -{ /* {{{ */ +static void reset_scanner(GoomSL *gss) { /* {{{ */ gss->num_lines = 0; gss->instr = NULL; iflow_clean(gss->iflow); @@ -878,12 +898,12 @@ static void reset_scanner(GoomSL *gss) gss->namespaces[0] = gss->vars; goom_hash_free(gss->structIDS); - gss->structIDS = goom_hash_new(); - + gss->structIDS = goom_hash_new(); + while (gss->nbStructID > 0) { int i; gss->nbStructID--; - for(i=0;igsl_struct[gss->nbStructID]->nbFields;++i) + for (i = 0; i < gss->gsl_struct[gss->nbStructID]->nbFields; ++i) free(gss->gsl_struct[gss->nbStructID]->fields[i]); free(gss->gsl_struct[gss->nbStructID]); } @@ -894,18 +914,17 @@ static void reset_scanner(GoomSL *gss) gss->data_heap = goom_heap_new(); } /* }}} */ -static void calculate_labels(InstructionFlow *iflow) -{ /* {{{ */ +static void calculate_labels(InstructionFlow *iflow) { /* {{{ */ int i = 0; while (i < iflow->number) { Instruction *instr = iflow->instr[i]; if (instr->jump_label) { - HashValue *label = goom_hash_get(iflow->labels,instr->jump_label); + HashValue *label = goom_hash_get(iflow->labels, instr->jump_label); if (label) { instr->data.udest.jump_offset = -instr->address + label->i; - } - else { - fprintf(stderr, "ERROR: Line %d, Could not find label %s\n", instr->line_number, instr->jump_label); + } else { + fprintf(stderr, "ERROR: Line %d, Could not find label %s\n", + instr->line_number, instr->jump_label); instr->id = INSTR_NOP; instr->nop_label = 0; exit(1); @@ -916,19 +935,17 @@ static void calculate_labels(InstructionFlow *iflow) } /* }}} */ #ifdef USE_JITC_X86 -static int powerOfTwo(int i) -{ +static int powerOfTwo(int i) { int b; - for (b=0;b<31;b++) - if (i == (1<iflow->number; int i; #ifdef USE_JITC_X86 @@ -944,341 +961,347 @@ static void gsl_create_fast_iflow(void) jitc = currentGoomSL->jitc = jitc_x86_env_new(0xffff); currentGoomSL->jitc_func = jitc_prepare_func(jitc); -#if 0 -#define SRC_STRUCT_ID instr[ip].data.usrc.var_int[-1] +#if 0 +#define SRC_STRUCT_ID instr[ip].data.usrc.var_int[-1] #define DEST_STRUCT_ID instr[ip].data.udest.var_int[-1] -#define SRC_STRUCT_IBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i] -#define SRC_STRUCT_FBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i] +#define SRC_STRUCT_IBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i] +#define SRC_STRUCT_FBLOCK(i) gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i] #define DEST_STRUCT_IBLOCK(i) gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i] #define DEST_STRUCT_FBLOCK(i) gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i] -#define DEST_STRUCT_IBLOCK_VAR(i,j) \ - ((int*)((char*)pDEST_VAR + gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i].data))[j] -#define DEST_STRUCT_FBLOCK_VAR(i,j) \ - ((float*)((char*)pDEST_VAR + gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i].data))[j] -#define SRC_STRUCT_IBLOCK_VAR(i,j) \ - ((int*)((char*)pSRC_VAR + gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i].data))[j] -#define SRC_STRUCT_FBLOCK_VAR(i,j) \ - ((float*)((char*)pSRC_VAR + gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i].data))[j] -#define DEST_STRUCT_SIZE gsl->gsl_struct[DEST_STRUCT_ID]->size +#define DEST_STRUCT_IBLOCK_VAR(i, j) \ + ((int *)((char *)pDEST_VAR + \ + gsl->gsl_struct[DEST_STRUCT_ID]->iBlock[i].data))[j] +#define DEST_STRUCT_FBLOCK_VAR(i, j) \ + ((float *)((char *)pDEST_VAR + \ + gsl->gsl_struct[DEST_STRUCT_ID]->fBlock[i].data))[j] +#define SRC_STRUCT_IBLOCK_VAR(i, j) \ + ((int *)((char *)pSRC_VAR + \ + gsl->gsl_struct[SRC_STRUCT_ID]->iBlock[i].data))[j] +#define SRC_STRUCT_FBLOCK_VAR(i, j) \ + ((float *)((char *)pSRC_VAR + \ + gsl->gsl_struct[SRC_STRUCT_ID]->fBlock[i].data))[j] +#define DEST_STRUCT_SIZE gsl->gsl_struct[DEST_STRUCT_ID]->size #endif JITC_JUMP_LABEL(jitc, "__very_end__"); - JITC_ADD_LABEL (jitc, "__very_start__"); - - for (i=0;iiflow->instr[i]; switch (instr->id) { - case INSTR_SETI_VAR_INTEGER : - jitc_add(jitc, "mov [$d], $d", instr->data.udest.var_int, instr->data.usrc.value_int); - break; - case INSTR_SETI_VAR_VAR : - jitc_add(jitc, "mov eax, [$d]", instr->data.usrc.var_int); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); - break; - /* SET.F */ - case INSTR_SETF_VAR_FLOAT : - jitc_add(jitc, "mov [$d], $d", instr->data.udest.var_float, *(int*)(&instr->data.usrc.value_float)); - break; - case INSTR_SETF_VAR_VAR : - jitc_add(jitc, "mov eax, [$d]", instr->data.usrc.var_float); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_float); - break; - case INSTR_NOP : - if (instr->nop_label != 0) - JITC_ADD_LABEL(jitc, instr->nop_label); - break; - case INSTR_JUMP : - JITC_JUMP_LABEL(jitc,instr->jump_label); - break; - case INSTR_SETP_VAR_PTR : - jitc_add(jitc, "mov [$d], $d", instr->data.udest.var_ptr, instr->data.usrc.value_ptr); - break; - case INSTR_SETP_VAR_VAR : - jitc_add(jitc, "mov eax, [$d]", instr->data.usrc.var_ptr); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_ptr); - break; - case INSTR_SUBI_VAR_INTEGER : - jitc_add(jitc, "add [$d], $d", instr->data.udest.var_int, -instr->data.usrc.value_int); - break; - case INSTR_SUBI_VAR_VAR : - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "sub eax, [$d]", instr->data.usrc.var_int); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); - break; - case INSTR_SUBF_VAR_FLOAT : - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_SUBF_VAR_VAR : - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_ISLOWERF_VAR_VAR: - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_ISLOWERF_VAR_FLOAT: - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_ISLOWERI_VAR_VAR: - jitc_add(jitc,"mov edx, [$d]", instr->data.udest.var_int); - jitc_add(jitc,"sub edx, [$d]", instr->data.usrc.var_int); - jitc_add(jitc,"shr edx, $d", 31); - break; - case INSTR_ISLOWERI_VAR_INTEGER: - jitc_add(jitc,"mov edx, [$d]", instr->data.udest.var_int); - jitc_add(jitc,"sub edx, $d", instr->data.usrc.value_int); - jitc_add(jitc,"shr edx, $d", 31); - break; - case INSTR_ADDI_VAR_INTEGER: - jitc_add(jitc, "add [$d], $d", instr->data.udest.var_int, instr->data.usrc.value_int); - break; - case INSTR_ADDI_VAR_VAR: - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "add eax, [$d]", instr->data.usrc.var_int); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); - break; - case INSTR_ADDF_VAR_FLOAT: - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_ADDF_VAR_VAR: - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_MULI_VAR_INTEGER: - if (instr->data.usrc.value_int != 1) - { - int po2 = powerOfTwo(instr->data.usrc.value_int); - if (po2) { - /* performs (V / 2^n) by doing V >> n */ - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "sal eax, $d", po2); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); - } - else { - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "imul eax, $d", instr->data.usrc.value_int); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); - } - } - break; - case INSTR_MULI_VAR_VAR: - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "imul eax, [$d]", instr->data.usrc.var_int); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); - break; - case INSTR_MULF_VAR_FLOAT: - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_MULF_VAR_VAR: - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_DIVI_VAR_INTEGER: - if ((instr->data.usrc.value_int != 1) && (instr->data.usrc.value_int != 0)) - { - int po2 = powerOfTwo(instr->data.usrc.value_int); - if (po2) { - /* performs (V / 2^n) by doing V >> n */ - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "sar eax, $d", po2); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); - } - else { - /* performs (V/n) by doing (V*(32^2/n)) */ - long coef; - double dcoef = (double)4294967296.0 / (double)instr->data.usrc.value_int; - if (dcoef < 0.0) dcoef = -dcoef; - coef = (long)floor(dcoef); - dcoef -= floor(dcoef); - if (dcoef < 0.5) coef += 1; - - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "mov edx, $d", coef); - jitc_add(jitc, "imul edx"); - if (instr->data.usrc.value_int < 0) - jitc_add(jitc, "neg edx"); - jitc_add(jitc, "mov [$d], edx", instr->data.udest.var_int); - } - } - break; - case INSTR_DIVI_VAR_VAR : - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "cdq"); /* sign extend eax into edx */ - jitc_add(jitc, "idiv [$d]", instr->data.usrc.var_int); - jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); - break; - case INSTR_DIVF_VAR_FLOAT: - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_DIVF_VAR_VAR: - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_JZERO: - jitc_add(jitc, "cmp edx, $d", 0); - jitc_add(jitc, "je $s", instr->jump_label); - break; - case INSTR_ISEQUALP_VAR_VAR : - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_ptr); - jitc_add(jitc, "mov edx, $d", 0); - jitc_add(jitc, "cmp eax, [$d]", instr->data.usrc.var_ptr); - jitc_add(jitc, "jne $d", 1); - jitc_add(jitc, "inc edx"); - break; - case INSTR_ISEQUALP_VAR_PTR : - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_ptr); - jitc_add(jitc, "mov edx, $d", 0); - jitc_add(jitc, "cmp eax, $d", instr->data.usrc.value_ptr); - jitc_add(jitc, "jne $d", 1); - jitc_add(jitc, "inc edx"); - break; - case INSTR_ISEQUALI_VAR_VAR : - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "mov edx, $d", 0); - jitc_add(jitc, "cmp eax, [$d]", instr->data.usrc.var_int); - jitc_add(jitc, "jne $d", 1); - jitc_add(jitc, "inc edx"); - break; - case INSTR_ISEQUALI_VAR_INTEGER : - jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); - jitc_add(jitc, "mov edx, $d", 0); - jitc_add(jitc, "cmp eax, $d", instr->data.usrc.value_int); - jitc_add(jitc, "jne $d", 1); - jitc_add(jitc, "inc edx"); - break; - case INSTR_ISEQUALF_VAR_VAR : - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_ISEQUALF_VAR_FLOAT : - printf("NOT IMPLEMENTED : %d\n", instr->id); - break; - case INSTR_CALL: - jitc_add(jitc, "call $s", instr->jump_label); - break; - case INSTR_RET: - jitc_add(jitc, "ret"); - break; - case INSTR_EXT_CALL: - jitc_add(jitc, "mov eax, [$d]", &(instr->data.udest.external_function->vars)); - jitc_add(jitc, "push eax"); - jitc_add(jitc, "mov edx, [$d]", &(currentGoomSL->vars)); - jitc_add(jitc, "push edx"); - jitc_add(jitc, "mov eax, [$d]", &(currentGoomSL)); - jitc_add(jitc, "push eax"); - - jitc_add(jitc, "mov eax, [$d]", &(instr->data.udest.external_function)); - jitc_add(jitc, "mov eax, [eax]"); - jitc_add(jitc, "call [eax]"); - jitc_add(jitc, "add esp, $d", 12); - break; - case INSTR_NOT_VAR: - jitc_add(jitc, "mov eax, edx"); - jitc_add(jitc, "mov edx, $d", 1); - jitc_add(jitc, "sub edx, eax"); - break; - case INSTR_JNZERO: - jitc_add(jitc, "cmp edx, $d", 0); - jitc_add(jitc, "jne $s", instr->jump_label); - break; - case INSTR_SETS_VAR_VAR: - { - int loop = DEST_STRUCT_SIZE / sizeof(int); - int dst = (int)pDEST_VAR; - int src = (int)pSRC_VAR; - - while (loop--) { - jitc_add(jitc,"mov eax, [$d]", src); - jitc_add(jitc,"mov [$d], eax", dst); - src += 4; - dst += 4; - } - } - break; - case INSTR_ISEQUALS_VAR_VAR: - break; - case INSTR_ADDS_VAR_VAR: - { - /* process integers */ - int i=0; - while (DEST_STRUCT_IBLOCK(i).size > 0) { - int j=DEST_STRUCT_IBLOCK(i).size; - while (j--) { /* TODO interlace 2 */ - jitc_add(jitc, "mov eax, [$d]", &DEST_STRUCT_IBLOCK_VAR(i,j)); - jitc_add(jitc, "add eax, [$d]", &SRC_STRUCT_IBLOCK_VAR(i,j)); - jitc_add(jitc, "mov [$d], eax", &DEST_STRUCT_IBLOCK_VAR(i,j)); - } - ++i; - } - /* process floats */ - i=0; - while (DEST_STRUCT_FBLOCK(i).size > 0) { - int j=DEST_STRUCT_FBLOCK(i).size; - while (j--) { - /* DEST_STRUCT_FBLOCK_VAR(i,j) += SRC_STRUCT_FBLOCK_VAR(i,j); */ - /* TODO */ - } - ++i; - } - break; + case INSTR_SETI_VAR_INTEGER: + jitc_add(jitc, "mov [$d], $d", instr->data.udest.var_int, + instr->data.usrc.value_int); + break; + case INSTR_SETI_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.usrc.var_int); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); + break; + /* SET.F */ + case INSTR_SETF_VAR_FLOAT: + jitc_add(jitc, "mov [$d], $d", instr->data.udest.var_float, + *(int *)(&instr->data.usrc.value_float)); + break; + case INSTR_SETF_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.usrc.var_float); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_float); + break; + case INSTR_NOP: + if (instr->nop_label != 0) + JITC_ADD_LABEL(jitc, instr->nop_label); + break; + case INSTR_JUMP: + JITC_JUMP_LABEL(jitc, instr->jump_label); + break; + case INSTR_SETP_VAR_PTR: + jitc_add(jitc, "mov [$d], $d", instr->data.udest.var_ptr, + instr->data.usrc.value_ptr); + break; + case INSTR_SETP_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.usrc.var_ptr); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_ptr); + break; + case INSTR_SUBI_VAR_INTEGER: + jitc_add(jitc, "add [$d], $d", instr->data.udest.var_int, + -instr->data.usrc.value_int); + break; + case INSTR_SUBI_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "sub eax, [$d]", instr->data.usrc.var_int); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); + break; + case INSTR_SUBF_VAR_FLOAT: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_SUBF_VAR_VAR: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_ISLOWERF_VAR_VAR: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_ISLOWERF_VAR_FLOAT: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_ISLOWERI_VAR_VAR: + jitc_add(jitc, "mov edx, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "sub edx, [$d]", instr->data.usrc.var_int); + jitc_add(jitc, "shr edx, $d", 31); + break; + case INSTR_ISLOWERI_VAR_INTEGER: + jitc_add(jitc, "mov edx, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "sub edx, $d", instr->data.usrc.value_int); + jitc_add(jitc, "shr edx, $d", 31); + break; + case INSTR_ADDI_VAR_INTEGER: + jitc_add(jitc, "add [$d], $d", instr->data.udest.var_int, + instr->data.usrc.value_int); + break; + case INSTR_ADDI_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "add eax, [$d]", instr->data.usrc.var_int); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); + break; + case INSTR_ADDF_VAR_FLOAT: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_ADDF_VAR_VAR: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_MULI_VAR_INTEGER: + if (instr->data.usrc.value_int != 1) { + int po2 = powerOfTwo(instr->data.usrc.value_int); + if (po2) { + /* performs (V / 2^n) by doing V >> n */ + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "sal eax, $d", po2); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); + } else { + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "imul eax, $d", instr->data.usrc.value_int); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); } - case INSTR_SUBS_VAR_VAR: - { - /* process integers */ - int i=0; - while (DEST_STRUCT_IBLOCK(i).size > 0) { - int j=DEST_STRUCT_IBLOCK(i).size; - while (j--) { - jitc_add(jitc, "mov eax, [$d]", &DEST_STRUCT_IBLOCK_VAR(i,j)); - jitc_add(jitc, "sub eax, [$d]", &SRC_STRUCT_IBLOCK_VAR(i,j)); - jitc_add(jitc, "mov [$d], eax", &DEST_STRUCT_IBLOCK_VAR(i,j)); - } - ++i; + } + break; + case INSTR_MULI_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "imul eax, [$d]", instr->data.usrc.var_int); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); + break; + case INSTR_MULF_VAR_FLOAT: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_MULF_VAR_VAR: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_DIVI_VAR_INTEGER: + if ((instr->data.usrc.value_int != 1) && + (instr->data.usrc.value_int != 0)) { + int po2 = powerOfTwo(instr->data.usrc.value_int); + if (po2) { + /* performs (V / 2^n) by doing V >> n */ + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "sar eax, $d", po2); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); + } else { + /* performs (V/n) by doing (V*(32^2/n)) */ + long coef; + double dcoef = + (double)4294967296.0 / (double)instr->data.usrc.value_int; + if (dcoef < 0.0) + dcoef = -dcoef; + coef = (long)floor(dcoef); + dcoef -= floor(dcoef); + if (dcoef < 0.5) + coef += 1; + + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "mov edx, $d", coef); + jitc_add(jitc, "imul edx"); + if (instr->data.usrc.value_int < 0) + jitc_add(jitc, "neg edx"); + jitc_add(jitc, "mov [$d], edx", instr->data.udest.var_int); } - break; + } + break; + case INSTR_DIVI_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "cdq"); /* sign extend eax into edx */ + jitc_add(jitc, "idiv [$d]", instr->data.usrc.var_int); + jitc_add(jitc, "mov [$d], eax", instr->data.udest.var_int); + break; + case INSTR_DIVF_VAR_FLOAT: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_DIVF_VAR_VAR: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_JZERO: + jitc_add(jitc, "cmp edx, $d", 0); + jitc_add(jitc, "je $s", instr->jump_label); + break; + case INSTR_ISEQUALP_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_ptr); + jitc_add(jitc, "mov edx, $d", 0); + jitc_add(jitc, "cmp eax, [$d]", instr->data.usrc.var_ptr); + jitc_add(jitc, "jne $d", 1); + jitc_add(jitc, "inc edx"); + break; + case INSTR_ISEQUALP_VAR_PTR: + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_ptr); + jitc_add(jitc, "mov edx, $d", 0); + jitc_add(jitc, "cmp eax, $d", instr->data.usrc.value_ptr); + jitc_add(jitc, "jne $d", 1); + jitc_add(jitc, "inc edx"); + break; + case INSTR_ISEQUALI_VAR_VAR: + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "mov edx, $d", 0); + jitc_add(jitc, "cmp eax, [$d]", instr->data.usrc.var_int); + jitc_add(jitc, "jne $d", 1); + jitc_add(jitc, "inc edx"); + break; + case INSTR_ISEQUALI_VAR_INTEGER: + jitc_add(jitc, "mov eax, [$d]", instr->data.udest.var_int); + jitc_add(jitc, "mov edx, $d", 0); + jitc_add(jitc, "cmp eax, $d", instr->data.usrc.value_int); + jitc_add(jitc, "jne $d", 1); + jitc_add(jitc, "inc edx"); + break; + case INSTR_ISEQUALF_VAR_VAR: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_ISEQUALF_VAR_FLOAT: + printf("NOT IMPLEMENTED : %d\n", instr->id); + break; + case INSTR_CALL: + jitc_add(jitc, "call $s", instr->jump_label); + break; + case INSTR_RET: + jitc_add(jitc, "ret"); + break; + case INSTR_EXT_CALL: + jitc_add(jitc, "mov eax, [$d]", + &(instr->data.udest.external_function->vars)); + jitc_add(jitc, "push eax"); + jitc_add(jitc, "mov edx, [$d]", &(currentGoomSL->vars)); + jitc_add(jitc, "push edx"); + jitc_add(jitc, "mov eax, [$d]", &(currentGoomSL)); + jitc_add(jitc, "push eax"); + + jitc_add(jitc, "mov eax, [$d]", &(instr->data.udest.external_function)); + jitc_add(jitc, "mov eax, [eax]"); + jitc_add(jitc, "call [eax]"); + jitc_add(jitc, "add esp, $d", 12); + break; + case INSTR_NOT_VAR: + jitc_add(jitc, "mov eax, edx"); + jitc_add(jitc, "mov edx, $d", 1); + jitc_add(jitc, "sub edx, eax"); + break; + case INSTR_JNZERO: + jitc_add(jitc, "cmp edx, $d", 0); + jitc_add(jitc, "jne $s", instr->jump_label); + break; + case INSTR_SETS_VAR_VAR: { + int loop = DEST_STRUCT_SIZE / sizeof(int); + int dst = (int)pDEST_VAR; + int src = (int)pSRC_VAR; + + while (loop--) { + jitc_add(jitc, "mov eax, [$d]", src); + jitc_add(jitc, "mov [$d], eax", dst); + src += 4; + dst += 4; + } + } break; + case INSTR_ISEQUALS_VAR_VAR: + break; + case INSTR_ADDS_VAR_VAR: { + /* process integers */ + int i = 0; + while (DEST_STRUCT_IBLOCK(i).size > 0) { + int j = DEST_STRUCT_IBLOCK(i).size; + while (j--) { /* TODO interlace 2 */ + jitc_add(jitc, "mov eax, [$d]", &DEST_STRUCT_IBLOCK_VAR(i, j)); + jitc_add(jitc, "add eax, [$d]", &SRC_STRUCT_IBLOCK_VAR(i, j)); + jitc_add(jitc, "mov [$d], eax", &DEST_STRUCT_IBLOCK_VAR(i, j)); } - case INSTR_MULS_VAR_VAR: - { - /* process integers */ - int i=0; - while (DEST_STRUCT_IBLOCK(i).size > 0) { - int j=DEST_STRUCT_IBLOCK(i).size; - while (j--) { - jitc_add(jitc, "mov eax, [$d]", &DEST_STRUCT_IBLOCK_VAR(i,j)); - jitc_add(jitc, "imul eax, [$d]", &SRC_STRUCT_IBLOCK_VAR(i,j)); - jitc_add(jitc, "mov [$d], eax", &DEST_STRUCT_IBLOCK_VAR(i,j)); - } - ++i; + ++i; + } + /* process floats */ + i = 0; + while (DEST_STRUCT_FBLOCK(i).size > 0) { + int j = DEST_STRUCT_FBLOCK(i).size; + while (j--) { + /* DEST_STRUCT_FBLOCK_VAR(i,j) += SRC_STRUCT_FBLOCK_VAR(i,j); */ + /* TODO */ } - break; + ++i; + } + break; + } + case INSTR_SUBS_VAR_VAR: { + /* process integers */ + int i = 0; + while (DEST_STRUCT_IBLOCK(i).size > 0) { + int j = DEST_STRUCT_IBLOCK(i).size; + while (j--) { + jitc_add(jitc, "mov eax, [$d]", &DEST_STRUCT_IBLOCK_VAR(i, j)); + jitc_add(jitc, "sub eax, [$d]", &SRC_STRUCT_IBLOCK_VAR(i, j)); + jitc_add(jitc, "mov [$d], eax", &DEST_STRUCT_IBLOCK_VAR(i, j)); } - case INSTR_DIVS_VAR_VAR: - { - /* process integers */ - int i=0; - while (DEST_STRUCT_IBLOCK(i).size > 0) { - int j=DEST_STRUCT_IBLOCK(i).size; - while (j--) { - jitc_add(jitc, "mov eax, [$d]", &DEST_STRUCT_IBLOCK_VAR(i,j)); - jitc_add(jitc, "cdq"); - jitc_add(jitc, "idiv [$d]", &SRC_STRUCT_IBLOCK_VAR(i,j)); - jitc_add(jitc, "mov [$d], eax", &DEST_STRUCT_IBLOCK_VAR(i,j)); - } - ++i; + ++i; + } + break; + } + case INSTR_MULS_VAR_VAR: { + /* process integers */ + int i = 0; + while (DEST_STRUCT_IBLOCK(i).size > 0) { + int j = DEST_STRUCT_IBLOCK(i).size; + while (j--) { + jitc_add(jitc, "mov eax, [$d]", &DEST_STRUCT_IBLOCK_VAR(i, j)); + jitc_add(jitc, "imul eax, [$d]", &SRC_STRUCT_IBLOCK_VAR(i, j)); + jitc_add(jitc, "mov [$d], eax", &DEST_STRUCT_IBLOCK_VAR(i, j)); } - break; + ++i; + } + break; + } + case INSTR_DIVS_VAR_VAR: { + /* process integers */ + int i = 0; + while (DEST_STRUCT_IBLOCK(i).size > 0) { + int j = DEST_STRUCT_IBLOCK(i).size; + while (j--) { + jitc_add(jitc, "mov eax, [$d]", &DEST_STRUCT_IBLOCK_VAR(i, j)); + jitc_add(jitc, "cdq"); + jitc_add(jitc, "idiv [$d]", &SRC_STRUCT_IBLOCK_VAR(i, j)); + jitc_add(jitc, "mov [$d], eax", &DEST_STRUCT_IBLOCK_VAR(i, j)); } + ++i; + } + break; + } } } - JITC_ADD_LABEL (jitc, "__very_end__"); + JITC_ADD_LABEL(jitc, "__very_end__"); jitc_add(jitc, "call $s", "__very_start__"); jitc_add(jitc, "mov eax, $d", 0); jitc_validate_func(jitc); #else - InstructionFlow *iflow = currentGoomSL->iflow; - FastInstructionFlow *fastiflow = (FastInstructionFlow*)malloc(sizeof(FastInstructionFlow)); - fastiflow->mallocedInstr = calloc(number, 16*sizeof(FastInstruction)); - /* fastiflow->instr = (FastInstruction*)(((int)fastiflow->mallocedInstr) + 16 - (((int)fastiflow->mallocedInstr)%16)); */ - fastiflow->instr = (FastInstruction*)fastiflow->mallocedInstr; + InstructionFlow *iflow = currentGoomSL->iflow; + FastInstructionFlow *fastiflow = + (FastInstructionFlow *)malloc(sizeof(FastInstructionFlow)); + fastiflow->mallocedInstr = calloc(number, 16 * sizeof(FastInstruction)); + /* fastiflow->instr = (FastInstruction*)(((int)fastiflow->mallocedInstr) + 16 + * - (((int)fastiflow->mallocedInstr)%16)); */ + fastiflow->instr = (FastInstruction *)fastiflow->mallocedInstr; fastiflow->number = number; - for(i=0;iinstr[i].id = iflow->instr[i]->id; - fastiflow->instr[i].data = iflow->instr[i]->data; + for (i = 0; i < number; ++i) { + fastiflow->instr[i].id = iflow->instr[i]->id; + fastiflow->instr[i].data = iflow->instr[i]->data; fastiflow->instr[i].proto = iflow->instr[i]; } currentGoomSL->fastiflow = fastiflow; @@ -1286,21 +1309,16 @@ static void gsl_create_fast_iflow(void) } /* }}} */ void yy_scan_string(const char *str); -int yyparse(void); - -GoomHash *gsl_globals(GoomSL *_this) -{ - return _this->vars; -} +int yyparse(void); +GoomHash *gsl_globals(GoomSL *_this) { return _this->vars; } /** * Some native external functions */ -static void ext_charAt(GoomSL *gsl, GoomHash *global, GoomHash *local) -{ +static void ext_charAt(GoomSL *gsl, GoomHash *global, GoomHash *local) { char *string = GSL_LOCAL_PTR(gsl, local, "value"); - int index = GSL_LOCAL_INT(gsl, local, "index"); + int index = GSL_LOCAL_INT(gsl, local, "index"); GSL_GLOBAL_INT(gsl, "charAt") = 0; if (string == NULL) { return; @@ -1309,14 +1327,12 @@ static void ext_charAt(GoomSL *gsl, GoomHash *global, GoomHash *local) GSL_GLOBAL_INT(gsl, "charAt") = string[index]; } -static void ext_i2f(GoomSL *gsl, GoomHash *global, GoomHash *local) -{ +static void ext_i2f(GoomSL *gsl, GoomHash *global, GoomHash *local) { int i = GSL_LOCAL_INT(gsl, local, "value"); GSL_GLOBAL_FLOAT(gsl, "i2f") = i; } -static void ext_f2i(GoomSL *gsl, GoomHash *global, GoomHash *local) -{ +static void ext_f2i(GoomSL *gsl, GoomHash *global, GoomHash *local) { float f = GSL_LOCAL_FLOAT(gsl, local, "value"); GSL_GLOBAL_INT(gsl, "f2i") = f; } @@ -1324,13 +1340,12 @@ static void ext_f2i(GoomSL *gsl, GoomHash *global, GoomHash *local) /** * */ -void gsl_compile(GoomSL *_currentGoomSL, const char *script) -{ /* {{{ */ +void gsl_compile(GoomSL *_currentGoomSL, const char *script) { /* {{{ */ char *script_and_externals; static const char *sBinds = - "external : int\n" - "external : int\n" - "external : float\n"; + "external : int\n" + "external : int\n" + "external : float\n"; #ifdef VERBOSE printf("\n=== Starting Compilation ===\n"); @@ -1362,14 +1377,14 @@ void gsl_compile(GoomSL *_currentGoomSL, const char *script) gsl_bind_function(currentGoomSL, "f2i", ext_f2i); gsl_bind_function(currentGoomSL, "i2f", ext_i2f); free(script_and_externals); - + #ifdef VERBOSE - printf("=== Compilation done. # of lines: %d. # of instr: %d ===\n", currentGoomSL->num_lines, currentGoomSL->iflow->number); + printf("=== Compilation done. # of lines: %d. # of instr: %d ===\n", + currentGoomSL->num_lines, currentGoomSL->iflow->number); #endif } /* }}} */ -void gsl_execute(GoomSL *scanner) -{ /* {{{ */ +void gsl_execute(GoomSL *scanner) { /* {{{ */ if (scanner->compilationOK) { #if USE_JITC_X86 scanner->jitc_func(); @@ -1379,17 +1394,17 @@ void gsl_execute(GoomSL *scanner) } } /* }}} */ -GoomSL *gsl_new(void) -{ /* {{{ */ - GoomSL *gss = (GoomSL*)malloc(sizeof(GoomSL)); +GoomSL *gsl_new(void) { /* {{{ */ + GoomSL *gss = (GoomSL *)malloc(sizeof(GoomSL)); gss->iflow = iflow_new(); - gss->vars = goom_hash_new(); + gss->vars = goom_hash_new(); gss->functions = goom_hash_new(); - gss->nbStructID = 0; - gss->structIDS = goom_hash_new(); + gss->nbStructID = 0; + gss->structIDS = goom_hash_new(); gss->gsl_struct_size = 32; - gss->gsl_struct = (GSL_Struct**)malloc(gss->gsl_struct_size * sizeof(GSL_Struct*)); + gss->gsl_struct = + (GSL_Struct **)malloc(gss->gsl_struct_size * sizeof(GSL_Struct *)); gss->currentNS = 0; gss->namespaces[0] = gss->vars; gss->data_heap = goom_heap_new(); @@ -1397,115 +1412,107 @@ GoomSL *gsl_new(void) reset_scanner(gss); gss->compilationOK = 0; - gss->nbPtr=0; - gss->ptrArraySize=256; - gss->ptrArray = (void**)malloc(gss->ptrArraySize * sizeof(void*)); + gss->nbPtr = 0; + gss->ptrArraySize = 256; + gss->ptrArray = (void **)malloc(gss->ptrArraySize * sizeof(void *)); #ifdef USE_JITC_X86 gss->jitc = NULL; #endif return gss; } /* }}} */ -void gsl_bind_function(GoomSL *gss, const char *fname, GoomSL_ExternalFunction func) -{ /* {{{ */ +void gsl_bind_function(GoomSL *gss, const char *fname, + GoomSL_ExternalFunction func) { /* {{{ */ HashValue *val = goom_hash_get(gss->functions, fname); if (val) { - ExternalFunctionStruct *gef = (ExternalFunctionStruct*)val->ptr; + ExternalFunctionStruct *gef = (ExternalFunctionStruct *)val->ptr; gef->function = func; - } - else fprintf(stderr, "Unable to bind function %s\n", fname); + } else + fprintf(stderr, "Unable to bind function %s\n", fname); } /* }}} */ -int gsl_is_compiled(GoomSL *gss) -{ /* {{{ */ +int gsl_is_compiled(GoomSL *gss) { /* {{{ */ return gss->compilationOK; } /* }}} */ -void gsl_free(GoomSL *gss) -{ /* {{{ */ +void gsl_free(GoomSL *gss) { /* {{{ */ iflow_free(gss->iflow); free(gss->vars); free(gss->functions); free(gss); } /* }}} */ - static int gsl_nb_import; static char gsl_already_imported[256][256]; -char *gsl_init_buffer(const char *fname) -{ - char *fbuffer; - fbuffer = (char*)malloc(512); - fbuffer[0]=0; - gsl_nb_import = 0; - if (fname) - gsl_append_file_to_buffer(fname,&fbuffer); - return fbuffer; +char *gsl_init_buffer(const char *fname) { + char *fbuffer; + fbuffer = (char *)malloc(512); + fbuffer[0] = 0; + gsl_nb_import = 0; + if (fname) + gsl_append_file_to_buffer(fname, &fbuffer); + return fbuffer; } -static char *gsl_read_file(const char *fname) -{ +static char *gsl_read_file(const char *fname) { FILE *f; char *buffer; int fsize; - f = fopen(fname,"rt"); + f = fopen(fname, "rt"); if (!f) { fprintf(stderr, "ERROR: Could not load file %s\n", fname); exit(1); } - fseek(f,0,SEEK_END); + fseek(f, 0, SEEK_END); fsize = ftell(f); rewind(f); - buffer = (char*)malloc(fsize+512); - fread(buffer,1,fsize,f); + buffer = (char *)malloc(fsize + 512); + fread(buffer, 1, fsize, f); fclose(f); - buffer[fsize]=0; + buffer[fsize] = 0; return buffer; } -void gsl_append_file_to_buffer(const char *fname, char **buffer) -{ - char *fbuffer; - int size,fsize,i=0; - char reset_msg[256]; - - /* look if the file have not been already imported */ - for (i=0;iptr) -#define GSL_LOCAL_INT(gsl,local,name) (*(int*)goom_hash_get(local,name)->ptr) -#define GSL_LOCAL_FLOAT(gsl,local,name) (*(float*)goom_hash_get(local,name)->ptr) - -#define GSL_GLOBAL_PTR(gsl,name) gsl_get_ptr(gsl, *(int*)goom_hash_get(gsl_globals(gsl),name)->ptr) -#define GSL_GLOBAL_INT(gsl,name) (*(int*)goom_hash_get(gsl_globals(gsl),name)->ptr) -#define GSL_GLOBAL_FLOAT(gsl,name) (*(float*)goom_hash_get(gsl_globals(gsl),name)->ptr) +#define GSL_LOCAL_PTR(gsl, local, name) \ + gsl_get_ptr(gsl, *(int *)goom_hash_get(local, name)->ptr) +#define GSL_LOCAL_INT(gsl, local, name) \ + (*(int *)goom_hash_get(local, name)->ptr) +#define GSL_LOCAL_FLOAT(gsl, local, name) \ + (*(float *)goom_hash_get(local, name)->ptr) + +#define GSL_GLOBAL_PTR(gsl, name) \ + gsl_get_ptr(gsl, *(int *)goom_hash_get(gsl_globals(gsl), name)->ptr) +#define GSL_GLOBAL_INT(gsl, name) \ + (*(int *)goom_hash_get(gsl_globals(gsl), name)->ptr) +#define GSL_GLOBAL_FLOAT(gsl, name) \ + (*(float *)goom_hash_get(gsl_globals(gsl), name)->ptr) #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/goomsl_hash.c b/libvisual-plugins/plugins/actor/goom2k4/goomsl_hash.c index 5f6eac56f..f0d359c43 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goomsl_hash.c +++ b/libvisual-plugins/plugins/actor/goom2k4/goomsl_hash.c @@ -6,107 +6,107 @@ static GoomHashEntry *entry_new(const char *key, HashValue value) { int len = strlen(key); - GoomHashEntry *entry = (GoomHashEntry*)malloc(sizeof(GoomHashEntry)); + GoomHashEntry *entry = (GoomHashEntry *)malloc(sizeof(GoomHashEntry)); - entry->key = (char *)malloc(len+1); - visual_mem_copy(entry->key,key,len+1); - entry->value = value; - entry->lower = NULL; - entry->upper = NULL; + entry->key = (char *)malloc(len + 1); + visual_mem_copy(entry->key, key, len + 1); + entry->value = value; + entry->lower = NULL; + entry->upper = NULL; - return entry; + return entry; } static void entry_free(GoomHashEntry *entry) { - if (entry!=NULL) { - entry_free(entry->lower); - entry_free(entry->upper); - free(entry->key); - free(entry); - } + if (entry != NULL) { + entry_free(entry->lower); + entry_free(entry->upper); + free(entry->key); + free(entry); + } } static void entry_put(GoomHashEntry *entry, const char *key, HashValue value) { - int cmp = strcmp(key,entry->key); - if (cmp==0) { - entry->value = value; - } - else if (cmp > 0) { - if (entry->upper == NULL) - entry->upper = entry_new(key,value); - else - entry_put(entry->upper, key, value); - } - else { - if (entry->lower == NULL) - entry->lower = entry_new(key,value); - else - entry_put(entry->lower, key, value); - } + int cmp = strcmp(key, entry->key); + if (cmp == 0) { + entry->value = value; + } else if (cmp > 0) { + if (entry->upper == NULL) + entry->upper = entry_new(key, value); + else + entry_put(entry->upper, key, value); + } else { + if (entry->lower == NULL) + entry->lower = entry_new(key, value); + else + entry_put(entry->lower, key, value); + } } static HashValue *entry_get(GoomHashEntry *entry, const char *key) { - int cmp; - if (entry==NULL) - return NULL; - cmp = strcmp(key,entry->key); - if (cmp > 0) - return entry_get(entry->upper, key); - else if (cmp < 0) - return entry_get(entry->lower, key); - else - return &(entry->value); + int cmp; + if (entry == NULL) + return NULL; + cmp = strcmp(key, entry->key); + if (cmp > 0) + return entry_get(entry->upper, key); + else if (cmp < 0) + return entry_get(entry->lower, key); + else + return &(entry->value); } GoomHash *goom_hash_new(void) { - GoomHash *_this = (GoomHash*)malloc(sizeof(GoomHash)); - _this->root = NULL; + GoomHash *_this = (GoomHash *)malloc(sizeof(GoomHash)); + _this->root = NULL; _this->number_of_puts = 0; - return _this; + return _this; } void goom_hash_free(GoomHash *_this) { - entry_free(_this->root); - free(_this); + entry_free(_this->root); + free(_this); } void goom_hash_put(GoomHash *_this, const char *key, HashValue value) { _this->number_of_puts += 1; - if (_this->root == NULL) - _this->root = entry_new(key,value); - else - entry_put(_this->root,key,value); + if (_this->root == NULL) + _this->root = entry_new(key, value); + else + entry_put(_this->root, key, value); } HashValue *goom_hash_get(GoomHash *_this, const char *key) { - if (_this == NULL) return NULL; - return entry_get(_this->root,key); + if (_this == NULL) + return NULL; + return entry_get(_this->root, key); } void goom_hash_put_int(GoomHash *_this, const char *key, int i) { - HashValue value; - value.i = i; - goom_hash_put(_this,key,value); + HashValue value; + value.i = i; + goom_hash_put(_this, key, value); } void goom_hash_put_float(GoomHash *_this, const char *key, float f) { - HashValue value; - value.f = f; - goom_hash_put(_this,key,value); + HashValue value; + value.f = f; + goom_hash_put(_this, key, value); } void goom_hash_put_ptr(GoomHash *_this, const char *key, void *ptr) { - HashValue value; - value.ptr = ptr; - goom_hash_put(_this,key,value); + HashValue value; + value.ptr = ptr; + goom_hash_put(_this, key, value); } /* FOR EACH */ -static void _goom_hash_for_each(GoomHash *_this, GoomHashEntry *entry, GH_Func func) -{ - if (entry == NULL) return; +static void _goom_hash_for_each(GoomHash *_this, GoomHashEntry *entry, + GH_Func func) { + if (entry == NULL) + return; func(_this, entry->key, &(entry->value)); _goom_hash_for_each(_this, entry->lower, func); _goom_hash_for_each(_this, entry->upper, func); @@ -116,6 +116,4 @@ void goom_hash_for_each(GoomHash *_this, GH_Func func) { _goom_hash_for_each(_this, _this->root, func); } -int goom_hash_number_of_puts(GoomHash *_this) { - return _this->number_of_puts; -} +int goom_hash_number_of_puts(GoomHash *_this) { return _this->number_of_puts; } diff --git a/libvisual-plugins/plugins/actor/goom2k4/goomsl_hash.h b/libvisual-plugins/plugins/actor/goom2k4/goomsl_hash.h index d5e3fab60..35f243566 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goomsl_hash.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goomsl_hash.h @@ -5,32 +5,32 @@ typedef struct GOOM_HASH_ENTRY GoomHashEntry; typedef struct GOOM_HASH GoomHash; typedef union { - void *ptr; - int i; - float f; + void *ptr; + int i; + float f; } HashValue; struct GOOM_HASH_ENTRY { - char *key; - HashValue value; - GoomHashEntry *lower; - GoomHashEntry *upper; + char *key; + HashValue value; + GoomHashEntry *lower; + GoomHashEntry *upper; }; struct GOOM_HASH { - GoomHashEntry *root; - int number_of_puts; + GoomHashEntry *root; + int number_of_puts; }; GoomHash *goom_hash_new(void); -void goom_hash_free(GoomHash *gh); +void goom_hash_free(GoomHash *gh); void goom_hash_put(GoomHash *gh, const char *key, HashValue value); HashValue *goom_hash_get(GoomHash *gh, const char *key); -void goom_hash_put_int (GoomHash *_this, const char *key, int i); +void goom_hash_put_int(GoomHash *_this, const char *key, int i); void goom_hash_put_float(GoomHash *_this, const char *key, float f); -void goom_hash_put_ptr (GoomHash *_this, const char *key, void *ptr); +void goom_hash_put_ptr(GoomHash *_this, const char *key, void *ptr); typedef void (*GH_Func)(GoomHash *caller, const char *key, HashValue *value); diff --git a/libvisual-plugins/plugins/actor/goom2k4/goomsl_heap.c b/libvisual-plugins/plugins/actor/goom2k4/goomsl_heap.c index 2660ff2f9..4460dc093 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goomsl_heap.c +++ b/libvisual-plugins/plugins/actor/goom2k4/goomsl_heap.c @@ -10,97 +10,98 @@ struct _GOOM_HEAP { }; /* Constructors / Destructor */ -GoomHeap *goom_heap_new(void) -{ - return goom_heap_new_with_granularity(4096); -} +GoomHeap *goom_heap_new(void) { return goom_heap_new_with_granularity(4096); } -GoomHeap *goom_heap_new_with_granularity(int granularity) -{ +GoomHeap *goom_heap_new_with_granularity(int granularity) { GoomHeap *_this; - _this = (GoomHeap*)malloc(sizeof(GoomHeap)); - _this->number_of_arrays = 0; + _this = (GoomHeap *)malloc(sizeof(GoomHeap)); + _this->number_of_arrays = 0; _this->size_of_each_array = granularity; _this->consumed_in_last_array = 0; - _this->arrays = (void**)malloc(sizeof(void*)); + _this->arrays = (void **)malloc(sizeof(void *)); return _this; } -void goom_heap_delete(GoomHeap *_this) -{ +void goom_heap_delete(GoomHeap *_this) { int i; - for (i=0;i<_this->number_of_arrays;++i) { + for (i = 0; i < _this->number_of_arrays; ++i) { free(_this->arrays[i]); } free(_this->arrays); free(_this); } -static void align_it(GoomHeap *_this, int alignment) -{ - if ((alignment > 1) && (_this->number_of_arrays>0)) { +static void align_it(GoomHeap *_this, int alignment) { + if ((alignment > 1) && (_this->number_of_arrays > 0)) { void *last_array = _this->arrays[_this->number_of_arrays - 1]; - intptr_t last_address = (intptr_t)last_array + _this->consumed_in_last_array; - int decal = (last_address % alignment); + intptr_t last_address = + (intptr_t)last_array + _this->consumed_in_last_array; + int decal = (last_address % alignment); if (decal != 0) { _this->consumed_in_last_array += alignment - decal; } } } -void *goom_heap_malloc_with_alignment_prefixed(GoomHeap *_this, int nb_bytes, - int alignment, int prefix_bytes) -{ +void *goom_heap_malloc_with_alignment_prefixed(GoomHeap *_this, int nb_bytes, + int alignment, + int prefix_bytes) { void *retval = NULL; - + /* d'abord on gere les problemes d'alignement */ _this->consumed_in_last_array += prefix_bytes; align_it(_this, alignment); - /* ensuite on verifie que la quantite de memoire demandee tient dans le buffer */ - if ((_this->consumed_in_last_array + nb_bytes >= _this->size_of_each_array) - || (_this->number_of_arrays == 0)) { + /* ensuite on verifie que la quantite de memoire demandee tient dans le buffer + */ + if ((_this->consumed_in_last_array + nb_bytes >= _this->size_of_each_array) || + (_this->number_of_arrays == 0)) { if (prefix_bytes + nb_bytes + alignment >= _this->size_of_each_array) { /* Si la zone demandee est plus grosse que la granularitee */ /* On alloue un buffer plus gros que les autres */ - _this->arrays = (void**)realloc(_this->arrays, sizeof(void*) * (_this->number_of_arrays+2)); - + _this->arrays = (void **)realloc( + _this->arrays, sizeof(void *) * (_this->number_of_arrays + 2)); + _this->number_of_arrays += 1; _this->consumed_in_last_array = prefix_bytes; - - _this->arrays[_this->number_of_arrays - 1] = malloc(prefix_bytes + nb_bytes + alignment); - align_it(_this,alignment); - retval = (void*)((char*)_this->arrays[_this->number_of_arrays - 1] + _this->consumed_in_last_array); + + _this->arrays[_this->number_of_arrays - 1] = + malloc(prefix_bytes + nb_bytes + alignment); + align_it(_this, alignment); + retval = (void *)((char *)_this->arrays[_this->number_of_arrays - 1] + + _this->consumed_in_last_array); /* puis on repart sur un nouveau buffer vide */ _this->number_of_arrays += 1; _this->consumed_in_last_array = 0; - _this->arrays[_this->number_of_arrays - 1] = malloc(_this->size_of_each_array); + _this->arrays[_this->number_of_arrays - 1] = + malloc(_this->size_of_each_array); return retval; - } - else { + } else { _this->number_of_arrays += 1; _this->consumed_in_last_array = prefix_bytes; - _this->arrays = (void**)realloc(_this->arrays, sizeof(void*) * _this->number_of_arrays); + _this->arrays = (void **)realloc( + _this->arrays, sizeof(void *) * _this->number_of_arrays); - _this->arrays[_this->number_of_arrays - 1] = malloc(_this->size_of_each_array); - align_it(_this,alignment); + _this->arrays[_this->number_of_arrays - 1] = + malloc(_this->size_of_each_array); + align_it(_this, alignment); } } - retval = (void*)((char*)_this->arrays[_this->number_of_arrays - 1] + _this->consumed_in_last_array); + retval = (void *)((char *)_this->arrays[_this->number_of_arrays - 1] + + _this->consumed_in_last_array); _this->consumed_in_last_array += nb_bytes; return retval; } -void *goom_heap_malloc_with_alignment(GoomHeap *_this, int nb_bytes, int alignment) -{ - return goom_heap_malloc_with_alignment_prefixed(_this, nb_bytes, alignment, 0); +void *goom_heap_malloc_with_alignment(GoomHeap *_this, int nb_bytes, + int alignment) { + return goom_heap_malloc_with_alignment_prefixed(_this, nb_bytes, alignment, + 0); } -void *goom_heap_malloc(GoomHeap *_this, int nb_bytes) -{ - return goom_heap_malloc_with_alignment(_this,nb_bytes,1); +void *goom_heap_malloc(GoomHeap *_this, int nb_bytes) { + return goom_heap_malloc_with_alignment(_this, nb_bytes, 1); } - diff --git a/libvisual-plugins/plugins/actor/goom2k4/goomsl_heap.h b/libvisual-plugins/plugins/actor/goom2k4/goomsl_heap.h index a22bac695..bff5fcbcb 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goomsl_heap.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goomsl_heap.h @@ -14,16 +14,16 @@ typedef struct _GOOM_HEAP GoomHeap; /* Constructors / Destructor */ GoomHeap *goom_heap_new(void); GoomHeap *goom_heap_new_with_granularity(int granularity); -void goom_heap_delete(GoomHeap *_this); +void goom_heap_delete(GoomHeap *_this); /* This method behaves like malloc. */ -void *goom_heap_malloc(GoomHeap *_this, int nb_bytes); +void *goom_heap_malloc(GoomHeap *_this, int nb_bytes); /* This adds an alignment constraint. */ -void *goom_heap_malloc_with_alignment(GoomHeap *_this, int nb_bytes, int alignment); +void *goom_heap_malloc_with_alignment(GoomHeap *_this, int nb_bytes, + int alignment); /* Returns a pointeur on the bytes... prefix is before */ -void *goom_heap_malloc_with_alignment_prefixed(GoomHeap *_this, int nb_bytes, - int alignment, int prefix_bytes); +void *goom_heap_malloc_with_alignment_prefixed(GoomHeap *_this, int nb_bytes, + int alignment, int prefix_bytes); #endif - diff --git a/libvisual-plugins/plugins/actor/goom2k4/goomsl_private.h b/libvisual-plugins/plugins/actor/goom2k4/goomsl_private.h index 8be151577..bbe8ca542 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/goomsl_private.h +++ b/libvisual-plugins/plugins/actor/goom2k4/goomsl_private.h @@ -49,81 +49,81 @@ /* }}} */ typedef struct _ConstIntNodeType { /* {{{ */ - int val; -} ConstIntNodeType; /* }}} */ + int val; +} ConstIntNodeType; /* }}} */ typedef struct _ConstFloatNodeType { /* {{{ */ - float val; -} ConstFloatNodeType; /* }}} */ + float val; +} ConstFloatNodeType; /* }}} */ typedef struct _ConstPtrNodeType { /* {{{ */ - int id; -} ConstPtrNodeType; /* }}} */ + int id; +} ConstPtrNodeType; /* }}} */ typedef struct _OprNodeType { /* {{{ */ - int type; - int nbOp; - struct _NODE_TYPE *op[3]; /* maximal number of operand needed */ - struct _NODE_TYPE *next; -} OprNodeType; /* }}} */ + int type; + int nbOp; + struct _NODE_TYPE *op[3]; /* maximal number of operand needed */ + struct _NODE_TYPE *next; +} OprNodeType; /* }}} */ typedef struct _NODE_TYPE { /* {{{ */ - int type; - char *str; - GoomHash *vnamespace; - int line_number; - union { - ConstIntNodeType constInt; - ConstFloatNodeType constFloat; - ConstPtrNodeType constPtr; - OprNodeType opr; - } unode; -} NodeType; /* }}} */ + int type; + char *str; + GoomHash *vnamespace; + int line_number; + union { + ConstIntNodeType constInt; + ConstFloatNodeType constFloat; + ConstPtrNodeType constPtr; + OprNodeType opr; + } unode; +} NodeType; /* }}} */ typedef struct _INSTRUCTION_DATA { /* {{{ */ - + union { - void *var; - int *var_int; - int *var_ptr; + void *var; + int *var_int; + int *var_ptr; float *var_float; - int jump_offset; + int jump_offset; struct _ExternalFunctionStruct *external_function; } udest; union { - void *var; - int *var_int; - int *var_ptr; + void *var; + int *var_int; + int *var_ptr; float *var_float; - int value_int; - int value_ptr; - float value_float; + int value_int; + int value_ptr; + float value_float; } usrc; } InstructionData; /* }}} */ typedef struct _INSTRUCTION { /* {{{ */ - int id; - InstructionData data; - GoomSL *parent; - const char *name; /* name of the instruction */ + int id; + InstructionData data; + GoomSL *parent; + const char *name; /* name of the instruction */ - char **params; /* parametres de l'instruction */ - GoomHash **vnamespace; - int *types; /* type des parametres de l'instruction */ - int cur_param; - int nb_param; + char **params; /* parametres de l'instruction */ + GoomHash **vnamespace; + int *types; /* type des parametres de l'instruction */ + int cur_param; + int nb_param; - int address; - char *jump_label; - char *nop_label; + int address; + char *jump_label; + char *nop_label; - int line_number; + int line_number; } Instruction; /* }}} */ typedef struct _INSTRUCTION_FLOW { /* {{{ */ - Instruction **instr; - int number; - int tabsize; - GoomHash *labels; + Instruction **instr; + int number; + int tabsize; + GoomHash *labels; } InstructionFlow; /* }}} */ typedef struct _FAST_INSTRUCTION { /* {{{ */ @@ -145,15 +145,15 @@ typedef struct _ExternalFunctionStruct { /* {{{ */ } ExternalFunctionStruct; /* }}} */ typedef struct _Block { - int data; - int size; + int data; + int size; } Block; typedef struct _GSL_StructField { /* {{{ */ - int type; + int type; char name[256]; - int offsetInStruct; /* Where this field is stored... */ + int offsetInStruct; /* Where this field is stored... */ } GSL_StructField; - /* }}} */ +/* }}} */ typedef struct _GSL_Struct { /* {{{ */ int nbFields; GSL_StructField *fields[64]; @@ -161,41 +161,42 @@ typedef struct _GSL_Struct { /* {{{ */ Block iBlock[64]; Block fBlock[64]; } GSL_Struct; - /* }}} */ +/* }}} */ struct _GoomSL { /* {{{ */ - int num_lines; - Instruction *instr; /* instruction en cours de construction */ - - InstructionFlow *iflow; /* flow d'instruction 'normal' */ - FastInstructionFlow *fastiflow; /* flow d'instruction optimise */ - - GoomHash *vars; /* table de variables */ - int currentNS; - GoomHash *namespaces[16]; - - GoomHash *functions; /* table des fonctions externes */ - - GoomHeap *data_heap; /* GSL Heap-like memory space */ - - int nbStructID; - GoomHash *structIDS; - GSL_Struct **gsl_struct; - int gsl_struct_size; - - int nbPtr; - int ptrArraySize; - void **ptrArray; - - int compilationOK; + int num_lines; + Instruction *instr; /* instruction en cours de construction */ + + InstructionFlow *iflow; /* flow d'instruction 'normal' */ + FastInstructionFlow *fastiflow; /* flow d'instruction optimise */ + + GoomHash *vars; /* table de variables */ + int currentNS; + GoomHash *namespaces[16]; + + GoomHash *functions; /* table des fonctions externes */ + + GoomHeap *data_heap; /* GSL Heap-like memory space */ + + int nbStructID; + GoomHash *structIDS; + GSL_Struct **gsl_struct; + int gsl_struct_size; + + int nbPtr; + int ptrArraySize; + void **ptrArray; + + int compilationOK; #ifdef USE_JITC_X86 - JitcX86Env *jitc; - JitcFunc jitc_func; + JitcX86Env *jitc; + JitcFunc jitc_func; #endif }; /* }}} */ extern GoomSL *currentGoomSL; -Instruction *gsl_instr_init(GoomSL *parent, const char *name, int id, int nb_param, int line_number); +Instruction *gsl_instr_init(GoomSL *parent, const char *name, int id, + int nb_param, int line_number); void gsl_instr_add_param(Instruction *_this, char *param, int type); void gsl_instr_set_namespace(Instruction *_this, GoomHash *ns); @@ -215,37 +216,36 @@ void gsl_commit_compilation(void); #define FIRST_RESERVED 0x80000 -#define TYPE_INTEGER 0x90001 -#define TYPE_FLOAT 0x90002 -#define TYPE_VAR 0x90003 -#define TYPE_PTR 0x90004 -#define TYPE_LABEL 0x90005 +#define TYPE_INTEGER 0x90001 +#define TYPE_FLOAT 0x90002 +#define TYPE_VAR 0x90003 +#define TYPE_PTR 0x90004 +#define TYPE_LABEL 0x90005 #define TYPE_OP_EQUAL 6 -#define TYPE_IVAR 0xa0001 -#define TYPE_FVAR 0xa0002 -#define TYPE_PVAR 0xa0003 -#define TYPE_SVAR 0xa0004 - -#define INSTR_JUMP 6 -#define INSTR_JZERO 29 -#define INSTR_CALL 36 -#define INSTR_RET 37 +#define TYPE_IVAR 0xa0001 +#define TYPE_FVAR 0xa0002 +#define TYPE_PVAR 0xa0003 +#define TYPE_SVAR 0xa0004 + +#define INSTR_JUMP 6 +#define INSTR_JZERO 29 +#define INSTR_CALL 36 +#define INSTR_RET 37 #define INSTR_EXT_CALL 38 -#define INSTR_JNZERO 40 +#define INSTR_JNZERO 40 -#define INSTR_SET 0x80001 -#define INSTR_INT 0x80002 -#define INSTR_FLOAT 0x80003 -#define INSTR_PTR 0x80004 -#define INSTR_LABEL 0x80005 +#define INSTR_SET 0x80001 +#define INSTR_INT 0x80002 +#define INSTR_FLOAT 0x80003 +#define INSTR_PTR 0x80004 +#define INSTR_LABEL 0x80005 #define INSTR_ISLOWER 0x80006 -#define INSTR_ADD 0x80007 -#define INSTR_MUL 0x80008 -#define INSTR_DIV 0x80009 -#define INSTR_SUB 0x80010 +#define INSTR_ADD 0x80007 +#define INSTR_MUL 0x80008 +#define INSTR_DIV 0x80009 +#define INSTR_SUB 0x80010 #define INSTR_ISEQUAL 0x80011 -#define INSTR_NOT 0x80012 - +#define INSTR_NOT 0x80012 #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/graphic.c b/libvisual-plugins/plugins/actor/goom2k4/graphic.c index 2ee71a6dd..307acdb7f 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/graphic.c +++ b/libvisual-plugins/plugins/actor/goom2k4/graphic.c @@ -1,10 +1,10 @@ #include "goom_graphic.h" -const Color BLACK = { 0, 0, 0 }; -const Color WHITE = { 0xff, 0xff, 0xff }; -const Color RED = { 0xff, 0x05, 0x05 }; -const Color GREEN = { 0x05, 0xff, 0x05 }; -const Color BLUE = { 0x05, 0x05, 0xff }; -const Color YELLOW = { 0xff, 0xff, 0x33 }; -const Color ORANGE = { 0xff, 0xcc, 0x05 }; -const Color VIOLET = { 0x55, 0x05, 0xff }; +const Color BLACK = {0, 0, 0}; +const Color WHITE = {0xff, 0xff, 0xff}; +const Color RED = {0xff, 0x05, 0x05}; +const Color GREEN = {0x05, 0xff, 0x05}; +const Color BLUE = {0x05, 0x05, 0xff}; +const Color YELLOW = {0xff, 0xff, 0x33}; +const Color ORANGE = {0xff, 0xcc, 0x05}; +const Color VIOLET = {0x55, 0x05, 0xff}; diff --git a/libvisual-plugins/plugins/actor/goom2k4/ifs.c b/libvisual-plugins/plugins/actor/goom2k4/ifs.c index 3432694c6..66679517b 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/ifs.c +++ b/libvisual-plugins/plugins/actor/goom2k4/ifs.c @@ -24,10 +24,9 @@ * * Revision History: * 13-Dec-2003: Added some goom specific stuffs (to make ifs a VisualFX). - * 11-Apr-2002: jeko@ios-software.com: Make ifs.c system-indendant. (ifs.h added) - * 01-Nov-2000: Allocation checks - * 10-May-1997: jwz@jwz.org: turned into a standalone program. - * Made it render into an offscreen bitmap and then copy + * 11-Apr-2002: jeko@ios-software.com: Make ifs.c system-indendant. (ifs.h + * added) 01-Nov-2000: Allocation checks 10-May-1997: jwz@jwz.org: turned into a + * standalone program. Made it render into an offscreen bitmap and then copy * that onto the screen, to reduce flicker. */ @@ -48,12 +47,9 @@ #include "ifs.h" #include "goom_tools.h" -typedef struct _ifsPoint -{ - int32_t x, y; -} -IFSPoint; - +typedef struct _ifsPoint { + int32_t x, y; +} IFSPoint; #define MODE_ifs @@ -64,15 +60,18 @@ IFSPoint; #define ifs_opts xlockmore_opts -#define DEFAULTS "*delay: 20000 \n" \ -"*ncolors: 100 \n" +#define DEFAULTS \ + "*delay: 20000 \n" \ + "*ncolors: 100 \n" #define SMOOTH_COLORS -#define LRAND() ((long) (goom_random(goomInfo->gRandom) & 0x7fffffff)) -#define NRAND(n) ((int) (LRAND() % (n))) +#define LRAND() ((long)(goom_random(goomInfo->gRandom) & 0x7fffffff)) +#define NRAND(n) ((int)(LRAND() % (n))) -#define MAXRAND (2147483648.0/127.0) /* unsigned 1<<31 / 127.0 (cf goom_tools) as a float */ +#define MAXRAND \ + (2147483648.0 / 127.0) /* unsigned 1<<31 / 127.0 (cf goom_tools) as a float \ + */ /*****************************************************/ @@ -84,15 +83,15 @@ typedef int F_PT; /*****************************************************/ #define FIX 12 -#define UNIT ( 1<c_x = Gauss_Rand (goomInfo, 0.0, .8, 4.0); - Cur->c_y = Gauss_Rand (goomInfo, 0.0, .8, 4.0); - Cur->r = Gauss_Rand (goomInfo, F->r_mean, F->dr_mean, 3.0); - Cur->r2 = Half_Gauss_Rand (goomInfo, 0.0, F->dr2_mean, 2.0); - Cur->A = Gauss_Rand (goomInfo, 0.0, 360.0, 4.0) * (M_PI / 180.0); - Cur->A2 = Gauss_Rand (goomInfo, 0.0, 360.0, 4.0) * (M_PI / 180.0); - Cur++; - } +static void Random_Simis(PluginInfo *goomInfo, FRACTAL *F, SIMI *Cur, int i) { + while (i--) { + Cur->c_x = Gauss_Rand(goomInfo, 0.0, .8, 4.0); + Cur->c_y = Gauss_Rand(goomInfo, 0.0, .8, 4.0); + Cur->r = Gauss_Rand(goomInfo, F->r_mean, F->dr_mean, 3.0); + Cur->r2 = Half_Gauss_Rand(goomInfo, 0.0, F->dr2_mean, 2.0); + Cur->A = Gauss_Rand(goomInfo, 0.0, 360.0, 4.0) * (M_PI / 180.0); + Cur->A2 = Gauss_Rand(goomInfo, 0.0, 360.0, 4.0) * (M_PI / 180.0); + Cur++; + } } -static void -free_ifs_buffers (FRACTAL * Fractal) -{ - if (Fractal->Buffer1 != NULL) { - (void) free ((void *) Fractal->Buffer1); - Fractal->Buffer1 = (IFSPoint *) NULL; - } - if (Fractal->Buffer2 != NULL) { - (void) free ((void *) Fractal->Buffer2); - Fractal->Buffer2 = (IFSPoint *) NULL; - } +static void free_ifs_buffers(FRACTAL *Fractal) { + if (Fractal->Buffer1 != NULL) { + (void)free((void *)Fractal->Buffer1); + Fractal->Buffer1 = (IFSPoint *)NULL; + } + if (Fractal->Buffer2 != NULL) { + (void)free((void *)Fractal->Buffer2); + Fractal->Buffer2 = (IFSPoint *)NULL; + } } - -static void -free_ifs (FRACTAL * Fractal) -{ - free_ifs_buffers (Fractal); -} +static void free_ifs(FRACTAL *Fractal) { free_ifs_buffers(Fractal); } /***************************************************************/ -static void -init_ifs (PluginInfo *goomInfo, IfsData *data) -{ - int i; - FRACTAL *Fractal; - int width = goomInfo->screen.width; - int height = goomInfo->screen.height; - - if (data->Root == NULL) { - data->Root = (FRACTAL *) malloc (sizeof (FRACTAL)); - if (data->Root == NULL) - return; - data->Root->Buffer1 = (IFSPoint *) NULL; - data->Root->Buffer2 = (IFSPoint *) NULL; - } - Fractal = data->Root; - - free_ifs_buffers (Fractal); - - i = (NRAND (4)) + 2; /* Number of centers */ - switch (i) { - case 3: - Fractal->Depth = MAX_DEPTH_3; - Fractal->r_mean = .6; - Fractal->dr_mean = .4; - Fractal->dr2_mean = .3; - break; - - case 4: - Fractal->Depth = MAX_DEPTH_4; - Fractal->r_mean = .5; - Fractal->dr_mean = .4; - Fractal->dr2_mean = .3; - break; - - case 5: - Fractal->Depth = MAX_DEPTH_5; - Fractal->r_mean = .5; - Fractal->dr_mean = .4; - Fractal->dr2_mean = .3; - break; - - default: - case 2: - Fractal->Depth = MAX_DEPTH_2; - Fractal->r_mean = .7; - Fractal->dr_mean = .3; - Fractal->dr2_mean = .4; - break; - } - Fractal->Nb_Simi = i; - Fractal->Max_Pt = Fractal->Nb_Simi - 1; - for (i = 0; i <= Fractal->Depth + 2; ++i) - Fractal->Max_Pt *= Fractal->Nb_Simi; - - if ((Fractal->Buffer1 = (IFSPoint *) calloc (Fractal->Max_Pt, - sizeof (IFSPoint))) == NULL) { - free_ifs (Fractal); - return; - } - if ((Fractal->Buffer2 = (IFSPoint *) calloc (Fractal->Max_Pt, - sizeof (IFSPoint))) == NULL) { - free_ifs (Fractal); - return; - } - - Fractal->Speed = 6; - Fractal->Width = width; /* modif by JeKo */ - Fractal->Height = height; /* modif by JeKo */ - Fractal->Cur_Pt = 0; - Fractal->Count = 0; - Fractal->Lx = (Fractal->Width - 1) / 2; - Fractal->Ly = (Fractal->Height - 1) / 2; - Fractal->Col = visual_rand() % (width * height); /* modif by JeKo */ - - Random_Simis (goomInfo, Fractal, Fractal->Components, 5 * MAX_SIMI); +static void init_ifs(PluginInfo *goomInfo, IfsData *data) { + int i; + FRACTAL *Fractal; + int width = goomInfo->screen.width; + int height = goomInfo->screen.height; + + if (data->Root == NULL) { + data->Root = (FRACTAL *)malloc(sizeof(FRACTAL)); + if (data->Root == NULL) + return; + data->Root->Buffer1 = (IFSPoint *)NULL; + data->Root->Buffer2 = (IFSPoint *)NULL; + } + Fractal = data->Root; + + free_ifs_buffers(Fractal); + + i = (NRAND(4)) + 2; /* Number of centers */ + switch (i) { + case 3: + Fractal->Depth = MAX_DEPTH_3; + Fractal->r_mean = .6; + Fractal->dr_mean = .4; + Fractal->dr2_mean = .3; + break; + + case 4: + Fractal->Depth = MAX_DEPTH_4; + Fractal->r_mean = .5; + Fractal->dr_mean = .4; + Fractal->dr2_mean = .3; + break; + + case 5: + Fractal->Depth = MAX_DEPTH_5; + Fractal->r_mean = .5; + Fractal->dr_mean = .4; + Fractal->dr2_mean = .3; + break; + + default: + case 2: + Fractal->Depth = MAX_DEPTH_2; + Fractal->r_mean = .7; + Fractal->dr_mean = .3; + Fractal->dr2_mean = .4; + break; + } + Fractal->Nb_Simi = i; + Fractal->Max_Pt = Fractal->Nb_Simi - 1; + for (i = 0; i <= Fractal->Depth + 2; ++i) + Fractal->Max_Pt *= Fractal->Nb_Simi; + + if ((Fractal->Buffer1 = + (IFSPoint *)calloc(Fractal->Max_Pt, sizeof(IFSPoint))) == NULL) { + free_ifs(Fractal); + return; + } + if ((Fractal->Buffer2 = + (IFSPoint *)calloc(Fractal->Max_Pt, sizeof(IFSPoint))) == NULL) { + free_ifs(Fractal); + return; + } + + Fractal->Speed = 6; + Fractal->Width = width; /* modif by JeKo */ + Fractal->Height = height; /* modif by JeKo */ + Fractal->Cur_Pt = 0; + Fractal->Count = 0; + Fractal->Lx = (Fractal->Width - 1) / 2; + Fractal->Ly = (Fractal->Height - 1) / 2; + Fractal->Col = visual_rand() % (width * height); /* modif by JeKo */ + + Random_Simis(goomInfo, Fractal, Fractal->Components, 5 * MAX_SIMI); } - /***************************************************************/ -static inline void -Transform (SIMI * Simi, F_PT xo, F_PT yo, F_PT * x, F_PT * y) -{ - F_PT xx, yy; - - xo = xo - Simi->Cx; - xo = (xo * Simi->R) >> FIX; /* / UNIT; */ - yo = yo - Simi->Cy; - yo = (yo * Simi->R) >> FIX; /* / UNIT; */ - - xx = xo - Simi->Cx; - xx = (xx * Simi->R2) >> FIX; /* / UNIT; */ - yy = -yo - Simi->Cy; - yy = (yy * Simi->R2) >> FIX; /* / UNIT; */ - - *x = - ((xo * Simi->Ct - yo * Simi->St + xx * Simi->Ct2 - yy * Simi->St2) - >> FIX /* / UNIT */ ) + Simi->Cx; - *y = - ((xo * Simi->St + yo * Simi->Ct + xx * Simi->St2 + yy * Simi->Ct2) - >> FIX /* / UNIT */ ) + Simi->Cy; +static inline void Transform(SIMI *Simi, F_PT xo, F_PT yo, F_PT *x, F_PT *y) { + F_PT xx, yy; + + xo = xo - Simi->Cx; + xo = (xo * Simi->R) >> FIX; /* / UNIT; */ + yo = yo - Simi->Cy; + yo = (yo * Simi->R) >> FIX; /* / UNIT; */ + + xx = xo - Simi->Cx; + xx = (xx * Simi->R2) >> FIX; /* / UNIT; */ + yy = -yo - Simi->Cy; + yy = (yy * Simi->R2) >> FIX; /* / UNIT; */ + + *x = ((xo * Simi->Ct - yo * Simi->St + xx * Simi->Ct2 - yy * Simi->St2) >> + FIX /* / UNIT */) + + Simi->Cx; + *y = ((xo * Simi->St + yo * Simi->Ct + xx * Simi->St2 + yy * Simi->Ct2) >> + FIX /* / UNIT */) + + Simi->Cy; } /***************************************************************/ -static void -Trace (FRACTAL * F, F_PT xo, F_PT yo, IfsData *data) -{ - F_PT x, y, i; - SIMI *Cur; +static void Trace(FRACTAL *F, F_PT xo, F_PT yo, IfsData *data) { + F_PT x, y, i; + SIMI *Cur; - Cur = data->Cur_F->Components; - for (i = data->Cur_F->Nb_Simi; i; --i, Cur++) { - Transform (Cur, xo, yo, &x, &y); + Cur = data->Cur_F->Components; + for (i = data->Cur_F->Nb_Simi; i; --i, Cur++) { + Transform(Cur, xo, yo, &x, &y); - data->Buf->x = F->Lx + ((x * F->Lx) >> (FIX+1) /* /(UNIT*2) */ ); - data->Buf->y = F->Ly - ((y * F->Ly) >> (FIX+1) /* /(UNIT*2) */ ); - data->Buf++; + data->Buf->x = F->Lx + ((x * F->Lx) >> (FIX + 1) /* /(UNIT*2) */); + data->Buf->y = F->Ly - ((y * F->Ly) >> (FIX + 1) /* /(UNIT*2) */); + data->Buf++; - data->Cur_Pt++; + data->Cur_Pt++; - if (F->Depth && ((x - xo) >> 4) && ((y - yo) >> 4)) { - F->Depth--; - Trace (F, x, y, data); - F->Depth++; - } - } + if (F->Depth && ((x - xo) >> 4) && ((y - yo) >> 4)) { + F->Depth--; + Trace(F, x, y, data); + F->Depth++; + } + } } -static void -Draw_Fractal (IfsData *data) -{ - FRACTAL *F = data->Root; - int i, j; - F_PT x, y, xo, yo; - SIMI *Cur, *Simi; - - for (Cur = F->Components, i = F->Nb_Simi; i; --i, Cur++) { - Cur->Cx = DBL_To_F_PT (Cur->c_x); - Cur->Cy = DBL_To_F_PT (Cur->c_y); - - Cur->Ct = DBL_To_F_PT (cos (Cur->A)); - Cur->St = DBL_To_F_PT (sin (Cur->A)); - Cur->Ct2 = DBL_To_F_PT (cos (Cur->A2)); - Cur->St2 = DBL_To_F_PT (sin (Cur->A2)); - - Cur->R = DBL_To_F_PT (Cur->r); - Cur->R2 = DBL_To_F_PT (Cur->r2); - } - - - data->Cur_Pt = 0; - data->Cur_F = F; - data->Buf = F->Buffer2; - for (Cur = F->Components, i = F->Nb_Simi; i; --i, Cur++) { - xo = Cur->Cx; - yo = Cur->Cy; - for (Simi = F->Components, j = F->Nb_Simi; j; --j, Simi++) { - if (Simi == Cur) - continue; - Transform (Simi, xo, yo, &x, &y); - Trace (F, x, y, data); - } - } - - /* Erase previous */ - - F->Cur_Pt = data->Cur_Pt; - data->Buf = F->Buffer1; - F->Buffer1 = F->Buffer2; - F->Buffer2 = data->Buf; +static void Draw_Fractal(IfsData *data) { + FRACTAL *F = data->Root; + int i, j; + F_PT x, y, xo, yo; + SIMI *Cur, *Simi; + + for (Cur = F->Components, i = F->Nb_Simi; i; --i, Cur++) { + Cur->Cx = DBL_To_F_PT(Cur->c_x); + Cur->Cy = DBL_To_F_PT(Cur->c_y); + + Cur->Ct = DBL_To_F_PT(cos(Cur->A)); + Cur->St = DBL_To_F_PT(sin(Cur->A)); + Cur->Ct2 = DBL_To_F_PT(cos(Cur->A2)); + Cur->St2 = DBL_To_F_PT(sin(Cur->A2)); + + Cur->R = DBL_To_F_PT(Cur->r); + Cur->R2 = DBL_To_F_PT(Cur->r2); + } + + data->Cur_Pt = 0; + data->Cur_F = F; + data->Buf = F->Buffer2; + for (Cur = F->Components, i = F->Nb_Simi; i; --i, Cur++) { + xo = Cur->Cx; + yo = Cur->Cy; + for (Simi = F->Components, j = F->Nb_Simi; j; --j, Simi++) { + if (Simi == Cur) + continue; + Transform(Simi, xo, yo, &x, &y); + Trace(F, x, y, data); + } + } + + /* Erase previous */ + + F->Cur_Pt = data->Cur_Pt; + data->Buf = F->Buffer1; + F->Buffer1 = F->Buffer2; + F->Buffer2 = data->Buf; } - -static IFSPoint * -draw_ifs (PluginInfo *goomInfo, int *nbpt, IfsData *data) -{ - int i; - DBL u, uu, v, vv, u0, u1, u2, u3; - SIMI *S, *S1, *S2, *S3, *S4; - FRACTAL *F; - - if (data->Root == NULL) - return NULL; - F = data->Root; - if (F->Buffer1 == NULL) - return NULL; - - u = (DBL) (F->Count) * (DBL) (F->Speed) / 1000.0; - uu = u * u; - v = 1.0 - u; - vv = v * v; - u0 = vv * v; - u1 = 3.0 * vv * u; - u2 = 3.0 * v * uu; - u3 = u * uu; - - S = F->Components; - S1 = S + F->Nb_Simi; - S2 = S1 + F->Nb_Simi; - S3 = S2 + F->Nb_Simi; - S4 = S3 + F->Nb_Simi; - - for (i = F->Nb_Simi; i; --i, S++, S1++, S2++, S3++, S4++) { - S->c_x = u0 * S1->c_x + u1 * S2->c_x + u2 * S3->c_x + u3 * S4->c_x; - S->c_y = u0 * S1->c_y + u1 * S2->c_y + u2 * S3->c_y + u3 * S4->c_y; - S->r = u0 * S1->r + u1 * S2->r + u2 * S3->r + u3 * S4->r; - S->r2 = u0 * S1->r2 + u1 * S2->r2 + u2 * S3->r2 + u3 * S4->r2; - S->A = u0 * S1->A + u1 * S2->A + u2 * S3->A + u3 * S4->A; - S->A2 = u0 * S1->A2 + u1 * S2->A2 + u2 * S3->A2 + u3 * S4->A2; - } - - Draw_Fractal (data); - - if (F->Count >= 1000 / F->Speed) { - S = F->Components; - S1 = S + F->Nb_Simi; - S2 = S1 + F->Nb_Simi; - S3 = S2 + F->Nb_Simi; - S4 = S3 + F->Nb_Simi; - - for (i = F->Nb_Simi; i; --i, S++, S1++, S2++, S3++, S4++) { - S2->c_x = 2.0 * S4->c_x - S3->c_x; - S2->c_y = 2.0 * S4->c_y - S3->c_y; - S2->r = 2.0 * S4->r - S3->r; - S2->r2 = 2.0 * S4->r2 - S3->r2; - S2->A = 2.0 * S4->A - S3->A; - S2->A2 = 2.0 * S4->A2 - S3->A2; - - *S1 = *S4; - } - Random_Simis (goomInfo, F, F->Components + 3 * F->Nb_Simi, F->Nb_Simi); - - Random_Simis (goomInfo, F, F->Components + 4 * F->Nb_Simi, F->Nb_Simi); - - F->Count = 0; - } - else - F->Count++; - - F->Col++; - - (*nbpt) = data->Cur_Pt; - return F->Buffer2; +static IFSPoint *draw_ifs(PluginInfo *goomInfo, int *nbpt, IfsData *data) { + int i; + DBL u, uu, v, vv, u0, u1, u2, u3; + SIMI *S, *S1, *S2, *S3, *S4; + FRACTAL *F; + + if (data->Root == NULL) + return NULL; + F = data->Root; + if (F->Buffer1 == NULL) + return NULL; + + u = (DBL)(F->Count) * (DBL)(F->Speed) / 1000.0; + uu = u * u; + v = 1.0 - u; + vv = v * v; + u0 = vv * v; + u1 = 3.0 * vv * u; + u2 = 3.0 * v * uu; + u3 = u * uu; + + S = F->Components; + S1 = S + F->Nb_Simi; + S2 = S1 + F->Nb_Simi; + S3 = S2 + F->Nb_Simi; + S4 = S3 + F->Nb_Simi; + + for (i = F->Nb_Simi; i; --i, S++, S1++, S2++, S3++, S4++) { + S->c_x = u0 * S1->c_x + u1 * S2->c_x + u2 * S3->c_x + u3 * S4->c_x; + S->c_y = u0 * S1->c_y + u1 * S2->c_y + u2 * S3->c_y + u3 * S4->c_y; + S->r = u0 * S1->r + u1 * S2->r + u2 * S3->r + u3 * S4->r; + S->r2 = u0 * S1->r2 + u1 * S2->r2 + u2 * S3->r2 + u3 * S4->r2; + S->A = u0 * S1->A + u1 * S2->A + u2 * S3->A + u3 * S4->A; + S->A2 = u0 * S1->A2 + u1 * S2->A2 + u2 * S3->A2 + u3 * S4->A2; + } + + Draw_Fractal(data); + + if (F->Count >= 1000 / F->Speed) { + S = F->Components; + S1 = S + F->Nb_Simi; + S2 = S1 + F->Nb_Simi; + S3 = S2 + F->Nb_Simi; + S4 = S3 + F->Nb_Simi; + + for (i = F->Nb_Simi; i; --i, S++, S1++, S2++, S3++, S4++) { + S2->c_x = 2.0 * S4->c_x - S3->c_x; + S2->c_y = 2.0 * S4->c_y - S3->c_y; + S2->r = 2.0 * S4->r - S3->r; + S2->r2 = 2.0 * S4->r2 - S3->r2; + S2->A = 2.0 * S4->A - S3->A; + S2->A2 = 2.0 * S4->A2 - S3->A2; + + *S1 = *S4; + } + Random_Simis(goomInfo, F, F->Components + 3 * F->Nb_Simi, F->Nb_Simi); + + Random_Simis(goomInfo, F, F->Components + 4 * F->Nb_Simi, F->Nb_Simi); + + F->Count = 0; + } else + F->Count++; + + F->Col++; + + (*nbpt) = data->Cur_Pt; + return F->Buffer2; } - /***************************************************************/ -static void release_ifs (IfsData *data) -{ - if (data->Root != NULL) { - free_ifs (data->Root); - (void) free ((void *) data->Root); - data->Root = (FRACTAL *) NULL; - } +static void release_ifs(IfsData *data) { + if (data->Root != NULL) { + free_ifs(data->Root); + (void)free((void *)data->Root); + data->Root = (FRACTAL *)NULL; + } } #define RAND() goom_random(goomInfo->gRandom) -static void ifs_update (PluginInfo *goomInfo, Pixel * data, Pixel * back, int increment, IfsData *fx_data) -{ - static int couleur = 0xc0c0c0c0; - static int v[4] = { 2, 4, 3, 2 }; - static int col[4] = { 2, 4, 3, 2 }; +static void ifs_update(PluginInfo *goomInfo, Pixel *data, Pixel *back, + int increment, IfsData *fx_data) { + static int couleur = 0xc0c0c0c0; + static int v[4] = {2, 4, 3, 2}; + static int col[4] = {2, 4, 3, 2}; #define MOD_MER 0 #define MOD_FEU 1 #define MOD_MERVER 2 - static int mode = MOD_MERVER; - static int justChanged = 0; - static int cycle = 0; - int cycle10; + static int mode = MOD_MERVER; + static int justChanged = 0; + static int cycle = 0; + int cycle10; - int nbpt; - IFSPoint *points; - int i; + int nbpt; + IFSPoint *points; + int i; - int couleursl = couleur; - int width = goomInfo->screen.width; - int height = goomInfo->screen.height; + int couleursl = couleur; + int width = goomInfo->screen.width; + int height = goomInfo->screen.height; - cycle++; - if (cycle >= 80) - cycle = 0; + cycle++; + if (cycle >= 80) + cycle = 0; - if (cycle < 40) - cycle10 = cycle / 10; - else - cycle10 = 7 - cycle / 10; + if (cycle < 40) + cycle10 = cycle / 10; + else + cycle10 = 7 - cycle / 10; - { - unsigned char *tmp = (unsigned char *) &couleursl; + { + unsigned char *tmp = (unsigned char *)&couleursl; - for (i = 0; i < 4; i++) { - *tmp = (*tmp) >> cycle10; - tmp++; - } - } + for (i = 0; i < 4; i++) { + *tmp = (*tmp) >> cycle10; + tmp++; + } + } - points = draw_ifs (goomInfo, &nbpt, fx_data); - nbpt--; + points = draw_ifs(goomInfo, &nbpt, fx_data); + nbpt--; #ifdef HAVE_MMX - movd_m2r (couleursl, mm1); - punpckldq_r2r (mm1, mm1); - for (i = 0; i < nbpt; i += increment) { - int x = points[i].x; - int y = points[i].y; - - if ((x < width) && (y < height) && (x > 0) && (y > 0)) { - int pos = x + (y * width); - movd_m2r (back[pos], mm0); - paddusb_r2r (mm1, mm0); - movd_r2m (mm0, data[pos]); - } - } - emms();/*__asm__ __volatile__ ("emms");*/ + movd_m2r(couleursl, mm1); + punpckldq_r2r(mm1, mm1); + for (i = 0; i < nbpt; i += increment) { + int x = points[i].x; + int y = points[i].y; + + if ((x < width) && (y < height) && (x > 0) && (y > 0)) { + int pos = x + (y * width); + movd_m2r(back[pos], mm0); + paddusb_r2r(mm1, mm0); + movd_r2m(mm0, data[pos]); + } + } + emms(); /*__asm__ __volatile__ ("emms");*/ #else - for (i = 0; i < nbpt; i += increment) { - int x = (int) points[i].x & 0x7fffffff; - int y = (int) points[i].y & 0x7fffffff; - - if ((x < width) && (y < height)) { - int pos = x + (int) (y * width); - int tra = 0, i = 0; - unsigned char *bra = (unsigned char *) &back[pos]; - unsigned char *dra = (unsigned char *) &data[pos]; - unsigned char *cra = (unsigned char *) &couleursl; - - for (; i < 4; i++) { - tra = *cra; - tra += *bra; - if (tra > 255) - tra = 255; - *dra = tra; - ++dra; - ++cra; - ++bra; - } - } - } + for (i = 0; i < nbpt; i += increment) { + int x = (int)points[i].x & 0x7fffffff; + int y = (int)points[i].y & 0x7fffffff; + + if ((x < width) && (y < height)) { + int pos = x + (int)(y * width); + int tra = 0, i = 0; + unsigned char *bra = (unsigned char *)&back[pos]; + unsigned char *dra = (unsigned char *)&data[pos]; + unsigned char *cra = (unsigned char *)&couleursl; + + for (; i < 4; i++) { + tra = *cra; + tra += *bra; + if (tra > 255) + tra = 255; + *dra = tra; + ++dra; + ++cra; + ++bra; + } + } + } #endif /*MMX*/ - justChanged--; - - col[ALPHA] = couleur >> (ALPHA * 8) & 0xff; - col[BLEU] = couleur >> (BLEU * 8) & 0xff; - col[VERT] = couleur >> (VERT * 8) & 0xff; - col[ROUGE] = couleur >> (ROUGE * 8) & 0xff; - - if (mode == MOD_MER) { - col[BLEU] += v[BLEU]; - if (col[BLEU] > 255) { - col[BLEU] = 255; - v[BLEU] = -(RAND() % 4) - 1; - } - if (col[BLEU] < 32) { - col[BLEU] = 32; - v[BLEU] = (RAND() % 4) + 1; - } - - col[VERT] += v[VERT]; - if (col[VERT] > 200) { - col[VERT] = 200; - v[VERT] = -(RAND() % 3) - 2; - } - if (col[VERT] > col[BLEU]) { - col[VERT] = col[BLEU]; - v[VERT] = v[BLEU]; - } - if (col[VERT] < 32) { - col[VERT] = 32; - v[VERT] = (RAND() % 3) + 2; - } - - col[ROUGE] += v[ROUGE]; - if (col[ROUGE] > 64) { - col[ROUGE] = 64; - v[ROUGE] = -(RAND () % 4) - 1; - } - if (col[ROUGE] < 0) { - col[ROUGE] = 0; - v[ROUGE] = (RAND () % 4) + 1; - } - - col[ALPHA] += v[ALPHA]; - if (col[ALPHA] > 0) { - col[ALPHA] = 0; - v[ALPHA] = -(RAND () % 4) - 1; - } - if (col[ALPHA] < 0) { - col[ALPHA] = 0; - v[ALPHA] = (RAND () % 4) + 1; - } - - if (((col[VERT] > 32) && (col[ROUGE] < col[VERT] + 40) - && (col[VERT] < col[ROUGE] + 20) && (col[BLEU] < 64) - && (RAND () % 20 == 0)) && (justChanged < 0)) { - mode = RAND () % 3 ? MOD_FEU : MOD_MERVER; - justChanged = 250; - } - } - else if (mode == MOD_MERVER) { - col[BLEU] += v[BLEU]; - if (col[BLEU] > 128) { - col[BLEU] = 128; - v[BLEU] = -(RAND () % 4) - 1; - } - if (col[BLEU] < 16) { - col[BLEU] = 16; - v[BLEU] = (RAND () % 4) + 1; - } - - col[VERT] += v[VERT]; - if (col[VERT] > 200) { - col[VERT] = 200; - v[VERT] = -(RAND () % 3) - 2; - } - if (col[VERT] > col[ALPHA]) { - col[VERT] = col[ALPHA]; - v[VERT] = v[ALPHA]; - } - if (col[VERT] < 32) { - col[VERT] = 32; - v[VERT] = (RAND () % 3) + 2; - } - - col[ROUGE] += v[ROUGE]; - if (col[ROUGE] > 128) { - col[ROUGE] = 128; - v[ROUGE] = -(RAND () % 4) - 1; - } - if (col[ROUGE] < 0) { - col[ROUGE] = 0; - v[ROUGE] = (RAND () % 4) + 1; - } - - col[ALPHA] += v[ALPHA]; - if (col[ALPHA] > 255) { - col[ALPHA] = 255; - v[ALPHA] = -(RAND () % 4) - 1; - } - if (col[ALPHA] < 0) { - col[ALPHA] = 0; - v[ALPHA] = (RAND () % 4) + 1; - } - - if (((col[VERT] > 32) && (col[ROUGE] < col[VERT] + 40) - && (col[VERT] < col[ROUGE] + 20) && (col[BLEU] < 64) - && (RAND () % 20 == 0)) && (justChanged < 0)) { - mode = RAND () % 3 ? MOD_FEU : MOD_MER; - justChanged = 250; - } - } - else if (mode == MOD_FEU) { - - col[BLEU] += v[BLEU]; - if (col[BLEU] > 64) { - col[BLEU] = 64; - v[BLEU] = -(RAND () % 4) - 1; - } - if (col[BLEU] < 0) { - col[BLEU] = 0; - v[BLEU] = (RAND () % 4) + 1; - } - - col[VERT] += v[VERT]; - if (col[VERT] > 200) { - col[VERT] = 200; - v[VERT] = -(RAND () % 3) - 2; - } - if (col[VERT] > col[ROUGE] + 20) { - col[VERT] = col[ROUGE] + 20; - v[VERT] = -(RAND () % 3) - 2; - v[ROUGE] = (RAND () % 4) + 1; - v[BLEU] = (RAND () % 4) + 1; - } - if (col[VERT] < 0) { - col[VERT] = 0; - v[VERT] = (RAND () % 3) + 2; - } - - col[ROUGE] += v[ROUGE]; - if (col[ROUGE] > 255) { - col[ROUGE] = 255; - v[ROUGE] = -(RAND () % 4) - 1; - } - if (col[ROUGE] > col[VERT] + 40) { - col[ROUGE] = col[VERT] + 40; - v[ROUGE] = -(RAND () % 4) - 1; - } - if (col[ROUGE] < 0) { - col[ROUGE] = 0; - v[ROUGE] = (RAND () % 4) + 1; - } - - col[ALPHA] += v[ALPHA]; - if (col[ALPHA] > 0) { - col[ALPHA] = 0; - v[ALPHA] = -(RAND () % 4) - 1; - } - if (col[ALPHA] < 0) { - col[ALPHA] = 0; - v[ALPHA] = (RAND () % 4) + 1; - } - - if (((col[ROUGE] < 64) && (col[VERT] > 32) && (col[VERT] < col[BLEU]) - && (col[BLEU] > 32) - && (RAND () % 20 == 0)) && (justChanged < 0)) { - mode = RAND () % 2 ? MOD_MER : MOD_MERVER; - justChanged = 250; - } - } - - couleur = (col[ALPHA] << (ALPHA * 8)) - | (col[BLEU] << (BLEU * 8)) - | (col[VERT] << (VERT * 8)) - | (col[ROUGE] << (ROUGE * 8)); + justChanged--; + + col[ALPHA] = couleur >> (ALPHA * 8) & 0xff; + col[BLEU] = couleur >> (BLEU * 8) & 0xff; + col[VERT] = couleur >> (VERT * 8) & 0xff; + col[ROUGE] = couleur >> (ROUGE * 8) & 0xff; + + if (mode == MOD_MER) { + col[BLEU] += v[BLEU]; + if (col[BLEU] > 255) { + col[BLEU] = 255; + v[BLEU] = -(RAND() % 4) - 1; + } + if (col[BLEU] < 32) { + col[BLEU] = 32; + v[BLEU] = (RAND() % 4) + 1; + } + + col[VERT] += v[VERT]; + if (col[VERT] > 200) { + col[VERT] = 200; + v[VERT] = -(RAND() % 3) - 2; + } + if (col[VERT] > col[BLEU]) { + col[VERT] = col[BLEU]; + v[VERT] = v[BLEU]; + } + if (col[VERT] < 32) { + col[VERT] = 32; + v[VERT] = (RAND() % 3) + 2; + } + + col[ROUGE] += v[ROUGE]; + if (col[ROUGE] > 64) { + col[ROUGE] = 64; + v[ROUGE] = -(RAND() % 4) - 1; + } + if (col[ROUGE] < 0) { + col[ROUGE] = 0; + v[ROUGE] = (RAND() % 4) + 1; + } + + col[ALPHA] += v[ALPHA]; + if (col[ALPHA] > 0) { + col[ALPHA] = 0; + v[ALPHA] = -(RAND() % 4) - 1; + } + if (col[ALPHA] < 0) { + col[ALPHA] = 0; + v[ALPHA] = (RAND() % 4) + 1; + } + + if (((col[VERT] > 32) && (col[ROUGE] < col[VERT] + 40) && + (col[VERT] < col[ROUGE] + 20) && (col[BLEU] < 64) && + (RAND() % 20 == 0)) && + (justChanged < 0)) { + mode = RAND() % 3 ? MOD_FEU : MOD_MERVER; + justChanged = 250; + } + } else if (mode == MOD_MERVER) { + col[BLEU] += v[BLEU]; + if (col[BLEU] > 128) { + col[BLEU] = 128; + v[BLEU] = -(RAND() % 4) - 1; + } + if (col[BLEU] < 16) { + col[BLEU] = 16; + v[BLEU] = (RAND() % 4) + 1; + } + + col[VERT] += v[VERT]; + if (col[VERT] > 200) { + col[VERT] = 200; + v[VERT] = -(RAND() % 3) - 2; + } + if (col[VERT] > col[ALPHA]) { + col[VERT] = col[ALPHA]; + v[VERT] = v[ALPHA]; + } + if (col[VERT] < 32) { + col[VERT] = 32; + v[VERT] = (RAND() % 3) + 2; + } + + col[ROUGE] += v[ROUGE]; + if (col[ROUGE] > 128) { + col[ROUGE] = 128; + v[ROUGE] = -(RAND() % 4) - 1; + } + if (col[ROUGE] < 0) { + col[ROUGE] = 0; + v[ROUGE] = (RAND() % 4) + 1; + } + + col[ALPHA] += v[ALPHA]; + if (col[ALPHA] > 255) { + col[ALPHA] = 255; + v[ALPHA] = -(RAND() % 4) - 1; + } + if (col[ALPHA] < 0) { + col[ALPHA] = 0; + v[ALPHA] = (RAND() % 4) + 1; + } + + if (((col[VERT] > 32) && (col[ROUGE] < col[VERT] + 40) && + (col[VERT] < col[ROUGE] + 20) && (col[BLEU] < 64) && + (RAND() % 20 == 0)) && + (justChanged < 0)) { + mode = RAND() % 3 ? MOD_FEU : MOD_MER; + justChanged = 250; + } + } else if (mode == MOD_FEU) { + + col[BLEU] += v[BLEU]; + if (col[BLEU] > 64) { + col[BLEU] = 64; + v[BLEU] = -(RAND() % 4) - 1; + } + if (col[BLEU] < 0) { + col[BLEU] = 0; + v[BLEU] = (RAND() % 4) + 1; + } + + col[VERT] += v[VERT]; + if (col[VERT] > 200) { + col[VERT] = 200; + v[VERT] = -(RAND() % 3) - 2; + } + if (col[VERT] > col[ROUGE] + 20) { + col[VERT] = col[ROUGE] + 20; + v[VERT] = -(RAND() % 3) - 2; + v[ROUGE] = (RAND() % 4) + 1; + v[BLEU] = (RAND() % 4) + 1; + } + if (col[VERT] < 0) { + col[VERT] = 0; + v[VERT] = (RAND() % 3) + 2; + } + + col[ROUGE] += v[ROUGE]; + if (col[ROUGE] > 255) { + col[ROUGE] = 255; + v[ROUGE] = -(RAND() % 4) - 1; + } + if (col[ROUGE] > col[VERT] + 40) { + col[ROUGE] = col[VERT] + 40; + v[ROUGE] = -(RAND() % 4) - 1; + } + if (col[ROUGE] < 0) { + col[ROUGE] = 0; + v[ROUGE] = (RAND() % 4) + 1; + } + + col[ALPHA] += v[ALPHA]; + if (col[ALPHA] > 0) { + col[ALPHA] = 0; + v[ALPHA] = -(RAND() % 4) - 1; + } + if (col[ALPHA] < 0) { + col[ALPHA] = 0; + v[ALPHA] = (RAND() % 4) + 1; + } + + if (((col[ROUGE] < 64) && (col[VERT] > 32) && (col[VERT] < col[BLEU]) && + (col[BLEU] > 32) && (RAND() % 20 == 0)) && + (justChanged < 0)) { + mode = RAND() % 2 ? MOD_MER : MOD_MERVER; + justChanged = 250; + } + } + + couleur = (col[ALPHA] << (ALPHA * 8)) | (col[BLEU] << (BLEU * 8)) | + (col[VERT] << (VERT * 8)) | (col[ROUGE] << (ROUGE * 8)); } /** VISUAL_FX WRAPPER FOR IFS */ -static void ifs_vfx_apply(VisualFX *_this, Pixel *src, Pixel *dest, PluginInfo *goomInfo) { - - IfsData *data = (IfsData*)_this->fx_data; - if (!data->initalized) { - data->initalized = 1; - init_ifs(goomInfo, data); - } - ifs_update (goomInfo, dest, src, goomInfo->update.ifs_incr, data); - /*TODO: trouver meilleur soluce pour increment (mettre le code de gestion de l'ifs dans ce fichier: ifs_vfx_apply) */ +static void ifs_vfx_apply(VisualFX *_this, Pixel *src, Pixel *dest, + PluginInfo *goomInfo) { + + IfsData *data = (IfsData *)_this->fx_data; + if (!data->initalized) { + data->initalized = 1; + init_ifs(goomInfo, data); + } + ifs_update(goomInfo, dest, src, goomInfo->update.ifs_incr, data); + /*TODO: trouver meilleur soluce pour increment (mettre le code de gestion de + * l'ifs dans ce fichier: ifs_vfx_apply) */ } static void ifs_vfx_init(VisualFX *_this, PluginInfo *info) { - IfsData *data = (IfsData*)malloc(sizeof(IfsData)); - data->Root = (FRACTAL*)NULL; - data->initalized = 0; - _this->fx_data = data; + IfsData *data = (IfsData *)malloc(sizeof(IfsData)); + data->Root = (FRACTAL *)NULL; + data->initalized = 0; + _this->fx_data = data; } static void ifs_vfx_free(VisualFX *_this) { - IfsData *data = (IfsData*)_this->fx_data; - release_ifs(data); - free(data); + IfsData *data = (IfsData *)_this->fx_data; + release_ifs(data); + free(data); } VisualFX ifs_visualfx_create(void) { - VisualFX vfx; - vfx.init = ifs_vfx_init; - vfx.free = ifs_vfx_free; - vfx.apply = ifs_vfx_apply; - return vfx; + VisualFX vfx; + vfx.init = ifs_vfx_init; + vfx.free = ifs_vfx_free; + vfx.apply = ifs_vfx_apply; + return vfx; } diff --git a/libvisual-plugins/plugins/actor/goom2k4/ifs.h b/libvisual-plugins/plugins/actor/goom2k4/ifs.h index fab042668..81eee6de4 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/ifs.h +++ b/libvisual-plugins/plugins/actor/goom2k4/ifs.h @@ -17,11 +17,11 @@ void init_ifs (PluginInfo *goomInfo, int width, int height); / * draw an ifs on the buffer (which size is width * height) increment means that we draw 1/increment of the ifs's points * / -void ifs_update (PluginInfo *goomInfo, Pixel * buffer, Pixel * back, int width, int height, int increment); +void ifs_update (PluginInfo *goomInfo, Pixel * buffer, Pixel * back, int width, +int height, int increment); / * free all ifs's data. * / void release_ifs (void); */ - #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/jitc_test.c b/libvisual-plugins/plugins/actor/goom2k4/jitc_test.c index cab03e82f..d1465c48c 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/jitc_test.c +++ b/libvisual-plugins/plugins/actor/goom2k4/jitc_test.c @@ -1,38 +1,37 @@ #include "jitc_x86.h" #include -int main(int c, char **v) -{ - int i; - int j; - JitcX86Env *jitc = jitc_x86_env_new(0xffff); - JitcFunc func = jitc_prepare_func(jitc); +int main(int c, char **v) { + int i; + int j; + JitcX86Env *jitc = jitc_x86_env_new(0xffff); + JitcFunc func = jitc_prepare_func(jitc); - jitc_add(jitc, "mov edx, $d", 0xffffffff); - jitc_add(jitc, "mov eax, $d", 40); - jitc_add(jitc, "mov ebx, $d", 2); - jitc_add(jitc, "idiv ebx"); - jitc_add(jitc, "mov eax, [$d]", 0xdeadbeaf); - - jitc_add(jitc, "sal edx, $d", 7); - jitc_add(jitc, "imul ecx"); - jitc_add(jitc, "idiv ecx"); - jitc_add(jitc, "imul $d[ecx]", 2); - jitc_add(jitc, "imul ecx, [ecx]"); - jitc_add(jitc, "mov ecx, $d", (char*)(&i)-12); - jitc_add(jitc, "dec $d[ecx]", 2); - jitc_add(jitc, "add ecx, $d", 12); - jitc_add(jitc, "dec [ecx]"); - jitc_add(jitc, "dec ecx"); + jitc_add(jitc, "mov edx, $d", 0xffffffff); + jitc_add(jitc, "mov eax, $d", 40); + jitc_add(jitc, "mov ebx, $d", 2); + jitc_add(jitc, "idiv ebx"); + jitc_add(jitc, "mov eax, [$d]", 0xdeadbeaf); - JITC_FLD_pIMM32(jitc,&i); - JITC_FSTP_pIMM32(jitc,&j); - - jitc_validate_func(jitc); - func(); + jitc_add(jitc, "sal edx, $d", 7); + jitc_add(jitc, "imul ecx"); + jitc_add(jitc, "idiv ecx"); + jitc_add(jitc, "imul $d[ecx]", 2); + jitc_add(jitc, "imul ecx, [ecx]"); + jitc_add(jitc, "mov ecx, $d", (char *)(&i) - 12); + jitc_add(jitc, "dec $d[ecx]", 2); + jitc_add(jitc, "add ecx, $d", 12); + jitc_add(jitc, "dec [ecx]"); + jitc_add(jitc, "dec ecx"); - printf("i = 0x%08x\n", i); - - jitc_x86_delete(jitc); - return 0; + JITC_FLD_pIMM32(jitc, &i); + JITC_FSTP_pIMM32(jitc, &j); + + jitc_validate_func(jitc); + func(); + + printf("i = 0x%08x\n", i); + + jitc_x86_delete(jitc); + return 0; } diff --git a/libvisual-plugins/plugins/actor/goom2k4/jitc_x86.c b/libvisual-plugins/plugins/actor/goom2k4/jitc_x86.c index 21213b893..0938808e9 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/jitc_x86.c +++ b/libvisual-plugins/plugins/actor/goom2k4/jitc_x86.c @@ -4,110 +4,103 @@ #include #include -#define PARAM_INT 1 -#define PARAM_FLOAT 2 -#define PARAM_REG 3 -#define PARAM_dispREG 4 -#define PARAM_DISP32 5 -#define PARAM_LABEL 6 -#define PARAM_NONE 666 +#define PARAM_INT 1 +#define PARAM_FLOAT 2 +#define PARAM_REG 3 +#define PARAM_dispREG 4 +#define PARAM_DISP32 5 +#define PARAM_LABEL 6 +#define PARAM_NONE 666 typedef struct { - int id; - int i; + int id; + int i; double f; - int reg; - int disp; - char label[256]; + int reg; + int disp; + char label[256]; } IParam; struct { char *name; - int reg; + int reg; } RegsName[] = { - {"eax",EAX}, {"ebx",EBX}, {"ecx",ECX}, {"edx",EDX}, - {"edi",EDI}, {"esi",ESI}, {"ebp",EBP}, {"esp",ESP}, - {"st0",0}, {"st1",1}, {"st2",2}, {"st3",3}, - {"st4",4}, {"st5",5}, {"st6",6}, {"st7",7}, - {"mm0",0}, {"mm1",1}, {"mm2",2}, {"mm3",3}, - {"mm4",4}, {"mm5",5}, {"mm6",6}, {"mm7",7}, {NULL,0} -}; - -void modrm(JitcX86Env *jitc, int opcode, IParam *iparam) -{ + {"eax", EAX}, {"ebx", EBX}, {"ecx", ECX}, {"edx", EDX}, {"edi", EDI}, + {"esi", ESI}, {"ebp", EBP}, {"esp", ESP}, {"st0", 0}, {"st1", 1}, + {"st2", 2}, {"st3", 3}, {"st4", 4}, {"st5", 5}, {"st6", 6}, + {"st7", 7}, {"mm0", 0}, {"mm1", 1}, {"mm2", 2}, {"mm3", 3}, + {"mm4", 4}, {"mm5", 5}, {"mm6", 6}, {"mm7", 7}, {NULL, 0}}; + +void modrm(JitcX86Env *jitc, int opcode, IParam *iparam) { int dest = 0; - int src = 1; + int src = 1; int direction = 0x0; - unsigned int byte = 666; - unsigned int int32 = 0; + unsigned int byte = 666; + unsigned int int32 = 0; unsigned int need32 = 0; if ((iparam[0].id == PARAM_REG) && (iparam[1].id != PARAM_REG)) { dest = 1; - src = 0; + src = 0; direction = 0x02; } if (iparam[src].id != PARAM_REG) { - fprintf(stderr, "JITC_x86: Invalid Instruction Parameters: %d %d.\n", iparam[0].id, iparam[1].id); + fprintf(stderr, "JITC_x86: Invalid Instruction Parameters: %d %d.\n", + iparam[0].id, iparam[1].id); exit(1); } if (iparam[dest].id == PARAM_REG) { - byte = ((int)JITC_MOD_REG_REG << 6) | (iparam[src].reg << 3) | (iparam[0].reg); + byte = + ((int)JITC_MOD_REG_REG << 6) | (iparam[src].reg << 3) | (iparam[0].reg); } - else if (iparam[dest].id == PARAM_dispREG) - { + else if (iparam[dest].id == PARAM_dispREG) { if (iparam[dest].disp == 0) - byte = ((int)JITC_MOD_pREG_REG << 6) | (iparam[src].reg << 3) | (iparam[dest].reg); + byte = ((int)JITC_MOD_pREG_REG << 6) | (iparam[src].reg << 3) | + (iparam[dest].reg); } - else if (iparam[dest].id == PARAM_DISP32) - { - byte = ((int)JITC_MOD_pREG_REG << 6) | (iparam[src].reg << 3) | JITC_RM_DISP32; + else if (iparam[dest].id == PARAM_DISP32) { + byte = + ((int)JITC_MOD_pREG_REG << 6) | (iparam[src].reg << 3) | JITC_RM_DISP32; need32 = 1; - int32 = iparam[dest].disp; + int32 = iparam[dest].disp; } if (byte == 666) { - fprintf(stderr, "JITC_x86: Invalid Instruction Parameters: %d %d.\n", iparam[0].id, iparam[1].id); + fprintf(stderr, "JITC_x86: Invalid Instruction Parameters: %d %d.\n", + iparam[0].id, iparam[1].id); exit(1); - } - else { + } else { if (opcode < 0x100) JITC_ADD_UCHAR(jitc, opcode + direction); else { - JITC_ADD_UCHAR(jitc, (opcode>>8)&0xff); - JITC_ADD_UCHAR(jitc, (opcode&0xff)/* + direction*/); + JITC_ADD_UCHAR(jitc, (opcode >> 8) & 0xff); + JITC_ADD_UCHAR(jitc, (opcode & 0xff) /* + direction*/); } JITC_ADD_UCHAR(jitc, byte); if (need32) JITC_ADD_UINT(jitc, int32); } } - -static void imul_like_modrm_1param(JitcX86Env *jitc, int opcode, int digit, IParam *iparam) -{ - if (iparam[0].id == PARAM_REG) - { + +static void imul_like_modrm_1param(JitcX86Env *jitc, int opcode, int digit, + IParam *iparam) { + if (iparam[0].id == PARAM_REG) { JITC_ADD_UCHAR(jitc, opcode); JITC_MODRM(jitc, 0x03, digit, iparam[0].reg); return; } if (iparam[0].id == PARAM_dispREG) { JITC_ADD_UCHAR(jitc, opcode); - if (iparam[0].disp == 0) - { + if (iparam[0].disp == 0) { JITC_MODRM(jitc, 0x00, digit, iparam[0].reg); - } - else if ((iparam[0].disp & 0xff) == iparam[0].disp) - { + } else if ((iparam[0].disp & 0xff) == iparam[0].disp) { JITC_MODRM(jitc, 0x01, digit, iparam[0].reg); JITC_ADD_UCHAR(jitc, iparam[0].disp); - } - else - { + } else { JITC_MODRM(jitc, 0x02, digit, iparam[0].reg); JITC_ADD_UINT(jitc, iparam[0].disp); } @@ -122,9 +115,11 @@ static void imul_like_modrm_1param(JitcX86Env *jitc, int opcode, int digit, IPar } /* 1 byte encoded opcode including register... imm32 parameter */ -#define INSTR_1bReg_IMM32(opcode,dest,src) { \ - JITC_ADD_UCHAR(jitc, opcode + iparam[dest].reg); \ - JITC_ADD_UINT (jitc, (int)iparam[src].i); } +#define INSTR_1bReg_IMM32(opcode, dest, src) \ + { \ + JITC_ADD_UCHAR(jitc, opcode + iparam[dest].reg); \ + JITC_ADD_UINT(jitc, (int)iparam[src].i); \ + } typedef struct { char *name; @@ -134,59 +129,49 @@ typedef struct { int opcode_eax_int; } AddLikeInstr; -static AddLikeInstr addLike[] = { - { "add", 0x01, 0x81, 0x00, 0x05 }, - { "and", 0x21, 0x81, 0x04, 0x25 }, - { "or", 0x0B, 0x81, 0x01, 0x0D }, - { "cmp", 0x39, 0x81, 0x07, 0x3D }, - { "imul", 0x0FAF, 0x69, 0x00, 0x10000 }, - { "sub", 0x29, 0x81, 0x05, 0X2D }, - { NULL, -1, -1, -1, -1 } -}; - -int checkAddLike(JitcX86Env *jitc, char *op, IParam *iparam, int nbParams) -{ +static AddLikeInstr addLike[] = {{"add", 0x01, 0x81, 0x00, 0x05}, + {"and", 0x21, 0x81, 0x04, 0x25}, + {"or", 0x0B, 0x81, 0x01, 0x0D}, + {"cmp", 0x39, 0x81, 0x07, 0x3D}, + {"imul", 0x0FAF, 0x69, 0x00, 0x10000}, + {"sub", 0x29, 0x81, 0x05, 0X2D}, + {NULL, -1, -1, -1, -1}}; + +int checkAddLike(JitcX86Env *jitc, char *op, IParam *iparam, int nbParams) { int i; - for (i=0;addLike[i].name;++i) - { - if (strcmp(op,addLike[i].name) == 0) - { + for (i = 0; addLike[i].name; ++i) { + if (strcmp(op, addLike[i].name) == 0) { if ((iparam[0].id == PARAM_REG) && (iparam[1].id == PARAM_INT)) { if ((iparam[0].reg == EAX) && (addLike[i].opcode_eax_int != 0x10000)) { JITC_ADD_UCHAR(jitc, addLike[i].opcode_eax_int); - JITC_ADD_UINT(jitc, iparam[1].i); + JITC_ADD_UINT(jitc, iparam[1].i); return 1; - } - else { + } else { JITC_ADD_UCHAR(jitc, addLike[i].opcode_reg_int); - JITC_MODRM(jitc, 0x03, addLike[i].digit_reg_int, iparam[0].reg); - JITC_ADD_UINT(jitc, iparam[1].i); + JITC_MODRM(jitc, 0x03, addLike[i].digit_reg_int, iparam[0].reg); + JITC_ADD_UINT(jitc, iparam[1].i); return 1; } - } - else if ((iparam[0].id == PARAM_dispREG) && (iparam[1].id == PARAM_INT)) { + } else if ((iparam[0].id == PARAM_dispREG) && + (iparam[1].id == PARAM_INT)) { JITC_ADD_UCHAR(jitc, addLike[i].opcode_reg_int); - if ((iparam[0].disp & 0xff) == iparam[0].disp) - { - JITC_MODRM(jitc, 0x01, addLike[i].digit_reg_int, iparam[0].reg); - JITC_ADD_UCHAR(jitc, iparam[0].disp); - } - else - { - JITC_MODRM(jitc, 0x00, addLike[i].digit_reg_int, iparam[0].reg); - JITC_ADD_UINT(jitc, iparam[0].disp); + if ((iparam[0].disp & 0xff) == iparam[0].disp) { + JITC_MODRM(jitc, 0x01, addLike[i].digit_reg_int, iparam[0].reg); + JITC_ADD_UCHAR(jitc, iparam[0].disp); + } else { + JITC_MODRM(jitc, 0x00, addLike[i].digit_reg_int, iparam[0].reg); + JITC_ADD_UINT(jitc, iparam[0].disp); } - JITC_ADD_UINT(jitc, iparam[1].i); + JITC_ADD_UINT(jitc, iparam[1].i); return 1; - } - else if ((iparam[0].id == PARAM_DISP32) && (iparam[1].id == PARAM_INT)) { + } else if ((iparam[0].id == PARAM_DISP32) && + (iparam[1].id == PARAM_INT)) { JITC_ADD_UCHAR(jitc, addLike[i].opcode_reg_int); JITC_MODRM(jitc, 0x00, addLike[i].digit_reg_int, 0x05); - JITC_ADD_UINT(jitc, iparam[0].disp); - JITC_ADD_UINT(jitc, iparam[1].i); + JITC_ADD_UINT(jitc, iparam[0].disp); + JITC_ADD_UINT(jitc, iparam[1].i); return 1; - } - else { + } else { modrm(jitc, addLike[i].opcode, iparam); return 1; } @@ -198,55 +183,56 @@ int checkAddLike(JitcX86Env *jitc, char *op, IParam *iparam, int nbParams) /** * Check all kind of known instruction... perform special optimisations.. */ -static void jitc_add_op(JitcX86Env *jitc, char *op, IParam *iparam, int nbParams) -{ +static void jitc_add_op(JitcX86Env *jitc, char *op, IParam *iparam, + int nbParams) { /* MOV */ - if (strcmp(op,"mov") == 0) - { + if (strcmp(op, "mov") == 0) { if ((iparam[0].id == PARAM_REG) && (iparam[1].id == PARAM_INT)) { - INSTR_1bReg_IMM32(0xb8,0,1); - } - else if ((iparam[0].id == PARAM_DISP32) && (iparam[1].id == PARAM_INT)) { + INSTR_1bReg_IMM32(0xb8, 0, 1); + } else if ((iparam[0].id == PARAM_DISP32) && (iparam[1].id == PARAM_INT)) { JITC_ADD_UCHAR(jitc, 0xc7); JITC_MODRM(jitc, 0x00, 0x00, 0x05); JITC_ADD_UINT(jitc, iparam[0].disp); JITC_ADD_UINT(jitc, iparam[1].i); - } - else + } else modrm(jitc, 0x89, iparam); return; } -#define IMUL_LIKE(_OP,_opcode,_digit)\ - if (strcmp(op, _OP) == 0) { \ - if (nbParams == 1) { \ - imul_like_modrm_1param(jitc, _opcode, _digit, iparam); \ - return; }} - -#define SHIFT_LIKE(_name,_op1,_op2,_digit) \ - if (strcmp(op, _name) == 0) { \ - if (iparam[1].id == PARAM_INT) { \ - if (iparam[1].i == 1) \ - imul_like_modrm_1param(jitc, _op1, _digit, iparam); \ - else { \ - imul_like_modrm_1param(jitc, _op2, _digit, iparam); \ - JITC_ADD_UCHAR(jitc, iparam[1].i); \ - } \ - return; \ - } \ +#define IMUL_LIKE(_OP, _opcode, _digit) \ + if (strcmp(op, _OP) == 0) { \ + if (nbParams == 1) { \ + imul_like_modrm_1param(jitc, _opcode, _digit, iparam); \ + return; \ + } \ } -#define POP_LIKE(_OP,_opcode) \ - if (strcmp(op, _OP) == 0) { \ - if (iparam[0].id == PARAM_REG) { \ - JITC_ADD_UCHAR(jitc, _opcode + iparam[0].reg); \ - return; } } +#define SHIFT_LIKE(_name, _op1, _op2, _digit) \ + if (strcmp(op, _name) == 0) { \ + if (iparam[1].id == PARAM_INT) { \ + if (iparam[1].i == 1) \ + imul_like_modrm_1param(jitc, _op1, _digit, iparam); \ + else { \ + imul_like_modrm_1param(jitc, _op2, _digit, iparam); \ + JITC_ADD_UCHAR(jitc, iparam[1].i); \ + } \ + return; \ + } \ + } - IMUL_LIKE("neg", 0xf7, 0x03); +#define POP_LIKE(_OP, _opcode) \ + if (strcmp(op, _OP) == 0) { \ + if (iparam[0].id == PARAM_REG) { \ + JITC_ADD_UCHAR(jitc, _opcode + iparam[0].reg); \ + return; \ + } \ + } + + IMUL_LIKE("neg", 0xf7, 0x03); IMUL_LIKE("imul", 0xf7, 0x05); IMUL_LIKE("idiv", 0xf7, 0x07); - POP_LIKE("pop", 0x58); + POP_LIKE("pop", 0x58); POP_LIKE("push", 0x50); SHIFT_LIKE("sal", 0xd1, 0xc1, 0x04); @@ -274,28 +260,28 @@ static void jitc_add_op(JitcX86Env *jitc, char *op, IParam *iparam, int nbParams return; } - if (strcmp(op, "call") == 0) - { + if (strcmp(op, "call") == 0) { if (iparam[0].id == PARAM_LABEL) { - jitc_add_used_label(jitc,iparam[0].label,jitc->used+1); - JITC_CALL(jitc,0); + jitc_add_used_label(jitc, iparam[0].label, jitc->used + 1); + JITC_CALL(jitc, 0); return; } if (iparam[0].id == PARAM_INT) { - JITC_CALL(jitc,iparam[0].i); + JITC_CALL(jitc, iparam[0].i); return; } if (iparam[0].id == PARAM_dispREG) { - JITC_ADD_UCHAR(jitc,0xff); - JITC_ADD_UCHAR(jitc,0xd0+iparam[0].reg); + JITC_ADD_UCHAR(jitc, 0xff); + JITC_ADD_UCHAR(jitc, 0xd0 + iparam[0].reg); return; } } - -#define MONOBYTE_INSTR(_OP,_opcode) \ - if (strcmp(op, _OP) == 0) { \ - JITC_ADD_UCHAR(jitc, _opcode); \ - return; } + +#define MONOBYTE_INSTR(_OP, _opcode) \ + if (strcmp(op, _OP) == 0) { \ + JITC_ADD_UCHAR(jitc, _opcode); \ + return; \ + } MONOBYTE_INSTR("ret", 0xc3); MONOBYTE_INSTR("leave", 0xc9); @@ -304,11 +290,11 @@ static void jitc_add_op(JitcX86Env *jitc, char *op, IParam *iparam, int nbParams /* JNE */ if (strcmp(op, "jne") == 0) { if (iparam[0].id == PARAM_LABEL) { - JITC_JUMP_COND_LABEL(jitc,COND_NOT_EQUAL,iparam[0].label); + JITC_JUMP_COND_LABEL(jitc, COND_NOT_EQUAL, iparam[0].label); return; } if (iparam[0].id == PARAM_INT) { - JITC_JUMP_COND(jitc,COND_NOT_EQUAL,iparam[0].i); + JITC_JUMP_COND(jitc, COND_NOT_EQUAL, iparam[0].i); return; } } @@ -316,20 +302,21 @@ static void jitc_add_op(JitcX86Env *jitc, char *op, IParam *iparam, int nbParams /* JE */ if (strcmp(op, "je") == 0) { if (iparam[0].id == PARAM_LABEL) { - JITC_JUMP_COND_LABEL(jitc,COND_EQUAL,iparam[0].label); + JITC_JUMP_COND_LABEL(jitc, COND_EQUAL, iparam[0].label); return; } if (iparam[0].id == PARAM_INT) { - JITC_JUMP_COND(jitc,COND_EQUAL,iparam[0].i); + JITC_JUMP_COND(jitc, COND_EQUAL, iparam[0].i); return; } } - + /* ADD LIKE */ - if (checkAddLike(jitc, op, iparam, nbParams)) return; + if (checkAddLike(jitc, op, iparam, nbParams)) + return; /* BSWAP : 0F C8+rd */ - + fprintf(stderr, "JITC_x86: Invalid Operation '%s'\n", op); exit(1); } @@ -337,72 +324,69 @@ static void jitc_add_op(JitcX86Env *jitc, char *op, IParam *iparam, int nbParams /** * Adds a new instruction to the just in time compiled function */ -void jitc_add(JitcX86Env *jitc, const char *_instr, ...) -{ +void jitc_add(JitcX86Env *jitc, const char *_instr, ...) { char instr[256]; char *op; - char *sparam[16]; int nbParam=0; int i; + char *sparam[16]; + int nbParam = 0; + int i; IParam iparam[16]; va_list ap; - strcpy(instr,_instr); + strcpy(instr, _instr); #ifdef DISPLAY_GENCODE printf("|"); #endif - + op = strtok(instr, " ,"); - if (!op) return; + if (!op) + return; /* decoupage en tokens */ - while ((sparam[nbParam] = strtok(NULL, " ,")) != NULL) if (strlen(sparam[nbParam])>0) nbParam++; + while ((sparam[nbParam] = strtok(NULL, " ,")) != NULL) + if (strlen(sparam[nbParam]) > 0) + nbParam++; /* Reconnaissance des parametres */ va_start(ap, _instr); - for (i=0;i 0) { - if (strcmp(regname, RegsName[r].name) == 0) { - iparam[i].id = PARAM_dispREG; - iparam[i].reg = RegsName[r].reg; - iparam[i].disp = va_arg(ap, int); + } else if (strcmp(sparam[i], "$s") == 0) { + iparam[i].id = PARAM_LABEL; + strcpy(iparam[i].label, va_arg(ap, char *)); + } else + for (r = 0; RegsName[r].name; r++) { + if (strcmp(sparam[i], RegsName[r].name) == 0) { + iparam[i].id = PARAM_REG; + iparam[i].reg = RegsName[r].reg; + } else { + if (sscanf(sparam[i], "$d[%3s]", regname) > 0) { + if (strcmp(regname, RegsName[r].name) == 0) { + iparam[i].id = PARAM_dispREG; + iparam[i].reg = RegsName[r].reg; + iparam[i].disp = va_arg(ap, int); + } } - } - if (sscanf(sparam[i], "[%3s]", regname) > 0) { - if (strcmp(regname, RegsName[r].name) == 0) { - iparam[i].id = PARAM_dispREG; - iparam[i].reg = RegsName[r].reg; - iparam[i].disp = 0; + if (sscanf(sparam[i], "[%3s]", regname) > 0) { + if (strcmp(regname, RegsName[r].name) == 0) { + iparam[i].id = PARAM_dispREG; + iparam[i].reg = RegsName[r].reg; + iparam[i].disp = 0; + } } } } - } if (iparam[i].id == PARAM_NONE) { fprintf(stderr, "JITC_x86: Unrecognized parameter '%s'\n", sparam[i]); exit(1); @@ -413,8 +397,7 @@ void jitc_add(JitcX86Env *jitc, const char *_instr, ...) jitc_add_op(jitc, op, &(iparam[0]), nbParam); #ifdef DISPLAY_GENCODE printf(" ;;; %s", op); - for (i=0;i_memory = (unsigned char*)malloc(memory_size); - jitc->used = 0; - jitc->memory = (unsigned char*)((int)jitc->_memory + (32-((int)jitc->_memory)%32)%32); + JitcX86Env *jitc = (JitcX86Env *)malloc(sizeof(JitcX86Env)); + jitc->_memory = (unsigned char *)malloc(memory_size); + jitc->used = 0; + jitc->memory = (unsigned char *)((int)jitc->_memory + + (32 - ((int)jitc->_memory) % 32) % 32); + + jitc->nbUsedLabel = 0; + jitc->nbKnownLabel = 0; - jitc->nbUsedLabel = 0; - jitc->nbKnownLabel = 0; + jitc->usedLabel = (LabelAddr *)malloc(sizeof(LabelAddr) * JITC_MAXLABEL); + jitc->knownLabel = (LabelAddr *)malloc(sizeof(LabelAddr) * JITC_MAXLABEL); - jitc->usedLabel = (LabelAddr*)malloc(sizeof(LabelAddr) * JITC_MAXLABEL); - jitc->knownLabel = (LabelAddr*)malloc(sizeof(LabelAddr) * JITC_MAXLABEL); - - return jitc; + return jitc; } void jitc_x86_delete(JitcX86Env *jitc) { - - free(jitc->usedLabel); - free(jitc->knownLabel); - free(jitc->_memory); - free(jitc); + + free(jitc->usedLabel); + free(jitc->knownLabel); + free(jitc->_memory); + free(jitc); } JitcFunc jitc_prepare_func(JitcX86Env *jitc) { - JitcFunc ptr = 0; - jitc->used = (32 - jitc->used%32)%32; - ptr = (JitcFunc)&(jitc->memory[jitc->used]); + JitcFunc ptr = 0; + jitc->used = (32 - jitc->used % 32) % 32; + ptr = (JitcFunc) & (jitc->memory[jitc->used]); #ifdef DISPLAY_GENCODE - printf("\n------------------------------------------\n"); - printf("-- Function Intro --\n"); - printf("------------------------------------------\n"); + printf("\n------------------------------------------\n"); + printf("-- Function Intro --\n"); + printf("------------------------------------------\n"); #endif - /* save the state */ - jitc_add(jitc,"push ebp"); - jitc_add(jitc,"mov ebp, esp"); - jitc_add(jitc,"sub esp, $d", 8); - JITC_PUSH_ALL(jitc); + /* save the state */ + jitc_add(jitc, "push ebp"); + jitc_add(jitc, "mov ebp, esp"); + jitc_add(jitc, "sub esp, $d", 8); + JITC_PUSH_ALL(jitc); #ifdef DISPLAY_GENCODE - printf("\n------------------------------------------\n"); + printf("\n------------------------------------------\n"); #endif - return ptr; + return ptr; } void jitc_validate_func(JitcX86Env *jitc) { #ifdef DISPLAY_GENCODE - printf("\n------------------------------------------\n"); - printf("-- Function Outro --\n"); - printf("------------------------------------------\n"); + printf("\n------------------------------------------\n"); + printf("-- Function Outro --\n"); + printf("------------------------------------------\n"); #endif - /* restore the state */ - JITC_POP_ALL(jitc); - jitc_add(jitc, "leave"); - jitc_add(jitc, "ret"); - jitc_resolve_labels(jitc); + /* restore the state */ + JITC_POP_ALL(jitc); + jitc_add(jitc, "leave"); + jitc_add(jitc, "ret"); + jitc_resolve_labels(jitc); #ifdef DISPLAY_GENCODE - printf("\n------------------------------------------\n"); + printf("\n------------------------------------------\n"); #endif } void jitc_add_used_label(JitcX86Env *jitc, char *label, int where) { - strncpy(jitc->usedLabel[jitc->nbUsedLabel].label, label, JITC_LABEL_SIZE); - jitc->usedLabel[jitc->nbUsedLabel].address = where; - jitc->nbUsedLabel++; + strncpy(jitc->usedLabel[jitc->nbUsedLabel].label, label, JITC_LABEL_SIZE); + jitc->usedLabel[jitc->nbUsedLabel].address = where; + jitc->nbUsedLabel++; } void jitc_add_known_label(JitcX86Env *jitc, char *label, int where) { #ifdef DISPLAY_GENCODE - printf("%s:\n", label); + printf("%s:\n", label); #endif - strncpy(jitc->knownLabel[jitc->nbKnownLabel].label, label, JITC_LABEL_SIZE); - jitc->knownLabel[jitc->nbKnownLabel].address = where; - jitc->nbKnownLabel++; + strncpy(jitc->knownLabel[jitc->nbKnownLabel].label, label, JITC_LABEL_SIZE); + jitc->knownLabel[jitc->nbKnownLabel].address = where; + jitc->nbKnownLabel++; } void jitc_resolve_labels(JitcX86Env *jitc) { - int i,j; - for (i=jitc->nbUsedLabel;i-->0;) { + int i, j; + for (i = jitc->nbUsedLabel; i-- > 0;) { - LabelAddr used = jitc->usedLabel[i]; - for (j=jitc->nbKnownLabel;j-->0;) { + LabelAddr used = jitc->usedLabel[i]; + for (j = jitc->nbKnownLabel; j-- > 0;) { - LabelAddr known = jitc->knownLabel[j]; - if (strcmp(known.label, used.label) == 0) { - int *offset = (int*)&(jitc->memory[used.address]); - *offset = known.address - used.address - 4; /* always using long offset */ - break; - } - } + LabelAddr known = jitc->knownLabel[j]; + if (strcmp(known.label, used.label) == 0) { + int *offset = (int *)&(jitc->memory[used.address]); + *offset = + known.address - used.address - 4; /* always using long offset */ + break; + } } - jitc->nbUsedLabel = jitc->nbKnownLabel = 0; + } + jitc->nbUsedLabel = jitc->nbKnownLabel = 0; } diff --git a/libvisual-plugins/plugins/actor/goom2k4/jitc_x86.h b/libvisual-plugins/plugins/actor/goom2k4/jitc_x86.h index c81fa9ccd..b8cd43b6a 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/jitc_x86.h +++ b/libvisual-plugins/plugins/actor/goom2k4/jitc_x86.h @@ -12,7 +12,7 @@ * low level macros */ - /* {{{ Registres Generaux */ +/* {{{ Registres Generaux */ #define EAX 0 #define ECX 1 #define EDX 2 @@ -21,8 +21,8 @@ #define EBP 5 #define ESI 6 #define EDI 7 - /* }}} */ - /* {{{ Registres MMX */ +/* }}} */ +/* {{{ Registres MMX */ #define MM0 0 #define MM1 1 #define MM2 2 @@ -31,8 +31,8 @@ #define MM5 5 #define MM6 6 #define MM7 7 - /* }}} */ - /* {{{ Registres SSE*/ +/* }}} */ +/* {{{ Registres SSE*/ #define XMM0 0 #define XMM1 1 #define XMM2 2 @@ -41,8 +41,8 @@ #define XMM5 5 #define XMM6 6 #define XMM7 7 - /* }}} */ - /* {{{ Alias aux registres */ +/* }}} */ +/* {{{ Alias aux registres */ #define R0 0 #define R1 1 #define R2 2 @@ -51,162 +51,253 @@ #define R5 5 #define R6 6 #define R7 7 - /* }}} */ +/* }}} */ - /* {{{ Conditions */ -#define COND_OVERFLOW 0 +/* {{{ Conditions */ +#define COND_OVERFLOW 0 #define COND_NO_OVERFLOW 1 -#define COND_BELOW 2 -#define COND_NOT_BELOW 3 -#define COND_EQUAL 4 -#define COND_ZERO 4 -#define COND_NOT_EQUAL 5 -#define COND_NOT_ZERO 5 -#define COND_NOT_ABOVE 6 -#define COND_ABOVE 7 -#define COND_SIGN 8 -#define COND_NOT_SIGN 9 -#define COND_EVEN 10 -#define COND_ODD 11 -#define COND_LESS_THAN 12 +#define COND_BELOW 2 +#define COND_NOT_BELOW 3 +#define COND_EQUAL 4 +#define COND_ZERO 4 +#define COND_NOT_EQUAL 5 +#define COND_NOT_ZERO 5 +#define COND_NOT_ABOVE 6 +#define COND_ABOVE 7 +#define COND_SIGN 8 +#define COND_NOT_SIGN 9 +#define COND_EVEN 10 +#define COND_ODD 11 +#define COND_LESS_THAN 12 #define COND_GREATER_EQUAL 13 -#define COND_LESS_EQUAL 14 -#define COND_GREATER_THAN 15 - /* }}} */ +#define COND_LESS_EQUAL 14 +#define COND_GREATER_THAN 15 +/* }}} */ typedef int (*JitcFunc)(void); typedef struct _LABEL_ADDR { char label[JITC_LABEL_SIZE]; - int address; + int address; } LabelAddr; typedef struct _JITC_X86_ENV { unsigned char *_memory; unsigned char *memory; - unsigned int used; + unsigned int used; int nbUsedLabel; int nbKnownLabel; - LabelAddr *usedLabel; - LabelAddr *knownLabel; + LabelAddr *usedLabel; + LabelAddr *knownLabel; } JitcX86Env; #define DISPLAY_GENCODE /*#define DISPLAY_GENCODE_HEXA*/ #ifdef DISPLAY_GENCODE_HEXA - #define JITC_ADD_UCHAR(jitc,op) printf(" 0x%02x", op) && (jitc->memory[jitc->used++]=op) +#define JITC_ADD_UCHAR(jitc, op) \ + printf(" 0x%02x", op) && (jitc->memory[jitc->used++] = op) #else - #define JITC_ADD_UCHAR(jitc,op) (jitc->memory[jitc->used++]=op) +#define JITC_ADD_UCHAR(jitc, op) (jitc->memory[jitc->used++] = op) #endif -#define JITC_ADD_USHORT(jitc,i) { JITC_ADD_UCHAR(jitc,i&0xff); JITC_ADD_UCHAR(jitc,(i>>8)&0xff); } -#define JITC_ADD_UINT(jitc,i) { \ - JITC_ADD_UCHAR(jitc,i&0xff); \ - JITC_ADD_UCHAR(jitc,(i>>8)&0xff); \ - JITC_ADD_UCHAR(jitc,(i>>16)&0xff); \ - JITC_ADD_UCHAR(jitc,(i>>24)&0xff); \ -} -#define JITC_ADD_2UCHAR(jitc,op1,op2) {JITC_ADD_UCHAR(jitc,op1); JITC_ADD_UCHAR(jitc,op2);} - -#define JITC_MODRM(jitc,mod,reg,rm) { JITC_ADD_UCHAR(jitc,((int)mod<<6)|((int)reg<<3)|((int)rm)); } +#define JITC_ADD_USHORT(jitc, i) \ + { \ + JITC_ADD_UCHAR(jitc, i & 0xff); \ + JITC_ADD_UCHAR(jitc, (i >> 8) & 0xff); \ + } +#define JITC_ADD_UINT(jitc, i) \ + { \ + JITC_ADD_UCHAR(jitc, i & 0xff); \ + JITC_ADD_UCHAR(jitc, (i >> 8) & 0xff); \ + JITC_ADD_UCHAR(jitc, (i >> 16) & 0xff); \ + JITC_ADD_UCHAR(jitc, (i >> 24) & 0xff); \ + } +#define JITC_ADD_2UCHAR(jitc, op1, op2) \ + { \ + JITC_ADD_UCHAR(jitc, op1); \ + JITC_ADD_UCHAR(jitc, op2); \ + } + +#define JITC_MODRM(jitc, mod, reg, rm) \ + { JITC_ADD_UCHAR(jitc, ((int)mod << 6) | ((int)reg << 3) | ((int)rm)); } /* special values for R/M */ #define JITC_RM_DISP32 0x05 -#define JITC_MOD_pREG_REG 0x00 -#define JITC_MOD_disp8REG_REG 0x01 +#define JITC_MOD_pREG_REG 0x00 +#define JITC_MOD_disp8REG_REG 0x01 #define JITC_MOD_disp32REG_REG 0x02 -#define JITC_MOD_REG_REG 0x03 +#define JITC_MOD_REG_REG 0x03 /* cf 24319101 p.27 */ -#define JITC_OP_REG_REG(jitc,op,dest,src) { JITC_ADD_UCHAR(jitc,op); JITC_ADD_UCHAR(jitc,0xc0+(src<<3)+dest); } -#define JITC_OP_REG_pREG(jitc,op,dest,src) { JITC_ADD_UCHAR(jitc,op); JITC_ADD_UCHAR(jitc,(dest<<3)+src); } -#define JITC_OP_pREG_REG(jitc,op,dest,src) { JITC_ADD_UCHAR(jitc,op); JITC_ADD_UCHAR(jitc,(src<<3)+dest); } +#define JITC_OP_REG_REG(jitc, op, dest, src) \ + { \ + JITC_ADD_UCHAR(jitc, op); \ + JITC_ADD_UCHAR(jitc, 0xc0 + (src << 3) + dest); \ + } +#define JITC_OP_REG_pREG(jitc, op, dest, src) \ + { \ + JITC_ADD_UCHAR(jitc, op); \ + JITC_ADD_UCHAR(jitc, (dest << 3) + src); \ + } +#define JITC_OP_pREG_REG(jitc, op, dest, src) \ + { \ + JITC_ADD_UCHAR(jitc, op); \ + JITC_ADD_UCHAR(jitc, (src << 3) + dest); \ + } /** * "high" level macro */ -#define JITC_LOAD_REG_IMM32(jitc,reg,imm32) { JITC_ADD_UCHAR (jitc,0xb8+reg); JITC_ADD_UINT(jitc,(int)(imm32)); } -#define JITC_LOAD_REG_REG(jitc,dest,src) { JITC_OP_REG_REG (jitc,0x89,dest,src); } - -#define JITC_LOAD_REG_pREG(jitc,dest,src) { JITC_OP_REG_pREG(jitc,0x8b,dest,src); } -#define JITC_LOAD_pREG_REG(jitc,dest,src) { JITC_OP_pREG_REG(jitc,0x89,dest,src); } - -#define JITC_DEC_REG(jitc,reg) { JITC_ADD_UCHAR (jitc,0x48+reg); } -#define JITC_INC_REG(jitc,reg) { JITC_ADD_UCHAR (jitc,0x40+reg); } - -#define JITC_ADD_REG_REG(jitc,dest,src) { JITC_OP_REG_REG (jitc,0x01,dest,src); } -#define JITC_ADD_REG_IMM32(jitc,reg,imm32) { JITC_ADD_UCHAR (jitc,0x81);\ - JITC_ADD_UCHAR (jitc,0xc0+reg);\ - JITC_ADD_UINT (jitc,(int)imm32); } - -#define JITC_AND_REG_REG(jitc,dest,src) { JITC_OP_REG_REG (jitc,0x21,dest,src); } -#define JITC_CMP_REG_REG(jitc,dest,src) { JITC_OP_REG_REG (jitc,0x39,dest,src); } -#define JITC_CMP_REG_IMM32(jitc,reg,imm32) { JITC_ADD_2UCHAR (jitc,0x81,0xf8+reg); \ - JITC_ADD_UINT (jitc,(int)imm32); } - -#define JITC_IDIV_EAX_REG(jitc,reg) { JITC_ADD_2UCHAR(jitc, 0xf7, 0xf8+reg); } -#define JITC_IMUL_EAX_REG(jitc,reg) { JITC_ADD_2UCHAR(jitc, 0xf7, 0xe8+reg); } - -/*#define JITC_SUB_REG_REG(jitc,dest,src) { JITC_OP_REG_REG (jitc,0x29,dest,src); } -#define JITC_SUB_EAX_IMM32(jitc,imm32) { JITC_ADD_UCHAR (jitc,0x2d); JITC_ADD_UINT(jitc,(int)imm32); } -#define JITC_SUB_REG_IMM32(jitc,reg,imm32) { JITC_ADD_2UCHAR (jitc,0x81, 0xe8+reg);\ - JITC_ADD_UINT (jitc,(int)imm32); }*/ -#define JITC_SUB_REG_IMM8(jitc,reg,imm8) { JITC_ADD_2UCHAR (jitc,0x83, 0xe8+reg);\ - JITC_ADD_UCHAR(jitc,imm8); } +#define JITC_LOAD_REG_IMM32(jitc, reg, imm32) \ + { \ + JITC_ADD_UCHAR(jitc, 0xb8 + reg); \ + JITC_ADD_UINT(jitc, (int)(imm32)); \ + } +#define JITC_LOAD_REG_REG(jitc, dest, src) \ + { JITC_OP_REG_REG(jitc, 0x89, dest, src); } + +#define JITC_LOAD_REG_pREG(jitc, dest, src) \ + { JITC_OP_REG_pREG(jitc, 0x8b, dest, src); } +#define JITC_LOAD_pREG_REG(jitc, dest, src) \ + { JITC_OP_pREG_REG(jitc, 0x89, dest, src); } + +#define JITC_DEC_REG(jitc, reg) \ + { JITC_ADD_UCHAR(jitc, 0x48 + reg); } +#define JITC_INC_REG(jitc, reg) \ + { JITC_ADD_UCHAR(jitc, 0x40 + reg); } + +#define JITC_ADD_REG_REG(jitc, dest, src) \ + { JITC_OP_REG_REG(jitc, 0x01, dest, src); } +#define JITC_ADD_REG_IMM32(jitc, reg, imm32) \ + { \ + JITC_ADD_UCHAR(jitc, 0x81); \ + JITC_ADD_UCHAR(jitc, 0xc0 + reg); \ + JITC_ADD_UINT(jitc, (int)imm32); \ + } + +#define JITC_AND_REG_REG(jitc, dest, src) \ + { JITC_OP_REG_REG(jitc, 0x21, dest, src); } +#define JITC_CMP_REG_REG(jitc, dest, src) \ + { JITC_OP_REG_REG(jitc, 0x39, dest, src); } +#define JITC_CMP_REG_IMM32(jitc, reg, imm32) \ + { \ + JITC_ADD_2UCHAR(jitc, 0x81, 0xf8 + reg); \ + JITC_ADD_UINT(jitc, (int)imm32); \ + } + +#define JITC_IDIV_EAX_REG(jitc, reg) \ + { JITC_ADD_2UCHAR(jitc, 0xf7, 0xf8 + reg); } +#define JITC_IMUL_EAX_REG(jitc, reg) \ + { JITC_ADD_2UCHAR(jitc, 0xf7, 0xe8 + reg); } + +/*#define JITC_SUB_REG_REG(jitc,dest,src) { JITC_OP_REG_REG +(jitc,0x29,dest,src); } #define JITC_SUB_EAX_IMM32(jitc,imm32) { +JITC_ADD_UCHAR (jitc,0x2d); JITC_ADD_UINT(jitc,(int)imm32); } +#define JITC_SUB_REG_IMM32(jitc,reg,imm32) { JITC_ADD_2UCHAR (jitc,0x81, +0xe8+reg);\ JITC_ADD_UINT (jitc,(int)imm32); }*/ +#define JITC_SUB_REG_IMM8(jitc, reg, imm8) \ + { \ + JITC_ADD_2UCHAR(jitc, 0x83, 0xe8 + reg); \ + JITC_ADD_UCHAR(jitc, imm8); \ + } /* Floating points */ -#define JITC_FLD_pIMM32(jitc,address) { JITC_ADD_UCHAR (jitc, 0xD9); \ - JITC_MODRM (jitc, 0x00, 0x00,JITC_RM_DISP32); \ - JITC_ADD_UINT(jitc,(int)(address)); } -#define JITC_FLD_STi(jict,reg) { JITC_ADD_2UCHAR (jitc, 0xD9, 0xC0+reg); } - -#define JITC_FST_pIMM32(jitc,address) { JITC_ADD_UCHAR (jitc, 0xD9); \ - JITC_MODRM (jitc, 0x00, 0x02,JITC_RM_DISP32); \ - JITC_ADD_UINT(jitc,(int)(ADDRess)); } -#define JITC_FST_STi(jict,reg) { JITC_ADD_2UCHAR (jitc, 0xDD, 0xD0+reg); } - -#define JITC_FSTP_pIMM32(jitc,address) { JITC_ADD_UCHAR (jitc, 0xD9); \ - JITC_MODRM (jitc, 0x00, 0x03, JITC_RM_DISP32); \ - JITC_ADD_UINT(jitc,(int)(address)); } -#define JITC_FSTP_STi(jict,reg) { JITC_ADD_2UCHAR (jitc, 0xDD, 0xD8+reg); } +#define JITC_FLD_pIMM32(jitc, address) \ + { \ + JITC_ADD_UCHAR(jitc, 0xD9); \ + JITC_MODRM(jitc, 0x00, 0x00, JITC_RM_DISP32); \ + JITC_ADD_UINT(jitc, (int)(address)); \ + } +#define JITC_FLD_STi(jict, reg) \ + { JITC_ADD_2UCHAR(jitc, 0xD9, 0xC0 + reg); } + +#define JITC_FST_pIMM32(jitc, address) \ + { \ + JITC_ADD_UCHAR(jitc, 0xD9); \ + JITC_MODRM(jitc, 0x00, 0x02, JITC_RM_DISP32); \ + JITC_ADD_UINT(jitc, (int)(ADDRess)); \ + } +#define JITC_FST_STi(jict, reg) \ + { JITC_ADD_2UCHAR(jitc, 0xDD, 0xD0 + reg); } + +#define JITC_FSTP_pIMM32(jitc, address) \ + { \ + JITC_ADD_UCHAR(jitc, 0xD9); \ + JITC_MODRM(jitc, 0x00, 0x03, JITC_RM_DISP32); \ + JITC_ADD_UINT(jitc, (int)(address)); \ + } +#define JITC_FSTP_STi(jict, reg) \ + { JITC_ADD_2UCHAR(jitc, 0xDD, 0xD8 + reg); } #define JITC_FADD /* Jumps */ -#define JITC_ADD_LABEL(jitc,label) { jitc_add_known_label(jitc,label,jitc->used); } - -#define JITC_JUMP(jitc,offset) { JITC_ADD_UCHAR(jitc,0xe9); JITC_ADD_UINT(jitc,offset); } -#define JITC_JUMP_LABEL(jitc,label) { jitc_add_used_label(jitc,label,jitc->used+1); JITC_JUMP(jitc,0); } -#define JITC_JUMP_COND(jitc,cond,offset) { JITC_ADD_UCHAR(jitc,0x0f);\ - JITC_ADD_UCHAR(jitc,0x80+cond);\ - JITC_ADD_UINT(jitc,offset); } -#define JITC_JUMP_COND_LABEL(jitc,cond,label) { jitc_add_used_label(jitc,label,jitc->used+2); JITC_JUMP_COND(jitc,cond,0); } -#define JITC_CALL(jitc,function) { int __offset__ = (int)function - (int)(&jitc->memory[jitc->used+5]);\ - JITC_ADD_UCHAR(jitc,0xe8); JITC_ADD_UINT(jitc,__offset__); } -/*#define JITC_CALL_pREG(jitc,reg) { JITC_ADD_UCHAR(jitc,0xff); JITC_ADD_UCHAR(jitc,0xd0+reg); } -#define JITC_CALL_LABEL(jitc,label) { jitc_add_used_label(jitc,label,jitc->used+1); JITC_CALL(jitc,0); }*/ +#define JITC_ADD_LABEL(jitc, label) \ + { jitc_add_known_label(jitc, label, jitc->used); } + +#define JITC_JUMP(jitc, offset) \ + { \ + JITC_ADD_UCHAR(jitc, 0xe9); \ + JITC_ADD_UINT(jitc, offset); \ + } +#define JITC_JUMP_LABEL(jitc, label) \ + { \ + jitc_add_used_label(jitc, label, jitc->used + 1); \ + JITC_JUMP(jitc, 0); \ + } +#define JITC_JUMP_COND(jitc, cond, offset) \ + { \ + JITC_ADD_UCHAR(jitc, 0x0f); \ + JITC_ADD_UCHAR(jitc, 0x80 + cond); \ + JITC_ADD_UINT(jitc, offset); \ + } +#define JITC_JUMP_COND_LABEL(jitc, cond, label) \ + { \ + jitc_add_used_label(jitc, label, jitc->used + 2); \ + JITC_JUMP_COND(jitc, cond, 0); \ + } +#define JITC_CALL(jitc, function) \ + { \ + int __offset__ = (int)function - (int)(&jitc->memory[jitc->used + 5]); \ + JITC_ADD_UCHAR(jitc, 0xe8); \ + JITC_ADD_UINT(jitc, __offset__); \ + } +/*#define JITC_CALL_pREG(jitc,reg) { JITC_ADD_UCHAR(jitc,0xff); +JITC_ADD_UCHAR(jitc,0xd0+reg); } #define JITC_CALL_LABEL(jitc,label) { +jitc_add_used_label(jitc,label,jitc->used+1); JITC_CALL(jitc,0); }*/ /* save all registers (except EAX,ESP,EBP) */ -#define JITC_PUSH_ALL(jitc) { jitc_add(jitc,"push ecx"); jitc_add(jitc,"push edx"); jitc_add(jitc,"push ebx"); \ - jitc_add(jitc,"push esi"); jitc_add(jitc,"push edi"); } +#define JITC_PUSH_ALL(jitc) \ + { \ + jitc_add(jitc, "push ecx"); \ + jitc_add(jitc, "push edx"); \ + jitc_add(jitc, "push ebx"); \ + jitc_add(jitc, "push esi"); \ + jitc_add(jitc, "push edi"); \ + } /* restore all registers (except EAX,ESP,EBP) */ -#define JITC_POP_ALL(jitc) { jitc_add(jitc,"pop edi"); jitc_add(jitc,"pop esi"); jitc_add(jitc,"pop ebx"); \ - jitc_add(jitc,"pop edx"); jitc_add(jitc,"pop ecx"); } +#define JITC_POP_ALL(jitc) \ + { \ + jitc_add(jitc, "pop edi"); \ + jitc_add(jitc, "pop esi"); \ + jitc_add(jitc, "pop ebx"); \ + jitc_add(jitc, "pop edx"); \ + jitc_add(jitc, "pop ecx"); \ + } /* public methods */ JitcX86Env *jitc_x86_env_new(int memory_size); -JitcFunc jitc_prepare_func(JitcX86Env *jitc); -void jitc_add(JitcX86Env *jitc, const char *instr, ...); -void jitc_validate_func(JitcX86Env *jitc); -void jitc_x86_delete(JitcX86Env *jitc); - +JitcFunc jitc_prepare_func(JitcX86Env *jitc); +void jitc_add(JitcX86Env *jitc, const char *instr, ...); +void jitc_validate_func(JitcX86Env *jitc); +void jitc_x86_delete(JitcX86Env *jitc); /* private methods */ void jitc_add_used_label(JitcX86Env *jitc, char *label, int where); diff --git a/libvisual-plugins/plugins/actor/goom2k4/lines.c b/libvisual-plugins/plugins/actor/goom2k4/lines.c index 96890267f..e883b280c 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/lines.c +++ b/libvisual-plugins/plugins/actor/goom2k4/lines.c @@ -10,229 +10,211 @@ #include "drawmethods.h" #include "goom_plugin_info.h" -static inline unsigned char lighten (unsigned char value, float power) -{ - int val = value; - float t = (float) val * log10(power) / 2.0; - - if (t > 0) { - val = (int) t; /* (32.0f * log (t)); */ - if (val > 255) - val = 255; - if (val < 0) - val = 0; - return val; - } - else { - return 0; - } +static inline unsigned char lighten(unsigned char value, float power) { + int val = value; + float t = (float)val * log10(power) / 2.0; + + if (t > 0) { + val = (int)t; /* (32.0f * log (t)); */ + if (val > 255) + val = 255; + if (val < 0) + val = 0; + return val; + } else { + return 0; + } } -static void lightencolor (uint32_t *col, float power) -{ - unsigned char *color; - - color = (unsigned char *) col; - *color = lighten (*color, power); - color++; - *color = lighten (*color, power); - color++; - *color = lighten (*color, power); - color++; - *color = lighten (*color, power); +static void lightencolor(uint32_t *col, float power) { + unsigned char *color; + + color = (unsigned char *)col; + *color = lighten(*color, power); + color++; + *color = lighten(*color, power); + color++; + *color = lighten(*color, power); + color++; + *color = lighten(*color, power); } - - -static void -genline (int id, float param, GMUnitPointer * l, int rx, int ry) -{ - int i; - - switch (id) { - case GML_HLINE: - for (i = 0; i < 512; i++) { - l[i].x = ((float) i * rx) / 512.0f; - l[i].y = param; - l[i].angle = M_PI / 2.0f; - } - return; - case GML_VLINE: - for (i = 0; i < 512; i++) { - l[i].y = ((float) i * ry) / 512.0f; - l[i].x = param; - l[i].angle = 0.0f; - } - return; - case GML_CIRCLE: - for (i = 0; i < 512; i++) { - float cosa, sina; - - l[i].angle = 2.0f * M_PI * (float) i / 512.0f; - cosa = param * cos (l[i].angle); - sina = param * sin (l[i].angle); - l[i].x = ((float) rx / 2.0f) + cosa; - l[i].y = (float) ry / 2.0f + sina; - } - return; - } +static void genline(int id, float param, GMUnitPointer *l, int rx, int ry) { + int i; + + switch (id) { + case GML_HLINE: + for (i = 0; i < 512; i++) { + l[i].x = ((float)i * rx) / 512.0f; + l[i].y = param; + l[i].angle = M_PI / 2.0f; + } + return; + case GML_VLINE: + for (i = 0; i < 512; i++) { + l[i].y = ((float)i * ry) / 512.0f; + l[i].x = param; + l[i].angle = 0.0f; + } + return; + case GML_CIRCLE: + for (i = 0; i < 512; i++) { + float cosa, sina; + + l[i].angle = 2.0f * M_PI * (float)i / 512.0f; + cosa = param * cos(l[i].angle); + sina = param * sin(l[i].angle); + l[i].x = ((float)rx / 2.0f) + cosa; + l[i].y = (float)ry / 2.0f + sina; + } + return; + } } -static uint32_t getcouleur (int mode) -{ - switch (mode) { - case GML_RED: - return (230 << (ROUGE * 8)) | (120 << (VERT * 8)) | (18 << (BLEU * 8)); - case GML_ORANGE_J: - return (120 << (VERT * 8)) | (252 << (ROUGE * 8)) | (18 << (BLEU * 8)); - case GML_ORANGE_V: - return (160 << (VERT * 8)) | (236 << (ROUGE * 8)) | (40 << (BLEU * 8)); - case GML_BLEUBLANC: - return (40 << (BLEU * 8)) | (220 << (ROUGE * 8)) | (140 << (VERT * 8)); - case GML_VERT: - return (200 << (VERT * 8)) | (80 << (ROUGE * 8)) | (18 << (BLEU * 8)); - case GML_BLEU: - return (250 << (BLEU * 8)) | (30 << (VERT * 8)) | (80 << (ROUGE * 8)); - case GML_BLACK: - return (16 << (BLEU * 8)) | (16 << (VERT * 8)) | (16 << (ROUGE * 8)); - } - return 0; +static uint32_t getcouleur(int mode) { + switch (mode) { + case GML_RED: + return (230 << (ROUGE * 8)) | (120 << (VERT * 8)) | (18 << (BLEU * 8)); + case GML_ORANGE_J: + return (120 << (VERT * 8)) | (252 << (ROUGE * 8)) | (18 << (BLEU * 8)); + case GML_ORANGE_V: + return (160 << (VERT * 8)) | (236 << (ROUGE * 8)) | (40 << (BLEU * 8)); + case GML_BLEUBLANC: + return (40 << (BLEU * 8)) | (220 << (ROUGE * 8)) | (140 << (VERT * 8)); + case GML_VERT: + return (200 << (VERT * 8)) | (80 << (ROUGE * 8)) | (18 << (BLEU * 8)); + case GML_BLEU: + return (250 << (BLEU * 8)) | (30 << (VERT * 8)) | (80 << (ROUGE * 8)); + case GML_BLACK: + return (16 << (BLEU * 8)) | (16 << (VERT * 8)) | (16 << (ROUGE * 8)); + } + return 0; } -void -goom_lines_set_res (GMLine * gml, int rx, int ry) -{ - if (gml != NULL) { - gml->screenX = rx; - gml->screenY = ry; +void goom_lines_set_res(GMLine *gml, int rx, int ry) { + if (gml != NULL) { + gml->screenX = rx; + gml->screenY = ry; - genline (gml->IDdest, gml->param, gml->points2, rx, ry); - } + genline(gml->IDdest, gml->param, gml->points2, rx, ry); + } } - -static void -goom_lines_move (GMLine * l) -{ - int i; - unsigned char *c1, *c2; - - for (i = 0; i < 512; i++) { - l->points[i].x = (l->points2[i].x + 39.0f * l->points[i].x) / 40.0f; - l->points[i].y = (l->points2[i].y + 39.0f * l->points[i].y) / 40.0f; - l->points[i].angle = - (l->points2[i].angle + 39.0f * l->points[i].angle) / 40.0f; - } - - c1 = (unsigned char *) &l->color; - c2 = (unsigned char *) &l->color2; - for (i = 0; i < 4; i++) { - int cc1, cc2; - - cc1 = *c1; - cc2 = *c2; - *c1 = (unsigned char) ((cc1 * 63 + cc2) >> 6); - ++c1; - ++c2; - } - - l->power += l->powinc; - if (l->power < 1.1f) { - l->power = 1.1f; - l->powinc = (float) (goom_irand(l->goomInfo->gRandom,20) + 10) / 300.0f; - } - if (l->power > 17.5f) { - l->power = 17.5f; - l->powinc = -(float) (goom_irand(l->goomInfo->gRandom,20) + 10) / 300.0f; - } - - l->amplitude = (99.0f * l->amplitude + l->amplitudeF) / 100.0f; +static void goom_lines_move(GMLine *l) { + int i; + unsigned char *c1, *c2; + + for (i = 0; i < 512; i++) { + l->points[i].x = (l->points2[i].x + 39.0f * l->points[i].x) / 40.0f; + l->points[i].y = (l->points2[i].y + 39.0f * l->points[i].y) / 40.0f; + l->points[i].angle = + (l->points2[i].angle + 39.0f * l->points[i].angle) / 40.0f; + } + + c1 = (unsigned char *)&l->color; + c2 = (unsigned char *)&l->color2; + for (i = 0; i < 4; i++) { + int cc1, cc2; + + cc1 = *c1; + cc2 = *c2; + *c1 = (unsigned char)((cc1 * 63 + cc2) >> 6); + ++c1; + ++c2; + } + + l->power += l->powinc; + if (l->power < 1.1f) { + l->power = 1.1f; + l->powinc = (float)(goom_irand(l->goomInfo->gRandom, 20) + 10) / 300.0f; + } + if (l->power > 17.5f) { + l->power = 17.5f; + l->powinc = -(float)(goom_irand(l->goomInfo->gRandom, 20) + 10) / 300.0f; + } + + l->amplitude = (99.0f * l->amplitude + l->amplitudeF) / 100.0f; } -void -goom_lines_switch_to (GMLine * gml, int IDdest, - float param, float amplitude, int col) -{ - genline (IDdest, param, gml->points2, gml->screenX, gml->screenY); - gml->IDdest = IDdest; - gml->param = param; - gml->amplitudeF = amplitude; - gml->color2 = getcouleur (col); +void goom_lines_switch_to(GMLine *gml, int IDdest, float param, float amplitude, + int col) { + genline(IDdest, param, gml->points2, gml->screenX, gml->screenY); + gml->IDdest = IDdest; + gml->param = param; + gml->amplitudeF = amplitude; + gml->color2 = getcouleur(col); } -GMLine * -goom_lines_init (PluginInfo *goomInfo, int rx, int ry, - int IDsrc, float paramS, int coulS, - int IDdest, float paramD, int coulD) -{ - GMLine *l = (GMLine *) malloc (sizeof (GMLine)); +GMLine *goom_lines_init(PluginInfo *goomInfo, int rx, int ry, int IDsrc, + float paramS, int coulS, int IDdest, float paramD, + int coulD) { + GMLine *l = (GMLine *)malloc(sizeof(GMLine)); + + l->goomInfo = goomInfo; + + l->points = (GMUnitPointer *)malloc(512 * sizeof(GMUnitPointer)); + l->points2 = (GMUnitPointer *)malloc(512 * sizeof(GMUnitPointer)); + l->nbPoints = 512; - l->goomInfo = goomInfo; - - l->points = (GMUnitPointer *) malloc (512 * sizeof (GMUnitPointer)); - l->points2 = (GMUnitPointer *) malloc (512 * sizeof (GMUnitPointer)); - l->nbPoints = 512; + l->IDdest = IDdest; + l->param = paramD; - l->IDdest = IDdest; - l->param = paramD; - - l->amplitude = l->amplitudeF = 1.0f; + l->amplitude = l->amplitudeF = 1.0f; - genline (IDsrc, paramS, l->points, rx, ry); - genline (IDdest, paramD, l->points2, rx, ry); + genline(IDsrc, paramS, l->points, rx, ry); + genline(IDdest, paramD, l->points2, rx, ry); - l->color = getcouleur (coulS); - l->color2 = getcouleur (coulD); + l->color = getcouleur(coulS); + l->color2 = getcouleur(coulD); - l->screenX = rx; - l->screenY = ry; + l->screenX = rx; + l->screenY = ry; - l->power = 0.0f; - l->powinc = 0.01f; + l->power = 0.0f; + l->powinc = 0.01f; - goom_lines_switch_to (l, IDdest, paramD, 1.0f, coulD); + goom_lines_switch_to(l, IDdest, paramD, 1.0f, coulD); - return l; + return l; } -void -goom_lines_free (GMLine ** l) -{ - free ((*l)->points); - free (*l); - l = NULL; +void goom_lines_free(GMLine **l) { + free((*l)->points); + free(*l); + l = NULL; } -void goom_lines_draw (PluginInfo *plug, GMLine * line, int16_t data[512], Pixel *p) -{ - if (line != NULL) { - int i, x1, y1; - uint32_t color = line->color; - GMUnitPointer *pt = &(line->points[0]); +void goom_lines_draw(PluginInfo *plug, GMLine *line, int16_t data[512], + Pixel *p) { + if (line != NULL) { + int i, x1, y1; + uint32_t color = line->color; + GMUnitPointer *pt = &(line->points[0]); - float cosa = cos (pt->angle) / 1000.0f; - float sina = sin (pt->angle) / 1000.0f; + float cosa = cos(pt->angle) / 1000.0f; + float sina = sin(pt->angle) / 1000.0f; - lightencolor (&color, line->power); + lightencolor(&color, line->power); - x1 = (int) (pt->x + cosa * line->amplitude * data[0]); - y1 = (int) (pt->y + sina * line->amplitude * data[0]); + x1 = (int)(pt->x + cosa * line->amplitude * data[0]); + y1 = (int)(pt->y + sina * line->amplitude * data[0]); - for (i = 1; i < 512; i++) { - int x2, y2; - GMUnitPointer *pt = &(line->points[i]); + for (i = 1; i < 512; i++) { + int x2, y2; + GMUnitPointer *pt = &(line->points[i]); - float cosa = cos (pt->angle) / 1000.0f; - float sina = sin (pt->angle) / 1000.0f; + float cosa = cos(pt->angle) / 1000.0f; + float sina = sin(pt->angle) / 1000.0f; - x2 = (int) (pt->x + cosa * line->amplitude * data[i]); - y2 = (int) (pt->y + sina * line->amplitude * data[i]); + x2 = (int)(pt->x + cosa * line->amplitude * data[i]); + y2 = (int)(pt->y + sina * line->amplitude * data[i]); - plug->methods.draw_line (p, x1, y1, x2, y2, color, line->screenX, line->screenY); + plug->methods.draw_line(p, x1, y1, x2, y2, color, line->screenX, + line->screenY); - x1 = x2; - y1 = y2; - } - goom_lines_move (line); - } + x1 = x2; + y1 = y2; + } + goom_lines_move(line); + } } diff --git a/libvisual-plugins/plugins/actor/goom2k4/lines.h b/libvisual-plugins/plugins/actor/goom2k4/lines.h index 458562f64..0419a5e72 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/lines.h +++ b/libvisual-plugins/plugins/actor/goom2k4/lines.h @@ -11,35 +11,34 @@ #include "goom_graphic.h" #include "goom_config.h" -struct _GMUNITPOINTER -{ - float x; - float y; - float angle; +struct _GMUNITPOINTER { + float x; + float y; + float angle; }; /* tableau de points */ -struct _GMLINE -{ +struct _GMLINE { - GMUnitPointer *points; - GMUnitPointer *points2; - int IDdest; - float param; - float amplitudeF; - float amplitude; + GMUnitPointer *points; + GMUnitPointer *points2; + int IDdest; + float param; + float amplitudeF; + float amplitude; - int nbPoints; - uint32_t color; /* pour l'instant je stocke la couleur a terme, on stockera le mode couleur et l'on animera */ - uint32_t color2; + int nbPoints; + uint32_t color; /* pour l'instant je stocke la couleur a terme, on stockera le + mode couleur et l'on animera */ + uint32_t color2; - int screenX; - int screenY; + int screenX; + int screenY; - float power; - float powinc; + float power; + float powinc; - PluginInfo *goomInfo; + PluginInfo *goomInfo; }; /* les ID possibles */ @@ -64,18 +63,18 @@ struct _GMLINE #define GML_BLACK 6 /* construit un effet de line (une ligne horitontale pour commencer) */ -GMLine *goom_lines_init (PluginInfo *goomInfo, int rx, int ry, - int IDsrc, float paramS, int modeCoulSrc, - int IDdest, float paramD, int modeCoulDest); +GMLine *goom_lines_init(PluginInfo *goomInfo, int rx, int ry, int IDsrc, + float paramS, int modeCoulSrc, int IDdest, float paramD, + int modeCoulDest); -void goom_lines_switch_to (GMLine * gml, int IDdest, float param, - float amplitude, - int modeCoul); +void goom_lines_switch_to(GMLine *gml, int IDdest, float param, float amplitude, + int modeCoul); -void goom_lines_set_res (GMLine * gml, int rx, int ry); +void goom_lines_set_res(GMLine *gml, int rx, int ry); -void goom_lines_free (GMLine ** gml); +void goom_lines_free(GMLine **gml); -void goom_lines_draw (PluginInfo *plugInfo, GMLine * gml, int16_t data[512], Pixel *p); +void goom_lines_draw(PluginInfo *plugInfo, GMLine *gml, int16_t data[512], + Pixel *p); #endif /* _LINES_H */ diff --git a/libvisual-plugins/plugins/actor/goom2k4/mathtools.c b/libvisual-plugins/plugins/actor/goom2k4/mathtools.c index b2b02ea05..7e9259b8b 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/mathtools.c +++ b/libvisual-plugins/plugins/actor/goom2k4/mathtools.c @@ -4,81 +4,111 @@ ** Goom Project ** ** Created by Jeko on Sun Jul 20 2003 - ** Copyright (c) 2003 iOS. All rights reserved. +** Copyright (c) 2003 iOS. All rights reserved. */ /*---------------------------------------------------------------------------*/ #include "mathtools.h" float sin256[256] = { - 0,0.0245412,0.0490677,0.0735646,0.0980171,0.122411,0.14673,0.170962 - ,0.19509,0.219101,0.24298,0.266713,0.290285,0.313682,0.33689,0.359895 - ,0.382683,0.405241,0.427555,0.449611,0.471397,0.492898,0.514103,0.534998 - ,0.55557,0.575808,0.595699,0.615232,0.634393,0.653173,0.671559,0.689541 - ,0.707107,0.724247,0.740951,0.757209,0.77301,0.788346,0.803208,0.817585 - ,0.83147,0.844854,0.857729,0.870087,0.881921,0.893224,0.903989,0.91421 - ,0.92388,0.932993,0.941544,0.949528,0.95694,0.963776,0.970031,0.975702 - ,0.980785,0.985278,0.989177,0.99248,0.995185,0.99729,0.998795,0.999699 - ,1,0.999699,0.998795,0.99729,0.995185,0.99248,0.989177,0.985278 - ,0.980785,0.975702,0.970031,0.963776,0.95694,0.949528,0.941544,0.932993 - ,0.92388,0.91421,0.903989,0.893224,0.881921,0.870087,0.857729,0.844854 - ,0.83147,0.817585,0.803208,0.788346,0.77301,0.757209,0.740951,0.724247 - ,0.707107,0.689541,0.671559,0.653173,0.634393,0.615232,0.595699,0.575808 - ,0.55557,0.534998,0.514103,0.492898,0.471397,0.449611,0.427555,0.405241 - ,0.382683,0.359895,0.33689,0.313682,0.290285,0.266713,0.24298,0.219101 - ,0.19509,0.170962,0.14673,0.122411,0.0980171,0.0735646,0.0490677,0.0245412 - ,1.22465e-16,-0.0245412,-0.0490677,-0.0735646,-0.0980171,-0.122411,-0.14673,-0.170962 - ,-0.19509,-0.219101,-0.24298,-0.266713,-0.290285,-0.313682,-0.33689,-0.359895 - ,-0.382683,-0.405241,-0.427555,-0.449611,-0.471397,-0.492898,-0.514103,-0.534998 - ,-0.55557,-0.575808,-0.595699,-0.615232,-0.634393,-0.653173,-0.671559,-0.689541 - ,-0.707107,-0.724247,-0.740951,-0.757209,-0.77301,-0.788346,-0.803208,-0.817585 - ,-0.83147,-0.844854,-0.857729,-0.870087,-0.881921,-0.893224,-0.903989,-0.91421 - ,-0.92388,-0.932993,-0.941544,-0.949528,-0.95694,-0.963776,-0.970031,-0.975702 - ,-0.980785,-0.985278,-0.989177,-0.99248,-0.995185,-0.99729,-0.998795,-0.999699 - ,-1,-0.999699,-0.998795,-0.99729,-0.995185,-0.99248,-0.989177,-0.985278 - ,-0.980785,-0.975702,-0.970031,-0.963776,-0.95694,-0.949528,-0.941544,-0.932993 - ,-0.92388,-0.91421,-0.903989,-0.893224,-0.881921,-0.870087,-0.857729,-0.844854 - ,-0.83147,-0.817585,-0.803208,-0.788346,-0.77301,-0.757209,-0.740951,-0.724247 - ,-0.707107,-0.689541,-0.671559,-0.653173,-0.634393,-0.615232,-0.595699,-0.575808 - ,-0.55557,-0.534998,-0.514103,-0.492898,-0.471397,-0.449611,-0.427555,-0.405241 - ,-0.382683,-0.359895,-0.33689,-0.313682,-0.290285,-0.266713,-0.24298,-0.219101 - ,-0.19509,-0.170962,-0.14673,-0.122411,-0.0980171,-0.0735646,-0.0490677,-0.0245412 + 0, 0.0245412, 0.0490677, 0.0735646, 0.0980171, 0.122411, + 0.14673, 0.170962, 0.19509, 0.219101, 0.24298, 0.266713, + 0.290285, 0.313682, 0.33689, 0.359895, 0.382683, 0.405241, + 0.427555, 0.449611, 0.471397, 0.492898, 0.514103, 0.534998, + 0.55557, 0.575808, 0.595699, 0.615232, 0.634393, 0.653173, + 0.671559, 0.689541, 0.707107, 0.724247, 0.740951, 0.757209, + 0.77301, 0.788346, 0.803208, 0.817585, 0.83147, 0.844854, + 0.857729, 0.870087, 0.881921, 0.893224, 0.903989, 0.91421, + 0.92388, 0.932993, 0.941544, 0.949528, 0.95694, 0.963776, + 0.970031, 0.975702, 0.980785, 0.985278, 0.989177, 0.99248, + 0.995185, 0.99729, 0.998795, 0.999699, 1, 0.999699, + 0.998795, 0.99729, 0.995185, 0.99248, 0.989177, 0.985278, + 0.980785, 0.975702, 0.970031, 0.963776, 0.95694, 0.949528, + 0.941544, 0.932993, 0.92388, 0.91421, 0.903989, 0.893224, + 0.881921, 0.870087, 0.857729, 0.844854, 0.83147, 0.817585, + 0.803208, 0.788346, 0.77301, 0.757209, 0.740951, 0.724247, + 0.707107, 0.689541, 0.671559, 0.653173, 0.634393, 0.615232, + 0.595699, 0.575808, 0.55557, 0.534998, 0.514103, 0.492898, + 0.471397, 0.449611, 0.427555, 0.405241, 0.382683, 0.359895, + 0.33689, 0.313682, 0.290285, 0.266713, 0.24298, 0.219101, + 0.19509, 0.170962, 0.14673, 0.122411, 0.0980171, 0.0735646, + 0.0490677, 0.0245412, 1.22465e-16, -0.0245412, -0.0490677, -0.0735646, + -0.0980171, -0.122411, -0.14673, -0.170962, -0.19509, -0.219101, + -0.24298, -0.266713, -0.290285, -0.313682, -0.33689, -0.359895, + -0.382683, -0.405241, -0.427555, -0.449611, -0.471397, -0.492898, + -0.514103, -0.534998, -0.55557, -0.575808, -0.595699, -0.615232, + -0.634393, -0.653173, -0.671559, -0.689541, -0.707107, -0.724247, + -0.740951, -0.757209, -0.77301, -0.788346, -0.803208, -0.817585, + -0.83147, -0.844854, -0.857729, -0.870087, -0.881921, -0.893224, + -0.903989, -0.91421, -0.92388, -0.932993, -0.941544, -0.949528, + -0.95694, -0.963776, -0.970031, -0.975702, -0.980785, -0.985278, + -0.989177, -0.99248, -0.995185, -0.99729, -0.998795, -0.999699, + -1, -0.999699, -0.998795, -0.99729, -0.995185, -0.99248, + -0.989177, -0.985278, -0.980785, -0.975702, -0.970031, -0.963776, + -0.95694, -0.949528, -0.941544, -0.932993, -0.92388, -0.91421, + -0.903989, -0.893224, -0.881921, -0.870087, -0.857729, -0.844854, + -0.83147, -0.817585, -0.803208, -0.788346, -0.77301, -0.757209, + -0.740951, -0.724247, -0.707107, -0.689541, -0.671559, -0.653173, + -0.634393, -0.615232, -0.595699, -0.575808, -0.55557, -0.534998, + -0.514103, -0.492898, -0.471397, -0.449611, -0.427555, -0.405241, + -0.382683, -0.359895, -0.33689, -0.313682, -0.290285, -0.266713, + -0.24298, -0.219101, -0.19509, -0.170962, -0.14673, -0.122411, + -0.0980171, -0.0735646, -0.0490677, -0.0245412 }; float cos256[256] = { - 0,0.999699,0.998795,0.99729,0.995185,0.99248,0.989177,0.985278 - ,0.980785,0.975702,0.970031,0.963776,0.95694,0.949528,0.941544,0.932993 - ,0.92388,0.91421,0.903989,0.893224,0.881921,0.870087,0.857729,0.844854 - ,0.83147,0.817585,0.803208,0.788346,0.77301,0.757209,0.740951,0.724247 - ,0.707107,0.689541,0.671559,0.653173,0.634393,0.615232,0.595699,0.575808 - ,0.55557,0.534998,0.514103,0.492898,0.471397,0.449611,0.427555,0.405241 - ,0.382683,0.359895,0.33689,0.313682,0.290285,0.266713,0.24298,0.219101 - ,0.19509,0.170962,0.14673,0.122411,0.0980171,0.0735646,0.0490677,0.0245412 - ,6.12323e-17,-0.0245412,-0.0490677,-0.0735646,-0.0980171,-0.122411,-0.14673,-0.170962 - ,-0.19509,-0.219101,-0.24298,-0.266713,-0.290285,-0.313682,-0.33689,-0.359895 - ,-0.382683,-0.405241,-0.427555,-0.449611,-0.471397,-0.492898,-0.514103,-0.534998 - ,-0.55557,-0.575808,-0.595699,-0.615232,-0.634393,-0.653173,-0.671559,-0.689541 - ,-0.707107,-0.724247,-0.740951,-0.757209,-0.77301,-0.788346,-0.803208,-0.817585 - ,-0.83147,-0.844854,-0.857729,-0.870087,-0.881921,-0.893224,-0.903989,-0.91421 - ,-0.92388,-0.932993,-0.941544,-0.949528,-0.95694,-0.963776,-0.970031,-0.975702 - ,-0.980785,-0.985278,-0.989177,-0.99248,-0.995185,-0.99729,-0.998795,-0.999699 - ,-1,-0.999699,-0.998795,-0.99729,-0.995185,-0.99248,-0.989177,-0.985278 - ,-0.980785,-0.975702,-0.970031,-0.963776,-0.95694,-0.949528,-0.941544,-0.932993 - ,-0.92388,-0.91421,-0.903989,-0.893224,-0.881921,-0.870087,-0.857729,-0.844854 - ,-0.83147,-0.817585,-0.803208,-0.788346,-0.77301,-0.757209,-0.740951,-0.724247 - ,-0.707107,-0.689541,-0.671559,-0.653173,-0.634393,-0.615232,-0.595699,-0.575808 - ,-0.55557,-0.534998,-0.514103,-0.492898,-0.471397,-0.449611,-0.427555,-0.405241 - ,-0.382683,-0.359895,-0.33689,-0.313682,-0.290285,-0.266713,-0.24298,-0.219101 - ,-0.19509,-0.170962,-0.14673,-0.122411,-0.0980171,-0.0735646,-0.0490677,-0.0245412 - ,-1.83697e-16,0.0245412,0.0490677,0.0735646,0.0980171,0.122411,0.14673,0.170962 - ,0.19509,0.219101,0.24298,0.266713,0.290285,0.313682,0.33689,0.359895 - ,0.382683,0.405241,0.427555,0.449611,0.471397,0.492898,0.514103,0.534998 - ,0.55557,0.575808,0.595699,0.615232,0.634393,0.653173,0.671559,0.689541 - ,0.707107,0.724247,0.740951,0.757209,0.77301,0.788346,0.803208,0.817585 - ,0.83147,0.844854,0.857729,0.870087,0.881921,0.893224,0.903989,0.91421 - ,0.92388,0.932993,0.941544,0.949528,0.95694,0.963776,0.970031,0.975702 - ,0.980785,0.985278,0.989177,0.99248,0.995185,0.99729,0.998795,0.999699 + 0, 0.999699, 0.998795, 0.99729, 0.995185, + 0.99248, 0.989177, 0.985278, 0.980785, 0.975702, + 0.970031, 0.963776, 0.95694, 0.949528, 0.941544, + 0.932993, 0.92388, 0.91421, 0.903989, 0.893224, + 0.881921, 0.870087, 0.857729, 0.844854, 0.83147, + 0.817585, 0.803208, 0.788346, 0.77301, 0.757209, + 0.740951, 0.724247, 0.707107, 0.689541, 0.671559, + 0.653173, 0.634393, 0.615232, 0.595699, 0.575808, + 0.55557, 0.534998, 0.514103, 0.492898, 0.471397, + 0.449611, 0.427555, 0.405241, 0.382683, 0.359895, + 0.33689, 0.313682, 0.290285, 0.266713, 0.24298, + 0.219101, 0.19509, 0.170962, 0.14673, 0.122411, + 0.0980171, 0.0735646, 0.0490677, 0.0245412, 6.12323e-17, + -0.0245412, -0.0490677, -0.0735646, -0.0980171, -0.122411, + -0.14673, -0.170962, -0.19509, -0.219101, -0.24298, + -0.266713, -0.290285, -0.313682, -0.33689, -0.359895, + -0.382683, -0.405241, -0.427555, -0.449611, -0.471397, + -0.492898, -0.514103, -0.534998, -0.55557, -0.575808, + -0.595699, -0.615232, -0.634393, -0.653173, -0.671559, + -0.689541, -0.707107, -0.724247, -0.740951, -0.757209, + -0.77301, -0.788346, -0.803208, -0.817585, -0.83147, + -0.844854, -0.857729, -0.870087, -0.881921, -0.893224, + -0.903989, -0.91421, -0.92388, -0.932993, -0.941544, + -0.949528, -0.95694, -0.963776, -0.970031, -0.975702, + -0.980785, -0.985278, -0.989177, -0.99248, -0.995185, + -0.99729, -0.998795, -0.999699, -1, -0.999699, + -0.998795, -0.99729, -0.995185, -0.99248, -0.989177, + -0.985278, -0.980785, -0.975702, -0.970031, -0.963776, + -0.95694, -0.949528, -0.941544, -0.932993, -0.92388, + -0.91421, -0.903989, -0.893224, -0.881921, -0.870087, + -0.857729, -0.844854, -0.83147, -0.817585, -0.803208, + -0.788346, -0.77301, -0.757209, -0.740951, -0.724247, + -0.707107, -0.689541, -0.671559, -0.653173, -0.634393, + -0.615232, -0.595699, -0.575808, -0.55557, -0.534998, + -0.514103, -0.492898, -0.471397, -0.449611, -0.427555, + -0.405241, -0.382683, -0.359895, -0.33689, -0.313682, + -0.290285, -0.266713, -0.24298, -0.219101, -0.19509, + -0.170962, -0.14673, -0.122411, -0.0980171, -0.0735646, + -0.0490677, -0.0245412, -1.83697e-16, 0.0245412, 0.0490677, + 0.0735646, 0.0980171, 0.122411, 0.14673, 0.170962, + 0.19509, 0.219101, 0.24298, 0.266713, 0.290285, + 0.313682, 0.33689, 0.359895, 0.382683, 0.405241, + 0.427555, 0.449611, 0.471397, 0.492898, 0.514103, + 0.534998, 0.55557, 0.575808, 0.595699, 0.615232, + 0.634393, 0.653173, 0.671559, 0.689541, 0.707107, + 0.724247, 0.740951, 0.757209, 0.77301, 0.788346, + 0.803208, 0.817585, 0.83147, 0.844854, 0.857729, + 0.870087, 0.881921, 0.893224, 0.903989, 0.91421, + 0.92388, 0.932993, 0.941544, 0.949528, 0.95694, + 0.963776, 0.970031, 0.975702, 0.980785, 0.985278, + 0.989177, 0.99248, 0.995185, 0.99729, 0.998795, + 0.999699 }; - diff --git a/libvisual-plugins/plugins/actor/goom2k4/mathtools.h b/libvisual-plugins/plugins/actor/goom2k4/mathtools.h index 0e2293c3f..99c546d6b 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/mathtools.h +++ b/libvisual-plugins/plugins/actor/goom2k4/mathtools.h @@ -1,36 +1,38 @@ #ifndef MATHTOOLS_H #define MATHTOOLS_H - -#define _double2fixmagic (68719476736.0*1.5) +#define _double2fixmagic (68719476736.0 * 1.5) /* 2^36 * 1.5, (52-_shiftamt=36) uses limited precisicion to floor */ #define _shiftamt 16 /* 16.16 fixed point representation */ #if BigEndian_ -#define iexp_ 0 -#define iman_ 1 +#define iexp_ 0 +#define iman_ 1 #else -#define iexp_ 1 -#define iman_ 0 +#define iexp_ 1 +#define iman_ 0 #endif /* BigEndian_ */ /* TODO: this optimization is very efficient: put it again when all works #ifdef HAVE_MMX -#define F2I(dbl,i) {double d = dbl + _double2fixmagic; i = ((int*)&d)[iman_] >> _shiftamt;} -#else*/ -#define F2I(dbl,i) i=(int)dbl; +#define F2I(dbl,i) {double d = dbl + _double2fixmagic; i = ((int*)&d)[iman_] >> +_shiftamt;} #else*/ +#define F2I(dbl, i) i = (int)dbl; /*#endif*/ #if 0 -#define SINCOS(f,s,c) \ - __asm__ __volatile__ ("fsincos" : "=t" (c), "=u" (s) : "0" (f)) +#define SINCOS(f, s, c) \ + __asm__ __volatile__("fsincos" : "=t"(c), "=u"(s) : "0"(f)) #else -#define SINCOS(f,s,c) {s=sin(f);c=cos(f);} +#define SINCOS(f, s, c) \ + { \ + s = sin(f); \ + c = cos(f); \ + } #endif extern float sin256[256]; extern float cos256[256]; #endif - diff --git a/libvisual-plugins/plugins/actor/goom2k4/mmx.c b/libvisual-plugins/plugins/actor/goom2k4/mmx.c index fdf06492a..f51d68f04 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/mmx.c +++ b/libvisual-plugins/plugins/actor/goom2k4/mmx.c @@ -13,263 +13,257 @@ // faire : a / sqrtperte <=> a >> PERTEDEC #define PERTEDEC 4 -int mmx_supported (void) { - return (mm_support()&0x1); -} - -void zoom_filter_mmx (int prevX, int prevY, - Pixel *expix1, Pixel *expix2, - int *brutS, int *brutD, int buffratio, - int precalCoef[16][16]) -{ - unsigned int ax = (prevX-1)<> BUFFPOINTNB); - brutSmypos = brutS[myPos2]; - py = brutSmypos + (((brutD[myPos2] - brutSmypos)*buffratio) >> BUFFPOINTNB); + int myPos = loop << 1, myPos2 = myPos + 1; + int brutSmypos = brutS[myPos]; - if ((py>=ay) || (px>=ax)) { - pos=coeffs=0; - } - else { - pos = ((px >> PERTEDEC) + prevX * (py >> PERTEDEC)); - // coef en modulo 15 - coeffs = precalCoef [px & PERTEMASK][py & PERTEMASK]; - } + px = + brutSmypos + (((brutD[myPos] - brutSmypos) * buffratio) >> BUFFPOINTNB); + brutSmypos = brutS[myPos2]; + py = brutSmypos + + (((brutD[myPos2] - brutSmypos) * buffratio) >> BUFFPOINTNB); - __asm__ __volatile__ ( - "movd %2, %%mm6 \n\t" + if ((py >= ay) || (px >= ax)) { + pos = coeffs = 0; + } else { + pos = ((px >> PERTEDEC) + prevX * (py >> PERTEDEC)); + // coef en modulo 15 + coeffs = precalCoef[px & PERTEMASK][py & PERTEMASK]; + } - /* recuperation des deux premiers pixels dans mm0 et mm1 */ - "movq (%3,%1,4), %%mm0 \n\t" /* b1-v1-r1-a1-b2-v2-r2-a2 */ - "movq %%mm0, %%mm1 \n\t" /* b1-v1-r1-a1-b2-v2-r2-a2 */ + __asm__ __volatile__( + "movd %2, %%mm6 \n\t" - /* depackage du premier pixel */ - "punpcklbw %%mm7, %%mm0 \n\t" /* 00-b2-00-v2-00-r2-00-a2 */ + /* recuperation des deux premiers pixels dans mm0 et mm1 */ + "movq (%3,%1,4), %%mm0 \n\t" /* b1-v1-r1-a1-b2-v2-r2-a2 */ + "movq %%mm0, %%mm1 \n\t" /* b1-v1-r1-a1-b2-v2-r2-a2 */ - "movq %%mm6, %%mm5 \n\t" /* ??-??-??-??-c4-c3-c2-c1 */ - /* depackage du 2ieme pixel */ - "punpckhbw %%mm7, %%mm1 \n\t" /* 00-b1-00-v1-00-r1-00-a1 */ + /* depackage du premier pixel */ + "punpcklbw %%mm7, %%mm0 \n\t" /* 00-b2-00-v2-00-r2-00-a2 */ - /* extraction des coefficients... */ - "punpcklbw %%mm5, %%mm6 \n\t" /* c4-c4-c3-c3-c2-c2-c1-c1 */ - "movq %%mm6, %%mm4 \n\t" /* c4-c4-c3-c3-c2-c2-c1-c1 */ - "movq %%mm6, %%mm5 \n\t" /* c4-c4-c3-c3-c2-c2-c1-c1 */ + "movq %%mm6, %%mm5 \n\t" /* ??-??-??-??-c4-c3-c2-c1 */ + /* depackage du 2ieme pixel */ + "punpckhbw %%mm7, %%mm1 \n\t" /* 00-b1-00-v1-00-r1-00-a1 */ - "punpcklbw %%mm5, %%mm6 \n\t" /* c2-c2-c2-c2-c1-c1-c1-c1 */ - "punpckhbw %%mm5, %%mm4 \n\t" /* c4-c4-c4-c4-c3-c3-c3-c3 */ + /* extraction des coefficients... */ + "punpcklbw %%mm5, %%mm6 \n\t" /* c4-c4-c3-c3-c2-c2-c1-c1 */ + "movq %%mm6, %%mm4 \n\t" /* c4-c4-c3-c3-c2-c2-c1-c1 */ + "movq %%mm6, %%mm5 \n\t" /* c4-c4-c3-c3-c2-c2-c1-c1 */ - "movq %%mm6, %%mm3 \n\t" /* c2-c2-c2-c2-c1-c1-c1-c1 */ + "punpcklbw %%mm5, %%mm6 \n\t" /* c2-c2-c2-c2-c1-c1-c1-c1 */ + "punpckhbw %%mm5, %%mm4 \n\t" /* c4-c4-c4-c4-c3-c3-c3-c3 */ - "punpcklbw %%mm7, %%mm6 \n\t" /* 00-c1-00-c1-00-c1-00-c1 */ - "punpckhbw %%mm7, %%mm3 \n\t" /* 00-c2-00-c2-00-c2-00-c2 */ + "movq %%mm6, %%mm3 \n\t" /* c2-c2-c2-c2-c1-c1-c1-c1 */ - /* multiplication des pixels par les coefficients */ - "pmullw %%mm6, %%mm0 \n\t" /* c1*b2-c1*v2-c1*r2-c1*a2 */ - "pmullw %%mm3, %%mm1 \n\t" /* c2*b1-c2*v1-c2*r1-c2*a1 */ - "paddw %%mm1, %%mm0 \n\t" + "punpcklbw %%mm7, %%mm6 \n\t" /* 00-c1-00-c1-00-c1-00-c1 */ + "punpckhbw %%mm7, %%mm3 \n\t" /* 00-c2-00-c2-00-c2-00-c2 */ - /* ...extraction des 2 derniers coefficients */ - "movq %%mm4, %%mm5 \n\t" /* c4-c4-c4-c4-c3-c3-c3-c3 */ - "punpcklbw %%mm7, %%mm4 \n\t" /* 00-c3-00-c3-00-c3-00-c3 */ - "punpckhbw %%mm7, %%mm5 \n\t" /* 00-c4-00-c4-00-c4-00-c4 */ + /* multiplication des pixels par les coefficients */ + "pmullw %%mm6, %%mm0 \n\t" /* c1*b2-c1*v2-c1*r2-c1*a2 */ + "pmullw %%mm3, %%mm1 \n\t" /* c2*b1-c2*v1-c2*r1-c2*a1 */ + "paddw %%mm1, %%mm0 \n\t" - /* ajouter la longueur de ligne a esi */ - "addl 8(%%ebp),%1 \n\t" + /* ...extraction des 2 derniers coefficients */ + "movq %%mm4, %%mm5 \n\t" /* c4-c4-c4-c4-c3-c3-c3-c3 */ + "punpcklbw %%mm7, %%mm4 \n\t" /* 00-c3-00-c3-00-c3-00-c3 */ + "punpckhbw %%mm7, %%mm5 \n\t" /* 00-c4-00-c4-00-c4-00-c4 */ - /* recuperation des 2 derniers pixels */ - "movq (%3,%1,4), %%mm1 \n\t" - "movq %%mm1, %%mm2 \n\t" + /* ajouter la longueur de ligne a esi */ + "addl 8(%%ebp),%1 \n\t" - /* depackage des pixels */ - "punpcklbw %%mm7, %%mm1 \n\t" - "punpckhbw %%mm7, %%mm2 \n\t" + /* recuperation des 2 derniers pixels */ + "movq (%3,%1,4), %%mm1 \n\t" + "movq %%mm1, %%mm2 \n\t" - /* multiplication pas les coeffs */ - "pmullw %%mm4, %%mm1 \n\t" - "pmullw %%mm5, %%mm2 \n\t" + /* depackage des pixels */ + "punpcklbw %%mm7, %%mm1 \n\t" + "punpckhbw %%mm7, %%mm2 \n\t" - /* ajout des valeurs obtenues � la valeur finale */ - "paddw %%mm1, %%mm0 \n\t" - "paddw %%mm2, %%mm0 \n\t" + /* multiplication pas les coeffs */ + "pmullw %%mm4, %%mm1 \n\t" + "pmullw %%mm5, %%mm2 \n\t" - /* division par 256 = 16+16+16+16, puis repackage du pixel final */ - "psrlw $8, %%mm0 \n\t" - "packuswb %%mm7, %%mm0 \n\t" + /* ajout des valeurs obtenues � la valeur finale */ + "paddw %%mm1, %%mm0 \n\t" + "paddw %%mm2, %%mm0 \n\t" - "movd %%mm0,%0 \n\t" - :"=g"(expix2[loop]) - :"r"(pos),"r"(coeffs),"r"(expix1) + /* division par 256 = 16+16+16+16, puis repackage du pixel final */ + "psrlw $8, %%mm0 \n\t" + "packuswb %%mm7, %%mm0 \n\t" - ); + "movd %%mm0,%0 \n\t" + : "=g"(expix2[loop]) + : "r"(pos), "r"(coeffs), "r"(expix1) - emms(); - } -} + ); -#define DRAWMETHOD_PLUS_MMX(_out,_backbuf,_col) \ -{ \ - movd_m2r(_backbuf, mm0); \ - paddusb_m2r(_col, mm0); \ - movd_r2m(mm0, _out); \ + emms(); + } } -#define DRAWMETHOD DRAWMETHOD_PLUS_MMX(*p,*p,col) - -void draw_line_mmx (Pixel *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny) -{ - int x, y, dx, dy, yy, xx; - Pixel *p; - - if ((y1 < 0) || (y2 < 0) || (x1 < 0) || (x2 < 0) || (y1 >= screeny) || (y2 >= screeny) || (x1 >= screenx) || (x2 >= screenx)) - goto end_of_line; - - dx = x2 - x1; - dy = y2 - y1; - if (x1 >= x2) { - int tmp; - - tmp = x1; - x1 = x2; - x2 = tmp; - tmp = y1; - y1 = y2; - y2 = tmp; - dx = x2 - x1; - dy = y2 - y1; - } - - /* vertical line */ - if (dx == 0) { - if (y1 < y2) { - p = &(data[(screenx * y1) + x1]); - for (y = y1; y <= y2; y++) { - DRAWMETHOD; - p += screenx; - } - } - else { - p = &(data[(screenx * y2) + x1]); - for (y = y2; y <= y1; y++) { - DRAWMETHOD; - p += screenx; - } - } - goto end_of_line; - } - /* horizontal line */ - if (dy == 0) { - if (x1 < x2) { - p = &(data[(screenx * y1) + x1]); - for (x = x1; x <= x2; x++) { - DRAWMETHOD; - p++; - } - goto end_of_line; - } - else { - p = &(data[(screenx * y1) + x2]); - for (x = x2; x <= x1; x++) { - DRAWMETHOD; - p++; - } - goto end_of_line; - } - } - /* 1 */ - /* \ */ - /* \ */ - /* 2 */ - if (y2 > y1) { - /* steep */ - if (dy > dx) { - dx = ((dx << 16) / dy); - x = x1 << 16; - for (y = y1; y <= y2; y++) { - xx = x >> 16; - p = &(data[(screenx * y) + xx]); - DRAWMETHOD; - if (xx < (screenx - 1)) { - p++; - /* DRAWMETHOD; */ - } - x += dx; - } - goto end_of_line; - } - /* shallow */ - else { - dy = ((dy << 16) / dx); - y = y1 << 16; - for (x = x1; x <= x2; x++) { - yy = y >> 16; - p = &(data[(screenx * yy) + x]); - DRAWMETHOD; - if (yy < (screeny - 1)) { - p += screeny; - /* DRAWMETHOD; */ - } - y += dy; - } - } - } - /* 2 */ - /* / */ - /* / */ - /* 1 */ - else { - /* steep */ - if (-dy > dx) { - dx = ((dx << 16) / -dy); - x = (x1 + 1) << 16; - for (y = y1; y >= y2; y--) { - xx = x >> 16; - p = &(data[(screenx * y) + xx]); - DRAWMETHOD; - if (xx < (screenx - 1)) { - p--; - /* DRAWMETHOD; */ - } - x += dx; - } - goto end_of_line; - } - /* shallow */ - else { - dy = ((dy << 16) / dx); - y = y1 << 16; - for (x = x1; x <= x2; x++) { - yy = y >> 16; - p = &(data[(screenx * yy) + x]); - DRAWMETHOD; - if (yy < (screeny - 1)) { - p += screeny; - /* DRAWMETHOD; */ - } - y += dy; - } - goto end_of_line; - } - } +#define DRAWMETHOD_PLUS_MMX(_out, _backbuf, _col) \ + { \ + movd_m2r(_backbuf, mm0); \ + paddusb_m2r(_col, mm0); \ + movd_r2m(mm0, _out); \ + } + +#define DRAWMETHOD DRAWMETHOD_PLUS_MMX(*p, *p, col) + +void draw_line_mmx(Pixel *data, int x1, int y1, int x2, int y2, int col, + int screenx, int screeny) { + int x, y, dx, dy, yy, xx; + Pixel *p; + + if ((y1 < 0) || (y2 < 0) || (x1 < 0) || (x2 < 0) || (y1 >= screeny) || + (y2 >= screeny) || (x1 >= screenx) || (x2 >= screenx)) + goto end_of_line; + + dx = x2 - x1; + dy = y2 - y1; + if (x1 >= x2) { + int tmp; + + tmp = x1; + x1 = x2; + x2 = tmp; + tmp = y1; + y1 = y2; + y2 = tmp; + dx = x2 - x1; + dy = y2 - y1; + } + + /* vertical line */ + if (dx == 0) { + if (y1 < y2) { + p = &(data[(screenx * y1) + x1]); + for (y = y1; y <= y2; y++) { + DRAWMETHOD; + p += screenx; + } + } else { + p = &(data[(screenx * y2) + x1]); + for (y = y2; y <= y1; y++) { + DRAWMETHOD; + p += screenx; + } + } + goto end_of_line; + } + /* horizontal line */ + if (dy == 0) { + if (x1 < x2) { + p = &(data[(screenx * y1) + x1]); + for (x = x1; x <= x2; x++) { + DRAWMETHOD; + p++; + } + goto end_of_line; + } else { + p = &(data[(screenx * y1) + x2]); + for (x = x2; x <= x1; x++) { + DRAWMETHOD; + p++; + } + goto end_of_line; + } + } + /* 1 */ + /* \ */ + /* \ */ + /* 2 */ + if (y2 > y1) { + /* steep */ + if (dy > dx) { + dx = ((dx << 16) / dy); + x = x1 << 16; + for (y = y1; y <= y2; y++) { + xx = x >> 16; + p = &(data[(screenx * y) + xx]); + DRAWMETHOD; + if (xx < (screenx - 1)) { + p++; + /* DRAWMETHOD; */ + } + x += dx; + } + goto end_of_line; + } + /* shallow */ + else { + dy = ((dy << 16) / dx); + y = y1 << 16; + for (x = x1; x <= x2; x++) { + yy = y >> 16; + p = &(data[(screenx * yy) + x]); + DRAWMETHOD; + if (yy < (screeny - 1)) { + p += screeny; + /* DRAWMETHOD; */ + } + y += dy; + } + } + } + /* 2 */ + /* / */ + /* / */ + /* 1 */ + else { + /* steep */ + if (-dy > dx) { + dx = ((dx << 16) / -dy); + x = (x1 + 1) << 16; + for (y = y1; y >= y2; y--) { + xx = x >> 16; + p = &(data[(screenx * y) + xx]); + DRAWMETHOD; + if (xx < (screenx - 1)) { + p--; + /* DRAWMETHOD; */ + } + x += dx; + } + goto end_of_line; + } + /* shallow */ + else { + dy = ((dy << 16) / dx); + y = y1 << 16; + for (x = x1; x <= x2; x++) { + yy = y >> 16; + p = &(data[(screenx * yy) + x]); + DRAWMETHOD; + if (yy < (screeny - 1)) { + p += screeny; + /* DRAWMETHOD; */ + } + y += dy; + } + goto end_of_line; + } + } end_of_line: - emms(); - /* __asm__ __volatile__ ("emms"); */ + emms(); + /* __asm__ __volatile__ ("emms"); */ } #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/mmx.h b/libvisual-plugins/plugins/actor/goom2k4/mmx.h index 3fae26b98..1b0ee8ce3 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/mmx.h +++ b/libvisual-plugins/plugins/actor/goom2k4/mmx.h @@ -1,27 +1,27 @@ /* mmx.h - MultiMedia eXtensions GCC interface library for IA32. + MultiMedia eXtensions GCC interface library for IA32. - To use this library, simply include this header file - and compile with GCC. You MUST have inlining enabled - in order for mmx_ok() to work; this can be done by - simply using -O on the GCC command line. + To use this library, simply include this header file + and compile with GCC. You MUST have inlining enabled + in order for mmx_ok() to work; this can be done by + simply using -O on the GCC command line. - Compiling with -DMMX_TRACE will cause detailed trace - output to be sent to stderr for each mmx operation. - This adds lots of code, and obviously slows execution to - a crawl, but can be very useful for debugging. + Compiling with -DMMX_TRACE will cause detailed trace + output to be sent to stderr for each mmx operation. + This adds lots of code, and obviously slows execution to + a crawl, but can be very useful for debugging. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT - LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR ANY PARTICULAR PURPOSE. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT + LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR ANY PARTICULAR PURPOSE. - 1997-99 by H. Dietz and R. Fisher + 1997-99 by H. Dietz and R. Fisher Notes: - It appears that the latest gas has the pand problem fixed, therefore - I'll undefine BROKEN_PAND by default. + It appears that the latest gas has the pand problem fixed, therefore + I'll undefine BROKEN_PAND by default. */ #ifndef _MMX_H @@ -30,700 +30,646 @@ #include "goom_graphic.h" /* Warning: at this writing, the version of GAS packaged - with most Linux distributions does not handle the - parallel AND operation mnemonic correctly. If the - symbol BROKEN_PAND is defined, a slower alternative - coding will be used. If execution of mmxtest results - in an illegal instruction fault, define this symbol. + with most Linux distributions does not handle the + parallel AND operation mnemonic correctly. If the + symbol BROKEN_PAND is defined, a slower alternative + coding will be used. If execution of mmxtest results + in an illegal instruction fault, define this symbol. */ -#undef BROKEN_PAND - +#undef BROKEN_PAND /* The type of an value that fits in an MMX register - (note that long long constant values MUST be suffixed - by LL and unsigned long long values by ULL, lest - they be truncated by the compiler) -*/ -typedef union { - long long q; /* Quadword (64-bit) value */ - unsigned long long uq; /* Unsigned Quadword */ - int d[2]; /* 2 Doubleword (32-bit) values */ - unsigned int ud[2]; /* 2 Unsigned Doubleword */ - short w[4]; /* 4 Word (16-bit) values */ - unsigned short uw[4]; /* 4 Unsigned Word */ - char b[8]; /* 8 Byte (8-bit) values */ - unsigned char ub[8]; /* 8 Unsigned Byte */ - float s[2]; /* Single-precision (32-bit) value */ -} __attribute__ ((aligned (8))) mmx_t; /* On an 8-byte (64-bit) boundary */ - - + (note that long long constant values MUST be suffixed + by LL and unsigned long long values by ULL, lest + they be truncated by the compiler) +*/ +typedef union { + long long q; /* Quadword (64-bit) value */ + unsigned long long uq; /* Unsigned Quadword */ + int d[2]; /* 2 Doubleword (32-bit) values */ + unsigned int ud[2]; /* 2 Unsigned Doubleword */ + short w[4]; /* 4 Word (16-bit) values */ + unsigned short uw[4]; /* 4 Unsigned Word */ + char b[8]; /* 8 Byte (8-bit) values */ + unsigned char ub[8]; /* 8 Unsigned Byte */ + float s[2]; /* Single-precision (32-bit) value */ +} __attribute__((aligned(8))) mmx_t; /* On an 8-byte (64-bit) boundary */ /* Function to test if multimedia instructions are supported... -*/ -static int -mm_support(void) -{ - /* Returns 1 if MMX instructions are supported, - 3 if Cyrix MMX and Extended MMX instructions are supported - 5 if AMD MMX and 3DNow! instructions are supported - 13 if AMD Extended MMX, &3dNow supported - 0 if hardware does not support any of these - */ - register int rval = 0; - - __asm__ __volatile__ ( - /* See if CPUID instruction is supported ... */ - /* ... Get copies of EFLAGS into eax and ecx */ - "pushl %%ebx\n\t" - "pushf\n\t" - "popl %%eax\n\t" - "movl %%eax, %%ecx\n\t" - - /* ... Toggle the ID bit in one copy and store */ - /* to the EFLAGS reg */ - "xorl $0x200000, %%eax\n\t" - "push %%eax\n\t" - "popf\n\t" - - /* ... Get the (hopefully modified) EFLAGS */ - "pushf\n\t" - "popl %%eax\n\t" - - /* ... Compare and test result */ - "xorl %%eax, %%ecx\n\t" - "testl $0x200000, %%ecx\n\t" - "jz NotSupported1\n\t" /* CPUID not supported */ - - - /* Get standard CPUID information, and - go to a specific vendor section */ - "movl $0, %%eax\n\t" - "cpuid\n\t" - - /* Check for Intel */ - "cmpl $0x756e6547, %%ebx\n\t" - "jne TryAMD\n\t" - "cmpl $0x49656e69, %%edx\n\t" - "jne TryAMD\n\t" - "cmpl $0x6c65746e, %%ecx\n" - "jne TryAMD\n\t" - "jmp Intel\n\t" - - /* Check for AMD */ - "\nTryAMD:\n\t" - "cmpl $0x68747541, %%ebx\n\t" - "jne TryCyrix\n\t" - "cmpl $0x69746e65, %%edx\n\t" - "jne TryCyrix\n\t" - "cmpl $0x444d4163, %%ecx\n" - "jne TryCyrix\n\t" - "jmp AMD\n\t" - - /* Check for Cyrix */ - "\nTryCyrix:\n\t" - "cmpl $0x69727943, %%ebx\n\t" - "jne NotSupported2\n\t" - "cmpl $0x736e4978, %%edx\n\t" - "jne NotSupported3\n\t" - "cmpl $0x64616574, %%ecx\n\t" - "jne NotSupported4\n\t" - /* Drop through to Cyrix... */ - - - /* Cyrix Section */ - /* See if extended CPUID level 80000001 is supported */ - /* The value of CPUID/80000001 for the 6x86MX is undefined - according to the Cyrix CPU Detection Guide (Preliminary - Rev. 1.01 table 1), so we'll check the value of eax for - CPUID/0 to see if standard CPUID level 2 is supported. - According to the table, the only CPU which supports level - 2 is also the only one which supports extended CPUID levels. - */ - "cmpl $0x2, %%eax\n\t" - "jne MMXtest\n\t" /* Use standard CPUID instead */ - - /* Extended CPUID supported (in theory), so get extended - features */ - "movl $0x80000001, %%eax\n\t" - "cpuid\n\t" - "testl $0x00800000, %%eax\n\t" /* Test for MMX */ - "jz NotSupported5\n\t" /* MMX not supported */ - "testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */ - "jnz EMMXSupported\n\t" - "movl $1, %0\n\n\t" /* MMX Supported */ - "jmp Return\n\n" - "EMMXSupported:\n\t" - "movl $3, %0\n\n\t" /* EMMX and MMX Supported */ - "jmp Return\n\t" - - - /* AMD Section */ - "AMD:\n\t" - - /* See if extended CPUID is supported */ - "movl $0x80000000, %%eax\n\t" - "cpuid\n\t" - "cmpl $0x80000000, %%eax\n\t" - "jl MMXtest\n\t" /* Use standard CPUID instead */ - - /* Extended CPUID supported, so get extended features */ - "movl $0x80000001, %%eax\n\t" - "cpuid\n\t" - "testl $0x00800000, %%edx\n\t" /* Test for MMX */ - "jz NotSupported6\n\t" /* MMX not supported */ - "testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */ - "jnz ThreeDNowSupported\n\t" - "movl $1, %0\n\n\t" /* MMX Supported */ - "jmp Return\n\n" - "ThreeDNowSupported:\n\t" - "testl $0x40000000, %%edx\n\t" /* Test AMD Extended MMX */ - "jnz AMDXMMXSupported\n\t" - "movl $5, %0\n\n\t" /* 3DNow! and MMX Supported */ - "jmp Return\n\t" - "AMDXMMXSupported:\n\t" - "movl $13, %0\n\n\t" /* XMMX, 3DNow! and MMX Supported */ - "jmp Return\n\t" - - - /* Intel Section */ - "Intel:\n\t" - - /* Check for MMX */ - "MMXtest:\n\t" - "movl $1, %%eax\n\t" - "cpuid\n\t" - "testl $0x00800000, %%edx\n\t" /* Test for MMX */ - "jz NotSupported7\n\t" /* MMX Not supported */ - "movl $1, %0\n\n\t" /* MMX Supported */ - "jmp Return\n\t" - - /* Nothing supported */ - "\nNotSupported1:\n\t" - "#movl $101, %0\n\n\t" - "\nNotSupported2:\n\t" - "#movl $102, %0\n\n\t" - "\nNotSupported3:\n\t" - "#movl $103, %0\n\n\t" - "\nNotSupported4:\n\t" - "#movl $104, %0\n\n\t" - "\nNotSupported5:\n\t" - "#movl $105, %0\n\n\t" - "\nNotSupported6:\n\t" - "#movl $106, %0\n\n\t" - "\nNotSupported7:\n\t" - "#movl $107, %0\n\n\t" - "movl $0, %0\n\n\t" - - "Return:\n\t" - "popl %%ebx\n\t" - : "=X" (rval) - : /* no input */ - : "eax", "ecx", "edx" - ); - - /* Return */ - return(rval); + */ +static int mm_support(void) { + /* Returns 1 if MMX instructions are supported, + 3 if Cyrix MMX and Extended MMX instructions are supported + 5 if AMD MMX and 3DNow! instructions are supported + 13 if AMD Extended MMX, &3dNow supported + 0 if hardware does not support any of these + */ + register int rval = 0; + + __asm__ __volatile__( + /* See if CPUID instruction is supported ... */ + /* ... Get copies of EFLAGS into eax and ecx */ + "pushl %%ebx\n\t" + "pushf\n\t" + "popl %%eax\n\t" + "movl %%eax, %%ecx\n\t" + + /* ... Toggle the ID bit in one copy and store */ + /* to the EFLAGS reg */ + "xorl $0x200000, %%eax\n\t" + "push %%eax\n\t" + "popf\n\t" + + /* ... Get the (hopefully modified) EFLAGS */ + "pushf\n\t" + "popl %%eax\n\t" + + /* ... Compare and test result */ + "xorl %%eax, %%ecx\n\t" + "testl $0x200000, %%ecx\n\t" + "jz NotSupported1\n\t" /* CPUID not supported */ + + /* Get standard CPUID information, and + go to a specific vendor section */ + "movl $0, %%eax\n\t" + "cpuid\n\t" + + /* Check for Intel */ + "cmpl $0x756e6547, %%ebx\n\t" + "jne TryAMD\n\t" + "cmpl $0x49656e69, %%edx\n\t" + "jne TryAMD\n\t" + "cmpl $0x6c65746e, %%ecx\n" + "jne TryAMD\n\t" + "jmp Intel\n\t" + + /* Check for AMD */ + "\nTryAMD:\n\t" + "cmpl $0x68747541, %%ebx\n\t" + "jne TryCyrix\n\t" + "cmpl $0x69746e65, %%edx\n\t" + "jne TryCyrix\n\t" + "cmpl $0x444d4163, %%ecx\n" + "jne TryCyrix\n\t" + "jmp AMD\n\t" + + /* Check for Cyrix */ + "\nTryCyrix:\n\t" + "cmpl $0x69727943, %%ebx\n\t" + "jne NotSupported2\n\t" + "cmpl $0x736e4978, %%edx\n\t" + "jne NotSupported3\n\t" + "cmpl $0x64616574, %%ecx\n\t" + "jne NotSupported4\n\t" + /* Drop through to Cyrix... */ + + /* Cyrix Section */ + /* See if extended CPUID level 80000001 is supported */ + /* The value of CPUID/80000001 for the 6x86MX is undefined + according to the Cyrix CPU Detection Guide (Preliminary + Rev. 1.01 table 1), so we'll check the value of eax for + CPUID/0 to see if standard CPUID level 2 is supported. + According to the table, the only CPU which supports level + 2 is also the only one which supports extended CPUID levels. + */ + "cmpl $0x2, %%eax\n\t" + "jne MMXtest\n\t" /* Use standard CPUID instead */ + + /* Extended CPUID supported (in theory), so get extended + features */ + "movl $0x80000001, %%eax\n\t" + "cpuid\n\t" + "testl $0x00800000, %%eax\n\t" /* Test for MMX */ + "jz NotSupported5\n\t" /* MMX not supported */ + "testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */ + "jnz EMMXSupported\n\t" + "movl $1, %0\n\n\t" /* MMX Supported */ + "jmp Return\n\n" + "EMMXSupported:\n\t" + "movl $3, %0\n\n\t" /* EMMX and MMX Supported */ + "jmp Return\n\t" + + /* AMD Section */ + "AMD:\n\t" + + /* See if extended CPUID is supported */ + "movl $0x80000000, %%eax\n\t" + "cpuid\n\t" + "cmpl $0x80000000, %%eax\n\t" + "jl MMXtest\n\t" /* Use standard CPUID instead */ + + /* Extended CPUID supported, so get extended features */ + "movl $0x80000001, %%eax\n\t" + "cpuid\n\t" + "testl $0x00800000, %%edx\n\t" /* Test for MMX */ + "jz NotSupported6\n\t" /* MMX not supported */ + "testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */ + "jnz ThreeDNowSupported\n\t" + "movl $1, %0\n\n\t" /* MMX Supported */ + "jmp Return\n\n" + "ThreeDNowSupported:\n\t" + "testl $0x40000000, %%edx\n\t" /* Test AMD Extended MMX */ + "jnz AMDXMMXSupported\n\t" + "movl $5, %0\n\n\t" /* 3DNow! and MMX Supported */ + "jmp Return\n\t" + "AMDXMMXSupported:\n\t" + "movl $13, %0\n\n\t" /* XMMX, 3DNow! and MMX Supported */ + "jmp Return\n\t" + + /* Intel Section */ + "Intel:\n\t" + + /* Check for MMX */ + "MMXtest:\n\t" + "movl $1, %%eax\n\t" + "cpuid\n\t" + "testl $0x00800000, %%edx\n\t" /* Test for MMX */ + "jz NotSupported7\n\t" /* MMX Not supported */ + "movl $1, %0\n\n\t" /* MMX Supported */ + "jmp Return\n\t" + + /* Nothing supported */ + "\nNotSupported1:\n\t" + "#movl $101, %0\n\n\t" + "\nNotSupported2:\n\t" + "#movl $102, %0\n\n\t" + "\nNotSupported3:\n\t" + "#movl $103, %0\n\n\t" + "\nNotSupported4:\n\t" + "#movl $104, %0\n\n\t" + "\nNotSupported5:\n\t" + "#movl $105, %0\n\n\t" + "\nNotSupported6:\n\t" + "#movl $106, %0\n\n\t" + "\nNotSupported7:\n\t" + "#movl $107, %0\n\n\t" + "movl $0, %0\n\n\t" + + "Return:\n\t" + "popl %%ebx\n\t" + : "=X"(rval) + : /* no input */ + : "eax", "ecx", "edx"); + + /* Return */ + return (rval); } /* Function to test if mmx instructions are supported... -*/ -static inline int -mmx_ok(void) -{ - /* Returns 1 if MMX instructions are supported, 0 otherwise */ - return ( mm_support() & 0x1 ); + */ +static inline int mmx_ok(void) { + /* Returns 1 if MMX instructions are supported, 0 otherwise */ + return (mm_support() & 0x1); } -int mmx_supported (void); -int xmmx_supported (void); - +int mmx_supported(void); +int xmmx_supported(void); /* MMX optimized implementations */ -void draw_line_mmx (Pixel *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny); -void draw_line_xmmx (Pixel *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny); -void zoom_filter_mmx (int prevX, int prevY, Pixel *expix1, Pixel *expix2, - int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); -void zoom_filter_xmmx (int prevX, int prevY, Pixel *expix1, Pixel *expix2, - int *lbruS, int *lbruD, int buffratio, int precalCoef[16][16]); - +void draw_line_mmx(Pixel *data, int x1, int y1, int x2, int y2, int col, + int screenx, int screeny); +void draw_line_xmmx(Pixel *data, int x1, int y1, int x2, int y2, int col, + int screenx, int screeny); +void zoom_filter_mmx(int prevX, int prevY, Pixel *expix1, Pixel *expix2, + int *brutS, int *brutD, int buffratio, + int precalCoef[16][16]); +void zoom_filter_xmmx(int prevX, int prevY, Pixel *expix1, Pixel *expix2, + int *lbruS, int *lbruD, int buffratio, + int precalCoef[16][16]); /* Helper functions for the instruction macros that follow... - (note that memory-to-register, m2r, instructions are nearly - as efficient as register-to-register, r2r, instructions; - however, memory-to-memory instructions are really simulated - as a convenience, and are only 1/3 as efficient) + (note that memory-to-register, m2r, instructions are nearly + as efficient as register-to-register, r2r, instructions; + however, memory-to-memory instructions are really simulated + as a convenience, and are only 1/3 as efficient) */ -#ifdef MMX_TRACE +#ifdef MMX_TRACE /* Include the stuff for printing a trace to stderr... -*/ + */ #include -#define mmx_i2r(op, imm, reg) \ - { \ - mmx_t mmx_trace; \ - mmx_trace.uq = (imm); \ - printf(#op "_i2r(" #imm "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - printf(#reg "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "X" (imm)); \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - printf(#reg "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } - -#define mmx_m2r(op, mem, reg) \ - { \ - mmx_t mmx_trace; \ - mmx_trace = (mem); \ - printf(#op "_m2r(" #mem "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - printf(#reg "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "m" (mem)); \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - printf(#reg "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } - -#define mmx_r2m(op, reg, mem) \ - { \ - mmx_t mmx_trace; \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - printf(#op "_r2m(" #reg "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - mmx_trace = (mem); \ - printf(#mem "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ (#op " %%" #reg ", %0" \ - : "=m" (mem) \ - : /* nothing */ ); \ - mmx_trace = (mem); \ - printf(#mem "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } - -#define mmx_r2r(op, regs, regd) \ - { \ - mmx_t mmx_trace; \ - __asm__ __volatile__ ("movq %%" #regs ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - printf(#op "_r2r(" #regs "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ ("movq %%" #regd ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - printf(#regd "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ (#op " %" #regs ", %" #regd); \ - __asm__ __volatile__ ("movq %%" #regd ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - printf(#regd "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } - -#define mmx_m2m(op, mems, memd) \ - { \ - mmx_t mmx_trace; \ - mmx_trace = (mems); \ - printf(#op "_m2m(" #mems "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - mmx_trace = (memd); \ - printf(#memd "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ - #op " %1, %%mm0\n\t" \ - "movq %%mm0, %0" \ - : "=m" (memd) \ - : "m" (mems)); \ - mmx_trace = (memd); \ - printf(#memd "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } +#define mmx_i2r(op, imm, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace.uq = (imm); \ + printf(#op "_i2r(" #imm "=0x%08x%08x, ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + printf(#reg "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__(#op " %0, %%" #reg \ + : /* nothing */ \ + : "X"(imm)); \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + printf(#reg "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_m2r(op, mem, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mem); \ + printf(#op "_m2r(" #mem "=0x%08x%08x, ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + printf(#reg "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__(#op " %0, %%" #reg \ + : /* nothing */ \ + : "m"(mem)); \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + printf(#reg "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_r2m(op, reg, mem) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + printf(#op "_r2m(" #reg "=0x%08x%08x, ", mmx_trace.d[1], mmx_trace.d[0]); \ + mmx_trace = (mem); \ + printf(#mem "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__(#op " %%" #reg ", %0" : "=m"(mem) : /* nothing */); \ + mmx_trace = (mem); \ + printf(#mem "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_r2r(op, regs, regd) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__("movq %%" #regs ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + printf(#op "_r2r(" #regs "=0x%08x%08x, ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__("movq %%" #regd ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + printf(#regd "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__(#op " %" #regs ", %" #regd); \ + __asm__ __volatile__("movq %%" #regd ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + printf(#regd "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_m2m(op, mems, memd) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mems); \ + printf(#op "_m2m(" #mems "=0x%08x%08x, ", mmx_trace.d[1], mmx_trace.d[0]); \ + mmx_trace = (memd); \ + printf(#memd "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__("movq %0, %%mm0\n\t" #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=m"(memd) \ + : "m"(mems)); \ + mmx_trace = (memd); \ + printf(#memd "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } #else /* These macros are a lot simpler without the tracing... -*/ + */ -#define mmx_i2r(op, imm, reg) \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "X" (imm) ) +#define mmx_i2r(op, imm, reg) \ + __asm__ __volatile__(#op " %0, %%" #reg \ + : /* nothing */ \ + : "X"(imm)) -#define mmx_m2r(op, mem, reg) \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "m" (mem)) +#define mmx_m2r(op, mem, reg) \ + __asm__ __volatile__(#op " %0, %%" #reg \ + : /* nothing */ \ + : "m"(mem)) -#define mmx_r2m(op, reg, mem) \ - __asm__ __volatile__ (#op " %%" #reg ", %0" \ - : "=m" (mem) \ - : /* nothing */ ) +#define mmx_r2m(op, reg, mem) \ + __asm__ __volatile__(#op " %%" #reg ", %0" : "=m"(mem) : /* nothing */) -#define mmx_r2r(op, regs, regd) \ - __asm__ __volatile__ (#op " %" #regs ", %" #regd) +#define mmx_r2r(op, regs, regd) __asm__ __volatile__(#op " %" #regs ", %" #regd) -#define mmx_m2m(op, mems, memd) \ - __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ - #op " %1, %%mm0\n\t" \ - "movq %%mm0, %0" \ - : "=m" (memd) \ - : "m" (mems)) +#define mmx_m2m(op, mems, memd) \ + __asm__ __volatile__("movq %0, %%mm0\n\t" #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=m"(memd) \ + : "m"(mems)) #endif - /* 1x64 MOVe Quadword - (this is both a load and a store... - in fact, it is the only way to store) -*/ -#define movq_m2r(var, reg) mmx_m2r(movq, var, reg) -#define movq_r2m(reg, var) mmx_r2m(movq, reg, var) -#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) -#define movq(vars, vard) \ - __asm__ __volatile__ ("movq %1, %%mm0\n\t" \ - "movq %%mm0, %0" \ - : "=X" (vard) \ - : "X" (vars)) - + (this is both a load and a store... + in fact, it is the only way to store) +*/ +#define movq_m2r(var, reg) mmx_m2r(movq, var, reg) +#define movq_r2m(reg, var) mmx_r2m(movq, reg, var) +#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) +#define movq(vars, vard) \ + __asm__ __volatile__("movq %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X"(vard) \ + : "X"(vars)) /* 1x32 MOVe Doubleword - (like movq, this is both load and store... - but is most useful for moving things between - mmx registers and ordinary registers) -*/ -#define movd_m2r(var, reg) mmx_m2r(movd, var, reg) -#define movd_r2m(reg, var) mmx_r2m(movd, reg, var) -#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) -#define movd(vars, vard) \ - __asm__ __volatile__ ("movd %1, %%mm0\n\t" \ - "movd %%mm0, %0" \ - : "=X" (vard) \ - : "X" (vars)) - + (like movq, this is both load and store... + but is most useful for moving things between + mmx registers and ordinary registers) +*/ +#define movd_m2r(var, reg) mmx_m2r(movd, var, reg) +#define movd_r2m(reg, var) mmx_r2m(movd, reg, var) +#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) +#define movd(vars, vard) \ + __asm__ __volatile__("movd %1, %%mm0\n\t" \ + "movd %%mm0, %0" \ + : "=X"(vard) \ + : "X"(vars)) /* 2x32, 4x16, and 8x8 Parallel ADDs -*/ -#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg) -#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd) -#define paddd(vars, vard) mmx_m2m(paddd, vars, vard) - -#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg) -#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd) -#define paddw(vars, vard) mmx_m2m(paddw, vars, vard) + */ +#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg) +#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd) +#define paddd(vars, vard) mmx_m2m(paddd, vars, vard) -#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg) -#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd) -#define paddb(vars, vard) mmx_m2m(paddb, vars, vard) +#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg) +#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd) +#define paddw(vars, vard) mmx_m2m(paddw, vars, vard) +#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg) +#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd) +#define paddb(vars, vard) mmx_m2m(paddb, vars, vard) /* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic -*/ -#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg) -#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd) -#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard) - -#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg) -#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd) -#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard) + */ +#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg) +#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd) +#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard) +#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg) +#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd) +#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard) /* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic -*/ -#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg) -#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd) -#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard) - -#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg) -#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd) -#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard) + */ +#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg) +#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd) +#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard) +#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg) +#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd) +#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard) /* 2x32, 4x16, and 8x8 Parallel SUBs -*/ -#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg) -#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd) -#define psubd(vars, vard) mmx_m2m(psubd, vars, vard) - -#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg) -#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd) -#define psubw(vars, vard) mmx_m2m(psubw, vars, vard) + */ +#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg) +#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd) +#define psubd(vars, vard) mmx_m2m(psubd, vars, vard) -#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg) -#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd) -#define psubb(vars, vard) mmx_m2m(psubb, vars, vard) +#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg) +#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd) +#define psubw(vars, vard) mmx_m2m(psubw, vars, vard) +#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg) +#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd) +#define psubb(vars, vard) mmx_m2m(psubb, vars, vard) /* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic -*/ -#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg) -#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd) -#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard) - -#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg) -#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd) -#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard) + */ +#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg) +#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd) +#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard) +#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg) +#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd) +#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard) /* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic -*/ -#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg) -#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd) -#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard) - -#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg) -#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd) -#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard) + */ +#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg) +#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd) +#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard) +#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg) +#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd) +#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard) /* 4x16 Parallel MULs giving Low 4x16 portions of results -*/ -#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg) -#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd) -#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard) - + */ +#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg) +#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd) +#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard) /* 4x16 Parallel MULs giving High 4x16 portions of results -*/ -#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg) -#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd) -#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard) - + */ +#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg) +#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd) +#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard) /* 4x16->2x32 Parallel Mul-ADD - (muls like pmullw, then adds adjacent 16-bit fields - in the multiply result to make the final 2x32 result) + (muls like pmullw, then adds adjacent 16-bit fields + in the multiply result to make the final 2x32 result) */ -#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg) -#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd) -#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard) - +#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg) +#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd) +#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard) /* 1x64 bitwise AND -*/ -#ifdef BROKEN_PAND -#define pand_m2r(var, reg) \ - { \ - mmx_m2r(pandn, (mmx_t) -1LL, reg); \ - mmx_m2r(pandn, var, reg); \ - } -#define pand_r2r(regs, regd) \ - { \ - mmx_m2r(pandn, (mmx_t) -1LL, regd); \ - mmx_r2r(pandn, regs, regd) \ - } -#define pand(vars, vard) \ - { \ - movq_m2r(vard, mm0); \ - mmx_m2r(pandn, (mmx_t) -1LL, mm0); \ - mmx_m2r(pandn, vars, mm0); \ - movq_r2m(mm0, vard); \ - } + */ +#ifdef BROKEN_PAND +#define pand_m2r(var, reg) \ + { \ + mmx_m2r(pandn, (mmx_t)-1LL, reg); \ + mmx_m2r(pandn, var, reg); \ + } +#define pand_r2r(regs, regd) \ + { \ + mmx_m2r(pandn, (mmx_t)-1LL, regd); \ + mmx_r2r(pandn, regs, regd) \ + } +#define pand(vars, vard) \ + { \ + movq_m2r(vard, mm0); \ + mmx_m2r(pandn, (mmx_t)-1LL, mm0); \ + mmx_m2r(pandn, vars, mm0); \ + movq_r2m(mm0, vard); \ + } #else -#define pand_m2r(var, reg) mmx_m2r(pand, var, reg) -#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd) -#define pand(vars, vard) mmx_m2m(pand, vars, vard) +#define pand_m2r(var, reg) mmx_m2r(pand, var, reg) +#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd) +#define pand(vars, vard) mmx_m2m(pand, vars, vard) #endif - /* 1x64 bitwise AND with Not the destination -*/ -#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg) -#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd) -#define pandn(vars, vard) mmx_m2m(pandn, vars, vard) - + */ +#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg) +#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd) +#define pandn(vars, vard) mmx_m2m(pandn, vars, vard) /* 1x64 bitwise OR -*/ -#define por_m2r(var, reg) mmx_m2r(por, var, reg) -#define por_r2r(regs, regd) mmx_r2r(por, regs, regd) -#define por(vars, vard) mmx_m2m(por, vars, vard) - + */ +#define por_m2r(var, reg) mmx_m2r(por, var, reg) +#define por_r2r(regs, regd) mmx_r2r(por, regs, regd) +#define por(vars, vard) mmx_m2m(por, vars, vard) /* 1x64 bitwise eXclusive OR -*/ -#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg) -#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd) -#define pxor(vars, vard) mmx_m2m(pxor, vars, vard) - + */ +#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg) +#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd) +#define pxor(vars, vard) mmx_m2m(pxor, vars, vard) /* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality - (resulting fields are either 0 or -1) + (resulting fields are either 0 or -1) */ -#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg) -#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd) -#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard) +#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg) +#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd) +#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard) -#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg) -#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd) -#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard) - -#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg) -#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd) -#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard) +#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg) +#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd) +#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard) +#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg) +#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd) +#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard) /* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than - (resulting fields are either 0 or -1) + (resulting fields are either 0 or -1) */ -#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg) -#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd) -#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard) - -#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg) -#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd) -#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard) +#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg) +#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd) +#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard) -#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg) -#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd) -#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard) +#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg) +#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd) +#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard) +#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg) +#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd) +#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard) /* 1x64, 2x32, and 4x16 Parallel Shift Left Logical -*/ -#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg) -#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg) -#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd) -#define psllq(vars, vard) mmx_m2m(psllq, vars, vard) - -#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg) -#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg) -#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd) -#define pslld(vars, vard) mmx_m2m(pslld, vars, vard) - -#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg) -#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg) -#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd) -#define psllw(vars, vard) mmx_m2m(psllw, vars, vard) - + */ +#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg) +#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg) +#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd) +#define psllq(vars, vard) mmx_m2m(psllq, vars, vard) + +#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg) +#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg) +#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd) +#define pslld(vars, vard) mmx_m2m(pslld, vars, vard) + +#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg) +#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg) +#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd) +#define psllw(vars, vard) mmx_m2m(psllw, vars, vard) /* 1x64, 2x32, and 4x16 Parallel Shift Right Logical -*/ -#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg) -#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg) -#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd) -#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard) - -#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg) -#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg) -#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd) -#define psrld(vars, vard) mmx_m2m(psrld, vars, vard) - -#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg) -#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg) -#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd) -#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard) - + */ +#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg) +#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg) +#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd) +#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard) + +#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg) +#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg) +#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd) +#define psrld(vars, vard) mmx_m2m(psrld, vars, vard) + +#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg) +#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg) +#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd) +#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard) /* 2x32 and 4x16 Parallel Shift Right Arithmetic -*/ -#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg) -#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg) -#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd) -#define psrad(vars, vard) mmx_m2m(psrad, vars, vard) - -#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg) -#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg) -#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd) -#define psraw(vars, vard) mmx_m2m(psraw, vars, vard) + */ +#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg) +#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg) +#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd) +#define psrad(vars, vard) mmx_m2m(psrad, vars, vard) +#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg) +#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg) +#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd) +#define psraw(vars, vard) mmx_m2m(psraw, vars, vard) /* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate - (packs source and dest fields into dest in that order) + (packs source and dest fields into dest in that order) */ -#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg) -#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd) -#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard) - -#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg) -#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd) -#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard) +#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg) +#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd) +#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard) +#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg) +#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd) +#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard) /* 4x16->8x8 PACK and Unsigned Saturate - (packs source and dest fields into dest in that order) + (packs source and dest fields into dest in that order) */ -#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg) -#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd) -#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard) - +#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg) +#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd) +#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard) /* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low - (interleaves low half of dest with low half of source - as padding in each result field) + (interleaves low half of dest with low half of source + as padding in each result field) */ -#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg) -#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd) -#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard) +#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg) +#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd) +#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard) -#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg) -#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd) -#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard) - -#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg) -#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd) -#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard) +#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg) +#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd) +#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard) +#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg) +#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd) +#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard) /* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High - (interleaves high half of dest with high half of source - as padding in each result field) + (interleaves high half of dest with high half of source + as padding in each result field) */ -#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg) -#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd) -#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard) - -#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg) -#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd) -#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard) +#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg) +#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd) +#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard) -#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg) -#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd) -#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard) +#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg) +#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd) +#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard) +#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg) +#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd) +#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard) /* Empty MMx State - (used to clean-up when going from mmx to float use - of the registers that are shared by both; note that - there is no float-to-mmx operation needed, because - only the float tag word info is corruptible) -*/ -#ifdef MMX_TRACE - -#define emms() \ - { \ - printf("emms()\n"); \ - __asm__ __volatile__ ("emms" \ - "st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)"); \ - } + (used to clean-up when going from mmx to float use + of the registers that are shared by both; note that + there is no float-to-mmx operation needed, because + only the float tag word info is corruptible) +*/ +#ifdef MMX_TRACE + +#define emms() \ + { \ + printf("emms()\n"); \ + __asm__ __volatile__("emms" \ + "st(1)", \ + "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", \ + "st(7)"); \ + } #else -#define emms() __asm__ __volatile__ ("emms"::: \ - "st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)") +#define emms() \ + __asm__ __volatile__("emms" :: \ + : "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", \ + "st(6)", "st(7)") #endif #endif - diff --git a/libvisual-plugins/plugins/actor/goom2k4/motif_goom1.h b/libvisual-plugins/plugins/actor/goom2k4/motif_goom1.h index b4a9f3f1d..8eb0505b3 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/motif_goom1.h +++ b/libvisual-plugins/plugins/actor/goom2k4/motif_goom1.h @@ -1,1026 +1,864 @@ static Motif CONV_MOTIF1 = { - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,14,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,13,9,9,7,2,2,9,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,11, - 11,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,12,7,4,0,0,0,2,0,0,3,14,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,12,10,9,9,4,1,0, - 1,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,10,3,0,0,0,1,1,3,5,0,0,1,14,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,14,6,3,1,1,4,9,1, - 1,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 10,3,0,0,2,7,13,14,14,14,7,0,0,2,14,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,12,1,9,15,15,15,15,3, - 0,13,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,12,4, - 0,0,2,10,15,15,15,15,15,15,1,0,0,10,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,9,0,2,14,15,15,15,7, - 0,9,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,14,6,0,0, - 2,9,15,15,15,15,15,15,15,13,0,0,3,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,11,0,0,10,15,15,15,9, - 0,9,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,13,3,0,1,5, - 5,4,4,4,6,12,15,15,15,13,0,0,7,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,14,0,0,5,15,15,15,10, - 0,7,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,11,1,0,3,3,1, - 0,0,0,0,0,0,5,13,15,12,0,0,13,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,13,14,15, - 15,15,15,15,15,15,15,15,14,0,0,1,15,15,15,12, - 0,3,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,10,1,2,4,0,0,1, - 9,12,12,12,9,3,0,2,14,5,0,7,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,14,7,4,4,1,1,12, - 15,15,15,15,15,15,15,15,14,1,0,0,12,15,15,15, - 1,0,12,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,10,0,3,2,0,0,3,12, - 15,15,15,15,15,14,2,1,13,2,0,12,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,14,3,0,0,0,0,0,2, - 13,15,15,15,15,15,15,15,14,1,0,0,8,15,15,15, - 1,0,9,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,12,2,1,0,0,0,9,14,15, - 15,15,15,15,15,14,1,1,11,0,3,14,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,7,4,11,12,10,1,0, - 3,12,15,15,15,15,15,15,13,1,1,0,4,15,15,15, - 2,0,10,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,14,2,1,0,0,3,12,15,15,15, - 15,15,15,15,15,11,0,5,9,1,12,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,5,1,13,15,15,12,1, - 0,1,9,15,15,15,15,15,14,2,5,0,1,14,15,15, - 2,0,7,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,14,3,0,0,0,7,14,15,15,15,15, - 15,15,15,15,15,9,0,8,7,4,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,7,0,7,8,11,15,13, - 2,0,0,3,10,15,15,15,15,5,11,0,0,11,15,15, - 6,0,2,14,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,6,0,0,0,8,15,15,15,15,15,15, - 15,15,15,15,15,6,0,4,0,6,15,15,15,15,15,15, - 14,9,14,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,11,0,3,3,0,8,15, - 14,5,0,0,0,4,12,15,15,5,13,2,0,6,15,15, - 12,0,0,11,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,10,0,0,0,8,15,15,15,15,15,15,15, - 15,15,15,15,10,1,7,6,4,13,15,15,15,15,13,11, - 6,0,8,11,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,1,1,11,2,0,5, - 14,15,8,0,0,0,0,7,15,5,14,6,0,2,15,15, - 15,3,0,5,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,13,1,0,0,7,15,15,15,15,15,15,15,15, - 15,15,15,15,7,9,15,15,15,15,15,15,12,6,2,1, - 1,1,8,6,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,4,0,6,12,1,0, - 3,13,15,11,2,0,0,0,8,4,14,10,0,0,13,15, - 15,7,0,1,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,5,0,0,5,15,15,15,15,15,15,15,15,15, - 15,15,15,15,13,15,15,15,15,14,8,3,1,2,7,11, - 5,4,5,6,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,8,0,1,14,11,0, - 0,1,9,15,14,5,0,0,2,4,14,13,0,0,10,15, - 15,12,0,0,12,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,10,0,0,1,14,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,14,13,7,2,0,5,9,15,15,15, - 5,3,6,9,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,13,0,0,9,15,12, - 2,0,0,4,13,14,4,0,3,2,12,15,1,0,5,15, - 15,14,1,0,8,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,2,0,0,9,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,11,6,1,0,2,3,10,15,15,15,15,7, - 1,2,4,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,5,0,3,14,15, - 9,2,0,0,1,6,12,13,13,1,9,12,0,0,2,14, - 15,15,4,0,4,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,10,0,0,2,14,15,15,15,15,15,15,15,15,15,15, - 13,9,6,0,1,2,9,10,15,15,15,15,14,7,1,0, - 6,2,4,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,11,0,0,9,15, - 4,4,11,6,1,0,0,1,1,0,10,4,0,0,0,12, - 15,15,9,0,1,14,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,3,0,0,8,15,15,15,15,15,15,15,13,12,4,4, - 1,1,3,10,12,15,15,15,15,15,9,2,1,0,1,6, - 6,0,10,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,4,0,3,14, - 4,3,15,15,14,9,7,9,1,0,0,0,0,1,0,7, - 15,15,13,0,0,9,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 13,0,0,1,14,15,15,15,15,15,12,9,1,0,1,4, - 7,15,15,15,15,15,15,14,8,2,0,0,0,2,13,9, - 0,4,14,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,11,0,0,9, - 3,0,8,14,15,15,15,15,10,5,4,4,7,4,0,3, - 15,15,15,4,0,3,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 5,0,0,5,15,15,15,15,14,8,7,8,10,12,14,15, - 15,15,15,15,15,15,11,1,0,0,0,5,11,15,13,1, - 1,13,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,3,0,4, - 4,0,0,2,6,10,15,15,15,15,15,15,15,10,0,0, - 12,15,15,9,0,0,12,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 1,0,0,10,15,15,15,15,15,13,14,15,15,15,15,15, - 15,15,15,15,14,7,1,0,0,3,12,15,15,15,6,0, - 7,15,15,15,12,10,9,10,12,14,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,9,0,0, - 8,3,1,4,1,0,1,12,15,15,15,15,15,14,2,0, - 6,15,15,15,2,0,6,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 0,0,1,14,15,15,15,15,14,5,15,15,15,15,15,15, - 15,15,15,7,2,0,0,1,8,15,15,15,15,12,0,2, - 14,15,12,4,0,0,0,0,0,1,5,10,14,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,14,0,0, - 5,4,1,14,15,10,7,13,15,15,15,15,15,15,8,0, - 1,14,15,15,7,0,1,14,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,13, - 0,0,4,15,15,15,15,15,13,2,13,15,15,15,15,15, - 12,7,0,0,0,0,5,12,15,15,15,15,14,3,0,9, - 11,1,0,0,1,1,0,1,0,0,0,0,2,12,15,15, - 15,15,15,15,15,15,15,14,15,15,15,15,15,15,2,0, - 5,2,1,14,15,14,13,15,15,15,15,15,15,15,12,0, - 0,10,15,15,13,0,0,9,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,12, - 0,0,4,15,15,15,15,15,12,0,12,15,15,15,12,6, - 0,0,0,0,6,14,15,15,15,15,15,15,7,0,0,12, - 1,0,0,2,2,1,1,7,12,8,3,0,0,1,13,15, - 15,15,15,15,15,8,4,8,12,15,15,15,15,15,8,0, - 4,2,0,14,15,11,9,15,15,15,15,15,15,15,15,3, - 0,5,15,15,15,5,0,3,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,12, - 0,0,4,15,15,15,15,15,12,0,12,15,13,3,1,0, - 0,0,5,12,15,15,15,15,15,15,15,12,0,0,7,7, - 0,0,0,0,0,0,0,1,12,15,15,12,3,0,5,15, - 15,15,15,14,5,0,0,0,0,2,2,3,7,14,9,8, - 14,2,1,14,15,2,12,13,15,15,15,15,15,15,15,9, - 0,0,13,15,15,10,0,0,12,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,13, - 0,0,5,15,15,15,15,15,12,0,11,10,1,0,0,1, - 5,14,15,15,15,15,15,15,15,15,15,6,0,2,7,0, - 0,0,0,1,2,7,4,0,3,14,15,15,14,2,0,12, - 15,15,15,9,0,1,2,1,0,0,0,0,0,1,3,7, - 15,3,0,14,15,4,12,15,15,15,15,15,15,15,15,14, - 1,0,8,15,15,14,1,0,8,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,13, - 0,0,4,15,15,15,15,15,12,0,2,0,0,1,10,15, - 15,15,15,15,15,15,15,15,15,15,12,0,0,6,0,0, - 0,1,10,14,15,15,11,1,0,9,15,15,15,8,0,9, - 15,15,12,4,8,14,15,8,1,0,0,0,0,0,1,9, - 15,2,0,13,15,1,9,15,15,15,15,15,15,15,15,15, - 6,0,1,14,15,14,1,0,3,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,14, - 1,0,1,14,15,15,15,15,12,1,3,7,9,13,15,15, - 15,15,15,15,15,15,15,15,15,15,3,0,2,3,0,4, - 0,8,15,15,15,15,15,13,1,2,14,15,15,10,0,6, - 15,14,2,6,15,15,15,1,3,7,3,0,0,0,0,1, - 11,1,0,11,12,0,12,15,15,15,15,15,15,15,15,15, - 11,0,0,9,15,15,4,0,0,12,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 6,0,0,9,15,15,15,15,15,12,14,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,11,0,0,3,0,8,14, - 2,5,15,15,15,15,15,15,5,0,8,15,15,12,0,4, - 15,5,2,14,15,15,10,0,13,15,13,2,4,5,5,0, - 9,1,0,10,9,1,14,15,15,15,15,15,15,15,15,15, - 13,0,0,3,15,15,9,0,0,8,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 12,0,0,3,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,3,0,1,1,5,14,15, - 11,0,12,15,15,15,15,15,14,1,1,14,15,12,0,4, - 10,0,9,15,15,11,1,8,15,15,8,1,14,15,14,2, - 5,0,0,10,6,2,15,15,15,15,15,15,15,15,15,15, - 15,3,0,0,12,15,13,0,0,2,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,3,0,0,10,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,10,0,0,1,0,11,15,15, - 15,2,6,15,15,15,15,15,15,6,0,9,15,13,0,6, - 3,0,13,15,14,2,6,15,15,13,1,8,15,15,15,4, - 3,1,0,10,7,2,15,15,15,15,15,15,15,15,15,15, - 15,9,0,0,6,15,15,3,0,0,13,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,9,0,0,2,14,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,11,10,2,0,3,0,3,15,15,15, - 15,8,1,14,15,15,15,15,15,13,0,2,15,9,1,10, - 0,3,15,15,6,2,14,15,14,3,1,14,15,15,15,2, - 4,0,0,12,5,3,15,15,15,15,15,15,15,15,15,15, - 15,14,1,0,1,14,15,5,0,0,12,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,4,0,0,6,15,15,15,15,15,15,15,15,14,12, - 12,9,5,4,4,3,0,0,0,0,4,0,8,15,15,15, - 15,13,1,10,15,15,15,15,15,15,2,0,11,3,5,10, - 0,7,15,9,1,11,15,15,8,0,6,15,15,15,10,0, - 3,0,0,13,3,6,15,15,15,15,15,15,15,15,15,15, - 15,15,6,0,0,12,15,5,0,0,7,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,13,1,0,0,8,14,15,15,13,6,4,4,1,0, - 0,0,0,0,0,0,2,0,0,4,3,0,12,15,15,15, - 15,15,5,3,15,15,15,15,14,8,0,0,1,1,12,9, - 0,9,10,0,6,15,15,15,2,2,14,15,15,13,2,0, - 4,0,1,13,0,10,15,15,15,15,15,15,15,15,15,15, - 15,15,13,1,0,10,15,10,0,0,5,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,9,0,0,0,3,2,2,1,0,0,0,1,4, - 4,5,10,12,12,12,11,0,0,11,4,0,12,15,15,15, - 15,15,12,0,7,13,15,15,5,0,0,0,1,6,15,9, - 0,3,0,0,1,6,14,10,0,12,15,15,11,2,0,2, - 3,0,3,12,1,11,15,15,15,15,15,15,15,15,15,15, - 15,15,15,3,0,6,8,7,0,0,5,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,9,1,0,0,0,2,6,10,12,12,14,15, - 15,15,15,15,11,5,4,0,2,14,4,0,12,15,15,15, - 15,15,15,4,0,3,13,6,0,0,0,1,2,14,15,12, - 0,0,0,0,0,0,2,2,6,15,14,8,0,0,0,7, - 4,0,4,12,0,12,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,0,0,0,0,0,0,1,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,12,2,0,0,0,1,6,11,15,15,15, - 15,15,15,15,2,1,0,0,9,15,6,0,7,15,15,15, - 15,15,15,13,2,0,0,0,0,0,0,1,12,15,15,15, - 4,0,0,0,0,0,0,6,13,6,1,0,0,4,13,15, - 6,0,6,12,0,12,15,15,15,15,15,15,15,15,15,15, - 15,15,15,14,5,0,0,0,0,0,5,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,14,5,0,0,0,0,0,2,4,5, - 7,3,6,3,0,2,0,2,15,15,11,0,0,9,15,15, - 15,15,15,15,11,0,0,0,0,0,2,11,15,15,15,15, - 12,1,0,0,1,4,6,10,2,0,0,0,7,14,15,15, - 9,0,9,9,0,12,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,13,9,8,9,7,13,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,12,6,1,0,0,0,0,0, - 0,0,0,2,8,0,0,9,15,15,14,4,0,0,3,10, - 14,15,15,15,15,13,3,0,0,4,14,15,15,15,15,15, - 15,11,2,0,0,1,1,0,0,0,1,11,15,15,15,15, - 9,0,10,5,3,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,14,12,10,5,4,6, - 2,4,10,14,8,0,1,14,15,15,15,14,5,0,0,0, - 1,2,4,4,4,3,1,2,9,14,15,15,15,15,15,15, - 15,15,15,11,11,13,10,9,9,11,15,15,15,15,15,15, - 10,0,8,2,4,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 2,7,15,14,1,0,6,15,15,15,15,15,15,10,6,4, - 2,2,4,4,4,3,9,14,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 11,0,3,1,4,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,11, - 1,10,15,9,0,0,13,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 11,0,11,11,11,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,2, - 5,15,14,2,0,5,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 14,1,13,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,10,1, - 13,15,11,0,0,12,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,5,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,8,1, - 15,15,5,0,3,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,10,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,12,2,3, - 15,14,1,0,7,15,15,15,15,15,13,15,15,15,15,14, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,13,12,12,11,9,4,7,14,15, - 14,13,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,12,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,14,3,0,10, - 15,9,0,0,8,7,4,2,2,1,0,3,4,3,4,9, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,14,13,11,7,4,2,0,0,0,0,0,0,1,12,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,14,13,11,7,4,2,2,13,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,12,0,3,11, - 7,1,0,0,0,0,0,1,4,9,11,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,14,12,11,9,7,4, - 3,1,0,0,0,0,0,0,0,0,0,2,11,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,13,11,8, - 4,3,1,0,0,0,0,3,8,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,14,11,3,0,0,0, - 0,0,0,2,6,9,12,14,15,15,15,15,15,15,15,15, - 15,15,15,15,15,13,9,6,3,1,0,0,0,0,0,0, - 0,0,0,0,1,4,7,11,12,12,12,14,15,15,15,15, - 15,15,15,15,15,15,15,14,12,11,7,4,2,0,0,0, - 0,0,0,1,5,10,13,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,14,12,7,3,1,0,0,0,2,5, - 2,0,2,14,15,15,15,15,15,15,15,15,15,14,13,12, - 11,9,6,4,2,0,0,0,0,0,0,0,0,1,2,4, - 5,9,11,13,15,15,15,15,15,15,15,15,15,15,15,15, - 15,14,12,11,7,4,3,1,0,0,0,0,0,0,0,1, - 4,5,10,14,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,13,10,5,1,0,0,0,1,0,0,2,13,14, - 1,0,8,15,15,14,12,11,9,8,4,3,2,1,0,0, - 0,0,0,0,1,3,2,3,5,9,10,12,13,14,15,15, - 15,15,15,15,15,15,15,15,15,15,15,13,11,10,6,4, - 3,1,0,0,0,0,0,0,0,0,1,4,7,11,13,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,11,4,0,0,0,1,4,9,13,13,1,0,0,1,7, - 0,0,7,8,5,2,0,0,0,0,0,0,1,2,3,4, - 5,9,10,12,14,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,14,11,8,4,3,1,0,0,0,0,0, - 0,0,0,0,1,4,5,9,12,13,15,15,15,15,15,15, - 15,15,14,12,9,8,8,7,4,2,5,4,5,5,12,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,14,10,5, - 1,0,1,3,6,11,14,15,15,15,15,13,12,8,3,2, - 0,0,1,1,3,3,4,5,8,10,12,13,14,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,13, - 11,9,6,4,2,1,0,0,0,0,0,0,0,1,2,4, - 6,10,11,13,15,15,15,15,15,15,15,15,13,11,9,7, - 4,2,1,0,0,0,0,2,4,7,12,14,14,14,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,10,5,1,1,3, - 8,12,14,15,15,15,15,15,15,15,15,15,15,15,15,9, - 3,11,14,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,8,6,9,9,9,9,9,8,5,4,4,3,1,0, - 0,0,0,0,1,2,3,2,4,5,9,11,12,14,15,15, - 15,15,15,15,15,15,15,14,12,9,5,2,0,0,0,0, - 0,1,2,4,7,10,14,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,14,9,4,1,3,9,13,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,13, - 11,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,13,3,1,1,1,1,1,1,1,0,0,0,0,2,3, - 5,8,10,12,14,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,12,5,2,0,0,0,1,3,4,7,10, - 12,13,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,13,11,13,13,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,14,12,12,12,13,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,8,1,0,1,4,7,11,13,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,13,7,8,11,14,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 - }; + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 13, 9, 9, 7, 2, 2, 9, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 11, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 7, + 4, 0, 0, 0, 2, 0, 0, 3, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 10, 9, 9, 4, 1, + 0, 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 3, 0, 0, 0, 1, 1, 3, 5, + 0, 0, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 14, 6, 3, 1, 1, 4, 9, 1, 1, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 10, 3, 0, 0, 2, 7, 13, 14, 14, 14, 7, 0, 0, 2, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 12, 1, 9, 15, 15, 15, 15, 3, 0, 13, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 4, 0, 0, + 2, 10, 15, 15, 15, 15, 15, 15, 1, 0, 0, 10, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 2, + 14, 15, 15, 15, 7, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 14, 6, 0, 0, 2, 9, 15, 15, 15, 15, 15, + 15, 15, 13, 0, 0, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 0, 0, 10, 15, 15, 15, 9, + 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 13, 3, 0, 1, 5, 5, 4, 4, 4, 6, 12, 15, 15, 15, 13, 0, 0, + 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 14, 0, 0, 5, 15, 15, 15, 10, 0, 7, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 1, 0, 3, + 3, 1, 0, 0, 0, 0, 0, 0, 5, 13, 15, 12, 0, 0, 13, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 14, 0, 0, 1, 15, 15, 15, 12, 0, 3, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 1, 2, 4, 0, 0, 1, 9, 12, 12, + 12, 9, 3, 0, 2, 14, 5, 0, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 14, 7, 4, 4, 1, 1, 12, 15, 15, 15, 15, 15, 15, 15, 15, 14, 1, 0, 0, + 12, 15, 15, 15, 1, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 10, 0, 3, 2, 0, 0, 3, 12, 15, 15, 15, 15, 15, 14, 2, 1, + 13, 2, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 3, 0, 0, 0, 0, + 0, 2, 13, 15, 15, 15, 15, 15, 15, 15, 14, 1, 0, 0, 8, 15, 15, 15, 1, + 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 2, 1, + 0, 0, 0, 9, 14, 15, 15, 15, 15, 15, 15, 14, 1, 1, 11, 0, 3, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 4, 11, 12, 10, 1, 0, 3, 12, 15, + 15, 15, 15, 15, 15, 13, 1, 1, 0, 4, 15, 15, 15, 2, 0, 10, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 2, 1, 0, 0, 3, 12, 15, 15, + 15, 15, 15, 15, 15, 15, 11, 0, 5, 9, 1, 12, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 5, 1, 13, 15, 15, 12, 1, 0, 1, 9, 15, 15, 15, 15, 15, + 14, 2, 5, 0, 1, 14, 15, 15, 2, 0, 7, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 14, 3, 0, 0, 0, 7, 14, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 9, 0, 8, 7, 4, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, + 0, 7, 8, 11, 15, 13, 2, 0, 0, 3, 10, 15, 15, 15, 15, 5, 11, 0, 0, + 11, 15, 15, 6, 0, 2, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 6, + 0, 0, 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 6, 0, 4, 0, + 6, 15, 15, 15, 15, 15, 15, 14, 9, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 0, 3, 3, 0, 8, + 15, 14, 5, 0, 0, 0, 4, 12, 15, 15, 5, 13, 2, 0, 6, 15, 15, 12, 0, + 0, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 0, 0, 0, 8, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 1, 7, 6, 4, 13, 15, 15, 15, 15, + 13, 11, 6, 0, 8, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 1, 11, 2, 0, 5, 14, 15, 8, 0, + 0, 0, 0, 7, 15, 5, 14, 6, 0, 2, 15, 15, 15, 3, 0, 5, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 13, 1, 0, 0, 7, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 7, 9, 15, 15, 15, 15, 15, 15, 12, 6, 2, 1, 1, 1, 8, + 6, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 4, 0, 6, 12, 1, 0, 3, 13, 15, 11, 2, 0, 0, 0, 8, + 4, 14, 10, 0, 0, 13, 15, 15, 7, 0, 1, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 5, 0, 0, 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, + 15, 15, 15, 15, 14, 8, 3, 1, 2, 7, 11, 5, 4, 5, 6, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 8, + 0, 1, 14, 11, 0, 0, 1, 9, 15, 14, 5, 0, 0, 2, 4, 14, 13, 0, 0, + 10, 15, 15, 12, 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 0, 0, 1, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 13, 7, 2, + 0, 5, 9, 15, 15, 15, 5, 3, 6, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 0, 0, 9, 15, 12, + 2, 0, 0, 4, 13, 14, 4, 0, 3, 2, 12, 15, 1, 0, 5, 15, 15, 14, 1, + 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 2, 0, 0, 9, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 12, 11, 6, 1, 0, 2, 3, 10, 15, 15, 15, 15, + 7, 1, 2, 4, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 5, 0, 3, 14, 15, 9, 2, 0, 0, 1, + 6, 12, 13, 13, 1, 9, 12, 0, 0, 2, 14, 15, 15, 4, 0, 4, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 10, 0, 0, 2, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, + 9, 6, 0, 1, 2, 9, 10, 15, 15, 15, 15, 14, 7, 1, 0, 6, 2, 4, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 11, 0, 0, 9, 15, 4, 4, 11, 6, 1, 0, 0, 1, 1, 0, + 10, 4, 0, 0, 0, 12, 15, 15, 9, 0, 1, 14, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, + 0, 8, 15, 15, 15, 15, 15, 15, 15, 13, 12, 4, 4, 1, 1, 3, 10, 12, 15, + 15, 15, 15, 15, 9, 2, 1, 0, 1, 6, 6, 0, 10, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 4, 0, 3, 14, 4, 3, 15, 15, 14, 9, 7, 9, 1, 0, 0, 0, 0, 1, 0, + 7, 15, 15, 13, 0, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 0, 0, 1, 14, 15, 15, 15, + 15, 15, 12, 9, 1, 0, 1, 4, 7, 15, 15, 15, 15, 15, 15, 14, 8, 2, 0, + 0, 0, 2, 13, 9, 0, 4, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 0, 0, 9, 3, + 0, 8, 14, 15, 15, 15, 15, 10, 5, 4, 4, 7, 4, 0, 3, 15, 15, 15, 4, + 0, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 5, 0, 0, 5, 15, 15, 15, 15, 14, 8, 7, 8, 10, + 12, 14, 15, 15, 15, 15, 15, 15, 15, 11, 1, 0, 0, 0, 5, 11, 15, 13, 1, + 1, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, 4, 4, 0, 0, 2, 6, 10, + 15, 15, 15, 15, 15, 15, 15, 10, 0, 0, 12, 15, 15, 9, 0, 0, 12, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 1, 0, 0, 10, 15, 15, 15, 15, 15, 13, 14, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 14, 7, 1, 0, 0, 3, 12, 15, 15, 15, 6, 0, 7, 15, 15, 15, 12, + 10, 9, 10, 12, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 9, 0, 0, 8, 3, 1, 4, 1, 0, 1, 12, 15, 15, 15, + 15, 15, 14, 2, 0, 6, 15, 15, 15, 2, 0, 6, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 1, 14, + 15, 15, 15, 15, 14, 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 2, 0, 0, + 1, 8, 15, 15, 15, 15, 12, 0, 2, 14, 15, 12, 4, 0, 0, 0, 0, 0, 1, + 5, 10, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 14, 0, 0, 5, 4, 1, 14, 15, 10, 7, 13, 15, 15, 15, 15, 15, 15, 8, 0, + 1, 14, 15, 15, 7, 0, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 0, 0, 4, 15, 15, 15, 15, 15, 13, + 2, 13, 15, 15, 15, 15, 15, 12, 7, 0, 0, 0, 0, 5, 12, 15, 15, 15, 15, + 14, 3, 0, 9, 11, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 2, 12, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 2, 0, 5, 2, + 1, 14, 15, 14, 13, 15, 15, 15, 15, 15, 15, 15, 12, 0, 0, 10, 15, 15, 13, + 0, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 12, 0, 0, 4, 15, 15, 15, 15, 15, 12, 0, 12, 15, 15, 15, + 12, 6, 0, 0, 0, 0, 6, 14, 15, 15, 15, 15, 15, 15, 7, 0, 0, 12, 1, + 0, 0, 2, 2, 1, 1, 7, 12, 8, 3, 0, 0, 1, 13, 15, 15, 15, 15, 15, + 15, 8, 4, 8, 12, 15, 15, 15, 15, 15, 8, 0, 4, 2, 0, 14, 15, 11, 9, + 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, 5, 15, 15, 15, 5, 0, 3, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, + 0, 0, 4, 15, 15, 15, 15, 15, 12, 0, 12, 15, 13, 3, 1, 0, 0, 0, 5, + 12, 15, 15, 15, 15, 15, 15, 15, 12, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, + 0, 1, 12, 15, 15, 12, 3, 0, 5, 15, 15, 15, 15, 14, 5, 0, 0, 0, 0, + 2, 2, 3, 7, 14, 9, 8, 14, 2, 1, 14, 15, 2, 12, 13, 15, 15, 15, 15, + 15, 15, 15, 9, 0, 0, 13, 15, 15, 10, 0, 0, 12, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 0, 0, 5, 15, 15, + 15, 15, 15, 12, 0, 11, 10, 1, 0, 0, 1, 5, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 6, 0, 2, 7, 0, 0, 0, 0, 1, 2, 7, 4, 0, 3, 14, 15, + 15, 14, 2, 0, 12, 15, 15, 15, 9, 0, 1, 2, 1, 0, 0, 0, 0, 0, 1, + 3, 7, 15, 3, 0, 14, 15, 4, 12, 15, 15, 15, 15, 15, 15, 15, 15, 14, 1, + 0, 8, 15, 15, 14, 1, 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 13, 0, 0, 4, 15, 15, 15, 15, 15, 12, 0, + 2, 0, 0, 1, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, 0, + 6, 0, 0, 0, 1, 10, 14, 15, 15, 11, 1, 0, 9, 15, 15, 15, 8, 0, 9, + 15, 15, 12, 4, 8, 14, 15, 8, 1, 0, 0, 0, 0, 0, 1, 9, 15, 2, 0, + 13, 15, 1, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 6, 0, 1, 14, 15, 14, + 1, 0, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 14, 1, 0, 1, 14, 15, 15, 15, 15, 12, 1, 3, 7, 9, 13, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, 2, 3, 0, 4, 0, 8, + 15, 15, 15, 15, 15, 13, 1, 2, 14, 15, 15, 10, 0, 6, 15, 14, 2, 6, 15, + 15, 15, 1, 3, 7, 3, 0, 0, 0, 0, 1, 11, 1, 0, 11, 12, 0, 12, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 11, 0, 0, 9, 15, 15, 4, 0, 0, 12, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 6, + 0, 0, 9, 15, 15, 15, 15, 15, 12, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 11, 0, 0, 3, 0, 8, 14, 2, 5, 15, 15, 15, 15, 15, + 15, 5, 0, 8, 15, 15, 12, 0, 4, 15, 5, 2, 14, 15, 15, 10, 0, 13, 15, + 13, 2, 4, 5, 5, 0, 9, 1, 0, 10, 9, 1, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 13, 0, 0, 3, 15, 15, 9, 0, 0, 8, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, 0, 3, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 3, 0, 1, 1, 5, 14, 15, 11, 0, 12, 15, 15, 15, 15, 15, 14, 1, 1, 14, + 15, 12, 0, 4, 10, 0, 9, 15, 15, 11, 1, 8, 15, 15, 8, 1, 14, 15, 14, + 2, 5, 0, 0, 10, 6, 2, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, + 0, 0, 12, 15, 13, 0, 0, 2, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, 0, 10, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 0, 0, 1, 0, 11, + 15, 15, 15, 2, 6, 15, 15, 15, 15, 15, 15, 6, 0, 9, 15, 13, 0, 6, 3, + 0, 13, 15, 14, 2, 6, 15, 15, 13, 1, 8, 15, 15, 15, 4, 3, 1, 0, 10, + 7, 2, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 0, 6, 15, 15, + 3, 0, 0, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 9, 0, 0, 2, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 11, 10, 2, 0, 3, 0, 3, 15, 15, 15, 15, 8, 1, + 14, 15, 15, 15, 15, 15, 13, 0, 2, 15, 9, 1, 10, 0, 3, 15, 15, 6, 2, + 14, 15, 14, 3, 1, 14, 15, 15, 15, 2, 4, 0, 0, 12, 5, 3, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 14, 1, 0, 1, 14, 15, 5, 0, 0, 12, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 4, 0, 0, 6, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 12, 9, 5, 4, 4, + 3, 0, 0, 0, 0, 4, 0, 8, 15, 15, 15, 15, 13, 1, 10, 15, 15, 15, 15, + 15, 15, 2, 0, 11, 3, 5, 10, 0, 7, 15, 9, 1, 11, 15, 15, 8, 0, 6, + 15, 15, 15, 10, 0, 3, 0, 0, 13, 3, 6, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 6, 0, 0, 12, 15, 5, 0, 0, 7, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 1, 0, 0, 8, + 14, 15, 15, 13, 6, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, + 3, 0, 12, 15, 15, 15, 15, 15, 5, 3, 15, 15, 15, 15, 14, 8, 0, 0, 1, + 1, 12, 9, 0, 9, 10, 0, 6, 15, 15, 15, 2, 2, 14, 15, 15, 13, 2, 0, + 4, 0, 1, 13, 0, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, + 1, 0, 10, 15, 10, 0, 0, 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 0, 0, 3, 2, 2, 1, 0, + 0, 0, 1, 4, 4, 5, 10, 12, 12, 12, 11, 0, 0, 11, 4, 0, 12, 15, 15, + 15, 15, 15, 12, 0, 7, 13, 15, 15, 5, 0, 0, 0, 1, 6, 15, 9, 0, 3, + 0, 0, 1, 6, 14, 10, 0, 12, 15, 15, 11, 2, 0, 2, 3, 0, 3, 12, 1, + 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, 6, 8, 7, + 0, 0, 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 9, 1, 0, 0, 0, 2, 6, 10, 12, 12, 14, 15, 15, + 15, 15, 15, 11, 5, 4, 0, 2, 14, 4, 0, 12, 15, 15, 15, 15, 15, 15, 4, + 0, 3, 13, 6, 0, 0, 0, 1, 2, 14, 15, 12, 0, 0, 0, 0, 0, 0, 2, + 2, 6, 15, 14, 8, 0, 0, 0, 7, 4, 0, 4, 12, 0, 12, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, 0, 0, 0, 0, 0, 1, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 12, 2, 0, 0, 0, 1, 6, 11, 15, 15, 15, 15, 15, 15, 15, 2, 1, + 0, 0, 9, 15, 6, 0, 7, 15, 15, 15, 15, 15, 15, 13, 2, 0, 0, 0, 0, + 0, 0, 1, 12, 15, 15, 15, 4, 0, 0, 0, 0, 0, 0, 6, 13, 6, 1, 0, + 0, 4, 13, 15, 6, 0, 6, 12, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 14, 5, 0, 0, 0, 0, 0, 5, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 5, + 0, 0, 0, 0, 0, 2, 4, 5, 7, 3, 6, 3, 0, 2, 0, 2, 15, 15, 11, + 0, 0, 9, 15, 15, 15, 15, 15, 15, 11, 0, 0, 0, 0, 0, 2, 11, 15, 15, + 15, 15, 12, 1, 0, 0, 1, 4, 6, 10, 2, 0, 0, 0, 7, 14, 15, 15, 9, + 0, 9, 9, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 13, 9, 8, 9, 7, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 6, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 8, 0, 0, 9, 15, 15, 14, 4, 0, 0, 3, 10, + 14, 15, 15, 15, 15, 13, 3, 0, 0, 4, 14, 15, 15, 15, 15, 15, 15, 11, 2, + 0, 0, 1, 1, 0, 0, 0, 1, 11, 15, 15, 15, 15, 9, 0, 10, 5, 3, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 10, 5, 4, 6, 2, 4, + 10, 14, 8, 0, 1, 14, 15, 15, 15, 14, 5, 0, 0, 0, 1, 2, 4, 4, 4, + 3, 1, 2, 9, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 11, 13, 10, 9, + 9, 11, 15, 15, 15, 15, 15, 15, 10, 0, 8, 2, 4, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 2, 7, 15, 14, 1, 0, 6, + 15, 15, 15, 15, 15, 15, 10, 6, 4, 2, 2, 4, 4, 4, 3, 9, 14, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 11, 0, 3, 1, 4, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 11, 1, 10, 15, 9, 0, 0, 13, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 0, + 11, 11, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 2, 5, 15, 14, 2, 0, 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 1, 13, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 1, 13, 15, 11, + 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 8, 1, 15, 15, 5, 0, 3, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 12, 2, 3, 15, 14, 1, 0, 7, 15, 15, 15, 15, 15, 13, 15, 15, + 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 13, 12, 12, 11, 9, 4, 7, 14, 15, 14, 13, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 3, 0, + 10, 15, 9, 0, 0, 8, 7, 4, 2, 2, 1, 0, 3, 4, 3, 4, 9, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 13, 11, 7, + 4, 2, 0, 0, 0, 0, 0, 0, 1, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 13, 11, 7, 4, 2, 2, 13, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, 3, 11, 7, 1, 0, 0, + 0, 0, 0, 1, 4, 9, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 14, 12, 11, 9, 7, 4, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 13, 11, 8, 4, 3, 1, 0, 0, 0, 0, 3, 8, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 14, 11, 3, 0, 0, 0, 0, 0, 0, 2, 6, 9, 12, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 9, 6, 3, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 7, 11, 12, 12, 12, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 11, 7, 4, 2, 0, 0, 0, 0, 0, + 0, 1, 5, 10, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 7, 3, 1, + 0, 0, 0, 2, 5, 2, 0, 2, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, + 13, 12, 11, 9, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 5, + 9, 11, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 11, + 7, 4, 3, 1, 0, 0, 0, 0, 0, 0, 0, 1, 4, 5, 10, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 13, 10, 5, 1, 0, 0, 0, 1, 0, 0, 2, 13, 14, + 1, 0, 8, 15, 15, 14, 12, 11, 9, 8, 4, 3, 2, 1, 0, 0, 0, 0, 0, + 0, 1, 3, 2, 3, 5, 9, 10, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 13, 11, 10, 6, 4, 3, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 4, 7, 11, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, + 4, 0, 0, 0, 1, 4, 9, 13, 13, 1, 0, 0, 1, 7, 0, 0, 7, 8, 5, + 2, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 9, 10, 12, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 11, 8, 4, 3, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 5, 9, 12, 13, 15, 15, 15, 15, + 15, 15, 15, 15, 14, 12, 9, 8, 8, 7, 4, 2, 5, 4, 5, 5, 12, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 10, 5, 1, 0, 1, 3, 6, 11, 14, + 15, 15, 15, 15, 13, 12, 8, 3, 2, 0, 0, 1, 1, 3, 3, 4, 5, 8, 10, + 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 13, 11, 9, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, + 6, 10, 11, 13, 15, 15, 15, 15, 15, 15, 15, 15, 13, 11, 9, 7, 4, 2, 1, + 0, 0, 0, 0, 2, 4, 7, 12, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 10, 5, 1, 1, 3, 8, 12, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 9, 3, 11, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 8, 6, 9, 9, 9, 9, 9, 8, 5, 4, 4, 3, 1, 0, 0, 0, + 0, 0, 1, 2, 3, 2, 4, 5, 9, 11, 12, 14, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 14, 12, 9, 5, 2, 0, 0, 0, 0, 0, 1, 2, 4, 7, 10, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 9, 4, 1, 3, 9, + 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 11, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 3, 1, + 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 3, 5, 8, 10, 12, 14, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 5, 2, 0, 0, + 0, 1, 3, 4, 7, 10, 12, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 13, 11, 13, 13, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 14, 12, 12, 12, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 8, 1, 0, 1, 4, 7, 11, 13, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 13, 7, 8, 11, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15}; diff --git a/libvisual-plugins/plugins/actor/goom2k4/motif_goom2.h b/libvisual-plugins/plugins/actor/goom2k4/motif_goom2.h index 4bde2a3d0..42500954d 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/motif_goom2.h +++ b/libvisual-plugins/plugins/actor/goom2k4/motif_goom2.h @@ -1,1026 +1,864 @@ static Motif CONV_MOTIF2 = { - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,12,5,14, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,12,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,10,1,14, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,10,0,12,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,6,0,12, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,7,0,8,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,13,2,0,10, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,6,0,2,14,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,5,0,0,10, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,9,0,0,12,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,14,9,0,0,1,14, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,8,0,0,8,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,14,8,3,0,0,0,9,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,11,0,0,2,14,15,15,15,15,15,15,15,15,15,15, - 15,15,15,13,9,5,3,4,1,0,0,0,0,7,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,14,4,0,0,4,11,13,13,15,15,14,12,10,8,5, - 6,4,1,0,0,0,0,0,0,0,0,0,0,14,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,12,1,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,9,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 13,9,10,13,14,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,3,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,2,5,6,0,0,0,0,12,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 5,0,0,0,3,10,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,14,9,2,1,0,0,0,1,4,6,6,1, - 0,0,0,8,13,15,15,15,12,1,0,2,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,14, - 2,0,0,0,0,0,4,12,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,3,0,0,10,15,15,15,10, - 0,0,4,15,15,15,15,15,15,2,0,6,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,5, - 3,11,5,0,0,0,0,0,4,11,14,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,0,13,15,15,15,11, - 0,0,7,15,15,15,15,15,15,1,0,9,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,9,0, - 13,15,15,12,5,0,0,0,0,0,1,8,14,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,1,14,15,15,15,11, - 0,0,7,15,15,15,15,15,14,0,0,9,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,11,1,10, - 15,15,15,15,15,11,5,0,0,0,0,0,1,6,13,15, - 15,15,15,15,14,8,11,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,6,0,2,15,15,15,15,11, - 0,0,6,15,15,15,15,15,13,0,0,11,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,11,1,6,15, - 15,15,15,15,15,15,15,14,5,0,0,0,0,0,0,6, - 14,15,15,15,6,0,4,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,5,15,15,15,15,11, - 0,0,5,15,15,15,15,15,12,0,0,12,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,13,2,1,13,15, - 15,15,15,15,15,15,15,15,15,12,2,0,0,0,0,0, - 1,6,11,7,0,0,4,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,7,15,15,15,15,11, - 0,0,6,15,15,15,15,15,12,0,0,12,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,5,0,7,15,15, - 15,15,15,15,15,15,15,15,15,15,15,11,5,0,0,0, - 0,0,0,0,0,1,11,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,10,15,15,15,15,11, - 0,0,6,15,15,15,15,15,12,0,0,12,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,10,0,4,14,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,13,7,0, - 0,0,0,0,0,1,6,12,14,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,10,15,15,15,15,11, - 0,0,7,15,15,15,15,15,12,0,0,12,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,13,1,1,12,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,13, - 5,0,0,0,0,0,0,0,3,10,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,10,15,15,15,15,11, - 0,0,7,15,15,15,15,15,11,0,0,13,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,14,4,0,8,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 13,0,0,0,1,0,0,0,0,1,13,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,10,15,15,15,15,11, - 0,0,8,15,15,15,15,15,8,0,2,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,9,0,4,14,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,14, - 4,0,0,5,13,12,6,2,0,2,13,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,7,0,10,15,15,15,15,11, - 0,0,7,15,15,15,15,15,4,0,4,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,13,1,1,13,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,11, - 0,0,1,13,15,15,15,14,9,13,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,5,0,6,15,15,15,15,11, - 0,0,8,15,15,15,15,15,2,0,8,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,5,0,9,15,15,15,15,15,15, - 15,15,15,15,15,15,14,11,15,15,15,15,15,15,15,9, - 0,0,10,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,4,0,4,15,15,15,15,11, - 0,0,7,15,15,15,15,13,0,0,11,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,10,0,3,14,15,15,15,15,15,15, - 15,15,15,15,15,14,3,0,13,15,15,15,15,15,15,14, - 9,11,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,4,0,4,15,15,15,15,11, - 0,0,8,15,15,15,15,12,0,0,12,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,14,2,1,12,15,15,15,15,15,15,15, - 15,15,15,15,14,3,0,0,9,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,6,0,3,15,15,15,15,13, - 1,0,8,15,15,15,15,12,0,0,12,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,9,0,5,15,15,15,15,15,15,15,15, - 15,15,15,14,4,0,0,0,10,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,8,0,2,15,15,15,15,15, - 3,0,13,15,15,15,15,12,0,0,12,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,13,2,1,12,15,15,15,15,15,15,15,15, - 15,15,15,7,0,0,0,0,8,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,10,0,1,14,15,15,15,15, - 11,5,15,15,15,15,15,12,0,0,11,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,6,0,7,15,15,15,15,15,15,15,15,15, - 15,15,8,0,0,0,0,0,0,9,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,12,0,0,12,15,15,15,15, - 15,14,15,15,15,15,15,10,0,0,12,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,13,1,2,14,15,15,15,15,15,15,15,15,15, - 15,10,0,0,0,6,6,0,0,0,5,12,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,12,12, - 15,15,15,15,15,15,15,15,13,0,0,11,15,15,15,15, - 15,15,15,15,15,15,15,9,0,1,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,7,0,8,15,15,15,15,15,15,15,15,15,15, - 15,9,0,0,4,15,15,8,0,0,0,1,5,13,15,15, - 15,15,15,15,15,15,15,15,15,15,12,8,7,6,5,3, - 3,3,4,12,15,15,15,15,15,15,15,15,15,7,0,6, - 15,15,15,15,15,15,15,15,14,1,0,10,15,15,15,15, - 15,15,15,15,15,15,15,6,0,3,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,13,1,0,13,15,15,15,15,15,15,15,15,15,15, - 15,14,7,8,13,15,15,15,11,2,0,0,0,0,5,11, - 15,15,15,15,15,15,15,15,13,3,0,0,0,0,0,0, - 0,0,0,5,15,15,15,15,15,15,15,15,12,1,0,0, - 3,11,15,15,15,15,15,15,13,1,0,10,15,15,15,15, - 15,15,15,15,15,15,15,3,0,5,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,9,0,5,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,14,8,1,0,0,0,0, - 4,12,15,15,15,15,15,15,4,0,0,0,0,0,0,0, - 0,0,0,2,15,15,15,15,15,15,15,14,4,0,0,0, - 0,0,9,15,15,15,15,15,14,1,0,10,15,15,15,15, - 15,15,15,15,15,15,15,2,0,9,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,14,4,0,11,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,14,8,2,0,0, - 0,0,4,10,14,15,15,15,4,0,0,0,0,0,0,0, - 0,0,0,3,15,15,15,15,15,15,15,6,0,0,0,2, - 3,0,0,8,15,15,15,15,14,1,0,10,15,15,15,15, - 15,15,15,15,15,15,15,1,0,9,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 14,5,0,4,14,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,14,9,3, - 0,0,0,0,2,5,10,15,5,0,1,11,11,12,13,15, - 11,0,0,7,15,15,15,15,15,15,8,0,0,0,1,12, - 14,6,0,0,7,14,15,15,14,1,0,9,15,15,15,15, - 15,15,15,15,15,15,15,2,0,10,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 9,0,1,13,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,14, - 10,2,0,0,0,0,1,14,4,0,1,14,15,15,15,15, - 9,0,0,9,15,15,15,15,15,9,0,0,0,0,9,15, - 15,15,7,0,0,6,14,15,15,3,0,6,15,15,15,15, - 15,15,15,15,15,15,15,1,0,9,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,9, - 0,0,1,10,14,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,13,1,0,0,0,1,14,3,0,0,14,15,15,15,15, - 5,0,0,11,15,15,15,15,13,1,0,0,0,6,15,15, - 15,15,15,8,0,0,2,10,15,6,0,3,15,15,15,15, - 15,15,15,15,15,15,15,2,0,10,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,13,1, - 0,0,0,0,3,9,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,6,1,0,0,0,8,15,1,0,0,14,15,15,15,15, - 4,0,0,13,15,15,15,14,4,0,0,0,3,14,15,15, - 15,15,15,15,5,0,0,1,14,9,0,1,14,15,15,15, - 15,15,15,15,15,15,15,1,0,9,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,13,1, - 0,0,0,0,0,0,4,12,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 9,0,0,0,0,7,15,15,1,0,0,14,15,15,15,14, - 2,0,1,14,15,15,15,12,0,0,0,3,13,15,15,15, - 15,15,15,9,0,0,0,1,14,12,0,0,12,15,15,15, - 15,15,15,15,15,15,14,1,0,10,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,12, - 3,0,0,0,0,0,0,1,8,14,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,9, - 0,0,0,0,7,15,15,15,1,0,0,14,15,15,15,13, - 0,0,1,15,15,15,15,12,0,0,0,6,14,15,15,15, - 15,15,12,0,0,0,0,3,14,12,0,0,12,15,15,15, - 15,15,15,15,15,15,12,0,0,12,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,13,3,0,0,0,0,0,0,1,6,13,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,12,0, - 0,0,0,3,15,15,15,12,0,0,0,14,15,15,15,11, - 0,0,3,15,15,15,15,15,12,7,0,0,4,14,15,15, - 15,11,1,0,0,0,4,13,15,12,0,0,12,15,15,15, - 15,15,15,15,15,15,10,0,1,14,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,7,0,0,0,0,0,0,0,3,8,12,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,4,0, - 0,0,1,13,15,15,15,6,0,0,0,14,15,15,15,8, - 0,0,7,15,15,15,15,15,15,15,8,1,0,2,13,15, - 14,2,0,0,0,4,14,15,15,13,1,0,10,15,15,15, - 15,15,15,15,15,15,9,0,2,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,11,6,2,0,0,0,0,0,0,0,1, - 10,15,15,15,15,15,15,15,15,15,15,15,15,8,0,0, - 0,0,10,15,15,15,15,4,0,0,1,15,15,15,15,4, - 0,0,8,15,15,15,15,15,15,15,15,10,1,0,1,8, - 2,0,0,0,5,15,15,15,15,15,2,0,6,15,15,15, - 15,15,15,15,15,15,9,0,1,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,9,1,0,0,0,0,0,0, - 0,1,7,13,14,15,15,15,15,15,15,15,9,0,0,0, - 0,6,15,15,15,15,15,4,0,0,4,15,15,15,14,1, - 0,0,9,15,15,15,15,15,15,15,15,15,12,2,0,0, - 0,0,0,4,14,15,15,15,15,15,4,0,4,15,15,15, - 15,15,15,15,15,15,7,0,0,14,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,14,11,6,2,0,0,0, - 0,0,0,0,1,9,12,15,15,15,15,14,3,0,0,0, - 4,15,15,15,15,15,15,4,0,0,3,6,4,4,2,0, - 0,0,13,15,15,15,15,15,15,15,15,15,15,12,1,0, - 0,0,3,14,15,15,15,15,15,15,4,0,4,15,15,15, - 15,15,15,15,15,15,5,0,0,12,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,8,2,0, - 0,0,0,0,0,0,0,1,9,15,15,5,0,0,0,0, - 12,15,15,15,15,15,15,4,0,0,0,0,0,0,0,0, - 0,3,15,15,15,15,15,15,15,15,15,15,15,14,4,0, - 0,1,12,15,15,15,15,15,15,15,6,0,1,14,15,15, - 15,15,15,15,15,15,5,0,0,13,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,12, - 7,1,0,0,0,0,0,0,0,5,7,0,0,0,0,10, - 15,15,15,15,15,15,15,7,0,0,0,0,0,0,0,0, - 1,10,15,15,15,15,15,15,15,15,15,15,15,14,3,0, - 3,12,15,15,15,15,15,15,15,15,12,0,0,12,15,15, - 15,15,15,15,15,15,5,0,0,1,1,4,11,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,11,6,1,0,0,0,0,0,0,0,0,0,7,15, - 15,15,15,15,15,15,15,14,7,4,4,4,5,9,12,13, - 14,15,15,15,15,15,15,15,15,15,15,15,15,15,11,9, - 14,15,15,14,12,11,11,11,10,9,7,0,0,5,13,15, - 15,15,15,15,15,12,1,0,0,0,0,0,0,10,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,14,7,1,0,0,0,0,0,3,14,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,13,2,0,0,0,0,0,0,0,0,0,0,0,8, - 15,15,15,15,15,11,0,0,0,0,0,0,0,9,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,13,5,0,0,0,0,12,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,8,0,0,0,0,0,0,0,0,0,0,0,0,5, - 15,15,15,15,15,15,10,5,6,7,7,7,9,14,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,8,3,2,2,2,2,5,14,15, - 15,15,15,15,15,15,15,15,15,10,3,0,6,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,13,3,1,0,1,0,1,1,2,4,4,3,9,14, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,12,4,0,1,6,7,7,4,1,3,13, - 15,15,15,15,15,15,15,15,15,15,14,10,13,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,11,11,15,15,15,15, - 15,15,15,14,14,14,14,14,14,14,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,14,2,0,4,13,15,15,15,15,10,0,12, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,14,13,14,12,12,12,12,12,12,12, - 12,14,15,15,15,15,15,15,15,15,4,14,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,7,1,5,14,15,15,15,15,15,12,1,11, - 15,15,15,13,12,13,15,15,14,11,13,15,15,15,15,15, - 15,15,15,11,6,3,1,1,1,0,0,0,0,0,0,0, - 0,1,4,7,11,14,15,15,15,14,4,15,13,10,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,14,7,4,5, - 12,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,13,1,1,14,15,15,14,10,12,15,11,1,12, - 15,15,11,1,0,4,15,15,6,0,2,14,15,15,15,15, - 15,15,14,8,6,3,3,2,2,1,0,0,0,0,0,0, - 0,0,0,0,0,3,11,15,15,11,8,15,12,6,15,9, - 8,15,15,15,15,15,15,15,15,15,15,15,10,4,4,1, - 4,15,15,15,15,11,6,2,8,14,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,0,4,15,15,15,11,2,10,15,9,1,13, - 15,13,1,7,6,2,14,14,1,2,1,14,15,15,15,15, - 15,15,15,15,15,15,15,15,15,13,12,12,12,12,12,12, - 11,11,11,10,9,10,12,15,15,6,7,15,9,4,15,4, - 1,14,15,15,15,15,15,15,15,15,15,15,2,11,15,4, - 4,15,15,15,15,3,9,4,0,9,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,0,4,15,15,15,5,0,6,6,1,9,15, - 15,4,1,13,10,1,13,9,2,7,1,14,14,14,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,3,5,15,3,5,14,1, - 0,12,13,9,14,15,15,15,15,15,15,15,2,2,4,1, - 6,15,15,15,14,1,5,6,0,9,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,0,4,15,15,15,12,4,2,2,10,15,15, - 11,0,6,15,12,0,10,7,9,10,1,14,7,14,15,15, - 15,15,15,15,15,15,13,12,11,11,10,9,9,10,11,13, - 15,15,15,15,15,15,15,15,15,1,9,15,2,7,14,1, - 0,10,7,0,8,15,15,15,15,15,15,15,11,4,4,4, - 13,15,15,15,15,10,2,2,4,14,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,0,4,15,15,15,15,15,15,15,15,15,15, - 4,2,14,15,15,1,9,5,14,9,1,14,8,14,15,15, - 15,15,15,15,15,10,3,0,1,0,0,0,0,0,0,5, - 15,15,15,15,15,15,15,15,15,1,9,14,1,8,14,1, - 0,11,13,6,11,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,14,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,0,4,15,15,15,15,15,15,15,15,15,11, - 0,6,15,15,15,1,5,3,13,10,0,6,8,15,15,15, - 15,15,15,15,15,15,13,12,12,11,10,9,9,10,11,13, - 15,15,15,15,15,15,15,15,15,1,9,12,1,11,15,4, - 1,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 14,10,4,2,12,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,12,1,3,14,15,15,15,15,15,15,15,15,4, - 3,14,15,15,15,5,1,8,15,14,5,2,9,15,15,15, - 15,15,15,15,15,15,15,15,15,11,9,13,15,15,15,15, - 15,15,15,15,15,15,15,15,15,1,9,12,1,12,15,13, - 11,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 10,2,9,2,3,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,14,4,0,5,14,15,15,15,15,15,15,11,0, - 6,15,15,15,15,15,14,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,8,1,0,3,15,15,15,15, - 15,15,15,15,15,15,15,15,15,1,9,15,11,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 7,1,12,6,1,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,11,1,0,3,8,9,9,10,11,9,5,4, - 13,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,12,9,13,15,15,15,15, - 15,15,15,15,15,15,15,15,15,5,11,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 10,3,4,1,5,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,12,2,0,0,0,0,0,0,1,8,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,14,12,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,13,8,8,10,9,10,11,14,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, - 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 - }; + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 12, 5, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 10, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 10, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 6, 0, 12, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 7, 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 2, 0, 10, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 6, 0, 2, + 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 5, 0, 0, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 0, 12, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 9, + 0, 0, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 8, 0, 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 8, 3, 0, 0, 0, 9, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 11, 0, 0, 2, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 13, 9, 5, 3, 4, 1, 0, 0, 0, 0, 7, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 4, 0, 0, + 4, 11, 13, 13, 15, 15, 14, 12, 10, 8, 5, 6, 4, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 9, 10, 13, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 12, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 5, 6, 0, 0, 0, 0, 12, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 5, 0, 0, 0, 3, 10, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 14, 9, 2, 1, 0, 0, 0, 1, 4, 6, 6, 1, 0, 0, 0, 8, + 13, 15, 15, 15, 12, 1, 0, 2, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 14, 2, 0, 0, 0, 0, 0, 4, 12, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 3, 0, 0, 10, 15, 15, 15, 10, 0, 0, 4, 15, 15, 15, 15, 15, 15, + 2, 0, 6, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 5, 3, 11, + 5, 0, 0, 0, 0, 0, 4, 11, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 0, + 13, 15, 15, 15, 11, 0, 0, 7, 15, 15, 15, 15, 15, 15, 1, 0, 9, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 13, 15, 15, 12, 5, 0, 0, + 0, 0, 0, 1, 8, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 1, 14, 15, 15, 15, 11, + 0, 0, 7, 15, 15, 15, 15, 15, 14, 0, 0, 9, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 11, 1, 10, 15, 15, 15, 15, 15, 11, 5, 0, 0, 0, 0, 0, + 1, 6, 13, 15, 15, 15, 15, 15, 14, 8, 11, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 6, 0, 2, 15, 15, 15, 15, 11, 0, 0, 6, 15, 15, + 15, 15, 15, 13, 0, 0, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 1, + 6, 15, 15, 15, 15, 15, 15, 15, 15, 14, 5, 0, 0, 0, 0, 0, 0, 6, 14, + 15, 15, 15, 6, 0, 4, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 7, 0, 5, 15, 15, 15, 15, 11, 0, 0, 5, 15, 15, 15, 15, 15, 12, 0, + 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 2, 1, 13, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 12, 2, 0, 0, 0, 0, 0, 1, 6, 11, 7, 0, 0, + 4, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 7, 15, + 15, 15, 15, 11, 0, 0, 6, 15, 15, 15, 15, 15, 12, 0, 0, 12, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 5, 0, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 11, 5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 10, 15, 15, 15, 15, 11, 0, + 0, 6, 15, 15, 15, 15, 15, 12, 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 10, 0, 4, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 13, 7, 0, 0, 0, 0, 0, 0, 1, 6, 12, 14, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 7, 0, 10, 15, 15, 15, 15, 11, 0, 0, 7, 15, 15, 15, + 15, 15, 12, 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 1, 1, 12, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 5, 0, + 0, 0, 0, 0, 0, 0, 3, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 7, 0, 10, 15, 15, 15, 15, 11, 0, 0, 7, 15, 15, 15, 15, 15, 11, 0, 0, + 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 14, 4, 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 0, 0, 0, 1, 0, 0, + 0, 0, 1, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 10, 15, 15, + 15, 15, 11, 0, 0, 8, 15, 15, 15, 15, 15, 8, 0, 2, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 9, 0, 4, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 14, 4, 0, 0, 5, 13, 12, 6, 2, 0, 2, 13, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 10, 15, 15, 15, 15, 11, 0, 0, + 7, 15, 15, 15, 15, 15, 4, 0, 4, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 1, 1, 13, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 11, 0, 0, 1, 13, 15, 15, 15, 14, 9, 13, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 5, 0, 6, 15, 15, 15, 15, 11, 0, 0, 8, 15, 15, 15, 15, + 15, 2, 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 5, 0, 9, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 14, 11, 15, 15, 15, 15, 15, 15, 15, 9, 0, 0, 10, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 4, + 0, 4, 15, 15, 15, 15, 11, 0, 0, 7, 15, 15, 15, 15, 13, 0, 0, 11, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 10, 0, 3, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 14, 3, 0, 13, 15, 15, 15, 15, 15, 15, 14, 9, 11, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 4, 0, 4, 15, 15, 15, + 15, 11, 0, 0, 8, 15, 15, 15, 15, 12, 0, 0, 12, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 2, + 1, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 3, 0, 0, 9, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 6, 0, 3, 15, 15, 15, 15, 13, 1, 0, 8, + 15, 15, 15, 15, 12, 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 5, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 14, 4, 0, 0, 0, 10, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 8, 0, 2, 15, 15, 15, 15, 15, 3, 0, 13, 15, 15, 15, 15, 12, + 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 13, 2, 1, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 7, 0, 0, 0, 0, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 0, + 1, 14, 15, 15, 15, 15, 11, 5, 15, 15, 15, 15, 15, 12, 0, 0, 11, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 6, 0, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 8, 0, 0, 0, + 0, 0, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, 0, 12, 15, 15, 15, + 15, 15, 14, 15, 15, 15, 15, 15, 10, 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 1, 2, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 0, 0, 0, 6, 6, 0, 0, 0, 5, + 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 12, 15, + 15, 15, 15, 15, 15, 15, 15, 13, 0, 0, 11, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 9, 0, 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 8, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 9, 0, 0, 4, 15, 15, 8, 0, 0, 0, 1, 5, 13, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 8, 7, 6, 5, 3, 3, 3, 4, + 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 6, 15, 15, 15, 15, 15, 15, + 15, 15, 14, 1, 0, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 6, 0, + 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 13, 1, 0, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, + 7, 8, 13, 15, 15, 15, 11, 2, 0, 0, 0, 0, 5, 11, 15, 15, 15, 15, 15, + 15, 15, 15, 13, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 15, 15, 15, 15, + 15, 15, 15, 15, 12, 1, 0, 0, 3, 11, 15, 15, 15, 15, 15, 15, 13, 1, 0, + 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 0, 5, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, + 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 14, 8, 1, 0, 0, 0, 0, 4, 12, 15, 15, 15, 15, 15, 15, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 15, 15, 15, 15, 15, 15, 15, 14, 4, + 0, 0, 0, 0, 0, 9, 15, 15, 15, 15, 15, 14, 1, 0, 10, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 2, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 4, 0, 11, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, + 8, 2, 0, 0, 0, 0, 4, 10, 14, 15, 15, 15, 4, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 15, 15, 15, 15, 15, 15, 15, 6, 0, 0, 0, 2, 3, 0, + 0, 8, 15, 15, 15, 15, 14, 1, 0, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 1, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 14, 5, 0, 4, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 9, 3, 0, + 0, 0, 0, 2, 5, 10, 15, 5, 0, 1, 11, 11, 12, 13, 15, 11, 0, 0, 7, + 15, 15, 15, 15, 15, 15, 8, 0, 0, 0, 1, 12, 14, 6, 0, 0, 7, 14, 15, + 15, 14, 1, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 2, 0, 10, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 9, 0, 1, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 10, 2, 0, 0, 0, 0, + 1, 14, 4, 0, 1, 14, 15, 15, 15, 15, 9, 0, 0, 9, 15, 15, 15, 15, 15, + 9, 0, 0, 0, 0, 9, 15, 15, 15, 7, 0, 0, 6, 14, 15, 15, 3, 0, 6, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 0, 9, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 0, 1, 10, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 1, 0, 0, 0, 1, 14, 3, 0, 0, + 14, 15, 15, 15, 15, 5, 0, 0, 11, 15, 15, 15, 15, 13, 1, 0, 0, 0, 6, + 15, 15, 15, 15, 15, 8, 0, 0, 2, 10, 15, 6, 0, 3, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 2, 0, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 13, 1, 0, 0, 0, 0, 3, 9, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 6, 1, 0, 0, 0, 8, 15, 1, 0, 0, 14, 15, 15, 15, 15, + 4, 0, 0, 13, 15, 15, 15, 14, 4, 0, 0, 0, 3, 14, 15, 15, 15, 15, 15, + 15, 5, 0, 0, 1, 14, 9, 0, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 1, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 13, 1, 0, 0, 0, 0, 0, 0, 4, 12, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, + 0, 0, 0, 7, 15, 15, 1, 0, 0, 14, 15, 15, 15, 14, 2, 0, 1, 14, 15, + 15, 15, 12, 0, 0, 0, 3, 13, 15, 15, 15, 15, 15, 15, 9, 0, 0, 0, 1, + 14, 12, 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 1, 0, 10, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 3, + 0, 0, 0, 0, 0, 0, 1, 8, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 0, 0, 0, 7, 15, 15, + 15, 1, 0, 0, 14, 15, 15, 15, 13, 0, 0, 1, 15, 15, 15, 15, 12, 0, 0, + 0, 6, 14, 15, 15, 15, 15, 15, 12, 0, 0, 0, 0, 3, 14, 12, 0, 0, 12, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, 0, 12, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 3, 0, 0, 0, + 0, 0, 0, 1, 6, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 12, 0, 0, 0, 0, 3, 15, 15, 15, 12, 0, 0, 0, 14, + 15, 15, 15, 11, 0, 0, 3, 15, 15, 15, 15, 15, 12, 7, 0, 0, 4, 14, 15, + 15, 15, 11, 1, 0, 0, 0, 4, 13, 15, 12, 0, 0, 12, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 10, 0, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 7, 0, 0, 0, 0, 0, 0, + 0, 3, 8, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 4, 0, 0, 0, 1, 13, 15, 15, 15, 6, 0, 0, 0, 14, 15, 15, 15, 8, 0, + 0, 7, 15, 15, 15, 15, 15, 15, 15, 8, 1, 0, 2, 13, 15, 14, 2, 0, 0, + 0, 4, 14, 15, 15, 13, 1, 0, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, + 0, 2, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 11, 6, 2, 0, 0, 0, 0, 0, 0, 0, 1, + 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 8, 0, 0, 0, 0, 10, + 15, 15, 15, 15, 4, 0, 0, 1, 15, 15, 15, 15, 4, 0, 0, 8, 15, 15, 15, + 15, 15, 15, 15, 15, 10, 1, 0, 1, 8, 2, 0, 0, 0, 5, 15, 15, 15, 15, + 15, 2, 0, 6, 15, 15, 15, 15, 15, 15, 15, 15, 15, 9, 0, 1, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 9, 1, 0, 0, 0, 0, 0, 0, 0, 1, 7, 13, 14, + 15, 15, 15, 15, 15, 15, 15, 9, 0, 0, 0, 0, 6, 15, 15, 15, 15, 15, 4, + 0, 0, 4, 15, 15, 15, 14, 1, 0, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 12, 2, 0, 0, 0, 0, 0, 4, 14, 15, 15, 15, 15, 15, 4, 0, 4, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 7, 0, 0, 14, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 14, 11, 6, 2, 0, 0, 0, 0, 0, 0, 0, 1, 9, 12, 15, 15, 15, + 15, 14, 3, 0, 0, 0, 4, 15, 15, 15, 15, 15, 15, 4, 0, 0, 3, 6, 4, + 4, 2, 0, 0, 0, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 1, 0, + 0, 0, 3, 14, 15, 15, 15, 15, 15, 15, 4, 0, 4, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 5, 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 15, 15, 5, 0, 0, 0, + 0, 12, 15, 15, 15, 15, 15, 15, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 4, 0, 0, 1, 12, 15, 15, + 15, 15, 15, 15, 15, 6, 0, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 5, 0, + 0, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 7, + 1, 0, 0, 0, 0, 0, 0, 0, 5, 7, 0, 0, 0, 0, 10, 15, 15, 15, 15, + 15, 15, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 14, 3, 0, 3, 12, 15, 15, 15, 15, 15, 15, 15, 15, + 12, 0, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 5, 0, 0, 1, 1, 4, 11, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 6, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 7, 15, 15, 15, 15, 15, 15, 15, 15, 14, 7, + 4, 4, 4, 5, 9, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 11, 9, 14, 15, 15, 14, 12, 11, 11, 11, 10, 9, 7, 0, 0, 5, 13, + 15, 15, 15, 15, 15, 15, 12, 1, 0, 0, 0, 0, 0, 0, 10, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 7, 1, 0, 0, 0, + 0, 0, 3, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 15, 15, 15, 15, + 15, 11, 0, 0, 0, 0, 0, 0, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 5, 0, 0, 0, 0, 12, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 15, 15, 15, 15, 15, 15, 10, 5, 6, + 7, 7, 7, 9, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 8, 3, 2, 2, 2, 2, 5, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 10, 3, 0, 6, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 3, 1, 0, 1, 0, 1, 1, 2, + 4, 4, 3, 9, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 12, 4, 0, 1, 6, 7, 7, 4, 1, 3, 13, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 14, 10, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 11, 15, + 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 2, 0, 4, 13, + 15, 15, 15, 15, 10, 0, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 13, 14, 12, 12, 12, 12, 12, 12, + 12, 12, 14, 15, 15, 15, 15, 15, 15, 15, 15, 4, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 1, 5, 14, 15, 15, 15, 15, 15, 12, + 1, 11, 15, 15, 15, 13, 12, 13, 15, 15, 14, 11, 13, 15, 15, 15, 15, 15, 15, + 15, 15, 11, 6, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 7, + 11, 14, 15, 15, 15, 14, 4, 15, 13, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 14, 7, 4, 5, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 13, 1, 1, 14, 15, 15, 14, 10, 12, 15, 11, 1, 12, 15, 15, 11, + 1, 0, 4, 15, 15, 6, 0, 2, 14, 15, 15, 15, 15, 15, 15, 14, 8, 6, 3, + 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 11, 15, 15, + 11, 8, 15, 12, 6, 15, 9, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 10, 4, 4, 1, 4, 15, 15, 15, 15, 11, 6, 2, 8, 14, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, + 4, 15, 15, 15, 11, 2, 10, 15, 9, 1, 13, 15, 13, 1, 7, 6, 2, 14, 14, + 1, 2, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 12, + 12, 12, 12, 12, 12, 11, 11, 11, 10, 9, 10, 12, 15, 15, 6, 7, 15, 9, 4, + 15, 4, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 2, 11, 15, 4, 4, + 15, 15, 15, 15, 3, 9, 4, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, 4, 15, 15, 15, 5, + 0, 6, 6, 1, 9, 15, 15, 4, 1, 13, 10, 1, 13, 9, 2, 7, 1, 14, 14, + 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 3, 5, 15, 3, 5, 14, 1, 0, 12, 13, + 9, 14, 15, 15, 15, 15, 15, 15, 15, 2, 2, 4, 1, 6, 15, 15, 15, 14, 1, + 5, 6, 0, 9, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 12, 0, 4, 15, 15, 15, 12, 4, 2, 2, 10, 15, + 15, 11, 0, 6, 15, 12, 0, 10, 7, 9, 10, 1, 14, 7, 14, 15, 15, 15, 15, + 15, 15, 15, 15, 13, 12, 11, 11, 10, 9, 9, 10, 11, 13, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 1, 9, 15, 2, 7, 14, 1, 0, 10, 7, 0, 8, 15, 15, 15, + 15, 15, 15, 15, 11, 4, 4, 4, 13, 15, 15, 15, 15, 10, 2, 2, 4, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 12, 0, 4, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 4, 2, 14, 15, + 15, 1, 9, 5, 14, 9, 1, 14, 8, 14, 15, 15, 15, 15, 15, 15, 15, 10, 3, + 0, 1, 0, 0, 0, 0, 0, 0, 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, + 9, 14, 1, 8, 14, 1, 0, 11, 13, 6, 11, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 0, 4, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 0, 6, 15, 15, 15, 1, 5, 3, 13, + 10, 0, 6, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 12, 12, 11, 10, 9, + 9, 10, 11, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 9, 12, 1, 11, 15, + 4, 1, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 10, + 4, 2, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 1, 3, 14, 15, 15, 15, 15, + 15, 15, 15, 15, 4, 3, 14, 15, 15, 15, 5, 1, 8, 15, 14, 5, 2, 9, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 9, 13, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 1, 9, 12, 1, 12, 15, 13, 11, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 10, 2, 9, 2, 3, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 14, 4, 0, 5, 14, 15, 15, 15, 15, 15, 15, 11, 0, + 6, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 8, 1, 0, 3, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 1, 9, 15, 11, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 7, 1, 12, 6, 1, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 11, 1, 0, 3, 8, 9, 9, 10, 11, 9, 5, 4, 13, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 12, 9, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 5, 11, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 10, 3, 4, 1, 5, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 12, 2, + 0, 0, 0, 0, 0, 0, 1, 8, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, + 12, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 13, 8, 8, 10, 9, 10, + 11, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15}; diff --git a/libvisual-plugins/plugins/actor/goom2k4/plugin_info.c b/libvisual-plugins/plugins/actor/goom2k4/plugin_info.c index a292901ab..26baa5d9c 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/plugin_info.c +++ b/libvisual-plugins/plugins/actor/goom2k4/plugin_info.c @@ -6,7 +6,6 @@ #include #include - #ifdef CPU_POWERPC #include #include @@ -14,198 +13,191 @@ #include "ppc_drawings.h" #endif /* CPU_POWERPC */ - #ifdef CPU_X86 #include "mmx.h" #endif /* CPU_X86 */ - - static void setOptimizedMethods(PluginInfo *p) { #if defined(CPU_X86) || defined(CPU_POWERPC) - unsigned int cpuFlavour = cpu_flavour(); + unsigned int cpuFlavour = cpu_flavour(); #endif - /* set default methods */ - p->methods.draw_line = draw_line; - p->methods.zoom_filter = zoom_filter_c; -/* p->methods.create_output_with_brightness = create_output_with_brightness;*/ + /* set default methods */ + p->methods.draw_line = draw_line; + p->methods.zoom_filter = zoom_filter_c; + /* p->methods.create_output_with_brightness = + * create_output_with_brightness;*/ #ifdef CPU_X86 - if (cpuFlavour & CPU_OPTION_XMMX) { + if (cpuFlavour & CPU_OPTION_XMMX) { #ifdef VERBOSE - printf ("Extented MMX detected. Using the fastest methods !\n"); + printf("Extented MMX detected. Using the fastest methods !\n"); #endif - p->methods.draw_line = draw_line_mmx; - p->methods.zoom_filter = zoom_filter_xmmx; - } - else if (cpuFlavour & CPU_OPTION_MMX) { + p->methods.draw_line = draw_line_mmx; + p->methods.zoom_filter = zoom_filter_xmmx; + } else if (cpuFlavour & CPU_OPTION_MMX) { #ifdef VERBOSE - printf ("MMX detected. Using fast methods !\n"); + printf("MMX detected. Using fast methods !\n"); #endif - p->methods.draw_line = draw_line_mmx; - p->methods.zoom_filter = zoom_filter_mmx; - } + p->methods.draw_line = draw_line_mmx; + p->methods.zoom_filter = zoom_filter_mmx; + } #ifdef VERBOSE - else - printf ("Too bad ! No SIMD optimization available for your CPU.\n"); + else + printf("Too bad ! No SIMD optimization available for your CPU.\n"); #endif #endif /* CPU_X86 */ - + #ifdef CPU_POWERPC - if ((cpuFlavour & CPU_OPTION_64_BITS) != 0) { -/* p->methods.create_output_with_brightness = ppc_brightness_G5; */ - p->methods.zoom_filter = ppc_zoom_generic; - } - else if ((cpuFlavour & CPU_OPTION_ALTIVEC) != 0) { -/* p->methods.create_output_with_brightness = ppc_brightness_G4; */ - p->methods.zoom_filter = ppc_zoom_G4; - } - else - { -/* p->methods.create_output_with_brightness = ppc_brightness_generic;*/ - p->methods.zoom_filter = ppc_zoom_generic; - } + if ((cpuFlavour & CPU_OPTION_64_BITS) != 0) { + /* p->methods.create_output_with_brightness = ppc_brightness_G5; + */ + p->methods.zoom_filter = ppc_zoom_generic; + } else if ((cpuFlavour & CPU_OPTION_ALTIVEC) != 0) { + /* p->methods.create_output_with_brightness = ppc_brightness_G4; + */ + p->methods.zoom_filter = ppc_zoom_G4; + } else { + /* p->methods.create_output_with_brightness = + * ppc_brightness_generic;*/ + p->methods.zoom_filter = ppc_zoom_generic; + } #endif /* CPU_POWERPC */ - } void plugin_info_init(PluginInfo *pp, int nbVisuals) { - PluginInfo p; - int i; - - p.sound.cycle = 0; - p.sound.timeSinceLastGoom = 0; - p.sound.goomPower = 0; - p.sound.timeSinceLastBigGoom = 0; - p.sound.volume = 1; - p.sound.bigGoomLimit = 1; - - p.sound.speedvar = p.sound.accelvar = p.sound.totalgoom = 0; - p.sound.prov_max = 0; - p.sound.goom_limit = 1; - p.sound.allTimesMax = 1; - - p.sound.volume_p = secure_f_feedback("Sound Volume"); - p.sound.accel_p = secure_f_feedback("Sound Acceleration"); - p.sound.speed_p = secure_f_feedback("Sound Speed"); - p.sound.goom_limit_p = secure_f_feedback("Goom Limit"); - p.sound.last_goom_p = secure_f_feedback("Goom Detection"); - p.sound.last_biggoom_p = secure_f_feedback("Big Goom Detection"); - p.sound.goom_power_p = secure_f_feedback("Goom Power"); - - p.sound.biggoom_speed_limit_p = secure_i_param("Big Goom Speed Limit"); - IVAL(p.sound.biggoom_speed_limit_p) = 10; - IMIN(p.sound.biggoom_speed_limit_p) = 0; - IMAX(p.sound.biggoom_speed_limit_p) = 100; - ISTEP(p.sound.biggoom_speed_limit_p) = 1; - - p.sound.biggoom_factor_p = secure_i_param("Big Goom Factor"); - IVAL(p.sound.biggoom_factor_p) = 10; - IMIN(p.sound.biggoom_factor_p) = 0; - IMAX(p.sound.biggoom_factor_p) = 100; - ISTEP(p.sound.biggoom_factor_p) = 1; - - p.sound.params = plugin_parameters ("Sound", 11); - - p.nbParams = 0; - p.nbVisuals = nbVisuals; - p.visuals = (VisualFX**)malloc(sizeof(VisualFX*)*nbVisuals); - - *pp = p; - pp->sound.params.params[0] = &pp->sound.biggoom_speed_limit_p; - pp->sound.params.params[1] = &pp->sound.biggoom_factor_p; - pp->sound.params.params[2] = 0; - pp->sound.params.params[3] = &pp->sound.volume_p; - pp->sound.params.params[4] = &pp->sound.accel_p; - pp->sound.params.params[5] = &pp->sound.speed_p; - pp->sound.params.params[6] = 0; - pp->sound.params.params[7] = &pp->sound.goom_limit_p; - pp->sound.params.params[8] = &pp->sound.goom_power_p; - pp->sound.params.params[9] = &pp->sound.last_goom_p; - pp->sound.params.params[10] = &pp->sound.last_biggoom_p; - - pp->statesNumber = 8; - pp->statesRangeMax = 510; - { - GoomState states[8] = { - {1,0,0,1,4, 0, 100}, - {1,0,0,0,1, 101, 140}, - {1,0,0,1,2, 141, 200}, - {0,1,0,1,2, 201, 260}, - {0,1,0,1,0, 261, 330}, - {0,1,1,1,4, 331, 400}, - {0,0,1,0,5, 401, 450}, - {0,0,1,1,1, 451, 510}}; - for (i=0;i<8;++i) - pp->states[i] = states[i]; - } - pp->curGState = &(pp->states[6]); - - /* datas for the update loop */ - pp->update.lockvar = 0; - pp->update.goomvar = 0; - pp->update.loopvar = 0; - pp->update.stop_lines = 0; - pp->update.ifs_incr = 1; /* dessiner l'ifs (0 = non: > = increment) */ - pp->update.decay_ifs = 0; /* disparition de l'ifs */ - pp->update.recay_ifs = 0; /* dedisparition de l'ifs */ - pp->update.cyclesSinceLastChange = 0; - pp->update.drawLinesDuration = 80; - pp->update.lineMode= pp->update.drawLinesDuration; - - pp->update.switchMultAmount = (29.0f/30.0f); - pp->update.switchIncrAmount = 0x7f; - pp->update.switchMult = 1.0f; - pp->update.switchIncr = pp->update.switchIncrAmount; - - pp->update.stateSelectionRnd = 0; - pp->update.stateSelectionBlocker = 0; - pp->update.previousZoomSpeed = 128; - pp->update.timeOfTitleDisplay = 0; - - pp->update_message.affiche = 0; - - { - ZoomFilterData zfd = { - 127, 8, 16, - 1, 1, 0, NORMAL_MODE, - 0, 0, 0, 0, 0 - }; - pp->update.zoomFilterData = zfd; - } - - setOptimizedMethods(pp); - - pp->scanner = gsl_new(); - pp->main_scanner = gsl_new(); - pp->main_script_str = GOOM_MAIN_SCRIPT; - - for (i = 0; i < 0xffff; i++) { - pp->sintable[i] = (int) (1024 * sin ((double) i * 360 / (sizeof (pp->sintable) / sizeof (pp->sintable[0]) - 1) * 3.141592 / 180) + .5); - /* sintable [us] = (int)(1024.0f * sin (us*2*3.31415f/0xffff)) ; */ - } + PluginInfo p; + int i; + + p.sound.cycle = 0; + p.sound.timeSinceLastGoom = 0; + p.sound.goomPower = 0; + p.sound.timeSinceLastBigGoom = 0; + p.sound.volume = 1; + p.sound.bigGoomLimit = 1; + + p.sound.speedvar = p.sound.accelvar = p.sound.totalgoom = 0; + p.sound.prov_max = 0; + p.sound.goom_limit = 1; + p.sound.allTimesMax = 1; + + p.sound.volume_p = secure_f_feedback("Sound Volume"); + p.sound.accel_p = secure_f_feedback("Sound Acceleration"); + p.sound.speed_p = secure_f_feedback("Sound Speed"); + p.sound.goom_limit_p = secure_f_feedback("Goom Limit"); + p.sound.last_goom_p = secure_f_feedback("Goom Detection"); + p.sound.last_biggoom_p = secure_f_feedback("Big Goom Detection"); + p.sound.goom_power_p = secure_f_feedback("Goom Power"); + + p.sound.biggoom_speed_limit_p = secure_i_param("Big Goom Speed Limit"); + IVAL(p.sound.biggoom_speed_limit_p) = 10; + IMIN(p.sound.biggoom_speed_limit_p) = 0; + IMAX(p.sound.biggoom_speed_limit_p) = 100; + ISTEP(p.sound.biggoom_speed_limit_p) = 1; + + p.sound.biggoom_factor_p = secure_i_param("Big Goom Factor"); + IVAL(p.sound.biggoom_factor_p) = 10; + IMIN(p.sound.biggoom_factor_p) = 0; + IMAX(p.sound.biggoom_factor_p) = 100; + ISTEP(p.sound.biggoom_factor_p) = 1; + + p.sound.params = plugin_parameters("Sound", 11); + + p.nbParams = 0; + p.nbVisuals = nbVisuals; + p.visuals = (VisualFX **)malloc(sizeof(VisualFX *) * nbVisuals); + + *pp = p; + pp->sound.params.params[0] = &pp->sound.biggoom_speed_limit_p; + pp->sound.params.params[1] = &pp->sound.biggoom_factor_p; + pp->sound.params.params[2] = 0; + pp->sound.params.params[3] = &pp->sound.volume_p; + pp->sound.params.params[4] = &pp->sound.accel_p; + pp->sound.params.params[5] = &pp->sound.speed_p; + pp->sound.params.params[6] = 0; + pp->sound.params.params[7] = &pp->sound.goom_limit_p; + pp->sound.params.params[8] = &pp->sound.goom_power_p; + pp->sound.params.params[9] = &pp->sound.last_goom_p; + pp->sound.params.params[10] = &pp->sound.last_biggoom_p; + + pp->statesNumber = 8; + pp->statesRangeMax = 510; + { + GoomState states[8] = { + {1, 0, 0, 1, 4, 0, 100}, {1, 0, 0, 0, 1, 101, 140}, + {1, 0, 0, 1, 2, 141, 200}, {0, 1, 0, 1, 2, 201, 260}, + {0, 1, 0, 1, 0, 261, 330}, {0, 1, 1, 1, 4, 331, 400}, + {0, 0, 1, 0, 5, 401, 450}, {0, 0, 1, 1, 1, 451, 510}}; + for (i = 0; i < 8; ++i) + pp->states[i] = states[i]; + } + pp->curGState = &(pp->states[6]); + + /* datas for the update loop */ + pp->update.lockvar = 0; + pp->update.goomvar = 0; + pp->update.loopvar = 0; + pp->update.stop_lines = 0; + pp->update.ifs_incr = 1; /* dessiner l'ifs (0 = non: > = increment) */ + pp->update.decay_ifs = 0; /* disparition de l'ifs */ + pp->update.recay_ifs = 0; /* dedisparition de l'ifs */ + pp->update.cyclesSinceLastChange = 0; + pp->update.drawLinesDuration = 80; + pp->update.lineMode = pp->update.drawLinesDuration; + + pp->update.switchMultAmount = (29.0f / 30.0f); + pp->update.switchIncrAmount = 0x7f; + pp->update.switchMult = 1.0f; + pp->update.switchIncr = pp->update.switchIncrAmount; + + pp->update.stateSelectionRnd = 0; + pp->update.stateSelectionBlocker = 0; + pp->update.previousZoomSpeed = 128; + pp->update.timeOfTitleDisplay = 0; + + pp->update_message.affiche = 0; + + { + ZoomFilterData zfd = {127, 8, 16, 1, 1, 0, NORMAL_MODE, 0, 0, 0, 0, 0}; + pp->update.zoomFilterData = zfd; + } + + setOptimizedMethods(pp); + + pp->scanner = gsl_new(); + pp->main_scanner = gsl_new(); + pp->main_script_str = GOOM_MAIN_SCRIPT; + + for (i = 0; i < 0xffff; i++) { + pp->sintable[i] = + (int)(1024 * sin((double)i * 360 / + (sizeof(pp->sintable) / sizeof(pp->sintable[0]) - 1) * + 3.141592 / 180) + + .5); + /* sintable [us] = (int)(1024.0f * sin (us*2*3.31415f/0xffff)) ; */ + } } void plugin_info_add_visual(PluginInfo *p, int i, VisualFX *visual) { - p->visuals[i] = visual; - if (i == p->nbVisuals-1) { - ++i; - p->nbParams = 1; - while (i--) { - if (p->visuals[i]->params) - p->nbParams++; - } - p->params = (PluginParameters *)malloc(sizeof(PluginParameters)*p->nbParams); - i = p->nbVisuals; - p->nbParams = 1; - p->params[0] = p->sound.params; - while (i--) { - if (p->visuals[i]->params) - p->params[p->nbParams++] = *(p->visuals[i]->params); - } - } + p->visuals[i] = visual; + if (i == p->nbVisuals - 1) { + ++i; + p->nbParams = 1; + while (i--) { + if (p->visuals[i]->params) + p->nbParams++; + } + p->params = + (PluginParameters *)malloc(sizeof(PluginParameters) * p->nbParams); + i = p->nbVisuals; + p->nbParams = 1; + p->params[0] = p->sound.params; + while (i--) { + if (p->visuals[i]->params) + p->params[p->nbParams++] = *(p->visuals[i]->params); + } + } } diff --git a/libvisual-plugins/plugins/actor/goom2k4/ppc_drawings.h b/libvisual-plugins/plugins/actor/goom2k4/ppc_drawings.h index ee438c289..e2d4a912a 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/ppc_drawings.h +++ b/libvisual-plugins/plugins/actor/goom2k4/ppc_drawings.h @@ -15,4 +15,3 @@ void ppc_brightness_G4(Pixel *src, Pixel *dest, int size, int coeff); /* G5 Specific PowerPC Code (Possible use of Altivec) */ void ppc_brightness_G5(Pixel *src, Pixel *dest, int size, int coeff); - diff --git a/libvisual-plugins/plugins/actor/goom2k4/ppc_zoom_ultimate.h b/libvisual-plugins/plugins/actor/goom2k4/ppc_zoom_ultimate.h index d6932e7e6..55e0105b6 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/ppc_zoom_ultimate.h +++ b/libvisual-plugins/plugins/actor/goom2k4/ppc_zoom_ultimate.h @@ -8,7 +8,9 @@ */ /* Generic PowerPC Code */ -void ppc_zoom_generic (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); +void ppc_zoom_generic(int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, + int *brutD, int buffratio, int precalCoef[16][16]); /* G4 Specific PowerPC Code (Possible use of Altivec and Data Streams) */ -void ppc_zoom_G4 (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); \ No newline at end of file +void ppc_zoom_G4(int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, + int *brutD, int buffratio, int precalCoef[16][16]); \ No newline at end of file diff --git a/libvisual-plugins/plugins/actor/goom2k4/sound_tester.c b/libvisual-plugins/plugins/actor/goom2k4/sound_tester.c index 297599a95..8b7274431 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/sound_tester.c +++ b/libvisual-plugins/plugins/actor/goom2k4/sound_tester.c @@ -12,129 +12,129 @@ #define ACCEL_MULT 0.95f #define SPEED_MULT 0.99f - void evaluate_sound(int16_t data[2][512], SoundInfo *info) { - int i; - float difaccel; - float prevspeed; - - /* find the max */ - int incvar = 0; - for (i = 0; i < 512; i+=2) { - if (incvar < data[0][i]) - incvar = data[0][i]; - } - - if (incvar > info->allTimesMax) - info->allTimesMax = incvar; - - /* volume sonore */ - info->volume = (float)incvar / (float)info->allTimesMax; - visual_mem_copy(info->samples[0], data[0], 512 * sizeof(short)); - visual_mem_copy(info->samples[1], data[1], 512 * sizeof(short)); - - difaccel = info->accelvar; - info->accelvar = info->volume; /* accel entre 0 et 1 */ - - /* transformations sur la vitesse du son */ - if (info->speedvar > 1.0f) - info->speedvar = 1.0f; - - if (info->speedvar < 0.1f) - info->accelvar *= (1.0f - (float)info->speedvar); - else if (info->speedvar < 0.3f) - info->accelvar *= (0.9f - (float)(info->speedvar-0.1f)/2.0f); - else - info->accelvar *= (0.8f - (float)(info->speedvar-0.3f)/4.0f); - - /* adoucissement de l'acceleration */ - info->accelvar *= ACCEL_MULT; - if (info->accelvar < 0) - info->accelvar = 0; - - difaccel = info->accelvar - difaccel; - if (difaccel < 0) - difaccel = - difaccel; - - /* mise a jour de la vitesse */ + int i; + float difaccel; + float prevspeed; + + /* find the max */ + int incvar = 0; + for (i = 0; i < 512; i += 2) { + if (incvar < data[0][i]) + incvar = data[0][i]; + } + + if (incvar > info->allTimesMax) + info->allTimesMax = incvar; + + /* volume sonore */ + info->volume = (float)incvar / (float)info->allTimesMax; + visual_mem_copy(info->samples[0], data[0], 512 * sizeof(short)); + visual_mem_copy(info->samples[1], data[1], 512 * sizeof(short)); + + difaccel = info->accelvar; + info->accelvar = info->volume; /* accel entre 0 et 1 */ + + /* transformations sur la vitesse du son */ + if (info->speedvar > 1.0f) + info->speedvar = 1.0f; + + if (info->speedvar < 0.1f) + info->accelvar *= (1.0f - (float)info->speedvar); + else if (info->speedvar < 0.3f) + info->accelvar *= (0.9f - (float)(info->speedvar - 0.1f) / 2.0f); + else + info->accelvar *= (0.8f - (float)(info->speedvar - 0.3f) / 4.0f); + + /* adoucissement de l'acceleration */ + info->accelvar *= ACCEL_MULT; + if (info->accelvar < 0) + info->accelvar = 0; + + difaccel = info->accelvar - difaccel; + if (difaccel < 0) + difaccel = -difaccel; + + /* mise a jour de la vitesse */ prevspeed = info->speedvar; - info->speedvar = (info->speedvar + difaccel * 0.5f) / 2; - info->speedvar *= SPEED_MULT; + info->speedvar = (info->speedvar + difaccel * 0.5f) / 2; + info->speedvar *= SPEED_MULT; info->speedvar = (info->speedvar + 3.0f * prevspeed) / 4.0f; - if (info->speedvar < 0) - info->speedvar = 0; - if (info->speedvar > 1) - info->speedvar = 1; - - /* temps du goom */ - info->timeSinceLastGoom++; - info->timeSinceLastBigGoom++; - info->cycle++; - - /* detection des nouveaux gooms */ - if ((info->speedvar > (float)IVAL(info->biggoom_speed_limit_p)/100.0f) - && (info->accelvar > info->bigGoomLimit) - && (info->timeSinceLastBigGoom > BIG_GOOM_DURATION)) { - info->timeSinceLastBigGoom = 0; - } - - if (info->accelvar > info->goom_limit) { - /* TODO: tester && (info->timeSinceLastGoom > 20)) { */ - info->totalgoom ++; - info->timeSinceLastGoom = 0; - info->goomPower = info->accelvar - info->goom_limit; - } - - if (info->accelvar > info->prov_max) - info->prov_max = info->accelvar; - - if (info->goom_limit>1) - info->goom_limit=1; - - /* toute les 2 secondes : v�rifier si le taux de goom est correct - * et le modifier sinon.. */ - if (info->cycle % 64 == 0) { - if (info->speedvar<0.01f) - info->goom_limit *= 0.91; - if (info->totalgoom > 4) { - info->goom_limit+=0.02; - } - if (info->totalgoom > 7) { - info->goom_limit*=1.03f; - info->goom_limit+=0.03; - } - if (info->totalgoom > 16) { - info->goom_limit*=1.05f; - info->goom_limit+=0.04; - } - if (info->totalgoom == 0) { - info->goom_limit = info->prov_max - 0.02; - } - if ((info->totalgoom == 1) && (info->goom_limit > 0.02)) - info->goom_limit-=0.01; - info->totalgoom = 0; - info->bigGoomLimit = info->goom_limit * (1.0f + (float)IVAL(info->biggoom_factor_p)/500.0f); - info->prov_max = 0; - } - - /* mise a jour des parametres pour la GUI */ - FVAL(info->volume_p) = info->volume; - info->volume_p.change_listener(&info->volume_p); - FVAL(info->speed_p) = info->speedvar * 4; - info->speed_p.change_listener(&info->speed_p); - FVAL(info->accel_p) = info->accelvar; - info->accel_p.change_listener(&info->accel_p); - - FVAL(info->goom_limit_p) = info->goom_limit; - info->goom_limit_p.change_listener(&info->goom_limit_p); - FVAL(info->goom_power_p) = info->goomPower; - info->goom_power_p.change_listener(&info->goom_power_p); - FVAL(info->last_goom_p) = 1.0-((float)info->timeSinceLastGoom/20.0f); - info->last_goom_p.change_listener(&info->last_goom_p); - FVAL(info->last_biggoom_p) = 1.0-((float)info->timeSinceLastBigGoom/40.0f); - info->last_biggoom_p.change_listener(&info->last_biggoom_p); - - /* bigGoomLimit ==goomLimit*9/8+7 ? */ - } - + if (info->speedvar < 0) + info->speedvar = 0; + if (info->speedvar > 1) + info->speedvar = 1; + + /* temps du goom */ + info->timeSinceLastGoom++; + info->timeSinceLastBigGoom++; + info->cycle++; + + /* detection des nouveaux gooms */ + if ((info->speedvar > (float)IVAL(info->biggoom_speed_limit_p) / 100.0f) && + (info->accelvar > info->bigGoomLimit) && + (info->timeSinceLastBigGoom > BIG_GOOM_DURATION)) { + info->timeSinceLastBigGoom = 0; + } + + if (info->accelvar > info->goom_limit) { + /* TODO: tester && (info->timeSinceLastGoom > 20)) { */ + info->totalgoom++; + info->timeSinceLastGoom = 0; + info->goomPower = info->accelvar - info->goom_limit; + } + + if (info->accelvar > info->prov_max) + info->prov_max = info->accelvar; + + if (info->goom_limit > 1) + info->goom_limit = 1; + + /* toute les 2 secondes : v�rifier si le taux de goom est correct + * et le modifier sinon.. */ + if (info->cycle % 64 == 0) { + if (info->speedvar < 0.01f) + info->goom_limit *= 0.91; + if (info->totalgoom > 4) { + info->goom_limit += 0.02; + } + if (info->totalgoom > 7) { + info->goom_limit *= 1.03f; + info->goom_limit += 0.03; + } + if (info->totalgoom > 16) { + info->goom_limit *= 1.05f; + info->goom_limit += 0.04; + } + if (info->totalgoom == 0) { + info->goom_limit = info->prov_max - 0.02; + } + if ((info->totalgoom == 1) && (info->goom_limit > 0.02)) + info->goom_limit -= 0.01; + info->totalgoom = 0; + info->bigGoomLimit = info->goom_limit * + (1.0f + (float)IVAL(info->biggoom_factor_p) / 500.0f); + info->prov_max = 0; + } + + /* mise a jour des parametres pour la GUI */ + FVAL(info->volume_p) = info->volume; + info->volume_p.change_listener(&info->volume_p); + FVAL(info->speed_p) = info->speedvar * 4; + info->speed_p.change_listener(&info->speed_p); + FVAL(info->accel_p) = info->accelvar; + info->accel_p.change_listener(&info->accel_p); + + FVAL(info->goom_limit_p) = info->goom_limit; + info->goom_limit_p.change_listener(&info->goom_limit_p); + FVAL(info->goom_power_p) = info->goomPower; + info->goom_power_p.change_listener(&info->goom_power_p); + FVAL(info->last_goom_p) = 1.0 - ((float)info->timeSinceLastGoom / 20.0f); + info->last_goom_p.change_listener(&info->last_goom_p); + FVAL(info->last_biggoom_p) = + 1.0 - ((float)info->timeSinceLastBigGoom / 40.0f); + info->last_biggoom_p.change_listener(&info->last_biggoom_p); + + /* bigGoomLimit ==goomLimit*9/8+7 ? */ +} diff --git a/libvisual-plugins/plugins/actor/goom2k4/sound_tester.h b/libvisual-plugins/plugins/actor/goom2k4/sound_tester.h index d1fe215b2..ce0ab1b01 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/sound_tester.h +++ b/libvisual-plugins/plugins/actor/goom2k4/sound_tester.h @@ -8,4 +8,3 @@ void evaluate_sound(int16_t data[2][512], SoundInfo *sndInfo); #endif - diff --git a/libvisual-plugins/plugins/actor/goom2k4/surf3d.c b/libvisual-plugins/plugins/actor/goom2k4/surf3d.c index ba8c69094..7a852b6f8 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/surf3d.c +++ b/libvisual-plugins/plugins/actor/goom2k4/surf3d.c @@ -4,104 +4,104 @@ #include #include -grid3d *grid3d_new (int sizex, int defx, int sizez, int defz, v3d center) { - int x = defx; - int y = defz; - grid3d *g = malloc (sizeof(grid3d)); - surf3d *s = &(g->surf); - s->nbvertex = x*y; - s->vertex = malloc (x*y*sizeof(v3d)); - s->svertex = malloc (x*y*sizeof(v3d)); - s->center = center; - - g->defx=defx; - g->sizex=sizex; - g->defz=defz; - g->sizez=sizez; - g->mode=0; - - while (y) { - --y; - x = defx; - while (x) { - --x; - s->vertex[x+defx*y].x = (float)(x-defx/2)*sizex/defx; - s->vertex[x+defx*y].y = 0; - s->vertex[x+defx*y].z = (float)(y-defz/2)*sizez/defz; - } - } - return g; +grid3d *grid3d_new(int sizex, int defx, int sizez, int defz, v3d center) { + int x = defx; + int y = defz; + grid3d *g = malloc(sizeof(grid3d)); + surf3d *s = &(g->surf); + s->nbvertex = x * y; + s->vertex = malloc(x * y * sizeof(v3d)); + s->svertex = malloc(x * y * sizeof(v3d)); + s->center = center; + + g->defx = defx; + g->sizex = sizex; + g->defz = defz; + g->sizez = sizez; + g->mode = 0; + + while (y) { + --y; + x = defx; + while (x) { + --x; + s->vertex[x + defx * y].x = (float)(x - defx / 2) * sizex / defx; + s->vertex[x + defx * y].y = 0; + s->vertex[x + defx * y].z = (float)(y - defz / 2) * sizez / defz; + } + } + return g; } -void grid3d_draw (PluginInfo *plug, grid3d *g, int color, int colorlow, - int dist, Pixel *buf, Pixel *back, int W,int H) { - - int x; - v2d v2,v2x; - - v2d *v2_array = malloc(g->surf.nbvertex * sizeof(v2d)); - v3d_to_v2d(g->surf.svertex, g->surf.nbvertex, W, H, dist, v2_array); - - for (x=0;xdefx;x++) { - int z; - v2x = v2_array[x]; - - for (z=1;zdefz;z++) { - v2 = v2_array[z*g->defx + x]; - if (((v2.x != -666) || (v2.y!=-666)) - && ((v2x.x != -666) || (v2x.y!=-666))) { - plug->methods.draw_line (buf,v2x.x,v2x.y,v2.x,v2.y, colorlow, W, H); - plug->methods.draw_line (back,v2x.x,v2x.y,v2.x,v2.y, color, W, H); - } - v2x = v2; - } - } - - free(v2_array); +void grid3d_draw(PluginInfo *plug, grid3d *g, int color, int colorlow, int dist, + Pixel *buf, Pixel *back, int W, int H) { + + int x; + v2d v2, v2x; + + v2d *v2_array = malloc(g->surf.nbvertex * sizeof(v2d)); + v3d_to_v2d(g->surf.svertex, g->surf.nbvertex, W, H, dist, v2_array); + + for (x = 0; x < g->defx; x++) { + int z; + v2x = v2_array[x]; + + for (z = 1; z < g->defz; z++) { + v2 = v2_array[z * g->defx + x]; + if (((v2.x != -666) || (v2.y != -666)) && + ((v2x.x != -666) || (v2x.y != -666))) { + plug->methods.draw_line(buf, v2x.x, v2x.y, v2.x, v2.y, colorlow, W, H); + plug->methods.draw_line(back, v2x.x, v2x.y, v2.x, v2.y, color, W, H); + } + v2x = v2; + } + } + + free(v2_array); } -void surf3d_rotate (surf3d *s, float angle) { - int i; - float cosa; - float sina; - SINCOS(angle,sina,cosa); - for (i=0;inbvertex;i++) { - Y_ROTATE_V3D(s->vertex[i],s->svertex[i],cosa,sina); - } +void surf3d_rotate(surf3d *s, float angle) { + int i; + float cosa; + float sina; + SINCOS(angle, sina, cosa); + for (i = 0; i < s->nbvertex; i++) { + Y_ROTATE_V3D(s->vertex[i], s->svertex[i], cosa, sina); + } } -void surf3d_translate (surf3d *s) { - int i; - for (i=0;inbvertex;i++) { - TRANSLATE_V3D(s->center,s->svertex[i]); - } +void surf3d_translate(surf3d *s) { + int i; + for (i = 0; i < s->nbvertex; i++) { + TRANSLATE_V3D(s->center, s->svertex[i]); + } } -void grid3d_update (grid3d *g, float angle, float *vals, float dist) { - int i; - float cosa; - float sina; - surf3d *s = &(g->surf); - v3d cam = s->center; - cam.z += dist; - - SINCOS((angle/4.3f),sina,cosa); - cam.y += sina*2.0f; - SINCOS(angle,sina,cosa); - - if (g->mode==0) { - if (vals) - for (i=0;idefx;i++) - s->vertex[i].y = s->vertex[i].y*0.2 + vals[i]*0.8; - - for (i=g->defx;inbvertex;i++) { - s->vertex[i].y *= 0.255f; - s->vertex[i].y += (s->vertex[i-g->defx].y * 0.777f); - } - } - - for (i=0;inbvertex;i++) { - Y_ROTATE_V3D(s->vertex[i],s->svertex[i],cosa,sina); - TRANSLATE_V3D(cam,s->svertex[i]); - } +void grid3d_update(grid3d *g, float angle, float *vals, float dist) { + int i; + float cosa; + float sina; + surf3d *s = &(g->surf); + v3d cam = s->center; + cam.z += dist; + + SINCOS((angle / 4.3f), sina, cosa); + cam.y += sina * 2.0f; + SINCOS(angle, sina, cosa); + + if (g->mode == 0) { + if (vals) + for (i = 0; i < g->defx; i++) + s->vertex[i].y = s->vertex[i].y * 0.2 + vals[i] * 0.8; + + for (i = g->defx; i < s->nbvertex; i++) { + s->vertex[i].y *= 0.255f; + s->vertex[i].y += (s->vertex[i - g->defx].y * 0.777f); + } + } + + for (i = 0; i < s->nbvertex; i++) { + Y_ROTATE_V3D(s->vertex[i], s->svertex[i], cosa, sina); + TRANSLATE_V3D(cam, s->svertex[i]); + } } diff --git a/libvisual-plugins/plugins/actor/goom2k4/surf3d.h b/libvisual-plugins/plugins/actor/goom2k4/surf3d.h index 482b6a090..b3093b01c 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/surf3d.h +++ b/libvisual-plugins/plugins/actor/goom2k4/surf3d.h @@ -6,33 +6,35 @@ #include "goom_typedefs.h" typedef struct { - v3d *vertex; - v3d *svertex; - int nbvertex; + v3d *vertex; + v3d *svertex; + int nbvertex; - v3d center; + v3d center; } surf3d; typedef struct { - surf3d surf; - - int defx; - int sizex; - int defz; - int sizez; - int mode; + surf3d surf; + + int defx; + int sizex; + int defz; + int sizez; + int mode; } grid3d; /* hi-level */ /* works on grid3d */ -grid3d *grid3d_new (int sizex, int defx, int sizez, int defz, v3d center); -void grid3d_update (grid3d *s, float angle, float *vals, float dist); +grid3d *grid3d_new(int sizex, int defx, int sizez, int defz, v3d center); +void grid3d_update(grid3d *s, float angle, float *vals, float dist); /* low level */ -void surf3d_draw (surf3d *s, int color, int dist, int *buf, int *back, int W,int H); -void grid3d_draw (PluginInfo *plug, grid3d *g, int color, int colorlow, int dist, Pixel *buf, Pixel *back, int W,int H); -void surf3d_rotate (surf3d *s, float angle); -void surf3d_translate (surf3d *s); +void surf3d_draw(surf3d *s, int color, int dist, int *buf, int *back, int W, + int H); +void grid3d_draw(PluginInfo *plug, grid3d *g, int color, int colorlow, int dist, + Pixel *buf, Pixel *back, int W, int H); +void surf3d_rotate(surf3d *s, float angle); +void surf3d_translate(surf3d *s); #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/tentacle3d.c b/libvisual-plugins/plugins/actor/goom2k4/tentacle3d.c index 3e85ae8e1..d6ee5b58d 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/tentacle3d.c +++ b/libvisual-plugins/plugins/actor/goom2k4/tentacle3d.c @@ -16,73 +16,79 @@ #define definitionz 45 typedef struct _TENTACLE_FX_DATA { - PluginParam enabled_bp; - PluginParameters params; + PluginParam enabled_bp; + PluginParameters params; - float cycle; - grid3d *grille[nbgrid]; - float *vals; + float cycle; + grid3d *grille[nbgrid]; + float *vals; #define NB_TENTACLE_COLORS 4 - int colors[NB_TENTACLE_COLORS]; - - int col; - int dstcol; - float lig; - float ligs; - - /* statics from pretty_move */ - float distt; - float distt2; - float rot; /* entre 0 et 2 * M_PI */ - int happens; - int rotation; - int lock; + int colors[NB_TENTACLE_COLORS]; + + int col; + int dstcol; + float lig; + float ligs; + + /* statics from pretty_move */ + float distt; + float distt2; + float rot; /* entre 0 et 2 * M_PI */ + int happens; + int rotation; + int lock; } TentacleFXData; -static void tentacle_new (TentacleFXData *data); -static void tentacle_update(PluginInfo *goomInfo, Pixel *buf, Pixel *back, int W, int H, - short[2][512], float, int drawit, TentacleFXData *data); -static void tentacle_free (TentacleFXData *data); +static void tentacle_new(TentacleFXData *data); +static void tentacle_update(PluginInfo *goomInfo, Pixel *buf, Pixel *back, + int W, int H, short[2][512], float, int drawit, + TentacleFXData *data); +static void tentacle_free(TentacleFXData *data); -/* +/* * VisualFX wrapper for the tentacles */ static void tentacle_fx_init(VisualFX *_this, PluginInfo *info) { - - TentacleFXData *data = (TentacleFXData*)malloc(sizeof(TentacleFXData)); - - data->enabled_bp = secure_b_param("Enabled", 1); - data->params = plugin_parameters ("3D Tentacles", 1); - data->params.params[0] = &data->enabled_bp; - - data->cycle = 0.0f; - data->col = (0x28<<(ROUGE*8))|(0x2c<<(VERT*8))|(0x5f<<(BLEU*8)); - data->dstcol = 0; - data->lig = 1.15f; - data->ligs = 0.1f; - - data->distt = 10.0f; - data->distt2 = 0.0f; - data->rot = 0.0f; /* entre 0 et 2 * M_PI */ - data->happens = 0; - - data->rotation = 0; - data->lock = 0; - data->colors[0] = (0x18<<(ROUGE*8))|(0x4c<<(VERT*8))|(0x2f<<(BLEU*8)); - data->colors[1] = (0x48<<(ROUGE*8))|(0x2c<<(VERT*8))|(0x6f<<(BLEU*8)); - data->colors[2] = (0x58<<(ROUGE*8))|(0x3c<<(VERT*8))|(0x0f<<(BLEU*8)); - data->colors[3] = (0x87<<(ROUGE*8))|(0x55<<(VERT*8))|(0x74<<(BLEU*8)); - tentacle_new(data); - - _this->params = &data->params; - _this->fx_data = (void*)data; + + TentacleFXData *data = (TentacleFXData *)malloc(sizeof(TentacleFXData)); + + data->enabled_bp = secure_b_param("Enabled", 1); + data->params = plugin_parameters("3D Tentacles", 1); + data->params.params[0] = &data->enabled_bp; + + data->cycle = 0.0f; + data->col = + (0x28 << (ROUGE * 8)) | (0x2c << (VERT * 8)) | (0x5f << (BLEU * 8)); + data->dstcol = 0; + data->lig = 1.15f; + data->ligs = 0.1f; + + data->distt = 10.0f; + data->distt2 = 0.0f; + data->rot = 0.0f; /* entre 0 et 2 * M_PI */ + data->happens = 0; + + data->rotation = 0; + data->lock = 0; + data->colors[0] = + (0x18 << (ROUGE * 8)) | (0x4c << (VERT * 8)) | (0x2f << (BLEU * 8)); + data->colors[1] = + (0x48 << (ROUGE * 8)) | (0x2c << (VERT * 8)) | (0x6f << (BLEU * 8)); + data->colors[2] = + (0x58 << (ROUGE * 8)) | (0x3c << (VERT * 8)) | (0x0f << (BLEU * 8)); + data->colors[3] = + (0x87 << (ROUGE * 8)) | (0x55 << (VERT * 8)) | (0x74 << (BLEU * 8)); + tentacle_new(data); + + _this->params = &data->params; + _this->fx_data = (void *)data; } -static void tentacle_fx_apply(VisualFX *_this, Pixel *src, Pixel *dest, PluginInfo *goomInfo) -{ - TentacleFXData *data = (TentacleFXData*)_this->fx_data; +static void tentacle_fx_apply(VisualFX *_this, Pixel *src, Pixel *dest, + PluginInfo *goomInfo) { + TentacleFXData *data = (TentacleFXData *)_this->fx_data; if (BVAL(data->enabled_bp)) { tentacle_update(goomInfo, dest, src, goomInfo->screen.width, goomInfo->screen.height, goomInfo->sound.samples, @@ -92,201 +98,210 @@ static void tentacle_fx_apply(VisualFX *_this, Pixel *src, Pixel *dest, PluginIn } static void tentacle_fx_free(VisualFX *_this) { - tentacle_free((TentacleFXData*)_this->fx_data); - free(_this->fx_data); + tentacle_free((TentacleFXData *)_this->fx_data); + free(_this->fx_data); } VisualFX tentacle_fx_create(void) { - VisualFX fx; - fx.init = tentacle_fx_init; - fx.apply = tentacle_fx_apply; - fx.free = tentacle_fx_free; - return fx; + VisualFX fx; + fx.init = tentacle_fx_init; + fx.apply = tentacle_fx_apply; + fx.free = tentacle_fx_free; + return fx; } /* ----- */ -static void tentacle_free (TentacleFXData *data) { - /* TODO : un vrai FREE GRID!! */ - free (data->vals); +static void tentacle_free(TentacleFXData *data) { + /* TODO : un vrai FREE GRID!! */ + free(data->vals); } -static void tentacle_new (TentacleFXData *data) { - int tmp; +static void tentacle_new(TentacleFXData *data) { + int tmp; - v3d center = {0,-17.0,0}; - data->vals = (float*)malloc ((definitionx+20)*sizeof(float)); + v3d center = {0, -17.0, 0}; + data->vals = (float *)malloc((definitionx + 20) * sizeof(float)); - for (tmp=0;tmpgrille[tmp] = grid3d_new (x, definitionx, z, definitionz + visual_rand() % 10, center); - center.y += 8; - } + for (tmp = 0; tmp < nbgrid; tmp++) { + int x, z; + z = 45 + visual_rand() % 30; + x = 85 + visual_rand() % 5; + center.z = z; + data->grille[tmp] = + grid3d_new(x, definitionx, z, definitionz + visual_rand() % 10, center); + center.y += 8; + } } -static inline unsigned char lighten (unsigned char value, float power) -{ - int val = value; - float t = (float) val * log10(power) / 2.0; - - if (t > 0) { - val = (int) t; /* (32.0f * log (t)); */ - if (val > 255) - val = 255; - if (val < 0) - val = 0; - return val; - } - else { - return 0; - } +static inline unsigned char lighten(unsigned char value, float power) { + int val = value; + float t = (float)val * log10(power) / 2.0; + + if (t > 0) { + val = (int)t; /* (32.0f * log (t)); */ + if (val > 255) + val = 255; + if (val < 0) + val = 0; + return val; + } else { + return 0; + } } -static void lightencolor (int *col, float power) -{ - unsigned char *color; - - color = (unsigned char *) col; - *color = lighten (*color, power); - color++; - *color = lighten (*color, power); - color++; - *color = lighten (*color, power); - color++; - *color = lighten (*color, power); +static void lightencolor(int *col, float power) { + unsigned char *color; + + color = (unsigned char *)col; + *color = lighten(*color, power); + color++; + *color = lighten(*color, power); + color++; + *color = lighten(*color, power); + color++; + *color = lighten(*color, power); } /* retourne x>>s , en testant le signe de x */ -#define ShiftRight(_x,_s) ((_x<0) ? -(-_x>>_s) : (_x>>_s)) - -static int evolutecolor (unsigned int src,unsigned int dest, - unsigned int mask, unsigned int incr) { - - int color = src & (~mask); - src &= mask; - dest &= mask; - - if ((src!=mask) - &&(srcdest) - src -= incr; - return (src&mask)|color; +#define ShiftRight(_x, _s) ((_x < 0) ? -(-_x >> _s) : (_x >> _s)) + +static int evolutecolor(unsigned int src, unsigned int dest, unsigned int mask, + unsigned int incr) { + + int color = src & (~mask); + src &= mask; + dest &= mask; + + if ((src != mask) && (src < dest)) + src += incr; + + if (src > dest) + src -= incr; + return (src & mask) | color; } -static void pretty_move (PluginInfo *goomInfo, float cycle, float *dist, float *dist2, float *rotangle, TentacleFXData *fx_data) { - - float tmp; - - /* many magic numbers here... I don't really like that. */ - if (fx_data->happens) - fx_data->happens -= 1; - else if (fx_data->lock == 0) { - fx_data->happens = goom_irand(goomInfo->gRandom,200)?0:100+goom_irand(goomInfo->gRandom,60); - fx_data->lock = fx_data->happens * 3 / 2; - } - else fx_data->lock --; - - tmp = fx_data->happens?8.0f:0; - *dist2 = fx_data->distt2 = (tmp + 15.0f*fx_data->distt2)/16.0f; - - tmp = 30+D-90.0f*(1.0f+sin(cycle*19/20)); - if (fx_data->happens) - tmp *= 0.6f; - - *dist = fx_data->distt = (tmp + 3.0f*fx_data->distt)/4.0f; - - if (!fx_data->happens){ - tmp = M_PI*sin(cycle)/32+3*M_PI/2; - } - else { - fx_data->rotation = goom_irand(goomInfo->gRandom,500)?fx_data->rotation:goom_irand(goomInfo->gRandom,2); - if (fx_data->rotation) - cycle *= 2.0f*M_PI; - else - cycle *= -1.0f*M_PI; - tmp = cycle - (M_PI*2.0) * floor(cycle/(M_PI*2.0)); - } - - if (fabs(tmp-fx_data->rot) > fabs(tmp-(fx_data->rot+2.0*M_PI))) { - fx_data->rot = (tmp + 15.0f*(fx_data->rot+2*M_PI)) / 16.0f; - if (fx_data->rot>2.0*M_PI) - fx_data->rot -= 2.0*M_PI; - *rotangle = fx_data->rot; - } - else if (fabs(tmp-fx_data->rot) > fabs(tmp-(fx_data->rot-2.0*M_PI))) { - fx_data->rot = (tmp + 15.0f*(fx_data->rot-2.0*M_PI)) / 16.0f; - if (fx_data->rot<0.0f) - fx_data->rot += 2.0*M_PI; - *rotangle = fx_data->rot; - } - else - *rotangle = fx_data->rot = (tmp + 15.0f*fx_data->rot) / 16.0f; +static void pretty_move(PluginInfo *goomInfo, float cycle, float *dist, + float *dist2, float *rotangle, + TentacleFXData *fx_data) { + + float tmp; + + /* many magic numbers here... I don't really like that. */ + if (fx_data->happens) + fx_data->happens -= 1; + else if (fx_data->lock == 0) { + fx_data->happens = goom_irand(goomInfo->gRandom, 200) + ? 0 + : 100 + goom_irand(goomInfo->gRandom, 60); + fx_data->lock = fx_data->happens * 3 / 2; + } else + fx_data->lock--; + + tmp = fx_data->happens ? 8.0f : 0; + *dist2 = fx_data->distt2 = (tmp + 15.0f * fx_data->distt2) / 16.0f; + + tmp = 30 + D - 90.0f * (1.0f + sin(cycle * 19 / 20)); + if (fx_data->happens) + tmp *= 0.6f; + + *dist = fx_data->distt = (tmp + 3.0f * fx_data->distt) / 4.0f; + + if (!fx_data->happens) { + tmp = M_PI * sin(cycle) / 32 + 3 * M_PI / 2; + } else { + fx_data->rotation = goom_irand(goomInfo->gRandom, 500) + ? fx_data->rotation + : goom_irand(goomInfo->gRandom, 2); + if (fx_data->rotation) + cycle *= 2.0f * M_PI; + else + cycle *= -1.0f * M_PI; + tmp = cycle - (M_PI * 2.0) * floor(cycle / (M_PI * 2.0)); + } + + if (fabs(tmp - fx_data->rot) > fabs(tmp - (fx_data->rot + 2.0 * M_PI))) { + fx_data->rot = (tmp + 15.0f * (fx_data->rot + 2 * M_PI)) / 16.0f; + if (fx_data->rot > 2.0 * M_PI) + fx_data->rot -= 2.0 * M_PI; + *rotangle = fx_data->rot; + } else if (fabs(tmp - fx_data->rot) > + fabs(tmp - (fx_data->rot - 2.0 * M_PI))) { + fx_data->rot = (tmp + 15.0f * (fx_data->rot - 2.0 * M_PI)) / 16.0f; + if (fx_data->rot < 0.0f) + fx_data->rot += 2.0 * M_PI; + *rotangle = fx_data->rot; + } else + *rotangle = fx_data->rot = (tmp + 15.0f * fx_data->rot) / 16.0f; } -static void tentacle_update(PluginInfo *goomInfo, Pixel *buf, Pixel *back, int W, int H, - short data[2][512], float rapport, int drawit, TentacleFXData *fx_data) { - - int tmp; - int tmp2; - - int color; - int colorlow; - - float dist,dist2,rotangle; - - if ((!drawit) && (fx_data->ligs>0.0f)) - fx_data->ligs = -fx_data->ligs; - - fx_data->lig += fx_data->ligs; - - if (fx_data->lig > 1.01f) { - if ((fx_data->lig>10.0f) | (fx_data->lig<1.1f)) fx_data->ligs = -fx_data->ligs; - - if ((fx_data->lig<6.3f)&&(goom_irand(goomInfo->gRandom,30)==0)) - fx_data->dstcol=goom_irand(goomInfo->gRandom,NB_TENTACLE_COLORS); - - fx_data->col = evolutecolor(fx_data->col,fx_data->colors[fx_data->dstcol],0xff,0x01); - fx_data->col = evolutecolor(fx_data->col,fx_data->colors[fx_data->dstcol],0xff00,0x0100); - fx_data->col = evolutecolor(fx_data->col,fx_data->colors[fx_data->dstcol],0xff0000,0x010000); - fx_data->col = evolutecolor(fx_data->col,fx_data->colors[fx_data->dstcol],0xff000000,0x01000000); - - color = fx_data->col; - colorlow = fx_data->col; - - lightencolor(&color,fx_data->lig * 2.0f + 2.0f); - lightencolor(&colorlow,(fx_data->lig/3.0f)+0.67f); - - rapport = 1.0f + 2.0f * (rapport - 1.0f); - rapport *= 1.2f; - if (rapport > 1.12f) - rapport = 1.12f; - - pretty_move (goomInfo, fx_data->cycle, &dist, &dist2, &rotangle, fx_data); - - for (tmp=0;tmpgRandom,511)],10)) * rapport; - fx_data->vals[tmp2] = val; - } - - grid3d_update (fx_data->grille[tmp], rotangle, fx_data->vals, dist2); - } - fx_data->cycle+=0.01f; - for (tmp=0;tmpgrille[tmp],color,colorlow,dist,buf,back,W,H); - } - else { - fx_data->lig = 1.05f; - if (fx_data->ligs < 0.0f) - fx_data->ligs = -fx_data->ligs; - pretty_move (goomInfo, fx_data->cycle, &dist, &dist2, &rotangle, fx_data); - fx_data->cycle+=0.1f; - if (fx_data->cycle > 1000) - fx_data->cycle = 0; - } +static void tentacle_update(PluginInfo *goomInfo, Pixel *buf, Pixel *back, + int W, int H, short data[2][512], float rapport, + int drawit, TentacleFXData *fx_data) { + + int tmp; + int tmp2; + + int color; + int colorlow; + + float dist, dist2, rotangle; + + if ((!drawit) && (fx_data->ligs > 0.0f)) + fx_data->ligs = -fx_data->ligs; + + fx_data->lig += fx_data->ligs; + + if (fx_data->lig > 1.01f) { + if ((fx_data->lig > 10.0f) | (fx_data->lig < 1.1f)) + fx_data->ligs = -fx_data->ligs; + + if ((fx_data->lig < 6.3f) && (goom_irand(goomInfo->gRandom, 30) == 0)) + fx_data->dstcol = goom_irand(goomInfo->gRandom, NB_TENTACLE_COLORS); + + fx_data->col = evolutecolor(fx_data->col, fx_data->colors[fx_data->dstcol], + 0xff, 0x01); + fx_data->col = evolutecolor(fx_data->col, fx_data->colors[fx_data->dstcol], + 0xff00, 0x0100); + fx_data->col = evolutecolor(fx_data->col, fx_data->colors[fx_data->dstcol], + 0xff0000, 0x010000); + fx_data->col = evolutecolor(fx_data->col, fx_data->colors[fx_data->dstcol], + 0xff000000, 0x01000000); + + color = fx_data->col; + colorlow = fx_data->col; + + lightencolor(&color, fx_data->lig * 2.0f + 2.0f); + lightencolor(&colorlow, (fx_data->lig / 3.0f) + 0.67f); + + rapport = 1.0f + 2.0f * (rapport - 1.0f); + rapport *= 1.2f; + if (rapport > 1.12f) + rapport = 1.12f; + + pretty_move(goomInfo, fx_data->cycle, &dist, &dist2, &rotangle, fx_data); + + for (tmp = 0; tmp < nbgrid; tmp++) { + for (tmp2 = 0; tmp2 < definitionx; tmp2++) { + float val = (float)(ShiftRight( + data[0][goom_irand(goomInfo->gRandom, 511)], 10)) * + rapport; + fx_data->vals[tmp2] = val; + } + + grid3d_update(fx_data->grille[tmp], rotangle, fx_data->vals, dist2); + } + fx_data->cycle += 0.01f; + for (tmp = 0; tmp < nbgrid; tmp++) + grid3d_draw(goomInfo, fx_data->grille[tmp], color, colorlow, dist, buf, + back, W, H); + } else { + fx_data->lig = 1.05f; + if (fx_data->ligs < 0.0f) + fx_data->ligs = -fx_data->ligs; + pretty_move(goomInfo, fx_data->cycle, &dist, &dist2, &rotangle, fx_data); + fx_data->cycle += 0.1f; + if (fx_data->cycle > 1000) + fx_data->cycle = 0; + } } diff --git a/libvisual-plugins/plugins/actor/goom2k4/v3d.c b/libvisual-plugins/plugins/actor/goom2k4/v3d.c index 1614e8afd..1a515cef0 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/v3d.c +++ b/libvisual-plugins/plugins/actor/goom2k4/v3d.c @@ -1,15 +1,16 @@ #include "v3d.h" -void v3d_to_v2d(v3d *v3, int nbvertex, int width, int height, float distance, v2d *v2) { - int i; - for (i=0;i 2) { - int Xp, Yp; - F2I((distance * v3[i].x / v3[i].z),Xp); - F2I((distance * v3[i].y / v3[i].z),Yp); - v2[i].x = Xp + (width>>1); - v2[i].y = -Yp + (height>>1); - } - else v2[i].x=v2[i].y=-666; - } +void v3d_to_v2d(v3d *v3, int nbvertex, int width, int height, float distance, + v2d *v2) { + int i; + for (i = 0; i < nbvertex; ++i) { + if (v3[i].z > 2) { + int Xp, Yp; + F2I((distance * v3[i].x / v3[i].z), Xp); + F2I((distance * v3[i].y / v3[i].z), Yp); + v2[i].x = Xp + (width >> 1); + v2[i].y = -Yp + (height >> 1); + } else + v2[i].x = v2[i].y = -666; + } } diff --git a/libvisual-plugins/plugins/actor/goom2k4/v3d.h b/libvisual-plugins/plugins/actor/goom2k4/v3d.h index 7690847f2..cc6b47b18 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/v3d.h +++ b/libvisual-plugins/plugins/actor/goom2k4/v3d.h @@ -8,58 +8,64 @@ #include "mathtools.h" typedef struct { - float x,y,z; + float x, y, z; } v3d; typedef struct { - int x,y; + int x, y; } v2d; typedef struct { - double x,y; + double x, y; } v2g; -/* +/* * projete le vertex 3D sur le plan d'affichage * retourne (0,0) si le point ne doit pas etre affiche. * * bonne valeur pour distance : 256 */ -#define V3D_TO_V2D(v3,v2,width,height,distance) \ -{ \ - int Xp, Yp; \ - if (v3.z > 2) { \ - F2I((distance * v3.x / v3.z),Xp) ; \ - F2I((distance * v3.y / v3.z),Yp) ; \ - v2.x = Xp + (width>>1); \ - v2.y = -Yp + (height>>1); \ - } \ - else v2.x=v2.y=-666; \ -} +#define V3D_TO_V2D(v3, v2, width, height, distance) \ + { \ + int Xp, Yp; \ + if (v3.z > 2) { \ + F2I((distance * v3.x / v3.z), Xp); \ + F2I((distance * v3.y / v3.z), Yp); \ + v2.x = Xp + (width >> 1); \ + v2.y = -Yp + (height >> 1); \ + } else \ + v2.x = v2.y = -666; \ + } -void v3d_to_v2d(v3d *src, int nbvertex, int width, int height, float distance, v2d *v2_array); +void v3d_to_v2d(v3d *src, int nbvertex, int width, int height, float distance, + v2d *v2_array); /* * rotation selon Y du v3d vi d'angle a (cosa=cos(a), sina=sin(a)) * centerz = centre de rotation en z */ -#define Y_ROTATE_V3D(vi,vf,sina,cosa)\ -{\ - vf.x = vi.x * cosa - vi.z * sina;\ - vf.z = vi.x * sina + vi.z * cosa;\ - vf.y = vi.y;\ -} +#define Y_ROTATE_V3D(vi, vf, sina, cosa) \ + { \ + vf.x = vi.x * cosa - vi.z * sina; \ + vf.z = vi.x * sina + vi.z * cosa; \ + vf.y = vi.y; \ + } /* * translation */ -#define TRANSLATE_V3D(vsrc,vdest)\ -{\ - vdest.x += vsrc.x;\ - vdest.y += vsrc.y;\ - vdest.z += vsrc.z;\ -} +#define TRANSLATE_V3D(vsrc, vdest) \ + { \ + vdest.x += vsrc.x; \ + vdest.y += vsrc.y; \ + vdest.z += vsrc.z; \ + } -#define MUL_V3D(lf,v) {v.x*=lf;v.y*=lf;v.z*=lf;} +#define MUL_V3D(lf, v) \ + { \ + v.x *= lf; \ + v.y *= lf; \ + v.z *= lf; \ + } #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/xmmx.c b/libvisual-plugins/plugins/actor/goom2k4/xmmx.c index 9c97b1ed4..7a2ff7450 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/xmmx.c +++ b/libvisual-plugins/plugins/actor/goom2k4/xmmx.c @@ -16,378 +16,367 @@ /* faire : a / sqrtperte <=> a >> PERTEDEC*/ #define PERTEDEC 4 - /*#define MMX_TRACE*/ #include "mmx.h" /*#include "xmmx.h"*/ #include "goom_graphic.h" -int xmmx_supported (void) { - return (mm_support()&0x8)>>3; -} - -void zoom_filter_xmmx (int prevX, int prevY, - Pixel *expix1, Pixel *expix2, - int *lbruS, int *lbruD, int buffratio, - int precalCoef[16][16]) -{ - int bufsize = prevX * prevY; /* taille du buffer */ - volatile int loop; /* variable de boucle */ - - mmx_t *brutS = (mmx_t*)lbruS; /* buffer de transformation source */ - mmx_t *brutD = (mmx_t*)lbruD; /* buffer de transformation dest */ - - volatile mmx_t prevXY; - volatile mmx_t ratiox; - /* volatile mmx_t interpix; */ - - expix1[0].val=expix1[prevX-1].val=expix1[prevX*prevY-1].val=expix1[prevX*prevY-prevX].val=0; - - prevXY.ud[0] = (prevX-1)<> 16 */ - - "#1 \n\t paddd %%mm1, %%mm0" /* mm0 = S + mm1 */ - "#1 \n\t psrld $16, %%mm0" - : - : [brutS]"g"(brutS[loop]) - , [brutD]"g"(brutD[loop]) - ); /* mm0 = S */ - - /* - * pre : mm0 : position vector on screen - * prevXY : coordinate of the lower-right point on screen - * post : clipped mm0 - * modified : mm0,mm1,mm2 - */ - asm volatile - ("#1 \n\t movq %[prevXY], %%mm1" - "#1 \n\t pcmpgtd %%mm0, %%mm1" - /* mm0 en X contient (idem pour Y) : - * 1111 si prevXY > px - * 0000 si prevXY <= px */ +int xmmx_supported(void) { return (mm_support() & 0x8) >> 3; } + +void zoom_filter_xmmx(int prevX, int prevY, Pixel *expix1, Pixel *expix2, + int *lbruS, int *lbruD, int buffratio, + int precalCoef[16][16]) { + int bufsize = prevX * prevY; /* taille du buffer */ + volatile int loop; /* variable de boucle */ + + mmx_t *brutS = (mmx_t *)lbruS; /* buffer de transformation source */ + mmx_t *brutD = (mmx_t *)lbruD; /* buffer de transformation dest */ + + volatile mmx_t prevXY; + volatile mmx_t ratiox; + /* volatile mmx_t interpix; */ + + expix1[0].val = expix1[prevX - 1].val = expix1[prevX * prevY - 1].val = + expix1[prevX * prevY - prevX].val = 0; + + prevXY.ud[0] = (prevX - 1) << PERTEDEC; + prevXY.ud[1] = (prevY - 1) << PERTEDEC; + + ratiox.d[0] = buffratio; + ratiox.d[1] = buffratio; + + asm volatile("\n\t movq %[ratio], %%mm6" + "\n\t pslld $16, %%mm6" /* mm6 = [rat16=buffratio<<16 | + rat16=buffratio<<16] */ + "\n\t pxor %%mm7, %%mm7" /* mm7 = 0 */ + ::[ratio] "m"(ratiox)); + + loop = 0; + + /* + * NOTE : mm6 et mm7 ne sont pas modifies dans la boucle. + */ + while (loop < bufsize) { + /* Thread #1 + * pre : mm6 = [rat16|rat16] + * post : mm0 = S + ((D-S)*rat16 format [X|Y] + * modified = mm0,mm1,mm2 + */ + + asm volatile( + "#1 \n\t movq %[brutS], %%mm0" + "#1 \n\t movq %[brutD], %%mm1" + "#1 \n\t psubd %%mm0, %%mm1" /* mm1 = D - S */ + "#1 \n\t movq %%mm1, %%mm2" /* mm2 = D - S */ + "#1 \n\t pslld $16, %%mm1" + "#1 \n\t pmullw %%mm6, %%mm2" + "#1 \n\t pmulhuw %%mm6, %%mm1" + + "#1 \n\t pslld $16, %%mm0" + "#1 \n\t paddd %%mm2, %%mm1" /* mm1 = (D - S) * buffratio >> 16 */ + + "#1 \n\t paddd %%mm1, %%mm0" /* mm0 = S + mm1 */ + "#1 \n\t psrld $16, %%mm0" + : + : [brutS] "g"(brutS[loop]), [brutD] "g"(brutD[loop])); /* mm0 = S */ + + /* + * pre : mm0 : position vector on screen + * prevXY : coordinate of the lower-right point on screen + * post : clipped mm0 + * modified : mm0,mm1,mm2 + */ + asm volatile( + "#1 \n\t movq %[prevXY], %%mm1" + "#1 \n\t pcmpgtd %%mm0, %%mm1" + /* mm0 en X contient (idem pour Y) : + * 1111 si prevXY > px + * 0000 si prevXY <= px */ #ifdef STRICT_COMPAT - "#1 \n\t movq %%mm1, %%mm2" - "#1 \n\t punpckhdq %%mm2, %%mm2" - "#1 \n\t punpckldq %%mm1, %%mm1" - "#1 \n\t pand %%mm2, %%mm0" + "#1 \n\t movq %%mm1, %%mm2" + "#1 \n\t punpckhdq %%mm2, %%mm2" + "#1 \n\t punpckldq %%mm1, %%mm1" + "#1 \n\t pand %%mm2, %%mm0" #endif - "#1 \n\t pand %%mm1, %%mm0" /* on met a zero la partie qui deborde */ - ::[prevXY]"m"(prevXY)); - - /* Thread #2 - * pre : mm0 : clipped position on screen - * - * post : mm3 : coefs for this position - * mm1 : X vector [0|X] - * - * modif : eax,esi - */ - __asm__ __volatile__ ( - "#2 \n\t movd %%mm0,%%esi" - "#2 \n\t movq %%mm0,%%mm1" - - "#2 \n\t andl $15,%%esi" - "#2 \n\t psrlq $32,%%mm1" - - "#2 \n\t shll $6,%%esi" - "#2 \n\t movd %%mm1,%%eax" - - "#2 \n\t addl %[precalCoef],%%esi" - "#2 \n\t andl $15,%%eax" - - "#2 \n\t movd (%%esi,%%eax,4),%%mm3" - ::[precalCoef]"g"(precalCoef):"eax","esi"); - - /* - * extraction des coefficients... (Thread #3) - * - * pre : coef dans mm3 - * - * post : coef extraits dans mm3 (c1 & c2) - * et mm4 (c3 & c4) - * - * modif : mm5 - */ - - /* (Thread #4) - * pre : mm0 : Y pos [*|Y] - * mm1 : X pos [*|X] - * - * post : mm0 : expix1[position] - * mm2 : expix1[position+largeur] - * - * modif : eax, esi - */ - __asm__ __volatile__ ( - "#2 \n\t psrld $4, %%mm0" - "#2 \n\t psrld $4, %%mm1" /* PERTEDEC = $4 */ - - "#4 \n\t movd %%mm1,%%eax" - "#3 \n\t movq %%mm3,%%mm5" - - "#4 \n\t mull %[prevX]" - "#4 \n\t movd %%mm0,%%esi" - - "#3 \n\t punpcklbw %%mm5, %%mm3" - "#4 \n\t addl %%esi, %%eax" - - "#3 \n\t movq %%mm3, %%mm4" - "#3 \n\t movq %%mm3, %%mm5" - - "#4 \n\t movl %[expix1], %%esi" - "#3 \n\t punpcklbw %%mm5, %%mm3" - - "#4 \n\t movq (%%esi,%%eax,4),%%mm0" - "#3 \n\t punpckhbw %%mm5, %%mm4" - - "#4 \n\t addl %[prevX],%%eax" - "#4 \n\t movq (%%esi,%%eax,4),%%mm2" - - : - : [expix1] "g"(expix1) - , [prevX] "g"(prevX) - :"eax","esi" - ); - - /* - * pre : mm0 : expix1[position] - * mm2 : expix1[position+largeur] - * mm3 & mm4 : coefs - */ - - /* recopie des deux premiers pixels dans mm0 et mm1 */ - movq_r2r (mm0, mm1); /* b1-v1-r1-a1-b2-v2-r2-a2 */ - - /* depackage du premier pixel */ - punpcklbw_r2r (mm7, mm0); /* 00-b2-00-v2-00-r2-00-a2 */ - - /* extraction des coefficients... */ - - movq_r2r (mm3, mm5); /* c2-c2-c2-c2-c1-c1-c1-c1 */ - - /*^en parrallele^*/ /* depackage du 2ieme pixel */ - /*^*/ punpckhbw_r2r (mm7, mm1); /* 00-b1-00-v1-00-r1-00-a1 */ - - punpcklbw_r2r (mm7, mm5); /* 00-c1-00-c1-00-c1-00-c1 */ - punpckhbw_r2r (mm7, mm3); /* 00-c2-00-c2-00-c2-00-c2 */ - - /* multiplication des pixels par les coefficients */ - pmullw_r2r (mm5, mm0); /* c1*b2-c1*v2-c1*r2-c1*a2 */ - pmullw_r2r (mm3, mm1); /* c2*b1-c2*v1-c2*r1-c2*a1 */ - paddw_r2r (mm1, mm0); - - /* ...extraction des 2 derniers coefficients */ - movq_r2r (mm4, mm5); /* c4-c4-c4-c4-c3-c3-c3-c3 */ - punpcklbw_r2r (mm7, mm4); /* 00-c3-00-c3-00-c3-00-c3 */ - punpckhbw_r2r (mm7, mm5); /* 00-c4-00-c4-00-c4-00-c4 */ - - /* recuperation des 2 derniers pixels */ - movq_r2r (mm2, mm1); + "#1 \n\t pand %%mm1, %%mm0" /* on met a zero la partie qui deborde */ + ::[prevXY] "m"(prevXY)); + + /* Thread #2 + * pre : mm0 : clipped position on screen + * + * post : mm3 : coefs for this position + * mm1 : X vector [0|X] + * + * modif : eax,esi + */ + __asm__ __volatile__( + "#2 \n\t movd %%mm0,%%esi" + "#2 \n\t movq %%mm0,%%mm1" + + "#2 \n\t andl $15,%%esi" + "#2 \n\t psrlq $32,%%mm1" - /* depackage des pixels */ - punpcklbw_r2r (mm7, mm1); - punpckhbw_r2r (mm7, mm2); + "#2 \n\t shll $6,%%esi" + "#2 \n\t movd %%mm1,%%eax" + + "#2 \n\t addl %[precalCoef],%%esi" + "#2 \n\t andl $15,%%eax" + + "#2 \n\t movd (%%esi,%%eax,4),%%mm3" ::[precalCoef] "g"(precalCoef) + : "eax", "esi"); + + /* + * extraction des coefficients... (Thread #3) + * + * pre : coef dans mm3 + * + * post : coef extraits dans mm3 (c1 & c2) + * et mm4 (c3 & c4) + * + * modif : mm5 + */ + + /* (Thread #4) + * pre : mm0 : Y pos [*|Y] + * mm1 : X pos [*|X] + * + * post : mm0 : expix1[position] + * mm2 : expix1[position+largeur] + * + * modif : eax, esi + */ + __asm__ __volatile__("#2 \n\t psrld $4, %%mm0" + "#2 \n\t psrld $4, %%mm1" /* PERTEDEC = $4 */ + + "#4 \n\t movd %%mm1,%%eax" + "#3 \n\t movq %%mm3,%%mm5" + + "#4 \n\t mull %[prevX]" + "#4 \n\t movd %%mm0,%%esi" + + "#3 \n\t punpcklbw %%mm5, %%mm3" + "#4 \n\t addl %%esi, %%eax" + + "#3 \n\t movq %%mm3, %%mm4" + "#3 \n\t movq %%mm3, %%mm5" + + "#4 \n\t movl %[expix1], %%esi" + "#3 \n\t punpcklbw %%mm5, %%mm3" + + "#4 \n\t movq (%%esi,%%eax,4),%%mm0" + "#3 \n\t punpckhbw %%mm5, %%mm4" + + "#4 \n\t addl %[prevX],%%eax" + "#4 \n\t movq (%%esi,%%eax,4),%%mm2" + + : + : [expix1] "g"(expix1), [prevX] "g"(prevX) + : "eax", "esi"); + + /* + * pre : mm0 : expix1[position] + * mm2 : expix1[position+largeur] + * mm3 & mm4 : coefs + */ + + /* recopie des deux premiers pixels dans mm0 et mm1 */ + movq_r2r(mm0, mm1); /* b1-v1-r1-a1-b2-v2-r2-a2 */ + + /* depackage du premier pixel */ + punpcklbw_r2r(mm7, mm0); /* 00-b2-00-v2-00-r2-00-a2 */ + + /* extraction des coefficients... */ + + movq_r2r(mm3, mm5); /* c2-c2-c2-c2-c1-c1-c1-c1 */ + + /*^en parrallele^*/ /* depackage du 2ieme pixel */ + /*^*/ punpckhbw_r2r(mm7, mm1); /* 00-b1-00-v1-00-r1-00-a1 */ + + punpcklbw_r2r(mm7, mm5); /* 00-c1-00-c1-00-c1-00-c1 */ + punpckhbw_r2r(mm7, mm3); /* 00-c2-00-c2-00-c2-00-c2 */ + + /* multiplication des pixels par les coefficients */ + pmullw_r2r(mm5, mm0); /* c1*b2-c1*v2-c1*r2-c1*a2 */ + pmullw_r2r(mm3, mm1); /* c2*b1-c2*v1-c2*r1-c2*a1 */ + paddw_r2r(mm1, mm0); + + /* ...extraction des 2 derniers coefficients */ + movq_r2r(mm4, mm5); /* c4-c4-c4-c4-c3-c3-c3-c3 */ + punpcklbw_r2r(mm7, mm4); /* 00-c3-00-c3-00-c3-00-c3 */ + punpckhbw_r2r(mm7, mm5); /* 00-c4-00-c4-00-c4-00-c4 */ + + /* recuperation des 2 derniers pixels */ + movq_r2r(mm2, mm1); - /* multiplication pas les coeffs */ - pmullw_r2r (mm4, mm1); - pmullw_r2r (mm5, mm2); + /* depackage des pixels */ + punpcklbw_r2r(mm7, mm1); + punpckhbw_r2r(mm7, mm2); - /* ajout des valeurs obtenues � la valeur finale */ - paddw_r2r (mm1, mm0); - paddw_r2r (mm2, mm0); - - /* division par 256 = 16+16+16+16, puis repackage du pixel final */ - psrlw_i2r (8, mm0); - packuswb_r2r (mm7, mm0); - - movd_r2m (mm0,expix2[loop]); - - ++loop; - } - __asm__ __volatile__ ("femms\n"); -} + /* multiplication pas les coeffs */ + pmullw_r2r(mm4, mm1); + pmullw_r2r(mm5, mm2); + + /* ajout des valeurs obtenues � la valeur finale */ + paddw_r2r(mm1, mm0); + paddw_r2r(mm2, mm0); + + /* division par 256 = 16+16+16+16, puis repackage du pixel final */ + psrlw_i2r(8, mm0); + packuswb_r2r(mm7, mm0); -#define DRAWMETHOD_PLUS_XMMX(_out,_backbuf,_col) \ -{ \ - movd_m2r(_backbuf, mm0); \ - paddusb_m2r(_col, mm0); \ - movd_r2m(mm0, _out); \ + movd_r2m(mm0, expix2[loop]); + + ++loop; + } + __asm__ __volatile__("femms\n"); } -#define DRAWMETHOD DRAWMETHOD_PLUS_XMMX(*p,*p,col) - -void draw_line_xmmx (Pixel *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny) -{ - int x, y, dx, dy, yy, xx; - Pixel *p; - - if ((y1 < 0) || (y2 < 0) || (x1 < 0) || (x2 < 0) || (y1 >= screeny) || (y2 >= screeny) || (x1 >= screenx) || (x2 >= screenx)) - goto end_of_line; - - dx = x2 - x1; - dy = y2 - y1; - if (x1 >= x2) { - int tmp; - - tmp = x1; - x1 = x2; - x2 = tmp; - tmp = y1; - y1 = y2; - y2 = tmp; - dx = x2 - x1; - dy = y2 - y1; - } - - /* vertical line */ - if (dx == 0) { - if (y1 < y2) { - p = &(data[(screenx * y1) + x1]); - for (y = y1; y <= y2; y++) { - DRAWMETHOD; - p += screenx; - } - } - else { - p = &(data[(screenx * y2) + x1]); - for (y = y2; y <= y1; y++) { - DRAWMETHOD; - p += screenx; - } - } - goto end_of_line; - } - /* horizontal line */ - if (dy == 0) { - if (x1 < x2) { - p = &(data[(screenx * y1) + x1]); - for (x = x1; x <= x2; x++) { - DRAWMETHOD; - p++; - } - goto end_of_line; - } - else { - p = &(data[(screenx * y1) + x2]); - for (x = x2; x <= x1; x++) { - DRAWMETHOD; - p++; - } - goto end_of_line; - } - } - /* 1 */ - /* \ */ - /* \ */ - /* 2 */ - if (y2 > y1) { - /* steep */ - if (dy > dx) { - dx = ((dx << 16) / dy); - x = x1 << 16; - for (y = y1; y <= y2; y++) { - xx = x >> 16; - p = &(data[(screenx * y) + xx]); - DRAWMETHOD; - if (xx < (screenx - 1)) { - p++; - /* DRAWMETHOD; */ - } - x += dx; - } - goto end_of_line; - } - /* shallow */ - else { - dy = ((dy << 16) / dx); - y = y1 << 16; - for (x = x1; x <= x2; x++) { - yy = y >> 16; - p = &(data[(screenx * yy) + x]); - DRAWMETHOD; - if (yy < (screeny - 1)) { - p += screeny; - /* DRAWMETHOD; */ - } - y += dy; - } - } - } - /* 2 */ - /* / */ - /* / */ - /* 1 */ - else { - /* steep */ - if (-dy > dx) { - dx = ((dx << 16) / -dy); - x = (x1 + 1) << 16; - for (y = y1; y >= y2; y--) { - xx = x >> 16; - p = &(data[(screenx * y) + xx]); - DRAWMETHOD; - if (xx < (screenx - 1)) { - p--; - /* DRAWMETHOD; */ - } - x += dx; - } - goto end_of_line; - } - /* shallow */ - else { - dy = ((dy << 16) / dx); - y = y1 << 16; - for (x = x1; x <= x2; x++) { - yy = y >> 16; - p = &(data[(screenx * yy) + x]); - DRAWMETHOD; - if (yy < (screeny - 1)) { - p += screeny; - /* DRAWMETHOD; */ - } - y += dy; - } - goto end_of_line; - } - } +#define DRAWMETHOD_PLUS_XMMX(_out, _backbuf, _col) \ + { \ + movd_m2r(_backbuf, mm0); \ + paddusb_m2r(_col, mm0); \ + movd_r2m(mm0, _out); \ + } + +#define DRAWMETHOD DRAWMETHOD_PLUS_XMMX(*p, *p, col) + +void draw_line_xmmx(Pixel *data, int x1, int y1, int x2, int y2, int col, + int screenx, int screeny) { + int x, y, dx, dy, yy, xx; + Pixel *p; + + if ((y1 < 0) || (y2 < 0) || (x1 < 0) || (x2 < 0) || (y1 >= screeny) || + (y2 >= screeny) || (x1 >= screenx) || (x2 >= screenx)) + goto end_of_line; + + dx = x2 - x1; + dy = y2 - y1; + if (x1 >= x2) { + int tmp; + + tmp = x1; + x1 = x2; + x2 = tmp; + tmp = y1; + y1 = y2; + y2 = tmp; + dx = x2 - x1; + dy = y2 - y1; + } + + /* vertical line */ + if (dx == 0) { + if (y1 < y2) { + p = &(data[(screenx * y1) + x1]); + for (y = y1; y <= y2; y++) { + DRAWMETHOD; + p += screenx; + } + } else { + p = &(data[(screenx * y2) + x1]); + for (y = y2; y <= y1; y++) { + DRAWMETHOD; + p += screenx; + } + } + goto end_of_line; + } + /* horizontal line */ + if (dy == 0) { + if (x1 < x2) { + p = &(data[(screenx * y1) + x1]); + for (x = x1; x <= x2; x++) { + DRAWMETHOD; + p++; + } + goto end_of_line; + } else { + p = &(data[(screenx * y1) + x2]); + for (x = x2; x <= x1; x++) { + DRAWMETHOD; + p++; + } + goto end_of_line; + } + } + /* 1 */ + /* \ */ + /* \ */ + /* 2 */ + if (y2 > y1) { + /* steep */ + if (dy > dx) { + dx = ((dx << 16) / dy); + x = x1 << 16; + for (y = y1; y <= y2; y++) { + xx = x >> 16; + p = &(data[(screenx * y) + xx]); + DRAWMETHOD; + if (xx < (screenx - 1)) { + p++; + /* DRAWMETHOD; */ + } + x += dx; + } + goto end_of_line; + } + /* shallow */ + else { + dy = ((dy << 16) / dx); + y = y1 << 16; + for (x = x1; x <= x2; x++) { + yy = y >> 16; + p = &(data[(screenx * yy) + x]); + DRAWMETHOD; + if (yy < (screeny - 1)) { + p += screeny; + /* DRAWMETHOD; */ + } + y += dy; + } + } + } + /* 2 */ + /* / */ + /* / */ + /* 1 */ + else { + /* steep */ + if (-dy > dx) { + dx = ((dx << 16) / -dy); + x = (x1 + 1) << 16; + for (y = y1; y >= y2; y--) { + xx = x >> 16; + p = &(data[(screenx * y) + xx]); + DRAWMETHOD; + if (xx < (screenx - 1)) { + p--; + /* DRAWMETHOD; */ + } + x += dx; + } + goto end_of_line; + } + /* shallow */ + else { + dy = ((dy << 16) / dx); + y = y1 << 16; + for (x = x1; x <= x2; x++) { + yy = y >> 16; + p = &(data[(screenx * yy) + x]); + DRAWMETHOD; + if (yy < (screeny - 1)) { + p += screeny; + /* DRAWMETHOD; */ + } + y += dy; + } + goto end_of_line; + } + } end_of_line: - __asm__ __volatile__ ("femms\n"); + __asm__ __volatile__("femms\n"); } #endif diff --git a/libvisual-plugins/plugins/actor/goom2k4/xmmx.h b/libvisual-plugins/plugins/actor/goom2k4/xmmx.h index 70ef36143..d5585ce03 100644 --- a/libvisual-plugins/plugins/actor/goom2k4/xmmx.h +++ b/libvisual-plugins/plugins/actor/goom2k4/xmmx.h @@ -1,537 +1,486 @@ /* xmmx.h - eXtended MultiMedia eXtensions GCC interface library for IA32. + eXtended MultiMedia eXtensions GCC interface library for IA32. - To use this library, simply include this header file - and compile with GCC. You MUST have inlining enabled - in order for xmmx_ok() to work; this can be done by - simply using -O on the GCC command line. + To use this library, simply include this header file + and compile with GCC. You MUST have inlining enabled + in order for xmmx_ok() to work; this can be done by + simply using -O on the GCC command line. - Compiling with -DXMMX_TRACE will cause detailed trace - output to be sent to stderr for each mmx operation. - This adds lots of code, and obviously slows execution to - a crawl, but can be very useful for debugging. + Compiling with -DXMMX_TRACE will cause detailed trace + output to be sent to stderr for each mmx operation. + This adds lots of code, and obviously slows execution to + a crawl, but can be very useful for debugging. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT - LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR ANY PARTICULAR PURPOSE. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT + LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR ANY PARTICULAR PURPOSE. - 1999 by R. Fisher - Based on libmmx, 1997-99 by H. Dietz and R. Fisher + 1999 by R. Fisher + Based on libmmx, 1997-99 by H. Dietz and R. Fisher Notes: - It appears that the latest gas has the pand problem fixed, therefore - I'll undefine BROKEN_PAND by default. + It appears that the latest gas has the pand problem fixed, therefore + I'll undefine BROKEN_PAND by default. */ #ifndef _XMMX_H #define _XMMX_H - /* Warning: at this writing, the version of GAS packaged - with most Linux distributions does not handle the - parallel AND operation mnemonic correctly. If the - symbol BROKEN_PAND is defined, a slower alternative - coding will be used. If execution of mmxtest results - in an illegal instruction fault, define this symbol. + with most Linux distributions does not handle the + parallel AND operation mnemonic correctly. If the + symbol BROKEN_PAND is defined, a slower alternative + coding will be used. If execution of mmxtest results + in an illegal instruction fault, define this symbol. */ -#undef BROKEN_PAND - +#undef BROKEN_PAND /* The type of an value that fits in an (Extended) MMX register - (note that long long constant values MUST be suffixed - by LL and unsigned long long values by ULL, lest - they be truncated by the compiler) + (note that long long constant values MUST be suffixed + by LL and unsigned long long values by ULL, lest + they be truncated by the compiler) */ #ifndef _MMX_H -typedef union { - long long q; /* Quadword (64-bit) value */ - unsigned long long uq; /* Unsigned Quadword */ - int d[2]; /* 2 Doubleword (32-bit) values */ - unsigned int ud[2]; /* 2 Unsigned Doubleword */ - short w[4]; /* 4 Word (16-bit) values */ - unsigned short uw[4]; /* 4 Unsigned Word */ - char b[8]; /* 8 Byte (8-bit) values */ - unsigned char ub[8]; /* 8 Unsigned Byte */ - float s[2]; /* Single-precision (32-bit) value */ -} __attribute__ ((aligned (8))) mmx_t; /* On an 8-byte (64-bit) boundary */ +typedef union { + long long q; /* Quadword (64-bit) value */ + unsigned long long uq; /* Unsigned Quadword */ + int d[2]; /* 2 Doubleword (32-bit) values */ + unsigned int ud[2]; /* 2 Unsigned Doubleword */ + short w[4]; /* 4 Word (16-bit) values */ + unsigned short uw[4]; /* 4 Unsigned Word */ + char b[8]; /* 8 Byte (8-bit) values */ + unsigned char ub[8]; /* 8 Unsigned Byte */ + float s[2]; /* Single-precision (32-bit) value */ +} __attribute__((aligned(8))) mmx_t; /* On an 8-byte (64-bit) boundary */ #endif - - /* Function to test if multimedia instructions are supported... -*/ -static int -mm_support(void) -{ - /* Returns 1 if MMX instructions are supported, - 3 if Cyrix MMX and Extended MMX instructions are supported - 5 if AMD MMX and 3DNow! instructions are supported - 0 if hardware does not support any of these - */ - register int rval = 0; - - __asm__ __volatile__ ( - /* See if CPUID instruction is supported ... */ - /* ... Get copies of EFLAGS into eax and ecx */ - "pushf\n\t" - "popl %%eax\n\t" - "movl %%eax, %%ecx\n\t" - - /* ... Toggle the ID bit in one copy and store */ - /* to the EFLAGS reg */ - "xorl $0x200000, %%eax\n\t" - "push %%eax\n\t" - "popf\n\t" - - /* ... Get the (hopefully modified) EFLAGS */ - "pushf\n\t" - "popl %%eax\n\t" - - /* ... Compare and test result */ - "xorl %%eax, %%ecx\n\t" - "testl $0x200000, %%ecx\n\t" - "jz NotSupported1\n\t" /* CPUID not supported */ - - - /* Get standard CPUID information, and - go to a specific vendor section */ - "movl $0, %%eax\n\t" - "cpuid\n\t" - - /* Check for Intel */ - "cmpl $0x756e6547, %%ebx\n\t" - "jne TryAMD\n\t" - "cmpl $0x49656e69, %%edx\n\t" - "jne TryAMD\n\t" - "cmpl $0x6c65746e, %%ecx\n" - "jne TryAMD\n\t" - "jmp Intel\n\t" - - /* Check for AMD */ - "\nTryAMD:\n\t" - "cmpl $0x68747541, %%ebx\n\t" - "jne TryCyrix\n\t" - "cmpl $0x69746e65, %%edx\n\t" - "jne TryCyrix\n\t" - "cmpl $0x444d4163, %%ecx\n" - "jne TryCyrix\n\t" - "jmp AMD\n\t" - - /* Check for Cyrix */ - "\nTryCyrix:\n\t" - "cmpl $0x69727943, %%ebx\n\t" - "jne NotSupported2\n\t" - "cmpl $0x736e4978, %%edx\n\t" - "jne NotSupported3\n\t" - "cmpl $0x64616574, %%ecx\n\t" - "jne NotSupported4\n\t" - /* Drop through to Cyrix... */ - - - /* Cyrix Section */ - /* See if extended CPUID level 80000001 is supported */ - /* The value of CPUID/80000001 for the 6x86MX is undefined - according to the Cyrix CPU Detection Guide (Preliminary - Rev. 1.01 table 1), so we'll check the value of eax for - CPUID/0 to see if standard CPUID level 2 is supported. - According to the table, the only CPU which supports level - 2 is also the only one which supports extended CPUID levels. - */ - "cmpl $0x2, %%eax\n\t" - "jne MMXtest\n\t" /* Use standard CPUID instead */ - - /* Extended CPUID supported (in theory), so get extended - features */ - "movl $0x80000001, %%eax\n\t" - "cpuid\n\t" - "testl $0x00800000, %%eax\n\t" /* Test for MMX */ - "jz NotSupported5\n\t" /* MMX not supported */ - "testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */ - "jnz EMMXSupported\n\t" - "movl $1, %0:\n\n\t" /* MMX Supported */ - "jmp Return\n\n" - "EMMXSupported:\n\t" - "movl $3, %0:\n\n\t" /* EMMX and MMX Supported */ - "jmp Return\n\t" - - - /* AMD Section */ - "AMD:\n\t" - - /* See if extended CPUID is supported */ - "movl $0x80000000, %%eax\n\t" - "cpuid\n\t" - "cmpl $0x80000000, %%eax\n\t" - "jl MMXtest\n\t" /* Use standard CPUID instead */ - - /* Extended CPUID supported, so get extended features */ - "movl $0x80000001, %%eax\n\t" - "cpuid\n\t" - "testl $0x00800000, %%edx\n\t" /* Test for MMX */ - "jz NotSupported6\n\t" /* MMX not supported */ - "testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */ - "jnz ThreeDNowSupported\n\t" - "movl $1, %0:\n\n\t" /* MMX Supported */ - "jmp Return\n\n" - "ThreeDNowSupported:\n\t" - "movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */ - "jmp Return\n\t" - - - /* Intel Section */ - "Intel:\n\t" - - /* Check for MMX */ - "MMXtest:\n\t" - "movl $1, %%eax\n\t" - "cpuid\n\t" - "testl $0x00800000, %%edx\n\t" /* Test for MMX */ - "jz NotSupported7\n\t" /* MMX Not supported */ - "movl $1, %0:\n\n\t" /* MMX Supported */ - "jmp Return\n\t" - - /* Nothing supported */ - "\nNotSupported1:\n\t" - "#movl $101, %0:\n\n\t" - "\nNotSupported2:\n\t" - "#movl $102, %0:\n\n\t" - "\nNotSupported3:\n\t" - "#movl $103, %0:\n\n\t" - "\nNotSupported4:\n\t" - "#movl $104, %0:\n\n\t" - "\nNotSupported5:\n\t" - "#movl $105, %0:\n\n\t" - "\nNotSupported6:\n\t" - "#movl $106, %0:\n\n\t" - "\nNotSupported7:\n\t" - "#movl $107, %0:\n\n\t" - "movl $0, %0:\n\n\t" - - "Return:\n\t" - : "=a" (rval) - : /* no input */ - : "eax", "ebx", "ecx", "edx" - ); - - /* Return */ - return(rval); + */ +static int mm_support(void) { + /* Returns 1 if MMX instructions are supported, + 3 if Cyrix MMX and Extended MMX instructions are supported + 5 if AMD MMX and 3DNow! instructions are supported + 0 if hardware does not support any of these + */ + register int rval = 0; + + __asm__ __volatile__( + /* See if CPUID instruction is supported ... */ + /* ... Get copies of EFLAGS into eax and ecx */ + "pushf\n\t" + "popl %%eax\n\t" + "movl %%eax, %%ecx\n\t" + + /* ... Toggle the ID bit in one copy and store */ + /* to the EFLAGS reg */ + "xorl $0x200000, %%eax\n\t" + "push %%eax\n\t" + "popf\n\t" + + /* ... Get the (hopefully modified) EFLAGS */ + "pushf\n\t" + "popl %%eax\n\t" + + /* ... Compare and test result */ + "xorl %%eax, %%ecx\n\t" + "testl $0x200000, %%ecx\n\t" + "jz NotSupported1\n\t" /* CPUID not supported */ + + /* Get standard CPUID information, and + go to a specific vendor section */ + "movl $0, %%eax\n\t" + "cpuid\n\t" + + /* Check for Intel */ + "cmpl $0x756e6547, %%ebx\n\t" + "jne TryAMD\n\t" + "cmpl $0x49656e69, %%edx\n\t" + "jne TryAMD\n\t" + "cmpl $0x6c65746e, %%ecx\n" + "jne TryAMD\n\t" + "jmp Intel\n\t" + + /* Check for AMD */ + "\nTryAMD:\n\t" + "cmpl $0x68747541, %%ebx\n\t" + "jne TryCyrix\n\t" + "cmpl $0x69746e65, %%edx\n\t" + "jne TryCyrix\n\t" + "cmpl $0x444d4163, %%ecx\n" + "jne TryCyrix\n\t" + "jmp AMD\n\t" + + /* Check for Cyrix */ + "\nTryCyrix:\n\t" + "cmpl $0x69727943, %%ebx\n\t" + "jne NotSupported2\n\t" + "cmpl $0x736e4978, %%edx\n\t" + "jne NotSupported3\n\t" + "cmpl $0x64616574, %%ecx\n\t" + "jne NotSupported4\n\t" + /* Drop through to Cyrix... */ + + /* Cyrix Section */ + /* See if extended CPUID level 80000001 is supported */ + /* The value of CPUID/80000001 for the 6x86MX is undefined + according to the Cyrix CPU Detection Guide (Preliminary + Rev. 1.01 table 1), so we'll check the value of eax for + CPUID/0 to see if standard CPUID level 2 is supported. + According to the table, the only CPU which supports level + 2 is also the only one which supports extended CPUID levels. + */ + "cmpl $0x2, %%eax\n\t" + "jne MMXtest\n\t" /* Use standard CPUID instead */ + + /* Extended CPUID supported (in theory), so get extended + features */ + "movl $0x80000001, %%eax\n\t" + "cpuid\n\t" + "testl $0x00800000, %%eax\n\t" /* Test for MMX */ + "jz NotSupported5\n\t" /* MMX not supported */ + "testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */ + "jnz EMMXSupported\n\t" + "movl $1, %0:\n\n\t" /* MMX Supported */ + "jmp Return\n\n" + "EMMXSupported:\n\t" + "movl $3, %0:\n\n\t" /* EMMX and MMX Supported */ + "jmp Return\n\t" + + /* AMD Section */ + "AMD:\n\t" + + /* See if extended CPUID is supported */ + "movl $0x80000000, %%eax\n\t" + "cpuid\n\t" + "cmpl $0x80000000, %%eax\n\t" + "jl MMXtest\n\t" /* Use standard CPUID instead */ + + /* Extended CPUID supported, so get extended features */ + "movl $0x80000001, %%eax\n\t" + "cpuid\n\t" + "testl $0x00800000, %%edx\n\t" /* Test for MMX */ + "jz NotSupported6\n\t" /* MMX not supported */ + "testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */ + "jnz ThreeDNowSupported\n\t" + "movl $1, %0:\n\n\t" /* MMX Supported */ + "jmp Return\n\n" + "ThreeDNowSupported:\n\t" + "movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */ + "jmp Return\n\t" + + /* Intel Section */ + "Intel:\n\t" + + /* Check for MMX */ + "MMXtest:\n\t" + "movl $1, %%eax\n\t" + "cpuid\n\t" + "testl $0x00800000, %%edx\n\t" /* Test for MMX */ + "jz NotSupported7\n\t" /* MMX Not supported */ + "movl $1, %0:\n\n\t" /* MMX Supported */ + "jmp Return\n\t" + + /* Nothing supported */ + "\nNotSupported1:\n\t" + "#movl $101, %0:\n\n\t" + "\nNotSupported2:\n\t" + "#movl $102, %0:\n\n\t" + "\nNotSupported3:\n\t" + "#movl $103, %0:\n\n\t" + "\nNotSupported4:\n\t" + "#movl $104, %0:\n\n\t" + "\nNotSupported5:\n\t" + "#movl $105, %0:\n\n\t" + "\nNotSupported6:\n\t" + "#movl $106, %0:\n\n\t" + "\nNotSupported7:\n\t" + "#movl $107, %0:\n\n\t" + "movl $0, %0:\n\n\t" + + "Return:\n\t" + : "=a"(rval) + : /* no input */ + : "eax", "ebx", "ecx", "edx"); + + /* Return */ + return (rval); } /* Function to test if mmx instructions are supported... -*/ + */ #ifndef _XMMX_H -inline extern int -mmx_ok(void) -{ - /* Returns 1 if MMX instructions are supported, 0 otherwise */ - return ( mm_support() & 0x1 ); +inline extern int mmx_ok(void) { + /* Returns 1 if MMX instructions are supported, 0 otherwise */ + return (mm_support() & 0x1); } #endif /* Function to test if xmmx instructions are supported... -*/ -inline extern int -xmmx_ok(void) -{ - /* Returns 1 if Extended MMX instructions are supported, 0 otherwise */ - return ( (mm_support() & 0x2) >> 1 ); + */ +inline extern int xmmx_ok(void) { + /* Returns 1 if Extended MMX instructions are supported, 0 otherwise */ + return ((mm_support() & 0x2) >> 1); } - /* Helper functions for the instruction macros that follow... - (note that memory-to-register, m2r, instructions are nearly - as efficient as register-to-register, r2r, instructions; - however, memory-to-memory instructions are really simulated - as a convenience, and are only 1/3 as efficient) + (note that memory-to-register, m2r, instructions are nearly + as efficient as register-to-register, r2r, instructions; + however, memory-to-memory instructions are really simulated + as a convenience, and are only 1/3 as efficient) */ -#ifdef XMMX_TRACE +#ifdef XMMX_TRACE /* Include the stuff for printing a trace to stderr... -*/ + */ #include -#define mmx_i2r(op, imm, reg) \ - { \ - mmx_t mmx_trace; \ - mmx_trace.uq = (imm); \ - fprintf(stderr, #op "_i2r(" #imm "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - fprintf(stderr, #reg "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "X" (imm)); \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - fprintf(stderr, #reg "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } - -#define mmx_m2r(op, mem, reg) \ - { \ - mmx_t mmx_trace; \ - mmx_trace = (mem); \ - fprintf(stderr, #op "_m2r(" #mem "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - fprintf(stderr, #reg "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "X" (mem)); \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - fprintf(stderr, #reg "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } - -#define mmx_r2m(op, reg, mem) \ - { \ - mmx_t mmx_trace; \ - __asm__ __volatile__ ("movq %%" #reg ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - fprintf(stderr, #op "_r2m(" #reg "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - mmx_trace = (mem); \ - fprintf(stderr, #mem "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ (#op " %%" #reg ", %0" \ - : "=X" (mem) \ - : /* nothing */ ); \ - mmx_trace = (mem); \ - fprintf(stderr, #mem "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } - -#define mmx_r2r(op, regs, regd) \ - { \ - mmx_t mmx_trace; \ - __asm__ __volatile__ ("movq %%" #regs ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - fprintf(stderr, #op "_r2r(" #regs "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ ("movq %%" #regd ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - fprintf(stderr, #regd "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ (#op " %" #regs ", %" #regd); \ - __asm__ __volatile__ ("movq %%" #regd ", %0" \ - : "=X" (mmx_trace) \ - : /* nothing */ ); \ - fprintf(stderr, #regd "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } - -#define mmx_m2m(op, mems, memd) \ - { \ - mmx_t mmx_trace; \ - mmx_trace = (mems); \ - fprintf(stderr, #op "_m2m(" #mems "=0x%08x%08x, ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - mmx_trace = (memd); \ - fprintf(stderr, #memd "=0x%08x%08x) => ", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ - #op " %1, %%mm0\n\t" \ - "movq %%mm0, %0" \ - : "=X" (memd) \ - : "X" (mems)); \ - mmx_trace = (memd); \ - fprintf(stderr, #memd "=0x%08x%08x\n", \ - mmx_trace.d[1], mmx_trace.d[0]); \ - } +#define mmx_i2r(op, imm, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace.uq = (imm); \ + fprintf(stderr, #op "_i2r(" #imm "=0x%08x%08x, ", mmx_trace.d[1], \ + mmx_trace.d[0]); \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + fprintf(stderr, #reg "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__(#op " %0, %%" #reg \ + : /* nothing */ \ + : "X"(imm)); \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + fprintf(stderr, #reg "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_m2r(op, mem, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mem); \ + fprintf(stderr, #op "_m2r(" #mem "=0x%08x%08x, ", mmx_trace.d[1], \ + mmx_trace.d[0]); \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + fprintf(stderr, #reg "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__(#op " %0, %%" #reg \ + : /* nothing */ \ + : "X"(mem)); \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + fprintf(stderr, #reg "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_r2m(op, reg, mem) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__("movq %%" #reg ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + fprintf(stderr, #op "_r2m(" #reg "=0x%08x%08x, ", mmx_trace.d[1], \ + mmx_trace.d[0]); \ + mmx_trace = (mem); \ + fprintf(stderr, #mem "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__(#op " %%" #reg ", %0" : "=X"(mem) : /* nothing */); \ + mmx_trace = (mem); \ + fprintf(stderr, #mem "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_r2r(op, regs, regd) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__("movq %%" #regs ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + fprintf(stderr, #op "_r2r(" #regs "=0x%08x%08x, ", mmx_trace.d[1], \ + mmx_trace.d[0]); \ + __asm__ __volatile__("movq %%" #regd ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + fprintf(stderr, #regd "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__(#op " %" #regs ", %" #regd); \ + __asm__ __volatile__("movq %%" #regd ", %0" \ + : "=X"(mmx_trace) \ + : /* nothing */); \ + fprintf(stderr, #regd "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_m2m(op, mems, memd) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mems); \ + fprintf(stderr, #op "_m2m(" #mems "=0x%08x%08x, ", mmx_trace.d[1], \ + mmx_trace.d[0]); \ + mmx_trace = (memd); \ + fprintf(stderr, #memd "=0x%08x%08x) => ", mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__("movq %0, %%mm0\n\t" #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X"(memd) \ + : "X"(mems)); \ + mmx_trace = (memd); \ + fprintf(stderr, #memd "=0x%08x%08x\n", mmx_trace.d[1], mmx_trace.d[0]); \ + } #else /* These macros are a lot simpler without the tracing... -*/ + */ -#define mmx_i2r(op, imm, reg) \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "X" (imm) ) - -#define mmx_m2r(op, mem, reg) \ - __asm__ __volatile__ (#op " %0, %%" #reg \ - : /* nothing */ \ - : "X" (mem)) - -#define mmx_m2ir(op, mem, rs) \ - __asm__ __volatile__ (#op " %0, %%" #rs \ - : /* nothing */ \ - : "X" (mem) ) - -#define mmx_r2m(op, reg, mem) \ - __asm__ __volatile__ (#op " %%" #reg ", %0" \ - : "=X" (mem) \ - : /* nothing */ ) - -#define mmx_r2r(op, regs, regd) \ - __asm__ __volatile__ (#op " %" #regs ", %" #regd) - -#define mmx_r2ir(op, rs1, rs2) \ - __asm__ __volatile__ (#op " %%" #rs1 ", %%" #rs2 \ - : /* nothing */ \ - : /* nothing */ ) - -#define mmx_m2m(op, mems, memd) \ - __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ - #op " %1, %%mm0\n\t" \ - "movq %%mm0, %0" \ - : "=X" (memd) \ - : "X" (mems)) +#define mmx_i2r(op, imm, reg) \ + __asm__ __volatile__(#op " %0, %%" #reg \ + : /* nothing */ \ + : "X"(imm)) -#endif +#define mmx_m2r(op, mem, reg) \ + __asm__ __volatile__(#op " %0, %%" #reg \ + : /* nothing */ \ + : "X"(mem)) +#define mmx_m2ir(op, mem, rs) \ + __asm__ __volatile__(#op " %0, %%" #rs \ + : /* nothing */ \ + : "X"(mem)) +#define mmx_r2m(op, reg, mem) \ + __asm__ __volatile__(#op " %%" #reg ", %0" : "=X"(mem) : /* nothing */) -/* 1x64 MOVe Quadword - (this is both a load and a store... - in fact, it is the only way to store) -*/ -#define movq_m2r(var, reg) mmx_m2r(movq, var, reg) -#define movq_r2m(reg, var) mmx_r2m(movq, reg, var) -#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) -#define movq(vars, vard) \ - __asm__ __volatile__ ("movq %1, %%mm0\n\t" \ - "movq %%mm0, %0" \ - : "=X" (vard) \ - : "X" (vars)) +#define mmx_r2r(op, regs, regd) __asm__ __volatile__(#op " %" #regs ", %" #regd) +#define mmx_r2ir(op, rs1, rs2) \ + __asm__ __volatile__(#op " %%" #rs1 ", %%" #rs2 \ + : /* nothing */ \ + : /* nothing */) -/* 1x32 MOVe Doubleword - (like movq, this is both load and store... - but is most useful for moving things between - mmx registers and ordinary registers) -*/ -#define movd_m2r(var, reg) mmx_m2r(movd, var, reg) -#define movd_r2m(reg, var) mmx_r2m(movd, reg, var) -#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) -#define movd(vars, vard) \ - __asm__ __volatile__ ("movd %1, %%mm0\n\t" \ - "movd %%mm0, %0" \ - : "=X" (vard) \ - : "X" (vars)) +#define mmx_m2m(op, mems, memd) \ + __asm__ __volatile__("movq %0, %%mm0\n\t" #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X"(memd) \ + : "X"(mems)) +#endif +/* 1x64 MOVe Quadword + (this is both a load and a store... + in fact, it is the only way to store) +*/ +#define movq_m2r(var, reg) mmx_m2r(movq, var, reg) +#define movq_r2m(reg, var) mmx_r2m(movq, reg, var) +#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) +#define movq(vars, vard) \ + __asm__ __volatile__("movq %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X"(vard) \ + : "X"(vars)) -/* 4x16 Parallel MAGnitude +/* 1x32 MOVe Doubleword + (like movq, this is both load and store... + but is most useful for moving things between + mmx registers and ordinary registers) */ -#define pmagw_m2r(var, reg) mmx_m2r(pmagw, var, reg) -#define pmagw_r2r(regs, regd) mmx_r2r(pmagw, regs, regd) -#define pmagw(vars, vard) mmx_m2m(pmagw, vars, vard) +#define movd_m2r(var, reg) mmx_m2r(movd, var, reg) +#define movd_r2m(reg, var) mmx_r2m(movd, reg, var) +#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) +#define movd(vars, vard) \ + __asm__ __volatile__("movd %1, %%mm0\n\t" \ + "movd %%mm0, %0" \ + : "=X"(vard) \ + : "X"(vars)) +/* 4x16 Parallel MAGnitude + */ +#define pmagw_m2r(var, reg) mmx_m2r(pmagw, var, reg) +#define pmagw_r2r(regs, regd) mmx_r2r(pmagw, regs, regd) +#define pmagw(vars, vard) mmx_m2m(pmagw, vars, vard) /* 4x16 Parallel ADDs using Saturation arithmetic - and Implied destination + and Implied destination */ -#define paddsiw_m2ir(var, rs) mmx_m2ir(paddsiw, var, rs) -#define paddsiw_r2ir(rs1, rs2) mmx_r2ir(paddsiw, rs1, rs2) -#define paddsiw(vars, vard) mmx_m2m(paddsiw, vars, vard) - +#define paddsiw_m2ir(var, rs) mmx_m2ir(paddsiw, var, rs) +#define paddsiw_r2ir(rs1, rs2) mmx_r2ir(paddsiw, rs1, rs2) +#define paddsiw(vars, vard) mmx_m2m(paddsiw, vars, vard) /* 4x16 Parallel SUBs using Saturation arithmetic - and Implied destination + and Implied destination */ -#define psubsiw_m2ir(var, rs) mmx_m2ir(psubsiw, var, rs) -#define psubsiw_r2ir(rs1, rs2) mmx_r2ir(psubsiw, rs1, rs2) -#define psubsiw(vars, vard) mmx_m2m(psubsiw, vars, vard) - +#define psubsiw_m2ir(var, rs) mmx_m2ir(psubsiw, var, rs) +#define psubsiw_r2ir(rs1, rs2) mmx_r2ir(psubsiw, rs1, rs2) +#define psubsiw(vars, vard) mmx_m2m(psubsiw, vars, vard) /* 4x16 Parallel MULs giving High 4x16 portions of results - Rounded with 1/2 bit 15. + Rounded with 1/2 bit 15. */ -#define pmulhrw_m2r(var, reg) mmx_m2r(pmulhrw, var, reg) -#define pmulhrw_r2r(regs, regd) mmx_r2r(pmulhrw, regs, regd) -#define pmulhrw(vars, vard) mmx_m2m(pmulhrw, vars, vard) - +#define pmulhrw_m2r(var, reg) mmx_m2r(pmulhrw, var, reg) +#define pmulhrw_r2r(regs, regd) mmx_r2r(pmulhrw, regs, regd) +#define pmulhrw(vars, vard) mmx_m2m(pmulhrw, vars, vard) /* 4x16 Parallel MULs giving High 4x16 portions of results - Rounded with 1/2 bit 15, storing to Implied register + Rounded with 1/2 bit 15, storing to Implied register */ -#define pmulhriw_m2ir(var, rs) mmx_m2ir(pmulhriw, var, rs) -#define pmulhriw_r2ir(rs1, rs2) mmx_r2ir(pmulhriw, rs1, rs2) -#define pmulhriw(vars, vard) mmx_m2m(pmulhriw, vars, vard) - +#define pmulhriw_m2ir(var, rs) mmx_m2ir(pmulhriw, var, rs) +#define pmulhriw_r2ir(rs1, rs2) mmx_r2ir(pmulhriw, rs1, rs2) +#define pmulhriw(vars, vard) mmx_m2m(pmulhriw, vars, vard) /* 4x16 Parallel Muls (and ACcumulate) giving High 4x16 portions - of results Rounded with 1/2 bit 15, accumulating with Implied register + of results Rounded with 1/2 bit 15, accumulating with Implied register */ -#define pmachriw_m2ir(var, rs) mmx_m2ir(pmachriw, var, rs) -#define pmachriw_r2ir(rs1, rs2) mmx_r2ir(pmachriw, rs1, rs2) -#define pmachriw(vars, vard) mmx_m2m(pmachriw, vars, vard) - +#define pmachriw_m2ir(var, rs) mmx_m2ir(pmachriw, var, rs) +#define pmachriw_r2ir(rs1, rs2) mmx_r2ir(pmachriw, rs1, rs2) +#define pmachriw(vars, vard) mmx_m2m(pmachriw, vars, vard) /* 8x8u Parallel AVErage -*/ -#define paveb_m2r(var, reg) mmx_m2r(paveb, var, reg) -#define paveb_r2r(regs, regd) mmx_r2r(paveb, regs, regd) -#define paveb(vars, vard) mmx_m2m(paveb, vars, vard) - + */ +#define paveb_m2r(var, reg) mmx_m2r(paveb, var, reg) +#define paveb_r2r(regs, regd) mmx_r2r(paveb, regs, regd) +#define paveb(vars, vard) mmx_m2m(paveb, vars, vard) /* 8x8u Parallel DISTance and accumulate with - unsigned saturation to Implied register + unsigned saturation to Implied register */ -#define pdistib_m2ir(var, rs) mmx_m2ir(pdistib, var, rs) -#define pdistib(vars, vard) mmx_m2m(pdistib, vars, vard) - +#define pdistib_m2ir(var, rs) mmx_m2ir(pdistib, var, rs) +#define pdistib(vars, vard) mmx_m2m(pdistib, vars, vard) /* 8x8 Parallel conditional MoVe - if implied register field is Zero + if implied register field is Zero */ -#define pmvzb_m2ir(var, rs) mmx_m2ir(pmvzb, var, rs) - +#define pmvzb_m2ir(var, rs) mmx_m2ir(pmvzb, var, rs) /* 8x8 Parallel conditional MoVe - if implied register field is Not Zero + if implied register field is Not Zero */ -#define pmvnzb_m2ir(var, rs) mmx_m2ir(pmvnzb, var, rs) - +#define pmvnzb_m2ir(var, rs) mmx_m2ir(pmvnzb, var, rs) /* 8x8 Parallel conditional MoVe - if implied register field is Less than Zero + if implied register field is Less than Zero */ -#define pmvlzb_m2ir(var, rs) mmx_m2ir(pmvlzb, var, rs) - +#define pmvlzb_m2ir(var, rs) mmx_m2ir(pmvlzb, var, rs) /* 8x8 Parallel conditional MoVe - if implied register field is Greater than or Equal to Zero + if implied register field is Greater than or Equal to Zero */ -#define pmvgezb_m2ir(var, rs) mmx_m2ir(pmvgezb, var, rs) - +#define pmvgezb_m2ir(var, rs) mmx_m2ir(pmvgezb, var, rs) /* Fast Empty MMx State - (used to clean-up when going from mmx to float use - of the registers that are shared by both; note that - there is no float-to-xmmx operation needed, because - only the float tag word info is corruptible) + (used to clean-up when going from mmx to float use + of the registers that are shared by both; note that + there is no float-to-xmmx operation needed, because + only the float tag word info is corruptible) */ -#ifdef XMMX_TRACE +#ifdef XMMX_TRACE -#define femms() \ - { \ - fprintf(stderr, "femms()\n"); \ - __asm__ __volatile__ ("femms"); \ - } +#define femms() \ + { \ + fprintf(stderr, "femms()\n"); \ + __asm__ __volatile__("femms"); \ + } #else -#define femms() __asm__ __volatile__ ("femms") +#define femms() __asm__ __volatile__("femms") #endif #endif - diff --git a/libvisual-plugins/plugins/actor/gstreamer/actor_gstreamer.c b/libvisual-plugins/plugins/actor/gstreamer/actor_gstreamer.c index aa320b6d8..551721841 100644 --- a/libvisual-plugins/plugins/actor/gstreamer/actor_gstreamer.c +++ b/libvisual-plugins/plugins/actor/gstreamer/actor_gstreamer.c @@ -29,311 +29,310 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR typedef struct { - GstElement *pipeline; - GMainLoop *glib_main_loop; - GstBuffer *buffer; - GstElement *capsfilter; - GstElement *sink; - GMutex *mutex; + GstElement *pipeline; + GMainLoop *glib_main_loop; + GstBuffer *buffer; + GstElement *capsfilter; + GstElement *sink; + GMutex *mutex; } GStreamerPrivate; -static int act_gstreamer_init (VisPluginData *plugin); -static void act_gstreamer_cleanup (VisPluginData *plugin); -static void act_gstreamer_requisition (VisPluginData *plugin, int *width, int *height); -static void act_gstreamer_resize (VisPluginData *plugin, int width, int height); -static int act_gstreamer_events (VisPluginData *plugin, VisEventQueue *events); -static VisPalette *act_gstreamer_palette (VisPluginData *plugin); -static void act_gstreamer_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); - -static void handle_sink_handoff (GstElement *sink, GstBuffer *buffer, GstPad *pad, GStreamerPrivate *data); -static void handle_bus_error_message (GstBus *bus, GstMessage *message, GStreamerPrivate *priv); -static void handle_bus_eos_message (GstBus *bus, GstMessage *message, GStreamerPrivate *priv); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = act_gstreamer_requisition, - .palette = act_gstreamer_palette, - .render = act_gstreamer_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_24BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "gstreamer", - .name = "libvisual gstreamer", - .author = N_("Dennis Smit "), - .version = "0.1", - .about = N_("Libvisual gstreamer plugin"), - .help = N_("Capable of using gstreamer to play video, or do effects using the gstreamer pipeline"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = act_gstreamer_init, - .cleanup = act_gstreamer_cleanup, - .events = act_gstreamer_events, - .plugin = &actor - }; - - return &info; +static int act_gstreamer_init(VisPluginData *plugin); +static void act_gstreamer_cleanup(VisPluginData *plugin); +static void act_gstreamer_requisition(VisPluginData *plugin, int *width, + int *height); +static void act_gstreamer_resize(VisPluginData *plugin, int width, int height); +static int act_gstreamer_events(VisPluginData *plugin, VisEventQueue *events); +static VisPalette *act_gstreamer_palette(VisPluginData *plugin); +static void act_gstreamer_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); + +static void handle_sink_handoff(GstElement *sink, GstBuffer *buffer, + GstPad *pad, GStreamerPrivate *data); +static void handle_bus_error_message(GstBus *bus, GstMessage *message, + GStreamerPrivate *priv); +static void handle_bus_eos_message(GstBus *bus, GstMessage *message, + GStreamerPrivate *priv); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = act_gstreamer_requisition, + .palette = act_gstreamer_palette, + .render = act_gstreamer_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_24BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "gstreamer", + .name = "libvisual gstreamer", + .author = N_("Dennis Smit "), + .version = "0.1", + .about = N_("Libvisual gstreamer plugin"), + .help = N_("Capable of using gstreamer to play video, or do effects " + "using the gstreamer pipeline"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = act_gstreamer_init, + .cleanup = act_gstreamer_cleanup, + .events = act_gstreamer_events, + .plugin = &actor}; + + return &info; } -static int act_gstreamer_init (VisPluginData *plugin) -{ - GStreamerPrivate *priv; +static int act_gstreamer_init(VisPluginData *plugin) { + GStreamerPrivate *priv; #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - priv = visual_mem_new0 (GStreamerPrivate, 1); - visual_plugin_set_private (plugin, priv); - - gst_init (NULL, NULL); - - // Regarding the pipeline below: - // - Element "filesrc" reads a video file from disk. - // - Element "decodebin" auto-magically constructs a decoding pipeline - // using available decoders and demuxers via auto-plugging. - // - Element "videoconvert" does conversion between video formats - // from given to wanted. - // - Element "videoscale" does scaling from given to wanted resolution. - // - Element "capsfilter" limits the output to the width/height/format we want. - // - Element "fakesink" allows accessing the rendered raw pixels from C code. - // - "name=capsfilter" and "name=sink" are needed to access these elements - // from within C code further down. - // - "signal-handoffs=true" makes fakesink let use know it started using - // a different buffer. - // - "sync=true" makes fakesink respect the target framerate of the video - // input to give the appearance of original playback speed - // (in contrast to serving frames as fast as possible). - char *launch_str = g_strdup_printf ("filesrc location=%s ! decodebin ! videoconvert ! " - "videoscale ! capsfilter name=capsfilter ! " - "fakesink name=sink signal-handoffs=true sync=true", - "test.mpg"); - - GError *error = NULL; - priv->pipeline = gst_parse_launch (launch_str, &error); - - if (!priv->pipeline) { - visual_log (VISUAL_LOG_ERROR, "Failed to create pipeline: %s", error->message); - g_error_free (error); - g_free (launch_str); - return FALSE; - } - - priv->capsfilter = gst_bin_get_by_name (GST_BIN (priv->pipeline), "capsfilter"); - GstCaps *caps = gst_caps_new_simple ("video/x-raw", - "width", G_TYPE_INT, 320, - "height", G_TYPE_INT, 240, - "format", G_TYPE_STRING, "BGR", - NULL); - g_object_set (priv->capsfilter, "caps", caps, NULL); - gst_caps_unref (caps); - - priv->buffer = NULL; - priv->mutex = g_slice_new0 (GMutex); - g_mutex_init (priv->mutex); - - priv->sink = gst_bin_get_by_name (GST_BIN (priv->pipeline), "sink"); - g_signal_connect (priv->sink, "handoff", G_CALLBACK (handle_sink_handoff), priv); - - gst_element_set_state (priv->pipeline, GST_STATE_PAUSED); - - GstStateChangeReturn status = gst_element_get_state (priv->pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); - if (status != GST_STATE_CHANGE_SUCCESS) { - visual_log (VISUAL_LOG_ERROR, "Failed to ready pipeline: %s", launch_str); - g_free (launch_str); - return FALSE; - } - g_free (launch_str); - - GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (priv->pipeline)); - g_signal_connect (bus, "message::error", G_CALLBACK (handle_bus_error_message), priv); - g_signal_connect (bus, "message::eos", G_CALLBACK (handle_bus_eos_message), priv); - gst_object_unref (bus); - - priv->glib_main_loop = g_main_loop_new (NULL, FALSE); - - return TRUE; + priv = visual_mem_new0(GStreamerPrivate, 1); + visual_plugin_set_private(plugin, priv); + + gst_init(NULL, NULL); + + // Regarding the pipeline below: + // - Element "filesrc" reads a video file from disk. + // - Element "decodebin" auto-magically constructs a decoding pipeline + // using available decoders and demuxers via auto-plugging. + // - Element "videoconvert" does conversion between video formats + // from given to wanted. + // - Element "videoscale" does scaling from given to wanted resolution. + // - Element "capsfilter" limits the output to the width/height/format we + // want. + // - Element "fakesink" allows accessing the rendered raw pixels from C code. + // - "name=capsfilter" and "name=sink" are needed to access these elements + // from within C code further down. + // - "signal-handoffs=true" makes fakesink let use know it started using + // a different buffer. + // - "sync=true" makes fakesink respect the target framerate of the video + // input to give the appearance of original playback speed + // (in contrast to serving frames as fast as possible). + char *launch_str = + g_strdup_printf("filesrc location=%s ! decodebin ! videoconvert ! " + "videoscale ! capsfilter name=capsfilter ! " + "fakesink name=sink signal-handoffs=true sync=true", + "test.mpg"); + + GError *error = NULL; + priv->pipeline = gst_parse_launch(launch_str, &error); + + if (!priv->pipeline) { + visual_log(VISUAL_LOG_ERROR, "Failed to create pipeline: %s", + error->message); + g_error_free(error); + g_free(launch_str); + return FALSE; + } + + priv->capsfilter = gst_bin_get_by_name(GST_BIN(priv->pipeline), "capsfilter"); + GstCaps *caps = gst_caps_new_simple("video/x-raw", "width", G_TYPE_INT, 320, + "height", G_TYPE_INT, 240, "format", + G_TYPE_STRING, "BGR", NULL); + g_object_set(priv->capsfilter, "caps", caps, NULL); + gst_caps_unref(caps); + + priv->buffer = NULL; + priv->mutex = g_slice_new0(GMutex); + g_mutex_init(priv->mutex); + + priv->sink = gst_bin_get_by_name(GST_BIN(priv->pipeline), "sink"); + g_signal_connect(priv->sink, "handoff", G_CALLBACK(handle_sink_handoff), + priv); + + gst_element_set_state(priv->pipeline, GST_STATE_PAUSED); + + GstStateChangeReturn status = + gst_element_get_state(priv->pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); + if (status != GST_STATE_CHANGE_SUCCESS) { + visual_log(VISUAL_LOG_ERROR, "Failed to ready pipeline: %s", launch_str); + g_free(launch_str); + return FALSE; + } + g_free(launch_str); + + GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(priv->pipeline)); + g_signal_connect(bus, "message::error", G_CALLBACK(handle_bus_error_message), + priv); + g_signal_connect(bus, "message::eos", G_CALLBACK(handle_bus_eos_message), + priv); + gst_object_unref(bus); + + priv->glib_main_loop = g_main_loop_new(NULL, FALSE); + + return TRUE; } -static void act_gstreamer_cleanup (VisPluginData *plugin) -{ - GStreamerPrivate *priv = visual_plugin_get_private (plugin); +static void act_gstreamer_cleanup(VisPluginData *plugin) { + GStreamerPrivate *priv = visual_plugin_get_private(plugin); - if (priv->pipeline) { - g_signal_handlers_disconnect_by_func (priv->sink, "handoff", handle_sink_handoff); + if (priv->pipeline) { + g_signal_handlers_disconnect_by_func(priv->sink, "handoff", + handle_sink_handoff); - GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (priv->pipeline)); - g_signal_handlers_disconnect_by_func (bus, handle_bus_error_message, priv); - g_signal_handlers_disconnect_by_func (bus, handle_bus_eos_message, priv); - gst_object_unref (bus); + GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(priv->pipeline)); + g_signal_handlers_disconnect_by_func(bus, handle_bus_error_message, priv); + g_signal_handlers_disconnect_by_func(bus, handle_bus_eos_message, priv); + gst_object_unref(bus); - g_main_loop_unref (priv->glib_main_loop); + g_main_loop_unref(priv->glib_main_loop); - gst_object_unref (priv->sink); - gst_object_unref (priv->capsfilter); + gst_object_unref(priv->sink); + gst_object_unref(priv->capsfilter); - gst_element_set_state (priv->pipeline, GST_STATE_NULL); - gst_object_unref (priv->pipeline); + gst_element_set_state(priv->pipeline, GST_STATE_NULL); + gst_object_unref(priv->pipeline); - if (priv->buffer) { - gst_buffer_unref (priv->buffer); - } - - g_mutex_clear (priv->mutex); - g_slice_free (GMutex, priv->mutex); + if (priv->buffer) { + gst_buffer_unref(priv->buffer); } - visual_mem_free (priv); + g_mutex_clear(priv->mutex); + g_slice_free(GMutex, priv->mutex); + } + + visual_mem_free(priv); } -static void act_gstreamer_requisition (VisPluginData *plugin, int *width, int *height) -{ - GStreamerPrivate *priv = visual_plugin_get_private (plugin); +static void act_gstreamer_requisition(VisPluginData *plugin, int *width, + int *height) { + GStreamerPrivate *priv = visual_plugin_get_private(plugin); - GstCaps *caps = NULL; - g_object_get (priv->capsfilter, "caps", &caps, NULL); + GstCaps *caps = NULL; + g_object_get(priv->capsfilter, "caps", &caps, NULL); - GstStructure *structure = gst_caps_get_structure (caps, 0); - gst_structure_get (structure, - "width", width, - "height", height, - NULL); - gst_caps_unref (caps); + GstStructure *structure = gst_caps_get_structure(caps, 0); + gst_structure_get(structure, "width", width, "height", height, NULL); + gst_caps_unref(caps); } +static void act_gstreamer_resize(VisPluginData *plugin, int width, int height) { + GStreamerPrivate *priv = visual_plugin_get_private(plugin); -static void act_gstreamer_resize (VisPluginData *plugin, int width, int height) -{ - GStreamerPrivate *priv = visual_plugin_get_private (plugin); - - GstCaps *caps = gst_caps_new_simple ("video/x-raw", - "width" , G_TYPE_INT, width, - "height", G_TYPE_INT, height, - "format", G_TYPE_STRING, "BGR", - NULL); - g_object_set (priv->capsfilter, "caps", caps, NULL); - gst_caps_unref (caps); + GstCaps *caps = gst_caps_new_simple("video/x-raw", "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, "format", + G_TYPE_STRING, "BGR", NULL); + g_object_set(priv->capsfilter, "caps", caps, NULL); + gst_caps_unref(caps); } -static int act_gstreamer_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; +static int act_gstreamer_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - act_gstreamer_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + act_gstreamer_resize(plugin, ev.event.resize.width, + ev.event.resize.height); + break; - default: - break; - } + default: + break; } + } - return TRUE; + return TRUE; } -static VisPalette *act_gstreamer_palette (VisPluginData *plugin) -{ - return NULL; -} +static VisPalette *act_gstreamer_palette(VisPluginData *plugin) { return NULL; } -static void act_gstreamer_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - GStreamerPrivate *priv = visual_plugin_get_private (plugin); +static void act_gstreamer_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + GStreamerPrivate *priv = visual_plugin_get_private(plugin); - GstState state, pending_state; - GstStateChangeReturn status; + GstState state, pending_state; + GstStateChangeReturn status; - gst_element_get_state (priv->pipeline, &state, &pending_state, 0); - if (state != GST_STATE_PLAYING && pending_state != GST_STATE_PLAYING) { - /* Set pipeline to playing if not already done so */ - gst_element_set_state (priv->pipeline, GST_STATE_PLAYING); + gst_element_get_state(priv->pipeline, &state, &pending_state, 0); + if (state != GST_STATE_PLAYING && pending_state != GST_STATE_PLAYING) { + /* Set pipeline to playing if not already done so */ + gst_element_set_state(priv->pipeline, GST_STATE_PLAYING); - /* Check pipeline state, make sure it's already playing, or going to be set playing */ - status = gst_element_get_state (priv->pipeline, &state, &pending_state, 10 * GST_MSECOND); + /* Check pipeline state, make sure it's already playing, or going to be set + * playing */ + status = gst_element_get_state(priv->pipeline, &state, &pending_state, + 10 * GST_MSECOND); - switch (status) { - case GST_STATE_CHANGE_ASYNC: - visual_log (VISUAL_LOG_INFO, "Waiting for pipeline to get ready (Current state: %s)", - gst_element_state_get_name (state)); - return; + switch (status) { + case GST_STATE_CHANGE_ASYNC: + visual_log(VISUAL_LOG_INFO, + "Waiting for pipeline to get ready (Current state: %s)", + gst_element_state_get_name(state)); + return; - case GST_STATE_CHANGE_FAILURE: - visual_log (VISUAL_LOG_INFO, "Failed to animate pipeline"); - return; + case GST_STATE_CHANGE_FAILURE: + visual_log(VISUAL_LOG_INFO, "Failed to animate pipeline"); + return; - default: /* nothing */; - } + default: /* nothing */; + } + } + + /* Process any messages on the bus */ + g_main_context_iteration(g_main_loop_get_context(priv->glib_main_loop), + FALSE); + + /* Draw if we have a buffer */ + g_mutex_lock(priv->mutex); + if (priv->buffer) { + // NOTE: GStreamer format "BGR" does not have any padding + const int expected_row_pitch = visual_video_get_width(video) * (24 / 8); + const int expected_buffer_size = + expected_row_pitch * visual_video_get_height(video); + + /* Copy buffer to video only if dimensions match, ignoring + * buffers received from GStreamer before their corresponding + * resizes were completed. */ + if (gst_buffer_get_size(priv->buffer) == expected_buffer_size) { + GstMapInfo info; + if (gst_buffer_map(priv->buffer, &info, GST_MAP_READ)) { + VisVideo *const source = visual_video_new_wrap_buffer( + info.data, FALSE, visual_video_get_width(video), + visual_video_get_height(video), VISUAL_VIDEO_DEPTH_24BIT, + 0 /* i.e. auto-calculated */); + + visual_video_convert_depth(video, source); + + visual_video_unref(source); + + gst_buffer_unmap(priv->buffer, &info); + } } - /* Process any messages on the bus */ - g_main_context_iteration (g_main_loop_get_context (priv->glib_main_loop), FALSE); + gst_buffer_unref(priv->buffer); - /* Draw if we have a buffer */ - g_mutex_lock (priv->mutex); - if (priv->buffer) { - // NOTE: GStreamer format "BGR" does not have any padding - const int expected_row_pitch = visual_video_get_width (video) * (24 / 8); - const int expected_buffer_size = expected_row_pitch * visual_video_get_height (video); - - /* Copy buffer to video only if dimensions match, ignoring - * buffers received from GStreamer before their corresponding - * resizes were completed. */ - if (gst_buffer_get_size (priv->buffer) == expected_buffer_size) { - GstMapInfo info; - if (gst_buffer_map(priv->buffer, &info, GST_MAP_READ)) { - VisVideo * const source = visual_video_new_wrap_buffer (info.data, - FALSE, - visual_video_get_width (video), - visual_video_get_height (video), - VISUAL_VIDEO_DEPTH_24BIT, - 0 /* i.e. auto-calculated */); - - visual_video_convert_depth (video, source); - - visual_video_unref (source); - - gst_buffer_unmap(priv->buffer, &info); - } - } - - gst_buffer_unref (priv->buffer); - - priv->buffer = NULL; - } - g_mutex_unlock (priv->mutex); + priv->buffer = NULL; + } + g_mutex_unlock(priv->mutex); } -static void handle_sink_handoff (GstElement *sink, GstBuffer *buffer, GstPad *pad, GStreamerPrivate* priv) -{ - g_mutex_lock (priv->mutex); +static void handle_sink_handoff(GstElement *sink, GstBuffer *buffer, + GstPad *pad, GStreamerPrivate *priv) { + g_mutex_lock(priv->mutex); - /* Keep the most recently received buffer alive for rendering */ - if (priv->buffer) { - gst_buffer_unref (priv->buffer); - } + /* Keep the most recently received buffer alive for rendering */ + if (priv->buffer) { + gst_buffer_unref(priv->buffer); + } - priv->buffer = buffer; - gst_buffer_ref (priv->buffer); + priv->buffer = buffer; + gst_buffer_ref(priv->buffer); - g_mutex_unlock (priv->mutex); + g_mutex_unlock(priv->mutex); } -static void handle_bus_error_message (GstBus *bus, GstMessage *message, GStreamerPrivate *priv) -{ - GError *error = NULL; - char *msg = NULL; - gst_message_parse_error (message, &error, &msg); - visual_log (VISUAL_LOG_ERROR, "GStreamer error: %s", msg); - g_error_free (error); - g_free (msg); +static void handle_bus_error_message(GstBus *bus, GstMessage *message, + GStreamerPrivate *priv) { + GError *error = NULL; + char *msg = NULL; + gst_message_parse_error(message, &error, &msg); + visual_log(VISUAL_LOG_ERROR, "GStreamer error: %s", msg); + g_error_free(error); + g_free(msg); } -static void handle_bus_eos_message (GstBus *bus, GstMessage *message, GStreamerPrivate *priv) -{ - visual_log (VISUAL_LOG_INFO, "End of stream!"); +static void handle_bus_eos_message(GstBus *bus, GstMessage *message, + GStreamerPrivate *priv) { + visual_log(VISUAL_LOG_INFO, "End of stream!"); } diff --git a/libvisual-plugins/plugins/actor/infinite/compute.c b/libvisual-plugins/plugins/actor/infinite/compute.c index e42e1dce6..35ed87cd1 100644 --- a/libvisual-plugins/plugins/actor/infinite/compute.c +++ b/libvisual-plugins/plugins/actor/infinite/compute.c @@ -6,166 +6,165 @@ #define PI 3.14159 -static t_complex _inf_fct(InfinitePrivate *priv, t_complex a,int n,int p1,int p2) //p1 et p2:0-4 +static t_complex _inf_fct(InfinitePrivate *priv, t_complex a, int n, int p1, + int p2) // p1 et p2:0-4 { - t_complex b; - float fact; - float an; - float circle_size; - float speed; - float co,si; - - a.x-=priv->plugwidth/2; - a.y-=priv->plugheight/2; - - switch (n) { - - case 0: - an=0.025*(p1-2)+0.002; - co=cos(an); - si=sin(an); - circle_size=priv->plugheight*0.25; - speed=2000+p2*500; - b.x=(co*a.x-si*a.y); - b.y=(si*a.x+co*a.y); - fact=-(sqrt(b.x*b.x+b.y*b.y)-circle_size)/speed+1; - b.x=(b.x*fact); - b.y=(b.y*fact); - break; - - case 1: - an=0.015*(p1-2)+0.002; - co=cos(an); - si=sin(an); - circle_size=priv->plugheight*0.45; - speed=4000+p2*1000; - b.x=(co*a.x-si*a.y); - b.y=(si*a.x+co*a.y); - fact=(sqrt(b.x*b.x+b.y*b.y)-circle_size)/speed+1; - b.x=(b.x*fact); - b.y=(b.y*fact); - break; - - case 2: - an=0.002; - co=cos(an); - si=sin(an); - circle_size=priv->plugheight*0.25; - speed=400+p2*100; - b.x=(co*a.x-si*a.y); - b.y=(si*a.x+co*a.y); - fact=-(sqrt(b.x*b.x+b.y*b.y)-circle_size)/speed+1; - b.x=(b.x*fact); - b.y=(b.y*fact); - break; - - case 3: - an=(sin(sqrt(a.x*a.x+a.y*a.y)/20)/20)+0.002; - co=cos(an); - si=sin(an); - circle_size=priv->plugheight*0.25; - speed=4000; - b.x=(co*a.x-si*a.y); - b.y=(si*a.x+co*a.y); - fact=-(sqrt(b.x*b.x+b.y*b.y)-circle_size)/speed+1; - b.x=(b.x*fact); - b.y=(b.y*fact); - break; - - case 4: - an=0.002; - co=cos(an); - si=sin(an); - circle_size=priv->plugheight*0.25; - speed=sin(sqrt(a.x*a.x+a.y*a.y)/5)*3000+4000; - b.x=(co*a.x-si*a.y); - b.y=(si*a.x+co*a.y); - fact=-(sqrt(b.x*b.x+b.y*b.y)-circle_size)/speed+1; - b.x=(b.x*fact); - b.y=(b.y*fact); - break; - - case 5: - b.x=a.x*1.02; - b.y=a.y*1.02; - break; - - case 6: - an=0.002; - co=cos(an); - si=sin(an); - circle_size=priv->plugheight*0.25; - fact=1+cos(atan(a.x/(a.y+0.00001))*6)*0.02; - b.x=(co*a.x-si*a.y); - b.y=(si*a.x+co*a.y); - b.x=(b.x*fact); - b.y=(b.y*fact); - break; - - } - - b.x+=priv->plugwidth/2; - b.y+=priv->plugheight/2; - if (b.x<0) - b.x=0; - if (b.y<0) - b.y=0; - if (b.x>priv->plugwidth-1) - b.x=priv->plugwidth-1; - if (b.y>priv->plugheight-1) - b.y=priv->plugheight-1; - - return b; -} + t_complex b; + float fact; + float an; + float circle_size; + float speed; + float co, si; + a.x -= priv->plugwidth / 2; + a.y -= priv->plugheight / 2; -static void _inf_generate_sector(InfinitePrivate *priv, int g,int f,int p1,int p2,int debut,int step,t_interpol* vector_field) -{ - int fin=debut+step; - const int prop_transmitted=249; - const int b_add=g*priv->plugwidth*priv->plugheight; - t_coord c; - - - if (fin>priv->plugheight) - fin=priv->plugheight; - for (c.y=debut;c.yplugwidth;c.x++) { - t_complex a; - float fpy; - int rw,lw,add; - uint32_t w1,w2,w3,w4; - uint32_t x,y; - - a.x=(float)c.x; - a.y=(float)c.y; - a=_inf_fct(priv, a,f,p1,p2); - add=c.x+c.y*priv->plugwidth; - x=(int)(a.x); - y=(int)(a.y); - vector_field[b_add+add].coord=(x<<16)|y; - - fpy=a.y-floor(a.y); - rw=(int)((a.x-floor(a.x))*prop_transmitted); - lw=prop_transmitted-rw; - w4=(int)(fpy*rw); - w2=rw-w4; - w3=(int)(fpy*lw); - w1=lw-w3; - vector_field[b_add+add].weight=(w1<<24)|(w2<<16)|(w3<<8)|w4; - } + switch (n) { + + case 0: + an = 0.025 * (p1 - 2) + 0.002; + co = cos(an); + si = sin(an); + circle_size = priv->plugheight * 0.25; + speed = 2000 + p2 * 500; + b.x = (co * a.x - si * a.y); + b.y = (si * a.x + co * a.y); + fact = -(sqrt(b.x * b.x + b.y * b.y) - circle_size) / speed + 1; + b.x = (b.x * fact); + b.y = (b.y * fact); + break; + + case 1: + an = 0.015 * (p1 - 2) + 0.002; + co = cos(an); + si = sin(an); + circle_size = priv->plugheight * 0.45; + speed = 4000 + p2 * 1000; + b.x = (co * a.x - si * a.y); + b.y = (si * a.x + co * a.y); + fact = (sqrt(b.x * b.x + b.y * b.y) - circle_size) / speed + 1; + b.x = (b.x * fact); + b.y = (b.y * fact); + break; + + case 2: + an = 0.002; + co = cos(an); + si = sin(an); + circle_size = priv->plugheight * 0.25; + speed = 400 + p2 * 100; + b.x = (co * a.x - si * a.y); + b.y = (si * a.x + co * a.y); + fact = -(sqrt(b.x * b.x + b.y * b.y) - circle_size) / speed + 1; + b.x = (b.x * fact); + b.y = (b.y * fact); + break; + + case 3: + an = (sin(sqrt(a.x * a.x + a.y * a.y) / 20) / 20) + 0.002; + co = cos(an); + si = sin(an); + circle_size = priv->plugheight * 0.25; + speed = 4000; + b.x = (co * a.x - si * a.y); + b.y = (si * a.x + co * a.y); + fact = -(sqrt(b.x * b.x + b.y * b.y) - circle_size) / speed + 1; + b.x = (b.x * fact); + b.y = (b.y * fact); + break; + + case 4: + an = 0.002; + co = cos(an); + si = sin(an); + circle_size = priv->plugheight * 0.25; + speed = sin(sqrt(a.x * a.x + a.y * a.y) / 5) * 3000 + 4000; + b.x = (co * a.x - si * a.y); + b.y = (si * a.x + co * a.y); + fact = -(sqrt(b.x * b.x + b.y * b.y) - circle_size) / speed + 1; + b.x = (b.x * fact); + b.y = (b.y * fact); + break; + + case 5: + b.x = a.x * 1.02; + b.y = a.y * 1.02; + break; + + case 6: + an = 0.002; + co = cos(an); + si = sin(an); + circle_size = priv->plugheight * 0.25; + fact = 1 + cos(atan(a.x / (a.y + 0.00001)) * 6) * 0.02; + b.x = (co * a.x - si * a.y); + b.y = (si * a.x + co * a.y); + b.x = (b.x * fact); + b.y = (b.y * fact); + break; + } + + b.x += priv->plugwidth / 2; + b.y += priv->plugheight / 2; + if (b.x < 0) + b.x = 0; + if (b.y < 0) + b.y = 0; + if (b.x > priv->plugwidth - 1) + b.x = priv->plugwidth - 1; + if (b.y > priv->plugheight - 1) + b.y = priv->plugheight - 1; + + return b; } -void _inf_generate_vector_field(InfinitePrivate *priv, t_interpol* vector_field) -{ - int f; - int i,p1,p2; - - for (f=0;fplugheight;i+=10) - _inf_generate_sector(priv, f,f,p1,p2,i,10,vector_field); - } +static void _inf_generate_sector(InfinitePrivate *priv, int g, int f, int p1, + int p2, int debut, int step, + t_interpol *vector_field) { + int fin = debut + step; + const int prop_transmitted = 249; + const int b_add = g * priv->plugwidth * priv->plugheight; + t_coord c; + + if (fin > priv->plugheight) + fin = priv->plugheight; + for (c.y = debut; c.y < fin; c.y++) + for (c.x = 0; c.x < priv->plugwidth; c.x++) { + t_complex a; + float fpy; + int rw, lw, add; + uint32_t w1, w2, w3, w4; + uint32_t x, y; + + a.x = (float)c.x; + a.y = (float)c.y; + a = _inf_fct(priv, a, f, p1, p2); + add = c.x + c.y * priv->plugwidth; + x = (int)(a.x); + y = (int)(a.y); + vector_field[b_add + add].coord = (x << 16) | y; + + fpy = a.y - floor(a.y); + rw = (int)((a.x - floor(a.x)) * prop_transmitted); + lw = prop_transmitted - rw; + w4 = (int)(fpy * rw); + w2 = rw - w4; + w3 = (int)(fpy * lw); + w1 = lw - w3; + vector_field[b_add + add].weight = + (w1 << 24) | (w2 << 16) | (w3 << 8) | w4; + } } +void _inf_generate_vector_field(InfinitePrivate *priv, + t_interpol *vector_field) { + int f; + int i, p1, p2; + + for (f = 0; f < NB_FCT; f++) { + p1 = 2; + p2 = 2; + for (i = 0; i < priv->plugheight; i += 10) + _inf_generate_sector(priv, f, f, p1, p2, i, 10, vector_field); + } +} diff --git a/libvisual-plugins/plugins/actor/infinite/compute.h b/libvisual-plugins/plugins/actor/infinite/compute.h index 1db83aff4..e4260f02a 100644 --- a/libvisual-plugins/plugins/actor/infinite/compute.h +++ b/libvisual-plugins/plugins/actor/infinite/compute.h @@ -3,6 +3,7 @@ #define NB_FCT 7 -void _inf_generate_vector_field(InfinitePrivate *priv, t_interpol* vector_field); +void _inf_generate_vector_field(InfinitePrivate *priv, + t_interpol *vector_field); #endif /* _INF_COMPUTE_H */ diff --git a/libvisual-plugins/plugins/actor/infinite/display.c b/libvisual-plugins/plugins/actor/infinite/display.c index 249f548f5..9e08507da 100644 --- a/libvisual-plugins/plugins/actor/infinite/display.c +++ b/libvisual-plugins/plugins/actor/infinite/display.c @@ -8,72 +8,79 @@ #include "display.h" #include "main.h" -#define wrap(a) ( a < 0 ? 0 : ( a > 255 ? 255 : a )) -#define assign_max(p,a) ( *p = ( *p > a ? *p : a )) +#define wrap(a) (a < 0 ? 0 : (a > 255 ? 255 : a)) +#define assign_max(p, a) (*p = (*p > a ? *p : a)) #define PI 3.14159 -void _inf_generate_colors(InfinitePrivate *priv) -{ - int i,k; - float colors[NB_PALETTES][2][3]={{{1,1,1},{1,1,1}}, - {{2,1.5,0},{0,0.5,2}}, - {{0,1,2},{0,1,0}}, - {{0,2,1},{0,0,1}}, - {{2,0,0},{0,1,1}}}; - - for (k=0;kcolor_table[k][i].r = colors[k][0][0]*i; - priv->color_table[k][i].g = colors[k][0][1]*i; - priv->color_table[k][i].b = colors[k][0][2]*i; - } - for ( i=0; i<128; i++ ) - { - priv->color_table[k][i+128].r = colors[k][0][0]*127+colors[k][1][0]*i; - priv->color_table[k][i+128].g = colors[k][0][1]*127+colors[k][1][1]*i; - priv->color_table[k][i+128].b = colors[k][0][2]*127+colors[k][1][2]*i; - } - } +void _inf_generate_colors(InfinitePrivate *priv) { + int i, k; + float colors[NB_PALETTES][2][3] = {{{1, 1, 1}, {1, 1, 1}}, + {{2, 1.5, 0}, {0, 0.5, 2}}, + {{0, 1, 2}, {0, 1, 0}}, + {{0, 2, 1}, {0, 0, 1}}, + {{2, 0, 0}, {0, 1, 1}}}; + + for (k = 0; k < NB_PALETTES; k++) { + for (i = 0; i < 128; i++) { + priv->color_table[k][i].r = colors[k][0][0] * i; + priv->color_table[k][i].g = colors[k][0][1] * i; + priv->color_table[k][i].b = colors[k][0][2] * i; + } + for (i = 0; i < 128; i++) { + priv->color_table[k][i + 128].r = + colors[k][0][0] * 127 + colors[k][1][0] * i; + priv->color_table[k][i + 128].g = + colors[k][0][1] * 127 + colors[k][1][1] * i; + priv->color_table[k][i + 128].b = + colors[k][0][2] * 127 + colors[k][1][2] * i; + } + } } -void _inf_change_color(InfinitePrivate *priv, int t2,int t1,int w) -{ - VisColor *pal_colors = visual_palette_get_colors (priv->pal); - - int i; - - for (i=0;i<256;i++) { - int r,g,b; - r=(priv->color_table[t1][i].r*w+priv->color_table[t2][i].r*(256-w))>>8; - g=(priv->color_table[t1][i].g*w+priv->color_table[t2][i].g*(256-w))>>8; - b=(priv->color_table[t1][i].b*w+priv->color_table[t2][i].b*(256-w))>>8; - - pal_colors[i].r = r; - pal_colors[i].g = g; - pal_colors[i].b = b; - } +void _inf_change_color(InfinitePrivate *priv, int t2, int t1, int w) { + VisColor *pal_colors = visual_palette_get_colors(priv->pal); + + int i; + + for (i = 0; i < 256; i++) { + int r, g, b; + r = (priv->color_table[t1][i].r * w + + priv->color_table[t2][i].r * (256 - w)) >> + 8; + g = (priv->color_table[t1][i].g * w + + priv->color_table[t2][i].g * (256 - w)) >> + 8; + b = (priv->color_table[t1][i].b * w + + priv->color_table[t2][i].b * (256 - w)) >> + 8; + + pal_colors[i].r = r; + pal_colors[i].g = g; + pal_colors[i].b = b; + } } -static void _inf_compute_surface(InfinitePrivate *priv, t_interpol* vector_field) -{ - int i,j; - int add_dest=0,add_src; - t_interpol *interpol; - register uint8_t* ptr_pix; - int color = 0; - uint8_t* ptr_swap; - - /* FIXME OK we're going to take a different approach: - * have a whole set of interpolate buffers: - * every buffer containing one element, the different weights, the upper and lower part of - * the interpolation coords etc, with this setup it's MUCH easier to vectorize it damn hard. - */ - - /* FIXME ok this sucked, is een mislukte actie geweest zie ik, omdat ik mmx regs te kort kwam - * zat ik met restore problemen, waardoor het uiteindelijk even snel werd, moet de hele blur routine - * van deze plugin from scratch doen... */ - if (0) { +static void _inf_compute_surface(InfinitePrivate *priv, + t_interpol *vector_field) { + int i, j; + int add_dest = 0, add_src; + t_interpol *interpol; + register uint8_t *ptr_pix; + int color = 0; + uint8_t *ptr_swap; + + /* FIXME OK we're going to take a different approach: + * have a whole set of interpolate buffers: + * every buffer containing one element, the different weights, the upper and + * lower part of the interpolation coords etc, with this setup it's MUCH + * easier to vectorize it damn hard. + */ + + /* FIXME ok this sucked, is een mislukte actie geweest zie ik, omdat ik mmx + * regs te kort kwam zat ik met restore problemen, waardoor het uiteindelijk + * even snel werd, moet de hele blur routine van deze plugin from scratch + * doen... */ + if (0) { #if 0 #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) int add_src2[2]; @@ -158,293 +165,295 @@ static void _inf_compute_surface(InfinitePrivate *priv, t_interpol* vector_field ("emms"); #endif /* #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) */ #endif /* #if 0 */ - } else { - const uint8_t *ptr_pix_end = priv->surface1 + (priv->plugwidth * priv->plugheight); - - for (j=0;jplugheight;j++) { - for (i=0;iplugwidth;i++) { - interpol = &vector_field[add_dest]; - const uint16_t y = interpol->coord & 0xffff; - const uint16_t x = interpol->coord >> 16; - (void)add_src; - ptr_pix = priv->surface1 + y * priv->plugwidth + x; - - color = ptr_pix[0] * (interpol->weight >> 24); - - // right neigbor - if (ptr_pix + 1 < ptr_pix_end) - color += ptr_pix[1] * ((interpol->weight >> 16) & 0xFF); - - // bottom neigbor - if (ptr_pix + priv->plugwidth < ptr_pix_end) - color += ptr_pix[priv->plugwidth] * ((interpol->weight >> 8) & 0xFF); - - // bottom right neigbor - if (ptr_pix + priv->plugwidth + 1 < ptr_pix_end) - color += ptr_pix[priv->plugwidth + 1] * (interpol->weight & 0xFF); - - color >>= 8; -/* - color= (*(ptr_pix) // * (interpol->weight >> 24) - +*(ptr_pix + 1) // * ((interpol->weight & 0xFFFFFF) >> 16) - +*(ptr_pix + priv->plugwidth) // * ((interpol->weight & 0xFFFF) >> 8) - +*(ptr_pix + priv->plugwidth + 1)); // * (interpol->weight & 0xFF)) >> 8; - -*/ priv->surface2[add_dest]=color; - add_dest++; - } - } - } - - - ptr_swap=priv->surface1; - priv->surface1=priv->surface2; - priv->surface2=ptr_swap; + } else { + const uint8_t *ptr_pix_end = + priv->surface1 + (priv->plugwidth * priv->plugheight); + + for (j = 0; j < priv->plugheight; j++) { + for (i = 0; i < priv->plugwidth; i++) { + interpol = &vector_field[add_dest]; + const uint16_t y = interpol->coord & 0xffff; + const uint16_t x = interpol->coord >> 16; + (void)add_src; + ptr_pix = priv->surface1 + y * priv->plugwidth + x; + + color = ptr_pix[0] * (interpol->weight >> 24); + + // right neigbor + if (ptr_pix + 1 < ptr_pix_end) + color += ptr_pix[1] * ((interpol->weight >> 16) & 0xFF); + + // bottom neigbor + if (ptr_pix + priv->plugwidth < ptr_pix_end) + color += ptr_pix[priv->plugwidth] * ((interpol->weight >> 8) & 0xFF); + + // bottom right neigbor + if (ptr_pix + priv->plugwidth + 1 < ptr_pix_end) + color += ptr_pix[priv->plugwidth + 1] * (interpol->weight & 0xFF); + + color >>= 8; + /* + color= (*(ptr_pix) // * + (interpol->weight >> 24) + +*(ptr_pix + 1) // * + ((interpol->weight & 0xFFFFFF) >> 16) + +*(ptr_pix + priv->plugwidth) // + * ((interpol->weight & 0xFFFF) >> 8) + +*(ptr_pix + priv->plugwidth + + 1)); // * (interpol->weight & 0xFF)) >> 8; + + */ + priv->surface2[add_dest] = color; + add_dest++; + } + } + } + + ptr_swap = priv->surface1; + priv->surface1 = priv->surface2; + priv->surface2 = ptr_swap; } -void _inf_display (InfinitePrivate *priv, uint8_t *surf, int pitch) -{ - int i; +void _inf_display(InfinitePrivate *priv, uint8_t *surf, int pitch) { + int i; - for (i = 0; i < priv->plugheight; i++) { + for (i = 0; i < priv->plugheight; i++) { - visual_mem_copy (surf, priv->surface1 + (i * priv->plugwidth), priv->plugwidth); + visual_mem_copy(surf, priv->surface1 + (i * priv->plugwidth), + priv->plugwidth); - surf += pitch; - } + surf += pitch; + } } -void _inf_blur(InfinitePrivate *priv, t_interpol* vector_field) -{ - _inf_compute_surface(priv, vector_field); +void _inf_blur(InfinitePrivate *priv, t_interpol *vector_field) { + _inf_compute_surface(priv, vector_field); } -static void _inf_plot1(InfinitePrivate *priv, int x,int y,int c) -{ - if (x>0 && xplugwidth-3 && y>0 && yplugheight-3) - assign_max(&(priv->surface1)[x+y*priv->plugwidth],c); +static void _inf_plot1(InfinitePrivate *priv, int x, int y, int c) { + if (x > 0 && x < priv->plugwidth - 3 && y > 0 && y < priv->plugheight - 3) + assign_max(&(priv->surface1)[x + y * priv->plugwidth], c); } +static void _inf_plot2(InfinitePrivate *priv, int x, int y, int c) { + int ty; -static void _inf_plot2(InfinitePrivate *priv, int x,int y,int c) -{ - int ty; - - if (x>0 && xplugwidth-3 && y>0 && yplugheight-3) { - ty = y*priv->plugwidth; - assign_max(&(priv->surface1)[x+ty],c); - assign_max(&(priv->surface1)[x+1+ty],c); - assign_max(&(priv->surface1)[x+ty+priv->plugwidth],c); - assign_max(&(priv->surface1)[x+1+ty+priv->plugwidth],c); - } + if (x > 0 && x < priv->plugwidth - 3 && y > 0 && y < priv->plugheight - 3) { + ty = y * priv->plugwidth; + assign_max(&(priv->surface1)[x + ty], c); + assign_max(&(priv->surface1)[x + 1 + ty], c); + assign_max(&(priv->surface1)[x + ty + priv->plugwidth], c); + assign_max(&(priv->surface1)[x + 1 + ty + priv->plugwidth], c); + } } -#define SWAP(x,y) \ - x = x + y; \ - y = x - y; \ - x = x - y; - -static void _inf_line(InfinitePrivate *priv, int x1, int y1, int x2, int y2, int c) { - int dx, dy, cxy,dxy; - /* calculate the distances */ - dx = abs(x1 - x2); - dy = abs(y1 - y2); - - cxy = 0; - if (dy > dx) { - /* Follow Y axis */ - if (y1 > y2) { - SWAP(y1, y2); - SWAP(x1, x2); - } - - if (x1 > x2) - dxy = -1; - else - dxy = 1; - - for (; y1= dy) { - x1+= dxy; - cxy -= dy; - } - _inf_plot1(priv, x1, y1, c); - } - } else { - /* Follow X axis */ - if (x1 > x2) { - SWAP(x1, x2); - SWAP(y1, y2); - } - - if (y1 > y2) - dxy = -1; - else - dxy = 1; - - for (; x1= dx) { - y1+=dxy; - cxy -= dx; - } - _inf_plot1(priv, x1, y1, c); - } - } +#define SWAP(x, y) \ + x = x + y; \ + y = x - y; \ + x = x - y; + +static void _inf_line(InfinitePrivate *priv, int x1, int y1, int x2, int y2, + int c) { + int dx, dy, cxy, dxy; + /* calculate the distances */ + dx = abs(x1 - x2); + dy = abs(y1 - y2); + + cxy = 0; + if (dy > dx) { + /* Follow Y axis */ + if (y1 > y2) { + SWAP(y1, y2); + SWAP(x1, x2); + } + + if (x1 > x2) + dxy = -1; + else + dxy = 1; + + for (; y1 < y2; y1++) { + cxy += dx; + if (cxy >= dy) { + x1 += dxy; + cxy -= dy; + } + _inf_plot1(priv, x1, y1, c); + } + } else { + /* Follow X axis */ + if (x1 > x2) { + SWAP(x1, x2); + SWAP(y1, y2); + } + + if (y1 > y2) + dxy = -1; + else + dxy = 1; + + for (; x1 < x2; x1++) { + cxy += dy; + if (cxy >= dx) { + y1 += dxy; + cxy -= dx; + } + _inf_plot1(priv, x1, y1, c); + } + } } struct sincos { - int i; - float *f; + int i; + float *f; }; /* Little optimization for cos/sin functions */ -static struct sincos cosw = { 0, NULL }; -static struct sincos sinw = { 0, NULL }; - -void _inf_spectral(InfinitePrivate *priv, t_effect* current_effect, float data[2][512]) -{ - int i, halfheight, halfwidth; - float old_y1,old_y2; - float y1=(((data[0][0]+data[1][0]) * 128)*current_effect->spectral_amplitude*priv->plugheight) * (1.0 / 4096.0); - float y2=(((data[0][0]+data[1][0]) * 128)*current_effect->spectral_amplitude*priv->plugheight) * (1.0 / 4096.0); - const int density_lines=5; - const int step=4; - const int shift=(current_effect->spectral_shift*priv->plugheight)>>8; - - if (cosw.i != priv->plugwidth || sinw.i != priv->plugwidth) { - if (cosw.f != NULL) - visual_mem_free(cosw.f); - - if (sinw.f != NULL) - visual_mem_free(sinw.f); - - sinw.f = cosw.f = NULL; - sinw.i = cosw.i = 0; - } - - if (cosw.i == 0 || cosw.f == NULL) { - float halfPI = (float)PI/2; - cosw.i = priv->plugwidth; - cosw.f = visual_mem_malloc0(sizeof(float)*priv->plugwidth); - for (i=0; iplugwidth;i+=step) - cosw.f[i] = cos((float)i/priv->plugwidth*PI+halfPI); - } - - if (sinw.i == 0 || sinw.f == NULL) { - float halfPI = (float)PI/2; - sinw.i = priv->plugwidth; - sinw.f = visual_mem_malloc0(sizeof(float)*priv->plugwidth); - for (i=0; iplugwidth;i+=step) - sinw.f[i] = sin((float)i/priv->plugwidth*PI+halfPI); - } - - if (current_effect->mode_spectre==3) { - if (y1<0) - y1=0; - if (y2<0) - y2=0; - } - - halfheight = priv->plugheight >> 1; - halfwidth = priv->plugwidth >> 1; - for (i=step;iplugwidth;i+=step) { - old_y1=y1; - old_y2=y2; - y1=((data[1][(i<<9)/priv->plugwidth/density_lines] * 256)* - current_effect->spectral_amplitude*priv->plugheight) * (1.0 / 4096.0); - y2=((data[0][(i<<9)/priv->plugwidth/density_lines] * 256)* - current_effect->spectral_amplitude*priv->plugheight) * (1.0 / 4096.0); - - switch (current_effect->mode_spectre) { - case 0: - _inf_line(priv, i-step,halfheight+shift+old_y2, - i,halfheight+shift+y2, - current_effect->spectral_color); - break; - case 1: - _inf_line(priv, i-step,halfheight+shift+old_y1, - i,halfheight+shift+y1, - current_effect->spectral_color); - _inf_line(priv, i-step,halfheight-shift+old_y2, - i,halfheight-shift+y2, - current_effect->spectral_color); - break; - case 2: - _inf_line(priv, i-step,halfheight+shift+old_y1, - i,halfheight+shift+y1, - current_effect->spectral_color); - _inf_line(priv, i-step,halfheight-shift+old_y1, - i,halfheight-shift+y1, - current_effect->spectral_color); - _inf_line(priv, halfwidth+shift+old_y2,i-step, - halfwidth+shift+y2,i, - current_effect->spectral_color); - _inf_line(priv, halfwidth-shift+old_y2,i-step, - halfwidth-shift+y2,i, - current_effect->spectral_color); - break; - case 3: - if (y1<0) - y1=0; - if (y2<0) - y2=0; - case 4: - _inf_line(priv, halfwidth + cosw.f[i-step] * (shift+old_y1), - halfheight + sinw.f[i-step] * (shift+old_y1), - halfwidth + cosw.f[i] * (shift+y1), - halfheight + sinw.f[i] * (shift+y1), - current_effect->spectral_color); - _inf_line(priv, halfwidth - cosw.f[i-step] * (shift+old_y2), - halfheight + sinw.f[i-step] * (shift+old_y2), - halfwidth - cosw.f[i] * (shift+y2), - halfheight + sinw.f[i] * (shift+y2), - current_effect->spectral_color); - break; - } - } - - if (current_effect->mode_spectre==3 || current_effect->mode_spectre==4) - _inf_line(priv, halfwidth + cosw.f[priv->plugwidth - step] * (shift+y1), - halfheight + sinw.f[priv->plugwidth - step] * (shift+y1), - halfwidth - cosw.f[priv->plugwidth - step] * (shift+y2), - halfheight + sinw.f[priv->plugwidth - step] * (shift+y2), - current_effect->spectral_color); +static struct sincos cosw = {0, NULL}; +static struct sincos sinw = {0, NULL}; + +void _inf_spectral(InfinitePrivate *priv, t_effect *current_effect, + float data[2][512]) { + int i, halfheight, halfwidth; + float old_y1, old_y2; + float y1 = (((data[0][0] + data[1][0]) * 128) * + current_effect->spectral_amplitude * priv->plugheight) * + (1.0 / 4096.0); + float y2 = (((data[0][0] + data[1][0]) * 128) * + current_effect->spectral_amplitude * priv->plugheight) * + (1.0 / 4096.0); + const int density_lines = 5; + const int step = 4; + const int shift = (current_effect->spectral_shift * priv->plugheight) >> 8; + + if (cosw.i != priv->plugwidth || sinw.i != priv->plugwidth) { + if (cosw.f != NULL) + visual_mem_free(cosw.f); + + if (sinw.f != NULL) + visual_mem_free(sinw.f); + + sinw.f = cosw.f = NULL; + sinw.i = cosw.i = 0; + } + + if (cosw.i == 0 || cosw.f == NULL) { + float halfPI = (float)PI / 2; + cosw.i = priv->plugwidth; + cosw.f = visual_mem_malloc0(sizeof(float) * priv->plugwidth); + for (i = 0; i < priv->plugwidth; i += step) + cosw.f[i] = cos((float)i / priv->plugwidth * PI + halfPI); + } + + if (sinw.i == 0 || sinw.f == NULL) { + float halfPI = (float)PI / 2; + sinw.i = priv->plugwidth; + sinw.f = visual_mem_malloc0(sizeof(float) * priv->plugwidth); + for (i = 0; i < priv->plugwidth; i += step) + sinw.f[i] = sin((float)i / priv->plugwidth * PI + halfPI); + } + + if (current_effect->mode_spectre == 3) { + if (y1 < 0) + y1 = 0; + if (y2 < 0) + y2 = 0; + } + + halfheight = priv->plugheight >> 1; + halfwidth = priv->plugwidth >> 1; + for (i = step; i < priv->plugwidth; i += step) { + old_y1 = y1; + old_y2 = y2; + y1 = ((data[1][(i << 9) / priv->plugwidth / density_lines] * 256) * + current_effect->spectral_amplitude * priv->plugheight) * + (1.0 / 4096.0); + y2 = ((data[0][(i << 9) / priv->plugwidth / density_lines] * 256) * + current_effect->spectral_amplitude * priv->plugheight) * + (1.0 / 4096.0); + + switch (current_effect->mode_spectre) { + case 0: + _inf_line(priv, i - step, halfheight + shift + old_y2, i, + halfheight + shift + y2, current_effect->spectral_color); + break; + case 1: + _inf_line(priv, i - step, halfheight + shift + old_y1, i, + halfheight + shift + y1, current_effect->spectral_color); + _inf_line(priv, i - step, halfheight - shift + old_y2, i, + halfheight - shift + y2, current_effect->spectral_color); + break; + case 2: + _inf_line(priv, i - step, halfheight + shift + old_y1, i, + halfheight + shift + y1, current_effect->spectral_color); + _inf_line(priv, i - step, halfheight - shift + old_y1, i, + halfheight - shift + y1, current_effect->spectral_color); + _inf_line(priv, halfwidth + shift + old_y2, i - step, + halfwidth + shift + y2, i, current_effect->spectral_color); + _inf_line(priv, halfwidth - shift + old_y2, i - step, + halfwidth - shift + y2, i, current_effect->spectral_color); + break; + case 3: + if (y1 < 0) + y1 = 0; + if (y2 < 0) + y2 = 0; + case 4: + _inf_line(priv, halfwidth + cosw.f[i - step] * (shift + old_y1), + halfheight + sinw.f[i - step] * (shift + old_y1), + halfwidth + cosw.f[i] * (shift + y1), + halfheight + sinw.f[i] * (shift + y1), + current_effect->spectral_color); + _inf_line(priv, halfwidth - cosw.f[i - step] * (shift + old_y2), + halfheight + sinw.f[i - step] * (shift + old_y2), + halfwidth - cosw.f[i] * (shift + y2), + halfheight + sinw.f[i] * (shift + y2), + current_effect->spectral_color); + break; + } + } + + if (current_effect->mode_spectre == 3 || current_effect->mode_spectre == 4) + _inf_line(priv, halfwidth + cosw.f[priv->plugwidth - step] * (shift + y1), + halfheight + sinw.f[priv->plugwidth - step] * (shift + y1), + halfwidth - cosw.f[priv->plugwidth - step] * (shift + y2), + halfheight + sinw.f[priv->plugwidth - step] * (shift + y2), + current_effect->spectral_color); } -void _inf_curve(InfinitePrivate *priv, t_effect* current_effect) -{ - int i,j,k; - float v,vr; - float x,y; - float amplitude=(float)current_effect->curve_amplitude/256; - - for (j=0;j<2;j++) { - v=80; - vr=0.001; - k=current_effect->x_curve; - for (i=0;i<64;i++) { - x=cos((float)(k)/(v+v*j*1.34))*priv->plugheight*amplitude; - y=sin((float)(k)/(1.756*(v+v*j*0.93)))*priv->plugheight*amplitude; - _inf_plot2(priv, x*cos((float)k*vr)+y*sin((float)k*vr)+priv->plugwidth/2, - x*sin((float)k*vr)-y*cos((float)k*vr)+priv->plugheight/2, - current_effect->curve_color); - k++; - } - } - current_effect->x_curve=k; +void _inf_curve(InfinitePrivate *priv, t_effect *current_effect) { + int i, j, k; + float v, vr; + float x, y; + float amplitude = (float)current_effect->curve_amplitude / 256; + + for (j = 0; j < 2; j++) { + v = 80; + vr = 0.001; + k = current_effect->x_curve; + for (i = 0; i < 64; i++) { + x = cos((float)(k) / (v + v * j * 1.34)) * priv->plugheight * amplitude; + y = sin((float)(k) / (1.756 * (v + v * j * 0.93))) * priv->plugheight * + amplitude; + _inf_plot2(priv, + x * cos((float)k * vr) + y * sin((float)k * vr) + + priv->plugwidth / 2, + x * sin((float)k * vr) - y * cos((float)k * vr) + + priv->plugheight / 2, + current_effect->curve_color); + k++; + } + } + current_effect->x_curve = k; } -void _inf_init_display(InfinitePrivate *priv) -{ - int allocsize; - priv->plugwidth = priv->plugwidth; - priv->plugheight = priv->plugheight; +void _inf_init_display(InfinitePrivate *priv) { + int allocsize; + priv->plugwidth = priv->plugwidth; + priv->plugheight = priv->plugheight; - allocsize = priv->plugwidth * priv->plugheight; + allocsize = priv->plugwidth * priv->plugheight; - priv->surface1 = (uint8_t *) visual_mem_malloc0(allocsize); - priv->surface2 = (uint8_t *) visual_mem_malloc0(allocsize); + priv->surface1 = (uint8_t *)visual_mem_malloc0(allocsize); + priv->surface2 = (uint8_t *)visual_mem_malloc0(allocsize); } - diff --git a/libvisual-plugins/plugins/actor/infinite/display.h b/libvisual-plugins/plugins/actor/infinite/display.h index 934faac5e..04e7e30b3 100644 --- a/libvisual-plugins/plugins/actor/infinite/display.h +++ b/libvisual-plugins/plugins/actor/infinite/display.h @@ -5,13 +5,14 @@ #include "main.h" -void _inf_display (InfinitePrivate *priv, uint8_t *surf, int pitch); +void _inf_display(InfinitePrivate *priv, uint8_t *surf, int pitch); void _inf_generate_colors(InfinitePrivate *priv); -void _inf_change_color(InfinitePrivate *priv, int old_p,int p,int w); -void _inf_blur(InfinitePrivate *priv, t_interpol* vector_field); -void _inf_spectral(InfinitePrivate *priv, t_effect* current_effect, float data[2][512]); -void _inf_curve(InfinitePrivate *priv, t_effect* current_effect); +void _inf_change_color(InfinitePrivate *priv, int old_p, int p, int w); +void _inf_blur(InfinitePrivate *priv, t_interpol *vector_field); +void _inf_spectral(InfinitePrivate *priv, t_effect *current_effect, + float data[2][512]); +void _inf_curve(InfinitePrivate *priv, t_effect *current_effect); void _inf_init_display(InfinitePrivate *priv); #endif /* _INF_DISPLAY_H */ diff --git a/libvisual-plugins/plugins/actor/infinite/file.c b/libvisual-plugins/plugins/actor/infinite/file.c index 22891f60d..5784e0c9c 100644 --- a/libvisual-plugins/plugins/actor/infinite/file.c +++ b/libvisual-plugins/plugins/actor/infinite/file.c @@ -6,301 +6,242 @@ #include "renderer.h" t_effect _inf_effects[] = { - { - .num_effect = 6, - .x_curve = 1842944, - .curve_color = 0, - .curve_amplitude = 59, - .spectral_amplitude = 14, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 82 - }, - { - .num_effect = 6, - .x_curve = 1824128, - .curve_color = 0, - .curve_amplitude = 59, - .spectral_amplitude = 11, - .spectral_color = 255, - .mode_spectre = 1, - .spectral_shift = 40 - }, - { - .num_effect = 6, - .x_curve = 1676608, - .curve_color = 0, - .curve_amplitude = 59, - .spectral_amplitude = 29, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 0 - }, - { - .num_effect = 6, - .x_curve = 1635200, - .curve_color = 0, - .curve_amplitude = 59, - .spectral_amplitude = 4, - .spectral_color = 255, - .mode_spectre = 3, - .spectral_shift = 73 - }, - { - .num_effect = 6, - .x_curve = 1598592, - .curve_color = 255, - .curve_amplitude = 75, - .spectral_amplitude = 4, - .spectral_color = 0, - .mode_spectre = 3, - .spectral_shift = 113 - }, - { - .num_effect = 5, - .x_curve = 1545728, - .curve_color = 255, - .curve_amplitude = 59, - .spectral_amplitude = 4, - .spectral_color = 255, - .mode_spectre = 1, - .spectral_shift = 98 - }, - { - .num_effect = 3, - .x_curve = 1471744, - .curve_color = 255, - .curve_amplitude = 82, - .spectral_amplitude = 41, - .spectral_color = 0, - .mode_spectre = 4, - .spectral_shift = 397 - }, - { - .num_effect = 4, - .x_curve = 1466816, - .curve_color = 255, - .curve_amplitude = 82, - .spectral_amplitude = 41, - .spectral_color = 0, - .mode_spectre = 4, - .spectral_shift = 397 - }, - { - .num_effect = 3, - .x_curve = 1405824, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 36, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 0 - }, - { - .num_effect = 4, - .x_curve = 1360256, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 15, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 82 - }, - { - .num_effect = 4, - .x_curve = 1345600, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 9, - .spectral_color = 255, - .mode_spectre = 3, - .spectral_shift = 61 - }, - { - .num_effect = 3, - .x_curve = 1265344, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 9, - .spectral_color = 255, - .mode_spectre = 1, - .spectral_shift = 73 - }, - { - .num_effect = 3, - .x_curve = 1239040, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 9, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 76 - }, - { - .num_effect = 3, - .x_curve = 1108480, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 9, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 77 - }, - { - .num_effect = 3, - .x_curve = 1084736, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 6, - .spectral_color = 255, - .mode_spectre = 3, - .spectral_shift = 63 - }, - { - .num_effect = 3, - .x_curve = 1000000, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 6, - .spectral_color = 255, - .mode_spectre = 2, - .spectral_shift = 56 - }, - { - .num_effect = 2, - .x_curve = 814848, - .curve_color = 0, - .curve_amplitude = 51, - .spectral_amplitude = 6, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 82 - }, - { - .num_effect = 0, - .x_curve = 715328, - .curve_color = 255, - .curve_amplitude = 51, - .spectral_amplitude = 6, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 102 - }, - { - .num_effect = 2, - .x_curve = 706112, - .curve_color = 255, - .curve_amplitude = 51, - .spectral_amplitude = 6, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 102 - }, - { - .num_effect = 2, - .x_curve = 657408, - .curve_color = 255, - .curve_amplitude = 58, - .spectral_amplitude = 29, - .spectral_color = 0, - .mode_spectre = 4, - .spectral_shift = 397 - }, - { - .num_effect = 2, - .x_curve = 655808, - .curve_color = 255, - .curve_amplitude = 58, - .spectral_amplitude = 29, - .spectral_color = 0, - .mode_spectre = 4, - .spectral_shift = 397 - }, - { - .num_effect = 2, - .x_curve = 612416, - .curve_color = 0, - .curve_amplitude = 84, - .spectral_amplitude = 29, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 0 - }, - { - .num_effect = 1, - .x_curve = 566272, - .curve_color = 0, - .curve_amplitude = 84, - .spectral_amplitude = 23, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 0 - }, - { - .num_effect = 1, - .x_curve = 516736, - .curve_color = 255, - .curve_amplitude = 84, - .spectral_amplitude = 10, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 0 - }, - { - .num_effect = 1, - .x_curve = 495296, - .curve_color = 255, - .curve_amplitude = 84, - .spectral_amplitude = 10, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 0 - }, - { - .num_effect = 0, - .x_curve = 375616, - .curve_color = 255, - .curve_amplitude = 84, - .spectral_amplitude = 4, - .spectral_color = 0, - .mode_spectre = 3, - .spectral_shift = 45 - }, - { - .num_effect = 0, - .x_curve = 297280, - .curve_color = 0, - .curve_amplitude = 0, - .spectral_amplitude = 11, - .spectral_color = 255, - .mode_spectre = 3, - .spectral_shift = 62 - }, - { - .num_effect = 0, - .x_curve = 253888, - .curve_color = 0, - .curve_amplitude = 0, - .spectral_amplitude = 11, - .spectral_color = 255, - .mode_spectre = 4, - .spectral_shift = 76 - }, - { - .num_effect = 0, - .x_curve = 151488, - .curve_color = 0, - .curve_amplitude = 0, - .spectral_amplitude = 43, - .spectral_color = 255, - .mode_spectre = 0, - .spectral_shift = 0 - }, + {.num_effect = 6, + .x_curve = 1842944, + .curve_color = 0, + .curve_amplitude = 59, + .spectral_amplitude = 14, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 82}, + {.num_effect = 6, + .x_curve = 1824128, + .curve_color = 0, + .curve_amplitude = 59, + .spectral_amplitude = 11, + .spectral_color = 255, + .mode_spectre = 1, + .spectral_shift = 40}, + {.num_effect = 6, + .x_curve = 1676608, + .curve_color = 0, + .curve_amplitude = 59, + .spectral_amplitude = 29, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 0}, + {.num_effect = 6, + .x_curve = 1635200, + .curve_color = 0, + .curve_amplitude = 59, + .spectral_amplitude = 4, + .spectral_color = 255, + .mode_spectre = 3, + .spectral_shift = 73}, + {.num_effect = 6, + .x_curve = 1598592, + .curve_color = 255, + .curve_amplitude = 75, + .spectral_amplitude = 4, + .spectral_color = 0, + .mode_spectre = 3, + .spectral_shift = 113}, + {.num_effect = 5, + .x_curve = 1545728, + .curve_color = 255, + .curve_amplitude = 59, + .spectral_amplitude = 4, + .spectral_color = 255, + .mode_spectre = 1, + .spectral_shift = 98}, + {.num_effect = 3, + .x_curve = 1471744, + .curve_color = 255, + .curve_amplitude = 82, + .spectral_amplitude = 41, + .spectral_color = 0, + .mode_spectre = 4, + .spectral_shift = 397}, + {.num_effect = 4, + .x_curve = 1466816, + .curve_color = 255, + .curve_amplitude = 82, + .spectral_amplitude = 41, + .spectral_color = 0, + .mode_spectre = 4, + .spectral_shift = 397}, + {.num_effect = 3, + .x_curve = 1405824, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 36, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 0}, + {.num_effect = 4, + .x_curve = 1360256, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 15, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 82}, + {.num_effect = 4, + .x_curve = 1345600, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 9, + .spectral_color = 255, + .mode_spectre = 3, + .spectral_shift = 61}, + {.num_effect = 3, + .x_curve = 1265344, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 9, + .spectral_color = 255, + .mode_spectre = 1, + .spectral_shift = 73}, + {.num_effect = 3, + .x_curve = 1239040, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 9, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 76}, + {.num_effect = 3, + .x_curve = 1108480, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 9, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 77}, + {.num_effect = 3, + .x_curve = 1084736, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 6, + .spectral_color = 255, + .mode_spectre = 3, + .spectral_shift = 63}, + {.num_effect = 3, + .x_curve = 1000000, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 6, + .spectral_color = 255, + .mode_spectre = 2, + .spectral_shift = 56}, + {.num_effect = 2, + .x_curve = 814848, + .curve_color = 0, + .curve_amplitude = 51, + .spectral_amplitude = 6, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 82}, + {.num_effect = 0, + .x_curve = 715328, + .curve_color = 255, + .curve_amplitude = 51, + .spectral_amplitude = 6, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 102}, + {.num_effect = 2, + .x_curve = 706112, + .curve_color = 255, + .curve_amplitude = 51, + .spectral_amplitude = 6, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 102}, + {.num_effect = 2, + .x_curve = 657408, + .curve_color = 255, + .curve_amplitude = 58, + .spectral_amplitude = 29, + .spectral_color = 0, + .mode_spectre = 4, + .spectral_shift = 397}, + {.num_effect = 2, + .x_curve = 655808, + .curve_color = 255, + .curve_amplitude = 58, + .spectral_amplitude = 29, + .spectral_color = 0, + .mode_spectre = 4, + .spectral_shift = 397}, + {.num_effect = 2, + .x_curve = 612416, + .curve_color = 0, + .curve_amplitude = 84, + .spectral_amplitude = 29, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 0}, + {.num_effect = 1, + .x_curve = 566272, + .curve_color = 0, + .curve_amplitude = 84, + .spectral_amplitude = 23, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 0}, + {.num_effect = 1, + .x_curve = 516736, + .curve_color = 255, + .curve_amplitude = 84, + .spectral_amplitude = 10, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 0}, + {.num_effect = 1, + .x_curve = 495296, + .curve_color = 255, + .curve_amplitude = 84, + .spectral_amplitude = 10, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 0}, + {.num_effect = 0, + .x_curve = 375616, + .curve_color = 255, + .curve_amplitude = 84, + .spectral_amplitude = 4, + .spectral_color = 0, + .mode_spectre = 3, + .spectral_shift = 45}, + {.num_effect = 0, + .x_curve = 297280, + .curve_color = 0, + .curve_amplitude = 0, + .spectral_amplitude = 11, + .spectral_color = 255, + .mode_spectre = 3, + .spectral_shift = 62}, + {.num_effect = 0, + .x_curve = 253888, + .curve_color = 0, + .curve_amplitude = 0, + .spectral_amplitude = 11, + .spectral_color = 255, + .mode_spectre = 4, + .spectral_shift = 76}, + {.num_effect = 0, + .x_curve = 151488, + .curve_color = 0, + .curve_amplitude = 0, + .spectral_amplitude = 43, + .spectral_color = 255, + .mode_spectre = 0, + .spectral_shift = 0}, }; -void _inf_load_random_effect(InfinitePrivate *priv, t_effect *effect) -{ - const size_t effect_count = sizeof(_inf_effects) / sizeof(_inf_effects[0]); - const int index = visual_random_context_int(priv->rcontext) % effect_count; - *effect = _inf_effects[index]; +void _inf_load_random_effect(InfinitePrivate *priv, t_effect *effect) { + const size_t effect_count = sizeof(_inf_effects) / sizeof(_inf_effects[0]); + const int index = visual_random_context_int(priv->rcontext) % effect_count; + *effect = _inf_effects[index]; } diff --git a/libvisual-plugins/plugins/actor/infinite/lv_infinite.c b/libvisual-plugins/plugins/actor/infinite/lv_infinite.c index 8e1bb08d8..1efbbd033 100644 --- a/libvisual-plugins/plugins/actor/infinite/lv_infinite.c +++ b/libvisual-plugins/plugins/actor/infinite/lv_infinite.c @@ -30,157 +30,156 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int act_infinite_init (VisPluginData *plugin); -static void act_infinite_cleanup (VisPluginData *plugin); -static void act_infinite_resize (VisPluginData *plugin, int width, int height); -static void act_infinite_requisition (VisPluginData *plugin, int *width, int *height); -static int act_infinite_events (VisPluginData *plugin, VisEventQueue *events); -static void act_infinite_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *act_infinite_palette (VisPluginData *plugin); - - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = act_infinite_requisition, - .palette = act_infinite_palette, - .render = act_infinite_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "infinite", - .name = "infinite plugin", - .author = N_("Original by: Julien Carme , Port by: Dennis Smit "), - .version = "0.1", - .about = N_("Infinite visual plugin"), - .help = N_("This is the libvisual plugin for the infinite visual"), - .license = VISUAL_PLUGIN_LICENSE_GPL, - - .init = act_infinite_init, - .cleanup = act_infinite_cleanup, - .events = act_infinite_events, - .plugin = &actor - }; - - return &info; +static int act_infinite_init(VisPluginData *plugin); +static void act_infinite_cleanup(VisPluginData *plugin); +static void act_infinite_resize(VisPluginData *plugin, int width, int height); +static void act_infinite_requisition(VisPluginData *plugin, int *width, + int *height); +static int act_infinite_events(VisPluginData *plugin, VisEventQueue *events); +static void act_infinite_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *act_infinite_palette(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = act_infinite_requisition, + .palette = act_infinite_palette, + .render = act_infinite_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "infinite", + .name = "infinite plugin", + .author = N_("Original by: Julien Carme , Port by: " + "Dennis Smit "), + .version = "0.1", + .about = N_("Infinite visual plugin"), + .help = N_("This is the libvisual plugin for the infinite visual"), + .license = VISUAL_PLUGIN_LICENSE_GPL, + + .init = act_infinite_init, + .cleanup = act_infinite_cleanup, + .events = act_infinite_events, + .plugin = &actor}; + + return &info; } -int act_infinite_init (VisPluginData *plugin) -{ +int act_infinite_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - InfinitePrivate *priv = visual_mem_new0 (InfinitePrivate, 1); - visual_plugin_set_private (plugin, priv); + InfinitePrivate *priv = visual_mem_new0(InfinitePrivate, 1); + visual_plugin_set_private(plugin, priv); - priv->rcontext = visual_plugin_get_random_context (plugin); + priv->rcontext = visual_plugin_get_random_context(plugin); - priv->plugwidth = 32; - priv->plugheight = 32; + priv->plugwidth = 32; + priv->plugheight = 32; - priv->pal = visual_palette_new (256); + priv->pal = visual_palette_new(256); - _inf_init_renderer (priv); - _inf_load_random_effect(priv, &priv->current_effect); + _inf_init_renderer(priv); + _inf_load_random_effect(priv, &priv->current_effect); - priv->color = visual_random_context_int_range (priv->rcontext, 0, NB_PALETTES - 1); - _inf_change_color(priv, priv->old_color, priv->color, 256); - priv->old_color = priv->color; + priv->color = + visual_random_context_int_range(priv->rcontext, 0, NB_PALETTES - 1); + _inf_change_color(priv, priv->old_color, priv->color, 256); + priv->old_color = priv->color; - priv->color = visual_random_context_int_range (priv->rcontext, 0, NB_PALETTES - 1); + priv->color = + visual_random_context_int_range(priv->rcontext, 0, NB_PALETTES - 1); - return TRUE; + return TRUE; } -static void act_infinite_cleanup (VisPluginData *plugin) -{ - InfinitePrivate *priv; +static void act_infinite_cleanup(VisPluginData *plugin) { + InfinitePrivate *priv; - priv = visual_plugin_get_private (plugin); + priv = visual_plugin_get_private(plugin); - _inf_close_renderer (priv); + _inf_close_renderer(priv); - visual_palette_free (priv->pal); - visual_mem_free (priv); + visual_palette_free(priv->pal); + visual_mem_free(priv); } -static void act_infinite_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void act_infinite_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - while (reqw % 2 || (reqw / 2) % 2) - reqw--; + while (reqw % 2 || (reqw / 2) % 2) + reqw--; - while (reqh % 2 || (reqh / 2) % 2) - reqh--; + while (reqh % 2 || (reqh / 2) % 2) + reqh--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static void act_infinite_resize (VisPluginData *plugin, int width, int height) -{ - InfinitePrivate *priv = visual_plugin_get_private (plugin); - priv->plugwidth = width; - priv->plugheight = height; +static void act_infinite_resize(VisPluginData *plugin, int width, int height) { + InfinitePrivate *priv = visual_plugin_get_private(plugin); + priv->plugwidth = width; + priv->plugheight = height; - _inf_close_renderer (priv); - _inf_init_renderer (priv); + _inf_close_renderer(priv); + _inf_init_renderer(priv); } -static int act_infinite_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - act_infinite_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; - default: /* to avoid warnings */ - break; - } - } - - return TRUE; +static int act_infinite_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; + + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + act_infinite_resize(plugin, ev.event.resize.width, + ev.event.resize.height); + break; + default: /* to avoid warnings */ + break; + } + } + + return TRUE; } -static VisPalette *act_infinite_palette (VisPluginData *plugin) -{ - InfinitePrivate *priv; +static VisPalette *act_infinite_palette(VisPluginData *plugin) { + InfinitePrivate *priv; - visual_return_val_if_fail (plugin != NULL, NULL); + visual_return_val_if_fail(plugin != NULL, NULL); - priv = visual_plugin_get_private (plugin); + priv = visual_plugin_get_private(plugin); - return priv->pal; + return priv->pal; } -static void act_infinite_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - InfinitePrivate *priv = visual_plugin_get_private (plugin); +static void act_infinite_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + InfinitePrivate *priv = visual_plugin_get_private(plugin); - VisBuffer *pcm_left = visual_buffer_new_wrap_data(priv->pcm_data[0], sizeof (float) * 512, 0); - visual_audio_get_sample (audio, pcm_left, VISUAL_AUDIO_CHANNEL_LEFT); - visual_buffer_unref(pcm_left); + VisBuffer *pcm_left = + visual_buffer_new_wrap_data(priv->pcm_data[0], sizeof(float) * 512, 0); + visual_audio_get_sample(audio, pcm_left, VISUAL_AUDIO_CHANNEL_LEFT); + visual_buffer_unref(pcm_left); - VisBuffer *pcm_right = visual_buffer_new_wrap_data(priv->pcm_data[1], sizeof (float) * 512, 0); - visual_audio_get_sample (audio, pcm_right, VISUAL_AUDIO_CHANNEL_RIGHT); - visual_buffer_unref(pcm_right); + VisBuffer *pcm_right = + visual_buffer_new_wrap_data(priv->pcm_data[1], sizeof(float) * 512, 0); + visual_audio_get_sample(audio, pcm_right, VISUAL_AUDIO_CHANNEL_RIGHT); + visual_buffer_unref(pcm_right); - _inf_renderer (priv); - _inf_display (priv, (uint8_t *) visual_video_get_pixels (video), visual_video_get_pitch (video)); + _inf_renderer(priv); + _inf_display(priv, (uint8_t *)visual_video_get_pixels(video), + visual_video_get_pitch(video)); } diff --git a/libvisual-plugins/plugins/actor/infinite/main.h b/libvisual-plugins/plugins/actor/infinite/main.h index 6d0f8bcd4..29f3ad4b2 100644 --- a/libvisual-plugins/plugins/actor/infinite/main.h +++ b/libvisual-plugins/plugins/actor/infinite/main.h @@ -6,59 +6,59 @@ #define NB_PALETTES 5 struct infinite_col { - uint8_t r; - uint8_t g; - uint8_t b; + uint8_t r; + uint8_t g; + uint8_t b; }; typedef struct t_coord { - int x,y; + int x, y; } t_coord; typedef struct t_complex { - float x,y; + float x, y; } t_complex; typedef struct t_interpol { - uint32_t coord ; //coordinates of the top left pixel. - uint32_t weight; //32 bits = 4*8= weights of the four corners + uint32_t coord; // coordinates of the top left pixel. + uint32_t weight; // 32 bits = 4*8= weights of the four corners } t_interpol; typedef struct t_effect { - int num_effect; - int x_curve; - int curve_color; - int curve_amplitude; - int spectral_amplitude; - int spectral_color; - int mode_spectre; - int spectral_shift; + int num_effect; + int x_curve; + int curve_color; + int curve_amplitude; + int spectral_amplitude; + int spectral_color; + int mode_spectre; + int spectral_shift; } t_effect; typedef struct { - float pcm_data[2][512]; - int plugwidth; - int plugheight; - VisPalette *pal; + float pcm_data[2][512]; + int plugwidth; + int plugheight; + VisPalette *pal; - /* Random context for this plugin */ - VisRandomContext *rcontext; + /* Random context for this plugin */ + VisRandomContext *rcontext; - uint8_t *surface1; - uint8_t *surface2; + uint8_t *surface1; + uint8_t *surface2; - int teff; - int tcol; + int teff; + int tcol; - struct infinite_col color_table[NB_PALETTES][256]; + struct infinite_col color_table[NB_PALETTES][256]; - int old_color; - int color; - int t_last_color; - int t_last_effect; + int old_color; + int color; + int t_last_color; + int t_last_effect; - t_effect current_effect; - t_interpol *vector_field; + t_effect current_effect; + t_interpol *vector_field; } InfinitePrivate; #endif /* _INF_MAIN_H */ diff --git a/libvisual-plugins/plugins/actor/infinite/renderer.c b/libvisual-plugins/plugins/actor/infinite/renderer.c index cdc215d55..1cdf377ee 100644 --- a/libvisual-plugins/plugins/actor/infinite/renderer.c +++ b/libvisual-plugins/plugins/actor/infinite/renderer.c @@ -13,56 +13,53 @@ #include "compute.h" #include "display.h" -#define wrap(a) ( a < 0 ? 0 : ( a > 255 ? 255 : a )) +#define wrap(a) (a < 0 ? 0 : (a > 255 ? 255 : a)) -void _inf_init_renderer(InfinitePrivate *priv) -{ - int allocsize; +void _inf_init_renderer(InfinitePrivate *priv) { + int allocsize; - allocsize = ((priv->plugwidth * priv->plugheight) + (priv->plugwidth * 2)) * NB_FCT * sizeof(t_interpol); + allocsize = ((priv->plugwidth * priv->plugheight) + (priv->plugwidth * 2)) * + NB_FCT * sizeof(t_interpol); - priv->teff = 500; - priv->tcol = 100; + priv->teff = 500; + priv->tcol = 100; - _inf_init_display(priv); - _inf_generate_colors(priv); - _inf_load_random_effect(priv, &priv->current_effect); + _inf_init_display(priv); + _inf_generate_colors(priv); + _inf_load_random_effect(priv, &priv->current_effect); - priv->vector_field = (t_interpol*) visual_mem_malloc0(allocsize); - visual_mem_set (priv->vector_field, 0, allocsize); + priv->vector_field = (t_interpol *)visual_mem_malloc0(allocsize); + visual_mem_set(priv->vector_field, 0, allocsize); - _inf_generate_vector_field(priv, priv->vector_field); + _inf_generate_vector_field(priv, priv->vector_field); } +void _inf_renderer(InfinitePrivate *priv) { + _inf_blur(priv, &priv->vector_field[priv->plugwidth * priv->plugheight * + priv->current_effect.num_effect]); + _inf_spectral(priv, &priv->current_effect, priv->pcm_data); + _inf_curve(priv, &priv->current_effect); -void _inf_renderer(InfinitePrivate *priv) -{ - _inf_blur(priv, &priv->vector_field[priv->plugwidth*priv->plugheight*priv->current_effect.num_effect]); - _inf_spectral(priv, &priv->current_effect, priv->pcm_data); - _inf_curve(priv, &priv->current_effect); - - if (priv->t_last_color<=32) { - _inf_change_color(priv, priv->old_color, - priv->color, - priv->t_last_color*8); - } - priv->t_last_color+=1; - priv->t_last_effect+=1; - if (priv->t_last_effect%priv->teff==0) { - _inf_load_random_effect(priv, &priv->current_effect); - priv->t_last_effect=0; - } - if (priv->t_last_color%priv->tcol==0) { - priv->old_color=priv->color; - priv->color=visual_random_context_int_range(priv->rcontext, 0, NB_PALETTES - 1); - priv->t_last_color=0; - } + if (priv->t_last_color <= 32) { + _inf_change_color(priv, priv->old_color, priv->color, + priv->t_last_color * 8); + } + priv->t_last_color += 1; + priv->t_last_effect += 1; + if (priv->t_last_effect % priv->teff == 0) { + _inf_load_random_effect(priv, &priv->current_effect); + priv->t_last_effect = 0; + } + if (priv->t_last_color % priv->tcol == 0) { + priv->old_color = priv->color; + priv->color = + visual_random_context_int_range(priv->rcontext, 0, NB_PALETTES - 1); + priv->t_last_color = 0; + } } -void _inf_close_renderer(InfinitePrivate *priv) -{ - visual_mem_free(priv->surface1); - visual_mem_free(priv->surface2); - visual_mem_free(priv->vector_field); +void _inf_close_renderer(InfinitePrivate *priv) { + visual_mem_free(priv->surface1); + visual_mem_free(priv->surface2); + visual_mem_free(priv->vector_field); } - diff --git a/libvisual-plugins/plugins/actor/jakdaw/actor_jakdaw.c b/libvisual-plugins/plugins/actor/jakdaw/actor_jakdaw.c index 30a63b980..8d74565e6 100644 --- a/libvisual-plugins/plugins/actor/jakdaw/actor_jakdaw.c +++ b/libvisual-plugins/plugins/actor/jakdaw/actor_jakdaw.c @@ -28,221 +28,209 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int act_jakdaw_init (VisPluginData *plugin); -static void act_jakdaw_cleanup (VisPluginData *plugin); -static void act_jakdaw_requisition (VisPluginData *plugin, int *width, int *height); -static void act_jakdaw_resize (VisPluginData *plugin, int width, int height); -static int act_jakdaw_events (VisPluginData *plugin, VisEventQueue *events); -static void act_jakdaw_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *act_jakdaw_palette (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = act_jakdaw_requisition, - .palette = act_jakdaw_palette, - .render = act_jakdaw_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_32BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "jakdaw", - .name = "Jakdaw plugin", - .author = N_("Original by: Christopher Wilson , Port by: Dennis Smit "), - .version = "0.0.1", - .about = N_("jakdaw visual plugin"), - .help = N_("This is the libvisual port of the xmms Jakdaw plugin"), - .license = VISUAL_PLUGIN_LICENSE_GPL, - - .init = act_jakdaw_init, - .cleanup = act_jakdaw_cleanup, - .events = act_jakdaw_events, - .plugin = &actor - }; - - return &info; +static int act_jakdaw_init(VisPluginData *plugin); +static void act_jakdaw_cleanup(VisPluginData *plugin); +static void act_jakdaw_requisition(VisPluginData *plugin, int *width, + int *height); +static void act_jakdaw_resize(VisPluginData *plugin, int width, int height); +static int act_jakdaw_events(VisPluginData *plugin, VisEventQueue *events); +static void act_jakdaw_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *act_jakdaw_palette(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = act_jakdaw_requisition, + .palette = act_jakdaw_palette, + .render = act_jakdaw_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_32BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "jakdaw", + .name = "Jakdaw plugin", + .author = N_("Original by: Christopher Wilson , Port by: " + "Dennis Smit "), + .version = "0.0.1", + .about = N_("jakdaw visual plugin"), + .help = N_("This is the libvisual port of the xmms Jakdaw plugin"), + .license = VISUAL_PLUGIN_LICENSE_GPL, + + .init = act_jakdaw_init, + .cleanup = act_jakdaw_cleanup, + .events = act_jakdaw_events, + .plugin = &actor}; + + return &info; } -static int act_jakdaw_init (VisPluginData *plugin) -{ +static int act_jakdaw_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - JakdawPrivate *priv = visual_mem_new0 (JakdawPrivate, 1); - visual_plugin_set_private (plugin, priv); - - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_integer ("zoom_mode", N_("Zoom mode"), - FEEDBACK_ZOOMRIPPLE, - NULL), - visual_param_new_integer ("plotter_trigger", N_("Plotter trigger"), - PLOTTER_COLOUR_MUSICTRIG, - NULL), - visual_param_new_integer ("plotter type", N_("Plotter type"), - PLOTTER_SCOPE_LINES, - NULL), - NULL); - - /* - - static VisParamEntry zoomparamchoices[] = { - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Zoom ripple", FEEDBACK_ZOOMRIPPLE), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Blur only", FEEDBACK_BLURONLY), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Zoom rotate", FEEDBACK_ZOOMROTATE), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Scroll", FEEDBACK_SCROLL), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Into screen", FEEDBACK_INTOSCREEN), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Ripple", FEEDBACK_NEWRIPPLE), - VISUAL_PARAM_LIST_END - }; - - static VisParamEntry colorparamchoices[] = { - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Solid", PLOTTER_COLOUR_SOLID), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Random", PLOTTER_COLOUR_RANDOM), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("On music", PLOTTER_COLOUR_MUSICTRIG), - VISUAL_PARAM_LIST_END - }; - - static VisParamEntry scopeparamchoices[] = { - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Lines", PLOTTER_SCOPE_LINES), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Dots", PLOTTER_SCOPE_DOTS), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Solid", PLOTTER_SCOPE_SOLID), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Nothing", PLOTTER_SCOPE_NOTHING), - VISUAL_PARAM_LIST_END - }; - */ - - priv->rcontext = visual_plugin_get_random_context (plugin); - - priv->decay_rate = 1; - - priv->zoom_ripplesize = 32; - priv->zoom_ripplefact = 0.1; - priv->zoom_zoomfact = 0.9; - - priv->plotter_amplitude = 0.5; - - /* FIXME make param of this one as well */ - priv->plotter_scopecolor = 0xff00ff; - - priv->pcmbuf = visual_buffer_new_allocate (512 * sizeof (float)); - priv->freqbuf = visual_buffer_new_allocate (256 * sizeof (float)); - - return TRUE; + JakdawPrivate *priv = visual_mem_new0(JakdawPrivate, 1); + visual_plugin_set_private(plugin, priv); + + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, + visual_param_new_integer("zoom_mode", N_("Zoom mode"), + FEEDBACK_ZOOMRIPPLE, NULL), + visual_param_new_integer("plotter_trigger", N_("Plotter trigger"), + PLOTTER_COLOUR_MUSICTRIG, NULL), + visual_param_new_integer("plotter type", N_("Plotter type"), + PLOTTER_SCOPE_LINES, NULL), + NULL); + + /* + + static VisParamEntry zoomparamchoices[] = { + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Zoom ripple", FEEDBACK_ZOOMRIPPLE), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Blur only", FEEDBACK_BLURONLY), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Zoom rotate", FEEDBACK_ZOOMROTATE), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Scroll", FEEDBACK_SCROLL), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Into screen", FEEDBACK_INTOSCREEN), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Ripple", FEEDBACK_NEWRIPPLE), + VISUAL_PARAM_LIST_END + }; + + static VisParamEntry colorparamchoices[] = { + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Solid", PLOTTER_COLOUR_SOLID), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Random", PLOTTER_COLOUR_RANDOM), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("On music", PLOTTER_COLOUR_MUSICTRIG), + VISUAL_PARAM_LIST_END + }; + + static VisParamEntry scopeparamchoices[] = { + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Lines", PLOTTER_SCOPE_LINES), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Dots", PLOTTER_SCOPE_DOTS), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Solid", PLOTTER_SCOPE_SOLID), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Nothing", PLOTTER_SCOPE_NOTHING), + VISUAL_PARAM_LIST_END + }; + */ + + priv->rcontext = visual_plugin_get_random_context(plugin); + + priv->decay_rate = 1; + + priv->zoom_ripplesize = 32; + priv->zoom_ripplefact = 0.1; + priv->zoom_zoomfact = 0.9; + + priv->plotter_amplitude = 0.5; + + /* FIXME make param of this one as well */ + priv->plotter_scopecolor = 0xff00ff; + + priv->pcmbuf = visual_buffer_new_allocate(512 * sizeof(float)); + priv->freqbuf = visual_buffer_new_allocate(256 * sizeof(float)); + + return TRUE; } -static void act_jakdaw_cleanup (VisPluginData *plugin) -{ - JakdawPrivate *priv = visual_plugin_get_private (plugin); +static void act_jakdaw_cleanup(VisPluginData *plugin) { + JakdawPrivate *priv = visual_plugin_get_private(plugin); - _jakdaw_feedback_close (priv); + _jakdaw_feedback_close(priv); - visual_buffer_unref (priv->pcmbuf); - visual_buffer_unref (priv->freqbuf); + visual_buffer_unref(priv->pcmbuf); + visual_buffer_unref(priv->freqbuf); - visual_mem_free (priv); + visual_mem_free(priv); } -static void act_jakdaw_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void act_jakdaw_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static void act_jakdaw_resize (VisPluginData *plugin, int width, int height) -{ - JakdawPrivate *priv = visual_plugin_get_private (plugin); +static void act_jakdaw_resize(VisPluginData *plugin, int width, int height) { + JakdawPrivate *priv = visual_plugin_get_private(plugin); - priv->xres = width; - priv->yres = height; + priv->xres = width; + priv->yres = height; - _jakdaw_feedback_reset (priv, width, height); + _jakdaw_feedback_reset(priv, width, height); } -static int act_jakdaw_events (VisPluginData *plugin, VisEventQueue *events) -{ - JakdawPrivate *priv = visual_plugin_get_private (plugin); - VisEvent ev; - VisParam *param; +static int act_jakdaw_events(VisPluginData *plugin, VisEventQueue *events) { + JakdawPrivate *priv = visual_plugin_get_private(plugin); + VisEvent ev; + VisParam *param; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - act_jakdaw_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + act_jakdaw_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; - case VISUAL_EVENT_PARAM: - param = ev.event.param.param; + case VISUAL_EVENT_PARAM: + param = ev.event.param.param; - visual_log (VISUAL_LOG_DEBUG, "Param changed: %s", visual_param_get_name (param)); + visual_log(VISUAL_LOG_DEBUG, "Param changed: %s", + visual_param_get_name(param)); - if (visual_param_has_name (param, "zoom mode")) { - visual_log (VISUAL_LOG_DEBUG, "New value for the zoom mode param: %d", - visual_param_get_value_integer (param)); + if (visual_param_has_name(param, "zoom mode")) { + visual_log(VISUAL_LOG_DEBUG, "New value for the zoom mode param: %d", + visual_param_get_value_integer(param)); - priv->zoom_mode = visual_param_get_value_integer (param); + priv->zoom_mode = visual_param_get_value_integer(param); - _jakdaw_feedback_reset (priv, priv->xres, priv->yres); - } - else if (visual_param_has_name (param, "plotter trigger")) { - visual_log (VISUAL_LOG_DEBUG, "New value for the plotter trigger param: %d", - visual_param_get_value_integer (param)); + _jakdaw_feedback_reset(priv, priv->xres, priv->yres); + } else if (visual_param_has_name(param, "plotter trigger")) { + visual_log(VISUAL_LOG_DEBUG, + "New value for the plotter trigger param: %d", + visual_param_get_value_integer(param)); - priv->plotter_colortype = visual_param_get_value_integer (param); + priv->plotter_colortype = visual_param_get_value_integer(param); - } - else if (visual_param_has_name (param, "plotter type")) { - visual_log (VISUAL_LOG_DEBUG, "New value for the plotter type param: %d", - visual_param_get_value_integer (param)); + } else if (visual_param_has_name(param, "plotter type")) { + visual_log(VISUAL_LOG_DEBUG, "New value for the plotter type param: %d", + visual_param_get_value_integer(param)); - priv->plotter_scopetype = visual_param_get_value_integer (param); + priv->plotter_scopetype = visual_param_get_value_integer(param); - _jakdaw_feedback_reset (priv, priv->xres, priv->yres); - } + _jakdaw_feedback_reset(priv, priv->xres, priv->yres); + } - break; + break; - default: /* to avoid warnings */ - break; - } + default: /* to avoid warnings */ + break; } + } - return TRUE; + return TRUE; } -static VisPalette *act_jakdaw_palette (VisPluginData *plugin) -{ - return NULL; -} +static VisPalette *act_jakdaw_palette(VisPluginData *plugin) { return NULL; } -static void act_jakdaw_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - JakdawPrivate *priv = visual_plugin_get_private (plugin); - uint32_t *vscr = visual_video_get_pixels (video); +static void act_jakdaw_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + JakdawPrivate *priv = visual_plugin_get_private(plugin); + uint32_t *vscr = visual_video_get_pixels(video); - visual_audio_get_sample_mixed_simple (audio, priv->pcmbuf, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); + visual_audio_get_sample_mixed_simple(audio, priv->pcmbuf, 2, + VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); - visual_audio_get_spectrum_for_sample (priv->freqbuf, priv->pcmbuf, TRUE); + visual_audio_get_spectrum_for_sample(priv->freqbuf, priv->pcmbuf, TRUE); - _jakdaw_feedback_render (priv, vscr); - _jakdaw_plotter_draw (priv, - visual_buffer_get_data (priv->pcmbuf), - visual_buffer_get_data (priv->freqbuf), vscr); + _jakdaw_feedback_render(priv, vscr); + _jakdaw_plotter_draw(priv, visual_buffer_get_data(priv->pcmbuf), + visual_buffer_get_data(priv->freqbuf), vscr); } - diff --git a/libvisual-plugins/plugins/actor/jakdaw/actor_jakdaw.h b/libvisual-plugins/plugins/actor/jakdaw/actor_jakdaw.h index 873a2bfdd..6ac13b1cd 100644 --- a/libvisual-plugins/plugins/actor/jakdaw/actor_jakdaw.h +++ b/libvisual-plugins/plugins/actor/jakdaw/actor_jakdaw.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2004, 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -27,57 +27,56 @@ #include typedef enum { - PLOTTER_SCOPE_LINES, - PLOTTER_SCOPE_DOTS, - PLOTTER_SCOPE_SOLID, - PLOTTER_SCOPE_NOTHING + PLOTTER_SCOPE_LINES, + PLOTTER_SCOPE_DOTS, + PLOTTER_SCOPE_SOLID, + PLOTTER_SCOPE_NOTHING } JakdawPlotterOptions; typedef enum { - PLOTTER_COLOUR_SOLID, - PLOTTER_COLOUR_RANDOM, - PLOTTER_COLOUR_MUSICTRIG + PLOTTER_COLOUR_SOLID, + PLOTTER_COLOUR_RANDOM, + PLOTTER_COLOUR_MUSICTRIG } JakdawPlotterColor; -typedef enum -{ - FEEDBACK_ZOOMRIPPLE, - FEEDBACK_BLURONLY, - FEEDBACK_ZOOMROTATE, - FEEDBACK_SCROLL, - FEEDBACK_INTOSCREEN, - FEEDBACK_NEWRIPPLE +typedef enum { + FEEDBACK_ZOOMRIPPLE, + FEEDBACK_BLURONLY, + FEEDBACK_ZOOMROTATE, + FEEDBACK_SCROLL, + FEEDBACK_INTOSCREEN, + FEEDBACK_NEWRIPPLE } JakdawFeedbackType; typedef struct { - int xres; - int yres; + int xres; + int yres; - int decay_rate; + int decay_rate; - JakdawFeedbackType zoom_mode; - double zoom_ripplesize; - double zoom_ripplefact; - double zoom_zoomfact; + JakdawFeedbackType zoom_mode; + double zoom_ripplesize; + double zoom_ripplefact; + double zoom_zoomfact; - float plotter_amplitude; - JakdawPlotterColor plotter_colortype; - int plotter_scopecolor; - JakdawPlotterOptions plotter_scopetype; + float plotter_amplitude; + JakdawPlotterColor plotter_colortype; + int plotter_scopecolor; + JakdawPlotterOptions plotter_scopetype; - /* Feedback privates */ - uint32_t *table; - uint32_t *new_image; - int tableptr; + /* Feedback privates */ + uint32_t *table; + uint32_t *new_image; + int tableptr; - /* PCM Buffer */ - VisBuffer *pcmbuf; + /* PCM Buffer */ + VisBuffer *pcmbuf; - /* Spectrum buffer */ - VisBuffer *freqbuf; + /* Spectrum buffer */ + VisBuffer *freqbuf; - /* Plugin it's random context */ - VisRandomContext *rcontext; + /* Plugin it's random context */ + VisRandomContext *rcontext; } JakdawPrivate; #endif /* _ACTOR_JAKDAW_H */ diff --git a/libvisual-plugins/plugins/actor/jakdaw/feedback.c b/libvisual-plugins/plugins/actor/jakdaw/feedback.c index a605a7b18..614c077d8 100644 --- a/libvisual-plugins/plugins/actor/jakdaw/feedback.c +++ b/libvisual-plugins/plugins/actor/jakdaw/feedback.c @@ -1,8 +1,8 @@ -/* +/* * Jakdaw's XMMS Plugin. * Copyright (C) 1999, 2000, Christopher Wilson. * - * Email: + * Email: * Project Homepage: * * This program is free software; you can redistribute it and/or modify @@ -24,11 +24,12 @@ #include "feedback.h" -typedef uint32_t (*transform_function) (JakdawPrivate *priv, int x, int y); +typedef uint32_t (*transform_function)(JakdawPrivate *priv, int x, int y); static void init_table(JakdawPrivate *priv); static void table_store(JakdawPrivate *priv, int x); -static void blur_then(JakdawPrivate *priv, int x, int y, transform_function func); +static void blur_then(JakdawPrivate *priv, int x, int y, + transform_function func); /* Transforms */ static uint32_t nothing(JakdawPrivate *priv, int x, int y); @@ -38,248 +39,258 @@ static uint32_t zoom_ripple(JakdawPrivate *priv, int x, int y); static uint32_t into_screen(JakdawPrivate *priv, int x, int y); static uint32_t zoom_ripplenew(JakdawPrivate *priv, int x, int y); -void _jakdaw_feedback_init(JakdawPrivate *priv, int x, int y) -{ - int a, b; - - init_table(priv); - priv->new_image= visual_mem_malloc0 (priv->xres*priv->yres*4); - - for(b=0;byres;b++) - for(a=0;axres;a++) - { - switch(priv->zoom_mode) - { - case FEEDBACK_ZOOMRIPPLE: blur_then(priv, a,b,zoom_ripple); break; - case FEEDBACK_BLURONLY: blur_then(priv, a,b,nothing); break; - case FEEDBACK_ZOOMROTATE: blur_then(priv, a,b,zoom_rotate); break; - case FEEDBACK_SCROLL: blur_then(priv, a,b,scroll); break; - case FEEDBACK_INTOSCREEN: blur_then(priv, a,b,into_screen); break; - case FEEDBACK_NEWRIPPLE: blur_then(priv, a,b,zoom_ripplenew); break; - default: blur_then(priv, a,b,nothing); - } - } +void _jakdaw_feedback_init(JakdawPrivate *priv, int x, int y) { + int a, b; + + init_table(priv); + priv->new_image = visual_mem_malloc0(priv->xres * priv->yres * 4); + + for (b = 0; b < priv->yres; b++) + for (a = 0; a < priv->xres; a++) { + switch (priv->zoom_mode) { + case FEEDBACK_ZOOMRIPPLE: + blur_then(priv, a, b, zoom_ripple); + break; + case FEEDBACK_BLURONLY: + blur_then(priv, a, b, nothing); + break; + case FEEDBACK_ZOOMROTATE: + blur_then(priv, a, b, zoom_rotate); + break; + case FEEDBACK_SCROLL: + blur_then(priv, a, b, scroll); + break; + case FEEDBACK_INTOSCREEN: + blur_then(priv, a, b, into_screen); + break; + case FEEDBACK_NEWRIPPLE: + blur_then(priv, a, b, zoom_ripplenew); + break; + default: + blur_then(priv, a, b, nothing); + } + } } -void _jakdaw_feedback_reset(JakdawPrivate *priv, int x, int y) -{ - // Check whether res or feedback type have changed here - _jakdaw_feedback_close(priv); - _jakdaw_feedback_init(priv, x,y); +void _jakdaw_feedback_reset(JakdawPrivate *priv, int x, int y) { + // Check whether res or feedback type have changed here + _jakdaw_feedback_close(priv); + _jakdaw_feedback_init(priv, x, y); } -void _jakdaw_feedback_close(JakdawPrivate *priv) -{ - if (priv->new_image != NULL) - visual_mem_free (priv->new_image); +void _jakdaw_feedback_close(JakdawPrivate *priv) { + if (priv->new_image != NULL) + visual_mem_free(priv->new_image); - if (priv->table != NULL) - visual_mem_free (priv->table); + if (priv->table != NULL) + visual_mem_free(priv->table); } -void _jakdaw_feedback_render(JakdawPrivate *priv, uint32_t *vscr) -{ - int x,tptr,niptr,a; - int r,g,b; - int np, rdr, gdr, bdr; - - /* Most feedback effects don't take well to the middle pixel becoming - * a bright colour - so we just blank it here. Most effects now rely on - * this as a black pixel to be used instead of those that fall off the - * edges of the screen. */ - - vscr[((priv->yres>>1)*priv->xres)+(priv->xres>>1)]=0; - - tptr=niptr=0; - - np=priv->xres*priv->yres; - rdr=priv->decay_rate<<2; - gdr=priv->decay_rate<<10; - bdr=priv->decay_rate<<18; - - for(x=0;xtable[tptr++]]; - r=a&0xff; - g=a&0xff00; - b=a&0xff0000; - - a=vscr[priv->table[tptr++]]; - r+=a&0xff; - g+=a&0xff00; - b+=a&0xff0000; - - a=vscr[priv->table[tptr++]]; - r+=a&0xff; - g+=a&0xff00; - b+=a&0xff0000; - - a=vscr[priv->table[tptr++]]; - r+=a&0xff; - g+=a&0xff00; - b+=a&0xff0000; - - r=r>rdr ? r-rdr : 0; - g=g>gdr ? g-gdr : 0; - b=b>bdr ? b-bdr : 0; - - a=(r&0x3fc)|(g&0x3fc00)|(b&0x3fc0000); - a>>=2; - - priv->new_image[niptr++]=a; - - } - - visual_mem_copy(vscr, priv->new_image, priv->xres*priv->yres*4); +void _jakdaw_feedback_render(JakdawPrivate *priv, uint32_t *vscr) { + int x, tptr, niptr, a; + int r, g, b; + int np, rdr, gdr, bdr; + + /* Most feedback effects don't take well to the middle pixel becoming + * a bright colour - so we just blank it here. Most effects now rely on + * this as a black pixel to be used instead of those that fall off the + * edges of the screen. */ + + vscr[((priv->yres >> 1) * priv->xres) + (priv->xres >> 1)] = 0; + + tptr = niptr = 0; + + np = priv->xres * priv->yres; + rdr = priv->decay_rate << 2; + gdr = priv->decay_rate << 10; + bdr = priv->decay_rate << 18; + + for (x = 0; x < np; x++) { + /* I dunno how good a job the C compiler makes at optimizing this + * loop. Since this is what the plugin spends pretty much all of + * it's time doing it might be worth looking into the possiblilty + * of optimizing it further. */ + + a = vscr[priv->table[tptr++]]; + r = a & 0xff; + g = a & 0xff00; + b = a & 0xff0000; + + a = vscr[priv->table[tptr++]]; + r += a & 0xff; + g += a & 0xff00; + b += a & 0xff0000; + + a = vscr[priv->table[tptr++]]; + r += a & 0xff; + g += a & 0xff00; + b += a & 0xff0000; + + a = vscr[priv->table[tptr++]]; + r += a & 0xff; + g += a & 0xff00; + b += a & 0xff0000; + + r = r > rdr ? r - rdr : 0; + g = g > gdr ? g - gdr : 0; + b = b > bdr ? b - bdr : 0; + + a = (r & 0x3fc) | (g & 0x3fc00) | (b & 0x3fc0000); + a >>= 2; + + priv->new_image[niptr++] = a; + } + + visual_mem_copy(vscr, priv->new_image, priv->xres * priv->yres * 4); } -static void init_table(JakdawPrivate *priv) -{ - priv->table=visual_mem_malloc0(priv->xres*priv->yres*sizeof(uint32_t)*4); // 4 points / pixel - priv->tableptr=0; +static void init_table(JakdawPrivate *priv) { + priv->table = visual_mem_malloc0(priv->xres * priv->yres * sizeof(uint32_t) * + 4); // 4 points / pixel + priv->tableptr = 0; } -static void table_store(JakdawPrivate *priv, int x) -{ - priv->table[priv->tableptr++]=x; +static void table_store(JakdawPrivate *priv, int x) { + priv->table[priv->tableptr++] = x; } -static void blur_then(JakdawPrivate *priv, int x, int y, transform_function func) -{ - uint32_t a; - - a=x+1xres ? x+1 : x; - table_store(priv, func(priv,a,y)); - a=x-1<0 ? 0 : x-1; - table_store(priv, func(priv,a,y)); - a=y+1yres ? y+1 : y; - table_store(priv, func(priv,x,a)); - a=y-1<0 ? 0 : y-1; - table_store(priv, func(priv,x,a)); - - return; +static void blur_then(JakdawPrivate *priv, int x, int y, + transform_function func) { + uint32_t a; + + a = x + 1 < priv->xres ? x + 1 : x; + table_store(priv, func(priv, a, y)); + a = x - 1 < 0 ? 0 : x - 1; + table_store(priv, func(priv, a, y)); + a = y + 1 < priv->yres ? y + 1 : y; + table_store(priv, func(priv, x, a)); + a = y - 1 < 0 ? 0 : y - 1; + table_store(priv, func(priv, x, a)); + + return; } // Transform functions --------------------------------------------------------- -static uint32_t nothing(JakdawPrivate *priv, int x, int y) -{ - return (y*priv->xres)+x; +static uint32_t nothing(JakdawPrivate *priv, int x, int y) { + return (y * priv->xres) + x; } -static uint32_t scroll(JakdawPrivate *priv, int x, int y) -{ - int retval; - - if(y+6<=priv->yres) - retval = ((y+6)*priv->xres)+x; - else - retval = ((priv->yres>>1)*priv->xres)+(priv->xres>>1); - - if (retval > priv->xres * priv->yres) - return priv->xres * priv->yres; - else if (retval < 0) - return 0; - else - return retval; -} +static uint32_t scroll(JakdawPrivate *priv, int x, int y) { + int retval; + + if (y + 6 <= priv->yres) + retval = ((y + 6) * priv->xres) + x; + else + retval = ((priv->yres >> 1) * priv->xres) + (priv->xres >> 1); -static uint32_t zoom_rotate(JakdawPrivate *priv, int x, int y) -{ - double ang=5.0*(3.14/180.0); - int nx, ny; - - x-=(priv->xres>>1); - y-=(priv->yres>>1); - - nx=x*cos(ang) + y*sin(ang); - ny=y*cos(ang) - x*sin(ang); - nx/=1.2; - ny/=1.2; - - nx+=(priv->xres>>1); - ny+=(priv->yres>>1); - - if(nx>=priv->xres || nx<0 || ny>=priv->yres || ny<0) - { - nx=0; ny=0; - } - - if(nx<0 || nx>=priv->xres || ny<0 || ny>=priv->yres) { nx=priv->xres>>1; ny=priv->yres>>1; } - - return (ny*priv->xres)+nx; - + if (retval > priv->xres * priv->yres) + return priv->xres * priv->yres; + else if (retval < 0) + return 0; + else + return retval; } -static uint32_t zoom_ripple(JakdawPrivate *priv, int x, int y) -{ - double dist; - int nx, ny; - - x-=(priv->xres>>1); - y-=(priv->yres>>1); - - dist=sqrt((x*x)+(y*y)); - - dist*=3.14*priv->zoom_ripplesize/sqrt((priv->xres*priv->xres)+(priv->yres*priv->yres)); - - nx=x*(priv->zoom_zoomfact+(priv->zoom_ripplefact*sin(dist))); - ny=y*(priv->zoom_zoomfact+(priv->zoom_ripplefact*sin(dist))); - - nx+=(priv->xres>>1); - ny+=(priv->yres>>1); - - if(nx<0 || nx>=priv->xres || ny<0 || ny>=priv->yres) { nx=priv->xres>>1; ny=priv->yres>>1; } - - return (ny*priv->xres)+nx; +static uint32_t zoom_rotate(JakdawPrivate *priv, int x, int y) { + double ang = 5.0 * (3.14 / 180.0); + int nx, ny; + + x -= (priv->xres >> 1); + y -= (priv->yres >> 1); + + nx = x * cos(ang) + y * sin(ang); + ny = y * cos(ang) - x * sin(ang); + nx /= 1.2; + ny /= 1.2; + + nx += (priv->xres >> 1); + ny += (priv->yres >> 1); + + if (nx >= priv->xres || nx < 0 || ny >= priv->yres || ny < 0) { + nx = 0; + ny = 0; + } + + if (nx < 0 || nx >= priv->xres || ny < 0 || ny >= priv->yres) { + nx = priv->xres >> 1; + ny = priv->yres >> 1; + } + + return (ny * priv->xres) + nx; } -static uint32_t zoom_ripplenew(JakdawPrivate *priv, int x, int y) -{ - double dist; - int nx, ny; - - x-=(priv->xres>>1); - y-=(priv->yres>>1); - - dist=sqrt((x*x)+(y*y)); - dist*=3.14*priv->zoom_ripplesize/sqrt((priv->xres*priv->xres)+(priv->yres*priv->yres)); - - // FIXME - implement the rest of this! - (void)dist; // just for -Wunused-but-set-variable - - nx=x; - ny=y; - - nx+=(priv->xres>>1); - ny+=(priv->yres>>1); - - if(nx<0 || nx>=priv->xres || ny<0 || ny>=priv->yres) { nx=priv->xres>>1; ny=priv->yres>>1; } - - return (ny*priv->xres)+nx; +static uint32_t zoom_ripple(JakdawPrivate *priv, int x, int y) { + double dist; + int nx, ny; + + x -= (priv->xres >> 1); + y -= (priv->yres >> 1); + + dist = sqrt((x * x) + (y * y)); + + dist *= 3.14 * priv->zoom_ripplesize / + sqrt((priv->xres * priv->xres) + (priv->yres * priv->yres)); + + nx = x * (priv->zoom_zoomfact + (priv->zoom_ripplefact * sin(dist))); + ny = y * (priv->zoom_zoomfact + (priv->zoom_ripplefact * sin(dist))); + + nx += (priv->xres >> 1); + ny += (priv->yres >> 1); + + if (nx < 0 || nx >= priv->xres || ny < 0 || ny >= priv->yres) { + nx = priv->xres >> 1; + ny = priv->yres >> 1; + } + + return (ny * priv->xres) + nx; } -static uint32_t into_screen(JakdawPrivate *priv, int x, int y) -{ - double xfact, yfact; - int nx,ny; - - x-=(priv->xres>>1); - xfact=1.0+(0.05*((priv->yres-y)/(double)priv->yres)); - yfact=1.05+(0.05*(y/(double)priv->yres)); - - nx=x*xfact; - ny=y*yfact; - - nx+=(priv->xres>>1); - - if(nx<0 || nx>=priv->xres || ny<0 || ny>=priv->yres) { nx=priv->xres>>1; ny=priv->yres>>1; } - - return (ny*priv->xres)+nx; +static uint32_t zoom_ripplenew(JakdawPrivate *priv, int x, int y) { + double dist; + int nx, ny; + + x -= (priv->xres >> 1); + y -= (priv->yres >> 1); + + dist = sqrt((x * x) + (y * y)); + dist *= 3.14 * priv->zoom_ripplesize / + sqrt((priv->xres * priv->xres) + (priv->yres * priv->yres)); + + // FIXME - implement the rest of this! + (void)dist; // just for -Wunused-but-set-variable + + nx = x; + ny = y; + + nx += (priv->xres >> 1); + ny += (priv->yres >> 1); + + if (nx < 0 || nx >= priv->xres || ny < 0 || ny >= priv->yres) { + nx = priv->xres >> 1; + ny = priv->yres >> 1; + } + + return (ny * priv->xres) + nx; } +static uint32_t into_screen(JakdawPrivate *priv, int x, int y) { + double xfact, yfact; + int nx, ny; + + x -= (priv->xres >> 1); + xfact = 1.0 + (0.05 * ((priv->yres - y) / (double)priv->yres)); + yfact = 1.05 + (0.05 * (y / (double)priv->yres)); + + nx = x * xfact; + ny = y * yfact; + + nx += (priv->xres >> 1); + + if (nx < 0 || nx >= priv->xres || ny < 0 || ny >= priv->yres) { + nx = priv->xres >> 1; + ny = priv->yres >> 1; + } + + return (ny * priv->xres) + nx; +} diff --git a/libvisual-plugins/plugins/actor/jakdaw/feedback.h b/libvisual-plugins/plugins/actor/jakdaw/feedback.h index b68cc2235..5e0e0ecea 100644 --- a/libvisual-plugins/plugins/actor/jakdaw/feedback.h +++ b/libvisual-plugins/plugins/actor/jakdaw/feedback.h @@ -1,8 +1,8 @@ -/* +/* * Jakdaw's XMMS Plugin. * Copyright (C) 1999, 2000, Christopher Wilson. * - * Email: + * Email: * Project Homepage: * * This program is free software; you can redistribute it and/or modify @@ -25,9 +25,9 @@ #include "actor_jakdaw.h" -void _jakdaw_feedback_init (JakdawPrivate *priv, int x, int y); -void _jakdaw_feedback_reset (JakdawPrivate *priv, int x, int y); -void _jakdaw_feedback_close (JakdawPrivate *priv); -void _jakdaw_feedback_render (JakdawPrivate *priv, uint32_t *vscr); +void _jakdaw_feedback_init(JakdawPrivate *priv, int x, int y); +void _jakdaw_feedback_reset(JakdawPrivate *priv, int x, int y); +void _jakdaw_feedback_close(JakdawPrivate *priv); +void _jakdaw_feedback_render(JakdawPrivate *priv, uint32_t *vscr); #endif /* _FEEDBACK_H */ diff --git a/libvisual-plugins/plugins/actor/jakdaw/plotter.c b/libvisual-plugins/plugins/actor/jakdaw/plotter.c index 208ffada1..54d71cc80 100644 --- a/libvisual-plugins/plugins/actor/jakdaw/plotter.c +++ b/libvisual-plugins/plugins/actor/jakdaw/plotter.c @@ -1,8 +1,8 @@ -/* +/* * Jakdaw's XMMS Plugin. * Copyright (C) 1999, 2000, Christopher Wilson. * - * Email: + * Email: * Project Homepage: * * This program is free software; you can redistribute it and/or modify @@ -25,85 +25,85 @@ #include "plotter.h" -static void vert_line(JakdawPrivate *priv, int x, int a, int b, uint32_t col, uint32_t *vscr); - -void _jakdaw_plotter_draw(JakdawPrivate *priv, float *pcm_data, float *freq_data, uint32_t *vscr) -{ - int x, y; - int oy; - uint32_t col; - - switch (priv->plotter_colortype) - { - case PLOTTER_COLOUR_SOLID: col=priv->plotter_scopecolor; break; - case PLOTTER_COLOUR_RANDOM: col=visual_random_context_int (priv->rcontext); break; - case PLOTTER_COLOUR_MUSICTRIG: - default: - { - float d; - int c; - d=0; - for(c=0;c<16;c++) - d=d+freq_data[c]; - col=(int)((double) d*(256.0 * 16.0)); - - d=0; - for(c=16;c<108;c++) - d=d+freq_data[c]; - col|=((int)((double) d*(256.0 * 64.0)))<<8; - - d=0; - for(c=108;c<255;c++) - d=d+freq_data[c]; - col|=((int)((double) d*(256.0 * 128.0)))<<16; - - } - } - - oy = (priv->yres / 2) + ((pcm_data[0] * priv->plotter_amplitude) * (priv->yres / 2)); - - oy=oy<0 ? 0 : oy>=priv->yres ? priv->yres -1 : oy; - - for(x=0;xxres;x++) - { - y = (priv->yres / 2) + ((pcm_data[x % 512] * priv->plotter_amplitude) * (priv->yres / 2)); - - if(y<0) y=0; - if(y>=priv->yres) y=priv->yres-1; - if(priv->plotter_scopetype==PLOTTER_SCOPE_LINES) - { - vert_line(priv, x, oy, y, col, vscr); - oy=y; - } - else if(priv->plotter_scopetype==PLOTTER_SCOPE_DOTS) - { - if(x>0 && xxres && y>0 && yyres) - vscr[(y*priv->xres)+x]=col; - } - else if(priv->plotter_scopetype==PLOTTER_SCOPE_SOLID) - { - vert_line(priv, x, (priv->yres>>1), y, col, vscr); - } - } +static void vert_line(JakdawPrivate *priv, int x, int a, int b, uint32_t col, + uint32_t *vscr); + +void _jakdaw_plotter_draw(JakdawPrivate *priv, float *pcm_data, + float *freq_data, uint32_t *vscr) { + int x, y; + int oy; + uint32_t col; + + switch (priv->plotter_colortype) { + case PLOTTER_COLOUR_SOLID: + col = priv->plotter_scopecolor; + break; + case PLOTTER_COLOUR_RANDOM: + col = visual_random_context_int(priv->rcontext); + break; + case PLOTTER_COLOUR_MUSICTRIG: + default: { + float d; + int c; + d = 0; + for (c = 0; c < 16; c++) + d = d + freq_data[c]; + col = (int)((double)d * (256.0 * 16.0)); + + d = 0; + for (c = 16; c < 108; c++) + d = d + freq_data[c]; + col |= ((int)((double)d * (256.0 * 64.0))) << 8; + + d = 0; + for (c = 108; c < 255; c++) + d = d + freq_data[c]; + col |= ((int)((double)d * (256.0 * 128.0))) << 16; + } + } + + oy = (priv->yres / 2) + + ((pcm_data[0] * priv->plotter_amplitude) * (priv->yres / 2)); + + oy = oy < 0 ? 0 : oy >= priv->yres ? priv->yres - 1 : oy; + + for (x = 0; x < priv->xres; x++) { + y = (priv->yres / 2) + + ((pcm_data[x % 512] * priv->plotter_amplitude) * (priv->yres / 2)); + + if (y < 0) + y = 0; + if (y >= priv->yres) + y = priv->yres - 1; + if (priv->plotter_scopetype == PLOTTER_SCOPE_LINES) { + vert_line(priv, x, oy, y, col, vscr); + oy = y; + } else if (priv->plotter_scopetype == PLOTTER_SCOPE_DOTS) { + if (x > 0 && x < priv->xres && y > 0 && y < priv->yres) + vscr[(y * priv->xres) + x] = col; + } else if (priv->plotter_scopetype == PLOTTER_SCOPE_SOLID) { + vert_line(priv, x, (priv->yres >> 1), y, col, vscr); + } + } } -static void vert_line(JakdawPrivate *priv, int x,int a, int b, uint32_t col, uint32_t *vscr) -{ - int y, ptr; +static void vert_line(JakdawPrivate *priv, int x, int a, int b, uint32_t col, + uint32_t *vscr) { + int y, ptr; - if(b=priv->yres || b<0 || b>=priv->yres) - return; + if (a < 0 || a >= priv->yres || b < 0 || b >= priv->yres) + return; - ptr=(a*priv->xres)+x; + ptr = (a * priv->xres) + x; - for(y=a;y<=b;y++) - { - vscr[ptr]=col; - ptr+=priv->xres; - } + for (y = a; y <= b; y++) { + vscr[ptr] = col; + ptr += priv->xres; + } } diff --git a/libvisual-plugins/plugins/actor/jakdaw/plotter.h b/libvisual-plugins/plugins/actor/jakdaw/plotter.h index e9061c802..d33392290 100644 --- a/libvisual-plugins/plugins/actor/jakdaw/plotter.h +++ b/libvisual-plugins/plugins/actor/jakdaw/plotter.h @@ -1,8 +1,8 @@ -/* +/* * Jakdaw's XMMS Plugin. * Copyright (C) 1999, 2000, Christopher Wilson. * - * Email: + * Email: * Project Homepage: * * This program is free software; you can redistribute it and/or modify @@ -25,6 +25,7 @@ #include "actor_jakdaw.h" -void _jakdaw_plotter_draw (JakdawPrivate *priv, float *pcm_data, float *freq_data, uint32_t *vscr); +void _jakdaw_plotter_draw(JakdawPrivate *priv, float *pcm_data, + float *freq_data, uint32_t *vscr); #endif /* _PLOTTER_H */ diff --git a/libvisual-plugins/plugins/actor/jess/analyser.c b/libvisual-plugins/plugins/actor/jess/analyser.c index ccd7e9d3a..9407adc43 100644 --- a/libvisual-plugins/plugins/actor/jess/analyser.c +++ b/libvisual-plugins/plugins/actor/jess/analyser.c @@ -31,131 +31,116 @@ #include "def.h" #include "jess.h" -int detect_beat(JessPrivate *priv) -{ - if ((priv->lys.E / priv->lys.E_moyen > LEVEL_ONE)) - { - priv->lys.beat = OUI; +int detect_beat(JessPrivate *priv) { + if ((priv->lys.E / priv->lys.E_moyen > LEVEL_ONE)) { + priv->lys.beat = OUI; + } - } - - return 0; + return 0; } /* Energie discrete moyenne temporellie*/ -void spectre_moyen(JessPrivate *priv, short data_freq_tmp[2][256]) -{ - int i; - float aux,N; - N = T_AVERAGE_SPECTRAL; - - for (i=0 ; i<256 ; i++) - { - aux = (float) (data_freq_tmp[0][i] + data_freq_tmp[1][i]) * 0.5 / 65536; - aux = aux * aux; - priv->lys.Ed_moyen[i] = (N - 1.0) / N * priv->lys.Ed_moyen[i] + 1.0 / N * aux; - - if (aux / priv->lys.Ed_moyen[i] > 9) /* discret beat */ - priv->lys.dbeat[i] = OUI; - } +void spectre_moyen(JessPrivate *priv, short data_freq_tmp[2][256]) { + int i; + float aux, N; + N = T_AVERAGE_SPECTRAL; + + for (i = 0; i < 256; i++) { + aux = (float)(data_freq_tmp[0][i] + data_freq_tmp[1][i]) * 0.5 / 65536; + aux = aux * aux; + priv->lys.Ed_moyen[i] = + (N - 1.0) / N * priv->lys.Ed_moyen[i] + 1.0 / N * aux; + + if (aux / priv->lys.Ed_moyen[i] > 9) /* discret beat */ + priv->lys.dbeat[i] = OUI; + } } - /* Derivee temporelle de l'energie moyenne */ /* Doit etre appelle apres C_E_moyen */ -void C_dEdt_moyen(JessPrivate *priv) -{ - float new, N; +void C_dEdt_moyen(JessPrivate *priv) { + float new, N; - N = T_AVERAGE_DEDT; + N = T_AVERAGE_DEDT; - new = (priv->lys.E_moyen - priv->E_old1) / priv->lys.dt; + new = (priv->lys.E_moyen - priv->E_old1) / priv->lys.dt; - priv->lys.dEdt_moyen = (N - 1.0) / N * priv->lys.dEdt_moyen + 1.0 / N * new; + priv->lys.dEdt_moyen = (N - 1.0) / N * priv->lys.dEdt_moyen + 1.0 / N * new; - priv->E_old1 = priv->lys.E_moyen; + priv->E_old1 = priv->lys.E_moyen; } -void C_dEdt(JessPrivate *priv) -{ - float new, N; +void C_dEdt(JessPrivate *priv) { + float new, N; - N = T_DEDT; /* on met un petit filtre qd meme */ + N = T_DEDT; /* on met un petit filtre qd meme */ - new = (priv->lys.E_moyen - priv->E_old2) / priv->lys.dt; + new = (priv->lys.E_moyen - priv->E_old2) / priv->lys.dt; - priv->lys.dEdt = (N - 1.0) / N * priv->lys.dEdt_moyen + 1.0 / N * new; + priv->lys.dEdt = (N - 1.0) / N * priv->lys.dEdt_moyen + 1.0 / N * new; - priv->E_old2 = priv->lys.E_moyen; + priv->E_old2 = priv->lys.E_moyen; } - + /* Energie moyenne temporelle */ -void C_E_moyen(JessPrivate *priv, short data_freq_tmp[2][256]) -{ - float N; - N = T_AVERAGE_E; +void C_E_moyen(JessPrivate *priv, short data_freq_tmp[2][256]) { + float N; + N = T_AVERAGE_E; - priv->lys.E_moyen = (N - 1.0) / N * priv->lys.E_moyen + 1.0 / N * energy(priv, data_freq_tmp,1); + priv->lys.E_moyen = (N - 1.0) / N * priv->lys.E_moyen + + 1.0 / N * energy(priv, data_freq_tmp, 1); } /* Energie courante */ -float energy(JessPrivate *priv, short data_freq_tmp[2][256], int type_E) -{ - int i, tmp; - float energy_ = 0; +float energy(JessPrivate *priv, short data_freq_tmp[2][256], int type_E) { + int i, tmp; + float energy_ = 0; - for (i = 0; i < 256; i++) { - tmp = ( data_freq_tmp[1][i] ) >> 8 ; - energy_+= tmp * tmp ; - } + for (i = 0; i < 256; i++) { + tmp = (data_freq_tmp[1][i]) >> 8; + energy_ += tmp * tmp; + } - energy_ = energy_ / 65536 / 256 * 256; /*ahahah*/ /* synap: Yes, indeed */ + energy_ = energy_ / 65536 / 256 * 256; /*ahahah*/ /* synap: Yes, indeed */ - priv->lys.E = energy_; + priv->lys.E = energy_; - return energy_; + return energy_; } /* TICK REPLACEMENT */ -int start_ticks(JessPrivate *priv) -{ - gettimeofday(&priv->start, NULL); +int start_ticks(JessPrivate *priv) { + gettimeofday(&priv->start, NULL); - return 0; + return 0; } -static int get_ticks(JessPrivate *priv) -{ - struct timeval now; - int ticks; +static int get_ticks(JessPrivate *priv) { + struct timeval now; + int ticks; - gettimeofday(&now, NULL); - ticks = (now.tv_sec - priv->start.tv_sec) * 1000 + - (now.tv_usec - priv->start.tv_usec) / 1000; + gettimeofday(&now, NULL); + ticks = (now.tv_sec - priv->start.tv_sec) * 1000 + + (now.tv_usec - priv->start.tv_usec) / 1000; - return ticks; + return ticks; } /* REINIT */ -float time_last(JessPrivate *priv, int i, int reinit) -{ - float new_time = get_ticks(priv); - float delta_t; - - delta_t = (new_time - priv->lys.last_time[i]) / 1000; +float time_last(JessPrivate *priv, int i, int reinit) { + float new_time = get_ticks(priv); + float delta_t; - if (reinit == OUI) - priv->lys.last_time[i] = new_time; + delta_t = (new_time - priv->lys.last_time[i]) / 1000; - return delta_t; -} + if (reinit == OUI) + priv->lys.last_time[i] = new_time; - - -void ips(JessPrivate *priv) -{ - priv->conteur.dt = time_last(priv, FOUR, NON); - priv->conteur.fps = (int) 1 / time_last(priv, FOUR, REINIT); + return delta_t; } +void ips(JessPrivate *priv) { + priv->conteur.dt = time_last(priv, FOUR, NON); + priv->conteur.fps = (int)1 / time_last(priv, FOUR, REINIT); +} diff --git a/libvisual-plugins/plugins/actor/jess/analyser.h b/libvisual-plugins/plugins/actor/jess/analyser.h index d088e4315..7015f23d7 100644 --- a/libvisual-plugins/plugins/actor/jess/analyser.h +++ b/libvisual-plugins/plugins/actor/jess/analyser.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier diff --git a/libvisual-plugins/plugins/actor/jess/analyser_struct.h b/libvisual-plugins/plugins/actor/jess/analyser_struct.h index 5e66e69d7..9f3f05a68 100644 --- a/libvisual-plugins/plugins/actor/jess/analyser_struct.h +++ b/libvisual-plugins/plugins/actor/jess/analyser_struct.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -36,7 +36,7 @@ #define NON 0 #define BPM_MAX 400 -#define LEVEL_ONE 3 +#define LEVEL_ONE 3 #define TOTAL_E 0 #define BASS_E 1 #define MEDIUM_E 2 @@ -47,23 +47,22 @@ #define T_DEDT 10 #define T_AVERAGE_E 130 -struct analyser_struct -{ - float E; - float E_moyen; - float dEdt; - float dEdt_moyen; +struct analyser_struct { + float E; + float E_moyen; + float dEdt; + float dEdt_moyen; - float Ed_moyen[256]; - float dt; + float Ed_moyen[256]; + float dt; - char dbeat[256]; + char dbeat[256]; - int reprise; - int montee; - int beat; - int last_time[10]; - int conteur[100]; /* ZERO : sert pour l'affichage de appel JESS */ + int reprise; + int montee; + int beat; + int last_time[10]; + int conteur[100]; /* ZERO : sert pour l'affichage de appel JESS */ }; #endif /* _JESS_ANALYSER_STRUCT_H */ diff --git a/libvisual-plugins/plugins/actor/jess/def.h b/libvisual-plugins/plugins/actor/jess/def.h index eb08a2908..107dba9e1 100644 --- a/libvisual-plugins/plugins/actor/jess/def.h +++ b/libvisual-plugins/plugins/actor/jess/def.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -27,16 +27,18 @@ #define PI 3.1416 #define RESX 640 /* start resolution */ -#define RESY 300 +#define RESY 300 #define RESX_D 640 /* rerence resolution */ -#define RESY_D 300 +#define RESY_D 300 -#define SCREENFLAG SDL_HWSURFACE|SDL_HWPALETTE|SDL_DOUBLEBUF|SDL_ASYNCBLIT|SDL_HWACCEL|SDL_RLEACCEL +#define SCREENFLAG \ + SDL_HWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF | SDL_ASYNCBLIT | \ + SDL_HWACCEL | SDL_RLEACCEL -#define RESFACTX(par1) ( (int) ( (float) resx*(par1)/RESX_D )) -#define RESFACTY(par1) ( (int) ( (float) resy*(par1)/RESY_D )) -#define RESFACTXF(par1) ( (float) resx*(par1)/RESX_D ) -#define RESFACTYF(par1) ( (float) resy*(par1)/RESY_D ) +#define RESFACTX(par1) ((int)((float)resx * (par1) / RESX_D)) +#define RESFACTY(par1) ((int)((float)resy * (par1) / RESY_D)) +#define RESFACTXF(par1) ((float)resx * (par1) / RESX_D) +#define RESFACTYF(par1) ((float)resy * (par1) / RESY_D) #define FUSEE_MAX 10 #define FUSEE_VIE 5 diff --git a/libvisual-plugins/plugins/actor/jess/distorsion.c b/libvisual-plugins/plugins/actor/jess/distorsion.c index 1c438d3e0..48115b476 100644 --- a/libvisual-plugins/plugins/actor/jess/distorsion.c +++ b/libvisual-plugins/plugins/actor/jess/distorsion.c @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -24,138 +24,129 @@ #include #include -#include +#include #include #include "distorsion.h" #include "def.h" #include "jess.h" -void create_tables(JessPrivate *priv) -{ - int i, j, k, x, y; - float n_fx, n_fy; - int resy, resx; - - resy = priv->resy; - resx = priv->resx; - - for (k=1; k<5; k++) - { - for (i = 0; i < priv->resy; i++) - { - for (j = 0; j < priv->resx; j++) - { - n_fx = (float) j - priv->xres2; - n_fy = (float) i - priv->yres2; - - switch(k) - { - case 1: - rot_hyperbolic_radial (&n_fx, &n_fy, -PI / 5, 0.001, 0, - RESFACTY (50)) ; - rot_hyperbolic_radial (&n_fx, &n_fy, PI / 2, 0.004, - RESFACTX (200), RESFACTY (-30)) ; - rot_hyperbolic_radial (&n_fx, &n_fy, PI / 5, 0.001, - RESFACTX (-150), RESFACTY (-30)) ; - rot_hyperbolic_radial (&n_fx, &n_fy, PI / 30, 0.0001, 0, 0) ; - break; - case 2: - rot_cos_radial(&n_fx,&n_fy, 2*PI/75, 0.01,000,000) ; - break; - case 3: - homothetie_hyperbolic(&n_fx, &n_fy, 0.0005,0,0) ; - break; - case 4: - noize(priv, &n_fx, &n_fy, 0*5.0); - /* rot_hyperbolic_radial (&n_fx, &n_fy, PI / 30, 0.00010, 0, 0) ; */ - /* homothetie_hyperbolic(&n_fx, &n_fy, -0.0002,0,0) ; */ - /* homothetie_cos_radial(&n_fx, &n_fy, 0.01,-10,10) ; */ - break; - } - - x = (int) (n_fx + priv->xres2); - y = (int) (n_fy + priv->yres2); - - if (x < 0 || x >= priv->resx || y < 0 || y >= priv->resy ) - { - x = 0; - y = 0; - } - - switch(k) - { - case 1: - priv->table1[i * resx + j] = x + y * resx; - break; - case 2: - priv->table2[i * resx + j] = x + y * resx; - break; - case 3: - priv->table3[i * resx + j] = x + y * resx; - break; - case 4: - priv->table4[i * resx + j] = x + y * resx; - break; - } - } - } - } +void create_tables(JessPrivate *priv) { + int i, j, k, x, y; + float n_fx, n_fy; + int resy, resx; + + resy = priv->resy; + resx = priv->resx; + + for (k = 1; k < 5; k++) { + for (i = 0; i < priv->resy; i++) { + for (j = 0; j < priv->resx; j++) { + n_fx = (float)j - priv->xres2; + n_fy = (float)i - priv->yres2; + + switch (k) { + case 1: + rot_hyperbolic_radial(&n_fx, &n_fy, -PI / 5, 0.001, 0, RESFACTY(50)); + rot_hyperbolic_radial(&n_fx, &n_fy, PI / 2, 0.004, RESFACTX(200), + RESFACTY(-30)); + rot_hyperbolic_radial(&n_fx, &n_fy, PI / 5, 0.001, RESFACTX(-150), + RESFACTY(-30)); + rot_hyperbolic_radial(&n_fx, &n_fy, PI / 30, 0.0001, 0, 0); + break; + case 2: + rot_cos_radial(&n_fx, &n_fy, 2 * PI / 75, 0.01, 000, 000); + break; + case 3: + homothetie_hyperbolic(&n_fx, &n_fy, 0.0005, 0, 0); + break; + case 4: + noize(priv, &n_fx, &n_fy, 0 * 5.0); + /* rot_hyperbolic_radial (&n_fx, &n_fy, PI / 30, 0.00010, 0, 0) ; + */ + /* homothetie_hyperbolic(&n_fx, &n_fy, -0.0002,0,0) ; */ + /* homothetie_cos_radial(&n_fx, &n_fy, 0.01,-10,10) ; */ + break; + } + + x = (int)(n_fx + priv->xres2); + y = (int)(n_fy + priv->yres2); + + if (x < 0 || x >= priv->resx || y < 0 || y >= priv->resy) { + x = 0; + y = 0; + } + + switch (k) { + case 1: + priv->table1[i * resx + j] = x + y * resx; + break; + case 2: + priv->table2[i * resx + j] = x + y * resx; + break; + case 3: + priv->table3[i * resx + j] = x + y * resx; + break; + case 4: + priv->table4[i * resx + j] = x + y * resx; + break; + } + } + } + } } -void rot_hyperbolic_radial(float *n_fx,float *n_fy,float d_alpha, float rad_factor, float cx, float cy) -{ - float r2,dx = *n_fx-cx, dy = *n_fy-cy,cosal, sinal; +void rot_hyperbolic_radial(float *n_fx, float *n_fy, float d_alpha, + float rad_factor, float cx, float cy) { + float r2, dx = *n_fx - cx, dy = *n_fy - cy, cosal, sinal; - r2 = (dx)*(dx)+(dy)*(dy); + r2 = (dx) * (dx) + (dy) * (dy); - d_alpha*=1/(1+r2*rad_factor); + d_alpha *= 1 / (1 + r2 * rad_factor); - cosal = cos(d_alpha) ; - sinal = sin(d_alpha) ; + cosal = cos(d_alpha); + sinal = sin(d_alpha); - *n_fx = cx + dx * cosal - dy * sinal; - *n_fy = cy + dx * sinal + dy * cosal; + *n_fx = cx + dx * cosal - dy * sinal; + *n_fy = cy + dx * sinal + dy * cosal; } -void rot_cos_radial( float *n_fx,float *n_fy,float d_alpha, float rad_factor, float cx, float cy) -{ - float r,dx = *n_fx-cx, dy = *n_fy-cy,cosal, sinal; - r = sqrt(dx*dx+dy*dy); +void rot_cos_radial(float *n_fx, float *n_fy, float d_alpha, float rad_factor, + float cx, float cy) { + float r, dx = *n_fx - cx, dy = *n_fy - cy, cosal, sinal; + r = sqrt(dx * dx + dy * dy); - d_alpha=d_alpha*cos(r*rad_factor); + d_alpha = d_alpha * cos(r * rad_factor); - cosal = cos(d_alpha) ; - sinal = sin(d_alpha) ; + cosal = cos(d_alpha); + sinal = sin(d_alpha); - *n_fx = cx + dx * cosal - dy * sinal; - *n_fy = cy + dx * sinal + dy * cosal; + *n_fx = cx + dx * cosal - dy * sinal; + *n_fy = cy + dx * sinal + dy * cosal; } -void homothetie_hyperbolic(float *n_fx,float *n_fy, float rad_factor, float cx, float cy) -{ - float r,dx = *n_fx-cx, dy = *n_fy-cy; - r = sqrt(dx*dx+dy*dy); +void homothetie_hyperbolic(float *n_fx, float *n_fy, float rad_factor, float cx, + float cy) { + float r, dx = *n_fx - cx, dy = *n_fy - cy; + r = sqrt(dx * dx + dy * dy); - *n_fx = cx + dx/(1+rad_factor*r); - *n_fy = cy + dy/(1+rad_factor*r); + *n_fx = cx + dx / (1 + rad_factor * r); + *n_fy = cy + dy / (1 + rad_factor * r); } +void homothetie_cos_radial(float *n_fx, float *n_fy, float rad_factor, float cx, + float cy) { + float r, cosrad, dx = *n_fx - cx, dy = *n_fy - cy; + r = sqrt(dx * dx + dy * dy); -void homothetie_cos_radial(float *n_fx,float *n_fy, float rad_factor, float cx, float cy) -{ - float r,cosrad, dx = *n_fx-cx, dy = *n_fy-cy; - r = sqrt(dx*dx+dy*dy); - - cosrad = cos(r*rad_factor); + cosrad = cos(r * rad_factor); - *n_fx = cx + dx*cosrad; - *n_fy = cy + dy*cosrad; + *n_fx = cx + dx * cosrad; + *n_fy = cy + dy * cosrad; } -void noize(JessPrivate *priv, float *n_fx,float *n_fy, float intensity) -{ - *n_fx +=2*(visual_random_context_float(priv->rcontext)-0.5)*intensity; - *n_fy +=2*(visual_random_context_float(priv->rcontext)-0.5)*intensity-5; +void noize(JessPrivate *priv, float *n_fx, float *n_fy, float intensity) { + *n_fx += 2 * (visual_random_context_float(priv->rcontext) - 0.5) * intensity; + *n_fy += + 2 * (visual_random_context_float(priv->rcontext) - 0.5) * intensity - 5; } - diff --git a/libvisual-plugins/plugins/actor/jess/distorsion.h b/libvisual-plugins/plugins/actor/jess/distorsion.h index f49ae62e0..e6b949d37 100644 --- a/libvisual-plugins/plugins/actor/jess/distorsion.h +++ b/libvisual-plugins/plugins/actor/jess/distorsion.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -25,8 +25,12 @@ #include "jess.h" void create_tables(JessPrivate *priv); -void rot_hyperbolic_radial(float *n_fx,float *n_fy,float d_alpha, float rad_factor, float cx, float cy); -void rot_cos_radial( float *n_fx,float *n_fy,float d_alpha, float rad_factor, float cx, float cy); -void homothetie_hyperbolic(float *n_fx,float *n_fy, float rad_factor, float cx, float cy); -void homothetie_cos_radial(float *n_fx,float *n_fy, float rad_factor, float cx, float cy); -void noize(JessPrivate *priv, float *n_fx,float *n_fy, float intensity); +void rot_hyperbolic_radial(float *n_fx, float *n_fy, float d_alpha, + float rad_factor, float cx, float cy); +void rot_cos_radial(float *n_fx, float *n_fy, float d_alpha, float rad_factor, + float cx, float cy); +void homothetie_hyperbolic(float *n_fx, float *n_fy, float rad_factor, float cx, + float cy); +void homothetie_cos_radial(float *n_fx, float *n_fy, float rad_factor, float cx, + float cy); +void noize(JessPrivate *priv, float *n_fx, float *n_fy, float intensity); diff --git a/libvisual-plugins/plugins/actor/jess/draw.c b/libvisual-plugins/plugins/actor/jess/draw.c index 85b1dfb9a..59aa9f08e 100644 --- a/libvisual-plugins/plugins/actor/jess/draw.c +++ b/libvisual-plugins/plugins/actor/jess/draw.c @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -40,650 +40,623 @@ /**************** ANALYSER *****************************************/ /*******************************************************************/ -void analyser(JessPrivate *priv, uint8_t * buffer) -{ - int i ; +void analyser(JessPrivate *priv, uint8_t *buffer) { + int i; - droite (priv, buffer, -priv->xres2, 0, -priv->xres2+10, 0, 30); + droite(priv, buffer, -priv->xres2, 0, -priv->xres2 + 10, 0, 30); - for (i = -priv->xres2 ; i<-priv->xres2+5 ; i++) - { - droite (priv, buffer, i, 0, i,(int)(priv->lys.E_moyen*2000) , 250); - droite (priv, buffer, i+5, 0, i+5, (int)(priv->lys.dEdt_moyen*25000) , 230); - droite (priv, buffer, i+10, 0, i+10, (int)(priv->lys.dEdt*25000) , 200); - } + for (i = -priv->xres2; i < -priv->xres2 + 5; i++) { + droite(priv, buffer, i, 0, i, (int)(priv->lys.E_moyen * 2000), 250); + droite(priv, buffer, i + 5, 0, i + 5, (int)(priv->lys.dEdt_moyen * 25000), + 230); + droite(priv, buffer, i + 10, 0, i + 10, (int)(priv->lys.dEdt * 25000), 200); + } } /*******************************************************************/ /**************** FUSEES *******************************************/ /*******************************************************************/ -void fusee(JessPrivate *priv, uint8_t * buffer, int new) -{ - int i; - int x=0,y=0; - float factor ; - - if (new == NEW) /* on creer une nouvelle fusee*/ - { - i=0; - while (priv->life[i] > 0) - { - i++; - if (i == FUSEE_MAX) - return; - } - priv->xi[i] = visual_random_context_int(priv->rcontext) % priv->resx - priv->xres2; - priv->yi[i] = -visual_random_context_int(priv->rcontext) % priv->yres2; - priv->life[i] = FUSEE_VIE; /* on donne la vie max*/ - } - else /* on gere les autres */ - { - for(i = 0 ; i< FUSEE_MAX; i++) - { - if (priv->life[i] > 0) /* si elle est vivante */ - { - factor = priv->life[i] / FUSEE_VIE; - x = priv->xi[i] * factor; - y = priv->yi[i] * factor; - priv->life[i]--; - ball (priv, buffer, x, y, (int) FUSEE_RAYON * factor, FUSEE_COLOR); - } - } - } +void fusee(JessPrivate *priv, uint8_t *buffer, int new) { + int i; + int x = 0, y = 0; + float factor; + + if (new == NEW) /* on creer une nouvelle fusee*/ + { + i = 0; + while (priv->life[i] > 0) { + i++; + if (i == FUSEE_MAX) + return; + } + priv->xi[i] = + visual_random_context_int(priv->rcontext) % priv->resx - priv->xres2; + priv->yi[i] = -visual_random_context_int(priv->rcontext) % priv->yres2; + priv->life[i] = FUSEE_VIE; /* on donne la vie max*/ + } else /* on gere les autres */ + { + for (i = 0; i < FUSEE_MAX; i++) { + if (priv->life[i] > 0) /* si elle est vivante */ + { + factor = priv->life[i] / FUSEE_VIE; + x = priv->xi[i] * factor; + y = priv->yi[i] * factor; + priv->life[i]--; + ball(priv, buffer, x, y, (int)FUSEE_RAYON * factor, FUSEE_COLOR); + } + } + } } /*******************************************************************/ /**************** SUPER SPECTRAL ***********************************/ /*******************************************************************/ -void super_spectral_balls(JessPrivate *priv, uint8_t * buffer) -{ - int i,j; - - float dt = priv->conteur.dt; - - int resx = priv->resx; - int resy = priv->resy; - int xres2 = priv->xres2; - int yres2 = priv->yres2; - - for(i=0; i < 256 ;i++) /* pour chaque frequence */ - { - if (priv->lys.dbeat[i] == NEW) /*creation d'une nouvelle ligne */ - { - priv->lys.dbeat[i] = MANAGE; - j=0; - while (priv->lifev[i][j] > 0) - { - j++; - if (j == LINE_MAX+1) - goto quit; /* pas de place desole */ - } - - /* initialisation de la ligne */ - priv->lifev[i][j] = LINE_VIE; - priv->vx[i][j] = RESFACTXF( 0.025*((float) i - 128.0) * 32 +0* - (1-visual_random_context_int(priv->rcontext)/(float)UINT32_MAX) ); - priv->vy[i][j] = RESFACTYF( (10+i)*i*priv->lys.Ed_moyen[i]*5000*( (float)j+1)/4); - priv->x[i][j] = RESFACTXF( 2*(i - 128) ) +((float)j*(i-128))/2; - priv->y[i][j] = 0*RESFACTXF( yres2/2-(float)((i-128)*(i-128))/256) -20*j ; - } -quit:; /* pas de nouvelle ligne */ - - for (j=0 ; j < LINE_MAX ; j++) - { - if (priv->lifev[i][j] > 0) - { - - priv->vy[i][j] += -0.5*dt*1024; - priv->x[i][j] += priv->vx[i][j] * dt; - priv->y[i][j] += priv->vy[i][j] * dt; - - boule(priv, buffer, (int) priv->x[i][j], (int) priv->y[i][j], 5, - 250*(LINE_VIE-priv->lifev[i][j])/LINE_VIE); - - if ((priv->y[i][j] < resy) &&(priv->y[i][j] > -resy) ) /*oui !*/ - { - if (i>128) - droite (priv, buffer, priv->xres2, (int) priv->y[i][j] / 32, - (int) priv->x[i][j], (int) priv->y[i][j], 50 * - (LINE_VIE-priv->lifev[i][j]) / LINE_VIE); - else - droite (priv, buffer, -xres2, (int) priv->y[i][j] / 32, - (int) priv->x[i][j], (int) priv->y[i][j], 50 * - (LINE_VIE-priv->lifev[i][j])/LINE_VIE); - } - priv->lifev[i][j]--; - } - } - } +void super_spectral_balls(JessPrivate *priv, uint8_t *buffer) { + int i, j; + + float dt = priv->conteur.dt; + + int resx = priv->resx; + int resy = priv->resy; + int xres2 = priv->xres2; + int yres2 = priv->yres2; + + for (i = 0; i < 256; i++) /* pour chaque frequence */ + { + if (priv->lys.dbeat[i] == NEW) /*creation d'une nouvelle ligne */ + { + priv->lys.dbeat[i] = MANAGE; + j = 0; + while (priv->lifev[i][j] > 0) { + j++; + if (j == LINE_MAX + 1) + goto quit; /* pas de place desole */ + } + + /* initialisation de la ligne */ + priv->lifev[i][j] = LINE_VIE; + priv->vx[i][j] = + RESFACTXF(0.025 * ((float)i - 128.0) * 32 + + 0 * (1 - visual_random_context_int(priv->rcontext) / + (float)UINT32_MAX)); + priv->vy[i][j] = RESFACTYF((10 + i) * i * priv->lys.Ed_moyen[i] * 5000 * + ((float)j + 1) / 4); + priv->x[i][j] = RESFACTXF(2 * (i - 128)) + ((float)j * (i - 128)) / 2; + priv->y[i][j] = + 0 * RESFACTXF(yres2 / 2 - (float)((i - 128) * (i - 128)) / 256) - + 20 * j; + } + quit:; /* pas de nouvelle ligne */ + + for (j = 0; j < LINE_MAX; j++) { + if (priv->lifev[i][j] > 0) { + + priv->vy[i][j] += -0.5 * dt * 1024; + priv->x[i][j] += priv->vx[i][j] * dt; + priv->y[i][j] += priv->vy[i][j] * dt; + + boule(priv, buffer, (int)priv->x[i][j], (int)priv->y[i][j], 5, + 250 * (LINE_VIE - priv->lifev[i][j]) / LINE_VIE); + + if ((priv->y[i][j] < resy) && (priv->y[i][j] > -resy)) /*oui !*/ + { + if (i > 128) + droite(priv, buffer, priv->xres2, (int)priv->y[i][j] / 32, + (int)priv->x[i][j], (int)priv->y[i][j], + 50 * (LINE_VIE - priv->lifev[i][j]) / LINE_VIE); + else + droite(priv, buffer, -xres2, (int)priv->y[i][j] / 32, + (int)priv->x[i][j], (int)priv->y[i][j], + 50 * (LINE_VIE - priv->lifev[i][j]) / LINE_VIE); + } + priv->lifev[i][j]--; + } + } + } } /*******************************************************************/ /**************** SUPER SPECTRAL ***********************************/ /*******************************************************************/ -void super_spectral(JessPrivate *priv, uint8_t * buffer) -{ - int i,j; - - float nx,ny; - float taille,dt = priv->conteur.dt; - - int resx = priv->resx; - int resy = priv->resy; - int yres2 = priv->yres2; - - for(i=0; i < 256 ;i++) /* pour chaque frequence */ - { - if (priv->lys.dbeat[i] == NEW) /*creation d'une nouvelle ligne */ - { - priv->lys.dbeat[i] = MANAGE; - j=0; - while (priv->lifet[i][j] > 0) - { - j++; - if (j == LINE_MAX+1) - goto quit; /* pas de place desole */ - } - /* initialisation de la ligne */ - priv->lifet[i][j] = LINE_VIE; - priv->ssvx[i][j] = 0*RESFACTXF( 0.025*((float) i - 128.0) * 32 + - visual_random_context_int(priv->rcontext)/(float)UINT32_MAX*60 ); - priv->ssvy[i][j] = 0*RESFACTYF( 64 +visual_random_context_int(priv->rcontext)/(float)UINT32_MAX*64); - priv->ssx[i][j] = RESFACTXF( 2*(i - 128) ) +((float)j*(i-128))/2; - priv->ssy[i][j] = 0*RESFACTXF( yres2/2-(float)((i-128)*(i-128))/256) -20*j+60 ; - priv->sstheta[i][j] = 0; - priv->ssomega[i][j] = (10+i)*i*priv->lys.Ed_moyen[i]*32; - } -quit:; /* pas de nouvelle ligne */ - for (j=0 ; j < LINE_MAX ; j++) - if (priv->lifet[i][j] > 0) - { - priv->sstheta[i][j] += priv->ssomega[i][j]*dt; - priv->ssvy[i][j] += -0.5*dt*1024*0; - priv->ssx[i][j] += priv->ssvx[i][j] * dt; - priv->ssy[i][j] += priv->ssvy[i][j] * dt; - taille = RESFACTXF(70) * (0+2*(LINE_VIE-priv->lifet[i][j]))/LINE_VIE*(j+1)/6; - nx = taille*sin(priv->sstheta[i][j]); - ny = taille*cos(priv->sstheta[i][j]); - - droite (priv, buffer, (int) priv->ssx[i][j]+nx , (int) priv->ssy[i][j]+ny, (int) priv->ssx[i][j], (int) priv->ssy[i][j], 50*(LINE_VIE-priv->lifet[i][j])/LINE_VIE); - - if (priv->video ==8) - cercle (priv, buffer, (int) priv->ssx[i][j]+nx, (int) priv->ssy[i][j]+ny, 3*j, 150*(LINE_VIE-priv->lifet[i][j])/LINE_VIE); - else - cercle_32 (priv, buffer, (int) priv->ssx[i][j]+nx, (int) priv->ssy[i][j]+ny, 3*j, 150*(LINE_VIE-priv->lifet[i][j])/LINE_VIE); - - priv->lifet[i][j]--; - } - } +void super_spectral(JessPrivate *priv, uint8_t *buffer) { + int i, j; + + float nx, ny; + float taille, dt = priv->conteur.dt; + + int resx = priv->resx; + int resy = priv->resy; + int yres2 = priv->yres2; + + for (i = 0; i < 256; i++) /* pour chaque frequence */ + { + if (priv->lys.dbeat[i] == NEW) /*creation d'une nouvelle ligne */ + { + priv->lys.dbeat[i] = MANAGE; + j = 0; + while (priv->lifet[i][j] > 0) { + j++; + if (j == LINE_MAX + 1) + goto quit; /* pas de place desole */ + } + /* initialisation de la ligne */ + priv->lifet[i][j] = LINE_VIE; + priv->ssvx[i][j] = + 0 * RESFACTXF(0.025 * ((float)i - 128.0) * 32 + + visual_random_context_int(priv->rcontext) / + (float)UINT32_MAX * 60); + priv->ssvy[i][j] = + 0 * RESFACTYF(64 + visual_random_context_int(priv->rcontext) / + (float)UINT32_MAX * 64); + priv->ssx[i][j] = RESFACTXF(2 * (i - 128)) + ((float)j * (i - 128)) / 2; + priv->ssy[i][j] = + 0 * RESFACTXF(yres2 / 2 - (float)((i - 128) * (i - 128)) / 256) - + 20 * j + 60; + priv->sstheta[i][j] = 0; + priv->ssomega[i][j] = (10 + i) * i * priv->lys.Ed_moyen[i] * 32; + } + quit:; /* pas de nouvelle ligne */ + for (j = 0; j < LINE_MAX; j++) + if (priv->lifet[i][j] > 0) { + priv->sstheta[i][j] += priv->ssomega[i][j] * dt; + priv->ssvy[i][j] += -0.5 * dt * 1024 * 0; + priv->ssx[i][j] += priv->ssvx[i][j] * dt; + priv->ssy[i][j] += priv->ssvy[i][j] * dt; + taille = RESFACTXF(70) * (0 + 2 * (LINE_VIE - priv->lifet[i][j])) / + LINE_VIE * (j + 1) / 6; + nx = taille * sin(priv->sstheta[i][j]); + ny = taille * cos(priv->sstheta[i][j]); + + droite(priv, buffer, (int)priv->ssx[i][j] + nx, + (int)priv->ssy[i][j] + ny, (int)priv->ssx[i][j], + (int)priv->ssy[i][j], + 50 * (LINE_VIE - priv->lifet[i][j]) / LINE_VIE); + + if (priv->video == 8) + cercle(priv, buffer, (int)priv->ssx[i][j] + nx, + (int)priv->ssy[i][j] + ny, 3 * j, + 150 * (LINE_VIE - priv->lifet[i][j]) / LINE_VIE); + else + cercle_32(priv, buffer, (int)priv->ssx[i][j] + nx, + (int)priv->ssy[i][j] + ny, 3 * j, + 150 * (LINE_VIE - priv->lifet[i][j]) / LINE_VIE); + + priv->lifet[i][j]--; + } + } } /*******************************************************************/ /**************** GRANDE GRILLE ************************************/ /*******************************************************************/ -void grille_3d (JessPrivate *priv, uint8_t * buffer, float data[2][512], float alpha, float beta, - float gamma, int persp, int dist_cam) -{ - - float x, y, z, xres2 = (float) (priv->resx >> 1); - short ax = 0, ay = 0, ix, iy, i, j, nb_x, nb_y; - uint8_t color; - - int resx = priv->resx; - int resy = priv->resy; - - nb_x = 32; - nb_y = 32; - - for (i = 0; i < nb_x; i++) - { - /* Optimisation par Karl Soulabaille. Factorisation et expressions communes. */ - for (j = 0; j < nb_y; j++) - { - x = RESFACTXF ((i - ((float) nb_x) / 2) * 10); - y = RESFACTYF ((j - ((float) nb_y) / 2) * 10); - - if (j >= 16) - { - z = RESFACTXF ((float) (data[0][i + nb_x * (j - 16)]) * 256); - color = data[0][i + nb_x * (j - 16)] * 64 + 100; - } - else - { - z = RESFACTXF ((float) (data[1][i + nb_x * j]) * 256); - color = (data[1][i + nb_x * j]) * 64 + 100; - } - - rotation_3d (&x, &y, &z, alpha, beta, gamma); - perspective (&x, &y, &z, persp, dist_cam); - - if (x >= xres2) - { - x = xres2 - 1; - color = 0; - } - if (x <= -xres2) - { - x = -xres2 + 1; - color = 0; - } - if (y >= priv->yres2) - { - y = priv->yres2 - 1; - color = 0; - } - if (y <= -priv->yres2) - { - y = -priv->yres2 + 1; - color = 0; - } - - ix = (int) x; - iy = (int) y; - - if (j != 0) - droite (priv, buffer, ix, iy, ax, ay, color); - - ax = ix; - ay = iy; - } - } +void grille_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512], + float alpha, float beta, float gamma, int persp, int dist_cam) { + + float x, y, z, xres2 = (float)(priv->resx >> 1); + short ax = 0, ay = 0, ix, iy, i, j, nb_x, nb_y; + uint8_t color; + + int resx = priv->resx; + int resy = priv->resy; + + nb_x = 32; + nb_y = 32; + + for (i = 0; i < nb_x; i++) { + /* Optimisation par Karl Soulabaille. Factorisation et expressions communes. + */ + for (j = 0; j < nb_y; j++) { + x = RESFACTXF((i - ((float)nb_x) / 2) * 10); + y = RESFACTYF((j - ((float)nb_y) / 2) * 10); + + if (j >= 16) { + z = RESFACTXF((float)(data[0][i + nb_x * (j - 16)]) * 256); + color = data[0][i + nb_x * (j - 16)] * 64 + 100; + } else { + z = RESFACTXF((float)(data[1][i + nb_x * j]) * 256); + color = (data[1][i + nb_x * j]) * 64 + 100; + } + + rotation_3d(&x, &y, &z, alpha, beta, gamma); + perspective(&x, &y, &z, persp, dist_cam); + + if (x >= xres2) { + x = xres2 - 1; + color = 0; + } + if (x <= -xres2) { + x = -xres2 + 1; + color = 0; + } + if (y >= priv->yres2) { + y = priv->yres2 - 1; + color = 0; + } + if (y <= -priv->yres2) { + y = -priv->yres2 + 1; + color = 0; + } + + ix = (int)x; + iy = (int)y; + + if (j != 0) + droite(priv, buffer, ix, iy, ax, ay, color); + + ax = ix; + ay = iy; + } + } } /*******************************************************************/ /**************** 2 GRILLES JUMELLES *******************************/ /*******************************************************************/ -void l2_grilles_3d (JessPrivate *priv, uint8_t * buffer, float data[2][512], float alpha, float beta, - float gamma, int persp, int dist_cam) -{ +void l2_grilles_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512], + float alpha, float beta, float gamma, int persp, + int dist_cam) { - float x, y, z, xres4 = (float) (priv->resx >> 2); - short ax = 0, ay = 0, ix, iy, i, j, nb_x, nb_y; - uint8_t color[16][16]; + float x, y, z, xres4 = (float)(priv->resx >> 2); + short ax = 0, ay = 0, ix, iy, i, j, nb_x, nb_y; + uint8_t color[16][16]; - int resx = priv->resx; - int resy = priv->resy; + int resx = priv->resx; + int resy = priv->resy; - nb_x = 16; - nb_y = 16; + nb_x = 16; + nb_y = 16; - for (i = 0; i < nb_x; i++) - { - /* Optimisation par Karl Soulabaille. Factorisation de calcul & expression commune */ - x = RESFACTXF ((i - ((float) nb_x / 2)) * 15); - for (j = 0; j < nb_y; j++) - { - y = RESFACTYF ((j - ((float) nb_y / 2)) * 15); + for (i = 0; i < nb_x; i++) { + /* Optimisation par Karl Soulabaille. Factorisation de calcul & expression + * commune */ + x = RESFACTXF((i - ((float)nb_x / 2)) * 15); + for (j = 0; j < nb_y; j++) { + y = RESFACTYF((j - ((float)nb_y / 2)) * 15); - z = fabs(RESFACTXF ((float) (data[1][i + nb_x * j]) * 256)); - color[i][j] = data[1][i + nb_x * j] * 64 + 100; + z = fabs(RESFACTXF((float)(data[1][i + nb_x * j]) * 256)); + color[i][j] = data[1][i + nb_x * j] * 64 + 100; - rotation_3d (&x, &y, &z, alpha, beta, gamma); - perspective (&x, &y, &z, persp, dist_cam); + rotation_3d(&x, &y, &z, alpha, beta, gamma); + perspective(&x, &y, &z, persp, dist_cam); - ix = (int) x; - iy = (int) y; + ix = (int)x; + iy = (int)y; - if (j != 0) - { - droite (priv, buffer, ix - xres4, iy, ax - xres4, ay, color[i][j]); - droite (priv, buffer, ix + xres4, iy, ax + xres4, ay, color[i][j]); - } + if (j != 0) { + droite(priv, buffer, ix - xres4, iy, ax - xres4, ay, color[i][j]); + droite(priv, buffer, ix + xres4, iy, ax + xres4, ay, color[i][j]); + } - ax = ix; - ay = iy; - } - } + ax = ix; + ay = iy; + } + } } /*******************************************************************/ /**************** BURN 3D ******************************************/ /*******************************************************************/ -void burn_3d (JessPrivate *priv, uint8_t * buffer, float data[2][512], float alpha, float beta, - float gamma, int persp, int dist_cam, int mode) -{ - float x,y,z,xres2 = (float) (priv->resx >> 1), yres2 = (float) (priv->resy >> 1); - short ix, iy, i, j, nb_x, nb_y, color, taille; - - /* Variable temporaire pour la factorisation de constantes */ - float temp1, temp2, temp3, temp3b, temp4, temp4b, temp5,temp6,temp7,temp8,temp9; - - int resx = priv->resx; - int resy = priv->resy; - - nb_x = 12; - nb_y = 12; - - /* 4 cas: */ - switch(mode) { - case 0: - - temp1 = 2*PI/nb_x*cos(alpha); - temp2 = 2*PI/nb_y; - for (i = 0 ; i< nb_x ; i++) - { - temp3 = (float)((int)(i*i)); - for (j = 0 ; j= xres2 || x <= -xres2 || y >= yres2 || y <= -yres2)) - { - ix = (int) x; - iy = (int) y; - - color = ((int)(float)(100+0.4*z)); - if (color<0) - color = 0; - taille = color/8; - - boule (priv, buffer, ix, iy, taille, color); - } - } - } - break; - case 1: - temp1 = PI/(nb_x*nb_x*nb_x)*fabs(priv->lys.dEdt_moyen*5000); - temp6 = 2*PI/nb_y; - for (i = 0 ; i< nb_x ; i++) - { - temp3 = (float)(i*i*i); - temp4 = sin((i+1)*PI/nb_x); - temp5 = 5*alpha*2*PI/nb_x*i; - temp3b = temp3*temp1; - temp4b = temp4*temp1; - - for (j = 0 ; jlys.dEdt_moyen*1000)); - rotation_3d (&x, &y, &z, alpha, beta, gamma); - perspective (&x, &y, &z, persp, dist_cam); - if (!(x >= xres2 || x <= -xres2 || y >= yres2 || y <= -yres2)) - { - ix = (int) x; - iy = (int) y; - - color = ((int)(float)(100+0.4*z)); - if (color<0) - color = 0; - taille = color/8; - - boule (priv, buffer, ix, iy, taille, color); - } - } - } - break; - case 2: - temp5 = 2*PI/(5*nb_x); - temp6 = 2*PI/nb_y; - for (i = 0 ; i< nb_x ; i++) - { - temp1 = sin((i+1)*PI/nb_x); - temp2 = temp5 * -i; - - for (j = 0 ; jlys.dEdt_moyen*1000 ); - rotation_3d (&x, &y, &z, alpha, beta, gamma); - perspective (&x, &y, &z, persp, dist_cam); - if (!(x >= xres2 || x <= -xres2 || y >= yres2 || y <= -yres2)) - { - ix = (int) x; - iy = (int) y; - - color = ((int)(float)(100+0.4*z)); - if (color<0) - color = 0; - taille = color/8; - - boule (priv, buffer, ix, iy, taille, color); - } - } - } - break; - case 3: - temp5 = 25; - temp6 = ((float)(-2))*PI/(10*nb_x); - temp8 = (float)(2)*PI/nb_y; - temp9 = 10*alpha; - for (i = 0 ; i< nb_x ; i++) - { - temp5 += 25; - temp7 = -i*temp6; - for (j = 0 ; j= xres2 || x <= -xres2 || y >= yres2 || y <= -yres2)) - { - ix = (int) x; - iy = (int) y; - - color = ((int)(float)(100+0.4*z)); - if (color<0) - color = 0; - taille = color/8; - - boule (priv, buffer, ix, iy, taille, color); - } - } - } - break; - } +void burn_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512], + float alpha, float beta, float gamma, int persp, int dist_cam, + int mode) { + float x, y, z, xres2 = (float)(priv->resx >> 1), + yres2 = (float)(priv->resy >> 1); + short ix, iy, i, j, nb_x, nb_y, color, taille; + + /* Variable temporaire pour la factorisation de constantes */ + float temp1, temp2, temp3, temp3b, temp4, temp4b, temp5, temp6, temp7, temp8, + temp9; + + int resx = priv->resx; + int resy = priv->resy; + + nb_x = 12; + nb_y = 12; + + /* 4 cas: */ + switch (mode) { + case 0: + + temp1 = 2 * PI / nb_x * cos(alpha); + temp2 = 2 * PI / nb_y; + for (i = 0; i < nb_x; i++) { + temp3 = (float)((int)(i * i)); + for (j = 0; j < nb_y; j++) { + x = RESFACTXF((float)25 * (i + 1) * cos(temp3 * temp1 + temp2 * j)); + y = RESFACTYF((float)25 * (i + 1) * sin(temp3 * temp1 + temp2 * j)); + z = RESFACTXF(40 * cos(5 * alpha)); + rotation_3d(&x, &y, &z, alpha, beta, gamma); + perspective(&x, &y, &z, persp, dist_cam); + if (!(x >= xres2 || x <= -xres2 || y >= yres2 || y <= -yres2)) { + ix = (int)x; + iy = (int)y; + + color = ((int)(float)(100 + 0.4 * z)); + if (color < 0) + color = 0; + taille = color / 8; + + boule(priv, buffer, ix, iy, taille, color); + } + } + } + break; + case 1: + temp1 = PI / (nb_x * nb_x * nb_x) * fabs(priv->lys.dEdt_moyen * 5000); + temp6 = 2 * PI / nb_y; + for (i = 0; i < nb_x; i++) { + temp3 = (float)(i * i * i); + temp4 = sin((i + 1) * PI / nb_x); + temp5 = 5 * alpha * 2 * PI / nb_x * i; + temp3b = temp3 * temp1; + temp4b = temp4 * temp1; + + for (j = 0; j < nb_y; j++) { + x = RESFACTXF((float)50 * (temp3b + temp4 * cos(temp5 + temp6 * j))); + y = RESFACTYF((float)50 * (temp4b + temp4 * sin(temp5 + temp6 * j))); + z = RESFACTXF((float)100 * cos((float)i / nb_x * PI) * + (1 + priv->lys.dEdt_moyen * 1000)); + rotation_3d(&x, &y, &z, alpha, beta, gamma); + perspective(&x, &y, &z, persp, dist_cam); + if (!(x >= xres2 || x <= -xres2 || y >= yres2 || y <= -yres2)) { + ix = (int)x; + iy = (int)y; + + color = ((int)(float)(100 + 0.4 * z)); + if (color < 0) + color = 0; + taille = color / 8; + + boule(priv, buffer, ix, iy, taille, color); + } + } + } + break; + case 2: + temp5 = 2 * PI / (5 * nb_x); + temp6 = 2 * PI / nb_y; + for (i = 0; i < nb_x; i++) { + temp1 = sin((i + 1) * PI / nb_x); + temp2 = temp5 * -i; + + for (j = 0; j < nb_y; j++) { + x = RESFACTXF((float)130 * temp1 * cos(temp2 + j * temp6)); + y = RESFACTYF((float)130 * temp1 * sin(temp2 + j * temp6)); + z = -RESFACTXF(130 * cos((float)i / nb_x * PI) * priv->lys.dEdt_moyen * + 1000); + rotation_3d(&x, &y, &z, alpha, beta, gamma); + perspective(&x, &y, &z, persp, dist_cam); + if (!(x >= xres2 || x <= -xres2 || y >= yres2 || y <= -yres2)) { + ix = (int)x; + iy = (int)y; + + color = ((int)(float)(100 + 0.4 * z)); + if (color < 0) + color = 0; + taille = color / 8; + + boule(priv, buffer, ix, iy, taille, color); + } + } + } + break; + case 3: + temp5 = 25; + temp6 = ((float)(-2)) * PI / (10 * nb_x); + temp8 = (float)(2) * PI / nb_y; + temp9 = 10 * alpha; + for (i = 0; i < nb_x; i++) { + temp5 += 25; + temp7 = -i * temp6; + for (j = 0; j < nb_y; j++) { + x = RESFACTXF((float)temp5 * cos(temp7 + temp8 * j)); + y = RESFACTYF((float)temp5 * sin(temp7 + temp8 * j)); + z = RESFACTXF(60 * (cos(temp8 * j + temp9) + cos(-temp7))); + rotation_3d(&x, &y, &z, alpha, beta, gamma); + perspective(&x, &y, &z, persp, dist_cam); + if (!(x >= xres2 || x <= -xres2 || y >= yres2 || y <= -yres2)) { + ix = (int)x; + iy = (int)y; + + color = ((int)(float)(100 + 0.4 * z)); + if (color < 0) + color = 0; + taille = color / 8; + + boule(priv, buffer, ix, iy, taille, color); + } + } + } + break; + } } /*******************************************************************/ /**************** STARS MORPH **************************************/ /*******************************************************************/ -void stars_create_state(JessPrivate *priv, float pos[3][STARS_MAX], int mode) -{ - int i,j,sq=sqrt(STARS_MAX); - float fsq = (float) sq; - - - switch(mode) - { - case 0: - for(i=0 ; i< STARS_MAX; i++) - { - for(j=0; j<3 ; j++) - { - pos[j][i] = 0; - } - } - break; - case 1: - for(i=0 ; i< STARS_MAX; i++) - { - for(j=0; j<3 ; j++) - { - pos[j][i] = (visual_random_context_int(priv->rcontext)/(float)UINT32_MAX-0.5); - - } - } - break; - case 2: - for(j=0 ; j< sq; j++) - { - for(i=0 ; i< sq; i++) - { - pos[0][i + j*sq] = (i - fsq/2)*2/fsq; - pos[1][i + j*sq] = (j - fsq/2)*2/fsq; - pos[2][i + j*sq] = 0; - } - } - break; - case 3: - for(j=0 ; j< sq; j++) - { - for(i=0 ; i< sq; i++) - { - pos[0][i + j*sq] = sin((i+1)*PI/fsq); - pos[1][i + j*sq] = sin(-i*2*PI/(10*fsq)+ j*2*PI/fsq) ; - pos[2][i + j*sq] = cos(j*2*PI/fsq) ; - } - } - break; - } +void stars_create_state(JessPrivate *priv, float pos[3][STARS_MAX], int mode) { + int i, j, sq = sqrt(STARS_MAX); + float fsq = (float)sq; + + switch (mode) { + case 0: + for (i = 0; i < STARS_MAX; i++) { + for (j = 0; j < 3; j++) { + pos[j][i] = 0; + } + } + break; + case 1: + for (i = 0; i < STARS_MAX; i++) { + for (j = 0; j < 3; j++) { + pos[j][i] = + (visual_random_context_int(priv->rcontext) / (float)UINT32_MAX - + 0.5); + } + } + break; + case 2: + for (j = 0; j < sq; j++) { + for (i = 0; i < sq; i++) { + pos[0][i + j * sq] = (i - fsq / 2) * 2 / fsq; + pos[1][i + j * sq] = (j - fsq / 2) * 2 / fsq; + pos[2][i + j * sq] = 0; + } + } + break; + case 3: + for (j = 0; j < sq; j++) { + for (i = 0; i < sq; i++) { + pos[0][i + j * sq] = sin((i + 1) * PI / fsq); + pos[1][i + j * sq] = sin(-i * 2 * PI / (10 * fsq) + j * 2 * PI / fsq); + pos[2][i + j * sq] = cos(j * 2 * PI / fsq); + } + } + break; + } } -void stars_manage(JessPrivate *priv, uint8_t *buffer, int new, float alpha, float beta, - float gamma, int persp, int dist_cam) -{ - static float x[STARS_MAX], y[STARS_MAX], z[STARS_MAX]; - float xres2 = (float) (priv->resx >> 1), yres2 = (float) (priv->resy >> 1); - float x_t, y_t, z_t; - float mult; - int ix, iy, i, color, taille; - - if (new == NEW_SESSION) /* explosion */ - { - priv->smmorpheur = 0; - priv->smselect = 1; - stars_create_state(priv, priv->smpos[0], 0); - stars_create_state(priv, priv->smpos[1], 1); - } - else if(new == NEW) /* on creer une nouvelle forme */ - { - mult = 1; - if ((visual_random_context_int(priv->rcontext)%3)==0) - mult = 4; - - for(i = 0 ; i< STARS_MAX; i++) - { - priv->smpos[priv->smselect][0][i]= mult*x[i]; - priv->smpos[priv->smselect][1][i]= mult*y[i]; - priv->smpos[priv->smselect][2][i]= mult*z[i]; - } - priv->smselect = 1 - priv->smselect; - stars_create_state(priv, priv->smpos[priv->smselect], visual_random_context_int(priv->rcontext)%2+1); - } - else /* on gere */ - { - priv->smmorpheur += ( 2 * (float)priv->smselect - 1) * MORPH_SPEED * priv->conteur.dt; - - if (priv->smmorpheur > 1) - priv->smmorpheur = 1; - else if (priv->smmorpheur < 0) - priv->smmorpheur = 0; - - for(i = 0 ; i< STARS_MAX; i++) - { - x[i] =(priv->smpos[1][0][i] * priv->smmorpheur + (1-priv->smmorpheur) * priv->smpos[0][0][i]); - y[i] =(priv->smpos[1][1][i] * priv->smmorpheur + (1-priv->smmorpheur) * priv->smpos[0][1][i]); - z[i] =(priv->smpos[1][2][i] * priv->smmorpheur + (1-priv->smmorpheur) * priv->smpos[0][2][i]); - - x_t = 250 * x[i]; - y_t = 250 * y[i]; - z_t = 250 * z[i]; - - rotation_3d (&x_t, &y_t, &z_t, alpha, beta, gamma); - perspective (&x_t, &y_t, &z_t, persp, dist_cam); - - if ((int)x_t >= xres2 || (int)x_t <= -xres2 || (int)y_t >= yres2 || (int)y_t <= -yres2 || z_t >2*dist_cam) - return; - - ix = (int) x_t; - iy = (int) y_t; - - color = ((int)(float)(100+0.4*z_t)); - if (color<0) - color = 0; - - taille = color/8; - - droite(priv, buffer,ix,iy, xres2/2 ,-yres2 , color/8); - boule (priv, buffer, ix, iy, taille, color); - } - } +void stars_manage(JessPrivate *priv, uint8_t *buffer, int new, float alpha, + float beta, float gamma, int persp, int dist_cam) { + static float x[STARS_MAX], y[STARS_MAX], z[STARS_MAX]; + float xres2 = (float)(priv->resx >> 1), yres2 = (float)(priv->resy >> 1); + float x_t, y_t, z_t; + float mult; + int ix, iy, i, color, taille; + + if (new == NEW_SESSION) /* explosion */ + { + priv->smmorpheur = 0; + priv->smselect = 1; + stars_create_state(priv, priv->smpos[0], 0); + stars_create_state(priv, priv->smpos[1], 1); + } else if (new == NEW) /* on creer une nouvelle forme */ + { + mult = 1; + if ((visual_random_context_int(priv->rcontext) % 3) == 0) + mult = 4; + + for (i = 0; i < STARS_MAX; i++) { + priv->smpos[priv->smselect][0][i] = mult * x[i]; + priv->smpos[priv->smselect][1][i] = mult * y[i]; + priv->smpos[priv->smselect][2][i] = mult * z[i]; + } + priv->smselect = 1 - priv->smselect; + stars_create_state(priv, priv->smpos[priv->smselect], + visual_random_context_int(priv->rcontext) % 2 + 1); + } else /* on gere */ + { + priv->smmorpheur += + (2 * (float)priv->smselect - 1) * MORPH_SPEED * priv->conteur.dt; + + if (priv->smmorpheur > 1) + priv->smmorpheur = 1; + else if (priv->smmorpheur < 0) + priv->smmorpheur = 0; + + for (i = 0; i < STARS_MAX; i++) { + x[i] = (priv->smpos[1][0][i] * priv->smmorpheur + + (1 - priv->smmorpheur) * priv->smpos[0][0][i]); + y[i] = (priv->smpos[1][1][i] * priv->smmorpheur + + (1 - priv->smmorpheur) * priv->smpos[0][1][i]); + z[i] = (priv->smpos[1][2][i] * priv->smmorpheur + + (1 - priv->smmorpheur) * priv->smpos[0][2][i]); + + x_t = 250 * x[i]; + y_t = 250 * y[i]; + z_t = 250 * z[i]; + + rotation_3d(&x_t, &y_t, &z_t, alpha, beta, gamma); + perspective(&x_t, &y_t, &z_t, persp, dist_cam); + + if ((int)x_t >= xres2 || (int)x_t <= -xres2 || (int)y_t >= yres2 || + (int)y_t <= -yres2 || z_t > 2 * dist_cam) + return; + + ix = (int)x_t; + iy = (int)y_t; + + color = ((int)(float)(100 + 0.4 * z_t)); + if (color < 0) + color = 0; + + taille = color / 8; + + droite(priv, buffer, ix, iy, xres2 / 2, -yres2, color / 8); + boule(priv, buffer, ix, iy, taille, color); + } + } } /*******************************************************************/ /**************** OSCILLO ******************************************/ /*******************************************************************/ -static uint8_t couleur (JessPrivate *priv, short x) -{ - int resx = priv->resx; +static uint8_t couleur(JessPrivate *priv, short x) { + int resx = priv->resx; - float xf = (float) x, resx2f = (float) resx / 2; - return (uint8_t) ((float) -(xf - resx2f) * (xf + resx2f) * 150 / - (resx2f * resx2f)); + float xf = (float)x, resx2f = (float)resx / 2; + return (uint8_t)((float)-(xf - resx2f) * (xf + resx2f) * 150 / + (resx2f * resx2f)); } -void courbes (JessPrivate *priv, uint8_t * buffer, float data[2][512], uint8_t color, int type) -{ - int j, i, x1, y1, x2=0, y2=0; - int r; +void courbes(JessPrivate *priv, uint8_t *buffer, float data[2][512], + uint8_t color, int type) { + int j, i, x1, y1, x2 = 0, y2 = 0; + int r; - int resx = priv->resx; - int resy = priv->resy; + int resx = priv->resx; + int resy = priv->resy; #define RAYON 100 - switch (type) - { - case 0: - for (i = 0; i < resx - 1 && i < 511; i++) - { - j = i - 256; - droite (priv, buffer, j, data[0][i] * (128) + resy / 6, j + 1, - data[0][i + 1] * (128) + resy / 6, couleur (priv, j)); - droite (priv, buffer, j, data[1][i] * (128) - resy / 6, j + 1, - data[1][i + 1] * (128) - resy / 6, couleur (priv, j)); - } - break; - case 1: - r = data[0][255] * 256; - x2 = (RAYON+r) * cos (255*2*PI/256); - y2 = (RAYON+r) * sin (255*2*PI/256); - for (i = 0; i < 256 ;i++) - { - r = data[0][i] * 256; - x1 = (RAYON+r) * cos (i*2*PI/256); - y1 = (RAYON+r) * sin( i*2*PI/256); - droite(priv, buffer,x1,y1,x2,y2,100); - x2 = x1; - y2 = y1; - } - break; - default: - break; - } - + switch (type) { + case 0: + for (i = 0; i < resx - 1 && i < 511; i++) { + j = i - 256; + droite(priv, buffer, j, data[0][i] * (128) + resy / 6, j + 1, + data[0][i + 1] * (128) + resy / 6, couleur(priv, j)); + droite(priv, buffer, j, data[1][i] * (128) - resy / 6, j + 1, + data[1][i + 1] * (128) - resy / 6, couleur(priv, j)); + } + break; + case 1: + r = data[0][255] * 256; + x2 = (RAYON + r) * cos(255 * 2 * PI / 256); + y2 = (RAYON + r) * sin(255 * 2 * PI / 256); + for (i = 0; i < 256; i++) { + r = data[0][i] * 256; + x1 = (RAYON + r) * cos(i * 2 * PI / 256); + y1 = (RAYON + r) * sin(i * 2 * PI / 256); + droite(priv, buffer, x1, y1, x2, y2, 100); + x2 = x1; + y2 = y1; + } + break; + default: + break; + } } /*******************************************************************/ /**************** SINUS_RECT ***************************************/ /*******************************************************************/ -void sinus_rect (JessPrivate *priv, uint8_t * buffer, int k) -{ - int resx = priv->resx; - int resy = priv->resy; - - float fk = k; - - ball (priv, buffer, RESFACTXF (250 * cos (fk / 25)), - RESFACTYF (100 * sin (2 * fk / 25)), RESFACTXF (100), 200); - ball (priv, buffer, RESFACTXF (-250 * cos (fk / 25)), - RESFACTYF (100 * sin (2 * fk / 25)), RESFACTXF (100), 200); -} +void sinus_rect(JessPrivate *priv, uint8_t *buffer, int k) { + int resx = priv->resx; + int resy = priv->resy; + float fk = k; + + ball(priv, buffer, RESFACTXF(250 * cos(fk / 25)), + RESFACTYF(100 * sin(2 * fk / 25)), RESFACTXF(100), 200); + ball(priv, buffer, RESFACTXF(-250 * cos(fk / 25)), + RESFACTYF(100 * sin(2 * fk / 25)), RESFACTXF(100), 200); +} diff --git a/libvisual-plugins/plugins/actor/jess/draw.h b/libvisual-plugins/plugins/actor/jess/draw.h index 9287cc160..334bc59d9 100644 --- a/libvisual-plugins/plugins/actor/jess/draw.h +++ b/libvisual-plugins/plugins/actor/jess/draw.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -24,14 +24,21 @@ #include "jess.h" -void analyser(JessPrivate *priv, uint8_t * buffer); -void fusee(JessPrivate *priv, uint8_t * buffer, int new); -void super_spectral(JessPrivate *priv, uint8_t * buffer); -void super_spectral_balls(JessPrivate *priv, uint8_t * buffer); -void grille_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512],float alpha, float beta, float gamma, int persp, int dist_cam); -void l2_grilles_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512],float alpha, float beta, float gamma, int persp, int dist_cam); -void burn_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512],float alpha, float beta, float gamma, int persp, int dist_cam, int mode); -void courbes(JessPrivate *priv, uint8_t *buffer, float data[2][512],uint8_t color, int type); -void sinus_rect(JessPrivate *priv, uint8_t *buffer,int k); +void analyser(JessPrivate *priv, uint8_t *buffer); +void fusee(JessPrivate *priv, uint8_t *buffer, int new); +void super_spectral(JessPrivate *priv, uint8_t *buffer); +void super_spectral_balls(JessPrivate *priv, uint8_t *buffer); +void grille_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512], + float alpha, float beta, float gamma, int persp, int dist_cam); +void l2_grilles_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512], + float alpha, float beta, float gamma, int persp, + int dist_cam); +void burn_3d(JessPrivate *priv, uint8_t *buffer, float data[2][512], + float alpha, float beta, float gamma, int persp, int dist_cam, + int mode); +void courbes(JessPrivate *priv, uint8_t *buffer, float data[2][512], + uint8_t color, int type); +void sinus_rect(JessPrivate *priv, uint8_t *buffer, int k); void stars_create_state(JessPrivate *priv, float pos[3][STARS_MAX], int mode); -void stars_manage(JessPrivate *priv, uint8_t *buffer, int new, float alpha, float beta, float gamma, int persp, int dist_cam); +void stars_manage(JessPrivate *priv, uint8_t *buffer, int new, float alpha, + float beta, float gamma, int persp, int dist_cam); diff --git a/libvisual-plugins/plugins/actor/jess/draw_low_level.c b/libvisual-plugins/plugins/actor/jess/draw_low_level.c index 01bdf6c1e..376c8a32e 100644 --- a/libvisual-plugins/plugins/actor/jess/draw_low_level.c +++ b/libvisual-plugins/plugins/actor/jess/draw_low_level.c @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -29,384 +29,335 @@ #include "draw_low_level.h" #include "jess.h" -#define MAXE(a,b) ( (a) > (b) ? (b) : (a)) +#define MAXE(a, b) ((a) > (b) ? (b) : (a)) /*#define MAXE(a,b) (((int)(a>b))&1)*b+(((int)(!(a>b))&1)*a) */ -#define MAX255(a) ((a<=255)*a+(!(a<=255))*255) +#define MAX255(a) ((a <= 255) * a + (!(a <= 255)) * 255) -void tracer_point_add (JessPrivate *priv, uint8_t * buffer, int x, int y, uint8_t color) -{ - uint8_t *point; - int calcul; +void tracer_point_add(JessPrivate *priv, uint8_t *buffer, int x, int y, + uint8_t color) { + uint8_t *point; + int calcul; - /* goto non; */ + /* goto non; */ - if (x >= priv->xres2 || x <= -priv->xres2 || y >= priv->yres2 || y <= -priv->yres2) - return; + if (x >= priv->xres2 || x <= -priv->xres2 || y >= priv->yres2 || + y <= -priv->yres2) + return; - point = buffer + (-y + priv->yres2) * priv->resx + x + priv->xres2; - calcul = (int)(color) + (int)(*point); - *point = MAX255(calcul); - /* *point = MAXE ((int)color + *point, 255); - */ + point = buffer + (-y + priv->yres2) * priv->resx + x + priv->xres2; + calcul = (int)(color) + (int)(*point); + *point = MAX255(calcul); + /* *point = MAXE ((int)color + *point, 255); + */ } -void tracer_point_add_32 (JessPrivate *priv, uint8_t * buffer, int x, int y, uint8_t color) -{ - uint8_t *point; - int calcul; +void tracer_point_add_32(JessPrivate *priv, uint8_t *buffer, int x, int y, + uint8_t color) { + uint8_t *point; + int calcul; - if (x >= priv->xres2 || x <= -priv->xres2 || y >= priv->yres2 || y <= -priv->yres2) - return; + if (x >= priv->xres2 || x <= -priv->xres2 || y >= priv->yres2 || + y <= -priv->yres2) + return; - point = buffer + (-y + priv->yres2) * priv->pitch + ((x + priv->xres2) << 2); - /* *point = MAXE ((int)(color) + *point, 255); */ - calcul = (int)(color) + (int)(*point); - *point = MAX255(calcul); + point = buffer + (-y + priv->yres2) * priv->pitch + ((x + priv->xres2) << 2); + /* *point = MAXE ((int)(color) + *point, 255); */ + calcul = (int)(color) + (int)(*point); + *point = MAX255(calcul); - point++; + point++; - calcul = (int)(color) + (int)(*point); - *point = MAX255(calcul); + calcul = (int)(color) + (int)(*point); + *point = MAX255(calcul); - /* *point = MAXE ((int)color + *point, 255); */ - point++; - calcul = (int)(color) + (int)(*point); - *point = MAX255(calcul); + /* *point = MAXE ((int)color + *point, 255); */ + point++; + calcul = (int)(color) + (int)(*point); + *point = MAX255(calcul); - /* *point = MAXE ((int)color + *point, 255); */ + /* *point = MAXE ((int)color + *point, 255); */ } -void cercle (JessPrivate *priv, uint8_t * buffer, int h, int k, int y, uint8_t color) -{ - int x = -1, d = 3 - 2 * y; - - while (x <= y) - { - if (d < 0) - { - d += 4 * x + 6; - x++; - } - else - { - d += 4 * (x - y) + 10; - x++; - y--; - } - tracer_point_add (priv, buffer, h + x, y + k, color); - tracer_point_add (priv, buffer, h + y, x + k, color); - tracer_point_add (priv, buffer, h - y, x + k, color); - tracer_point_add (priv, buffer, h - x, y + k, color); - tracer_point_add (priv, buffer, h - x, -y + k, color); - tracer_point_add (priv, buffer, h - y, -x + k, color); - tracer_point_add (priv, buffer, h + y, -x + k, color); - tracer_point_add (priv, buffer, h + x, -y + k, color); - } +void cercle(JessPrivate *priv, uint8_t *buffer, int h, int k, int y, + uint8_t color) { + int x = -1, d = 3 - 2 * y; + + while (x <= y) { + if (d < 0) { + d += 4 * x + 6; + x++; + } else { + d += 4 * (x - y) + 10; + x++; + y--; + } + tracer_point_add(priv, buffer, h + x, y + k, color); + tracer_point_add(priv, buffer, h + y, x + k, color); + tracer_point_add(priv, buffer, h - y, x + k, color); + tracer_point_add(priv, buffer, h - x, y + k, color); + tracer_point_add(priv, buffer, h - x, -y + k, color); + tracer_point_add(priv, buffer, h - y, -x + k, color); + tracer_point_add(priv, buffer, h + y, -x + k, color); + tracer_point_add(priv, buffer, h + x, -y + k, color); + } } -void cercle_32 (JessPrivate *priv, uint8_t * buffer, int h, int k, int y, uint8_t color) -{ - int x = -1, d = 3 - 2 * y; - - while (x <= y) - { - if (d < 0) - { - d += 2* x+6 ; - x++; - } - else - { - d += 4 * (x - y)+10 ; - x++; - y--; - } - tracer_point_add_32 (priv, buffer, h + x, y + k, color); - tracer_point_add_32 (priv, buffer, h + y, x + k, color); - tracer_point_add_32 (priv, buffer, h - y, x + k, color); - tracer_point_add_32 (priv, buffer, h - x, y + k, color); - tracer_point_add_32 (priv, buffer, h - x, -y + k, color); - tracer_point_add_32 (priv, buffer, h - y, -x + k, color); - tracer_point_add_32 (priv, buffer, h + y, -x + k, color); - tracer_point_add_32 (priv, buffer, h + x, -y + k, color); - } +void cercle_32(JessPrivate *priv, uint8_t *buffer, int h, int k, int y, + uint8_t color) { + int x = -1, d = 3 - 2 * y; + + while (x <= y) { + if (d < 0) { + d += 2 * x + 6; + x++; + } else { + d += 4 * (x - y) + 10; + x++; + y--; + } + tracer_point_add_32(priv, buffer, h + x, y + k, color); + tracer_point_add_32(priv, buffer, h + y, x + k, color); + tracer_point_add_32(priv, buffer, h - y, x + k, color); + tracer_point_add_32(priv, buffer, h - x, y + k, color); + tracer_point_add_32(priv, buffer, h - x, -y + k, color); + tracer_point_add_32(priv, buffer, h - y, -x + k, color); + tracer_point_add_32(priv, buffer, h + y, -x + k, color); + tracer_point_add_32(priv, buffer, h + x, -y + k, color); + } } -void boule_random (JessPrivate *priv, uint8_t * buffer, int x, int y, int r, uint8_t color) -{ - int i, j, ecart = (int) visual_random_context_int(priv->rcontext)%5+1; - j = color; - if (priv->video == 8) - { - for (i = 0; i <= r; i+=ecart) - { - - cercle (priv, buffer, x, y, i, (int) ((float) (j * j) / (256))); - j = color - color * ((float) i) / r; - } - } - else - { - for (i = 0; i <= r; i+=ecart) - { - - cercle_32 (priv, buffer, x, y, i, (int) ((float) (j * j) / (256))); - j = color - color * ((float) i) / r; - } - } +void boule_random(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, + uint8_t color) { + int i, j, ecart = (int)visual_random_context_int(priv->rcontext) % 5 + 1; + j = color; + if (priv->video == 8) { + for (i = 0; i <= r; i += ecart) { + + cercle(priv, buffer, x, y, i, (int)((float)(j * j) / (256))); + j = color - color * ((float)i) / r; + } + } else { + for (i = 0; i <= r; i += ecart) { + + cercle_32(priv, buffer, x, y, i, (int)((float)(j * j) / (256))); + j = color - color * ((float)i) / r; + } + } } -void boule (JessPrivate *priv, uint8_t * buffer, int x, int y, int r, uint8_t color) -{ - int i, j; - - if (priv->video == 8) - { - for (i = r; i >= 0; i--) - { - j = color - color * ((float) i) / r; - /* cercle (buffer, x, y, i, (int) ((float) (j * j) / (256))); */ - /* Optimisation by Karl Soulabaille. - Remplace un flottant par un entier */ - cercle (priv, buffer, x, y, i, (j*j)>>8); - } - - } - else - { - for (i = 0; i < r; i++) - { - j = color - color * ((float) i) / r; - /* cercle_32 (buffer, x, y, i, (int) ((float) (j * j) / (256))); */ - cercle_32 (priv, buffer, x, y, i, (j*j)>>8); - } - } +void boule(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, + uint8_t color) { + int i, j; + + if (priv->video == 8) { + for (i = r; i >= 0; i--) { + j = color - color * ((float)i) / r; + /* cercle (buffer, x, y, i, (int) ((float) (j * j) / (256))); */ + /* Optimisation by Karl Soulabaille. + Remplace un flottant par un entier */ + cercle(priv, buffer, x, y, i, (j * j) >> 8); + } + + } else { + for (i = 0; i < r; i++) { + j = color - color * ((float)i) / r; + /* cercle_32 (buffer, x, y, i, (int) ((float) (j * j) / (256))); */ + cercle_32(priv, buffer, x, y, i, (j * j) >> 8); + } + } } -void droite (JessPrivate *priv, uint8_t * buffer, int x1, int y1, int x2, int y2, uint8_t color) -{ - - int lx, ly, dx, dy; - int i, j, k; - - lx = abs(x1-x2); - ly = abs(y1-y2); - dx = (x1>x2) ? -1 : 1; - dy = (y1>y2) ? -1 : 1; - - if (priv->video == 8) - { - if (lx>ly) - { - for (i=x1,j=y1,k=0;i!=x2;i+=dx,k+=ly) - { - if (k>=lx) - { - k -= lx; - j += dy; - } - tracer_point_add (priv, buffer, i, j, color); - } - } - else - { - for (i=y1,j=x1,k=0;i!=y2;i+=dy,k+=lx) - { - if (k>=ly) - { - k -= ly; - j += dx; - } - tracer_point_add (priv, buffer, j, i, color); - } - } - } - else - { - if (lx>ly) - { - for (i=x1,j=y1,k=0;i!=x2;i+=dx,k+=ly) - { - if (k>=lx) - { - k -= lx; - j += dy; - } - tracer_point_add_32 (priv, buffer, i, j, color); - } - } - else - { - for (i=y1,j=x1,k=0;i!=y2;i+=dy,k+=lx) - { - if (k>=ly) - { - k -= ly; - j += dx; - } - tracer_point_add_32 (priv, buffer, j, i, color); - } - } - } +void droite(JessPrivate *priv, uint8_t *buffer, int x1, int y1, int x2, int y2, + uint8_t color) { + + int lx, ly, dx, dy; + int i, j, k; + + lx = abs(x1 - x2); + ly = abs(y1 - y2); + dx = (x1 > x2) ? -1 : 1; + dy = (y1 > y2) ? -1 : 1; + + if (priv->video == 8) { + if (lx > ly) { + for (i = x1, j = y1, k = 0; i != x2; i += dx, k += ly) { + if (k >= lx) { + k -= lx; + j += dy; + } + tracer_point_add(priv, buffer, i, j, color); + } + } else { + for (i = y1, j = x1, k = 0; i != y2; i += dy, k += lx) { + if (k >= ly) { + k -= ly; + j += dx; + } + tracer_point_add(priv, buffer, j, i, color); + } + } + } else { + if (lx > ly) { + for (i = x1, j = y1, k = 0; i != x2; i += dx, k += ly) { + if (k >= lx) { + k -= lx; + j += dy; + } + tracer_point_add_32(priv, buffer, i, j, color); + } + } else { + for (i = y1, j = x1, k = 0; i != y2; i += dy, k += lx) { + if (k >= ly) { + k -= ly; + j += dx; + } + tracer_point_add_32(priv, buffer, j, i, color); + } + } + } } -void ball_init(JessPrivate *priv) -{ - int i,j,k; - int x,y; - int ssize; - - if (priv->big_ball != NULL) - visual_mem_free (priv->big_ball); - - ssize = BIG_BALL_SIZE * BIG_BALL_SIZE; - priv->big_ball = (uint8_t *) visual_mem_malloc0(ssize); - - for (i=0 ; i < BIG_BALL_SIZE ;i++) - { - if (priv->big_ball_scale[i] != NULL) - visual_mem_free (priv->big_ball_scale[i]); - - ssize = (i + 1) * sizeof (int); - priv->big_ball_scale[i] = (uint32_t *) visual_mem_malloc0(ssize); - } - - for (i=0 ; i < BIG_BALL_SIZE ;i++) - for (j=0 ; jbig_ball_scale[i][j] = (int) floor((float)j*BIG_BALL_SIZE/(i+1)); - - /*creation de la grande boulle */ - for (i =0; i< BIG_BALL_SIZE/2; i++) /*pour chaque rayon*/ - { - for (j=0; j< 2000; j++) - { - x = (int) ((float) (BIG_BALL_SIZE/2 + i*0.5*cos((float)j/2000*2*3.1416)) ); - y = (int) ((float) (BIG_BALL_SIZE/2 + i*0.5*sin((float)j/2000*2*3.1416)) ); - - k = 255-255 * ((float) (i) / (BIG_BALL_SIZE/2)); - - priv->big_ball[ y * BIG_BALL_SIZE + x] = MAX255(3*((k*k)>>9)); - } - } +void ball_init(JessPrivate *priv) { + int i, j, k; + int x, y; + int ssize; + + if (priv->big_ball != NULL) + visual_mem_free(priv->big_ball); + + ssize = BIG_BALL_SIZE * BIG_BALL_SIZE; + priv->big_ball = (uint8_t *)visual_mem_malloc0(ssize); + + for (i = 0; i < BIG_BALL_SIZE; i++) { + if (priv->big_ball_scale[i] != NULL) + visual_mem_free(priv->big_ball_scale[i]); + + ssize = (i + 1) * sizeof(int); + priv->big_ball_scale[i] = (uint32_t *)visual_mem_malloc0(ssize); + } + + for (i = 0; i < BIG_BALL_SIZE; i++) + for (j = 0; j < i; j++) + priv->big_ball_scale[i][j] = + (int)floor((float)j * BIG_BALL_SIZE / (i + 1)); + + /*creation de la grande boulle */ + for (i = 0; i < BIG_BALL_SIZE / 2; i++) /*pour chaque rayon*/ + { + for (j = 0; j < 2000; j++) { + x = (int)((float)(BIG_BALL_SIZE / 2 + + i * 0.5 * cos((float)j / 2000 * 2 * 3.1416))); + y = (int)((float)(BIG_BALL_SIZE / 2 + + i * 0.5 * sin((float)j / 2000 * 2 * 3.1416))); + + k = 255 - 255 * ((float)(i) / (BIG_BALL_SIZE / 2)); + + priv->big_ball[y * BIG_BALL_SIZE + x] = MAX255(3 * ((k * k) >> 9)); + } + } } -void ball(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, uint8_t color) -{ - int i,j,k,d= 2*r; - uint32_t *pt=priv->big_ball_scale[d]; - int colorc; - float fcolor = (float) color; - - int a,b,c,e,f,g,h,l; - if (d>=BIG_BALL_SIZE) - r = BIG_BALL_SIZE/ 2 - 1; - - if (priv->video == 8) - { - for (j=-r+1; j <= 0; j++) - { - k = pt[j+r-1] * BIG_BALL_SIZE; - a = j + y; - b = j + x ; - c = -j + x ; - e = -j + y ; - for (i=-r+1; i <= j; i++) - { - f = i + x ; - g = -i + x; - h = i + y; - l = -i + y; - - colorc = (int) (fcolor/256* (float) priv->big_ball[k + pt[i+r-1]]); - - tracer_point_add(priv, buffer, f ,a , colorc ); - tracer_point_add(priv, buffer, g ,a , colorc ); - tracer_point_add(priv, buffer, f ,e , colorc ); - tracer_point_add(priv, buffer, g ,e , colorc ); - - tracer_point_add(priv, buffer, b ,h , colorc ); - tracer_point_add(priv, buffer, b ,l , colorc ); - tracer_point_add(priv, buffer, c ,h , colorc ); - tracer_point_add(priv, buffer, c ,l , colorc ); - } - } - } - else - { - for (j=-r+1; j <= 0; j++) - { - k = pt[j+r-1] * BIG_BALL_SIZE; - a = j + y; - b = j + x ; - c = -j + x ; - e = -j + y ; - for (i=-r+1; i <= j; i++) - { - f = i + x ; - g = -i + x; - h = i + y; - l = -i + y; - - colorc = (int) (fcolor/256* (float)priv->big_ball[k + pt[i+r-1]]); - - tracer_point_add_32 (priv, buffer, f ,a , colorc ); - tracer_point_add_32 (priv, buffer, g ,a , colorc ); - tracer_point_add_32 (priv, buffer, f ,e , colorc ); - tracer_point_add_32 (priv, buffer, g ,e , colorc ); - - tracer_point_add_32 (priv, buffer, b ,h , colorc ); - tracer_point_add_32 (priv, buffer, b ,l , colorc ); - tracer_point_add_32 (priv, buffer, c ,h , colorc ); - tracer_point_add_32 (priv, buffer, c ,l , colorc ); - } - } - } +void ball(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, + uint8_t color) { + int i, j, k, d = 2 * r; + uint32_t *pt = priv->big_ball_scale[d]; + int colorc; + float fcolor = (float)color; + + int a, b, c, e, f, g, h, l; + if (d >= BIG_BALL_SIZE) + r = BIG_BALL_SIZE / 2 - 1; + + if (priv->video == 8) { + for (j = -r + 1; j <= 0; j++) { + k = pt[j + r - 1] * BIG_BALL_SIZE; + a = j + y; + b = j + x; + c = -j + x; + e = -j + y; + for (i = -r + 1; i <= j; i++) { + f = i + x; + g = -i + x; + h = i + y; + l = -i + y; + + colorc = (int)(fcolor / 256 * (float)priv->big_ball[k + pt[i + r - 1]]); + + tracer_point_add(priv, buffer, f, a, colorc); + tracer_point_add(priv, buffer, g, a, colorc); + tracer_point_add(priv, buffer, f, e, colorc); + tracer_point_add(priv, buffer, g, e, colorc); + + tracer_point_add(priv, buffer, b, h, colorc); + tracer_point_add(priv, buffer, b, l, colorc); + tracer_point_add(priv, buffer, c, h, colorc); + tracer_point_add(priv, buffer, c, l, colorc); + } + } + } else { + for (j = -r + 1; j <= 0; j++) { + k = pt[j + r - 1] * BIG_BALL_SIZE; + a = j + y; + b = j + x; + c = -j + x; + e = -j + y; + for (i = -r + 1; i <= j; i++) { + f = i + x; + g = -i + x; + h = i + y; + l = -i + y; + + colorc = (int)(fcolor / 256 * (float)priv->big_ball[k + pt[i + r - 1]]); + + tracer_point_add_32(priv, buffer, f, a, colorc); + tracer_point_add_32(priv, buffer, g, a, colorc); + tracer_point_add_32(priv, buffer, f, e, colorc); + tracer_point_add_32(priv, buffer, g, e, colorc); + + tracer_point_add_32(priv, buffer, b, h, colorc); + tracer_point_add_32(priv, buffer, b, l, colorc); + tracer_point_add_32(priv, buffer, c, h, colorc); + tracer_point_add_32(priv, buffer, c, l, colorc); + } + } + } } -void -boule_no_add (uint8_t * buffer, int x, int y, int r, uint8_t color) -{ - int i, j; - for (i = r; i >= 0; i--) - { - j = color - color * ((float) i) / r; - cercle_no_add (buffer, x, y, i, (j*j)>>8); - } +void boule_no_add(uint8_t *buffer, int x, int y, int r, uint8_t color) { + int i, j; + for (i = r; i >= 0; i--) { + j = color - color * ((float)i) / r; + cercle_no_add(buffer, x, y, i, (j * j) >> 8); + } } -void cercle_no_add (uint8_t * buffer, int h, int k, int y, uint8_t color) -{ - int x = -1, d = 3 - 2 * y; - - while (x <= y) - { - if (d < 0) - { - d += 4 * x + 6; - x++; - } - else - { - d += 4 * (x - y) + 10; - x++; - y--; - } - tracer_point_no_add (buffer, h + x, y + k, color); - tracer_point_no_add (buffer, h + y, x + k, color); - tracer_point_no_add (buffer, h - y, x + k, color); - tracer_point_no_add (buffer, h - x, y + k, color); - tracer_point_no_add (buffer, h - x, -y + k, color); - tracer_point_no_add (buffer, h - y, -x + k, color); - tracer_point_no_add (buffer, h + y, -x + k, color); - tracer_point_no_add (buffer, h + x, -y + k, color); - } +void cercle_no_add(uint8_t *buffer, int h, int k, int y, uint8_t color) { + int x = -1, d = 3 - 2 * y; + + while (x <= y) { + if (d < 0) { + d += 4 * x + 6; + x++; + } else { + d += 4 * (x - y) + 10; + x++; + y--; + } + tracer_point_no_add(buffer, h + x, y + k, color); + tracer_point_no_add(buffer, h + y, x + k, color); + tracer_point_no_add(buffer, h - y, x + k, color); + tracer_point_no_add(buffer, h - x, y + k, color); + tracer_point_no_add(buffer, h - x, -y + k, color); + tracer_point_no_add(buffer, h - y, -x + k, color); + tracer_point_no_add(buffer, h + y, -x + k, color); + tracer_point_no_add(buffer, h + x, -y + k, color); + } } -void tracer_point_no_add (uint8_t * buffer, int x, int y, uint8_t color) -{ - uint8_t *point; +void tracer_point_no_add(uint8_t *buffer, int x, int y, uint8_t color) { + uint8_t *point; - point = buffer + (-y + BIG_BALL_SIZE/2) * BIG_BALL_SIZE + x + BIG_BALL_SIZE/2; - *point = (int)(color); + point = + buffer + (-y + BIG_BALL_SIZE / 2) * BIG_BALL_SIZE + x + BIG_BALL_SIZE / 2; + *point = (int)(color); } - diff --git a/libvisual-plugins/plugins/actor/jess/draw_low_level.h b/libvisual-plugins/plugins/actor/jess/draw_low_level.h index 2c5d9ef68..885785b75 100644 --- a/libvisual-plugins/plugins/actor/jess/draw_low_level.h +++ b/libvisual-plugins/plugins/actor/jess/draw_low_level.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -24,16 +24,24 @@ #include "jess.h" -void boule_random (JessPrivate *priv, uint8_t * buffer, int x, int y, int r, uint8_t color); -void cercle(JessPrivate *priv, uint8_t *buffer, int h, int k, int y, uint8_t color); -void cercle_32(JessPrivate *priv, uint8_t *buffer, int h, int k, int y, uint8_t color); -void boule(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, uint8_t color); -void droite(JessPrivate *priv, uint8_t *buffer,int x1, int y1, int x2, int y2, uint8_t color); -void tracer_point_add(JessPrivate *priv, uint8_t *buffer, int x, int y, uint8_t color); -void tracer_point_add_32(JessPrivate *priv, uint8_t *buffer, int x, int y, uint8_t color); +void boule_random(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, + uint8_t color); +void cercle(JessPrivate *priv, uint8_t *buffer, int h, int k, int y, + uint8_t color); +void cercle_32(JessPrivate *priv, uint8_t *buffer, int h, int k, int y, + uint8_t color); +void boule(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, + uint8_t color); +void droite(JessPrivate *priv, uint8_t *buffer, int x1, int y1, int x2, int y2, + uint8_t color); +void tracer_point_add(JessPrivate *priv, uint8_t *buffer, int x, int y, + uint8_t color); +void tracer_point_add_32(JessPrivate *priv, uint8_t *buffer, int x, int y, + uint8_t color); void ball_init(JessPrivate *priv); void boule_no_add(uint8_t *buffer, int x, int y, int r, uint8_t color); void cercle_no_add(uint8_t *buffer, int h, int k, int y, uint8_t color); void tracer_point_no_add(uint8_t *buffer, int x, int y, uint8_t color); -void ball(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, uint8_t color); +void ball(JessPrivate *priv, uint8_t *buffer, int x, int y, int r, + uint8_t color); diff --git a/libvisual-plugins/plugins/actor/jess/jess.c b/libvisual-plugins/plugins/actor/jess/jess.c index 2490fc4c9..bfef0d8b8 100644 --- a/libvisual-plugins/plugins/actor/jess/jess.c +++ b/libvisual-plugins/plugins/actor/jess/jess.c @@ -35,280 +35,275 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int act_jess_init (VisPluginData *plugin); -static void act_jess_cleanup (VisPluginData *plugin); -static void act_jess_requisition (VisPluginData *plugin, int *width, int *height); -static void act_jess_resize (VisPluginData *plugin, int width, int height); -static int act_jess_events (VisPluginData *plugin, VisEventQueue *events); -static void act_jess_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *act_jess_palette (VisPluginData *plugin); - -static void jess_init (JessPrivate *priv); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = act_jess_requisition, - .palette = act_jess_palette, - .render = act_jess_render, - .vidoptions.depth = - VISUAL_VIDEO_DEPTH_8BIT | - VISUAL_VIDEO_DEPTH_32BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "jess", - .name = "jess plugin", - .author = N_("Original by: Remi Arquier , Port by: Dennis Smit "), - .version = "0.1", - .about = N_("Jess visual plugin"), - .help = N_("This is the libvisual plugin for the jess visual"), - .license = VISUAL_PLUGIN_LICENSE_GPL, - - .init = act_jess_init, - .cleanup = act_jess_cleanup, - .events = act_jess_events, - .plugin = &actor - }; - - return &info; +static int act_jess_init(VisPluginData *plugin); +static void act_jess_cleanup(VisPluginData *plugin); +static void act_jess_requisition(VisPluginData *plugin, int *width, + int *height); +static void act_jess_resize(VisPluginData *plugin, int width, int height); +static int act_jess_events(VisPluginData *plugin, VisEventQueue *events); +static void act_jess_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *act_jess_palette(VisPluginData *plugin); + +static void jess_init(JessPrivate *priv); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = act_jess_requisition, + .palette = act_jess_palette, + .render = act_jess_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT | + VISUAL_VIDEO_DEPTH_32BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "jess", + .name = "jess plugin", + .author = N_("Original by: Remi Arquier , Port by: " + "Dennis Smit "), + .version = "0.1", + .about = N_("Jess visual plugin"), + .help = N_("This is the libvisual plugin for the jess visual"), + .license = VISUAL_PLUGIN_LICENSE_GPL, + + .init = act_jess_init, + .cleanup = act_jess_cleanup, + .events = act_jess_events, + .plugin = &actor}; + + return &info; } -static int act_jess_init (VisPluginData *plugin) -{ +static int act_jess_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - JessPrivate *priv = visual_mem_new0 (JessPrivate, 1); + JessPrivate *priv = visual_mem_new0(JessPrivate, 1); - visual_plugin_set_private (plugin, priv); + visual_plugin_set_private(plugin, priv); - priv->rcontext = visual_plugin_get_random_context (plugin); + priv->rcontext = visual_plugin_get_random_context(plugin); - priv->conteur.burn_mode = 4; - priv->conteur.draw_mode = 4; - priv->conteur.blur_mode = 3; - priv->video = 8; - priv->conteur.term_display = OUI; - priv->resx = 320; - priv->resy = 200; + priv->conteur.burn_mode = 4; + priv->conteur.draw_mode = 4; + priv->conteur.blur_mode = 3; + priv->video = 8; + priv->conteur.term_display = OUI; + priv->resx = 320; + priv->resy = 200; - priv->conteur.courbe = 0; - priv->conteur.angle = 0; - priv->conteur.angle2 = 0; - priv->conteur.k1 = 0; - priv->conteur.k2 = 0; - priv->conteur.k3 = 10000; + priv->conteur.courbe = 0; + priv->conteur.angle = 0; + priv->conteur.angle2 = 0; + priv->conteur.k1 = 0; + priv->conteur.k2 = 0; + priv->conteur.k3 = 10000; - priv->conteur.fps = 40; + priv->conteur.fps = 40; - priv->conteur.mix_reprise = 1000; - priv->conteur.last_flash = 1000; - priv->conteur.burn_mode = 2; - priv->conteur.draw_mode = 5; - priv->conteur.v_angle2 = 1; - priv->conteur.general = 0; - priv->conteur.blur_mode = 3; - priv->conteur.freeze = 0; - priv->conteur.freeze_mode = 0; + priv->conteur.mix_reprise = 1000; + priv->conteur.last_flash = 1000; + priv->conteur.burn_mode = 2; + priv->conteur.draw_mode = 5; + priv->conteur.v_angle2 = 1; + priv->conteur.general = 0; + priv->conteur.blur_mode = 3; + priv->conteur.freeze = 0; + priv->conteur.freeze_mode = 0; - priv->lys.E_moyen = 0; - priv->lys.dEdt_moyen = 0; + priv->lys.E_moyen = 0; + priv->lys.dEdt_moyen = 0; - priv->jess_pal = visual_palette_new (256); + priv->jess_pal = visual_palette_new(256); - priv->pcm_data1 = visual_buffer_new_wrap_data (priv->pcm_data[0], 512 * sizeof (float), FALSE); - priv->pcm_data2 = visual_buffer_new_wrap_data (priv->pcm_data[1], 512 * sizeof (float), FALSE); + priv->pcm_data1 = visual_buffer_new_wrap_data(priv->pcm_data[0], + 512 * sizeof(float), FALSE); + priv->pcm_data2 = visual_buffer_new_wrap_data(priv->pcm_data[1], + 512 * sizeof(float), FALSE); - start_ticks (priv); + start_ticks(priv); - return TRUE; + return TRUE; } -static void act_jess_cleanup (VisPluginData *plugin) -{ - JessPrivate *priv = visual_plugin_get_private (plugin); +static void act_jess_cleanup(VisPluginData *plugin) { + JessPrivate *priv = visual_plugin_get_private(plugin); - if (priv->big_ball != NULL) - visual_mem_free (priv->big_ball); + if (priv->big_ball != NULL) + visual_mem_free(priv->big_ball); - int i; + int i; - for (i = 0; i < BIG_BALL_SIZE; i++) - { - if (priv->big_ball_scale[i] != NULL) - visual_mem_free (priv->big_ball_scale[i]); - } + for (i = 0; i < BIG_BALL_SIZE; i++) { + if (priv->big_ball_scale[i] != NULL) + visual_mem_free(priv->big_ball_scale[i]); + } - if (priv->table1 != NULL) - visual_mem_free (priv->table1); + if (priv->table1 != NULL) + visual_mem_free(priv->table1); - if (priv->table2 != NULL) - visual_mem_free (priv->table2); + if (priv->table2 != NULL) + visual_mem_free(priv->table2); - if (priv->table3 != NULL) - visual_mem_free (priv->table3); + if (priv->table3 != NULL) + visual_mem_free(priv->table3); - if (priv->table4 != NULL) - visual_mem_free (priv->table4); + if (priv->table4 != NULL) + visual_mem_free(priv->table4); - if (priv->buffer != NULL) - visual_mem_free (priv->buffer); + if (priv->buffer != NULL) + visual_mem_free(priv->buffer); - visual_buffer_unref (priv->pcm_data1); - visual_buffer_unref (priv->pcm_data2); + visual_buffer_unref(priv->pcm_data1); + visual_buffer_unref(priv->pcm_data2); - visual_palette_free (priv->jess_pal); + visual_palette_free(priv->jess_pal); - visual_mem_free (priv); + visual_mem_free(priv); } -static void act_jess_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw = *width; - int reqh = *height; +static void act_jess_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw = *width; + int reqh = *height; - while (reqw % 2 || (reqw / 2) % 2) - reqw--; + while (reqw % 2 || (reqw / 2) % 2) + reqw--; - while (reqh % 2 || (reqh / 2) % 2) - reqh--; + while (reqh % 2 || (reqh / 2) % 2) + reqh--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static void act_jess_resize (VisPluginData *plugin, int width, int height) -{ - JessPrivate *priv = visual_plugin_get_private (plugin); +static void act_jess_resize(VisPluginData *plugin, int width, int height) { + JessPrivate *priv = visual_plugin_get_private(plugin); - priv->resx = width; - priv->resy = height; + priv->resx = width; + priv->resy = height; - if (priv->table1 != NULL) - visual_mem_free (priv->table1); + if (priv->table1 != NULL) + visual_mem_free(priv->table1); - if (priv->table2 != NULL) - visual_mem_free (priv->table2); + if (priv->table2 != NULL) + visual_mem_free(priv->table2); - if (priv->table3 != NULL) - visual_mem_free (priv->table3); + if (priv->table3 != NULL) + visual_mem_free(priv->table3); - if (priv->table4 != NULL) - visual_mem_free (priv->table4); + if (priv->table4 != NULL) + visual_mem_free(priv->table4); - if (priv->buffer != NULL) - visual_mem_free (priv->buffer); + if (priv->buffer != NULL) + visual_mem_free(priv->buffer); - ball_init (priv); - jess_init (priv); + ball_init(priv); + jess_init(priv); } -static int act_jess_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - act_jess_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; - default: /* to avoid warnings */ - break; - } - } - - return TRUE; +static int act_jess_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; + + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + act_jess_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; + default: /* to avoid warnings */ + break; + } + } + + return TRUE; } -static VisPalette *act_jess_palette (VisPluginData *plugin) -{ - JessPrivate *priv = visual_plugin_get_private (plugin); +static VisPalette *act_jess_palette(VisPluginData *plugin) { + JessPrivate *priv = visual_plugin_get_private(plugin); - return priv->jess_pal; + return priv->jess_pal; } -static void act_jess_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - JessPrivate *priv = visual_plugin_get_private (plugin); +static void act_jess_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + JessPrivate *priv = visual_plugin_get_private(plugin); - VisBuffer* fbuf[2]; - float freq[2][256]; - short freqdata[2][256]; - int i, depth; + VisBuffer *fbuf[2]; + float freq[2][256]; + short freqdata[2][256]; + int i, depth; - visual_audio_get_sample (audio, priv->pcm_data1, VISUAL_AUDIO_CHANNEL_LEFT); - visual_audio_get_sample (audio, priv->pcm_data2, VISUAL_AUDIO_CHANNEL_RIGHT); + visual_audio_get_sample(audio, priv->pcm_data1, VISUAL_AUDIO_CHANNEL_LEFT); + visual_audio_get_sample(audio, priv->pcm_data2, VISUAL_AUDIO_CHANNEL_RIGHT); - fbuf[0] = visual_buffer_new_wrap_data (freq[0], sizeof (freq[0]), FALSE); - fbuf[1] = visual_buffer_new_wrap_data (freq[1], sizeof (freq[1]), FALSE); + fbuf[0] = visual_buffer_new_wrap_data(freq[0], sizeof(freq[0]), FALSE); + fbuf[1] = visual_buffer_new_wrap_data(freq[1], sizeof(freq[1]), FALSE); - visual_audio_get_spectrum_for_sample (fbuf[0], priv->pcm_data1, FALSE); - visual_audio_get_spectrum_for_sample (fbuf[1], priv->pcm_data2, FALSE); + visual_audio_get_spectrum_for_sample(fbuf[0], priv->pcm_data1, FALSE); + visual_audio_get_spectrum_for_sample(fbuf[1], priv->pcm_data2, FALSE); - visual_buffer_unref (fbuf[0]); - visual_buffer_unref (fbuf[1]); + visual_buffer_unref(fbuf[0]); + visual_buffer_unref(fbuf[1]); - for (i = 0;i < 256; i++) { - freqdata[0][i] = freq[0][i] * 32768; - freqdata[1][i] = freq[1][i] * 32768; - } + for (i = 0; i < 256; i++) { + freqdata[0][i] = freq[0][i] * 32768; + freqdata[1][i] = freq[1][i] * 32768; + } - priv->lys.conteur[ZERO]++; - priv->lys.conteur[ONE]++; + priv->lys.conteur[ZERO]++; + priv->lys.conteur[ONE]++; - priv->lys.dt = time_last(priv, TWO, OUI); + priv->lys.dt = time_last(priv, TWO, OUI); - spectre_moyen(priv, freqdata); - C_E_moyen(priv, freqdata); - C_dEdt_moyen(priv); - C_dEdt(priv); + spectre_moyen(priv, freqdata); + C_E_moyen(priv, freqdata); + C_dEdt_moyen(priv); + C_dEdt(priv); - priv->pitch = visual_video_get_pitch (video); + priv->pitch = visual_video_get_pitch(video); - depth = priv->video; - priv->video = visual_video_depth_bpp (visual_video_get_depth (video)); - if(depth != priv->video) - { - free(priv->buffer); - if(priv->video == 8) - priv->buffer = (uint8_t *)malloc(priv->resx * priv->resy); - else - priv->buffer = (uint8_t *)malloc(priv->resx * priv->resy * 4); - } + depth = priv->video; + priv->video = visual_video_depth_bpp(visual_video_get_depth(video)); + if (depth != priv->video) { + free(priv->buffer); + if (priv->video == 8) + priv->buffer = (uint8_t *)malloc(priv->resx * priv->resy); + else + priv->buffer = (uint8_t *)malloc(priv->resx * priv->resy * 4); + } - priv->pixel = ((uint8_t *) visual_video_get_pixels (video)); + priv->pixel = ((uint8_t *)visual_video_get_pixels(video)); - renderer (priv); + renderer(priv); } -static void jess_init (JessPrivate *priv) -{ - priv->xres2 = priv->resx / 2; - priv->yres2 = priv->resy / 2; +static void jess_init(JessPrivate *priv) { + priv->xres2 = priv->resx / 2; + priv->yres2 = priv->resy / 2; - priv->conteur.fullscreen = 0; - priv->conteur.blur_mode = 1; + priv->conteur.fullscreen = 0; + priv->conteur.blur_mode = 1; - priv->table1 = (uint32_t *) visual_mem_malloc0 (priv->resx * priv->resy * sizeof (int)); - priv->table2 = (uint32_t *) visual_mem_malloc0 (priv->resx * priv->resy * sizeof (int)); - priv->table3 = (uint32_t *) visual_mem_malloc0 (priv->resx * priv->resy * sizeof (int)); - priv->table4 = (uint32_t *) visual_mem_malloc0 (priv->resx * priv->resy * sizeof (int)); + priv->table1 = + (uint32_t *)visual_mem_malloc0(priv->resx * priv->resy * sizeof(int)); + priv->table2 = + (uint32_t *)visual_mem_malloc0(priv->resx * priv->resy * sizeof(int)); + priv->table3 = + (uint32_t *)visual_mem_malloc0(priv->resx * priv->resy * sizeof(int)); + priv->table4 = + (uint32_t *)visual_mem_malloc0(priv->resx * priv->resy * sizeof(int)); - if (priv->video == 8) - priv->buffer = (uint8_t *) visual_mem_malloc0 (priv->resx * priv->resy); - else - priv->buffer = (uint8_t *) visual_mem_malloc0 (priv->resx * priv->resy * 4); + if (priv->video == 8) + priv->buffer = (uint8_t *)visual_mem_malloc0(priv->resx * priv->resy); + else + priv->buffer = (uint8_t *)visual_mem_malloc0(priv->resx * priv->resy * 4); - create_tables(priv); + create_tables(priv); } - diff --git a/libvisual-plugins/plugins/actor/jess/jess.h b/libvisual-plugins/plugins/actor/jess/jess.h index 82a467bbe..fc2993b0a 100644 --- a/libvisual-plugins/plugins/actor/jess/jess.h +++ b/libvisual-plugins/plugins/actor/jess/jess.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -36,66 +36,66 @@ #define BIG_BALL_SIZE 1024 typedef struct { - struct conteur_struct conteur; - struct analyser_struct lys; - float E_old1; - float E_old2; - - struct timeval start; - - /* Randomize context from libvisual */ - VisRandomContext *rcontext; - VisPalette *jess_pal; - - VisBuffer *pcm_data1; - VisBuffer *pcm_data2; - float pcm_data[2][512]; - - uint32_t *table1; - uint32_t *table2; - uint32_t *table3; - uint32_t *table4; - uint32_t pitch; - uint32_t video; - - uint8_t dim[256]; - uint8_t dimR[256]; - uint8_t dimG[256]; - uint8_t dimB[256]; - uint8_t *bits; - uint8_t *pixel; - uint8_t *buffer; - - int resx; - int resy; - int xres2; - int yres2; - - uint8_t *big_ball; - uint32_t *big_ball_scale[BIG_BALL_SIZE]; - - int xi[FUSEE_MAX]; - int yi[FUSEE_MAX]; - float life[FUSEE_MAX]; - - float lifev[256][LINE_MAX]; - float x[256][LINE_MAX]; - float y[256][LINE_MAX]; - float vx[256][LINE_MAX]; - float vy[256][LINE_MAX]; - - float lifet[256][LINE_MAX]; - float ssx[256][LINE_MAX]; - float ssy[256][LINE_MAX]; - float ssvx[256][LINE_MAX]; - float ssvy[256][LINE_MAX]; - float sstheta[256][LINE_MAX]; - float ssomega[256][LINE_MAX]; - - float smpos[2][3][STARS_MAX]; - float smmorpheur; - int smselect; - + struct conteur_struct conteur; + struct analyser_struct lys; + float E_old1; + float E_old2; + + struct timeval start; + + /* Randomize context from libvisual */ + VisRandomContext *rcontext; + VisPalette *jess_pal; + + VisBuffer *pcm_data1; + VisBuffer *pcm_data2; + float pcm_data[2][512]; + + uint32_t *table1; + uint32_t *table2; + uint32_t *table3; + uint32_t *table4; + uint32_t pitch; + uint32_t video; + + uint8_t dim[256]; + uint8_t dimR[256]; + uint8_t dimG[256]; + uint8_t dimB[256]; + uint8_t *bits; + uint8_t *pixel; + uint8_t *buffer; + + int resx; + int resy; + int xres2; + int yres2; + + uint8_t *big_ball; + uint32_t *big_ball_scale[BIG_BALL_SIZE]; + + int xi[FUSEE_MAX]; + int yi[FUSEE_MAX]; + float life[FUSEE_MAX]; + + float lifev[256][LINE_MAX]; + float x[256][LINE_MAX]; + float y[256][LINE_MAX]; + float vx[256][LINE_MAX]; + float vy[256][LINE_MAX]; + + float lifet[256][LINE_MAX]; + float ssx[256][LINE_MAX]; + float ssy[256][LINE_MAX]; + float ssvx[256][LINE_MAX]; + float ssvy[256][LINE_MAX]; + float sstheta[256][LINE_MAX]; + float ssomega[256][LINE_MAX]; + + float smpos[2][3][STARS_MAX]; + float smmorpheur; + int smselect; + } JessPrivate; #endif /* _JESS_JESS_H */ diff --git a/libvisual-plugins/plugins/actor/jess/pal.c b/libvisual-plugins/plugins/actor/jess/pal.c index 87d697e9d..4c7045cc1 100644 --- a/libvisual-plugins/plugins/actor/jess/pal.c +++ b/libvisual-plugins/plugins/actor/jess/pal.c @@ -33,57 +33,52 @@ const float __magic = 2.0 * PI / 256; -uint8_t courbes_palette(JessPrivate *priv, uint8_t i, int no_courbe) -{ - /* Optimisation par Karl Soulabaille */ - switch(no_courbe) - { - case 0: - return (i * i * i) >> 16; - break; - case 1: - return (i * i) >> 8; - break; - case 2: - return (uint8_t) i ; - break; - case 3: - return (uint8_t) (128 * fabs(sin(__magic * i))); - break; - case 4: - return 0; - break; - } - return 0; +uint8_t courbes_palette(JessPrivate *priv, uint8_t i, int no_courbe) { + /* Optimisation par Karl Soulabaille */ + switch (no_courbe) { + case 0: + return (i * i * i) >> 16; + break; + case 1: + return (i * i) >> 8; + break; + case 2: + return (uint8_t)i; + break; + case 3: + return (uint8_t)(128 * fabs(sin(__magic * i))); + break; + case 4: + return 0; + break; + } + return 0; } -void random_palette(JessPrivate *priv) -{ - VisColor *pal_colors = visual_palette_get_colors (priv->jess_pal); +void random_palette(JessPrivate *priv) { + VisColor *pal_colors = visual_palette_get_colors(priv->jess_pal); - int i,j,k,l; + int i, j, k, l; -again_mister: - ; +again_mister:; - if (priv->conteur.psy == 1) - i = 5; - else - i = 3; + if (priv->conteur.psy == 1) + i = 5; + else + i = 3; - j=visual_random_context_int(priv->rcontext) % i; - k=visual_random_context_int(priv->rcontext) % i; - l=visual_random_context_int(priv->rcontext) % i; + j = visual_random_context_int(priv->rcontext) % i; + k = visual_random_context_int(priv->rcontext) % i; + l = visual_random_context_int(priv->rcontext) % i; - priv->conteur.triplet = j+10*k+100*l; + priv->conteur.triplet = j + 10 * k + 100 * l; - if ((j==k) || (j==l) || (l==k)) - goto again_mister; + if ((j == k) || (j == l) || (l == k)) + goto again_mister; - for (i = 0; i < 256; i++){ - pal_colors[i].r = courbes_palette(priv, i, j); - pal_colors[i].g = courbes_palette(priv, i, k); - pal_colors[i].b = courbes_palette(priv, i, l); - } + for (i = 0; i < 256; i++) { + pal_colors[i].r = courbes_palette(priv, i, j); + pal_colors[i].g = courbes_palette(priv, i, k); + pal_colors[i].b = courbes_palette(priv, i, l); + } } - diff --git a/libvisual-plugins/plugins/actor/jess/pal.h b/libvisual-plugins/plugins/actor/jess/pal.h index 5f6540d9e..0c1d512c1 100644 --- a/libvisual-plugins/plugins/actor/jess/pal.h +++ b/libvisual-plugins/plugins/actor/jess/pal.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier diff --git a/libvisual-plugins/plugins/actor/jess/projection.c b/libvisual-plugins/plugins/actor/jess/projection.c index b4b4758ec..75278b6e5 100644 --- a/libvisual-plugins/plugins/actor/jess/projection.c +++ b/libvisual-plugins/plugins/actor/jess/projection.c @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -25,28 +25,23 @@ #include #include "projection.h" -void rotation_3d (float *x, float *y, float *z, float alpha, float beta, - float gamma) -{ - float nx, ny; - float cosga = cos (gamma), singa = sin (gamma), cosal = cos (alpha), sinal = - sin (alpha); - +void rotation_3d(float *x, float *y, float *z, float alpha, float beta, + float gamma) { + float nx, ny; + float cosga = cos(gamma), singa = sin(gamma), cosal = cos(alpha), + sinal = sin(alpha); - nx = cosga * *x - singa * *y; - ny = cosal * (singa * *x + cosga * *y) - sinal * *z; - *z = sinal * (singa * *x + cosga * *y) + cosal * *z; - - *x = nx; - *y = ny; + nx = cosga * *x - singa * *y; + ny = cosal * (singa * *x + cosga * *y) - sinal * *z; + *z = sinal * (singa * *x + cosga * *y) + cosal * *z; + *x = nx; + *y = ny; } -void perspective (float *x, float *y, float *z, int persp, int dist_cam) -{ - float foc_cam = 100,aux; - aux = (foc_cam + persp) / (dist_cam + persp - *z); - *x = *x * aux; - *y = *y * aux; +void perspective(float *x, float *y, float *z, int persp, int dist_cam) { + float foc_cam = 100, aux; + aux = (foc_cam + persp) / (dist_cam + persp - *z); + *x = *x * aux; + *y = *y * aux; } - diff --git a/libvisual-plugins/plugins/actor/jess/projection.h b/libvisual-plugins/plugins/actor/jess/projection.h index e47ee3ce0..fe0c6e8c9 100644 --- a/libvisual-plugins/plugins/actor/jess/projection.h +++ b/libvisual-plugins/plugins/actor/jess/projection.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -22,5 +22,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -void rotation_3d(float *x, float *y, float *z, float alpha, float beta, float gamma); -void perspective(float *x, float *y, float *z,int persp,int dist_cam); +void rotation_3d(float *x, float *y, float *z, float alpha, float beta, + float gamma); +void perspective(float *x, float *y, float *z, int persp, int dist_cam); diff --git a/libvisual-plugins/plugins/actor/jess/renderer.c b/libvisual-plugins/plugins/actor/jess/renderer.c index 8628d0959..62fc9bd6c 100644 --- a/libvisual-plugins/plugins/actor/jess/renderer.c +++ b/libvisual-plugins/plugins/actor/jess/renderer.c @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -38,434 +38,393 @@ #include "renderer.h" #include "pal.h" -void draw_mode(JessPrivate *priv, int mode) -{ - switch (priv->lys.montee) - { - case NON: /* bruit calme */ - if (priv->conteur.courbe <= 255 - 35) /* le bruit calme revient */ - priv->conteur.courbe += 32; /* on fait re-apparaitre la courbe */ - - if (mode == 0) - courbes (priv, priv->pixel, priv->pcm_data, priv->conteur.courbe,0); - else if (mode == 1) - l2_grilles_3d (priv, priv->pixel, priv->pcm_data, priv->conteur.angle2 / 200, 0, - priv->conteur.angle2 / 30, 200, 130); - else if (mode == 2) - burn_3d (priv, priv->pixel, priv->pcm_data, priv->conteur.angle2 / 400, 0, - priv->conteur.angle2 / 60, 200, 130, priv->conteur.burn_mode); - else if ((mode == 3) && (priv->conteur.k3 > 700)) /* mode 3 */ - burn_3d (priv, priv->pixel, priv->pcm_data, priv->conteur.angle / 200, 0, - priv->conteur.angle / 30, 200, 130, priv->conteur.burn_mode); - else if (mode == 4) /* mode ligne */ - { - super_spectral_balls(priv, priv->pixel); - courbes (priv, priv->pixel, priv->pcm_data, priv->conteur.courbe,1); - } - else if (mode == 6) - super_spectral(priv, priv->pixel); - - else if (mode == 5) /* mode stars */ - stars_manage(priv, priv->pixel, MANAGE, priv->conteur.angle2 / 400, 0, - priv->conteur.angle2 / 60, 200, 130); - break; - - case OUI: /* bruit modere */ - priv->conteur.courbe = 0; - if (mode == 0) - grille_3d (priv, priv->pixel, priv->pcm_data, priv->conteur.angle / 200, 0, priv->conteur.angle / 30, - 100, -priv->lys.E_moyen*20 + 130); - else if (mode == 1) - l2_grilles_3d (priv, priv->pixel, priv->pcm_data, priv->conteur.angle2 / 200, 0, - priv->conteur.angle2 / 30, 200, -priv->lys.E_moyen * 20 + 130); - else if (mode == 2) - burn_3d (priv, priv->pixel, priv->pcm_data, priv->conteur.angle2 / 400, 0, - priv->conteur.angle2 / 60, 200, 130, priv->conteur.burn_mode); - else if ((mode == 3) && (priv->conteur.k3 > 700)) /* mode 3 */ - burn_3d (priv, priv->pixel, priv->pcm_data, priv->conteur.angle / 200, 0, - priv->conteur.angle / 30, 200, 130, priv->conteur.burn_mode); - else if (mode == 4) /* mode ligne */ - { - super_spectral_balls (priv, priv->pixel); - courbes (priv, priv->pixel, priv->pcm_data, priv->conteur.courbe,1); - } - else if (mode == 6) - super_spectral (priv, priv->pixel); - else if (mode == 5) /* mode stars */ - stars_manage (priv, priv->pixel, MANAGE, priv->conteur.angle2 / 400, 0, - priv->conteur.angle2 / 60, 200, 130); - break; - } - - priv->conteur.k3 += 10; - if (priv->conteur.k3 < 300) /* Ici c'est les boules qui se barrent */ - burn_3d (priv, priv->pixel, priv->pcm_data, priv->conteur.angle2 / 200, 0, - priv->conteur.angle2 / 200, 200, -50 + 3 * priv->conteur.k3, priv->conteur.burn_mode); - - fusee(priv, priv->pixel, MANAGE); - - on_beat(priv, priv->lys.beat); - - on_reprise(priv); +void draw_mode(JessPrivate *priv, int mode) { + switch (priv->lys.montee) { + case NON: /* bruit calme */ + if (priv->conteur.courbe <= 255 - 35) /* le bruit calme revient */ + priv->conteur.courbe += 32; /* on fait re-apparaitre la courbe */ + + if (mode == 0) + courbes(priv, priv->pixel, priv->pcm_data, priv->conteur.courbe, 0); + else if (mode == 1) + l2_grilles_3d(priv, priv->pixel, priv->pcm_data, + priv->conteur.angle2 / 200, 0, priv->conteur.angle2 / 30, + 200, 130); + else if (mode == 2) + burn_3d(priv, priv->pixel, priv->pcm_data, priv->conteur.angle2 / 400, 0, + priv->conteur.angle2 / 60, 200, 130, priv->conteur.burn_mode); + else if ((mode == 3) && (priv->conteur.k3 > 700)) /* mode 3 */ + burn_3d(priv, priv->pixel, priv->pcm_data, priv->conteur.angle / 200, 0, + priv->conteur.angle / 30, 200, 130, priv->conteur.burn_mode); + else if (mode == 4) /* mode ligne */ + { + super_spectral_balls(priv, priv->pixel); + courbes(priv, priv->pixel, priv->pcm_data, priv->conteur.courbe, 1); + } else if (mode == 6) + super_spectral(priv, priv->pixel); + + else if (mode == 5) /* mode stars */ + stars_manage(priv, priv->pixel, MANAGE, priv->conteur.angle2 / 400, 0, + priv->conteur.angle2 / 60, 200, 130); + break; + + case OUI: /* bruit modere */ + priv->conteur.courbe = 0; + if (mode == 0) + grille_3d(priv, priv->pixel, priv->pcm_data, priv->conteur.angle / 200, 0, + priv->conteur.angle / 30, 100, -priv->lys.E_moyen * 20 + 130); + else if (mode == 1) + l2_grilles_3d(priv, priv->pixel, priv->pcm_data, + priv->conteur.angle2 / 200, 0, priv->conteur.angle2 / 30, + 200, -priv->lys.E_moyen * 20 + 130); + else if (mode == 2) + burn_3d(priv, priv->pixel, priv->pcm_data, priv->conteur.angle2 / 400, 0, + priv->conteur.angle2 / 60, 200, 130, priv->conteur.burn_mode); + else if ((mode == 3) && (priv->conteur.k3 > 700)) /* mode 3 */ + burn_3d(priv, priv->pixel, priv->pcm_data, priv->conteur.angle / 200, 0, + priv->conteur.angle / 30, 200, 130, priv->conteur.burn_mode); + else if (mode == 4) /* mode ligne */ + { + super_spectral_balls(priv, priv->pixel); + courbes(priv, priv->pixel, priv->pcm_data, priv->conteur.courbe, 1); + } else if (mode == 6) + super_spectral(priv, priv->pixel); + else if (mode == 5) /* mode stars */ + stars_manage(priv, priv->pixel, MANAGE, priv->conteur.angle2 / 400, 0, + priv->conteur.angle2 / 60, 200, 130); + break; + } + + priv->conteur.k3 += 10; + if (priv->conteur.k3 < 300) /* Ici c'est les boules qui se barrent */ + burn_3d(priv, priv->pixel, priv->pcm_data, priv->conteur.angle2 / 200, 0, + priv->conteur.angle2 / 200, 200, -50 + 3 * priv->conteur.k3, + priv->conteur.burn_mode); + + fusee(priv, priv->pixel, MANAGE); + + on_beat(priv, priv->lys.beat); + + on_reprise(priv); } -void *renderer (JessPrivate *priv) -{ - ips (priv); +void *renderer(JessPrivate *priv) { + ips(priv); - manage_dynamic_and_states_open(priv); + manage_dynamic_and_states_open(priv); - render_deformation(priv, priv->conteur.blur_mode); + render_deformation(priv, priv->conteur.blur_mode); - render_blur(priv, 0); + render_blur(priv, 0); - draw_mode(priv, priv->conteur.draw_mode); + draw_mode(priv, priv->conteur.draw_mode); - copy_and_fade(priv, DEDT_FACTOR * priv->lys.dEdt_moyen); + copy_and_fade(priv, DEDT_FACTOR * priv->lys.dEdt_moyen); - if (priv->conteur.analyser == 1) { - analyser (priv, priv->pixel); - } + if (priv->conteur.analyser == 1) { + analyser(priv, priv->pixel); + } - manage_states_close(priv); + manage_states_close(priv); - return NULL; + return NULL; } -void manage_dynamic_and_states_open(JessPrivate *priv) -{ - priv->conteur.general++; - priv->conteur.k2++; - priv->conteur.last_flash++; - - priv->conteur.angle += priv->conteur.dt * 50; +void manage_dynamic_and_states_open(JessPrivate *priv) { + priv->conteur.general++; + priv->conteur.k2++; + priv->conteur.last_flash++; - priv->conteur.v_angle2 = 0.97 * priv->conteur.v_angle2 ; - priv->conteur.angle2 += priv->conteur.v_angle2 * priv->conteur.dt ; + priv->conteur.angle += priv->conteur.dt * 50; - detect_beat(priv); + priv->conteur.v_angle2 = 0.97 * priv->conteur.v_angle2; + priv->conteur.angle2 += priv->conteur.v_angle2 * priv->conteur.dt; - if (priv->lys.dEdt_moyen > 0) - priv->lys.montee = OUI; + detect_beat(priv); - if ((priv->lys.montee == OUI) && (priv->lys.beat == OUI)) - priv->lys.reprise = OUI ; + if (priv->lys.dEdt_moyen > 0) + priv->lys.montee = OUI; + if ((priv->lys.montee == OUI) && (priv->lys.beat == OUI)) + priv->lys.reprise = OUI; } -void manage_states_close(JessPrivate *priv) -{ - priv->lys.beat = NON ; - priv->lys.montee = NON; - priv->lys.reprise = NON; +void manage_states_close(JessPrivate *priv) { + priv->lys.beat = NON; + priv->lys.montee = NON; + priv->lys.reprise = NON; } -void on_beat(JessPrivate *priv, int beat) -{ - if (priv->lys.beat == OUI) - { +void on_beat(JessPrivate *priv, int beat) { + if (priv->lys.beat == OUI) { - fusee(priv, priv->pixel,NEW); + fusee(priv, priv->pixel, NEW); - /* on fou des etoiles */ - priv->conteur.k1 += 4; + /* on fou des etoiles */ + priv->conteur.k1 += 4; - /* vitesse a l angle 2 */ - priv->conteur.v_angle2 += (visual_random_context_int (priv->rcontext) % 2 - 0.5) * 16 * 32; + /* vitesse a l angle 2 */ + priv->conteur.v_angle2 += + (visual_random_context_int(priv->rcontext) % 2 - 0.5) * 16 * 32; - if (priv->conteur.draw_mode == 3) - priv->conteur.k3 = 0; + if (priv->conteur.draw_mode == 3) + priv->conteur.k3 = 0; - if (priv->conteur.draw_mode == 5) - stars_manage(priv, priv->pixel, NEW, priv->conteur.angle2 / 400, 0, - priv->conteur.angle2 / 60, 200, 130); - } + if (priv->conteur.draw_mode == 5) + stars_manage(priv, priv->pixel, NEW, priv->conteur.angle2 / 400, 0, + priv->conteur.angle2 / 60, 200, 130); + } } -void on_reprise(JessPrivate *priv) -{ - uint32_t j; - uint8_t *pix = priv->pixel; - - if (priv->lys.reprise == OUI) { - if (priv->conteur.last_flash > 5 * priv->conteur.fps) { - if (priv->conteur.draw_mode == 5) - stars_manage(priv, priv->pixel, NEW_SESSION, priv->conteur.angle2 / 400, 0, - priv->conteur.angle2 / 60, 200, 130); - - pix = priv->pixel; - for (j = 0; j < priv->resy * priv->pitch; j++) - *(pix++) = 250; - - if (priv->conteur.freeze_mode == NON) { - priv->conteur.burn_mode = visual_random_context_int(priv->rcontext) % 4; - - priv->conteur.draw_mode = visual_random_context_int(priv->rcontext) % 7; - - priv->conteur.blur_mode = visual_random_context_int(priv->rcontext) % 5 ; - if (priv->conteur.draw_mode==2) - priv->conteur.blur_mode=0; - - random_palette(priv); - } - priv->conteur.last_flash = 0; - } else { - /* il y a eu un flash y a pas longtemps, donc on fait juste des etoiles */ - /* on change de mode blur */ - if ((priv->conteur.freeze_mode == 0) && (priv->conteur.mix_reprise >5) && (priv->conteur.draw_mode!=2)) { - priv->conteur.blur_mode = visual_random_context_int(priv->rcontext) % 5 ; - } - } - } +void on_reprise(JessPrivate *priv) { + uint32_t j; + uint8_t *pix = priv->pixel; + + if (priv->lys.reprise == OUI) { + if (priv->conteur.last_flash > 5 * priv->conteur.fps) { + if (priv->conteur.draw_mode == 5) + stars_manage(priv, priv->pixel, NEW_SESSION, priv->conteur.angle2 / 400, + 0, priv->conteur.angle2 / 60, 200, 130); + + pix = priv->pixel; + for (j = 0; j < priv->resy * priv->pitch; j++) + *(pix++) = 250; + + if (priv->conteur.freeze_mode == NON) { + priv->conteur.burn_mode = visual_random_context_int(priv->rcontext) % 4; + + priv->conteur.draw_mode = visual_random_context_int(priv->rcontext) % 7; + + priv->conteur.blur_mode = visual_random_context_int(priv->rcontext) % 5; + if (priv->conteur.draw_mode == 2) + priv->conteur.blur_mode = 0; + + random_palette(priv); + } + priv->conteur.last_flash = 0; + } else { + /* il y a eu un flash y a pas longtemps, donc on fait juste des etoiles */ + /* on change de mode blur */ + if ((priv->conteur.freeze_mode == 0) && (priv->conteur.mix_reprise > 5) && + (priv->conteur.draw_mode != 2)) { + priv->conteur.blur_mode = visual_random_context_int(priv->rcontext) % 5; + } + } + } } -void copy_and_fade(JessPrivate *priv, float factor) -{ - uint32_t j; - uint8_t *pix, *buf; - - buf = priv->buffer; - pix = priv->pixel; - - if(priv->video == 8) - { - fade(factor, priv->dim); - - for (j = 0; j < priv->resy * priv->resx; j++) - { - *(buf++) = priv->dim[*(pix++)]; - } - } - else - { - fade(cos(0.125*factor)*factor*2, priv->dimR); - fade(cos(0.25*factor)*factor*2, priv->dimG); - fade(cos(0.5*factor)*factor*2, priv->dimB); - - for (j = 0; j < priv->resy * priv->resx; j++) - { - *(buf++) = priv->dimR[*(pix++)]; - *(buf++) = priv->dimG[*(pix++)]; - *(buf++) = priv->dimB[*(pix++)]; - - buf++; - pix++; - } - } +void copy_and_fade(JessPrivate *priv, float factor) { + uint32_t j; + uint8_t *pix, *buf; + + buf = priv->buffer; + pix = priv->pixel; + + if (priv->video == 8) { + fade(factor, priv->dim); + + for (j = 0; j < priv->resy * priv->resx; j++) { + *(buf++) = priv->dim[*(pix++)]; + } + } else { + fade(cos(0.125 * factor) * factor * 2, priv->dimR); + fade(cos(0.25 * factor) * factor * 2, priv->dimG); + fade(cos(0.5 * factor) * factor * 2, priv->dimB); + + for (j = 0; j < priv->resy * priv->resx; j++) { + *(buf++) = priv->dimR[*(pix++)]; + *(buf++) = priv->dimG[*(pix++)]; + *(buf++) = priv->dimB[*(pix++)]; + + buf++; + pix++; + } + } } +void fade(float variable, uint8_t *dim) { + uint32_t aux2, j; + float aux; -void fade(float variable, uint8_t * dim) -{ - uint32_t aux2,j ; - float aux; - - aux = 1-exp(-fabs(variable)); + aux = 1 - exp(-fabs(variable)); - if (aux>1) - aux=1; - if (aux<0) - aux=0; + if (aux > 1) + aux = 1; + if (aux < 0) + aux = 0; - for (j= 0; j < 256; j++) - { - aux2 = (uint8_t) ((float) j * 0.245 * aux); + for (j = 0; j < 256; j++) { + aux2 = (uint8_t)((float)j * 0.245 * aux); - if (aux2>255) - aux2=255; - if (aux2<0) - aux2=0; + if (aux2 > 255) + aux2 = 255; + if (aux2 < 0) + aux2 = 0; - dim[j]= aux2; - } + dim[j] = aux2; + } } -void render_deformation(JessPrivate *priv, int defmode) -{ - intptr_t bmax; - uint32_t *tab1 = NULL, *tab2, *tab3, *tab4, i; - uint8_t *pix = priv->pixel, *aux; - - /**************** BUFFER DEFORMATION ****************/ - if (priv->video == 8) - { - tab1 = priv->table1; - tab2 = priv->table2; - tab3 = priv->table3; - tab4 = priv->table4; - bmax = priv->resx * priv->resy + (intptr_t) priv->pixel; - - switch(defmode) - { - case 0: - visual_mem_copy(priv->pixel, priv->buffer, priv->resx * priv->resy); - break; - case 1: - for (pix = priv->pixel; pix < (uint8_t *) bmax ; pix++) - *pix = *(priv->buffer + *(tab1++)) ; - break; - case 2: - for (pix = priv->pixel; pix < (uint8_t *) bmax; pix++) - *pix = *(priv->buffer + *(tab2++)) ; - break; - case 3: - for (pix = priv->pixel; pix < (uint8_t *) bmax; pix++) - *pix = *(priv->buffer + *(tab3++)) ; - break; - case 4: - for (pix = priv->pixel; pix < (uint8_t *) bmax; pix++) - *pix = *(priv->buffer + *(tab4++)) ; - break; - default: - - break; - } - } - else - { - pix = priv->pixel; - - bmax = priv->resx * priv->resy; - switch(defmode) - { - case 0: - visual_mem_copy(priv->pixel, priv->buffer, priv->pitch * priv->resy); - return; - break; - case 1: - tab1 = priv->table1; - break; - case 2: - tab1 = priv->table2; - break; - case 3: - tab1 = priv->table3; - break; - case 4: - tab1 = priv->table4; - break; - - default: - - break; - } - for (i = 0; i < priv->resy * priv->resx; i++) - { - aux = (uint8_t *) ((*(tab1) << 2 ) + (intptr_t) priv->buffer); - *(pix++) = *(aux++) ; - *(pix++) = *(aux++); - *(pix++) = *(aux); - - pix++; - - tab1++; - } - } +void render_deformation(JessPrivate *priv, int defmode) { + intptr_t bmax; + uint32_t *tab1 = NULL, *tab2, *tab3, *tab4, i; + uint8_t *pix = priv->pixel, *aux; + + /**************** BUFFER DEFORMATION ****************/ + if (priv->video == 8) { + tab1 = priv->table1; + tab2 = priv->table2; + tab3 = priv->table3; + tab4 = priv->table4; + bmax = priv->resx * priv->resy + (intptr_t)priv->pixel; + + switch (defmode) { + case 0: + visual_mem_copy(priv->pixel, priv->buffer, priv->resx * priv->resy); + break; + case 1: + for (pix = priv->pixel; pix < (uint8_t *)bmax; pix++) + *pix = *(priv->buffer + *(tab1++)); + break; + case 2: + for (pix = priv->pixel; pix < (uint8_t *)bmax; pix++) + *pix = *(priv->buffer + *(tab2++)); + break; + case 3: + for (pix = priv->pixel; pix < (uint8_t *)bmax; pix++) + *pix = *(priv->buffer + *(tab3++)); + break; + case 4: + for (pix = priv->pixel; pix < (uint8_t *)bmax; pix++) + *pix = *(priv->buffer + *(tab4++)); + break; + default: + + break; + } + } else { + pix = priv->pixel; + + bmax = priv->resx * priv->resy; + switch (defmode) { + case 0: + visual_mem_copy(priv->pixel, priv->buffer, priv->pitch * priv->resy); + return; + break; + case 1: + tab1 = priv->table1; + break; + case 2: + tab1 = priv->table2; + break; + case 3: + tab1 = priv->table3; + break; + case 4: + tab1 = priv->table4; + break; + + default: + + break; + } + for (i = 0; i < priv->resy * priv->resx; i++) { + aux = (uint8_t *)((*(tab1) << 2) + (intptr_t)priv->buffer); + *(pix++) = *(aux++); + *(pix++) = *(aux++); + *(pix++) = *(aux); + + pix++; + + tab1++; + } + } } -void render_blur(JessPrivate *priv, int blur) -{ +void render_blur(JessPrivate *priv, int blur) { - /***************** Annotation par Karl Soulabaille: ***/ - /* Quel est la valeur d'initialisation de pix ? */ - /* (d'ou le segfault) */ - /* j'ai mis pixel par defaut... */ + /***************** Annotation par Karl Soulabaille: ***/ + /* Quel est la valeur d'initialisation de pix ? */ + /* (d'ou le segfault) */ + /* j'ai mis pixel par defaut... */ - uint8_t *pix = priv->pixel; - intptr_t bmax; - uint32_t pitch_4; - - pix = priv->pixel; - if (priv->pixel == NULL) - return; + uint8_t *pix = priv->pixel; + intptr_t bmax; + uint32_t pitch_4; + pix = priv->pixel; + if (priv->pixel == NULL) + return; - /* FIXME MMX 8 BIT VERSION */ - - /* Annotation par Karl Soulabaille: */ - /* Il y avait des overflows sur les boucles (indice sup�rieur trop �lev� de 1) */ - if (priv->video == 8) - { - bmax = priv->resx * (priv->resy-1) + (intptr_t) priv->pixel; + /* FIXME MMX 8 BIT VERSION */ - if (visual_cpu_has_mmx ()) { + /* Annotation par Karl Soulabaille: */ + /* Il y avait des overflows sur les boucles (indice sup�rieur trop �lev� de 1) + */ + if (priv->video == 8) { + bmax = priv->resx * (priv->resy - 1) + (intptr_t)priv->pixel; + + if (visual_cpu_has_mmx()) { #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) - __asm __volatile - ("\n\t pxor %%mm6, %%mm6" - ::); - - for (pix = priv->pixel; pix < (uint8_t *) bmax-9; pix += 8) - { - __asm __volatile - ("\n\t movq %[pix1], %%mm0" - "\n\t movq %[pix2], %%mm1" - "\n\t movq %[pix3], %%mm2" - "\n\t paddb %%mm0, %%mm1" - "\n\t movq %[pix4], %%mm3" - "\n\t paddb %%mm2, %%mm1" - "\n\t paddb %%mm3, %%mm1" - "\n\t movq %%mm1, %[pix1]" - :: [pix1] "m" (*pix) - , [pix2] "m" (*(pix + 1)) - , [pix3] "m" (*(pix + priv->resx)) - , [pix4] "m" (*(pix + priv->resx + 1))); - - } - - __asm __volatile - ("\n\t emms"); + __asm __volatile("\n\t pxor %%mm6, %%mm6" ::); + + for (pix = priv->pixel; pix < (uint8_t *)bmax - 9; pix += 8) { + __asm __volatile( + "\n\t movq %[pix1], %%mm0" + "\n\t movq %[pix2], %%mm1" + "\n\t movq %[pix3], %%mm2" + "\n\t paddb %%mm0, %%mm1" + "\n\t movq %[pix4], %%mm3" + "\n\t paddb %%mm2, %%mm1" + "\n\t paddb %%mm3, %%mm1" + "\n\t movq %%mm1, %[pix1]" ::[pix1] "m"(*pix), + [pix2] "m"(*(pix + 1)), [pix3] "m"(*(pix + priv->resx)), + [pix4] "m"(*(pix + priv->resx + 1))); + } + + __asm __volatile("\n\t emms"); #endif - } else { - for (pix = priv->pixel; pix < (uint8_t *) bmax-1; pix++) - *pix += *(pix+1) + *(pix+ priv->resx) + *(pix+ priv->resx+1); - } - } - else - { - pitch_4 = priv->pitch+4; - bmax = priv->pitch*(priv->resy-1) + (intptr_t) priv->pixel; - - if (visual_cpu_has_mmx ()) { + } else { + for (pix = priv->pixel; pix < (uint8_t *)bmax - 1; pix++) + *pix += *(pix + 1) + *(pix + priv->resx) + *(pix + priv->resx + 1); + } + } else { + pitch_4 = priv->pitch + 4; + bmax = priv->pitch * (priv->resy - 1) + (intptr_t)priv->pixel; + + if (visual_cpu_has_mmx()) { #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) - __asm __volatile - ("\n\t pxor %%mm6, %%mm6" - ::); - - for (pix = priv->pixel; pix < (uint8_t *) bmax-12; ) - { - __asm __volatile - ("\n\t movq %[pix1], %%mm0" - "\n\t movq %[pix2], %%mm1" - "\n\t movq %[pix3], %%mm2" - "\n\t paddb %%mm0, %%mm1" - "\n\t movq %[pix4], %%mm3" - "\n\t paddb %%mm2, %%mm1" - "\n\t paddb %%mm3, %%mm1" - "\n\t movq %%mm1, %[pix1]" - :: [pix1] "m" (*pix) - , [pix2] "m" (*(pix + 4)) - , [pix3] "m" (*(pix + priv->pitch)) - , [pix4] "m" (*(pix + pitch_4))); - - pix += 8; - } - - __asm __volatile - ("\n\t emms"); + __asm __volatile("\n\t pxor %%mm6, %%mm6" ::); + + for (pix = priv->pixel; pix < (uint8_t *)bmax - 12;) { + __asm __volatile( + "\n\t movq %[pix1], %%mm0" + "\n\t movq %[pix2], %%mm1" + "\n\t movq %[pix3], %%mm2" + "\n\t paddb %%mm0, %%mm1" + "\n\t movq %[pix4], %%mm3" + "\n\t paddb %%mm2, %%mm1" + "\n\t paddb %%mm3, %%mm1" + "\n\t movq %%mm1, %[pix1]" ::[pix1] "m"(*pix), + [pix2] "m"(*(pix + 4)), [pix3] "m"(*(pix + priv->pitch)), + [pix4] "m"(*(pix + pitch_4))); + + pix += 8; + } + + __asm __volatile("\n\t emms"); #endif - } else { - for (pix = priv->pixel; pix < (uint8_t *) bmax-4; ) - { - *pix += *(pix + 4) + *(pix + priv->pitch) + *(pix + pitch_4); - pix++; - *pix += *(pix + 4) + *(pix + priv->pitch) + *(pix + pitch_4); - pix++; - *pix += *(pix + 4) + *(pix + priv->pitch) + *(pix + pitch_4); - pix += 2; - } - } - } + } else { + for (pix = priv->pixel; pix < (uint8_t *)bmax - 4;) { + *pix += *(pix + 4) + *(pix + priv->pitch) + *(pix + pitch_4); + pix++; + *pix += *(pix + 4) + *(pix + priv->pitch) + *(pix + pitch_4); + pix++; + *pix += *(pix + 4) + *(pix + priv->pitch) + *(pix + pitch_4); + pix += 2; + } + } + } } - diff --git a/libvisual-plugins/plugins/actor/jess/renderer.h b/libvisual-plugins/plugins/actor/jess/renderer.h index d795524e9..c8a09298e 100644 --- a/libvisual-plugins/plugins/actor/jess/renderer.h +++ b/libvisual-plugins/plugins/actor/jess/renderer.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -24,9 +24,9 @@ #include "jess.h" -int nice(int inc); +int nice(int inc); void *renderer(JessPrivate *priv); -void fade(float variable, uint8_t * dim); +void fade(float variable, uint8_t *dim); void draw_mode(JessPrivate *priv, int mode); void on_beat(JessPrivate *priv, int beat); void on_reprise(JessPrivate *priv); diff --git a/libvisual-plugins/plugins/actor/jess/struct.h b/libvisual-plugins/plugins/actor/jess/struct.h index ccfc9cce1..26f63d9e5 100644 --- a/libvisual-plugins/plugins/actor/jess/struct.h +++ b/libvisual-plugins/plugins/actor/jess/struct.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Remi Arquier * * Authors: Remi Arquier @@ -27,39 +27,35 @@ #include -struct conteur_struct -{ - float angle; - float angle2; - float v_angle2; - - float dt; - - uint32_t blur_mode; - +struct conteur_struct { + float angle; + float angle2; + float v_angle2; - int fps; + float dt; - uint32_t courbe; - uint32_t mix_reprise; - uint32_t last_flash; - uint32_t draw_mode; - uint32_t burn_mode; - uint32_t k1; - uint32_t k2; - uint32_t k3; + uint32_t blur_mode; + int fps; - uint32_t general; - int term_display; - int fullscreen; - int psy; - int analyser; - int freeze ; - int freeze_mode ; + uint32_t courbe; + uint32_t mix_reprise; + uint32_t last_flash; + uint32_t draw_mode; + uint32_t burn_mode; + uint32_t k1; + uint32_t k2; + uint32_t k3; + uint32_t general; + int term_display; + int fullscreen; + int psy; + int analyser; + int freeze; + int freeze_mode; - int triplet; + int triplet; }; #endif /* _JESS_STRUCT_H */ diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/BufferedReader.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/BufferedReader.cpp index 8f21846db..f7284e60c 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/BufferedReader.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/BufferedReader.cpp @@ -28,51 +28,42 @@ using namespace LCD; BufferedReader::BufferedReader() { - current_ = 0; - locked_ = false; + current_ = 0; + locked_ = false; } int BufferedReader::Peek(unsigned char *data, int bytes) { - int i; - for(i = current_; (i - current_) < bytes && - i < (int)buffer_.size() ; i++ ) { - data[i-current_] = buffer_[i]; - } - int read = i - current_; - current_+=i - current_; - return read; + int i; + for (i = current_; (i - current_) < bytes && i < (int)buffer_.size(); i++) { + data[i - current_] = buffer_[i]; + } + int read = i - current_; + current_ += i - current_; + return read; } int BufferedReader::Read(unsigned char *data, int bytes) { - int i; - std::vector::iterator it = buffer_.begin(); - for( i = 0; i < bytes && i < (int)buffer_.size(); i++ ) { - data[i] = buffer_[i]; - it++; - } - buffer_.erase(buffer_.begin(), it); - current_ = 0; - return i; + int i; + std::vector::iterator it = buffer_.begin(); + for (i = 0; i < bytes && i < (int)buffer_.size(); i++) { + data[i] = buffer_[i]; + it++; + } + buffer_.erase(buffer_.begin(), it); + current_ = 0; + return i; } void BufferedReader::AddData(unsigned char *data, int len) { - for( int i = 0; i < len; i++ ) { - buffer_.push_back(data[i]); - } + for (int i = 0; i < len; i++) { + buffer_.push_back(data[i]); + } } -void BufferedReader::SetCurrent(int c) { - current_ = c; -} +void BufferedReader::SetCurrent(int c) { current_ = c; } -int BufferedReader::GetCurrent() { - return current_; -} +int BufferedReader::GetCurrent() { return current_; } -void BufferedReader::SetLocked(bool locked) { - locked_ = locked; -} +void BufferedReader::SetLocked(bool locked) { locked_ = locked; } -bool BufferedReader::GetLocked() { - return locked_; -} +bool BufferedReader::GetLocked() { return locked_; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/BufferedReader.h b/libvisual-plugins/plugins/actor/lcdcontrol/BufferedReader.h index 98ace6717..7222f7c3b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/BufferedReader.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/BufferedReader.h @@ -28,20 +28,21 @@ namespace LCD { class BufferedReader { - std::vector buffer_; - bool locked_; - int current_; - public: - BufferedReader(); - int Peek(unsigned char *data, int bytes = 1); - int Read(unsigned char *data, int bytes = 1); - void AddData(unsigned char *data, int len); - void SetCurrent(int c); - int GetCurrent(); - void SetLocked(bool locked); - bool GetLocked(); + std::vector buffer_; + bool locked_; + int current_; + +public: + BufferedReader(); + int Peek(unsigned char *data, int bytes = 1); + int Read(unsigned char *data, int bytes = 1); + void AddData(unsigned char *data, int len); + void SetCurrent(int c); + int GetCurrent(); + void SetLocked(bool locked); + bool GetLocked(); }; -} +} // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/CFG.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/CFG.cpp index 4edec8188..7e1196bf8 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/CFG.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/CFG.cpp @@ -35,119 +35,118 @@ using namespace LCD; extern std::string lcdcontrol_config; CFG::CFG() { - main_root_ = true; - root_ = NULL; + main_root_ = true; + root_ = NULL; } CFG::CFG(Json::Value *config) { - main_root_ = false; - root_ = config; + main_root_ = false; + root_ = config; } CFG::~CFG() { - if(main_root_) - delete root_; + if (main_root_) + delete root_; } std::string CFG::CFG_Source() { - std::string path = key_ + ".source"; - Json::Value *source = CFG_Fetch_Raw(root_, path, new Json::Value("")); - std::string name = source->asString(); - delete source; - return name; + std::string path = key_ + ".source"; + Json::Value *source = CFG_Fetch_Raw(root_, path, new Json::Value("")); + std::string name = source->asString(); + delete source; + return name; } -bool CFG::CFG_Init( std::string path ) { +bool CFG::CFG_Init(std::string path) { - std::ifstream stream_in; - std::ofstream stream_out; + std::ifstream stream_in; + std::ofstream stream_out; + stream_in.open(path, std::ios::binary); + + if (not stream_in.is_open()) { + stream_out.open(path); + stream_out << lcdcontrol_config; + stream_out.close(); stream_in.open(path, std::ios::binary); + } + if (not stream_in.is_open()) { + visual_log(VISUAL_LOG_CRITICAL, "LCDControl could not load a config file."); + return false; + } + + root_ = new Json::Value(); + + bool r = reader_.parse(stream_in, *root_, true); + + stream_in.close(); - if(not stream_in.is_open()) - { - stream_out.open(path); - stream_out << lcdcontrol_config; - stream_out.close(); - stream_in.open(path, std::ios::binary); - } - if(not stream_in.is_open()) - { - visual_log(VISUAL_LOG_CRITICAL, "LCDControl could not load a config file."); - return false; - } - - root_ = new Json::Value(); - - bool r = reader_.parse( stream_in, *root_, true ); - - stream_in.close(); - - if( r ) { - return true; - } else { - LCDError("%s", reader_.getFormatedErrorMessages().c_str()); - return false; - } + if (r) { + return true; + } else { + LCDError("%s", reader_.getFormatedErrorMessages().c_str()); + return false; + } } // Programmer must free memory -Json::Value *CFG::CFG_Fetch_Raw(Json::Value *section, std::string key, - Json::Value *defval) { - - int pos = key.find("."); - if( pos > -1 ) { - std::string k = key.substr(0, pos); - Json::Value *subSection = CFG_Fetch_Raw(section, k); - if(!subSection) - return defval; - Json::Value *root_ = CFG_Fetch_Raw(subSection, - key.substr(pos + 1, key.length()), defval); - delete subSection; - return root_; - } - - if(!section->isMember(key)) { - return defval; - } - - Json::Value *val = new Json::Value(section->get(key, - defval ? *defval : Json::Value())); - - /*if(defval && (val->type() != defval->type())) { - LCDError("CFG: Possible value type mismatch <%s>", key.c_str()); - delete val; - return defval; - }*/ - - if( val->isNull() ) { - delete val; - val = NULL; - } - - if(val && defval) { - delete defval; - defval = NULL; - } - return val ? val : defval; +Json::Value *CFG::CFG_Fetch_Raw(Json::Value *section, std::string key, + Json::Value *defval) { + + int pos = key.find("."); + if (pos > -1) { + std::string k = key.substr(0, pos); + Json::Value *subSection = CFG_Fetch_Raw(section, k); + if (!subSection) + return defval; + Json::Value *root_ = + CFG_Fetch_Raw(subSection, key.substr(pos + 1, key.length()), defval); + delete subSection; + return root_; + } + + if (!section->isMember(key)) { + return defval; + } + + Json::Value *val = + new Json::Value(section->get(key, defval ? *defval : Json::Value())); + + /*if(defval && (val->type() != defval->type())) { + LCDError("CFG: Possible value type mismatch <%s>", key.c_str()); + delete val; + return defval; + }*/ + + if (val->isNull()) { + delete val; + val = NULL; + } + + if (val && defval) { + delete defval; + defval = NULL; + } + return val ? val : defval; } // Programmer must free memory -Json::Value *CFG::CFG_Fetch(Json::Value *section, std::string key, - Json::Value *defval) { - - Json::Value *val = CFG_Fetch_Raw(section, key, defval ? - new Json::Value(*defval) : defval); - - if(!val) - return defval; - - if( val->isNumeric() ) { - if( defval ) delete defval; - return val; - } else if ( val->isString() ) { - Json::Value *val2 = new Json::Value(Eval(val->asCString())); - return val2 ? val2 : defval; - } +Json::Value *CFG::CFG_Fetch(Json::Value *section, std::string key, + Json::Value *defval) { + + Json::Value *val = + CFG_Fetch_Raw(section, key, defval ? new Json::Value(*defval) : defval); + + if (!val) return defval; + + if (val->isNumeric()) { + if (defval) + delete defval; + return val; + } else if (val->isString()) { + Json::Value *val2 = new Json::Value(Eval(val->asCString())); + return val2 ? val2 : defval; + } + return defval; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/CFG.h b/libvisual-plugins/plugins/actor/lcdcontrol/CFG.h index c765ca806..682aa447d 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/CFG.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/CFG.h @@ -29,26 +29,28 @@ namespace LCD { class CFG : public virtual Evaluator { - Json::Reader reader_; - Json::Value *root_; - bool main_root_; - protected: - std::string key_; - public: - CFG(); - CFG(Json::Value *config); - virtual ~CFG(); - std::string CFG_Source(); - bool CFG_Init( std::string path); - Json::Value *CFG_Fetch_Raw(Json::Value *section, std::string key, - Json::Value *defval = NULL); - Json::Value *CFG_Fetch(Json::Value *section, std::string key, - Json::Value *defval = NULL); - virtual std::string CFG_Key() { return key_;}; - virtual Json::Value *CFG_Get_Root() { return root_; } - virtual void CFG_Set_Root(Json::Value *r) { root_ = r; } -}; + Json::Reader reader_; + Json::Value *root_; + bool main_root_; + +protected: + std::string key_; +public: + CFG(); + CFG(Json::Value *config); + virtual ~CFG(); + std::string CFG_Source(); + bool CFG_Init(std::string path); + Json::Value *CFG_Fetch_Raw(Json::Value *section, std::string key, + Json::Value *defval = NULL); + Json::Value *CFG_Fetch(Json::Value *section, std::string key, + Json::Value *defval = NULL); + virtual std::string CFG_Key() { return key_; }; + virtual Json::Value *CFG_Get_Root() { return root_; } + virtual void CFG_Set_Root(Json::Value *r) { root_ = r; } }; +}; // namespace LCD + #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/CPtr.h b/libvisual-plugins/plugins/actor/lcdcontrol/CPtr.h index 22e20f2b3..2c1448c17 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/CPtr.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/CPtr.h @@ -1,17 +1,15 @@ #ifndef __CPTR_ #define __CPTR_ -template -T getObjectFromCPtr( JNIEnv *env, jobject cptr ) -{ - T obj; - jclass classPtr = env->GetObjectClass( cptr ); - jfieldID CPtr_peer_ID = env->GetFieldID( classPtr, "peer", "J" ); - jlong *peer = (jlong *) env->GetLongField( cptr, CPtr_peer_ID ); +template T getObjectFromCPtr(JNIEnv *env, jobject cptr) { + T obj; + jclass classPtr = env->GetObjectClass(cptr); + jfieldID CPtr_peer_ID = env->GetFieldID(classPtr, "peer", "J"); + jlong *peer = (jlong *)env->GetLongField(cptr, CPtr_peer_ID); - obj = ( T ) peer; + obj = (T)peer; - return obj; + return obj; } #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/DrvVideo.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/DrvVideo.cpp index a363f9097..ffa8b12ff 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/DrvVideo.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/DrvVideo.cpp @@ -25,97 +25,84 @@ using namespace LCD; // LCDGraphic RealBlit void DrvVideoBlit(LCDGraphic *lcd, const int row, const int col, - const int height, const int width) { - ((DrvVideo *)lcd)->DrvBlit(row, col, height, width); + const int height, const int width) { + ((DrvVideo *)lcd)->DrvBlit(row, col, height, width); } - // Constructor -DrvVideo::DrvVideo(std::string name, LCDControl *v, - Json::Value *config, int layers, VisEventQueue *eventqueue) : - LCDCore(v, name, config, LCD_GRAPHIC, eventqueue, (LCDGraphic *)this), - LCDGraphic((LCDCore *)this) { - LCDError("DrvVideo"); +DrvVideo::DrvVideo(std::string name, LCDControl *v, Json::Value *config, + int layers, VisEventQueue *eventqueue) + : LCDCore(v, name, config, LCD_GRAPHIC, eventqueue, (LCDGraphic *)this), + LCDGraphic((LCDCore *)this) { + LCDError("DrvVideo"); - GraphicRealBlit = DrvVideoBlit; + GraphicRealBlit = DrvVideoBlit; - Json::Value *val = CFG_Fetch_Raw(config, name + ".cols", new Json::Value(SCREEN_W)); - cols_ = val->asInt(); - delete val; + Json::Value *val = + CFG_Fetch_Raw(config, name + ".cols", new Json::Value(SCREEN_W)); + cols_ = val->asInt(); + delete val; - val = CFG_Fetch_Raw(config, name + ".rows", new Json::Value(SCREEN_H)); - rows_ = val->asInt(); - delete val; + val = CFG_Fetch_Raw(config, name + ".rows", new Json::Value(SCREEN_H)); + rows_ = val->asInt(); + delete val; - val = CFG_Fetch_Raw(config, name + ".update", new Json::Value(30)); - update_ = val->asInt(); - delete val; + val = CFG_Fetch_Raw(config, name + ".update", new Json::Value(30)); + update_ = val->asInt(); + delete val; - GraphicInit(rows_, cols_, 8, 8, layers); + GraphicInit(rows_, cols_, 8, 8, layers); - video_ = visual_video_new_with_buffer(cols_, rows_, VISUAL_VIDEO_DEPTH_32BIT); + video_ = visual_video_new_with_buffer(cols_, rows_, VISUAL_VIDEO_DEPTH_32BIT); } // Destructor -DrvVideo::~DrvVideo() { - visual_video_unref(video_); -} +DrvVideo::~DrvVideo() { visual_video_unref(video_); } // Initialize device and libusb void DrvVideo::SetupDevice() { - if(update_ < 0) - return; + if (update_ < 0) + return; } // Deinit driver -void DrvVideo::TakeDown() { - Disconnect(); -} +void DrvVideo::TakeDown() { Disconnect(); } // Configuration setup -void DrvVideo::CFGSetup() { - LCDCore::CFGSetup(); -} +void DrvVideo::CFGSetup() { LCDCore::CFGSetup(); } // Connect -- generic method called from main code void DrvVideo::Connect() { - if(update_ < 0) - return; - LCDError("DrvVideo::Connect()"); - connected_ = true; - GraphicClear(); - GraphicStart(); + if (update_ < 0) + return; + LCDError("DrvVideo::Connect()"); + connected_ = true; + GraphicClear(); + GraphicStart(); } // Disconnect -- deinit -void DrvVideo::Disconnect() { - connected_ = false; -} +void DrvVideo::Disconnect() { connected_ = false; } void DrvVideo::DrvUpdateImg() { - //unsigned int size = visual_video_get_size(video_); - //uint8_t *data = (uint8_t *)visual_video_get_pixels(video_); - - + // unsigned int size = visual_video_get_size(video_); + // uint8_t *data = (uint8_t *)visual_video_get_pixels(video_); } // Driver-side blit method -void DrvVideo::DrvBlit(const int row, const int col, - const int height, const int width) { -/* - uint32_t *pixels = (uint32_t *)visual_video_get_pixels(video_); - - for(int r = row; r < row + height; r++) { - for(int c = col; c < col + width; c++) { - //We don't need this because LCDGraphic has a VisVideo* getter now. - pixels[r * cols_ + c] = GraphicRGB(r, c).ToInt(); - } - } -*/ +void DrvVideo::DrvBlit(const int row, const int col, const int height, + const int width) { + /* + uint32_t *pixels = (uint32_t *)visual_video_get_pixels(video_); + + for(int r = row; r < row + height; r++) { + for(int c = col; c < col + width; c++) { + //We don't need this because LCDGraphic has a VisVideo* getter + now. pixels[r * cols_ + c] = GraphicRGB(r, c).ToInt(); + } + } + */ } // Clear the LCD -void DrvVideo::DrvClear() { - -} - +void DrvVideo::DrvClear() {} diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/DrvVideo.h b/libvisual-plugins/plugins/actor/lcdcontrol/DrvVideo.h index 2c0bf2afc..9b3d530e6 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/DrvVideo.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/DrvVideo.h @@ -18,34 +18,32 @@ namespace LCD { class DrvVideo : public LCDCore, public LCDGraphic { - VisVideo *video_; - - bool connected_; - int update_; - int cols_; - int rows_; - int bpp_; - int depth_; - - void DrvClear(); - void DrvUpdateImg(); - void DrvUpdate(); - - public: - DrvVideo(std::string name, LCDControl *v, - Json::Value *config, int layers, VisEventQueue *eventqueue); - ~DrvVideo(); - void SetupDevice(); - void TakeDown(); - void CFGSetup(); - void Connect(); - void Disconnect(); - void UpdateThread(); - void DrvBlit(const int row, const int col, const int height, const int width); - + VisVideo *video_; + + bool connected_; + int update_; + int cols_; + int rows_; + int bpp_; + int depth_; + + void DrvClear(); + void DrvUpdateImg(); + void DrvUpdate(); + +public: + DrvVideo(std::string name, LCDControl *v, Json::Value *config, int layers, + VisEventQueue *eventqueue); + ~DrvVideo(); + void SetupDevice(); + void TakeDown(); + void CFGSetup(); + void Connect(); + void Disconnect(); + void UpdateThread(); + void DrvBlit(const int row, const int col, const int height, const int width); }; - -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Evaluator.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/Evaluator.cpp index 0aec1d730..9ab81173f 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Evaluator.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Evaluator.cpp @@ -23,68 +23,64 @@ #include #include #include -//#include +// #include #include #include "luascript.h" #include "Evaluator.h" #include "SpecialChar.h" -//#include "CPtr.h" +// #include "CPtr.h" #include "debug.h" using namespace LCD; -Evaluator::Evaluator() -{ - mScript = new lua(); - mCpuinfo = new PluginCpuinfo(mScript); - mLoadavg = new PluginLoadavg(mScript); - mProcStat = new PluginProcStat(mScript); - mUptime = new PluginUptime(mScript); - mFPS = new PluginFPS(mScript); - mUname = new PluginUname(mScript); - mNetinfo = new PluginNetinfo(mScript); - mNetDev = new PluginNetDev(mScript); - mMeminfo = new PluginMeminfo(mScript); - mStatfs = new PluginStatfs(mScript); - mDiskstats = new PluginDiskstats(mScript); - mFifo = new PluginFifo(mScript); +Evaluator::Evaluator() { + mScript = new lua(); + mCpuinfo = new PluginCpuinfo(mScript); + mLoadavg = new PluginLoadavg(mScript); + mProcStat = new PluginProcStat(mScript); + mUptime = new PluginUptime(mScript); + mFPS = new PluginFPS(mScript); + mUname = new PluginUname(mScript); + mNetinfo = new PluginNetinfo(mScript); + mNetDev = new PluginNetDev(mScript); + mMeminfo = new PluginMeminfo(mScript); + mStatfs = new PluginStatfs(mScript); + mDiskstats = new PluginDiskstats(mScript); + mFifo = new PluginFifo(mScript); } -Evaluator::~Evaluator() -{ - delete mScript; - delete mCpuinfo; - delete mLoadavg; - delete mProcStat; - delete mUptime; - delete mFPS; - delete mUname; - delete mNetinfo; - delete mNetDev; - delete mStatfs; - delete mDiskstats; - delete mFifo; +Evaluator::~Evaluator() { + delete mScript; + delete mCpuinfo; + delete mLoadavg; + delete mProcStat; + delete mUptime; + delete mFPS; + delete mUname; + delete mNetinfo; + delete mNetDev; + delete mStatfs; + delete mDiskstats; + delete mFifo; } -std::string Evaluator::Eval(std::string str, std::string name) -{ - std::string val = ""; - - try { - mScript->exec("function __wrap__() " + str + " end; __out__ = __wrap__() or '0'"); - val = mScript->get_variable("__out__").value(); - } catch (lua::exception &e) - { - visual_log(VISUAL_LOG_ERROR, "(%s) Lua error: %s, line: %d (%s)", name.c_str(), e.error().c_str(), e.line(), str.c_str()); - } - return val; - +std::string Evaluator::Eval(std::string str, std::string name) { + std::string val = ""; + + try { + mScript->exec("function __wrap__() " + str + + " end; __out__ = __wrap__() or '0'"); + val = mScript->get_variable("__out__").value(); + } catch (lua::exception &e) { + visual_log(VISUAL_LOG_ERROR, "(%s) Lua error: %s, line: %d (%s)", + name.c_str(), e.error().c_str(), e.line(), str.c_str()); + } + return val; } -std::string Evaluator::Eval(std::string str) -{ - return Eval(str, "LCD::Evaluator"); +std::string Evaluator::Eval(std::string str) { + return Eval(str, "LCD::Evaluator"); } /////////////////////// JNI glue @@ -92,8 +88,9 @@ std::string Evaluator::Eval(std::string str) extern "C" { -JNIEXPORT jstring JNICALL Java_com_starlon_libscriptable_UtilsEvaluator_evaluate( - JNIEnv *env, jclass clazz, jobject obj, jstring str) +JNIEXPORT jstring JNICALL +Java_com_starlon_libscriptable_UtilsEvaluator_evaluate( JNIEnv *env, jclass +clazz, jobject obj, jstring str) { Evaluator *eval = getObjectFromCPtr( env, obj ); @@ -106,8 +103,9 @@ JNIEXPORT jstring JNICALL Java_com_starlon_libscriptable_UtilsEvaluator_evaluate return env->NewStringUTF(val.c_str()); } -JNIEXPORT jobject JNICALL Java_com_starlon_libscriptable_UtilsEvaluator_evaluatorNew( - JNIEnv *env, jclass clazz) +JNIEXPORT jobject JNICALL +Java_com_starlon_libscriptable_UtilsEvaluator_evaluatorNew( JNIEnv *env, jclass +clazz) { std::set_terminate(std::abort); @@ -125,13 +123,15 @@ JNIEXPORT jobject JNICALL Java_com_starlon_libscriptable_UtilsEvaluator_evaluato if (obj) { - env->SetLongField( obj, env->GetFieldID( tempClass, "peer", "J" ), (jlong)eval); + env->SetLongField( obj, env->GetFieldID( tempClass, "peer", "J" ), +(jlong)eval); } return obj; } -JNIEXPORT void JNICALL Java_com_starlon_libscriptable_UtilsEvaluator_evaluatorDel( - JNIEnv *env, jclass clazz, jobject obj) +JNIEXPORT void JNICALL +Java_com_starlon_libscriptable_UtilsEvaluator_evaluatorDel( JNIEnv *env, jclass +clazz, jobject obj) { Evaluator *eval = getObjectFromCPtr(env, obj); diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Evaluator.h b/libvisual-plugins/plugins/actor/lcdcontrol/Evaluator.h index de1ce0409..8ee94a74a 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Evaluator.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Evaluator.h @@ -43,34 +43,34 @@ namespace LCD { class Evaluator { - private: - lua *mScript; - PluginCpuinfo *mCpuinfo; - PluginLoadavg *mLoadavg; - PluginProcStat *mProcStat; - PluginUptime *mUptime; - PluginFPS *mFPS; - PluginUname *mUname; - PluginNetinfo *mNetinfo; - PluginNetDev *mNetDev; - PluginMeminfo *mMeminfo; - PluginStatfs *mStatfs; - PluginDiskstats *mDiskstats; - PluginFifo *mFifo; +private: + lua *mScript; + PluginCpuinfo *mCpuinfo; + PluginLoadavg *mLoadavg; + PluginProcStat *mProcStat; + PluginUptime *mUptime; + PluginFPS *mFPS; + PluginUname *mUname; + PluginNetinfo *mNetinfo; + PluginNetDev *mNetDev; + PluginMeminfo *mMeminfo; + PluginStatfs *mStatfs; + PluginDiskstats *mDiskstats; + PluginFifo *mFifo; - public: - Evaluator(); - virtual ~Evaluator(); - virtual std::string Eval(std::string str, std::string name); - virtual std::string Eval(std::string str); -/* - void AddAccessor(std::string name, QScriptValue (*func)(QScriptContext *ctx, - QScriptEngine *eng), QFlags); - void AddValue(std::string, QScriptValue val); - QScriptEngine *GetEngine() { return engine_; }; -*/ +public: + Evaluator(); + virtual ~Evaluator(); + virtual std::string Eval(std::string str, std::string name); + virtual std::string Eval(std::string str); + /* + void AddAccessor(std::string name, QScriptValue (*func)(QScriptContext + *ctx, QScriptEngine *eng), QFlags); void + AddValue(std::string, QScriptValue val); QScriptEngine *GetEngine() { + return engine_; }; + */ }; -}; +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Font_6x8.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/Font_6x8.cpp old mode 100755 new mode 100644 index 75438e8d3..c33588bbb --- a/libvisual-plugins/plugins/actor/lcdcontrol/Font_6x8.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Font_6x8.cpp @@ -24,2052 +24,259 @@ #include "Font_6x8.h" int Font_6x8[256][8] = { - /*0x0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x10*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x11*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x12*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x13*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x14*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x15*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x16*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x17*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x18*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x19*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1a*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1b*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1c*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1d*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1e*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1f*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x20*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x21*/ {___O__, - ___O__, - ___O__, - ___O__, - ______, - ______, - ___O__, - ______}, - /*0x22*/ {__O_O_, - __O_O_, - __O_O_, - ______, - ______, - ______, - ______, - ______}, - /*0x23*/ {__O_O_, - __O_O_, - _OOOOO, - __O_O_, - _OOOOO, - __O_O_, - __O_O_, - ______}, - /*0x24*/ {___O__, - __OOOO, - _O_O__, - __OOO_, - ___O_O, - _OOOO_, - ___O__, - ______}, - /*0x25*/ {_OO___, - _OO__O, - ____O_, - ___O__, - __O___, - _O__OO, - ____OO, - ______}, - /*0x26*/ {__OO__, - _O__O_, - _O_O__, - __O___, - _O_O_O, - _O__O_, - __OO_O, - ______}, - /*0x27*/ {__OO__, - ___O__, - __O___, - ______, - ______, - ______, - ______, - ______}, - /*0x28*/ {____O_, - ___O__, - __O___, - __O___, - __O___, - ___O__, - ____O_, - ______}, - /*0x29*/ {__O___, - ___O__, - ____O_, - ____O_, - ____O_, - ___O__, - __O___, - ______}, - /*0x2a*/ {______, - ___O__, - _O_O_O, - __OOO_, - _O_O_O, - ___O__, - ______, - ______}, - /*0x2b*/ {______, - ___O__, - ___O__, - _OOOOO, - ___O__, - ___O__, - ______, - ______}, - /*0x2c*/ {______, - ______, - ______, - ______, - __OO__, - ___O__, - __O___, - ______}, - /*0x2d*/ {______, - ______, - ______, - _OOOOO, - ______, - ______, - ______, - ______}, - /*0x2e*/ {______, - ______, - ______, - ______, - ______, - __OO__, - __OO__, - ______}, - /*0x2f*/ {______, - _____O, - ____O_, - ___O__, - __O___, - _O____, - ______, - ______}, - /*0x30*/ {__OOO_, - _O___O, - _O__OO, - _O_O_O, - _OO__O, - _O___O, - __OOO_, - ______}, - /*0x31*/ {___O__, - __OO__, - ___O__, - ___O__, - ___O__, - ___O__, - __OOO_, - ______}, - /*0x32*/ {__OOO_, - _O___O, - _____O, - ____O_, - ___O__, - __O___, - _OOOOO, - ______}, - /*0x33*/ {_OOOOO, - ____O_, - ___O__, - ____O_, - _____O, - _O___O, - __OOO_, - ______}, - /*0x34*/ {____O_, - ___OO_, - __O_O_, - _O__O_, - _OOOOO, - ____O_, - ____O_, - ______}, - /*0x35*/ {_OOOOO, - _O____, - _O____, - _OOOO_, - _____O, - _O___O, - __OOO_, - ______}, - /*0x36*/ {___OO_, - __O___, - _O____, - _OOOO_, - _O___O, - _O___O, - __OOO_, - ______}, - /*0x37*/ {_OOOOO, - _____O, - ____O_, - ___O__, - __O___, - __O___, - __O___, - ______}, - /*0x38*/ {__OOO_, - _O___O, - _O___O, - __OOO_, - _O___O, - _O___O, - __OOO_, - ______}, - /*0x39*/ {__OOO_, - _O___O, - _O___O, - __OOOO, - _____O, - ____O_, - __OO__, - ______}, - /*0x3a*/ {______, - __OO__, - __OO__, - ______, - __OO__, - __OO__, - ______, - ______}, - /*0x3b*/ {______, - __OO__, - __OO__, - ______, - __OO__, - ___O__, - __O___, - ______}, - /*0x3c*/ {____O_, - ___O__, - __O___, - _O____, - __O___, - ___O__, - ____O_, - ______}, - /*0x3d*/ {______, - ______, - _OOOOO, - ______, - _OOOOO, - ______, - ______, - ______}, - /*0x3e*/ {_O____, - __O___, - ___O__, - ____O_, - ___O__, - __O___, - _O____, - ______}, - /*0x3f*/ {__OOO_, - _O___O, - _____O, - ____O_, - ___O__, - ______, - ___O__, - ______}, - /*0x40*/ {__OOO_, - _O___O, - _____O, - __OO_O, - _O_O_O, - _O_O_O, - __OOO_, - ______}, - /*0x41*/ {__OOO_, - _O___O, - _O___O, - _O___O, - _OOOOO, - _O___O, - _O___O, - ______}, - /*0x42*/ {_OOOO_, - _O___O, - _O___O, - _OOOO_, - _O___O, - _O___O, - _OOOO_, - ______}, - /*0x43*/ {__OOO_, - _O___O, - _O____, - _O____, - _O____, - _O___O, - __OOO_, - ______}, - /*0x44*/ {_OOO__, - _O__O_, - _O___O, - _O___O, - _O___O, - _O__O_, - _OOO__, - ______}, - /*0x45*/ {_OOOOO, - _O____, - _O____, - _OOOO_, - _O____, - _O____, - _OOOOO, - ______}, - /*0x46*/ {_OOOOO, - _O____, - _O____, - _OOOO_, - _O____, - _O____, - _O____, - ______}, - /*0x47*/ {__OOO_, - _O___O, - _O____, - _O_OOO, - _O___O, - _O___O, - __OOOO, - ______}, - /*0x48*/ {_O___O, - _O___O, - _O___O, - _OOOOO, - _O___O, - _O___O, - _O___O, - ______}, - /*0x49*/ {__OOO_, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - __OOO_, - ______}, - /*0x4a*/ {___OOO, - ____O_, - ____O_, - ____O_, - ____O_, - _O__O_, - __OO__, - ______}, - /*0x4b*/ {_O___O, - _O__O_, - _O_O__, - _OO___, - _O_O__, - _O__O_, - _O___O, - ______}, - /*0x4c*/ {_O____, - _O____, - _O____, - _O____, - _O____, - _O____, - _OOOOO, - ______}, - /*0x4d*/ {_O___O, - _OO_OO, - _O_O_O, - _O_O_O, - _O___O, - _O___O, - _O___O, - ______}, - /*0x4e*/ {_O___O, - _O___O, - _OO__O, - _O_O_O, - _O__OO, - _O___O, - _O___O, - ______}, - /*0x4f*/ {__OOO_, - _O___O, - _O___O, - _O___O, - _O___O, - _O___O, - __OOO_, - ______}, - /*0x50*/ {_OOOO_, - _O___O, - _O___O, - _OOOO_, - _O____, - _O____, - _O____, - ______}, - /*0x51*/ {__OOO_, - _O___O, - _O___O, - _O___O, - _O_O_O, - _O__O_, - __OO_O, - ______}, - /*0x52*/ {_OOOO_, - _O___O, - _O___O, - _OOOO_, - _O_O__, - _O__O_, - _O___O, - ______}, - /*0x53*/ {__OOOO, - _O____, - _O____, - __OOO_, - _____O, - _____O, - _OOOO_, - ______}, - /*0x54*/ {_OOOOO, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ______}, - /*0x55*/ {_O___O, - _O___O, - _O___O, - _O___O, - _O___O, - _O___O, - __OOO_, - ______}, - /*0x56*/ {_O___O, - _O___O, - _O___O, - _O___O, - _O___O, - __O_O_, - ___O__, - ______}, - /*0x57*/ {_O___O, - _O___O, - _O___O, - _O_O_O, - _O_O_O, - _O_O_O, - __O_O_, - ______}, - /*0x58*/ {_O___O, - _O___O, - __O_O_, - ___O__, - __O_O_, - _O___O, - _O___O, - ______}, - /*0x59*/ {_O___O, - _O___O, - _O___O, - __O_O_, - ___O__, - ___O__, - ___O__, - ______}, - /*0x5a*/ {_OOOOO, - _____O, - ____O_, - ___O__, - __O___, - _O____, - _OOOOO, - ______}, - /*0x5b*/ {__OOO_, - __O___, - __O___, - __O___, - __O___, - __O___, - __OOO_, - ______}, - /*0x5c*/ {_O___O, - __O_O_, - _OOOOO, - ___O__, - _OOOOO, - ___O__, - ___O__, - ______}, - /*0x5d*/ {__OOO_, - ____O_, - ____O_, - ____O_, - ____O_, - ____O_, - __OOO_, - ______}, - /*0x5e*/ {___O__, - __O_O_, - _O___O, - ______, - ______, - ______, - ______, - ______}, - /*0x5f*/ {______, - ______, - ______, - ______, - ______, - ______, - _OOOOO, - ______}, - /*0x60*/ {__O___, - ___O__, - ____O_, - ______, - ______, - ______, - ______, - ______}, - /*0x61*/ {______, - ______, - __OOO_, - _____O, - __OOOO, - _O___O, - __OOOO, - ______}, - /*0x62*/ {_O____, - _O____, - _O_OO_, - _OO__O, - _O___O, - _O___O, - _OOOO_, - ______}, - /*0x63*/ {______, - ______, - __OOO_, - _O____, - _O____, - _O___O, - __OOO_, - ______}, - /*0x64*/ {_____O, - _____O, - __OO_O, - _O__OO, - _O___O, - _O___O, - __OOOO, - ______}, - /*0x65*/ {______, - ______, - __OOO_, - _O___O, - _OOOOO, - _O____, - __OOO_, - ______}, - /*0x66*/ {___OO_, - __O__O, - __O___, - _OOO__, - __O___, - __O___, - __O___, - ______}, - /*0x67*/ {______, - ______, - __OOOO, - _O___O, - _O___O, - __OOOO, - _____O, - __OOO_}, - /*0x68*/ {_O____, - _O____, - _O_OO_, - _OO__O, - _O___O, - _O___O, - _O___O, - ______}, - /*0x69*/ {___O__, - ______, - __OO__, - ___O__, - ___O__, - ___O__, - __OOO_, - ______}, - /*0x6a*/ {____O_, - ______, - ___OO_, - ____O_, - ____O_, - _O__O_, - __OO__, - ______}, - /*0x6b*/ {__O___, - __O___, - __O__O, - __O_O_, - __OO__, - __O_O_, - __O__O, - ______}, - /*0x6c*/ {__OO__, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - __OOO_, - ______}, - /*0x6d*/ {______, - ______, - _OO_O_, - _O_O_O, - _O_O_O, - _O___O, - _O___O, - ______}, - /*0x6e*/ {______, - ______, - _OOOO_, - _O___O, - _O___O, - _O___O, - _O___O, - ______}, - /*0x6f*/ {______, - ______, - __OOO_, - _O___O, - _O___O, - _O___O, - __OOO_, - ______}, - /*0x70*/ {______, - ______, - _OOOO_, - _O___O, - _O___O, - _OOOO_, - _O____, - _O____}, - /*0x71*/ {______, - ______, - __OO_O, - _O__OO, - _O___O, - __OOOO, - _____O, - _____O}, - /*0x72*/ {______, - ______, - _O_OO_, - _OO__O, - _O____, - _O____, - _O____, - ______}, - /*0x73*/ {______, - ______, - __OOO_, - _O____, - __OOO_, - _____O, - _OOOO_, - ______}, - /*0x74*/ {__O___, - __O___, - _OOO__, - __O___, - __O___, - __O__O, - ___OO_, - ______}, - /*0x75*/ {______, - ______, - _O___O, - _O___O, - _O___O, - _O__OO, - __OO_O, - ______}, - /*0x76*/ {______, - ______, - _O___O, - _O___O, - _O___O, - __O_O_, - ___O__, - ______}, - /*0x77*/ {______, - ______, - _O___O, - _O___O, - _O___O, - _O_O_O, - __O_O_, - ______}, - /*0x78*/ {______, - ______, - _O___O, - __O_O_, - ___O__, - __O_O_, - _O___O, - ______}, - /*0x79*/ {______, - ______, - _O___O, - _O___O, - __OOOO, - _____O, - __OOO_, - ______}, - /*0x7a*/ {______, - ______, - _OOOOO, - ____O_, - ___O__, - __O___, - _OOOOO, - ______}, - /*0x7b*/ {____O_, - ___O__, - ___O__, - __O___, - ___O__, - ___O__, - ____O_, - ______}, - /*0x7c*/ {___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ___O__, - ______}, - /*0x7d*/ {__O___, - ___O__, - ___O__, - ____O_, - ___O__, - ___O__, - __O___, - ______}, - /*0x7e*/ {______, - ___O__, - ____O_, - _OOOOO, - ____O_, - ___O__, - ______, - ______}, - /*0x7f*/ {______, - ___O__, - __O___, - _OOOOO, - __O___, - ___O__, - ______, - ______}, - /*0x80*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x81*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x82*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x83*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x84*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x85*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x86*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x87*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x88*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x89*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8a*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8b*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8c*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8d*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8e*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8f*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x90*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x91*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x92*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x93*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x94*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x95*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x96*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x97*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x98*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x99*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9a*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9b*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9c*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9d*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9e*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9f*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xaa*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xab*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xac*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xad*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xae*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xaf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb0*/ {__OOO_, - __O_O_, - __OOO_, - ______, - ______, - ______, - ______, - ______}, - /*0xb1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xba*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbe*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xca*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xcb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xcc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xcd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xce*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xcf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xda*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xdb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xdc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xdd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xde*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xdf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe1*/ {__O_O_, - ______, - __OOO_, - _____O, - __OOOO, - _O___O, - __OOOO, - ______}, - /*0xe2*/ {__OOO_, - _O___O, - _OOOO_, - _O___O, - _O___O, - _O_OO_, - _O____, - ______}, - /*0xe3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xea*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xeb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xec*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xed*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xee*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xef*/ {__O_O_, - ______, - __OOO_, - _O___O, - _O___O, - _O___O, - __OOO_, - ______}, - /*0xf0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf5*/ {__O_O_, - ______, - _O___O, - _O___O, - _O___O, - _O__OO, - __OO_O, - ______}, - /*0xf6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfa*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfe*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xff*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______} -}; + /*0x0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x10*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x11*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x12*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x13*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x14*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x15*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x16*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x17*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x18*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x19*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1a*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1b*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1c*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1d*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1e*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1f*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x20*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x21*/ {___O__, ___O__, ___O__, ___O__, ______, ______, ___O__, ______}, + /*0x22*/ {__O_O_, __O_O_, __O_O_, ______, ______, ______, ______, ______}, + /*0x23*/ {__O_O_, __O_O_, _OOOOO, __O_O_, _OOOOO, __O_O_, __O_O_, ______}, + /*0x24*/ {___O__, __OOOO, _O_O__, __OOO_, ___O_O, _OOOO_, ___O__, ______}, + /*0x25*/ {_OO___, _OO__O, ____O_, ___O__, __O___, _O__OO, ____OO, ______}, + /*0x26*/ {__OO__, _O__O_, _O_O__, __O___, _O_O_O, _O__O_, __OO_O, ______}, + /*0x27*/ {__OO__, ___O__, __O___, ______, ______, ______, ______, ______}, + /*0x28*/ {____O_, ___O__, __O___, __O___, __O___, ___O__, ____O_, ______}, + /*0x29*/ {__O___, ___O__, ____O_, ____O_, ____O_, ___O__, __O___, ______}, + /*0x2a*/ {______, ___O__, _O_O_O, __OOO_, _O_O_O, ___O__, ______, ______}, + /*0x2b*/ {______, ___O__, ___O__, _OOOOO, ___O__, ___O__, ______, ______}, + /*0x2c*/ {______, ______, ______, ______, __OO__, ___O__, __O___, ______}, + /*0x2d*/ {______, ______, ______, _OOOOO, ______, ______, ______, ______}, + /*0x2e*/ {______, ______, ______, ______, ______, __OO__, __OO__, ______}, + /*0x2f*/ {______, _____O, ____O_, ___O__, __O___, _O____, ______, ______}, + /*0x30*/ {__OOO_, _O___O, _O__OO, _O_O_O, _OO__O, _O___O, __OOO_, ______}, + /*0x31*/ {___O__, __OO__, ___O__, ___O__, ___O__, ___O__, __OOO_, ______}, + /*0x32*/ {__OOO_, _O___O, _____O, ____O_, ___O__, __O___, _OOOOO, ______}, + /*0x33*/ {_OOOOO, ____O_, ___O__, ____O_, _____O, _O___O, __OOO_, ______}, + /*0x34*/ {____O_, ___OO_, __O_O_, _O__O_, _OOOOO, ____O_, ____O_, ______}, + /*0x35*/ {_OOOOO, _O____, _O____, _OOOO_, _____O, _O___O, __OOO_, ______}, + /*0x36*/ {___OO_, __O___, _O____, _OOOO_, _O___O, _O___O, __OOO_, ______}, + /*0x37*/ {_OOOOO, _____O, ____O_, ___O__, __O___, __O___, __O___, ______}, + /*0x38*/ {__OOO_, _O___O, _O___O, __OOO_, _O___O, _O___O, __OOO_, ______}, + /*0x39*/ {__OOO_, _O___O, _O___O, __OOOO, _____O, ____O_, __OO__, ______}, + /*0x3a*/ {______, __OO__, __OO__, ______, __OO__, __OO__, ______, ______}, + /*0x3b*/ {______, __OO__, __OO__, ______, __OO__, ___O__, __O___, ______}, + /*0x3c*/ {____O_, ___O__, __O___, _O____, __O___, ___O__, ____O_, ______}, + /*0x3d*/ {______, ______, _OOOOO, ______, _OOOOO, ______, ______, ______}, + /*0x3e*/ {_O____, __O___, ___O__, ____O_, ___O__, __O___, _O____, ______}, + /*0x3f*/ {__OOO_, _O___O, _____O, ____O_, ___O__, ______, ___O__, ______}, + /*0x40*/ {__OOO_, _O___O, _____O, __OO_O, _O_O_O, _O_O_O, __OOO_, ______}, + /*0x41*/ {__OOO_, _O___O, _O___O, _O___O, _OOOOO, _O___O, _O___O, ______}, + /*0x42*/ {_OOOO_, _O___O, _O___O, _OOOO_, _O___O, _O___O, _OOOO_, ______}, + /*0x43*/ {__OOO_, _O___O, _O____, _O____, _O____, _O___O, __OOO_, ______}, + /*0x44*/ {_OOO__, _O__O_, _O___O, _O___O, _O___O, _O__O_, _OOO__, ______}, + /*0x45*/ {_OOOOO, _O____, _O____, _OOOO_, _O____, _O____, _OOOOO, ______}, + /*0x46*/ {_OOOOO, _O____, _O____, _OOOO_, _O____, _O____, _O____, ______}, + /*0x47*/ {__OOO_, _O___O, _O____, _O_OOO, _O___O, _O___O, __OOOO, ______}, + /*0x48*/ {_O___O, _O___O, _O___O, _OOOOO, _O___O, _O___O, _O___O, ______}, + /*0x49*/ {__OOO_, ___O__, ___O__, ___O__, ___O__, ___O__, __OOO_, ______}, + /*0x4a*/ {___OOO, ____O_, ____O_, ____O_, ____O_, _O__O_, __OO__, ______}, + /*0x4b*/ {_O___O, _O__O_, _O_O__, _OO___, _O_O__, _O__O_, _O___O, ______}, + /*0x4c*/ {_O____, _O____, _O____, _O____, _O____, _O____, _OOOOO, ______}, + /*0x4d*/ {_O___O, _OO_OO, _O_O_O, _O_O_O, _O___O, _O___O, _O___O, ______}, + /*0x4e*/ {_O___O, _O___O, _OO__O, _O_O_O, _O__OO, _O___O, _O___O, ______}, + /*0x4f*/ {__OOO_, _O___O, _O___O, _O___O, _O___O, _O___O, __OOO_, ______}, + /*0x50*/ {_OOOO_, _O___O, _O___O, _OOOO_, _O____, _O____, _O____, ______}, + /*0x51*/ {__OOO_, _O___O, _O___O, _O___O, _O_O_O, _O__O_, __OO_O, ______}, + /*0x52*/ {_OOOO_, _O___O, _O___O, _OOOO_, _O_O__, _O__O_, _O___O, ______}, + /*0x53*/ {__OOOO, _O____, _O____, __OOO_, _____O, _____O, _OOOO_, ______}, + /*0x54*/ {_OOOOO, ___O__, ___O__, ___O__, ___O__, ___O__, ___O__, ______}, + /*0x55*/ {_O___O, _O___O, _O___O, _O___O, _O___O, _O___O, __OOO_, ______}, + /*0x56*/ {_O___O, _O___O, _O___O, _O___O, _O___O, __O_O_, ___O__, ______}, + /*0x57*/ {_O___O, _O___O, _O___O, _O_O_O, _O_O_O, _O_O_O, __O_O_, ______}, + /*0x58*/ {_O___O, _O___O, __O_O_, ___O__, __O_O_, _O___O, _O___O, ______}, + /*0x59*/ {_O___O, _O___O, _O___O, __O_O_, ___O__, ___O__, ___O__, ______}, + /*0x5a*/ {_OOOOO, _____O, ____O_, ___O__, __O___, _O____, _OOOOO, ______}, + /*0x5b*/ {__OOO_, __O___, __O___, __O___, __O___, __O___, __OOO_, ______}, + /*0x5c*/ {_O___O, __O_O_, _OOOOO, ___O__, _OOOOO, ___O__, ___O__, ______}, + /*0x5d*/ {__OOO_, ____O_, ____O_, ____O_, ____O_, ____O_, __OOO_, ______}, + /*0x5e*/ {___O__, __O_O_, _O___O, ______, ______, ______, ______, ______}, + /*0x5f*/ {______, ______, ______, ______, ______, ______, _OOOOO, ______}, + /*0x60*/ {__O___, ___O__, ____O_, ______, ______, ______, ______, ______}, + /*0x61*/ {______, ______, __OOO_, _____O, __OOOO, _O___O, __OOOO, ______}, + /*0x62*/ {_O____, _O____, _O_OO_, _OO__O, _O___O, _O___O, _OOOO_, ______}, + /*0x63*/ {______, ______, __OOO_, _O____, _O____, _O___O, __OOO_, ______}, + /*0x64*/ {_____O, _____O, __OO_O, _O__OO, _O___O, _O___O, __OOOO, ______}, + /*0x65*/ {______, ______, __OOO_, _O___O, _OOOOO, _O____, __OOO_, ______}, + /*0x66*/ {___OO_, __O__O, __O___, _OOO__, __O___, __O___, __O___, ______}, + /*0x67*/ {______, ______, __OOOO, _O___O, _O___O, __OOOO, _____O, __OOO_}, + /*0x68*/ {_O____, _O____, _O_OO_, _OO__O, _O___O, _O___O, _O___O, ______}, + /*0x69*/ {___O__, ______, __OO__, ___O__, ___O__, ___O__, __OOO_, ______}, + /*0x6a*/ {____O_, ______, ___OO_, ____O_, ____O_, _O__O_, __OO__, ______}, + /*0x6b*/ {__O___, __O___, __O__O, __O_O_, __OO__, __O_O_, __O__O, ______}, + /*0x6c*/ {__OO__, ___O__, ___O__, ___O__, ___O__, ___O__, __OOO_, ______}, + /*0x6d*/ {______, ______, _OO_O_, _O_O_O, _O_O_O, _O___O, _O___O, ______}, + /*0x6e*/ {______, ______, _OOOO_, _O___O, _O___O, _O___O, _O___O, ______}, + /*0x6f*/ {______, ______, __OOO_, _O___O, _O___O, _O___O, __OOO_, ______}, + /*0x70*/ {______, ______, _OOOO_, _O___O, _O___O, _OOOO_, _O____, _O____}, + /*0x71*/ {______, ______, __OO_O, _O__OO, _O___O, __OOOO, _____O, _____O}, + /*0x72*/ {______, ______, _O_OO_, _OO__O, _O____, _O____, _O____, ______}, + /*0x73*/ {______, ______, __OOO_, _O____, __OOO_, _____O, _OOOO_, ______}, + /*0x74*/ {__O___, __O___, _OOO__, __O___, __O___, __O__O, ___OO_, ______}, + /*0x75*/ {______, ______, _O___O, _O___O, _O___O, _O__OO, __OO_O, ______}, + /*0x76*/ {______, ______, _O___O, _O___O, _O___O, __O_O_, ___O__, ______}, + /*0x77*/ {______, ______, _O___O, _O___O, _O___O, _O_O_O, __O_O_, ______}, + /*0x78*/ {______, ______, _O___O, __O_O_, ___O__, __O_O_, _O___O, ______}, + /*0x79*/ {______, ______, _O___O, _O___O, __OOOO, _____O, __OOO_, ______}, + /*0x7a*/ {______, ______, _OOOOO, ____O_, ___O__, __O___, _OOOOO, ______}, + /*0x7b*/ {____O_, ___O__, ___O__, __O___, ___O__, ___O__, ____O_, ______}, + /*0x7c*/ {___O__, ___O__, ___O__, ___O__, ___O__, ___O__, ___O__, ______}, + /*0x7d*/ {__O___, ___O__, ___O__, ____O_, ___O__, ___O__, __O___, ______}, + /*0x7e*/ {______, ___O__, ____O_, _OOOOO, ____O_, ___O__, ______, ______}, + /*0x7f*/ {______, ___O__, __O___, _OOOOO, __O___, ___O__, ______, ______}, + /*0x80*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x81*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x82*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x83*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x84*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x85*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x86*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x87*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x88*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x89*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8a*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8b*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8c*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8d*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8e*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8f*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x90*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x91*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x92*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x93*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x94*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x95*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x96*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x97*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x98*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x99*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9a*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9b*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9c*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9d*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9e*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9f*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xaa*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xab*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xac*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xad*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xae*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xaf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb0*/ {__OOO_, __O_O_, __OOO_, ______, ______, ______, ______, ______}, + /*0xb1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xba*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbe*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xca*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xcb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xcc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xcd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xce*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xcf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xda*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xdb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xdc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xdd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xde*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xdf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe1*/ {__O_O_, ______, __OOO_, _____O, __OOOO, _O___O, __OOOO, ______}, + /*0xe2*/ {__OOO_, _O___O, _OOOO_, _O___O, _O___O, _O_OO_, _O____, ______}, + /*0xe3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xea*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xeb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xec*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xed*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xee*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xef*/ {__O_O_, ______, __OOO_, _O___O, _O___O, _O___O, __OOO_, ______}, + /*0xf0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf5*/ {__O_O_, ______, _O___O, _O___O, _O___O, _O__OO, __OO_O, ______}, + /*0xf6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfa*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfe*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xff*/ {______, ______, ______, ______, ______, ______, ______, ______}}; diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Font_6x8_bold.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/Font_6x8_bold.cpp old mode 100755 new mode 100644 index 468b27ecf..e5cd8f5ba --- a/libvisual-plugins/plugins/actor/lcdcontrol/Font_6x8_bold.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Font_6x8_bold.cpp @@ -24,2052 +24,259 @@ #include "Font_6x8.h" int Font_6x8_bold[256][8] = { - /*0x0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x10*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x11*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x12*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x13*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x14*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x15*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x16*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x17*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x18*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x19*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1a*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1b*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1c*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1d*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1e*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x1f*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x20*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x21*/ {__OO__, - __OO__, - __OO__, - __OO__, - ______, - ______, - __OO__, - ______}, - /*0x22*/ {_OO_OO, - _OO_OO, - _OO_OO, - ______, - ______, - ______, - ______, - ______}, - /*0x23*/ {__O_O_, - __O_O_, - _OOOOO, - __O_O_, - _OOOOO, - __O_O_, - __O_O_, - ______}, - /*0x24*/ {___O__, - __OOOO, - _O_O__, - __OOO_, - ___O_O, - _OOOO_, - ___O__, - ______}, - /*0x25*/ {_OO___, - _OO_OO, - ___OO_, - __OO__, - _OO___, - OO__OO, - ____OO, - ______}, - /*0x26*/ {__OO__, - _OO_OO, - _OO_OO, - __OO__, - _OOO_O, - _OO_OO, - __OO_O, - ______}, - /*0x27*/ {__OO__, - __OO__, - _OO___, - ______, - ______, - ______, - ______, - ______}, - /*0x28*/ {___OO_, - __OO__, - _OO___, - _OO___, - _OO___, - __OO__, - ___OO_, - ______}, - /*0x29*/ {_OO___, - __OO__, - ___OO_, - ___OO_, - ___OO_, - __OO__, - _OO___, - ______}, - /*0x2a*/ {______, - ___O__, - _O_O_O, - __OOO_, - _O_O_O, - ___O__, - ______, - ______}, - /*0x2b*/ {______, - __OO__, - __OO__, - _OOOO_, - __OO__, - __OO__, - ______, - ______}, - /*0x2c*/ {______, - ______, - ______, - ______, - ___OO_, - ___OO_, - __OO__, - ______}, - /*0x2d*/ {______, - ______, - ______, - _OOOOO, - ______, - ______, - ______, - ______}, - /*0x2e*/ {______, - ______, - ______, - ______, - ______, - __OO__, - __OO__, - ______}, - /*0x2f*/ {______, - ____OO, - ___OO_, - __OO__, - _OO___, - OO____, - ______, - ______}, - /*0x30*/ {__OOO_, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - __OOO_, - ______}, - /*0x31*/ {___OO_, - __OOO_, - ___OO_, - ___OO_, - ___OO_, - ___OO_, - __OOOO, - ______}, - /*0x32*/ {__OOO_, - _OO_OO, - ____OO, - ___OO_, - __OO__, - _OO___, - _OOOOO, - ______}, - /*0x33*/ {_OOOOO, - ____OO, - ___OO_, - ____OO, - ____OO, - _OO_OO, - __OOO_, - ______}, - /*0x34*/ {____OO, - ___OO_, - __OO__, - _OO_OO, - _OOOOO, - ____OO, - ____OO, - ______}, - /*0x35*/ {_OOOOO, - _OO___, - _OO___, - _OOOO_, - ____OO, - _OO_OO, - __OOO_, - ______}, - /*0x36*/ {___OO_, - __OO__, - _OO___, - _OOOO_, - _OO_OO, - _OO_OO, - __OOO_, - ______}, - /*0x37*/ {_OOOOO, - ____OO, - ___OO_, - __OO__, - __OO__, - __OO__, - __OO__, - ______}, - /*0x38*/ {__OOO_, - _OO_OO, - _OO_OO, - __OOO_, - _OO_OO, - _OO_OO, - __OOO_, - ______}, - /*0x39*/ {__OOO_, - _OO_OO, - _OO_OO, - __OOOO, - ____OO, - ___OO_, - _OOO__, - ______}, - /*0x3a*/ {______, - __OO__, - __OO__, - ______, - __OO__, - __OO__, - ______, - ______}, - /*0x3b*/ {______, - __OO__, - __OO__, - ______, - __OO__, - __OO__, - _OO___, - ______}, - /*0x3c*/ {____OO, - ___OO_, - __OO__, - _OO___, - __OO__, - ___OO_, - ____OO, - ______}, - /*0x3d*/ {______, - ______, - _OOOOO, - ______, - _OOOOO, - ______, - ______, - ______}, - /*0x3e*/ {_OO___, - __OO__, - ___OO_, - ____OO, - ___OO_, - __OO__, - _OO___, - ______}, - /*0x3f*/ {__OOO_, - _OO_OO, - ____OO, - ___OO_, - __OO__, - ______, - __OO__, - ______}, - /*0x40*/ {__OOO_, - _OO_OO, - ____OO, - __O_OO, - _OO_OO, - _OO_OO, - __OOO_, - ______}, - /*0x41*/ {__OOO_, - _OO_OO, - _OO_OO, - _OO_OO, - _OOOOO, - _OO_OO, - _OO_OO, - ______}, - /*0x42*/ {_OOOO_, - _OO_OO, - _OO_OO, - _OOOO_, - _OO_OO, - _OO_OO, - _OOOO_, - ______}, - /*0x43*/ {__OOO_, - _OO_OO, - _OO___, - _OO___, - _OO___, - _OO_OO, - __OOO_, - ______}, - /*0x44*/ {_OOO__, - _OOOO_, - _OO_OO, - _OO_OO, - _OO_OO, - _OOOO_, - _OOO__, - ______}, - /*0x45*/ {_OOOOO, - _OO___, - _OO___, - _OOOO_, - _OO___, - _OO___, - _OOOOO, - ______}, - /*0x46*/ {_OOOOO, - _OO___, - _OO___, - _OOOO_, - _OO___, - _OO___, - _OO___, - ______}, - /*0x47*/ {__OOO_, - _OO_OO, - _OO___, - _OO_OO, - _OO_OO, - _OO_OO, - __OOOO, - ______}, - /*0x48*/ {_OO_OO, - _OO_OO, - _OO_OO, - _OOOOO, - _OO_OO, - _OO_OO, - _OO_OO, - ______}, - /*0x49*/ {_OOOO_, - __OO__, - __OO__, - __OO__, - __OO__, - __OO__, - _OOOO_, - ______}, - /*0x4a*/ {___OOO, - ____OO, - ____OO, - ____OO, - ____OO, - _OO_OO, - __OOO_, - ______}, - /*0x4b*/ {_OO_OO, - _OO_OO, - _OOOO_, - _OOO__, - _OOOO_, - _OO_OO, - _OO_OO, - ______}, - /*0x4c*/ {_OO___, - _OO___, - _OO___, - _OO___, - _OO___, - _OO___, - _OOOOO, - ______}, - /*0x4d*/ {_O___O, - _OO_OO, - _OOOOO, - _OOOOO, - _OO_OO, - _OO_OO, - _OO_OO, - ______}, - /*0x4e*/ {_O__OO, - _OO_OO, - _OO_OO, - _OOOOO, - _OO_OO, - _OO_OO, - _OO__O, - ______}, - /*0x4f*/ {__OOO_, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - __OOO_, - ______}, - /*0x50*/ {_OOOO_, - _OO_OO, - _OO_OO, - _OOOO_, - _OO___, - _OO___, - _OO___, - ______}, - /*0x51*/ {__OOO_, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_O_, - _OO_OO, - __OO_O, - ______}, - /*0x52*/ {_OOOO_, - _OO_OO, - _OO_OO, - _OOOO_, - _OOOO_, - _OO_OO, - _OO_OO, - ______}, - /*0x53*/ {__OOOO, - _OO___, - _OO___, - __OOO_, - ____OO, - ____OO, - _OOOO_, - ______}, - /*0x54*/ {OOOOOO, - __OO__, - __OO__, - __OO__, - __OO__, - __OO__, - __OO__, - ______}, - /*0x55*/ {_OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - __OOO_, - ______}, - /*0x56*/ {_OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - __OOO_, - ___O__, - ______}, - /*0x57*/ {_OO_OO, - _OO_OO, - _OO_OO, - _OOOOO, - _OOOOO, - _OO_OO, - _O___O, - ______}, - /*0x58*/ {_OO_OO, - _OO_OO, - _OO_OO, - __OOO_, - _OO_OO, - _OO_OO, - _OO_OO, - ______}, - /*0x59*/ {_OO_OO, - _OO_OO, - _OO_OO, - __O_OO, - ___OOO, - ___OO_, - _OOO__, - ______}, - /*0x5a*/ {_OOOOO, - ____OO, - ___OO_, - __OOO_, - __OO__, - _OO___, - _OOOOO, - ______}, - /*0x5b*/ {_OOOO_, - _OO___, - _OO___, - _OO___, - _OO___, - _OO___, - _OOOO_, - ______}, - /*0x5c*/ {_O___O, - __O_O_, - _OOOOO, - ___O__, - _OOOOO, - ___O__, - ___O__, - ______}, - /*0x5d*/ {__OOOO, - ____OO, - ____OO, - ____OO, - ____OO, - ____OO, - __OOOO, - ______}, - /*0x5e*/ {___O__, - __OOO_, - _OO_OO, - ______, - ______, - ______, - ______, - ______}, - /*0x5f*/ {______, - ______, - ______, - ______, - ______, - ______, - _OOOOO, - ______}, - /*0x60*/ {_OO___, - __OO__, - ___OO_, - ______, - ______, - ______, - ______, - ______}, - /*0x61*/ {______, - ______, - __OOO_, - ____OO, - __OOOO, - _OO_OO, - __OOOO, - ______}, - /*0x62*/ {_OO___, - _OO___, - _OOOO_, - _OO_OO, - _OO_OO, - _OO_OO, - _OOOO_, - ______}, - /*0x63*/ {______, - ______, - __OOO_, - _OO_OO, - _OO___, - _OO_OO, - __OOO_, - ______}, - /*0x64*/ {____OO, - ____OO, - __OOOO, - _OO_OO, - _OO_OO, - _OO_OO, - __OOOO, - ______}, - /*0x65*/ {______, - ______, - __OOO_, - _OO_OO, - _OOOOO, - _OO___, - __OOO_, - ______}, - /*0x66*/ {___OOO, - __OO__, - __OO__, - _OOOO_, - __OO__, - __OO__, - __OO__, - ______}, - /*0x67*/ {______, - ______, - __OOOO, - _OO_OO, - _OO_OO, - __OOOO, - ____OO, - __OOO_}, - /*0x68*/ {_OO___, - _OO___, - _OOOO_, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - ______}, - /*0x69*/ {__OO__, - ______, - _OOO__, - __OO__, - __OO__, - __OO__, - _OOOO_, - ______}, - /*0x6a*/ {____OO, - ______, - ___OOO, - ____OO, - ____OO, - _OO_OO, - __OOO_, - ______}, - /*0x6b*/ {_OO___, - _OO___, - _OO_OO, - _OO_OO, - _OOOO_, - _OO_OO, - _OO_OO, - ______}, - /*0x6c*/ {_OOO__, - __OO__, - __OO__, - __OO__, - __OO__, - __OO__, - _OOOO_, - ______}, - /*0x6d*/ {______, - ______, - _OO_O_, - _OOOOO, - _OOOOO, - _OO_OO, - _OO_OO, - ______}, - /*0x6e*/ {______, - ______, - _OOOO_, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - ______}, - /*0x6f*/ {______, - ______, - __OOO_, - _OO_OO, - _OO_OO, - _OO_OO, - __OOO_, - ______}, - /*0x70*/ {______, - ______, - _OOOO_, - _OO_OO, - _OO_OO, - _OOOO_, - _OO___, - _OO___}, - /*0x71*/ {______, - ______, - __OOOO, - _OO_OO, - _OO_OO, - __OOOO, - ____OO, - ____OO}, - /*0x72*/ {______, - ______, - _OO_OO, - _OOOO_, - _OO___, - _OO___, - _OO___, - ______}, - /*0x73*/ {______, - ______, - __OOOO, - _OO___, - __OOO_, - ____OO, - _OOOO_, - ______}, - /*0x74*/ {__OO__, - __OO__, - _OOOO_, - __OO__, - __OO__, - __OO__, - ___OO_, - ______}, - /*0x75*/ {______, - ______, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - __OOOO, - ______}, - /*0x76*/ {______, - ______, - _OO_OO, - _OO_OO, - _OO_OO, - __OOO_, - ___O__, - ______}, - /*0x77*/ {______, - ______, - _OO_OO, - _OO_OO, - _OOOOO, - _OO_OO, - _O___O, - ______}, - /*0x78*/ {______, - ______, - _OO_OO, - _OO_OO, - __OOO_, - _OO_OO, - _OO_OO, - ______}, - /*0x79*/ {______, - ______, - _OO_OO, - _OO_OO, - __OOOO, - ____OO, - __OOO_, - ______}, - /*0x7a*/ {______, - ______, - _OOOOO, - ___OO_, - __OO__, - _OO___, - _OOOOO, - ______}, - /*0x7b*/ {___OO_, - __OO__, - __OO__, - _OO___, - __OO__, - __OO__, - ___OO_, - ______}, - /*0x7c*/ {__OO__, - __OO__, - __OO__, - __OO__, - __OO__, - __OO__, - __OO__, - ______}, - /*0x7d*/ {__OO__, - ___OO_, - ___OO_, - ____OO, - ___OO_, - ___OO_, - __OO__, - ______}, - /*0x7e*/ {______, - __OO__, - ___OO_, - _OOOOO, - ___OO_, - __OO__, - ______, - ______}, - /*0x7f*/ {______, - ___OO_, - __OO__, - _OOOOO, - __OO__, - ___OO_, - ______, - ______}, - /*0x80*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x81*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x82*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x83*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x84*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x85*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x86*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x87*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x88*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x89*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8a*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8b*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8c*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8d*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8e*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x8f*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x90*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x91*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x92*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x93*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x94*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x95*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x96*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x97*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x98*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x99*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9a*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9b*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9c*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9d*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9e*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0x9f*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xa9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xaa*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xab*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xac*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xad*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xae*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xaf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb0*/ {_OOOOO, - _OO_OO, - _OOOOO, - ______, - ______, - ______, - ______, - ______}, - /*0xb1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xb9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xba*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbe*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xbf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xc9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xca*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xcb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xcc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xcd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xce*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xcf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xd9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xda*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xdb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xdc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xdd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xde*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xdf*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe1*/ {_OO_OO, - ______, - __OOO_, - ____OO, - __OOOO, - _OO_OO, - __OOOO, - ______}, - /*0xe2*/ {__OOO_, - _OO_OO, - _OOOO_, - _OO_OO, - _OO_OO, - _OOOO_, - _OO___, - ______}, - /*0xe3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe5*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xe9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xea*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xeb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xec*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xed*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xee*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xef*/ {_OO_OO, - ______, - __OOO_, - _OO_OO, - _OO_OO, - _OO_OO, - __OOO_, - ______}, - /*0xf0*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf1*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf2*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf3*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf4*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf5*/ {_OO_OO, - ______, - _OO_OO, - _OO_OO, - _OO_OO, - _OO_OO, - __OOOO, - ______}, - /*0xf6*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf7*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf8*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xf9*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfa*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfb*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfc*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfd*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xfe*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______}, - /*0xff*/ {______, - ______, - ______, - ______, - ______, - ______, - ______, - ______} -}; + /*0x0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x10*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x11*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x12*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x13*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x14*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x15*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x16*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x17*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x18*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x19*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1a*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1b*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1c*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1d*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1e*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x1f*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x20*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x21*/ {__OO__, __OO__, __OO__, __OO__, ______, ______, __OO__, ______}, + /*0x22*/ {_OO_OO, _OO_OO, _OO_OO, ______, ______, ______, ______, ______}, + /*0x23*/ {__O_O_, __O_O_, _OOOOO, __O_O_, _OOOOO, __O_O_, __O_O_, ______}, + /*0x24*/ {___O__, __OOOO, _O_O__, __OOO_, ___O_O, _OOOO_, ___O__, ______}, + /*0x25*/ {_OO___, _OO_OO, ___OO_, __OO__, _OO___, OO__OO, ____OO, ______}, + /*0x26*/ {__OO__, _OO_OO, _OO_OO, __OO__, _OOO_O, _OO_OO, __OO_O, ______}, + /*0x27*/ {__OO__, __OO__, _OO___, ______, ______, ______, ______, ______}, + /*0x28*/ {___OO_, __OO__, _OO___, _OO___, _OO___, __OO__, ___OO_, ______}, + /*0x29*/ {_OO___, __OO__, ___OO_, ___OO_, ___OO_, __OO__, _OO___, ______}, + /*0x2a*/ {______, ___O__, _O_O_O, __OOO_, _O_O_O, ___O__, ______, ______}, + /*0x2b*/ {______, __OO__, __OO__, _OOOO_, __OO__, __OO__, ______, ______}, + /*0x2c*/ {______, ______, ______, ______, ___OO_, ___OO_, __OO__, ______}, + /*0x2d*/ {______, ______, ______, _OOOOO, ______, ______, ______, ______}, + /*0x2e*/ {______, ______, ______, ______, ______, __OO__, __OO__, ______}, + /*0x2f*/ {______, ____OO, ___OO_, __OO__, _OO___, OO____, ______, ______}, + /*0x30*/ {__OOO_, _OO_OO, _OO_OO, _OO_OO, _OO_OO, _OO_OO, __OOO_, ______}, + /*0x31*/ {___OO_, __OOO_, ___OO_, ___OO_, ___OO_, ___OO_, __OOOO, ______}, + /*0x32*/ {__OOO_, _OO_OO, ____OO, ___OO_, __OO__, _OO___, _OOOOO, ______}, + /*0x33*/ {_OOOOO, ____OO, ___OO_, ____OO, ____OO, _OO_OO, __OOO_, ______}, + /*0x34*/ {____OO, ___OO_, __OO__, _OO_OO, _OOOOO, ____OO, ____OO, ______}, + /*0x35*/ {_OOOOO, _OO___, _OO___, _OOOO_, ____OO, _OO_OO, __OOO_, ______}, + /*0x36*/ {___OO_, __OO__, _OO___, _OOOO_, _OO_OO, _OO_OO, __OOO_, ______}, + /*0x37*/ {_OOOOO, ____OO, ___OO_, __OO__, __OO__, __OO__, __OO__, ______}, + /*0x38*/ {__OOO_, _OO_OO, _OO_OO, __OOO_, _OO_OO, _OO_OO, __OOO_, ______}, + /*0x39*/ {__OOO_, _OO_OO, _OO_OO, __OOOO, ____OO, ___OO_, _OOO__, ______}, + /*0x3a*/ {______, __OO__, __OO__, ______, __OO__, __OO__, ______, ______}, + /*0x3b*/ {______, __OO__, __OO__, ______, __OO__, __OO__, _OO___, ______}, + /*0x3c*/ {____OO, ___OO_, __OO__, _OO___, __OO__, ___OO_, ____OO, ______}, + /*0x3d*/ {______, ______, _OOOOO, ______, _OOOOO, ______, ______, ______}, + /*0x3e*/ {_OO___, __OO__, ___OO_, ____OO, ___OO_, __OO__, _OO___, ______}, + /*0x3f*/ {__OOO_, _OO_OO, ____OO, ___OO_, __OO__, ______, __OO__, ______}, + /*0x40*/ {__OOO_, _OO_OO, ____OO, __O_OO, _OO_OO, _OO_OO, __OOO_, ______}, + /*0x41*/ {__OOO_, _OO_OO, _OO_OO, _OO_OO, _OOOOO, _OO_OO, _OO_OO, ______}, + /*0x42*/ {_OOOO_, _OO_OO, _OO_OO, _OOOO_, _OO_OO, _OO_OO, _OOOO_, ______}, + /*0x43*/ {__OOO_, _OO_OO, _OO___, _OO___, _OO___, _OO_OO, __OOO_, ______}, + /*0x44*/ {_OOO__, _OOOO_, _OO_OO, _OO_OO, _OO_OO, _OOOO_, _OOO__, ______}, + /*0x45*/ {_OOOOO, _OO___, _OO___, _OOOO_, _OO___, _OO___, _OOOOO, ______}, + /*0x46*/ {_OOOOO, _OO___, _OO___, _OOOO_, _OO___, _OO___, _OO___, ______}, + /*0x47*/ {__OOO_, _OO_OO, _OO___, _OO_OO, _OO_OO, _OO_OO, __OOOO, ______}, + /*0x48*/ {_OO_OO, _OO_OO, _OO_OO, _OOOOO, _OO_OO, _OO_OO, _OO_OO, ______}, + /*0x49*/ {_OOOO_, __OO__, __OO__, __OO__, __OO__, __OO__, _OOOO_, ______}, + /*0x4a*/ {___OOO, ____OO, ____OO, ____OO, ____OO, _OO_OO, __OOO_, ______}, + /*0x4b*/ {_OO_OO, _OO_OO, _OOOO_, _OOO__, _OOOO_, _OO_OO, _OO_OO, ______}, + /*0x4c*/ {_OO___, _OO___, _OO___, _OO___, _OO___, _OO___, _OOOOO, ______}, + /*0x4d*/ {_O___O, _OO_OO, _OOOOO, _OOOOO, _OO_OO, _OO_OO, _OO_OO, ______}, + /*0x4e*/ {_O__OO, _OO_OO, _OO_OO, _OOOOO, _OO_OO, _OO_OO, _OO__O, ______}, + /*0x4f*/ {__OOO_, _OO_OO, _OO_OO, _OO_OO, _OO_OO, _OO_OO, __OOO_, ______}, + /*0x50*/ {_OOOO_, _OO_OO, _OO_OO, _OOOO_, _OO___, _OO___, _OO___, ______}, + /*0x51*/ {__OOO_, _OO_OO, _OO_OO, _OO_OO, _OO_O_, _OO_OO, __OO_O, ______}, + /*0x52*/ {_OOOO_, _OO_OO, _OO_OO, _OOOO_, _OOOO_, _OO_OO, _OO_OO, ______}, + /*0x53*/ {__OOOO, _OO___, _OO___, __OOO_, ____OO, ____OO, _OOOO_, ______}, + /*0x54*/ {OOOOOO, __OO__, __OO__, __OO__, __OO__, __OO__, __OO__, ______}, + /*0x55*/ {_OO_OO, _OO_OO, _OO_OO, _OO_OO, _OO_OO, _OO_OO, __OOO_, ______}, + /*0x56*/ {_OO_OO, _OO_OO, _OO_OO, _OO_OO, _OO_OO, __OOO_, ___O__, ______}, + /*0x57*/ {_OO_OO, _OO_OO, _OO_OO, _OOOOO, _OOOOO, _OO_OO, _O___O, ______}, + /*0x58*/ {_OO_OO, _OO_OO, _OO_OO, __OOO_, _OO_OO, _OO_OO, _OO_OO, ______}, + /*0x59*/ {_OO_OO, _OO_OO, _OO_OO, __O_OO, ___OOO, ___OO_, _OOO__, ______}, + /*0x5a*/ {_OOOOO, ____OO, ___OO_, __OOO_, __OO__, _OO___, _OOOOO, ______}, + /*0x5b*/ {_OOOO_, _OO___, _OO___, _OO___, _OO___, _OO___, _OOOO_, ______}, + /*0x5c*/ {_O___O, __O_O_, _OOOOO, ___O__, _OOOOO, ___O__, ___O__, ______}, + /*0x5d*/ {__OOOO, ____OO, ____OO, ____OO, ____OO, ____OO, __OOOO, ______}, + /*0x5e*/ {___O__, __OOO_, _OO_OO, ______, ______, ______, ______, ______}, + /*0x5f*/ {______, ______, ______, ______, ______, ______, _OOOOO, ______}, + /*0x60*/ {_OO___, __OO__, ___OO_, ______, ______, ______, ______, ______}, + /*0x61*/ {______, ______, __OOO_, ____OO, __OOOO, _OO_OO, __OOOO, ______}, + /*0x62*/ {_OO___, _OO___, _OOOO_, _OO_OO, _OO_OO, _OO_OO, _OOOO_, ______}, + /*0x63*/ {______, ______, __OOO_, _OO_OO, _OO___, _OO_OO, __OOO_, ______}, + /*0x64*/ {____OO, ____OO, __OOOO, _OO_OO, _OO_OO, _OO_OO, __OOOO, ______}, + /*0x65*/ {______, ______, __OOO_, _OO_OO, _OOOOO, _OO___, __OOO_, ______}, + /*0x66*/ {___OOO, __OO__, __OO__, _OOOO_, __OO__, __OO__, __OO__, ______}, + /*0x67*/ {______, ______, __OOOO, _OO_OO, _OO_OO, __OOOO, ____OO, __OOO_}, + /*0x68*/ {_OO___, _OO___, _OOOO_, _OO_OO, _OO_OO, _OO_OO, _OO_OO, ______}, + /*0x69*/ {__OO__, ______, _OOO__, __OO__, __OO__, __OO__, _OOOO_, ______}, + /*0x6a*/ {____OO, ______, ___OOO, ____OO, ____OO, _OO_OO, __OOO_, ______}, + /*0x6b*/ {_OO___, _OO___, _OO_OO, _OO_OO, _OOOO_, _OO_OO, _OO_OO, ______}, + /*0x6c*/ {_OOO__, __OO__, __OO__, __OO__, __OO__, __OO__, _OOOO_, ______}, + /*0x6d*/ {______, ______, _OO_O_, _OOOOO, _OOOOO, _OO_OO, _OO_OO, ______}, + /*0x6e*/ {______, ______, _OOOO_, _OO_OO, _OO_OO, _OO_OO, _OO_OO, ______}, + /*0x6f*/ {______, ______, __OOO_, _OO_OO, _OO_OO, _OO_OO, __OOO_, ______}, + /*0x70*/ {______, ______, _OOOO_, _OO_OO, _OO_OO, _OOOO_, _OO___, _OO___}, + /*0x71*/ {______, ______, __OOOO, _OO_OO, _OO_OO, __OOOO, ____OO, ____OO}, + /*0x72*/ {______, ______, _OO_OO, _OOOO_, _OO___, _OO___, _OO___, ______}, + /*0x73*/ {______, ______, __OOOO, _OO___, __OOO_, ____OO, _OOOO_, ______}, + /*0x74*/ {__OO__, __OO__, _OOOO_, __OO__, __OO__, __OO__, ___OO_, ______}, + /*0x75*/ {______, ______, _OO_OO, _OO_OO, _OO_OO, _OO_OO, __OOOO, ______}, + /*0x76*/ {______, ______, _OO_OO, _OO_OO, _OO_OO, __OOO_, ___O__, ______}, + /*0x77*/ {______, ______, _OO_OO, _OO_OO, _OOOOO, _OO_OO, _O___O, ______}, + /*0x78*/ {______, ______, _OO_OO, _OO_OO, __OOO_, _OO_OO, _OO_OO, ______}, + /*0x79*/ {______, ______, _OO_OO, _OO_OO, __OOOO, ____OO, __OOO_, ______}, + /*0x7a*/ {______, ______, _OOOOO, ___OO_, __OO__, _OO___, _OOOOO, ______}, + /*0x7b*/ {___OO_, __OO__, __OO__, _OO___, __OO__, __OO__, ___OO_, ______}, + /*0x7c*/ {__OO__, __OO__, __OO__, __OO__, __OO__, __OO__, __OO__, ______}, + /*0x7d*/ {__OO__, ___OO_, ___OO_, ____OO, ___OO_, ___OO_, __OO__, ______}, + /*0x7e*/ {______, __OO__, ___OO_, _OOOOO, ___OO_, __OO__, ______, ______}, + /*0x7f*/ {______, ___OO_, __OO__, _OOOOO, __OO__, ___OO_, ______, ______}, + /*0x80*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x81*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x82*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x83*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x84*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x85*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x86*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x87*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x88*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x89*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8a*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8b*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8c*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8d*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8e*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x8f*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x90*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x91*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x92*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x93*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x94*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x95*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x96*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x97*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x98*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x99*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9a*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9b*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9c*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9d*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9e*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0x9f*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xa9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xaa*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xab*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xac*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xad*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xae*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xaf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb0*/ {_OOOOO, _OO_OO, _OOOOO, ______, ______, ______, ______, ______}, + /*0xb1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xb9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xba*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbe*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xbf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xc9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xca*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xcb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xcc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xcd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xce*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xcf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xd9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xda*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xdb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xdc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xdd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xde*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xdf*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe1*/ {_OO_OO, ______, __OOO_, ____OO, __OOOO, _OO_OO, __OOOO, ______}, + /*0xe2*/ {__OOO_, _OO_OO, _OOOO_, _OO_OO, _OO_OO, _OOOO_, _OO___, ______}, + /*0xe3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe5*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xe9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xea*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xeb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xec*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xed*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xee*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xef*/ {_OO_OO, ______, __OOO_, _OO_OO, _OO_OO, _OO_OO, __OOO_, ______}, + /*0xf0*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf1*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf2*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf3*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf4*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf5*/ {_OO_OO, ______, _OO_OO, _OO_OO, _OO_OO, _OO_OO, __OOOO, ______}, + /*0xf6*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf7*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf8*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xf9*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfa*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfb*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfc*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfd*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xfe*/ {______, ______, ______, ______, ______, ______, ______, ______}, + /*0xff*/ {______, ______, ______, ______, ______, ______, ______, ______}}; diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Font_8x16.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/Font_8x16.cpp index 8ece74527..5389feda9 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Font_8x16.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Font_8x16.cpp @@ -22,164 +22,34 @@ #include "Font_8x16.h" int Font_8x16[10][16] = { - {_OOOOO__, - OOOOOOO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OOOOOOO_, - _OOOOO__, - ________}, - {_OO_____, - OOO_____, - OOO_____, - _OO_____, - _OO_____, - _OO_____, - _OO_____, - _OO_____, - _OO_____, - _OO_____, - _OO_____, - _OO_____, - _OO_____, - OOOO____, - OOOO____, - ________}, - {_OOOOO__, - OOOOOOO_, - OO___OO_, - _____OO_, - _____OO_, - _____OO_, - ___OOOO_, - _OOOOO__, - OOO_____, - OO______, - OO______, - OO______, - OO______, - OOOOOOO_, - OOOOOOO_, - ________}, - {_OOOOO__, - OOOOOOO_, - OO___OO_, - _____OO_, - _____OO_, - ____OOO_, - ___OOO__, - __OOO___, - ___OOO__, - ____OOO_, - _____OO_, - _____OO_, - OO___OO_, - OOOOOOO_, - _OOOOO__, - ________}, - {OO__OO__, - OO__OO__, - OO__OO__, - OO__OO__, - OO__OO__, - OO__OO__, - OO__OO__, - OOOOOOO_, - OOOOOOO_, - ____OO__, - ____OO__, - ____OO__, - ____OO__, - ____OO__, - ____OO__, - ________}, - {OOOOOOO_, - OOOOOOO_, - OO______, - OO______, - OO______, - OO______, - OOOOOO__, - _OOOOO__, - _____OO_, - _____OO_, - _____OO_, - _____OO_, - _____OO_, - OOOOOO__, - OOOOO___, - ________}, - {____OO__, - ___OO___, - __OO____, - _OO_____, - OO______, - OO______, - OOOOO___, - OOOOOO__, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OOOOOOO_, - _OOOOO__, - __OOO___, - ________}, - {OOOOOOO_, - OOOOOOO_, - _____OO_, - _____OO_, - _____OO_, - _____OO_, - ____OO__, - ___OO___, - __OO____, - __OO____, - __OO____, - __OO____, - __OO____, - __OO____, - __OO____, - ________}, - {_OOOOO__, - OOOOOOO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - _OOOOO__, - __OOO___, - _OOOOO__, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OOOOOOO_, - _OOOOO__, - ________}, - {__OOO___, - _OOOOO__, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OO___OO_, - OOOOOOO_, - _OOOOOO_, - _____OO_, - _____OO_, - ____OO__, - ___OOO__, - OOOOO___, - OOO_____, - ________}, + {_OOOOO__, OOOOOOO_, OO___OO_, OO___OO_, OO___OO_, OO___OO_, OO___OO_, + OO___OO_, OO___OO_, OO___OO_, OO___OO_, OO___OO_, OO___OO_, OOOOOOO_, + _OOOOO__, ________}, + {_OO_____, OOO_____, OOO_____, _OO_____, _OO_____, _OO_____, _OO_____, + _OO_____, _OO_____, _OO_____, _OO_____, _OO_____, _OO_____, OOOO____, + OOOO____, ________}, + {_OOOOO__, OOOOOOO_, OO___OO_, _____OO_, _____OO_, _____OO_, ___OOOO_, + _OOOOO__, OOO_____, OO______, OO______, OO______, OO______, OOOOOOO_, + OOOOOOO_, ________}, + {_OOOOO__, OOOOOOO_, OO___OO_, _____OO_, _____OO_, ____OOO_, ___OOO__, + __OOO___, ___OOO__, ____OOO_, _____OO_, _____OO_, OO___OO_, OOOOOOO_, + _OOOOO__, ________}, + {OO__OO__, OO__OO__, OO__OO__, OO__OO__, OO__OO__, OO__OO__, OO__OO__, + OOOOOOO_, OOOOOOO_, ____OO__, ____OO__, ____OO__, ____OO__, ____OO__, + ____OO__, ________}, + {OOOOOOO_, OOOOOOO_, OO______, OO______, OO______, OO______, OOOOOO__, + _OOOOO__, _____OO_, _____OO_, _____OO_, _____OO_, _____OO_, OOOOOO__, + OOOOO___, ________}, + {____OO__, ___OO___, __OO____, _OO_____, OO______, OO______, OOOOO___, + OOOOOO__, OO___OO_, OO___OO_, OO___OO_, OO___OO_, OOOOOOO_, _OOOOO__, + __OOO___, ________}, + {OOOOOOO_, OOOOOOO_, _____OO_, _____OO_, _____OO_, _____OO_, ____OO__, + ___OO___, __OO____, __OO____, __OO____, __OO____, __OO____, __OO____, + __OO____, ________}, + {_OOOOO__, OOOOOOO_, OO___OO_, OO___OO_, OO___OO_, OO___OO_, _OOOOO__, + __OOO___, _OOOOO__, OO___OO_, OO___OO_, OO___OO_, OO___OO_, OOOOOOO_, + _OOOOO__, ________}, + {__OOO___, _OOOOO__, OO___OO_, OO___OO_, OO___OO_, OO___OO_, OO___OO_, + OOOOOOO_, _OOOOOO_, _____OO_, _____OO_, ____OO__, ___OOO__, OOOOO___, + OOO_____, ________}, }; diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Generator.h b/libvisual-plugins/plugins/actor/lcdcontrol/Generator.h index d4f47fa23..b16213d30 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Generator.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Generator.h @@ -27,27 +27,32 @@ // idea borrowed from: "coroutines in C" Simon Tatham, // http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html -struct _generator -{ +struct _generator { int _line; - _generator():_line(0) {} + _generator() : _line(0) {} }; - #define test2 2 #define _generator(NAME) struct NAME : public _generator -#define _emit(T) bool operator()(T &_rv1, T &_rv2) { \ - switch(_line) { case 0:; - -#define _stop } _line = 0; return false; } - -#define _yield(V) \ - do {\ - _line=__LINE__;\ - _rv2 = _rv1;\ - _rv1 = (V); return true; case __LINE__:;\ - } while (0) +#define _emit(T) \ + bool operator()(T &_rv1, T &_rv2) { \ + switch (_line) { \ + case 0:; + +#define _stop \ + } \ + _line = 0; \ + return false; \ + } + +#define _yield(V) \ + do { \ + _line = __LINE__; \ + _rv2 = _rv1; \ + _rv1 = (V); \ + return true; \ + case __LINE__:; \ + } while (0) #endif - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/GenericSerial.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/GenericSerial.cpp index ae38abe5f..b47872251 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/GenericSerial.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/GenericSerial.cpp @@ -39,159 +39,161 @@ using namespace LCD; GenericSerial::GenericSerial(std::string device_name) { - device_name_ = device_name; - connected_ = false; - port_ = ""; - baud_ = 0; + device_name_ = device_name; + connected_ = false; + port_ = ""; + baud_ = 0; } int GenericSerial::SerialOpen(std::string port, int baud, int flags) { - struct termios portset; - - port_ = port; - - switch (baud) { - case 1200: - baud_ = B1200; - break; - case 2400: - baud_ = B2400; - break; - case 4800: - baud_ = B4800; - break; - case 9600: - baud_ = B9600; - break; - case 19200: - baud_ = B19200; - break; - case 38400: - baud_ = B38400; - break; - case 57600: - baud_ = B57600; - break; - case 115200: - baud_ = B115200; - break; + struct termios portset; + + port_ = port; + + switch (baud) { + case 1200: + baud_ = B1200; + break; + case 2400: + baud_ = B2400; + break; + case 4800: + baud_ = B4800; + break; + case 9600: + baud_ = B9600; + break; + case 19200: + baud_ = B19200; + break; + case 38400: + baud_ = B38400; + break; + case 57600: + baud_ = B57600; + break; + case 115200: + baud_ = B115200; + break; #ifdef B230400 - case 230400: - baud_ = B230400; - break; + case 230400: + baud_ = B230400; + break; #endif - default: - LCDError("%s: Serial: unsupported speed '%d'", device_name_.c_str(), baud); - return -1; - } - LCDError("Using port '%s' at %d baud", port.c_str(), baud); - fd_ = open(port.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK); - if( fd_ == -1 ) { - LCDError("%s: Open(%s) failed: %s", device_name_.c_str(), - port.c_str(), strerror(errno)); - return -1; - } - - if( tcgetattr(fd_, &portset) == -1) { - LCDError("%s: tcgetattr(%s) failed: %s", device_name_.c_str(), - port.c_str(), strerror(errno)); - return -1; - } - - //cfmakeraw(&portset); - //input modes - portset.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|INPCK|ISTRIP|INLCR|IGNCR|ICRNL - |IXON|IXOFF); - portset.c_iflag |= IGNPAR; - - //output modes - portset.c_oflag &= ~(OPOST|ONLCR|OCRNL|ONOCR|ONLRET|OFILL - |OFDEL|NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY); - - //control modes - portset.c_cflag &= ~(CSIZE|PARENB|PARODD|HUPCL|CRTSCTS); - portset.c_cflag |= CREAD|CS8|CSTOPB|CLOCAL; - portset.c_cflag |= flags; - - //local modes - portset.c_lflag &= ~(ISIG|ICANON|IEXTEN|ECHO); - portset.c_lflag |= NOFLSH; - - cfsetispeed(&portset, baud_); - cfsetospeed(&portset, baud_); - if(tcsetattr(fd_, TCSANOW, &portset) == -1 ) { - LCDError("%s: tcsetattr(%s) failed: %s", device_name_.c_str(), - port.c_str(), strerror(errno)); - return -1; - } - - connected_ = true; - return fd_; + default: + LCDError("%s: Serial: unsupported speed '%d'", device_name_.c_str(), baud); + return -1; + } + LCDError("Using port '%s' at %d baud", port.c_str(), baud); + fd_ = open(port.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK); + if (fd_ == -1) { + LCDError("%s: Open(%s) failed: %s", device_name_.c_str(), port.c_str(), + strerror(errno)); + return -1; + } + + if (tcgetattr(fd_, &portset) == -1) { + LCDError("%s: tcgetattr(%s) failed: %s", device_name_.c_str(), port.c_str(), + strerror(errno)); + return -1; + } + + // cfmakeraw(&portset); + // input modes + portset.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | INPCK | ISTRIP | INLCR | + IGNCR | ICRNL | IXON | IXOFF); + portset.c_iflag |= IGNPAR; + + // output modes + portset.c_oflag &= ~(OPOST | ONLCR | OCRNL | ONOCR | ONLRET | OFILL | OFDEL | + NLDLY | CRDLY | TABDLY | BSDLY | VTDLY | FFDLY); + + // control modes + portset.c_cflag &= ~(CSIZE | PARENB | PARODD | HUPCL | CRTSCTS); + portset.c_cflag |= CREAD | CS8 | CSTOPB | CLOCAL; + portset.c_cflag |= flags; + + // local modes + portset.c_lflag &= ~(ISIG | ICANON | IEXTEN | ECHO); + portset.c_lflag |= NOFLSH; + + cfsetispeed(&portset, baud_); + cfsetospeed(&portset, baud_); + if (tcsetattr(fd_, TCSANOW, &portset) == -1) { + LCDError("%s: tcsetattr(%s) failed: %s", device_name_.c_str(), port.c_str(), + strerror(errno)); + return -1; + } + + connected_ = true; + return fd_; } void GenericSerial::SerialClose() { - LCDInfo("%s: closing port %s", device_name_.c_str(), port_.c_str()); - close(fd_); - connected_ = false; + LCDInfo("%s: closing port %s", device_name_.c_str(), port_.c_str()); + close(fd_); + connected_ = false; } int GenericSerial::SerialPoll(unsigned char *string, int len) { - if(!connected_) - return -1; - char buff[len + 1]; - int ret = read(fd_, buff, len); - if( ret < 0 && errno != EAGAIN ) { - LCDError("%s: read(%s) failed: %s", device_name_.c_str(), port_.c_str(), strerror(errno)); - } - for(int i = 0; i < ret; i++ ) { - string[i] = buff[i]; - } - return ret; + if (!connected_) + return -1; + char buff[len + 1]; + int ret = read(fd_, buff, len); + if (ret < 0 && errno != EAGAIN) { + LCDError("%s: read(%s) failed: %s", device_name_.c_str(), port_.c_str(), + strerror(errno)); + } + for (int i = 0; i < ret; i++) { + string[i] = buff[i]; + } + return ret; } int GenericSerial::SerialReadData(unsigned char *string, int len) { - int run, ret; - for( run = 0; run < 16; run++) { - ret = SerialPoll(string, len); - if(ret >= 0 || errno != EAGAIN ) - break; - //LCDInfo("%s: read(%s): EAGAIN", device_name_.c_str(), port_.c_str()); - usleep(1000); - } -/* - if ( ret > 0 && ret != len && len > 0 ) { - LCDInfo("%s partial read(%s): len=%d ret=%d", device_name_.c_str(), - port_.c_str(), len, ret); - } -*/ - return ret; + int run, ret; + for (run = 0; run < 16; run++) { + ret = SerialPoll(string, len); + if (ret >= 0 || errno != EAGAIN) + break; + // LCDInfo("%s: read(%s): EAGAIN", device_name_.c_str(), port_.c_str()); + usleep(1000); + } + /* + if ( ret > 0 && ret != len && len > 0 ) { + LCDInfo("%s partial read(%s): len=%d ret=%d", device_name_.c_str(), + port_.c_str(), len, ret); + } + */ + return ret; } int GenericSerial::SerialWrite(unsigned char *string, int len) { - static int error = 0; - int run, ret; - - if(!connected_) - return -1; - - for(run = 0; run < 10; run++) { - ret = write(fd_, string, len); - if( ret >= 0 || errno != EAGAIN) - break; - if( run > 0 ) - LCDInfo("%s: write(%s): EAGAIN #%d",device_name_.c_str(),port_.c_str(),run); - usleep(1000); + static int error = 0; + int run, ret; + + if (!connected_) + return -1; + + for (run = 0; run < 10; run++) { + ret = write(fd_, string, len); + if (ret >= 0 || errno != EAGAIN) + break; + if (run > 0) + LCDInfo("%s: write(%s): EAGAIN #%d", device_name_.c_str(), port_.c_str(), + run); + usleep(1000); + } + + if (ret < 0) { + if (++error > 10) { + LCDError("%s: too many errors", device_name_.c_str()); } - - if( ret < 0 ) { - if(++error > 10) { - LCDError("%s: too many errors", device_name_.c_str()); - } - } else if ( ret != len) { - LCDInfo("%s: partial write(%s): len=%d ret=%d", device_name_.c_str(), - port_.c_str(), len, ret); - } else { - error = 0; - } - return ret; + } else if (ret != len) { + LCDInfo("%s: partial write(%s): len=%d ret=%d", device_name_.c_str(), + port_.c_str(), len, ret); + } else { + error = 0; + } + return ret; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/GenericSerial.h b/libvisual-plugins/plugins/actor/lcdcontrol/GenericSerial.h index b08aa4381..89667fc4a 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/GenericSerial.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/GenericSerial.h @@ -28,20 +28,21 @@ namespace LCD { class GenericSerial { - speed_t baud_; - std::string port_; - int fd_; - bool connected_; - std::string device_name_; - public: - GenericSerial(std::string name); - virtual ~GenericSerial() {} - int SerialOpen(std::string port, int baud, int flags = 0); - void SerialClose(); - int SerialPoll(unsigned char *str, int len); - int SerialReadData(unsigned char *str, int len); - int SerialWrite(unsigned char *str, int len); + speed_t baud_; + std::string port_; + int fd_; + bool connected_; + std::string device_name_; + +public: + GenericSerial(std::string name); + virtual ~GenericSerial() {} + int SerialOpen(std::string port, int baud, int flags = 0); + void SerialClose(); + int SerialPoll(unsigned char *str, int len); + int SerialReadData(unsigned char *str, int len); + int SerialWrite(unsigned char *str, int len); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Hash.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/Hash.cpp index b370cfca2..92e3ce5b0 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Hash.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Hash.cpp @@ -24,7 +24,7 @@ * */ -/* +/* * exported functions: * * void hash_create (HASH *Hash); @@ -53,8 +53,6 @@ * */ - - #include #include #include @@ -73,432 +71,402 @@ /* string buffer chunk size */ #define CHUNK_SIZE 16 - /* initialize a new hash table */ -void hash_create(HASH * Hash) -{ - Hash->sorted = 0; +void hash_create(HASH *Hash) { + Hash->sorted = 0; - Hash->timestamp.tv_sec = 0; - Hash->timestamp.tv_usec = 0; + Hash->timestamp.tv_sec = 0; + Hash->timestamp.tv_usec = 0; - Hash->nItems = 0; - Hash->Items = NULL; + Hash->nItems = 0; + Hash->Items = NULL; - Hash->nColumns = 0; - Hash->Columns = NULL; + Hash->nColumns = 0; + Hash->Columns = NULL; - Hash->delimiter = strdup(" \t\n"); + Hash->delimiter = strdup(" \t\n"); } - /* bsearch compare function for hash items */ -static int hash_lookup_item(const void *a, const void *b) -{ - char *key = (char *) a; - HASH_ITEM *item = (HASH_ITEM *) b; +static int hash_lookup_item(const void *a, const void *b) { + char *key = (char *)a; + HASH_ITEM *item = (HASH_ITEM *)b; - return strcasecmp(key, item->key); + return strcasecmp(key, item->key); } - /* qsort compare function for hash items */ -static int hash_sort_item(const void *a, const void *b) -{ - HASH_ITEM *ha = (HASH_ITEM *) a; - HASH_ITEM *hb = (HASH_ITEM *) b; +static int hash_sort_item(const void *a, const void *b) { + HASH_ITEM *ha = (HASH_ITEM *)a; + HASH_ITEM *hb = (HASH_ITEM *)b; - return strcasecmp(ha->key, hb->key); + return strcasecmp(ha->key, hb->key); } - /* bsearch compare function for hash headers */ -static int hash_lookup_column(const void *a, const void *b) -{ - char *key = (char *) a; - HASH_COLUMN *column = (HASH_COLUMN *) b; +static int hash_lookup_column(const void *a, const void *b) { + char *key = (char *)a; + HASH_COLUMN *column = (HASH_COLUMN *)b; - return strcasecmp(key, column->key); + return strcasecmp(key, column->key); } - /* qsort compare function for hash headers */ -static int hash_sort_column(const void *a, const void *b) -{ - HASH_COLUMN *ha = (HASH_COLUMN *) a; - HASH_COLUMN *hb = (HASH_COLUMN *) b; +static int hash_sort_column(const void *a, const void *b) { + HASH_COLUMN *ha = (HASH_COLUMN *)a; + HASH_COLUMN *hb = (HASH_COLUMN *)b; - return strcasecmp(ha->key, hb->key); + return strcasecmp(ha->key, hb->key); } - /* split a value into columns and */ /* return the nth column in a string */ /* WARNING: does return a pointer to a static string!! */ -static char *split(const char *val, const int column, const char *delimiter) -{ - static char buffer[256]; - int num; - size_t len; - const char *beg, *end; - - if (column < 0) - return (char *) val; - if (val == NULL) - return NULL; - - num = 0; - len = 0; - beg = val; - end = beg; - while (beg && *beg) { - while (strchr(delimiter, *beg)) - beg++; - end = strpbrk(beg, delimiter); - if (num++ == column) - break; - beg = end ? end + 1 : NULL; - } - if (beg != NULL) { - len = end ? (size_t) (end - beg) : strlen(beg); - if (len >= sizeof(buffer)) - len = sizeof(buffer) - 1; - strncpy(buffer, beg, len); - } - - buffer[len] = '\0'; - return buffer; +static char *split(const char *val, const int column, const char *delimiter) { + static char buffer[256]; + int num; + size_t len; + const char *beg, *end; + + if (column < 0) + return (char *)val; + if (val == NULL) + return NULL; + + num = 0; + len = 0; + beg = val; + end = beg; + while (beg && *beg) { + while (strchr(delimiter, *beg)) + beg++; + end = strpbrk(beg, delimiter); + if (num++ == column) + break; + beg = end ? end + 1 : NULL; + } + if (beg != NULL) { + len = end ? (size_t)(end - beg) : strlen(beg); + if (len >= sizeof(buffer)) + len = sizeof(buffer) - 1; + strncpy(buffer, beg, len); + } + + buffer[len] = '\0'; + return buffer; } - /* search an entry in the hash table: */ /* If the table is flagged "sorted", the entry is looked */ /* up using the bsearch function. If the table is */ /* unsorted, it will be searched in a linear way */ -static HASH_ITEM *hash_lookup(HASH * Hash, const char *key, const int do_sort) -{ - HASH_ITEM *Item = NULL; - - /* maybe sort the array */ - if (do_sort && !Hash->sorted) { - qsort(Hash->Items, Hash->nItems, sizeof(HASH_ITEM), hash_sort_item); - Hash->sorted = 1; - } - - /* no key was passed */ - if (key == NULL) - return NULL; - - /* lookup using bsearch */ - if (Hash->sorted) { - Item = (HASH_ITEM *)bsearch(key, Hash->Items, Hash->nItems, sizeof(HASH_ITEM), hash_lookup_item); - } - - /* linear search */ - if (Item == NULL) { - int i; - for (i = 0; i < Hash->nItems; i++) { - if (strcmp(key, Hash->Items[i].key) == 0) { - Item = &(Hash->Items[i]); - break; - } - } +static HASH_ITEM *hash_lookup(HASH *Hash, const char *key, const int do_sort) { + HASH_ITEM *Item = NULL; + + /* maybe sort the array */ + if (do_sort && !Hash->sorted) { + qsort(Hash->Items, Hash->nItems, sizeof(HASH_ITEM), hash_sort_item); + Hash->sorted = 1; + } + + /* no key was passed */ + if (key == NULL) + return NULL; + + /* lookup using bsearch */ + if (Hash->sorted) { + Item = (HASH_ITEM *)bsearch(key, Hash->Items, Hash->nItems, + sizeof(HASH_ITEM), hash_lookup_item); + } + + /* linear search */ + if (Item == NULL) { + int i; + for (i = 0; i < Hash->nItems; i++) { + if (strcmp(key, Hash->Items[i].key) == 0) { + Item = &(Hash->Items[i]); + break; + } } + } - return Item; - + return Item; } - /* return the age in milliseconds of an entry from the hash table */ /* or from the hash table itself if key is NULL */ /* returns -1 if entry does not exist */ -int hash_age(HASH * Hash, const char *key) -{ - HASH_ITEM *Item; - struct timeval now, *timestamp; - - if (key == NULL) { - timestamp = &(Hash->timestamp); - } else { - Item = hash_lookup(Hash, key, 1); - if (Item == NULL) - return -1; - timestamp = &(Item->Slot[Item->index].timestamp); - } +int hash_age(HASH *Hash, const char *key) { + HASH_ITEM *Item; + struct timeval now, *timestamp; + + if (key == NULL) { + timestamp = &(Hash->timestamp); + } else { + Item = hash_lookup(Hash, key, 1); + if (Item == NULL) + return -1; + timestamp = &(Item->Slot[Item->index].timestamp); + } - gettimeofday(&now, NULL); + gettimeofday(&now, NULL); - return (now.tv_sec - timestamp->tv_sec) * 1000 + (now.tv_usec - timestamp->tv_usec) / 1000; + return (now.tv_sec - timestamp->tv_sec) * 1000 + + (now.tv_usec - timestamp->tv_usec) / 1000; } - /* add an entry to the column header table */ -void hash_set_column(HASH * Hash, const int number, const char *column) -{ - if (Hash == NULL) - return; - - Hash->nColumns++; - Hash->Columns = (HASH_COLUMN *)realloc(Hash->Columns, Hash->nColumns * sizeof(HASH_COLUMN)); - Hash->Columns[Hash->nColumns - 1].key = strdup(column); - Hash->Columns[Hash->nColumns - 1].val = number; +void hash_set_column(HASH *Hash, const int number, const char *column) { + if (Hash == NULL) + return; - qsort(Hash->Columns, Hash->nColumns, sizeof(HASH_COLUMN), hash_sort_column); + Hash->nColumns++; + Hash->Columns = (HASH_COLUMN *)realloc(Hash->Columns, + Hash->nColumns * sizeof(HASH_COLUMN)); + Hash->Columns[Hash->nColumns - 1].key = strdup(column); + Hash->Columns[Hash->nColumns - 1].val = number; + qsort(Hash->Columns, Hash->nColumns, sizeof(HASH_COLUMN), hash_sort_column); } - /* fetch a column number by column header */ -static int hash_get_column(HASH * Hash, const char *key) -{ - HASH_COLUMN *Column; +static int hash_get_column(HASH *Hash, const char *key) { + HASH_COLUMN *Column; - if (key == NULL || *key == '\0') - return -1; + if (key == NULL || *key == '\0') + return -1; - Column = (HASH_COLUMN *)bsearch(key, Hash->Columns, Hash->nColumns, sizeof(HASH_COLUMN), hash_lookup_column); - if (Column == NULL) - return -1; + Column = (HASH_COLUMN *)bsearch(key, Hash->Columns, Hash->nColumns, + sizeof(HASH_COLUMN), hash_lookup_column); + if (Column == NULL) + return -1; - return Column->val; + return Column->val; } - /* set column delimiters */ -void hash_set_delimiter(HASH * Hash, const char *delimiter) -{ - if (Hash->delimiter != NULL) - free(Hash->delimiter); - Hash->delimiter = strdup(delimiter); +void hash_set_delimiter(HASH *Hash, const char *delimiter) { + if (Hash->delimiter != NULL) + free(Hash->delimiter); + Hash->delimiter = strdup(delimiter); } - /* get a string from the hash table */ -char *hash_get(HASH * Hash, const char *key, const char *column) -{ - HASH_ITEM *Item; - int c; +char *hash_get(HASH *Hash, const char *key, const char *column) { + HASH_ITEM *Item; + int c; - Item = hash_lookup(Hash, key, 1); - if (Item == NULL) - return NULL; + Item = hash_lookup(Hash, key, 1); + if (Item == NULL) + return NULL; - c = hash_get_column(Hash, column); - return split(Item->Slot[Item->index].value, c, Hash->delimiter); + c = hash_get_column(Hash, column); + return split(Item->Slot[Item->index].value, c, Hash->delimiter); } - /* get a delta value from the delta table */ -double hash_get_delta(HASH * Hash, const char *key, const char *column, const int delay) -{ - HASH_ITEM *Item; - HASH_SLOT *Slot1, *Slot2; - int i, c; - double v1, v2; - double dv, dt; - struct timeval now, end; - - /* lookup item */ - Item = hash_lookup(Hash, key, 1); - if (Item == NULL) - return 0.0; - - /* this is the "current" Slot */ - Slot1 = &(Item->Slot[Item->index]); - - /* fetch column number */ - c = hash_get_column(Hash, column); - - /* if delay is zero, return absolute value */ - if (delay == 0) - return atof(split(Slot1->value, c, Hash->delimiter)); - - /* prepare timing values */ - now = Slot1->timestamp; - end.tv_sec = now.tv_sec; - end.tv_usec = now.tv_usec - 1000 * delay; - while (end.tv_usec < 0) { - end.tv_sec--; - end.tv_usec += 1000000; - } - - /* search delta slot */ - Slot2 = &(Item->Slot[Item->index]); - for (i = 1; i < Item->nSlot; i++) { - Slot2 = &(Item->Slot[(Item->index + i) % Item->nSlot]); - if (Slot2->timestamp.tv_sec == 0) - break; - if (timercmp(&(Slot2->timestamp), &end, <)) - break; - } - - /* empty slot => try the one before */ - if (Slot2->timestamp.tv_sec == 0) { - i--; - Slot2 = &(Item->Slot[(Item->index + i) % Item->nSlot]); - } +double hash_get_delta(HASH *Hash, const char *key, const char *column, + const int delay) { + HASH_ITEM *Item; + HASH_SLOT *Slot1, *Slot2; + int i, c; + double v1, v2; + double dv, dt; + struct timeval now, end; + + /* lookup item */ + Item = hash_lookup(Hash, key, 1); + if (Item == NULL) + return 0.0; - /* not enough slots available... */ - if (i == 0) - return 0.0; + /* this is the "current" Slot */ + Slot1 = &(Item->Slot[Item->index]); + + /* fetch column number */ + c = hash_get_column(Hash, column); + + /* if delay is zero, return absolute value */ + if (delay == 0) + return atof(split(Slot1->value, c, Hash->delimiter)); + + /* prepare timing values */ + now = Slot1->timestamp; + end.tv_sec = now.tv_sec; + end.tv_usec = now.tv_usec - 1000 * delay; + while (end.tv_usec < 0) { + end.tv_sec--; + end.tv_usec += 1000000; + } + + /* search delta slot */ + Slot2 = &(Item->Slot[Item->index]); + for (i = 1; i < Item->nSlot; i++) { + Slot2 = &(Item->Slot[(Item->index + i) % Item->nSlot]); + if (Slot2->timestamp.tv_sec == 0) + break; + if (timercmp(&(Slot2->timestamp), &end, <)) + break; + } + + /* empty slot => try the one before */ + if (Slot2->timestamp.tv_sec == 0) { + i--; + Slot2 = &(Item->Slot[(Item->index + i) % Item->nSlot]); + } + + /* not enough slots available... */ + if (i == 0) + return 0.0; - /* delta value, delta time */ - v1 = atof(split(Slot1->value, c, Hash->delimiter)); - v2 = atof(split(Slot2->value, c, Hash->delimiter)); - dv = v1 - v2; - dt = (Slot1->timestamp.tv_sec - Slot2->timestamp.tv_sec) - + (Slot1->timestamp.tv_usec - Slot2->timestamp.tv_usec) / 1000000.0; + /* delta value, delta time */ + v1 = atof(split(Slot1->value, c, Hash->delimiter)); + v2 = atof(split(Slot2->value, c, Hash->delimiter)); + dv = v1 - v2; + dt = (Slot1->timestamp.tv_sec - Slot2->timestamp.tv_sec) + + (Slot1->timestamp.tv_usec - Slot2->timestamp.tv_usec) / 1000000.0; - if (dt > 0.0 && dv >= 0.0) - return dv / dt; - return 0.0; + if (dt > 0.0 && dv >= 0.0) + return dv / dt; + return 0.0; } - /* get a delta value from the delta table */ /* key may contain regular expressions, and the sum */ /* of all matching entries is returned. */ -double hash_get_regex(HASH * Hash, const char *key, const char *column, const int delay) -{ - double sum; - regex_t preg; - int i, err; - - err = regcomp(&preg, key, REG_ICASE | REG_NOSUB); - if (err != 0) { - char buffer[32]; - regerror(err, &preg, buffer, sizeof(buffer)); - LCDError("error in regular expression: %s", buffer); - regfree(&preg); - return 0.0; - } +double hash_get_regex(HASH *Hash, const char *key, const char *column, + const int delay) { + double sum; + regex_t preg; + int i, err; + + err = regcomp(&preg, key, REG_ICASE | REG_NOSUB); + if (err != 0) { + char buffer[32]; + regerror(err, &preg, buffer, sizeof(buffer)); + LCDError("error in regular expression: %s", buffer); + regfree(&preg); + return 0.0; + } - /* force the table to be sorted by requesting anything */ - hash_lookup(Hash, NULL, 1); + /* force the table to be sorted by requesting anything */ + hash_lookup(Hash, NULL, 1); - sum = 0.0; - for (i = 0; i < Hash->nItems; i++) { - if (regexec(&preg, Hash->Items[i].key, 0, NULL, 0) == 0) { - sum += hash_get_delta(Hash, Hash->Items[i].key, column, delay); - } + sum = 0.0; + for (i = 0; i < Hash->nItems; i++) { + if (regexec(&preg, Hash->Items[i].key, 0, NULL, 0) == 0) { + sum += hash_get_delta(Hash, Hash->Items[i].key, column, delay); } - regfree(&preg); - return sum; + } + regfree(&preg); + return sum; } - /* insert a key/val pair into the hash table */ /* If the entry does already exist, it will be overwritten, */ /* and the table stays sorted (if it has been before). */ /* Otherwise, the entry is appended at the end, and */ /* the table will be flagged 'unsorted' afterwards */ -static HASH_ITEM *hash_set(HASH * Hash, const char *key, const char *value, const int delta) -{ - HASH_ITEM *Item; - HASH_SLOT *Slot; - int size; - - Item = hash_lookup(Hash, key, 0); - - if (Item == NULL) { - - /* add entry */ - Hash->sorted = 0; - Hash->nItems++; - Hash->Items = (HASH_ITEM *)realloc(Hash->Items, Hash->nItems * sizeof(HASH_ITEM)); +static HASH_ITEM *hash_set(HASH *Hash, const char *key, const char *value, + const int delta) { + HASH_ITEM *Item; + HASH_SLOT *Slot; + int size; - Item = &(Hash->Items[Hash->nItems - 1]); - Item->key = strdup(key); - Item->index = 0; - Item->nSlot = delta; - Item->Slot = (HASH_SLOT *)malloc(Item->nSlot * sizeof(HASH_SLOT)); - memset(Item->Slot, 0, Item->nSlot * sizeof(HASH_SLOT)); + Item = hash_lookup(Hash, key, 0); - } else { + if (Item == NULL) { - /* maybe enlarge delta table */ - if (Item->nSlot < delta) { - Item->nSlot = delta; - Item->Slot = (HASH_SLOT *)realloc(Item->Slot, Item->nSlot * sizeof(HASH_SLOT)); - } - - } - - if (Item->nSlot > 1) { - /* move the pointer to the next free slot, wrap around if necessary */ - if (--Item->index < 0) - Item->index = Item->nSlot - 1; - } - - /* create entry */ - Slot = &(Item->Slot[Item->index]); - size = strlen(value) + 1; - - /* maybe enlarge value buffer */ - if (size > Slot->size) { - /* buffer is either empty or too small */ - /* allocate memory in multiples of CHUNK_SIZE */ - Slot->size = CHUNK_SIZE * (size / CHUNK_SIZE + 1); - Slot->value = (char *)realloc(Slot->value, Slot->size); + /* add entry */ + Hash->sorted = 0; + Hash->nItems++; + Hash->Items = + (HASH_ITEM *)realloc(Hash->Items, Hash->nItems * sizeof(HASH_ITEM)); + + Item = &(Hash->Items[Hash->nItems - 1]); + Item->key = strdup(key); + Item->index = 0; + Item->nSlot = delta; + Item->Slot = (HASH_SLOT *)malloc(Item->nSlot * sizeof(HASH_SLOT)); + memset(Item->Slot, 0, Item->nSlot * sizeof(HASH_SLOT)); + + } else { + + /* maybe enlarge delta table */ + if (Item->nSlot < delta) { + Item->nSlot = delta; + Item->Slot = + (HASH_SLOT *)realloc(Item->Slot, Item->nSlot * sizeof(HASH_SLOT)); } - - /* set value */ - strcpy(Slot->value, value); - - /* set timestamps */ - gettimeofday(&(Hash->timestamp), NULL); - Slot->timestamp = Hash->timestamp; - - return Item; + } + + if (Item->nSlot > 1) { + /* move the pointer to the next free slot, wrap around if necessary */ + if (--Item->index < 0) + Item->index = Item->nSlot - 1; + } + + /* create entry */ + Slot = &(Item->Slot[Item->index]); + size = strlen(value) + 1; + + /* maybe enlarge value buffer */ + if (size > Slot->size) { + /* buffer is either empty or too small */ + /* allocate memory in multiples of CHUNK_SIZE */ + Slot->size = CHUNK_SIZE * (size / CHUNK_SIZE + 1); + Slot->value = (char *)realloc(Slot->value, Slot->size); + } + + /* set value */ + strcpy(Slot->value, value); + + /* set timestamps */ + gettimeofday(&(Hash->timestamp), NULL); + Slot->timestamp = Hash->timestamp; + + return Item; } - /* insert a string into the hash table */ /* without delta processing */ -void hash_put(HASH * Hash, const char *key, const char *value) -{ - hash_set(Hash, key, value, 1); +void hash_put(HASH *Hash, const char *key, const char *value) { + hash_set(Hash, key, value, 1); } - /* insert a string into the hash table */ /* with delta processing */ -void hash_put_delta(HASH * Hash, const char *key, const char *value) -{ - hash_set(Hash, key, value, DELTA_SLOTS); +void hash_put_delta(HASH *Hash, const char *key, const char *value) { + hash_set(Hash, key, value, DELTA_SLOTS); } +void hash_destroy(HASH *Hash) { + int i; -void hash_destroy(HASH * Hash) -{ - int i; - - if (Hash->Items) { - - /* free all headers */ - for (i = 0; i < Hash->nColumns; i++) { - if (Hash->Columns[i].key) - free(Hash->Columns[i].key); - } + if (Hash->Items) { - /* free header table */ - free(Hash->Columns); + /* free all headers */ + for (i = 0; i < Hash->nColumns; i++) { + if (Hash->Columns[i].key) + free(Hash->Columns[i].key); + } - /* free all items */ - for (i = 0; i < Hash->nItems; i++) { - if (Hash->Items[i].key) - free(Hash->Items[i].key); - if (Hash->Items[i].Slot) - free(Hash->Items[i].Slot); - } + /* free header table */ + free(Hash->Columns); - /* free items table */ - free(Hash->Items); + /* free all items */ + for (i = 0; i < Hash->nItems; i++) { + if (Hash->Items[i].key) + free(Hash->Items[i].key); + if (Hash->Items[i].Slot) + free(Hash->Items[i].Slot); } - Hash->sorted = 0; - Hash->nItems = 0; - Hash->Items = NULL; + /* free items table */ + free(Hash->Items); + } + + Hash->sorted = 0; + Hash->nItems = 0; + Hash->Items = NULL; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Hash.h b/libvisual-plugins/plugins/actor/lcdcontrol/Hash.h index 687573c46..b261801ee 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Hash.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Hash.h @@ -27,54 +27,50 @@ /* struct timeval */ #include - typedef struct { - int size; - char *value; - struct timeval timestamp; + int size; + char *value; + struct timeval timestamp; } HASH_SLOT; - typedef struct { - char *key; - int val; + char *key; + int val; } HASH_COLUMN; typedef struct { - char *key; - int index; - int nSlot; - HASH_SLOT *Slot; + char *key; + int index; + int nSlot; + HASH_SLOT *Slot; } HASH_ITEM; - typedef struct { - int sorted; - struct timeval timestamp; - int nItems; - HASH_ITEM *Items; - int nColumns; - HASH_COLUMN *Columns; - char *delimiter; + int sorted; + struct timeval timestamp; + int nItems; + HASH_ITEM *Items; + int nColumns; + HASH_COLUMN *Columns; + char *delimiter; } HASH; +void hash_create(HASH *Hash); +int hash_age(HASH *Hash, const char *key); -void hash_create(HASH * Hash); - -int hash_age(HASH * Hash, const char *key); - -void hash_set_column(HASH * Hash, const int number, const char *column); -void hash_set_delimiter(HASH * Hash, const char *delimiter); - -char *hash_get(HASH * Hash, const char *key, const char *column); -double hash_get_delta(HASH * Hash, const char *key, const char *column, const int delay); -double hash_get_regex(HASH * Hash, const char *key, const char *column, const int delay); +void hash_set_column(HASH *Hash, const int number, const char *column); +void hash_set_delimiter(HASH *Hash, const char *delimiter); -void hash_put(HASH * Hash, const char *key, const char *value); -void hash_put_delta(HASH * Hash, const char *key, const char *value); +char *hash_get(HASH *Hash, const char *key, const char *column); +double hash_get_delta(HASH *Hash, const char *key, const char *column, + const int delay); +double hash_get_regex(HASH *Hash, const char *key, const char *column, + const int delay); -void hash_destroy(HASH * Hash); +void hash_put(HASH *Hash, const char *key, const char *value); +void hash_put_delta(HASH *Hash, const char *key, const char *value); +void hash_destroy(HASH *Hash); #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDBase.h b/libvisual-plugins/plugins/actor/lcdcontrol/LCDBase.h index b52d39f98..f8ae07d4b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDBase.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDBase.h @@ -27,29 +27,29 @@ namespace LCD { class LCDBase { - public: - virtual ~LCDBase() {} - virtual void Transition() = 0; - virtual void SignalTransitionStart(std::string layout) = 0; - virtual void SignalTransitionEnd() = 0; - virtual int ResizeLCD(int rows, int cols) = 0; - - virtual void ResizeBefore(int rows, int cols) = 0; - virtual void ResizeAfter() = 0; - virtual void LayoutChangeBefore() = 0; - virtual void LayoutChangeAfter() = 0; - - virtual VisVideo *GetVideo() = 0; - int XRES; - int YRES; - int LROWS; - int LCOLS; - int DROWS; - int DCOLS; - int LAYERS; - bool clear_on_layout_change_; +public: + virtual ~LCDBase() {} + virtual void Transition() = 0; + virtual void SignalTransitionStart(std::string layout) = 0; + virtual void SignalTransitionEnd() = 0; + virtual int ResizeLCD(int rows, int cols) = 0; + + virtual void ResizeBefore(int rows, int cols) = 0; + virtual void ResizeAfter() = 0; + virtual void LayoutChangeBefore() = 0; + virtual void LayoutChangeAfter() = 0; + + virtual VisVideo *GetVideo() = 0; + int XRES; + int YRES; + int LROWS; + int LCOLS; + int DROWS; + int DCOLS; + int LAYERS; + bool clear_on_layout_change_; }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDControl.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/LCDControl.cpp index 0b77288c7..0a3773dc2 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDControl.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDControl.cpp @@ -34,68 +34,57 @@ using namespace LCD; LCDControl::LCDControl(void *priv, VisEventQueue *eventqueue) { - priv_ = priv; - active_ = false; - timers_ = new LCDTimerBin(); - eventqueue_ = eventqueue; - stats_init(&stats_); + priv_ = priv; + active_ = false; + timers_ = new LCDTimerBin(); + eventqueue_ = eventqueue; + stats_init(&stats_); } LCDControl::~LCDControl() { -/* - Shutdown(); - for(std::vector::iterator it = display_keys_.begin(); - it != display_keys_.end(); it++) { - if(devices_.find(*it) != devices_.end() && devices_[*it]) - delete devices_[*it]; - } -*/ + /* + Shutdown(); + for(std::vector::iterator it = display_keys_.begin(); + it != display_keys_.end(); it++) { + if(devices_.find(*it) != devices_.end() && devices_[*it]) + delete devices_[*it]; + } + */ } int LCDControl::Start() { - std::string file = std::string(getenv("HOME")) + "/.lcdcontrol_config.js"; + std::string file = std::string(getenv("HOME")) + "/.lcdcontrol_config.js"; - if((active_ = CFG_Init(file))) - { - ConfigSetup(); - } + if ((active_ = CFG_Init(file))) { + ConfigSetup(); + } - return 1; + return 1; } -void LCDControl::Stop() { - active_ = false; -} +void LCDControl::Stop() { active_ = false; } -void LCDControl::Lock() { - mutex_.lock(); -} +void LCDControl::Lock() { mutex_.lock(); } -void LCDControl::Unlock() { - mutex_.unlock(); -} +void LCDControl::Unlock() { mutex_.unlock(); } -void LCDControl::Tick() -{ - if(not active_) - return; - //stats_startFrame(&stats_); - timers_->Tick(); - //stats_endFrame(&stats_); +void LCDControl::Tick() { + if (not active_) + return; + // stats_startFrame(&stats_); + timers_->Tick(); + // stats_endFrame(&stats_); } -LCDTimerBin *LCDControl::GetTimers() -{ - return timers_; -} +LCDTimerBin *LCDControl::GetTimers() { return timers_; } VisVideo *LCDControl::GetVideo() { - if(not active_ or not device_) - return NULL; - return device_->GetVideo(); + if (not active_ or not device_) + return NULL; + return device_->GetVideo(); } void LCDControl::TryLock() { - // FIXME + // FIXME } /* @@ -103,9 +92,8 @@ void LCDControl::ProcessVariables(Json::Value *config, Evaluator *ev) { Json::Value *vars = CFG_Fetch_Raw(config, "variables"); if(vars) { Json::Value::Members keys = vars->getMemberNames(); - for(std::vector::iterator it = keys.begin(); it != keys.end(); it++) { - Json::Value *val = CFG_Fetch_Raw(vars, *it); - if(!val) + for(std::vector::iterator it = keys.begin(); it != +keys.end(); it++) { Json::Value *val = CFG_Fetch_Raw(vars, *it); if(!val) continue; LCDInfo("Adding variable <%s>", (*it).c_str()); QScriptValue *scriptVal; @@ -170,64 +158,67 @@ void LCDControl::ProcessVariables(Json::Value *config, Evaluator *ev) { */ void LCDControl::ConfigSetup() { - if(!CFG_Get_Root()) return; - - Json::Value::Members keys = CFG_Get_Root()->getMemberNames(); - - for(std::vector::iterator it = keys.begin(); it != keys.end(); it++ ) { - if(it->find("display_", 0) != std::string::npos) { - Json::Value *display = CFG_Fetch_Raw(CFG_Get_Root(), it->c_str()); - Json::Value *driver = CFG_Fetch_Raw(display, "driver"); - if(!driver) { - LCDError("CFG: Must specify driver <%s>", it->c_str()); - continue; - } - Json::Value *rows = CFG_Fetch_Raw(display, "rows", new Json::Value(0)); - Json::Value *cols = CFG_Fetch_Raw(display, "cols", new Json::Value(0)); - Json::Value *layers = CFG_Fetch_Raw(display, "layers", new Json::Value(1)); - Json::Value *model = CFG_Fetch_Raw(display, "model"); - if(driver->asString() == "video") { - devices_[*it] = new DrvVideo(*it, this, CFG_Get_Root(), layers->asInt(), eventqueue_); - } else { - continue; - } - if(model) delete model; - delete display; - delete driver; - delete rows; - delete cols; - } - - } - - for(std::map::iterator it = - devices_.begin(); it != devices_.end(); it++) { - display_keys_.push_back(it->first); - LCDError("Starting <%s> %p", it->first.c_str(), it->second); - LCDCore *device = it->second; - device->CFGSetup(); - device->SetupDevice(); - device->Connect(); - device->BuildLayouts(); - device->StartLayout(); - device_ = device; - LCDError("Starting 222222222222222 <%s> %p", it->first.c_str(), it->second); + if (!CFG_Get_Root()) + return; + + Json::Value::Members keys = CFG_Get_Root()->getMemberNames(); + + for (std::vector::iterator it = keys.begin(); it != keys.end(); + it++) { + if (it->find("display_", 0) != std::string::npos) { + Json::Value *display = CFG_Fetch_Raw(CFG_Get_Root(), it->c_str()); + Json::Value *driver = CFG_Fetch_Raw(display, "driver"); + if (!driver) { + LCDError("CFG: Must specify driver <%s>", it->c_str()); + continue; + } + Json::Value *rows = CFG_Fetch_Raw(display, "rows", new Json::Value(0)); + Json::Value *cols = CFG_Fetch_Raw(display, "cols", new Json::Value(0)); + Json::Value *layers = + CFG_Fetch_Raw(display, "layers", new Json::Value(1)); + Json::Value *model = CFG_Fetch_Raw(display, "model"); + if (driver->asString() == "video") { + devices_[*it] = new DrvVideo(*it, this, CFG_Get_Root(), layers->asInt(), + eventqueue_); + } else { + continue; + } + if (model) + delete model; + delete display; + delete driver; + delete rows; + delete cols; } + } + + for (std::map::iterator it = devices_.begin(); + it != devices_.end(); it++) { + display_keys_.push_back(it->first); + LCDError("Starting <%s> %p", it->first.c_str(), it->second); + LCDCore *device = it->second; + device->CFGSetup(); + device->SetupDevice(); + device->Connect(); + device->BuildLayouts(); + device->StartLayout(); + device_ = device; + LCDError("Starting 222222222222222 <%s> %p", it->first.c_str(), it->second); + } } void LCDControl::Shutdown() { -/* - for(std::map::iterator it = - devices_.begin(); it != devices_.end(); it++ ) { - it->second->TakeDown(); - } -*/ + /* + for(std::map::iterator it = + devices_.begin(); it != devices_.end(); it++ ) { + it->second->TakeDown(); + } + */ } LCDCore *LCDControl::FindDisplay(std::string name) { - std::map::iterator dev = devices_.find(name); - if(dev == devices_.end()) - return NULL; - return dev->second; + std::map::iterator dev = devices_.find(name); + if (dev == devices_.end()) + return NULL; + return dev->second; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDControl.h b/libvisual-plugins/plugins/actor/lcdcontrol/LCDControl.h index dfd97a566..fea0e6b6d 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDControl.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDControl.h @@ -41,33 +41,33 @@ class Evaluator; class LCDControl : public CFG { - bool active_; - LCDCore *device_; - std::map devices_; - std::vector display_keys_; - LCDTimerBin *timers_; - VisEventQueue *eventqueue_; - void ConfigSetup(); + bool active_; + LCDCore *device_; + std::map devices_; + std::vector display_keys_; + LCDTimerBin *timers_; + VisEventQueue *eventqueue_; + void ConfigSetup(); - public: - std::mutex mutex_; - Stats stats_; - void *priv_; - LCDControl(void *priv, VisEventQueue *eventqueue); - ~LCDControl(); - int Start(); - void Stop(); - void Lock(); - void Unlock(); - void TryLock(); - void Tick(); - void Shutdown(); - LCDTimerBin *GetTimers(); - LCDCore *FindDisplay(std::string name); - void ProcessVariables(Json::Value *config, Evaluator *ev); - bool IsActive() { return active_; } - VisVideo *GetVideo(); +public: + std::mutex mutex_; + Stats stats_; + void *priv_; + LCDControl(void *priv, VisEventQueue *eventqueue); + ~LCDControl(); + int Start(); + void Stop(); + void Lock(); + void Unlock(); + void TryLock(); + void Tick(); + void Shutdown(); + LCDTimerBin *GetTimers(); + LCDCore *FindDisplay(std::string name); + void ProcessVariables(Json::Value *config, Evaluator *ev); + bool IsActive() { return active_; } + VisVideo *GetVideo(); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDCore.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/LCDCore.cpp index a21e5adc2..82e82596d 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDCore.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDCore.cpp @@ -33,7 +33,7 @@ #include "Evaluator.h" #include "LCDText.h" #include "LCDGraphic.h" -//#include "PluginLCD.h" +// #include "PluginLCD.h" #include "Widget.h" #include "WidgetText.h" @@ -48,578 +48,581 @@ #include "WidgetFPS.h" #include "debug.h" -//#include "Generator.h" +// #include "Generator.h" using namespace LCD; -void change_layout(void *data) -{ - LCDCore *core = (LCDCore *)data; - core->ChangeLayout(); +void change_layout(void *data) { + LCDCore *core = (LCDCore *)data; + core->ChangeLayout(); } -void layout_transition(void *data) -{ - LCDCore *core = (LCDCore *)data; - core->LayoutTransition(); +void layout_transition(void *data) { + LCDCore *core = (LCDCore *)data; + core->LayoutTransition(); } -LCDCore::LCDCore(LCDControl *app, std::string name, Json::Value *config, int t, VisEventQueue *eventqueue, LCDBase *lcd) : - CFG(config), gen_(0, this, true) { - app_ = app; - type_ = t; - eventqueue_ = eventqueue; - lcd_ = lcd; - name_ = name; - layout_timeout_ = 0; - transitions_off_ = false; - // initialize true so property initialization doesn't trigger transitions - is_transitioning_ = false; - - timers_ = app->GetTimers(); - timer_ = timers_->AddTimer(change_layout, this, 12000, false); - transition_timer_ = timers_->AddTimer(layout_transition, this, 100, true); - -/* - wrapper_ = new LCDWrapper((LCDInterface *)this, (QObject *)NULL); - timer_ = new QTimer(); - timer_->setSingleShot(true); - transition_timer_ = new QTimer(); - transition_timer_->setSingleShot(false); - QObject::connect(timer_, SIGNAL(timeout()), wrapper_, SLOT(ChangeLayout())); - QObject::connect(transition_timer_, SIGNAL(timeout()), wrapper_, - SLOT(LayoutTransition())); - QObject::connect(wrapper_, SIGNAL(_TransitionFinished()), - wrapper_, SLOT(TransitionFinished())); - QObject::connect(wrapper_, SIGNAL(_KeypadEvent(const int)), - wrapper_, SLOT(KeypadEvent(const int))); - gen_index_ = 0; - - pluginLCD = new PluginLCD(this); - QScriptValue val = engine_->newObject(); - QScriptValue objVal = engine_->newQObject(val, pluginLCD); - engine_->globalObject().setProperty("lcd", objVal); -*/ - -/* - if( !CFG_Init("libvisual_config.js") ) { - LCDError("Couldn't load configuration."); - } -*/ +LCDCore::LCDCore(LCDControl *app, std::string name, Json::Value *config, int t, + VisEventQueue *eventqueue, LCDBase *lcd) + : CFG(config), gen_(0, this, true) { + app_ = app; + type_ = t; + eventqueue_ = eventqueue; + lcd_ = lcd; + name_ = name; + layout_timeout_ = 0; + transitions_off_ = false; + // initialize true so property initialization doesn't trigger transitions + is_transitioning_ = false; + + timers_ = app->GetTimers(); + timer_ = timers_->AddTimer(change_layout, this, 12000, false); + transition_timer_ = timers_->AddTimer(layout_transition, this, 100, true); + + /* + wrapper_ = new LCDWrapper((LCDInterface *)this, (QObject *)NULL); + timer_ = new QTimer(); + timer_->setSingleShot(true); + transition_timer_ = new QTimer(); + transition_timer_->setSingleShot(false); + QObject::connect(timer_, SIGNAL(timeout()), wrapper_, + SLOT(ChangeLayout())); QObject::connect(transition_timer_, + SIGNAL(timeout()), wrapper_, SLOT(LayoutTransition())); + QObject::connect(wrapper_, SIGNAL(_TransitionFinished()), + wrapper_, SLOT(TransitionFinished())); + QObject::connect(wrapper_, SIGNAL(_KeypadEvent(const int)), + wrapper_, SLOT(KeypadEvent(const int))); + gen_index_ = 0; + + pluginLCD = new PluginLCD(this); + QScriptValue val = engine_->newObject(); + QScriptValue objVal = engine_->newQObject(val, pluginLCD); + engine_->globalObject().setProperty("lcd", objVal); + */ + + /* + if( !CFG_Init("libvisual_config.js") ) { + LCDError("Couldn't load configuration."); + } + */ } LCDCore::~LCDCore() { - //delete pluginLCD; - for(std::map::iterator w = widgets_.begin(); - w != widgets_.end(); w++) { - delete w->second; - } - delete timers_; + // delete pluginLCD; + for (std::map::iterator w = widgets_.begin(); + w != widgets_.end(); w++) { + delete w->second; + } + delete timers_; } -bool LCDCore::IsActive() { - return app_->IsActive(); -} +bool LCDCore::IsActive() { return app_->IsActive(); } void LCDCore::CFGSetup() { - int i = 1; - std::stringstream strm; - std::string str; + int i = 1; + std::stringstream strm; + std::string str; - //app_->ProcessVariables(CFG_Get_Root(), (Evaluator *)this); + // app_->ProcessVariables(CFG_Get_Root(), (Evaluator *)this); - Json::Value *section = CFG_Fetch_Raw(CFG_Get_Root(), name_); - if(!section) { - LCDError("Device <%s> doesn't exist.", name_.c_str()); - return; - } + Json::Value *section = CFG_Fetch_Raw(CFG_Get_Root(), name_); + if (!section) { + LCDError("Device <%s> doesn't exist.", name_.c_str()); + return; + } - Json::Value *val = CFG_Fetch(section, "layout-timeout", new Json::Value(0)); - layout_timeout_ = val->asInt(); - delete val; + Json::Value *val = CFG_Fetch(section, "layout-timeout", new Json::Value(0)); + layout_timeout_ = val->asInt(); + delete val; - val = CFG_Fetch(section, "transition-speed", new Json::Value(200)); - transition_speed_ = val->asInt(); - delete val; + val = CFG_Fetch(section, "transition-speed", new Json::Value(200)); + transition_speed_ = val->asInt(); + delete val; - val = CFG_Fetch_Raw(section, "clear_on_layout_change", new Json::Value(true)); - clear_on_layout_change_ = val->asBool(); - delete val; + val = CFG_Fetch_Raw(section, "clear_on_layout_change", new Json::Value(true)); + clear_on_layout_change_ = val->asBool(); + delete val; - val = CFG_Fetch_Raw(section, "transitions-off", new Json::Value(false)); - transitions_off_ = val->asBool(); - delete val; + val = CFG_Fetch_Raw(section, "transitions-off", new Json::Value(false)); + transitions_off_ = val->asBool(); + delete val; - Json::Value *layout = CFG_Fetch_Raw(section, "layout0"); + Json::Value *layout = CFG_Fetch_Raw(section, "layout0"); - while(layout) { - layouts_.push_back(layout->asCString()); - strm << "layout" << i; - strm >> str; - strm.clear(); - strm.str(""); - delete layout; - layout = CFG_Fetch_Raw(section, str); - i++; - } + while (layout) { + layouts_.push_back(layout->asCString()); + strm << "layout" << i; + strm >> str; + strm.clear(); + strm.str(""); + delete layout; + layout = CFG_Fetch_Raw(section, str); + i++; + } + + if (i == 1) { + delete layout; + return; + } - if(i == 1) { delete layout; return; } + Json::Value *widget = CFG_Fetch_Raw(section, "widget0"); - Json::Value *widget = CFG_Fetch_Raw(section, "widget0"); + i = 1; + while (widget && widget->isString()) { + static_widgets_.push_back(widget->asCString()); + strm << "widget" << i; + strm >> str; + strm.clear(); + strm.str(""); + delete widget; + widget = CFG_Fetch_Raw(section, str); + i++; + } + + if (i == 1) + delete widget; - i = 1; - while(widget && widget->isString()) { - static_widgets_.push_back(widget->asCString()); - strm << "widget" << i; + for (unsigned int i = 0; i < layouts_.size(); i++) { + layout = CFG_Fetch_Raw(CFG_Get_Root(), layouts_[i]); + if (!layout) { + LCDError("Missing layout <%s>", layouts_[i].c_str()); + continue; + } + Json::Value *val = CFG_Fetch(layout, "keyless", new Json::Value(0)); + if (val->asInt()) { + keyless_layouts_[layouts_[i]] = true; + } + delete val; + + LCDError("layers: %d", lcd_->LAYERS); + + for (int layer = 0; layer < lcd_->LAYERS; layer++) { + strm << "layer" << layer + 1; + strm >> str; + strm.clear(); + strm.str(""); + Json::Value *cfg_layer = CFG_Fetch_Raw(layout, str); + if (!cfg_layer) + continue; + for (int row = 0; row < lcd_->LROWS; row++) { + strm << "row" << row + 1; strm >> str; strm.clear(); strm.str(""); - delete widget; - widget = CFG_Fetch_Raw(section, str); - i++; - } - - if(i == 1) delete widget; - - for(unsigned int i = 0; i < layouts_.size(); i++ ) { - layout = CFG_Fetch_Raw(CFG_Get_Root(), layouts_[i]); - if(!layout) { - LCDError("Missing layout <%s>", layouts_[i].c_str()); + Json::Value *cfg_row = CFG_Fetch_Raw(cfg_layer, str); + if (!cfg_row) + continue; + for (int col = 0; col < lcd_->LCOLS; col++) { + strm << "col" << col + 1; + strm >> str; + strm.clear(); + strm.str(""); + Json::Value *cfg_col = CFG_Fetch_Raw(cfg_row, str); + + if (!cfg_col || !cfg_col->isString()) { + if (cfg_col) + delete cfg_col; continue; + } + + widget_template w = widget_template(); + w.key = cfg_col->asString(); + w.row = row; + w.col = col; + w.layer = layer; + widget_templates_[layouts_[i]].push_back(w); + delete cfg_col; } - Json::Value *val = CFG_Fetch(layout, "keyless", new Json::Value(0)); - if(val->asInt()) { - keyless_layouts_[layouts_[i]] = true; - } - delete val; - - LCDError("layers: %d", lcd_->LAYERS); - - for(int layer = 0; layer < lcd_->LAYERS; layer++) { - strm << "layer" << layer + 1; - strm >> str; - strm.clear(); - strm.str(""); - Json::Value *cfg_layer = CFG_Fetch_Raw(layout, str); - if(!cfg_layer) - continue; - for(int row = 0; row < lcd_->LROWS; row++) { - strm << "row" << row + 1; - strm >> str; - strm.clear(); - strm.str(""); - Json::Value *cfg_row = CFG_Fetch_Raw(cfg_layer, str); - if(!cfg_row) - continue; - for(int col = 0; col < lcd_->LCOLS; col++) { - strm << "col" << col + 1; - strm >> str; - strm.clear(); - strm.str(""); - Json::Value *cfg_col = CFG_Fetch_Raw(cfg_row, str); - - if(!cfg_col || !cfg_col->isString()) { - if(cfg_col) delete cfg_col; - continue; - } - - widget_template w = widget_template(); - w.key = cfg_col->asString(); - w.row = row; - w.col = col; - w.layer = layer; - widget_templates_[layouts_[i]].push_back(w); - delete cfg_col; - } - delete cfg_row; - } - delete cfg_layer; - } + delete cfg_row; + } + delete cfg_layer; + } - for(int row = 0; row < lcd_->LROWS; row++ ) { - strm << "row" << row + 1; - strm >> str; - strm.clear(); - strm.str(""); - Json::Value *cfg_row = CFG_Fetch_Raw(layout, str); - if(!cfg_row) - continue; - for(int col = 0; col < lcd_->LCOLS; col++ ) { - strm << "col" << col + 1; - strm >> str; - strm.clear(); - strm.str(""); - Json::Value *cfg_col = CFG_Fetch_Raw(cfg_row, str); - - if(!cfg_col || !cfg_col->isString()) { - if(cfg_col) delete cfg_col; - continue; - } - - widget_template w = widget_template(); - w.key = cfg_col->asString(); - w.row = row; - w.col = col; - w.layer = 0; - widget_templates_[layouts_[i]].push_back(w); - delete cfg_col; - } - delete cfg_row; + for (int row = 0; row < lcd_->LROWS; row++) { + strm << "row" << row + 1; + strm >> str; + strm.clear(); + strm.str(""); + Json::Value *cfg_row = CFG_Fetch_Raw(layout, str); + if (!cfg_row) + continue; + for (int col = 0; col < lcd_->LCOLS; col++) { + strm << "col" << col + 1; + strm >> str; + strm.clear(); + strm.str(""); + Json::Value *cfg_col = CFG_Fetch_Raw(cfg_row, str); + + if (!cfg_col || !cfg_col->isString()) { + if (cfg_col) + delete cfg_col; + continue; } - } - for(unsigned int j = 0; j < static_widgets_.size(); j++ ) { widget_template w = widget_template(); - w.key = static_widgets_[j]; - w.row = 0; - w.col = 0; - widget_templates_[name_].push_back(w); + w.key = cfg_col->asString(); + w.row = row; + w.col = col; + w.layer = 0; + widget_templates_[layouts_[i]].push_back(w); + delete cfg_col; + } + delete cfg_row; } - - delete section; - delete layout; - delete widget; + } + + for (unsigned int j = 0; j < static_widgets_.size(); j++) { + widget_template w = widget_template(); + w.key = static_widgets_[j]; + w.row = 0; + w.col = 0; + widget_templates_[name_].push_back(w); + } + + delete section; + delete layout; + delete widget; } void LCDCore::BuildLayouts() { - std::stringstream strm; - std::string name; - for(std::map >::iterator l = - widget_templates_.begin(); l != widget_templates_.end(); l++) { - std::vector widgets = l->second; - for(unsigned int i = 0; i < widgets.size(); i++ ) { - Json::Value *widget_v = CFG_Fetch_Raw(CFG_Get_Root(), widgets[i].key); - if(!widget_v) { - LCDError("No widget named <%s>", widgets[i].key.c_str()); - continue; - } - Json::Value *type = CFG_Fetch_Raw(widget_v, "type"); - if(!type) { - LCDError("Widget <%s> has no type!", widgets[i].key.c_str()); - delete widget_v; - continue; - } - - Widget *widget = (Widget *)NULL; - - std::string name; - int j = 0; - strm << l->first << ":" << widgets[i].key << ":" << j; - strm >> name; - strm.clear(); - strm.str(""); - - while(widgets_.find(name) != widgets_.end()) { - j++; - strm << l->first << ":" << widgets[i].key << ":" << j; - strm >> name; - strm.clear(); - strm.str(""); - } - - if(type->asString() == "text") { - widget = (Widget *) new WidgetText(this, name, widget_v, - widgets[i].row, widgets[i].col, widgets[i].layer); - } else if (type->asString() == "bar") { - widget = (Widget *) new WidgetBar(this, name, widget_v, - widgets[i].row, widgets[i].col, widgets[i].layer); - } else if (type->asString() == "icon") { - widget = (Widget *) new WidgetIcon(this, name, widget_v, - widgets[i].row, widgets[i].col, widgets[i].layer); - } else if (type->asString() == "histogram") { - widget = (Widget *) new WidgetHistogram(this, name, widget_v, - widgets[i].row, widgets[i].col, widgets[i].layer); - } else if (type->asString() == "fps") { - widget = (Widget *) new WidgetFPS(this, name, widget_v, - widgets[i].row, widgets[i].col, widgets[i].layer); - } else if (type->asString() == "bignums") { - widget = (Widget *) new WidgetBignums(this, name, widget_v, - widgets[i].row, widgets[i].col, widgets[i].layer); - } else if (type->asString() == "visualization") { - widget = (Widget *) new WidgetVisualization(this, name, widget_v, - widgets[i].row, widgets[i].col, widgets[i].layer); - } else if (type->asString() == "key") { - widget = (Widget *) new WidgetKey(this, name, widget_v); - } else if (type->asString() == "timer") { - widget = (Widget *) new WidgetTimer(this, name, widget_v); - } else if (type->asString() == "script") { - widget = (Widget *) new WidgetScript(this, name, widget_v); - } else { - LCDError("Unknown widget type: %s", type->asCString()); - } - if(widget) { - widgets_[name] = widget; - } //else LCDError("No widget: %s", type->asCString()); - delete type; - } - } + std::stringstream strm; + std::string name; + for (std::map>::iterator l = + widget_templates_.begin(); + l != widget_templates_.end(); l++) { + std::vector widgets = l->second; + for (unsigned int i = 0; i < widgets.size(); i++) { + Json::Value *widget_v = CFG_Fetch_Raw(CFG_Get_Root(), widgets[i].key); + if (!widget_v) { + LCDError("No widget named <%s>", widgets[i].key.c_str()); + continue; + } + Json::Value *type = CFG_Fetch_Raw(widget_v, "type"); + if (!type) { + LCDError("Widget <%s> has no type!", widgets[i].key.c_str()); + delete widget_v; + continue; + } + + Widget *widget = (Widget *)NULL; + + std::string name; + int j = 0; + strm << l->first << ":" << widgets[i].key << ":" << j; + strm >> name; + strm.clear(); + strm.str(""); + + while (widgets_.find(name) != widgets_.end()) { + j++; + strm << l->first << ":" << widgets[i].key << ":" << j; + strm >> name; + strm.clear(); + strm.str(""); + } + + if (type->asString() == "text") { + widget = (Widget *)new WidgetText(this, name, widget_v, widgets[i].row, + widgets[i].col, widgets[i].layer); + } else if (type->asString() == "bar") { + widget = (Widget *)new WidgetBar(this, name, widget_v, widgets[i].row, + widgets[i].col, widgets[i].layer); + } else if (type->asString() == "icon") { + widget = (Widget *)new WidgetIcon(this, name, widget_v, widgets[i].row, + widgets[i].col, widgets[i].layer); + } else if (type->asString() == "histogram") { + widget = + (Widget *)new WidgetHistogram(this, name, widget_v, widgets[i].row, + widgets[i].col, widgets[i].layer); + } else if (type->asString() == "fps") { + widget = (Widget *)new WidgetFPS(this, name, widget_v, widgets[i].row, + widgets[i].col, widgets[i].layer); + } else if (type->asString() == "bignums") { + widget = + (Widget *)new WidgetBignums(this, name, widget_v, widgets[i].row, + widgets[i].col, widgets[i].layer); + } else if (type->asString() == "visualization") { + widget = (Widget *)new WidgetVisualization( + this, name, widget_v, widgets[i].row, widgets[i].col, + widgets[i].layer); + } else if (type->asString() == "key") { + widget = (Widget *)new WidgetKey(this, name, widget_v); + } else if (type->asString() == "timer") { + widget = (Widget *)new WidgetTimer(this, name, widget_v); + } else if (type->asString() == "script") { + widget = (Widget *)new WidgetScript(this, name, widget_v); + } else { + LCDError("Unknown widget type: %s", type->asCString()); + } + if (widget) { + widgets_[name] = widget; + } // else LCDError("No widget: %s", type->asCString()); + delete type; + } + } } void LCDCore::StartLayout(std::string key) { - if(key == "") { - gen_(current_layout_, last_layout_); - } else { - current_layout_ = key; - } - - LCDError("StartLayout: %s", current_layout_.c_str()); - lcd_->LayoutChangeBefore(); - std::map widgets = widgets_; - for(std::map::iterator w = widgets.begin(); - w != widgets.end(); w++){ - - if(!w->second) LCDError("w->second is null"); - if(w->second && (current_layout_ == w->second->GetLayoutBase() || w->second->GetLayoutBase() == name_ )) { - if( type_ == LCD_TEXT && - (w->second->GetType() & WIDGET_TYPE_SPECIAL)) { - - w->second->SetupChars(); - } - w->second->Start(); - } + if (key == "") { + gen_(current_layout_, last_layout_); + } else { + current_layout_ = key; + } + + LCDError("StartLayout: %s", current_layout_.c_str()); + lcd_->LayoutChangeBefore(); + std::map widgets = widgets_; + for (std::map::iterator w = widgets.begin(); + w != widgets.end(); w++) { + + if (!w->second) + LCDError("w->second is null"); + if (w->second && (current_layout_ == w->second->GetLayoutBase() || + w->second->GetLayoutBase() == name_)) { + if (type_ == LCD_TEXT && (w->second->GetType() & WIDGET_TYPE_SPECIAL)) { + + w->second->SetupChars(); + } + w->second->Start(); } + } - lcd_->LayoutChangeAfter(); + lcd_->LayoutChangeAfter(); - Json::Value *timeout = CFG_Fetch(CFG_Get_Root(), - current_layout_ + ".timeout", new Json::Value(layout_timeout_)); + Json::Value *timeout = CFG_Fetch(CFG_Get_Root(), current_layout_ + ".timeout", + new Json::Value(layout_timeout_)); - if(timeout->asInt() > 0) - timer_->Start(timeout->asInt()); + if (timeout->asInt() > 0) + timer_->Start(timeout->asInt()); - delete timeout; + delete timeout; - Json::Value *val = CFG_Fetch_Raw(CFG_Get_Root(), current_layout_ + - ".clear_on_layout_change", new Json::Value(clear_on_layout_change_)); + Json::Value *val = + CFG_Fetch_Raw(CFG_Get_Root(), current_layout_ + ".clear_on_layout_change", + new Json::Value(clear_on_layout_change_)); - clear_on_layout_change_ = val->asBool(); + clear_on_layout_change_ = val->asBool(); - LCDError("StartLayout end: %s", current_layout_.c_str()); - delete val; + LCDError("StartLayout end: %s", current_layout_.c_str()); + delete val; } void LCDCore::StopLayout(std::string layout) { - std::map widgets = widgets_; - for(std::map::iterator w = widgets.begin(); - w != widgets.end(); w++){ - - if(layout != w->second->GetLayoutBase() ) - continue; + std::map widgets = widgets_; + for (std::map::iterator w = widgets.begin(); + w != widgets.end(); w++) { + + if (layout != w->second->GetLayoutBase()) + continue; - w->second->Stop(); - } + w->second->Stop(); + } } void LCDCore::ChangeLayout() { - if(is_transitioning_) { - timer_->Start(); - return; - } - LCDError("ChangeLayout"); - Json::Value *t = CFG_Fetch_Raw(CFG_Get_Root(), - current_layout_ + ".transition"); - if(!t or transitions_off_) { - StopLayout(current_layout_); - StartLayout(); - } else { - StartTransition(t->asString()); - delete t; - if(type_ & LCD_TEXT) { - LCDText *text = ((LCDText *)lcd_); - text->CleanBuffer(text->LayoutFB); - } + if (is_transitioning_) { + timer_->Start(); + return; + } + LCDError("ChangeLayout"); + Json::Value *t = + CFG_Fetch_Raw(CFG_Get_Root(), current_layout_ + ".transition"); + if (!t or transitions_off_) { + StopLayout(current_layout_); + StartLayout(); + } else { + StartTransition(t->asString()); + delete t; + if (type_ & LCD_TEXT) { + LCDText *text = ((LCDText *)lcd_); + text->CleanBuffer(text->LayoutFB); } + } } void LCDCore::Transition(int i) { - if(is_transitioning_) - return; - gen_ = layoutGenerator(i, this); - ChangeLayout(); - LCDError("LCDCore::Transition %d", i); + if (is_transitioning_) + return; + gen_ = layoutGenerator(i, this); + ChangeLayout(); + LCDError("LCDCore::Transition %d", i); } void LCDCore::StartTransition(std::string transition) { - int t; - if(transition.size() < 1) { - LCDError("Transition not defined <%s>", current_layout_.c_str()); - StartLayout(); - return; - } - switch(transition.c_str()[0]) { - case 'R': - t = TRANSITION_RIGHT; - break; - case 'L': - t = TRANSITION_LEFT; - break; - case 'B': - t = TRANSITION_BOTH; - break; - case 'U': - t = TRANSITION_UP; - break; - case 'D': - t = TRANSITION_DOWN; - break; - case 'T': - t = TRANSITION_TENTACLE; - break; - case 'A': - t = TRANSITION_ALPHABLEND; - break; - default: - t = TRANSITION_RIGHT; - break; - } - gen_(current_layout_, last_layout_); - lcd_->SignalTransitionStart(current_layout_); - direction_ = t; - StartLayout(current_layout_); - is_transitioning_ = true; - Json::Value *val = CFG_Fetch_Raw(CFG_Get_Root(), - current_layout_ + ".transition-speed", new Json::Value(transition_speed_)); - int speed = val->asInt(); - delete val; - transition_timer_->Start(speed); - LayoutTransition(); - LCDError("Transition started -- speed: %d", transition_speed_); + int t; + if (transition.size() < 1) { + LCDError("Transition not defined <%s>", current_layout_.c_str()); + StartLayout(); + return; + } + switch (transition.c_str()[0]) { + case 'R': + t = TRANSITION_RIGHT; + break; + case 'L': + t = TRANSITION_LEFT; + break; + case 'B': + t = TRANSITION_BOTH; + break; + case 'U': + t = TRANSITION_UP; + break; + case 'D': + t = TRANSITION_DOWN; + break; + case 'T': + t = TRANSITION_TENTACLE; + break; + case 'A': + t = TRANSITION_ALPHABLEND; + break; + default: + t = TRANSITION_RIGHT; + break; + } + gen_(current_layout_, last_layout_); + lcd_->SignalTransitionStart(current_layout_); + direction_ = t; + StartLayout(current_layout_); + is_transitioning_ = true; + Json::Value *val = + CFG_Fetch_Raw(CFG_Get_Root(), current_layout_ + ".transition-speed", + new Json::Value(transition_speed_)); + int speed = val->asInt(); + delete val; + transition_timer_->Start(speed); + LayoutTransition(); + LCDError("Transition started -- speed: %d", transition_speed_); } -void LCDCore::LayoutTransition() { - lcd_->Transition(); -} +void LCDCore::LayoutTransition() { lcd_->Transition(); } void LCDCore::TransitionFinished() { - transition_timer_->Stop(); - StopLayout(last_layout_); - is_transitioning_ = false; - lcd_->SignalTransitionEnd(); - timer_->Start(); + transition_timer_->Stop(); + StopLayout(last_layout_); + is_transitioning_ = false; + lcd_->SignalTransitionEnd(); + timer_->Start(); } -std::map LCDCore::GetWidgets() { - return widgets_; -} +std::map LCDCore::GetWidgets() { return widgets_; } -std::string LCDCore::CFG_Key() { - return key_; -} +std::string LCDCore::CFG_Key() { return key_; } void LCDCore::KeypadEvent(const int key) { - LCDError("KeypadEvent(%d) %s", key, current_layout_.c_str()); + LCDError("KeypadEvent(%d) %s", key, current_layout_.c_str()); - std::map::iterator it = - keyless_layouts_.find(current_layout_); + std::map::iterator it = + keyless_layouts_.find(current_layout_); - if(it != keyless_layouts_.end()) - return; + if (it != keyless_layouts_.end()) + return; - for(std::map::iterator w = widgets_.begin(); - w != widgets_.end(); w++) { - if( w->second->GetType() & WIDGET_TYPE_KEYPAD ) - ((WidgetKey*)w->second)->KeyPressed(key); - } + for (std::map::iterator w = widgets_.begin(); + w != widgets_.end(); w++) { + if (w->second->GetType() & WIDGET_TYPE_KEYPAD) + ((WidgetKey *)w->second)->KeyPressed(key); + } } int LCDCore::ResizeLCD(int rows, int cols) { - StopLayout(current_layout_); - //int old_rows = lcd_->LROWS; - //int old_cols = lcd_->LCOLS; - if(lcd_->ResizeLCD(rows, cols) == 0) { - //emit static_cast(wrapper_)->_ResizeLCD(rows, cols, old_rows, old_cols); - } else { - LCDError("LCDCore::ResizeLCD: Unable to resize LCD"); - return -1; - } - StartLayout(current_layout_); - return 0; + StopLayout(current_layout_); + // int old_rows = lcd_->LROWS; + // int old_cols = lcd_->LCOLS; + if (lcd_->ResizeLCD(rows, cols) == 0) { + // emit static_cast(wrapper_)->_ResizeLCD(rows, cols, old_rows, + // old_cols); + } else { + LCDError("LCDCore::ResizeLCD: Unable to resize LCD"); + return -1; + } + StartLayout(current_layout_); + return 0; } void LCDCore::SelectLayout(std::string layout) { - if(is_transitioning_) - return; - for(unsigned int i = 0; i < layouts_.size(); i++) { - if(layouts_[i] == layout) { - StopLayout(current_layout_); - StartLayout(layout); - } + if (is_transitioning_) + return; + for (unsigned int i = 0; i < layouts_.size(); i++) { + if (layouts_[i] == layout) { + StopLayout(current_layout_); + StartLayout(layout); } + } } int LCDCore::RemoveWidget(std::string name) { - std::map::iterator it = widgets_.find(name); - if(it != widgets_.end()) { - delete it->second; - widgets_.erase(it); - return 0; - } - return -1; + std::map::iterator it = widgets_.find(name); + if (it != widgets_.end()) { + delete it->second; + widgets_.erase(it); + return 0; + } + return -1; } -std::string LCDCore::AddWidget(std::string layout, int row, - int col, int layer, std::string object) { - std::stringstream strm; - std::string name; - strm << layout << ":" << "script_widget" << 0; +std::string LCDCore::AddWidget(std::string layout, int row, int col, int layer, + std::string object) { + std::stringstream strm; + std::string name; + strm << layout << ":" + << "script_widget" << 0; + strm >> name; + strm.clear(); + strm.str(""); + int i = 0; + while (widgets_.find(name) != widgets_.end()) { + strm << layout << ":" + << "script_widget" + << ":" << ++i; strm >> name; strm.clear(); strm.str(""); - int i = 0; - while(widgets_.find(name) != widgets_.end()) { - strm << layout << ":" << "script_widget" << ":" << ++i; - strm >> name; - strm.clear(); - strm.str(""); - } - - Json::Reader reader; - Json::Value *root = new Json::Value();; - if(!reader.parse(object, *root)) { - LCDError("Error parsing script: %s", reader.getFormatedErrorMessages().c_str()); - return ""; - } - - Json::Value *type = CFG_Fetch_Raw(root, "type"); - - if(type) { - Widget *widget = (Widget *)NULL; - if(type->asString() == "text") { - widget = (Widget *) new WidgetText(this, name, root, - row, col, layer); - } else if (type->asString() == "bar") { - widget = (Widget *) new WidgetBar(this, name, root, - row, col, layer); - } else if (type->asString() == "icon") { - widget = (Widget *) new WidgetIcon(this, name, root, - row, col, layer); - } else if (type->asString() == "histogram") { - widget = (Widget *) new WidgetHistogram(this, name, root, - row, col, layer); - } else if (type->asString() == "bignums") { - widget = (Widget *) new WidgetBignums(this, name, root, - row, col, layer); - } else if (type->asString() == "key") { - widget = (Widget *) new WidgetKey(this, name, root); - } else if (type->asString() == "timer") { - widget = (Widget *) new WidgetTimer(this, name, root); - } else if (type->asString() == "script") { - widget = (Widget *) new WidgetScript(this, name, root); - } else { - LCDError("Unknown widget type: %s", type->asCString()); - } - if(widget) { - widgets_[name] = widget; - widget->Start(); - } - delete type; - return name; + } + + Json::Reader reader; + Json::Value *root = new Json::Value(); + ; + if (!reader.parse(object, *root)) { + LCDError("Error parsing script: %s", + reader.getFormatedErrorMessages().c_str()); + return ""; + } + + Json::Value *type = CFG_Fetch_Raw(root, "type"); + + if (type) { + Widget *widget = (Widget *)NULL; + if (type->asString() == "text") { + widget = (Widget *)new WidgetText(this, name, root, row, col, layer); + } else if (type->asString() == "bar") { + widget = (Widget *)new WidgetBar(this, name, root, row, col, layer); + } else if (type->asString() == "icon") { + widget = (Widget *)new WidgetIcon(this, name, root, row, col, layer); + } else if (type->asString() == "histogram") { + widget = (Widget *)new WidgetHistogram(this, name, root, row, col, layer); + } else if (type->asString() == "bignums") { + widget = (Widget *)new WidgetBignums(this, name, root, row, col, layer); + } else if (type->asString() == "key") { + widget = (Widget *)new WidgetKey(this, name, root); + } else if (type->asString() == "timer") { + widget = (Widget *)new WidgetTimer(this, name, root); + } else if (type->asString() == "script") { + widget = (Widget *)new WidgetScript(this, name, root); } else { - LCDError("Widget has no type <%s>", object.c_str()); + LCDError("Unknown widget type: %s", type->asCString()); } - return ""; + if (widget) { + widgets_[name] = widget; + widget->Start(); + } + delete type; + return name; + } else { + LCDError("Widget has no type <%s>", object.c_str()); + } + return ""; } -int LCDCore::MoveWidget(std::string widget, int row, int col) { - return 0; -} +int LCDCore::MoveWidget(std::string widget, int row, int col) { return 0; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDCore.h b/libvisual-plugins/plugins/actor/lcdcontrol/LCDCore.h index 7dabaec67..ea3979d92 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDCore.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDCore.h @@ -57,113 +57,113 @@ namespace LCD { -//class PluginLCD; +// class PluginLCD; class LCDControl; struct widget_template { - std::string key; - int row; - int col; - int layer; + std::string key; + int row; + int col; + int layer; }; -class LCDCore: public virtual Evaluator, public CFG { - std::vector layouts_; - std::string current_layout_; - std::string last_layout_; - std::vector static_widgets_; - std::map > widget_templates_; - std::map widgets_; - std::map keyless_layouts_; - int type_; - int layout_timeout_; - int transition_speed_; - int direction_; - bool is_transitioning_; - bool clear_on_layout_change_; - bool transitions_off_; - LCDTimer *timer_; - LCDTimer *transition_timer_; - VisEventQueue *eventqueue_; - - //PluginLCD *pluginLCD; - - protected: - LCDBase *lcd_; - std::string name_; - LCDControl *app_; - - public: - LCDCore(LCDControl *app, std::string name, Json::Value *config, - int type, VisEventQueue *eventqueue, LCDBase *lcd = (LCDBase *)NULL); - virtual ~LCDCore(); - virtual void CFGSetup(); - void BuildLayouts(); - void StartLayout(std::string key = ""); - int GetType() { return type_; } - LCDBase *GetLCD() { return lcd_; } - virtual void Connect(){}; - virtual void SetupDevice(){}; - virtual void TakeDown(){}; - VisVideo *GetVideo(){ return lcd_->GetVideo(); }; - std::map GetWidgets(); - std::string CFG_Key(); - std::vector GetLayouts() { return layouts_; } - int GetDirection() { return direction_; } - std::string GetCurrentLayout() { return current_layout_; } - std::string GetLastLayout() { return last_layout_; } - std::string GetName() { return name_; } - LCDControl *GetApp() { return app_; } - bool ClearOnLayoutChange() { return clear_on_layout_change_; } - bool IsActive(); - void TextSetSpecialChars() {} - void LayoutChangeBefore() {} - void LayoutChangeAfter() {} - void TextSpecialCharChanged(int i) {} - void ChangeLayout(); - void StopLayout(std::string layout); - void StartTransition(std::string transition); - void LayoutTransition(); - void TransitionFinished(); - void Transition(int); - void KeypadEvent(const int k); - int ResizeLCD(int row, int col); - void SelectLayout(std::string layout); - int RemoveWidget(std::string name); - std::string AddWidget(std::string layout, int row, int col, - int layer, std::string object); - int MoveWidget(std::string widget, int rows, int cols); - - LCDTimerBin *timers_; - - int gen_index_; - - _generator(layoutGenerator) { - LCDCore *obj; - layoutGenerator(int j, LCDCore *v, bool init = false) { - obj = v; - if(init) obj->gen_index_ = 1; - obj->gen_index_+=j-1; - if(obj->gen_index_ >= (int)obj->GetLayouts().size()) - obj->gen_index_ = 0; - if(obj->gen_index_ < 0) - obj->gen_index_ = obj->GetLayouts().size() - 1; - } - _emit(std::string) - while(true) { - _yield(obj->GetLayouts()[obj->gen_index_++]); - if(obj->gen_index_ >= (int)obj->GetLayouts().size()) - obj->gen_index_ = 0; - } - _stop; - }; - - void InitGen(int i = 0) { gen_index_ = i; } - private: - layoutGenerator gen_; +class LCDCore : public virtual Evaluator, public CFG { + std::vector layouts_; + std::string current_layout_; + std::string last_layout_; + std::vector static_widgets_; + std::map> widget_templates_; + std::map widgets_; + std::map keyless_layouts_; + int type_; + int layout_timeout_; + int transition_speed_; + int direction_; + bool is_transitioning_; + bool clear_on_layout_change_; + bool transitions_off_; + LCDTimer *timer_; + LCDTimer *transition_timer_; + VisEventQueue *eventqueue_; + + // PluginLCD *pluginLCD; + +protected: + LCDBase *lcd_; + std::string name_; + LCDControl *app_; + +public: + LCDCore(LCDControl *app, std::string name, Json::Value *config, int type, + VisEventQueue *eventqueue, LCDBase *lcd = (LCDBase *)NULL); + virtual ~LCDCore(); + virtual void CFGSetup(); + void BuildLayouts(); + void StartLayout(std::string key = ""); + int GetType() { return type_; } + LCDBase *GetLCD() { return lcd_; } + virtual void Connect(){}; + virtual void SetupDevice(){}; + virtual void TakeDown(){}; + VisVideo *GetVideo() { return lcd_->GetVideo(); }; + std::map GetWidgets(); + std::string CFG_Key(); + std::vector GetLayouts() { return layouts_; } + int GetDirection() { return direction_; } + std::string GetCurrentLayout() { return current_layout_; } + std::string GetLastLayout() { return last_layout_; } + std::string GetName() { return name_; } + LCDControl *GetApp() { return app_; } + bool ClearOnLayoutChange() { return clear_on_layout_change_; } + bool IsActive(); + void TextSetSpecialChars() {} + void LayoutChangeBefore() {} + void LayoutChangeAfter() {} + void TextSpecialCharChanged(int i) {} + void ChangeLayout(); + void StopLayout(std::string layout); + void StartTransition(std::string transition); + void LayoutTransition(); + void TransitionFinished(); + void Transition(int); + void KeypadEvent(const int k); + int ResizeLCD(int row, int col); + void SelectLayout(std::string layout); + int RemoveWidget(std::string name); + std::string AddWidget(std::string layout, int row, int col, int layer, + std::string object); + int MoveWidget(std::string widget, int rows, int cols); + + LCDTimerBin *timers_; + + int gen_index_; + + _generator(layoutGenerator) { + LCDCore *obj; + layoutGenerator(int j, LCDCore *v, bool init = false) { + obj = v; + if (init) + obj->gen_index_ = 1; + obj->gen_index_ += j - 1; + if (obj->gen_index_ >= (int)obj->GetLayouts().size()) + obj->gen_index_ = 0; + if (obj->gen_index_ < 0) + obj->gen_index_ = obj->GetLayouts().size() - 1; + } + _emit(std::string) while (true) { + _yield(obj->GetLayouts()[obj->gen_index_++]); + if (obj->gen_index_ >= (int)obj->GetLayouts().size()) + obj->gen_index_ = 0; + } + _stop; + }; + + void InitGen(int i = 0) { gen_index_ = i; } + +private: + layoutGenerator gen_; }; -}; // End namespace - +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDEvent.h b/libvisual-plugins/plugins/actor/lcdcontrol/LCDEvent.h index 0c56bc3f6..a6730e293 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDEvent.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDEvent.h @@ -3,32 +3,24 @@ #include -typedef void (*LCDEventFunc) (void *data); +typedef void (*LCDEventFunc)(void *data); -namespace LCD -{ +namespace LCD { class LCDEvent { - public: - LCDEventFunc mFunc; - void *mData; +public: + LCDEventFunc mFunc; + void *mData; - LCDEvent(LCDEventFunc func, void *data) - { + LCDEvent(LCDEventFunc func, void *data) { - mFunc = func; - mData = data; - } + mFunc = func; + mData = data; + } - ~LCDEvent() - { - } + ~LCDEvent() {} - void Fire() - { - mFunc(mData); - } -}; + void Fire() { mFunc(mData); } }; +}; // namespace LCD #endif - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDGraphic.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/LCDGraphic.cpp index 7325c8cc5..d7e8ef3c8 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDGraphic.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDGraphic.cpp @@ -48,7 +48,7 @@ #include #if _OPENMP -# include +#include #endif #undef NULL @@ -61,919 +61,891 @@ extern int Font_6x8[256][8]; extern int Font_6x8_bold[256][8]; extern int VISUALIZATION_CHARS[6][9]; -void graphic_update(void *data) -{ - LCDGraphic *graphic = (LCDGraphic *)data; - graphic->GraphicBlitAll(); +void graphic_update(void *data) { + LCDGraphic *graphic = (LCDGraphic *)data; + graphic->GraphicBlitAll(); } -LCDGraphic::LCDGraphic(LCDCore *v) : - FG_COL(0x00, 0x00, 0x00, 0xFF), - BG_COL(0xFF, 0xFF, 0xFF, 0xFF), - BL_COL(0xFF, 0xFF, 0xFF, 0x00), - NO_COL(0x00, 0x00, 0x00, 0x00) { - - visitor_ = v; - - - Json::Value *val = v->CFG_Fetch_Raw(v->CFG_Get_Root(), - v->GetName() + ".foreground", new Json::Value("ff000000")); - - if(color2RGBA(val->asCString(), &FG_COL) < 0 ) { - LCDError("%s: ignoring illegal color '%s'", - v->GetName().c_str(), val->asCString()); - } - delete val; - - val = v->CFG_Fetch_Raw(v->CFG_Get_Root(), - v->GetName() + ".background", new Json::Value("ffffffff")); - if(color2RGBA(val->asCString(), &BG_COL) < 0 ) { - LCDError("%s: ignoring illegal color '%s'", - v->GetName().c_str(), val->asCString()); - } - delete val; - - val = v->CFG_Fetch_Raw(v->CFG_Get_Root(), - v->GetName() + ".basecolor", new Json::Value("00000000")); - - if(color2RGBA(val->asCString(), &BL_COL) < 0) { - LCDError("%s: ignoring illegal color '%s'", - v->GetName().c_str(), val->asCString()); - } - delete val; - - val = v->CFG_Fetch(v->CFG_Get_Root(), - v->GetName() + ".fill", new Json::Value(0)); - fill_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(v->CFG_Get_Root(), v->GetName() + ".refresh-rate", - new Json::Value(10)); - refresh_rate_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(v->CFG_Get_Root(), - v->GetName() + ".inverted", new Json::Value(0)); - INVERTED = val->asInt(); - delete val; - - GraphicRealBlit = NULL; - - transition_tick_ = 0; - transitioning_ = false; - - timer_ = v->timers_->AddTimer(graphic_update, this, refresh_rate_, true); - - //QObject::connect(&wrapper_, SIGNAL(_GraphicUpdate(int, int, int, int)), - // &wrapper_, SLOT(GraphicUpdate(int, int, int, int))); - -/* - update_thread_ = new LCDGraphicUpdateThread(this); - - graphic_wrapper_ = new LCDGraphicWrapper(this); - - QObject::connect(v->GetWrapper(), SIGNAL(_ResizeBefore(int, int)), - graphic_wrapper_, SLOT(ResizeBefore(int, int))); - QObject::connect(v->GetWrapper(), SIGNAL(_ResizeAfter()), - graphic_wrapper_, SLOT(ResizeAfter())); - QObject::connect(v->GetWrapper(), SIGNAL(_LayoutChangeBefore()), - graphic_wrapper_, SLOT(LayoutChangeBefore())); - QObject::connect(v->GetWrapper(), SIGNAL(_LayoutChangeAfter()), - graphic_wrapper_, SLOT(LayoutChangeAfter())); -*/ +LCDGraphic::LCDGraphic(LCDCore *v) + : FG_COL(0x00, 0x00, 0x00, 0xFF), BG_COL(0xFF, 0xFF, 0xFF, 0xFF), + BL_COL(0xFF, 0xFF, 0xFF, 0x00), NO_COL(0x00, 0x00, 0x00, 0x00) { + + visitor_ = v; + + Json::Value *val = + v->CFG_Fetch_Raw(v->CFG_Get_Root(), v->GetName() + ".foreground", + new Json::Value("ff000000")); + + if (color2RGBA(val->asCString(), &FG_COL) < 0) { + LCDError("%s: ignoring illegal color '%s'", v->GetName().c_str(), + val->asCString()); + } + delete val; + + val = v->CFG_Fetch_Raw(v->CFG_Get_Root(), v->GetName() + ".background", + new Json::Value("ffffffff")); + if (color2RGBA(val->asCString(), &BG_COL) < 0) { + LCDError("%s: ignoring illegal color '%s'", v->GetName().c_str(), + val->asCString()); + } + delete val; + + val = v->CFG_Fetch_Raw(v->CFG_Get_Root(), v->GetName() + ".basecolor", + new Json::Value("00000000")); + + if (color2RGBA(val->asCString(), &BL_COL) < 0) { + LCDError("%s: ignoring illegal color '%s'", v->GetName().c_str(), + val->asCString()); + } + delete val; + + val = v->CFG_Fetch(v->CFG_Get_Root(), v->GetName() + ".fill", + new Json::Value(0)); + fill_ = val->asInt(); + delete val; + + val = v->CFG_Fetch(v->CFG_Get_Root(), v->GetName() + ".refresh-rate", + new Json::Value(10)); + refresh_rate_ = val->asInt(); + delete val; + + val = v->CFG_Fetch(v->CFG_Get_Root(), v->GetName() + ".inverted", + new Json::Value(0)); + INVERTED = val->asInt(); + delete val; + + GraphicRealBlit = NULL; + + transition_tick_ = 0; + transitioning_ = false; + + timer_ = v->timers_->AddTimer(graphic_update, this, refresh_rate_, true); + + // QObject::connect(&wrapper_, SIGNAL(_GraphicUpdate(int, int, int, int)), + // &wrapper_, SLOT(GraphicUpdate(int, int, int, int))); + + /* + update_thread_ = new LCDGraphicUpdateThread(this); + + graphic_wrapper_ = new LCDGraphicWrapper(this); + + QObject::connect(v->GetWrapper(), SIGNAL(_ResizeBefore(int, int)), + graphic_wrapper_, SLOT(ResizeBefore(int, int))); + QObject::connect(v->GetWrapper(), SIGNAL(_ResizeAfter()), + graphic_wrapper_, SLOT(ResizeAfter())); + QObject::connect(v->GetWrapper(), SIGNAL(_LayoutChangeBefore()), + graphic_wrapper_, SLOT(LayoutChangeBefore())); + QObject::connect(v->GetWrapper(), SIGNAL(_LayoutChangeAfter()), + graphic_wrapper_, SLOT(LayoutChangeAfter())); + */ } LCDGraphic::~LCDGraphic() { - //update_thread_->wait(); - for(int l = 0; l < LAYERS; l++ ) { - free(DisplayFB[l]); - free(LayoutFB[l]); - free(TransitionFB[l]); - visual_video_unref(VideoFB[l]); - } - free(DisplayFB); - free(LayoutFB); - free(TransitionFB); - free(VideoFB); - visual_video_unref(video_); + // update_thread_->wait(); + for (int l = 0; l < LAYERS; l++) { + free(DisplayFB[l]); + free(LayoutFB[l]); + free(TransitionFB[l]); + visual_video_unref(VideoFB[l]); + } + free(DisplayFB); + free(LayoutFB); + free(TransitionFB); + free(VideoFB); + visual_video_unref(video_); } +VisVideo *LCDGraphic::GetVideo(int layer) { + VisVideo *video = + visual_video_new_with_buffer(LCOLS, LROWS, VISUAL_VIDEO_DEPTH_32BIT); -VisVideo *LCDGraphic::GetVideo(int layer) -{ - VisVideo *video = visual_video_new_with_buffer(LCOLS, LROWS, VISUAL_VIDEO_DEPTH_32BIT); - - uint32_t *pixels = (uint32_t *)visual_video_get_pixels(video); + uint32_t *pixels = (uint32_t *)visual_video_get_pixels(video); #if _OPENMP -# pragma omp parallel -# pragma omp for +#pragma omp parallel +#pragma omp for #endif - for(int n = 0; n < LCOLS * LROWS; n++) - { - pixels[n] = DisplayFB[layer][n].ToInt(); - } + for (int n = 0; n < LCOLS * LROWS; n++) { + pixels[n] = DisplayFB[layer][n].ToInt(); + } - return video; + return video; } -VisVideo *LCDGraphic::GetVideo() -{ - char *pixels = (char *)visual_video_get_pixels(video_); - memset(pixels, 0, visual_video_get_size(video_)); +VisVideo *LCDGraphic::GetVideo() { + char *pixels = (char *)visual_video_get_pixels(video_); + memset(pixels, 0, visual_video_get_size(video_)); - //int i = 0, num_threads = omp_get_num_threads(); + // int i = 0, num_threads = omp_get_num_threads(); #if _OPENMP -# pragma omp parallel -# pragma omp for +#pragma omp parallel +#pragma omp for #endif - for(int row = 0; row < LROWS; row++) - { - for(int col = 0; col < LCOLS; col++) - { - int n = row * video_->get_pitch() + col * 4; - RGBA rgb = GraphicBlend(row, col); - pixels[n] = rgb.R; - pixels[n+1] = rgb.G; - pixels[n+2] = rgb.B; - pixels[n+3] = rgb.A; - } + for (int row = 0; row < LROWS; row++) { + for (int col = 0; col < LCOLS; col++) { + int n = row * video_->get_pitch() + col * 4; + RGBA rgb = GraphicBlend(row, col); + pixels[n] = rgb.R; + pixels[n + 1] = rgb.G; + pixels[n + 2] = rgb.B; + pixels[n + 3] = rgb.A; } + } - return video_; + return video_; } -void LCDGraphic::LayoutChangeBefore() { - GraphicFill(); -} +void LCDGraphic::LayoutChangeBefore() { GraphicFill(); } -void LCDGraphic::LayoutChangeAfter() { -} +void LCDGraphic::LayoutChangeAfter() {} void LCDGraphic::GraphicStart() { - is_resizing_ = false; - timer_->Start(); + is_resizing_ = false; + timer_->Start(); } -void LCDGraphic::GraphicStop() -{ - timer_->Stop(); -} +void LCDGraphic::GraphicStop() { timer_->Stop(); } -void LCDGraphic::GraphicInit(const int rows, const int cols, - const int yres, const int xres, const int layers, const bool clear_on_layout_change) { -cout << "rows " << rows << " cols " << cols << "-----------======================\n"; - LROWS = rows; - LCOLS = cols; - YRES = yres; - XRES = xres; - LAYERS = layers; - clear_on_layout_change_ = clear_on_layout_change; +void LCDGraphic::GraphicInit(const int rows, const int cols, const int yres, + const int xres, const int layers, + const bool clear_on_layout_change) { + cout << "rows " << rows << " cols " << cols + << "-----------======================\n"; + LROWS = rows; + LCOLS = cols; + YRES = yres; + XRES = xres; + LAYERS = layers; + clear_on_layout_change_ = clear_on_layout_change; - video_ = visual_video_new_with_buffer(LCOLS, LROWS, VISUAL_VIDEO_DEPTH_32BIT); + video_ = visual_video_new_with_buffer(LCOLS, LROWS, VISUAL_VIDEO_DEPTH_32BIT); - DisplayFB = (RGBA **)malloc(sizeof(RGBA *) * layers); + DisplayFB = (RGBA **)malloc(sizeof(RGBA *) * layers); - for(int l = 0; l < layers; l++) { - DisplayFB[l] = (RGBA *)malloc(sizeof(RGBA) * rows * cols); - } + for (int l = 0; l < layers; l++) { + DisplayFB[l] = (RGBA *)malloc(sizeof(RGBA) * rows * cols); + } - LayoutFB = (RGBA **)malloc(sizeof(RGBA *) * layers); + LayoutFB = (RGBA **)malloc(sizeof(RGBA *) * layers); - for(int l = 0; l < layers; l++) { - LayoutFB[l] = (RGBA *)malloc(sizeof(RGBA) * rows * cols); - } + for (int l = 0; l < layers; l++) { + LayoutFB[l] = (RGBA *)malloc(sizeof(RGBA) * rows * cols); + } - TransitionFB = (RGBA **)malloc(sizeof(RGBA *) * layers); + TransitionFB = (RGBA **)malloc(sizeof(RGBA *) * layers); - for( int l = 0; l < layers; l++) { - TransitionFB[l] = (RGBA *)malloc(sizeof(RGBA) * rows * cols); - } + for (int l = 0; l < layers; l++) { + TransitionFB[l] = (RGBA *)malloc(sizeof(RGBA) * rows * cols); + } - VideoFB = (VisVideo **)malloc(sizeof(VisVideo) * layers); + VideoFB = (VisVideo **)malloc(sizeof(VisVideo) * layers); - for( int l = 0; l < layers; l++) { - VideoFB[l] = visual_video_new_with_buffer(LCOLS, LROWS, VISUAL_VIDEO_DEPTH_32BIT); - visual_video_fill_color(VideoFB[l], NO_COL.ToColor()); - } + for (int l = 0; l < layers; l++) { + VideoFB[l] = + visual_video_new_with_buffer(LCOLS, LROWS, VISUAL_VIDEO_DEPTH_32BIT); + visual_video_fill_color(VideoFB[l], NO_COL.ToColor()); + } - for(int l = 0; l < layers; l++) { - for(int i = 0; i < cols * rows; i++) { - DisplayFB[l][i] = NO_COL; - LayoutFB[l][i] = NO_COL; - TransitionFB[l][i] = NO_COL; - } + for (int l = 0; l < layers; l++) { + for (int i = 0; i < cols * rows; i++) { + DisplayFB[l][i] = NO_COL; + LayoutFB[l][i] = NO_COL; + TransitionFB[l][i] = NO_COL; } + } - update_window_.R = rows - 1; - update_window_.C = cols - 1; - update_window_.H = 0; - update_window_.W = 0; + update_window_.R = rows - 1; + update_window_.C = cols - 1; + update_window_.H = 0; + update_window_.W = 0; } int LCDGraphic::ResizeLCD(int rows, int cols) { - RGBA *tmp; - - for(int l = 0; l < LAYERS; l++) { - free(DisplayFB[l]); - free(LayoutFB[l]); - free(TransitionFB[l]); - tmp = (RGBA *)malloc(rows * cols * sizeof(RGBA)); - if(tmp) { - DisplayFB[l] = tmp; - } else { - return -1; - } - tmp = (RGBA *)malloc(rows * cols * sizeof(RGBA)); - if(tmp) { - LayoutFB[l] = tmp; - } else { - return -1; - } - tmp = (RGBA *)malloc(rows * cols * sizeof(RGBA)); - if(tmp) { - TransitionFB[l] = tmp; - } else { - return -1; - } - for(int n = 0; n < rows * cols; n++) { - if(l == 0 && fill_) - DisplayFB[l][n] = BG_COL; - else - DisplayFB[l][n] = NO_COL; - LayoutFB[l][n] = NO_COL; - TransitionFB[l][n] = NO_COL; - } + RGBA *tmp; + + for (int l = 0; l < LAYERS; l++) { + free(DisplayFB[l]); + free(LayoutFB[l]); + free(TransitionFB[l]); + tmp = (RGBA *)malloc(rows * cols * sizeof(RGBA)); + if (tmp) { + DisplayFB[l] = tmp; + } else { + return -1; } - LROWS = update_window_.H = rows; - DROWS = rows; - LCOLS = update_window_.W = cols; - DCOLS = cols; - update_window_.R = 0; - update_window_.C = 0; - return 0; + tmp = (RGBA *)malloc(rows * cols * sizeof(RGBA)); + if (tmp) { + LayoutFB[l] = tmp; + } else { + return -1; + } + tmp = (RGBA *)malloc(rows * cols * sizeof(RGBA)); + if (tmp) { + TransitionFB[l] = tmp; + } else { + return -1; + } + for (int n = 0; n < rows * cols; n++) { + if (l == 0 && fill_) + DisplayFB[l][n] = BG_COL; + else + DisplayFB[l][n] = NO_COL; + LayoutFB[l][n] = NO_COL; + TransitionFB[l][n] = NO_COL; + } + } + LROWS = update_window_.H = rows; + DROWS = rows; + LCOLS = update_window_.W = cols; + DCOLS = cols; + update_window_.R = 0; + update_window_.C = 0; + return 0; } -void LCDGraphic::ResizeBefore(int rows, int cols) { - is_resizing_ = true; -} +void LCDGraphic::ResizeBefore(int rows, int cols) { is_resizing_ = true; } -void LCDGraphic::ResizeAfter() { - is_resizing_ = false; -} +void LCDGraphic::ResizeAfter() { is_resizing_ = false; } -#define max(a, b) ((a>b)?a:b) -#define min(a, b) ((a b) ? a : b) +#define min(a, b) ((a < b) ? a : b) void LCDGraphic::GraphicUpdate(int row, int col, int height, int width) { - int y1 = row + height; - int x1 = col + width; - int y2 = update_window_.R + update_window_.H; - int x2 = update_window_.C + update_window_.W; - - //row = max((int)LROWS - 1, row); - //col = max((int)LCOLS - 1, col); - - if(y1 > y2) - update_window_.H = (y1 - y2) + height; - if(x1 > x2) - update_window_.W = (x1 - x2) + width;; - - if(row < update_window_.R) { - update_window_.R = row; - } - if(col < update_window_.C) { - update_window_.C = col; - } - -/* - int tmp = max((int)LROWS - 1, row + height); - int delta = LROWS - tmp; - update_window_.H-=delta; - - tmp = max((int)LCOLS - 1, col + width); - delta = LCOLS - tmp; - update_window_.W-=delta; -*/ + int y1 = row + height; + int x1 = col + width; + int y2 = update_window_.R + update_window_.H; + int x2 = update_window_.C + update_window_.W; + + // row = max((int)LROWS - 1, row); + // col = max((int)LCOLS - 1, col); + + if (y1 > y2) + update_window_.H = (y1 - y2) + height; + if (x1 > x2) + update_window_.W = (x1 - x2) + width; + ; + + if (row < update_window_.R) { + update_window_.R = row; + } + if (col < update_window_.C) { + update_window_.C = col; + } + + /* + int tmp = max((int)LROWS - 1, row + height); + int delta = LROWS - tmp; + update_window_.H-=delta; + + tmp = max((int)LCOLS - 1, col + width); + delta = LCOLS - tmp; + update_window_.W-=delta; + */ } void LCDGraphic::GraphicDraw() { - while(visitor_->IsActive()) { - if(update_window_.H == 0 || update_window_.W == 0 || - is_resizing_ || transitioning_) { - usleep(refresh_rate_ * 1000); - continue; - } - - //graphic_mutex_.lock(); - GraphicBlit(update_window_.R, update_window_.C, update_window_.H, update_window_.W); - //graphic_mutex_.unlock(); - update_window_.R = LROWS - 1; - update_window_.C = LCOLS - 1; - update_window_.H = 0; - update_window_.W = 0; - usleep(refresh_rate_ * 1000); + while (visitor_->IsActive()) { + if (update_window_.H == 0 || update_window_.W == 0 || is_resizing_ || + transitioning_) { + usleep(refresh_rate_ * 1000); + continue; } + + // graphic_mutex_.lock(); + GraphicBlit(update_window_.R, update_window_.C, update_window_.H, + update_window_.W); + // graphic_mutex_.unlock(); + update_window_.R = LROWS - 1; + update_window_.C = LCOLS - 1; + update_window_.H = 0; + update_window_.W = 0; + usleep(refresh_rate_ * 1000); + } } -void LCDGraphic::GraphicWindow(int pos, int size, int max, int *wpos, int *wsize) -{ - int p1 = pos; - int p2 = pos + size; +void LCDGraphic::GraphicWindow(int pos, int size, int max, int *wpos, + int *wsize) { + int p1 = pos; + int p2 = pos + size; - *wpos = 0; - *wsize = 0; + *wpos = 0; + *wsize = 0; - if (p1 > max || p2 < 0 || size < 1) - return; + if (p1 > max || p2 < 0 || size < 1) + return; - if (p1 < 0) - p1 = 0; + if (p1 < 0) + p1 = 0; - if (p2 > max) - p2 = max; + if (p2 > max) + p2 = max; - *wpos = p1; - *wsize = p2 - p1; + *wpos = p1; + *wsize = p2 - p1; } -void LCDGraphic::GraphicBlit(const int row, const int col, const int height, const int width) -{ - int r, c, h, w; - GraphicWindow(row, height, LROWS, &r, &h); - GraphicWindow(col, width, LCOLS, &c, &w); +void LCDGraphic::GraphicBlit(const int row, const int col, const int height, + const int width) { + int r, c, h, w; + GraphicWindow(row, height, LROWS, &r, &h); + GraphicWindow(col, width, LCOLS, &c, &w); - GraphicClear(); + GraphicClear(); - if (h > 0 && w > 0) { + if (h > 0 && w > 0) { #if _OPENMP -# pragma omp parallel -# pragma omp for +#pragma omp parallel +#pragma omp for #endif - for(int rr = r; rr < r + h; rr++) { - for(int cc = c; cc < c + w; cc++) { - for(int l = LAYERS - 1; l >= 0; l-- ) { - if(LayoutFB[l][rr * LCOLS + cc] != NO_COL) - DisplayFB[l][rr * LCOLS + cc] = - LayoutFB[l][rr * LCOLS + cc]; - } - } + for (int rr = r; rr < r + h; rr++) { + for (int cc = c; cc < c + w; cc++) { + for (int l = LAYERS - 1; l >= 0; l--) { + if (LayoutFB[l][rr * LCOLS + cc] != NO_COL) + DisplayFB[l][rr * LCOLS + cc] = LayoutFB[l][rr * LCOLS + cc]; } - if(GraphicRealBlit) - GraphicRealBlit(this, r, c, h, w); + } } + if (GraphicRealBlit) + GraphicRealBlit(this, r, c, h, w); + } } -void LCDGraphic::GraphicBlitAll() -{ - GraphicBlit(0, 0, LROWS, LCOLS); -} - -inline RGBA LCDGraphic::GraphicBlend(const int row, const int col, RGBA **buffer) -{ - int l, o; - RGBA p; - RGBA ret; - - if(buffer == NULL) - buffer = DisplayFB; - - ret.R = BL_COL.R; - ret.G = BL_COL.G; - ret.B = BL_COL.B; - ret.A = 0x00; - - /* find first opaque layer */ - /* layers below are fully covered */ - o = LAYERS - 1; - for (l = 0; l < (int)LAYERS; l++) { - p = buffer[l][row * LCOLS + col]; - if (p.A == 255) { - o = l; - break; - } - } - - for (l = o; l >= 0; l--) { - p = buffer[l][row * LCOLS + col]; - if(p.A != 0) - { - if(p.A == 255) { - ret.R = p.R; - ret.G = p.G; - ret.B = p.B; - ret.A = 0xff; - } else { - ret.R = (p.R * p.A + ret.R * (255 - p.A)) / 255; - ret.G = (p.G * p.A + ret.G * (255 - p.A)) / 255; - ret.B = (p.B * p.A + ret.B * (255 - p.A)) / 255; - ret.A = 0xff; - } - } +void LCDGraphic::GraphicBlitAll() { GraphicBlit(0, 0, LROWS, LCOLS); } + +inline RGBA LCDGraphic::GraphicBlend(const int row, const int col, + RGBA **buffer) { + int l, o; + RGBA p; + RGBA ret; + + if (buffer == NULL) + buffer = DisplayFB; + + ret.R = BL_COL.R; + ret.G = BL_COL.G; + ret.B = BL_COL.B; + ret.A = 0x00; + + /* find first opaque layer */ + /* layers below are fully covered */ + o = LAYERS - 1; + for (l = 0; l < (int)LAYERS; l++) { + p = buffer[l][row * LCOLS + col]; + if (p.A == 255) { + o = l; + break; } - if (INVERTED) { - ret.R = 255 - ret.R; - ret.G = 255 - ret.G; - ret.B = 255 - ret.B; + } + + for (l = o; l >= 0; l--) { + p = buffer[l][row * LCOLS + col]; + if (p.A != 0) { + if (p.A == 255) { + ret.R = p.R; + ret.G = p.G; + ret.B = p.B; + ret.A = 0xff; + } else { + ret.R = (p.R * p.A + ret.R * (255 - p.A)) / 255; + ret.G = (p.G * p.A + ret.G * (255 - p.A)) / 255; + ret.B = (p.B * p.A + ret.B * (255 - p.A)) / 255; + ret.A = 0xff; + } } - - return ret; + } + if (INVERTED) { + ret.R = 255 - ret.R; + ret.G = 255 - ret.G; + ret.B = 255 - ret.B; + } + + return ret; } - /****************************************/ /*** generic text handling ***/ /****************************************/ -void LCDGraphic::GraphicRender(const int layer, const int row, const int col, - const RGBA fg, const RGBA bg, const char *txt, bool bold, int offset, std::string layout) -{ - int c, r, x, y, len; +void LCDGraphic::GraphicRender(const int layer, const int row, const int col, + const RGBA fg, const RGBA bg, const char *txt, + bool bold, int offset, std::string layout) { + int c, r, x, y, len; - //LCDError("LCDGraphic::GraphicRender"); + // LCDError("LCDGraphic::GraphicRender"); - /* sanity checks */ - if (layer < 0 || layer >= (int)LAYERS) { - LCDError("%s: layer %d out of bounds (0..%d)", - visitor_->GetName().c_str(), layer, LAYERS - 1); - return; - } + /* sanity checks */ + if (layer < 0 || layer >= (int)LAYERS) { + LCDError("%s: layer %d out of bounds (0..%d)", visitor_->GetName().c_str(), + layer, LAYERS - 1); + return; + } - len = strlen(txt); + len = strlen(txt); - r = row; - c = col; + r = row; + c = col; - if(c < 0) - c = 0; - else if(c >= LCOLS) - c = LCOLS - 1; + if (c < 0) + c = 0; + else if (c >= LCOLS) + c = LCOLS - 1; - RGBA **fb; + RGBA **fb; - if(IsTransitioning() && layout == GetTransitionLayout()) - fb = TransitionFB; - else - fb = LayoutFB; + if (IsTransitioning() && layout == GetTransitionLayout()) + fb = TransitionFB; + else + fb = LayoutFB; - if(offset < 0 && c < LCOLS - 2) { - c+=XRES-(XRES+offset); - } else if (offset > 0 && c < LCOLS - 2) { - c-=offset; - } + if (offset < 0 && c < LCOLS - 2) { + c += XRES - (XRES + offset); + } else if (offset > 0 && c < LCOLS - 2) { + c -= offset; + } - /* render text into layout FB */ + /* render text into layout FB */ - while( *txt != '\0') { - int *chr; + while (*txt != '\0') { + int *chr; - if(bold) { - chr = Font_6x8_bold[(int) *(unsigned char *) txt]; - } else { - chr = Font_6x8[(int) *(unsigned char *) txt]; - } + if (bold) { + chr = Font_6x8_bold[(int)*(unsigned char *)txt]; + } else { + chr = Font_6x8[(int)*(unsigned char *)txt]; + } - for (y = 0; y < YRES && y + r < LROWS; y++) { - int mask = 1 << XRES; - for (x = 0; x < XRES && x + c < LCOLS; x++) { - mask >>= 1; - if (chr[y] & mask) - fb[layer][(r + y) * LCOLS + c + x] = fg; - else - fb[layer][(r + y) * LCOLS + c + x] = bg; - } - } - c += XRES; - if (offset > 0 && strlen(txt) == 1) { - for(y = 0; y < YRES && y + r < LROWS; y++) { - for(x = 0; x < XRES && x + c + offset < LCOLS; x++) { - fb[layer][(r + y) * LCOLS + c + x] = bg; - } - } + for (y = 0; y < YRES && y + r < LROWS; y++) { + int mask = 1 << XRES; + for (x = 0; x < XRES && x + c < LCOLS; x++) { + mask >>= 1; + if (chr[y] & mask) + fb[layer][(r + y) * LCOLS + c + x] = fg; + else + fb[layer][(r + y) * LCOLS + c + x] = bg; + } + } + c += XRES; + if (offset > 0 && strlen(txt) == 1) { + for (y = 0; y < YRES && y + r < LROWS; y++) { + for (x = 0; x < XRES && x + c + offset < LCOLS; x++) { + fb[layer][(r + y) * LCOLS + c + x] = bg; } - txt++; + } } + txt++; + } - /* flush area */ - if(!transitioning_) - GraphicUpdate(row, col, YRES, XRES * len); + /* flush area */ + if (!transitioning_) + GraphicUpdate(row, col, YRES, XRES * len); } void LCDGraphic::GraphicClear() { #if _OPENMP -# pragma omp parallel -# pragma omp for +#pragma omp parallel +#pragma omp for #endif - for (int l = 0; l < LAYERS; l++) { - for (int i = 0; i < LCOLS * LROWS; i++) { - DisplayFB[l][i] = NO_COL; - } + for (int l = 0; l < LAYERS; l++) { + for (int i = 0; i < LCOLS * LROWS; i++) { + DisplayFB[l][i] = NO_COL; } + } } void LCDGraphic::GraphicFill() { - for(int i = 0; i < LCOLS * LROWS; i++) { - DisplayFB[0][i] = BG_COL; - LayoutFB[0][i] = BG_COL; - TransitionFB[0][i] = BG_COL; - } + for (int i = 0; i < LCOLS * LROWS; i++) { + DisplayFB[0][i] = BG_COL; + LayoutFB[0][i] = BG_COL; + TransitionFB[0][i] = BG_COL; + } - GraphicBlit(0, 0, LROWS, LCOLS); + GraphicBlit(0, 0, LROWS, LCOLS); } - -RGBA LCDGraphic::GraphicRGB(const int row, const int col) -{ - return GraphicBlend(row, col); +RGBA LCDGraphic::GraphicRGB(const int row, const int col) { + return GraphicBlend(row, col); } - -unsigned char LCDGraphic::GraphicGray(const int row, const int col) -{ - RGBA p = GraphicBlend(row, col); - return (77 * p.R + 150 * p.G + 28 * p.B) / 255; +unsigned char LCDGraphic::GraphicGray(const int row, const int col) { + RGBA p = GraphicBlend(row, col); + return (77 * p.R + 150 * p.G + 28 * p.B) / 255; } - -unsigned char LCDGraphic::GraphicBlack(const int row, const int col) -{ - return GraphicGray(row, col) < 127; +unsigned char LCDGraphic::GraphicBlack(const int row, const int col) { + return GraphicGray(row, col) < 127; } -void LCDGraphic::DrawSpecialChar(const int row, const int col, - const int height, const int width, const int layer, - const RGBA fg, const RGBA bg, SpecialChar ch, std::string layout) { - - RGBA *fb; - - if(IsTransitioning() && layout == GetTransitionLayout()) - fb = TransitionFB[layer]; - else - fb = LayoutFB[layer]; - - for(int y = row; y < row + height; y++) { - int mask = 1 << width; - for(int x = col; x < col + width; x++) { - mask >>= 1; - if(ch[y - row] & mask) - fb[(row + y) * LCOLS + col + x] = fg; - else - fb[(row + y) * LCOLS + col + x] = bg; - } +void LCDGraphic::DrawSpecialChar(const int row, const int col, const int height, + const int width, const int layer, + const RGBA fg, const RGBA bg, SpecialChar ch, + std::string layout) { + + RGBA *fb; + + if (IsTransitioning() && layout == GetTransitionLayout()) + fb = TransitionFB[layer]; + else + fb = LayoutFB[layer]; + + for (int y = row; y < row + height; y++) { + int mask = 1 << width; + for (int x = col; x < col + width; x++) { + mask >>= 1; + if (ch[y - row] & mask) + fb[(row + y) * LCOLS + col + x] = fg; + else + fb[(row + y) * LCOLS + col + x] = bg; } + } } - void LCD::GraphicDraw(WidgetText *w) { - LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); - RGBA fg, bg; + LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); + RGBA fg, bg; - fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; - bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; + fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; + bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; - lcd->GraphicRender(w->GetLayer(), lcd->YRES * w->GetRow(), - lcd->XRES * w->GetCol(), fg, bg, w->GetBuffer().c_str(), - w->GetBold(), w->GetOffset(), w->GetLayoutBase()); + lcd->GraphicRender(w->GetLayer(), lcd->YRES * w->GetRow(), + lcd->XRES * w->GetCol(), fg, bg, w->GetBuffer().c_str(), + w->GetBold(), w->GetOffset(), w->GetLayoutBase()); } void LCD::GraphicIconDraw(WidgetIcon *w) { - LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); - SpecialChar bitmap; - RGBA fg, bg; - int layer, row, col; - int x, y; - int visible; - - bitmap = w->GetBitmap(); - layer = w->GetLayer(); - row = lcd->YRES * w->GetRow(); - col = lcd->XRES * w->GetCol(); - - fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; - bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; - - /* sanity check */ - if (layer < 0 || layer >= lcd->LAYERS) { - LCDError("%s: layer %d out of bounds (0..%d)", - lcd->GetVisitor()->GetName().c_str(), - layer, lcd->LAYERS - 1); - return; - } - - /* Icon visible? */ - visible = w->GetVisible()->P2INT(); - - RGBA *fb; - - if(lcd->IsTransitioning() && - w->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB[layer]; - else - fb = lcd->LayoutFB[layer]; - - //lcd->graphic_mutex_.lock(); - - /* render icon */ - for (y = 0; y < lcd->YRES; y++) { - int mask = 1 << lcd->XRES; - for (x = 0; x < lcd->XRES; x++) { - int i = (row + y) * lcd->LCOLS + col + x; - mask >>= 1; - if (visible) { - if (bitmap[y] & mask) - fb[i] = fg; - else - fb[i] = bg; - } else { - fb[i] = lcd->NO_COL; - } - } + LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); + SpecialChar bitmap; + RGBA fg, bg; + int layer, row, col; + int x, y; + int visible; + + bitmap = w->GetBitmap(); + layer = w->GetLayer(); + row = lcd->YRES * w->GetRow(); + col = lcd->XRES * w->GetCol(); + + fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; + bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; + + /* sanity check */ + if (layer < 0 || layer >= lcd->LAYERS) { + LCDError("%s: layer %d out of bounds (0..%d)", + lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); + return; + } + + /* Icon visible? */ + visible = w->GetVisible()->P2INT(); + + RGBA *fb; + + if (lcd->IsTransitioning() && + w->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB[layer]; + else + fb = lcd->LayoutFB[layer]; + + // lcd->graphic_mutex_.lock(); + + /* render icon */ + for (y = 0; y < lcd->YRES; y++) { + int mask = 1 << lcd->XRES; + for (x = 0; x < lcd->XRES; x++) { + int i = (row + y) * lcd->LCOLS + col + x; + mask >>= 1; + if (visible) { + if (bitmap[y] & mask) + fb[i] = fg; + else + fb[i] = bg; + } else { + fb[i] = lcd->NO_COL; + } } + } + // lcd->graphic_mutex_.unlock(); - //lcd->graphic_mutex_.unlock(); - - /* flush area */ - if(!lcd->IsTransitioning()) - lcd->GraphicUpdate(row, col, lcd->YRES, lcd->XRES); + /* flush area */ + if (!lcd->IsTransitioning()) + lcd->GraphicUpdate(row, col, lcd->YRES, lcd->XRES); } void LCD::GraphicBarDraw(WidgetBar *w) { - LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); - RGBA fg, bg, bar[2]; - int layer, row, col, len, res, rev, max, val1, val2; - int x, y; - DIRECTION dir; - STYLE style; - - layer = w->GetLayer(); - row = lcd->YRES * w->GetRow(); - col = lcd->XRES * w->GetCol(); - dir = w->GetDirection(); - style = w->GetStyle(); - len = w->GetCols(); - - fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; - bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; - - bar[0] = w->GetColorValid()[0] ? w->GetColor()[0] : fg; - bar[1] = w->GetColorValid()[1] ? w->GetColor()[1] : fg; - - /* sanity check */ - if (layer < 0 || layer >= lcd->LAYERS) { - LCDError("%s: layer %d out of bounds (0..%d)", - lcd->GetVisitor()->GetName().c_str(), - layer, lcd->LAYERS - 1); - return; - } - - res = dir & (DIR_EAST | DIR_WEST) ? lcd->XRES : lcd->YRES; - max = len * res; - val1 = w->GetVal1() * (double) (max); - val2 = w->GetVal2() * (double) (max); - - if (val1 < 1) - val1 = 1; - else if (val1 > max) - val1 = max; - - if (val2 < 1) - val2 = 1; - else if (val2 > max) - val2 = max; - - rev = 0; - - RGBA **fb; - - if(lcd->IsTransitioning() && - w->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB; - else - fb = lcd->LayoutFB; - - switch (dir) { - case DIR_WEST: - val1 = max - val1; - val2 = max - val2; - rev = 1; - - case DIR_EAST: - //lcd->graphic_mutex_.lock(); - for (y = 0; y < lcd->YRES; y++) { - int val = y < lcd->YRES / 2 ? val1 : val2; - RGBA bc = y < lcd->YRES / 2 ? bar[0] : bar[1]; - - for (x = 0; x < max; x++) { - if (x < val) - fb[layer][(row + y) * lcd->LCOLS + col + x] = rev ? bg : bc; - else - fb[layer][(row + y) * lcd->LCOLS + col + x] = rev ? bc : bg; - - if (style) { - fb[layer][(row + 0) * lcd->LCOLS + col + x] = fg; - fb[layer][(row + lcd->YRES - 1) * lcd->LCOLS + col + x] = fg; - } - } - if (style) { - fb[layer][(row + y) * lcd->LCOLS + col] = fg; - fb[layer][(row + y) * lcd->LCOLS + col + max - 1] = fg; - } - } - //lcd->graphic_mutex_.unlock(); - break; - - case DIR_NORTH: - val1 = max - val1; - val2 = max - val2; - rev = 1; - - case DIR_SOUTH: - //lcd->graphic_mutex_.lock(); - for (x = 0; x < lcd->XRES; x++) { - int val = x < lcd->XRES / 2 ? val1 : val2; - RGBA bc = x < lcd->XRES / 2 ? bar[0] : bar[1]; - for (y = 0; y < max; y++) { - if (y < val) - fb[layer][(row + y) * lcd->LCOLS + col + x] = rev ? bg : bc; - else - fb[layer][(row + y) * lcd->LCOLS + col + x] = rev ? bc : bg; - if (style) { - fb[layer][(row + y) * lcd->LCOLS + col + 0] = fg; - fb[layer][(row + y) * lcd->LCOLS + col + lcd->XRES - 1] = fg; - } - } - if (style) { - fb[layer][(row + 0) * lcd->LCOLS + col + x] = fg; - fb[layer][(row + max - 1) * lcd->LCOLS + col + x] = fg; - } + LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); + RGBA fg, bg, bar[2]; + int layer, row, col, len, res, rev, max, val1, val2; + int x, y; + DIRECTION dir; + STYLE style; + + layer = w->GetLayer(); + row = lcd->YRES * w->GetRow(); + col = lcd->XRES * w->GetCol(); + dir = w->GetDirection(); + style = w->GetStyle(); + len = w->GetCols(); + + fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; + bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; + + bar[0] = w->GetColorValid()[0] ? w->GetColor()[0] : fg; + bar[1] = w->GetColorValid()[1] ? w->GetColor()[1] : fg; + + /* sanity check */ + if (layer < 0 || layer >= lcd->LAYERS) { + LCDError("%s: layer %d out of bounds (0..%d)", + lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); + return; + } + + res = dir & (DIR_EAST | DIR_WEST) ? lcd->XRES : lcd->YRES; + max = len * res; + val1 = w->GetVal1() * (double)(max); + val2 = w->GetVal2() * (double)(max); + + if (val1 < 1) + val1 = 1; + else if (val1 > max) + val1 = max; + + if (val2 < 1) + val2 = 1; + else if (val2 > max) + val2 = max; + + rev = 0; + + RGBA **fb; + + if (lcd->IsTransitioning() && + w->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB; + else + fb = lcd->LayoutFB; + + switch (dir) { + case DIR_WEST: + val1 = max - val1; + val2 = max - val2; + rev = 1; + + case DIR_EAST: + // lcd->graphic_mutex_.lock(); + for (y = 0; y < lcd->YRES; y++) { + int val = y < lcd->YRES / 2 ? val1 : val2; + RGBA bc = y < lcd->YRES / 2 ? bar[0] : bar[1]; + + for (x = 0; x < max; x++) { + if (x < val) + fb[layer][(row + y) * lcd->LCOLS + col + x] = rev ? bg : bc; + else + fb[layer][(row + y) * lcd->LCOLS + col + x] = rev ? bc : bg; + + if (style) { + fb[layer][(row + 0) * lcd->LCOLS + col + x] = fg; + fb[layer][(row + lcd->YRES - 1) * lcd->LCOLS + col + x] = fg; } - //lcd->graphic_mutex_.unlock(); - break; + } + if (style) { + fb[layer][(row + y) * lcd->LCOLS + col] = fg; + fb[layer][(row + y) * lcd->LCOLS + col + max - 1] = fg; + } } - - /* flush area */ - if (dir & (DIR_EAST | DIR_WEST)) { - if(!lcd->IsTransitioning()) - - lcd->GraphicUpdate(row, col, lcd->YRES, lcd->XRES * len); - } else { - if(!lcd->IsTransitioning()) - lcd->GraphicUpdate(row, col, lcd->YRES * len, lcd->XRES); + // lcd->graphic_mutex_.unlock(); + break; + + case DIR_NORTH: + val1 = max - val1; + val2 = max - val2; + rev = 1; + + case DIR_SOUTH: + // lcd->graphic_mutex_.lock(); + for (x = 0; x < lcd->XRES; x++) { + int val = x < lcd->XRES / 2 ? val1 : val2; + RGBA bc = x < lcd->XRES / 2 ? bar[0] : bar[1]; + for (y = 0; y < max; y++) { + if (y < val) + fb[layer][(row + y) * lcd->LCOLS + col + x] = rev ? bg : bc; + else + fb[layer][(row + y) * lcd->LCOLS + col + x] = rev ? bc : bg; + if (style) { + fb[layer][(row + y) * lcd->LCOLS + col + 0] = fg; + fb[layer][(row + y) * lcd->LCOLS + col + lcd->XRES - 1] = fg; + } + } + if (style) { + fb[layer][(row + 0) * lcd->LCOLS + col + x] = fg; + fb[layer][(row + max - 1) * lcd->LCOLS + col + x] = fg; + } } - + // lcd->graphic_mutex_.unlock(); + break; + } + + /* flush area */ + if (dir & (DIR_EAST | DIR_WEST)) { + if (!lcd->IsTransitioning()) + + lcd->GraphicUpdate(row, col, lcd->YRES, lcd->XRES * len); + } else { + if (!lcd->IsTransitioning()) + lcd->GraphicUpdate(row, col, lcd->YRES * len, lcd->XRES); + } } void LCD::GraphicHistogramDraw(WidgetHistogram *w) { - LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); - int layer, row, col, width, height; - int offset = w->GetOffset(); - - - layer = w->GetLayer(); - row = w->GetRow() * lcd->YRES; - col = w->GetCol() * lcd->XRES; - width = w->GetCols() * lcd->XRES; - height = w->GetRows() * lcd->YRES; - - if (layer < 0 || layer >= lcd->LAYERS ) { - LCDError("%s: layer %d out of bounds (0..%d)", - lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); - return; - } - - RGBA fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; - RGBA bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; - - RGBA *fb; - - if(lcd->IsTransitioning() && - w->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB[layer]; - else - fb = lcd->LayoutFB[layer]; - - //lcd->graphic_mutex_.lock(); - for(int c = 0; c < width / lcd->XRES; c++) { - int base = (int)(w->GetHistory()[c] * height); - int top = round((w->GetHistory()[c] * height - base) * lcd->YRES); - for(int y = 0; y < height && row + y < lcd->LROWS; y++) { - for(int x = 0; x < lcd->XRES && x + col + c * lcd->XRES + offset < lcd->LCOLS; x++) { - int n = (row + y) * lcd->LCOLS + col + c * lcd->XRES + x + offset; - - if(n < 0) - n = 0; - - if(y < height - base - top) { - fb[n] = bg; - } else if( y < height - base ) { - if(y < height - base + top) { - fb[n] = bg; - } else { - fb[n] = fg; - } - } else { - fb[n] = fg; - } - } + LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); + int layer, row, col, width, height; + int offset = w->GetOffset(); + + layer = w->GetLayer(); + row = w->GetRow() * lcd->YRES; + col = w->GetCol() * lcd->XRES; + width = w->GetCols() * lcd->XRES; + height = w->GetRows() * lcd->YRES; + + if (layer < 0 || layer >= lcd->LAYERS) { + LCDError("%s: layer %d out of bounds (0..%d)", + lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); + return; + } + + RGBA fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; + RGBA bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; + + RGBA *fb; + + if (lcd->IsTransitioning() && + w->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB[layer]; + else + fb = lcd->LayoutFB[layer]; + + // lcd->graphic_mutex_.lock(); + for (int c = 0; c < width / lcd->XRES; c++) { + int base = (int)(w->GetHistory()[c] * height); + int top = round((w->GetHistory()[c] * height - base) * lcd->YRES); + for (int y = 0; y < height && row + y < lcd->LROWS; y++) { + for (int x = 0; + x < lcd->XRES && x + col + c * lcd->XRES + offset < lcd->LCOLS; + x++) { + int n = (row + y) * lcd->LCOLS + col + c * lcd->XRES + x + offset; + + if (n < 0) + n = 0; + + if (y < height - base - top) { + fb[n] = bg; + } else if (y < height - base) { + if (y < height - base + top) { + fb[n] = bg; + } else { + fb[n] = fg; + } + } else { + fb[n] = fg; } + } } - //lcd->graphic_mutex_.unlock(); + } + // lcd->graphic_mutex_.unlock(); - if(!lcd->IsTransitioning()) - lcd->GraphicUpdate(row, col, height, width); + if (!lcd->IsTransitioning()) + lcd->GraphicUpdate(row, col, height, width); } void LCD::GraphicBignumsDraw(WidgetBignums *w) { - LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); - int layer, row, col; - - layer = w->GetLayer(); - row = w->GetRow() * lcd->YRES; - col = w->GetCol() * lcd->XRES; - - if (layer < 0 || layer >= lcd->LAYERS ) { - LCDError("%s: layer %d out of bounds (0..%d)", - lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); - return; - } - - RGBA fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; - RGBA bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; - - RGBA *fb; - - if(lcd->IsTransitioning() && - w->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB[layer]; - else - fb = lcd->LayoutFB[layer]; - - //lcd->graphic_mutex_.lock(); - - for(int r = 0; r < 16 && row + r < lcd->LROWS; r++) { - for(int c = 0; c < 24 && col + c < lcd->LCOLS; c++) { - int n = (row + r) * lcd->LCOLS + col + c; - if(w->GetFB()[r * 24 + c] == '.') { - fb[n] = fg; - } else { - fb[n] = bg; - } - } + LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); + int layer, row, col; + + layer = w->GetLayer(); + row = w->GetRow() * lcd->YRES; + col = w->GetCol() * lcd->XRES; + + if (layer < 0 || layer >= lcd->LAYERS) { + LCDError("%s: layer %d out of bounds (0..%d)", + lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); + return; + } + + RGBA fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; + RGBA bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; + + RGBA *fb; + + if (lcd->IsTransitioning() && + w->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB[layer]; + else + fb = lcd->LayoutFB[layer]; + + // lcd->graphic_mutex_.lock(); + + for (int r = 0; r < 16 && row + r < lcd->LROWS; r++) { + for (int c = 0; c < 24 && col + c < lcd->LCOLS; c++) { + int n = (row + r) * lcd->LCOLS + col + c; + if (w->GetFB()[r * 24 + c] == '.') { + fb[n] = fg; + } else { + fb[n] = bg; + } } - //lcd->graphic_mutex_.unlock(); + } + // lcd->graphic_mutex_.unlock(); - if(!lcd->IsTransitioning()) - lcd->GraphicUpdate(row, col, 16, 24); + if (!lcd->IsTransitioning()) + lcd->GraphicUpdate(row, col, 16, 24); } void LCD::GraphicFPSDraw(WidgetFPS *w) { - LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); - int layer, row, col; - - layer = w->GetLayer(); - row = w->GetRow() * lcd->YRES; - col = w->GetCol() * lcd->XRES; - - if (layer < 0 || layer >= lcd->LAYERS ) { - LCDError("%s: layer %d out of bounds (0..%d)", - lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); - return; + LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); + int layer, row, col; + + layer = w->GetLayer(); + row = w->GetRow() * lcd->YRES; + col = w->GetCol() * lcd->XRES; + + if (layer < 0 || layer >= lcd->LAYERS) { + LCDError("%s: layer %d out of bounds (0..%d)", + lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); + return; + } + + RGBA fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; + RGBA bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; + + RGBA *fb; + + if (lcd->IsTransitioning() && + w->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB[layer]; + else + fb = lcd->LayoutFB[layer]; + + // lcd->graphic_mutex_.lock(); + for (int r = 0; r < 16 && row + r < lcd->LROWS; r++) { + for (int c = 0; c < 24 && col + c < lcd->LCOLS; c++) { + int n = (row + r) * lcd->LCOLS + col + c; + if (w->GetFB()[r * 24 + c] == '.') { + fb[n] = fg; + } else { + fb[n] = bg; + } } + } + // lcd->graphic_mutex_.unlock(); - RGBA fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; - RGBA bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; - - RGBA *fb; - - if(lcd->IsTransitioning() && - w->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB[layer]; - else - fb = lcd->LayoutFB[layer]; - - //lcd->graphic_mutex_.lock(); - for(int r = 0; r < 16 && row + r < lcd->LROWS; r++) { - for(int c = 0; c < 24 && col + c < lcd->LCOLS; c++) { - int n = (row + r) * lcd->LCOLS + col + c; - if(w->GetFB()[r * 24 + c] == '.') { - fb[n] = fg; - } else { - fb[n] = bg; - } - } - } - //lcd->graphic_mutex_.unlock(); - - if(!lcd->IsTransitioning()) - lcd->GraphicUpdate(row, col, 16, 24); + if (!lcd->IsTransitioning()) + lcd->GraphicUpdate(row, col, 16, 24); } /* @@ -989,7 +961,7 @@ void LCD::GraphicGifDraw(WidgetGif *w) { height = w->GetRows(); if (layer < 0 || layer >= lcd->LAYERS ) { - LCDError("%s: layer %d out of bounds (0..%d)", + LCDError("%s: layer %d out of bounds (0..%d)", lcd->GetVisitor()->GetName().c_str(), layer, lcd->LAYERS - 1); return; } @@ -1028,489 +1000,489 @@ void LCD::GraphicGifDraw(WidgetGif *w) { */ void GraphicVisualizationPeakDraw(WidgetVisualization *widget) { - LCDGraphic *lcd = (LCDGraphic *)widget->GetVisitor()->GetLCD(); - - int row = widget->GetRow(); - int col = widget->GetCol(); - int width = widget->GetCols(); - int height = widget->GetRows(); - int layer = widget->GetLayer(); - char *buffer = widget->GetPeakBuffer(); - - RGBA fg = widget->GetFGValid() ? widget->GetFGColor() : lcd->FG_COL; - RGBA bg = widget->GetBGValid() ? widget->GetBGColor() : lcd->BG_COL; - - RGBA *fb; + LCDGraphic *lcd = (LCDGraphic *)widget->GetVisitor()->GetLCD(); + + int row = widget->GetRow(); + int col = widget->GetCol(); + int width = widget->GetCols(); + int height = widget->GetRows(); + int layer = widget->GetLayer(); + char *buffer = widget->GetPeakBuffer(); + + RGBA fg = widget->GetFGValid() ? widget->GetFGColor() : lcd->FG_COL; + RGBA bg = widget->GetBGValid() ? widget->GetBGColor() : lcd->BG_COL; + + RGBA *fb; + + if (lcd->IsTransitioning() && + widget->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB[layer]; + else + fb = lcd->LayoutFB[layer]; + + // lcd->graphic_mutex_.lock(); + for (int y = 0; y < height && row + y < lcd->LROWS; y++) { + int val = (int)(((double)widget->GetHistory()[y / lcd->YRES][0] / + (double)SHRT_MAX) * + (width / 2 - 1)); + for (int i = 0; i < (width / 2 - 1) - val && col + i < lcd->LCOLS; i++) { + int n = y * width + i; + if (buffer[n] == 0) + buffer[n] = 1; + else if (buffer[n] == 1) + buffer[n] = 2; + else if (buffer[n] == 2) + buffer[n] = 3; + else if (buffer[n] == 3) + buffer[n] = 4; + else + buffer[n] = ' '; + } - if(lcd->IsTransitioning() && - widget->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB[layer]; - else - fb = lcd->LayoutFB[layer]; - - //lcd->graphic_mutex_.lock(); - for(int y = 0; y < height && row + y < lcd->LROWS; y++) { - int val = (int)(((double)widget->GetHistory()[y / lcd->YRES][0] / - (double)SHRT_MAX) * (width / 2 - 1)); - for(int i = 0; i < (width / 2 - 1) - val && col + i < lcd->LCOLS; i++) { - int n = y * width + i; - if(buffer[n] == 0) - buffer[n] = 1; - else if(buffer[n] == 1) - buffer[n] = 2; - else if(buffer[n] == 2) - buffer[n] = 3; - else if(buffer[n] == 3) - buffer[n] = 4; - else - buffer[n] = ' '; - } + for (int i = (width / 2 - 1) - val; i < (width / 2 - 1); i++) { + buffer[y * width + i] = ' '; + } - for(int i = (width / 2 - 1) - val; i < (width / 2 - 1); i++) { - buffer[y * width + i] = ' '; - } + buffer[y * width + (width / 2 - 1)] = 5; - buffer[y * width + (width / 2 - 1)] = 5; + val = (int)(((double)widget->GetHistory()[y][1] / (double)SHRT_MAX) * + (width / 2 - 1)) + + width / 2; - val = (int)(((double)widget->GetHistory()[y][1] / - (double)SHRT_MAX) * ( width / 2 - 1)) + width / 2; + for (int i = width / 2; i < val; i++) { + buffer[y * width + i] = 0; + } - for(int i = width / 2; i < val; i++) { - buffer[y * width + i] = 0; - } + for (int i = val; i < width && i + col < lcd->LCOLS / lcd->XRES; i++) { + int n = y * width + i; + if (buffer[n] == 0) + buffer[n] = 1; + else if (buffer[n] == 1) + buffer[n] = 2; + else if (buffer[n] == 2) + buffer[n] = 3; + else if (buffer[n] == 3) + buffer[n] = 4; + else + buffer[n] = ' '; + } - for(int i = val; i < width && i + col < lcd->LCOLS / lcd->XRES; i++) { - int n = y * width + i; - if(buffer[n] == 0) - buffer[n] = 1; - else if(buffer[n] == 1) - buffer[n] = 2; - else if(buffer[n] == 2) - buffer[n] = 3; - else if(buffer[n] == 3) - buffer[n] = 4; + for (int i = 0; i < width; i++) { + for (int yy = 0; yy < lcd->YRES && row + yy < lcd->LROWS; yy++) { + for (int xx = 0; xx < lcd->XRES && col + xx < lcd->LCOLS; xx++) { + int n = ((row + y) * lcd->YRES + yy) * lcd->LCOLS + + (col + i) * lcd->XRES + xx; + switch (buffer[y * width + i]) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + if (VISUALIZATION_CHARS[(int)buffer[y * width + i]][yy] & + (lcd->XRES - xx - 1)) + fb[n] = fg; else - buffer[n] = ' '; - } - - for(int i = 0; i < width; i++) { - for(int yy = 0; yy < lcd->YRES && row + yy < lcd->LROWS; yy++) { - for(int xx = 0; xx < lcd->XRES && col + xx < lcd->LCOLS; xx++) { - int n = ((row + y) * lcd->YRES + yy) * lcd->LCOLS + - (col + i) * lcd->XRES + xx; - switch(buffer[y * width + i]) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - if( VISUALIZATION_CHARS[ - (int)buffer[y * width + i]][yy] & - (lcd->XRES - xx - 1) ) - fb[n] = fg; - else - fb[n] = bg; - break; - case ' ': - fb[n] = bg; - break; - } - } - } + fb[n] = bg; + break; + case ' ': + fb[n] = bg; + break; + } } + } } - //lcd->graphic_mutex_.unlock(); + } + // lcd->graphic_mutex_.unlock(); } -void do_alpha (VisVideo *vid, uint8_t rate) -{ - int i; - uint32_t *ptr = (uint32_t *)visual_video_get_pixels(vid); //vid->pixels; - union { - uint32_t c32; - uint8_t c8[4]; - } col; - +void do_alpha(VisVideo *vid, uint8_t rate) { + int i; + uint32_t *ptr = (uint32_t *)visual_video_get_pixels(vid); // vid->pixels; + union { + uint32_t c32; + uint8_t c8[4]; + } col; - for (i = 0; i < vid->get_width() * vid->get_height(); i++) { - col.c32 = ptr[i]; + for (i = 0; i < vid->get_width() * vid->get_height(); i++) { + col.c32 = ptr[i]; - col.c8[3] = rate; + col.c8[3] = rate; - ptr[i] = col.c32; - } + ptr[i] = col.c32; + } } void GraphicVisualizationPCMDraw(WidgetVisualization *widget) { - LCDGraphic *lcd = (LCDGraphic *)widget->GetVisitor()->GetLCD(); + LCDGraphic *lcd = (LCDGraphic *)widget->GetVisitor()->GetLCD(); - int row = widget->GetRow() * lcd->YRES; - int col = widget->GetCol() * lcd->XRES; - int width = widget->GetCols(); - int height = widget->GetRows(); - int layer = widget->GetLayer(); - VisVideo *video = widget->video_; - VisVideo *sub = visual_video_new_with_buffer(video->get_width(), - video->get_height(), - VISUAL_VIDEO_DEPTH_32BIT); + int row = widget->GetRow() * lcd->YRES; + int col = widget->GetCol() * lcd->XRES; + int width = widget->GetCols(); + int height = widget->GetRows(); + int layer = widget->GetLayer(); + VisVideo *video = widget->video_; + VisVideo *sub = visual_video_new_with_buffer( + video->get_width(), video->get_height(), VISUAL_VIDEO_DEPTH_32BIT); - VisColor color; + VisColor color; - visual_video_convert_depth(sub, widget->video_); + visual_video_convert_depth(sub, widget->video_); - do_alpha(sub, widget->alpha_); + do_alpha(sub, widget->alpha_); - uint32_t *buffer = (uint32_t *)visual_video_get_pixels(sub); + uint32_t *buffer = (uint32_t *)visual_video_get_pixels(sub); - RGBA *fb; + RGBA *fb; - if(lcd->IsTransitioning() && - widget->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB[layer]; - else - fb = lcd->LayoutFB[layer]; + if (lcd->IsTransitioning() && + widget->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB[layer]; + else + fb = lcd->LayoutFB[layer]; - //lcd->graphic_mutex_.lock(); + // lcd->graphic_mutex_.lock(); - for(int r = 0; r < height && row + r < lcd->LROWS; r++) { - for(int c = 0; c < width && col + c < lcd->LCOLS; c++) { - int n = ((row + r) * lcd->LCOLS + col + c); - uint32_t pixel = buffer[r * width + c]; - visual_color_set_from_uint32(&color, pixel); - fb[n].R = color.r; - fb[n].G = color.g; - fb[n].B = color.b; - fb[n].A = color.a; - } - } - //lcd->graphic_mutex_.unlock(); + for (int r = 0; r < height && row + r < lcd->LROWS; r++) { + for (int c = 0; c < width && col + c < lcd->LCOLS; c++) { + int n = ((row + r) * lcd->LCOLS + col + c); + uint32_t pixel = buffer[r * width + c]; + visual_color_set_from_uint32(&color, pixel); + fb[n].R = color.r; + fb[n].G = color.g; + fb[n].B = color.b; + fb[n].A = color.a; + } + } + // lcd->graphic_mutex_.unlock(); - if(!lcd->IsTransitioning()) - lcd->GraphicUpdate(row, col, height, width); + if (!lcd->IsTransitioning()) + lcd->GraphicUpdate(row, col, height, width); - visual_video_unref(sub); + visual_video_unref(sub); } void GraphicVisualizationSpectrumDraw(WidgetVisualization *w) { - LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); - - int row = w->GetRow() * lcd->YRES; - int col = w->GetCol() * lcd->XRES; - int width = w->GetCols() * lcd->XRES; - int height = w->GetRows() * lcd->YRES; - int layer = w->GetLayer(); - - RGBA fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; - RGBA bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; - - int base = SHRT_MAX / height; - - //lcd->graphic_mutex_.lock(); - for(int x = 0; x < width && col + - x < lcd->LCOLS; x+=lcd->XRES) { - int val = w->GetHistory()[0][x]; - - for(int y = lcd->YRES; y <= height && row + y - lcd->YRES < - lcd->LROWS; y+=lcd->YRES) { - if(val > (y * base)) - lcd->DrawSpecialChar(row + height - y, col + x, 8, 5, layer, fg, bg, - SpecialChar(VISUALIZATION_CHARS[0], 8), w->GetLayoutBase()); - else if (val > ((y-1) * base)) - lcd->DrawSpecialChar(row + height - y, col + x, 8, 5, layer, fg, bg, - SpecialChar(VISUALIZATION_CHARS[1], 8), w->GetLayoutBase()); - else - lcd->DrawSpecialChar(row + height - y, col + x, 8, 5, - layer, lcd->NO_COL, lcd->NO_COL, SpecialChar(8), w->GetLayoutBase()); - } + LCDGraphic *lcd = (LCDGraphic *)w->GetVisitor()->GetLCD(); + + int row = w->GetRow() * lcd->YRES; + int col = w->GetCol() * lcd->XRES; + int width = w->GetCols() * lcd->XRES; + int height = w->GetRows() * lcd->YRES; + int layer = w->GetLayer(); + + RGBA fg = w->GetFGValid() ? w->GetFGColor() : lcd->FG_COL; + RGBA bg = w->GetBGValid() ? w->GetBGColor() : lcd->BG_COL; + + int base = SHRT_MAX / height; + + // lcd->graphic_mutex_.lock(); + for (int x = 0; x < width && col + x < lcd->LCOLS; x += lcd->XRES) { + int val = w->GetHistory()[0][x]; + + for (int y = lcd->YRES; y <= height && row + y - lcd->YRES < lcd->LROWS; + y += lcd->YRES) { + if (val > (y * base)) + lcd->DrawSpecialChar(row + height - y, col + x, 8, 5, layer, fg, bg, + SpecialChar(VISUALIZATION_CHARS[0], 8), + w->GetLayoutBase()); + else if (val > ((y - 1) * base)) + lcd->DrawSpecialChar(row + height - y, col + x, 8, 5, layer, fg, bg, + SpecialChar(VISUALIZATION_CHARS[1], 8), + w->GetLayoutBase()); + else + lcd->DrawSpecialChar(row + height - y, col + x, 8, 5, layer, + lcd->NO_COL, lcd->NO_COL, SpecialChar(8), + w->GetLayoutBase()); } - //lcd->graphic_mutex_.unlock(); - - if(!lcd->IsTransitioning()) - lcd->GraphicUpdate(row * lcd->YRES, col * lcd->XRES, - height * lcd->YRES, width * lcd->XRES); + } + // lcd->graphic_mutex_.unlock(); + if (!lcd->IsTransitioning()) + lcd->GraphicUpdate(row * lcd->YRES, col * lcd->XRES, height * lcd->YRES, + width * lcd->XRES); } void GraphicVisualizationDraw(WidgetVisualization *widget) { - if(widget->GetStyle() == STYLE_PEAK) - GraphicVisualizationPeakDraw(widget); - else if(widget->GetStyle() == STYLE_PCM) { - GraphicVisualizationPCMDraw(widget); - } else if(widget->GetStyle() == STYLE_SPECTRUM) - GraphicVisualizationSpectrumDraw(widget); + if (widget->GetStyle() == STYLE_PEAK) + GraphicVisualizationPeakDraw(widget); + else if (widget->GetStyle() == STYLE_PCM) { + GraphicVisualizationPCMDraw(widget); + } else if (widget->GetStyle() == STYLE_SPECTRUM) + GraphicVisualizationSpectrumDraw(widget); } void LCDGraphic::Transition() { - switch(visitor_->GetDirection()) { - case TRANSITION_LEFT: - case TRANSITION_RIGHT: - case TRANSITION_BOTH: - TransitionLeftRight(); - break; - case TRANSITION_UP: - case TRANSITION_DOWN: - TransitionUpDown(); - break; - case TRANSITION_TENTACLE: - TransitionTentacle(); - break; - case TRANSITION_ALPHABLEND: - TransitionAlphaBlend(); - break; - default: - TransitionLeftRight(); - } + switch (visitor_->GetDirection()) { + case TRANSITION_LEFT: + case TRANSITION_RIGHT: + case TRANSITION_BOTH: + TransitionLeftRight(); + break; + case TRANSITION_UP: + case TRANSITION_DOWN: + TransitionUpDown(); + break; + case TRANSITION_TENTACLE: + TransitionTentacle(); + break; + case TRANSITION_ALPHABLEND: + TransitionAlphaBlend(); + break; + default: + TransitionLeftRight(); + } } void LCDGraphic::TransitionLeftRight() { - int direction = visitor_->GetDirection(); - int col; - RGBA **left, **right; - - for(int row = 0; row < LROWS / YRES; row++) { - if( direction == TRANSITION_LEFT || - (direction == TRANSITION_BOTH && row % 2 == 0)) { - col = LCOLS - transition_tick_ - XRES - 1; - left = LayoutFB; - right = TransitionFB; - } else if( direction == TRANSITION_RIGHT || direction == TRANSITION_BOTH) { - col = transition_tick_; - left = TransitionFB; - right = LayoutFB; - } else { - col = transition_tick_; - left = TransitionFB; - right = LayoutFB; - LCDError("LCDGraphic: Bad transition direction: %d", direction); - } + int direction = visitor_->GetDirection(); + int col; + RGBA **left, **right; + + for (int row = 0; row < LROWS / YRES; row++) { + if (direction == TRANSITION_LEFT || + (direction == TRANSITION_BOTH && row % 2 == 0)) { + col = LCOLS - transition_tick_ - XRES - 1; + left = LayoutFB; + right = TransitionFB; + } else if (direction == TRANSITION_RIGHT || direction == TRANSITION_BOTH) { + col = transition_tick_; + left = TransitionFB; + right = LayoutFB; + } else { + col = transition_tick_; + left = TransitionFB; + right = LayoutFB; + LCDError("LCDGraphic: Bad transition direction: %d", direction); + } - if(col < 0) - col = 0; - - if(col + XRES >= LCOLS) - col-=LCOLS-col; - - for(int i = 0; i < YRES; i++) { - int n = (row * YRES + i) * LCOLS; - for(int l = 0; l < LAYERS; l++) { - memcpy(DisplayFB[l] + n, left[l] + n + (LCOLS - col), - col * sizeof(RGBA)); - memcpy(DisplayFB[l] + n + col + XRES, right[l] + n, - (LCOLS - col - XRES) * sizeof(RGBA)); - } - } - GraphicRealBlit(this, row * YRES, 0, YRES, LCOLS); + if (col < 0) + col = 0; + + if (col + XRES >= LCOLS) + col -= LCOLS - col; + + for (int i = 0; i < YRES; i++) { + int n = (row * YRES + i) * LCOLS; + for (int l = 0; l < LAYERS; l++) { + memcpy(DisplayFB[l] + n, left[l] + n + (LCOLS - col), + col * sizeof(RGBA)); + memcpy(DisplayFB[l] + n + col + XRES, right[l] + n, + (LCOLS - col - XRES) * sizeof(RGBA)); + } } + GraphicRealBlit(this, row * YRES, 0, YRES, LCOLS); + } - transition_tick_+=XRES; - if( transition_tick_ >= (int)LCOLS) { - transition_tick_ = 0; - for(int l = 0; l < LAYERS; l++) { - memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS * sizeof(RGBA)); - for(int n = 0; n < LCOLS * LROWS; n++) - TransitionFB[l][n] = NO_COL; - } - if(fill_) { - for(int n = 0; n < LCOLS * LROWS; n++) - TransitionFB[0][n] = BG_COL; - } - transitioning_ = false; - GraphicBlit(0, 0, LROWS, LCOLS); - visitor_->TransitionFinished(); + transition_tick_ += XRES; + if (transition_tick_ >= (int)LCOLS) { + transition_tick_ = 0; + for (int l = 0; l < LAYERS; l++) { + memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS * sizeof(RGBA)); + for (int n = 0; n < LCOLS * LROWS; n++) + TransitionFB[l][n] = NO_COL; + } + if (fill_) { + for (int n = 0; n < LCOLS * LROWS; n++) + TransitionFB[0][n] = BG_COL; } - LCDError("TransitionLeftRight %d", transition_tick_); + transitioning_ = false; + GraphicBlit(0, 0, LROWS, LCOLS); + visitor_->TransitionFinished(); + } + LCDError("TransitionLeftRight %d", transition_tick_); } void LCDGraphic::TransitionUpDown() { - int direction = visitor_->GetDirection(); - int row; - RGBA **top, **bottom; - - if(direction == TRANSITION_UP) { - top = LayoutFB; - bottom = TransitionFB; - row = LROWS - transition_tick_ - YRES; - } else { - top = TransitionFB; - bottom = LayoutFB; - row = transition_tick_; + int direction = visitor_->GetDirection(); + int row; + RGBA **top, **bottom; + + if (direction == TRANSITION_UP) { + top = LayoutFB; + bottom = TransitionFB; + row = LROWS - transition_tick_ - YRES; + } else { + top = TransitionFB; + bottom = LayoutFB; + row = transition_tick_; + } + + int o = row * LCOLS; + + LCDError("o: %d, row: %d", o, row); + + for (int r = 0; r < LROWS; r += YRES) { + int n = r * LCOLS; + for (int rr = 0; rr < YRES && r + rr < LROWS; rr++) { + int nn = n + rr * LCOLS; + for (int l = 0; l < LAYERS; l++) { + if (row <= (int)r) + memcpy(DisplayFB[l] + nn, bottom[l] + nn - o, LCOLS * sizeof(RGBA)); + else + memcpy(DisplayFB[l] + nn, top[l] + nn - o, LCOLS * sizeof(RGBA)); + } + GraphicRealBlit(this, r, 0, YRES, LCOLS); } + } - int o = row * LCOLS; - - LCDError("o: %d, row: %d", o, row); + transition_tick_ += YRES; + if (transition_tick_ >= (int)LROWS) { - for(int r = 0; r < LROWS; r+=YRES) { - int n = r * LCOLS; - for(int rr = 0; rr < YRES && r + rr < LROWS; rr++) { - int nn = n + rr * LCOLS; - for(int l =0; l < LAYERS; l++) { - if(row <= (int)r) - memcpy(DisplayFB[l] + nn, bottom[l] + nn - o, LCOLS * sizeof(RGBA)); - else - memcpy(DisplayFB[l] + nn, top[l] + nn - o, LCOLS * sizeof(RGBA)); - } - GraphicRealBlit(this, r, 0, YRES, LCOLS); - } + transition_tick_ = 0; + // emit static_cast( + // visitor_->GetWrapper())->_TransitionFinished(); + visitor_->TransitionFinished(); + for (int l = 0; l < LAYERS; l++) { + memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS * sizeof(RGBA)); + for (int n = 0; n < LROWS * LCOLS; n++) { + TransitionFB[l][n] = NO_COL; + } } - - transition_tick_+=YRES; - if( transition_tick_ >= (int)LROWS) { - - transition_tick_ = 0; - //emit static_cast( - // visitor_->GetWrapper())->_TransitionFinished(); - visitor_->TransitionFinished(); - for(int l = 0; l < LAYERS; l++) { - memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS * sizeof(RGBA)); - for(int n = 0; n < LROWS * LCOLS; n++) { - TransitionFB[l][n] = NO_COL; - } - } - if(fill_) { - for(int n = 0; n < LCOLS * LROWS; n++) - TransitionFB[0][n] = BG_COL; - } - transitioning_ = false; - GraphicBlit(0, 0, LROWS, LCOLS); - LCDError("Transition finished"); - return; + if (fill_) { + for (int n = 0; n < LCOLS * LROWS; n++) + TransitionFB[0][n] = BG_COL; } - LCDError("Transition iteration finished"); + transitioning_ = false; + GraphicBlit(0, 0, LROWS, LCOLS); + LCDError("Transition finished"); + return; + } + LCDError("Transition iteration finished"); } void LCDGraphic::SaneCoords(int *x, int *y1, int *y2) { - if(*x >= (int)LCOLS) - *x = LCOLS - 1; - else if(*x < 0) - *x = 0; - - if(*y1 >= (int)LROWS) - *y1 = LROWS - 1; - else if(*y1 < 0) - *y1 = 0; - - if(*y2 >= (int)LROWS) - *y2 = LROWS - 1; - else if(*y2 < 0) - *y2 = 0; + if (*x >= (int)LCOLS) + *x = LCOLS - 1; + else if (*x < 0) + *x = 0; + + if (*y1 >= (int)LROWS) + *y1 = LROWS - 1; + else if (*y1 < 0) + *y1 = 0; + + if (*y2 >= (int)LROWS) + *y2 = LROWS - 1; + else if (*y2 < 0) + *y2 = 0; } void LCDGraphic::VlineFromBuffer(RGBA *dest, RGBA *src, int x, int y1, int y2) { - - SaneCoords(&x, &y1, &y2); - for(int i = y1; i < y2; i++) - dest[i * LCOLS + x] = src[i * LCOLS + x]; + SaneCoords(&x, &y1, &y2); + + for (int i = y1; i < y2; i++) + dest[i * LCOLS + x] = src[i * LCOLS + x]; } void LCDGraphic::TransitionTentacle() { - int height1; - int height2; - int add1; - int add2; + int height1; + int height2; + int add1; + int add2; - float sinrate = tentacle_move_; - float multiplier = 0; - float multiadd = 1.000 / LCOLS; - float rate = (LCOLS - transition_tick_) / (double)LCOLS; + float sinrate = tentacle_move_; + float multiplier = 0; + float multiadd = 1.000 / LCOLS; + float rate = (LCOLS - transition_tick_) / (double)LCOLS; - int i, l; + int i, l; - for(l = 0; l < LAYERS; l++) { - memcpy(DisplayFB[l], TransitionFB[l], LROWS * LCOLS * sizeof(RGBA)); - } + for (l = 0; l < LAYERS; l++) { + memcpy(DisplayFB[l], TransitionFB[l], LROWS * LCOLS * sizeof(RGBA)); + } - for(i = 0; i < LCOLS; i++) { - add1 = (LROWS / 2) - ((LROWS / 2) * (rate * 1.5)); - add2 = (LROWS / 2) + ((LROWS / 2) * (rate * 1.5)); + for (i = 0; i < LCOLS; i++) { + add1 = (LROWS / 2) - ((LROWS / 2) * (rate * 1.5)); + add2 = (LROWS / 2) + ((LROWS / 2) * (rate * 1.5)); - height1 = (sin(sinrate) * ((LROWS / 4) * multiplier)) + add1; - height2 = (sin(sinrate) * ((LROWS / 4) * multiplier)) + add2; - multiplier += multiadd; + height1 = (sin(sinrate) * ((LROWS / 4) * multiplier)) + add1; + height2 = (sin(sinrate) * ((LROWS / 4) * multiplier)) + add2; + multiplier += multiadd; - for(l = 0; l < LAYERS; l++) { - VlineFromBuffer(DisplayFB[l], LayoutFB[l], i, height1, height2); - } - sinrate += 0.02; - tentacle_move_ += 0.0002; + for (l = 0; l < LAYERS; l++) { + VlineFromBuffer(DisplayFB[l], LayoutFB[l], i, height1, height2); } + sinrate += 0.02; + tentacle_move_ += 0.0002; + } - transition_tick_+=XRES; - if( transition_tick_ >= (int)LCOLS) { - transition_tick_ = 0; - //emit static_cast( - // visitor_->GetWrapper())->_TransitionFinished(); - visitor_->TransitionFinished(); - for(int l = 0; l < LAYERS; l++) { - memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS * sizeof(RGBA)); - for(int n = 0; n < LCOLS * LROWS; n++) - TransitionFB[l][n] = NO_COL; - } - if(fill_) { - for(int n = 0; n < LCOLS * LROWS; n++) - TransitionFB[0][n] = BG_COL; - } - transitioning_ = false; - GraphicBlit(0, 0, LROWS, LCOLS); - return; + transition_tick_ += XRES; + if (transition_tick_ >= (int)LCOLS) { + transition_tick_ = 0; + // emit static_cast( + // visitor_->GetWrapper())->_TransitionFinished(); + visitor_->TransitionFinished(); + for (int l = 0; l < LAYERS; l++) { + memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS * sizeof(RGBA)); + for (int n = 0; n < LCOLS * LROWS; n++) + TransitionFB[l][n] = NO_COL; + } + if (fill_) { + for (int n = 0; n < LCOLS * LROWS; n++) + TransitionFB[0][n] = BG_COL; } - GraphicRealBlit(this, 0, 0, LROWS, LCOLS); + transitioning_ = false; + GraphicBlit(0, 0, LROWS, LCOLS); + return; + } + GraphicRealBlit(this, 0, 0, LROWS, LCOLS); } RGBA LCDGraphic::BlendRGBA(RGBA col1, RGBA col2, uint8_t alpha) { - RGBA ret; + RGBA ret; - ret.R = (col1.R * alpha + col2.R * (255 - alpha)) / 255; - ret.G = (col1.G * alpha + col2.G * (255 - alpha)) / 255; - ret.B = (col1.B * alpha + col2.B * (255 - alpha)) / 255; - ret.A = alpha; + ret.R = (col1.R * alpha + col2.R * (255 - alpha)) / 255; + ret.G = (col1.G * alpha + col2.G * (255 - alpha)) / 255; + ret.B = (col1.B * alpha + col2.B * (255 - alpha)) / 255; + ret.A = alpha; - return ret; + return ret; } -void LCDGraphic::AlphaBlendBuffer(RGBA **dest, RGBA **src1, RGBA **src2, float alpha) { - uint8_t ialpha = (alpha * 255); +void LCDGraphic::AlphaBlendBuffer(RGBA **dest, RGBA **src1, RGBA **src2, + float alpha) { + uint8_t ialpha = (alpha * 255); - for(int row = 0; row < LROWS; row++) { - for(int col = 0; col < LCOLS; col++) { - RGBA col1 = GraphicBlend(row, col, src1); - RGBA col2 = GraphicBlend(row, col, src2); - dest[0][row * LCOLS + col] = BlendRGBA(col1, col2, ialpha); - } + for (int row = 0; row < LROWS; row++) { + for (int col = 0; col < LCOLS; col++) { + RGBA col1 = GraphicBlend(row, col, src1); + RGBA col2 = GraphicBlend(row, col, src2); + dest[0][row * LCOLS + col] = BlendRGBA(col1, col2, ialpha); } + } } void LCDGraphic::TransitionAlphaBlend() { - float rate = (LCOLS - transition_tick_) / (float)LCOLS; - - for(int n = 0; n < LROWS * LCOLS; n++) - for(int l = 0; l < LAYERS; l++) - DisplayFB[l][n] = NO_COL; - - AlphaBlendBuffer(DisplayFB, LayoutFB, TransitionFB, rate); - - transition_tick_+=XRES; - if( transition_tick_ >= (int)LCOLS) { - transition_tick_ = 0; - //emit static_cast( - // visitor_->GetWrapper())->_TransitionFinished(); - visitor_->TransitionFinished(); - for(int l = 0; l < LAYERS; l++) { - memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS * sizeof(RGBA)); - for(int n = 0; n < LCOLS * LROWS; n++) { - DisplayFB[l][n] = NO_COL; - TransitionFB[l][n] = NO_COL; - } - } - if(fill_) { - for(int n = 0; n < LCOLS * LROWS; n++) - TransitionFB[0][n] = BG_COL; - } - transitioning_ = false; - GraphicBlit(0, 0, LROWS, LCOLS); - return; + float rate = (LCOLS - transition_tick_) / (float)LCOLS; + + for (int n = 0; n < LROWS * LCOLS; n++) + for (int l = 0; l < LAYERS; l++) + DisplayFB[l][n] = NO_COL; + + AlphaBlendBuffer(DisplayFB, LayoutFB, TransitionFB, rate); + + transition_tick_ += XRES; + if (transition_tick_ >= (int)LCOLS) { + transition_tick_ = 0; + // emit static_cast( + // visitor_->GetWrapper())->_TransitionFinished(); + visitor_->TransitionFinished(); + for (int l = 0; l < LAYERS; l++) { + memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS * sizeof(RGBA)); + for (int n = 0; n < LCOLS * LROWS; n++) { + DisplayFB[l][n] = NO_COL; + TransitionFB[l][n] = NO_COL; + } + } + if (fill_) { + for (int n = 0; n < LCOLS * LROWS; n++) + TransitionFB[0][n] = BG_COL; } - GraphicRealBlit(this, 0, 0, LROWS, LCOLS); + transitioning_ = false; + GraphicBlit(0, 0, LROWS, LCOLS); + return; + } + GraphicRealBlit(this, 0, 0, LROWS, LCOLS); } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDGraphic.h b/libvisual-plugins/plugins/actor/lcdcontrol/LCDGraphic.h index 4a4159ec8..1c72b65b8 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDGraphic.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDGraphic.h @@ -62,122 +62,126 @@ class LCDGraphicInterface { class LCDGraphicWrapper { LCDGraphicInterface *wrappedObject_; public: - LCDGraphicWrapper(LCDGraphicInterface *visitor) { wrappedObject_ = visitor; } + LCDGraphicWrapper(LCDGraphicInterface *visitor) { wrappedObject_ = visitor; +} - void ResizeBefore(int rows, int cols) { wrappedObject_->ResizeBefore(rows, cols); } - void ResizeAfter() { wrappedObject_->ResizeAfter(); } - void LayoutChangeBefore() { wrappedObject_->LayoutChangeBefore(); } - void LayoutChangeAfter() { wrappedObject_->LayoutChangeAfter(); } + void ResizeBefore(int rows, int cols) { wrappedObject_->ResizeBefore(rows, +cols); } void ResizeAfter() { wrappedObject_->ResizeAfter(); } void +LayoutChangeBefore() { wrappedObject_->LayoutChangeBefore(); } void +LayoutChangeAfter() { wrappedObject_->LayoutChangeAfter(); } }; */ class LCDGraphic : public LCDBase { - struct _GraphicWindow { - int R; - int C; - int H; - int W; - } update_window_; - - float tentacle_move_; - - //LCDGraphicUpdateThread *update_thread_; - //LCDGraphicWrapper *graphic_wrapper_; - int refresh_rate_; - - bool fill_; - - int transition_tick_; - bool transitioning_; - std::string transition_layout_; - - bool is_resizing_; - - VisVideo *video_; - - LCDTimer *timer_; - - - void Transition(); - void TransitionLeftRight(); - void TransitionUpDown(); - void TransitionTentacle(); - void VlineFromBuffer(RGBA *dest, RGBA *src, int x, int y1, int y2); - void SaneCoords(int *x, int *y1, int *y2); - void TransitionAlphaBlend(); - void AlphaBlendBuffer(RGBA **dest, RGBA **src1, RGBA **src2, float alpha); - int ResizeLCD(int rows, int cols); - void ResizeBefore(int rows, int cols); - void ResizeAfter(); - void LayoutChangeBefore(); - void LayoutChangeAfter(); - - protected: - LCDCore *visitor_; - - public: - RGBA FG_COL; - RGBA BG_COL; - RGBA BL_COL; - RGBA NO_COL; - - - bool INVERTED; - - RGBA **DisplayFB; - RGBA **LayoutFB; - RGBA **TransitionFB; - - VisVideo **VideoFB; - - //std::vector> DisplayFB; - //std::vector> LayoutFB; - //std::vector> TransitionFB; - - LCDGraphic(LCDCore *visitor); - virtual ~LCDGraphic(); - void (*GraphicRealBlit) (LCDGraphic *lcd, const int row, const int col, - const int height, const int width); - void GraphicStart(); - void GraphicStop(); - LCDCore *GetVisitor() { return visitor_; } - void GraphicUpdate(int row, int col, int height, int width); - void GraphicDraw(); - void GraphicInit(const int rows, const int cols, - const int yres, const int xres, const int layers, bool clear_on_layout_change = true); - void GraphicClear(); - void GraphicFill(); - void GraphicWindow(int, int, int, int *, int *); - void GraphicBlit(int, int, int, int); - void GraphicBlitAll(); - RGBA GraphicBlend(int, int, RGBA **buffer = (RGBA **)NULL); - static RGBA BlendRGBA(RGBA col1, RGBA col2, uint8_t alpha); - - RGBA GraphicRGB(const int row, const int col); - unsigned char GraphicGray(const int row, const int col); - unsigned char GraphicBlack(const int row, const int col); - VisVideo *GetVideo(); - VisVideo *GetVideo(int layer); - void GraphicRender(int layer, int row, int col, RGBA fg, RGBA bg, const char *txt, bool bold, int offset, std::string layout); - bool IsTransitioning() { return transitioning_; } - void SignalTransitionStart(std::string layout) { transitioning_ = true; transition_layout_ = layout;} - void SignalTransitionEnd() { - for(int l = 0; l < LAYERS; l++) - for(int n = 0; n < LROWS * LCOLS; n++) - TransitionFB[l][n] = NO_COL; - if(fill_) { - for(int n = 0; n < LROWS * LCOLS; n++) - ;//DisplayFB[0][n] = BG_COL; - } + struct _GraphicWindow { + int R; + int C; + int H; + int W; + } update_window_; + + float tentacle_move_; + + // LCDGraphicUpdateThread *update_thread_; + // LCDGraphicWrapper *graphic_wrapper_; + int refresh_rate_; + + bool fill_; + + int transition_tick_; + bool transitioning_; + std::string transition_layout_; + + bool is_resizing_; + + VisVideo *video_; + + LCDTimer *timer_; + + void Transition(); + void TransitionLeftRight(); + void TransitionUpDown(); + void TransitionTentacle(); + void VlineFromBuffer(RGBA *dest, RGBA *src, int x, int y1, int y2); + void SaneCoords(int *x, int *y1, int *y2); + void TransitionAlphaBlend(); + void AlphaBlendBuffer(RGBA **dest, RGBA **src1, RGBA **src2, float alpha); + int ResizeLCD(int rows, int cols); + void ResizeBefore(int rows, int cols); + void ResizeAfter(); + void LayoutChangeBefore(); + void LayoutChangeAfter(); + +protected: + LCDCore *visitor_; + +public: + RGBA FG_COL; + RGBA BG_COL; + RGBA BL_COL; + RGBA NO_COL; + + bool INVERTED; + + RGBA **DisplayFB; + RGBA **LayoutFB; + RGBA **TransitionFB; + + VisVideo **VideoFB; + + // std::vector> DisplayFB; + // std::vector> LayoutFB; + // std::vector> TransitionFB; + + LCDGraphic(LCDCore *visitor); + virtual ~LCDGraphic(); + void (*GraphicRealBlit)(LCDGraphic *lcd, const int row, const int col, + const int height, const int width); + void GraphicStart(); + void GraphicStop(); + LCDCore *GetVisitor() { return visitor_; } + void GraphicUpdate(int row, int col, int height, int width); + void GraphicDraw(); + void GraphicInit(const int rows, const int cols, const int yres, + const int xres, const int layers, + bool clear_on_layout_change = true); + void GraphicClear(); + void GraphicFill(); + void GraphicWindow(int, int, int, int *, int *); + void GraphicBlit(int, int, int, int); + void GraphicBlitAll(); + RGBA GraphicBlend(int, int, RGBA **buffer = (RGBA **)NULL); + static RGBA BlendRGBA(RGBA col1, RGBA col2, uint8_t alpha); + + RGBA GraphicRGB(const int row, const int col); + unsigned char GraphicGray(const int row, const int col); + unsigned char GraphicBlack(const int row, const int col); + VisVideo *GetVideo(); + VisVideo *GetVideo(int layer); + void GraphicRender(int layer, int row, int col, RGBA fg, RGBA bg, + const char *txt, bool bold, int offset, + std::string layout); + bool IsTransitioning() { return transitioning_; } + void SignalTransitionStart(std::string layout) { + transitioning_ = true; + transition_layout_ = layout; + } + void SignalTransitionEnd() { + for (int l = 0; l < LAYERS; l++) + for (int n = 0; n < LROWS * LCOLS; n++) + TransitionFB[l][n] = NO_COL; + if (fill_) { + for (int n = 0; n < LROWS * LCOLS; n++) + ; // DisplayFB[0][n] = BG_COL; } - std::string GetTransitionLayout() { return transition_layout_; } - - void DrawSpecialChar(const int row, const int col, - const int height, const int width, const int layer, - const RGBA fg, const RGBA bg, SpecialChar ch, std::string layout); + } + std::string GetTransitionLayout() { return transition_layout_; } + void DrawSpecialChar(const int row, const int col, const int height, + const int width, const int layer, const RGBA fg, + const RGBA bg, SpecialChar ch, std::string layout); }; /* @@ -206,6 +210,6 @@ void GraphicFPSDraw(WidgetFPS *w); void GraphicGifDraw(WidgetGif *w); -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDText.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/LCDText.cpp index 126927e57..5f7ef914c 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDText.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDText.cpp @@ -45,457 +45,465 @@ using namespace LCD; LCDText::LCDText(LCDCore *visitor) { - visitor_ = visitor; - TextRealBlit = 0; - TextRealDefChar = 0; - transition_tick_ = 0; - transitioning_ = false; - tentacle_move_ = 0; - LayoutFB = 0; - TransitionFB = 0; - DisplayFB = 0; -/* - wrapper_ = new LCDWrapper((LCDInterface *)this, 0); - QObject::connect(visitor->GetWrapper(), SIGNAL(_LayoutChangeBefore()), - wrapper_, SLOT(LayoutChangeBefore())); - QObject::connect(visitor->GetWrapper(), SIGNAL(_LayoutChangeAfter()), - wrapper_, SLOT(LayoutChangeAfter())); - transitioning_ = false; -*/ + visitor_ = visitor; + TextRealBlit = 0; + TextRealDefChar = 0; + transition_tick_ = 0; + transitioning_ = false; + tentacle_move_ = 0; + LayoutFB = 0; + TransitionFB = 0; + DisplayFB = 0; + /* + wrapper_ = new LCDWrapper((LCDInterface *)this, 0); + QObject::connect(visitor->GetWrapper(), SIGNAL(_LayoutChangeBefore()), + wrapper_, SLOT(LayoutChangeBefore())); + QObject::connect(visitor->GetWrapper(), SIGNAL(_LayoutChangeAfter()), + wrapper_, SLOT(LayoutChangeAfter())); + transitioning_ = false; + */ } LCDText::~LCDText() { - //delete wrapper_; - if(!LayoutFB) return; - for(int l = 0; l < LAYERS; l++) { - free(LayoutFB[l]); - free(TransitionFB[l]); - } - free(LayoutFB); - free(TransitionFB); - free(DisplayFB); -} - -void LCDText::TextInit(int rows, int cols, int yres, - int xres, int _goto, int chars, int char0, - int layers) { - int n = rows * cols; - GOTO_COST = _goto; - CHARS = chars; - CHAR0 = char0; - YRES = yres; - XRES = xres; - LROWS = DROWS = rows; - LCOLS = DCOLS = cols; - LAYERS = layers; - LayoutFB = (unsigned char **)malloc(sizeof(char) * cols * rows * layers); - TransitionFB = (unsigned char **)malloc(sizeof(char) * cols * rows * layers); - for(int l = 0; l < layers; l++) { - LayoutFB[l] = (unsigned char *)malloc(sizeof(char) * cols * rows);//new unsigned char[n]; - memset(LayoutFB[l], ' ', n); - TransitionFB[l] = (unsigned char *)malloc(sizeof(char) * cols * rows);//new unsigned char[n]; - memset(TransitionFB[l], ' ', n); - } - DisplayFB = (unsigned char *)malloc(sizeof(char) * cols * rows);; - memset(DisplayFB, ' ', n); + // delete wrapper_; + if (!LayoutFB) + return; + for (int l = 0; l < LAYERS; l++) { + free(LayoutFB[l]); + free(TransitionFB[l]); + } + free(LayoutFB); + free(TransitionFB); + free(DisplayFB); +} + +void LCDText::TextInit(int rows, int cols, int yres, int xres, int _goto, + int chars, int char0, int layers) { + int n = rows * cols; + GOTO_COST = _goto; + CHARS = chars; + CHAR0 = char0; + YRES = yres; + XRES = xres; + LROWS = DROWS = rows; + LCOLS = DCOLS = cols; + LAYERS = layers; + LayoutFB = (unsigned char **)malloc(sizeof(char) * cols * rows * layers); + TransitionFB = (unsigned char **)malloc(sizeof(char) * cols * rows * layers); + for (int l = 0; l < layers; l++) { + LayoutFB[l] = (unsigned char *)malloc(sizeof(char) * cols * + rows); // new unsigned char[n]; + memset(LayoutFB[l], ' ', n); + TransitionFB[l] = (unsigned char *)malloc(sizeof(char) * cols * + rows); // new unsigned char[n]; + memset(TransitionFB[l], ' ', n); + } + DisplayFB = (unsigned char *)malloc(sizeof(char) * cols * rows); + ; + memset(DisplayFB, ' ', n); } int LCDText::ResizeLCD(int rows, int cols) { - for(int l = 0; l < LAYERS; l++) { - free(LayoutFB[l]); - free(TransitionFB[l]); - } - free(LayoutFB); - free(TransitionFB); - free(DisplayFB); - TextInit(rows, cols, YRES, XRES, GOTO_COST, CHARS, CHAR0, LAYERS); - return -1; + for (int l = 0; l < LAYERS; l++) { + free(LayoutFB[l]); + free(TransitionFB[l]); + } + free(LayoutFB); + free(TransitionFB); + free(DisplayFB); + TextInit(rows, cols, YRES, XRES, GOTO_COST, CHARS, CHAR0, LAYERS); + return -1; } void LCDText::TextSetSpecialChars() { - for(int i = 0; i < (int)special_chars.size(); i++ ) { - if (i > CHARS) { - LCDError("Too many chars to process. Expected %d, got %" VISUAL_SIZE_T_FORMAT ".", CHARS, - special_chars.size()); - break; - } - TextSpecialCharChanged(i); - } - //emit static_cast(wrapper_)->_TextSpecialCharsSet(); + for (int i = 0; i < (int)special_chars.size(); i++) { + if (i > CHARS) { + LCDError( + "Too many chars to process. Expected %d, got %" VISUAL_SIZE_T_FORMAT + ".", + CHARS, special_chars.size()); + break; + } + TextSpecialCharChanged(i); + } + // emit static_cast(wrapper_)->_TextSpecialCharsSet(); } void LCDText::TextSpecialCharChanged(int ch) { - if( ch < 0 || ch >= CHARS || ch >= (int)special_chars.size() ) - return; - if(TextRealDefChar) - TextRealDefChar(this, ch, special_chars[ch]); - else - LCDError("LCDText: No TextRealDefChar"); + if (ch < 0 || ch >= CHARS || ch >= (int)special_chars.size()) + return; + if (TextRealDefChar) + TextRealDefChar(this, ch, special_chars[ch]); + else + LCDError("LCDText: No TextRealDefChar"); } inline char GetCell(unsigned char **buffer, int pos, int layers) { - char cell = ' '; - for(int l = layers - 1; l>=0; l--) { - if (buffer[l][pos] != ' ') - cell = buffer[l][pos]; - } - return cell; + char cell = ' '; + for (int l = layers - 1; l >= 0; l--) { + if (buffer[l][pos] != ' ') + cell = buffer[l][pos]; + } + return cell; } void LCDText::LayoutChangeBefore() { - if(visitor_->ClearOnLayoutChange()) - TextClear(); - TextClearChars(); -} - -void LCDText::LayoutChangeAfter() { - TextSetSpecialChars(); -} - -void LCDText::TextBlit(int row, int col, int height, - int width) { - int lr, lc; /* layout row/col */ - int dr, dc; /* display row/col */ - int p1, p2; /* start/end positon of changed area */ - int eq; /* counter for equal contents */ - char fb[LROWS * LCOLS]; - - memset(fb, ' ', LROWS * LCOLS); - for(int r = row; r < LROWS && r < row + height; r++) { - for(int c = col; c < LCOLS && c < col + width; c++) { - int n = r * LCOLS + c; - fb[n] = GetCell(LayoutFB, n, LAYERS); - } - } - - /* loop over layout rows */ - for (lr = row; lr < LROWS && lr < row + height; lr++) { - /* transform layout to display row */ - dr = lr; + if (visitor_->ClearOnLayoutChange()) + TextClear(); + TextClearChars(); +} + +void LCDText::LayoutChangeAfter() { TextSetSpecialChars(); } + +void LCDText::TextBlit(int row, int col, int height, int width) { + int lr, lc; /* layout row/col */ + int dr, dc; /* display row/col */ + int p1, p2; /* start/end positon of changed area */ + int eq; /* counter for equal contents */ + char fb[LROWS * LCOLS]; + + memset(fb, ' ', LROWS * LCOLS); + for (int r = row; r < LROWS && r < row + height; r++) { + for (int c = col; c < LCOLS && c < col + width; c++) { + int n = r * LCOLS + c; + fb[n] = GetCell(LayoutFB, n, LAYERS); + } + } + + /* loop over layout rows */ + for (lr = row; lr < LROWS && lr < row + height; lr++) { + /* transform layout to display row */ + dr = lr; + /* sanity check */ + if (dr < 0 || dr >= DROWS) + continue; + /* loop over layout cols */ + for (lc = col; lc < LCOLS && lc < col + width; lc++) { + /* transform layout to display column */ + dc = lc; + /* sanity check */ + if (dc < 0 || dc >= DCOLS) + continue; + /* find start of difference */ + if (DisplayFB[dr * DCOLS + dc] == fb[lr * LCOLS + lc]) + continue; + /* find end of difference */ + for (p1 = dc, p2 = p1, eq = 0, lc++; lc < LCOLS && lc < col + width; + lc++) { + /* transform layout to display column */ + dc = lc; /* sanity check */ - if (dr < 0 || dr >= DROWS) - continue; - /* loop over layout cols */ - for (lc = col; lc < LCOLS && lc < col + width; lc++) { - /* transform layout to display column */ - dc = lc; - /* sanity check */ - if (dc < 0 || dc >= DCOLS) - continue; - /* find start of difference */ - if (DisplayFB[dr * DCOLS + dc] == fb[lr * LCOLS + lc]) - continue; - /* find end of difference */ - for (p1 = dc, p2 = p1, eq = 0, lc++; lc < LCOLS && lc < col + width; lc++) { - /* transform layout to display column */ - dc = lc; - /* sanity check */ - if (dc < 0 || dc >= DCOLS) - continue; - if (DisplayFB[dr * DCOLS + dc] == fb[lr * LCOLS + lc]) { - if (++eq > GOTO_COST) - break; - } else { - p2 = dc; - eq = 0; - } - } - /* send to display */ - memcpy(DisplayFB + dr * DCOLS + p1, fb + lr * LCOLS + p1, p2 - p1 + 1); - if (TextRealBlit) - TextRealBlit((LCDText *)visitor_->GetLCD(), dr, p1, - DisplayFB + dr * DCOLS + p1, p2 - p1 + 1); + if (dc < 0 || dc >= DCOLS) + continue; + if (DisplayFB[dr * DCOLS + dc] == fb[lr * LCOLS + lc]) { + if (++eq > GOTO_COST) + break; + } else { + p2 = dc; + eq = 0; } + } + /* send to display */ + memcpy(DisplayFB + dr * DCOLS + p1, fb + lr * LCOLS + p1, p2 - p1 + 1); + if (TextRealBlit) + TextRealBlit((LCDText *)visitor_->GetLCD(), dr, p1, + DisplayFB + dr * DCOLS + p1, p2 - p1 + 1); } + } } void LCDText::CleanBuffer(unsigned char **buf) { - for(int l = 0; special_chars.size() > 0 && l < LAYERS; l++) { - for(int n = 0; n < LROWS * LCOLS; n++) { - if(buf[l][n] >= CHAR0 && buf[l][n] < CHAR0 + CHARS) - buf[l][n] = ' '; - } + for (int l = 0; special_chars.size() > 0 && l < LAYERS; l++) { + for (int n = 0; n < LROWS * LCOLS; n++) { + if (buf[l][n] >= CHAR0 && buf[l][n] < CHAR0 + CHARS) + buf[l][n] = ' '; } + } } void LCDText::TextClear() { - for(int l = 0; l < LAYERS; l++) - memset(LayoutFB[l], ' ', LROWS * LCOLS); - TextBlit(0, 0, LROWS, LCOLS); + for (int l = 0; l < LAYERS; l++) + memset(LayoutFB[l], ' ', LROWS * LCOLS); + TextBlit(0, 0, LROWS, LCOLS); } -void LCDText::TextClearChars() { - special_chars.clear(); -} +void LCDText::TextClearChars() { special_chars.clear(); } bool LCDText::TextAddChar(SpecialChar ch) { - if((int)special_chars.size() >= CHARS) - return false; - special_chars.push_back(ch); - return true; + if ((int)special_chars.size() >= CHARS) + return false; + special_chars.push_back(ch); + return true; } -void LCDText::TextGreet() { - -} +void LCDText::TextGreet() {} void LCD::TextDraw(WidgetText *widget) { - LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); + LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); - int row = widget->GetRow(); - int col = widget->GetCol(); - std::string txt = widget->GetBuffer(); - int length = widget->GetCols(); - int layer = widget->GetLayer(); + int row = widget->GetRow(); + int col = widget->GetCol(); + std::string txt = widget->GetBuffer(); + int length = widget->GetCols(); + int layer = widget->GetLayer(); - unsigned char *fb; - if(lcdText->IsTransitioning() && widget->GetLayoutBase() == lcdText->GetTransitionLayout()) - fb = lcdText->TransitionFB[layer]; - else - fb = lcdText->LayoutFB[layer]; + unsigned char *fb; + if (lcdText->IsTransitioning() && + widget->GetLayoutBase() == lcdText->GetTransitionLayout()) + fb = lcdText->TransitionFB[layer]; + else + fb = lcdText->LayoutFB[layer]; - memcpy(fb + row * lcdText->LCOLS + col, txt.c_str(), length); + memcpy(fb + row * lcdText->LCOLS + col, txt.c_str(), length); - if(!lcdText->IsTransitioning()) - lcdText->TextBlit(row, col, 1, length); + if (!lcdText->IsTransitioning()) + lcdText->TextBlit(row, col, 1, length); } void LCD::TextBarDraw(WidgetBar *widget) { - LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); + LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); - int length = widget->GetCols(); - int row = widget->GetRow(); - int col = widget->GetCol(); - int layer = widget->GetLayer(); - double end; + int length = widget->GetCols(); + int row = widget->GetRow(); + int col = widget->GetCol(); + int layer = widget->GetLayer(); + double end; - int val1 = round(widget->GetVal1() * length ); - int val2 = round(widget->GetVal2() * length ); + int val1 = round(widget->GetVal1() * length); + int val2 = round(widget->GetVal2() * length); - if(val1 < 0) val1 = 0; - if(val2 < 0) val2 = 0; + if (val1 < 0) + val1 = 0; + if (val2 < 0) + val2 = 0; - int n = row * lcdText->LCOLS + col; + int n = row * lcdText->LCOLS + col; - unsigned char *fb; - if(lcdText->IsTransitioning() && widget->GetLayoutBase() == lcdText->GetTransitionLayout()) - fb = lcdText->TransitionFB[layer]; - else - fb = lcdText->LayoutFB[layer]; - - for(int x = n; x < n + length; x++) - fb[x] = ' '; - - if( widget->GetDirection() == DIR_EAST ) { - if( val1 > val2) - end = n + val1; - else - end = n + val2; - - for(int i = n; i < end; i++ ) { - if( val1 == val2 || i < n + std::min(val1, val2)) - fb[i] = widget->GetChars()[0] + lcdText->CHAR0; - else if( i < n + val2 ) - fb[i] = widget->GetChars()[1] + lcdText->CHAR0; - else - fb[i] = widget->GetChars()[2] + lcdText->CHAR0; - } - if( widget->GetStyle() == STYLE_HOLLOW and val1 == val2 ) { - for(int i = n; i < end; i++ ) { - if( i == n ) - fb[i] = widget->GetChars()[1] + lcdText->CHAR0; - else if( i < n + length ) - fb[i] = widget->GetChars()[2] + lcdText->CHAR0; - else if( i == n + length ) - fb[i] = widget->GetChars()[3] + lcdText->CHAR0; - } - } - } else if( widget->GetDirection() == DIR_WEST ) { - if (val1 > val2 ) - end = n - val1; - else - end = n - val2; - for(int i = n; i > end; i-- ) { - if( val1 == val2 or i > n - std::min(val1, val2) ) - fb[i] = widget->GetChars()[0] + lcdText->CHAR0; - else if( i > n - val2 ) - fb[i] = widget->GetChars()[1] + lcdText->CHAR0; - else - fb[i] = widget->GetChars()[2] + lcdText->CHAR0; - } - if( widget->GetStyle() == STYLE_HOLLOW && val1 == val2 ) { - for(int i = n; i > n - length; i--) { - if( i == n ) - fb[i] = widget->GetChars()[3] + lcdText->CHAR0; - else if( i > n - length - 1 ) - fb[i] = widget->GetChars()[2] + lcdText->CHAR0; - else if( i == n - length - 1 ) - fb[i] = widget->GetChars()[3] + lcdText->CHAR0; + unsigned char *fb; + if (lcdText->IsTransitioning() && + widget->GetLayoutBase() == lcdText->GetTransitionLayout()) + fb = lcdText->TransitionFB[layer]; + else + fb = lcdText->LayoutFB[layer]; - } - } - } + for (int x = n; x < n + length; x++) + fb[x] = ' '; - if(!lcdText->IsTransitioning()) - lcdText->TextBlit(row, col, 1, length); + if (widget->GetDirection() == DIR_EAST) { + if (val1 > val2) + end = n + val1; + else + end = n + val2; + + for (int i = n; i < end; i++) { + if (val1 == val2 || i < n + std::min(val1, val2)) + fb[i] = widget->GetChars()[0] + lcdText->CHAR0; + else if (i < n + val2) + fb[i] = widget->GetChars()[1] + lcdText->CHAR0; + else + fb[i] = widget->GetChars()[2] + lcdText->CHAR0; + } + if (widget->GetStyle() == STYLE_HOLLOW and val1 == val2) { + for (int i = n; i < end; i++) { + if (i == n) + fb[i] = widget->GetChars()[1] + lcdText->CHAR0; + else if (i < n + length) + fb[i] = widget->GetChars()[2] + lcdText->CHAR0; + else if (i == n + length) + fb[i] = widget->GetChars()[3] + lcdText->CHAR0; + } + } + } else if (widget->GetDirection() == DIR_WEST) { + if (val1 > val2) + end = n - val1; + else + end = n - val2; + for (int i = n; i > end; i--) { + if (val1 == val2 or i > n - std::min(val1, val2)) + fb[i] = widget->GetChars()[0] + lcdText->CHAR0; + else if (i > n - val2) + fb[i] = widget->GetChars()[1] + lcdText->CHAR0; + else + fb[i] = widget->GetChars()[2] + lcdText->CHAR0; + } + if (widget->GetStyle() == STYLE_HOLLOW && val1 == val2) { + for (int i = n; i > n - length; i--) { + if (i == n) + fb[i] = widget->GetChars()[3] + lcdText->CHAR0; + else if (i > n - length - 1) + fb[i] = widget->GetChars()[2] + lcdText->CHAR0; + else if (i == n - length - 1) + fb[i] = widget->GetChars()[3] + lcdText->CHAR0; + } + } + } + + if (!lcdText->IsTransitioning()) + lcdText->TextBlit(row, col, 1, length); } void LCD::TextHistogramDraw(WidgetHistogram *widget) { - LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); + LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); - int row = widget->GetRow(); - int col = widget->GetCol(); - int length = widget->GetCols(); - int layer = widget->GetLayer(); + int row = widget->GetRow(); + int col = widget->GetCol(); + int length = widget->GetCols(); + int layer = widget->GetLayer(); - char *txt = new char[length]; + char *txt = new char[length]; - for(int i = 0; i < length; i++ ) { - int val = round(widget->GetHistory()[i] * lcdText->YRES); - if( val < 0 ) - val = 0; - txt[i] = widget->GetCh()[val] + lcdText->CHAR0; - } + for (int i = 0; i < length; i++) { + int val = round(widget->GetHistory()[i] * lcdText->YRES); + if (val < 0) + val = 0; + txt[i] = widget->GetCh()[val] + lcdText->CHAR0; + } - unsigned char *fb; - if(lcdText->IsTransitioning() && widget->GetLayoutBase() == lcdText->GetTransitionLayout()) - fb = lcdText->TransitionFB[layer]; - else - fb = lcdText->LayoutFB[layer]; + unsigned char *fb; + if (lcdText->IsTransitioning() && + widget->GetLayoutBase() == lcdText->GetTransitionLayout()) + fb = lcdText->TransitionFB[layer]; + else + fb = lcdText->LayoutFB[layer]; - memcpy(fb + row * lcdText->LCOLS + col, txt, length); - delete []txt; - if(!lcdText->IsTransitioning()) - lcdText->TextBlit(row, col, 1, length); + memcpy(fb + row * lcdText->LCOLS + col, txt, length); + delete[] txt; + if (!lcdText->IsTransitioning()) + lcdText->TextBlit(row, col, 1, length); } void LCD::TextIconDraw(WidgetIcon *widget) { - LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); - - int row = widget->GetRow(); - int col = widget->GetCol(); - int layer = widget->GetLayer(); - int n = row * lcdText->LCOLS + col; - - if((!lcdText->IsTransitioning() || (lcdText->IsTransitioning() && widget->GetLayoutBase() == lcdText->GetTransitionLayout()))) { - lcdText->special_chars[widget->GetCh()] = widget->GetBitmap(); - lcdText->TextSpecialCharChanged(widget->GetCh()); - } - - unsigned char *fb; - if(lcdText->IsTransitioning() && widget->GetLayoutBase() == lcdText->GetTransitionLayout()) - fb = lcdText->TransitionFB[layer]; - else - fb = lcdText->LayoutFB[layer]; - fb[n] = (char) (widget->GetCh() + lcdText->CHAR0); - if(!lcdText->IsTransitioning()) - lcdText->TextBlit(row, col, 1, 1); + LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); + + int row = widget->GetRow(); + int col = widget->GetCol(); + int layer = widget->GetLayer(); + int n = row * lcdText->LCOLS + col; + + if ((!lcdText->IsTransitioning() || + (lcdText->IsTransitioning() && + widget->GetLayoutBase() == lcdText->GetTransitionLayout()))) { + lcdText->special_chars[widget->GetCh()] = widget->GetBitmap(); + lcdText->TextSpecialCharChanged(widget->GetCh()); + } + + unsigned char *fb; + if (lcdText->IsTransitioning() && + widget->GetLayoutBase() == lcdText->GetTransitionLayout()) + fb = lcdText->TransitionFB[layer]; + else + fb = lcdText->LayoutFB[layer]; + fb[n] = (char)(widget->GetCh() + lcdText->CHAR0); + if (!lcdText->IsTransitioning()) + lcdText->TextBlit(row, col, 1, 1); } void LCD::TextBignumsDraw(WidgetBignums *widget) { - LCDText *lcd = (LCDText *)widget->GetVisitor()->GetLCD(); - - if( lcd->CHARS < 8 || lcd->YRES < 8 || lcd->XRES < 6 ) - return; - - std::vector tmp; - tmp.resize(8); - for(int i = 0; i < 8; i++ ) { - tmp[i] = SpecialChar(8); - } - - for(int row = 0; row < 16; row++ ) { - int i = row / 8; - int rr = row % 8; - for(int col = 0; col < 24; col++ ) { - int j = col / 6; - int cc = col % 6; - int n = i * 4 + j; - - if( widget->GetFB()[row * 24 + col] == '.' ) { - tmp[n][rr] = tmp[n][rr] ^ (1<<(5-cc)); - } - } - } - - for(int i = 0; i < 8; i++ ) { - lcd->special_chars[widget->GetCh()[i]] = tmp[i]; - lcd->TextSpecialCharChanged(widget->GetCh()[i]); - } - - int row = widget->GetRow(); - int col = widget->GetCol(); - int layer = widget->GetLayer(); - - unsigned char *fb; - if(lcd->IsTransitioning() && widget->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB[layer]; - else - fb = lcd->LayoutFB[layer]; - - int n = 0; - for(int i = 0; i < 2 && i + row < lcd->LROWS; i++) { - for(int j = 0; j < 4 && j + col < lcd->LCOLS; j++ ) { - fb[(row + i) * lcd->LCOLS + col + j] = - (char)(n + widget->GetCh()[0] + lcd->CHAR0); - n++; - } - } - if(!lcd->IsTransitioning()) - lcd->TextBlit(row, col, 2, 4); + LCDText *lcd = (LCDText *)widget->GetVisitor()->GetLCD(); + + if (lcd->CHARS < 8 || lcd->YRES < 8 || lcd->XRES < 6) + return; + + std::vector tmp; + tmp.resize(8); + for (int i = 0; i < 8; i++) { + tmp[i] = SpecialChar(8); + } + + for (int row = 0; row < 16; row++) { + int i = row / 8; + int rr = row % 8; + for (int col = 0; col < 24; col++) { + int j = col / 6; + int cc = col % 6; + int n = i * 4 + j; + + if (widget->GetFB()[row * 24 + col] == '.') { + tmp[n][rr] = tmp[n][rr] ^ (1 << (5 - cc)); + } + } + } + + for (int i = 0; i < 8; i++) { + lcd->special_chars[widget->GetCh()[i]] = tmp[i]; + lcd->TextSpecialCharChanged(widget->GetCh()[i]); + } + + int row = widget->GetRow(); + int col = widget->GetCol(); + int layer = widget->GetLayer(); + + unsigned char *fb; + if (lcd->IsTransitioning() && + widget->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB[layer]; + else + fb = lcd->LayoutFB[layer]; + + int n = 0; + for (int i = 0; i < 2 && i + row < lcd->LROWS; i++) { + for (int j = 0; j < 4 && j + col < lcd->LCOLS; j++) { + fb[(row + i) * lcd->LCOLS + col + j] = + (char)(n + widget->GetCh()[0] + lcd->CHAR0); + n++; + } + } + if (!lcd->IsTransitioning()) + lcd->TextBlit(row, col, 2, 4); } void LCD::TextFPSDraw(WidgetFPS *widget) { - LCDText *lcd = (LCDText *)widget->GetVisitor()->GetLCD(); - - if( lcd->CHARS < 8 || lcd->YRES < 8 || lcd->XRES < 6 ) - return; - - std::vector tmp; - tmp.resize(8); - for(int i = 0; i < 8; i++ ) { - tmp[i] = SpecialChar(8); - } - - for(int row = 0; row < 16; row++ ) { - int i = row / 8; - int rr = row % 8; - for(int col = 0; col < 24; col++ ) { - int j = col / 6; - int cc = col % 6; - int n = i * 4 + j; - - if( widget->GetFB()[row * 24 + col] == '.' ) { - tmp[n][rr] = tmp[n][rr] ^ (1<<(5-cc)); - } - } - } - - for(int i = 0; i < 8; i++ ) { - lcd->special_chars[widget->GetCh()[i]] = tmp[i]; - lcd->TextSpecialCharChanged(widget->GetCh()[i]); - } - - int row = widget->GetRow(); - int col = widget->GetCol(); - int layer = widget->GetLayer(); - - unsigned char *fb; - if(lcd->IsTransitioning() && widget->GetLayoutBase() == lcd->GetTransitionLayout()) - fb = lcd->TransitionFB[layer]; - else - fb = lcd->LayoutFB[layer]; - - int n = 0; - for(int i = 0; i < 2 && i + row < lcd->LROWS; i++) { - for(int j = 0; j < 4 && j + col < lcd->LCOLS; j++ ) { - fb[(row + i) * lcd->LCOLS + col + j] = - (char)(n + widget->GetCh()[0] + lcd->CHAR0); - n++; - } - } - if(!lcd->IsTransitioning()) - lcd->TextBlit(row, col, 2, 4); + LCDText *lcd = (LCDText *)widget->GetVisitor()->GetLCD(); + + if (lcd->CHARS < 8 || lcd->YRES < 8 || lcd->XRES < 6) + return; + + std::vector tmp; + tmp.resize(8); + for (int i = 0; i < 8; i++) { + tmp[i] = SpecialChar(8); + } + + for (int row = 0; row < 16; row++) { + int i = row / 8; + int rr = row % 8; + for (int col = 0; col < 24; col++) { + int j = col / 6; + int cc = col % 6; + int n = i * 4 + j; + + if (widget->GetFB()[row * 24 + col] == '.') { + tmp[n][rr] = tmp[n][rr] ^ (1 << (5 - cc)); + } + } + } + + for (int i = 0; i < 8; i++) { + lcd->special_chars[widget->GetCh()[i]] = tmp[i]; + lcd->TextSpecialCharChanged(widget->GetCh()[i]); + } + + int row = widget->GetRow(); + int col = widget->GetCol(); + int layer = widget->GetLayer(); + + unsigned char *fb; + if (lcd->IsTransitioning() && + widget->GetLayoutBase() == lcd->GetTransitionLayout()) + fb = lcd->TransitionFB[layer]; + else + fb = lcd->LayoutFB[layer]; + + int n = 0; + for (int i = 0; i < 2 && i + row < lcd->LROWS; i++) { + for (int j = 0; j < 4 && j + col < lcd->LCOLS; j++) { + fb[(row + i) * lcd->LCOLS + col + j] = + (char)(n + widget->GetCh()[0] + lcd->CHAR0); + n++; + } + } + if (!lcd->IsTransitioning()) + lcd->TextBlit(row, col, 2, 4); } /* @@ -515,20 +523,20 @@ void LCD::TextGifDraw(WidgetGif *widget) { int cc = col % lcdText->XRES; int n = i * widget->GetCols() + j; - RGBA pxl = widget->GetBitmap()[row * widget->GetCols() * lcdText->XRES + col]; - if( !(pxl.R == widget->GetBackground().redQuantum() / 256 && - pxl.G == widget->GetBackground().greenQuantum() / 256 && - pxl.B == widget->GetBackground().blueQuantum() / 256) && - pxl.A == 255) { - tmp[n][rr] = tmp[n][rr] ^ 1<<(lcdText->XRES - 1 - cc); + RGBA pxl = widget->GetBitmap()[row * widget->GetCols() * +lcdText->XRES + col]; if( !(pxl.R == widget->GetBackground().redQuantum() / 256 +&& pxl.G == widget->GetBackground().greenQuantum() / 256 && pxl.B == +widget->GetBackground().blueQuantum() / 256) && pxl.A == 255) { tmp[n][rr] = +tmp[n][rr] ^ 1<<(lcdText->XRES - 1 - cc); } } - } + } std::vector chars = widget->GetChars(); - for(int i = 0; i < (int)tmp.size() && i < (int)widget->GetChars().size(); i++ ){ - if((!lcdText->IsTransitioning() || (lcdText->IsTransitioning() && widget->GetLayoutBase() == lcdText->GetTransitionLayout()))) { + for(int i = 0; i < (int)tmp.size() && i < (int)widget->GetChars().size(); +i++ ){ if((!lcdText->IsTransitioning() || (lcdText->IsTransitioning() && +widget->GetLayoutBase() == lcdText->GetTransitionLayout()))) { lcdText->special_chars[widget->GetChars()[i]] = tmp[i]; lcdText->TextSpecialCharChanged(widget->GetChars()[i]); } @@ -542,14 +550,14 @@ void LCD::TextGifDraw(WidgetGif *widget) { int n = 0; unsigned char *fb; - if(lcdText->IsTransitioning() && + if(lcdText->IsTransitioning() && widget->GetLayoutBase() == lcdText->GetTransitionLayout()) fb = lcdText->TransitionFB[layer]; else fb = lcdText->LayoutFB[layer]; for(int i = 0; i < rows && i + row < (int)lcdText->LROWS; i++) { for(int j = 0; j < cols && j + col < (int)lcdText->LCOLS; j++ ) { - fb[(row + i) * lcdText->LCOLS + col + j] = + fb[(row + i) * lcdText->LCOLS + col + j] = (char)(n + widget->GetChars()[0] + lcdText->CHAR0); n += 1; } @@ -561,429 +569,429 @@ void LCD::TextGifDraw(WidgetGif *widget) { */ void TextVisualizationPeakDraw(WidgetVisualization *widget) { - LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); - - int row = widget->GetRow(); - int col = widget->GetCol(); - int width = widget->GetCols(); - int height = widget->GetRows(); - int layer = widget->GetLayer(); - std::map ch = widget->GetChars(); - unsigned char *fb; - - if(lcdText->IsTransitioning()) - fb = lcdText->TransitionFB[layer]; - else - fb = lcdText->LayoutFB[layer]; - - for(int y = 0; y < height && row + y < lcdText->LROWS; y++) { - int val = (int)(((double)widget->GetHistory()[y][0] / - (double)SHRT_MAX) * (width / 2 - 1)); - int n = (row + y) * lcdText->LCOLS + col; - - for(int i = 0; i < (width / 2 - 1) - val; i++) { - if(fb[n + i] == ch[0] ) - fb[n + i] = ch[1]; - else if(fb[n + i] == ch[1] ) - fb[n + i] = ch[2]; - else if(fb[n + i] == ch[2] ) - fb[n + i] = ch[3]; - else if(fb[n + i] == ch[3] ) - fb[n + i] = ch[4]; - else - fb[n + i] = ' '; - } - - for(int i = (width / 2 - 1) - val; i < (width / 2 - 1); i++) { - fb[n + i] = ch[0]; - } - - fb[n + (width / 2 - 1)] = ch[5]; - - val = (int)(((double)widget->GetHistory()[y][1] / - (double)SHRT_MAX) * (width / 2 - 1)) + width / 2; - for(int i = width / 2; i < val; i++) { - fb[n + i] = ch[0]; - } - - for(int i = val; i < width && i + col < lcdText->LCOLS; i++) { - if(fb[n + i] == ch[0] ) - fb[n + i] = ch[1]; - else if(fb[n + i] == ch[1]) - fb[n + i] = ch[2]; - else if(fb[n + i] == ch[2]) - fb[n + i] = ch[3]; - else if(fb[n + i] == ch[3]) - fb[n + i] = ch[4]; - else - fb[n + i] = ' '; - } - } - - if(!lcdText->IsTransitioning()) - lcdText->TextBlit(row, col, height, width); + LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); + + int row = widget->GetRow(); + int col = widget->GetCol(); + int width = widget->GetCols(); + int height = widget->GetRows(); + int layer = widget->GetLayer(); + std::map ch = widget->GetChars(); + unsigned char *fb; + + if (lcdText->IsTransitioning()) + fb = lcdText->TransitionFB[layer]; + else + fb = lcdText->LayoutFB[layer]; + + for (int y = 0; y < height && row + y < lcdText->LROWS; y++) { + int val = (int)(((double)widget->GetHistory()[y][0] / (double)SHRT_MAX) * + (width / 2 - 1)); + int n = (row + y) * lcdText->LCOLS + col; + + for (int i = 0; i < (width / 2 - 1) - val; i++) { + if (fb[n + i] == ch[0]) + fb[n + i] = ch[1]; + else if (fb[n + i] == ch[1]) + fb[n + i] = ch[2]; + else if (fb[n + i] == ch[2]) + fb[n + i] = ch[3]; + else if (fb[n + i] == ch[3]) + fb[n + i] = ch[4]; + else + fb[n + i] = ' '; + } + + for (int i = (width / 2 - 1) - val; i < (width / 2 - 1); i++) { + fb[n + i] = ch[0]; + } + + fb[n + (width / 2 - 1)] = ch[5]; + + val = (int)(((double)widget->GetHistory()[y][1] / (double)SHRT_MAX) * + (width / 2 - 1)) + + width / 2; + for (int i = width / 2; i < val; i++) { + fb[n + i] = ch[0]; + } + + for (int i = val; i < width && i + col < lcdText->LCOLS; i++) { + if (fb[n + i] == ch[0]) + fb[n + i] = ch[1]; + else if (fb[n + i] == ch[1]) + fb[n + i] = ch[2]; + else if (fb[n + i] == ch[2]) + fb[n + i] = ch[3]; + else if (fb[n + i] == ch[3]) + fb[n + i] = ch[4]; + else + fb[n + i] = ' '; + } + } + + if (!lcdText->IsTransitioning()) + lcdText->TextBlit(row, col, height, width); } void TextVisualizationPCMDraw(WidgetVisualization *widget) { -/* - LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); - - int row = widget->GetRow(); - int col = widget->GetCol(); - int width = widget->GetCols(); - int height = widget->GetRows(); - int layer = widget->GetLayer(); - std::map ch = widget->GetChars(); - unsigned char *buffer = (unsigned char *)widget->GetBuffer(); - proxy v = widget->GetProxy(); - - unsigned char *fb; - - if(lcdText->IsTransitioning()) - fb = lcdText->TransitionFB[layer]; - else - fb = lcdText->LayoutFB[layer]; - - std::vector tmp; - for(int i = 0; i < - (height / lcdText->YRES) * (width / lcdText->XRES); i++ ) { - tmp.push_back(SpecialChar(lcdText->YRES)); - } - - for(int r = 0; r < height; r++) { - int i = r / lcdText->YRES; - int rr = r % lcdText->YRES; - for(int c = 0; c < width; c++) { - int j = c / lcdText->XRES; - int cc = c % lcdText->XRES; - int n = i * (width / lcdText->XRES) + j; - - unsigned char pixel = buffer[r * width + c]; - unsigned char gray = (77 * v.pal->colors[pixel].r + - 150 * v.pal->colors[pixel].g + - 28 * v.pal->colors[pixel].b) / 255; - bool black = (gray < 127); - - if(!black) { - tmp[n][rr] = tmp[n][rr] ^ 1<<(lcdText->XRES - 1 - cc); - } - } - } - - if(ch[0]) - for(int i = 0; i < - (height / lcdText->YRES) * (width / lcdText->XRES); i++ ){ - lcdText->special_chars[ch[i]] = tmp[i]; - lcdText->TextSpecialCharChanged(ch[i]); - } - else - { - LCDError("No special characters allocated."); - return; - } - - int n = 0; - for(int i = 0; i < height / lcdText->YRES && - i + row < lcdText->LROWS; i++) { - for(int j = 0; j < width / lcdText->XRES && - j + col < lcdText->LCOLS; j++ ) { - fb[(row + i) * lcdText->LCOLS + col + j] = - (char)(n + widget->GetChars()[0] + lcdText->CHAR0); - n += 1; - } - } - - if(!lcdText->IsTransitioning()) - lcdText->TextBlit(row, col, height, width); - */ + /* + LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); + + int row = widget->GetRow(); + int col = widget->GetCol(); + int width = widget->GetCols(); + int height = widget->GetRows(); + int layer = widget->GetLayer(); + std::map ch = widget->GetChars(); + unsigned char *buffer = (unsigned char *)widget->GetBuffer(); + proxy v = widget->GetProxy(); + + unsigned char *fb; + + if(lcdText->IsTransitioning()) + fb = lcdText->TransitionFB[layer]; + else + fb = lcdText->LayoutFB[layer]; + + std::vector tmp; + for(int i = 0; i < + (height / lcdText->YRES) * (width / lcdText->XRES); i++ ) { + tmp.push_back(SpecialChar(lcdText->YRES)); + } + + for(int r = 0; r < height; r++) { + int i = r / lcdText->YRES; + int rr = r % lcdText->YRES; + for(int c = 0; c < width; c++) { + int j = c / lcdText->XRES; + int cc = c % lcdText->XRES; + int n = i * (width / lcdText->XRES) + j; + + unsigned char pixel = buffer[r * width + c]; + unsigned char gray = (77 * v.pal->colors[pixel].r + + 150 * v.pal->colors[pixel].g + + 28 * v.pal->colors[pixel].b) / 255; + bool black = (gray < 127); + + if(!black) { + tmp[n][rr] = tmp[n][rr] ^ 1<<(lcdText->XRES - 1 - cc); + } + } + } + + if(ch[0]) + for(int i = 0; i < + (height / lcdText->YRES) * (width / lcdText->XRES); i++ ){ + lcdText->special_chars[ch[i]] = tmp[i]; + lcdText->TextSpecialCharChanged(ch[i]); + } + else + { + LCDError("No special characters allocated."); + return; + } + + int n = 0; + for(int i = 0; i < height / lcdText->YRES && + i + row < lcdText->LROWS; i++) { + for(int j = 0; j < width / lcdText->XRES && + j + col < lcdText->LCOLS; j++ ) { + fb[(row + i) * lcdText->LCOLS + col + j] = + (char)(n + widget->GetChars()[0] + lcdText->CHAR0); + n += 1; + } + } + + if(!lcdText->IsTransitioning()) + lcdText->TextBlit(row, col, height, width); + */ } void TextVisualizationSpectrumDraw(WidgetVisualization *widget) { - LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); + LCDText *lcdText = (LCDText *)widget->GetVisitor()->GetLCD(); - int row = widget->GetRow(); - int col = widget->GetCol(); - int width = widget->GetCols(); - int height = widget->GetRows(); - int layer = widget->GetLayer(); - std::map ch = widget->GetChars(); - unsigned char *fb; + int row = widget->GetRow(); + int col = widget->GetCol(); + int width = widget->GetCols(); + int height = widget->GetRows(); + int layer = widget->GetLayer(); + std::map ch = widget->GetChars(); + unsigned char *fb; - if(lcdText->IsTransitioning()) - fb = lcdText->TransitionFB[layer]; - else - fb = lcdText->LayoutFB[layer]; + if (lcdText->IsTransitioning()) + fb = lcdText->TransitionFB[layer]; + else + fb = lcdText->LayoutFB[layer]; - int base = SHRT_MAX / height; + int base = SHRT_MAX / height; - for(int x = 0; x < width && col + x < lcdText->LCOLS; x++) { - - int val = widget->GetHistory()[0][x]; + for (int x = 0; x < width && col + x < lcdText->LCOLS; x++) { - for(int y = 1; y <= height && row + y - 1 < lcdText->LROWS; y++) { - int n = (row + height - y) * lcdText->LCOLS + col + x; - if(val > (y * base)) - fb[n] = ch[0]; - else if(val > ((y-1) * base)) - fb[n] = ch[1]; - else - fb[n] = ' '; - } + int val = widget->GetHistory()[0][x]; + for (int y = 1; y <= height && row + y - 1 < lcdText->LROWS; y++) { + int n = (row + height - y) * lcdText->LCOLS + col + x; + if (val > (y * base)) + fb[n] = ch[0]; + else if (val > ((y - 1) * base)) + fb[n] = ch[1]; + else + fb[n] = ' '; } + } - if(!lcdText->IsTransitioning()) - lcdText->TextBlit(row, col, height, width); + if (!lcdText->IsTransitioning()) + lcdText->TextBlit(row, col, height, width); } void TextVisualizationDraw(WidgetVisualization *widget) { - if(widget->GetStyle() == STYLE_PEAK) - TextVisualizationPeakDraw(widget); - else if(widget->GetStyle() == STYLE_PCM) - TextVisualizationPCMDraw(widget); - else if(widget->GetStyle() == STYLE_SPECTRUM) - TextVisualizationSpectrumDraw(widget); + if (widget->GetStyle() == STYLE_PEAK) + TextVisualizationPeakDraw(widget); + else if (widget->GetStyle() == STYLE_PCM) + TextVisualizationPCMDraw(widget); + else if (widget->GetStyle() == STYLE_SPECTRUM) + TextVisualizationSpectrumDraw(widget); } void LCDText::Transition() { - switch(visitor_->GetDirection()) { - case TRANSITION_LEFT: - case TRANSITION_RIGHT: - case TRANSITION_BOTH: - TransitionLeftRight(); - break; - case TRANSITION_UP: - case TRANSITION_DOWN: - TransitionUpDown(); - break; - case TRANSITION_TENTACLE: - TransitionTentacle(); - break; - default: - TransitionLeftRight(); - } + switch (visitor_->GetDirection()) { + case TRANSITION_LEFT: + case TRANSITION_RIGHT: + case TRANSITION_BOTH: + TransitionLeftRight(); + break; + case TRANSITION_UP: + case TRANSITION_DOWN: + TransitionUpDown(); + break; + case TRANSITION_TENTACLE: + TransitionTentacle(); + break; + default: + TransitionLeftRight(); + } } void LCDText::TransitionLeftRight() { - int direction = visitor_->GetDirection(); - int col; - unsigned char *left, *right; - unsigned char layout[LROWS * LCOLS], transition[LROWS * LCOLS]; - - // Hide last layout's special chars if new layout has special chars. - for(int l = 0; special_chars.size() > 0 && l < LAYERS; l++) { - for(int n = 0; n < LROWS * LCOLS; n++) { - if(LayoutFB[l][n] >= CHAR0 && LayoutFB[l][n] < CHAR0 + CHARS) - LayoutFB[l][n] = ' '; - if(TransitionFB[l][n] >= CHAR0 && TransitionFB[l][n] < CHAR0 + CHARS) - ;//TransitionFB[l][n] = ' '; - } - } - - memset(layout, ' ', LROWS * LCOLS); - memset(transition, ' ', LROWS * LCOLS); - - for(int l = LAYERS - 1; l>=0; l--) { - for(int n = 0; n < LROWS * LCOLS; n++) { - if(LayoutFB[l][n] != ' ') - layout[n] = LayoutFB[l][n]; - if(TransitionFB[l][n] != ' ') - transition[n] = TransitionFB[l][n]; - } - } - - for(int row = 0; row < LROWS; row++) { - int n = row * LCOLS; - if( direction == TRANSITION_LEFT || - (direction == TRANSITION_BOTH && row % 2 == 0)) { - col = LCOLS - transition_tick_ - 1; - left = layout; - right = transition; - } else if( direction == TRANSITION_RIGHT || direction == TRANSITION_BOTH) { - col = transition_tick_; - left = transition; - right = layout; - } else { - col = transition_tick_; - left = transition; - right = layout; - } - memcpy(DisplayFB + n, left + n + (LCOLS - col - 1), col); - memcpy(DisplayFB + n + col, right + n, LCOLS - col); - if(direction != TRANSITION_BOTH) - DisplayFB[n + col] = ':'; - if(TextRealBlit) - TextRealBlit((LCDText *)visitor_->GetLCD(), row, 0, DisplayFB + n, LCOLS); - } - if( ++transition_tick_ >= (int)LCOLS ) { - transitioning_ = false; - transition_tick_ = 0; - //emit static_cast( - // visitor_->GetWrapper())->_TransitionFinished(); - for(int l = 0; l < LAYERS; l++) { - memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS); - memset(TransitionFB[l], ' ', LCOLS * LROWS); - } - TextBlit(0, 0, LROWS, LCOLS); + int direction = visitor_->GetDirection(); + int col; + unsigned char *left, *right; + unsigned char layout[LROWS * LCOLS], transition[LROWS * LCOLS]; + + // Hide last layout's special chars if new layout has special chars. + for (int l = 0; special_chars.size() > 0 && l < LAYERS; l++) { + for (int n = 0; n < LROWS * LCOLS; n++) { + if (LayoutFB[l][n] >= CHAR0 && LayoutFB[l][n] < CHAR0 + CHARS) + LayoutFB[l][n] = ' '; + if (TransitionFB[l][n] >= CHAR0 && TransitionFB[l][n] < CHAR0 + CHARS) + ; // TransitionFB[l][n] = ' '; + } + } + + memset(layout, ' ', LROWS * LCOLS); + memset(transition, ' ', LROWS * LCOLS); + + for (int l = LAYERS - 1; l >= 0; l--) { + for (int n = 0; n < LROWS * LCOLS; n++) { + if (LayoutFB[l][n] != ' ') + layout[n] = LayoutFB[l][n]; + if (TransitionFB[l][n] != ' ') + transition[n] = TransitionFB[l][n]; + } + } + + for (int row = 0; row < LROWS; row++) { + int n = row * LCOLS; + if (direction == TRANSITION_LEFT || + (direction == TRANSITION_BOTH && row % 2 == 0)) { + col = LCOLS - transition_tick_ - 1; + left = layout; + right = transition; + } else if (direction == TRANSITION_RIGHT || direction == TRANSITION_BOTH) { + col = transition_tick_; + left = transition; + right = layout; + } else { + col = transition_tick_; + left = transition; + right = layout; + } + memcpy(DisplayFB + n, left + n + (LCOLS - col - 1), col); + memcpy(DisplayFB + n + col, right + n, LCOLS - col); + if (direction != TRANSITION_BOTH) + DisplayFB[n + col] = ':'; + if (TextRealBlit) + TextRealBlit((LCDText *)visitor_->GetLCD(), row, 0, DisplayFB + n, LCOLS); + } + if (++transition_tick_ >= (int)LCOLS) { + transitioning_ = false; + transition_tick_ = 0; + // emit static_cast( + // visitor_->GetWrapper())->_TransitionFinished(); + for (int l = 0; l < LAYERS; l++) { + memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS); + memset(TransitionFB[l], ' ', LCOLS * LROWS); } + TextBlit(0, 0, LROWS, LCOLS); + } } void LCDText::TransitionUpDown() { - int direction = visitor_->GetDirection(); - int row; - unsigned char *top, *bottom; - unsigned char layout[LROWS * LCOLS], transition[LROWS * LCOLS]; - - // Hide last layout's special chars if new layout has special chars. - for(int l = LAYERS - 1; l>=0; l--) { - for(int n = 0; special_chars.size() > 0 && n < LROWS * LCOLS; n++) { - if(LayoutFB[l][n] >= CHAR0 && LayoutFB[l][n] < CHAR0 + CHARS) - LayoutFB[l][n] = ' '; - } - } - memset(layout, ' ', LROWS * LCOLS); - memset(transition, ' ', LROWS * LCOLS); - - for(int n = 0; n < LROWS * LCOLS; n++) { - layout[n] = GetCell(LayoutFB, n, LAYERS); - transition[n] = GetCell(TransitionFB, n, LAYERS); - } - - if(direction == TRANSITION_UP) { - top = layout; - bottom = transition; - row = LROWS - transition_tick_; + int direction = visitor_->GetDirection(); + int row; + unsigned char *top, *bottom; + unsigned char layout[LROWS * LCOLS], transition[LROWS * LCOLS]; + + // Hide last layout's special chars if new layout has special chars. + for (int l = LAYERS - 1; l >= 0; l--) { + for (int n = 0; special_chars.size() > 0 && n < LROWS * LCOLS; n++) { + if (LayoutFB[l][n] >= CHAR0 && LayoutFB[l][n] < CHAR0 + CHARS) + LayoutFB[l][n] = ' '; + } + } + memset(layout, ' ', LROWS * LCOLS); + memset(transition, ' ', LROWS * LCOLS); + + for (int n = 0; n < LROWS * LCOLS; n++) { + layout[n] = GetCell(LayoutFB, n, LAYERS); + transition[n] = GetCell(TransitionFB, n, LAYERS); + } + + if (direction == TRANSITION_UP) { + top = layout; + bottom = transition; + row = LROWS - transition_tick_; + } else { + top = transition; + bottom = layout; + row = transition_tick_; + } + + for (int r = 0; r < LROWS; r++) { + int n = r * LCOLS; + memset(DisplayFB + n, ' ', LCOLS); + if (r < row) { + memcpy(DisplayFB + n, top + n, LCOLS); } else { - top = transition; - bottom = layout; - row = transition_tick_; + memcpy(DisplayFB + n, bottom + n, LCOLS); } - - for(int r = 0; r < LROWS; r++) { - int n = r * LCOLS; - memset(DisplayFB + n, ' ', LCOLS); - if(r < row) { - memcpy(DisplayFB + n, top + n, LCOLS); - } else { - memcpy(DisplayFB + n, bottom + n, LCOLS); - } - if(TextRealBlit) - TextRealBlit((LCDText *)visitor_->GetLCD(), r, 0, DisplayFB + n, LCOLS); - } - if( ++transition_tick_ >= (int)LROWS ) { - transitioning_ = false; - transition_tick_ = 0; - //emit static_cast( - // visitor_->GetWrapper())->_TransitionFinished(); - memset(DisplayFB, ' ', LCOLS * LROWS); - for(int l = 0; l < LAYERS; l++) { - memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS); - memset(TransitionFB[l], ' ', LCOLS * LROWS); - } - TextBlit(0, 0, LROWS, LCOLS); + if (TextRealBlit) + TextRealBlit((LCDText *)visitor_->GetLCD(), r, 0, DisplayFB + n, LCOLS); + } + if (++transition_tick_ >= (int)LROWS) { + transitioning_ = false; + transition_tick_ = 0; + // emit static_cast( + // visitor_->GetWrapper())->_TransitionFinished(); + memset(DisplayFB, ' ', LCOLS * LROWS); + for (int l = 0; l < LAYERS; l++) { + memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS); + memset(TransitionFB[l], ' ', LCOLS * LROWS); } + TextBlit(0, 0, LROWS, LCOLS); + } } void SaneCoords(LCDText *lcd, int *x, int *y1, int *y2) { - if(*x >= lcd->LCOLS) - *x = lcd->LCOLS - 1; - else if(*x < 0) - *x = 0; + if (*x >= lcd->LCOLS) + *x = lcd->LCOLS - 1; + else if (*x < 0) + *x = 0; - if(*y1 >= lcd->LROWS) - *y1 = lcd->LROWS - 1; - else if(*y1 < 0) - *y1 = 0; + if (*y1 >= lcd->LROWS) + *y1 = lcd->LROWS - 1; + else if (*y1 < 0) + *y1 = 0; - if(*y2 >= lcd->LROWS) - *y2 = lcd->LROWS - 1; - else if(*y2 < 0) - *y2 = 0; + if (*y2 >= lcd->LROWS) + *y2 = lcd->LROWS - 1; + else if (*y2 < 0) + *y2 = 0; -/* - *x = (int)((*x)+0.5); - *y1 = (int)((*y1) + 0.5); - *y2 = (int)((*y2) + 0.5); -*/ + /* + *x = (int)((*x)+0.5); + *y1 = (int)((*y1) + 0.5); + *y2 = (int)((*y2) + 0.5); + */ } -void VLineFromBuffer(LCDText *lcd, unsigned char *dst, unsigned char *src, int _x, int _y1, int _y2) { - int x = _x; - int y1 = _y1; - int y2 = _y2; +void VLineFromBuffer(LCDText *lcd, unsigned char *dst, unsigned char *src, + int _x, int _y1, int _y2) { + int x = _x; + int y1 = _y1; + int y2 = _y2; - SaneCoords(lcd, &x, &y1, &y2); + SaneCoords(lcd, &x, &y1, &y2); - for(int i = y1; i < y2; i++) { - dst[i * lcd->LCOLS + x] = src[i * lcd->LCOLS + x]; - } + for (int i = y1; i < y2; i++) { + dst[i * lcd->LCOLS + x] = src[i * lcd->LCOLS + x]; + } } void LCDText::TransitionTentacle() { - int height1, height2; - double add1, add2; - double sinrate = tentacle_move_; - double multiplier = 0; - double multiadd = 1.0 / LCOLS; - double rate = (LCOLS - transition_tick_) / (double)LCOLS; - unsigned char layout[LCOLS * LROWS]; - - memset(DisplayFB, (int)' ', LCOLS * LROWS); - memset(layout, (int)' ', LCOLS * LROWS); - - // Hide last layout's special chars if new layout has special chars. - for(int l = LAYERS - 1; l>=0; l--) { - for(int n = 0; special_chars.size() > 0 && n < LROWS * LCOLS; n++) { - if(LayoutFB[l][n] >= CHAR0 && LayoutFB[l][n] < CHAR0 + CHARS) - LayoutFB[l][n] = ' '; - } + int height1, height2; + double add1, add2; + double sinrate = tentacle_move_; + double multiplier = 0; + double multiadd = 1.0 / LCOLS; + double rate = (LCOLS - transition_tick_) / (double)LCOLS; + unsigned char layout[LCOLS * LROWS]; + + memset(DisplayFB, (int)' ', LCOLS * LROWS); + memset(layout, (int)' ', LCOLS * LROWS); + + // Hide last layout's special chars if new layout has special chars. + for (int l = LAYERS - 1; l >= 0; l--) { + for (int n = 0; special_chars.size() > 0 && n < LROWS * LCOLS; n++) { + if (LayoutFB[l][n] >= CHAR0 && LayoutFB[l][n] < CHAR0 + CHARS) + LayoutFB[l][n] = ' '; } + } - for(int l = LAYERS - 1; l>=0; l--) { - for(int n = 0; n < LCOLS * LROWS; n++) { - if(LayoutFB[l][n] != ' ') - layout[n] = LayoutFB[l][n]; - if(TransitionFB[l][n] != ' ') - DisplayFB[n] = TransitionFB[l][n]; - } + for (int l = LAYERS - 1; l >= 0; l--) { + for (int n = 0; n < LCOLS * LROWS; n++) { + if (LayoutFB[l][n] != ' ') + layout[n] = LayoutFB[l][n]; + if (TransitionFB[l][n] != ' ') + DisplayFB[n] = TransitionFB[l][n]; } + } - for(int i = 0; i < LCOLS; i++) { + for (int i = 0; i < LCOLS; i++) { - add1 = (LROWS / 2) - ((LROWS / 2) * (rate * 1.5)); - add2 = (LROWS / 2) + ((LROWS / 2) * (rate * 1.5)); + add1 = (LROWS / 2) - ((LROWS / 2) * (rate * 1.5)); + add2 = (LROWS / 2) + ((LROWS / 2) * (rate * 1.5)); - height1 = (sin(sinrate) * ((LROWS / 8.0) * multiplier)) + add1; - height2 = (sin(sinrate) * ((LROWS / 8.0) * multiplier)) + add2; - multiplier+=multiadd; + height1 = (sin(sinrate) * ((LROWS / 8.0) * multiplier)) + add1; + height2 = (sin(sinrate) * ((LROWS / 8.0) * multiplier)) + add2; + multiplier += multiadd; - VLineFromBuffer(this, DisplayFB, layout, i, height1, height2); - sinrate+=0.2; - tentacle_move_+=0.01; - } + VLineFromBuffer(this, DisplayFB, layout, i, height1, height2); + sinrate += 0.2; + tentacle_move_ += 0.01; + } - for(int i = 0; i < visitor_->GetLCD()->LROWS; i++) - if(TextRealBlit) - TextRealBlit((LCDText *)visitor_->GetLCD(), i, 0, DisplayFB + i * LCOLS, LCOLS); + for (int i = 0; i < visitor_->GetLCD()->LROWS; i++) + if (TextRealBlit) + TextRealBlit((LCDText *)visitor_->GetLCD(), i, 0, DisplayFB + i * LCOLS, + LCOLS); - if( ++transition_tick_ >= (int)LCOLS ) { - transitioning_ = false; - transition_tick_ = 0; - //emit static_cast( - // visitor_->GetWrapper())->_TransitionFinished(); - memset(DisplayFB, (int)'*', LCOLS * LROWS); + if (++transition_tick_ >= (int)LCOLS) { + transitioning_ = false; + transition_tick_ = 0; + // emit static_cast( + // visitor_->GetWrapper())->_TransitionFinished(); + memset(DisplayFB, (int)'*', LCOLS * LROWS); - for(int l = 0; l < LAYERS; l++) { - memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS); - memset(TransitionFB[l], ' ', LCOLS * LROWS); - } - TextBlit(0, 0, LROWS, LCOLS); + for (int l = 0; l < LAYERS; l++) { + memcpy(LayoutFB[l], TransitionFB[l], LCOLS * LROWS); + memset(TransitionFB[l], ' ', LCOLS * LROWS); } + TextBlit(0, 0, LROWS, LCOLS); + } } -void LCDText::TransitionCheckerBoard() { - -} +void LCDText::TransitionCheckerBoard() {} diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDText.h b/libvisual-plugins/plugins/actor/lcdcontrol/LCDText.h index 76cd65734..026e63c2e 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDText.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDText.h @@ -42,62 +42,60 @@ class LCDCore; class LCDGraphic; -class LCDText: public LCDBase { - std::string transition_layout_; - public: - unsigned char **LayoutFB; - unsigned char **TransitionFB; - unsigned char *DisplayFB; - void (*TextRealBlit) (LCDText *obj, int row, int col, - unsigned char *data, int len); - void (*TextRealDefChar) (LCDText *obj, const int ascii, - SpecialChar matrix); - std::vector special_chars; - int GOTO_COST; - int CHARS; - int CHAR0; - int transition_tick_; - bool transitioning_; - double tentacle_move_; - LCDCore *visitor_; - LCDText(LCDCore *visitor); - virtual ~LCDText(); - void TextInit(int rows, int cols, int yres, - int xres, int _goto, int chars, int char0, - int layers); - void TextBlit(int row, int col, int height, - int width); - int ResizeLCD(int rows, int cols); - void CleanBuffer(unsigned char **buf); - void TextClear(); - void TextClearChars(); - bool TextAddChar(SpecialChar ch); - void TextGreet(); - void Transition(); - void TransitionLeftRight(); - void TransitionUpDown(); - void TransitionTentacle(); - void TransitionCheckerBoard(); - - bool IsTransitioning() { return transitioning_; } - void SignalTransitionStart(std::string layout) { - CleanBuffer(LayoutFB); - TextBlit(0, 0, LROWS, LCOLS); - transitioning_ = true; transition_layout_ = layout; - } - void SignalTransitionEnd() { } - std::string GetTransitionLayout() { return transition_layout_; } - - // Slots - void TextSetSpecialChars(); - void LayoutChangeBefore(); - void LayoutChangeAfter(); - void TextSpecialCharChanged(int ch); - void ChangeLayout() {} - void LayoutTransition() {} - void TransitionFinished() {} - void KeypadEvent(int k) {} - +class LCDText : public LCDBase { + std::string transition_layout_; + +public: + unsigned char **LayoutFB; + unsigned char **TransitionFB; + unsigned char *DisplayFB; + void (*TextRealBlit)(LCDText *obj, int row, int col, unsigned char *data, + int len); + void (*TextRealDefChar)(LCDText *obj, const int ascii, SpecialChar matrix); + std::vector special_chars; + int GOTO_COST; + int CHARS; + int CHAR0; + int transition_tick_; + bool transitioning_; + double tentacle_move_; + LCDCore *visitor_; + LCDText(LCDCore *visitor); + virtual ~LCDText(); + void TextInit(int rows, int cols, int yres, int xres, int _goto, int chars, + int char0, int layers); + void TextBlit(int row, int col, int height, int width); + int ResizeLCD(int rows, int cols); + void CleanBuffer(unsigned char **buf); + void TextClear(); + void TextClearChars(); + bool TextAddChar(SpecialChar ch); + void TextGreet(); + void Transition(); + void TransitionLeftRight(); + void TransitionUpDown(); + void TransitionTentacle(); + void TransitionCheckerBoard(); + + bool IsTransitioning() { return transitioning_; } + void SignalTransitionStart(std::string layout) { + CleanBuffer(LayoutFB); + TextBlit(0, 0, LROWS, LCOLS); + transitioning_ = true; + transition_layout_ = layout; + } + void SignalTransitionEnd() {} + std::string GetTransitionLayout() { return transition_layout_; } + + // Slots + void TextSetSpecialChars(); + void LayoutChangeBefore(); + void LayoutChangeAfter(); + void TextSpecialCharChanged(int ch); + void ChangeLayout() {} + void LayoutTransition() {} + void TransitionFinished() {} + void KeypadEvent(int k) {} }; void TextDraw(WidgetText *w); @@ -112,6 +110,6 @@ void TextBignumsDraw(WidgetBignums *w); void TextFPSDraw(WidgetFPS *w); -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDTimer.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/LCDTimer.cpp index 7333cee06..9c6e6f292 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDTimer.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDTimer.cpp @@ -3,107 +3,85 @@ using namespace LCD; -LCDTimer::LCDTimer(LCDEventFunc func, void *data, int duration, bool repeating) -{ - mDuration = duration; - mRepeating = repeating; - mStartTime = 0; - mActive = false; +LCDTimer::LCDTimer(LCDEventFunc func, void *data, int duration, + bool repeating) { + mDuration = duration; + mRepeating = repeating; + mStartTime = 0; + mActive = false; - mTimer = visual_timer_new(); + mTimer = visual_timer_new(); - mEvent = new LCDEvent(func, data); + mEvent = new LCDEvent(func, data); } -LCDTimer::~LCDTimer() -{ - delete mEvent; -} +LCDTimer::~LCDTimer() { delete mEvent; } -void LCDTimer::Start() -{ - if(mDuration <= .05) - return; - visual_timer_start(mTimer); - mActive = true; +void LCDTimer::Start() { + if (mDuration <= .05) + return; + visual_timer_start(mTimer); + mActive = true; } -void LCDTimer::Start(int duration) -{ - mDuration = duration; - Start(); +void LCDTimer::Start(int duration) { + mDuration = duration; + Start(); } -void LCDTimer::Start(int duration, void *data) -{ - mDuration = duration; - mEvent->mData = data; - Start(); +void LCDTimer::Start(int duration, void *data) { + mDuration = duration; + mEvent->mData = data; + Start(); } -void LCDTimer::Start(int duration, void *data, LCDEventFunc func) -{ - mEvent->mData = data; - mEvent->mFunc = func; - mDuration = duration; - Start(); +void LCDTimer::Start(int duration, void *data, LCDEventFunc func) { + mEvent->mData = data; + mEvent->mFunc = func; + mDuration = duration; + Start(); } -void LCDTimer::Stop() -{ - visual_timer_stop(mTimer); - mActive = false; +void LCDTimer::Stop() { + visual_timer_stop(mTimer); + mActive = false; } -void LCDTimer::Tick() -{ - if(mActive && visual_timer_elapsed_msecs(mTimer) > mDuration) - { - mEvent->Fire(); - if(mRepeating) - { - visual_timer_reset(mTimer); - visual_timer_start(mTimer); - } - else - { - visual_timer_stop(mTimer); - } +void LCDTimer::Tick() { + if (mActive && visual_timer_elapsed_msecs(mTimer) > mDuration) { + mEvent->Fire(); + if (mRepeating) { + visual_timer_reset(mTimer); + visual_timer_start(mTimer); + } else { + visual_timer_stop(mTimer); } + } } -LCDTimerBin::LCDTimerBin() : mTimers(0) -{ -} +LCDTimerBin::LCDTimerBin() : mTimers(0) {} -LCDTimerBin::~LCDTimerBin() -{ -} +LCDTimerBin::~LCDTimerBin() {} -LCDTimer *LCDTimerBin::AddTimer(LCDEventFunc func, void *data, int duration, bool repeating) -{ - LCDTimer *timer = new LCDTimer(func, data, duration, repeating); +LCDTimer *LCDTimerBin::AddTimer(LCDEventFunc func, void *data, int duration, + bool repeating) { + LCDTimer *timer = new LCDTimer(func, data, duration, repeating); - mTimers.push_back(timer); + mTimers.push_back(timer); - return timer; + return timer; } -void LCDTimerBin::Tick() -{ - unsigned int i; - for(i = 0; i < mTimers.size(); i++) - { - mTimers[i]->Tick(); - } +void LCDTimerBin::Tick() { + unsigned int i; + for (i = 0; i < mTimers.size(); i++) { + mTimers[i]->Tick(); + } } -void LCDTimerBin::Stop() -{ - unsigned int i; - for(i = 0; i < mTimers.size(); i++) - { - mTimers[i]->Stop(); - } +void LCDTimerBin::Stop() { + unsigned int i; + for (i = 0; i < mTimers.size(); i++) { + mTimers[i]->Stop(); + } } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/LCDTimer.h b/libvisual-plugins/plugins/actor/lcdcontrol/LCDTimer.h index 01cfb5f3a..6b40faa2f 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/LCDTimer.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/LCDTimer.h @@ -8,45 +8,43 @@ #include #include "LCDEvent.h" -namespace LCD -{ - -class LCDTimer -{ - private: - LCDEvent *mEvent; - - unsigned int mDuration; - int mStartTime; - bool mRepeating; - bool mActive; - std::string mName; - VisTimer *mTimer; - - public: - - LCDTimer(LCDEventFunc func, void *data, int duration, bool repeating); - ~LCDTimer(); - void Start(int duration, void *data, LCDEventFunc func); - void Start(int duration, void *data); - void Start(int duration); - void Start(); - void Stop(); - void Tick(); +namespace LCD { + +class LCDTimer { +private: + LCDEvent *mEvent; + + unsigned int mDuration; + int mStartTime; + bool mRepeating; + bool mActive; + std::string mName; + VisTimer *mTimer; + +public: + LCDTimer(LCDEventFunc func, void *data, int duration, bool repeating); + ~LCDTimer(); + void Start(int duration, void *data, LCDEventFunc func); + void Start(int duration, void *data); + void Start(int duration); + void Start(); + void Stop(); + void Tick(); }; class LCDTimerBin { - private: - std::vector mTimers; +private: + std::vector mTimers; - public: - LCDTimerBin(); - ~LCDTimerBin(); - LCDTimer *AddTimer(LCDEventFunc func, void *data, int duration, bool repeating); - void Tick(); +public: + LCDTimerBin(); + ~LCDTimerBin(); + LCDTimer *AddTimer(LCDEventFunc func, void *data, int duration, + bool repeating); + void Tick(); - void Stop(); + void Stop(); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginCpuinfo.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginCpuinfo.cpp index a904240a3..d11bb8c15 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginCpuinfo.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginCpuinfo.cpp @@ -38,111 +38,99 @@ static FILE *stream; static int ParseCpuinfo(void); static std::string Cpuinfo(std::string key); -static int ParseCpuinfo(void) -{ - int age; - - /* reread every second only */ - age = hash_age(&CPUinfo, NULL); - if (age > 0 && age <= 1000) - return 0; - - - if (stream == NULL) - stream = fopen("/proc/cpuinfo", "r"); - if (stream == NULL) { - LCDError("fopen(/proc/cpuinfo) failed: %s", strerror(errno)); - return -1; - } - rewind(stream); - while (!feof(stream)) { - char buffer[256]; - char *c, *key, *val; - fgets(buffer, sizeof(buffer), stream); - c = strchr(buffer, ':'); - if (c == NULL) - continue; - key = buffer; - val = c + 1; - /* strip leading blanks from key */ - while (isspace(*key)) - *key++ = '\0'; - /* strip trailing blanks from key */ - do - *c = '\0'; - while (isspace(*--c)); - /* strip leading blanks from value */ - while (isspace(*val)) - *val++ = '\0'; - /* strip trailing blanks from value */ - for (c = val; *c != '\0'; c++); - while (isspace(*--c)) - *c = '\0'; - - /* add entry to hash table */ - hash_put(&CPUinfo, key, val); - - } +static int ParseCpuinfo(void) { + int age; + + /* reread every second only */ + age = hash_age(&CPUinfo, NULL); + if (age > 0 && age <= 1000) return 0; + + if (stream == NULL) + stream = fopen("/proc/cpuinfo", "r"); + if (stream == NULL) { + LCDError("fopen(/proc/cpuinfo) failed: %s", strerror(errno)); + return -1; + } + rewind(stream); + while (!feof(stream)) { + char buffer[256]; + char *c, *key, *val; + fgets(buffer, sizeof(buffer), stream); + c = strchr(buffer, ':'); + if (c == NULL) + continue; + key = buffer; + val = c + 1; + /* strip leading blanks from key */ + while (isspace(*key)) + *key++ = '\0'; + /* strip trailing blanks from key */ + do + *c = '\0'; + while (isspace(*--c)); + /* strip leading blanks from value */ + while (isspace(*val)) + *val++ = '\0'; + /* strip trailing blanks from value */ + for (c = val; *c != '\0'; c++) + ; + while (isspace(*--c)) + *c = '\0'; + + /* add entry to hash table */ + hash_put(&CPUinfo, key, val); + } + return 0; } +static std::string Cpuinfo(std::string key) { + const char *val = ""; + if (ParseCpuinfo() < 0) { + return ""; + } -static std::string Cpuinfo(std::string key) -{ - const char *val = ""; - if (ParseCpuinfo() < 0) { - return ""; - } + val = hash_get(&CPUinfo, key.c_str(), NULL); + if (val == NULL) + val = ""; - val = hash_get(&CPUinfo, key.c_str(), NULL); - if (val == NULL) - val = ""; - - return val; + return val; } class cpuinfo_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "cpuinfo"; } - static const std::string name() { return "Cpuinfo"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - std::string str = Cpuinfo(key); - dynamic_cast(*out[0]).value() = str; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "cpuinfo"; } + static const std::string name() { return "Cpuinfo"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + std::string str = Cpuinfo(key); + dynamic_cast(*out[0]).value() = str; + } }; -PluginCpuinfo::PluginCpuinfo(lua *script) -{ - script->register_function(); - hash_create(&CPUinfo); - stream = NULL; +PluginCpuinfo::PluginCpuinfo(lua *script) { + script->register_function(); + hash_create(&CPUinfo); + stream = NULL; } -PluginCpuinfo::~PluginCpuinfo() -{ - if (stream != NULL) { - fclose(stream); - stream = NULL; - } - hash_destroy(&CPUinfo); +PluginCpuinfo::~PluginCpuinfo() { + if (stream != NULL) { + fclose(stream); + stream = NULL; + } + hash_destroy(&CPUinfo); } - - - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginCpuinfo.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginCpuinfo.h index 721721a87..7381d15ec 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginCpuinfo.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginCpuinfo.h @@ -31,15 +31,13 @@ namespace LCD { class PluginCpuinfo { - private: - - public: - PluginCpuinfo(lua *script); - ~PluginCpuinfo(); - std::string Cpuinfo(std::string str); +private: +public: + PluginCpuinfo(lua *script); + ~PluginCpuinfo(); + std::string Cpuinfo(std::string str); }; - -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginDiskstats.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginDiskstats.cpp index fcccd4500..1bafed15b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginDiskstats.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginDiskstats.cpp @@ -37,140 +37,129 @@ using namespace LCD; PluginDiskstats *mDiskstats; -int PluginDiskstats::ParseDiskstats() -{ - int age; - - /* reread every 10 msec only */ - age = hash_age(&DISKSTATS, NULL); - if (age > 0 && age <= 10) - return 0; - - if (stream == NULL) - stream = fopen("/proc/diskstats", "r"); - if (stream == NULL) { - LCDError("fopen(/proc/diskstats) failed: %s", strerror(errno)); - return -1; - } - - rewind(stream); - - while (!feof(stream)) { - char buffer[1024]; - char dev[1024]; - char *beg, *end; - unsigned int num, len; - - if (fgets(buffer, sizeof(buffer), stream) == NULL) - break; - - /* fetch device name (3rd column) as key */ - num = 0; - beg = buffer; - end = beg; - while (strlen(beg) > 0 && *beg) { - while (*beg == ' ' && strlen(beg) > 0) - beg++; - end = beg + 1; - while (strlen(end) > 0 && *end && *end != ' ') - end++; - if (num++ == 2) - break; - beg = *end && strlen(end) > 0 ? end + 1 : NULL; - } - len = end ? (unsigned) (end - beg) : strlen(beg); - - if (len > sizeof(dev)) - len = sizeof(dev); - strncpy(dev, beg, len); - dev[len] = '\0'; - - hash_put_delta(&DISKSTATS, dev, buffer); +int PluginDiskstats::ParseDiskstats() { + int age; - } + /* reread every 10 msec only */ + age = hash_age(&DISKSTATS, NULL); + if (age > 0 && age <= 10) return 0; -} - - -double PluginDiskstats::Diskstats(std::string arg1, std::string arg2, int arg3) -{ - char dev[256], key[256]; - int delay; - double value = 0; - strncpy(dev, arg1.c_str(), sizeof(dev)); - strncpy(key, arg2.c_str(), sizeof(key)); - delay = arg3; - - if (ParseDiskstats() < 0) { - LCDError("Unable to parse disk stats."); - return 0.0; + if (stream == NULL) + stream = fopen("/proc/diskstats", "r"); + if (stream == NULL) { + LCDError("fopen(/proc/diskstats) failed: %s", strerror(errno)); + return -1; + } + + rewind(stream); + + while (!feof(stream)) { + char buffer[1024]; + char dev[1024]; + char *beg, *end; + unsigned int num, len; + + if (fgets(buffer, sizeof(buffer), stream) == NULL) + break; + + /* fetch device name (3rd column) as key */ + num = 0; + beg = buffer; + end = beg; + while (strlen(beg) > 0 && *beg) { + while (*beg == ' ' && strlen(beg) > 0) + beg++; + end = beg + 1; + while (strlen(end) > 0 && *end && *end != ' ') + end++; + if (num++ == 2) + break; + beg = *end && strlen(end) > 0 ? end + 1 : NULL; } + len = end ? (unsigned)(end - beg) : strlen(beg); - value = hash_get_delta(&DISKSTATS, dev, key, delay); + if (len > sizeof(dev)) + len = sizeof(dev); + strncpy(dev, beg, len); + dev[len] = '\0'; - return value; + hash_put_delta(&DISKSTATS, dev, buffer); + } + return 0; } +double PluginDiskstats::Diskstats(std::string arg1, std::string arg2, + int arg3) { + char dev[256], key[256]; + int delay; + double value = 0; -class diskstats_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::string_arg_t()); - args->add(new lua::int_arg_t()); - return args; - } + strncpy(dev, arg1.c_str(), sizeof(dev)); + strncpy(key, arg2.c_str(), sizeof(key)); + delay = arg3; - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } + if (ParseDiskstats() < 0) { + LCDError("Unable to parse disk stats."); + return 0.0; + } - static const std::string ns() { return "diskstats"; } - static const std::string name() { return "Disstats"; } + value = hash_get_delta(&DISKSTATS, dev, key, delay); - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string arg1 = dynamic_cast(*in[0]).value(); - std::string arg2 = dynamic_cast(*in[0]).value(); - int arg3 = dynamic_cast(*in[0]).value(); - double value = mDiskstats->Diskstats(arg1, arg2, arg3); - dynamic_cast(*out[0]).value() = value; - } + return value; +} + +class diskstats_t { +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::string_arg_t()); + args->add(new lua::int_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "diskstats"; } + static const std::string name() { return "Disstats"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string arg1 = dynamic_cast(*in[0]).value(); + std::string arg2 = dynamic_cast(*in[0]).value(); + int arg3 = dynamic_cast(*in[0]).value(); + double value = mDiskstats->Diskstats(arg1, arg2, arg3); + dynamic_cast(*out[0]).value() = value; + } }; -PluginDiskstats::PluginDiskstats(lua *script) -{ - int i; - const char *header[] = { "major", "minor", "name", - "reads", "read_merges", "read_sectors", "read_ticks", - "writes", "write_merges", "write_sectors", "write_ticks", - "in_flight", "io_ticks", "time_in_queue", NULL - }; - - hash_create(&DISKSTATS); - hash_set_delimiter(&DISKSTATS, " \n"); - for (i = 0; header[i]; i++) { - hash_set_column(&DISKSTATS, i, header[i]); - } +PluginDiskstats::PluginDiskstats(lua *script) { + int i; + const char *header[] = {"major", "minor", "name", + "reads", "read_merges", "read_sectors", + "read_ticks", "writes", "write_merges", + "write_sectors", "write_ticks", "in_flight", + "io_ticks", "time_in_queue", NULL}; - stream = NULL; + hash_create(&DISKSTATS); + hash_set_delimiter(&DISKSTATS, " \n"); + for (i = 0; header[i]; i++) { + hash_set_column(&DISKSTATS, i, header[i]); + } - script->register_function(); -} + stream = NULL; -PluginDiskstats::~PluginDiskstats() -{ - if (stream != NULL) { - fclose(stream); - stream = NULL; - } - hash_destroy(&DISKSTATS); + script->register_function(); } - +PluginDiskstats::~PluginDiskstats() { + if (stream != NULL) { + fclose(stream); + stream = NULL; + } + hash_destroy(&DISKSTATS); +} diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginDiskstats.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginDiskstats.h index bf9aaed90..c057d1a49 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginDiskstats.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginDiskstats.h @@ -32,17 +32,17 @@ namespace LCD { class PluginDiskstats { - HASH DISKSTATS; - FILE *stream; - int ParseDiskstats(); + HASH DISKSTATS; + FILE *stream; + int ParseDiskstats(); - public: - PluginDiskstats(lua *script); - ~PluginDiskstats(); +public: + PluginDiskstats(lua *script); + ~PluginDiskstats(); - double Diskstats(std::string arg1, std::string arg2, int arg3); + double Diskstats(std::string arg1, std::string arg2, int arg3); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginFPS.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginFPS.cpp index dc0ff55ad..55188d144 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginFPS.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginFPS.cpp @@ -31,65 +31,53 @@ using namespace LCD; class statavg_t { - - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - return args; - } - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "fps"; } + static const std::string name() { return "avg"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + static std::vector hist; + static double then = now_ms(); - static const std::string ns() { return "fps"; } - static const std::string name() { return "avg"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - static std::vector hist; - static double then = now_ms(); - - double now = now_ms(); - double diff = now - then; - then = now; - - hist.push_back(diff); - - double avg = 0.0; - for(unsigned int i = 0; i < hist.size(); i++) - { - avg+=hist[i]; - } - avg = avg / hist.size(); - - double val = avg; - - visual_log(VISUAL_LOG_INFO, "AVERAGE FPS %f", val); - dynamic_cast(*out[0]).value() = val; - - if(hist.size() > 20) - { - std::vector tmp; - for(unsigned int i = 1; i < hist.size(); i++) - { - tmp.push_back(hist[i]); - } - hist = tmp; - } + double now = now_ms(); + double diff = now - then; + then = now; + + hist.push_back(diff); + + double avg = 0.0; + for (unsigned int i = 0; i < hist.size(); i++) { + avg += hist[i]; } -}; + avg = avg / hist.size(); -PluginFPS::PluginFPS(lua *script) { - script->register_function(); -} + double val = avg; + visual_log(VISUAL_LOG_INFO, "AVERAGE FPS %f", val); + dynamic_cast(*out[0]).value() = val; -PluginFPS::~PluginFPS() { -} + if (hist.size() > 20) { + std::vector tmp; + for (unsigned int i = 1; i < hist.size(); i++) { + tmp.push_back(hist[i]); + } + hist = tmp; + } + } +}; +PluginFPS::PluginFPS(lua *script) { script->register_function(); } +PluginFPS::~PluginFPS() {} diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginFPS.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginFPS.h index 03ade8a83..bba0e587f 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginFPS.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginFPS.h @@ -26,15 +26,14 @@ #include "luascript.h" - namespace LCD { class PluginFPS { - public: - PluginFPS(lua *script); - ~PluginFPS(); +public: + PluginFPS(lua *script); + ~PluginFPS(); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginFifo.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginFifo.cpp index 35a6c5146..0632c7328 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginFifo.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginFifo.cpp @@ -41,184 +41,163 @@ using namespace LCD; PluginFifo *mFifo; -void PluginFifo::ConfigureFifo(void) -{ -/* - memset(fifopath, 0, 1024); - std::string path = "lcdcontrol.fifo"; - Json::Value *s = visitor_->CFG_Fetch_Raw(visitor_->CFG_Get_Root(), path); - if (!s) { - LCDInfo("[FIFO] empty '%s.fifopath' entry from %s, assuming '/tmp/lcdcontrol.fifo'", - path.c_str(), visitor_->CFG_Source().c_str()); - strcpy(fifopath, "/etc/lcdcontrol.fifo"); - return; - } else { - strcpy(fifopath, s->asCString()); - LCDInfo("[FIFO] read '%s.fifopath', value is '%s'", - path.c_str(), fifopath); - } - delete s; -*/ +void PluginFifo::ConfigureFifo(void) { + /* + memset(fifopath, 0, 1024); + std::string path = "lcdcontrol.fifo"; + Json::Value *s = visitor_->CFG_Fetch_Raw(visitor_->CFG_Get_Root(), path); + if (!s) { + LCDInfo("[FIFO] empty '%s.fifopath' entry from %s, assuming + '/tmp/lcdcontrol.fifo'", path.c_str(), visitor_->CFG_Source().c_str()); + strcpy(fifopath, "/etc/lcdcontrol.fifo"); + return; + } else { + strcpy(fifopath, s->asCString()); + LCDInfo("[FIFO] read '%s.fifopath', value is '%s'", + path.c_str(), fifopath); + } + delete s; + */ } - -void PluginFifo::RemoveFifo(void) -{ - LCDDebug("Removing FIFO \"%s\"\n", fd.path); - if (unlink(fd.path) < 0) { - LCDError("Could not remove FIFO \"%s\": %s\n", fd.path, strerror(errno)); - return; - } - fd.created = 0; +void PluginFifo::RemoveFifo(void) { + LCDDebug("Removing FIFO \"%s\"\n", fd.path); + if (unlink(fd.path) < 0) { + LCDError("Could not remove FIFO \"%s\": %s\n", fd.path, strerror(errno)); + return; + } + fd.created = 0; } - -void PluginFifo::CloseFifo(void) -{ - struct stat st; - if (fd.input >= 0) { - close(fd.input); - fd.input = -1; - } - if (fd.created && (stat(fd.path, &st) == 0)) - RemoveFifo(); +void PluginFifo::CloseFifo(void) { + struct stat st; + if (fd.input >= 0) { + close(fd.input); + fd.input = -1; + } + if (fd.created && (stat(fd.path, &st) == 0)) + RemoveFifo(); } -int PluginFifo::MakeFifo(void) -{ - if (mkfifo(fd.path, 0666) < 0) { - LCDError("Couldn't create FIFO \"%s\": %s\n", fd.path, strerror(errno)); - return -1; - } - fd.created = 1; - return 0; +int PluginFifo::MakeFifo(void) { + if (mkfifo(fd.path, 0666) < 0) { + LCDError("Couldn't create FIFO \"%s\": %s\n", fd.path, strerror(errno)); + return -1; + } + fd.created = 1; + return 0; } +int PluginFifo::CheckFifo(void) { + struct stat st; + if (stat(fd.path, &st) < 0) { + if (errno == ENOENT) { -int PluginFifo::CheckFifo(void) -{ - struct stat st; - if (stat(fd.path, &st) < 0) { - if (errno == ENOENT) { - - /* Path doesn't exist */ - return MakeFifo(); - } - LCDError("Failed to stat FIFO \"%s\": %s\n", fd.path, strerror(errno)); - return -1; + /* Path doesn't exist */ + return MakeFifo(); } - if (!S_ISFIFO(st.st_mode)) { - LCDError("\"%s\" already exists, but is not a FIFO\n", fd.path); - return -1; - } - return 0; + LCDError("Failed to stat FIFO \"%s\": %s\n", fd.path, strerror(errno)); + return -1; + } + if (!S_ISFIFO(st.st_mode)) { + LCDError("\"%s\" already exists, but is not a FIFO\n", fd.path); + return -1; + } + return 0; } - -int PluginFifo::OpenFifo(void) -{ - if (CheckFifo() < 0) - return -1; - fd.input = open(fd.path, O_RDONLY | O_NONBLOCK); - if (fd.input < 0) { - LCDError("Could not open FIFO \"%s\" for reading: %s\n", fd.path, strerror(errno)); - CloseFifo(); - return -1; - } - return 0; +int PluginFifo::OpenFifo(void) { + if (CheckFifo() < 0) + return -1; + fd.input = open(fd.path, O_RDONLY | O_NONBLOCK); + if (fd.input < 0) { + LCDError("Could not open FIFO \"%s\" for reading: %s\n", fd.path, + strerror(errno)); + CloseFifo(); + return -1; + } + return 0; } +void PluginFifo::StartFifo(void) { + static int started = 0; -void PluginFifo::StartFifo(void) -{ - static int started = 0; - - if (started) - return; + if (started) + return; - started = 1; + started = 1; - ConfigureFifo(); - fd.path = fifopath; - fd.input = -1; - fd.created = 0; - OpenFifo(); - - /* ignore broken pipe */ - signal(SIGPIPE, SIG_IGN); + ConfigureFifo(); + fd.path = fifopath; + fd.input = -1; + fd.created = 0; + OpenFifo(); - memset(msg, 0, FIFO_BUFFER_SIZE); + /* ignore broken pipe */ + signal(SIGPIPE, SIG_IGN); + memset(msg, 0, FIFO_BUFFER_SIZE); } +std::string PluginFifo::Fiforead() { + char buf[FIFO_BUFFER_SIZE]; + unsigned int i; + int bytes = 1; -std::string PluginFifo::Fiforead() -{ - char buf[FIFO_BUFFER_SIZE]; - unsigned int i; - int bytes = 1; + StartFifo(); - StartFifo(); + memset(buf, 0, FIFO_BUFFER_SIZE); + strcat(buf, "ERROR"); + if (CheckFifo() == 0) { memset(buf, 0, FIFO_BUFFER_SIZE); - strcat(buf, "ERROR"); - - if (CheckFifo() == 0) { - memset(buf, 0, FIFO_BUFFER_SIZE); - - while (bytes > 0 && errno != EINTR) { - bytes = read(fd.input, buf, FIFO_BUFFER_SIZE); - } - - if (bytes < 0 || (errno > 0 && errno != EAGAIN)) { - LCDError("[FIFO] Error %i: %s", errno, strerror(errno)); - } else { - if (strlen(buf) > 0) { - strcpy(msg, buf); - } - for (i = 0; i < strlen(buf); i++) { - if (msg[i] < 0x20) - msg[i] = ' '; - } - } - } - return msg; -} -class fifo_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - return args; + while (bytes > 0 && errno != EINTR) { + bytes = read(fd.input, buf, FIFO_BUFFER_SIZE); } - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; + if (bytes < 0 || (errno > 0 && errno != EAGAIN)) { + LCDError("[FIFO] Error %i: %s", errno, strerror(errno)); + } else { + if (strlen(buf) > 0) { + strcpy(msg, buf); + } + for (i = 0; i < strlen(buf); i++) { + if (msg[i] < 0x20) + msg[i] = ' '; + } } + } + return msg; +} - static const std::string ns() { return "fifo"; } - static const std::string name() { return "Read"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string fmt = dynamic_cast(*in[0]).value(); - std::string str = mFifo->Fiforead(); - dynamic_cast(*out[0]).value() = str; - } +class fifo_t { +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "fifo"; } + static const std::string name() { return "Read"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string fmt = dynamic_cast(*in[0]).value(); + std::string str = mFifo->Fiforead(); + dynamic_cast(*out[0]).value() = str; + } }; PluginFifo::PluginFifo(lua *script) { - fd.path = NULL; - fd.input = -1; - fd.created = 0; - -} - -PluginFifo::~PluginFifo() { - CloseFifo(); + fd.path = NULL; + fd.input = -1; + fd.created = 0; } +PluginFifo::~PluginFifo() { CloseFifo(); } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginFifo.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginFifo.h index 2976047b4..821f3f8b1 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginFifo.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginFifo.h @@ -33,35 +33,34 @@ namespace LCD { -class PluginFifo{ +class PluginFifo { - typedef struct _FifoData { - char *path; - int input; - int created; - } FifoData; - - FifoData fd; - char msg[FIFO_BUFFER_SIZE]; - char fifopath[1024]; + typedef struct _FifoData { + char *path; + int input; + int created; + } FifoData; - void ConfigureFifo(); - void RemoveFifo(); - void CloseFifo(); - int MakeFifo(); - int CheckFifo(); - int OpenFifo(); - void StartFifo(); + FifoData fd; + char msg[FIFO_BUFFER_SIZE]; + char fifopath[1024]; - public: - PluginFifo(lua *script); - ~PluginFifo(); + void ConfigureFifo(); + void RemoveFifo(); + void CloseFifo(); + int MakeFifo(); + int CheckFifo(); + int OpenFifo(); + void StartFifo(); - std::string Fiforead(); - int Test(char *foo); +public: + PluginFifo(lua *script); + ~PluginFifo(); + std::string Fiforead(); + int Test(char *foo); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginLoadavg.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginLoadavg.cpp index 35b4758a4..a8efa3fe3 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginLoadavg.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginLoadavg.cpp @@ -38,108 +38,102 @@ using namespace LCD; int fd; -int GetLoadavg(double loadavg[], int nelem) -{ - char buf[65], *p; - ssize_t nread; - int i; - - if (fd == -2) - fd = open("/proc/loadavg", O_RDONLY); - if (fd < 0) - return -1; - - lseek(fd, 0, SEEK_SET); - nread = read(fd, buf, sizeof buf - 1); - - if (nread < 0) - return -1; - buf[nread - 1] = '\0'; - - if (nelem > 3) - nelem = 3; - p = buf; - for (i = 0; i < nelem; ++i) { - char *endp; - loadavg[i] = strtod(p, &endp); - if (endp == NULL || endp == p) - /* This should not happen. The format of /proc/loadavg - must have changed. Don't return with what we have, - signal an Error. */ - return -1; - p = endp; - } - - return i; +int GetLoadavg(double loadavg[], int nelem) { + char buf[65], *p; + ssize_t nread; + int i; + + if (fd == -2) + fd = open("/proc/loadavg", O_RDONLY); + if (fd < 0) + return -1; + + lseek(fd, 0, SEEK_SET); + nread = read(fd, buf, sizeof buf - 1); + + if (nread < 0) + return -1; + buf[nread - 1] = '\0'; + + if (nelem > 3) + nelem = 3; + p = buf; + for (i = 0; i < nelem; ++i) { + char *endp; + loadavg[i] = strtod(p, &endp); + if (endp == NULL || endp == p) + /* This should not happen. The format of /proc/loadavg + must have changed. Don't return with what we have, + signal an Error. */ + return -1; + p = endp; + } + + return i; } +double Loadavg(int arg1) { + static int nelem = -1; + int index, age; + static double loadavg[3]; + static struct timeval last_value; + struct timeval now; -double Loadavg(int arg1) -{ - static int nelem = -1; - int index, age; - static double loadavg[3]; - static struct timeval last_value; - struct timeval now; - - gettimeofday(&now, NULL); + gettimeofday(&now, NULL); - age = (now.tv_sec - last_value.tv_sec) * 1000 + (now.tv_usec - last_value.tv_usec) / 1000; - /* reread every 10 msec only */ - if (nelem == -1 || age == 0 || age > 10) { + age = (now.tv_sec - last_value.tv_sec) * 1000 + + (now.tv_usec - last_value.tv_usec) / 1000; + /* reread every 10 msec only */ + if (nelem == -1 || age == 0 || age > 10) { - nelem = GetLoadavg(loadavg, 3); - if (nelem < 0) { - LCDError("getloadavg() failed!"); - return 0.0; - } - last_value = now; + nelem = GetLoadavg(loadavg, 3); + if (nelem < 0) { + LCDError("getloadavg() failed!"); + return 0.0; } + last_value = now; + } - index = arg1; - if (index < 1 || index > nelem) { - LCDError("loadavg(%d): index out of range!", index); - return 0.0; - } + index = arg1; + if (index < 1 || index > nelem) { + LCDError("loadavg(%d): index out of range!", index); + return 0.0; + } - return loadavg[index - 1]; + return loadavg[index - 1]; } class loadavg_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } - - static const std::string ns() { return "loadavg"; } - static const std::string name() { return "Loadavg"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - int key = dynamic_cast(*in[0]).value(); - double val = Loadavg(key); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "loadavg"; } + static const std::string name() { return "Loadavg"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + int key = dynamic_cast(*in[0]).value(); + double val = Loadavg(key); + dynamic_cast(*out[0]).value() = val; + } }; PluginLoadavg::PluginLoadavg(lua *script) { - script->register_function(); - fd = -2; + script->register_function(); + fd = -2; } - PluginLoadavg::~PluginLoadavg() { - if (fd > 0) - close(fd); - fd = -2; + if (fd > 0) + close(fd); + fd = -2; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginLoadavg.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginLoadavg.h index 5e913eb60..7b54a7a75 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginLoadavg.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginLoadavg.h @@ -29,16 +29,16 @@ namespace LCD { class PluginLoadavg { - int fd; - int GetLoadavg(double loadavg[], int nelem); + int fd; + int GetLoadavg(double loadavg[], int nelem); - public: - PluginLoadavg(lua *script); - ~PluginLoadavg(); +public: + PluginLoadavg(lua *script); + ~PluginLoadavg(); - double Loadavg(int arg1); + double Loadavg(int arg1); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginMeminfo.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginMeminfo.cpp index 0b3a5ec53..1e1c2a96b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginMeminfo.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginMeminfo.cpp @@ -36,118 +36,108 @@ using namespace LCD; PluginMeminfo *plugmeminfo; -int PluginMeminfo::ParseMeminfo() -{ - int age; - - /* reread every 10 msec only */ - age = hash_age(&MemInfo, NULL); - if (age > 0 && age <= 10) - return 0; - - if (stream == NULL) - stream = fopen("/proc/meminfo", "r"); - if (stream == NULL) { - LCDError("fopen(/proc/meminfo) failed: %s", strerror(errno)); - return -1; - } +int PluginMeminfo::ParseMeminfo() { + int age; - rewind(stream); - while (!feof(stream)) { - char buffer[256]; - char *c, *key, *val; - fgets(buffer, sizeof(buffer), stream); - c = strchr(buffer, ':'); - if (c == NULL) - continue; - key = buffer; - val = c + 1; - /* strip leading blanks from key */ - while (isspace(*key)) - *key++ = '\0'; - /* strip trailing blanks from key */ - do - *c = '\0'; - while (isspace(*--c)); - /* strip leading blanks from value */ - while (isspace(*val)) - *val++ = '\0'; - /* strip trailing blanks from value */ - for (c = val; *c != '\0'; c++); - while (isspace(*--c)) - *c = '\0'; - /* skip lines that do not end with " kB" */ - if (*c == 'B' && *(c - 1) == 'k' && *(c - 2) == ' ') { - /* strip trailing " kB" from value */ - *(c - 2) = '\0'; - /* add entry to hash table */ - hash_put(&MemInfo, key, val); - } - } + /* reread every 10 msec only */ + age = hash_age(&MemInfo, NULL); + if (age > 0 && age <= 10) return 0; + + if (stream == NULL) + stream = fopen("/proc/meminfo", "r"); + if (stream == NULL) { + LCDError("fopen(/proc/meminfo) failed: %s", strerror(errno)); + return -1; + } + + rewind(stream); + while (!feof(stream)) { + char buffer[256]; + char *c, *key, *val; + fgets(buffer, sizeof(buffer), stream); + c = strchr(buffer, ':'); + if (c == NULL) + continue; + key = buffer; + val = c + 1; + /* strip leading blanks from key */ + while (isspace(*key)) + *key++ = '\0'; + /* strip trailing blanks from key */ + do + *c = '\0'; + while (isspace(*--c)); + /* strip leading blanks from value */ + while (isspace(*val)) + *val++ = '\0'; + /* strip trailing blanks from value */ + for (c = val; *c != '\0'; c++) + ; + while (isspace(*--c)) + *c = '\0'; + /* skip lines that do not end with " kB" */ + if (*c == 'B' && *(c - 1) == 'k' && *(c - 2) == ' ') { + /* strip trailing " kB" from value */ + *(c - 2) = '\0'; + /* add entry to hash table */ + hash_put(&MemInfo, key, val); + } + } + return 0; } -std::string PluginMeminfo::Meminfo(std::string arg1) -{ - std::string key; - const char * val; +std::string PluginMeminfo::Meminfo(std::string arg1) { + std::string key; + const char *val; - if (ParseMeminfo() < 0) { - return ""; - } + if (ParseMeminfo() < 0) { + return ""; + } - key = arg1; - val = hash_get(&MemInfo, key.c_str(), NULL); - if (val == NULL) - val = ""; + key = arg1; + val = hash_get(&MemInfo, key.c_str(), NULL); + if (val == NULL) + val = ""; - return val; + return val; } class meminfo_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "meminfo"; } - static const std::string name() { return "Meminfo"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - std::string str = plugmeminfo->Meminfo(key); - dynamic_cast(*out[0]).value() = str; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "meminfo"; } + static const std::string name() { return "Meminfo"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + std::string str = plugmeminfo->Meminfo(key); + dynamic_cast(*out[0]).value() = str; + } }; - -PluginMeminfo::PluginMeminfo(lua *script) -{ - plugmeminfo = this; - stream = NULL; - hash_create(&MemInfo); - script->register_function(); +PluginMeminfo::PluginMeminfo(lua *script) { + plugmeminfo = this; + stream = NULL; + hash_create(&MemInfo); + script->register_function(); } - -PluginMeminfo::~PluginMeminfo(void) -{ - if (stream != NULL) { - fclose(stream); - stream = NULL; - } - hash_destroy(&MemInfo); +PluginMeminfo::~PluginMeminfo(void) { + if (stream != NULL) { + fclose(stream); + stream = NULL; + } + hash_destroy(&MemInfo); } - - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginMeminfo.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginMeminfo.h index 132324cd6..c0dc894d4 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginMeminfo.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginMeminfo.h @@ -33,18 +33,17 @@ namespace LCD { class PluginMeminfo { - HASH MemInfo; - FILE *stream; - int ParseMeminfo(); + HASH MemInfo; + FILE *stream; + int ParseMeminfo(); - public: - PluginMeminfo(lua *script); - ~PluginMeminfo(); +public: + PluginMeminfo(lua *script); + ~PluginMeminfo(); - std::string Meminfo(std::string arg1); - + std::string Meminfo(std::string arg1); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetDev.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetDev.cpp index 82b1f859a..e9d116b0b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetDev.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetDev.cpp @@ -35,211 +35,197 @@ using namespace LCD; - PluginNetDev *plugnetdev; -int PluginNetDev::ParseNetDev() -{ - const char* DELIMITER = " :|\t\n"; - int age; - int row, col; - - /* reread every 10 msec only */ - age = hash_age(&NetDev, NULL); - if (age > 0 && age <= 10) - return 0; - if (Stream == NULL) - Stream = fopen("/proc/net/dev", "r"); - if (Stream == NULL) { - LCDError("fopen(/proc/net/dev) failed: %s", strerror(errno)); - return -1; - } +int PluginNetDev::ParseNetDev() { + const char *DELIMITER = " :|\t\n"; + int age; + int row, col; - rewind(Stream); - row = 0; - - while (!feof(Stream)) { - char buffer[256]; - char dev[16]; - char *beg, *end; - unsigned int len; - - beg = NULL; - end = NULL; - - if (fgets(buffer, sizeof(buffer), Stream) == NULL) - break; - - switch (++row) { - - case 1: - /* skip row 1 */ - continue; - - case 2: - /* row 2 used for headers */ - if (first_time || false) { - char *RxTx = strrchr(buffer, '|'); - first_time = 0; - col = 0; - beg = buffer; - while (beg && strlen(beg) > 0) { - char key[32]; - while (strlen(beg) > 0 && strchr(DELIMITER, *beg)) - beg++; - if (strlen(beg) == 0 || (end = strpbrk(beg, DELIMITER)) != NULL) - *end = '\0'; - if(strlen(beg) > 0) { - qprintf(key, sizeof(key), "%s_%s", beg < RxTx ? "Rx" : "Tx", beg); - hash_set_column(&NetDev, col++, key); - } - beg = end ? end + 1 : NULL; - } - } - continue; - - default: - /* fetch interface name (1st column) as key */ - beg = buffer; - while (strlen(beg) > 0 && *beg && *beg == ' ') - beg++; - if(strlen(beg) > 0) { - end = beg + 1; - while (strlen(end) > 0 && *end && *end != ':') - end++; - len = end - beg; - if (len >= sizeof(dev)) - len = sizeof(dev) - 1; - if(strlen(beg) >= len) { - strncpy(dev, beg, len); - dev[len] = '\0'; - - hash_put_delta(&NetDev, dev, buffer); - } - } - continue; + /* reread every 10 msec only */ + age = hash_age(&NetDev, NULL); + if (age > 0 && age <= 10) + return 0; + if (Stream == NULL) + Stream = fopen("/proc/net/dev", "r"); + if (Stream == NULL) { + LCDError("fopen(/proc/net/dev) failed: %s", strerror(errno)); + return -1; + } + + rewind(Stream); + row = 0; + + while (!feof(Stream)) { + char buffer[256]; + char dev[16]; + char *beg, *end; + unsigned int len; + + beg = NULL; + end = NULL; + + if (fgets(buffer, sizeof(buffer), Stream) == NULL) + break; + + switch (++row) { + + case 1: + /* skip row 1 */ + continue; + + case 2: + /* row 2 used for headers */ + if (first_time || false) { + char *RxTx = strrchr(buffer, '|'); + first_time = 0; + col = 0; + beg = buffer; + while (beg && strlen(beg) > 0) { + char key[32]; + while (strlen(beg) > 0 && strchr(DELIMITER, *beg)) + beg++; + if (strlen(beg) == 0 || (end = strpbrk(beg, DELIMITER)) != NULL) + *end = '\0'; + if (strlen(beg) > 0) { + qprintf(key, sizeof(key), "%s_%s", beg < RxTx ? "Rx" : "Tx", beg); + hash_set_column(&NetDev, col++, key); + } + beg = end ? end + 1 : NULL; } + } + continue; + + default: + /* fetch interface name (1st column) as key */ + beg = buffer; + while (strlen(beg) > 0 && *beg && *beg == ' ') + beg++; + if (strlen(beg) > 0) { + end = beg + 1; + while (strlen(end) > 0 && *end && *end != ':') + end++; + len = end - beg; + if (len >= sizeof(dev)) + len = sizeof(dev) - 1; + if (strlen(beg) >= len) { + strncpy(dev, beg, len); + dev[len] = '\0'; + + hash_put_delta(&NetDev, dev, buffer); + } + } + continue; } + } - return 0; + return 0; } -double PluginNetDev::Regex(std::string arg1, std::string arg2, double arg3) -{ - std::string dev, key; - int delay; - double value; +double PluginNetDev::Regex(std::string arg1, std::string arg2, double arg3) { + std::string dev, key; + int delay; + double value; - if (ParseNetDev() < 0) { - return -1; - } + if (ParseNetDev() < 0) { + return -1; + } - dev = arg1; - key = arg2; - delay = arg3; + dev = arg1; + key = arg2; + delay = arg3; - value = hash_get_regex(&NetDev, dev.c_str(), key.c_str(), delay); + value = hash_get_regex(&NetDev, dev.c_str(), key.c_str(), delay); - return value; + return value; } class netdev_Regex_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::string_arg_t()); - args->add(new lua::int_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "netdev"; } - static const std::string name() { return "Regex"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string dev = dynamic_cast(*in[0]).value(); - std::string key = dynamic_cast(*in[1]).value(); - double delay = dynamic_cast(*in[2]).value(); - double val = plugnetdev->Regex(dev, key, delay); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::string_arg_t()); + args->add(new lua::int_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "netdev"; } + static const std::string name() { return "Regex"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string dev = dynamic_cast(*in[0]).value(); + std::string key = dynamic_cast(*in[1]).value(); + double delay = dynamic_cast(*in[2]).value(); + double val = plugnetdev->Regex(dev, key, delay); + dynamic_cast(*out[0]).value() = val; + } }; -double PluginNetDev::Fast(std::string arg1, std::string arg2, double arg3) -{ - std::string dev, key; - int delay; - double value; +double PluginNetDev::Fast(std::string arg1, std::string arg2, double arg3) { + std::string dev, key; + int delay; + double value; - if (ParseNetDev() < 0) { - return -1; - } + if (ParseNetDev() < 0) { + return -1; + } - dev = arg1; - key = arg2; - delay = arg3; + dev = arg1; + key = arg2; + delay = arg3; - value = hash_get_delta(&NetDev, dev.c_str(), key.c_str(), delay); + value = hash_get_delta(&NetDev, dev.c_str(), key.c_str(), delay); - return value; + return value; } class netdev_Fast_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::string_arg_t()); - args->add(new lua::int_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "netdev"; } - static const std::string name() { return "Fast"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string dev = dynamic_cast(*in[0]).value(); - std::string key = dynamic_cast(*in[0]).value(); - double delay = dynamic_cast(*in[0]).value(); - double val = plugnetdev->Fast(dev, key, delay); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::string_arg_t()); + args->add(new lua::int_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "netdev"; } + static const std::string name() { return "Fast"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string dev = dynamic_cast(*in[0]).value(); + std::string key = dynamic_cast(*in[0]).value(); + double delay = dynamic_cast(*in[0]).value(); + double val = plugnetdev->Fast(dev, key, delay); + dynamic_cast(*out[0]).value() = val; + } }; -PluginNetDev::PluginNetDev(lua *script) -{ - plugnetdev = this; - first_time = 1; - Stream = NULL; - hash_create(&NetDev); - hash_set_delimiter(&NetDev, " :|\t\n"); +PluginNetDev::PluginNetDev(lua *script) { + plugnetdev = this; + first_time = 1; + Stream = NULL; + hash_create(&NetDev); + hash_set_delimiter(&NetDev, " :|\t\n"); } -PluginNetDev::~PluginNetDev() -{ - if (Stream != NULL) { - fclose(Stream); - Stream = NULL; - } - hash_destroy(&NetDev); +PluginNetDev::~PluginNetDev() { + if (Stream != NULL) { + fclose(Stream); + Stream = NULL; + } + hash_destroy(&NetDev); } - - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetDev.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetDev.h index 60847eeb4..ab0c38ab7 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetDev.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetDev.h @@ -33,20 +33,20 @@ namespace LCD { class PluginNetDev { - HASH NetDev; - FILE *Stream; - int first_time; + HASH NetDev; + FILE *Stream; + int first_time; - int ParseNetDev(); + int ParseNetDev(); - public: - PluginNetDev(lua *script); - ~PluginNetDev(); +public: + PluginNetDev(lua *script); + ~PluginNetDev(); - double Regex(std::string arg1, std::string arg2, double arg3); - double Fast(std::string arg1, std::string arg2, double arg3); + double Regex(std::string arg1, std::string arg2, double arg3); + double Fast(std::string arg1, std::string arg2, double arg3); }; -}; +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetinfo.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetinfo.cpp index 5cc9731e8..62b211778 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetinfo.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetinfo.cpp @@ -2,8 +2,9 @@ * $URL$ * * Copyright (C) 2007 Volker Gering - * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team - * Copyright (C) 2009 Scott Sibley + * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team + * Copyright (C) 2009 Scott Sibley + * * * This file is part of LCDControl. * @@ -29,13 +30,13 @@ #include "debug.h" #include "qprintf.h" -#include /* socket() */ -#include /* socket() */ -#include /* SIOCGIFNAME */ -#include /* ifreq{} */ -#include /* errno */ -#include /* inet_ntoa() */ -#include /* inet_ntoa() */ +#include /* socket() */ +#include /* socket() */ +#include /* SIOCGIFNAME */ +#include /* ifreq{} */ +#include /* errno */ +#include /* inet_ntoa() */ +#include /* inet_ntoa() */ #include "PluginNetinfo.h" @@ -52,322 +53,307 @@ int socknr = -2; int PluginNetinfo::OpenNet() { - if (socknr == -3) - return -1; - if (socknr == -2) { - socknr = socket(PF_INET, SOCK_DGRAM, 0); - } - if (socknr == -1) { - LCDError("%s: socket(PF_INET, SOCK_DGRAM, 0) failed: %s", "plugin_netinfo", strerror(errno)); - LCDError(" deactivate plugin netinfo"); - socknr = -3; - return -1; - } - - return 0; + if (socknr == -3) + return -1; + if (socknr == -2) { + socknr = socket(PF_INET, SOCK_DGRAM, 0); + } + if (socknr == -1) { + LCDError("%s: socket(PF_INET, SOCK_DGRAM, 0) failed: %s", "plugin_netinfo", + strerror(errno)); + LCDError(" deactivate plugin netinfo"); + socknr = -3; + return -1; + } + + return 0; } double PluginNetinfo::Exists(std::string arg1) { - char buf[10240]; - struct ifconf ifcnf; - struct ifreq *ifreq; - double value = 0.0; // netdev doesn't exists - char devname[80]; - - if (socknr < 0) { - /* no open socket */ - return value; - } - - ifcnf.ifc_len = sizeof(buf); - ifcnf.ifc_buf = buf; - if (ioctl(socknr, SIOCGIFCONF, &ifcnf) < 0) { - /* Error getting list of devices */ - LCDError("%s: ioctl(IFCONF) for %s failed: %s", "plugin_netinfo", - arg1.c_str(), strerror(errno)); - return value; - } - if (0 == ifcnf.ifc_len) { - /* no interfaces found */ - return value; - } - - ifreq = (struct ifreq *) buf; - strncpy(devname, arg1.c_str(), sizeof(devname)); + char buf[10240]; + struct ifconf ifcnf; + struct ifreq *ifreq; + double value = 0.0; // netdev doesn't exists + char devname[80]; + + if (socknr < 0) { + /* no open socket */ + return value; + } + + ifcnf.ifc_len = sizeof(buf); + ifcnf.ifc_buf = buf; + if (ioctl(socknr, SIOCGIFCONF, &ifcnf) < 0) { + /* Error getting list of devices */ + LCDError("%s: ioctl(IFCONF) for %s failed: %s", "plugin_netinfo", + arg1.c_str(), strerror(errno)); + return value; + } + if (0 == ifcnf.ifc_len) { + /* no interfaces found */ + return value; + } - while (ifreq && *((char *) ifreq) && ((char *) ifreq) < buf + ifcnf.ifc_len) { - if (*((char *) ifreq) && strncmp(ifreq->ifr_name, devname, sizeof(devname)) == 0) { - /* found */ - value = 1.0; - return value; - } + ifreq = (struct ifreq *)buf; + strncpy(devname, arg1.c_str(), sizeof(devname)); - ifreq++; + while (ifreq && *((char *)ifreq) && ((char *)ifreq) < buf + ifcnf.ifc_len) { + if (*((char *)ifreq) && + strncmp(ifreq->ifr_name, devname, sizeof(devname)) == 0) { + /* found */ + value = 1.0; + return value; } - /* device doesn't exists */ - return value; + ifreq++; + } + + /* device doesn't exists */ + return value; } class netinfo_Exists_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } - - static const std::string ns() { return "netinfo"; } - static const std::string name() { return "Exists"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - double val = plugnetinfo->Exists(key); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "netinfo"; } + static const std::string name() { return "Exists"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + double val = plugnetinfo->Exists(key); + dynamic_cast(*out[0]).value() = val; + } }; /* get MAC address (hardware address) of network device */ std::string PluginNetinfo::Hwaddr(std::string arg1) { - static int errcount = 0; - struct ifreq ifreq; - unsigned char *hw; - char value[18]; - - if (socknr < 0) { - /* no open socket */ - return ""; - } + static int errcount = 0; + struct ifreq ifreq; + unsigned char *hw; + char value[18]; - strncpy(ifreq.ifr_name, arg1.c_str(), sizeof(ifreq.ifr_name)); - if (ioctl(socknr, SIOCGIFHWADDR, &ifreq) < 0) { - errcount++; - if (1 == errcount % 1000) { - LCDError("%s: ioctl(IFHWADDR %s) failed: %s", "plugin_netinfo", ifreq.ifr_name, strerror(errno)); - LCDError(" (skip next 1000 Errors)"); - } - return ""; + if (socknr < 0) { + /* no open socket */ + return ""; + } + + strncpy(ifreq.ifr_name, arg1.c_str(), sizeof(ifreq.ifr_name)); + if (ioctl(socknr, SIOCGIFHWADDR, &ifreq) < 0) { + errcount++; + if (1 == errcount % 1000) { + LCDError("%s: ioctl(IFHWADDR %s) failed: %s", "plugin_netinfo", + ifreq.ifr_name, strerror(errno)); + LCDError(" (skip next 1000 Errors)"); } - hw = (unsigned char *) ifreq.ifr_hwaddr.sa_data; - qprintf(value, sizeof(value), "%02x:%02x:%02x:%02x:%02x:%02x", - *hw, *(hw + 1), *(hw + 2), *(hw + 3), *(hw + 4), *(hw + 5)); + return ""; + } + hw = (unsigned char *)ifreq.ifr_hwaddr.sa_data; + qprintf(value, sizeof(value), "%02x:%02x:%02x:%02x:%02x:%02x", *hw, *(hw + 1), + *(hw + 2), *(hw + 3), *(hw + 4), *(hw + 5)); - return value; + return value; } class netinfo_Hwaddr_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "netinfo"; } - static const std::string name() { return "Hwaddr"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - std::string val = plugnetinfo->Hwaddr(key); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "netinfo"; } + static const std::string name() { return "Hwaddr"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + std::string val = plugnetinfo->Hwaddr(key); + dynamic_cast(*out[0]).value() = val; + } }; - /* get ip address of network device */ std::string PluginNetinfo::Ipaddr(std::string arg1) { - static int errcount = 0; - struct ifreq ifreq; - struct sockaddr_in *sin; - char value[16]; - - if (socknr < 0) { - /* no open socket */ - return ""; - } + static int errcount = 0; + struct ifreq ifreq; + struct sockaddr_in *sin; + char value[16]; - strncpy(ifreq.ifr_name, arg1.c_str(), sizeof(ifreq.ifr_name)); - if (ioctl(socknr, SIOCGIFADDR, &ifreq) < 0) { - errcount++; - if (1 == errcount % 1000) { - LCDError("%s: ioctl(IFADDR %s) failed: %s", "plugin_netinfo", ifreq.ifr_name, strerror(errno)); - LCDError(" (skip next 1000 Errors)"); - } - return ""; + if (socknr < 0) { + /* no open socket */ + return ""; + } + + strncpy(ifreq.ifr_name, arg1.c_str(), sizeof(ifreq.ifr_name)); + if (ioctl(socknr, SIOCGIFADDR, &ifreq) < 0) { + errcount++; + if (1 == errcount % 1000) { + LCDError("%s: ioctl(IFADDR %s) failed: %s", "plugin_netinfo", + ifreq.ifr_name, strerror(errno)); + LCDError(" (skip next 1000 Errors)"); } - sin = (struct sockaddr_in *) &ifreq.ifr_addr; - qprintf(value, sizeof(value), "%s", inet_ntoa(sin->sin_addr)); + return ""; + } + sin = (struct sockaddr_in *)&ifreq.ifr_addr; + qprintf(value, sizeof(value), "%s", inet_ntoa(sin->sin_addr)); - return value; + return value; } class netinfo_Ipaddr_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "netinfo"; } - static const std::string name() { return "Ipaddr"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - std::string val = plugnetinfo->Ipaddr(key); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "netinfo"; } + static const std::string name() { return "Ipaddr"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + std::string val = plugnetinfo->Ipaddr(key); + dynamic_cast(*out[0]).value() = val; + } }; /* get ip netmask of network device */ std::string PluginNetinfo::Netmask(std::string arg1) { - static int errcount = 0; - struct ifreq ifreq; - struct sockaddr_in *sin; - char value[16]; - - if (socknr < 0) { - /* no open socket */ - return ""; - } + static int errcount = 0; + struct ifreq ifreq; + struct sockaddr_in *sin; + char value[16]; - strncpy(ifreq.ifr_name, arg1.c_str(), sizeof(ifreq.ifr_name)); - if (ioctl(socknr, SIOCGIFNETMASK, &ifreq) < 0) { - errcount++; - if (1 == errcount % 1000) { - LCDError("%s: ioctl(IFNETMASK %s) failed: %s", "plugin_netinfo", - ifreq.ifr_name, strerror(errno)); - LCDError(" (skip next 1000 Errors)"); - } - return ""; + if (socknr < 0) { + /* no open socket */ + return ""; + } + + strncpy(ifreq.ifr_name, arg1.c_str(), sizeof(ifreq.ifr_name)); + if (ioctl(socknr, SIOCGIFNETMASK, &ifreq) < 0) { + errcount++; + if (1 == errcount % 1000) { + LCDError("%s: ioctl(IFNETMASK %s) failed: %s", "plugin_netinfo", + ifreq.ifr_name, strerror(errno)); + LCDError(" (skip next 1000 Errors)"); } - sin = (struct sockaddr_in *) &ifreq.ifr_netmask; - qprintf(value, sizeof(value), "%s", inet_ntoa(sin->sin_addr)); - return ""; + } + sin = (struct sockaddr_in *)&ifreq.ifr_netmask; + qprintf(value, sizeof(value), "%s", inet_ntoa(sin->sin_addr)); + + return ""; } class netinfo_Netmask_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "netinfo"; } - static const std::string name() { return "Netmask"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - std::string val = plugnetinfo->Netmask(key); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "netinfo"; } + static const std::string name() { return "Netmask"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + std::string val = plugnetinfo->Netmask(key); + dynamic_cast(*out[0]).value() = val; + } }; /* get ip broadcast address of network device */ std::string PluginNetinfo::Bcaddr(std::string arg1) { - static int errcount = 0; - struct ifreq ifreq; - struct sockaddr_in *sin; - char value[16]; - - if (socknr < 0) { - /* no open socket */ - return ""; - } + static int errcount = 0; + struct ifreq ifreq; + struct sockaddr_in *sin; + char value[16]; - strncpy(ifreq.ifr_name, arg1.c_str(), sizeof(ifreq.ifr_name)); - if (ioctl(socknr, SIOCGIFBRDADDR, &ifreq) < 0) { - errcount++; - if (1 == errcount % 1000) { - LCDError("%s: ioctl(IFBRDADDR %s) failed: %s", "plugin_netinfo", ifreq.ifr_name, strerror(errno)); - LCDError(" (skip next 1000 Errors)"); - } - return ""; + if (socknr < 0) { + /* no open socket */ + return ""; + } + + strncpy(ifreq.ifr_name, arg1.c_str(), sizeof(ifreq.ifr_name)); + if (ioctl(socknr, SIOCGIFBRDADDR, &ifreq) < 0) { + errcount++; + if (1 == errcount % 1000) { + LCDError("%s: ioctl(IFBRDADDR %s) failed: %s", "plugin_netinfo", + ifreq.ifr_name, strerror(errno)); + LCDError(" (skip next 1000 Errors)"); } - sin = (struct sockaddr_in *) &ifreq.ifr_broadaddr; - qprintf(value, sizeof(value), "%s", inet_ntoa(sin->sin_addr)); + return ""; + } + sin = (struct sockaddr_in *)&ifreq.ifr_broadaddr; + qprintf(value, sizeof(value), "%s", inet_ntoa(sin->sin_addr)); - return value; + return value; } - class netinfo_Bcaddr_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "netinfo"; } - static const std::string name() { return "Bcaddr"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - std::string str = plugnetinfo->Bcaddr(key); - dynamic_cast(*out[0]).value() = str; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "netinfo"; } + static const std::string name() { return "Bcaddr"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + std::string str = plugnetinfo->Bcaddr(key); + dynamic_cast(*out[0]).value() = str; + } }; PluginNetinfo::PluginNetinfo(lua *script) { - plugnetinfo = this; - socknr = -2; - OpenNet(); - script->register_function(); - script->register_function(); - script->register_function(); - script->register_function(); - script->register_function(); -} - -PluginNetinfo::~PluginNetinfo() { - close(socknr); + plugnetinfo = this; + socknr = -2; + OpenNet(); + script->register_function(); + script->register_function(); + script->register_function(); + script->register_function(); + script->register_function(); } +PluginNetinfo::~PluginNetinfo() { close(socknr); } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetinfo.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetinfo.h index 425a4f54f..fa3fbfc2e 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetinfo.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginNetinfo.h @@ -2,8 +2,9 @@ * $URL$ * * Copyright (C) 2007 Volker Gering - * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team - * Copyright (C) 2009 Scott Sibley + * Copyright (C) 2004, 2005, 2006, 2007 The LCD4Linux Team + * Copyright (C) 2009 Scott Sibley + * * * This file is part of LCDControl. * @@ -32,20 +33,20 @@ namespace LCD { class PluginNetinfo { - int socknr; - int OpenNet(); + int socknr; + int OpenNet(); - public: - PluginNetinfo(lua *script); - ~PluginNetinfo(); +public: + PluginNetinfo(lua *script); + ~PluginNetinfo(); - double Exists(std::string arg1); - std::string Hwaddr(std::string arg1); - std::string Ipaddr(std::string arg1); - std::string Netmask(std::string arg1); - std::string Bcaddr(std::string arg1); + double Exists(std::string arg1); + std::string Hwaddr(std::string arg1); + std::string Ipaddr(std::string arg1); + std::string Netmask(std::string arg1); + std::string Bcaddr(std::string arg1); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginProcStat.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginProcStat.cpp index cad8b255b..3d39c9edd 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginProcStat.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginProcStat.cpp @@ -38,398 +38,376 @@ using namespace LCD; PluginProcStat *procstat; void PluginProcStat::HashPut1(const char *key1, const char *val) { - hash_put_delta(&Stat, key1, val); + hash_put_delta(&Stat, key1, val); } +void PluginProcStat::HashPut2(const char *key1, const char *key2, + const char *val) { + char key[32]; -void PluginProcStat::HashPut2(const char *key1, const char *key2, - const char *val) { - char key[32]; - - qprintf(key, sizeof(key), "%s.%s", key1, key2); - HashPut1(key, val); + qprintf(key, sizeof(key), "%s.%s", key1, key2); + HashPut1(key, val); } +void PluginProcStat::HashPut3(const char *key1, const char *key2, + const char *key3, const char *val) { + char key[32]; -void PluginProcStat::HashPut3(const char *key1, const char *key2, - const char *key3, const char *val) { - char key[32]; - - qprintf(key, sizeof(key), "%s.%s.%s", key1, key2, key3); - HashPut1(key, val); + qprintf(key, sizeof(key), "%s.%s.%s", key1, key2, key3); + HashPut1(key, val); } - int PluginProcStat::ParseProcStat(void) { - int age; - - /* reread every 10 msec only */ - age = hash_age(&Stat, NULL); - if (age > 0 && age <= 10) - return 0; - - if (stream == NULL) - stream = fopen("/proc/stat", "r"); - if (stream == NULL) { - LCDError("fopen(/proc/stat) failed: %s", strerror(errno)); - return -1; - } + int age; - rewind(stream); - - while (!feof(stream)) { - char buffer[1024]; - if (fgets(buffer, sizeof(buffer), stream) == NULL) - break; - - if (strncmp(buffer, "cpu", 3) == 0) { - const char *key[] = { "user", "nice", "system", "idle", "iow", "irq", "sirq" }; - char delim[] = " \t\n"; - char *cpu, *beg, *end; - int i; - - cpu = buffer; - - /* skip "cpu" or "cpu0" block */ - if ((end = strpbrk(buffer, delim)) != NULL) - *end = '\0'; - beg = end ? end + 1 : NULL; - - for (i = 0; i < 7 && beg != NULL; i++) { - while (strlen(beg) > 0 && strchr(delim, *beg)) - beg++; - if ((end = strpbrk(beg, delim))) - *end = '\0'; - HashPut2(cpu, key[i], beg); - beg = end ? end + 1 : NULL; - } - } + /* reread every 10 msec only */ + age = hash_age(&Stat, NULL); + if (age > 0 && age <= 10) + return 0; - else if (strncmp(buffer, "page ", 5) == 0) { - const char *key[] = { "in", "out" }; - char delim[] = " \t\n"; - char *beg, *end; - int i; - - for (i = 0, beg = buffer + 5; i < 2 && beg != NULL; i++) { - while (strlen(beg) > 0 && strchr(delim, *beg)) - beg++; - if ((end = strpbrk(beg, delim))) - *end = '\0'; - HashPut2("page", key[i], beg); - beg = end ? end + 1 : NULL; - } - } + if (stream == NULL) + stream = fopen("/proc/stat", "r"); + if (stream == NULL) { + LCDError("fopen(/proc/stat) failed: %s", strerror(errno)); + return -1; + } + + rewind(stream); + + while (!feof(stream)) { + char buffer[1024]; + if (fgets(buffer, sizeof(buffer), stream) == NULL) + break; + + if (strncmp(buffer, "cpu", 3) == 0) { + const char *key[] = {"user", "nice", "system", "idle", + "iow", "irq", "sirq"}; + char delim[] = " \t\n"; + char *cpu, *beg, *end; + int i; + + cpu = buffer; + + /* skip "cpu" or "cpu0" block */ + if ((end = strpbrk(buffer, delim)) != NULL) + *end = '\0'; + beg = end ? end + 1 : NULL; + + for (i = 0; i < 7 && beg != NULL; i++) { + while (strlen(beg) > 0 && strchr(delim, *beg)) + beg++; + if ((end = strpbrk(beg, delim))) + *end = '\0'; + HashPut2(cpu, key[i], beg); + beg = end ? end + 1 : NULL; + } + } - else if (strncmp(buffer, "swap ", 5) == 0) { - const char *key[] = { "in", "out" }; - char delim[] = " \t\n"; - char *beg, *end; - int i; - - for (i = 0, beg = buffer + 5; i < 2 && beg != NULL; i++) { - while (strlen(beg) > 0 && strchr(delim, *beg)) - beg++; - if ((end = strpbrk(beg, delim))) - *end = '\0'; - HashPut2("swap", key[i], beg); - beg = end ? end + 1 : NULL; - } - } + else if (strncmp(buffer, "page ", 5) == 0) { + const char *key[] = {"in", "out"}; + char delim[] = " \t\n"; + char *beg, *end; + int i; + + for (i = 0, beg = buffer + 5; i < 2 && beg != NULL; i++) { + while (strlen(beg) > 0 && strchr(delim, *beg)) + beg++; + if ((end = strpbrk(beg, delim))) + *end = '\0'; + HashPut2("page", key[i], beg); + beg = end ? end + 1 : NULL; + } + } - else if (strncmp(buffer, "intr ", 5) == 0) { - char delim[] = " \t\n"; - char *beg, *end, num[4]; - int i; - - for (i = 0, beg = buffer + 5; i < 17 && beg != NULL; i++) { - while (strlen(beg) > 0 && strchr(delim, *beg)) - beg++; - if ((end = strpbrk(beg, delim))) - *end = '\0'; - if (i == 0) - strcpy(num, "sum"); - else - qprintf(num, sizeof(num), "%d", i - 1); - HashPut2("intr", num, beg); - beg = end ? end + 1 : NULL; - } - } + else if (strncmp(buffer, "swap ", 5) == 0) { + const char *key[] = {"in", "out"}; + char delim[] = " \t\n"; + char *beg, *end; + int i; + + for (i = 0, beg = buffer + 5; i < 2 && beg != NULL; i++) { + while (strlen(beg) > 0 && strchr(delim, *beg)) + beg++; + if ((end = strpbrk(beg, delim))) + *end = '\0'; + HashPut2("swap", key[i], beg); + beg = end ? end + 1 : NULL; + } + } - else if (strncmp(buffer, "disk_io:", 8) == 0) { - const char *key[] = { "io", "rio", "rblk", "wio", "wblk" }; - char delim[] = " ():,\t\n"; - char *dev, *beg, *end, *p; - int i; - - dev = buffer + 8; - while (dev != NULL) { - while (strlen(dev) > 0 && strchr(delim, *dev)) - dev++; - if ((end = strchr(dev, ')'))) - *end = '\0'; - while ((p = strchr(dev, ',')) != NULL) - *p = ':'; - beg = end ? end + 1 : NULL; - for (i = 0; i < 5 && beg != NULL; i++) { - while (strlen(beg) > 0 && strchr(delim, *beg)) - beg++; - if ((end = strpbrk(beg, delim))) - *end = '\0'; - HashPut3("disk_io", dev, key[i], beg); - beg = end ? end + 1 : NULL; - } - dev = beg; - } - } + else if (strncmp(buffer, "intr ", 5) == 0) { + char delim[] = " \t\n"; + char *beg, *end, num[4]; + int i; + + for (i = 0, beg = buffer + 5; i < 17 && beg != NULL; i++) { + while (strlen(beg) > 0 && strchr(delim, *beg)) + beg++; + if ((end = strpbrk(beg, delim))) + *end = '\0'; + if (i == 0) + strcpy(num, "sum"); + else + qprintf(num, sizeof(num), "%d", i - 1); + HashPut2("intr", num, beg); + beg = end ? end + 1 : NULL; + } + } - else { - char delim[] = " \t\n"; - char *beg, *end; - - beg = buffer; - if ((end = strpbrk(beg, delim))) - *end = '\0'; - beg = end ? end + 1 : NULL; - if ((end = strpbrk(beg, delim))) - *end = '\0'; - while (strlen(beg) > 0 && strchr(delim, *beg)) - beg++; - HashPut1(buffer, beg); + else if (strncmp(buffer, "disk_io:", 8) == 0) { + const char *key[] = {"io", "rio", "rblk", "wio", "wblk"}; + char delim[] = " ():,\t\n"; + char *dev, *beg, *end, *p; + int i; + + dev = buffer + 8; + while (dev != NULL) { + while (strlen(dev) > 0 && strchr(delim, *dev)) + dev++; + if ((end = strchr(dev, ')'))) + *end = '\0'; + while ((p = strchr(dev, ',')) != NULL) + *p = ':'; + beg = end ? end + 1 : NULL; + for (i = 0; i < 5 && beg != NULL; i++) { + while (strlen(beg) > 0 && strchr(delim, *beg)) + beg++; + if ((end = strpbrk(beg, delim))) + *end = '\0'; + HashPut3("disk_io", dev, key[i], beg); + beg = end ? end + 1 : NULL; } + dev = beg; + } } - return 0; -} + else { + char delim[] = " \t\n"; + char *beg, *end; + + beg = buffer; + if ((end = strpbrk(beg, delim))) + *end = '\0'; + beg = end ? end + 1 : NULL; + if ((end = strpbrk(beg, delim))) + *end = '\0'; + while (strlen(beg) > 0 && strchr(delim, *beg)) + beg++; + HashPut1(buffer, beg); + } + } + return 0; +} std::string PluginProcStat::ProcStat(std::string arg1) { - char *string; + char *string; - string = hash_get(&Stat, arg1.c_str(), NULL); - if (string == NULL) - string = const_cast(""); - return string; + string = hash_get(&Stat, arg1.c_str(), NULL); + if (string == NULL) + string = const_cast(""); + return string; } class procstat1_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "procstat"; } - static const std::string name() { return "Procstat"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - std::string str = procstat->ProcStat(key); - dynamic_cast(*out[0]).value() = str; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "procstat"; } + static const std::string name() { return "Procstat"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + std::string str = procstat->ProcStat(key); + dynamic_cast(*out[0]).value() = str; + } }; +double PluginProcStat::ProcStat(std::string arg1, double arg2) { + double number; -double PluginProcStat::ProcStat(std::string arg1, double arg2) -{ - double number; - - number = hash_get_delta(&Stat, arg1.c_str(), - NULL, arg2); - return number; + number = hash_get_delta(&Stat, arg1.c_str(), NULL, arg2); + return number; } class procstat2_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::int_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } - - static const std::string ns() { return "procstat"; } - static const std::string name() { return "ProcstatDelta"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string arg1 = dynamic_cast(*in[0]).value(); - double arg2 = dynamic_cast(*in[1]).value(); - double val = procstat->ProcStat(arg1, arg2); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::int_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "procstat"; } + static const std::string name() { return "ProcstatDelta"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string arg1 = dynamic_cast(*in[0]).value(); + double arg2 = dynamic_cast(*in[1]).value(); + double val = procstat->ProcStat(arg1, arg2); + dynamic_cast(*out[0]).value() = val; + } }; - double PluginProcStat::Cpu(std::string arg1, int arg2) { - //const char *key; - std::string key = arg1; - int delay = arg2; - double cpu_user, cpu_nice, cpu_system, cpu_idle, cpu_total; - double cpu_iow, cpu_irq, cpu_sirq; - - if (ParseProcStat() < 0) { - LCDInfo("Unable to parse /proc/stat"); - return 0; - } - - cpu_user = hash_get_delta(&Stat, "cpu.user", NULL, delay); - cpu_nice = hash_get_delta(&Stat, "cpu.nice", NULL, delay); - cpu_system = hash_get_delta(&Stat, "cpu.system", NULL, delay); - cpu_idle = hash_get_delta(&Stat, "cpu.idle", NULL, delay); - - /* new fields for kernel 2.6 */ - /* even if we dont have this param (ie kernel 2.4) */ - /* the return is 0.0 and not change the results */ - cpu_iow = hash_get_delta(&Stat, "cpu.iow", NULL, delay); - cpu_irq = hash_get_delta(&Stat, "cpu.irq", NULL, delay); - cpu_sirq = hash_get_delta(&Stat, "cpu.sirq", NULL, delay); - - cpu_total = cpu_user + cpu_nice + cpu_system + cpu_idle + cpu_iow + cpu_irq + cpu_sirq; - - double value = 0.0; - - if (key == "user") - value = cpu_user; - else if (key == "nice") - value = cpu_nice; - else if (key =="system") - value = cpu_system; - else if (key == "idle") - value = cpu_idle; - else if (key == "iowait") - value = cpu_iow; - else if (key == "irq") - value = cpu_irq; - else if (key == "softirq") - value = cpu_sirq; - else if (key == "busy") - value = cpu_total - cpu_idle; - - if (cpu_total > 0.0) - value = 100 * value / cpu_total; - else - value = 0.0; - - return value; + // const char *key; + std::string key = arg1; + int delay = arg2; + double cpu_user, cpu_nice, cpu_system, cpu_idle, cpu_total; + double cpu_iow, cpu_irq, cpu_sirq; + + if (ParseProcStat() < 0) { + LCDInfo("Unable to parse /proc/stat"); + return 0; + } + + cpu_user = hash_get_delta(&Stat, "cpu.user", NULL, delay); + cpu_nice = hash_get_delta(&Stat, "cpu.nice", NULL, delay); + cpu_system = hash_get_delta(&Stat, "cpu.system", NULL, delay); + cpu_idle = hash_get_delta(&Stat, "cpu.idle", NULL, delay); + + /* new fields for kernel 2.6 */ + /* even if we dont have this param (ie kernel 2.4) */ + /* the return is 0.0 and not change the results */ + cpu_iow = hash_get_delta(&Stat, "cpu.iow", NULL, delay); + cpu_irq = hash_get_delta(&Stat, "cpu.irq", NULL, delay); + cpu_sirq = hash_get_delta(&Stat, "cpu.sirq", NULL, delay); + + cpu_total = cpu_user + cpu_nice + cpu_system + cpu_idle + cpu_iow + cpu_irq + + cpu_sirq; + + double value = 0.0; + + if (key == "user") + value = cpu_user; + else if (key == "nice") + value = cpu_nice; + else if (key == "system") + value = cpu_system; + else if (key == "idle") + value = cpu_idle; + else if (key == "iowait") + value = cpu_iow; + else if (key == "irq") + value = cpu_irq; + else if (key == "softirq") + value = cpu_sirq; + else if (key == "busy") + value = cpu_total - cpu_idle; + + if (cpu_total > 0.0) + value = 100 * value / cpu_total; + else + value = 0.0; + + return value; } class procstat3_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::int_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } - - static const std::string ns() { return "procstat"; } - static const std::string name() { return "Cpu"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string arg1 = dynamic_cast(*in[0]).value(); - double arg2 = dynamic_cast(*in[1]).value(); - double val = procstat->Cpu(arg1, arg2); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::int_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "procstat"; } + static const std::string name() { return "Cpu"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string arg1 = dynamic_cast(*in[0]).value(); + double arg2 = dynamic_cast(*in[1]).value(); + double val = procstat->Cpu(arg1, arg2); + dynamic_cast(*out[0]).value() = val; + } }; - double PluginProcStat::Disk(std::string arg1, std::string arg2, double arg3) { - const char *dev, *key; - char buffer[32]; - int delay; - double value; - - if (ParseProcStat() < 0) { - LCDInfo("Unable to parse /proc/stat"); - return 0; - } + const char *dev, *key; + char buffer[32]; + int delay; + double value; - dev = arg1.c_str(); - key = arg2.c_str(); - delay = arg3; + if (ParseProcStat() < 0) { + LCDInfo("Unable to parse /proc/stat"); + return 0; + } + + dev = arg1.c_str(); + key = arg2.c_str(); + delay = arg3; - qprintf(buffer, sizeof(buffer), "disk_io\\.%s\\.%s", dev, key); - value = hash_get_regex(&Stat, buffer, NULL, delay); + qprintf(buffer, sizeof(buffer), "disk_io\\.%s\\.%s", dev, key); + value = hash_get_regex(&Stat, buffer, NULL, delay); - return value; + return value; } class procstat4_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::string_arg_t()); - args->add(new lua::int_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } - - static const std::string ns() { return "procstat"; } - static const std::string name() { return "Disk"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string arg1 = dynamic_cast(*in[0]).value(); - std::string arg2 = dynamic_cast(*in[1]).value(); - double arg3 = dynamic_cast(*in[2]).value(); - double val = procstat->Disk(arg1, arg2, arg3); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::string_arg_t()); + args->add(new lua::int_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "procstat"; } + static const std::string name() { return "Disk"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string arg1 = dynamic_cast(*in[0]).value(); + std::string arg2 = dynamic_cast(*in[1]).value(); + double arg3 = dynamic_cast(*in[2]).value(); + double val = procstat->Disk(arg1, arg2, arg3); + dynamic_cast(*out[0]).value() = val; + } }; - PluginProcStat::PluginProcStat(lua *script) { - procstat = this; - script->register_function(); - script->register_function(); - script->register_function(); - script->register_function(); - stream = NULL; - hash_create(&Stat); + procstat = this; + script->register_function(); + script->register_function(); + script->register_function(); + script->register_function(); + stream = NULL; + hash_create(&Stat); } PluginProcStat::~PluginProcStat() { - if (stream != NULL) { - fclose(stream); - stream = NULL; - } - hash_destroy(&Stat); + if (stream != NULL) { + fclose(stream); + stream = NULL; + } + hash_destroy(&Stat); } - - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginProcStat.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginProcStat.h index 704c21f08..f5f0b94ed 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginProcStat.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginProcStat.h @@ -32,26 +32,25 @@ namespace LCD { class PluginProcStat { - HASH Stat; - FILE *stream; - - void HashPut1(const char *key1, const char *val); - void HashPut2(const char *key1, const char *key2, - const char *val); - void HashPut3(const char *key1, const char *key2, - const char *key3, const char *val); - int ParseProcStat(); - - public: - PluginProcStat(lua *script); - ~PluginProcStat(); - - std::string ProcStat(std::string arg1); - double ProcStat(std::string arg1, double arg2); - double Cpu(std::string arg1, int arg2); - double Disk(std::string arg1, std::string arg2, double arg3); + HASH Stat; + FILE *stream; + + void HashPut1(const char *key1, const char *val); + void HashPut2(const char *key1, const char *key2, const char *val); + void HashPut3(const char *key1, const char *key2, const char *key3, + const char *val); + int ParseProcStat(); + +public: + PluginProcStat(lua *script); + ~PluginProcStat(); + + std::string ProcStat(std::string arg1); + double ProcStat(std::string arg1, double arg2); + double Cpu(std::string arg1, int arg2); + double Disk(std::string arg1, std::string arg2, double arg3); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginStatfs.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginStatfs.cpp index 016b6d1c5..b9d0c76fe 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginStatfs.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginStatfs.cpp @@ -37,86 +37,79 @@ using namespace LCD; PluginStatfs *mStatfs; -double PluginStatfs::Statfs(std::string path, std::string key) -{ - struct statfs buf; - double value; - - //LCDError("path: %s, key: %s", path, key); - - if (statfs(path.c_str(), &buf) != 0) { - LCDError("statfs(%s) failed: %s", path.c_str(), strerror(errno)); - return 0.0; - } - - if (strcasecmp(key.c_str(), "type") == 0) { - value = buf.f_type; - } else if (strcasecmp(key.c_str(), "bsize") == 0) { - value = buf.f_bsize; - } else if (strcasecmp(key.c_str(), "blocks") == 0) { - value = buf.f_blocks; - } else if (strcasecmp(key.c_str(), "bfree") == 0) { - value = buf.f_bfree; - } else if (strcasecmp(key.c_str(), "bavail") == 0) { - value = buf.f_bavail; - } else if (strcasecmp(key.c_str(), "files") == 0) { - value = buf.f_files; - } else if (strcasecmp(key.c_str(), "ffree") == 0) { - value = buf.f_ffree; +double PluginStatfs::Statfs(std::string path, std::string key) { + struct statfs buf; + double value; + + // LCDError("path: %s, key: %s", path, key); + + if (statfs(path.c_str(), &buf) != 0) { + LCDError("statfs(%s) failed: %s", path.c_str(), strerror(errno)); + return 0.0; + } + + if (strcasecmp(key.c_str(), "type") == 0) { + value = buf.f_type; + } else if (strcasecmp(key.c_str(), "bsize") == 0) { + value = buf.f_bsize; + } else if (strcasecmp(key.c_str(), "blocks") == 0) { + value = buf.f_blocks; + } else if (strcasecmp(key.c_str(), "bfree") == 0) { + value = buf.f_bfree; + } else if (strcasecmp(key.c_str(), "bavail") == 0) { + value = buf.f_bavail; + } else if (strcasecmp(key.c_str(), "files") == 0) { + value = buf.f_files; + } else if (strcasecmp(key.c_str(), "ffree") == 0) { + value = buf.f_ffree; #if 0 } else if (strcasecmp(key, "fsid") == 0) { value = buf.f_fsid; #endif - } else if (strcasecmp(key.c_str(), "namelen") == 0) { - value = buf.f_namelen; - } else { - LCDError("statfs: unknown field '%s'", key.c_str()); - value = -1; - } - - return value; + } else if (strcasecmp(key.c_str(), "namelen") == 0) { + value = buf.f_namelen; + } else { + LCDError("statfs: unknown field '%s'", key.c_str()); + value = -1; + } + + return value; } - class statfs_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } - - static const std::string ns() { return "statfs"; } - static const std::string name() { return "Statfs"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string arg1 = dynamic_cast(*in[0]).value(); - std::string arg2 = dynamic_cast(*in[0]).value(); - double stat = mStatfs->Statfs(arg1, arg2); - dynamic_cast(*out[0]).value() = stat; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "statfs"; } + static const std::string name() { return "Statfs"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string arg1 = dynamic_cast(*in[0]).value(); + std::string arg2 = dynamic_cast(*in[0]).value(); + double stat = mStatfs->Statfs(arg1, arg2); + dynamic_cast(*out[0]).value() = stat; + } }; -PluginStatfs::PluginStatfs() { - -} +PluginStatfs::PluginStatfs() {} PluginStatfs::PluginStatfs(lua *script) { - script->register_function(); - mStatfs = this; + script->register_function(); + mStatfs = this; } -PluginStatfs::~PluginStatfs() { - if(this == mStatfs) - mStatfs = NULL; +PluginStatfs::~PluginStatfs() { + if (this == mStatfs) + mStatfs = NULL; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginStatfs.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginStatfs.h index dcea8a3cb..76179f0ea 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginStatfs.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginStatfs.h @@ -30,12 +30,12 @@ namespace LCD { class PluginStatfs { - public: - double Statfs(std::string arg1, std::string arg2); - PluginStatfs(lua *script); - PluginStatfs(); - ~PluginStatfs(); +public: + double Statfs(std::string arg1, std::string arg2); + PluginStatfs(lua *script); + PluginStatfs(); + ~PluginStatfs(); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginTime.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginTime.cpp index 076b510d8..010755782 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginTime.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginTime.cpp @@ -34,127 +34,113 @@ using namespace LCD; PluginTime *plugtime; -double PluginTime::Time() -{ - return (double)time(NULL); -} - +double PluginTime::Time() { return (double)time(NULL); } -std::string PluginTime::Strftime(std::string arg1, double arg2) -{ - char value[256]; - time_t t = arg2; +std::string PluginTime::Strftime(std::string arg1, double arg2) { + char value[256]; + time_t t = arg2; - value[0] = '\0'; - strftime(value, sizeof(value), arg1.c_str(), localtime(&t)); + value[0] = '\0'; + strftime(value, sizeof(value), arg1.c_str(), localtime(&t)); - return value; + return value; } class time_strf_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::int_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "time"; } - static const std::string name() { return "strf"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string fmt = dynamic_cast(*in[0]).value(); - double t = dynamic_cast(*in[1]).value(); - std::string str = plugtime->Strftime(fmt, t); - dynamic_cast(*out[0]).value() = str; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::int_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "time"; } + static const std::string name() { return "strf"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string fmt = dynamic_cast(*in[0]).value(); + double t = dynamic_cast(*in[1]).value(); + std::string str = plugtime->Strftime(fmt, t); + dynamic_cast(*out[0]).value() = str; + } }; -std::string PluginTime::Strftime_tz(std::string arg1, double arg2, std::string arg3) -{ - char value[256] = ""; - time_t t = arg2; - char *tz = (char *)arg3.c_str(); - char *old_tz; +std::string PluginTime::Strftime_tz(std::string arg1, double arg2, + std::string arg3) { + char value[256] = ""; + time_t t = arg2; + char *tz = (char *)arg3.c_str(); + char *old_tz; - old_tz = getenv("TZ"); + old_tz = getenv("TZ"); - /* - * because the next setenv() call may overwrite that string, we - * duplicate it here - */ - if (old_tz) { - old_tz = strdup(old_tz); - } + /* + * because the next setenv() call may overwrite that string, we + * duplicate it here + */ + if (old_tz) { + old_tz = strdup(old_tz); + } - setenv("TZ", tz, 1); - tzset(); + setenv("TZ", tz, 1); + tzset(); - strftime(value, sizeof(value), arg1.c_str(), localtime(&t)); + strftime(value, sizeof(value), arg1.c_str(), localtime(&t)); - if (old_tz) { - setenv("TZ", old_tz, 1); - } else { - unsetenv("TZ"); - } - tzset(); + if (old_tz) { + setenv("TZ", old_tz, 1); + } else { + unsetenv("TZ"); + } + tzset(); - free(old_tz); + free(old_tz); - return value; + return value; } class time_strf_tz_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - args->add(new lua::int_arg_t()); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "time"; } - static const std::string name() { return "strf_tz"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string fmt = dynamic_cast(*in[0]).value(); - double t = dynamic_cast(*in[1]).value(); - std::string tz = dynamic_cast(*in[2]).value(); - std::string str = plugtime->Strftime_tz(fmt, t, tz); - dynamic_cast(*out[0]).value() = str; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + args->add(new lua::int_arg_t()); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "time"; } + static const std::string name() { return "strf_tz"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string fmt = dynamic_cast(*in[0]).value(); + double t = dynamic_cast(*in[1]).value(); + std::string tz = dynamic_cast(*in[2]).value(); + std::string str = plugtime->Strftime_tz(fmt, t, tz); + dynamic_cast(*out[0]).value() = str; + } }; - double PluginTime::GetTimeOfDay() { - struct timeval now; - gettimeofday(&now, NULL); - return now.tv_sec * 1000 + now.tv_usec / 1000; + struct timeval now; + gettimeofday(&now, NULL); + return now.tv_sec * 1000 + now.tv_usec / 1000; } -PluginTime::PluginTime(lua *script) -{ - script->register_function(); - script->register_function(); +PluginTime::PluginTime(lua *script) { + script->register_function(); + script->register_function(); } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginTime.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginTime.h index db0191330..f088af237 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginTime.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginTime.h @@ -32,14 +32,14 @@ namespace LCD { class PluginTime { - public: - PluginTime(lua *script); +public: + PluginTime(lua *script); - double Time(); - std::string Strftime(std::string arg1, double arg2); - std::string Strftime_tz(std::string arg1, double arg2, std::string arg3); - double GetTimeOfDay(); + double Time(); + std::string Strftime(std::string arg1, double arg2); + std::string Strftime_tz(std::string arg1, double arg2, std::string arg3); + double GetTimeOfDay(); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginUname.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginUname.cpp index 2bf843b72..69b5b0784 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginUname.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginUname.cpp @@ -35,71 +35,66 @@ using namespace LCD; PluginUname *pluguname; -std::string PluginUname::Uname(std::string arg1) -{ - struct utsname utsbuf; - std::string key; - const char *value; +std::string PluginUname::Uname(std::string arg1) { + struct utsname utsbuf; + std::string key; + const char *value; - key = arg1; + key = arg1; - if (uname(&utsbuf) != 0) { - LCDError("uname() failed: %s", strerror(errno)); - return ""; - } + if (uname(&utsbuf) != 0) { + LCDError("uname() failed: %s", strerror(errno)); + return ""; + } - if (key == "sysname") { - value = utsbuf.sysname; - } else if (key == "nodename") { - value = utsbuf.nodename; - } else if (key == "release") { - value = utsbuf.release; - } else if (key == "version") { - value = utsbuf.version; - } else if (key == "machine") { - value = utsbuf.machine; -/*#if defined(_GNU_SOURCE) && ! defined(__APPLE__) && ! defined(__CYGWIN__) - else if (key == "domainname") - value = utsbuf.domainname; -#endif -*/ - } else { - LCDError("uname: unknown field '%s'", key.c_str()); - value = ""; - } + if (key == "sysname") { + value = utsbuf.sysname; + } else if (key == "nodename") { + value = utsbuf.nodename; + } else if (key == "release") { + value = utsbuf.release; + } else if (key == "version") { + value = utsbuf.version; + } else if (key == "machine") { + value = utsbuf.machine; + /*#if defined(_GNU_SOURCE) && ! defined(__APPLE__) && ! defined(__CYGWIN__) + else if (key == "domainname") + value = utsbuf.domainname; + #endif + */ + } else { + LCDError("uname: unknown field '%s'", key.c_str()); + value = ""; + } - return value; + return value; } class uname1_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } - static const std::string ns() { return "uname"; } - static const std::string name() { return "Uname"; } + static const std::string ns() { return "uname"; } + static const std::string name() { return "Uname"; } - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string key = dynamic_cast(*in[0]).value(); - std::string str = pluguname->Uname(key); - dynamic_cast(*out[0]).value() = str; - } + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string key = dynamic_cast(*in[0]).value(); + std::string str = pluguname->Uname(key); + dynamic_cast(*out[0]).value() = str; + } }; -PluginUname::PluginUname(lua *script) -{ - pluguname = this; - script->register_function(); +PluginUname::PluginUname(lua *script) { + pluguname = this; + script->register_function(); } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginUname.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginUname.h index 0d5483f85..a81ac80a2 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginUname.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginUname.h @@ -31,13 +31,12 @@ namespace LCD { class PluginUname { - public: - PluginUname(lua *script); - - std::string Uname(std::string arg1); +public: + PluginUname(lua *script); + std::string Uname(std::string arg1); }; -}; +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginUptime.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/PluginUptime.cpp index fd26923a2..f3c1146a2 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginUptime.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginUptime.cpp @@ -40,253 +40,241 @@ using namespace LCD; PluginUptime *mUptime; -static char *itoa(char *buffer, const size_t size, unsigned int value) -{ - char *p; +static char *itoa(char *buffer, const size_t size, unsigned int value) { + char *p; - /* sanity checks */ - if (buffer == NULL || size < 2) - return (NULL); + /* sanity checks */ + if (buffer == NULL || size < 2) + return (NULL); - /* p points to last char */ - p = buffer + size - 1; + /* p points to last char */ + p = buffer + size - 1; - /* set terminating zero */ - *p = '\0'; + /* set terminating zero */ + *p = '\0'; - do { - *--p = value % 10 + '0'; - value = value / 10; - } while (value != 0 && p > buffer); + do { + *--p = value % 10 + '0'; + value = value / 10; + } while (value != 0 && p > buffer); - return p; + return p; } +char *struptime(const unsigned int uptime, const char *format) { + static char string[256]; + const char *src; + char *dst; + int len, size; + + src = format; + dst = string; + len = 0; + + /* leave room for terminating zero */ + size = sizeof(string) - 1; + + while (len < size) { + + if (*src == '%') { + src++; + + if (strchr("sSmMhHd", *src) != NULL) { + char buffer[12], *s; + unsigned int value = 0; + int leading_zero = 0; + switch (*src++) { + case 's': + value = uptime; + break; + case 'S': + value = uptime % 60; + leading_zero = 1; + break; + case 'm': + value = uptime / 60; + break; + case 'M': + value = (uptime / 60) % 60; + leading_zero = 1; + break; + case 'h': + value = uptime / 60 / 60; + break; + case 'H': + value = (uptime / 60 / 60) % 24; + leading_zero = 1; + break; + case 'd': + value = uptime / 60 / 60 / 24; + break; + } -char *struptime(const unsigned int uptime, const char *format) -{ - static char string[256]; - const char *src; - char *dst; - int len, size; - - src = format; - dst = string; - len = 0; - - /* leave room for terminating zero */ - size = sizeof(string) - 1; - - while (len < size) { - - if (*src == '%') { - src++; - - if (strchr("sSmMhHd", *src) != NULL) { - char buffer[12], *s; - unsigned int value = 0; - int leading_zero = 0; - switch (*src++) { - case 's': - value = uptime; - break; - case 'S': - value = uptime % 60; - leading_zero = 1; - break; - case 'm': - value = uptime / 60; - break; - case 'M': - value = (uptime / 60) % 60; - leading_zero = 1; - break; - case 'h': - value = uptime / 60 / 60; - break; - case 'H': - value = (uptime / 60 / 60) % 24; - leading_zero = 1; - break; - case 'd': - value = uptime / 60 / 60 / 24; - break; - } - - if (leading_zero && value < 10) { - len++; - *dst++ = '0'; - } - - s = itoa(buffer, sizeof(buffer), value); - while (len < size && *s != '\0') { - len++; - *dst++ = *s++; - } - - } else if (*src == '%') { - len++; - *dst++ = '%'; - - } else { - len += 2; - *dst++ = '%'; - *dst++ = *src++; - } - - } else { - len++; - *dst++ = *src; - if (*src++ == '\0') - break; + if (leading_zero && value < 10) { + len++; + *dst++ = '0'; + } + + s = itoa(buffer, sizeof(buffer), value); + while (len < size && *s != '\0') { + len++; + *dst++ = *s++; } - } - /* enforce terminating zero */ - if (len >= size && *(dst - 1) != '\0') { + } else if (*src == '%') { len++; - *dst = '\0'; + *dst++ = '%'; + + } else { + len += 2; + *dst++ = '%'; + *dst++ = *src++; + } + + } else { + len++; + *dst++ = *src; + if (*src++ == '\0') + break; } + } - return string; -} + /* enforce terminating zero */ + if (len >= size && *(dst - 1) != '\0') { + len++; + *dst = '\0'; + } + return string; +} -double PluginUptime::GetUptime() -{ - char buffer[36]; - int i; +double PluginUptime::GetUptime() { + char buffer[36]; + int i; - if (fd == -2) - fd = open("/proc/uptime", O_RDONLY); - if (fd < 0) - return -1; + if (fd == -2) + fd = open("/proc/uptime", O_RDONLY); + if (fd < 0) + return -1; - lseek(fd, 0, SEEK_SET); + lseek(fd, 0, SEEK_SET); - i = read(fd, buffer, sizeof(buffer) - 1); - if (i < 0) - return -1; + i = read(fd, buffer, sizeof(buffer) - 1); + if (i < 0) + return -1; - buffer[i - 1] = '\0'; + buffer[i - 1] = '\0'; - /* ignore the 2nd value from /proc/uptime */ - return strtod(buffer, NULL); + /* ignore the 2nd value from /proc/uptime */ + return strtod(buffer, NULL); } - std::string PluginUptime::Uptime(std::string fmt) { - int age; - struct timeval now; - - gettimeofday(&now, NULL); - - age = (now.tv_sec - last_value.tv_sec) * 1000 + (now.tv_usec - last_value.tv_usec) / 1000; - /* reread every 100 msec only */ - if (fd == -2 || age == 0 || age > 100) { - uptime = GetUptime(); - if (uptime < 0.0) { - LCDError("parse(/proc/uptime) failed!"); - return "Error"; - } - - memcpy(&last_value, &now, sizeof(timeval)); + int age; + struct timeval now; + + gettimeofday(&now, NULL); + + age = (now.tv_sec - last_value.tv_sec) * 1000 + + (now.tv_usec - last_value.tv_usec) / 1000; + /* reread every 100 msec only */ + if (fd == -2 || age == 0 || age > 100) { + uptime = GetUptime(); + if (uptime < 0.0) { + LCDError("parse(/proc/uptime) failed!"); + return "Error"; } - char *buffer = struptime(uptime, fmt.c_str()); - std::string str = buffer; - return str; + memcpy(&last_value, &now, sizeof(timeval)); + } + + char *buffer = struptime(uptime, fmt.c_str()); + std::string str = buffer; + return str; } class uptime1_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::string_arg_t()); - return args; - } - - static const std::string ns() { return "uptime"; } - static const std::string name() { return "UptimeFmt"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - std::string fmt = dynamic_cast(*in[0]).value(); - std::string str = mUptime->Uptime(fmt); - dynamic_cast(*out[0]).value() = str; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::string_arg_t()); + return args; + } + + static const std::string ns() { return "uptime"; } + static const std::string name() { return "UptimeFmt"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + std::string fmt = dynamic_cast(*in[0]).value(); + std::string str = mUptime->Uptime(fmt); + dynamic_cast(*out[0]).value() = str; + } }; double PluginUptime::Uptime() { - int age; - struct timeval now; - - gettimeofday(&now, NULL); - - age = (now.tv_sec - last_value.tv_sec) * 1000 + (now.tv_usec - last_value.tv_usec) / 1000; - if (fd == -2 || age == 0 || age > 100) { - uptime = GetUptime(); - if (uptime < 0.0) { - LCDError("parse(/proc/uptime) failed!"); - return 0; - } - - memcpy(&last_value, &now, sizeof(timeval)); + int age; + struct timeval now; + + gettimeofday(&now, NULL); + + age = (now.tv_sec - last_value.tv_sec) * 1000 + + (now.tv_usec - last_value.tv_usec) / 1000; + if (fd == -2 || age == 0 || age > 100) { + uptime = GetUptime(); + if (uptime < 0.0) { + LCDError("parse(/proc/uptime) failed!"); + return 0; } - return uptime; + memcpy(&last_value, &now, sizeof(timeval)); + } + + return uptime; } class uptime2_t { - public: - static const lua::args_t *in_args() - { - lua::args_t *args = new lua::args_t(); - return args; - } - - static const lua::args_t *out_args() - { - lua::args_t *args = new lua::args_t(); - args->add(new lua::int_arg_t()); - return args; - } - - static const std::string ns() { return "uptime"; } - static const std::string name() { return "Uptime"; } - - static void calc(const lua::args_t& in, lua::args_t &out) - { - double val = mUptime->Uptime(); - dynamic_cast(*out[0]).value() = val; - } +public: + static const lua::args_t *in_args() { + lua::args_t *args = new lua::args_t(); + return args; + } + + static const lua::args_t *out_args() { + lua::args_t *args = new lua::args_t(); + args->add(new lua::int_arg_t()); + return args; + } + + static const std::string ns() { return "uptime"; } + static const std::string name() { return "Uptime"; } + + static void calc(const lua::args_t &in, lua::args_t &out) { + double val = mUptime->Uptime(); + dynamic_cast(*out[0]).value() = val; + } }; PluginUptime::PluginUptime() { - fd = -2; - uptime = 0; + fd = -2; + uptime = 0; } PluginUptime::PluginUptime(lua *script) { - script->register_function(); - script->register_function(); // FIXME this may be broken - uptime = 0; - fd = -2; - mUptime = this; + script->register_function(); + script->register_function(); // FIXME this may be broken + uptime = 0; + fd = -2; + mUptime = this; } PluginUptime::~PluginUptime() { - if (fd > 0) - close(fd); - fd = -2; + if (fd > 0) + close(fd); + fd = -2; } - - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/PluginUptime.h b/libvisual-plugins/plugins/actor/lcdcontrol/PluginUptime.h index e7a832a9d..2d0b7f8fb 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/PluginUptime.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/PluginUptime.h @@ -32,20 +32,20 @@ namespace LCD { class PluginUptime { - int fd; - double uptime; - struct timeval last_value; - double GetUptime(); - - public: - PluginUptime(lua *script); - PluginUptime(); - ~PluginUptime(); - - double Uptime(); - std::string Uptime(std::string format); + int fd; + double uptime; + struct timeval last_value; + double GetUptime(); + +public: + PluginUptime(lua *script); + PluginUptime(); + ~PluginUptime(); + + double Uptime(); + std::string Uptime(std::string format); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Property.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/Property.cpp index 8647772e1..8b05ebf83 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Property.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Property.cpp @@ -34,73 +34,58 @@ #include "Evaluator.h" #include "debug.h" - using namespace LCD; -Property::Property(LCDCore *v, Json::Value *section, std::string name, - Json::Value *defval) { - - visitor_ = v; - name_ = name; - is_valid = false; - expression_ = v->CFG_Fetch_Raw(section, name, defval); - if( expression_ != NULL && expression_->isString()) { - result_ = v->Eval(expression_->asCString()); - is_valid = true; - } else if (expression_ != NULL ) { - LCDError("Property: <%s> has no expression_ or is not a string field.", name.c_str()); - LCDError("%s", expression_->toStyledString().c_str()); - } +Property::Property(LCDCore *v, Json::Value *section, std::string name, + Json::Value *defval) { + + visitor_ = v; + name_ = name; + is_valid = false; + expression_ = v->CFG_Fetch_Raw(section, name, defval); + if (expression_ != NULL && expression_->isString()) { + result_ = v->Eval(expression_->asCString()); + is_valid = true; + } else if (expression_ != NULL) { + LCDError("Property: <%s> has no expression_ or is not a string field.", + name.c_str()); + LCDError("%s", expression_->toStyledString().c_str()); + } } Property::Property(const Property &prop) { - is_valid = prop.is_valid; - result_ = prop.result_; - expression_ = prop.expression_; + is_valid = prop.is_valid; + result_ = prop.result_; + expression_ = prop.expression_; } -Property::~Property() { - delete expression_; -} +Property::~Property() { delete expression_; } -bool Property::Valid() { - return is_valid; -} +bool Property::Valid() { return is_valid; } int Property::Eval() { - if(!is_valid) - return -1; - - int update = 1; - - std::string old; + if (!is_valid) + return -1; - result_ = visitor_->Eval(expression_->asCString()); + int update = 1; - if(old == result_ ) { - update = 0; - } + std::string old; - return update; -} + result_ = visitor_->Eval(expression_->asCString()); -double Property::P2N() { - return strtod(result_.c_str(), NULL); -} + if (old == result_) { + update = 0; + } -int Property::P2INT() { - return P2N(); + return update; } -std::string Property::P2S() { - return result_; -} +double Property::P2N() { return strtod(result_.c_str(), NULL); } +int Property::P2INT() { return P2N(); } -void Property::SetValue(Json::Value val) { +std::string Property::P2S() { return result_; } -} +void Property::SetValue(Json::Value val) {} -Property Property::operator=(Property prop) { - return Property(prop); -} +Property Property::operator=(Property prop) { return Property(prop); } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Property.h b/libvisual-plugins/plugins/actor/lcdcontrol/Property.h index e583e8b23..db94897aa 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Property.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Property.h @@ -37,26 +37,26 @@ class LCDText; class LCDGraphic; class Property { - bool is_valid; - LCDCore *visitor_; - Json::Value *expression_; - std::string name_; - std::string result_; - - public: - Property(const Property &prop); - Property(LCDCore *visitor, Json::Value *section, std::string name, - Json::Value *defval); - ~Property(); - bool Valid(); - int Eval(); - double P2N(); - int P2INT(); - std::string P2S(); - void SetValue(Json::Value val); - Property operator=(Property prop); + bool is_valid; + LCDCore *visitor_; + Json::Value *expression_; + std::string name_; + std::string result_; + +public: + Property(const Property &prop); + Property(LCDCore *visitor, Json::Value *section, std::string name, + Json::Value *defval); + ~Property(); + bool Valid(); + int Eval(); + double P2N(); + int P2INT(); + std::string P2S(); + void SetValue(Json::Value val); + Property operator=(Property prop); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/RGBA.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/RGBA.cpp index fbb501fd3..b445039fe 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/RGBA.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/RGBA.cpp @@ -26,33 +26,31 @@ #include "RGBA.h" -int LCD::color2RGBA(const char *color, RGBA * C) -{ - char *e; - unsigned long l; +int LCD::color2RGBA(const char *color, RGBA *C) { + char *e; + unsigned long l; - if (color == NULL || *color == '\0') { - return -1; - } + if (color == NULL || *color == '\0') { + return -1; + } - l = strtoul(color, &e, 16); - if (e != NULL && *e != '\0') { - return -1; - } + l = strtoul(color, &e, 16); + if (e != NULL && *e != '\0') { + return -1; + } - if (strlen(color) == 8) { - /* RGBA */ - C->A = (l >> 24) & 0xff; - C->R = (l >> 16) & 0xff; - C->G = (l >> 8) & 0xff; - C->B = (l >> 0) & 0xff; - } else { - /* RGB */ - C->A = 0xff; - C->R = (l >> 16) & 0xff; - C->G = (l >> 8) & 0xff; - C->B = l & 0xff; - } - return 0; + if (strlen(color) == 8) { + /* RGBA */ + C->A = (l >> 24) & 0xff; + C->R = (l >> 16) & 0xff; + C->G = (l >> 8) & 0xff; + C->B = (l >> 0) & 0xff; + } else { + /* RGB */ + C->A = 0xff; + C->R = (l >> 16) & 0xff; + C->G = (l >> 8) & 0xff; + C->B = l & 0xff; + } + return 0; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/RGBA.h b/libvisual-plugins/plugins/actor/lcdcontrol/RGBA.h index 052430cd3..07426a891 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/RGBA.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/RGBA.h @@ -36,44 +36,41 @@ typedef struct { } RGBA; */ class RGBA { - public: - VisColor rgb; - RGBA() : rgb(0, 0, 0, 255) {} - RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 255) : - rgb(r, g, b, a){ - R = r; G = g; B = b; A = a; - } - RGBA(int val) { - - visual_color_set_from_uint32(&rgb, val); - R = rgb.r; - G = rgb.g; - B = rgb.b; - A = rgb.a; - } - uint32_t ToInt() - { - return visual_color_to_uint32(&rgb); - } - VisColor *ToColor() - { - return &rgb; - } - unsigned char R; - unsigned char G; - unsigned char B; - unsigned char A; +public: + VisColor rgb; + RGBA() : rgb(0, 0, 0, 255) {} + RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 255) + : rgb(r, g, b, a) { + R = r; + G = g; + B = b; + A = a; + } + RGBA(int val) { + + visual_color_set_from_uint32(&rgb, val); + R = rgb.r; + G = rgb.g; + B = rgb.b; + A = rgb.a; + } + uint32_t ToInt() { return visual_color_to_uint32(&rgb); } + VisColor *ToColor() { return &rgb; } + unsigned char R; + unsigned char G; + unsigned char B; + unsigned char A; - bool operator==(const RGBA &rhv) const { - return R == rhv.R && G == rhv.G && B == rhv.B && A == rhv.A; - } - bool operator!=(const RGBA &rhv) const { - return R != rhv.R || G != rhv.G || B != rhv.B || A != rhv.A; - } + bool operator==(const RGBA &rhv) const { + return R == rhv.R && G == rhv.G && B == rhv.B && A == rhv.A; + } + bool operator!=(const RGBA &rhv) const { + return R != rhv.R || G != rhv.G || B != rhv.B || A != rhv.A; + } }; -int color2RGBA(const char *color, RGBA * C); +int color2RGBA(const char *color, RGBA *C); -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/SpecialChar.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/SpecialChar.cpp index 6be341b7a..f434b69d0 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/SpecialChar.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/SpecialChar.cpp @@ -25,80 +25,77 @@ using namespace LCD; SpecialChar::SpecialChar(int *ch, int size) { - for(int i = 0; i < size; i++) { - chars_[i] = ch[i]; - } - size_ = size; + for (int i = 0; i < size; i++) { + chars_[i] = ch[i]; + } + size_ = size; } SpecialChar::SpecialChar(int size) { - for(int i = 0; i < size; i++) { - chars_[i] = 0; - } - size_ = size; + for (int i = 0; i < size; i++) { + chars_[i] = 0; + } + size_ = size; } -SpecialChar::SpecialChar() { - size_ = 0; -} +SpecialChar::SpecialChar() { size_ = 0; } int &SpecialChar::operator[](int i) { - if(i >= size_) { - LCDError("SpecialChar: index out of range <%d,%d>", i, size_); - return chars_[0]; - } - return chars_[i]; + if (i >= size_) { + LCDError("SpecialChar: index out of range <%d,%d>", i, size_); + return chars_[0]; + } + return chars_[i]; } bool SpecialChar::operator==(const SpecialChar &rhv) const { - if( size_ != rhv.Size() ) - return false; - return chars_ != rhv.Chars(); + if (size_ != rhv.Size()) + return false; + return chars_ != rhv.Chars(); } bool SpecialChar::operator!=(const SpecialChar &rhv) const { - return !(*this == rhv); + return !(*this == rhv); } SpecialChar &SpecialChar::operator=(const SpecialChar &rhv) { - if(this == &rhv) - return *this; + if (this == &rhv) + return *this; - size_ = rhv.Size(); - chars_ = rhv.Chars(); + size_ = rhv.Size(); + chars_ = rhv.Chars(); - return *this; + return *this; } -void SpecialChar::AddChar(int ch) { - chars_[size_++] = ch; -} +void SpecialChar::AddChar(int ch) { chars_[size_++] = ch; } // Programmer must insure data is allocated void SpecialChar::Data(int *data) { - for(unsigned int i = 0; i < chars_.size(); i++ ) { - data[i] = chars_[i]; - } - size_ = chars_.size(); + for (unsigned int i = 0; i < chars_.size(); i++) { + data[i] = chars_[i]; + } + size_ = chars_.size(); } std::vector SpecialChar::Vector() const { - std::vector data; - std::map chars = chars_; - for(unsigned int i = 0; i < chars.size(); i++ ) { - data.push_back(chars[i]); - } - return data; + std::vector data; + std::map chars = chars_; + for (unsigned int i = 0; i < chars.size(); i++) { + data.push_back(chars[i]); + } + return data; } bool SpecialChar::Compare(SpecialChar other) { - bool flag = true; - if(Size() != other.Size()) flag = false; - else { - for(int i = 0; i < Size(); i++) { - if(other[i] != chars_[i]) - flag = false; - } + bool flag = true; + if (Size() != other.Size()) + flag = false; + else { + for (int i = 0; i < Size(); i++) { + if (other[i] != chars_[i]) + flag = false; } - return flag; + } + return flag; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/SpecialChar.h b/libvisual-plugins/plugins/actor/lcdcontrol/SpecialChar.h index 9a30f1209..25f85be8e 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/SpecialChar.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/SpecialChar.h @@ -28,25 +28,25 @@ namespace LCD { class SpecialChar { - std::map chars_; - int size_; + std::map chars_; + int size_; - public: - SpecialChar(); - SpecialChar(int *ch, int size); - SpecialChar(int size); - int Size() const { return size_; }; - std::map Chars() const { return chars_; }; - void AddChar(int ch); - void Data(int *data); - std::vector Vector() const; - bool Compare(SpecialChar other); - int &operator[](int i); - bool operator==(const SpecialChar &ch) const; - bool operator!=(const SpecialChar &ch) const; - SpecialChar &operator=(const SpecialChar &rhv); +public: + SpecialChar(); + SpecialChar(int *ch, int size); + SpecialChar(int size); + int Size() const { return size_; }; + std::map Chars() const { return chars_; }; + void AddChar(int ch); + void Data(int *data); + std::vector Vector() const; + bool Compare(SpecialChar other); + int &operator[](int i); + bool operator==(const SpecialChar &ch) const; + bool operator!=(const SpecialChar &ch) const; + SpecialChar &operator=(const SpecialChar &rhv); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Stats.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/Stats.cpp index f22fefb63..f11e1b2d8 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Stats.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Stats.cpp @@ -30,90 +30,82 @@ using namespace LCD; /* Return current time in milliseconds */ -double now_ms(void) -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec*1000. + tv.tv_usec/1000.; +double now_ms(void) { + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec * 1000. + tv.tv_usec / 1000.; } - -void -stats_init( Stats* s ) -{ - s->lastTime = now_ms(); - s->firstTime = 0.; - s->firstFrame = 0; - s->numFrames = 0; -} - -void -stats_startFrame( Stats* s ) -{ - s->frameTime = now_ms(); +void stats_init(Stats *s) { + s->lastTime = now_ms(); + s->firstTime = 0.; + s->firstFrame = 0; + s->numFrames = 0; } -void -stats_endFrame( Stats* s ) -{ - double now = now_ms(); - double renderTime = now - s->frameTime; - double frameTime = now - s->lastTime; - int nn; - - if (now - s->firstTime >= MAX_PERIOD_MS) { - if (s->numFrames > 0) { - double minRender = 0, maxRender = 0, avgRender = 0; - double minFrame = 0, maxFrame = 0, avgFrame = 0; - int count; - - nn = s->firstFrame; - minRender = maxRender = avgRender = s->frames[nn].renderTime; - minFrame = maxFrame = avgFrame = s->frames[nn].frameTime; - for (count = s->numFrames; count > 0; count-- ) { - nn += 1; - if (nn >= MAX_FRAME_STATS) - nn -= MAX_FRAME_STATS; - double render = s->frames[nn].renderTime; - if (render < minRender) minRender = render; - if (render > maxRender) maxRender = render; - double frame = s->frames[nn].frameTime; - if (frame < minFrame) minFrame = frame; - if (frame > maxFrame) maxFrame = frame; - avgRender += render; - avgFrame += frame; - } - avgRender /= s->numFrames; - avgFrame /= s->numFrames; - - s->avgFrame = avgFrame; - s->maxFrame = maxFrame; - s->minFrame = minFrame; - s->avgRender = avgRender; - s->minRender = minRender; - s->maxRender = maxRender; - - } - s->numFrames = 0; - s->firstFrame = 0; - s->firstTime = now; +void stats_startFrame(Stats *s) { s->frameTime = now_ms(); } + +void stats_endFrame(Stats *s) { + double now = now_ms(); + double renderTime = now - s->frameTime; + double frameTime = now - s->lastTime; + int nn; + + if (now - s->firstTime >= MAX_PERIOD_MS) { + if (s->numFrames > 0) { + double minRender = 0, maxRender = 0, avgRender = 0; + double minFrame = 0, maxFrame = 0, avgFrame = 0; + int count; + + nn = s->firstFrame; + minRender = maxRender = avgRender = s->frames[nn].renderTime; + minFrame = maxFrame = avgFrame = s->frames[nn].frameTime; + for (count = s->numFrames; count > 0; count--) { + nn += 1; + if (nn >= MAX_FRAME_STATS) + nn -= MAX_FRAME_STATS; + double render = s->frames[nn].renderTime; + if (render < minRender) + minRender = render; + if (render > maxRender) + maxRender = render; + double frame = s->frames[nn].frameTime; + if (frame < minFrame) + minFrame = frame; + if (frame > maxFrame) + maxFrame = frame; + avgRender += render; + avgFrame += frame; + } + avgRender /= s->numFrames; + avgFrame /= s->numFrames; + + s->avgFrame = avgFrame; + s->maxFrame = maxFrame; + s->minFrame = minFrame; + s->avgRender = avgRender; + s->minRender = minRender; + s->maxRender = maxRender; } + s->numFrames = 0; + s->firstFrame = 0; + s->firstTime = now; + } - nn = s->firstFrame + s->numFrames; - if (nn >= MAX_FRAME_STATS) - nn -= MAX_FRAME_STATS; + nn = s->firstFrame + s->numFrames; + if (nn >= MAX_FRAME_STATS) + nn -= MAX_FRAME_STATS; - s->frames[nn].renderTime = renderTime; - s->frames[nn].frameTime = frameTime; + s->frames[nn].renderTime = renderTime; + s->frames[nn].frameTime = frameTime; - if (s->numFrames < MAX_FRAME_STATS) { - s->numFrames += 1; - } else { - s->firstFrame += 1; - if (s->firstFrame >= MAX_FRAME_STATS) - s->firstFrame -= MAX_FRAME_STATS; - } + if (s->numFrames < MAX_FRAME_STATS) { + s->numFrames += 1; + } else { + s->firstFrame += 1; + if (s->firstFrame >= MAX_FRAME_STATS) + s->firstFrame -= MAX_FRAME_STATS; + } - s->lastTime = now; + s->lastTime = now; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Stats.h b/libvisual-plugins/plugins/actor/lcdcontrol/Stats.h index f67755d9e..bd67a5cc7 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Stats.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Stats.h @@ -4,28 +4,28 @@ /* simple stats management */ typedef struct { - double renderTime; - double frameTime; + double renderTime; + double frameTime; } FrameStats; -#define MAX_FRAME_STATS 200 -#define MAX_PERIOD_MS 1500 +#define MAX_FRAME_STATS 200 +#define MAX_PERIOD_MS 1500 typedef struct { - double firstTime; - double lastTime; - double frameTime; + double firstTime; + double lastTime; + double frameTime; - int firstFrame; - int numFrames; - FrameStats frames[ MAX_FRAME_STATS ]; - double avgFrame, maxFrame, minFrame, avgRender, minRender, maxRender; + int firstFrame; + int numFrames; + FrameStats frames[MAX_FRAME_STATS]; + double avgFrame, maxFrame, minFrame, avgRender, minRender, maxRender; } Stats; double now_ms(void); -void stats_init( Stats* s ); -void stats_startFrame( Stats* s ); -void stats_endFrame( Stats* s ); +void stats_init(Stats *s); +void stats_startFrame(Stats *s); +void stats_endFrame(Stats *s); #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Widget.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/Widget.cpp index 89ce133ac..ce5af5cf1 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Widget.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Widget.cpp @@ -1,4 +1,6 @@ -/* TODO: Chain child widgets, to call the next widget's start method in the parent's stop function. Start draws immediately, so that should draw over the previous widget -- the parent -- for sure. No bugs allowed. +/* TODO: Chain child widgets, to call the next widget's start method in the + * parent's stop function. Start draws immediately, so that should draw over the + * previous widget -- the parent -- for sure. No bugs allowed. */ /* $Id$ * $URL$ @@ -32,60 +34,60 @@ using namespace LCD; -Widget::Widget(LCDCore *visitor, std::string name, Json::Value *config, - int row, int col, - int layer, int type ) { - - visitor_ = visitor; +Widget::Widget(LCDCore *visitor, std::string name, Json::Value *config, int row, + int col, int layer, int type) { - lcd_type_ = visitor->GetType(); - if(name.empty()) - return; - int pos1 = name.find(":"); - int pos2 = name.rfind(":"); - name_ = name; - section_ = config; - if(row >= visitor->GetLCD()->LROWS) row_ = visitor->GetLCD()->LROWS - 1; - else row_ = row; - if(col >= visitor->GetLCD()->LCOLS) col_ = visitor->GetLCD()->LCOLS - 1; - else col_ = col; - layer_ = layer; - type_ = type; - if(pos1 < 0 || pos2 < 0) - return; - layout_base_ = name.substr(0, pos1); - widget_base_ = name.substr(pos1 + 1, pos2-pos1-1); - started_ = false; -} + visitor_ = visitor; -Widget::~Widget() { - delete section_; + lcd_type_ = visitor->GetType(); + if (name.empty()) + return; + int pos1 = name.find(":"); + int pos2 = name.rfind(":"); + name_ = name; + section_ = config; + if (row >= visitor->GetLCD()->LROWS) + row_ = visitor->GetLCD()->LROWS - 1; + else + row_ = row; + if (col >= visitor->GetLCD()->LCOLS) + col_ = visitor->GetLCD()->LCOLS - 1; + else + col_ = col; + layer_ = layer; + type_ = type; + if (pos1 < 0 || pos2 < 0) + return; + layout_base_ = name.substr(0, pos1); + widget_base_ = name.substr(pos1 + 1, pos2 - pos1 - 1); + started_ = false; } - + +Widget::~Widget() { delete section_; } + int Widget::WidgetColor(Json::Value *section, std::string key, RGBA *C) { - C->R = 0; - C->G = 0; - C->B = 0; - C->A = 0; + C->R = 0; + C->G = 0; + C->B = 0; + C->A = 0; - Json::Value *val = NULL; - - val = visitor_->CFG_Fetch_Raw(section, key); + Json::Value *val = NULL; - if (val == NULL) - return 0; + val = visitor_->CFG_Fetch_Raw(section, key); - if (color2RGBA(val->asCString(), C) < 0) { - LCDError("widget '%s': ignoring illegal %s color '%s'", - name_.c_str(), key.c_str(), val->asCString()); - return 0; - } + if (val == NULL) + return 0; - delete val; - return 1; -} + if (color2RGBA(val->asCString(), C) < 0) { + LCDError("widget '%s': ignoring illegal %s color '%s'", name_.c_str(), + key.c_str(), val->asCString()); + return 0; + } + delete val; + return 1; +} void Widget::SetupChars() {} void Widget::Start() {} diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/Widget.h b/libvisual-plugins/plugins/actor/lcdcontrol/Widget.h index 99484ee75..9d9c63754 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/Widget.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/Widget.h @@ -30,7 +30,12 @@ namespace LCD { -typedef enum { DIR_EAST = 1, DIR_WEST = 2, DIR_NORTH = 4, DIR_SOUTH = 8 } DIRECTION; +typedef enum { + DIR_EAST = 1, + DIR_WEST = 2, + DIR_NORTH = 4, + DIR_SOUTH = 8 +} DIRECTION; class LCDText; class LCDGraphic; @@ -38,73 +43,72 @@ class LCDGraphic; class LCDCore; class Widget { - //Q_OBJECT - - protected: - LCDCore *visitor_; - Json::Value *section_; - std::string name_; - bool started_; - int type_; - int lcd_type_; - int layer_; - int col_; - int row_; - int cols_; - int rows_; - int x2_; - int y2_; - RGBA fg_color_; - RGBA bg_color_; - bool fg_valid_; - bool bg_valid_; - std::string widget_base_; - std::string layout_base_; - - public: - Widget(LCDCore *visitor, std::string name, Json::Value *config, - int row, int col, - int layer, int type); - virtual ~Widget(); - virtual void Start(); - virtual void Stop(); - virtual void SetupChars(); - LCDCore *GetVisitor() { return visitor_; }; - bool GetStarted() const { return started_; } - int GetRow() const { return row_; } - int GetCol() const { return col_; } - int GetCols() { return cols_; } - int GetRows() { return rows_; } - int GetType() const { return type_; } - std::string GetName() const { return name_; } - std::string GetWidgetBase() const { return widget_base_; } - std::string GetLayoutBase() const { return layout_base_; } - int GetLayer() const { return layer_; } - RGBA GetFGColor() const { return fg_color_; } - RGBA GetBGColor() const { return bg_color_; } - bool GetFGValid() const { return fg_valid_; } - bool GetBGValid() const { return bg_valid_; } - int WidgetColor(Json::Value *section, std::string name, RGBA *color); + // Q_OBJECT - virtual void Update() = 0; - virtual void TextScroll() = 0; +protected: + LCDCore *visitor_; + Json::Value *section_; + std::string name_; + bool started_; + int type_; + int lcd_type_; + int layer_; + int col_; + int row_; + int cols_; + int rows_; + int x2_; + int y2_; + RGBA fg_color_; + RGBA bg_color_; + bool fg_valid_; + bool bg_valid_; + std::string widget_base_; + std::string layout_base_; + +public: + Widget(LCDCore *visitor, std::string name, Json::Value *config, int row, + int col, int layer, int type); + virtual ~Widget(); + virtual void Start(); + virtual void Stop(); + virtual void SetupChars(); + LCDCore *GetVisitor() { return visitor_; }; + bool GetStarted() const { return started_; } + int GetRow() const { return row_; } + int GetCol() const { return col_; } + int GetCols() { return cols_; } + int GetRows() { return rows_; } + int GetType() const { return type_; } + std::string GetName() const { return name_; } + std::string GetWidgetBase() const { return widget_base_; } + std::string GetLayoutBase() const { return layout_base_; } + int GetLayer() const { return layer_; } + RGBA GetFGColor() const { return fg_color_; } + RGBA GetBGColor() const { return bg_color_; } + bool GetFGValid() const { return fg_valid_; } + bool GetBGValid() const { return bg_valid_; } + int WidgetColor(Json::Value *section, std::string name, RGBA *color); + + virtual void Update() = 0; + virtual void TextScroll() = 0; }; -}; // End namespace +}; // namespace LCD -#define WIDGET_TYPE_RC (1<<0) -#define WIDGET_TYPE_XY (1<<1) -#define WIDGET_TYPE_GPO (1<<2) -#define WIDGET_TYPE_TIMER (1<<3) -#define WIDGET_TYPE_KEYPAD (1<<4) -#define WIDGET_TYPE_TEXT (1<<5) -#define WIDGET_TYPE_BAR (1<<6) -#define WIDGET_TYPE_ICON (1<<7) -#define WIDGET_TYPE_HISTOGRAM (1<<8) -#define WIDGET_TYPE_BIGNUMS (1<<9) -#define WIDGET_TYPE_GIF (1<<10) -#define WIDGET_TYPE_VISUALIZATION (1<<11) -#define WIDGET_TYPE_NIFTY (1<<12) -#define WIDGET_TYPE_SPECIAL (1<<13) +#define WIDGET_TYPE_RC (1 << 0) +#define WIDGET_TYPE_XY (1 << 1) +#define WIDGET_TYPE_GPO (1 << 2) +#define WIDGET_TYPE_TIMER (1 << 3) +#define WIDGET_TYPE_KEYPAD (1 << 4) +#define WIDGET_TYPE_TEXT (1 << 5) +#define WIDGET_TYPE_BAR (1 << 6) +#define WIDGET_TYPE_ICON (1 << 7) +#define WIDGET_TYPE_HISTOGRAM (1 << 8) +#define WIDGET_TYPE_BIGNUMS (1 << 9) +#define WIDGET_TYPE_GIF (1 << 10) +#define WIDGET_TYPE_VISUALIZATION (1 << 11) +#define WIDGET_TYPE_NIFTY (1 << 12) +#define WIDGET_TYPE_SPECIAL (1 << 13) #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBar.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBar.cpp index 4f184e0bb..930abecfc 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBar.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBar.cpp @@ -28,268 +28,267 @@ using namespace LCD; int SCHARS[][9] = { - {31, 31, 31, 31, 31, 31, 31, 31, -1}, - {31, 16, 16, 16, 16, 16, 16, 31, -1}, - {31, 0, 0, 0, 0, 0, 0, 31, -1}, - {31, 1, 1, 1, 1, 1, 1, 31, -1}, - {31, 31, 31, 31, 0, 0, 0, 0, -1}, - { 0, 0, 0, 0, 31, 31, 31, 31, -1}}; + {31, 31, 31, 31, 31, 31, 31, 31, -1}, {31, 16, 16, 16, 16, 16, 16, 31, -1}, + {31, 0, 0, 0, 0, 0, 0, 31, -1}, {31, 1, 1, 1, 1, 1, 1, 31, -1}, + {31, 31, 31, 31, 0, 0, 0, 0, -1}, {0, 0, 0, 0, 31, 31, 31, 31, -1}}; extern void TextBarDraw(WidgetBar *w); extern void GraphicBarDraw(WidgetBar *w); -void bar_update(void *data) -{ - WidgetBar *widget = (WidgetBar *)data; - widget->Update(); +void bar_update(void *data) { + WidgetBar *widget = (WidgetBar *)data; + widget->Update(); } -WidgetBar::WidgetBar(LCDCore *v, std::string n, Json::Value *section, - int row, int col, int layer) : Widget(v, n, section, row, col, layer, - WIDGET_TYPE_BAR | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { - - lcd_type_ = v->GetType(); - - if(lcd_type_ == LCD_TEXT) - Draw = TextBarDraw; - else if(lcd_type_ == LCD_GRAPHIC) - Draw = GraphicBarDraw; - else - Draw = NULL; - - expression_ = new Property(v, section, "expression", new Json::Value("0")); - expression2_ = new Property(v, section, "expression2", NULL); - expr_min_ = new Property(v, section, "min", NULL); - expr_max_ = new Property(v, section, "max", NULL); - - color_valid_[0] = WidgetColor(section, "barcolor0", &color_[0]); - color_valid_[1] = WidgetColor(section, "barcolor1", &color_[1]); - - fg_valid_ = WidgetColor(section, "foreground", &fg_color_); - bg_valid_ = WidgetColor(section, "background", &bg_color_); - - Json::Value *val = v->CFG_Fetch(section, "length", new Json::Value(10)); - cols_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section, "height", new Json::Value(1)); - rows_ = val->asInt(); - delete val; - - //LCDError("1 cols %d, rows %d", cols_, rows_); - int diff = (col_ + cols_) - v->GetLCD()->LCOLS; - if(diff > 0) cols_ -= diff; - - diff = (row_ + rows_) - v->GetLCD()->LROWS; - if(diff > 0) rows_ -= diff; - - //LCDError("2 cols %d, rows %d", cols_, rows_); - val = v->CFG_Fetch_Raw(section, "direction", new Json::Value("E")); - if( val->asString() == "E" ) { - direction_ = DIR_EAST; - } else if ( val->asString() == "W" ) { - direction_ = DIR_WEST; - } else { - LCDError("Widget %s has unknown direction '%s'; Use (E)ast or (W)est. Using (E).", - name_.c_str(), val->asCString()); - direction_ = DIR_EAST; - } - delete val; - - val = v->CFG_Fetch(section, "update", new Json::Value(1000)); - update_ = val->asInt(); - delete val; - - val = v->CFG_Fetch_Raw(section, "style", new Json::Value("N")); - - if( val->asString() == "H" ) { - style_ = STYLE_HOLLOW; - } else if (val->asString() == "N") { - style_ = STYLE_NORMAL; - } else { - LCDError("Widget %s has unknown style '%s'; known styles are 'N' or 'H'; using 'N'.", - name_.c_str(), val->asCString()); - style_ = STYLE_NORMAL; - } - - val1_ = val2_ = 0.0; - min_ = max_ = 0.0; - - timer_ = v->timers_->AddTimer(bar_update, this, update_, true); -/* - timer_ = new QTimer(); - timer_->setSingleShot(false); - timer_->setInterval(update_); - QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); - - QObject::connect(visitor_->GetWrapper(), SIGNAL(_ResizeLCD(int, int, int, int)), - this, SLOT(Resize(int, int, int, int))); -*/ +WidgetBar::WidgetBar(LCDCore *v, std::string n, Json::Value *section, int row, + int col, int layer) + : Widget(v, n, section, row, col, layer, + WIDGET_TYPE_BAR | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { + + lcd_type_ = v->GetType(); + + if (lcd_type_ == LCD_TEXT) + Draw = TextBarDraw; + else if (lcd_type_ == LCD_GRAPHIC) + Draw = GraphicBarDraw; + else + Draw = NULL; + + expression_ = new Property(v, section, "expression", new Json::Value("0")); + expression2_ = new Property(v, section, "expression2", NULL); + expr_min_ = new Property(v, section, "min", NULL); + expr_max_ = new Property(v, section, "max", NULL); + + color_valid_[0] = WidgetColor(section, "barcolor0", &color_[0]); + color_valid_[1] = WidgetColor(section, "barcolor1", &color_[1]); + + fg_valid_ = WidgetColor(section, "foreground", &fg_color_); + bg_valid_ = WidgetColor(section, "background", &bg_color_); + + Json::Value *val = v->CFG_Fetch(section, "length", new Json::Value(10)); + cols_ = val->asInt(); + delete val; + + val = v->CFG_Fetch(section, "height", new Json::Value(1)); + rows_ = val->asInt(); + delete val; + + // LCDError("1 cols %d, rows %d", cols_, rows_); + int diff = (col_ + cols_) - v->GetLCD()->LCOLS; + if (diff > 0) + cols_ -= diff; + + diff = (row_ + rows_) - v->GetLCD()->LROWS; + if (diff > 0) + rows_ -= diff; + + // LCDError("2 cols %d, rows %d", cols_, rows_); + val = v->CFG_Fetch_Raw(section, "direction", new Json::Value("E")); + if (val->asString() == "E") { + direction_ = DIR_EAST; + } else if (val->asString() == "W") { + direction_ = DIR_WEST; + } else { + LCDError("Widget %s has unknown direction '%s'; Use (E)ast or (W)est. " + "Using (E).", + name_.c_str(), val->asCString()); + direction_ = DIR_EAST; + } + delete val; + + val = v->CFG_Fetch(section, "update", new Json::Value(1000)); + update_ = val->asInt(); + delete val; + + val = v->CFG_Fetch_Raw(section, "style", new Json::Value("N")); + + if (val->asString() == "H") { + style_ = STYLE_HOLLOW; + } else if (val->asString() == "N") { + style_ = STYLE_NORMAL; + } else { + LCDError("Widget %s has unknown style '%s'; known styles are 'N' or 'H'; " + "using 'N'.", + name_.c_str(), val->asCString()); + style_ = STYLE_NORMAL; + } + + val1_ = val2_ = 0.0; + min_ = max_ = 0.0; + + timer_ = v->timers_->AddTimer(bar_update, this, update_, true); + /* + timer_ = new QTimer(); + timer_->setSingleShot(false); + timer_->setInterval(update_); + QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); + + QObject::connect(visitor_->GetWrapper(), SIGNAL(_ResizeLCD(int, int, int, + int)), this, SLOT(Resize(int, int, int, int))); + */ } WidgetBar::~WidgetBar() { - Stop(); - //delete timer_; - delete expression_; - delete expression2_; - delete expr_min_; - delete expr_max_; + Stop(); + // delete timer_; + delete expression_; + delete expression2_; + delete expr_min_; + delete expr_max_; } void WidgetBar::Resize(int rows, int cols, int old_rows, int old_cols) { - int xres = visitor_->GetLCD()->XRES; - int yres = visitor_->GetLCD()->YRES; - float y = rows_ * yres / (float)old_rows; - float x = cols_ * xres / (float)old_cols; - float r = row_ * yres / (float)old_rows; - float c = col_ * xres / (float)old_cols; - rows_ = (int)((visitor_->GetLCD()->LROWS * y / yres) + 0.5); - cols_ = (int)((visitor_->GetLCD()->LCOLS * x / xres) + 0.5); - row_ = (int)((visitor_->GetLCD()->LROWS * r / yres) + 0.5); - col_ = (int)((visitor_->GetLCD()->LCOLS * c / xres) + 0.5); - Update(); + int xres = visitor_->GetLCD()->XRES; + int yres = visitor_->GetLCD()->YRES; + float y = rows_ * yres / (float)old_rows; + float x = cols_ * xres / (float)old_cols; + float r = row_ * yres / (float)old_rows; + float c = col_ * xres / (float)old_cols; + rows_ = (int)((visitor_->GetLCD()->LROWS * y / yres) + 0.5); + cols_ = (int)((visitor_->GetLCD()->LCOLS * x / xres) + 0.5); + row_ = (int)((visitor_->GetLCD()->LROWS * r / yres) + 0.5); + col_ = (int)((visitor_->GetLCD()->LCOLS * c / xres) + 0.5); + Update(); } void WidgetBar::SetupChars() { - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - ch_.clear(); - if( style_ == STYLE_HOLLOW and not expression2_->Valid()) { - for( int i = 0; i < 4; i++ ) { - for( int j = 0; j < (int)lcd->special_chars.size(); j++ ) { - SpecialChar c(SCHARS[i], 8); - if( lcd->special_chars[j] == c ) { - ch_[i] = j; - } - } - - } - for(int i = 0; i < 6; i++ ) { - std::map::iterator it = ch_.find(i); - if(it != ch_.end()) { - if((int)lcd->special_chars.size() >= lcd->CHARS ) { - LCDError("Can not allot char for widget: %s",name_.c_str()); - update_ = -1; - return; - } - lcd->special_chars.push_back(SpecialChar(SCHARS[i], 8)); - ch_[i] = lcd->special_chars.size() - 1; - lcd->TextSpecialCharChanged(ch_[i]); - } - } - } else if (style_ == STYLE_NORMAL ) { - for(unsigned int j = 0; j < lcd->special_chars.size(); j++ ) { - if( lcd->special_chars[j] == SpecialChar(SCHARS[0], 8)) { - ch_[0] = j; - } - if( lcd->special_chars[j] == SpecialChar(SCHARS[4], 8)) { - ch_[1] = j; - } - if( lcd->special_chars[j] == SpecialChar(SCHARS[5], 8)) { - ch_[2] = j; - } + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + ch_.clear(); + if (style_ == STYLE_HOLLOW and not expression2_->Valid()) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < (int)lcd->special_chars.size(); j++) { + SpecialChar c(SCHARS[i], 8); + if (lcd->special_chars[j] == c) { + ch_[i] = j; } - std::map::iterator it; - - it = ch_.find(0); - if(it == ch_.end()) { - if((int)lcd->special_chars.size() >= lcd->CHARS ) { - LCDError("Can not allot char for bar widget: %s",name_.c_str()); - update_ = -1; - return; - } - lcd->special_chars.push_back(SpecialChar(SCHARS[0], 8)); - ch_[0] = lcd->special_chars.size() - 1; - lcd->TextSpecialCharChanged(ch_[0]); - } - - it = ch_.find(1); - if(it == ch_.end() && expression2_->Valid()) { - if( (int)lcd->special_chars.size() >= lcd->CHARS ) { - LCDError("Can not allot char for bar widget: %s",name_.c_str()); - update_ = -1; - return; - } - lcd->special_chars.push_back(SpecialChar(SCHARS[4], 8)); - ch_[1] = lcd->special_chars.size() - 1; - lcd->TextSpecialCharChanged(ch_[1]); - } - - it = ch_.find(2); - if(it == ch_.end() && expression2_->Valid()) { - if( (int)lcd->special_chars.size() >= lcd->CHARS ) { - LCDError("Can not allot char for bar widget: %s",name_.c_str()); - update_ = -1; - return; - } - lcd->special_chars.push_back(SpecialChar(SCHARS[5], 8)); - ch_[2] = lcd->special_chars.size() - 1; - lcd->TextSpecialCharChanged(ch_[2]); + } + } + for (int i = 0; i < 6; i++) { + std::map::iterator it = ch_.find(i); + if (it != ch_.end()) { + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("Can not allot char for widget: %s", name_.c_str()); + update_ = -1; + return; } - - } else { - LCDError("%s: Either choose style (H)ollow or have a 2nd expression.", - widget_base_.c_str()); + lcd->special_chars.push_back(SpecialChar(SCHARS[i], 8)); + ch_[i] = lcd->special_chars.size() - 1; + lcd->TextSpecialCharChanged(ch_[i]); + } } -} + } else if (style_ == STYLE_NORMAL) { + for (unsigned int j = 0; j < lcd->special_chars.size(); j++) { + if (lcd->special_chars[j] == SpecialChar(SCHARS[0], 8)) { + ch_[0] = j; + } + if (lcd->special_chars[j] == SpecialChar(SCHARS[4], 8)) { + ch_[1] = j; + } + if (lcd->special_chars[j] == SpecialChar(SCHARS[5], 8)) { + ch_[2] = j; + } + } + std::map::iterator it; -void WidgetBar::Start() { - if( update_ < 0 ) + it = ch_.find(0); + if (it == ch_.end()) { + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("Can not allot char for bar widget: %s", name_.c_str()); + update_ = -1; return; - //timer_->start(); - Update(); -} - -void WidgetBar::Stop() { - ch_.clear(); - //timer_->stop(); -} - -void WidgetBar::Update() { - expression_->Eval(); - double val1 = expression_->P2N(); - double val2 = val1; - if( expression2_->Valid() ) { - expression2_->Eval(); - val2 = expression2_->P2N(); + } + lcd->special_chars.push_back(SpecialChar(SCHARS[0], 8)); + ch_[0] = lcd->special_chars.size() - 1; + lcd->TextSpecialCharChanged(ch_[0]); } - double max, min; - if( expr_min_->Valid() ) { - expr_min_->Eval(); - min = expr_min_->P2N(); - } else { - min = min_; - if( val1 < min ) - min = val1; - if( val2 < min ) - min = val2; + it = ch_.find(1); + if (it == ch_.end() && expression2_->Valid()) { + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("Can not allot char for bar widget: %s", name_.c_str()); + update_ = -1; + return; + } + lcd->special_chars.push_back(SpecialChar(SCHARS[4], 8)); + ch_[1] = lcd->special_chars.size() - 1; + lcd->TextSpecialCharChanged(ch_[1]); } - if( expr_max_->Valid() ) { - expr_max_->Eval(); - max = expr_max_->P2N(); - } else { - max = max_; - if( val1 > max ) - max = val1; - if( val2 > max ) - max = val2; + it = ch_.find(2); + if (it == ch_.end() && expression2_->Valid()) { + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("Can not allot char for bar widget: %s", name_.c_str()); + update_ = -1; + return; + } + lcd->special_chars.push_back(SpecialChar(SCHARS[5], 8)); + ch_[2] = lcd->special_chars.size() - 1; + lcd->TextSpecialCharChanged(ch_[2]); } - min_ = min; - max_ = max; + } else { + LCDError("%s: Either choose style (H)ollow or have a 2nd expression.", + widget_base_.c_str()); + } +} - if( max > min ) { - val1_ = (val1 - min ) / (max - min); - val2_ = (val2 - min ) / (max - min); - } else { - val1_ = 0.0; - val2_ = 0.0; - } +void WidgetBar::Start() { + if (update_ < 0) + return; + // timer_->start(); + Update(); +} - if(Draw) - Draw(this); - else - LCDError("WidgetBar: no draw method"); +void WidgetBar::Stop() { + ch_.clear(); + // timer_->stop(); } +void WidgetBar::Update() { + expression_->Eval(); + double val1 = expression_->P2N(); + double val2 = val1; + if (expression2_->Valid()) { + expression2_->Eval(); + val2 = expression2_->P2N(); + } + + double max, min; + if (expr_min_->Valid()) { + expr_min_->Eval(); + min = expr_min_->P2N(); + } else { + min = min_; + if (val1 < min) + min = val1; + if (val2 < min) + min = val2; + } + + if (expr_max_->Valid()) { + expr_max_->Eval(); + max = expr_max_->P2N(); + } else { + max = max_; + if (val1 > max) + max = val1; + if (val2 > max) + max = val2; + } + + min_ = min; + max_ = max; + + if (max > min) { + val1_ = (val1 - min) / (max - min); + val2_ = (val2 - min) / (max - min); + } else { + val1_ = 0.0; + val2_ = 0.0; + } + + if (Draw) + Draw(this); + else + LCDError("WidgetBar: no draw method"); +} diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBar.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBar.h index add8fe1e4..2136773bf 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBar.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBar.h @@ -45,51 +45,50 @@ class LCDGraphic; typedef enum { STYLE_HOLLOW = 1, STYLE_NORMAL = 2 } STYLE; class WidgetBar : public Widget { - Property *expression_; - Property *expression2_; - Property *expr_min_; - Property *expr_max_; - - int color_valid_[2]; - RGBA color_[2]; - - DIRECTION direction_; - int update_; - STYLE style_; - - double val1_; - double val2_; - double min_; - double max_; - - std::map ch_; - - LCDTimer *timer_; - - void (*Draw)(WidgetBar *); - - public: - WidgetBar(LCDCore *visitor, std::string name, - Json::Value *section, int row, int col, int layer); - ~WidgetBar(); - void SetupChars(); - void Start(); - void Stop(); - DIRECTION GetDirection() { return direction_; } - STYLE GetStyle() { return style_; } - double GetVal1() { return val1_; } - double GetVal2() { return val2_; } - std::map &GetChars() { return ch_; } - int *GetColorValid() { return color_valid_; } - RGBA *GetColor() { return color_; } - - void Update(); - void TextScroll() {}; - - void Resize(int rows, int cols, int old_rows, int old_cols); + Property *expression_; + Property *expression2_; + Property *expr_min_; + Property *expr_max_; + + int color_valid_[2]; + RGBA color_[2]; + + DIRECTION direction_; + int update_; + STYLE style_; + + double val1_; + double val2_; + double min_; + double max_; + + std::map ch_; + + LCDTimer *timer_; + + void (*Draw)(WidgetBar *); + +public: + WidgetBar(LCDCore *visitor, std::string name, Json::Value *section, int row, + int col, int layer); + ~WidgetBar(); + void SetupChars(); + void Start(); + void Stop(); + DIRECTION GetDirection() { return direction_; } + STYLE GetStyle() { return style_; } + double GetVal1() { return val1_; } + double GetVal2() { return val2_; } + std::map &GetChars() { return ch_; } + int *GetColorValid() { return color_valid_; } + RGBA *GetColor() { return color_; } + + void Update(); + void TextScroll(){}; + + void Resize(int rows, int cols, int old_rows, int old_cols); }; - -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBignums.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBignums.cpp index 39a94c0ff..f670a7e1b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBignums.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBignums.cpp @@ -26,10 +26,9 @@ using namespace LCD; -void bignums_update(void *data) -{ - WidgetBignums *widget = (WidgetBignums *)data; - widget->Update(); +void bignums_update(void *data) { + WidgetBignums *widget = (WidgetBignums *)data; + widget->Update(); } extern void TextBignumsDraw(WidgetBignums *w); @@ -37,147 +36,147 @@ extern void GraphicBignumsDraw(WidgetBignums *w); extern int Font_8x16[10][16]; -WidgetBignums::WidgetBignums(LCDCore *v, std::string n, Json::Value *section, - int row, int col, int layer) : Widget(v, n, section, row, col, layer, - WIDGET_TYPE_BIGNUMS | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { +WidgetBignums::WidgetBignums(LCDCore *v, std::string n, Json::Value *section, + int row, int col, int layer) + : Widget(v, n, section, row, col, layer, + WIDGET_TYPE_BIGNUMS | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { - if(lcd_type_ == LCD_TEXT) - Draw = TextBignumsDraw; - else if(lcd_type_ == LCD_GRAPHIC) - Draw = GraphicBignumsDraw; - else - Draw = NULL; + if (lcd_type_ == LCD_TEXT) + Draw = TextBignumsDraw; + else if (lcd_type_ == LCD_GRAPHIC) + Draw = GraphicBignumsDraw; + else + Draw = NULL; - expression_ = new Property(v, section, "expression", new Json::Value("return 0")); - expr_min_ = new Property(v, section, "min", NULL); - expr_max_ = new Property(v, section, "max", NULL); + expression_ = + new Property(v, section, "expression", new Json::Value("return 0")); + expr_min_ = new Property(v, section, "min", NULL); + expr_max_ = new Property(v, section, "max", NULL); - Json::Value *val = v->CFG_Fetch_Raw(section, "layer", new Json::Value(0)); - layer_ = val->asInt(); - delete val; + Json::Value *val = v->CFG_Fetch_Raw(section, "layer", new Json::Value(0)); + layer_ = val->asInt(); + delete val; - val = v->CFG_Fetch_Raw(section, "update", new Json::Value(500)); - update_ = val->asInt(); - delete val; + val = v->CFG_Fetch_Raw(section, "update", new Json::Value(500)); + update_ = val->asInt(); + delete val; - fg_valid_ = WidgetColor(section, "foreground", &fg_color_); - bg_valid_ = WidgetColor(section, "background", &bg_color_); + fg_valid_ = WidgetColor(section, "foreground", &fg_color_); + bg_valid_ = WidgetColor(section, "background", &bg_color_); - min_ = max_ = 0.0; + min_ = max_ = 0.0; - timer_ = v->timers_->AddTimer(bignums_update, this, update_, true); + timer_ = v->timers_->AddTimer(bignums_update, this, update_, true); -/* - timer_ = new QTimer(); - timer_->setSingleShot(false); - timer_->setInterval(update_); - QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); + /* + timer_ = new QTimer(); + timer_->setSingleShot(false); + timer_->setInterval(update_); + QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); - QObject::connect(visitor_->GetWrapper(), SIGNAL(_ResizeLCD(int, int, int, int)), - this, SLOT(Resize(int, int, int, int))); -*/ + QObject::connect(visitor_->GetWrapper(), SIGNAL(_ResizeLCD(int, int, int, + int)), this, SLOT(Resize(int, int, int, int))); + */ } WidgetBignums::~WidgetBignums() { - Stop(); - delete expression_; - delete expr_min_; - delete expr_max_; + Stop(); + delete expression_; + delete expr_min_; + delete expr_max_; } void WidgetBignums::Resize(int rows, int cols, int old_rows, int old_cols) { - int yres = visitor_->GetLCD()->YRES; - int xres = visitor_->GetLCD()->XRES; - float r = row_ * yres / (float)old_rows; - float c = col_ * xres / (float)old_cols; - row_ = (int)((rows * r / yres) + 0.5); - col_ = (int)((cols * c / xres) + 0.5); - Update(); + int yres = visitor_->GetLCD()->YRES; + int xres = visitor_->GetLCD()->XRES; + float r = row_ * yres / (float)old_rows; + float c = col_ * xres / (float)old_cols; + row_ = (int)((rows * r / yres) + 0.5); + col_ = (int)((cols * c / xres) + 0.5); + Update(); } void WidgetBignums::SetupChars() { - ch_.clear(); - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - for(int i = 0; i < 8; i++) { - if((int)lcd->special_chars.size() >= lcd->CHARS ) { - LCDError("Can not allot char for widget: %s", name_.c_str()); - update_ = -1; - return; - } - lcd->special_chars.push_back(SpecialChar(8)); - ch_.push_back(lcd->special_chars.size() - 1); + ch_.clear(); + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + for (int i = 0; i < 8; i++) { + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("Can not allot char for widget: %s", name_.c_str()); + update_ = -1; + return; } + lcd->special_chars.push_back(SpecialChar(8)); + ch_.push_back(lcd->special_chars.size() - 1); + } } void WidgetBignums::Update() { - double max, min, val; - - expression_->Eval(); - val = expression_->P2N(); - - if( expr_min_->Valid() ) { - expr_min_->Eval(); - min = expr_min_->P2N(); - } else { - min = min_; - if( val < min ) - min = val; - } - - if( expr_max_->Valid() ) { - expr_max_->Eval(); - max = expr_max_->P2N(); - } else { - max = max_; - if( val > max ) - max = val; + double max, min, val; + + expression_->Eval(); + val = expression_->P2N(); + + if (expr_min_->Valid()) { + expr_min_->Eval(); + min = expr_min_->P2N(); + } else { + min = min_; + if (val < min) + min = val; + } + + if (expr_max_->Valid()) { + expr_max_->Eval(); + max = expr_max_->P2N(); + } else { + max = max_; + if (val > max) + max = val; + } + + min_ = min; + max_ = max; + + int value; + if (max > min) + value = (int)((val - min) / (max - min) * 100); + else + value = 0; + + std::ostringstream oss; + oss << value; + std::stringstream strm; + strm << oss.str(); + std::string text; + strm >> text; + + FB_.clear(); + FB_.resize(16 * 24); + + int pad = 3 - text.size(); + for (int i = 0; i < (int)text.size(); i++) { + int c = text[i] - '0'; + for (int row = 0; row < 16; row++) { + int mask = 1 << 8; + for (int col = 0; col < 8; col++) { + mask >>= 1; + if (Font_8x16[c][row] & mask) + FB_[row * 24 + (i + pad) * 8 + col] = '.'; + } } + } - min_ = min; - max_ = max; - - int value; - if(max > min) - value = (int)((val - min) / (max - min) * 100); - else - value = 0; - - std::ostringstream oss; - oss << value; - std::stringstream strm; - strm << oss.str(); - std::string text; - strm >> text; - - FB_.clear(); - FB_.resize(16*24); - - int pad = 3 - text.size(); - for(int i = 0; i < (int)text.size(); i++) { - int c = text[i] - '0'; - for(int row = 0; row < 16; row++) { - int mask = 1<<8; - for(int col = 0; col < 8; col++) { - mask >>= 1; - if(Font_8x16[c][row] & mask) - FB_[row * 24 + (i + pad) * 8 + col] = '.'; - } - } - } - - if(Draw) - Draw(this); - else - LCDError("WidgetBignums: no draw method."); + if (Draw) + Draw(this); + else + LCDError("WidgetBignums: no draw method."); } void WidgetBignums::Start() { - if(update_ < 0) - return; - timer_->Start(); + if (update_ < 0) + return; + timer_->Start(); } -void WidgetBignums::Stop() { - timer_->Stop(); -} +void WidgetBignums::Stop() { timer_->Stop(); } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBignums.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBignums.h index 2f4a60034..18c0aad59 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBignums.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetBignums.h @@ -43,35 +43,34 @@ class LCDGraphic; class LCDCore; class WidgetBignums : public Widget { - std::vector FB_; - std::vector ch_; - int min_; - int max_; - int update_; - Property *expression_; - Property *expr_min_; - Property *expr_max_; + std::vector FB_; + std::vector ch_; + int min_; + int max_; + int update_; + Property *expression_; + Property *expr_min_; + Property *expr_max_; - LCDTimer *timer_; + LCDTimer *timer_; - void (*Draw)(WidgetBignums *); - - public: - WidgetBignums(LCDCore *visitor, std::string name, Json::Value *section, - int row, int col, int layer); - ~WidgetBignums(); - void TextScroll() {}; - void SetupChars(); - void Update(); - void Start(); - void Stop(); - std::vector GetFB() { return FB_; } - std::vector GetCh() { return ch_; } + void (*Draw)(WidgetBignums *); - void Resize(int rows, int cols, int old_rows, int old_cols); -}; +public: + WidgetBignums(LCDCore *visitor, std::string name, Json::Value *section, + int row, int col, int layer); + ~WidgetBignums(); + void TextScroll(){}; + void SetupChars(); + void Update(); + void Start(); + void Stop(); + std::vector GetFB() { return FB_; } + std::vector GetCh() { return ch_; } -}; // End namespace + void Resize(int rows, int cols, int old_rows, int old_cols); +}; +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetFPS.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetFPS.cpp index da3833f3d..5c476361d 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetFPS.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetFPS.cpp @@ -32,10 +32,9 @@ using namespace LCD; -void fps_update(void *data) -{ - WidgetFPS *widget = (WidgetFPS *)data; - widget->Update(); +void fps_update(void *data) { + WidgetFPS *widget = (WidgetFPS *)data; + widget->Update(); } extern void TextFPSDraw(WidgetFPS *w); @@ -43,110 +42,102 @@ extern void GraphicFPSDraw(WidgetFPS *w); extern int Font_8x16[10][16]; +WidgetFPS::WidgetFPS(LCDCore *v, std::string n, Json::Value *section, int row, + int col, int layer) + : Widget(v, n, section, row, col, layer, WIDGET_TYPE_SPECIAL) { -WidgetFPS::WidgetFPS(LCDCore *v, std::string n, Json::Value *section, - int row, int col, int layer) : Widget(v, n, section, row, col, layer, - WIDGET_TYPE_SPECIAL) { + if (lcd_type_ == LCD_TEXT) + Draw = TextFPSDraw; + else if (lcd_type_ == LCD_GRAPHIC) + Draw = GraphicFPSDraw; + else + Draw = NULL; - if(lcd_type_ == LCD_TEXT) - Draw = TextFPSDraw; - else if(lcd_type_ == LCD_GRAPHIC) - Draw = GraphicFPSDraw; - else - Draw = NULL; + fg_valid_ = WidgetColor(section, "foreground", &fg_color_); + bg_valid_ = WidgetColor(section, "background", &bg_color_); - fg_valid_ = WidgetColor(section, "foreground", &fg_color_); - bg_valid_ = WidgetColor(section, "background", &bg_color_); + timer_ = v->timers_->AddTimer(fps_update, this, 200, true); - timer_ = v->timers_->AddTimer(fps_update, this, 200, true); - - stats_init( &stats_ ); + stats_init(&stats_); } -WidgetFPS::~WidgetFPS() { - Stop(); -} +WidgetFPS::~WidgetFPS() { Stop(); } void WidgetFPS::Resize(int rows, int cols, int old_rows, int old_cols) { - int yres = visitor_->GetLCD()->YRES; - int xres = visitor_->GetLCD()->XRES; - float r = row_ * yres / (float)old_rows; - float c = col_ * xres / (float)old_cols; - row_ = (int)((rows * r / yres) + 0.5); - col_ = (int)((cols * c / xres) + 0.5); - Update(); + int yres = visitor_->GetLCD()->YRES; + int xres = visitor_->GetLCD()->XRES; + float r = row_ * yres / (float)old_rows; + float c = col_ * xres / (float)old_cols; + row_ = (int)((rows * r / yres) + 0.5); + col_ = (int)((cols * c / xres) + 0.5); + Update(); } void WidgetFPS::SetupChars() { - ch_.clear(); - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - for(int i = 0; i < 8; i++) { - if((int)lcd->special_chars.size() >= lcd->CHARS ) { - LCDError("Can not allot char for widget: %s", name_.c_str()); - update_ = -1; - return; - } - lcd->special_chars.push_back(SpecialChar(8)); - ch_.push_back(lcd->special_chars.size() - 1); + ch_.clear(); + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + for (int i = 0; i < 8; i++) { + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("Can not allot char for widget: %s", name_.c_str()); + update_ = -1; + return; } + lcd->special_chars.push_back(SpecialChar(8)); + ch_.push_back(lcd->special_chars.size() - 1); + } } void WidgetFPS::Update() { - if(flipped_) - stats_startFrame(&stats_); - else + if (flipped_) + stats_startFrame(&stats_); + else - stats_endFrame(&stats_); + stats_endFrame(&stats_); - flipped_ = !flipped_; + flipped_ = !flipped_; - unsigned int value = (int)stats_.avgFrame; + unsigned int value = (int)stats_.avgFrame; - std::ostringstream oss; - oss << value; - std::stringstream strm; - strm << oss.str(); - std::string text; - strm >> text; + std::ostringstream oss; + oss << value; + std::stringstream strm; + strm << oss.str(); + std::string text; + strm >> text; - FB_.clear(); - FB_.resize(16*24); - - int pad = 3 - text.size(); + FB_.clear(); + FB_.resize(16 * 24); + int pad = 3 - text.size(); #ifdef __OPENMP -# pragma omp parallel -# pragma omp for +#pragma omp parallel +#pragma omp for #endif - for(int i = 0; i < (int)text.size(); i++) { - int c = text[i] - '0'; - for(int row = 0; row < 16; row++) { - int mask = 1<<8; - for(int col = 0; col < 8; col++) { - mask >>= 1; - if(Font_8x16[c][row] & mask) - FB_[row * 24 + (i + pad) * 8 + col] = '.'; - } - } + for (int i = 0; i < (int)text.size(); i++) { + int c = text[i] - '0'; + for (int row = 0; row < 16; row++) { + int mask = 1 << 8; + for (int col = 0; col < 8; col++) { + mask >>= 1; + if (Font_8x16[c][row] & mask) + FB_[row * 24 + (i + pad) * 8 + col] = '.'; + } } - - if(Draw) - Draw(this); - else - LCDError("WidgetFPS: no draw method."); -} + } -void WidgetFPS::Start() { - if(update_ < 0) - return; - timer_->Start(); + if (Draw) + Draw(this); + else + LCDError("WidgetFPS: no draw method."); } -void WidgetFPS::Stop() { - timer_->Stop(); +void WidgetFPS::Start() { + if (update_ < 0) + return; + timer_->Start(); } - +void WidgetFPS::Stop() { timer_->Stop(); } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetFPS.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetFPS.h index 52cfc313e..5f1c342c9 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetFPS.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetFPS.h @@ -44,33 +44,32 @@ class LCDGraphic; class LCDCore; class WidgetFPS : public Widget { - std::vector FB_; - std::vector ch_; - bool flipped_; - int update_; + std::vector FB_; + std::vector ch_; + bool flipped_; + int update_; - Stats stats_; + Stats stats_; - LCDTimer *timer_; + LCDTimer *timer_; - void (*Draw)(WidgetFPS *); - - public: - WidgetFPS(LCDCore *visitor, std::string name, Json::Value *section, - int row, int col, int layer); - ~WidgetFPS(); - void TextScroll() {}; - void SetupChars(); - void Update(); - void Start(); - void Stop(); - std::vector GetFB() { return FB_; } - std::vector GetCh() { return ch_; } + void (*Draw)(WidgetFPS *); - void Resize(int rows, int cols, int old_rows, int old_cols); -}; +public: + WidgetFPS(LCDCore *visitor, std::string name, Json::Value *section, int row, + int col, int layer); + ~WidgetFPS(); + void TextScroll(){}; + void SetupChars(); + void Update(); + void Start(); + void Stop(); + std::vector GetFB() { return FB_; } + std::vector GetCh() { return ch_; } -}; // End namespace + void Resize(int rows, int cols, int old_rows, int old_cols); +}; +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetHistogram.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetHistogram.cpp index 94fb83be5..7b7598d3c 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetHistogram.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetHistogram.cpp @@ -31,215 +31,220 @@ using namespace LCD; extern void TextHistogramDraw(WidgetHistogram *w); extern void GraphicHistogramDraw(WidgetHistogram *w); -void histogram_update(void *data) -{ - WidgetHistogram *widget = (WidgetHistogram *)data; - widget->Update(); +void histogram_update(void *data) { + WidgetHistogram *widget = (WidgetHistogram *)data; + widget->Update(); } -WidgetHistogram::WidgetHistogram(LCDCore *v, std::string n, Json::Value *section, - int row, int col, int layer) : Widget(v, n, section, row, col, layer, - WIDGET_TYPE_HISTOGRAM | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { - - - if(lcd_type_ == LCD_TEXT) - Draw = TextHistogramDraw; - else if(lcd_type_ == LCD_GRAPHIC) - Draw = GraphicHistogramDraw; - else - Draw = NULL; - - min_ = max_ = 0; - string_ = ""; - offset_ = 0; - - expression_ = new Property(v, section, "expression", new Json::Value("return 0")); - expr_min_ = new Property(v, section, "min", NULL); - expr_max_ = new Property(v, section, "max", NULL); - - fg_valid_ = WidgetColor(section, "foreground", &fg_color_); - bg_valid_ = WidgetColor(section, "background", &bg_color_); - - Json::Value *val = v->CFG_Fetch_Raw(section, "width", new Json::Value(10)); - cols_ = val->asInt(); - delete val; - - val = v->CFG_Fetch_Raw(section, "height", new Json::Value(1)); - rows_ = val->asInt(); - delete val; - - LCDError("1 cols_ %d, rows_ %d", cols_, rows_); - int diff = (col_ + cols_) - v->GetLCD()->LCOLS; - if(diff > 0) cols_ -= diff; - - diff = (row_ + rows_) - v->GetLCD()->LROWS; - if(diff > 0) rows_ -= diff; - LCDError("2 cols_ %d, rows_ %d", cols_, rows_); - - val = v->CFG_Fetch_Raw(section, "gap", new Json::Value(0)); - gap_ = val->asInt(); - delete val; - - val = v->CFG_Fetch_Raw(section, "direction", new Json::Value("E")); - if( val->asString() == "E" ) - direction_ = DIR_EAST; - else if (val->asString() == "W" ) - direction_ = DIR_WEST; - else { - LCDError("Widget %s has unknown direction '%s'; Use (E)ast or (W)est. Using E.", - name_.c_str(), val->asCString()); - direction_ = DIR_EAST; - } - delete val; - - val = v->CFG_Fetch(section, "update", new Json::Value(1000)); - update_ = val->asInt(); - delete val; - - history_.resize(cols_); - - timer_ = v->timers_->AddTimer(histogram_update, this, update_, true); - -/* - timer_ = new QTimer(); - timer_->setSingleShot(false); - timer_->setInterval(update_); - QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); - - QObject::connect(v->GetWrapper(), SIGNAL(_ResizeLCD(int, int, int, int)), - this, SLOT(Resize(int, int, int, int))); -*/ +WidgetHistogram::WidgetHistogram(LCDCore *v, std::string n, + Json::Value *section, int row, int col, + int layer) + : Widget(v, n, section, row, col, layer, + WIDGET_TYPE_HISTOGRAM | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { + + if (lcd_type_ == LCD_TEXT) + Draw = TextHistogramDraw; + else if (lcd_type_ == LCD_GRAPHIC) + Draw = GraphicHistogramDraw; + else + Draw = NULL; + + min_ = max_ = 0; + string_ = ""; + offset_ = 0; + + expression_ = + new Property(v, section, "expression", new Json::Value("return 0")); + expr_min_ = new Property(v, section, "min", NULL); + expr_max_ = new Property(v, section, "max", NULL); + + fg_valid_ = WidgetColor(section, "foreground", &fg_color_); + bg_valid_ = WidgetColor(section, "background", &bg_color_); + + Json::Value *val = v->CFG_Fetch_Raw(section, "width", new Json::Value(10)); + cols_ = val->asInt(); + delete val; + + val = v->CFG_Fetch_Raw(section, "height", new Json::Value(1)); + rows_ = val->asInt(); + delete val; + + LCDError("1 cols_ %d, rows_ %d", cols_, rows_); + int diff = (col_ + cols_) - v->GetLCD()->LCOLS; + if (diff > 0) + cols_ -= diff; + + diff = (row_ + rows_) - v->GetLCD()->LROWS; + if (diff > 0) + rows_ -= diff; + LCDError("2 cols_ %d, rows_ %d", cols_, rows_); + + val = v->CFG_Fetch_Raw(section, "gap", new Json::Value(0)); + gap_ = val->asInt(); + delete val; + + val = v->CFG_Fetch_Raw(section, "direction", new Json::Value("E")); + if (val->asString() == "E") + direction_ = DIR_EAST; + else if (val->asString() == "W") + direction_ = DIR_WEST; + else { + LCDError( + "Widget %s has unknown direction '%s'; Use (E)ast or (W)est. Using E.", + name_.c_str(), val->asCString()); + direction_ = DIR_EAST; + } + delete val; + + val = v->CFG_Fetch(section, "update", new Json::Value(1000)); + update_ = val->asInt(); + delete val; + + history_.resize(cols_); + + timer_ = v->timers_->AddTimer(histogram_update, this, update_, true); + + /* + timer_ = new QTimer(); + timer_->setSingleShot(false); + timer_->setInterval(update_); + QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); + + QObject::connect(v->GetWrapper(), SIGNAL(_ResizeLCD(int, int, int, int)), + this, SLOT(Resize(int, int, int, int))); + */ } WidgetHistogram::~WidgetHistogram() { - Stop(); - delete expression_; - delete expr_min_; - delete expr_max_; + Stop(); + delete expression_; + delete expr_min_; + delete expr_max_; } void WidgetHistogram::SetupChars() { - ch_.clear(); - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - for(int c = 0; c < (int)lcd->YRES; c++ ) { - SpecialChar buffer(lcd->YRES);; - for(int i = lcd->YRES - 1; i >= 0; i-- ) { - buffer[lcd->YRES - i - 1] = (i < c ? pow(2.0, (double)lcd->XRES)-1-gap_ : 0); - } - - bool reused = false; - - for(unsigned int i = 0; i < lcd->special_chars.size(); i++ ) { - if( buffer == lcd->special_chars[i] ) { - ch_[c] = i; - reused = true; - break; - } - } - - if( lcd->CHARS < (int)lcd->special_chars.size() ) { - update_ = -1; - LCDError("Widget %s - unable to allocate special chars", - name_.c_str()); - return; - } - - if( reused ) continue; - lcd->special_chars.push_back(buffer); - ch_[c] = lcd->special_chars.size() - 1; - lcd->TextSpecialCharChanged(ch_[c]); + ch_.clear(); + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + for (int c = 0; c < (int)lcd->YRES; c++) { + SpecialChar buffer(lcd->YRES); + ; + for (int i = lcd->YRES - 1; i >= 0; i--) { + buffer[lcd->YRES - i - 1] = + (i < c ? pow(2.0, (double)lcd->XRES) - 1 - gap_ : 0); } -} -void WidgetHistogram::Resize(int rows, int cols, int old_rows, int old_cols) { - int yres = visitor_->GetLCD()->YRES; - int xres = visitor_->GetLCD()->XRES; - float y = rows_ * yres / (float)old_rows; - float x = cols_ * xres / (float)old_cols; - float r = row_ * yres / (float)old_rows; - float c = col_ * xres / (float)old_cols; - rows_ = (int)((rows * y / yres) + 0.5); - cols_ = (int)((cols * x / xres) + 0.5); - row_ = (int)((rows * r / yres) + 0.5); - col_ = (int)((cols * c / yres) + 0.5); - history_.resize(cols_); - Update(); -} + bool reused = false; -void WidgetHistogram::Update() { + for (unsigned int i = 0; i < lcd->special_chars.size(); i++) { + if (buffer == lcd->special_chars[i]) { + ch_[c] = i; + reused = true; + break; + } + } - if(lcd_type_ == LCD_GRAPHIC && direction_ == DIR_EAST) - offset_++; - else if(lcd_type_ == LCD_GRAPHIC && direction_ == DIR_WEST) - offset_--; - - if(lcd_type_ == LCD_GRAPHIC && abs(offset_) < visitor_->GetLCD()->XRES) { - if(Draw) - Draw(this); - return; - } else { - offset_ = 0; + if (lcd->CHARS < (int)lcd->special_chars.size()) { + update_ = -1; + LCDError("Widget %s - unable to allocate special chars", name_.c_str()); + return; } - expression_->Eval(); - double val = expression_->P2N(); + if (reused) + continue; + lcd->special_chars.push_back(buffer); + ch_[c] = lcd->special_chars.size() - 1; + lcd->TextSpecialCharChanged(ch_[c]); + } +} + +void WidgetHistogram::Resize(int rows, int cols, int old_rows, int old_cols) { + int yres = visitor_->GetLCD()->YRES; + int xres = visitor_->GetLCD()->XRES; + float y = rows_ * yres / (float)old_rows; + float x = cols_ * xres / (float)old_cols; + float r = row_ * yres / (float)old_rows; + float c = col_ * xres / (float)old_cols; + rows_ = (int)((rows * y / yres) + 0.5); + cols_ = (int)((cols * x / xres) + 0.5); + row_ = (int)((rows * r / yres) + 0.5); + col_ = (int)((cols * c / yres) + 0.5); + history_.resize(cols_); + Update(); +} - double min; - double max; +void WidgetHistogram::Update() { - if( expr_min_->Valid() ) { - expr_min_->Eval(); - min = expr_min_->P2N(); - } else { - min = min_; - if( val < min ) - min = val; - } + if (lcd_type_ == LCD_GRAPHIC && direction_ == DIR_EAST) + offset_++; + else if (lcd_type_ == LCD_GRAPHIC && direction_ == DIR_WEST) + offset_--; - if( expr_max_->Valid() ) { - expr_max_->Eval(); - max = expr_max_->P2N(); - } else { - max = max_; - if( val > max ) - max = val; + if (lcd_type_ == LCD_GRAPHIC && abs(offset_) < visitor_->GetLCD()->XRES) { + if (Draw) + Draw(this); + return; + } else { + offset_ = 0; + } + + expression_->Eval(); + double val = expression_->P2N(); + + double min; + double max; + + if (expr_min_->Valid()) { + expr_min_->Eval(); + min = expr_min_->P2N(); + } else { + min = min_; + if (val < min) + min = val; + } + + if (expr_max_->Valid()) { + expr_max_->Eval(); + max = expr_max_->P2N(); + } else { + max = max_; + if (val > max) + max = val; + } + + min_ = min; + max_ = max; + + if (max > min) + val = (val - min) / (max - min); + else + val = 0.0; + + if (direction_ == DIR_EAST) { + std::vector tmp = history_; + history_[0] = val; + for (int i = 1; i < cols_; i++) { + history_[i] = tmp[i - 1]; } - - min_ = min; - max_ = max; - - if( max > min ) - val = (val - min) / (max - min); - else - val = 0.0; - - if( direction_ == DIR_EAST ) { - std::vector tmp = history_; - history_[0] = val; - for(int i = 1; i < cols_; i++ ) { - history_[i] = tmp[i-1]; - } - } else { - std::vector tmp = history_; - history_[cols_-1] = val; - for(int i = 0; i < cols_ - 1; i++ ) { - history_[i] = tmp[i+1]; - } + } else { + std::vector tmp = history_; + history_[cols_ - 1] = val; + for (int i = 0; i < cols_ - 1; i++) { + history_[i] = tmp[i + 1]; } + } - if(Draw) - Draw(this); + if (Draw) + Draw(this); } void WidgetHistogram::Start() { - if(update_ < 0) - return; - timer_->Start(); - Update(); + if (update_ < 0) + return; + timer_->Start(); + Update(); } void WidgetHistogram::Stop() { - timer_->Stop(); - ch_.clear(); + timer_->Stop(); + ch_.clear(); } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetHistogram.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetHistogram.h index 27ffe5df5..427d85d54 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetHistogram.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetHistogram.h @@ -43,41 +43,40 @@ class LCDGraphic; class LCDCore; class WidgetHistogram : public Widget { - int min_; - int max_; - std::string string_; - Property *expression_; - Property *expr_min_; - Property *expr_max_; - int gap_; - int direction_; - int offset_; - int update_; - std::vector history_; - std::map ch_; + int min_; + int max_; + std::string string_; + Property *expression_; + Property *expr_min_; + Property *expr_max_; + int gap_; + int direction_; + int offset_; + int update_; + std::vector history_; + std::map ch_; - LCDTimer *timer_; + LCDTimer *timer_; - void (*Draw)(WidgetHistogram *); + void (*Draw)(WidgetHistogram *); - public: - WidgetHistogram(LCDCore *visitor, std::string name, - Json::Value *section, int row, int col, int layer); - ~WidgetHistogram(); - void SetupChars(); - void Start(); - void Stop(); - std::map GetCh() { return ch_; } - std::vector GetHistory() { return history_; } - int GetOffset() { return offset_; } +public: + WidgetHistogram(LCDCore *visitor, std::string name, Json::Value *section, + int row, int col, int layer); + ~WidgetHistogram(); + void SetupChars(); + void Start(); + void Stop(); + std::map GetCh() { return ch_; } + std::vector GetHistory() { return history_; } + int GetOffset() { return offset_; } - void Update(); - void TextScroll() {} + void Update(); + void TextScroll() {} - void Resize(int rows, int cols, int old_rows, int old_cols); + void Resize(int rows, int cols, int old_rows, int old_cols); }; -}; // End namespace - +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetIcon.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetIcon.cpp index 91d2050d8..83cd0b6d7 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetIcon.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetIcon.cpp @@ -36,160 +36,155 @@ using namespace LCD; -void icon_update(void *data) -{ - WidgetIcon *icon = (WidgetIcon *)data; - icon->Update(); +void icon_update(void *data) { + WidgetIcon *icon = (WidgetIcon *)data; + icon->Update(); } extern void TextIconDraw(WidgetIcon *w); extern void GraphicIconDraw(WidgetIcon *w); -WidgetIcon::WidgetIcon(LCDCore *v, std::string n, - Json::Value *section, int row, int col, int layer) : - Widget(v, n, section, row, col, layer, WIDGET_TYPE_ICON | - WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { - - - if(lcd_type_ == LCD_TEXT) - Draw = TextIconDraw; - else if(lcd_type_ == LCD_GRAPHIC) - Draw = GraphicIconDraw; - else - Draw = NULL; - - cols_ = 1; - rows_ = 1; - - visible_ = new Property(v, section, "visible", new Json::Value("return 1")); - - Json::Value *val = v->CFG_Fetch_Raw(section, "speed", new Json::Value(500)); - update_ = val->asInt(); - delete val; - - fg_valid_ = WidgetColor(section, "foreground", &fg_color_); - bg_valid_ = WidgetColor(section, "background", &bg_color_); - - val = v->CFG_Fetch_Raw(section, "bitmap"); - - if(!val) { - update_ = -1; - return; - } - - std::vector ch; - - for(int i = 0; i < v->GetLCD()->YRES; i++) { - std::stringstream strm; - std::string str; - strm << "row" << i + 1; - strm >> str; - Json::Value *row = v->CFG_Fetch_Raw(val, str); - if(!row) break; - std::vector line = Split(row->asString(), '|'); - if( line[line.size() - 1] == "" ) - line.erase(line.end()); - for(unsigned int j = 0; j < line.size(); j++) { - std::string segment = line[j]; - if( j >= ch.size() ) - ch.push_back(SpecialChar(v->GetLCD()->YRES)); - for(unsigned int c = 0; c < segment.size(); c++ ) { - if( segment[c] == '*' ) - ch[j][i] ^= 1<CFG_Fetch_Raw(section, "speed", new Json::Value(500)); + update_ = val->asInt(); + delete val; + + fg_valid_ = WidgetColor(section, "foreground", &fg_color_); + bg_valid_ = WidgetColor(section, "background", &bg_color_); + + val = v->CFG_Fetch_Raw(section, "bitmap"); + + if (!val) { + update_ = -1; + return; + } + + std::vector ch; + + for (int i = 0; i < v->GetLCD()->YRES; i++) { + std::stringstream strm; + std::string str; + strm << "row" << i + 1; + strm >> str; + Json::Value *row = v->CFG_Fetch_Raw(val, str); + if (!row) + break; + std::vector line = Split(row->asString(), '|'); + if (line[line.size() - 1] == "") + line.erase(line.end()); + for (unsigned int j = 0; j < line.size(); j++) { + std::string segment = line[j]; + if (j >= ch.size()) + ch.push_back(SpecialChar(v->GetLCD()->YRES)); + for (unsigned int c = 0; c < segment.size(); c++) { + if (segment[c] == '*') + ch[j][i] ^= 1 << c; + } } - delete val; + delete row; + } + delete val; - data_ = ch; + data_ = ch; - index_ = 0; + index_ = 0; - started_ = false; + started_ = false; - ch_ = -1; + ch_ = -1; - bitmap_ = new SpecialChar(data_[0].Size()); + bitmap_ = new SpecialChar(data_[0].Size()); - timer_ = v->timers_->AddTimer(icon_update, this, update_, true); + timer_ = v->timers_->AddTimer(icon_update, this, update_, true); } - WidgetIcon::~WidgetIcon() { - Stop(); - delete visible_; - delete bitmap_; + Stop(); + delete visible_; + delete bitmap_; } void WidgetIcon::Resize(int rows, int cols, int old_rows, int old_cols) { - int yres = visitor_->GetLCD()->YRES; - int xres = visitor_->GetLCD()->XRES; - float r = row_ * yres / (float)old_rows; - float c = col_ * xres / (float)old_cols; - row_ = (int)((rows * r / yres) + 0.5); - col_ = (int)((cols * c / xres) + 0.5); - Update(); + int yres = visitor_->GetLCD()->YRES; + int xres = visitor_->GetLCD()->XRES; + float r = row_ * yres / (float)old_rows; + float c = col_ * xres / (float)old_cols; + row_ = (int)((rows * r / yres) + 0.5); + col_ = (int)((cols * c / xres) + 0.5); + Update(); } void WidgetIcon::SetupChars() { - std::map widgets = visitor_->GetWidgets(); - for(std::map::iterator it = - widgets.begin(); - it != widgets.end(); it++) { - if(it->second->GetWidgetBase() == widget_base_ && - ((WidgetIcon *)it->second)->GetCh() >= 0) { - ch_ = ((WidgetIcon *)it->second)->GetCh(); - return; - } + std::map widgets = visitor_->GetWidgets(); + for (std::map::iterator it = widgets.begin(); + it != widgets.end(); it++) { + if (it->second->GetWidgetBase() == widget_base_ && + ((WidgetIcon *)it->second)->GetCh() >= 0) { + ch_ = ((WidgetIcon *)it->second)->GetCh(); + return; } - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - if((int)lcd->special_chars.size() >= lcd->CHARS) { - LCDError("Can not allot char for widget: %s", name_.c_str()); - update_ = -1; - return; - } - lcd->special_chars.push_back(SpecialChar(lcd->YRES)); - ch_ = lcd->special_chars.size() - 1; + } + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("Can not allot char for widget: %s", name_.c_str()); + update_ = -1; + return; + } + lcd->special_chars.push_back(SpecialChar(lcd->YRES)); + ch_ = lcd->special_chars.size() - 1; } void WidgetIcon::Update() { - *bitmap_ = data_[index_++]; + *bitmap_ = data_[index_++]; - if(index_ >= (int)data_.size()) - index_ = 0; - - Draw(this); + if (index_ >= (int)data_.size()) + index_ = 0; + + Draw(this); } void WidgetIcon::Start() { - if(update_ < 0) - return; - started_ = false; - if(type_ == LCD_TEXT) - { - std::map widgets; - widgets = visitor_->GetWidgets(); - for(std::map::iterator it = widgets.begin(); - it != widgets.end() && lcd_type_ == LCD_TEXT; it++) { - if(it->second->GetWidgetBase() == widget_base_ && - it->second->GetStarted()) { - started_ = true; - break; - } - } - } - if(!started_) { - timer_->Start(); + if (update_ < 0) + return; + started_ = false; + if (type_ == LCD_TEXT) { + std::map widgets; + widgets = visitor_->GetWidgets(); + for (std::map::iterator it = widgets.begin(); + it != widgets.end() && lcd_type_ == LCD_TEXT; it++) { + if (it->second->GetWidgetBase() == widget_base_ && + it->second->GetStarted()) { started_ = true; - } - Update(); + break; + } + } + } + if (!started_) { + timer_->Start(); + started_ = true; + } + Update(); } void WidgetIcon::Stop() { - timer_->Stop(); - started_ = false; - ch_ = -1; + timer_->Stop(); + started_ = false; + ch_ = -1; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetIcon.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetIcon.h index 6d6e3d867..1fbe69a14 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetIcon.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetIcon.h @@ -43,48 +43,49 @@ class LCDGraphic; class LCDCore; class WidgetIcon : public Widget { - Property *visible_; - int update_; - int ch_; - int index_; - SpecialChar *bitmap_; - std::vector data_; - - LCDTimer *timer_; - - void (*Draw)(WidgetIcon *); - - public: - WidgetIcon(LCDCore *visitor, std::string name, Json::Value *section, int row, int col, int layer); - ~WidgetIcon(); - void SetupChars(); - void Start(); - void Stop(); - SpecialChar GetBitmap() { return *bitmap_; } - int GetCh() { return ch_; } - Property *GetVisible() { return visible_; } - - void Update(); - void TextScroll() {} - - void Resize(int rows, int cols, int old_rows, int old_cols); + Property *visible_; + int update_; + int ch_; + int index_; + SpecialChar *bitmap_; + std::vector data_; + + LCDTimer *timer_; + + void (*Draw)(WidgetIcon *); + +public: + WidgetIcon(LCDCore *visitor, std::string name, Json::Value *section, int row, + int col, int layer); + ~WidgetIcon(); + void SetupChars(); + void Start(); + void Stop(); + SpecialChar GetBitmap() { return *bitmap_; } + int GetCh() { return ch_; } + Property *GetVisible() { return visible_; } + + void Update(); + void TextScroll() {} + + void Resize(int rows, int cols, int old_rows, int old_cols); }; -inline std::vector &Split(const std::string &s, char delim, std::vector &elems) { - std::stringstream ss(s); - std::string item; - while(std::getline(ss, item, delim)) { - elems.push_back(item); - } - return elems; +inline std::vector &Split(const std::string &s, char delim, + std::vector &elems) { + std::stringstream ss(s); + std::string item; + while (std::getline(ss, item, delim)) { + elems.push_back(item); + } + return elems; } inline std::vector Split(const std::string &s, char delim) { - std::vector elems; - return Split(s, delim, elems); + std::vector elems; + return Split(s, delim, elems); } -}; // End namespace - +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetKey.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetKey.cpp index 04392bca5..c017acc40 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetKey.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetKey.cpp @@ -32,38 +32,33 @@ using namespace LCD; -WidgetKey::WidgetKey(LCDCore *v, std::string n, Json::Value *section) : - Widget(v, n, section, 0, 0, 0, WIDGET_TYPE_KEYPAD) { +WidgetKey::WidgetKey(LCDCore *v, std::string n, Json::Value *section) + : Widget(v, n, section, 0, 0, 0, WIDGET_TYPE_KEYPAD) { - Json::Value *val = v->CFG_Fetch_Raw(section, "expression", new Json::Value("")); - code_ = val->asString(); - delete val; + Json::Value *val = + v->CFG_Fetch_Raw(section, "expression", new Json::Value("")); + code_ = val->asString(); + delete val; - val = v->CFG_Fetch(section, "key", new Json::Value(-1)); - key_ = val->asInt(); - delete val; + val = v->CFG_Fetch(section, "key", new Json::Value(-1)); + key_ = val->asInt(); + delete val; - started_ = false; + started_ = false; } -WidgetKey::~WidgetKey() { -} +WidgetKey::~WidgetKey() {} void WidgetKey::KeyPressed(int k) { - if( started_ && k == key_ ) - Update(); + if (started_ && k == key_) + Update(); } void WidgetKey::Update() { - LCDError("WidgetKey::Update() %d", key_); - visitor_->Eval(code_.c_str()); -} - -void WidgetKey::Start() { - started_ = true; + LCDError("WidgetKey::Update() %d", key_); + visitor_->Eval(code_.c_str()); } -void WidgetKey::Stop() { - started_ = false; -} +void WidgetKey::Start() { started_ = true; } +void WidgetKey::Stop() { started_ = false; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetKey.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetKey.h index 724884606..557e8ffe5 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetKey.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetKey.h @@ -36,22 +36,21 @@ class LCDGraphic; class LCDCore; class WidgetKey : public Widget { - std::string code_; - int key_; - bool started_; - - public: - WidgetKey(LCDCore *v, std::string name, Json::Value *config); - ~WidgetKey(); - void Start(); - void Stop(); - void KeyPressed(int k); - - void TextScroll() {} - void Update(); + std::string code_; + int key_; + bool started_; + +public: + WidgetKey(LCDCore *v, std::string name, Json::Value *config); + ~WidgetKey(); + void Start(); + void Stop(); + void KeyPressed(int k); + + void TextScroll() {} + void Update(); }; -}; // End namespace - +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetScript.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetScript.cpp index 9b0df8929..369f836b9 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetScript.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetScript.cpp @@ -31,30 +31,29 @@ using namespace LCD; -WidgetScript::WidgetScript(LCDCore *v, std::string n, Json::Value *section) : - Widget(v, n, section, 0, 0, 0, WIDGET_TYPE_KEYPAD) { +WidgetScript::WidgetScript(LCDCore *v, std::string n, Json::Value *section) + : Widget(v, n, section, 0, 0, 0, WIDGET_TYPE_KEYPAD) { - Json::Value *scriptFile = v->CFG_Fetch_Raw(section, "file", NULL); - if(scriptFile) { - FILE *file = fopen( scriptFile->asCString(), "rb"); - if( !file ) { - LCDError("WidgetScript: Unable to open file <%s>", scriptFile->asCString()); - return; - } - fseek(file, 0, SEEK_END); - long size = ftell(file); - fseek(file, 0, SEEK_SET); - char *buffer = new char[size+1]; - buffer[size] = 0x0; - if( fread( buffer, 1, size, file) != (unsigned long) size) - return; - std::string script = buffer; - delete []buffer; - fclose(file); - v->Eval(script); + Json::Value *scriptFile = v->CFG_Fetch_Raw(section, "file", NULL); + if (scriptFile) { + FILE *file = fopen(scriptFile->asCString(), "rb"); + if (!file) { + LCDError("WidgetScript: Unable to open file <%s>", + scriptFile->asCString()); + return; } + fseek(file, 0, SEEK_END); + long size = ftell(file); + fseek(file, 0, SEEK_SET); + char *buffer = new char[size + 1]; + buffer[size] = 0x0; + if (fread(buffer, 1, size, file) != (unsigned long)size) + return; + std::string script = buffer; + delete[] buffer; + fclose(file); + v->Eval(script); + } } -WidgetScript::~WidgetScript() { -} - +WidgetScript::~WidgetScript() {} diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetScript.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetScript.h index 4d45e556c..780fceed2 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetScript.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetScript.h @@ -34,15 +34,15 @@ namespace LCD { class LCDCore; class WidgetScript : public Widget { - public: - WidgetScript(LCDCore *visitor, std::string name, Json::Value *config); - ~WidgetScript(); - void Start() {} - void Stop() {} - void TextScroll() {} - void Update() {} +public: + WidgetScript(LCDCore *visitor, std::string name, Json::Value *config); + ~WidgetScript(); + void Start() {} + void Stop() {} + void TextScroll() {} + void Update() {} }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetSuperscope.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetSuperscope.cpp index b66cd32e5..136fccd89 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetSuperscope.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetSuperscope.cpp @@ -37,216 +37,213 @@ using namespace LCD; enum scope_runnable { - SCOPE_RUNNABLE_INIT = 0, - SCOPE_RUNNABLE_FRAME, - SCOPE_RUNNABLE_BEAT, - SCOPE_RUNNABLE_POINT, + SCOPE_RUNNABLE_INIT = 0, + SCOPE_RUNNABLE_FRAME, + SCOPE_RUNNABLE_BEAT, + SCOPE_RUNNABLE_POINT, }; typedef struct { - char *runnables[4]; + char *runnables[4]; - double n, b, x, y, i, v, w, h, red, green, blue, linesize, skip, drawmode, t, d; - LVAVSPipeline *pipeline; + double n, b, x, y, i, v, w, h, red, green, blue, linesize, skip, drawmode, t, + d; + LVAVSPipeline *pipeline; + int channel_source; + int color_pos; + VisPalette pal; - int channel_source; - int color_pos; - VisPalette pal; + int needs_init; - int needs_init; - - AVSGfxColorCycler *cycler; + AVSGfxColorCycler *cycler; } SuperScopePrivate; -int lv_superscope_render (WidgetSuperscope *priv, VisVideo *video, VisAudio *audio); +int lv_superscope_render(WidgetSuperscope *priv, VisVideo *video, + VisAudio *audio); -void icon_update(void *data) -{ - WidgetSuperscope *icon = (WidgetSuperscope *)data; - icon->Update(); +void icon_update(void *data) { + WidgetSuperscope *icon = (WidgetSuperscope *)data; + icon->Update(); } -int scope_load_runnable(SuperScopePrivate *priv, ScopeRunnable runnable, char *buf) -{ -/* - AvsRunnable *obj = avs_runnable_new(priv->ctx); - avs_runnable_set_variable_manager(obj, priv->vm); - priv->runnable[runnable] = obj; - avs_runnable_compile(obj, (unsigned char *)buf, strlen(buf)); -*/ - return 0; +int scope_load_runnable(SuperScopePrivate *priv, ScopeRunnable runnable, + char *buf) { + /* + AvsRunnable *obj = avs_runnable_new(priv->ctx); + avs_runnable_set_variable_manager(obj, priv->vm); + priv->runnable[runnable] = obj; + avs_runnable_compile(obj, (unsigned char *)buf, strlen(buf)); + */ + return 0; } -int scope_run(SuperScopePrivate *priv, ScopeRunnable runnable) -{ - //avs_runnable_execute(priv->runnable[runnable]); - return 0; +int scope_run(SuperScopePrivate *priv, ScopeRunnable runnable) { + // avs_runnable_execute(priv->runnable[runnable]); + return 0; } extern void TextSuperscopeDraw(WidgetSuperscope *w); extern void GraphicSuperscopeDraw(WidgetSuperscope *w); -WidgetSuperscope::WidgetSuperscope(LCDCore *v, std::string n, - Json::Value *section, int row, int col, int layer) : - Widget(v, n, section, row, col, layer, WIDGET_TYPE_ICON | - WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { - +WidgetSuperscope::WidgetSuperscope(LCDCore *v, std::string n, + Json::Value *section, int row, int col, + int layer) + : Widget(v, n, section, row, col, layer, + WIDGET_TYPE_ICON | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { - if(lcd_type_ == LCD_TEXT) - Draw = TextSuperscopeDraw; - else if(lcd_type_ == LCD_GRAPHIC) - Draw = GraphicSuperscopeDraw; - else - Draw = NULL; + if (lcd_type_ == LCD_TEXT) + Draw = TextSuperscopeDraw; + else if (lcd_type_ == LCD_GRAPHIC) + Draw = GraphicSuperscopeDraw; + else + Draw = NULL; - cols_ = 1; - rows_ = 1; + cols_ = 1; + rows_ = 1; - visible_ = new Property(v, section, "visible", new Json::Value("return 1")); - init_ = new Property(v, section, "point", new Json::Value("return")); - beat_ = new Property(v, section, "beat", new Json::Value("return")); - frame_ = new Property(v, section, "frame", new Json::Value("return")); - point_ = new Property(v, section, "point", new Json::Value("return")); + visible_ = new Property(v, section, "visible", new Json::Value("return 1")); + init_ = new Property(v, section, "point", new Json::Value("return")); + beat_ = new Property(v, section, "beat", new Json::Value("return")); + frame_ = new Property(v, section, "frame", new Json::Value("return")); + point_ = new Property(v, section, "point", new Json::Value("return")); - Json::Value *val = v->CFG_Fetch_Raw(section, "speed", new Json::Value(500)); - update_ = val->asInt(); - delete val; + Json::Value *val = v->CFG_Fetch_Raw(section, "speed", new Json::Value(500)); + update_ = val->asInt(); + delete val; - fg_valid_ = WidgetColor(section, "foreground", &fg_color_); - bg_valid_ = WidgetColor(section, "background", &bg_color_); + fg_valid_ = WidgetColor(section, "foreground", &fg_color_); + bg_valid_ = WidgetColor(section, "background", &bg_color_); - data_ = ch; + data_ = ch; - index_ = 0; + index_ = 0; - started_ = false; + started_ = false; - ch_ = -1; + ch_ = -1; - video_ = visual_video_new_with_buffer(width, height, VISUAL_VIDEO_DEPTH_32BIT); + video_ = + visual_video_new_with_buffer(width, height, VISUAL_VIDEO_DEPTH_32BIT); - timer_ = v->timers_->AddTimer(icon_update, this, update_, true); + timer_ = v->timers_->AddTimer(icon_update, this, update_, true); } - WidgetSuperscope::~WidgetSuperscope() { - Stop(); - delete visible_; - delete bitmap_; - visual_video_unref(video_); + Stop(); + delete visible_; + delete bitmap_; + visual_video_unref(video_); } void WidgetSuperscope::Resize(int rows, int cols, int old_rows, int old_cols) { - int yres = visitor_->GetLCD()->YRES; - int xres = visitor_->GetLCD()->XRES; - float r = row_ * yres / (float)old_rows; - float c = col_ * xres / (float)old_cols; - row_ = (int)((rows * r / yres) + 0.5); - col_ = (int)((cols * c / xres) + 0.5); - Update(); + int yres = visitor_->GetLCD()->YRES; + int xres = visitor_->GetLCD()->XRES; + float r = row_ * yres / (float)old_rows; + float c = col_ * xres / (float)old_cols; + row_ = (int)((rows * r / yres) + 0.5); + col_ = (int)((cols * c / xres) + 0.5); + Update(); } void WidgetSuperscope::SetupChars() { - std::map widgets = visitor_->GetWidgets(); - for(std::map::iterator it = - widgets.begin(); - it != widgets.end(); it++) { - if(it->second->GetWidgetBase() == widget_base_ && - ((WidgetSuperscope *)it->second)->GetCh() >= 0) { - ch_ = ((WidgetSuperscope *)it->second)->GetCh(); - return; - } + std::map widgets = visitor_->GetWidgets(); + for (std::map::iterator it = widgets.begin(); + it != widgets.end(); it++) { + if (it->second->GetWidgetBase() == widget_base_ && + ((WidgetSuperscope *)it->second)->GetCh() >= 0) { + ch_ = ((WidgetSuperscope *)it->second)->GetCh(); + return; } - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - if((int)lcd->special_chars.size() >= lcd->CHARS) { - LCDError("Can not allot char for widget: %s", name_.c_str()); - update_ = -1; - return; - } - lcd->special_chars.push_back(SpecialChar(lcd->YRES)); - ch_ = lcd->special_chars.size() - 1; + } + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("Can not allot char for widget: %s", name_.c_str()); + update_ = -1; + return; + } + lcd->special_chars.push_back(SpecialChar(lcd->YRES)); + ch_ = lcd->special_chars.size() - 1; } void WidgetSuperscope::Update() { - - - if(Draw) Draw(this); + + if (Draw) + Draw(this); } void WidgetSuperscope::Start() { - if(update_ < 0) - return; - std::map widgets; - widgets = visitor_->GetWidgets(); - for(std::map::iterator it = widgets.begin(); - it != widgets.end() && lcd_type_ == LCD_TEXT; it++) { - if(it->second->GetWidgetBase() == widget_base_ && - it->second->GetStarted()) { - started_ = true; - break; - } + if (update_ < 0) + return; + std::map widgets; + widgets = visitor_->GetWidgets(); + for (std::map::iterator it = widgets.begin(); + it != widgets.end() && lcd_type_ == LCD_TEXT; it++) { + if (it->second->GetWidgetBase() == widget_base_ && + it->second->GetStarted()) { + started_ = true; + break; } - if(!started_) { - timer_->Start(); - started_ = true; - } - Update(); + } + if (!started_) { + timer_->Start(); + started_ = true; + } + Update(); } void WidgetSuperscope::Stop() { - timer_->Stop(); - started_ = false; - ch_ = -1; + timer_->Stop(); + started_ = false; + ch_ = -1; } -int lv_superscope_render (SuperScopePrivate *priv, VisVideo *video, VisAudio *audio) -{ - SuperScopePrivate *priv = visual_plugin_get_private (plugin); - LVAVSPipeline *pipeline = priv->pipeline; - int *buf = pipeline->framebuffer; - int isBeat; - int i; - - VisBuffer pcm; - float pcmbuf[BEAT_ADV_MAX]; - int size = BEAT_ADV_MAX/2; +int lv_superscope_render(SuperScopePrivate *priv, VisVideo *video, + VisAudio *audio) { + SuperScopePrivate *priv = visual_plugin_get_private(plugin); + LVAVSPipeline *pipeline = priv->pipeline; + int *buf = pipeline->framebuffer; + int isBeat; + int i; + + VisBuffer pcm; + float pcmbuf[BEAT_ADV_MAX]; + int size = BEAT_ADV_MAX / 2; + + isBeat = pipeline->isBeat; + + if (priv->needs_init) { + priv->needs_init = FALSE; + scope_run(priv, SCOPE_RUNNABLE_INIT); + } + + int a, l, lx = 0, ly = 0, x = 0, y = 0; + int32_t current_color; + int ws = (priv->channel_source & 4) ? 1 : 0; + int xorv = (ws * 128) ^ 128; + uint16_t fa_data[576]; + + if ((priv->channel_source & 3) >= 2) { + for (x = 0; x < size; x++) { + pcmbuf[x] = pipeline->audiodata[ws ^ 1][0][x] / 2 + + pipeline->audiodata[ws ^ 1][1][x] / 2; + } + } else { + for (x = 0; x < size; x++) { + pcmbuf[x] = pipeline->audiodata[ws ^ 1][priv->channel_source & 3][x]; + } + } - isBeat = pipeline->isBeat; + priv->color_pos++; - if(priv->needs_init) { - priv->needs_init = FALSE; - scope_run(priv, SCOPE_RUNNABLE_INIT); - } + if (priv->color_pos >= priv->pal.ncolors * 64) + priv->color_pos = 0; - int a, l, lx = 0, ly = 0, x = 0, y = 0; - int32_t current_color; - int ws=(priv->channel_source&4)?1:0; - int xorv=(ws*128)^128; - uint16_t fa_data[576]; - - if((priv->channel_source&3) >= 2) - { - for(x = 0; x < size; x++) { - pcmbuf[x] = pipeline->audiodata[ws^1][0][x] / 2 + pipeline->audiodata[ws^1][1][x] / 2; - } - } - else - { - for(x = 0; x < size; x++) { - pcmbuf[x] = pipeline->audiodata[ws^1][priv->channel_source&3][x]; - } - } - - priv->color_pos++; - - if(priv->color_pos >= priv->pal.ncolors * 64) priv->color_pos = 0; - - { - int p = priv->color_pos/64; - int r = priv->color_pos&63; - int c1, c2; - int r1, r2, r3; - c1 = visual_color_to_uint32(&priv->pal.colors[p]); - if(p+1 < priv->pal.ncolors) - c2=visual_color_to_uint32(&priv->pal.colors[p+1]); + { + int p = priv->color_pos / 64; + int r = priv->color_pos & 63; + int c1, c2; + int r1, r2, r3; + c1 = visual_color_to_uint32(&priv->pal.colors[p]); + if (p + 1 < priv->pal.ncolors) + c2 = visual_color_to_uint32(&priv->pal.colors[p + 1]); diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetSuperscope.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetSuperscope.h index 7f13670be..5c9434e78 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetSuperscope.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetSuperscope.h @@ -43,54 +43,56 @@ class LCDGraphic; class LCDCore; class WidgetSuperscope : public Widget { - public: - Property *visible_; - std::string init_, beat_, frame_, point_; - int update_; - int ch_; - int index_; - int channel_source; - int drawmode; - VisPalette *pal; - - double n, b, x, y, i, v, w, h, red, green, blue, linesize, skip, drawmode, t, d; - - SpecialChar *bitmap_; - VisVideo *video_; - LCDTimer *timer_; - - void (*Draw)(WidgetSuperscope *); - - WidgetSuperscope(LCDCore *visitor, std::string name, Json::Value *section, int row, int col, int layer); - ~WidgetSuperscope(); - void SetupChars(); - void Start(); - void Stop(); - SpecialChar GetBitmap() { return *bitmap_; } - int GetCh() { return ch_; } - Property *GetVisible() { return visible_; } - - void Update(); - void TextScroll() {} - - void Resize(int rows, int cols, int old_rows, int old_cols); +public: + Property *visible_; + std::string init_, beat_, frame_, point_; + int update_; + int ch_; + int index_; + int channel_source; + int drawmode; + VisPalette *pal; + + double n, b, x, y, i, v, w, h, red, green, blue, linesize, skip, drawmode, t, + d; + + SpecialChar *bitmap_; + VisVideo *video_; + LCDTimer *timer_; + + void (*Draw)(WidgetSuperscope *); + + WidgetSuperscope(LCDCore *visitor, std::string name, Json::Value *section, + int row, int col, int layer); + ~WidgetSuperscope(); + void SetupChars(); + void Start(); + void Stop(); + SpecialChar GetBitmap() { return *bitmap_; } + int GetCh() { return ch_; } + Property *GetVisible() { return visible_; } + + void Update(); + void TextScroll() {} + + void Resize(int rows, int cols, int old_rows, int old_cols); }; -inline std::vector &Split(const std::string &s, char delim, std::vector &elems) { - std::stringstream ss(s); - std::string item; - while(std::getline(ss, item, delim)) { - elems.push_back(item); - } - return elems; +inline std::vector &Split(const std::string &s, char delim, + std::vector &elems) { + std::stringstream ss(s); + std::string item; + while (std::getline(ss, item, delim)) { + elems.push_back(item); + } + return elems; } inline std::vector Split(const std::string &s, char delim) { - std::vector elems; - return Split(s, delim, elems); + std::vector elems; + return Split(s, delim, elems); } -}; // End namespace - +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetText.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetText.cpp index 4191a7574..5c14fe42f 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetText.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetText.cpp @@ -40,417 +40,414 @@ extern void TextDraw(WidgetText *w); extern void GraphicDraw(WidgetText *w); template -std::string to_string(T t, std::ios_base & (*f)(std::ios_base&), int precision) -{ +std::string to_string(T t, std::ios_base &(*f)(std::ios_base &), + int precision) { std::ostringstream oss; oss.setf(std::ios_base::floatfield, std::ios::fixed); oss << std::setprecision(precision) << f << t; return oss.str(); } -void text_update(void *data) -{ - WidgetText *text = (WidgetText *)data; - text->Update(); +void text_update(void *data) { + WidgetText *text = (WidgetText *)data; + text->Update(); } -void text_scroll(void *data) -{ - WidgetText *text = (WidgetText *)data; - text->TextScroll(); +void text_scroll(void *data) { + WidgetText *text = (WidgetText *)data; + text->TextScroll(); } WidgetText::WidgetText(LCDCore *v, std::string name, Json::Value *config, - int row, int col, int layer) : Widget(v, name, config, row, col, layer, - WIDGET_TYPE_TEXT | WIDGET_TYPE_RC) { - - if(lcd_type_ == LCD_TEXT) - Draw = TextDraw; - else if (lcd_type_ == LCD_GRAPHIC) - Draw = GraphicDraw; - - - string_ = ""; - offset_ = 0; - - prefix_ = new Property(v, section_, "prefix", new Json::Value("")); - postfix_ = new Property(v, section_, "postfix", new Json::Value("")); - style_ = new Property(v, section_, "style", new Json::Value("")); - value_ = new Property(v, section_, "expression", new Json::Value("")); - - fg_valid_ = WidgetColor(section_, "foreground", &fg_color_); - bg_valid_ = WidgetColor(section_, "background", &bg_color_); - - Json::Value *val; - val = v->CFG_Fetch(section_, "length", new Json::Value(10)); - cols_ = val->asInt(); - rows_ = 1; - delete val; - - if( col_ + cols_ >= v->GetLCD()->LCOLS) { - int diff = (col_ + cols_) - v->GetLCD()->LCOLS; - cols_-=diff; - } - - scroll_ = cols_; - - if( lcd_type_ == LCD_TEXT && cols_ + col_ >= v->GetLCD()->LCOLS ) { - cols_ -= cols_ + col - v->GetLCD()->LCOLS; - } else if (lcd_type_ == LCD_GRAPHIC && cols_ + col_ >= - v->GetLCD()->LCOLS / v->GetLCD()->XRES ) { - cols_ -= cols_ + col_ - - v->GetLCD()->LCOLS / v->GetLCD()->XRES; - } - - val = v->CFG_Fetch(section_, "precision", new Json::Value(0xBABE)); - precision_ = val->asInt(); - delete val; - - val = v->CFG_Fetch_Raw(section_, "align", new Json::Value("L")); - const char *c = val->asCString(); - switch ((*c)) { - case 'L': - align_ = ALIGN_LEFT; - break; - case 'C': - align_ = ALIGN_CENTER; - break; - case 'R': - align_ = ALIGN_RIGHT; - break; - case 'M': - align_ = ALIGN_MARQUEE; - break; - case 'A': - align_ = ALIGN_AUTOMATIC; - break; - case 'P': - align_ = ALIGN_PINGPONG; - break; - default: - LCDError("widget %s has unknown alignment '%s', using 'L'", widget_base_.c_str(), c); - align_ = ALIGN_LEFT; - } - delete val; - - val = v->CFG_Fetch(section_, "direction", new Json::Value(SCROLL_RIGHT)); - direction_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "update", new Json::Value(1000)); - update_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "speed", new Json::Value(500)); - speed_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "bold", new Json::Value(0)); - bold_ = val->asInt(); - delete val; - - timer_ = v->timers_->AddTimer(text_update, this, update_, true); - scroll_timer_ = v->timers_->AddTimer(text_scroll, this, speed_, true); + int row, int col, int layer) + : Widget(v, name, config, row, col, layer, + WIDGET_TYPE_TEXT | WIDGET_TYPE_RC) { + + if (lcd_type_ == LCD_TEXT) + Draw = TextDraw; + else if (lcd_type_ == LCD_GRAPHIC) + Draw = GraphicDraw; + + string_ = ""; + offset_ = 0; + + prefix_ = new Property(v, section_, "prefix", new Json::Value("")); + postfix_ = new Property(v, section_, "postfix", new Json::Value("")); + style_ = new Property(v, section_, "style", new Json::Value("")); + value_ = new Property(v, section_, "expression", new Json::Value("")); + + fg_valid_ = WidgetColor(section_, "foreground", &fg_color_); + bg_valid_ = WidgetColor(section_, "background", &bg_color_); + + Json::Value *val; + val = v->CFG_Fetch(section_, "length", new Json::Value(10)); + cols_ = val->asInt(); + rows_ = 1; + delete val; + + if (col_ + cols_ >= v->GetLCD()->LCOLS) { + int diff = (col_ + cols_) - v->GetLCD()->LCOLS; + cols_ -= diff; + } + + scroll_ = cols_; + + if (lcd_type_ == LCD_TEXT && cols_ + col_ >= v->GetLCD()->LCOLS) { + cols_ -= cols_ + col - v->GetLCD()->LCOLS; + } else if (lcd_type_ == LCD_GRAPHIC && + cols_ + col_ >= v->GetLCD()->LCOLS / v->GetLCD()->XRES) { + cols_ -= cols_ + col_ - v->GetLCD()->LCOLS / v->GetLCD()->XRES; + } + + val = v->CFG_Fetch(section_, "precision", new Json::Value(0xBABE)); + precision_ = val->asInt(); + delete val; + + val = v->CFG_Fetch_Raw(section_, "align", new Json::Value("L")); + const char *c = val->asCString(); + switch ((*c)) { + case 'L': + align_ = ALIGN_LEFT; + break; + case 'C': + align_ = ALIGN_CENTER; + break; + case 'R': + align_ = ALIGN_RIGHT; + break; + case 'M': + align_ = ALIGN_MARQUEE; + break; + case 'A': + align_ = ALIGN_AUTOMATIC; + break; + case 'P': + align_ = ALIGN_PINGPONG; + break; + default: + LCDError("widget %s has unknown alignment '%s', using 'L'", + widget_base_.c_str(), c); + align_ = ALIGN_LEFT; + } + delete val; + + val = v->CFG_Fetch(section_, "direction", new Json::Value(SCROLL_RIGHT)); + direction_ = val->asInt(); + delete val; + + val = v->CFG_Fetch(section_, "update", new Json::Value(1000)); + update_ = val->asInt(); + delete val; + + val = v->CFG_Fetch(section_, "speed", new Json::Value(500)); + speed_ = val->asInt(); + delete val; + + val = v->CFG_Fetch(section_, "bold", new Json::Value(0)); + bold_ = val->asInt(); + delete val; + + timer_ = v->timers_->AddTimer(text_update, this, update_, true); + scroll_timer_ = v->timers_->AddTimer(text_scroll, this, speed_, true); } - WidgetText::~WidgetText() { - Stop(); - delete prefix_; - delete postfix_; - delete style_; - delete value_; + Stop(); + delete prefix_; + delete postfix_; + delete style_; + delete value_; } void WidgetText::Resize(int rows, int cols, int old_rows, int old_cols) { - LCDInfo("WidgetText::REsize"); - int xres = visitor_->GetLCD()->XRES; - int yres = visitor_->GetLCD()->YRES; - float x = cols_ * xres / (float)old_cols; - float r = row_ * yres / (float)old_rows; - float c = col_ * xres / (float)old_cols; - LCDInfo("WidgetText::REsize cols: %d, row: %d, col: %d, x: %f, r: %f, c: %f", cols_, row_, col_, x, r, c); - cols_ = (int)((cols * x / xres) + 0.5); - row_ = (int)((rows * r / yres) + 0.5); - col_ = (int)((cols * c / xres) + 0.5); - LCDInfo("WidgetText::REsize cols: %d, row: %d, col: %d, x: %f, r: %f, c: %f", cols_, row_, col_, x, r, c); - Update(); + LCDInfo("WidgetText::REsize"); + int xres = visitor_->GetLCD()->XRES; + int yres = visitor_->GetLCD()->YRES; + float x = cols_ * xres / (float)old_cols; + float r = row_ * yres / (float)old_rows; + float c = col_ * xres / (float)old_cols; + LCDInfo("WidgetText::REsize cols: %d, row: %d, col: %d, x: %f, r: %f, c: %f", + cols_, row_, col_, x, r, c); + cols_ = (int)((cols * x / xres) + 0.5); + row_ = (int)((rows * r / yres) + 0.5); + col_ = (int)((cols * c / xres) + 0.5); + LCDInfo("WidgetText::REsize cols: %d, row: %d, col: %d, x: %f, r: %f, c: %f", + cols_, row_, col_, x, r, c); + Update(); } -void WidgetText::TextScroll() -{ - - std::string pre = prefix_->P2S(); - std::string post = postfix_->P2S(); - - std::string str = string_; - - - int num, len, width, pad; - int srcPtr = 0, dstPtr = 0; - std::string src, dst; - - num = 0; - len = str.length(); - width = cols_ - pre.length() - post.length(); - if (width < 0) - width = 0; - - if(direction_ == SCROLL_RIGHT && (align_ == ALIGN_MARQUEE || align_ == ALIGN_PINGPONG || align_ == ALIGN_AUTOMATIC)) { - offset_++; - } else if (align_ == ALIGN_MARQUEE || align_ == ALIGN_PINGPONG || align_ == ALIGN_AUTOMATIC) { - offset_--; +void WidgetText::TextScroll() { + + std::string pre = prefix_->P2S(); + std::string post = postfix_->P2S(); + + std::string str = string_; + + int num, len, width, pad; + int srcPtr = 0, dstPtr = 0; + std::string src, dst; + + num = 0; + len = str.length(); + width = cols_ - pre.length() - post.length(); + if (width < 0) + width = 0; + + if (direction_ == SCROLL_RIGHT && + (align_ == ALIGN_MARQUEE || align_ == ALIGN_PINGPONG || + align_ == ALIGN_AUTOMATIC)) { + offset_++; + } else if (align_ == ALIGN_MARQUEE || align_ == ALIGN_PINGPONG || + align_ == ALIGN_AUTOMATIC) { + offset_--; + } + + if (abs(offset_) <= visitor_->GetLCD()->XRES && + (align_ == ALIGN_MARQUEE || align_ == ALIGN_PINGPONG || + (align_ == ALIGN_AUTOMATIC && len > width))) { + if (Draw != NULL) { + Draw(this); + return; } - - if(abs(offset_) <= visitor_->GetLCD()->XRES && (align_ == ALIGN_MARQUEE || align_ == ALIGN_PINGPONG || (align_ == ALIGN_AUTOMATIC && len > width))) { - if(Draw != NULL) { - Draw(this); - return; - } - } else { - offset_ = 0; + } else { + offset_ = 0; + } + + switch (align_) { + case ALIGN_LEFT: + pad = 0; + break; + case ALIGN_CENTER: + pad = (width - len) / 2; + if (pad < 0) + pad = 0; + break; + case ALIGN_RIGHT: + pad = width - len; + if (pad < 0) + pad = 0; + break; + case ALIGN_AUTOMATIC: + if (len <= width) { + pad = 0; + break; } - - switch (align_) { - case ALIGN_LEFT: - pad = 0; - break; - case ALIGN_CENTER: - pad = (width - len) / 2; - if (pad < 0) - pad = 0; - break; - case ALIGN_RIGHT: - pad = width - len; - if (pad < 0) - pad = 0; - break; - case ALIGN_AUTOMATIC: - if (len <= width) { - pad = 0; - break; - } - case ALIGN_MARQUEE: - pad = width - scroll_; - scroll_++; - if (scroll_ >= width + len) - scroll_ = cols_; - break; - case ALIGN_PINGPONG: + case ALIGN_MARQUEE: + pad = width - scroll_; + scroll_++; + if (scroll_ >= width + len) + scroll_ = cols_; + break; + case ALIGN_PINGPONG: #define PINGPONGWAIT 2 - /* scrolling is not necessary - center the str */ - if (len <= width) { - pad = (width - len) / 2; - } else { - if (direction_ == SCROLL_RIGHT) - scroll_++; /* scroll right */ - else - scroll_--; /* scroll left */ - - /*pad = if positive, add leading space characters, else offset of str begin */ - pad = 0 - scroll_; - - if (pad < 0 - (len - width)) { - if (delay_-- < 1) { /* wait before switch direction */ - direction_ = SCROLL_LEFT; /* change scroll direction */ - delay_ = PINGPONGWAIT; - scroll_ -= PINGPONGWAIT; - } /* else debug("wait1"); */ - pad = 0 - (len - width); - } else if (pad > 0) { - if (delay_-- < 1) { - direction_ = SCROLL_RIGHT; - delay_ = PINGPONGWAIT; - scroll_ += PINGPONGWAIT; - } /* else debug("wait2"); */ - pad = 0; - } - - } - break; - default: /* not reached */ + /* scrolling is not necessary - center the str */ + if (len <= width) { + pad = (width - len) / 2; + } else { + if (direction_ == SCROLL_RIGHT) + scroll_++; /* scroll right */ + else + scroll_--; /* scroll left */ + + /*pad = if positive, add leading space characters, else offset of str + * begin */ + pad = 0 - scroll_; + + if (pad < 0 - (len - width)) { + if (delay_-- < 1) { /* wait before switch direction */ + direction_ = SCROLL_LEFT; /* change scroll direction */ + delay_ = PINGPONGWAIT; + scroll_ -= PINGPONGWAIT; + } /* else debug("wait1"); */ + pad = 0 - (len - width); + } else if (pad > 0) { + if (delay_-- < 1) { + direction_ = SCROLL_RIGHT; + delay_ = PINGPONGWAIT; + scroll_ += PINGPONGWAIT; + } /* else debug("wait2"); */ pad = 0; + } } + break; + default: /* not reached */ + pad = 0; + } + + dst.clear(); + dst.resize(cols_); + + for (int i = 0; i < cols_; i++) { + dst[i] = ' '; + } + + dstPtr = 0; + srcPtr = 0; + + num = 0; + + /* process prefix */ + /* + src = pre; + while (num < cols_) { + if (srcPtr == (int)src.length()) + break; + dst[dstPtr++] = src[srcPtr++]; + num++; + } + */ + + src = str; + srcPtr = 0; + + int offset = pad; + if (offset < 0) + offset = 0; + /* wrap around on the beginning */ + /* + while (pad > 0 && num < cols_) { + if(align_ == ALIGN_MARQUEE) + dst[dstPtr++] = src[(src.size() - offset) + srcPtr++]; + else + dst[dstPtr++] = ' '; + num++; + pad--; + } + */ + + /* skip src chars (marquee) */ + std::string tmp = src; + while (pad < 0 && tmp != "") { + src = tmp.substr(1, tmp.length()); + tmp = src; + pad++; + } + + /* copy content */ + while (num < cols_) { + if (srcPtr >= (int)src.length()) + break; + dst[dstPtr++] = src[srcPtr++]; + num++; + } + + /* wrap around on end */ + src = post; + len = src.length(); + srcPtr = 0; + if (num < cols_ - len && align_ == ALIGN_MARQUEE) { + dst[dstPtr++] = '*'; + num++; + } + + // Pad end + /* + while (num < cols_ - len) { + if(align_ == ALIGN_MARQUEE) + dst[dstPtr++] = str[srcPtr++]; + else + dst[dstPtr++] = ' '; + num++; + } + */ + + srcPtr = 0; + + /* process postfix */ + /* + while (num < cols_) { + if (srcPtr >= (int)src.length()) + break; + dst[dstPtr++] = src[srcPtr++]; + num++; + } + */ + buffer_ = dst; + + /* finally, draw it! */ + if (Draw) + Draw(this); + else + LCDError("WidgetText: No draw method."); +} - dst.clear(); - dst.resize(cols_); - - for(int i = 0; i < cols_; i++) - { - dst[i] = ' '; - } - - dstPtr = 0; - srcPtr = 0; - - num = 0; - - - /* process prefix */ -/* - src = pre; - while (num < cols_) { - if (srcPtr == (int)src.length()) - break; - dst[dstPtr++] = src[srcPtr++]; - num++; - } -*/ - - src = str; - srcPtr = 0; - - int offset = pad; - if(offset < 0) - offset = 0; - /* wrap around on the beginning */ -/* - while (pad > 0 && num < cols_) { - if(align_ == ALIGN_MARQUEE) - dst[dstPtr++] = src[(src.size() - offset) + srcPtr++]; - else - dst[dstPtr++] = ' '; - num++; - pad--; - } -*/ - - /* skip src chars (marquee) */ - std::string tmp = src; - while (pad < 0 && tmp != "") { - src = tmp.substr(1, tmp.length()); - tmp = src; - pad++; - } - - /* copy content */ - while (num < cols_) { - if (srcPtr >= (int)src.length()) - break; - dst[dstPtr++] = src[srcPtr++]; - num++; - } - - /* wrap around on end */ - src = post; - len = src.length(); - srcPtr = 0; - if(num < cols_ - len && align_ == ALIGN_MARQUEE) { - dst[dstPtr++] = '*'; - num++; - } - - // Pad end -/* - while (num < cols_ - len) { - if(align_ == ALIGN_MARQUEE) - dst[dstPtr++] = str[srcPtr++]; - else - dst[dstPtr++] = ' '; - num++; +void WidgetText::Update() { + std::string str; + int update = 0; + + /* evaluate properties */ + update += prefix_->Eval(); + update += postfix_->Eval(); + update += style_->Eval(); + + /* evaluate value */ + value_->Eval(); + + /* str or number? */ + if (precision_ == 0xBABE) { + str = value_->P2S(); + } else { + double number = value_->P2N(); + int width = cols_ - prefix_->P2S().size() - postfix_->P2S().size(); + int precision = precision_; + /* print zero bytes so we can specify NULL as target */ + /* and get the length of the resulting str */ + int size = snprintf((char *)NULL, 0, (char *)"%.*f", precision, number); + /* number does not fit into field width: try to reduce precision */ + if (width < 0) + width = 0; + if (size > width && precision > 0) { + int delta = size - width; + if (delta > precision) + delta = precision; + precision -= delta; + size -= delta; + /* zero precision: omit decimal point, too */ + if (precision == 0) + size--; } -*/ - - srcPtr = 0; - - /* process postfix */ -/* - while (num < cols_) { - if (srcPtr >= (int)src.length()) - break; - dst[dstPtr++] = src[srcPtr++]; - num++; + /* number still doesn't fit: display '*****' */ + if (size > width) { + str.resize(width); + for (int i = 0; i < width; i++) + str[i] = '*'; + } else { + str = to_string(number, std::dec, precision); } -*/ - buffer_ = dst; - - /* finally, draw it! */ - if (Draw) - Draw(this); - else - LCDError("WidgetText: No draw method."); -} - -void WidgetText::Update() -{ - std::string str; - int update = 0; + } - /* evaluate properties */ - update += prefix_->Eval(); - update += postfix_->Eval(); - update += style_->Eval(); + if (string_.empty() || str != string_) { + update++; + string_ = str; + } - /* evaluate value */ - value_->Eval(); + /* something has changed and should be updated */ + if (update) { - /* str or number? */ - if (precision_ == 0xBABE) { - str = value_->P2S(); - } else { - double number = value_->P2N(); - int width = cols_ - prefix_->P2S().size() - postfix_->P2S().size(); - int precision = precision_; - /* print zero bytes so we can specify NULL as target */ - /* and get the length of the resulting str */ - int size = snprintf((char *)NULL, 0, (char *)"%.*f", precision, number); - /* number does not fit into field width: try to reduce precision */ - if (width < 0) - width = 0; - if (size > width && precision > 0) { - int delta = size - width; - if (delta > precision) - delta = precision; - precision -= delta; - size -= delta; - /* zero precision: omit decimal point, too */ - if (precision == 0) - size--; - } - /* number still doesn't fit: display '*****' */ - if (size > width) { - str.resize(width); - for(int i = 0; i < width; i++) - str[i] = '*'; - } else { - str = to_string(number, std::dec, precision); - } + /* Init pingpong scroller. start scrolling left (wrong way) to get a delay + */ + if (align_ == ALIGN_PINGPONG) { + direction_ = 0; + delay_ = PINGPONGWAIT; } - - if (string_.empty() || str != string_ ) { - update++; - string_ = str; - } - - /* something has changed and should be updated */ - if (update) { - - /* Init pingpong scroller. start scrolling left (wrong way) to get a delay */ - if (align_ == ALIGN_PINGPONG) { - direction_ = 0; - delay_ = PINGPONGWAIT; - } - /* if there's a marquee scroller active, it has its own */ - /* update callback timer, so we do nothing here; otherwise */ - /* we simply call this scroll callback directly */ - if (align_ != ALIGN_MARQUEE || align_ != ALIGN_AUTOMATIC || - align_ != ALIGN_PINGPONG) { - TextScroll(); - } - + /* if there's a marquee scroller active, it has its own */ + /* update callback timer, so we do nothing here; otherwise */ + /* we simply call this scroll callback directly */ + if (align_ != ALIGN_MARQUEE || align_ != ALIGN_AUTOMATIC || + align_ != ALIGN_PINGPONG) { + TextScroll(); } - + } } void WidgetText::Start() { - timer_->Start(); - scroll_timer_->Start(); - Update(); + timer_->Start(); + scroll_timer_->Start(); + Update(); } void WidgetText::Stop() { - timer_->Stop(); - scroll_timer_->Stop(); + timer_->Stop(); + scroll_timer_->Stop(); } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetText.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetText.h index 240ca16c7..ab33c5baf 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetText.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetText.h @@ -35,49 +35,56 @@ namespace LCD { class LCDCore; -typedef enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT, ALIGN_MARQUEE, ALIGN_AUTOMATIC, ALIGN_PINGPONG } TEXT_ALIGN; +typedef enum { + ALIGN_LEFT, + ALIGN_CENTER, + ALIGN_RIGHT, + ALIGN_MARQUEE, + ALIGN_AUTOMATIC, + ALIGN_PINGPONG +} TEXT_ALIGN; typedef enum { SCROLL_RIGHT, SCROLL_LEFT } SCROLL_DIRECTION; class WidgetText : public Widget { - Property *prefix_; /* label on the left side */ - Property *postfix_; /* label on the right side */ - Property *value_; /* value of text widget */ - Property *style_; /* text style (plain/bold/slant) */ - std::string string_; /* formatted value */ - std::string buffer_; /* string with 'width+1' bytes allocated */ - int offset_; /* Increment by pixel */ - int precision_; /* number of digits after the decimal point */ - TEXT_ALIGN align_; /* alignment: L(eft), C(enter), R(ight), M(arquee), A(utomatic) */ - int update_; /* update interval */ - int scroll_; /* marquee starting point */ - int speed_; /* marquee scrolling speed */ - int direction_; /* pingpong direction, 0=right, 1=left */ - int delay_; /* pingpong scrolling, wait before switch direction */ - bool bold_; + Property *prefix_; /* label on the left side */ + Property *postfix_; /* label on the right side */ + Property *value_; /* value of text widget */ + Property *style_; /* text style (plain/bold/slant) */ + std::string string_; /* formatted value */ + std::string buffer_; /* string with 'width+1' bytes allocated */ + int offset_; /* Increment by pixel */ + int precision_; /* number of digits after the decimal point */ + TEXT_ALIGN + align_; /* alignment: L(eft), C(enter), R(ight), M(arquee), A(utomatic) */ + int update_; /* update interval */ + int scroll_; /* marquee starting point */ + int speed_; /* marquee scrolling speed */ + int direction_; /* pingpong direction, 0=right, 1=left */ + int delay_; /* pingpong scrolling, wait before switch direction */ + bool bold_; - LCDTimer *timer_; - LCDTimer *scroll_timer_; + LCDTimer *timer_; + LCDTimer *scroll_timer_; - public: - WidgetText(LCDCore *visitor, std::string name, Json::Value *section, - int row, int col, int layer); - ~WidgetText(); - void (*Draw)(WidgetText *w); - std::string GetBuffer() { return buffer_; } - int GetOffset() { return offset_; } - int GetDirection() { return direction_; } - bool GetBold() { return bold_; } - void Start(); - void Stop(); +public: + WidgetText(LCDCore *visitor, std::string name, Json::Value *section, int row, + int col, int layer); + ~WidgetText(); + void (*Draw)(WidgetText *w); + std::string GetBuffer() { return buffer_; } + int GetOffset() { return offset_; } + int GetDirection() { return direction_; } + bool GetBold() { return bold_; } + void Start(); + void Stop(); - // Slots - void Update(); - void TextScroll(); + // Slots + void Update(); + void TextScroll(); - void Resize(int rows, int cols, int old_rows, int old_cols); + void Resize(int rows, int cols, int old_rows, int old_cols); }; -}; // End namespace - +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetTimer.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetTimer.cpp index 7e857180b..452066680 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetTimer.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetTimer.cpp @@ -34,43 +34,41 @@ using namespace LCD; -WidgetTimer::WidgetTimer(LCDCore *v, std::string n, Json::Value *section) : - Widget(v, n, section, 0, 0, 0, WIDGET_TYPE_TIMER) { +WidgetTimer::WidgetTimer(LCDCore *v, std::string n, Json::Value *section) + : Widget(v, n, section, 0, 0, 0, WIDGET_TYPE_TIMER) { - expression_ = new Property(v, section, "expression", new Json::Value("")); + expression_ = new Property(v, section, "expression", new Json::Value("")); - Json::Value *val = v->CFG_Fetch(section, "update", new Json::Value(-1)); - update_ = val->asInt(); - delete val; + Json::Value *val = v->CFG_Fetch(section, "update", new Json::Value(-1)); + update_ = val->asInt(); + delete val; -/* - timer_ = new QTimer(); - timer_->setSingleShot(false); - timer_->setInterval(update_); - //QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); -*/ + /* + timer_ = new QTimer(); + timer_->setSingleShot(false); + timer_->setInterval(update_); + //QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); + */ } WidgetTimer::~WidgetTimer() { - Stop(); - delete expression_; + Stop(); + delete expression_; } void WidgetTimer::Start() { - if( update_ < 0) - return; - //timer_->start(); - Update(); + if (update_ < 0) + return; + // timer_->start(); + Update(); } void WidgetTimer::Stop() { - //timer_->stop(); + // timer_->stop(); } void WidgetTimer::Update() { - if(!expression_->Valid()) - return; - expression_->Eval(); + if (!expression_->Valid()) + return; + expression_->Eval(); } - - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetTimer.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetTimer.h index 80e4e8d86..2005d78ed 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetTimer.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetTimer.h @@ -35,21 +35,20 @@ namespace LCD { class LCDCore; class WidgetTimer : public Widget { - Property *expression_; - //QTimer *timer_; - int update_; - - public: - WidgetTimer(LCDCore *visitor, std::string name, Json::Value *config); - ~WidgetTimer(); - void Start(); - void Stop(); - - void Update(); - void TextScroll() {} + Property *expression_; + // QTimer *timer_; + int update_; + +public: + WidgetTimer(LCDCore *visitor, std::string name, Json::Value *config); + ~WidgetTimer(); + void Start(); + void Stop(); + + void Update(); + void TextScroll() {} }; -}; // End namespace - +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetVisualization.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetVisualization.cpp index 538c6d897..9d181e4f1 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetVisualization.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetVisualization.cpp @@ -38,484 +38,477 @@ extern void TextVisualizationDraw(WidgetVisualization *w); extern void GraphicVisualizationDraw(WidgetVisualization *w); -void visualization_update(void *data) -{ - WidgetVisualization *widget = (WidgetVisualization *)data; - widget->Update(); +void visualization_update(void *data) { + WidgetVisualization *widget = (WidgetVisualization *)data; + widget->Update(); } -void visualization_morph_update(void *data) -{ - WidgetVisualization *widget = (WidgetVisualization *)data; - widget->VisualMorph(); - +void visualization_morph_update(void *data) { + WidgetVisualization *widget = (WidgetVisualization *)data; + widget->VisualMorph(); } int VISUALIZATION_CHARS[6][9] = { - {31, 31, 31, 31, 31, 31, 31, 31, -1}, - {21, 14, 31, 14, 31, 14, 31, 10, -1}, - { 0, 14, 4, 14, 4, 14, 4, 0, -1}, - { 0, 0, 4, 14, 14, 4, 0, 0, -1}, - { 0, 0, 0, 4, 4, 0, 0, 0, -1}, - {14, 14, 14, 14, 14, 14, 14, 14, -1} -}; - -WidgetVisualization::WidgetVisualization(LCDCore *v, std::string n, Json::Value *section, int row, int col, int layer) : Widget(v, n, section, row, col, layer, - WIDGET_TYPE_VISUALIZATION | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { - - LCDError("widgetvisualization: layer: %d", layer_); - - if(lcd_type_ == LCD_TEXT) - Draw = TextVisualizationDraw; - else if(lcd_type_ == LCD_GRAPHIC) - Draw = GraphicVisualizationDraw; - else - Draw = 0; - - fg_valid_ = WidgetColor(section, "foreground", &fg_color_); - bg_valid_ = WidgetColor(section, "background", &bg_color_); - - Json::Value *val = v->CFG_Fetch(section, "width", new Json::Value(10)); - cols_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section, "height", new Json::Value(1)); - rows_ = val->asInt(); - delete val; - - val = v->CFG_Fetch_Raw(section, "direction", new Json::Value("E")); - if( val->asString() == "E" ) - direction_ = DIR_EAST; - else if (val->asString() == "W" ) - direction_ = DIR_WEST; - else { - LCDError("Widget %s has unknown direction '%s'; Use (E)ast or (W)est. Using E.", - name_.c_str(), val->asCString()); - direction_ = DIR_EAST; - } - delete val; - - val = v->CFG_Fetch(section, "mono", new Json::Value(0)); - mono_ = val->asInt(); - delete val; - - val = v->CFG_Fetch_Raw(section, "style", new Json::Value("peak")); - if(val->asString() == "peak") { - style_ = STYLE_PEAK; - } else if (val->asString() == "pcm") { - style_ = STYLE_PCM; - } else if (val->asString() == "spectrum") { - style_ = STYLE_SPECTRUM; - } - delete val; + {31, 31, 31, 31, 31, 31, 31, 31, -1}, {21, 14, 31, 14, 31, 14, 31, 10, -1}, + {0, 14, 4, 14, 4, 14, 4, 0, -1}, {0, 0, 4, 14, 14, 4, 0, 0, -1}, + {0, 0, 0, 4, 4, 0, 0, 0, -1}, {14, 14, 14, 14, 14, 14, 14, 14, -1}}; + +WidgetVisualization::WidgetVisualization(LCDCore *v, std::string n, + Json::Value *section, int row, int col, + int layer) + : Widget(v, n, section, row, col, layer, + WIDGET_TYPE_VISUALIZATION | WIDGET_TYPE_RC | WIDGET_TYPE_SPECIAL) { - val = v->CFG_Fetch_Raw(section, "actor", new Json::Value("oinksie")); - actor_plugin_ = val->asString(); - delete val; + LCDError("widgetvisualization: layer: %d", layer_); + + if (lcd_type_ == LCD_TEXT) + Draw = TextVisualizationDraw; + else if (lcd_type_ == LCD_GRAPHIC) + Draw = GraphicVisualizationDraw; + else + Draw = 0; - val = v->CFG_Fetch_Raw(section, "input", new Json::Value("debug")); - input_plugin_ = val->asString(); - delete val; + fg_valid_ = WidgetColor(section, "foreground", &fg_color_); + bg_valid_ = WidgetColor(section, "background", &bg_color_); - val = v->CFG_Fetch_Raw(section, "morph", new Json::Value("alphablend")); - morph_plugin_ = val->asString(); - delete val; + Json::Value *val = v->CFG_Fetch(section, "width", new Json::Value(10)); + cols_ = val->asInt(); + delete val; - val = v->CFG_Fetch(section, "morph-timeout", new Json::Value(4000)); - morph_timeout_ = val->asInt(); - delete val; + val = v->CFG_Fetch(section, "height", new Json::Value(1)); + rows_ = val->asInt(); + delete val; - val = v->CFG_Fetch_Raw(section, "skip-actors", new Json::Value("")); - skip_actors_ = val->asString(); - delete val; + val = v->CFG_Fetch_Raw(section, "direction", new Json::Value("E")); + if (val->asString() == "E") + direction_ = DIR_EAST; + else if (val->asString() == "W") + direction_ = DIR_WEST; + else { + LCDError( + "Widget %s has unknown direction '%s'; Use (E)ast or (W)est. Using E.", + name_.c_str(), val->asCString()); + direction_ = DIR_EAST; + } + delete val; - val = v->CFG_Fetch(section, "alpha", new Json::Value(255)); - alpha_ = val->asInt(); - delete val; + val = v->CFG_Fetch(section, "mono", new Json::Value(0)); + mono_ = val->asInt(); + delete val; - val = v->CFG_Fetch(section, "update", new Json::Value(500)); - update_ = val->asInt(); - delete val; - - history_.resize(rows_); + val = v->CFG_Fetch_Raw(section, "style", new Json::Value("peak")); + if (val->asString() == "peak") { + style_ = STYLE_PEAK; + } else if (val->asString() == "pcm") { + style_ = STYLE_PCM; + } else if (val->asString() == "spectrum") { + style_ = STYLE_SPECTRUM; + } + delete val; - timer_ = v->timers_->AddTimer(visualization_update, this, update_, true); + val = v->CFG_Fetch_Raw(section, "actor", new Json::Value("oinksie")); + actor_plugin_ = val->asString(); + delete val; - morph_timer_ = v->timers_->AddTimer(visualization_morph_update, this, morph_timeout_, true); - last_update_.tv_sec = last_update_.tv_usec = 0; + val = v->CFG_Fetch_Raw(section, "input", new Json::Value("debug")); + input_plugin_ = val->asString(); + delete val; - peak_buffer_ = new char[cols_ * rows_]; - memset(peak_buffer_, 5, cols_ * rows_); + val = v->CFG_Fetch_Raw(section, "morph", new Json::Value("alphablend")); + morph_plugin_ = val->asString(); + delete val; - // -------------------- libvisual related below ----------------- + val = v->CFG_Fetch(section, "morph-timeout", new Json::Value(4000)); + morph_timeout_ = val->asInt(); + delete val; - if(style_ != STYLE_PCM) - return; + val = v->CFG_Fetch_Raw(section, "skip-actors", new Json::Value("")); + skip_actors_ = val->asString(); + delete val; - visual_log_set_verbosity(VISUAL_LOG_DEBUG); + val = v->CFG_Fetch(section, "alpha", new Json::Value(255)); + alpha_ = val->asInt(); + delete val; - bin_ = new LV::Bin(); - bin_->set_supported_depth(VISUAL_VIDEO_DEPTH_ALL); + val = v->CFG_Fetch(section, "update", new Json::Value(500)); + update_ = val->asInt(); + delete val; - bin_->connect(actor_plugin_, input_plugin_); + history_.resize(rows_); - actor_ = bin_->get_actor().get(); + timer_ = v->timers_->AddTimer(visualization_update, this, update_, true); - // Set depth - int depthflag = visual_actor_get_supported_depths(actor_); + morph_timer_ = v->timers_->AddTimer(visualization_morph_update, this, + morph_timeout_, true); + last_update_.tv_sec = last_update_.tv_usec = 0; - depth_ = visual_video_depth_get_highest_nogl(depthflag); + peak_buffer_ = new char[cols_ * rows_]; + memset(peak_buffer_, 5, cols_ * rows_); - // ---- + // -------------------- libvisual related below ----------------- - bin_->set_depth(depth_); + if (style_ != STYLE_PCM) + return; - video_ = visual_video_new_with_buffer(cols_, rows_, depth_); + visual_log_set_verbosity(VISUAL_LOG_DEBUG); - visual_actor_set_video(actor_, video_); + bin_ = new LV::Bin(); + bin_->set_supported_depth(VISUAL_VIDEO_DEPTH_ALL); - visual_actor_video_negotiate(actor_, depth_, FALSE, TRUE); + bin_->connect(actor_plugin_, input_plugin_); - bin_->set_video(video_); - bin_->realize(); - bin_->set_morph(morph_plugin_); - bin_->use_morph(false); - bin_->sync(true); - bin_->depth_changed(); + actor_ = bin_->get_actor().get(); + + // Set depth + int depthflag = visual_actor_get_supported_depths(actor_); + + depth_ = visual_video_depth_get_highest_nogl(depthflag); + + // ---- + + bin_->set_depth(depth_); + + video_ = visual_video_new_with_buffer(cols_, rows_, depth_); + + visual_actor_set_video(actor_, video_); + + visual_actor_video_negotiate(actor_, depth_, FALSE, TRUE); -/* - memset(¤t_songinfo_, 0, sizeof(VisSongInfo)); + bin_->set_video(video_); + bin_->realize(); + bin_->set_morph(morph_plugin_); + bin_->use_morph(false); + bin_->sync(true); + bin_->depth_changed(); - visual_songinfo_init(¤t_songinfo_, VISUAL_SONGINFO_TYPE_NULL); - visual_songinfo_set_simple_name(¤t_songinfo_, (char *)""); - visual_songinfo_set_song(¤t_songinfo_, (char *)""); - visual_songinfo_set_artist(¤t_songinfo_, (char *)""); - visual_songinfo_set_album(¤t_songinfo_, (char *)""); -*/ + /* + memset(¤t_songinfo_, 0, sizeof(VisSongInfo)); - DoParams(); + visual_songinfo_init(¤t_songinfo_, VISUAL_SONGINFO_TYPE_NULL); + visual_songinfo_set_simple_name(¤t_songinfo_, (char *)""); + visual_songinfo_set_song(¤t_songinfo_, (char *)""); + visual_songinfo_set_artist(¤t_songinfo_, (char *)""); + visual_songinfo_set_album(¤t_songinfo_, (char *)""); + */ - LCDError("WidgetVisualization %s", name_.c_str()); + DoParams(); + + LCDError("WidgetVisualization %s", name_.c_str()); } void WidgetVisualization::DoParams() { - // params - Json::Value *actorVal = visitor_->CFG_Fetch_Raw(section_, std::string("params.") + actor_plugin_); - if(actorVal) { - VisActor *actor = visual_bin_get_actor(bin_); - VisPluginData *plugin = visual_actor_get_plugin(actor); - VisParamList *params = visual_plugin_get_params(plugin); - Json::Value::Members members = actorVal->getMemberNames(); - for(std::vector::iterator it = members.begin(); - it != members.end(); it++) { - VisParam *entry = visual_param_list_get(params, it->c_str()); - if(entry) { - Json::Value *val = visitor_->CFG_Fetch_Raw(actorVal, *it); - switch(visual_param_get_type (entry)) { - case VISUAL_PARAM_TYPE_STRING: - if(val->isString()) { - visual_param_set_value_string(entry, (char *)val->asCString()); - } - break; - case VISUAL_PARAM_TYPE_INTEGER: - if(val->isInt()) { - visual_param_set_value_integer(entry, val->asInt()); - } - break; - case VISUAL_PARAM_TYPE_FLOAT: - if(val->isDouble()) { - visual_param_set_value_float(entry, (float)val->asDouble()); - } - break; - case VISUAL_PARAM_TYPE_DOUBLE: - if(val->isDouble()) { - visual_param_set_value_double(entry, val->asDouble()); - } - break; - case VISUAL_PARAM_TYPE_COLOR: - if(val->isString()) { - int r, g, b; - sscanf(val->asCString(), "r=%d,g=%d,b=%d", &r, &g, &b); - VisColor color; - visual_color_set (&color, r, g, b); - visual_param_set_value_color(entry, &color); - } - break; - default: - break; - } - delete val; - } + // params + Json::Value *actorVal = + visitor_->CFG_Fetch_Raw(section_, std::string("params.") + actor_plugin_); + if (actorVal) { + VisActor *actor = visual_bin_get_actor(bin_); + VisPluginData *plugin = visual_actor_get_plugin(actor); + VisParamList *params = visual_plugin_get_params(plugin); + Json::Value::Members members = actorVal->getMemberNames(); + for (std::vector::iterator it = members.begin(); + it != members.end(); it++) { + VisParam *entry = visual_param_list_get(params, it->c_str()); + if (entry) { + Json::Value *val = visitor_->CFG_Fetch_Raw(actorVal, *it); + switch (visual_param_get_type(entry)) { + case VISUAL_PARAM_TYPE_STRING: + if (val->isString()) { + visual_param_set_value_string(entry, (char *)val->asCString()); + } + break; + case VISUAL_PARAM_TYPE_INTEGER: + if (val->isInt()) { + visual_param_set_value_integer(entry, val->asInt()); + } + break; + case VISUAL_PARAM_TYPE_FLOAT: + if (val->isDouble()) { + visual_param_set_value_float(entry, (float)val->asDouble()); + } + break; + case VISUAL_PARAM_TYPE_DOUBLE: + if (val->isDouble()) { + visual_param_set_value_double(entry, val->asDouble()); + } + break; + case VISUAL_PARAM_TYPE_COLOR: + if (val->isString()) { + int r, g, b; + sscanf(val->asCString(), "r=%d,g=%d,b=%d", &r, &g, &b); + VisColor color; + visual_color_set(&color, r, g, b); + visual_param_set_value_color(entry, &color); + } + break; + default: + break; } - delete actorVal; + delete val; + } } + delete actorVal; + } } WidgetVisualization::~WidgetVisualization() { - delete []peak_buffer_; - visual_video_unref(video_); + delete[] peak_buffer_; + visual_video_unref(video_); } -void WidgetVisualization::Resize(int rows, int cols, int old_rows, int old_cols) { - float y = rows_ / (float)old_rows; - float x = cols_ / (float)old_cols; - float r = row_ / (float)old_rows; - float c = col_ / (float)old_cols; - rows_ = round(rows * y); - cols_ = round(cols * x); - row_ = round(rows * r); - col_ = round(cols * c); +void WidgetVisualization::Resize(int rows, int cols, int old_rows, + int old_cols) { + float y = rows_ / (float)old_rows; + float x = cols_ / (float)old_cols; + float r = row_ / (float)old_rows; + float c = col_ / (float)old_cols; + rows_ = round(rows * y); + cols_ = round(cols * x); + row_ = round(rows * r); + col_ = round(cols * c); - visual_video_unref(video_); + visual_video_unref(video_); - // Set depth - int depthflag = visual_actor_get_supported_depths(actor_); + // Set depth + int depthflag = visual_actor_get_supported_depths(actor_); - depth_ = visual_video_depth_get_highest_nogl(depthflag); + depth_ = visual_video_depth_get_highest_nogl(depthflag); - video_ = visual_video_new_with_buffer(cols_, rows_, depth_); + video_ = visual_video_new_with_buffer(cols_, rows_, depth_); - visual_actor_set_video(actor_, video_); + visual_actor_set_video(actor_, video_); - visual_actor_video_negotiate(actor_, depth_, FALSE, TRUE); + visual_actor_video_negotiate(actor_, depth_, FALSE, TRUE); } -void WidgetVisualization::ResizeBefore(int rows, int cols) { - -} - -void WidgetVisualization::ResizeAfter() { -} +void WidgetVisualization::ResizeBefore(int rows, int cols) {} +void WidgetVisualization::ResizeAfter() {} bool WidgetVisualization::MyGetPlaytime(const int &playtime) { - //visual_songinfo_set_elapsed(¤t_songinfo_, playtime); - return false; + // visual_songinfo_set_elapsed(¤t_songinfo_, playtime); + return false; } void WidgetVisualization::SetupChars() { -LCDError("SetupChars"); - ch_.clear(); - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - - int size; - if(style_ == STYLE_PCM) - size = 8; - else if(style_ == STYLE_PEAK) - size = 6; + LCDError("SetupChars"); + ch_.clear(); + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + + int size; + if (style_ == STYLE_PCM) + size = 8; + else if (style_ == STYLE_PEAK) + size = 6; + else + size = 2; + + /* + if(style_ == STYLE_PCM) { + std::map widgets1; + std::map widgets2; + widgets1 = visitor_->GetWidgets(); + widgets2 = visitor_->GetWidgets(); + for(std::map::iterator ii=widgets1.begin(); + ii != widgets1.end(); ii++) { + if(ii->second->GetWidgetBase() == widget_base_ && + ((WidgetVisualization *)ii->second)->HasChars()) { + for(int i = 0; i < size; i++ ) { + ch_[i] = ((WidgetVisualization + *)widgets2[ii->first])->GetChars()[i]; + } + has_chars_ = true; + return; + } + } + } + */ + + if ((int)lcd->special_chars.size() >= lcd->CHARS - size) { + update_ = -1; + LCDError("Widget %s - unable to allocate special chars. CHARS: %d, " + "chars_cache: %" VISUAL_SIZE_T_FORMAT ", size: %d", + name_.c_str(), lcd->CHARS, lcd->special_chars.size(), size); + return; + } + + for (int c = 0; c < size; c++) { + if (style_ != STYLE_PCM) + lcd->special_chars.push_back( + SpecialChar(VISUALIZATION_CHARS[c], lcd->YRES)); else - size = 2; - - -/* - if(style_ == STYLE_PCM) { - std::map widgets1; - std::map widgets2; - widgets1 = visitor_->GetWidgets(); - widgets2 = visitor_->GetWidgets(); - for(std::map::iterator ii=widgets1.begin(); - ii != widgets1.end(); ii++) { - if(ii->second->GetWidgetBase() == widget_base_ && - ((WidgetVisualization *)ii->second)->HasChars()) { - for(int i = 0; i < size; i++ ) { - ch_[i] = ((WidgetVisualization *)widgets2[ii->first])->GetChars()[i]; - } - has_chars_ = true; - return; - } - } - } -*/ - - if( (int)lcd->special_chars.size() >= lcd->CHARS - size) { - update_ = -1; - LCDError("Widget %s - unable to allocate special chars. CHARS: %d, chars_cache: %" VISUAL_SIZE_T_FORMAT ", size: %d", - name_.c_str(), lcd->CHARS, lcd->special_chars.size(), size); - return; - } + lcd->special_chars.push_back(SpecialChar(lcd->YRES)); - for(int c = 0; c < size; c++) { - if(style_ != STYLE_PCM) - lcd->special_chars.push_back(SpecialChar(VISUALIZATION_CHARS[c], lcd->YRES)); - else - lcd->special_chars.push_back(SpecialChar(lcd->YRES)); + ch_[c] = lcd->special_chars.size() - 1; + lcd->TextSpecialCharChanged(ch_[c]); + } - ch_[c] = lcd->special_chars.size() - 1; - lcd->TextSpecialCharChanged(ch_[c]); - } - - has_chars_ = true; + has_chars_ = true; } void WidgetVisualization::Update() { - if(style_ == STYLE_PEAK) - UpdatePeak(); - else if(style_ == STYLE_PCM) - UpdatePCM(); - else if(style_ == STYLE_SPECTRUM) - UpdateSpectrum(); + if (style_ == STYLE_PEAK) + UpdatePeak(); + else if (style_ == STYLE_PCM) + UpdatePCM(); + else if (style_ == STYLE_SPECTRUM) + UpdateSpectrum(); } void WidgetVisualization::UpdatePeak() { -/* - short buffer[2]; - - //int ret = xmmsc_visualization_chunk_get(client_.getConnection(), vis_, buffer, 0, 0); - - if( ret < 0) { - update_ = -1; - Stop(); - LCDError("WidgetVisualization: Unable to get chunk -- stopping."); - return; - } else if (ret == 0) { - return; - } + /* + short buffer[2]; - timeval now; - gettimeofday(&now, 0); - unsigned long time = (now.tv_sec - last_update_.tv_sec) * - 1000 + (now.tv_usec - last_update_.tv_usec) / 1000; + //int ret = xmmsc_visualization_chunk_get(client_.getConnection(), vis_, + buffer, 0, 0); - if(time < (unsigned int)update_ && buffer[0] != 0 && buffer[1] != 0) - return; + if( ret < 0) { + update_ = -1; + Stop(); + LCDError("WidgetVisualization: Unable to get chunk -- stopping."); + return; + } else if (ret == 0) { + return; + } - gettimeofday(&last_update_, 0); + timeval now; + gettimeofday(&now, 0); + unsigned long time = (now.tv_sec - last_update_.tv_sec) * + 1000 + (now.tv_usec - last_update_.tv_usec) / 1000; - std::vector > tmp = history_; + if(time < (unsigned int)update_ && buffer[0] != 0 && buffer[1] != 0) + return; - history_[rows_ - 1][0] = buffer[0]; - history_[rows_ - 1][1] = buffer[1]; + gettimeofday(&last_update_, 0); - for(int i = rows_ - 2; i >= 0; i--) - history_[i] = tmp[i+1]; + std::vector > tmp = history_; - if(Draw) - Draw(this); - else - LCDError("WidgetVisualization: now draw method"); -*/ -} + history_[rows_ - 1][0] = buffer[0]; + history_[rows_ - 1][1] = buffer[1]; + for(int i = rows_ - 2; i >= 0; i--) + history_[i] = tmp[i+1]; -void WidgetVisualization::UpdatePCM() -{ - if(bin_->depth_changed()) - { - // Set depth + if(Draw) + Draw(this); + else + LCDError("WidgetVisualization: now draw method"); + */ +} - int depthflag = visual_actor_get_supported_depths(actor_); - +void WidgetVisualization::UpdatePCM() { + if (bin_->depth_changed()) { + // Set depth - depth_ = visual_video_depth_get_highest_nogl(depthflag); + int depthflag = visual_actor_get_supported_depths(actor_); - visual_video_unref(video_); + depth_ = visual_video_depth_get_highest_nogl(depthflag); - video_ = visual_video_new_with_buffer(cols_, rows_, depth_); + visual_video_unref(video_); - bin_->set_video(video_); + video_ = visual_video_new_with_buffer(cols_, rows_, depth_); - bin_->sync(true); - } + bin_->set_video(video_); + + bin_->sync(true); + } - bin_->run(); + bin_->run(); - if(Draw) - Draw(this); + if (Draw) + Draw(this); } void WidgetVisualization::VisualMorph() { - const char *name = visual_actor_get_next_by_name_nogl(actor_plugin_.c_str()); - LCDError("VisualMorph %s > %s", actor_plugin_.c_str(), name); + const char *name = visual_actor_get_next_by_name_nogl(actor_plugin_.c_str()); + LCDError("VisualMorph %s > %s", actor_plugin_.c_str(), name); - if(!name) - { - name = visual_actor_get_next_by_name_nogl(NULL); - } - - if(strstr(skip_actors_.c_str(), name) != 0) { - actor_plugin_ = name; - VisualMorph(); - return; - } + if (!name) { + name = visual_actor_get_next_by_name_nogl(NULL); + } + if (strstr(skip_actors_.c_str(), name) != 0) { actor_plugin_ = name; + VisualMorph(); + return; + } + + actor_plugin_ = name; - bin_->set_morph(morph_plugin_); - bin_->switch_actor(actor_plugin_); - actor_ = bin_->get_actor().get(); + bin_->set_morph(morph_plugin_); + bin_->switch_actor(actor_plugin_); + actor_ = bin_->get_actor().get(); - DoParams(); + DoParams(); } void WidgetVisualization::UpdateSpectrum() { -/* - short buffer[256]; - - int ret = xmmsc_visualization_chunk_get(client_.getConnection(), vis_, buffer, 0, 0); - - if( ret < 0) { - update_ = -1; - Stop(); - LCDError("WidgetVisualization: Unable to get chunk -- stopping."); - return; - } else if ( ret == 0) { - return; - } - - timeval now; - gettimeofday(&now, 0); - unsigned long time = (now.tv_sec - last_update_.tv_sec) * - 1000 + (now.tv_usec - last_update_.tv_usec) / 1000; - - if(time < (unsigned int)update_) - return; - - gettimeofday(&last_update_, 0); - - for(int i = 0; i < 256; i++) - history_[0][i] = buffer[i]; - - if(Draw) - Draw(this); - else - LCDError("WidgetVisualization: no draw method"); -*/ + /* + short buffer[256]; + + int ret = xmmsc_visualization_chunk_get(client_.getConnection(), vis_, + buffer, 0, 0); + + if( ret < 0) { + update_ = -1; + Stop(); + LCDError("WidgetVisualization: Unable to get chunk -- stopping."); + return; + } else if ( ret == 0) { + return; + } + + timeval now; + gettimeofday(&now, 0); + unsigned long time = (now.tv_sec - last_update_.tv_sec) * + 1000 + (now.tv_usec - last_update_.tv_usec) / 1000; + + if(time < (unsigned int)update_) + return; + + gettimeofday(&last_update_, 0); + + for(int i = 0; i < 256; i++) + history_[0][i] = buffer[i]; + + if(Draw) + Draw(this); + else + LCDError("WidgetVisualization: no draw method"); + */ } void WidgetVisualization::Start() { - if(update_ < 0) - return; - - std::map widgets; - widgets = visitor_->GetWidgets(); - for(std::map::iterator it = - widgets.begin(); - it != widgets.end(); it++) { - if(it->second->GetWidgetBase() == widget_base_ && - it->second->GetLayoutBase() == layout_base_ && - it->second->GetStarted()) { - started_ = true; - break; - } + if (update_ < 0) + return; + + std::map widgets; + widgets = visitor_->GetWidgets(); + for (std::map::iterator it = widgets.begin(); + it != widgets.end(); it++) { + if (it->second->GetWidgetBase() == widget_base_ && + it->second->GetLayoutBase() == layout_base_ && + it->second->GetStarted()) { + started_ = true; + break; } - if(!started_) { - timer_->Start(); - if(morph_timeout_ > 0 && style_ == STYLE_PCM) - morph_timer_->Start(); - started_ = true; - } - //Draw(this); - LCDError("WidgetVisualization::Start %s", name_.c_str()); + } + if (!started_) { + timer_->Start(); + if (morph_timeout_ > 0 && style_ == STYLE_PCM) + morph_timer_->Start(); + started_ = true; + } + // Draw(this); + LCDError("WidgetVisualization::Start %s", name_.c_str()); } void WidgetVisualization::Stop() { - timer_->Stop(); - if(style_ == STYLE_PCM) { - morph_timer_->Stop(); - } - ch_.clear(); - has_chars_ = false; - started_ = false; - LCDError("WidgetVisualization::Stop %s", name_.c_str()); + timer_->Stop(); + if (style_ == STYLE_PCM) { + morph_timer_->Stop(); + } + ch_.clear(); + has_chars_ = false; + started_ = false; + LCDError("WidgetVisualization::Stop %s", name_.c_str()); } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetVisualization.h b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetVisualization.h index 00b4a03f3..693782d34 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/WidgetVisualization.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/WidgetVisualization.h @@ -45,77 +45,76 @@ class LCDCore; class WidgetVisualization : public Widget { - int direction_; - int mono_; - int style_; - int update_; - timeval last_update_; - int vis_; - std::vector > history_; - std::map ch_; - bool has_chars_; - char *peak_buffer_; - - LCDTimer *timer_; - LCDTimer *morph_timer_; - - // libvisual stuff -/* - VisSongInfo current_songinfo_; - VisSongInfo final_songinfo_; -*/ - void *buffer_; - - public: - LV::Video *video_; - LV::Bin *bin_; - LV::Actor *actor_; - VisAudio *audio_; - - VisVideoDepth depth_; - std::string morph_plugin_; - std::string actor_plugin_; - std::string input_plugin_; - std::string skip_actors_; - int morph_timeout_; - bool morph_chosen_; - char alpha_; - - void (*Draw)(WidgetVisualization *widget); - - void DoParams(); - bool MyCurrentID( const int &id ); - bool MyGetPlaytime( const int &playtime ); - bool ErrorHandler( const std::string &function, const std::string &error ); - - WidgetVisualization(LCDCore *visitor, std::string name, - Json::Value *section, int row, int col, int layer); - ~WidgetVisualization(); - void SetupChars(); - void Start(); - void Stop(); - int GetStyle() { return style_; } - void *GetBuffer() { return buffer_; } - char *GetPeakBuffer() { return peak_buffer_; } - bool HasChars() { return has_chars_; } - VisVideoDepth GetDepth() { return depth_; } - std::map GetChars() { return ch_; } - std::vector > GetHistory() { return history_; } - - void Update(); - void UpdatePeak(); - void UpdatePCM(); - void UpdateSpectrum(); - void TextScroll() {} - - void VisualMorph(); - void Resize(int rows, int cols, int old_rows, int old_cols); - void ResizeBefore(int rows, int cols); - void ResizeAfter(); - + int direction_; + int mono_; + int style_; + int update_; + timeval last_update_; + int vis_; + std::vector> history_; + std::map ch_; + bool has_chars_; + char *peak_buffer_; + + LCDTimer *timer_; + LCDTimer *morph_timer_; + + // libvisual stuff + /* + VisSongInfo current_songinfo_; + VisSongInfo final_songinfo_; + */ + void *buffer_; + +public: + LV::Video *video_; + LV::Bin *bin_; + LV::Actor *actor_; + VisAudio *audio_; + + VisVideoDepth depth_; + std::string morph_plugin_; + std::string actor_plugin_; + std::string input_plugin_; + std::string skip_actors_; + int morph_timeout_; + bool morph_chosen_; + char alpha_; + + void (*Draw)(WidgetVisualization *widget); + + void DoParams(); + bool MyCurrentID(const int &id); + bool MyGetPlaytime(const int &playtime); + bool ErrorHandler(const std::string &function, const std::string &error); + + WidgetVisualization(LCDCore *visitor, std::string name, Json::Value *section, + int row, int col, int layer); + ~WidgetVisualization(); + void SetupChars(); + void Start(); + void Stop(); + int GetStyle() { return style_; } + void *GetBuffer() { return buffer_; } + char *GetPeakBuffer() { return peak_buffer_; } + bool HasChars() { return has_chars_; } + VisVideoDepth GetDepth() { return depth_; } + std::map GetChars() { return ch_; } + std::vector> GetHistory() { return history_; } + + void Update(); + void UpdatePeak(); + void UpdatePCM(); + void UpdateSpectrum(); + void TextScroll() {} + + void VisualMorph(); + void Resize(int rows, int cols, int old_rows, int old_cols); + void ResizeBefore(int rows, int cols); + void ResizeAfter(); }; -}; // End namespace +}; // namespace LCD #define STYLE_PEAK 0 #define STYLE_PCM 1 diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/actor_lcdcontrol.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/actor_lcdcontrol.cpp index 6603e9edd..d159d6d7d 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/actor_lcdcontrol.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/actor_lcdcontrol.cpp @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2004, 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -21,7 +21,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #include #include #include @@ -40,41 +39,39 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR namespace { - int lcdcontrol_init (VisPluginData *plugin); - void lcdcontrol_cleanup (VisPluginData *plugin); - void lcdcontrol_requisition (VisPluginData *plugin, int *width, int *height); - void lcdcontrol_resize (VisPluginData *plugin, int width, int height); - int lcdcontrol_events (VisPluginData *plugin, VisEventQueue *events); - void lcdcontrol_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); - VisPalette *lcdcontrol_palette (VisPluginData *plugin); +int lcdcontrol_init(VisPluginData *plugin); +void lcdcontrol_cleanup(VisPluginData *plugin); +void lcdcontrol_requisition(VisPluginData *plugin, int *width, int *height); +void lcdcontrol_resize(VisPluginData *plugin, int width, int height); +int lcdcontrol_events(VisPluginData *plugin, VisEventQueue *events); +void lcdcontrol_render(VisPluginData *plugin, VisVideo *video, VisAudio *audio); +VisPalette *lcdcontrol_palette(VisPluginData *plugin); } // End namespace - using namespace LCD; -const VisPluginInfo *get_plugin_info () -{ - static VisActorPlugin actor; - actor.requisition = lcdcontrol_requisition; - actor.palette = lcdcontrol_palette; - actor.render = lcdcontrol_render; - actor.vidoptions.depth = VISUAL_VIDEO_DEPTH_32BIT; - - static VisPluginInfo info; - info.type = VISUAL_PLUGIN_TYPE_ACTOR; - info.plugname = "lcdcontrol"; - info.name = "LCDControl"; - info.author = "Scott Sibley "; - info.version = "0.1"; - info.about = "LibVisual LCD Simulation"; - info.help = "This plugin simulates an LCD and is based on LCD4Linux."; - info.init = lcdcontrol_init; - info.cleanup = lcdcontrol_cleanup; - info.events = lcdcontrol_events; - info.plugin = &actor; - - return &info; +const VisPluginInfo *get_plugin_info() { + static VisActorPlugin actor; + actor.requisition = lcdcontrol_requisition; + actor.palette = lcdcontrol_palette; + actor.render = lcdcontrol_render; + actor.vidoptions.depth = VISUAL_VIDEO_DEPTH_32BIT; + + static VisPluginInfo info; + info.type = VISUAL_PLUGIN_TYPE_ACTOR; + info.plugname = "lcdcontrol"; + info.name = "LCDControl"; + info.author = "Scott Sibley "; + info.version = "0.1"; + info.about = "LibVisual LCD Simulation"; + info.help = "This plugin simulates an LCD and is based on LCD4Linux."; + info.init = lcdcontrol_init; + info.cleanup = lcdcontrol_cleanup; + info.events = lcdcontrol_events; + info.plugin = &actor; + + return &info; } namespace { @@ -88,110 +85,102 @@ void *my_thread_func(void *data) } */ -int lcdcontrol_init (VisPluginData *plugin) -{ +int lcdcontrol_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); #endif - auto priv = visual_mem_new0 (LCDPrivate, 1); - visual_plugin_set_private (plugin, priv); + auto priv = visual_mem_new0(LCDPrivate, 1); + visual_plugin_set_private(plugin, priv); - priv->pal = visual_palette_new(256); + priv->pal = visual_palette_new(256); - priv->control = new LCDControl((void *)priv, visual_plugin_get_event_queue (plugin)); - priv->control->Start(); + priv->control = + new LCDControl((void *)priv, visual_plugin_get_event_queue(plugin)); + priv->control->Start(); - return 0; + return 0; } +void lcdcontrol_cleanup(VisPluginData *plugin) { + auto priv = static_cast(visual_plugin_get_private(plugin)); -void lcdcontrol_cleanup (VisPluginData *plugin) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); - - delete priv->control; - visual_mem_free (priv); + delete priv->control; + visual_mem_free(priv); } -void lcdcontrol_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +void lcdcontrol_requisition(VisPluginData *plugin, int *width, int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - while (reqw % 2 || (reqw / 2) % 2) - reqw--; + while (reqw % 2 || (reqw / 2) % 2) + reqw--; - while (reqh % 2 || (reqh / 2) % 2) - reqh--; + while (reqh % 2 || (reqh / 2) % 2) + reqh--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -void lcdcontrol_resize (VisPluginData *plugin, int width, int height) -{ - // FIXME: Implement this +void lcdcontrol_resize(VisPluginData *plugin, int width, int height) { + // FIXME: Implement this } -int lcdcontrol_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - { - lcdcontrol_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; - } - default: /* to avoid warnings */ - { - break; - } - } +int lcdcontrol_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; + + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: { + lcdcontrol_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; + } + default: /* to avoid warnings */ + { + break; + } } + } - return true; + return true; } +VisPalette *lcdcontrol_palette(VisPluginData *plugin) { + auto priv = static_cast(visual_plugin_get_private(plugin)); -VisPalette *lcdcontrol_palette (VisPluginData *plugin) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); - - int i; + int i; - for (i = 0; i < 256; i++) { - priv->pal->colors[i].r = i; - priv->pal->colors[i].g = i; - priv->pal->colors[i].b = i; - } + for (i = 0; i < 256; i++) { + priv->pal->colors[i].r = i; + priv->pal->colors[i].g = i; + priv->pal->colors[i].b = i; + } - return priv->pal; + return priv->pal; } -void lcdcontrol_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lcdcontrol_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - priv->control->Lock(); - priv->control->Tick(); + priv->control->Lock(); + priv->control->Tick(); - VisVideo *vid = priv->control->GetVideo(); - if(vid) { - visual_video_scale(video, vid, VISUAL_VIDEO_SCALE_BILINEAR); - } + VisVideo *vid = priv->control->GetVideo(); + if (vid) { + visual_video_scale(video, vid, VISUAL_VIDEO_SCALE_BILINEAR); + } - priv->control->Unlock(); + priv->control->Unlock(); } } // end anonymous namespace diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/actor_lcdcontrol.h b/libvisual-plugins/plugins/actor/lcdcontrol/actor_lcdcontrol.h index 3308c0265..b3df872ea 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/actor_lcdcontrol.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/actor_lcdcontrol.h @@ -8,18 +8,18 @@ namespace LCD { class LCDControl; -#define PCM_SIZE 1024 +#define PCM_SIZE 1024 typedef struct { - VisPalette *pal; - //VisBuffer pcm; - //VisThread *thread; - pthread_attr_t attr; - pthread_t id; - LCDControl *control; - uint32_t *pixels; + VisPalette *pal; + // VisBuffer pcm; + // VisThread *thread; + pthread_attr_t attr; + pthread_t id; + LCDControl *control; + uint32_t *pixels; } LCDPrivate; -} +} // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_blend.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_blend.c index bb8fd6d0e..efa0e6484 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_blend.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_blend.c @@ -4,27 +4,30 @@ Copyright 2005 Nullsoft, Inc. All rights reserved. -Redistribution and use in source and binary forms, with or without modification, +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of Nullsoft nor the names of its contributors may be used to - endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + and/or other materials provided with the distribution. + + * Neither the name of Nullsoft nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _R_DEFS_H_ @@ -33,92 +36,85 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "config.h" #include "avs_blend.h" -static int max(int x, int y) -{ - return x > y ? x : y; -} +static int max(int x, int y) { return x > y ? x : y; } -static int min(int x, int y) -{ - return x < y ? x : y; -} +static int min(int x, int y) { return x < y ? x : y; } -__inline int BLEND(int a, int b) -{ - register int r,t; - r=(a&0xff)+(b&0xff); - t=min(r,0xff); - r=(a&0xff00)+(b&0xff00); - t|=min(r,0xff00); - r=(a&0xff0000)+(b&0xff0000); - t|=min(r,0xff0000); - r=(a&0xff000000)+(b&0xff000000); - return t|min(r,0xff000000); +__inline int BLEND(int a, int b) { + register int r, t; + r = (a & 0xff) + (b & 0xff); + t = min(r, 0xff); + r = (a & 0xff00) + (b & 0xff00); + t |= min(r, 0xff00); + r = (a & 0xff0000) + (b & 0xff0000); + t |= min(r, 0xff0000); + r = (a & 0xff000000) + (b & 0xff000000); + return t | min(r, 0xff000000); } #if 1 -#define FASTMAX(x,y) max(x,y) +#define FASTMAX(x, y) max(x, y) // (x-(((x-y)>>(32-1))&(x-y))) // hmm not faster :( -#define FASTMIN(x,y) min(x,y) -//(x+(((y-x)>>(32-1))&(y-x))) +#define FASTMIN(x, y) min(x, y) +//(x+(((y-x)>>(32-1))&(y-x))) #else -static int FASTMAX(int x, int y) -{ - int ret; - asm("mov %0, %%ecx\n\t" - "mov %1, %%eax\n\t" - "sub %%eax, %%ecx\n\t" - "cmc\n\t" - "and %%edx, %%ecx\n\t" - "add %%ecx, %%eax" - : "=a"(ret) - : "m"(x), "m"(y) - : "memory"); - return ret; +static int FASTMAX(int x, int y) { + int ret; + asm("mov %0, %%ecx\n\t" + "mov %1, %%eax\n\t" + "sub %%eax, %%ecx\n\t" + "cmc\n\t" + "and %%edx, %%ecx\n\t" + "add %%ecx, %%eax" + : "=a"(ret) + : "m"(x), "m"(y) + : "memory"); + return ret; } -static int FASTMIN(int x, int y) -{ - int ret; - asm("mov %0, %%ecx\n\t" - "mov %1, %%eax\n\t" - "sub %%eax, %%ecx\n\t" - "sbb %%edx, %%edx\n\t" - "and %%edx, %%ecx\n\t" - "and %%eax, %%ecx\n\t" - : "=m"(ret) - : "m"(x), "m"(y) - : "memory"); - return ret; +static int FASTMIN(int x, int y) { + int ret; + asm("mov %0, %%ecx\n\t" + "mov %1, %%eax\n\t" + "sub %%eax, %%ecx\n\t" + "sbb %%edx, %%edx\n\t" + "and %%edx, %%ecx\n\t" + "and %%eax, %%ecx\n\t" + : "=m"(ret) + : "m"(x), "m"(y) + : "memory"); + return ret; } #endif -__inline int BLEND_MAX(int a, int b) -{ - register int t; - int _a=a&0xff; - int _b=b&0xff; - t=FASTMAX(_a,_b); - _a=a&0xff00; _b=b&0xff00; - t|=FASTMAX(_a,_b); - _a=a&0xff0000; _b=b&0xff0000; - t|=FASTMAX(_a,_b); - return t; +__inline int BLEND_MAX(int a, int b) { + register int t; + int _a = a & 0xff; + int _b = b & 0xff; + t = FASTMAX(_a, _b); + _a = a & 0xff00; + _b = b & 0xff00; + t |= FASTMAX(_a, _b); + _a = a & 0xff0000; + _b = b & 0xff0000; + t |= FASTMAX(_a, _b); + return t; } -__inline int BLEND_MIN(int a, int b) -{ +__inline int BLEND_MIN(int a, int b) { #if 1 - register int t; - int _a=a&0xff; - int _b=b&0xff; - t=FASTMIN(_a,_b); - _a=a&0xff00; _b=b&0xff00; - t|=FASTMIN(_a,_b); - _a=a&0xff0000; _b=b&0xff0000; - t|=FASTMIN(_a,_b); - return t; + register int t; + int _a = a & 0xff; + int _b = b & 0xff; + t = FASTMIN(_a, _b); + _a = a & 0xff00; + _b = b & 0xff00; + t |= FASTMIN(_a, _b); + _a = a & 0xff0000; + _b = b & 0xff0000; + t |= FASTMIN(_a, _b); + return t; #else __asm { @@ -170,74 +166,102 @@ __inline int BLEND_MIN(int a, int b) #undef FASTMIN #endif - -__inline int BLEND_AVG(int a, int b) -{ - return ((a>>1)&~((1<<7)|(1<<15)|(1<<23)))+((b>>1)&~((1<<7)|(1<<15)|(1<<23))); +__inline int BLEND_AVG(int a, int b) { + return ((a >> 1) & ~((1 << 7) | (1 << 15) | (1 << 23))) + + ((b >> 1) & ~((1 << 7) | (1 << 15) | (1 << 23))); } - -__inline int BLEND_SUB(int a, int b) -{ - register int r,t; - r=(a&0xff)-(b&0xff); - t=max(r,0); - r=(a&0xff00)-(b&0xff00); - t|=max(r,0); - r=(a&0xff0000)-(b&0xff0000); - t|=max(r,0); - r=(a&0xff000000)-(b&0xff000000); - return t|max(r,0); +__inline int BLEND_SUB(int a, int b) { + register int r, t; + r = (a & 0xff) - (b & 0xff); + t = max(r, 0); + r = (a & 0xff00) - (b & 0xff00); + t |= max(r, 0); + r = (a & 0xff0000) - (b & 0xff0000); + t |= max(r, 0); + r = (a & 0xff000000) - (b & 0xff000000); + return t | max(r, 0); } -__inline int BLEND_ADJ_NOMMX(unsigned char blendtable[256][256], int a, int b, int v) -{ - register int t; - t=blendtable[a&0xFF][v]+blendtable[b&0xFF][0xFF-v]; - t|=(blendtable[(a&0xFF00)>>8][v]+blendtable[(b&0xFF00)>>8][0xFF-v])<<8; - t|=(blendtable[(a&0xFF0000)>>16][v]+blendtable[(b&0xFF0000)>>16][0xFF-v])<<16; - return t; +__inline int BLEND_ADJ_NOMMX(unsigned char blendtable[256][256], int a, int b, + int v) { + register int t; + t = blendtable[a & 0xFF][v] + blendtable[b & 0xFF][0xFF - v]; + t |= (blendtable[(a & 0xFF00) >> 8][v] + + blendtable[(b & 0xFF00) >> 8][0xFF - v]) + << 8; + t |= (blendtable[(a & 0xFF0000) >> 16][v] + + blendtable[(b & 0xFF0000) >> 16][0xFF - v]) + << 16; + return t; } -__inline int BLEND_MUL(unsigned char blendtable[256][256], int a, int b) -{ - register int t; - t=blendtable[a&0xFF][b&0xFF]; - t|=blendtable[(a&0xFF00)>>8][(b&0xFF00)>>8]<<8; - t|=blendtable[(a&0xFF0000)>>16][(b&0xFF0000)>>16]<<16; - return t; +__inline int BLEND_MUL(unsigned char blendtable[256][256], int a, int b) { + register int t; + t = blendtable[a & 0xFF][b & 0xFF]; + t |= blendtable[(a & 0xFF00) >> 8][(b & 0xFF00) >> 8] << 8; + t |= blendtable[(a & 0xFF0000) >> 16][(b & 0xFF0000) >> 16] << 16; + return t; } -__inline void BLEND_LINE(int *fb, int color, unsigned char blendtable[256][256], int mode) -{ - switch (mode) - { - case 1: *fb=BLEND(*fb,color); break; - case 2: *fb=BLEND_MAX(*fb,color); break; - case 3: *fb=BLEND_AVG(*fb,color); break; - case 4: *fb=BLEND_SUB(*fb,color); break; - case 5: *fb=BLEND_SUB(color,*fb); break; - case 6: *fb=BLEND_MUL(blendtable, *fb,color); break; - case 7: *fb=BLEND_ADJ_NOMMX(blendtable, *fb,color,(mode>>8)&0xff); break; - case 8: *fb=*fb^color; break; - case 9: *fb=BLEND_MIN(*fb,color); break; - default: *fb=color; break; +__inline void BLEND_LINE(int *fb, int color, unsigned char blendtable[256][256], + int mode) { + switch (mode) { + case 1: + *fb = BLEND(*fb, color); + break; + case 2: + *fb = BLEND_MAX(*fb, color); + break; + case 3: + *fb = BLEND_AVG(*fb, color); + break; + case 4: + *fb = BLEND_SUB(*fb, color); + break; + case 5: + *fb = BLEND_SUB(color, *fb); + break; + case 6: + *fb = BLEND_MUL(blendtable, *fb, color); + break; + case 7: + *fb = BLEND_ADJ_NOMMX(blendtable, *fb, color, (mode >> 8) & 0xff); + break; + case 8: + *fb = *fb ^ color; + break; + case 9: + *fb = BLEND_MIN(*fb, color); + break; + default: + *fb = color; + break; } } -__inline int BLEND4(unsigned char blendtable[256][256], int *p1, int w, int xp, int yp) -{ +__inline int BLEND4(unsigned char blendtable[256][256], int *p1, int w, int xp, + int yp) { #if 1 register int t; - unsigned char a1,a2,a3,a4; - a1=blendtable[255-xp][255-yp]; - a2=blendtable[xp][255-yp]; - a3=blendtable[255-xp][yp]; - a4=blendtable[xp][yp]; - t=blendtable[p1[0]&0xff][a1]+blendtable[p1[1]&0xff][a2]+blendtable[p1[w]&0xff][a3]+blendtable[p1[w+1]&0xff][a4]; - t|=(blendtable[(p1[0]>>8)&0xff][a1]+blendtable[(p1[1]>>8)&0xff][a2]+blendtable[(p1[w]>>8)&0xff][a3]+blendtable[(p1[w+1]>>8)&0xff][a4])<<8; - t|=(blendtable[(p1[0]>>16)&0xff][a1]+blendtable[(p1[1]>>16)&0xff][a2]+blendtable[(p1[w]>>16)&0xff][a3]+blendtable[(p1[w+1]>>16)&0xff][a4])<<16; - return t; + unsigned char a1, a2, a3, a4; + a1 = blendtable[255 - xp][255 - yp]; + a2 = blendtable[xp][255 - yp]; + a3 = blendtable[255 - xp][yp]; + a4 = blendtable[xp][yp]; + t = blendtable[p1[0] & 0xff][a1] + blendtable[p1[1] & 0xff][a2] + + blendtable[p1[w] & 0xff][a3] + blendtable[p1[w + 1] & 0xff][a4]; + t |= (blendtable[(p1[0] >> 8) & 0xff][a1] + + blendtable[(p1[1] >> 8) & 0xff][a2] + + blendtable[(p1[w] >> 8) & 0xff][a3] + + blendtable[(p1[w + 1] >> 8) & 0xff][a4]) + << 8; + t |= (blendtable[(p1[0] >> 16) & 0xff][a1] + + blendtable[(p1[1] >> 16) & 0xff][a2] + + blendtable[(p1[w] >> 16) & 0xff][a3] + + blendtable[(p1[w + 1] >> 16) & 0xff][a4]) + << 16; + return t; #else __asm { @@ -278,7 +302,7 @@ __inline int BLEND4(unsigned char blendtable[256][256], int *p1, int w, int xp, pmullw mm3, mm6 paddw mm0, mm1 - // stall (mm0) + // stall (mm0) psrlw mm0, 8 // stall (waiting for mm3/mm2) @@ -290,40 +314,48 @@ __inline int BLEND4(unsigned char blendtable[256][256], int *p1, int w, int xp, // stall (mm2) pmullw mm2, mm7 - // stall + // stall - // stall (mm2) + // stall (mm2) paddw mm0, mm2 - // stall + // stall psrlw mm0, 8 // stall packuswb mm0, mm0 - // stall + // stall movd eax, mm0 } #endif } - -__inline int BLEND4_16(unsigned char blendtable[256][256], int *p1, int w, int xp, int yp) -{ +__inline int BLEND4_16(unsigned char blendtable[256][256], int *p1, int w, + int xp, int yp) { #if 1 register int t; - unsigned char a1,a2,a3,a4; - xp=(xp>>8)&0xff; - yp=(yp>>8)&0xff; - a1=blendtable[255-xp][255-yp]; - a2=blendtable[xp][255-yp]; - a3=blendtable[255-xp][yp]; - a4=blendtable[xp][yp]; - t=blendtable[p1[0]&0xff][a1]+blendtable[p1[1]&0xff][a2]+blendtable[p1[w]&0xff][a3]+blendtable[p1[w+1]&0xff][a4]; - t|=(blendtable[(p1[0]>>8)&0xff][a1]+blendtable[(p1[1]>>8)&0xff][a2]+blendtable[(p1[w]>>8)&0xff][a3]+blendtable[(p1[w+1]>>8)&0xff][a4])<<8; - t|=(blendtable[(p1[0]>>16)&0xff][a1]+blendtable[(p1[1]>>16)&0xff][a2]+blendtable[(p1[w]>>16)&0xff][a3]+blendtable[(p1[w+1]>>16)&0xff][a4])<<16; - return t; + unsigned char a1, a2, a3, a4; + xp = (xp >> 8) & 0xff; + yp = (yp >> 8) & 0xff; + a1 = blendtable[255 - xp][255 - yp]; + a2 = blendtable[xp][255 - yp]; + a3 = blendtable[255 - xp][yp]; + a4 = blendtable[xp][yp]; + t = blendtable[p1[0] & 0xff][a1] + blendtable[p1[1] & 0xff][a2] + + blendtable[p1[w] & 0xff][a3] + blendtable[p1[w + 1] & 0xff][a4]; + t |= (blendtable[(p1[0] >> 8) & 0xff][a1] + + blendtable[(p1[1] >> 8) & 0xff][a2] + + blendtable[(p1[w] >> 8) & 0xff][a3] + + blendtable[(p1[w + 1] >> 8) & 0xff][a4]) + << 8; + t |= (blendtable[(p1[0] >> 16) & 0xff][a1] + + blendtable[(p1[1] >> 16) & 0xff][a2] + + blendtable[(p1[w] >> 16) & 0xff][a3] + + blendtable[(p1[w + 1] >> 16) & 0xff][a4]) + << 16; + return t; #else __asm { @@ -367,7 +399,7 @@ __inline int BLEND4_16(unsigned char blendtable[256][256], int *p1, int w, int x pmullw mm3, mm6 paddw mm0, mm1 - // stall (mm0) + // stall (mm0) psrlw mm0, 8 // stall (waiting for mm3/mm2) @@ -379,40 +411,35 @@ __inline int BLEND4_16(unsigned char blendtable[256][256], int *p1, int w, int x // stall (mm2) pmullw mm2, mm7 - // stall + // stall - // stall (mm2) + // stall (mm2) paddw mm0, mm2 - // stall + // stall psrlw mm0, 8 // stall packuswb mm0, mm0 - // stall + // stall movd eax, mm0 } #endif } -__inline void mmx_avgblend_block(int *output, int *input, int l) -{ +__inline void mmx_avgblend_block(int *output, int *input, int l) { #if 1 - while (l--) - { - *output=BLEND_AVG(*input++,*output); + while (l--) { + *output = BLEND_AVG(*input++, *output); output++; } #else - static int mask[2]= - { - ~((1<<7)|(1<<15)|(1<<23)), - ~((1<<7)|(1<<15)|(1<<23)) - }; - __asm - { + static int mask[2] = {~((1 << 7) | (1 << 15) | (1 << 23)), + ~((1 << 7) | (1 << 15) | (1 << 23))}; + __asm + { mov eax, input mov edi, output mov ecx, l @@ -443,22 +470,20 @@ __inline void mmx_avgblend_block(int *output, int *input, int l) dec ecx jnz mmx_avgblend_loop emms - }; + } + ; #endif } - -__inline void mmx_addblend_block(int *output, int *input, int l) -{ +__inline void mmx_addblend_block(int *output, int *input, int l) { #if 1 - while (l--) - { - *output=BLEND(*input++,*output); + while (l--) { + *output = BLEND(*input++, *output); output++; } #else - __asm - { + __asm + { mov eax, input mov edi, output mov ecx, l @@ -481,21 +506,21 @@ __inline void mmx_addblend_block(int *output, int *input, int l) dec ecx jnz mmx_addblend_loop emms - }; + } + ; #endif } -__inline void mmx_mulblend_block(unsigned char blendtable[256][256], int *output, int *input, int l) -{ +__inline void mmx_mulblend_block(unsigned char blendtable[256][256], + int *output, int *input, int l) { #if 1 - while (l--) - { - *output=BLEND_MUL(blendtable, *input++,*output); + while (l--) { + *output = BLEND_MUL(blendtable, *input++, *output); output++; } #else - __asm - { + __asm + { mov eax, input mov edi, output mov ecx, l @@ -526,20 +551,20 @@ __inline void mmx_mulblend_block(unsigned char blendtable[256][256], int *output dec ecx jnz mmx_mulblend_loop emms - }; + } + ; #endif } -void __inline mmx_adjblend_block(unsigned char blendtable[256][256], int *o, int *in1, int *in2, int len, int v) -{ +void __inline mmx_adjblend_block(unsigned char blendtable[256][256], int *o, + int *in1, int *in2, int len, int v) { #if 1 - while (len--) - { - *o++=BLEND_ADJ(blendtable, *in1++,*in2++,v); + while (len--) { + *o++ = BLEND_ADJ(blendtable, *in1++, *in2++, v); } #else __asm - { + { movd mm3, [v] // VVVVVVVV mov ecx, len @@ -599,7 +624,8 @@ void __inline mmx_adjblend_block(unsigned char blendtable[256][256], int *o, int jnz _mmx_adjblend_loop emms - }; + } + ; #endif } #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_blend.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_blend.h index 21049b2d0..0251f5bd4 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_blend.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_blend.h @@ -4,27 +4,30 @@ Copyright 2005 Nullsoft, Inc. All rights reserved. -Redistribution and use in source and binary forms, with or without modification, +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of Nullsoft nor the names of its contributors may be used to - endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + and/or other materials provided with the distribution. + + * Neither the name of Nullsoft nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _R_BLEND_H_ @@ -33,19 +36,23 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "config.h" #include "avs_globals.h" -int BLEND(int a, int b); -int BLEND_MAX(int a, int b); -int BLEND_MIN(int a, int b); -int BLEND_AVG(int a, int b); -int BLEND_SUB(int a, int b); -int BLEND_ADJ_NOMMX(unsigned char blendtable[256][256], int a, int b, int v); +int BLEND(int a, int b); +int BLEND_MAX(int a, int b); +int BLEND_MIN(int a, int b); +int BLEND_AVG(int a, int b); +int BLEND_SUB(int a, int b); +int BLEND_ADJ_NOMMX(unsigned char blendtable[256][256], int a, int b, int v); #define BLEND_ADJ BLEND_ADJ_NOMMX -int BLEND_MUL(unsigned char blendtable[256][256], int a, int b); -void BLEND_LINE(int *fb, int color, unsigned char blendtable[256][256], int mode); +int BLEND_MUL(unsigned char blendtable[256][256], int a, int b); +void BLEND_LINE(int *fb, int color, unsigned char blendtable[256][256], + int mode); int BLEND4(unsigned char blendtable[256][256], int *p1, int w, int xp, int yp); -int BLEND4_16(unsigned char blendtable[256][256], int *p1, int w, int xp, int yp); -void mmx_mulblend_block(unsigned char blendtable[256][256], int *output, int *input, int l); -void mmx_adjblend_block(unsigned char blendtable[256][256], int *o, int *in1, int *in2, int len, int v); +int BLEND4_16(unsigned char blendtable[256][256], int *p1, int w, int xp, + int yp); +void mmx_mulblend_block(unsigned char blendtable[256][256], int *output, + int *input, int l); +void mmx_adjblend_block(unsigned char blendtable[256][256], int *o, int *in1, + int *in2, int len, int v); void mmx_addblend_block(int *output, int *input, int l); void mmx_avgblend_block(int *output, int *input, int l); diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_common.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_common.h index 7bd513a27..64805639c 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_common.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_common.h @@ -3,4 +3,3 @@ #include "avs_config.h" #include "avs_globals.h" #include "avs_blend.h" - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_config.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_config.c index 335923931..65fb17351 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_config.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_config.c @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -34,12 +34,10 @@ #include "avs_config.h" -VisTime *avs_config_standard_color_cycler_time () -{ - static VisTime ccyclertime; +VisTime *avs_config_standard_color_cycler_time() { + static VisTime ccyclertime; - visual_time_set (&ccyclertime, 1, 0); + visual_time_set(&ccyclertime, 1, 0); - return &ccyclertime; + return &ccyclertime; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_config.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_config.h index b5ef95e7e..0f1e2e741 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_config.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_config.h @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -31,7 +31,7 @@ extern "C" { #endif /* __cplusplus */ /* Prototypes */ -VisTime *avs_config_standard_color_cycler_time (void); +VisTime *avs_config_standard_color_cycler_time(void); #ifdef __cplusplus } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_gfx.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_gfx.c index a6dde13e1..9ce172bca 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_gfx.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_gfx.c @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -36,214 +36,213 @@ #define SGN(a) (a == 0 ? 0 : a < 0 ? -1 : 1) -static int avs_gfx_colorcycler_dtor (VisObject *object); +static int avs_gfx_colorcycler_dtor(VisObject *object); /* Dtors */ -static int avs_gfx_colorcycler_dtor (VisObject *object) -{ - AVSGfxColorCycler *cycler = AVS_GFX_COLOR_CYCLER (object); +static int avs_gfx_colorcycler_dtor(VisObject *object) { + AVSGfxColorCycler *cycler = AVS_GFX_COLOR_CYCLER(object); - if (cycler->pal != NULL) - visual_object_unref (VISUAL_OBJECT (cycler->pal)); + if (cycler->pal != NULL) + visual_object_unref(VISUAL_OBJECT(cycler->pal)); - cycler->pal = NULL; + cycler->pal = NULL; - return VISUAL_OK; + return VISUAL_OK; } - /* Color cycler functions */ -AVSGfxColorCycler *avs_gfx_color_cycler_new (VisPalette *pal) -{ - AVSGfxColorCycler *cycler; +AVSGfxColorCycler *avs_gfx_color_cycler_new(VisPalette *pal) { + AVSGfxColorCycler *cycler; + + cycler = visual_mem_new0(AVSGfxColorCycler, 1); - cycler = visual_mem_new0 (AVSGfxColorCycler, 1); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(cycler), TRUE, + avs_gfx_colorcycler_dtor); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (cycler), TRUE, avs_gfx_colorcycler_dtor); + avs_gfx_color_cycler_set_mode(cycler, AVS_GFX_COLOR_CYCLER_TYPE_SET); - avs_gfx_color_cycler_set_mode (cycler, AVS_GFX_COLOR_CYCLER_TYPE_SET); - - visual_object_ref (VISUAL_OBJECT (pal)); - cycler->pal = pal; + visual_object_ref(VISUAL_OBJECT(pal)); + cycler->pal = pal; - return cycler; + return cycler; } -int avs_gfx_color_cycler_set_rate (AVSGfxColorCycler *cycler, float rate) -{ - cycler->rate = rate; +int avs_gfx_color_cycler_set_rate(AVSGfxColorCycler *cycler, float rate) { + cycler->rate = rate; - return 0; + return 0; } -int avs_gfx_color_cycler_set_time (AVSGfxColorCycler *cycler, VisTime *time) -{ - return visual_time_copy (&cycler->morphtime, time); +int avs_gfx_color_cycler_set_time(AVSGfxColorCycler *cycler, VisTime *time) { + return visual_time_copy(&cycler->morphtime, time); } -int avs_gfx_color_cycler_set_mode (AVSGfxColorCycler *cycler, AVSGfxColorCyclerType type) -{ - cycler->type = type; +int avs_gfx_color_cycler_set_mode(AVSGfxColorCycler *cycler, + AVSGfxColorCyclerType type) { + cycler->type = type; - return 0; + return 0; } -VisColor *avs_gfx_color_cycler_run (AVSGfxColorCycler *cycler) -{ - double usec_elapsed, usec_morph; - VisTime elapsed; +VisColor *avs_gfx_color_cycler_run(AVSGfxColorCycler *cycler) { + double usec_elapsed, usec_morph; + VisTime elapsed; - if (cycler->type == AVS_GFX_COLOR_CYCLER_TYPE_TIME) { - if (visual_timer_is_active (&cycler->timer) == FALSE) - visual_timer_start (&cycler->timer); - - visual_timer_elapsed (&cycler->timer, &elapsed); + if (cycler->type == AVS_GFX_COLOR_CYCLER_TYPE_TIME) { + if (visual_timer_is_active(&cycler->timer) == FALSE) + visual_timer_start(&cycler->timer); - usec_elapsed = ((double) elapsed.tv_sec) * VISUAL_USEC_PER_SEC + elapsed.tv_usec; - usec_morph = ((double) cycler->morphtime.tv_sec) * VISUAL_USEC_PER_SEC + cycler->morphtime.tv_usec; + visual_timer_elapsed(&cycler->timer, &elapsed); - cycler->timedrate = usec_elapsed / usec_morph; + usec_elapsed = + ((double)elapsed.tv_sec) * VISUAL_USEC_PER_SEC + elapsed.tv_usec; + usec_morph = ((double)cycler->morphtime.tv_sec) * VISUAL_USEC_PER_SEC + + cycler->morphtime.tv_usec; - /* Next color! */ - if (cycler->timedrate > 1.0) { - cycler->timedrate = 0; + cycler->timedrate = usec_elapsed / usec_morph; - cycler->curcolor++; + /* Next color! */ + if (cycler->timedrate > 1.0) { + cycler->timedrate = 0; - cycler->curcolor = cycler->curcolor % cycler->pal->ncolors; + cycler->curcolor++; - visual_timer_start (&cycler->timer); - } + cycler->curcolor = cycler->curcolor % cycler->pal->ncolors; - cycler->rate = cycler->timedrate + cycler->curcolor; - } + visual_timer_start(&cycler->timer); + } - return visual_palette_color_cycle (cycler->pal, cycler->rate); + cycler->rate = cycler->timedrate + cycler->curcolor; + } + + return visual_palette_color_cycle(cycler->pal, cycler->rate); } /* Line functions */ -int avs_gfx_line_non_naieve_floats (VisVideo *video, float x0, float y0, float x1, float y1, VisColor *col) -{ - return avs_gfx_line_non_naieve_ints (video, video->width * x0, video->height * y0, video->width * x1, video->height * y1, col); +int avs_gfx_line_non_naieve_floats(VisVideo *video, float x0, float y0, + float x1, float y1, VisColor *col) { + return avs_gfx_line_non_naieve_ints(video, video->width * x0, + video->height * y0, video->width * x1, + video->height * y1, col); } -int avs_gfx_line_non_naieve_ints (VisVideo *video, int x0, int y0, int x1, int y1, VisColor *col) -{ - int u, s, v, d1x, d1y, d2x, d2y, m, n; - int i; - u = x1 - x0; - v = y1 - y0; - d1x = SGN (u); - d1y = SGN (v); - d2x = SGN (u); - d2y = 0; - m = abs (u); - n = abs (v); - uint32_t color = col->r << 16 | col->g << 8 | col->b; - uint32_t *buf = visual_video_get_pixels (video); - int pbpp = video->pitch / 4; - - if (m <= n) { - d2x = 0; - d2y = SGN (v); - m = abs (v); - n = abs (u); - } - - s = (int) (m / 2); - for (i = 0; i < m; i++) { - - if (x0 > 0 && x0 < video->width && y0 > 0 && y0 < video->height) - buf[(y0 * pbpp) + x0] = color; - - s += n; - if (s >= m) { - s -= m; - x0 += d1x; - y0 += d1y; - } else { - x0 += d2x; - y0 += d2y; - } - } - - return 0; +int avs_gfx_line_non_naieve_ints(VisVideo *video, int x0, int y0, int x1, + int y1, VisColor *col) { + int u, s, v, d1x, d1y, d2x, d2y, m, n; + int i; + u = x1 - x0; + v = y1 - y0; + d1x = SGN(u); + d1y = SGN(v); + d2x = SGN(u); + d2y = 0; + m = abs(u); + n = abs(v); + uint32_t color = col->r << 16 | col->g << 8 | col->b; + uint32_t *buf = visual_video_get_pixels(video); + int pbpp = video->pitch / 4; + + if (m <= n) { + d2x = 0; + d2y = SGN(v); + m = abs(v); + n = abs(u); + } + + s = (int)(m / 2); + for (i = 0; i < m; i++) { + + if (x0 > 0 && x0 < video->width && y0 > 0 && y0 < video->height) + buf[(y0 * pbpp) + x0] = color; + + s += n; + if (s >= m) { + s -= m; + x0 += d1x; + y0 += d1y; + } else { + x0 += d2x; + y0 += d2y; + } + } + + return 0; } -int avs_gfx_line_floats (VisVideo *video, float x0, float y0, float x1, float y1, VisColor *col) -{ - return avs_gfx_line_ints (video, video->width * x0, video->height * y0, video->width * x1, video->height * y1, col); +int avs_gfx_line_floats(VisVideo *video, float x0, float y0, float x1, float y1, + VisColor *col) { + return avs_gfx_line_ints(video, video->width * x0, video->height * y0, + video->width * x1, video->height * y1, col); } -int avs_gfx_line_ints (VisVideo *video, int x0, int y0, int x1, int y1, VisColor *col) -{ - register int dy = y1 - y0; - register int dx = x1 - x0; - register int stepx, stepy, stepy_; - register int fraction; - register int bp; - register int x; - register int y; - uint32_t color = col->r << 16 | col->g << 8 | col->b; - uint32_t *buf = visual_video_get_pixels (video); - int pbpp = video->pitch / 4; - - if (dy < 0) { - dy = -dy; - stepy_ = -pbpp; - stepy = -1; - } else { - stepy = 1; - stepy_ = pbpp; - } - - if (dx < 0) { - dx = -dx; - stepx = -1; - } else { - stepx = 1; - } - - dy <<= 1; - dx <<= 1; - - bp = x0 + y0 * (pbpp); - - *(buf + bp) = color; - - x = x0; - y = y0; - - if (dx > dy) { - fraction = dy - (dx >> 1); - while (x0 != x1) { - if (fraction >= 0) { - bp += stepy_; - fraction -= dx; - } - x0 += stepx; - bp += stepx; - fraction += dy; - - buf[bp] = color; - } - } else { - fraction = dx - (dy >> 1); - while (y0 != y1) { - if (fraction >= 0) { - bp += stepx; - x0 += stepx; - fraction -= dy; - } - y0 += stepy; - bp += stepy_; - fraction += dx; - - buf[bp] = color; - } - } - - return 0; +int avs_gfx_line_ints(VisVideo *video, int x0, int y0, int x1, int y1, + VisColor *col) { + register int dy = y1 - y0; + register int dx = x1 - x0; + register int stepx, stepy, stepy_; + register int fraction; + register int bp; + register int x; + register int y; + uint32_t color = col->r << 16 | col->g << 8 | col->b; + uint32_t *buf = visual_video_get_pixels(video); + int pbpp = video->pitch / 4; + + if (dy < 0) { + dy = -dy; + stepy_ = -pbpp; + stepy = -1; + } else { + stepy = 1; + stepy_ = pbpp; + } + + if (dx < 0) { + dx = -dx; + stepx = -1; + } else { + stepx = 1; + } + + dy <<= 1; + dx <<= 1; + + bp = x0 + y0 * (pbpp); + + *(buf + bp) = color; + + x = x0; + y = y0; + + if (dx > dy) { + fraction = dy - (dx >> 1); + while (x0 != x1) { + if (fraction >= 0) { + bp += stepy_; + fraction -= dx; + } + x0 += stepx; + bp += stepx; + fraction += dy; + + buf[bp] = color; + } + } else { + fraction = dx - (dy >> 1); + while (y0 != y1) { + if (fraction >= 0) { + bp += stepx; + x0 += stepx; + fraction -= dy; + } + y0 += stepy; + bp += stepy_; + fraction += dx; + + buf[bp] = color; + } + } + + return 0; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_gfx.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_gfx.h index e6db1bac4..6dc1e4f84 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_gfx.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_gfx.h @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -30,41 +30,44 @@ extern "C" { #endif /* __cplusplus */ -#define AVS_GFX_COLOR_CYCLER(obj) (VISUAL_CHECK_CAST ((obj), AVSGfxColorCycler)) - +#define AVS_GFX_COLOR_CYCLER(obj) (VISUAL_CHECK_CAST((obj), AVSGfxColorCycler)) typedef struct _AVSGfxColorCycler AVSGfxColorCycler; typedef enum { - AVS_GFX_COLOR_CYCLER_TYPE_SET, - AVS_GFX_COLOR_CYCLER_TYPE_TIME + AVS_GFX_COLOR_CYCLER_TYPE_SET, + AVS_GFX_COLOR_CYCLER_TYPE_TIME } AVSGfxColorCyclerType; struct _AVSGfxColorCycler { - VisPalette *pal; + VisPalette *pal; - float rate; - float timedrate; - - int curcolor; + float rate; + float timedrate; - VisTime morphtime; - VisTimer timer; + int curcolor; - AVSGfxColorCyclerType type; -}; - -AVSGfxColorCycler *avs_gfx_color_cycler_new (VisPalette *pal); -int avs_gfx_color_cycler_set_rate (AVSGfxColorCycler *cycler, float rate); -int avs_gfx_color_cycler_set_time (AVSGfxColorCycler *cycler, VisTime *time); -int avs_gfx_color_cycler_set_mode (AVSGfxColorCycler *cycler, AVSGfxColorCyclerType type); -VisColor *avs_gfx_color_cycler_run (AVSGfxColorCycler *cycler); + VisTime morphtime; + VisTimer timer; + AVSGfxColorCyclerType type; +}; -int avs_gfx_line_non_naieve_floats (VisVideo *video, float x1, float y1, float x2, float y2, VisColor *col); -int avs_gfx_line_non_naieve_ints (VisVideo *video, int x1, int y1, int x2, int y2, VisColor *col); -int avs_gfx_line_floats (VisVideo *video, float x1, float y1, float x2, float y2, VisColor *col); -int avs_gfx_line_ints (VisVideo *video, int x1, int y1, int x2, int y2, VisColor *col); +AVSGfxColorCycler *avs_gfx_color_cycler_new(VisPalette *pal); +int avs_gfx_color_cycler_set_rate(AVSGfxColorCycler *cycler, float rate); +int avs_gfx_color_cycler_set_time(AVSGfxColorCycler *cycler, VisTime *time); +int avs_gfx_color_cycler_set_mode(AVSGfxColorCycler *cycler, + AVSGfxColorCyclerType type); +VisColor *avs_gfx_color_cycler_run(AVSGfxColorCycler *cycler); + +int avs_gfx_line_non_naieve_floats(VisVideo *video, float x1, float y1, + float x2, float y2, VisColor *col); +int avs_gfx_line_non_naieve_ints(VisVideo *video, int x1, int y1, int x2, + int y2, VisColor *col); +int avs_gfx_line_floats(VisVideo *video, float x1, float y1, float x2, float y2, + VisColor *col); +int avs_gfx_line_ints(VisVideo *video, int x1, int y1, int x2, int y2, + VisColor *col); #ifdef __cplusplus } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_globals.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_globals.c index b66c5678f..1fa5513c6 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_globals.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_globals.c @@ -2,7 +2,8 @@ #include "avs_globals.h" /* -AvsGlobalBuffer *avs_get_global_buffer(AvsGlobalProxy *obj, int w, int h, int n, int do_alloc) +AvsGlobalBuffer *avs_get_global_buffer(AvsGlobalProxy *obj, int w, int h, int n, +int do_alloc) { if(n < 0 || n >= MAXBUF) return NULL; @@ -10,8 +11,9 @@ AvsGlobalBuffer *avs_get_global_buffer(AvsGlobalProxy *obj, int w, int h, int n, if(obj->buffers == NULL) { obj->buffers = visual_mem_new0(AvsGlobalBuffer, MAXBUF); } - - if(!obj->buffers[n].buffer || obj->buffers[n].w != w || obj->buffers[n].h != h) + + if(!obj->buffers[n].buffer || obj->buffers[n].w != w || obj->buffers[n].h != +h) { if(obj->buffers[n].buffer) { visual_mem_free(obj->buffers[n].buffer); @@ -34,101 +36,97 @@ AvsGlobalBuffer *avs_get_global_buffer(AvsGlobalProxy *obj, int w, int h, int n, } */ -int global_proxy_dtor(VisObject *obj) -{ - int i; - AvsGlobalProxy *proxy = AVS_GLOBAL_PROXY(obj); +int global_proxy_dtor(VisObject *obj) { + int i; + AvsGlobalProxy *proxy = AVS_GLOBAL_PROXY(obj); - if(proxy->buffers != NULL) { - for(i = 0; i < MAXBUF; i++) { - if(proxy->buffers[i].buffer != NULL) - visual_mem_free(proxy->buffers[i].buffer); - } - visual_mem_free(proxy->buffers); + if (proxy->buffers != NULL) { + for (i = 0; i < MAXBUF; i++) { + if (proxy->buffers[i].buffer != NULL) + visual_mem_free(proxy->buffers[i].buffer); } + visual_mem_free(proxy->buffers); + } - visual_object_unref(VISUAL_OBJECT(proxy->multidelay)); + visual_object_unref(VISUAL_OBJECT(proxy->multidelay)); - visual_mem_free(proxy->framebuffer); - visual_mem_free(proxy->fbout); + visual_mem_free(proxy->framebuffer); + visual_mem_free(proxy->fbout); - for(i = 0; i < MAXBUF; i++) { - visual_mem_free(proxy->buffers[i].buffer); - } + for (i = 0; i < MAXBUF; i++) { + visual_mem_free(proxy->buffers[i].buffer); + } - visual_video_free_buffer(proxy->framebuffer); - visual_video_free_buffer(proxy->fbout); + visual_video_free_buffer(proxy->framebuffer); + visual_video_free_buffer(proxy->fbout); - visual_mem_free(proxy); + visual_mem_free(proxy); - return FALSE; + return FALSE; } -int multidelay_dtor(VisObject *obj) -{ - AvsMultidelayGlobals *multidelay = AVS_MULTIDELAY(obj); - int i; +int multidelay_dtor(VisObject *obj) { + AvsMultidelayGlobals *multidelay = AVS_MULTIDELAY(obj); + int i; - for(i = 0; i < MAXBUF; i++) - { - visual_mem_free(multidelay->buffer[i].fb); - } + for (i = 0; i < MAXBUF; i++) { + visual_mem_free(multidelay->buffer[i].fb); + } - visual_mem_free(multidelay); + visual_mem_free(multidelay); - return VISUAL_OK; + return VISUAL_OK; } -int multidelay_init(AvsMultidelayGlobals *multidelay) -{ - int i; - for(i = 0; i < MAXBUF; i++) - { - multidelay->renderid = 0; - multidelay->framessincebeat = 0; - multidelay->framesperbeat = 0; - multidelay->framemem = 1; - multidelay->oldframemem = 1; - multidelay->usebeats[i] = FALSE; - multidelay->delay[i] = 0; - multidelay->framedelay[i] = 0; - multidelay->buffersize[i] = 1; - multidelay->virtualbuffersize[i] = 1; - multidelay->oldvirtualbuffersize[i] = 1; - multidelay->buffer[i].fb = visual_mem_malloc0(multidelay->buffersize[i]); - multidelay->inpos[i].fb = multidelay->buffer[i].fb; - multidelay->outpos[i].fb = multidelay->buffer[i].fb; - } - - return VISUAL_OK; +int multidelay_init(AvsMultidelayGlobals *multidelay) { + int i; + for (i = 0; i < MAXBUF; i++) { + multidelay->renderid = 0; + multidelay->framessincebeat = 0; + multidelay->framesperbeat = 0; + multidelay->framemem = 1; + multidelay->oldframemem = 1; + multidelay->usebeats[i] = FALSE; + multidelay->delay[i] = 0; + multidelay->framedelay[i] = 0; + multidelay->buffersize[i] = 1; + multidelay->virtualbuffersize[i] = 1; + multidelay->oldvirtualbuffersize[i] = 1; + multidelay->buffer[i].fb = visual_mem_malloc0(multidelay->buffersize[i]); + multidelay->inpos[i].fb = multidelay->buffer[i].fb; + multidelay->outpos[i].fb = multidelay->buffer[i].fb; + } + + return VISUAL_OK; } -AvsGlobalProxy *avs_global_proxy_new(int w, int h, int depth) -{ - AvsGlobalProxy *proxy = visual_mem_new0(AvsGlobalProxy, 1); - - visual_object_initialize(VISUAL_OBJECT(proxy), 0, global_proxy_dtor); +AvsGlobalProxy *avs_global_proxy_new(int w, int h, int depth) { + AvsGlobalProxy *proxy = visual_mem_new0(AvsGlobalProxy, 1); - proxy->multidelay = visual_mem_new0(AvsMultidelayGlobals, 1); + visual_object_initialize(VISUAL_OBJECT(proxy), 0, global_proxy_dtor); - proxy->framebuffer = visual_video_new_with_buffer(w, h, depth); + proxy->multidelay = visual_mem_new0(AvsMultidelayGlobals, 1); - proxy->fbout = visual_video_new_with_buffer(w, h, depth); + proxy->framebuffer = visual_video_new_with_buffer(w, h, depth); - visual_object_initialize(VISUAL_OBJECT(proxy->multidelay), 0, multidelay_dtor); + proxy->fbout = visual_video_new_with_buffer(w, h, depth); - multidelay_init(proxy->multidelay); + visual_object_initialize(VISUAL_OBJECT(proxy->multidelay), 0, + multidelay_dtor); - return proxy; + multidelay_init(proxy->multidelay); + + return proxy; } -int avs_global_proxy_resize(AvsGlobalProxy *proxy, int w, int h, int depth) -{ - VisVideo *tmp = proxy->framebuffer; - proxy->framebuffer = visual_video_scale_depth_new(tmp, w, h, depth, VISUAL_VIDEO_SCALE_NEAREST); - visual_video_free_buffer(tmp); - tmp = proxy->fbout; - proxy->fbout = visual_video_scale_depth_new(tmp, w, h, depth, VISUAL_VIDEO_SCALE_NEAREST); - visual_video_free_buffer(tmp); - return 0; +int avs_global_proxy_resize(AvsGlobalProxy *proxy, int w, int h, int depth) { + VisVideo *tmp = proxy->framebuffer; + proxy->framebuffer = visual_video_scale_depth_new(tmp, w, h, depth, + VISUAL_VIDEO_SCALE_NEAREST); + visual_video_free_buffer(tmp); + tmp = proxy->fbout; + proxy->fbout = visual_video_scale_depth_new(tmp, w, h, depth, + VISUAL_VIDEO_SCALE_NEAREST); + visual_video_free_buffer(tmp); + return 0; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_globals.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_globals.h index 5070d17c6..255a0c6f4 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_globals.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_globals.h @@ -4,63 +4,65 @@ #include -#define AVS_GLOBAL_PROXY(obj) VISUAL_CHECK_CAST((obj), AvsGlobalProxy) -#define AVS_MULTIDELAY(obj) VISUAL_CHECK_CAST((obj), AvsMultidelayGlobals) +#define AVS_GLOBAL_PROXY(obj) VISUAL_CHECK_CAST((obj), AvsGlobalProxy) +#define AVS_MULTIDELAY(obj) VISUAL_CHECK_CAST((obj), AvsMultidelayGlobals) #define MAXBUF 8 typedef struct { - uint32_t *buffer; + uint32_t *buffer; } AvsGlobalBuffer; typedef struct { - void *fb; + void *fb; } AvsLPVOID; typedef struct _AvsGlobalProxy AvsGlobalProxy; typedef struct _AvsMultidelayGlobals AvsMultidelayGlobals; struct _AvsGlobalProxy { - VisObject obj; - unsigned char blendtable[256][256]; - int reset_vars_on_recompile; - int line_blend_mode; + VisObject obj; + unsigned char blendtable[256][256]; + int reset_vars_on_recompile; + int line_blend_mode; - AvsGlobalBuffer buffers[MAXBUF]; + AvsGlobalBuffer buffers[MAXBUF]; - VisVideo *framebuffer; - VisVideo *fbout; + VisVideo *framebuffer; + VisVideo *fbout; - int numbuffers; - int isBeat; - float audiodata[2][2][1024]; // Is in the format of [spectrum:0,wave:1][channel][band] + int numbuffers; + int isBeat; + float audiodata[2][2][1024]; // Is in the format of + // [spectrum:0,wave:1][channel][band] - AvsMultidelayGlobals *multidelay; + AvsMultidelayGlobals *multidelay; - char *path; + char *path; }; struct _AvsMultidelayGlobals { - VisObject obj; - - AvsLPVOID buffer[MAXBUF]; - AvsLPVOID inpos[MAXBUF]; - AvsLPVOID outpos[MAXBUF]; - unsigned long buffersize[MAXBUF]; - unsigned long virtualbuffersize[MAXBUF]; - unsigned long oldvirtualbuffersize[MAXBUF]; - unsigned long framedelay[MAXBUF]; - unsigned int numinstances; - unsigned long framessincebeat; - unsigned long framesperbeat; - unsigned long framemem; - unsigned long oldframemem; - unsigned int renderid; - uint8_t usebeats[6]; - int32_t delay[6]; + VisObject obj; + + AvsLPVOID buffer[MAXBUF]; + AvsLPVOID inpos[MAXBUF]; + AvsLPVOID outpos[MAXBUF]; + unsigned long buffersize[MAXBUF]; + unsigned long virtualbuffersize[MAXBUF]; + unsigned long oldvirtualbuffersize[MAXBUF]; + unsigned long framedelay[MAXBUF]; + unsigned int numinstances; + unsigned long framessincebeat; + unsigned long framesperbeat; + unsigned long framemem; + unsigned long oldframemem; + unsigned int renderid; + uint8_t usebeats[6]; + int32_t delay[6]; }; -//AvsGlobalBuffer *avs_get_global_buffer(AvsGlobalProxy *obj, int w, int h, int n, int do_alloc); +// AvsGlobalBuffer *avs_get_global_buffer(AvsGlobalProxy *obj, int w, int h, int +// n, int do_alloc); AvsGlobalProxy *avs_global_proxy_new(int w, int h, int depth); int avs_global_proxy_resize(AvsGlobalProxy *proxy, int w, int h, int depth); diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_matrix.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_matrix.c index 47f369bdf..a000837e1 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_matrix.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_matrix.c @@ -3,42 +3,51 @@ void matrixRotate(float matrix[], char m, float Deg) { char m1, m2; - float c,s; + float c, s; Deg *= 3.141592653589f / 180.0f; - memset(matrix,0,sizeof(float)*16); - matrix[((m-1)<<2)+m-1] = matrix[15] = 1.0f; + memset(matrix, 0, sizeof(float) * 16); + matrix[((m - 1) << 2) + m - 1] = matrix[15] = 1.0f; m1 = (m % 3); - m2 = ((m1+1) % 3); - c = (float)cos(Deg); s = (float)sin(Deg); - matrix[(m1<<2)+m1]=c; matrix[(m1<<2)+m2]=s; - matrix[(m2<<2)+m2]=c; matrix[(m2<<2)+m1]=-s; + m2 = ((m1 + 1) % 3); + c = (float)cos(Deg); + s = (float)sin(Deg); + matrix[(m1 << 2) + m1] = c; + matrix[(m1 << 2) + m2] = s; + matrix[(m2 << 2) + m2] = c; + matrix[(m2 << 2) + m1] = -s; } void matrixTranslate(float m[], float x, float y, float z) { - memset(m,0,sizeof(float)*16); - m[0] = m[4+1] = m[8+2] = m[12+3] = 1.0f; - m[0+3] = x; m[4+3] = y; m[8+3] = z; + memset(m, 0, sizeof(float) * 16); + m[0] = m[4 + 1] = m[8 + 2] = m[12 + 3] = 1.0f; + m[0 + 3] = x; + m[4 + 3] = y; + m[8 + 3] = z; } void matrixMultiply(float *dest, float src[]) { float temp[16]; int i; - memcpy(temp,dest,sizeof(float)*16); + memcpy(temp, dest, sizeof(float) * 16); for (i = 0; i < 16; i += 4) { - *dest++ = src[i+0]*temp[(0<<2)+0]+src[i+1]*temp[(1<<2)+0]+ - src[i+2]*temp[(2<<2)+0]+src[i+3]*temp[(3<<2)+0]; - *dest++ = src[i+0]*temp[(0<<2)+1]+src[i+1]*temp[(1<<2)+1]+ - src[i+2]*temp[(2<<2)+1]+src[i+3]*temp[(3<<2)+1]; - *dest++ = src[i+0]*temp[(0<<2)+2]+src[i+1]*temp[(1<<2)+2]+ - src[i+2]*temp[(2<<2)+2]+src[i+3]*temp[(3<<2)+2]; - *dest++ = src[i+0]*temp[(0<<2)+3]+src[i+1]*temp[(1<<2)+3]+ - src[i+2]*temp[(2<<2)+3]+src[i+3]*temp[(3<<2)+3]; + *dest++ = src[i + 0] * temp[(0 << 2) + 0] + + src[i + 1] * temp[(1 << 2) + 0] + + src[i + 2] * temp[(2 << 2) + 0] + src[i + 3] * temp[(3 << 2) + 0]; + *dest++ = src[i + 0] * temp[(0 << 2) + 1] + + src[i + 1] * temp[(1 << 2) + 1] + + src[i + 2] * temp[(2 << 2) + 1] + src[i + 3] * temp[(3 << 2) + 1]; + *dest++ = src[i + 0] * temp[(0 << 2) + 2] + + src[i + 1] * temp[(1 << 2) + 2] + + src[i + 2] * temp[(2 << 2) + 2] + src[i + 3] * temp[(3 << 2) + 2]; + *dest++ = src[i + 0] * temp[(0 << 2) + 3] + + src[i + 1] * temp[(1 << 2) + 3] + + src[i + 2] * temp[(2 << 2) + 3] + src[i + 3] * temp[(3 << 2) + 3]; } } -void matrixApply(float *m, float x, float y, float z, - float *outx, float *outy, float *outz) { - *outx = x*m[0] + y*m[1] + z*m[2] + m[3]; - *outy = x*m[4] + y*m[5] + z*m[6] + m[7]; - *outz = x*m[8] + y*m[9] + z*m[10] + m[11]; +void matrixApply(float *m, float x, float y, float z, float *outx, float *outy, + float *outz) { + *outx = x * m[0] + y * m[1] + z * m[2] + m[3]; + *outy = x * m[4] + y * m[5] + z * m[6] + m[7]; + *outz = x * m[8] + y * m[9] + z * m[10] + m[11]; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_matrix.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_matrix.h index 7af0fab05..182677681 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_matrix.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_matrix.h @@ -5,5 +5,5 @@ void matrixTranslate(float m[], float x, float y, float z); void matrixMultiply(float *dest, float src[]); -void matrixApply(float *m, float x, float y, float z, - float *outx, float *outy, float *outz); +void matrixApply(float *m, float x, float y, float z, float *outx, float *outy, + float *outz); diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_parse.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_parse.c index a0a06a7d6..7b7fee9ca 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_parse.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_parse.c @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -34,854 +34,832 @@ #include "avs_parse.h" /* Prototypes */ -static int avs_tree_dtor (VisObject *object); -static int avs_element_dtor (VisObject *object); -static int avs_main_dtor (VisObject *object); -static int avs_render_superscope_dtor (VisObject *object); +static int avs_tree_dtor(VisObject *object); +static int avs_element_dtor(VisObject *object); +static int avs_main_dtor(VisObject *object); +static int avs_render_superscope_dtor(VisObject *object); -static void show_options (AVSElement *element); +static void show_options(AVSElement *element); /* Object destructors */ -static int avs_tree_dtor (VisObject *object) -{ - AVSTree *avstree = AVS_TREE (object); +static int avs_tree_dtor(VisObject *object) { + AVSTree *avstree = AVS_TREE(object); - if (avstree->data != NULL) - visual_mem_free (avstree->data); + if (avstree->data != NULL) + visual_mem_free(avstree->data); - if (avstree->main != NULL) - visual_object_unref (VISUAL_OBJECT (avstree->main)); + if (avstree->main != NULL) + visual_object_unref(VISUAL_OBJECT(avstree->main)); - avstree->origfile = NULL; - avstree->data = NULL; - avstree->cur = NULL; - avstree->main = NULL; + avstree->origfile = NULL; + avstree->data = NULL; + avstree->cur = NULL; + avstree->main = NULL; - return TRUE; + return TRUE; } -/* Every object that derives from AVSElement needs to pass on to this dtor when setting a custom dtor */ -static int avs_element_dtor (VisObject *object) -{ - AVSElement *element = AVS_ELEMENT (object); +/* Every object that derives from AVSElement needs to pass on to this dtor when + * setting a custom dtor */ +static int avs_element_dtor(VisObject *object) { + AVSElement *element = AVS_ELEMENT(object); - if (element->serialize != NULL) - visual_object_unref (VISUAL_OBJECT (element->serialize)); + if (element->serialize != NULL) + visual_object_unref(VISUAL_OBJECT(element->serialize)); - if (element->pcont != NULL) - visual_object_unref (VISUAL_OBJECT (element->pcont)); + if (element->pcont != NULL) + visual_object_unref(VISUAL_OBJECT(element->pcont)); - element->serialize = NULL; - element->pcont = NULL; + element->serialize = NULL; + element->pcont = NULL; - return TRUE; + return TRUE; } -static int avs_container_dtor (VisObject *object) -{ - AVSContainer *container = AVS_CONTAINER (object); +static int avs_container_dtor(VisObject *object) { + AVSContainer *container = AVS_CONTAINER(object); - if (container->members != NULL) - visual_object_unref (VISUAL_OBJECT (container->members)); + if (container->members != NULL) + visual_object_unref(VISUAL_OBJECT(container->members)); - container->members = NULL; + container->members = NULL; - avs_element_dtor (object); + avs_element_dtor(object); - return TRUE; + return TRUE; } +static void show_options(AVSElement *element) { + return; + VisParamEntry *param; + VisHashmapChainEntry *mentry; + VisCollectionIter *iter; + if (element == NULL) + return; -static void show_options (AVSElement *element) -{ - return; - VisParamEntry *param; - VisHashmapChainEntry *mentry; - VisCollectionIter *iter; - - if (element == NULL) - return; - - printf ("Element options of element type: %d\n", element->type); + printf("Element options of element type: %d\n", element->type); - iter = visual_collection_get_iter (VISUAL_COLLECTION (&element->pcont->entries)); + iter = + visual_collection_get_iter(VISUAL_COLLECTION(&element->pcont->entries)); - while (visual_collection_iter_has_more (iter)) { - printf("Bleh\n"); - mentry = visual_collection_iter_get_data (iter); - param = mentry->data; + while (visual_collection_iter_has_more(iter)) { + printf("Bleh\n"); + mentry = visual_collection_iter_get_data(iter); + param = mentry->data; - switch (param->type) { - case VISUAL_PARAM_ENTRY_TYPE_NULL: - printf ("\t%s: Type NULL\n", - visual_param_entry_get_name (param)); + switch (param->type) { + case VISUAL_PARAM_ENTRY_TYPE_NULL: + printf("\t%s: Type NULL\n", visual_param_entry_get_name(param)); - break; + break; - case VISUAL_PARAM_ENTRY_TYPE_STRING: - printf ("\t%s: Type STRING: %s\n", - visual_param_entry_get_name (param), - visual_param_entry_get_string (param)); + case VISUAL_PARAM_ENTRY_TYPE_STRING: + printf("\t%s: Type STRING: %s\n", visual_param_entry_get_name(param), + visual_param_entry_get_string(param)); - break; + break; - case VISUAL_PARAM_ENTRY_TYPE_INTEGER: - printf ("\t%s: Type INTEGER: %d\n", - visual_param_entry_get_name (param), - visual_param_entry_get_integer (param)); + case VISUAL_PARAM_ENTRY_TYPE_INTEGER: + printf("\t%s: Type INTEGER: %d\n", visual_param_entry_get_name(param), + visual_param_entry_get_integer(param)); - break; + break; - case VISUAL_PARAM_ENTRY_TYPE_FLOAT: - printf ("\t%s: Type FLOAT: %f\n", - visual_param_entry_get_name (param), - visual_param_entry_get_float (param)); + case VISUAL_PARAM_ENTRY_TYPE_FLOAT: + printf("\t%s: Type FLOAT: %f\n", visual_param_entry_get_name(param), + visual_param_entry_get_float(param)); - break; + break; - case VISUAL_PARAM_ENTRY_TYPE_DOUBLE: - printf ("\t%s: Type DOUBLE: %f\n", - visual_param_entry_get_name (param), - visual_param_entry_get_double (param)); + case VISUAL_PARAM_ENTRY_TYPE_DOUBLE: + printf("\t%s: Type DOUBLE: %f\n", visual_param_entry_get_name(param), + visual_param_entry_get_double(param)); - break; + break; - case VISUAL_PARAM_ENTRY_TYPE_COLOR: - printf ("\t%s: Type COLOR: %d %d %d\n", - visual_param_entry_get_name (param), - param->color.r, param->color.g, param->color.b); + case VISUAL_PARAM_ENTRY_TYPE_COLOR: + printf("\t%s: Type COLOR: %d %d %d\n", visual_param_entry_get_name(param), + param->color.r, param->color.g, param->color.b); - break; + break; - case VISUAL_PARAM_ENTRY_TYPE_PALETTE: - { - int i; + case VISUAL_PARAM_ENTRY_TYPE_PALETTE: { + int i; - printf ("\t%s: Type PALETTE:\n", - visual_param_entry_get_name (param)); + printf("\t%s: Type PALETTE:\n", visual_param_entry_get_name(param)); - for (i = 0; i < param->pal.ncolors; i++) { - printf ("\t\tcolor[%d] %d %d %d\n", i, - param->pal.colors[i].r, - param->pal.colors[i].g, - param->pal.colors[i].b); - } - } - break; + for (i = 0; i < param->pal.ncolors; i++) { + printf("\t\tcolor[%d] %d %d %d\n", i, param->pal.colors[i].r, + param->pal.colors[i].g, param->pal.colors[i].b); + } + } break; - default: - break; - } - } + default: + break; + } + } - printf ("\n"); + printf("\n"); } - - /* AVS parser */ -AVSTree *avs_tree_new_from_preset (char *filename) -{ - AVSTree *avstree; +AVSTree *avs_tree_new_from_preset(char *filename) { + AVSTree *avstree; - avstree = visual_mem_new0 (AVSTree, 1); + avstree = visual_mem_new0(AVSTree, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (avstree), TRUE, avs_tree_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(avstree), TRUE, avs_tree_dtor); - avs_parse_data (avstree, filename); + avs_parse_data(avstree, filename); - return avstree; + return avstree; } -int avs_check_version (AVSTree *avstree) -{ - if (avstree->datasize <= strlen ("Nullsoft AVS Preset 0.2")) { - avstree->version = AVS_VERSION_UNKNOWN; +int avs_check_version(AVSTree *avstree) { + if (avstree->datasize <= strlen("Nullsoft AVS Preset 0.2")) { + avstree->version = AVS_VERSION_UNKNOWN; - printf ("VERSION PARSE: unknown\n"); + printf("VERSION PARSE: unknown\n"); - return -1; - } + return -1; + } - if (!strncmp(avstree->data, "Nullsoft AVS Preset 0.2", strlen ("Nullsoft AVS Preset 0.2"))) { - avstree->version = AVS_VERSION_2; + if (!strncmp(avstree->data, "Nullsoft AVS Preset 0.2", + strlen("Nullsoft AVS Preset 0.2"))) { + avstree->version = AVS_VERSION_2; - printf ("VERSION PARSE: Nullsoft AVS Preset 0.2\n"); + printf("VERSION PARSE: Nullsoft AVS Preset 0.2\n"); - avstree->cur = avstree->data + strlen ("Nullsoft AVS Preset 0.2"); + avstree->cur = avstree->data + strlen("Nullsoft AVS Preset 0.2"); - return 0; - } + return 0; + } - avstree->version = AVS_VERSION_UNKNOWN; + avstree->version = AVS_VERSION_UNKNOWN; - printf ("VERSION PARSE: unknown\n"); + printf("VERSION PARSE: unknown\n"); - return -1; + return -1; } -int avs_parse_tree (AVSTree *avstree, AVSContainer *curcontainer) -{ - AVSElement *element = NULL; - char namedelem[30]; - int isnamed; - char *next_section = NULL; - int marker; - - if (curcontainer == NULL) - return -1; - - while (avstree->cur < (avstree->data + avstree->datasize)) { - - element = NULL; - - marker = AVS_SERIALIZE_GET_INT (AVS_TREE_GET_CURRENT_POINTER (avstree)); - AVS_SERIALIZE_SKIP_INT (AVS_TREE_GET_CURRENT_POINTER (avstree)); - - /* Named preset section */ - isnamed = FALSE; - if (marker > 0xff) { - printf ("Marker > 0xff, named APE %x\n", marker); - - strncpy (namedelem, AVS_TREE_GET_CURRENT_POINTER (avstree), 30); - - AVS_SERIALIZE_SKIP_LENGTH (avstree->cur, 32); - isnamed = TRUE; - marker = AVS_ELEMENT_TYPE_APE; - - printf("avstree->cur %s\n", avstree->cur); - } - // FIXME: In some files next_section doesn't point to the correct location. - // Check the location of the section's size data. For now I've commented the - // line at the bottom of this function where avstree->cur is assigned next_section. - // This may not work for every file, but it works with the few I've checked. - next_section = AVS_SERIALIZE_GET_NEXT_SECTION (AVS_TREE_GET_CURRENT_POINTER (avstree)); - avstree->cur_section_length = next_section - avstree->cur; - - AVS_SERIALIZE_SKIP_INT (AVS_TREE_GET_CURRENT_POINTER (avstree)); - - printf (":: 0x%x marker! %d\n", marker, marker); - - /* FIXME: Use a table lookup here instead of giant function */ - switch (marker) { - case AVS_ELEMENT_TYPE_RENDER_SIMPLESPECTRUM: - - break; - - case AVS_ELEMENT_TYPE_MISC_COMMENT: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_MISC_COMMENT, - "text", AVS_SERIALIZE_ENTRY_TYPE_STRING, - NULL); - - break; - - case AVS_ELEMENT_TYPE_MISC_RENDERSTATE: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_MISC_RENDERSTATE, - "newmode", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - break; - - case AVS_ELEMENT_TYPE_MISC_BPM: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_MISC_BPM, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "arbitrary", AVS_SERIALIZE_ENTRY_TYPE_INT, - "skip", AVS_SERIALIZE_ENTRY_TYPE_INT, - "invert", AVS_SERIALIZE_ENTRY_TYPE_INT, - "arbVal", AVS_SERIALIZE_ENTRY_TYPE_INT, - "skipVal", AVS_SERIALIZE_ENTRY_TYPE_INT, - "skipfirst", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - break; - - - case AVS_ELEMENT_TYPE_MISC_STACK: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_MISC_STACK, - "dir", AVS_SERIALIZE_ENTRY_TYPE_INT, - "which", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - "adjblend_val", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - break; - - case AVS_ELEMENT_TYPE_RENDER_RING: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_RENDER_RING, - "source and place", AVS_SERIALIZE_ENTRY_TYPE_INT, - "palette", AVS_SERIALIZE_ENTRY_TYPE_PALETTE, - "size", AVS_SERIALIZE_ENTRY_TYPE_BYTE, - "type", AVS_SERIALIZE_ENTRY_TYPE_BYTE, - NULL); - - break; - - case AVS_ELEMENT_TYPE_RENDER_SUPERSCOPE: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_RENDER_SUPERSCOPE, - "empty", AVS_SERIALIZE_ENTRY_TYPE_BYTE, - "point", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "frame", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "beat", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "init", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "channel source", AVS_SERIALIZE_ENTRY_TYPE_INT, - "palette", AVS_SERIALIZE_ENTRY_TYPE_PALETTE, - "draw type", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_DMOVE: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_DMOVE, - "empty", AVS_SERIALIZE_ENTRY_TYPE_BYTE, - "point", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "frame", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "beat", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "init", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "subpixel", AVS_SERIALIZE_ENTRY_TYPE_INT, - "rectcoords", AVS_SERIALIZE_ENTRY_TYPE_INT, - "xres", AVS_SERIALIZE_ENTRY_TYPE_INT, - "yres", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - "wrap", AVS_SERIALIZE_ENTRY_TYPE_INT, - "buffern", AVS_SERIALIZE_ENTRY_TYPE_INT, - "nomove", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - break; - - case AVS_ELEMENT_TYPE_RENDER_CLEARSCREEN: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_RENDER_CLEARSCREEN, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, - "clear type", AVS_SERIALIZE_ENTRY_TYPE_INT, - "clear 5050", AVS_SERIALIZE_ENTRY_TYPE_INT, - "first", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_RENDER_BASSSPIN: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_RENDER_BASSSPIN, - "chan enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "left color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, - "right color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, - "draw type", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - break; - - case AVS_ELEMENT_TYPE_TRANS_FASTBRIGHT: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_FASTBRIGHT, - "brightness type", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_INVERT: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_INVERT, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_BLUR: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_BLUR, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "roundmode", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_MOVEMENT: - element = AVS_ELEMENT (avs_parse_trans_movement (avstree)); - - break; - - case AVS_ELEMENT_TYPE_TRANS_ONETONE: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_ONETONE, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blendavg", AVS_SERIALIZE_ENTRY_TYPE_INT, - "invert", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_GRAIN: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_GRAIN, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blendavg", AVS_SERIALIZE_ENTRY_TYPE_INT, - "smax", AVS_SERIALIZE_ENTRY_TYPE_INT, - "staticgrain", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_MIRROR: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_MIRROR, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "mode", AVS_SERIALIZE_ENTRY_TYPE_INT, - "onbeat", AVS_SERIALIZE_ENTRY_TYPE_INT, - "smooth", AVS_SERIALIZE_ENTRY_TYPE_INT, - "slower", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_SCATTER: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_SCATTER, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_FADEOUT: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_FADEOUT, - "fadelen", AVS_SERIALIZE_ENTRY_TYPE_INT, - "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_MOSAIC: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_MOSAIC, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "quality", AVS_SERIALIZE_ENTRY_TYPE_INT, - "quality2", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blendavg", AVS_SERIALIZE_ENTRY_TYPE_INT, - "onbeat", AVS_SERIALIZE_ENTRY_TYPE_INT, - "frame duration", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_WATER: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_WATERBUMP: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_WATERBUMP, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "density", AVS_SERIALIZE_ENTRY_TYPE_INT, - "depth", AVS_SERIALIZE_ENTRY_TYPE_INT, - "random prop", AVS_SERIALIZE_ENTRY_TYPE_INT, - "drop position x", AVS_SERIALIZE_ENTRY_TYPE_INT, - "drop position y", AVS_SERIALIZE_ENTRY_TYPE_INT, - "drop radius", AVS_SERIALIZE_ENTRY_TYPE_INT, - "method", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blendavg", AVS_SERIALIZE_ENTRY_TYPE_INT, - "redp", AVS_SERIALIZE_ENTRY_TYPE_INT, - "greenp", AVS_SERIALIZE_ENTRY_TYPE_INT, - "bleup", AVS_SERIALIZE_ENTRY_TYPE_INT, - "dissoc", AVS_SERIALIZE_ENTRY_TYPE_INT, - "color", AVS_SERIALIZE_ENTRY_TYPE_INT, - "exclude", AVS_SERIALIZE_ENTRY_TYPE_INT, - "distance", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_BUMPMAP: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_BUMPMAP, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "onbeat", AVS_SERIALIZE_ENTRY_TYPE_INT, - "frame duration", AVS_SERIALIZE_ENTRY_TYPE_INT, - "depth", AVS_SERIALIZE_ENTRY_TYPE_INT, - "depth 2", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blendavg", AVS_SERIALIZE_ENTRY_TYPE_INT, - "code1", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "code2", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "code3", AVS_SERIALIZE_ENTRY_TYPE_STRING, - "showlight", AVS_SERIALIZE_ENTRY_TYPE_INT, - "invert", AVS_SERIALIZE_ENTRY_TYPE_INT, - "oldstyle", AVS_SERIALIZE_ENTRY_TYPE_INT, - "buffern", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_TRANS_NFRAMECLEAR: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_NFRAMECLEAR, - "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - "n frame", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_RENDER_PARTICLE: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_RENDER_PARTICLE, - "enabled", AVS_SERIALIZE_ENTRY_TYPE_INT, - "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, - "maxdist", AVS_SERIALIZE_ENTRY_TYPE_INT, - "size", AVS_SERIALIZE_ENTRY_TYPE_INT, - "size2", AVS_SERIALIZE_ENTRY_TYPE_INT, - "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_RENDER_OSCSTARS: - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_RENDER_OSCSTARS, - "effect", AVS_SERIALIZE_ENTRY_TYPE_INT, - "palette", AVS_SERIALIZE_ENTRY_TYPE_PALETTE, - "size", AVS_SERIALIZE_ENTRY_TYPE_INT, - "rotate", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - - break; - - case AVS_ELEMENT_TYPE_APE: - - printf ("APE NAME: %s\n", namedelem); - - element = NULL; - if (strcmp (namedelem, "Multiplier") == 0) { - element = avs_parse_element_non_complex (avstree, AVS_ELEMENT_TYPE_TRANS_MULTIPLIER, - "multiply", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - } else if (strcmp (namedelem, "Channel Shift") == 0) { - element = avs_parse_element_non_complex (avstree, - AVS_ELEMENT_TYPE_TRANS_CHANNELSHIFT, - "shift", AVS_SERIALIZE_ENTRY_TYPE_INT, - "onbeat", AVS_SERIALIZE_ENTRY_TYPE_INT, - NULL); - } else { - printf ("Unhandled named entry: %s position: %x\n", - namedelem, avstree->cur - avstree->data); - } - - break; - - default: - printf ("Unhandled type: %x position: %x\n", *avstree->cur, avstree->cur - avstree->data); - - return -1; - - break; - } - - if (element != NULL) { - visual_list_add (curcontainer->members, element); - - show_options (element); - } - - - avstree->cur = next_section; - } - - return 0; +int avs_parse_tree(AVSTree *avstree, AVSContainer *curcontainer) { + AVSElement *element = NULL; + char namedelem[30]; + int isnamed; + char *next_section = NULL; + int marker; + + if (curcontainer == NULL) + return -1; + + while (avstree->cur < (avstree->data + avstree->datasize)) { + + element = NULL; + + marker = AVS_SERIALIZE_GET_INT(AVS_TREE_GET_CURRENT_POINTER(avstree)); + AVS_SERIALIZE_SKIP_INT(AVS_TREE_GET_CURRENT_POINTER(avstree)); + + /* Named preset section */ + isnamed = FALSE; + if (marker > 0xff) { + printf("Marker > 0xff, named APE %x\n", marker); + + strncpy(namedelem, AVS_TREE_GET_CURRENT_POINTER(avstree), 30); + + AVS_SERIALIZE_SKIP_LENGTH(avstree->cur, 32); + isnamed = TRUE; + marker = AVS_ELEMENT_TYPE_APE; + + printf("avstree->cur %s\n", avstree->cur); + } + // FIXME: In some files next_section doesn't point to the correct location. + // Check the location of the section's size data. For now I've commented the + // line at the bottom of this function where avstree->cur is assigned + // next_section. This may not work for every file, but it works with the few + // I've checked. + next_section = + AVS_SERIALIZE_GET_NEXT_SECTION(AVS_TREE_GET_CURRENT_POINTER(avstree)); + avstree->cur_section_length = next_section - avstree->cur; + + AVS_SERIALIZE_SKIP_INT(AVS_TREE_GET_CURRENT_POINTER(avstree)); + + printf(":: 0x%x marker! %d\n", marker, marker); + + /* FIXME: Use a table lookup here instead of giant function */ + switch (marker) { + case AVS_ELEMENT_TYPE_RENDER_SIMPLESPECTRUM: + + break; + + case AVS_ELEMENT_TYPE_MISC_COMMENT: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_MISC_COMMENT, "text", + AVS_SERIALIZE_ENTRY_TYPE_STRING, NULL); + + break; + + case AVS_ELEMENT_TYPE_MISC_RENDERSTATE: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_MISC_RENDERSTATE, "newmode", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + break; + + case AVS_ELEMENT_TYPE_MISC_BPM: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_MISC_BPM, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "arbitrary", + AVS_SERIALIZE_ENTRY_TYPE_INT, "skip", AVS_SERIALIZE_ENTRY_TYPE_INT, + "invert", AVS_SERIALIZE_ENTRY_TYPE_INT, "arbVal", + AVS_SERIALIZE_ENTRY_TYPE_INT, "skipVal", AVS_SERIALIZE_ENTRY_TYPE_INT, + "skipfirst", AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + break; + + case AVS_ELEMENT_TYPE_MISC_STACK: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_MISC_STACK, "dir", + AVS_SERIALIZE_ENTRY_TYPE_INT, "which", AVS_SERIALIZE_ENTRY_TYPE_INT, + "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, "adjblend_val", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + break; + + case AVS_ELEMENT_TYPE_RENDER_RING: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_RENDER_RING, "source and place", + AVS_SERIALIZE_ENTRY_TYPE_INT, "palette", + AVS_SERIALIZE_ENTRY_TYPE_PALETTE, "size", + AVS_SERIALIZE_ENTRY_TYPE_BYTE, "type", AVS_SERIALIZE_ENTRY_TYPE_BYTE, + NULL); + + break; + + case AVS_ELEMENT_TYPE_RENDER_SUPERSCOPE: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_RENDER_SUPERSCOPE, "empty", + AVS_SERIALIZE_ENTRY_TYPE_BYTE, "point", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "frame", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "beat", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "init", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "channel source", + AVS_SERIALIZE_ENTRY_TYPE_INT, "palette", + AVS_SERIALIZE_ENTRY_TYPE_PALETTE, "draw type", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_DMOVE: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_DMOVE, "empty", + AVS_SERIALIZE_ENTRY_TYPE_BYTE, "point", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "frame", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "beat", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "init", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "subpixel", + AVS_SERIALIZE_ENTRY_TYPE_INT, "rectcoords", + AVS_SERIALIZE_ENTRY_TYPE_INT, "xres", AVS_SERIALIZE_ENTRY_TYPE_INT, + "yres", AVS_SERIALIZE_ENTRY_TYPE_INT, "blend", + AVS_SERIALIZE_ENTRY_TYPE_INT, "wrap", AVS_SERIALIZE_ENTRY_TYPE_INT, + "buffern", AVS_SERIALIZE_ENTRY_TYPE_INT, "nomove", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + break; + + case AVS_ELEMENT_TYPE_RENDER_CLEARSCREEN: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_RENDER_CLEARSCREEN, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, + "clear type", AVS_SERIALIZE_ENTRY_TYPE_INT, "clear 5050", + AVS_SERIALIZE_ENTRY_TYPE_INT, "first", AVS_SERIALIZE_ENTRY_TYPE_INT, + NULL); + + break; + + case AVS_ELEMENT_TYPE_RENDER_BASSSPIN: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_RENDER_BASSSPIN, "chan enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "left color", + AVS_SERIALIZE_ENTRY_TYPE_COLOR, "right color", + AVS_SERIALIZE_ENTRY_TYPE_COLOR, "draw type", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + break; + + case AVS_ELEMENT_TYPE_TRANS_FASTBRIGHT: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_FASTBRIGHT, "brightness type", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_INVERT: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_INVERT, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_BLUR: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_BLUR, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "roundmode", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_MOVEMENT: + element = AVS_ELEMENT(avs_parse_trans_movement(avstree)); + + break; + + case AVS_ELEMENT_TYPE_TRANS_ONETONE: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_ONETONE, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, + "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, "blendavg", + AVS_SERIALIZE_ENTRY_TYPE_INT, "invert", AVS_SERIALIZE_ENTRY_TYPE_INT, + NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_GRAIN: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_GRAIN, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, + "blendavg", AVS_SERIALIZE_ENTRY_TYPE_INT, "smax", + AVS_SERIALIZE_ENTRY_TYPE_INT, "staticgrain", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_MIRROR: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_MIRROR, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "mode", AVS_SERIALIZE_ENTRY_TYPE_INT, + "onbeat", AVS_SERIALIZE_ENTRY_TYPE_INT, "smooth", + AVS_SERIALIZE_ENTRY_TYPE_INT, "slower", AVS_SERIALIZE_ENTRY_TYPE_INT, + NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_SCATTER: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_SCATTER, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_FADEOUT: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_FADEOUT, "fadelen", + AVS_SERIALIZE_ENTRY_TYPE_INT, "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, + NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_MOSAIC: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_MOSAIC, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "quality", AVS_SERIALIZE_ENTRY_TYPE_INT, + "quality2", AVS_SERIALIZE_ENTRY_TYPE_INT, "blend", + AVS_SERIALIZE_ENTRY_TYPE_INT, "blendavg", + AVS_SERIALIZE_ENTRY_TYPE_INT, "onbeat", AVS_SERIALIZE_ENTRY_TYPE_INT, + "frame duration", AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_WATER: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_WATERBUMP: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_WATERBUMP, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "density", AVS_SERIALIZE_ENTRY_TYPE_INT, + "depth", AVS_SERIALIZE_ENTRY_TYPE_INT, "random prop", + AVS_SERIALIZE_ENTRY_TYPE_INT, "drop position x", + AVS_SERIALIZE_ENTRY_TYPE_INT, "drop position y", + AVS_SERIALIZE_ENTRY_TYPE_INT, "drop radius", + AVS_SERIALIZE_ENTRY_TYPE_INT, "method", AVS_SERIALIZE_ENTRY_TYPE_INT, + NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, + "blendavg", AVS_SERIALIZE_ENTRY_TYPE_INT, "redp", + AVS_SERIALIZE_ENTRY_TYPE_INT, "greenp", AVS_SERIALIZE_ENTRY_TYPE_INT, + "bleup", AVS_SERIALIZE_ENTRY_TYPE_INT, "dissoc", + AVS_SERIALIZE_ENTRY_TYPE_INT, "color", AVS_SERIALIZE_ENTRY_TYPE_INT, + "exclude", AVS_SERIALIZE_ENTRY_TYPE_INT, "distance", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_BUMPMAP: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_BUMPMAP, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "onbeat", AVS_SERIALIZE_ENTRY_TYPE_INT, + "frame duration", AVS_SERIALIZE_ENTRY_TYPE_INT, "depth", + AVS_SERIALIZE_ENTRY_TYPE_INT, "depth 2", AVS_SERIALIZE_ENTRY_TYPE_INT, + "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, "blendavg", + AVS_SERIALIZE_ENTRY_TYPE_INT, "code1", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "code2", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "code3", + AVS_SERIALIZE_ENTRY_TYPE_STRING, "showlight", + AVS_SERIALIZE_ENTRY_TYPE_INT, "invert", AVS_SERIALIZE_ENTRY_TYPE_INT, + "oldstyle", AVS_SERIALIZE_ENTRY_TYPE_INT, "buffern", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_TRANS_NFRAMECLEAR: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_NFRAMECLEAR, "color", + AVS_SERIALIZE_ENTRY_TYPE_COLOR, "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, + "n frame", AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_RENDER_PARTICLE: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_RENDER_PARTICLE, "enabled", + AVS_SERIALIZE_ENTRY_TYPE_INT, "color", AVS_SERIALIZE_ENTRY_TYPE_COLOR, + "maxdist", AVS_SERIALIZE_ENTRY_TYPE_INT, "size", + AVS_SERIALIZE_ENTRY_TYPE_INT, "size2", AVS_SERIALIZE_ENTRY_TYPE_INT, + "blend", AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + + break; + + case AVS_ELEMENT_TYPE_RENDER_OSCSTARS: + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_RENDER_OSCSTARS, "effect", + AVS_SERIALIZE_ENTRY_TYPE_INT, "palette", + AVS_SERIALIZE_ENTRY_TYPE_PALETTE, "size", + AVS_SERIALIZE_ENTRY_TYPE_INT, "rotate", AVS_SERIALIZE_ENTRY_TYPE_INT, + NULL); + + break; + + case AVS_ELEMENT_TYPE_APE: + + printf("APE NAME: %s\n", namedelem); + + element = NULL; + if (strcmp(namedelem, "Multiplier") == 0) { + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_MULTIPLIER, "multiply", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + } else if (strcmp(namedelem, "Channel Shift") == 0) { + element = avs_parse_element_non_complex( + avstree, AVS_ELEMENT_TYPE_TRANS_CHANNELSHIFT, "shift", + AVS_SERIALIZE_ENTRY_TYPE_INT, "onbeat", + AVS_SERIALIZE_ENTRY_TYPE_INT, NULL); + } else { + printf("Unhandled named entry: %s position: %x\n", namedelem, + avstree->cur - avstree->data); + } + + break; + + default: + printf("Unhandled type: %x position: %x\n", *avstree->cur, + avstree->cur - avstree->data); + + return -1; + + break; + } + + if (element != NULL) { + visual_list_add(curcontainer->members, element); + + show_options(element); + } + + avstree->cur = next_section; + } + + return 0; } -int avs_element_connect_serialize_container (AVSElement *element, AVSSerializeContainer *scont) -{ - element->serialize = scont; +int avs_element_connect_serialize_container(AVSElement *element, + AVSSerializeContainer *scont) { + element->serialize = scont; - return 0; + return 0; } -int avs_element_deserialize (AVSElement *element, AVSTree *avstree) -{ - AVS_TREE_GET_CURRENT_POINTER (avstree) = - avs_serialize_container_deserialize (element->serialize, AVS_TREE_GET_CURRENT_POINTER (avstree)); +int avs_element_deserialize(AVSElement *element, AVSTree *avstree) { + AVS_TREE_GET_CURRENT_POINTER(avstree) = avs_serialize_container_deserialize( + element->serialize, AVS_TREE_GET_CURRENT_POINTER(avstree)); - return 0; + return 0; } -int avs_element_deserialize_many_new_params (AVSElement *element, AVSTree *avstree, ...) -{ - AVSSerializeContainer *scont; +int avs_element_deserialize_many_new_params(AVSElement *element, + AVSTree *avstree, ...) { + AVSSerializeContainer *scont; - VisParamContainer *pcont; - va_list ap; - char *pname; - AVSSerializeEntryType stype; + VisParamContainer *pcont; + va_list ap; + char *pname; + AVSSerializeEntryType stype; - pcont = visual_param_container_new (); - scont = avs_serialize_container_new (); + pcont = visual_param_container_new(); + scont = avs_serialize_container_new(); - va_start (ap, avstree); + va_start(ap, avstree); - while ((pname = va_arg (ap, char *)) != NULL) { - VisParamEntry *param = visual_param_entry_new (pname); - AVSSerializeEntry *sentry; + while ((pname = va_arg(ap, char *)) != NULL) { + VisParamEntry *param = visual_param_entry_new(pname); + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); - sentry->type = va_arg (ap, AVSSerializeEntryType); + sentry = avs_serialize_entry_new(param); + sentry->type = va_arg(ap, AVSSerializeEntryType); - avs_serialize_container_add (scont, sentry); - visual_param_container_add (pcont, param); - } + avs_serialize_container_add(scont, sentry); + visual_param_container_add(pcont, param); + } - va_end (ap); + va_end(ap); - element->pcont = pcont; - avs_element_connect_serialize_container (element, scont); + element->pcont = pcont; + avs_element_connect_serialize_container(element, scont); - return avs_element_deserialize (element, avstree); + return avs_element_deserialize(element, avstree); } -AVSContainer *avs_parse_main (AVSTree *avstree) -{ - AVSContainer *avsmain; - AVSSerializeContainer *scont; - VisParamContainer *pcont; +AVSContainer *avs_parse_main(AVSTree *avstree) { + AVSContainer *avsmain; + AVSSerializeContainer *scont; + VisParamContainer *pcont; - static VisParamEntry params[] = { - VISUAL_PARAM_LIST_ENTRY ("clearscreen"), - VISUAL_PARAM_LIST_END - }; + static VisParamEntry params[] = {VISUAL_PARAM_LIST_ENTRY("clearscreen"), + VISUAL_PARAM_LIST_END}; - pcont = visual_param_container_new (); + pcont = visual_param_container_new(); - visual_param_container_add_many (pcont, params); + visual_param_container_add_many(pcont, params); - avsmain = visual_mem_new0 (AVSContainer, 1); + avsmain = visual_mem_new0(AVSContainer, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (avsmain), TRUE, avs_container_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(avsmain), TRUE, avs_container_dtor); - AVS_ELEMENT (avsmain)->pcont = pcont; - AVS_ELEMENT (avsmain)->type = AVS_ELEMENT_TYPE_MAIN; + AVS_ELEMENT(avsmain)->pcont = pcont; + AVS_ELEMENT(avsmain)->type = AVS_ELEMENT_TYPE_MAIN; - AVS_CONTAINER (avsmain)->members = visual_list_new (visual_object_collection_destroyer); + AVS_CONTAINER(avsmain)->members = + visual_list_new(visual_object_collection_destroyer); - scont = avs_serialize_container_new (); - avs_serialize_container_add_byte (scont, visual_param_container_get (pcont, "clearscreen")); + scont = avs_serialize_container_new(); + avs_serialize_container_add_byte( + scont, visual_param_container_get(pcont, "clearscreen")); - avs_element_connect_serialize_container (AVS_ELEMENT (avsmain), scont); + avs_element_connect_serialize_container(AVS_ELEMENT(avsmain), scont); - avs_element_deserialize (AVS_ELEMENT (avsmain), avstree); + avs_element_deserialize(AVS_ELEMENT(avsmain), avstree); - avstree->main = avsmain; + avstree->main = avsmain; - return avsmain; + return avsmain; } -AVSElement *avs_parse_trans_movement (AVSTree *avstree) -{ - AVSElement *movement; - AVSSerializeContainer *scont; - int len = avstree->cur_section_length; - int pos=0; - - int effect; - int rectangular; - int effect_exp; - int blend; - int sourcemapped; - int subpixel; - int wrap; - int REFFECT_MAX = 23; - int effect_exp_ch; - - char buf[257]; - - VisParamContainer *pcont; - - static VisParamEntry params[] = { - VISUAL_PARAM_LIST_ENTRY_INTEGER ("effect", 0), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("rectangular", 0), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("blend", 0), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("sourcemapped", 0), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("subpixel", 0), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("wrap", 0), - VISUAL_PARAM_LIST_ENTRY_STRING ("code", ""), - VISUAL_PARAM_LIST_END - }; - - visual_mem_set (buf, 0, sizeof (buf)); - - pcont = visual_param_container_new (); - - visual_param_container_add_many(pcont, params); - - movement = visual_mem_new0 (AVSElement, 1); - - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (movement), TRUE, avs_element_dtor); - - AVS_ELEMENT (movement)->pcont = pcont; - AVS_ELEMENT (movement)->type = AVS_ELEMENT_TYPE_TRANS_MOVEMENT; - - /* Deserialize without using the container, too complex (borked) serialization */ - if (len - pos >= 4) { - effect=AVS_SERIALIZE_GET_INT (avstree->cur); - AVS_SERIALIZE_SKIP_INT (avstree->cur); - pos += 4; - } - if (effect == 32767) - { - if (!memcmp(avstree->cur,"!rect ",6)) - { - AVS_SERIALIZE_SKIP_LENGTH (avstree->cur, 6); - rectangular=1; - } - if (AVS_SERIALIZE_GET_BYTE (avstree->cur) == 1) - { - AVS_SERIALIZE_SKIP_BYTE (avstree->cur); - pos++; - - int l=AVS_SERIALIZE_GET_INT(avstree->cur); AVS_SERIALIZE_SKIP_INT (avstree->cur); pos += 4; - if (l > 0 && len-pos >= l) - { -// effect_exp.resize(l); - memcpy(buf, avstree->cur, l); - buf[l] = 0; - -// memcpy(effect_exp.get(), data+pos, l); - AVS_SERIALIZE_SKIP_LENGTH (avstree->cur, l); - pos+=l; - } - else - { -// effect_exp.resize(1); -// effect_exp.get()[0]=0; - } - } - else if (len-pos >= 256) - { - int l = 256 - (rectangular ? 6 : 0); - memcpy(buf,avstree->cur,l); - buf[l]=0; -// effect_exp.assign(buf); - AVS_SERIALIZE_SKIP_LENGTH (avstree->cur, l); - pos+=l; - printf ("trans_movement buf %s\n", buf); - } - } - if (len-pos >= 4) { blend=AVS_SERIALIZE_GET_INT(avstree->cur); AVS_SERIALIZE_SKIP_INT (avstree->cur);pos+=4; } - if (len-pos >= 4) { sourcemapped=AVS_SERIALIZE_GET_INT(avstree->cur); AVS_SERIALIZE_SKIP_INT (avstree->cur);pos+=4; } - if (len-pos >= 4) { rectangular=AVS_SERIALIZE_GET_INT(avstree->cur); AVS_SERIALIZE_SKIP_INT (avstree->cur);pos+=4; } - if (len-pos >= 4) { subpixel=AVS_SERIALIZE_GET_INT(avstree->cur); AVS_SERIALIZE_SKIP_INT (avstree->cur);pos+=4; } - else subpixel=0; - if (len-pos >= 4) { wrap=AVS_SERIALIZE_GET_INT(avstree->cur); AVS_SERIALIZE_SKIP_INT (avstree->cur);pos+=4; } - else wrap=0; - if (!effect && len-pos >= 4) - { - effect=AVS_SERIALIZE_GET_INT(avstree->cur); AVS_SERIALIZE_SKIP_INT (avstree->cur);pos+=4; - } - - if (effect != 32767 && (effect > REFFECT_MAX || effect < 0)) - effect=0; - effect_exp_ch=1; - - visual_param_entry_set_integer (visual_param_container_get (pcont, "effect"), effect); - visual_param_entry_set_integer (visual_param_container_get (pcont, "rectangular"), rectangular); - visual_param_entry_set_integer (visual_param_container_get (pcont, "blend"), blend); - visual_param_entry_set_integer (visual_param_container_get (pcont, "sourcemapped"), sourcemapped); - visual_param_entry_set_integer (visual_param_container_get (pcont, "subpixel"), subpixel); - visual_param_entry_set_integer (visual_param_container_get (pcont, "wrap"), wrap); - visual_param_entry_set_string (visual_param_container_get (pcont, "code"), buf); - - printf ("effect: %d, rectangular: %d, blend %d, sourcemapped %d, subpixel %d, wrap %d\n", - effect, rectangular, blend, sourcemapped, subpixel, wrap); - - return movement; +AVSElement *avs_parse_trans_movement(AVSTree *avstree) { + AVSElement *movement; + AVSSerializeContainer *scont; + int len = avstree->cur_section_length; + int pos = 0; + + int effect; + int rectangular; + int effect_exp; + int blend; + int sourcemapped; + int subpixel; + int wrap; + int REFFECT_MAX = 23; + int effect_exp_ch; + + char buf[257]; + + VisParamContainer *pcont; + + static VisParamEntry params[] = { + VISUAL_PARAM_LIST_ENTRY_INTEGER("effect", 0), + VISUAL_PARAM_LIST_ENTRY_INTEGER("rectangular", 0), + VISUAL_PARAM_LIST_ENTRY_INTEGER("blend", 0), + VISUAL_PARAM_LIST_ENTRY_INTEGER("sourcemapped", 0), + VISUAL_PARAM_LIST_ENTRY_INTEGER("subpixel", 0), + VISUAL_PARAM_LIST_ENTRY_INTEGER("wrap", 0), + VISUAL_PARAM_LIST_ENTRY_STRING("code", ""), + VISUAL_PARAM_LIST_END}; + + visual_mem_set(buf, 0, sizeof(buf)); + + pcont = visual_param_container_new(); + + visual_param_container_add_many(pcont, params); + + movement = visual_mem_new0(AVSElement, 1); + + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(movement), TRUE, avs_element_dtor); + + AVS_ELEMENT(movement)->pcont = pcont; + AVS_ELEMENT(movement)->type = AVS_ELEMENT_TYPE_TRANS_MOVEMENT; + + /* Deserialize without using the container, too complex (borked) serialization + */ + if (len - pos >= 4) { + effect = AVS_SERIALIZE_GET_INT(avstree->cur); + AVS_SERIALIZE_SKIP_INT(avstree->cur); + pos += 4; + } + if (effect == 32767) { + if (!memcmp(avstree->cur, "!rect ", 6)) { + AVS_SERIALIZE_SKIP_LENGTH(avstree->cur, 6); + rectangular = 1; + } + if (AVS_SERIALIZE_GET_BYTE(avstree->cur) == 1) { + AVS_SERIALIZE_SKIP_BYTE(avstree->cur); + pos++; + + int l = AVS_SERIALIZE_GET_INT(avstree->cur); + AVS_SERIALIZE_SKIP_INT(avstree->cur); + pos += 4; + if (l > 0 && len - pos >= l) { + // effect_exp.resize(l); + memcpy(buf, avstree->cur, l); + buf[l] = 0; + + // memcpy(effect_exp.get(), data+pos, l); + AVS_SERIALIZE_SKIP_LENGTH(avstree->cur, l); + pos += l; + } else { + // effect_exp.resize(1); + // effect_exp.get()[0]=0; + } + } else if (len - pos >= 256) { + int l = 256 - (rectangular ? 6 : 0); + memcpy(buf, avstree->cur, l); + buf[l] = 0; + // effect_exp.assign(buf); + AVS_SERIALIZE_SKIP_LENGTH(avstree->cur, l); + pos += l; + printf("trans_movement buf %s\n", buf); + } + } + if (len - pos >= 4) { + blend = AVS_SERIALIZE_GET_INT(avstree->cur); + AVS_SERIALIZE_SKIP_INT(avstree->cur); + pos += 4; + } + if (len - pos >= 4) { + sourcemapped = AVS_SERIALIZE_GET_INT(avstree->cur); + AVS_SERIALIZE_SKIP_INT(avstree->cur); + pos += 4; + } + if (len - pos >= 4) { + rectangular = AVS_SERIALIZE_GET_INT(avstree->cur); + AVS_SERIALIZE_SKIP_INT(avstree->cur); + pos += 4; + } + if (len - pos >= 4) { + subpixel = AVS_SERIALIZE_GET_INT(avstree->cur); + AVS_SERIALIZE_SKIP_INT(avstree->cur); + pos += 4; + } else + subpixel = 0; + if (len - pos >= 4) { + wrap = AVS_SERIALIZE_GET_INT(avstree->cur); + AVS_SERIALIZE_SKIP_INT(avstree->cur); + pos += 4; + } else + wrap = 0; + if (!effect && len - pos >= 4) { + effect = AVS_SERIALIZE_GET_INT(avstree->cur); + AVS_SERIALIZE_SKIP_INT(avstree->cur); + pos += 4; + } + + if (effect != 32767 && (effect > REFFECT_MAX || effect < 0)) + effect = 0; + effect_exp_ch = 1; + + visual_param_entry_set_integer(visual_param_container_get(pcont, "effect"), + effect); + visual_param_entry_set_integer( + visual_param_container_get(pcont, "rectangular"), rectangular); + visual_param_entry_set_integer(visual_param_container_get(pcont, "blend"), + blend); + visual_param_entry_set_integer( + visual_param_container_get(pcont, "sourcemapped"), sourcemapped); + visual_param_entry_set_integer(visual_param_container_get(pcont, "subpixel"), + subpixel); + visual_param_entry_set_integer(visual_param_container_get(pcont, "wrap"), + wrap); + visual_param_entry_set_string(visual_param_container_get(pcont, "code"), buf); + + printf("effect: %d, rectangular: %d, blend %d, sourcemapped %d, subpixel %d, " + "wrap %d\n", + effect, rectangular, blend, sourcemapped, subpixel, wrap); + + return movement; } -AVSElement *avs_parse_element_non_complex (AVSTree *avstree, AVSElementType type, ...) -{ - AVSElement *element; - AVSSerializeContainer *scont; - VisParamContainer *pcont; - va_list ap; - char *pname; - AVSSerializeEntryType stype; +AVSElement *avs_parse_element_non_complex(AVSTree *avstree, AVSElementType type, + ...) { + AVSElement *element; + AVSSerializeContainer *scont; + VisParamContainer *pcont; + va_list ap; + char *pname; + AVSSerializeEntryType stype; - element = visual_mem_new0 (AVSElement, 1); + element = visual_mem_new0(AVSElement, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (element), TRUE, avs_element_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(element), TRUE, avs_element_dtor); - element->type = type; + element->type = type; - pcont = visual_param_container_new (); - scont = avs_serialize_container_new (); + pcont = visual_param_container_new(); + scont = avs_serialize_container_new(); - va_start (ap, type); + va_start(ap, type); - while ((pname = va_arg (ap, char *)) != NULL) { - VisParamEntry *param = visual_param_entry_new (pname); - AVSSerializeEntry *sentry; + while ((pname = va_arg(ap, char *)) != NULL) { + VisParamEntry *param = visual_param_entry_new(pname); + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); - sentry->type = va_arg (ap, AVSSerializeEntryType); + sentry = avs_serialize_entry_new(param); + sentry->type = va_arg(ap, AVSSerializeEntryType); - avs_serialize_container_add (scont, sentry); - visual_param_container_add (pcont, param); - } + avs_serialize_container_add(scont, sentry); + visual_param_container_add(pcont, param); + } - va_end (ap); + va_end(ap); - element->pcont = pcont; - avs_element_connect_serialize_container (element, scont); + element->pcont = pcont; + avs_element_connect_serialize_container(element, scont); - avs_element_deserialize (element, avstree); + avs_element_deserialize(element, avstree); - return element; + return element; } -int avs_parse_data (AVSTree *avstree, char *filename) -{ - int fd; - int size; +int avs_parse_data(AVSTree *avstree, char *filename) { + int fd; + int size; - char *buf; + char *buf; - if (avstree == NULL || filename == NULL) - return -1; + if (avstree == NULL || filename == NULL) + return -1; - /* Open file, and read it into a memory buffer, a bit rough edged, but who cares! */ - fd = open (filename, O_RDONLY); + /* Open file, and read it into a memory buffer, a bit rough edged, but who + * cares! */ + fd = open(filename, O_RDONLY); - if (fd < 0) { - printf ("FILE NOT FOUND BLAH: %s\n", filename); + if (fd < 0) { + printf("FILE NOT FOUND BLAH: %s\n", filename); - exit (-1); - } + exit(-1); + } - /* So we know how big this file is, nice for allocating our buffer */ - size = lseek (fd, 0, SEEK_END); - lseek (fd, 0, SEEK_SET); + /* So we know how big this file is, nice for allocating our buffer */ + size = lseek(fd, 0, SEEK_END); + lseek(fd, 0, SEEK_SET); - /* Read the data into the buffer */ - avstree->data = malloc (size); - read (fd, avstree->data , size); - avstree->datasize = size; + /* Read the data into the buffer */ + avstree->data = malloc(size); + read(fd, avstree->data, size); + avstree->datasize = size; - /* Close the file since it's no longer needed */ - close (fd); + /* Close the file since it's no longer needed */ + close(fd); - avstree->cur = avstree->data; - avs_check_version (avstree); + avstree->cur = avstree->data; + avs_check_version(avstree); - if (avstree->version != AVS_VERSION_2) { - printf ("Not supported AVS version, or wrong filetype\n"); + if (avstree->version != AVS_VERSION_2) { + printf("Not supported AVS version, or wrong filetype\n"); - return -1; - } + return -1; + } - /* Skip over the main section marker, on to it's flags */ - AVS_SERIALIZE_SKIP_BYTE (AVS_TREE_GET_CURRENT_POINTER (avstree)); + /* Skip over the main section marker, on to it's flags */ + AVS_SERIALIZE_SKIP_BYTE(AVS_TREE_GET_CURRENT_POINTER(avstree)); - avstree->main = avs_parse_main (avstree); + avstree->main = avs_parse_main(avstree); - avs_parse_tree (avstree, AVS_CONTAINER (avstree->main)); + avs_parse_tree(avstree, AVS_CONTAINER(avstree->main)); - return 0; + return 0; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_parse.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_parse.h index 108a47f93..10e6fc079 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_parse.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_parse.h @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -32,129 +32,125 @@ extern "C" { #endif /* __cplusplus */ -#define AVS_TREE(obj) (VISUAL_CHECK_CAST ((obj), AVSTree)) - -#define AVS_ELEMENT(obj) (VISUAL_CHECK_CAST ((obj), AVSElement)) -#define AVS_CONTAINER(obj) (VISUAL_CHECK_CAST ((obj), AVSContainer)) +#define AVS_TREE(obj) (VISUAL_CHECK_CAST((obj), AVSTree)) -#define AVS_TREE_GET_CURRENT_POINTER(f) ((f)->cur) +#define AVS_ELEMENT(obj) (VISUAL_CHECK_CAST((obj), AVSElement)) +#define AVS_CONTAINER(obj) (VISUAL_CHECK_CAST((obj), AVSContainer)) +#define AVS_TREE_GET_CURRENT_POINTER(f) ((f)->cur) typedef struct _AVSTree AVSTree; typedef struct _AVSElement AVSElement; typedef struct _AVSContainer AVSContainer; -typedef enum { - AVS_VERSION_UNKNOWN, - AVS_VERSION_1, - AVS_VERSION_2 -} AVSVersion; +typedef enum { AVS_VERSION_UNKNOWN, AVS_VERSION_1, AVS_VERSION_2 } AVSVersion; typedef enum { - AVS_ELEMENT_TYPE_RENDER_SIMPLESPECTRUM = 0, - AVS_ELEMENT_TYPE_RENDER_DOTPLANE = 1, - AVS_ELEMENT_TYPE_RENDER_OSCSTARS = 2, - AVS_ELEMENT_TYPE_TRANS_FADEOUT = 3, - AVS_ELEMENT_TYPE_TRANS_BLITTERFB = 4, - AVS_ELEMENT_TYPE_TRANS_NFRAMECLEAR = 5, - AVS_ELEMENT_TYPE_TRANS_BLUR = 6, - AVS_ELEMENT_TYPE_RENDER_BASSSPIN = 7, - AVS_ELEMENT_TYPE_RENDER_PARTICLE = 8, - AVS_ELEMENT_TYPE_RENDER_ROTBLIT = 9, - AVS_ELEMENT_TYPE_RENDER_SVP = 10, - AVS_ELEMENT_TYPE_TRANS_COLORFADE = 11, - AVS_ELEMENT_TYPE_TRANS_CONTRASTENHANCE = 12, - AVS_ELEMENT_TYPE_RENDER_ROTSTAR = 13, - AVS_ELEMENT_TYPE_RENDER_RING = 14, - AVS_ELEMENT_TYPE_TRANS_MOVEMENT = 15, - AVS_ELEMENT_TYPE_TRANS_SCATTER = 16, - AVS_ELEMENT_TYPE_RENDER_DOTGRID = 17, - AVS_ELEMENT_TYPE_MISC_STACK = 18, - AVS_ELEMENT_TYPE_RENDER_DOTFOUNTAIN = 19, - AVS_ELEMENT_TYPE_TRANS_WATER = 20, - AVS_ELEMENT_TYPE_MISC_COMMENT = 21, - AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS = 22, - AVS_ELEMENT_TYPE_TRANS_INTERLEAVE = 23, - AVS_ELEMENT_TYPE_TRANS_GRAIN = 24, - AVS_ELEMENT_TYPE_RENDER_CLEARSCREEN = 25, - AVS_ELEMENT_TYPE_TRANS_MIRROR = 26, - AVS_ELEMENT_TYPE_RENDER_STARFIELD = 27, - AVS_ELEMENT_TYPE_RENDER_TEXT = 28, - AVS_ELEMENT_TYPE_TRANS_BUMPMAP = 29, - AVS_ELEMENT_TYPE_TRANS_MOSAIC = 30, - AVS_ELEMENT_TYPE_TRANS_WATERBUMP = 31, - AVS_ELEMENT_TYPE_RENDER_AVI = 32, - AVS_ELEMENT_TYPE_MISC_BPM = 33, - AVS_ELEMENT_TYPE_RENDER_PICTURE = 34, - AVS_ELEMENT_TYPE_UNKNOWN_DDM = 35, - AVS_ELEMENT_TYPE_RENDER_SUPERSCOPE = 36, - AVS_ELEMENT_TYPE_TRANS_INVERT = 37, - AVS_ELEMENT_TYPE_TRANS_ONETONE = 38, - AVS_ELEMENT_TYPE_RENDER_TIMESCOPE = 39, - AVS_ELEMENT_TYPE_MISC_RENDERSTATE = 40, - AVS_ELEMENT_TYPE_TRANS_INTERFERENCES = 41, - AVS_ELEMENT_TYPE_TRANS_CHANNELSHIFT = 42, - AVS_ELEMENT_TYPE_TRANS_DMOVE = 43, - AVS_ELEMENT_TYPE_TRANS_FASTBRIGHT = 44, - AVS_ELEMENT_TYPE_UNKNOWN_DCOLORMODE = 45, - - AVS_ELEMENT_TYPE_MAIN = 0x1000, - AVS_ELEMENT_TYPE_APE = 0xffff, - AVS_ELEMENT_TYPE_TRANS_MULTIPLIER, - - AVS_ELEMENT_TYPE_LAST + AVS_ELEMENT_TYPE_RENDER_SIMPLESPECTRUM = 0, + AVS_ELEMENT_TYPE_RENDER_DOTPLANE = 1, + AVS_ELEMENT_TYPE_RENDER_OSCSTARS = 2, + AVS_ELEMENT_TYPE_TRANS_FADEOUT = 3, + AVS_ELEMENT_TYPE_TRANS_BLITTERFB = 4, + AVS_ELEMENT_TYPE_TRANS_NFRAMECLEAR = 5, + AVS_ELEMENT_TYPE_TRANS_BLUR = 6, + AVS_ELEMENT_TYPE_RENDER_BASSSPIN = 7, + AVS_ELEMENT_TYPE_RENDER_PARTICLE = 8, + AVS_ELEMENT_TYPE_RENDER_ROTBLIT = 9, + AVS_ELEMENT_TYPE_RENDER_SVP = 10, + AVS_ELEMENT_TYPE_TRANS_COLORFADE = 11, + AVS_ELEMENT_TYPE_TRANS_CONTRASTENHANCE = 12, + AVS_ELEMENT_TYPE_RENDER_ROTSTAR = 13, + AVS_ELEMENT_TYPE_RENDER_RING = 14, + AVS_ELEMENT_TYPE_TRANS_MOVEMENT = 15, + AVS_ELEMENT_TYPE_TRANS_SCATTER = 16, + AVS_ELEMENT_TYPE_RENDER_DOTGRID = 17, + AVS_ELEMENT_TYPE_MISC_STACK = 18, + AVS_ELEMENT_TYPE_RENDER_DOTFOUNTAIN = 19, + AVS_ELEMENT_TYPE_TRANS_WATER = 20, + AVS_ELEMENT_TYPE_MISC_COMMENT = 21, + AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS = 22, + AVS_ELEMENT_TYPE_TRANS_INTERLEAVE = 23, + AVS_ELEMENT_TYPE_TRANS_GRAIN = 24, + AVS_ELEMENT_TYPE_RENDER_CLEARSCREEN = 25, + AVS_ELEMENT_TYPE_TRANS_MIRROR = 26, + AVS_ELEMENT_TYPE_RENDER_STARFIELD = 27, + AVS_ELEMENT_TYPE_RENDER_TEXT = 28, + AVS_ELEMENT_TYPE_TRANS_BUMPMAP = 29, + AVS_ELEMENT_TYPE_TRANS_MOSAIC = 30, + AVS_ELEMENT_TYPE_TRANS_WATERBUMP = 31, + AVS_ELEMENT_TYPE_RENDER_AVI = 32, + AVS_ELEMENT_TYPE_MISC_BPM = 33, + AVS_ELEMENT_TYPE_RENDER_PICTURE = 34, + AVS_ELEMENT_TYPE_UNKNOWN_DDM = 35, + AVS_ELEMENT_TYPE_RENDER_SUPERSCOPE = 36, + AVS_ELEMENT_TYPE_TRANS_INVERT = 37, + AVS_ELEMENT_TYPE_TRANS_ONETONE = 38, + AVS_ELEMENT_TYPE_RENDER_TIMESCOPE = 39, + AVS_ELEMENT_TYPE_MISC_RENDERSTATE = 40, + AVS_ELEMENT_TYPE_TRANS_INTERFERENCES = 41, + AVS_ELEMENT_TYPE_TRANS_CHANNELSHIFT = 42, + AVS_ELEMENT_TYPE_TRANS_DMOVE = 43, + AVS_ELEMENT_TYPE_TRANS_FASTBRIGHT = 44, + AVS_ELEMENT_TYPE_UNKNOWN_DCOLORMODE = 45, + + AVS_ELEMENT_TYPE_MAIN = 0x1000, + AVS_ELEMENT_TYPE_APE = 0xffff, + AVS_ELEMENT_TYPE_TRANS_MULTIPLIER, + + AVS_ELEMENT_TYPE_LAST } AVSElementType; /* The AVS data structure */ struct _AVSTree { - VisObject object; + VisObject object; - char *origfile; + char *origfile; - int datasize; - char *data; + int datasize; + char *data; - char *cur; - int cur_section_length; + char *cur; + int cur_section_length; - AVSVersion version; + AVSVersion version; - AVSContainer *main; + AVSContainer *main; }; struct _AVSElement { - VisObject object; + VisObject object; - AVSElementType type; + AVSElementType type; - AVSSerializeContainer *serialize; - VisParamContainer *pcont; + AVSSerializeContainer *serialize; + VisParamContainer *pcont; }; struct _AVSContainer { - AVSElement element; + AVSElement element; - VisList *members; + VisList *members; }; - /* Prototypes */ -AVSTree *avs_tree_new_from_preset (char *filename); -int avs_check_version (AVSTree *avstree); - -int avs_parse_tree (AVSTree *avstree, AVSContainer *curcontainer); +AVSTree *avs_tree_new_from_preset(char *filename); +int avs_check_version(AVSTree *avstree); -int avs_element_connect_serialize_container (AVSElement *element, AVSSerializeContainer *scont); -int avs_element_deserialize (AVSElement *element, AVSTree *avstree); -int avs_element_deserialize_many_new_params (AVSElement *element, AVSTree *avstree, ...); +int avs_parse_tree(AVSTree *avstree, AVSContainer *curcontainer); -AVSContainer *avs_parse_main (AVSTree *avstree); +int avs_element_connect_serialize_container(AVSElement *element, + AVSSerializeContainer *scont); +int avs_element_deserialize(AVSElement *element, AVSTree *avstree); +int avs_element_deserialize_many_new_params(AVSElement *element, + AVSTree *avstree, ...); -AVSElement *avs_parse_trans_movement (AVSTree *avstree); -AVSElement *avs_parse_element_non_complex (AVSTree *avstree, AVSElementType type, ...); +AVSContainer *avs_parse_main(AVSTree *avstree); -int avs_parse_data (AVSTree *avstree, char *filename); +AVSElement *avs_parse_trans_movement(AVSTree *avstree); +AVSElement *avs_parse_element_non_complex(AVSTree *avstree, AVSElementType type, + ...); +int avs_parse_data(AVSTree *avstree, char *filename); #ifdef __cplusplus } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_serialize.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_serialize.c index 96c986e25..ed6dd9aa2 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_serialize.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_serialize.c @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -33,414 +33,417 @@ #include "avs_serialize.h" #include "avs_parse.h" -static int avs_data_serialize_container_dtor (VisObject *object); +static int avs_data_serialize_container_dtor(VisObject *object); /* Object destructors */ -static int avs_data_serialize_container_dtor (VisObject *object) -{ - AVSSerializeContainer *scont = AVS_SERIALIZE_CONTAINER (object); +static int avs_data_serialize_container_dtor(VisObject *object) { + AVSSerializeContainer *scont = AVS_SERIALIZE_CONTAINER(object); - visual_collection_set_destroyer (VISUAL_COLLECTION (&scont->layout), visual_object_collection_destroyer); - visual_collection_destroy (VISUAL_COLLECTION (&scont->layout)); + visual_collection_set_destroyer(VISUAL_COLLECTION(&scont->layout), + visual_object_collection_destroyer); + visual_collection_destroy(VISUAL_COLLECTION(&scont->layout)); - return TRUE; + return TRUE; } /* Static parser helper functions */ -char *avs_serialize_retrieve_palette_from_preset_section (char *section, VisParamEntry *param) -{ - int i; - VisPalette pal; +char *avs_serialize_retrieve_palette_from_preset_section(char *section, + VisParamEntry *param) { + int i; + VisPalette pal; - visual_palette_allocate_colors (&pal, AVS_SERIALIZE_GET_BYTE (section)); + visual_palette_allocate_colors(&pal, AVS_SERIALIZE_GET_BYTE(section)); - AVS_SERIALIZE_SKIP_INT (section); + AVS_SERIALIZE_SKIP_INT(section); - for (i = 0; i < pal.ncolors; i++) { - pal.colors[i].r = AVS_SERIALIZE_GET_BYTE (section); - AVS_SERIALIZE_SKIP_BYTE (section); - pal.colors[i].g = AVS_SERIALIZE_GET_BYTE (section); - AVS_SERIALIZE_SKIP_BYTE (section); - pal.colors[i].b = AVS_SERIALIZE_GET_BYTE (section); - AVS_SERIALIZE_SKIP_BYTE (section); + for (i = 0; i < pal.ncolors; i++) { + pal.colors[i].r = AVS_SERIALIZE_GET_BYTE(section); + AVS_SERIALIZE_SKIP_BYTE(section); + pal.colors[i].g = AVS_SERIALIZE_GET_BYTE(section); + AVS_SERIALIZE_SKIP_BYTE(section); + pal.colors[i].b = AVS_SERIALIZE_GET_BYTE(section); + AVS_SERIALIZE_SKIP_BYTE(section); - AVS_SERIALIZE_SKIP_BYTE (section); - } + AVS_SERIALIZE_SKIP_BYTE(section); + } - visual_param_entry_set_palette (param, &pal); + visual_param_entry_set_palette(param, &pal); - visual_palette_free_colors (&pal); + visual_palette_free_colors(&pal); - return section; + return section; } -char *avs_serialize_retrieve_color_from_preset_section (char *section, VisParamEntry *param) -{ - unsigned char r, g, b; +char *avs_serialize_retrieve_color_from_preset_section(char *section, + VisParamEntry *param) { + unsigned char r, g, b; - b = AVS_SERIALIZE_GET_BYTE (section); - AVS_SERIALIZE_SKIP_BYTE (section); - g = AVS_SERIALIZE_GET_BYTE (section); - AVS_SERIALIZE_SKIP_BYTE (section); - r = AVS_SERIALIZE_GET_BYTE (section); - AVS_SERIALIZE_SKIP_BYTE (section); + b = AVS_SERIALIZE_GET_BYTE(section); + AVS_SERIALIZE_SKIP_BYTE(section); + g = AVS_SERIALIZE_GET_BYTE(section); + AVS_SERIALIZE_SKIP_BYTE(section); + r = AVS_SERIALIZE_GET_BYTE(section); + AVS_SERIALIZE_SKIP_BYTE(section); - visual_param_entry_set_color (param, r, g, b); + visual_param_entry_set_color(param, r, g, b); - AVS_SERIALIZE_SKIP_BYTE (section); + AVS_SERIALIZE_SKIP_BYTE(section); - return section; + return section; } -char *avs_serialize_retrieve_string_from_preset_section (char *section, VisParamEntry *param) -{ - char *string; - int len; - int i; +char *avs_serialize_retrieve_string_from_preset_section(char *section, + VisParamEntry *param) { + char *string; + int len; + int i; - /* FIXME should just get an int ? */ - len = AVS_SERIALIZE_GET_INT (section); - AVS_SERIALIZE_SKIP_INT (section); + /* FIXME should just get an int ? */ + len = AVS_SERIALIZE_GET_INT(section); + AVS_SERIALIZE_SKIP_INT(section); - if (len > 0) { - string = visual_mem_malloc0 (len); + if (len > 0) { + string = visual_mem_malloc0(len); - strncpy (string, section, len); + strncpy(string, section, len); - visual_param_entry_set_string (param, string); + visual_param_entry_set_string(param, string); - visual_mem_free (string); - } + visual_mem_free(string); + } - AVS_SERIALIZE_SKIP_LENGTH (section, len); + AVS_SERIALIZE_SKIP_LENGTH(section, len); - printf("after length skip :%s\n", section); - return section; + printf("after length skip :%s\n", section); + return section; } +AVSSerializeContainer *avs_serialize_container_new() { + AVSSerializeContainer *scont; + scont = visual_mem_new0(AVSSerializeContainer, 1); -AVSSerializeContainer *avs_serialize_container_new () -{ - AVSSerializeContainer *scont; - - scont = visual_mem_new0 (AVSSerializeContainer, 1); - - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (scont), TRUE, avs_data_serialize_container_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(scont), TRUE, + avs_data_serialize_container_dtor); - return scont; + return scont; } -int avs_serialize_container_add (AVSSerializeContainer *scont, AVSSerializeEntry *sentry) -{ - visual_list_add (&scont->layout, sentry); +int avs_serialize_container_add(AVSSerializeContainer *scont, + AVSSerializeEntry *sentry) { + visual_list_add(&scont->layout, sentry); - return 0; + return 0; } -int avs_serialize_container_add_string (AVSSerializeContainer *scont, VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_string(AVSSerializeContainer *scont, + VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_string (param); + sentry = avs_serialize_entry_new_string(param); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -int avs_serialize_container_add_byte (AVSSerializeContainer *scont, VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_byte(AVSSerializeContainer *scont, + VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_byte (param); + sentry = avs_serialize_entry_new_byte(param); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -int avs_serialize_container_add_byte_with_boundry (AVSSerializeContainer *scont, VisParamEntry *param, int boundry) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_byte_with_boundry(AVSSerializeContainer *scont, + VisParamEntry *param, + int boundry) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_byte_with_boundry (param, boundry); + sentry = avs_serialize_entry_new_byte_with_boundry(param, boundry); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -int avs_serialize_container_add_byte_int_skip (AVSSerializeContainer *scont, VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_byte_int_skip(AVSSerializeContainer *scont, + VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_byte_int_skip (param); + sentry = avs_serialize_entry_new_byte_int_skip(param); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -int avs_serialize_container_add_byte_int_skip_with_boundry (AVSSerializeContainer *scont, VisParamEntry *param, int boundry) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_byte_int_skip_with_boundry( + AVSSerializeContainer *scont, VisParamEntry *param, int boundry) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_byte_int_skip_with_boundry (param, boundry); + sentry = avs_serialize_entry_new_byte_int_skip_with_boundry(param, boundry); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -int avs_serialize_container_add_int (AVSSerializeContainer *scont, VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_int(AVSSerializeContainer *scont, + VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_int (param); + sentry = avs_serialize_entry_new_int(param); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -int avs_serialize_container_add_int_with_boundry (AVSSerializeContainer *scont, VisParamEntry *param, int boundry) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_int_with_boundry(AVSSerializeContainer *scont, + VisParamEntry *param, + int boundry) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_int_with_boundry (param, boundry); + sentry = avs_serialize_entry_new_int_with_boundry(param, boundry); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -int avs_serialize_container_add_palette (AVSSerializeContainer *scont, VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_palette(AVSSerializeContainer *scont, + VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_palette (param); + sentry = avs_serialize_entry_new_palette(param); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -int avs_serialize_container_add_color (AVSSerializeContainer *scont, VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +int avs_serialize_container_add_color(AVSSerializeContainer *scont, + VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new_color (param); + sentry = avs_serialize_entry_new_color(param); - avs_serialize_container_add (scont, sentry); + avs_serialize_container_add(scont, sentry); - return 0; + return 0; } -char *avs_serialize_container_deserialize (AVSSerializeContainer *scont, char *section) -{ - AVSSerializeEntry *sentry; - VisListEntry *le = NULL; +char *avs_serialize_container_deserialize(AVSSerializeContainer *scont, + char *section) { + AVSSerializeEntry *sentry; + VisListEntry *le = NULL; - while ((sentry = visual_list_next (&scont->layout, &le)) != NULL) { - switch (sentry->type) { - case AVS_SERIALIZE_ENTRY_TYPE_BYTE: - if (sentry->param != NULL) { - visual_param_entry_set_integer (sentry->param, AVS_SERIALIZE_GET_BYTE (section)); + while ((sentry = visual_list_next(&scont->layout, &le)) != NULL) { + switch (sentry->type) { + case AVS_SERIALIZE_ENTRY_TYPE_BYTE: + if (sentry->param != NULL) { + visual_param_entry_set_integer(sentry->param, + AVS_SERIALIZE_GET_BYTE(section)); - if (visual_param_entry_get_integer (sentry->param) > sentry->boundry && sentry->boundry > 0) { - visual_log (VISUAL_LOG_WARNING, "A serialized entry did hit the upper value boundry"); + if (visual_param_entry_get_integer(sentry->param) > sentry->boundry && + sentry->boundry > 0) { + visual_log(VISUAL_LOG_WARNING, + "A serialized entry did hit the upper value boundry"); - visual_param_entry_set_integer (sentry->param, 0); - } - } + visual_param_entry_set_integer(sentry->param, 0); + } + } - AVS_SERIALIZE_SKIP_BYTE (section); + AVS_SERIALIZE_SKIP_BYTE(section); - break; + break; - case AVS_SERIALIZE_ENTRY_TYPE_BYTE_WITH_INT_SKIP: - if (sentry->param != NULL) { - visual_param_entry_set_integer (sentry->param, AVS_SERIALIZE_GET_BYTE (section)); + case AVS_SERIALIZE_ENTRY_TYPE_BYTE_WITH_INT_SKIP: + if (sentry->param != NULL) { + visual_param_entry_set_integer(sentry->param, + AVS_SERIALIZE_GET_BYTE(section)); - if (visual_param_entry_get_integer (sentry->param) > sentry->boundry && sentry->boundry > 0) { - visual_log (VISUAL_LOG_WARNING, "A serialized entry did hit the upper value boundry"); + if (visual_param_entry_get_integer(sentry->param) > sentry->boundry && + sentry->boundry > 0) { + visual_log(VISUAL_LOG_WARNING, + "A serialized entry did hit the upper value boundry"); - visual_param_entry_set_integer (sentry->param, 0); - } - } + visual_param_entry_set_integer(sentry->param, 0); + } + } - AVS_SERIALIZE_SKIP_INT (section); + AVS_SERIALIZE_SKIP_INT(section); - break; + break; - case AVS_SERIALIZE_ENTRY_TYPE_INT: - if (sentry->param != NULL) { - // use get_int here... instead of get_byte - visual_param_entry_set_integer (sentry->param, AVS_SERIALIZE_GET_BYTE (section)); + case AVS_SERIALIZE_ENTRY_TYPE_INT: + if (sentry->param != NULL) { + // use get_int here... instead of get_byte + visual_param_entry_set_integer(sentry->param, + AVS_SERIALIZE_GET_BYTE(section)); - if (visual_param_entry_get_integer (sentry->param) > sentry->boundry && sentry->boundry > 0) { - visual_log (VISUAL_LOG_WARNING, "A serialized entry did hit the upper value boundry"); + if (visual_param_entry_get_integer(sentry->param) > sentry->boundry && + sentry->boundry > 0) { + visual_log(VISUAL_LOG_WARNING, + "A serialized entry did hit the upper value boundry"); - visual_param_entry_set_integer (sentry->param, 0); - } - } + visual_param_entry_set_integer(sentry->param, 0); + } + } - AVS_SERIALIZE_SKIP_INT (section); + AVS_SERIALIZE_SKIP_INT(section); - break; + break; - case AVS_SERIALIZE_ENTRY_TYPE_STRING: + case AVS_SERIALIZE_ENTRY_TYPE_STRING: - section = avs_serialize_retrieve_string_from_preset_section (section, sentry->param); + section = avs_serialize_retrieve_string_from_preset_section( + section, sentry->param); - break; + break; - case AVS_SERIALIZE_ENTRY_TYPE_COLOR: + case AVS_SERIALIZE_ENTRY_TYPE_COLOR: - section = avs_serialize_retrieve_color_from_preset_section (section, sentry->param); + section = avs_serialize_retrieve_color_from_preset_section(section, + sentry->param); - break; + break; - case AVS_SERIALIZE_ENTRY_TYPE_PALETTE: + case AVS_SERIALIZE_ENTRY_TYPE_PALETTE: - section = avs_serialize_retrieve_palette_from_preset_section (section, sentry->param); + section = avs_serialize_retrieve_palette_from_preset_section( + section, sentry->param); - break; + break; - default: - printf ("INVALID SERIALIZE TYPE, BAILING OUT VERY HARDLY\n"); - return NULL; + default: + printf("INVALID SERIALIZE TYPE, BAILING OUT VERY HARDLY\n"); + return NULL; - break; + break; + } + } - } - - } - - return section; + return section; } -AVSSerializeEntry *avs_serialize_entry_new (VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry *avs_serialize_entry_new(VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = visual_mem_new0 (AVSSerializeEntry, 1); + sentry = visual_mem_new0(AVSSerializeEntry, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (sentry), TRUE, NULL); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(sentry), TRUE, NULL); - sentry->param = param; + sentry->param = param; - /* No boundry */ - sentry->boundry = -1; + /* No boundry */ + sentry->boundry = -1; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_string (VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry *avs_serialize_entry_new_string(VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_STRING; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_STRING; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_byte (VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry *avs_serialize_entry_new_byte(VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_BYTE; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_BYTE; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_byte_with_boundry (VisParamEntry *param, int boundry) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry * +avs_serialize_entry_new_byte_with_boundry(VisParamEntry *param, int boundry) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_BYTE; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_BYTE; - sentry->boundry = boundry; + sentry->boundry = boundry; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_byte_int_skip (VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry *avs_serialize_entry_new_byte_int_skip(VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_BYTE_WITH_INT_SKIP; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_BYTE_WITH_INT_SKIP; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_byte_int_skip_with_boundry (VisParamEntry *param, int boundry) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry * +avs_serialize_entry_new_byte_int_skip_with_boundry(VisParamEntry *param, + int boundry) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_BYTE_WITH_INT_SKIP; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_BYTE_WITH_INT_SKIP; - sentry->boundry = boundry; + sentry->boundry = boundry; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_int (VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry *avs_serialize_entry_new_int(VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_INT; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_INT; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_int_with_boundry (VisParamEntry *param, int boundry) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry * +avs_serialize_entry_new_int_with_boundry(VisParamEntry *param, int boundry) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_INT; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_INT; - sentry->boundry = boundry; + sentry->boundry = boundry; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_palette (VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry *avs_serialize_entry_new_palette(VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_PALETTE; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_PALETTE; - return sentry; + return sentry; } -AVSSerializeEntry *avs_serialize_entry_new_color (VisParamEntry *param) -{ - AVSSerializeEntry *sentry; +AVSSerializeEntry *avs_serialize_entry_new_color(VisParamEntry *param) { + AVSSerializeEntry *sentry; - sentry = avs_serialize_entry_new (param); + sentry = avs_serialize_entry_new(param); - sentry->type = AVS_SERIALIZE_ENTRY_TYPE_COLOR; + sentry->type = AVS_SERIALIZE_ENTRY_TYPE_COLOR; - return sentry; + return sentry; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_serialize.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_serialize.h index df9849e21..b55ddf825 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_serialize.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_serialize.h @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -30,73 +30,95 @@ extern "C" { #endif /* __cplusplus */ -#define AVS_SERIALIZE_CONTAINER(obj) (VISUAL_CHECK_CAST ((obj), AVSSerializeContainer)) +#define AVS_SERIALIZE_CONTAINER(obj) \ + (VISUAL_CHECK_CAST((obj), AVSSerializeContainer)) /* Byte array retrieving / traversing helper macros */ -#define AVS_SERIALIZE_GET_BYTE(f) (*(f)) -#define AVS_SERIALIZE_GET_INT(f) (*((int *) f)) -#define AVS_SERIALIZE_SKIP_INT(f) ((f) += 4) -#define AVS_SERIALIZE_SKIP_BYTE(f) ((f)++) -#define AVS_SERIALIZE_SKIP_LENGTH(f,i) ((f) += (i)) -#define AVS_SERIALIZE_GET_NEXT_SECTION(f) ((f) + *f + 4) +#define AVS_SERIALIZE_GET_BYTE(f) (*(f)) +#define AVS_SERIALIZE_GET_INT(f) (*((int *)f)) +#define AVS_SERIALIZE_SKIP_INT(f) ((f) += 4) +#define AVS_SERIALIZE_SKIP_BYTE(f) ((f)++) +#define AVS_SERIALIZE_SKIP_LENGTH(f, i) ((f) += (i)) +#define AVS_SERIALIZE_GET_NEXT_SECTION(f) ((f) + *f + 4) typedef struct _AVSSerializeContainer AVSSerializeContainer; typedef struct _AVSSerializeEntry AVSSerializeEntry; typedef enum { - AVS_SERIALIZE_ENTRY_TYPE_BYTE, - AVS_SERIALIZE_ENTRY_TYPE_BYTE_WITH_INT_SKIP, - AVS_SERIALIZE_ENTRY_TYPE_INT, - AVS_SERIALIZE_ENTRY_TYPE_STRING, - AVS_SERIALIZE_ENTRY_TYPE_COLOR, - AVS_SERIALIZE_ENTRY_TYPE_PALETTE + AVS_SERIALIZE_ENTRY_TYPE_BYTE, + AVS_SERIALIZE_ENTRY_TYPE_BYTE_WITH_INT_SKIP, + AVS_SERIALIZE_ENTRY_TYPE_INT, + AVS_SERIALIZE_ENTRY_TYPE_STRING, + AVS_SERIALIZE_ENTRY_TYPE_COLOR, + AVS_SERIALIZE_ENTRY_TYPE_PALETTE } AVSSerializeEntryType; -/* The AVS data layout description structures for the automatic serializer / deserializer */ +/* The AVS data layout description structures for the automatic serializer / + * deserializer */ struct _AVSSerializeContainer { - VisObject object; + VisObject object; - VisList layout; + VisList layout; }; struct _AVSSerializeEntry { - VisObject object; + VisObject object; - AVSSerializeEntryType type; + AVSSerializeEntryType type; - VisParamEntry *param; + VisParamEntry *param; - int boundry; + int boundry; }; /* Prototypes */ -char *avs_serialize_retrieve_palette_from_preset_section (char *section, VisParamEntry *param); -char *avs_serialize_retrieve_color_from_preset_section (char *section, VisParamEntry *param); -char *avs_serialize_retrieve_string_from_preset_section (char *section, VisParamEntry *param); - -AVSSerializeContainer *avs_serialize_container_new (void); -int avs_serialize_container_add_string (AVSSerializeContainer *scont, VisParamEntry *param); -int avs_serialize_container_add_byte (AVSSerializeContainer *scont, VisParamEntry *param); -int avs_serialize_container_add_byte_with_boundry (AVSSerializeContainer *scont, VisParamEntry *param, int boundry); -int avs_serialize_container_add_byte_int_skip (AVSSerializeContainer *scont, VisParamEntry *param); -int avs_serialize_container_add_byte_int_skip_with_boundry (AVSSerializeContainer *scont, VisParamEntry *param, int boundry); -int avs_serialize_container_add_int (AVSSerializeContainer *scont, VisParamEntry *param); -int avs_serialize_container_add_int_with_boundry (AVSSerializeContainer *scont, VisParamEntry *param, int boundry); -int avs_serialize_container_add_palette (AVSSerializeContainer *scont, VisParamEntry *param); -int avs_serialize_container_add_color (AVSSerializeContainer *scont, VisParamEntry *param); -int avs_serialize_container_add (AVSSerializeContainer *scont, AVSSerializeEntry *sentry); -char *avs_serialize_container_deserialize (AVSSerializeContainer *scont, char *section); - -AVSSerializeEntry *avs_serialize_entry_new (VisParamEntry *param); -AVSSerializeEntry *avs_serialize_entry_new_string (VisParamEntry *param); -AVSSerializeEntry *avs_serialize_entry_new_byte (VisParamEntry *param); -AVSSerializeEntry *avs_serialize_entry_new_byte_with_boundry (VisParamEntry *param, int boundry); -AVSSerializeEntry *avs_serialize_entry_new_byte_int_skip (VisParamEntry *param); -AVSSerializeEntry *avs_serialize_entry_new_byte_int_skip_with_boundry (VisParamEntry *param, int boundry); -AVSSerializeEntry *avs_serialize_entry_new_int (VisParamEntry *param); -AVSSerializeEntry *avs_serialize_entry_new_int_with_boundry (VisParamEntry *param, int boundry); -AVSSerializeEntry *avs_serialize_entry_new_palette (VisParamEntry *param); -AVSSerializeEntry *avs_serialize_entry_new_color (VisParamEntry *param); +char *avs_serialize_retrieve_palette_from_preset_section(char *section, + VisParamEntry *param); +char *avs_serialize_retrieve_color_from_preset_section(char *section, + VisParamEntry *param); +char *avs_serialize_retrieve_string_from_preset_section(char *section, + VisParamEntry *param); + +AVSSerializeContainer *avs_serialize_container_new(void); +int avs_serialize_container_add_string(AVSSerializeContainer *scont, + VisParamEntry *param); +int avs_serialize_container_add_byte(AVSSerializeContainer *scont, + VisParamEntry *param); +int avs_serialize_container_add_byte_with_boundry(AVSSerializeContainer *scont, + VisParamEntry *param, + int boundry); +int avs_serialize_container_add_byte_int_skip(AVSSerializeContainer *scont, + VisParamEntry *param); +int avs_serialize_container_add_byte_int_skip_with_boundry( + AVSSerializeContainer *scont, VisParamEntry *param, int boundry); +int avs_serialize_container_add_int(AVSSerializeContainer *scont, + VisParamEntry *param); +int avs_serialize_container_add_int_with_boundry(AVSSerializeContainer *scont, + VisParamEntry *param, + int boundry); +int avs_serialize_container_add_palette(AVSSerializeContainer *scont, + VisParamEntry *param); +int avs_serialize_container_add_color(AVSSerializeContainer *scont, + VisParamEntry *param); +int avs_serialize_container_add(AVSSerializeContainer *scont, + AVSSerializeEntry *sentry); +char *avs_serialize_container_deserialize(AVSSerializeContainer *scont, + char *section); + +AVSSerializeEntry *avs_serialize_entry_new(VisParamEntry *param); +AVSSerializeEntry *avs_serialize_entry_new_string(VisParamEntry *param); +AVSSerializeEntry *avs_serialize_entry_new_byte(VisParamEntry *param); +AVSSerializeEntry * +avs_serialize_entry_new_byte_with_boundry(VisParamEntry *param, int boundry); +AVSSerializeEntry *avs_serialize_entry_new_byte_int_skip(VisParamEntry *param); +AVSSerializeEntry * +avs_serialize_entry_new_byte_int_skip_with_boundry(VisParamEntry *param, + int boundry); +AVSSerializeEntry *avs_serialize_entry_new_int(VisParamEntry *param); +AVSSerializeEntry * +avs_serialize_entry_new_int_with_boundry(VisParamEntry *param, int boundry); +AVSSerializeEntry *avs_serialize_entry_new_palette(VisParamEntry *param); +AVSSerializeEntry *avs_serialize_entry_new_color(VisParamEntry *param); #ifdef __cplusplus } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_sound.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_sound.c index 228633ba6..44ea6d540 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_sound.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_sound.c @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -34,35 +34,36 @@ #include "avs_sound.h" +int lvavs_sound_get_from_source(VisAudio *audio, float ***data) { + VisBuffer *tmp = visual_buffer_new_allocate(sizeof(float) * 1024); -int lvavs_sound_get_from_source (VisAudio *audio, float ***data) -{ - VisBuffer *tmp = visual_buffer_new_allocate(sizeof(float) * 1024); - - /* Left audio */ - if(visual_audio_get_sample(audio, tmp, VISUAL_AUDIO_CHANNEL_LEFT)) { - VisBuffer *pcmbuf1 = visual_buffer_new_wrap_data(data[0][0], sizeof(float) * 1024, 0); - visual_audio_sample_buffer_mix(pcmbuf1, tmp, TRUE, 1.0); - visual_buffer_unref(pcmbuf1); - } + /* Left audio */ + if (visual_audio_get_sample(audio, tmp, VISUAL_AUDIO_CHANNEL_LEFT)) { + VisBuffer *pcmbuf1 = + visual_buffer_new_wrap_data(data[0][0], sizeof(float) * 1024, 0); + visual_audio_sample_buffer_mix(pcmbuf1, tmp, TRUE, 1.0); + visual_buffer_unref(pcmbuf1); + } - VisBuffer *spmbuf1 = visual_buffer_new_wrap_data(data[1][0], sizeof(float) * 1024, 0); - visual_audio_get_spectrum_for_sample(spmbuf1, tmp, TRUE); - visual_buffer_unref(spmbuf1); + VisBuffer *spmbuf1 = + visual_buffer_new_wrap_data(data[1][0], sizeof(float) * 1024, 0); + visual_audio_get_spectrum_for_sample(spmbuf1, tmp, TRUE); + visual_buffer_unref(spmbuf1); - /* Right audio */ - if(visual_audio_get_sample(audio, tmp, VISUAL_AUDIO_CHANNEL_LEFT)) { - VisBuffer *pcmbuf2 = visual_buffer_new_wrap_data (data[0][1], sizeof(float) * 1024, 0); - visual_audio_sample_buffer_mix (pcmbuf2, tmp, TRUE, 1.0); - visual_buffer_unref(pcmbuf2); - } + /* Right audio */ + if (visual_audio_get_sample(audio, tmp, VISUAL_AUDIO_CHANNEL_LEFT)) { + VisBuffer *pcmbuf2 = + visual_buffer_new_wrap_data(data[0][1], sizeof(float) * 1024, 0); + visual_audio_sample_buffer_mix(pcmbuf2, tmp, TRUE, 1.0); + visual_buffer_unref(pcmbuf2); + } - VisBuffer *spmbuf2 = visual_buffer_new_wrap_data(data[1][1], sizeof(float) * 1024, 0); - visual_audio_get_spectrum_for_sample(spmbuf2, tmp, TRUE); - visual_buffer_unref(spmbuf2); + VisBuffer *spmbuf2 = + visual_buffer_new_wrap_data(data[1][1], sizeof(float) * 1024, 0); + visual_audio_get_spectrum_for_sample(spmbuf2, tmp, TRUE); + visual_buffer_unref(spmbuf2); - visual_buffer_unref(tmp); + visual_buffer_unref(tmp); - return 0; + return 0; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_sound.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_sound.h index 9786edee7..90d204d0d 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_sound.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/avs_sound.h @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -31,19 +31,20 @@ extern "C" { #endif /* __cplusplus */ typedef enum { - AVS_SOUND_SOURCE_TYPE_SCOPE, - AVS_SOUND_SOURCE_TYPE_SPECTRUM + AVS_SOUND_SOURCE_TYPE_SCOPE, + AVS_SOUND_SOURCE_TYPE_SPECTRUM } AVSSoundSourceType; typedef enum { - AVS_SOUND_CHANNEL_TYPE_LEFT, - AVS_SOUND_CHANNEL_TYPE_RIGHT, - AVS_SOUND_CHANNEL_TYPE_CENTER + AVS_SOUND_CHANNEL_TYPE_LEFT, + AVS_SOUND_CHANNEL_TYPE_RIGHT, + AVS_SOUND_CHANNEL_TYPE_CENTER } AVSSoundChannelType; /* Prototypes */ -//short avs_sound_get_from_source (VisAudio *audio, AVSSoundSourceType source, AVSSoundChannelType channel, int index); -int lvavs_sound_get_from_source (VisAudio *audio, float ***data); +// short avs_sound_get_from_source (VisAudio *audio, AVSSoundSourceType source, +// AVSSoundChannelType channel, int index); +int lvavs_sound_get_from_source(VisAudio *audio, float ***data); #ifdef __cplusplus } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_pipeline.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_pipeline.c index 1e512d6a2..45c280d6e 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_pipeline.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_pipeline.c @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -29,7 +29,6 @@ #include #include - #ifdef _OPENMP #include #endif @@ -41,814 +40,819 @@ #include "avs_common.h" /* Prototypes */ -static int lvavs_pipeline_dtor (VisObject *object); -static int lvavs_pipeline_element_dtor (VisObject *object); -static int lvavs_pipeline_container_dtor (VisObject *object); - -int pipeline_from_preset (LVAVSPipelineContainer *container, LVAVSPresetContainer *presetcont); -int pipeline_container_realize (LVAVSPipelineContainer *container); -int pipeline_container_negotiate (LVAVSPipelineContainer *container, VisVideo *video); -int pipeline_container_propagate_event (LVAVSPipelineContainer *container, VisEvent *event); -int pipeline_container_run (LVAVSPipelineContainer *container, VisVideo *video, VisAudio *audio); +static int lvavs_pipeline_dtor(VisObject *object); +static int lvavs_pipeline_element_dtor(VisObject *object); +static int lvavs_pipeline_container_dtor(VisObject *object); + +int pipeline_from_preset(LVAVSPipelineContainer *container, + LVAVSPresetContainer *presetcont); +int pipeline_container_realize(LVAVSPipelineContainer *container); +int pipeline_container_negotiate(LVAVSPipelineContainer *container, + VisVideo *video); +int pipeline_container_propagate_event(LVAVSPipelineContainer *container, + VisEvent *event); +int pipeline_container_run(LVAVSPipelineContainer *container, VisVideo *video, + VisAudio *audio); /* Object destructors */ -static int lvavs_pipeline_dtor (VisObject *object) -{ - LVAVSPipeline *pipeline = LVAVS_PIPELINE (object); +static int lvavs_pipeline_dtor(VisObject *object) { + LVAVSPipeline *pipeline = LVAVS_PIPELINE(object); - if (pipeline->renderstate != NULL) - visual_object_unref (VISUAL_OBJECT (pipeline->renderstate)); + if (pipeline->renderstate != NULL) + visual_object_unref(VISUAL_OBJECT(pipeline->renderstate)); - if (pipeline->container != NULL) - visual_object_unref (VISUAL_OBJECT (pipeline->container)); + if (pipeline->container != NULL) + visual_object_unref(VISUAL_OBJECT(pipeline->container)); - pipeline->renderstate = NULL; - pipeline->container = NULL; + pipeline->renderstate = NULL; + pipeline->container = NULL; - return TRUE; + return TRUE; } -static int lvavs_pipeline_element_dtor (VisObject *object) -{ - LVAVSPipelineElement *element = LVAVS_PIPELINE_ELEMENT (object); +static int lvavs_pipeline_element_dtor(VisObject *object) { + LVAVSPipelineElement *element = LVAVS_PIPELINE_ELEMENT(object); - if (element->params != NULL) - visual_object_unref (VISUAL_OBJECT (element->params)); - - switch (element->type) { - case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: - visual_object_unref (VISUAL_OBJECT (element->data.actor)); - element->data.actor = NULL; + if (element->params != NULL) + visual_object_unref(VISUAL_OBJECT(element->params)); - break; + switch (element->type) { + case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: + visual_object_unref(VISUAL_OBJECT(element->data.actor)); + element->data.actor = NULL; - case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: - visual_object_unref (VISUAL_OBJECT (element->data.transform)); - element->data.transform = NULL; + break; - break; + case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: + visual_object_unref(VISUAL_OBJECT(element->data.transform)); + element->data.transform = NULL; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_MORPH: - visual_object_unref (VISUAL_OBJECT (element->data.morph)); - element->data.morph = NULL; + case LVAVS_PIPELINE_ELEMENT_TYPE_MORPH: + visual_object_unref(VISUAL_OBJECT(element->data.morph)); + element->data.morph = NULL; - break; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_RENDERSTATE: - case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: + case LVAVS_PIPELINE_ELEMENT_TYPE_RENDERSTATE: + case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: - break; + break; - default: - visual_log (VISUAL_LOG_WARNING, "Tried to destroy invalid LVAVSPipelineElement type"); + default: + visual_log(VISUAL_LOG_WARNING, + "Tried to destroy invalid LVAVSPipelineElement type"); - break; - } + break; + } - element->pipeline = NULL; - element->params = NULL; + element->pipeline = NULL; + element->params = NULL; - return TRUE; + return TRUE; } -static int lvavs_pipeline_container_dtor (VisObject *object) -{ - LVAVSPipelineContainer *container = LVAVS_PIPELINE_CONTAINER (object); +static int lvavs_pipeline_container_dtor(VisObject *object) { + LVAVSPipelineContainer *container = LVAVS_PIPELINE_CONTAINER(object); - if (container->members != NULL) - ;//FIXME visual_object_unref (VISUAL_OBJECT (container->members)); + if (container->members != NULL) + ; // FIXME visual_object_unref (VISUAL_OBJECT (container->members)); - container->members = NULL; + container->members = NULL; - lvavs_pipeline_element_dtor (object); + lvavs_pipeline_element_dtor(object); - return TRUE; + return TRUE; } /* LVAVS Preset */ -LVAVSPipeline *lvavs_pipeline_new () -{ - LVAVSPipeline *pipeline; - VisColor *col = visual_color_black(); - int i,j; - +LVAVSPipeline *lvavs_pipeline_new() { + LVAVSPipeline *pipeline; + VisColor *col = visual_color_black(); + int i, j; - pipeline = visual_mem_new0 (LVAVSPipeline, 1); + pipeline = visual_mem_new0(LVAVSPipeline, 1); - pipeline->dummy_vid = visual_video_new_with_buffer(0, 0, 1); + pipeline->dummy_vid = visual_video_new_with_buffer(0, 0, 1); - pipeline->last_vid = visual_video_new_with_buffer(0, 0, 1); - - for(i = 0; i < sizeof(pipeline->buffers) / sizeof(VisVideo); i++) { - pipeline->buffers[i] = visual_video_new_with_buffer(0, 0, 1); - } - for (j=0;j<256;j++) - for (i=0;i<256;i++) - pipeline->blendtable[i][j] = (unsigned char)((i / 255.0) * (float)j); + pipeline->last_vid = visual_video_new_with_buffer(0, 0, 1); + + for (i = 0; i < sizeof(pipeline->buffers) / sizeof(VisVideo); i++) { + pipeline->buffers[i] = visual_video_new_with_buffer(0, 0, 1); + } + for (j = 0; j < 256; j++) + for (i = 0; i < 256; i++) + pipeline->blendtable[i][j] = (unsigned char)((i / 255.0) * (float)j); - /* Do the VisObject initialization */ - visual_object_set_allocated (VISUAL_OBJECT (pipeline), TRUE); - visual_object_initialize (VISUAL_OBJECT (pipeline), TRUE, lvavs_pipeline_dtor); + /* Do the VisObject initialization */ + visual_object_set_allocated(VISUAL_OBJECT(pipeline), TRUE); + visual_object_initialize(VISUAL_OBJECT(pipeline), TRUE, lvavs_pipeline_dtor); - return pipeline; + return pipeline; } -LVAVSPipelineElement *lvavs_pipeline_element_new (LVAVSPipelineElementType type) -{ - LVAVSPipelineElement *element; +LVAVSPipelineElement * +lvavs_pipeline_element_new(LVAVSPipelineElementType type) { + LVAVSPipelineElement *element; - element = visual_mem_new0 (LVAVSPipelineElement, 1); + element = visual_mem_new0(LVAVSPipelineElement, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (element), TRUE, lvavs_pipeline_element_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(element), TRUE, + lvavs_pipeline_element_dtor); - element->type = type; + element->type = type; - return element; + return element; } -LVAVSPipelineContainer *lvavs_pipeline_container_new () -{ - LVAVSPipelineContainer *container; +LVAVSPipelineContainer *lvavs_pipeline_container_new() { + LVAVSPipelineContainer *container; - container = visual_mem_new0 (LVAVSPipelineContainer, 1); + container = visual_mem_new0(LVAVSPipelineContainer, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (container), TRUE, lvavs_pipeline_container_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(container), TRUE, + lvavs_pipeline_container_dtor); - LVAVS_PIPELINE_ELEMENT (container)->type = LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER; + LVAVS_PIPELINE_ELEMENT(container)->type = + LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER; - container->members = visual_list_new (visual_object_collection_destroyer); + container->members = visual_list_new(visual_object_collection_destroyer); - return container; + return container; } -LVAVSPipeline *lvavs_pipeline_new_from_preset (LVAVSPreset *preset) -{ - LVAVSPipeline *pipeline; +LVAVSPipeline *lvavs_pipeline_new_from_preset(LVAVSPreset *preset) { + LVAVSPipeline *pipeline; - pipeline = lvavs_pipeline_new (); + pipeline = lvavs_pipeline_new(); - pipeline->container = lvavs_pipeline_container_new (); - LVAVS_PIPELINE_ELEMENT (pipeline->container)->pipeline = pipeline; + pipeline->container = lvavs_pipeline_container_new(); + LVAVS_PIPELINE_ELEMENT(pipeline->container)->pipeline = pipeline; - pipeline_from_preset (pipeline->container, preset->main); + pipeline_from_preset(pipeline->container, preset->main); - return pipeline; + return pipeline; } -int lvavs_pipeline_realize (LVAVSPipeline *pipeline) -{ - pipeline_container_realize (LVAVS_PIPELINE_CONTAINER (pipeline->container)); +int lvavs_pipeline_realize(LVAVSPipeline *pipeline) { + pipeline_container_realize(LVAVS_PIPELINE_CONTAINER(pipeline->container)); - return VISUAL_OK; + return VISUAL_OK; } /* The pipeline is currently depth unaware, and always runs in 32bits mode. * This will change when we introduce VisPipeline. */ -int lvavs_pipeline_negotiate (LVAVSPipeline *pipeline, VisVideo *video) -{ - pipeline_container_negotiate (LVAVS_PIPELINE_CONTAINER (pipeline->container), video); +int lvavs_pipeline_negotiate(LVAVSPipeline *pipeline, VisVideo *video) { + pipeline_container_negotiate(LVAVS_PIPELINE_CONTAINER(pipeline->container), + video); - return VISUAL_OK; + return VISUAL_OK; } -int lvavs_pipeline_propagate_event (LVAVSPipeline *pipeline, VisEvent *event) -{ - return pipeline_container_propagate_event (pipeline->container, event); +int lvavs_pipeline_propagate_event(LVAVSPipeline *pipeline, VisEvent *event) { + return pipeline_container_propagate_event(pipeline->container, event); } -int lvavs_pipeline_run (LVAVSPipeline *pipeline, VisVideo *video, VisAudio *audio) -{ - int size = BEAT_MAX_SIZE/2; +int lvavs_pipeline_run(LVAVSPipeline *pipeline, VisVideo *video, + VisAudio *audio) { + int size = BEAT_MAX_SIZE / 2; - float data[2][2][size]; + float data[2][2][size]; - VisBuffer *tmp = visual_buffer_new_allocate (sizeof(float) * size); + VisBuffer *tmp = visual_buffer_new_allocate(sizeof(float) * size); - /* Left audio */ - if(visual_audio_get_sample(audio, &tmp, VISUAL_AUDIO_CHANNEL_LEFT)) { - VisBuffer *pcmbuf1 = visual_buffer_new_wrap_data (data[0][0], sizeof(float) * size, 0); - visual_audio_sample_buffer_mix (pcmbuf1, tmp, TRUE, 1.0); - visual_buffer_unref(pcmbuf1); - } + /* Left audio */ + if (visual_audio_get_sample(audio, &tmp, VISUAL_AUDIO_CHANNEL_LEFT)) { + VisBuffer *pcmbuf1 = + visual_buffer_new_wrap_data(data[0][0], sizeof(float) * size, 0); + visual_audio_sample_buffer_mix(pcmbuf1, tmp, TRUE, 1.0); + visual_buffer_unref(pcmbuf1); + } - VisBuffer *spmbuf1 = visual_buffer_new_wrap_data (data[1][0], sizeof(float) * size, 0); - visual_audio_get_spectrum_for_sample (spmbuf1, tmp, TRUE); - visual_buffer_unref (spmbuf1); + VisBuffer *spmbuf1 = + visual_buffer_new_wrap_data(data[1][0], sizeof(float) * size, 0); + visual_audio_get_spectrum_for_sample(spmbuf1, tmp, TRUE); + visual_buffer_unref(spmbuf1); - /* Right audio */ + /* Right audio */ - if(visual_audio_get_sample (audio, &tmp, VISUAL_AUDIO_CHANNEL_LEFT)) { - VisBuffer *pcmbuf2 = visual_buffer_new_wrap_data (data[0][1], sizeof(float) * size, 0); - visual_audio_sample_buffer_mix (pcmbuf2, tmp, TRUE, 1.0); - visual_buffer_unref(pcmbuf2); - } + if (visual_audio_get_sample(audio, &tmp, VISUAL_AUDIO_CHANNEL_LEFT)) { + VisBuffer *pcmbuf2 = + visual_buffer_new_wrap_data(data[0][1], sizeof(float) * size, 0); + visual_audio_sample_buffer_mix(pcmbuf2, tmp, TRUE, 1.0); + visual_buffer_unref(pcmbuf2); + } - VisBuffer *spmbuf2 = visual_buffer_new_wrap_data (data[1][1], sizeof(float) * size, 0); - visual_audio_get_spectrum_for_sample (spmbuf2, tmp, TRUE); - visual_buffer_unref(spmbuf2); + VisBuffer *spmbuf2 = + visual_buffer_new_wrap_data(data[1][1], sizeof(float) * size, 0); + visual_audio_get_spectrum_for_sample(spmbuf2, tmp, TRUE); + visual_buffer_unref(spmbuf2); - visual_buffer_unref(tmp); + visual_buffer_unref(tmp); #ifdef _OPENMP #pragma omp parallel for private(i) #endif - for(int i = size - 1; i >= 0; i--) { - pipeline->audiodata[0][0][i] = (data[0][0][i] + 1) / 2.0; - pipeline->audiodata[1][0][i] = (data[1][0][i] + 1) / 2.0; - pipeline->audiodata[0][1][i] = (data[0][1][i] + 1) / 2.0; - pipeline->audiodata[1][1][i] = (data[1][1][i] + 1) / 2.0; - } + for (int i = size - 1; i >= 0; i--) { + pipeline->audiodata[0][0][i] = (data[0][0][i] + 1) / 2.0; + pipeline->audiodata[1][0][i] = (data[1][0][i] + 1) / 2.0; + pipeline->audiodata[0][1][i] = (data[0][1][i] + 1) / 2.0; + pipeline->audiodata[1][1][i] = (data[1][1][i] + 1) / 2.0; + } -/* - float beatdata[BEAT_MAX_SIZE]; - char visdata[BEAT_MAX_SIZE]; + /* + float beatdata[BEAT_MAX_SIZE]; + char visdata[BEAT_MAX_SIZE]; - memcpy(beatdata, data[1][0], size * sizeof(float)); - memcpy(beatdata + size, data[1][1], size * sizeof(float)); -#ifdef _OPENMP -#pragma omp parallel for private(i) -#endif + memcpy(beatdata, data[1][0], size * sizeof(float)); + memcpy(beatdata + size, data[1][1], size * sizeof(float)); + #ifdef _OPENMP + #pragma omp parallel for private(i) + #endif - for(i = BEAT_MAX_SIZE - 1; i >= 0; i--) { - visdata[i] = (beatdata[i] + 1) / 2.0 * CHAR_MAX; - } + for(i = BEAT_MAX_SIZE - 1; i >= 0; i--) { + visdata[i] = (beatdata[i] + 1) / 2.0 * CHAR_MAX; + } - pipeline->isBeat = visual_audio_is_beat_with_data(audio, VISUAL_BEAT_ALGORITHM_PEAK, visdata, BEAT_MAX_SIZE/2); -*/ + pipeline->isBeat = visual_audio_is_beat_with_data(audio, + VISUAL_BEAT_ALGORITHM_PEAK, visdata, BEAT_MAX_SIZE/2); + */ - pipeline_container_run (LVAVS_PIPELINE_CONTAINER (pipeline->container), video, audio); + pipeline_container_run(LVAVS_PIPELINE_CONTAINER(pipeline->container), video, + audio); - return VISUAL_OK; + return VISUAL_OK; } /* Internal functions */ -int pipeline_from_preset (LVAVSPipelineContainer *container, LVAVSPresetContainer *presetcont) -{ - VisListEntry *le = NULL; - LVAVSPresetElement *pelem; - LVAVSPipelineElement *element; - LVAVSPipelineContainer *cont; - VisPluginRef *ref; - LVAVSPipeline *pipeline = LVAVS_PIPELINE_ELEMENT(container)->pipeline; +int pipeline_from_preset(LVAVSPipelineContainer *container, + LVAVSPresetContainer *presetcont) { + VisListEntry *le = NULL; + LVAVSPresetElement *pelem; + LVAVSPipelineElement *element; + LVAVSPipelineContainer *cont; + VisPluginRef *ref; + LVAVSPipeline *pipeline = LVAVS_PIPELINE_ELEMENT(container)->pipeline; - while ((pelem = visual_list_next (presetcont->members, &le)) != NULL) { + while ((pelem = visual_list_next(presetcont->members, &le)) != NULL) { - switch (pelem->type) { - case LVAVS_PRESET_ELEMENT_TYPE_PLUGIN: - ref = visual_plugin_find (visual_plugin_get_registry (), pelem->element_name); + switch (pelem->type) { + case LVAVS_PRESET_ELEMENT_TYPE_PLUGIN: + ref = + visual_plugin_find(visual_plugin_get_registry(), pelem->element_name); - if (ref == NULL) { - visual_log (VISUAL_LOG_CRITICAL, "Requested plugin %s not in registry", pelem->element_name); + if (ref == NULL) { + visual_log(VISUAL_LOG_CRITICAL, "Requested plugin %s not in registry", + pelem->element_name); - break; - } + break; + } - if (ref->info == NULL) { - visual_log (VISUAL_LOG_CRITICAL, "Could not get VisPluginInfo for %s", pelem->element_name); + if (ref->info == NULL) { + visual_log(VISUAL_LOG_CRITICAL, "Could not get VisPluginInfo for %s", + pelem->element_name); - break; - } + break; + } - /* FIXME fix libvisual type lookup and use the functions here */ - if (strcmp (ref->info->type, VISUAL_PLUGIN_TYPE_ACTOR) == 0) { + /* FIXME fix libvisual type lookup and use the functions here */ + if (strcmp(ref->info->type, VISUAL_PLUGIN_TYPE_ACTOR) == 0) { - element = lvavs_pipeline_element_new (LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR); - element->data.actor = visual_actor_new (pelem->element_name); - visual_object_set_private(VISUAL_OBJECT(element->data.actor->plugin), pipeline); + element = lvavs_pipeline_element_new(LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR); + element->data.actor = visual_actor_new(pelem->element_name); + visual_object_set_private(VISUAL_OBJECT(element->data.actor->plugin), + pipeline); - } else if (strcmp (ref->info->type, VISUAL_PLUGIN_TYPE_MORPH) == 0) { + } else if (strcmp(ref->info->type, VISUAL_PLUGIN_TYPE_MORPH) == 0) { - element = lvavs_pipeline_element_new (LVAVS_PIPELINE_ELEMENT_TYPE_MORPH); - element->data.morph = visual_morph_new (pelem->element_name); - visual_object_set_private(VISUAL_OBJECT(element->data.morph->plugin), pipeline); + element = lvavs_pipeline_element_new(LVAVS_PIPELINE_ELEMENT_TYPE_MORPH); + element->data.morph = visual_morph_new(pelem->element_name); + visual_object_set_private(VISUAL_OBJECT(element->data.morph->plugin), + pipeline); - } else if (strcmp (ref->info->type, VISUAL_PLUGIN_TYPE_TRANSFORM) == 0) { + } else if (strcmp(ref->info->type, VISUAL_PLUGIN_TYPE_TRANSFORM) == 0) { - element = lvavs_pipeline_element_new (LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM); - element->data.transform = visual_transform_new (pelem->element_name); - visual_object_set_private(VISUAL_OBJECT(element->data.transform->plugin), pipeline); + element = + lvavs_pipeline_element_new(LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM); + element->data.transform = visual_transform_new(pelem->element_name); + visual_object_set_private( + VISUAL_OBJECT(element->data.transform->plugin), pipeline); - } else { - printf("uknown type '%s' '%s'\n", ref->info->type, ref->info->name); - } + } else { + printf("uknown type '%s' '%s'\n", ref->info->type, ref->info->name); + } - if (pelem->pcont != NULL) { - element->params = visual_param_container_new (); - visual_param_container_copy (element->params, pelem->pcont); - } + if (pelem->pcont != NULL) { + element->params = visual_param_container_new(); + visual_param_container_copy(element->params, pelem->pcont); + } - element->pipeline = LVAVS_PIPELINE_ELEMENT (container)->pipeline; + element->pipeline = LVAVS_PIPELINE_ELEMENT(container)->pipeline; - visual_list_add (container->members, element); + visual_list_add(container->members, element); - break; + break; - case LVAVS_PRESET_ELEMENT_TYPE_CONTAINER: - cont = lvavs_pipeline_container_new (); + case LVAVS_PRESET_ELEMENT_TYPE_CONTAINER: + cont = lvavs_pipeline_container_new(); - LVAVS_PIPELINE_ELEMENT(cont)->params = LVAVS_PIPELINE_ELEMENT(container)->params; - LVAVS_PIPELINE_ELEMENT(cont)->pipeline = LVAVS_PIPELINE_ELEMENT(container)->pipeline; + LVAVS_PIPELINE_ELEMENT(cont)->params = + LVAVS_PIPELINE_ELEMENT(container)->params; + LVAVS_PIPELINE_ELEMENT(cont)->pipeline = + LVAVS_PIPELINE_ELEMENT(container)->pipeline; - visual_list_add (container->members, cont); + visual_list_add(container->members, cont); - pipeline_from_preset (cont, LVAVS_PRESET_CONTAINER (pelem)); - break; + pipeline_from_preset(cont, LVAVS_PRESET_CONTAINER(pelem)); + break; - case LVAVS_PRESET_ELEMENT_TYPE_RENDERSTATE: + case LVAVS_PRESET_ELEMENT_TYPE_RENDERSTATE: - break; + break; - case LVAVS_PRESET_ELEMENT_TYPE_COMMENT: + case LVAVS_PRESET_ELEMENT_TYPE_COMMENT: - break; + break; - case LVAVS_PRESET_ELEMENT_TYPE_BPM: + case LVAVS_PRESET_ELEMENT_TYPE_BPM: - break; + break; - case LVAVS_PRESET_ELEMENT_TYPE_STACK: + case LVAVS_PRESET_ELEMENT_TYPE_STACK: - break; - - default: - visual_log (VISUAL_LOG_CRITICAL, "Invalid LVAVSPresetElementType in LVAVSPresetElement"); + break; - break; - } + default: + visual_log(VISUAL_LOG_CRITICAL, + "Invalid LVAVSPresetElementType in LVAVSPresetElement"); + + break; } + } - return VISUAL_OK; + return VISUAL_OK; } -int pipeline_container_realize (LVAVSPipelineContainer *container) -{ - VisListEntry *le = NULL; - LVAVSPipelineElement *element; +int pipeline_container_realize(LVAVSPipelineContainer *container) { + VisListEntry *le = NULL; + LVAVSPipelineElement *element; - while ((element = visual_list_next (container->members, &le)) != NULL) { + while ((element = visual_list_next(container->members, &le)) != NULL) { - switch (element->type) { - case LVAVS_PIPELINE_ELEMENT_TYPE_NULL: + switch (element->type) { + case LVAVS_PIPELINE_ELEMENT_TYPE_NULL: - break; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: + case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: - visual_actor_realize (element->data.actor); - visual_param_container_copy_match (visual_plugin_get_params ( - visual_actor_get_plugin (element->data.actor)), element->params); + visual_actor_realize(element->data.actor); + visual_param_container_copy_match( + visual_plugin_get_params( + visual_actor_get_plugin(element->data.actor)), + element->params); - break; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: + case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: - visual_transform_realize (element->data.transform); - visual_param_container_copy_match (visual_plugin_get_params ( - visual_transform_get_plugin (element->data.transform)), element->params); + visual_transform_realize(element->data.transform); + visual_param_container_copy_match( + visual_plugin_get_params( + visual_transform_get_plugin(element->data.transform)), + element->params); - break; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_MORPH: + case LVAVS_PIPELINE_ELEMENT_TYPE_MORPH: - visual_morph_realize (element->data.morph); + visual_morph_realize(element->data.morph); - break; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_RENDERSTATE: + case LVAVS_PIPELINE_ELEMENT_TYPE_RENDERSTATE: - break; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: + case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: - pipeline_container_realize (LVAVS_PIPELINE_CONTAINER (element)); + pipeline_container_realize(LVAVS_PIPELINE_CONTAINER(element)); - break; + break; - default: - visual_log (VISUAL_LOG_CRITICAL, "Invalid LVAVSPipelineElementType"); + default: + visual_log(VISUAL_LOG_CRITICAL, "Invalid LVAVSPipelineElementType"); - break; - } + break; } - return 0; + } + return 0; } -int pipeline_container_negotiate (LVAVSPipelineContainer *container, VisVideo *video) -{ - VisListEntry *le = NULL; - LVAVSPipelineElement *element; - - while ((element = visual_list_next (container->members, &le)) != NULL) { +int pipeline_container_negotiate(LVAVSPipelineContainer *container, + VisVideo *video) { + VisListEntry *le = NULL; + LVAVSPipelineElement *element; - switch (element->type) { - case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: - visual_actor_set_video (element->data.actor, video); - visual_actor_video_negotiate (element->data.actor, VISUAL_VIDEO_DEPTH_NONE, FALSE, FALSE); + while ((element = visual_list_next(container->members, &le)) != NULL) { - break; + switch (element->type) { + case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: + visual_actor_set_video(element->data.actor, video); + visual_actor_video_negotiate(element->data.actor, VISUAL_VIDEO_DEPTH_NONE, + FALSE, FALSE); - case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: - visual_transform_set_video (element->data.transform, video); - visual_transform_video_negotiate (element->data.transform); + break; - break; + case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: + visual_transform_set_video(element->data.transform, video); + visual_transform_video_negotiate(element->data.transform); + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: + case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: - pipeline_container_negotiate (LVAVS_PIPELINE_CONTAINER (element), video); + pipeline_container_negotiate(LVAVS_PIPELINE_CONTAINER(element), video); - break; + break; - default: + default: - break; - } + break; } + } - return VISUAL_OK; + return VISUAL_OK; } -int pipeline_container_propagate_event (LVAVSPipelineContainer *container, VisEvent *event) -{ - VisListEntry *le = NULL; - VisEventQueue *pluginqueue; - LVAVSPipelineElement *element; +int pipeline_container_propagate_event(LVAVSPipelineContainer *container, + VisEvent *event) { + VisListEntry *le = NULL; + VisEventQueue *pluginqueue; + LVAVSPipelineElement *element; - while ((element = visual_list_next (container->members, &le)) != NULL) { + while ((element = visual_list_next(container->members, &le)) != NULL) { - switch (element->type) { - case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: + switch (element->type) { + case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: - pluginqueue = visual_plugin_get_eventqueue (visual_actor_get_plugin (element->data.actor)); + pluginqueue = visual_plugin_get_eventqueue( + visual_actor_get_plugin(element->data.actor)); - visual_object_ref (VISUAL_OBJECT (event)); - visual_event_queue_add (pluginqueue, event); + visual_object_ref(VISUAL_OBJECT(event)); + visual_event_queue_add(pluginqueue, event); - break; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: + case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: - pluginqueue = visual_plugin_get_eventqueue (visual_actor_get_plugin (element->data.actor)); + pluginqueue = visual_plugin_get_eventqueue( + visual_actor_get_plugin(element->data.actor)); - visual_object_ref (VISUAL_OBJECT (event)); - visual_event_queue_add (pluginqueue, event); + visual_object_ref(VISUAL_OBJECT(event)); + visual_event_queue_add(pluginqueue, event); - break; + break; - case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: + case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: - pipeline_container_propagate_event (LVAVS_PIPELINE_CONTAINER (element), event); + pipeline_container_propagate_event(LVAVS_PIPELINE_CONTAINER(element), + event); - break; + break; - default: + default: - break; - } + break; } + } - - return VISUAL_OK; + return VISUAL_OK; } -static int blendin(int mode) {return ((mode>>8)&31);} -static void set_blendin(int v, int *mode) { *mode&=~(31<<8); *mode|=(v&31)<<8; } -static int blendout(int mode) { return ((mode>>16)&31)^1; } -static void set_blendout(int v, int *mode) { *mode&=~(31<<16); *mode|=((v^1)&31)<<16; } - -static int render_now(LVAVSPipelineContainer *container, VisVideo *video, VisAudio *audio, int s) -{ - LVAVSPipeline *pipeline = LVAVS_PIPELINE_ELEMENT(container)->pipeline; - - int i; - int count = visual_list_count(container->members); - for(i = 0; i < count; i++) { - LVAVSPipelineElement *element = visual_list_get(container->members, i); - VisVideo *tmpvid; - - if(s) { - pipeline->framebuffer = visual_video_get_pixels(pipeline->dummy_vid); - pipeline->fbout = visual_video_get_pixels(video); - } else { - pipeline->fbout = visual_video_get_pixels(pipeline->dummy_vid); - pipeline->framebuffer = visual_video_get_pixels(video); - } +static int blendin(int mode) { return ((mode >> 8) & 31); } +static void set_blendin(int v, int *mode) { + *mode &= ~(31 << 8); + *mode |= (v & 31) << 8; +} +static int blendout(int mode) { return ((mode >> 16) & 31) ^ 1; } +static void set_blendout(int v, int *mode) { + *mode &= ~(31 << 16); + *mode |= ((v ^ 1) & 31) << 16; +} - switch (element->type) { - case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: +static int render_now(LVAVSPipelineContainer *container, VisVideo *video, + VisAudio *audio, int s) { + LVAVSPipeline *pipeline = LVAVS_PIPELINE_ELEMENT(container)->pipeline; + + int i; + int count = visual_list_count(container->members); + for (i = 0; i < count; i++) { + LVAVSPipelineElement *element = visual_list_get(container->members, i); + VisVideo *tmpvid; + + if (s) { + pipeline->framebuffer = visual_video_get_pixels(pipeline->dummy_vid); + pipeline->fbout = visual_video_get_pixels(video); + } else { + pipeline->fbout = visual_video_get_pixels(pipeline->dummy_vid); + pipeline->framebuffer = visual_video_get_pixels(video); + } - visual_actor_set_video (element->data.actor, video); - visual_actor_run (element->data.actor, audio); + switch (element->type) { + case LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR: - break; + visual_actor_set_video(element->data.actor, video); + visual_actor_run(element->data.actor, audio); - case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: + break; - visual_transform_set_video (element->data.transform, video); - visual_transform_run (element->data.transform, audio); + case LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM: - break; + visual_transform_set_video(element->data.transform, video); + visual_transform_run(element->data.transform, audio); - case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: + break; - pipeline_container_run (LVAVS_PIPELINE_CONTAINER (element), video, audio); + case LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER: - break; + pipeline_container_run(LVAVS_PIPELINE_CONTAINER(element), video, audio); - default: + break; - break; - } + default: - if(pipeline->swap&1) { - s^=1; - pipeline->swap = 0; - } + break; + } + if (pipeline->swap & 1) { + s ^= 1; + pipeline->swap = 0; } + } - return s; + return s; } -int pipeline_container_run (LVAVSPipelineContainer *container, VisVideo *video, VisAudio *audio) -{ - int i, s = 0; - VisListEntry *le = NULL; - LVAVSPipelineElement *element; - VisBuffer pcmbuf1; - VisBuffer pcmbuf2; - VisBuffer spmbuf1; - VisBuffer spmbuf2; - VisBuffer tmp; - int *fbout; - int *framebuffer; - LVAVSPipeline *pipeline = LVAVS_PIPELINE_ELEMENT(container)->pipeline; - int w = video->width, h = video->height; - - if(video->width != pipeline->dummy_vid->width || video->height != pipeline->dummy_vid->height || video->depth != pipeline->dummy_vid->depth) { - - if(pipeline->dummy_vid) - visual_object_unref(VISUAL_OBJECT(pipeline->dummy_vid)); - - if(pipeline->last_vid) - visual_object_unref(VISUAL_OBJECT(pipeline->last_vid)); - - pipeline->dummy_vid = visual_video_scale_depth_new(video, video->width, video->height, video->depth, VISUAL_VIDEO_COMPOSITE_TYPE_SRC); - - pipeline->last_vid = visual_video_scale_depth_new(video, video->width, video->height, video->depth, VISUAL_VIDEO_COMPOSITE_TYPE_SRC); - - for(i = 0; i < 16; i++) { - VisVideo *vid = pipeline->buffers[i]; - if(vid) - visual_object_unref(VISUAL_OBJECT(vid)); - vid = visual_video_scale_depth_new(video, video->width, video->height, video->depth, VISUAL_VIDEO_COMPOSITE_TYPE_NONE); - pipeline->buffers[i] = vid; - } +int pipeline_container_run(LVAVSPipelineContainer *container, VisVideo *video, + VisAudio *audio) { + int i, s = 0; + VisListEntry *le = NULL; + LVAVSPipelineElement *element; + VisBuffer pcmbuf1; + VisBuffer pcmbuf2; + VisBuffer spmbuf1; + VisBuffer spmbuf2; + VisBuffer tmp; + int *fbout; + int *framebuffer; + LVAVSPipeline *pipeline = LVAVS_PIPELINE_ELEMENT(container)->pipeline; + int w = video->width, h = video->height; + + if (video->width != pipeline->dummy_vid->width || + video->height != pipeline->dummy_vid->height || + video->depth != pipeline->dummy_vid->depth) { + + if (pipeline->dummy_vid) + visual_object_unref(VISUAL_OBJECT(pipeline->dummy_vid)); + + if (pipeline->last_vid) + visual_object_unref(VISUAL_OBJECT(pipeline->last_vid)); + + pipeline->dummy_vid = visual_video_scale_depth_new( + video, video->width, video->height, video->depth, + VISUAL_VIDEO_COMPOSITE_TYPE_SRC); + + pipeline->last_vid = visual_video_scale_depth_new( + video, video->width, video->height, video->depth, + VISUAL_VIDEO_COMPOSITE_TYPE_SRC); + + for (i = 0; i < 16; i++) { + VisVideo *vid = pipeline->buffers[i]; + if (vid) + visual_object_unref(VISUAL_OBJECT(vid)); + vid = visual_video_scale_depth_new(video, video->width, video->height, + video->depth, + VISUAL_VIDEO_COMPOSITE_TYPE_NONE); + pipeline->buffers[i] = vid; } - - visual_video_blit_overlay(video, pipeline->last_vid, 0, 0, 0.5); - - fbout = visual_video_get_pixels(video); - framebuffer = visual_video_get_pixels(pipeline->dummy_vid); - - int is_preinit = pipeline->isBeat;//(pipeline->isBeat&0x80000000); - -/* if(pipeline->isBeat && beat_render) - fake_enabled = beat_render_frames; -*/ - s = render_now(container, video, audio, s); - - if(!is_preinit) - { - int x = video->width * video->height; - int *tfb=framebuffer; - int *o = fbout; - int use_blendin=blendin(pipeline->blendmode); - if(use_blendin == 10 && pipeline->use_inblendval >= 255) - use_blendin=1; - - switch (use_blendin) - { - case 1: - visual_mem_copy(o, tfb, w*h*sizeof(int)); - break; - case 2: - mmx_avgblend_block(o,tfb,x); - break; - case 3: - while(x--) - { - *o=BLEND_MAX(*o, *tfb++); - o++; - } - break; - case 4: - //mmx_addblend_block(pipeline->blendtable, o, tfb, x); - break; - case 5: - while(x--) - { - *o=BLEND_SUB(*o,*tfb++); - o++; - } - break; - case 6: - while(x--) - { - *o=BLEND_SUB(*tfb++, *o); - o++; - } - break; - case 7: - { - int y=h/2; - while(x-- > 0) - { - visual_mem_copy(o,tfb,w*sizeof(int)); - tfb+=w*2; - o+=w*2; - } - break; - } - case 8: - { - int r = 0; - int y = h; - while(y-- > 0) - { - int *out, *in; - int x=w/2; - out=o+r; - in=tfb+r; - r^=1; - while(x-- > 0) - { - *out=*in; - out+=2; - in+=2; - } - o+=w; - tfb+=w; - } - break; - } - case 9: - while(x--) - { - *o=*o^*tfb++; - o++; - } - break; - case 10: - mmx_adjblend_block(pipeline->blendtable,o,tfb,o,x,pipeline->use_inblendval); - break; - case 11: - mmx_mulblend_block(pipeline->blendtable, o,tfb,x); - break; - case 13: - while(x--) - { - *o=BLEND_MIN(*o,*tfb++); - o++; - } - break; - case 12: - /* - { - int *buf=(int*)getGlobalBuffer(w,h,bufferin,0); - if (!buf) break; - while (x--) - { - *o=BLEND_ADJ(*tfb++,*o, depthof(*buf, ininvert)); - o++; - buf++; - } - } - */ - break; - default: - break; + } + + visual_video_blit_overlay(video, pipeline->last_vid, 0, 0, 0.5); + + fbout = visual_video_get_pixels(video); + framebuffer = visual_video_get_pixels(pipeline->dummy_vid); + + int is_preinit = pipeline->isBeat; //(pipeline->isBeat&0x80000000); + + /* if(pipeline->isBeat && beat_render) + fake_enabled = beat_render_frames; + */ + s = render_now(container, video, audio, s); + + if (!is_preinit) { + int x = video->width * video->height; + int *tfb = framebuffer; + int *o = fbout; + int use_blendin = blendin(pipeline->blendmode); + if (use_blendin == 10 && pipeline->use_inblendval >= 255) + use_blendin = 1; + + switch (use_blendin) { + case 1: + visual_mem_copy(o, tfb, w * h * sizeof(int)); + break; + case 2: + mmx_avgblend_block(o, tfb, x); + break; + case 3: + while (x--) { + *o = BLEND_MAX(*o, *tfb++); + o++; + } + break; + case 4: + // mmx_addblend_block(pipeline->blendtable, o, tfb, x); + break; + case 5: + while (x--) { + *o = BLEND_SUB(*o, *tfb++); + o++; + } + break; + case 6: + while (x--) { + *o = BLEND_SUB(*tfb++, *o); + o++; + } + break; + case 7: { + int y = h / 2; + while (x-- > 0) { + visual_mem_copy(o, tfb, w * sizeof(int)); + tfb += w * 2; + o += w * 2; + } + break; + } + case 8: { + int r = 0; + int y = h; + while (y-- > 0) { + int *out, *in; + int x = w / 2; + out = o + r; + in = tfb + r; + r ^= 1; + while (x-- > 0) { + *out = *in; + out += 2; + in += 2; } + o += w; + tfb += w; + } + break; + } + case 9: + while (x--) { + *o = *o ^ *tfb++; + o++; + } + break; + case 10: + mmx_adjblend_block(pipeline->blendtable, o, tfb, o, x, + pipeline->use_inblendval); + break; + case 11: + mmx_mulblend_block(pipeline->blendtable, o, tfb, x); + break; + case 13: + while (x--) { + *o = BLEND_MIN(*o, *tfb++); + o++; + } + break; + case 12: + /* + { + int + *buf=(int*)getGlobalBuffer(w,h,bufferin,0); if (!buf) break; while + (x--) + { + *o=BLEND_ADJ(*tfb++,*o, + depthof(*buf, ininvert)); o++; buf++; + } + } + */ + break; + default: + break; } - int x; - int line_blend_mode_save=pipeline->blendmode; - //if(!is_preinit) pipeline->blendmode = 0; - - s = render_now(container, video, audio, s); - //if(!is_preinit) pipeline->blendmode = line_blend_mode_save; - - if(!is_preinit) - { - if(s) visual_mem_copy(framebuffer, fbout, w*h*sizeof(int)); - - int *tfb=s?fbout:framebuffer; - int *o=framebuffer; - x=w*h; - int use_blendout=blendout(pipeline->blendmode); - int use_outblendval = 100; - if(use_blendout == 10 && use_outblendval >= 255) - use_blendout=1; - switch(use_blendout) - { - case 1: - visual_mem_copy(o,tfb,x*sizeof(int)); - break; - case 2: - mmx_avgblend_block(o,tfb,x); - break; - case 3: - while(x--) - { - *o=BLEND_MAX(*o, *tfb++); - o++; - } - break; - case 4: - mmx_addblend_block(o, tfb, x); - break; - case 5: - while(x--) - { - *o = BLEND_SUB(*o, *tfb++); - o++; - } - break; - case 6: - while(x--) - { - *o=BLEND_SUB(*tfb++, *o); - o++; - } - break; - case 7: - { - int y=h/2; - while(y-- > 0) - { - visual_mem_copy(o, tfb, w*sizeof(int)); - tfb+=w*2; - o+=w*2; - } - } - break; - case 8: - { - int r = 0; - int y = h; - while(y-- > 0) - { - int *out, *in; - int x=w/2; - out=o+r; - in=tfb+r; - r^=1; - while(x-- > 0) - { - *out=*in; - out+=2; - in+=2; - } - o+=w; - tfb+=2; - } - } - case 9: - while(x--) - { - *o=*o^*tfb++; - o++; - } - break; - case 10: - mmx_adjblend_block(pipeline->blendtable,o, tfb, o, x, use_outblendval); - break; - case 11: - mmx_mulblend_block(pipeline->blendtable, o, tfb, x); - break; - case 13: - while(x--) - { - *o=BLEND_MIN(*o, *tfb++); - o++; - } - break; - case 12: - { - //uint32_t *buf = buffer[bufferout] - } - break; - default: - break; + } + int x; + int line_blend_mode_save = pipeline->blendmode; + // if(!is_preinit) pipeline->blendmode = 0; + + s = render_now(container, video, audio, s); + // if(!is_preinit) pipeline->blendmode = line_blend_mode_save; + + if (!is_preinit) { + if (s) + visual_mem_copy(framebuffer, fbout, w * h * sizeof(int)); + + int *tfb = s ? fbout : framebuffer; + int *o = framebuffer; + x = w * h; + int use_blendout = blendout(pipeline->blendmode); + int use_outblendval = 100; + if (use_blendout == 10 && use_outblendval >= 255) + use_blendout = 1; + switch (use_blendout) { + case 1: + visual_mem_copy(o, tfb, x * sizeof(int)); + break; + case 2: + mmx_avgblend_block(o, tfb, x); + break; + case 3: + while (x--) { + *o = BLEND_MAX(*o, *tfb++); + o++; + } + break; + case 4: + mmx_addblend_block(o, tfb, x); + break; + case 5: + while (x--) { + *o = BLEND_SUB(*o, *tfb++); + o++; + } + break; + case 6: + while (x--) { + *o = BLEND_SUB(*tfb++, *o); + o++; + } + break; + case 7: { + int y = h / 2; + while (y-- > 0) { + visual_mem_copy(o, tfb, w * sizeof(int)); + tfb += w * 2; + o += w * 2; + } + } break; + case 8: { + int r = 0; + int y = h; + while (y-- > 0) { + int *out, *in; + int x = w / 2; + out = o + r; + in = tfb + r; + r ^= 1; + while (x-- > 0) { + *out = *in; + out += 2; + in += 2; } - } + o += w; + tfb += 2; + } + } + case 9: + while (x--) { + *o = *o ^ *tfb++; + o++; + } + break; + case 10: + mmx_adjblend_block(pipeline->blendtable, o, tfb, o, x, use_outblendval); + break; + case 11: + mmx_mulblend_block(pipeline->blendtable, o, tfb, x); + break; + case 13: + while (x--) { + *o = BLEND_MIN(*o, *tfb++); + o++; + } + break; + case 12: { + // uint32_t *buf = buffer[bufferout] + } break; + default: + break; + } + } - // Save state for next frame. - visual_video_blit_overlay(pipeline->last_vid, video, 0, 0, 0); - return VISUAL_OK; + // Save state for next frame. + visual_video_blit_overlay(pipeline->last_vid, video, 0, 0, 0); + return VISUAL_OK; } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_pipeline.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_pipeline.h index b3f90c2a5..fb0daf82b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_pipeline.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_pipeline.h @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -34,10 +34,13 @@ extern "C" { #endif /* __cplusplus */ -#define LVAVS_PIPELINE(obj) (VISUAL_CHECK_CAST ((obj), LVAVSPipeline)) -#define LVAVS_PIPELINE_RENDERSTATE(obj) (VISUAL_CHECK_CAST ((obj), LVAVSPipelineRenderState)) -#define LVAVS_PIPELINE_ELEMENT(obj) (VISUAL_CHECK_CAST ((obj), LVAVSPipelineElement)) -#define LVAVS_PIPELINE_CONTAINER(obj) (VISUAL_CHECK_CAST ((obj), LVAVSPipelineContainer)) +#define LVAVS_PIPELINE(obj) (VISUAL_CHECK_CAST((obj), LVAVSPipeline)) +#define LVAVS_PIPELINE_RENDERSTATE(obj) \ + (VISUAL_CHECK_CAST((obj), LVAVSPipelineRenderState)) +#define LVAVS_PIPELINE_ELEMENT(obj) \ + (VISUAL_CHECK_CAST((obj), LVAVSPipelineElement)) +#define LVAVS_PIPELINE_CONTAINER(obj) \ + (VISUAL_CHECK_CAST((obj), LVAVSPipelineContainer)) #define LVAVS_MAX_BUFFERS 16 @@ -46,126 +49,127 @@ typedef struct _LVAVSPipelineRenderState LVAVSPipelineRenderState; typedef struct _LVAVSPipelineElement LVAVSPipelineElement; typedef struct _LVAVSPipelineContainer LVAVSPipelineContainer; - typedef enum { - LVAVS_PIPELINE_ELEMENT_TYPE_NULL, - LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR, - LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM, - LVAVS_PIPELINE_ELEMENT_TYPE_MORPH, - LVAVS_PIPELINE_ELEMENT_TYPE_RENDERSTATE, - LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER + LVAVS_PIPELINE_ELEMENT_TYPE_NULL, + LVAVS_PIPELINE_ELEMENT_TYPE_ACTOR, + LVAVS_PIPELINE_ELEMENT_TYPE_TRANSFORM, + LVAVS_PIPELINE_ELEMENT_TYPE_MORPH, + LVAVS_PIPELINE_ELEMENT_TYPE_RENDERSTATE, + LVAVS_PIPELINE_ELEMENT_TYPE_CONTAINER } LVAVSPipelineElementType; typedef enum { - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_REPLACE, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_ADDITIVE, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_MAXIMUM, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_5050, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_SUBSTRACT1, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_SUBSTRACT2, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_MULTIPLY, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_ADJUSTABLE, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_XOR, - LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_MINIMUM + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_REPLACE, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_ADDITIVE, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_MAXIMUM, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_5050, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_SUBSTRACT1, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_SUBSTRACT2, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_MULTIPLY, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_ADJUSTABLE, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_XOR, + LVAVS_PIPELINE_RENDER_STATE_BLEND_TYPE_MINIMUM } LVAVSPipelineRenderStateBlendMode; /* The AVS data structure */ struct _LVAVSPipeline { - VisObject object; + VisObject object; - int clearframe; + int clearframe; - LVAVSPipelineRenderState *renderstate; + LVAVSPipelineRenderState *renderstate; - VisVideo *target; + VisVideo *target; - VisVideo *buffers[LVAVS_MAX_BUFFERS]; + VisVideo *buffers[LVAVS_MAX_BUFFERS]; - VisVideo *dummy_vid; - VisVideo *last_vid; + VisVideo *dummy_vid; + VisVideo *last_vid; - float audiodata[2][2][1024]; + float audiodata[2][2][1024]; - unsigned char blendtable[256][256]; + unsigned char blendtable[256][256]; - int enabled; + int enabled; - unsigned char blendadjust; + unsigned char blendadjust; - LVAVSPipelineRenderStateBlendMode blendmode; + LVAVSPipelineRenderStateBlendMode blendmode; - int linewidth; + int linewidth; - int *fbout; + int *fbout; - int *framebuffer; + int *framebuffer; - int swap; // whether to swap buffers -- fbout<->framebuffer + int swap; // whether to swap buffers -- fbout<->framebuffer - int isBeat; + int isBeat; - int mode; - int inblendval; - int outblendval; - int bufferin; - int bufferout; - int ininvert; - int outinvert; - int beat_render; - int beat_render_frames; - int use_inblendval; + int mode; + int inblendval; + int outblendval; + int bufferin; + int bufferout; + int ininvert; + int outinvert; + int beat_render; + int beat_render_frames; + int use_inblendval; - LVAVSPipelineContainer *container; + LVAVSPipelineContainer *container; }; -// For removal. I don't see any reason to separatet these fields from the VisPipeline. Maybe there's a reason to exhcange RenderStates between pipelines? Leaving this here for now. +// For removal. I don't see any reason to separatet these fields from the +// VisPipeline. Maybe there's a reason to exhcange RenderStates between +// pipelines? Leaving this here for now. struct _LVAVSPipelineRenderState { - VisObject object; + VisObject object; - int enabled; + int enabled; - unsigned char blendadjust; + unsigned char blendadjust; - LVAVSPipelineRenderStateBlendMode blendmode; + LVAVSPipelineRenderStateBlendMode blendmode; - int linewidth; + int linewidth; }; struct _LVAVSPipelineElement { - VisObject object; + VisObject object; - LVAVSPipelineElementType type; + LVAVSPipelineElementType type; - LVAVSPipeline *pipeline; + LVAVSPipeline *pipeline; - VisParamContainer *params; + VisParamContainer *params; - union { - VisActor *actor; - VisMorph *morph; - VisTransform *transform; - LVAVSPipelineRenderState *renderstate; - LVAVSPipelineContainer *container; - } data; + union { + VisActor *actor; + VisMorph *morph; + VisTransform *transform; + LVAVSPipelineRenderState *renderstate; + LVAVSPipelineContainer *container; + } data; }; struct _LVAVSPipelineContainer { - LVAVSPipelineElement element; + LVAVSPipelineElement element; - VisList *members; + VisList *members; }; - /* Prototypes */ -LVAVSPipeline *lvavs_pipeline_new (void); -LVAVSPipelineElement *lvavs_pipeline_element_new (LVAVSPipelineElementType type); -LVAVSPipelineContainer *lvavs_pipeline_container_new (void); - -LVAVSPipeline *lvavs_pipeline_new_from_preset (LVAVSPreset *preset); -int lvavs_pipeline_realize (LVAVSPipeline *pipeline); -int lvavs_pipeline_negotiate (LVAVSPipeline *pipeline, VisVideo *video); -int lvavs_pipeline_propagate_event (LVAVSPipeline *pipeline, VisEvent *event); -int lvavs_pipeline_run (LVAVSPipeline *pipeline, VisVideo *video, VisAudio *audio); +LVAVSPipeline *lvavs_pipeline_new(void); +LVAVSPipelineElement *lvavs_pipeline_element_new(LVAVSPipelineElementType type); +LVAVSPipelineContainer *lvavs_pipeline_container_new(void); + +LVAVSPipeline *lvavs_pipeline_new_from_preset(LVAVSPreset *preset); +int lvavs_pipeline_realize(LVAVSPipeline *pipeline); +int lvavs_pipeline_negotiate(LVAVSPipeline *pipeline, VisVideo *video); +int lvavs_pipeline_propagate_event(LVAVSPipeline *pipeline, VisEvent *event); +int lvavs_pipeline_run(LVAVSPipeline *pipeline, VisVideo *video, + VisAudio *audio); #ifdef __cplusplus } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_preset.c b/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_preset.c index 7cb6eed2b..8ea0c82e1 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_preset.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_preset.c @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -27,146 +27,142 @@ #include #include #include -//#include -//#include +// #include +// #include #include #include "lvavs_preset.h" static const char *id_to_name_map[] = { - [AVS_ELEMENT_TYPE_RENDER_SIMPLESPECTRUM] = "avs_superscope", - [AVS_ELEMENT_TYPE_RENDER_DOTPLANE] = "avs_dotplane", - [AVS_ELEMENT_TYPE_RENDER_OSCSTARS] = "avs_stars", - [AVS_ELEMENT_TYPE_TRANS_FADEOUT] = "avs_fadeout", - [AVS_ELEMENT_TYPE_TRANS_BLITTERFB] = "avs_blitterfb", - [AVS_ELEMENT_TYPE_TRANS_NFRAMECLEAR] = "avs_nframeclear", - [AVS_ELEMENT_TYPE_TRANS_BLUR] = "avs_blur", - [AVS_ELEMENT_TYPE_RENDER_BASSSPIN] = "avs_bassspin", - [AVS_ELEMENT_TYPE_RENDER_PARTICLE] = "avs_particle", - [AVS_ELEMENT_TYPE_RENDER_ROTBLIT] = "avs_rotblitter", - [AVS_ELEMENT_TYPE_RENDER_SVP] = "error", - [AVS_ELEMENT_TYPE_TRANS_COLORFADE] = "avs_colorfade", - [AVS_ELEMENT_TYPE_TRANS_CONTRASTENHANCE] = "avs_contrastenhance", - [AVS_ELEMENT_TYPE_RENDER_ROTSTAR] = "avs_rotstar", - [AVS_ELEMENT_TYPE_RENDER_RING] = "avs_ring", - [AVS_ELEMENT_TYPE_TRANS_MOVEMENT] = "avs_movement", - [AVS_ELEMENT_TYPE_TRANS_SCATTER] = "avs_scatter", - [AVS_ELEMENT_TYPE_RENDER_DOTGRID] = "avs_dotgrid", - [AVS_ELEMENT_TYPE_MISC_STACK] = "error", - [AVS_ELEMENT_TYPE_RENDER_DOTFOUNTAIN] = "avs_dotfountain", - [AVS_ELEMENT_TYPE_TRANS_WATER] = "avs_water", - [AVS_ELEMENT_TYPE_MISC_COMMENT] = "error", - [AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS] = "avs_brightness", - [AVS_ELEMENT_TYPE_TRANS_INTERLEAVE] = "avs_interleave", - [AVS_ELEMENT_TYPE_TRANS_GRAIN] = "avs_grain", - [AVS_ELEMENT_TYPE_RENDER_CLEARSCREEN] = "avs_clearscreen", - [AVS_ELEMENT_TYPE_TRANS_MIRROR] = "avs_mirror", - [AVS_ELEMENT_TYPE_RENDER_STARFIELD] = "avs_starfield", - [AVS_ELEMENT_TYPE_RENDER_TEXT] = "avs_text", - [AVS_ELEMENT_TYPE_TRANS_BUMPMAP] = "avs_bumpmap", - [AVS_ELEMENT_TYPE_TRANS_MOSAIC] = "avs_mosaic", - [AVS_ELEMENT_TYPE_TRANS_WATERBUMP] = "avs_waterbump", - [AVS_ELEMENT_TYPE_RENDER_AVI] = "avs_avi", - [AVS_ELEMENT_TYPE_MISC_BPM] = "error", - [AVS_ELEMENT_TYPE_RENDER_PICTURE] = "avs_picture", - [AVS_ELEMENT_TYPE_UNKNOWN_DDM] = "error", - [AVS_ELEMENT_TYPE_RENDER_SUPERSCOPE] = "avs_superscope", - [AVS_ELEMENT_TYPE_TRANS_INVERT] = "avs_invert", - [AVS_ELEMENT_TYPE_TRANS_ONETONE] = "avs_onetone", - [AVS_ELEMENT_TYPE_RENDER_TIMESCOPE] = "avs_timescope", - [AVS_ELEMENT_TYPE_MISC_RENDERSTATE] = "error", - [AVS_ELEMENT_TYPE_TRANS_INTERFERENCES] = "avs_interferences", - [AVS_ELEMENT_TYPE_TRANS_CHANNELSHIFT] = "avs_channelshift", - [AVS_ELEMENT_TYPE_TRANS_DMOVE] = "avs_dmovement", - [AVS_ELEMENT_TYPE_TRANS_FASTBRIGHT] = "avs_fastbright", - [AVS_ELEMENT_TYPE_UNKNOWN_DCOLORMODE] = "error", - - [AVS_ELEMENT_TYPE_MAIN] = "error", - [AVS_ELEMENT_TYPE_APE] = "error", - [AVS_ELEMENT_TYPE_TRANS_MULTIPLIER] = "avs_multiplier", - NULL -}; + [AVS_ELEMENT_TYPE_RENDER_SIMPLESPECTRUM] = "avs_superscope", + [AVS_ELEMENT_TYPE_RENDER_DOTPLANE] = "avs_dotplane", + [AVS_ELEMENT_TYPE_RENDER_OSCSTARS] = "avs_stars", + [AVS_ELEMENT_TYPE_TRANS_FADEOUT] = "avs_fadeout", + [AVS_ELEMENT_TYPE_TRANS_BLITTERFB] = "avs_blitterfb", + [AVS_ELEMENT_TYPE_TRANS_NFRAMECLEAR] = "avs_nframeclear", + [AVS_ELEMENT_TYPE_TRANS_BLUR] = "avs_blur", + [AVS_ELEMENT_TYPE_RENDER_BASSSPIN] = "avs_bassspin", + [AVS_ELEMENT_TYPE_RENDER_PARTICLE] = "avs_particle", + [AVS_ELEMENT_TYPE_RENDER_ROTBLIT] = "avs_rotblitter", + [AVS_ELEMENT_TYPE_RENDER_SVP] = "error", + [AVS_ELEMENT_TYPE_TRANS_COLORFADE] = "avs_colorfade", + [AVS_ELEMENT_TYPE_TRANS_CONTRASTENHANCE] = "avs_contrastenhance", + [AVS_ELEMENT_TYPE_RENDER_ROTSTAR] = "avs_rotstar", + [AVS_ELEMENT_TYPE_RENDER_RING] = "avs_ring", + [AVS_ELEMENT_TYPE_TRANS_MOVEMENT] = "avs_movement", + [AVS_ELEMENT_TYPE_TRANS_SCATTER] = "avs_scatter", + [AVS_ELEMENT_TYPE_RENDER_DOTGRID] = "avs_dotgrid", + [AVS_ELEMENT_TYPE_MISC_STACK] = "error", + [AVS_ELEMENT_TYPE_RENDER_DOTFOUNTAIN] = "avs_dotfountain", + [AVS_ELEMENT_TYPE_TRANS_WATER] = "avs_water", + [AVS_ELEMENT_TYPE_MISC_COMMENT] = "error", + [AVS_ELEMENT_TYPE_TRANS_BRIGHTNESS] = "avs_brightness", + [AVS_ELEMENT_TYPE_TRANS_INTERLEAVE] = "avs_interleave", + [AVS_ELEMENT_TYPE_TRANS_GRAIN] = "avs_grain", + [AVS_ELEMENT_TYPE_RENDER_CLEARSCREEN] = "avs_clearscreen", + [AVS_ELEMENT_TYPE_TRANS_MIRROR] = "avs_mirror", + [AVS_ELEMENT_TYPE_RENDER_STARFIELD] = "avs_starfield", + [AVS_ELEMENT_TYPE_RENDER_TEXT] = "avs_text", + [AVS_ELEMENT_TYPE_TRANS_BUMPMAP] = "avs_bumpmap", + [AVS_ELEMENT_TYPE_TRANS_MOSAIC] = "avs_mosaic", + [AVS_ELEMENT_TYPE_TRANS_WATERBUMP] = "avs_waterbump", + [AVS_ELEMENT_TYPE_RENDER_AVI] = "avs_avi", + [AVS_ELEMENT_TYPE_MISC_BPM] = "error", + [AVS_ELEMENT_TYPE_RENDER_PICTURE] = "avs_picture", + [AVS_ELEMENT_TYPE_UNKNOWN_DDM] = "error", + [AVS_ELEMENT_TYPE_RENDER_SUPERSCOPE] = "avs_superscope", + [AVS_ELEMENT_TYPE_TRANS_INVERT] = "avs_invert", + [AVS_ELEMENT_TYPE_TRANS_ONETONE] = "avs_onetone", + [AVS_ELEMENT_TYPE_RENDER_TIMESCOPE] = "avs_timescope", + [AVS_ELEMENT_TYPE_MISC_RENDERSTATE] = "error", + [AVS_ELEMENT_TYPE_TRANS_INTERFERENCES] = "avs_interferences", + [AVS_ELEMENT_TYPE_TRANS_CHANNELSHIFT] = "avs_channelshift", + [AVS_ELEMENT_TYPE_TRANS_DMOVE] = "avs_dmovement", + [AVS_ELEMENT_TYPE_TRANS_FASTBRIGHT] = "avs_fastbright", + [AVS_ELEMENT_TYPE_UNKNOWN_DCOLORMODE] = "error", + + [AVS_ELEMENT_TYPE_MAIN] = "error", + [AVS_ELEMENT_TYPE_APE] = "error", + [AVS_ELEMENT_TYPE_TRANS_MULTIPLIER] = "avs_multiplier", + NULL}; static VisParamEntry container_params[] = { - VISUAL_PARAM_LIST_ENTRY_INTEGER("clearscreen", 1), - VISUAL_PARAM_LIST_END -}; + VISUAL_PARAM_LIST_ENTRY_INTEGER("clearscreen", 1), VISUAL_PARAM_LIST_END}; /* Prototypes */ -static int lvavs_preset_dtor (VisObject *object); -static int lvavs_preset_element_dtor (VisObject *object); -static int lvavs_preset_container_dtor (VisObject *object); +static int lvavs_preset_dtor(VisObject *object); +static int lvavs_preset_element_dtor(VisObject *object); +static int lvavs_preset_container_dtor(VisObject *object); -//LVAVSPresetContainer *lvavs_preset_container_from_xml_node(LVAVSPresetContainer *cont, xmlNodePtr node); +// LVAVSPresetContainer +// *lvavs_preset_container_from_xml_node(LVAVSPresetContainer *cont, xmlNodePtr +// node); -/*static int preset_convert_from_wavs (LVAVSPresetContainer *presetcont, AVSContainer *cont); +/*static int preset_convert_from_wavs (LVAVSPresetContainer *presetcont, +AVSContainer *cont); LVAVSPresetElement *wavs_convert_main_new (AVSElement *avselem); LVAVSPresetElement *wavs_convert_ring_new (AVSElement *avselem); LVAVSPresetElement *wavs_convert_channelshift_new (AVSElement *avselem); -LVAVSPresetElement *wavs_convert_remap (AVSElement *avselem, const char *plugname); +LVAVSPresetElement *wavs_convert_remap (AVSElement *avselem, const char +*plugname); */ /* Object destructors */ -static int lvavs_preset_dtor (VisObject *object) -{ - LVAVSPreset *preset = LVAVS_PRESET (object); +static int lvavs_preset_dtor(VisObject *object) { + LVAVSPreset *preset = LVAVS_PRESET(object); - if (preset->origfile != NULL) - visual_mem_free (preset->origfile); + if (preset->origfile != NULL) + visual_mem_free(preset->origfile); - if (preset->main != NULL) - visual_object_unref (VISUAL_OBJECT (preset->main)); + if (preset->main != NULL) + visual_object_unref(VISUAL_OBJECT(preset->main)); - preset->origfile = NULL; - preset->main = NULL; + preset->origfile = NULL; + preset->main = NULL; - return TRUE; + return TRUE; } -static int lvavs_preset_element_dtor (VisObject *object) -{ - LVAVSPresetElement *element = LVAVS_PRESET_ELEMENT (object); +static int lvavs_preset_element_dtor(VisObject *object) { + LVAVSPresetElement *element = LVAVS_PRESET_ELEMENT(object); - if (element->pcont != NULL) - visual_object_unref (VISUAL_OBJECT (element->pcont)); + if (element->pcont != NULL) + visual_object_unref(VISUAL_OBJECT(element->pcont)); - if (element->element_name != NULL) - visual_mem_free((void *)element->element_name); + if (element->element_name != NULL) + visual_mem_free((void *)element->element_name); - element->pcont = NULL; + element->pcont = NULL; - return TRUE; + return TRUE; } -static int lvavs_preset_container_dtor (VisObject *object) -{ - LVAVSPresetContainer *container = LVAVS_PRESET_CONTAINER (object); +static int lvavs_preset_container_dtor(VisObject *object) { + LVAVSPresetContainer *container = LVAVS_PRESET_CONTAINER(object); - if (container->members != NULL) - visual_object_unref (VISUAL_OBJECT (container->members)); + if (container->members != NULL) + visual_object_unref(VISUAL_OBJECT(container->members)); - container->members = NULL; + container->members = NULL; - lvavs_preset_element_dtor (object); + lvavs_preset_element_dtor(object); - return TRUE; + return TRUE; } - /* LVAVS Preset */ -LVAVSPreset *lvavs_preset_new () -{ - LVAVSPreset *preset; +LVAVSPreset *lvavs_preset_new() { + LVAVSPreset *preset; - preset = visual_mem_new0 (LVAVSPreset, 1); + preset = visual_mem_new0(LVAVSPreset, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (preset), TRUE, lvavs_preset_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(preset), TRUE, lvavs_preset_dtor); - return preset; + return preset; } /* cur->name should be the element name */ @@ -180,54 +176,51 @@ static int parse_element (xmlNodePtr cur, LVAVSPresetElement *element) for (cur = cur->xmlChildrenNode; cur; cur = cur->next) { if (xmlIsBlankNode (cur) || cur->type != XML_ELEMENT_NODE) - continue; - - LVAVSPresetElementType type; - xmlChar *prop = xmlGetProp(cur, (xmlChar *)"type"); - content = (char*)xmlNodeGetContent (cur); - - param = visual_param_entry_new((char *)cur->name); - - if(strcmp((char *)prop, "string") == 0) { - visual_param_entry_set_string(param, content); - } else if( strcmp((char *)prop, "float") == 0) { - visual_param_entry_set_double(param, strtod(content, NULL)); - } else if( strcmp((char *)prop, "integer") == 0) { - visual_param_entry_set_integer(param, (int)strtol(content, NULL, 0)); - } else if( strcmp((char *)prop, "color") == 0) { - int r,g,b; - char *s = content+1; - r = strtoul (s, &s, 0); - if (r > 255 || ! (s = strchr (s, ','))) - continue; - g = strtoul (s+1, &s, 0); - if (g > 255 || ! (s = strchr (s, ','))) - continue; - b = strtoul (s+1, NULL, 0); - if (b > 255) - continue; - visual_param_entry_set_color(param, r, g, b); - } else if( strcmp((char *)prop, "bool") == 0) { - char *c, *d; - int val; + continue; + + LVAVSPresetElementType type; + xmlChar *prop = xmlGetProp(cur, (xmlChar *)"type"); + content = (char*)xmlNodeGetContent (cur); + + param = visual_param_entry_new((char *)cur->name); + + if(strcmp((char *)prop, "string") == 0) { + visual_param_entry_set_string(param, content); + } else if( strcmp((char *)prop, "float") == 0) { + visual_param_entry_set_double(param, strtod(content, NULL)); + } else if( strcmp((char *)prop, "integer") == 0) { + visual_param_entry_set_integer(param, (int)strtol(content, NULL, +0)); } else if( strcmp((char *)prop, "color") == 0) { int r,g,b; char *s = +content+1; r = strtoul (s, &s, 0); if (r > 255 || ! (s = strchr (s, ','))) + continue; + g = strtoul (s+1, &s, 0); + if (g > 255 || ! (s = strchr (s, ','))) + continue; + b = strtoul (s+1, NULL, 0); + if (b > 255) + continue; + visual_param_entry_set_color(param, r, g, b); + } else if( strcmp((char *)prop, "bool") == 0) { + char *c, *d; + int val; #define isspace(c) (c == ' ' || c == '\t' || c == '\n') - for (c=content; isspace (*c); c++); - for (d=c; !isspace(*d); d++); - *d = '\0'; - if (g_strcasecmp (c, "true") == 0) - val = TRUE; - else if (g_strcasecmp (c, "false") == 0) - val = FALSE; - else - continue; - visual_param_entry_set_integer(param, val); - } - - visual_param_container_add(element->pcont, param); - - xmlFree ((xmlChar*)content); + for (c=content; isspace (*c); c++); + for (d=c; !isspace(*d); d++); + *d = '\0'; + if (g_strcasecmp (c, "true") == 0) + val = TRUE; + else if (g_strcasecmp (c, "false") == 0) + val = FALSE; + else + continue; + visual_param_entry_set_integer(param, val); + } + + visual_param_container_add(element->pcont, param); + + xmlFree ((xmlChar*)content); } return TRUE; } @@ -236,227 +229,232 @@ static int parse_element (xmlNodePtr cur, LVAVSPresetElement *element) /* LVAVSPreset *lvavs_preset_new_from_preset (char *filename) { - LVAVSPreset *preset = NULL; - LVAVSPresetElement *element; - LVAVSPresetContainer *cont; - xmlDocPtr doc; - xmlNodePtr cur; - int i; - - doc = xmlParseFile(filename); - if(doc == NULL) { - return NULL; - } - cur = xmlDocGetRootElement (doc); - if(!cur) { - xmlFreeDoc(doc); - fprintf(stderr, "No root element\n"); - return NULL; - } - - if(xmlStrcmp(cur->name, (const xmlChar *) "pipeline_preset") != 0) - { - xmlFreeDoc(doc); - fprintf(stderr, "Bad opening node in preset file %s. Looking for 'pipeline_preset' but got '%s'.", filename, cur->name); - return NULL; - } - - preset = lvavs_preset_new (); - preset->main = lvavs_preset_container_new(); + LVAVSPreset *preset = NULL; + LVAVSPresetElement *element; + LVAVSPresetContainer *cont; + xmlDocPtr doc; + xmlNodePtr cur; + int i; + + doc = xmlParseFile(filename); + if(doc == NULL) { + return NULL; + } + cur = xmlDocGetRootElement (doc); + if(!cur) { + xmlFreeDoc(doc); + fprintf(stderr, "No root element\n"); + return NULL; + } + + if(xmlStrcmp(cur->name, (const xmlChar *) "pipeline_preset") != 0) + { + xmlFreeDoc(doc); + fprintf(stderr, "Bad opening node in preset file %s. Looking for +'pipeline_preset' but got '%s'.", filename, cur->name); return NULL; + } + + preset = lvavs_preset_new (); + preset->main = lvavs_preset_container_new(); VisParamContainer *pcont = visual_param_container_new(); - visual_param_container_add_many(pcont, container_params); - LVAVS_PRESET_ELEMENT(preset->main)->pcont = pcont; - - for (cur = cur->children; cur; cur = cur->next) - { - if(xmlStrcmp(cur->name, (const xmlChar *)"container_main") == 0) - { - xmlNodePtr child; - LVAVSPresetContainer *cont = lvavs_preset_container_new(); - LVAVS_PRESET_ELEMENT(cont)->pcont = pcont; - visual_list_add(preset->main->members, cont); - cont = lvavs_preset_container_from_xml_node(cont, cur); - } - if(xmlStrcmp(cur->name, (const xmlChar *)"params") == 0) - { - parse_element(cur, LVAVS_PRESET_ELEMENT(preset->main)); - } - } - xmlFreeDoc (doc); + visual_param_container_add_many(pcont, container_params); + LVAVS_PRESET_ELEMENT(preset->main)->pcont = pcont; + + for (cur = cur->children; cur; cur = cur->next) + { + if(xmlStrcmp(cur->name, (const xmlChar *)"container_main") == 0) + { + xmlNodePtr child; + LVAVSPresetContainer *cont = +lvavs_preset_container_new(); LVAVS_PRESET_ELEMENT(cont)->pcont = pcont; + visual_list_add(preset->main->members, cont); + cont = lvavs_preset_container_from_xml_node(cont, cur); + } + if(xmlStrcmp(cur->name, (const xmlChar *)"params") == 0) + { + parse_element(cur, LVAVS_PRESET_ELEMENT(preset->main)); + } + } + xmlFreeDoc (doc); return preset; } */ /* -LVAVSPresetContainer *lvavs_preset_container_from_xml_node(LVAVSPresetContainer *cont, xmlNodePtr node) { - xmlNodePtr child; - LVAVSPresetElement *element; - int i; - for(child = node->children; child; child = child->next) - { - if (xmlIsBlankNode (child) || child->type != XML_ELEMENT_NODE) - continue; - if(xmlStrcmp(child->name, (xmlChar *)"container_child") == 0) { - LVAVSPresetContainer *cont2 = lvavs_preset_container_new(); - VisParamContainer *pcont = visual_param_container_new(); - LVAVS_PRESET_ELEMENT(cont2)->pcont = pcont; - visual_param_container_add_many(pcont, container_params); - visual_list_add(cont->members, cont2); - lvavs_preset_container_from_xml_node(cont2, child); - } - for(i = 0; id_to_name_map[i] != NULL; i++) - if (xmlStrcmp (child->name, - (const xmlChar *) id_to_name_map[i]) == 0) - break; - if(id_to_name_map[i] == NULL) - continue; - - element = lvavs_preset_element_new(LVAVS_PRESET_ELEMENT_TYPE_PLUGIN, (char*)child->name); - if(parse_element(child, element)) - visual_list_add(cont->members, element); - } - return cont; +LVAVSPresetContainer *lvavs_preset_container_from_xml_node(LVAVSPresetContainer +*cont, xmlNodePtr node) { xmlNodePtr child; LVAVSPresetElement *element; int i; + for(child = node->children; child; child = child->next) + { + if (xmlIsBlankNode (child) || child->type != XML_ELEMENT_NODE) + continue; + if(xmlStrcmp(child->name, (xmlChar *)"container_child") == 0) { + LVAVSPresetContainer *cont2 = +lvavs_preset_container_new(); VisParamContainer *pcont = +visual_param_container_new(); LVAVS_PRESET_ELEMENT(cont2)->pcont = pcont; + visual_param_container_add_many(pcont, +container_params); visual_list_add(cont->members, cont2); + lvavs_preset_container_from_xml_node(cont2, child); + } + for(i = 0; id_to_name_map[i] != NULL; i++) + if (xmlStrcmp (child->name, + (const xmlChar *) id_to_name_map[i]) == 0) + break; + if(id_to_name_map[i] == NULL) + continue; + + element = +lvavs_preset_element_new(LVAVS_PRESET_ELEMENT_TYPE_PLUGIN, (char*)child->name); + if(parse_element(child, element)) + visual_list_add(cont->members, element); + } + return cont; } */ -LVAVSPresetElement *lvavs_preset_element_new (LVAVSPresetElementType type, const char *name) -{ - LVAVSPresetElement *element; +LVAVSPresetElement *lvavs_preset_element_new(LVAVSPresetElementType type, + const char *name) { + LVAVSPresetElement *element; - element = visual_mem_new0 (LVAVSPresetElement, 1); + element = visual_mem_new0(LVAVSPresetElement, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (element), TRUE, lvavs_preset_element_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(element), TRUE, + lvavs_preset_element_dtor); - element->type = type; - element->element_name = strdup(name); - element->pcont = visual_param_container_new(); + element->type = type; + element->element_name = strdup(name); + element->pcont = visual_param_container_new(); - return element; + return element; } -LVAVSPresetContainer *lvavs_preset_container_new () -{ - LVAVSPresetContainer *container; - LVAVSPresetElement *el; +LVAVSPresetContainer *lvavs_preset_container_new() { + LVAVSPresetContainer *container; + LVAVSPresetElement *el; - container = visual_mem_new0 (LVAVSPresetContainer, 1); + container = visual_mem_new0(LVAVSPresetContainer, 1); - /* Do the VisObject initialization */ - visual_object_initialize (VISUAL_OBJECT (container), TRUE, lvavs_preset_container_dtor); + /* Do the VisObject initialization */ + visual_object_initialize(VISUAL_OBJECT(container), TRUE, + lvavs_preset_container_dtor); - container->members = visual_list_new (visual_object_collection_destroyer); - container->element.element_name = strdup("new container"); - container->element.type = LVAVS_PRESET_ELEMENT_TYPE_CONTAINER; + container->members = visual_list_new(visual_object_collection_destroyer); + container->element.element_name = strdup("new container"); + container->element.type = LVAVS_PRESET_ELEMENT_TYPE_CONTAINER; - return container; + return container; } - /* Internal functions */ /* -static int preset_convert_from_wavs (LVAVSPresetContainer *presetcont, AVSContainer *cont) +static int preset_convert_from_wavs (LVAVSPresetContainer *presetcont, +AVSContainer *cont) { - AVSElement *avselem; - VisListEntry *le = NULL; + AVSElement *avselem; + VisListEntry *le = NULL; - while ((avselem = visual_list_next (cont->members, &le)) != NULL) { + while ((avselem = visual_list_next (cont->members, &le)) != NULL) { - switch (avselem->type) { - case AVS_ELEMENT_TYPE_MAIN: - visual_list_add (presetcont->members, wavs_convert_main_new (avselem)); + switch (avselem->type) { + case AVS_ELEMENT_TYPE_MAIN: + visual_list_add (presetcont->members, +wavs_convert_main_new (avselem)); - break; + break; - case AVS_ELEMENT_TYPE_RENDER_RING: - visual_list_add (presetcont->members, wavs_convert_ring_new (avselem)); + case AVS_ELEMENT_TYPE_RENDER_RING: + visual_list_add (presetcont->members, +wavs_convert_ring_new (avselem)); - break; + break; - case AVS_ELEMENT_TYPE_TRANS_CHANNELSHIFT: - visual_list_add (presetcont->members, wavs_convert_channelshift_new (avselem)); + case AVS_ELEMENT_TYPE_TRANS_CHANNELSHIFT: + visual_list_add (presetcont->members, +wavs_convert_channelshift_new (avselem)); - break; + break; - default: - if (avselem->type >= AVS_ELEMENT_TYPE_RENDER_SIMPLESPECTRUM && - avselem->type < AVS_ELEMENT_TYPE_LAST) { + default: + if (avselem->type >= +AVS_ELEMENT_TYPE_RENDER_SIMPLESPECTRUM && avselem->type < AVS_ELEMENT_TYPE_LAST) +{ - visual_list_add (presetcont->members, wavs_convert_remap (avselem, - id_to_name_map[avselem->type])); + visual_list_add (presetcont->members, +wavs_convert_remap (avselem, id_to_name_map[avselem->type])); - } + } - break; - } - } + break; + } + } - return VISUAL_OK; + return VISUAL_OK; } */ /* LVAVSPresetElement *wavs_convert_main_new (AVSElement *avselem) { - LVAVSPresetContainer *container; - VisParamContainer *pcont; - VisParamContainer *pcontw; + LVAVSPresetContainer *container; + VisParamContainer *pcont; + VisParamContainer *pcontw; - static VisParamEntry params[] = { - VISUAL_PARAM_LIST_ENTRY ("clearscreen"), - VISUAL_PARAM_LIST_END - }; + static VisParamEntry params[] = { + VISUAL_PARAM_LIST_ENTRY ("clearscreen"), + VISUAL_PARAM_LIST_END + }; - pcont = visual_param_container_new (); - visual_param_container_add_many (pcont, params); + pcont = visual_param_container_new (); + visual_param_container_add_many (pcont, params); - pcontw = avselem->pcont; + pcontw = avselem->pcont; - // Copy all the matching - visual_param_container_copy_match (pcont, pcontw); + // Copy all the matching + visual_param_container_copy_match (pcont, pcontw); - container = lvavs_preset_container_new (); - LVAVS_PRESET_ELEMENT (container)->pcont = pcont; + container = lvavs_preset_container_new (); + LVAVS_PRESET_ELEMENT (container)->pcont = pcont; - return LVAVS_PRESET_ELEMENT (container); + return LVAVS_PRESET_ELEMENT (container); } */ /* LVAVSPresetElement *wavs_convert_ring_new (AVSElement *avselem) { - LVAVSPresetElement *element; - VisParamContainer *pcont; - VisParamContainer *pcontw; - int sourceplace; + LVAVSPresetElement *element; + VisParamContainer *pcont; + VisParamContainer *pcontw; + int sourceplace; - static VisParamEntry params[] = { - VISUAL_PARAM_LIST_ENTRY ("source"), - VISUAL_PARAM_LIST_ENTRY ("place"), - VISUAL_PARAM_LIST_ENTRY ("palette"), - VISUAL_PARAM_LIST_ENTRY ("size"), - VISUAL_PARAM_LIST_ENTRY ("type"), - VISUAL_PARAM_LIST_END - }; + static VisParamEntry params[] = { + VISUAL_PARAM_LIST_ENTRY ("source"), + VISUAL_PARAM_LIST_ENTRY ("place"), + VISUAL_PARAM_LIST_ENTRY ("palette"), + VISUAL_PARAM_LIST_ENTRY ("size"), + VISUAL_PARAM_LIST_ENTRY ("type"), + VISUAL_PARAM_LIST_END + }; - pcont = visual_param_container_new (); - visual_param_container_add_many (pcont, params); + pcont = visual_param_container_new (); + visual_param_container_add_many (pcont, params); - pcontw = avselem->pcont; + pcontw = avselem->pcont; - // Copy all the matching - visual_param_container_copy_match (pcont, pcontw); + // Copy all the matching + visual_param_container_copy_match (pcont, pcontw); - sourceplace = visual_param_entry_get_integer (visual_param_container_get (pcontw, "source and place")); + sourceplace = visual_param_entry_get_integer (visual_param_container_get +(pcontw, "source and place")); - visual_param_entry_set_integer (visual_param_container_get (pcont, "place"), sourceplace >> 4); - visual_param_entry_set_integer (visual_param_container_get (pcont, "source"), (sourceplace & 0x0f) / 4); + visual_param_entry_set_integer (visual_param_container_get (pcont, +"place"), sourceplace >> 4); visual_param_entry_set_integer +(visual_param_container_get (pcont, "source"), (sourceplace & 0x0f) / 4); - element = lvavs_preset_element_new (LVAVS_PRESET_ELEMENT_TYPE_PLUGIN, "avs_ring"); - element->pcont = pcont; + element = lvavs_preset_element_new (LVAVS_PRESET_ELEMENT_TYPE_PLUGIN, +"avs_ring"); element->pcont = pcont; - return element; + return element; } */ - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_preset.h b/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_preset.h index 6d985d80e..19d9df610 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_preset.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/common/lvavs_preset.h @@ -1,5 +1,5 @@ /* Libvisual-AVS - Advanced visual studio for libvisual - * + * * Copyright (C) 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -32,57 +32,58 @@ extern "C" { #endif /* __cplusplus */ -#define LVAVS_PRESET(obj) (VISUAL_CHECK_CAST ((obj), LVAVSPreset)) -#define LVAVS_PRESET_ELEMENT(obj) (VISUAL_CHECK_CAST ((obj), LVAVSPresetElement)) -#define LVAVS_PRESET_CONTAINER(obj) (VISUAL_CHECK_CAST ((obj), LVAVSPresetContainer)) +#define LVAVS_PRESET(obj) (VISUAL_CHECK_CAST((obj), LVAVSPreset)) +#define LVAVS_PRESET_ELEMENT(obj) (VISUAL_CHECK_CAST((obj), LVAVSPresetElement)) +#define LVAVS_PRESET_CONTAINER(obj) \ + (VISUAL_CHECK_CAST((obj), LVAVSPresetContainer)) typedef struct _LVAVSPreset LVAVSPreset; typedef struct _LVAVSPresetElement LVAVSPresetElement; typedef struct _LVAVSPresetContainer LVAVSPresetContainer; typedef enum { - LVAVS_PRESET_ELEMENT_TYPE_NULL, - LVAVS_PRESET_ELEMENT_TYPE_PLUGIN, - LVAVS_PRESET_ELEMENT_TYPE_CONTAINER, - LVAVS_PRESET_ELEMENT_TYPE_RENDERSTATE, - LVAVS_PRESET_ELEMENT_TYPE_COMMENT, - LVAVS_PRESET_ELEMENT_TYPE_STACK, - LVAVS_PRESET_ELEMENT_TYPE_BPM + LVAVS_PRESET_ELEMENT_TYPE_NULL, + LVAVS_PRESET_ELEMENT_TYPE_PLUGIN, + LVAVS_PRESET_ELEMENT_TYPE_CONTAINER, + LVAVS_PRESET_ELEMENT_TYPE_RENDERSTATE, + LVAVS_PRESET_ELEMENT_TYPE_COMMENT, + LVAVS_PRESET_ELEMENT_TYPE_STACK, + LVAVS_PRESET_ELEMENT_TYPE_BPM } LVAVSPresetElementType; /* The AVS data structure */ struct _LVAVSPreset { - VisObject object; + VisObject object; - char *origfile; + char *origfile; - LVAVSPresetContainer *main; + LVAVSPresetContainer *main; }; struct _LVAVSPresetElement { - VisObject object; + VisObject object; - LVAVSPresetElementType type; + LVAVSPresetElementType type; - char *element_name; + char *element_name; - VisParamContainer *pcont; + VisParamContainer *pcont; }; struct _LVAVSPresetContainer { - LVAVSPresetElement element; + LVAVSPresetElement element; - VisList *members; + VisList *members; }; - /* Prototypes */ -LVAVSPreset *lvavs_preset_new (void); -LVAVSPreset *lvavs_preset_new_from_preset (char *filename); -LVAVSPreset *lvavs_preset_new_from_wavs (AVSTree *wavs); +LVAVSPreset *lvavs_preset_new(void); +LVAVSPreset *lvavs_preset_new_from_preset(char *filename); +LVAVSPreset *lvavs_preset_new_from_wavs(AVSTree *wavs); -LVAVSPresetElement *lvavs_preset_element_new (LVAVSPresetElementType type, const char *name); -LVAVSPresetContainer *lvavs_preset_container_new (void); +LVAVSPresetElement *lvavs_preset_element_new(LVAVSPresetElementType type, + const char *name); +LVAVSPresetContainer *lvavs_preset_container_new(void); #ifdef __cplusplus } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/debug.c b/libvisual-plugins/plugins/actor/lcdcontrol/debug.c index f40fe24a5..33555a992 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/debug.c +++ b/libvisual-plugins/plugins/actor/lcdcontrol/debug.c @@ -21,7 +21,7 @@ * along with LCDControl. If not, see . */ -/* +/* * exported functions: * * message (level, format, ...) @@ -33,7 +33,7 @@ * */ -//#include "config.h" +// #include "config.h" #include #include @@ -47,44 +47,43 @@ int running_background = 0; int verbose_level = 0; -void message(const int level, const char *format, ...) -{ - va_list ap; - char buffer[256]; - static int log_open = 0; +void message(const int level, const char *format, ...) { + va_list ap; + char buffer[256]; + static int log_open = 0; - if (level > verbose_level) - return; + if (level > verbose_level) + return; - va_start(ap, format); - vsnprintf(buffer, sizeof(buffer), format, ap); - va_end(ap); + va_start(ap, format); + vsnprintf(buffer, sizeof(buffer), format, ap); + va_end(ap); - if (!running_background) { + if (!running_background) { #ifdef WITH_CURSES - extern int curses_Error(char *); - if (!curses_error(buffer)) + extern int curses_Error(char *); + if (!curses_error(buffer)) #endif - fprintf(level ? stdout : stderr, "%s\n", buffer); - } + fprintf(level ? stdout : stderr, "%s\n", buffer); + } - if (running_foreground) - return; + if (running_foreground) + return; - if (!log_open) { - openlog("LCDControl", LOG_PID, LOG_USER); - log_open = 1; - } + if (!log_open) { + openlog("LCDControl", LOG_PID, LOG_USER); + log_open = 1; + } - switch (level) { - case 0: - syslog(LOG_ERR, "%s", buffer); - break; - case 1: - syslog(LOG_INFO, "%s", buffer); - break; - default: - syslog(LOG_DEBUG, "%s", buffer); - } + switch (level) { + case 0: + syslog(LOG_ERR, "%s", buffer); + break; + case 1: + syslog(LOG_INFO, "%s", buffer); + break; + default: + syslog(LOG_DEBUG, "%s", buffer); + } } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/debug.h b/libvisual-plugins/plugins/actor/lcdcontrol/debug.h index 2c942ec18..0e5e65523 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/debug.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/debug.h @@ -21,7 +21,6 @@ * along with LCDControl. If not, see . */ - #ifndef _DEBUG_H_ #define _DEBUG_H_ @@ -33,14 +32,15 @@ extern int verbose_level; extern "C" { #endif -void message(const int level, const char *format, ...) __attribute__ ((format(__printf__, 2, 3))); +void message(const int level, const char *format, ...) + __attribute__((format(__printf__, 2, 3))); #ifdef __cplusplus } #endif -#define LCDDebug(args...) message (2, __FILE__ ": " args) -#define LCDInfo(args...) message (1, args) -#define LCDError(args...) message (0, args) +#define LCDDebug(args...) message(2, __FILE__ ": " args) +#define LCDInfo(args...) message(1, args) +#define LCDError(args...) message(0, args) #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/assertions.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/assertions.h index 84eb5d7e2..d87284f49 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/assertions.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/assertions.h @@ -4,23 +4,31 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED -# define CPPTL_JSON_ASSERTIONS_H_INCLUDED +#define CPPTL_JSON_ASSERTIONS_H_INCLUDED #include #include #if !defined(JSON_IS_AMALGAMATION) -# include +#include #endif // if !defined(JSON_IS_AMALGAMATION) #if JSON_USE_EXCEPTION -#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw -#define JSON_FAIL_MESSAGE( message ) throw std::runtime_error( message ); -#else // JSON_USE_EXCEPTION -#define JSON_ASSERT( condition ) assert( condition ); -#define JSON_FAIL_MESSAGE( message ) { std::cerr << std::endl << message << std::endl; exit(123); } +#define JSON_ASSERT(condition) \ + assert(condition); // @todo <= change this into an exception throw +#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message); +#else // JSON_USE_EXCEPTION +#define JSON_ASSERT(condition) assert(condition); +#define JSON_FAIL_MESSAGE(message) \ + { \ + std::cerr << std::endl << message << std::endl; \ + exit(123); \ + } #endif -#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) { JSON_FAIL_MESSAGE( message ) } +#define JSON_ASSERT_MESSAGE(condition, message) \ + if (!(condition)) { \ + JSON_FAIL_MESSAGE(message) \ + } #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/autolink.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/autolink.h index 02328d1f1..6fcc8afac 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/autolink.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/autolink.h @@ -4,21 +4,22 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_AUTOLINK_H_INCLUDED -# define JSON_AUTOLINK_H_INCLUDED +#define JSON_AUTOLINK_H_INCLUDED -# include "config.h" +#include "config.h" -# ifdef JSON_IN_CPPTL -# include -# endif +#ifdef JSON_IN_CPPTL +#include +#endif -# if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL) -# define CPPTL_AUTOLINK_NAME "json" -# undef CPPTL_AUTOLINK_DLL -# ifdef JSON_DLL -# define CPPTL_AUTOLINK_DLL -# endif -# include "autolink.h" -# endif +#if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \ + !defined(JSON_IN_CPPTL) +#define CPPTL_AUTOLINK_NAME "json" +#undef CPPTL_AUTOLINK_DLL +#ifdef JSON_DLL +#define CPPTL_AUTOLINK_DLL +#endif +#include "autolink.h" +#endif #endif // JSON_AUTOLINK_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/config.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/config.h index 72437c4bc..5d3162ec8 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/config.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/config.h @@ -4,95 +4,94 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_CONFIG_H_INCLUDED -# define JSON_CONFIG_H_INCLUDED +#define JSON_CONFIG_H_INCLUDED /// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 +// # define JSON_IN_CPPTL 1 /// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 +// # define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of +/// std::map as Value container. +// # define JSON_USE_CPPTL_SMALLMAP 1 /// If defined, indicates that Json specific container should be used /// (hash table & simple deque container with customizable allocator). /// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 -//# define JSON_VALUE_USE_INTERNAL_MAP 1 -/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. -/// The memory pools allocator used optimization (initializing Value and ValueInternalLink -/// as if it was a POD) that may cause some validation tool to report errors. -/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. -//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 +// # define JSON_VALUE_USE_INTERNAL_MAP 1 +/// Force usage of standard new/malloc based allocator instead of memory pool +/// based allocator. The memory pools allocator used optimization (initializing +/// Value and ValueInternalLink as if it was a POD) that may cause some +/// validation tool to report errors. Only has effects if +/// JSON_VALUE_USE_INTERNAL_MAP is defined. +// # define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 // If non-zero, the library uses exceptions to report bad input instead of C // assertion macros. The default is to use exceptions. -# ifndef JSON_USE_EXCEPTION -# define JSON_USE_EXCEPTION 1 -# endif +#ifndef JSON_USE_EXCEPTION +#define JSON_USE_EXCEPTION 1 +#endif /// If defined, indicates that the source file is amalgated /// to prevent private header inclusion. /// Remarks: it is automatically defined in the generated amalgated header. // #define JSON_IS_AMALGAMATION +#ifdef JSON_IN_CPPTL +#include +#ifndef JSON_USE_CPPTL +#define JSON_USE_CPPTL 1 +#endif +#endif -# ifdef JSON_IN_CPPTL -# include -# ifndef JSON_USE_CPPTL -# define JSON_USE_CPPTL 1 -# endif -# endif - -# ifdef JSON_IN_CPPTL -# define JSON_API CPPTL_API -# elif defined(JSON_DLL_BUILD) -# define JSON_API __declspec(dllexport) -# elif defined(JSON_DLL) -# define JSON_API __declspec(dllimport) -# else -# define JSON_API -# endif +#ifdef JSON_IN_CPPTL +#define JSON_API CPPTL_API +#elif defined(JSON_DLL_BUILD) +#define JSON_API __declspec(dllexport) +#elif defined(JSON_DLL) +#define JSON_API __declspec(dllimport) +#else +#define JSON_API +#endif -// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer -// Storages, and 64 bits integer support is disabled. -// #define JSON_NO_INT64 1 +// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for +// integer Storages, and 64 bits integer support is disabled. #define +// JSON_NO_INT64 1 -#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 +#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 // Microsoft Visual Studio 6 only support conversion from __int64 to double // (no conversion from unsigned __int64). #define JSON_USE_INT64_DOUBLE_CONVERSION 1 #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 -#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 +#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 /// Indicates that the following function is deprecated. -# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) +#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) #endif #if !defined(JSONCPP_DEPRECATED) -# define JSONCPP_DEPRECATED(message) +#define JSONCPP_DEPRECATED(message) #endif // if !defined(JSONCPP_DEPRECATED) namespace Json { - typedef int Int; - typedef unsigned int UInt; -# if defined(JSON_NO_INT64) - typedef int LargestInt; - typedef unsigned int LargestUInt; -# undef JSON_HAS_INT64 -# else // if defined(JSON_NO_INT64) - // For Microsoft Visual use specific types as long long is not supported -# if defined(_MSC_VER) // Microsoft Visual Studio - typedef __int64 Int64; - typedef unsigned __int64 UInt64; -# else // if defined(_MSC_VER) // Other platforms, use long long - typedef long long int Int64; - typedef unsigned long long int UInt64; -# endif // if defined(_MSC_VER) - typedef Int64 LargestInt; - typedef UInt64 LargestUInt; -# define JSON_HAS_INT64 -# endif // if defined(JSON_NO_INT64) +typedef int Int; +typedef unsigned int UInt; +#if defined(JSON_NO_INT64) +typedef int LargestInt; +typedef unsigned int LargestUInt; +#undef JSON_HAS_INT64 +#else // if defined(JSON_NO_INT64) +// For Microsoft Visual use specific types as long long is not supported +#if defined(_MSC_VER) // Microsoft Visual Studio +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#else // if defined(_MSC_VER) // Other platforms, use long long +typedef long long int Int64; +typedef unsigned long long int UInt64; +#endif // if defined(_MSC_VER) +typedef Int64 LargestInt; +typedef UInt64 LargestUInt; +#define JSON_HAS_INT64 +#endif // if defined(JSON_NO_INT64) } // end namespace Json - #endif // JSON_CONFIG_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/features.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/features.h index 435327844..781354783 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/features.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/features.h @@ -4,45 +4,47 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_FEATURES_H_INCLUDED -# define CPPTL_JSON_FEATURES_H_INCLUDED +#define CPPTL_JSON_FEATURES_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) -# include "forwards.h" +#include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { - /** \brief Configuration passed to reader and writer. - * This configuration object can be used to force the Reader or Writer - * to behave in a standard conforming way. - */ - class JSON_API Features - { - public: - /** \brief A configuration that allows all features and assumes all strings are UTF-8. - * - C & C++ comments are allowed - * - Root object can be any JSON value - * - Assumes Value strings are encoded in UTF-8 - */ - static Features all(); - - /** \brief A configuration that is strictly compatible with the JSON specification. - * - Comments are forbidden. - * - Root object must be either an array or an object value. - * - Assumes Value strings are encoded in UTF-8 - */ - static Features strictMode(); - - /** \brief Initialize the configuration like JsonConfig::allFeatures; - */ - Features(); - - /// \c true if comments are allowed. Default: \c true. - bool allowComments_; - - /// \c true if root must be either an array or an object value. Default: \c false. - bool strictRoot_; - }; +/** \brief Configuration passed to reader and writer. + * This configuration object can be used to force the Reader or Writer + * to behave in a standard conforming way. + */ +class JSON_API Features { +public: + /** \brief A configuration that allows all features and assumes all strings + * are UTF-8. + * - C & C++ comments are allowed + * - Root object can be any JSON value + * - Assumes Value strings are encoded in UTF-8 + */ + static Features all(); + + /** \brief A configuration that is strictly compatible with the JSON + * specification. + * - Comments are forbidden. + * - Root object must be either an array or an object value. + * - Assumes Value strings are encoded in UTF-8 + */ + static Features strictMode(); + + /** \brief Initialize the configuration like JsonConfig::allFeatures; + */ + Features(); + + /// \c true if comments are allowed. Default: \c true. + bool allowComments_; + + /// \c true if root must be either an array or an object value. Default: \c + /// false. + bool strictRoot_; +}; } // namespace Json diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/forwards.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/forwards.h index ab863da85..84a26cd2f 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/forwards.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/forwards.h @@ -4,41 +4,40 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_FORWARDS_H_INCLUDED -# define JSON_FORWARDS_H_INCLUDED +#define JSON_FORWARDS_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) -# include "config.h" +#include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { - // writer.h - class FastWriter; - class StyledWriter; - - // reader.h - class Reader; - - // features.h - class Features; - - // value.h - typedef unsigned int ArrayIndex; - class StaticString; - class Path; - class PathArgument; - class Value; - class ValueIteratorBase; - class ValueIterator; - class ValueConstIterator; +// writer.h +class FastWriter; +class StyledWriter; + +// reader.h +class Reader; + +// features.h +class Features; + +// value.h +typedef unsigned int ArrayIndex; +class StaticString; +class Path; +class PathArgument; +class Value; +class ValueIteratorBase; +class ValueIterator; +class ValueConstIterator; #ifdef JSON_VALUE_USE_INTERNAL_MAP - class ValueMapAllocator; - class ValueInternalLink; - class ValueInternalArray; - class ValueInternalMap; +class ValueMapAllocator; +class ValueInternalLink; +class ValueInternalArray; +class ValueInternalMap; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP } // namespace Json - #endif // JSON_FORWARDS_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/json.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/json.h index da5fc967e..8f10ac2bf 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/json.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/json.h @@ -4,12 +4,12 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_JSON_H_INCLUDED -# define JSON_JSON_H_INCLUDED +#define JSON_JSON_H_INCLUDED -# include "autolink.h" -# include "value.h" -# include "reader.h" -# include "writer.h" -# include "features.h" +#include "autolink.h" +#include "value.h" +#include "reader.h" +#include "writer.h" +#include "features.h" #endif // JSON_JSON_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/reader.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/reader.h index 0a324dfc5..5c9b267b6 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/reader.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/reader.h @@ -4,210 +4,196 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_READER_H_INCLUDED -# define CPPTL_JSON_READER_H_INCLUDED +#define CPPTL_JSON_READER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) -# include "features.h" -# include "value.h" +#include "features.h" +#include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) -# include -# include -# include -# include +#include +#include +#include +#include namespace Json { - /** \brief Unserialize a JSON document into a Value. - * - */ - class JSON_API Reader - { - public: - typedef char Char; - typedef const Char *Location; - - /** \brief Constructs a Reader allowing all features - * for parsing. - */ - Reader(); - - /** \brief Constructs a Reader allowing the specified feature set - * for parsing. - */ - Reader( const Features &features ); - - /** \brief Read a Value from a JSON document. - * \param document UTF-8 encoded string containing the document to read. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param collectComments \c true to collect comment and allow writing them back during - * serialization, \c false to discard comments. - * This parameter is ignored if Features::allowComments_ - * is \c false. - * \return \c true if the document was successfully parsed, \c false if an error occurred. - */ - bool parse( const std::string &document, - Value &root, - bool collectComments = true ); - - /** \brief Read a Value from a JSON document. - * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the document to read. - * \param endDoc Pointer on the end of the UTF-8 encoded string of the document to read. - \ Must be >= beginDoc. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param collectComments \c true to collect comment and allow writing them back during - * serialization, \c false to discard comments. - * This parameter is ignored if Features::allowComments_ - * is \c false. - * \return \c true if the document was successfully parsed, \c false if an error occurred. - */ - bool parse( const char *beginDoc, const char *endDoc, - Value &root, - bool collectComments = true ); - - /// \brief Parse from input stream. - /// \see Json::operator>>(std::istream&, Json::Value&). - bool parse( std::istream &is, - Value &root, - bool collectComments = true ); - - /** \brief Returns a user friendly string that list errors in the parsed document. - * \return Formatted error message with the list of errors with their location in - * the parsed document. An empty string is returned if no error occurred - * during parsing. - * \deprecated Use getFormattedErrorMessages() instead (typo fix). - */ - JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") - std::string getFormatedErrorMessages() const; - - /** \brief Returns a user friendly string that list errors in the parsed document. - * \return Formatted error message with the list of errors with their location in - * the parsed document. An empty string is returned if no error occurred - * during parsing. - */ - std::string getFormattedErrorMessages() const; - - private: - enum TokenType - { - tokenEndOfStream = 0, - tokenObjectBegin, - tokenObjectEnd, - tokenArrayBegin, - tokenArrayEnd, - tokenString, - tokenNumber, - tokenTrue, - tokenFalse, - tokenNull, - tokenArraySeparator, - tokenMemberSeparator, - tokenComment, - tokenError - }; - - class Token - { - public: - TokenType type_; - Location start_; - Location end_; - }; - - class ErrorInfo - { - public: - Token token_; - std::string message_; - Location extra_; - }; - - typedef std::deque Errors; - - bool expectToken( TokenType type, Token &token, const char *message ); - bool readToken( Token &token ); - void skipSpaces(); - bool match( Location pattern, - int patternLength ); - bool readComment(); - bool readCStyleComment(); - bool readCppStyleComment(); - bool readString(); - void readNumber(); - bool readValue(); - bool readObject( Token &token ); - bool readArray( Token &token ); - bool decodeNumber( Token &token ); - bool decodeString( Token &token ); - bool decodeString( Token &token, std::string &decoded ); - bool decodeDouble( Token &token ); - bool decodeUnicodeCodePoint( Token &token, - Location ¤t, - Location end, - unsigned int &unicode ); - bool decodeUnicodeEscapeSequence( Token &token, - Location ¤t, - Location end, - unsigned int &unicode ); - bool addError( const std::string &message, - Token &token, - Location extra = 0 ); - bool recoverFromError( TokenType skipUntilToken ); - bool addErrorAndRecover( const std::string &message, - Token &token, - TokenType skipUntilToken ); - void skipUntilSpace(); - Value ¤tValue(); - Char getNextChar(); - void getLocationLineAndColumn( Location location, - int &line, - int &column ) const; - std::string getLocationLineAndColumn( Location location ) const; - void addComment( Location begin, - Location end, - CommentPlacement placement ); - void skipCommentTokens( Token &token ); - - typedef std::stack Nodes; - Nodes nodes_; - Errors errors_; - std::string document_; - Location begin_; - Location end_; - Location current_; - Location lastValueEnd_; - Value *lastValue_; - std::string commentsBefore_; - Features features_; - bool collectComments_; - }; - - /** \brief Read from 'sin' into 'root'. - - Always keep comments from the input JSON. - - This can be used to read a file into a particular sub-object. - For example: - \code - Json::Value root; - cin >> root["dir"]["file"]; - cout << root; - \endcode - Result: - \verbatim - { - "dir": { - "file": { - // The input stream JSON would be nested here. - } - } - } - \endverbatim - \throw std::exception on parse error. - \see Json::operator<<() +/** \brief Unserialize a JSON document into a + * Value. + * + */ +class JSON_API Reader { +public: + typedef char Char; + typedef const Char *Location; + + /** \brief Constructs a Reader allowing all features + * for parsing. */ - std::istream& operator>>( std::istream&, Value& ); + Reader(); + + /** \brief Constructs a Reader allowing the specified feature set + * for parsing. + */ + Reader(const Features &features); + + /** \brief Read a Value from a JSON + * document. \param document UTF-8 encoded string containing the document to + * read. \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them + * back during serialization, \c false to discard comments. This parameter is + * ignored if Features::allowComments_ is \c false. \return \c true if the + * document was successfully parsed, \c false if an error occurred. + */ + bool parse(const std::string &document, Value &root, + bool collectComments = true); + + /** \brief Read a Value from a JSON + document. + * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the + document to read. + * \param endDoc Pointer on the end of the UTF-8 encoded string of the + document to read. \ Must be >= beginDoc. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them + back during + * serialization, \c false to discard comments. + * This parameter is ignored if + Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an + error occurred. + */ + bool parse(const char *beginDoc, const char *endDoc, Value &root, + bool collectComments = true); + + /// \brief Parse from input stream. + /// \see Json::operator>>(std::istream&, Json::Value&). + bool parse(std::istream &is, Value &root, bool collectComments = true); + + /** \brief Returns a user friendly string that list errors in the parsed + * document. \return Formatted error message with the list of errors with + * their location in the parsed document. An empty string is returned if no + * error occurred during parsing. \deprecated Use getFormattedErrorMessages() + * instead (typo fix). + */ + JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") + std::string getFormatedErrorMessages() const; + + /** \brief Returns a user friendly string that list errors in the parsed + * document. \return Formatted error message with the list of errors with + * their location in the parsed document. An empty string is returned if no + * error occurred during parsing. + */ + std::string getFormattedErrorMessages() const; + +private: + enum TokenType { + tokenEndOfStream = 0, + tokenObjectBegin, + tokenObjectEnd, + tokenArrayBegin, + tokenArrayEnd, + tokenString, + tokenNumber, + tokenTrue, + tokenFalse, + tokenNull, + tokenArraySeparator, + tokenMemberSeparator, + tokenComment, + tokenError + }; + + class Token { + public: + TokenType type_; + Location start_; + Location end_; + }; + + class ErrorInfo { + public: + Token token_; + std::string message_; + Location extra_; + }; + + typedef std::deque Errors; + + bool expectToken(TokenType type, Token &token, const char *message); + bool readToken(Token &token); + void skipSpaces(); + bool match(Location pattern, int patternLength); + bool readComment(); + bool readCStyleComment(); + bool readCppStyleComment(); + bool readString(); + void readNumber(); + bool readValue(); + bool readObject(Token &token); + bool readArray(Token &token); + bool decodeNumber(Token &token); + bool decodeString(Token &token); + bool decodeString(Token &token, std::string &decoded); + bool decodeDouble(Token &token); + bool decodeUnicodeCodePoint(Token &token, Location ¤t, Location end, + unsigned int &unicode); + bool decodeUnicodeEscapeSequence(Token &token, Location ¤t, + Location end, unsigned int &unicode); + bool addError(const std::string &message, Token &token, Location extra = 0); + bool recoverFromError(TokenType skipUntilToken); + bool addErrorAndRecover(const std::string &message, Token &token, + TokenType skipUntilToken); + void skipUntilSpace(); + Value ¤tValue(); + Char getNextChar(); + void getLocationLineAndColumn(Location location, int &line, + int &column) const; + std::string getLocationLineAndColumn(Location location) const; + void addComment(Location begin, Location end, CommentPlacement placement); + void skipCommentTokens(Token &token); + + typedef std::stack Nodes; + Nodes nodes_; + Errors errors_; + std::string document_; + Location begin_; + Location end_; + Location current_; + Location lastValueEnd_; + Value *lastValue_; + std::string commentsBefore_; + Features features_; + bool collectComments_; +}; + +/** \brief Read from 'sin' into 'root'. + + Always keep comments from the input JSON. + + This can be used to read a file into a particular sub-object. + For example: + \code + Json::Value root; + cin >> root["dir"]["file"]; + cout << root; + \endcode + Result: + \verbatim + { + "dir": { + "file": { + // The input stream JSON would be nested here. + } + } + } + \endverbatim + \throw std::exception on parse error. + \see Json::operator<<() +*/ +std::istream &operator>>(std::istream &, Value &); } // namespace Json diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/value.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/value.h index b013c9b8e..303bfc0d9 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/value.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/value.h @@ -4,1106 +4,1022 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_H_INCLUDED -# define CPPTL_JSON_H_INCLUDED +#define CPPTL_JSON_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) -# include "forwards.h" +#include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) -# include -# include - -# ifndef JSON_USE_CPPTL_SMALLMAP -# include -# else -# include -# endif -# ifdef JSON_USE_CPPTL -# include -# endif +#include +#include + +#ifndef JSON_USE_CPPTL_SMALLMAP +#include +#else +#include +#endif +#ifdef JSON_USE_CPPTL +#include +#endif /** \brief JSON (JavaScript Object Notation). */ namespace Json { - /** \brief Type of the value held by a Value object. - */ - enum ValueType - { - nullValue = 0, ///< 'null' value - intValue, ///< signed integer value - uintValue, ///< unsigned integer value - realValue, ///< double value - stringValue, ///< UTF-8 string value - booleanValue, ///< bool value - arrayValue, ///< array value (ordered list) - objectValue ///< object value (collection of name/value pairs). - }; +/** \brief Type of the value held by a Value object. + */ +enum ValueType { + nullValue = 0, ///< 'null' value + intValue, ///< signed integer value + uintValue, ///< unsigned integer value + realValue, ///< double value + stringValue, ///< UTF-8 string value + booleanValue, ///< bool value + arrayValue, ///< array value (ordered list) + objectValue ///< object value (collection of name/value pairs). +}; - enum CommentPlacement - { - commentBefore = 0, ///< a comment placed on the line before a value - commentAfterOnSameLine, ///< a comment just after a value on the same line - commentAfter, ///< a comment on the line after a value (only make sense for root value) - numberOfCommentPlacement - }; +enum CommentPlacement { + commentBefore = 0, ///< a comment placed on the line before a value + commentAfterOnSameLine, ///< a comment just after a value on the same line + commentAfter, ///< a comment on the line after a value (only make sense for + ///< root value) + numberOfCommentPlacement +}; -//# ifdef JSON_USE_CPPTL -// typedef CppTL::AnyEnumerator EnumMemberNames; -// typedef CppTL::AnyEnumerator EnumValues; -//# endif - - /** \brief Lightweight wrapper to tag static string. - * - * Value constructor and objectValue member assignement takes advantage of the - * StaticString and avoid the cost of string duplication when storing the - * string or the member name. - * - * Example of usage: - * \code - * Json::Value aValue( StaticString("some text") ); - * Json::Value object; - * static const StaticString code("code"); - * object[code] = 1234; - * \endcode - */ - class JSON_API StaticString - { - public: - explicit StaticString( const char *czstring ) - : str_( czstring ) - { - } +// # ifdef JSON_USE_CPPTL +// typedef CppTL::AnyEnumerator EnumMemberNames; +// typedef CppTL::AnyEnumerator EnumValues; +// # endif + +/** \brief Lightweight wrapper to tag static string. + * + * Value constructor and objectValue member assignement takes advantage of the + * StaticString and avoid the cost of string duplication when storing the + * string or the member name. + * + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ +class JSON_API StaticString { +public: + explicit StaticString(const char *czstring) : str_(czstring) {} - operator const char *() const - { - return str_; - } + operator const char *() const { return str_; } - const char *c_str() const - { - return str_; - } + const char *c_str() const { return str_; } - private: - const char *str_; - }; +private: + const char *str_; +}; - /** \brief Represents a JSON value. - * - * This class is a discriminated union wrapper that can represents a: - * - signed integer [range: Value::minInt - Value::maxInt] - * - unsigned integer (range: 0 - Value::maxUInt) - * - double - * - UTF-8 string - * - boolean - * - 'null' - * - an ordered list of Value - * - collection of name/value pairs (javascript object) - * - * The type of the held value is represented by a #ValueType and - * can be obtained using type(). - * - * values of an #objectValue or #arrayValue can be accessed using operator[]() methods. - * Non const methods will automatically create the a #nullValue element - * if it does not exist. - * The sequence of an #arrayValue will be automatically resize and initialized - * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. - * - * The get() methods can be used to obtanis default value in the case the required element - * does not exist. - * - * It is possible to iterate over the list of a #objectValue values using - * the getMemberNames() method. - */ - class JSON_API Value - { - friend class ValueIteratorBase; -# ifdef JSON_VALUE_USE_INTERNAL_MAP - friend class ValueInternalLink; - friend class ValueInternalMap; -# endif - public: - typedef std::vector Members; - typedef ValueIterator iterator; - typedef ValueConstIterator const_iterator; - typedef Json::UInt UInt; - typedef Json::Int Int; -# if defined(JSON_HAS_INT64) - typedef Json::UInt64 UInt64; - typedef Json::Int64 Int64; +/** \brief Represents a JSON value. + * + * This class is a discriminated union wrapper that can represents a: + * - signed integer [range: Value::minInt - Value::maxInt] + * - unsigned integer (range: 0 - Value::maxUInt) + * - double + * - UTF-8 string + * - boolean + * - 'null' + * - an ordered list of Value + * - collection of name/value pairs (javascript object) + * + * The type of the held value is represented by a #ValueType and + * can be obtained using type(). + * + * values of an #objectValue or #arrayValue can be accessed using operator[]() + * methods. Non const methods will automatically create the a #nullValue element + * if it does not exist. + * The sequence of an #arrayValue will be automatically resize and initialized + * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. + * + * The get() methods can be used to obtanis default value in the case the + * required element does not exist. + * + * It is possible to iterate over the list of a #objectValue values using + * the getMemberNames() method. + */ +class JSON_API Value { + friend class ValueIteratorBase; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + friend class ValueInternalLink; + friend class ValueInternalMap; +#endif +public: + typedef std::vector Members; + typedef ValueIterator iterator; + typedef ValueConstIterator const_iterator; + typedef Json::UInt UInt; + typedef Json::Int Int; +#if defined(JSON_HAS_INT64) + typedef Json::UInt64 UInt64; + typedef Json::Int64 Int64; #endif // defined(JSON_HAS_INT64) - typedef Json::LargestInt LargestInt; - typedef Json::LargestUInt LargestUInt; - typedef Json::ArrayIndex ArrayIndex; - - static const Value null; - /// Minimum signed integer value that can be stored in a Json::Value. - static const LargestInt minLargestInt; - /// Maximum signed integer value that can be stored in a Json::Value. - static const LargestInt maxLargestInt; - /// Maximum unsigned integer value that can be stored in a Json::Value. - static const LargestUInt maxLargestUInt; - - /// Minimum signed int value that can be stored in a Json::Value. - static const Int minInt; - /// Maximum signed int value that can be stored in a Json::Value. - static const Int maxInt; - /// Maximum unsigned int value that can be stored in a Json::Value. - static const UInt maxUInt; - -# if defined(JSON_HAS_INT64) - /// Minimum signed 64 bits int value that can be stored in a Json::Value. - static const Int64 minInt64; - /// Maximum signed 64 bits int value that can be stored in a Json::Value. - static const Int64 maxInt64; - /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. - static const UInt64 maxUInt64; + typedef Json::LargestInt LargestInt; + typedef Json::LargestUInt LargestUInt; + typedef Json::ArrayIndex ArrayIndex; + + static const Value null; + /// Minimum signed integer value that can be stored in a Json::Value. + static const LargestInt minLargestInt; + /// Maximum signed integer value that can be stored in a Json::Value. + static const LargestInt maxLargestInt; + /// Maximum unsigned integer value that can be stored in a Json::Value. + static const LargestUInt maxLargestUInt; + + /// Minimum signed int value that can be stored in a Json::Value. + static const Int minInt; + /// Maximum signed int value that can be stored in a Json::Value. + static const Int maxInt; + /// Maximum unsigned int value that can be stored in a Json::Value. + static const UInt maxUInt; + +#if defined(JSON_HAS_INT64) + /// Minimum signed 64 bits int value that can be stored in a Json::Value. + static const Int64 minInt64; + /// Maximum signed 64 bits int value that can be stored in a Json::Value. + static const Int64 maxInt64; + /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. + static const UInt64 maxUInt64; #endif // defined(JSON_HAS_INT64) - private: +private: #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION -# ifndef JSON_VALUE_USE_INTERNAL_MAP - class CZString - { - public: - enum DuplicationPolicy - { - noDuplication = 0, - duplicate, - duplicateOnCopy - }; - CZString( ArrayIndex index ); - CZString( const char *cstr, DuplicationPolicy allocate ); - CZString( const CZString &other ); - ~CZString(); - CZString &operator =( const CZString &other ); - bool operator<( const CZString &other ) const; - bool operator==( const CZString &other ) const; - ArrayIndex index() const; - const char *c_str() const; - bool isStaticString() const; - private: - void swap( CZString &other ); - const char *cstr_; - ArrayIndex index_; - }; - - public: -# ifndef JSON_USE_CPPTL_SMALLMAP - typedef std::map ObjectValues; -# else - typedef CppTL::SmallMap ObjectValues; -# endif // ifndef JSON_USE_CPPTL_SMALLMAP -# endif // ifndef JSON_VALUE_USE_INTERNAL_MAP +#ifndef JSON_VALUE_USE_INTERNAL_MAP + class CZString { + public: + enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy }; + CZString(ArrayIndex index); + CZString(const char *cstr, DuplicationPolicy allocate); + CZString(const CZString &other); + ~CZString(); + CZString &operator=(const CZString &other); + bool operator<(const CZString &other) const; + bool operator==(const CZString &other) const; + ArrayIndex index() const; + const char *c_str() const; + bool isStaticString() const; + + private: + void swap(CZString &other); + const char *cstr_; + ArrayIndex index_; + }; + +public: +#ifndef JSON_USE_CPPTL_SMALLMAP + typedef std::map ObjectValues; +#else + typedef CppTL::SmallMap ObjectValues; +#endif // ifndef JSON_USE_CPPTL_SMALLMAP +#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - public: - /** \brief Create a default Value of the given type. - - This is a very useful constructor. - To create an empty array, pass arrayValue. - To create an empty object, pass objectValue. - Another Value can then be set to this one by assignment. - This is useful since clear() and resize() will not alter types. - - Examples: - \code - Json::Value null_value; // null - Json::Value arr_value(Json::arrayValue); // [] - Json::Value obj_value(Json::objectValue); // {} - \endcode - */ - Value( ValueType type = nullValue ); - Value( Int value ); - Value( UInt value ); +public: + /** \brief Create a default Value of the given type. + + This is a very useful constructor. + To create an empty array, pass arrayValue. + To create an empty object, pass objectValue. + Another Value can then be set to this one by assignment. +This is useful since clear() and resize() will not alter types. + + Examples: +\code +Json::Value null_value; // null +Json::Value arr_value(Json::arrayValue); // [] +Json::Value obj_value(Json::objectValue); // {} +\endcode + */ + Value(ValueType type = nullValue); + Value(Int value); + Value(UInt value); #if defined(JSON_HAS_INT64) - Value( Int64 value ); - Value( UInt64 value ); + Value(Int64 value); + Value(UInt64 value); #endif // if defined(JSON_HAS_INT64) - Value( double value ); - Value( const char *value ); - Value( const char *beginValue, const char *endValue ); - /** \brief Constructs a value from a static string. - - * Like other value string constructor but do not duplicate the string for - * internal storage. The given string must remain alive after the call to this - * constructor. - * Example of usage: - * \code - * Json::Value aValue( StaticString("some text") ); - * \endcode - */ - Value( const StaticString &value ); - Value( const std::string &value ); -# ifdef JSON_USE_CPPTL - Value( const CppTL::ConstString &value ); -# endif - Value( bool value ); - Value( const Value &other ); - ~Value(); - - Value &operator=( const Value &other ); - /// Swap values. - /// \note Currently, comments are intentionally not swapped, for - /// both logic and efficiency. - void swap( Value &other ); - - ValueType type() const; - - bool operator <( const Value &other ) const; - bool operator <=( const Value &other ) const; - bool operator >=( const Value &other ) const; - bool operator >( const Value &other ) const; - - bool operator ==( const Value &other ) const; - bool operator !=( const Value &other ) const; - - int compare( const Value &other ) const; - - const char *asCString() const; - std::string asString() const; -# ifdef JSON_USE_CPPTL - CppTL::ConstString asConstString() const; -# endif - Int asInt() const; - UInt asUInt() const; + Value(double value); + Value(const char *value); + Value(const char *beginValue, const char *endValue); + /** \brief Constructs a value from a static string. + + * Like other value string constructor but do not duplicate the string for + * internal storage. The given string must remain alive after the call to this + * constructor. + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * \endcode + */ + Value(const StaticString &value); + Value(const std::string &value); +#ifdef JSON_USE_CPPTL + Value(const CppTL::ConstString &value); +#endif + Value(bool value); + Value(const Value &other); + ~Value(); + + Value &operator=(const Value &other); + /// Swap values. + /// \note Currently, comments are intentionally not swapped, for + /// both logic and efficiency. + void swap(Value &other); + + ValueType type() const; + + bool operator<(const Value &other) const; + bool operator<=(const Value &other) const; + bool operator>=(const Value &other) const; + bool operator>(const Value &other) const; + + bool operator==(const Value &other) const; + bool operator!=(const Value &other) const; + + int compare(const Value &other) const; + + const char *asCString() const; + std::string asString() const; +#ifdef JSON_USE_CPPTL + CppTL::ConstString asConstString() const; +#endif + Int asInt() const; + UInt asUInt() const; #if defined(JSON_HAS_INT64) - Int64 asInt64() const; - UInt64 asUInt64() const; + Int64 asInt64() const; + UInt64 asUInt64() const; #endif // if defined(JSON_HAS_INT64) - LargestInt asLargestInt() const; - LargestUInt asLargestUInt() const; - float asFloat() const; - double asDouble() const; - bool asBool() const; - - bool isNull() const; - bool isBool() const; - bool isInt() const; - bool isInt64() const; - bool isUInt() const; - bool isUInt64() const; - bool isIntegral() const; - bool isDouble() const; - bool isNumeric() const; - bool isString() const; - bool isArray() const; - bool isObject() const; - - bool isConvertibleTo( ValueType other ) const; - - /// Number of values in array or object - ArrayIndex size() const; - - /// \brief Return true if empty array, empty object, or null; - /// otherwise, false. - bool empty() const; - - /// Return isNull() - bool operator!() const; - - /// Remove all object members and array elements. - /// \pre type() is arrayValue, objectValue, or nullValue - /// \post type() is unchanged - void clear(); - - /// Resize the array to size elements. - /// New elements are initialized to null. - /// May only be called on nullValue or arrayValue. - /// \pre type() is arrayValue or nullValue - /// \post type() is arrayValue - void resize( ArrayIndex size ); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value &operator[]( ArrayIndex index ); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value &operator[]( int index ); - - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value &operator[]( ArrayIndex index ) const; - - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value &operator[]( int index ) const; - - /// If the array contains at least index+1 elements, returns the element value, - /// otherwise returns defaultValue. - Value get( ArrayIndex index, - const Value &defaultValue ) const; - /// Return true if index < size(). - bool isValidIndex( ArrayIndex index ) const; - /// \brief Append value to array at the end. - /// - /// Equivalent to jsonvalue[jsonvalue.size()] = value; - Value &append( const Value &value ); - - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const char *key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const char *key ) const; - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const std::string &key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const std::string &key ) const; - /** \brief Access an object value by name, create a null member if it does not exist. - - * If the object as no entry for that name, then the member name used to store - * the new entry is not duplicated. - * Example of use: - * \code - * Json::Value object; - * static const StaticString code("code"); - * object[code] = 1234; - * \endcode - */ - Value &operator[]( const StaticString &key ); -# ifdef JSON_USE_CPPTL - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const CppTL::ConstString &key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const CppTL::ConstString &key ) const; -# endif - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const char *key, - const Value &defaultValue ) const; - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const std::string &key, - const Value &defaultValue ) const; -# ifdef JSON_USE_CPPTL - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const CppTL::ConstString &key, - const Value &defaultValue ) const; -# endif - /// \brief Remove and return the named member. - /// - /// Do nothing if it did not exist. - /// \return the removed Value, or null. - /// \pre type() is objectValue or nullValue - /// \post type() is unchanged - Value removeMember( const char* key ); - /// Same as removeMember(const char*) - Value removeMember( const std::string &key ); - - /// Return true if the object has a member named key. - bool isMember( const char *key ) const; - /// Return true if the object has a member named key. - bool isMember( const std::string &key ) const; -# ifdef JSON_USE_CPPTL - /// Return true if the object has a member named key. - bool isMember( const CppTL::ConstString &key ) const; -# endif - - /// \brief Return a list of the member names. - /// - /// If null, return an empty list. - /// \pre type() is objectValue or nullValue - /// \post if type() was nullValue, it remains nullValue - Members getMemberNames() const; - -//# ifdef JSON_USE_CPPTL -// EnumMemberNames enumMemberNames() const; -// EnumValues enumValues() const; -//# endif - - /// Comments must be //... or /* ... */ - void setComment( const char *comment, - CommentPlacement placement ); - /// Comments must be //... or /* ... */ - void setComment( const std::string &comment, - CommentPlacement placement ); - bool hasComment( CommentPlacement placement ) const; - /// Include delimiters and embedded newlines. - std::string getComment( CommentPlacement placement ) const; - - std::string toStyledString() const; - - const_iterator begin() const; - const_iterator end() const; - - iterator begin(); - iterator end(); - - private: - Value &resolveReference( const char *key, - bool isStatic ); - -# ifdef JSON_VALUE_USE_INTERNAL_MAP - inline bool isItemAvailable() const + LargestInt asLargestInt() const; + LargestUInt asLargestUInt() const; + float asFloat() const; + double asDouble() const; + bool asBool() const; + + bool isNull() const; + bool isBool() const; + bool isInt() const; + bool isInt64() const; + bool isUInt() const; + bool isUInt64() const; + bool isIntegral() const; + bool isDouble() const; + bool isNumeric() const; + bool isString() const; + bool isArray() const; + bool isObject() const; + + bool isConvertibleTo(ValueType other) const; + + /// Number of values in array or object + ArrayIndex size() const; + + /// \brief Return true if empty array, empty object, or null; + /// otherwise, false. + bool empty() const; + + /// Return isNull() + bool operator!() const; + + /// Remove all object members and array elements. + /// \pre type() is arrayValue, objectValue, or nullValue + /// \post type() is unchanged + void clear(); + + /// Resize the array to size elements. + /// New elements are initialized to null. + /// May only be called on nullValue or arrayValue. + /// \pre type() is arrayValue or nullValue + /// \post type() is arrayValue + void resize(ArrayIndex size); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are + /// inserted in the array so that its size is index+1. (You may need to say + /// 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value &operator[](ArrayIndex index); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are + /// inserted in the array so that its size is index+1. (You may need to say + /// 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value &operator[](int index); + + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value &operator[](ArrayIndex index) const; + + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value &operator[](int index) const; + + /// If the array contains at least index+1 elements, returns the element + /// value, otherwise returns defaultValue. + Value get(ArrayIndex index, const Value &defaultValue) const; + /// Return true if index < size(). + bool isValidIndex(ArrayIndex index) const; + /// \brief Append value to array at the end. + /// + /// Equivalent to jsonvalue[jsonvalue.size()] = value; + Value &append(const Value &value); + + /// Access an object value by name, create a null member if it does not exist. + Value &operator[](const char *key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value &operator[](const char *key) const; + /// Access an object value by name, create a null member if it does not exist. + Value &operator[](const std::string &key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value &operator[](const std::string &key) const; + /** \brief Access an object value by name, create a null member if it does not + exist. + + * If the object as no entry for that name, then the member name used to store + * the new entry is not duplicated. + * Example of use: + * \code + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ + Value &operator[](const StaticString &key); +#ifdef JSON_USE_CPPTL + /// Access an object value by name, create a null member if it does not exist. + Value &operator[](const CppTL::ConstString &key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value &operator[](const CppTL::ConstString &key) const; +#endif + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const char *key, const Value &defaultValue) const; + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const std::string &key, const Value &defaultValue) const; +#ifdef JSON_USE_CPPTL + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const CppTL::ConstString &key, const Value &defaultValue) const; +#endif + /// \brief Remove and return the named member. + /// + /// Do nothing if it did not exist. + /// \return the removed Value, or null. + /// \pre type() is objectValue or nullValue + /// \post type() is unchanged + Value removeMember(const char *key); + /// Same as removeMember(const char*) + Value removeMember(const std::string &key); + + /// Return true if the object has a member named key. + bool isMember(const char *key) const; + /// Return true if the object has a member named key. + bool isMember(const std::string &key) const; +#ifdef JSON_USE_CPPTL + /// Return true if the object has a member named key. + bool isMember(const CppTL::ConstString &key) const; +#endif + + /// \brief Return a list of the member names. + /// + /// If null, return an empty list. + /// \pre type() is objectValue or nullValue + /// \post if type() was nullValue, it remains nullValue + Members getMemberNames() const; + + // # ifdef JSON_USE_CPPTL + // EnumMemberNames enumMemberNames() const; + // EnumValues enumValues() const; + // # endif + + /// Comments must be //... or /* ... */ + void setComment(const char *comment, CommentPlacement placement); + /// Comments must be //... or /* ... */ + void setComment(const std::string &comment, CommentPlacement placement); + bool hasComment(CommentPlacement placement) const; + /// Include delimiters and embedded newlines. + std::string getComment(CommentPlacement placement) const; + + std::string toStyledString() const; + + const_iterator begin() const; + const_iterator end() const; + + iterator begin(); + iterator end(); + +private: + Value &resolveReference(const char *key, bool isStatic); + +#ifdef JSON_VALUE_USE_INTERNAL_MAP + inline bool isItemAvailable() const { return itemIsUsed_ == 0; } + + inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; } + + inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; } + + inline void setMemberNameIsStatic(bool isStatic) { + memberNameIsStatic_ = isStatic ? 1 : 0; + } +#endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP + +private: + struct CommentInfo { + CommentInfo(); + ~CommentInfo(); + + void setComment(const char *text); + + char *comment_; + }; + + // struct MemberNamesTransform + //{ + // typedef const char *result_type; + // const char *operator()( const CZString &name ) const + // { + // return name.c_str(); + // } + // }; + + union ValueHolder { + LargestInt int_; + LargestUInt uint_; + double real_; + bool bool_; + char *string_; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + ValueInternalArray *array_; + ValueInternalMap *map_; +#else + ObjectValues *map_; +#endif + } value_; + ValueType type_ : 8; + int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. +#ifdef JSON_VALUE_USE_INTERNAL_MAP + unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. + int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. +#endif + CommentInfo *comments_; +}; + +/** \brief Experimental and untested: represents an element of the "path" to + * access a node. + */ +class PathArgument { +public: + friend class Path; + + PathArgument(); + PathArgument(ArrayIndex index); + PathArgument(const char *key); + PathArgument(const std::string &key); + +private: + enum Kind { kindNone = 0, kindIndex, kindKey }; + std::string key_; + ArrayIndex index_; + Kind kind_; +}; + +/** \brief Experimental and untested: represents a "path" to access a node. + * + * Syntax: + * - "." => root node + * - ".[n]" => elements at index 'n' of root node (an array value) + * - ".name" => member named 'name' of root node (an object value) + * - ".name1.name2.name3" + * - ".[0][1][2].name1[3]" + * - ".%" => member name is provided as parameter + * - ".[%]" => index is provied as parameter + */ +class Path { +public: + Path(const std::string &path, const PathArgument &a1 = PathArgument(), + const PathArgument &a2 = PathArgument(), + const PathArgument &a3 = PathArgument(), + const PathArgument &a4 = PathArgument(), + const PathArgument &a5 = PathArgument()); + + const Value &resolve(const Value &root) const; + Value resolve(const Value &root, const Value &defaultValue) const; + /// Creates the "path" to access the specified node and returns a reference on + /// the node. + Value &make(Value &root) const; + +private: + typedef std::vector InArgs; + typedef std::vector Args; + + void makePath(const std::string &path, const InArgs &in); + void addPathInArg(const std::string &path, const InArgs &in, + InArgs::const_iterator &itInArg, PathArgument::Kind kind); + void invalidPath(const std::string &path, int location); + + Args args_; +}; + +#ifdef JSON_VALUE_USE_INTERNAL_MAP +/** \brief Allocator to customize Value internal map. + * Below is an example of a simple implementation (default implementation + actually + * use memory pool for speed). + * \code + class DefaultValueMapAllocator : public ValueMapAllocator + { + public: // overridden from ValueMapAllocator + virtual ValueInternalMap *newMap() { - return itemIsUsed_ == 0; + return new ValueInternalMap(); } - inline void setItemUsed( bool isUsed = true ) + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { - itemIsUsed_ = isUsed ? 1 : 0; + return new ValueInternalMap( other ); } - inline bool isMemberNameStatic() const + virtual void destructMap( ValueInternalMap *map ) { - return memberNameIsStatic_ == 0; + delete map; } - inline void setMemberNameIsStatic( bool isStatic ) + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { - memberNameIsStatic_ = isStatic ? 1 : 0; + return new ValueInternalLink[size]; } -# endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP - private: - struct CommentInfo + virtual void releaseMapBuckets( ValueInternalLink *links ) { - CommentInfo(); - ~CommentInfo(); - - void setComment( const char *text ); - - char *comment_; - }; + delete [] links; + } - //struct MemberNamesTransform - //{ - // typedef const char *result_type; - // const char *operator()( const CZString &name ) const - // { - // return name.c_str(); - // } - //}; + virtual ValueInternalLink *allocateMapLink() + { + return new ValueInternalLink(); + } - union ValueHolder + virtual void releaseMapLink( ValueInternalLink *link ) { - LargestInt int_; - LargestUInt uint_; - double real_; - bool bool_; - char *string_; -# ifdef JSON_VALUE_USE_INTERNAL_MAP - ValueInternalArray *array_; - ValueInternalMap *map_; -#else - ObjectValues *map_; -# endif - } value_; - ValueType type_ : 8; - int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. -# ifdef JSON_VALUE_USE_INTERNAL_MAP - unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. - int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. -# endif - CommentInfo *comments_; + delete link; + } }; + * \endcode + */ +class JSON_API ValueMapAllocator { +public: + virtual ~ValueMapAllocator(); + virtual ValueInternalMap *newMap() = 0; + virtual ValueInternalMap *newMapCopy(const ValueInternalMap &other) = 0; + virtual void destructMap(ValueInternalMap *map) = 0; + virtual ValueInternalLink *allocateMapBuckets(unsigned int size) = 0; + virtual void releaseMapBuckets(ValueInternalLink *links) = 0; + virtual ValueInternalLink *allocateMapLink() = 0; + virtual void releaseMapLink(ValueInternalLink *link) = 0; +}; +/** \brief ValueInternalMap hash-map bucket chain link (for internal use only). + * \internal previous_ & next_ allows for bidirectional traversal. + */ +class JSON_API ValueInternalLink { +public: + enum { + itemPerLink = 6 + }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. + enum InternalFlags { flagAvailable = 0, flagUsed = 1 }; - /** \brief Experimental and untested: represents an element of the "path" to access a node. - */ - class PathArgument - { - public: - friend class Path; + ValueInternalLink(); - PathArgument(); - PathArgument( ArrayIndex index ); - PathArgument( const char *key ); - PathArgument( const std::string &key ); + ~ValueInternalLink(); - private: - enum Kind - { - kindNone = 0, - kindIndex, - kindKey - }; - std::string key_; - ArrayIndex index_; - Kind kind_; - }; + Value items_[itemPerLink]; + char *keys_[itemPerLink]; + ValueInternalLink *previous_; + ValueInternalLink *next_; +}; - /** \brief Experimental and untested: represents a "path" to access a node. - * - * Syntax: - * - "." => root node - * - ".[n]" => elements at index 'n' of root node (an array value) - * - ".name" => member named 'name' of root node (an object value) - * - ".name1.name2.name3" - * - ".[0][1][2].name1[3]" - * - ".%" => member name is provided as parameter - * - ".[%]" => index is provied as parameter - */ - class Path - { - public: - Path( const std::string &path, - const PathArgument &a1 = PathArgument(), - const PathArgument &a2 = PathArgument(), - const PathArgument &a3 = PathArgument(), - const PathArgument &a4 = PathArgument(), - const PathArgument &a5 = PathArgument() ); - - const Value &resolve( const Value &root ) const; - Value resolve( const Value &root, - const Value &defaultValue ) const; - /// Creates the "path" to access the specified node and returns a reference on the node. - Value &make( Value &root ) const; - - private: - typedef std::vector InArgs; - typedef std::vector Args; - - void makePath( const std::string &path, - const InArgs &in ); - void addPathInArg( const std::string &path, - const InArgs &in, - InArgs::const_iterator &itInArg, - PathArgument::Kind kind ); - void invalidPath( const std::string &path, - int location ); - - Args args_; - }; +/** \brief A linked page based hash-table implementation used internally by + * Value. \internal ValueInternalMap is a tradional bucket based hash-table, + * with a linked list in each bucket to handle collision. There is an addional + * twist in that each node of the collision linked list is a page containing a + * fixed amount of value. This provides a better compromise between memory usage + * and speed. + * + * Each bucket is made up of a chained list of ValueInternalLink. The last + * link of a given bucket can be found in the 'previous_' field of the following + * bucket. The last link of the last bucket is stored in tailLink_ as it has no + * following bucket. Only the last link of a bucket may contains 'available' + * item. The last link always contains at least one element unless is it the + * bucket one very first link. + */ +class JSON_API ValueInternalMap { + friend class ValueIteratorBase; + friend class Value; +public: + typedef unsigned int HashKey; + typedef unsigned int BucketIndex; +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState { + IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {} + ValueInternalMap *map_; + ValueInternalLink *link_; + BucketIndex itemIndex_; + BucketIndex bucketIndex_; + }; +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION -#ifdef JSON_VALUE_USE_INTERNAL_MAP - /** \brief Allocator to customize Value internal map. - * Below is an example of a simple implementation (default implementation actually - * use memory pool for speed). - * \code - class DefaultValueMapAllocator : public ValueMapAllocator - { - public: // overridden from ValueMapAllocator - virtual ValueInternalMap *newMap() - { - return new ValueInternalMap(); - } - - virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) - { - return new ValueInternalMap( other ); - } - - virtual void destructMap( ValueInternalMap *map ) - { - delete map; - } - - virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) - { - return new ValueInternalLink[size]; - } - - virtual void releaseMapBuckets( ValueInternalLink *links ) - { - delete [] links; - } - - virtual ValueInternalLink *allocateMapLink() - { - return new ValueInternalLink(); - } - - virtual void releaseMapLink( ValueInternalLink *link ) - { - delete link; - } - }; - * \endcode - */ - class JSON_API ValueMapAllocator - { - public: - virtual ~ValueMapAllocator(); - virtual ValueInternalMap *newMap() = 0; - virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0; - virtual void destructMap( ValueInternalMap *map ) = 0; - virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0; - virtual void releaseMapBuckets( ValueInternalLink *links ) = 0; - virtual ValueInternalLink *allocateMapLink() = 0; - virtual void releaseMapLink( ValueInternalLink *link ) = 0; - }; + ValueInternalMap(); + ValueInternalMap(const ValueInternalMap &other); + ValueInternalMap &operator=(const ValueInternalMap &other); + ~ValueInternalMap(); - /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). - * \internal previous_ & next_ allows for bidirectional traversal. - */ - class JSON_API ValueInternalLink - { - public: - enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. - enum InternalFlags { - flagAvailable = 0, - flagUsed = 1 - }; + void swap(ValueInternalMap &other); - ValueInternalLink(); + BucketIndex size() const; - ~ValueInternalLink(); + void clear(); - Value items_[itemPerLink]; - char *keys_[itemPerLink]; - ValueInternalLink *previous_; - ValueInternalLink *next_; - }; + bool reserveDelta(BucketIndex growth); + bool reserve(BucketIndex newItemCount); - /** \brief A linked page based hash-table implementation used internally by Value. - * \internal ValueInternalMap is a tradional bucket based hash-table, with a linked - * list in each bucket to handle collision. There is an addional twist in that - * each node of the collision linked list is a page containing a fixed amount of - * value. This provides a better compromise between memory usage and speed. - * - * Each bucket is made up of a chained list of ValueInternalLink. The last - * link of a given bucket can be found in the 'previous_' field of the following bucket. - * The last link of the last bucket is stored in tailLink_ as it has no following bucket. - * Only the last link of a bucket may contains 'available' item. The last link always - * contains at least one element unless is it the bucket one very first link. - */ - class JSON_API ValueInternalMap - { - friend class ValueIteratorBase; - friend class Value; - public: - typedef unsigned int HashKey; - typedef unsigned int BucketIndex; - -# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - struct IteratorState - { - IteratorState() - : map_(0) - , link_(0) - , itemIndex_(0) - , bucketIndex_(0) - { - } - ValueInternalMap *map_; - ValueInternalLink *link_; - BucketIndex itemIndex_; - BucketIndex bucketIndex_; - }; -# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + const Value *find(const char *key) const; - ValueInternalMap(); - ValueInternalMap( const ValueInternalMap &other ); - ValueInternalMap &operator =( const ValueInternalMap &other ); - ~ValueInternalMap(); + Value *find(const char *key); - void swap( ValueInternalMap &other ); + Value &resolveReference(const char *key, bool isStatic); - BucketIndex size() const; + void remove(const char *key); - void clear(); + void doActualRemove(ValueInternalLink *link, BucketIndex index, + BucketIndex bucketIndex); - bool reserveDelta( BucketIndex growth ); + ValueInternalLink *&getLastLinkInBucket(BucketIndex bucketIndex); - bool reserve( BucketIndex newItemCount ); + Value &setNewItem(const char *key, bool isStatic, ValueInternalLink *link, + BucketIndex index); - const Value *find( const char *key ) const; + Value &unsafeAdd(const char *key, bool isStatic, HashKey hashedKey); - Value *find( const char *key ); + HashKey hash(const char *key) const; - Value &resolveReference( const char *key, - bool isStatic ); + int compare(const ValueInternalMap &other) const; - void remove( const char *key ); +private: + void makeBeginIterator(IteratorState &it) const; + void makeEndIterator(IteratorState &it) const; + static bool equals(const IteratorState &x, const IteratorState &other); + static void increment(IteratorState &iterator); + static void incrementBucket(IteratorState &iterator); + static void decrement(IteratorState &iterator); + static const char *key(const IteratorState &iterator); + static const char *key(const IteratorState &iterator, bool &isStatic); + static Value &value(const IteratorState &iterator); + static int distance(const IteratorState &x, const IteratorState &y); - void doActualRemove( ValueInternalLink *link, - BucketIndex index, - BucketIndex bucketIndex ); +private: + ValueInternalLink *buckets_; + ValueInternalLink *tailLink_; + BucketIndex bucketsSize_; + BucketIndex itemCount_; +}; - ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex ); +/** \brief A simplified deque implementation used internally by Value. + * \internal + * It is based on a list of fixed "page", each page contains a fixed number of + * items. Instead of using a linked-list, a array of pointer is used for fast + * item look-up. Look-up for an element is as follow: + * - compute page index: pageIndex = itemIndex / itemsPerPage + * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] + * + * Insertion is amortized constant time (only the array containing the index of + * pointers need to be reallocated when items are appended). + */ +class JSON_API ValueInternalArray { + friend class Value; + friend class ValueIteratorBase; - Value &setNewItem( const char *key, - bool isStatic, - ValueInternalLink *link, - BucketIndex index ); +public: + enum { + itemsPerPage = 8 + }; // should be a power of 2 for fast divide and modulo. + typedef Value::ArrayIndex ArrayIndex; + typedef unsigned int PageIndex; - Value &unsafeAdd( const char *key, - bool isStatic, - HashKey hashedKey ); +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState // Must be a POD + { + IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {} + ValueInternalArray *array_; + Value **currentPageIndex_; + unsigned int currentItemIndex_; + }; +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - HashKey hash( const char *key ) const; + ValueInternalArray(); + ValueInternalArray(const ValueInternalArray &other); + ValueInternalArray &operator=(const ValueInternalArray &other); + ~ValueInternalArray(); + void swap(ValueInternalArray &other); - int compare( const ValueInternalMap &other ) const; + void clear(); + void resize(ArrayIndex newSize); - private: - void makeBeginIterator( IteratorState &it ) const; - void makeEndIterator( IteratorState &it ) const; - static bool equals( const IteratorState &x, const IteratorState &other ); - static void increment( IteratorState &iterator ); - static void incrementBucket( IteratorState &iterator ); - static void decrement( IteratorState &iterator ); - static const char *key( const IteratorState &iterator ); - static const char *key( const IteratorState &iterator, bool &isStatic ); - static Value &value( const IteratorState &iterator ); - static int distance( const IteratorState &x, const IteratorState &y ); + Value &resolveReference(ArrayIndex index); - private: - ValueInternalLink *buckets_; - ValueInternalLink *tailLink_; - BucketIndex bucketsSize_; - BucketIndex itemCount_; - }; + Value *find(ArrayIndex index) const; - /** \brief A simplified deque implementation used internally by Value. - * \internal - * It is based on a list of fixed "page", each page contains a fixed number of items. - * Instead of using a linked-list, a array of pointer is used for fast item look-up. - * Look-up for an element is as follow: - * - compute page index: pageIndex = itemIndex / itemsPerPage - * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] - * - * Insertion is amortized constant time (only the array containing the index of pointers - * need to be reallocated when items are appended). - */ - class JSON_API ValueInternalArray - { - friend class Value; - friend class ValueIteratorBase; - public: - enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. - typedef Value::ArrayIndex ArrayIndex; - typedef unsigned int PageIndex; - -# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - struct IteratorState // Must be a POD - { - IteratorState() - : array_(0) - , currentPageIndex_(0) - , currentItemIndex_(0) - { - } - ValueInternalArray *array_; - Value **currentPageIndex_; - unsigned int currentItemIndex_; - }; -# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - - ValueInternalArray(); - ValueInternalArray( const ValueInternalArray &other ); - ValueInternalArray &operator =( const ValueInternalArray &other ); - ~ValueInternalArray(); - void swap( ValueInternalArray &other ); - - void clear(); - void resize( ArrayIndex newSize ); - - Value &resolveReference( ArrayIndex index ); - - Value *find( ArrayIndex index ) const; - - ArrayIndex size() const; - - int compare( const ValueInternalArray &other ) const; - - private: - static bool equals( const IteratorState &x, const IteratorState &other ); - static void increment( IteratorState &iterator ); - static void decrement( IteratorState &iterator ); - static Value &dereference( const IteratorState &iterator ); - static Value &unsafeDereference( const IteratorState &iterator ); - static int distance( const IteratorState &x, const IteratorState &y ); - static ArrayIndex indexOf( const IteratorState &iterator ); - void makeBeginIterator( IteratorState &it ) const; - void makeEndIterator( IteratorState &it ) const; - void makeIterator( IteratorState &it, ArrayIndex index ) const; - - void makeIndexValid( ArrayIndex index ); - - Value **pages_; - ArrayIndex size_; - PageIndex pageCount_; - }; + ArrayIndex size() const; + + int compare(const ValueInternalArray &other) const; + +private: + static bool equals(const IteratorState &x, const IteratorState &other); + static void increment(IteratorState &iterator); + static void decrement(IteratorState &iterator); + static Value &dereference(const IteratorState &iterator); + static Value &unsafeDereference(const IteratorState &iterator); + static int distance(const IteratorState &x, const IteratorState &y); + static ArrayIndex indexOf(const IteratorState &iterator); + void makeBeginIterator(IteratorState &it) const; + void makeEndIterator(IteratorState &it) const; + void makeIterator(IteratorState &it, ArrayIndex index) const; + + void makeIndexValid(ArrayIndex index); - /** \brief Experimental: do not use. Allocator to customize Value internal array. - * Below is an example of a simple implementation (actual implementation use - * memory pool). - \code + Value **pages_; + ArrayIndex size_; + PageIndex pageCount_; +}; + +/** \brief Experimental: do not use. Allocator to customize Value internal +array. + * Below is an example of a simple implementation (actual implementation use + * memory pool). + \code class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator - virtual ~DefaultValueArrayAllocator() - { - } +virtual ~DefaultValueArrayAllocator() +{ +} - virtual ValueInternalArray *newArray() - { - return new ValueInternalArray(); - } +virtual ValueInternalArray *newArray() +{ + return new ValueInternalArray(); +} - virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) - { - return new ValueInternalArray( other ); - } +virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) +{ + return new ValueInternalArray( other ); +} - virtual void destruct( ValueInternalArray *array ) - { - delete array; - } +virtual void destruct( ValueInternalArray *array ) +{ + delete array; +} - virtual void reallocateArrayPageIndex( Value **&indexes, - ValueInternalArray::PageIndex &indexCount, - ValueInternalArray::PageIndex minNewIndexCount ) - { - ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; - if ( minNewIndexCount > newIndexCount ) - newIndexCount = minNewIndexCount; - void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); - if ( !newIndexes ) - throw std::bad_alloc(); - indexCount = newIndexCount; - indexes = static_cast( newIndexes ); - } - virtual void releaseArrayPageIndex( Value **indexes, - ValueInternalArray::PageIndex indexCount ) - { - if ( indexes ) - free( indexes ); - } +virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex +&indexCount, ValueInternalArray::PageIndex minNewIndexCount ) +{ + ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; + if ( minNewIndexCount > newIndexCount ) + newIndexCount = minNewIndexCount; + void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); + if ( !newIndexes ) + throw std::bad_alloc(); + indexCount = newIndexCount; + indexes = static_cast( newIndexes ); +} +virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) +{ + if ( indexes ) + free( indexes ); +} - virtual Value *allocateArrayPage() - { - return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); - } +virtual Value *allocateArrayPage() +{ + return static_cast( malloc( sizeof(Value) * +ValueInternalArray::itemsPerPage ) ); +} - virtual void releaseArrayPage( Value *value ) - { - if ( value ) - free( value ); - } +virtual void releaseArrayPage( Value *value ) +{ + if ( value ) + free( value ); +} +}; + \endcode + */ +class JSON_API ValueArrayAllocator { +public: + virtual ~ValueArrayAllocator(); + virtual ValueInternalArray *newArray() = 0; + virtual ValueInternalArray *newArrayCopy(const ValueInternalArray &other) = 0; + virtual void destructArray(ValueInternalArray *array) = 0; + /** \brief Reallocate array page index. + * Reallocates an array of pointer on each page. + * \param indexes [input] pointer on the current index. May be \c NULL. + * [output] pointer on the new index of at least + * \a minNewIndexCount pages. + * \param indexCount [input] current number of pages in the index. + * [output] number of page the reallocated index can handle. + * \b MUST be >= \a minNewIndexCount. + * \param minNewIndexCount Minimum number of page the new index must be able + * to handle. + */ + virtual void + reallocateArrayPageIndex(Value **&indexes, + ValueInternalArray::PageIndex &indexCount, + ValueInternalArray::PageIndex minNewIndexCount) = 0; + virtual void + releaseArrayPageIndex(Value **indexes, + ValueInternalArray::PageIndex indexCount) = 0; + virtual Value *allocateArrayPage() = 0; + virtual void releaseArrayPage(Value *value) = 0; }; - \endcode - */ - class JSON_API ValueArrayAllocator - { - public: - virtual ~ValueArrayAllocator(); - virtual ValueInternalArray *newArray() = 0; - virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0; - virtual void destructArray( ValueInternalArray *array ) = 0; - /** \brief Reallocate array page index. - * Reallocates an array of pointer on each page. - * \param indexes [input] pointer on the current index. May be \c NULL. - * [output] pointer on the new index of at least - * \a minNewIndexCount pages. - * \param indexCount [input] current number of pages in the index. - * [output] number of page the reallocated index can handle. - * \b MUST be >= \a minNewIndexCount. - * \param minNewIndexCount Minimum number of page the new index must be able to - * handle. - */ - virtual void reallocateArrayPageIndex( Value **&indexes, - ValueInternalArray::PageIndex &indexCount, - ValueInternalArray::PageIndex minNewIndexCount ) = 0; - virtual void releaseArrayPageIndex( Value **indexes, - ValueInternalArray::PageIndex indexCount ) = 0; - virtual Value *allocateArrayPage() = 0; - virtual void releaseArrayPage( Value *value ) = 0; - }; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP +/** \brief base class for Value iterators. + * + */ +class ValueIteratorBase { +public: + typedef unsigned int size_t; + typedef int difference_type; + typedef ValueIteratorBase SelfType; - /** \brief base class for Value iterators. - * - */ - class ValueIteratorBase - { - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef ValueIteratorBase SelfType; - - ValueIteratorBase(); + ValueIteratorBase(); #ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueIteratorBase( const Value::ObjectValues::iterator ¤t ); + explicit ValueIteratorBase(const Value::ObjectValues::iterator ¤t); #else - ValueIteratorBase( const ValueInternalArray::IteratorState &state ); - ValueIteratorBase( const ValueInternalMap::IteratorState &state ); + ValueIteratorBase(const ValueInternalArray::IteratorState &state); + ValueIteratorBase(const ValueInternalMap::IteratorState &state); #endif - bool operator ==( const SelfType &other ) const - { - return isEqual( other ); - } + bool operator==(const SelfType &other) const { return isEqual(other); } - bool operator !=( const SelfType &other ) const - { - return !isEqual( other ); - } + bool operator!=(const SelfType &other) const { return !isEqual(other); } - difference_type operator -( const SelfType &other ) const - { - return computeDistance( other ); - } - - /// Return either the index or the member name of the referenced value as a Value. - Value key() const; + difference_type operator-(const SelfType &other) const { + return computeDistance(other); + } - /// Return the index of the referenced Value. -1 if it is not an arrayValue. - UInt index() const; + /// Return either the index or the member name of the referenced value as a + /// Value. + Value key() const; - /// Return the member name of the referenced Value. "" if it is not an objectValue. - const char *memberName() const; + /// Return the index of the referenced Value. -1 if it is not an arrayValue. + UInt index() const; - protected: - Value &deref() const; + /// Return the member name of the referenced Value. "" if it is not an + /// objectValue. + const char *memberName() const; - void increment(); +protected: + Value &deref() const; - void decrement(); + void increment(); - difference_type computeDistance( const SelfType &other ) const; + void decrement(); - bool isEqual( const SelfType &other ) const; + difference_type computeDistance(const SelfType &other) const; - void copy( const SelfType &other ); + bool isEqual(const SelfType &other) const; - private: -#ifndef JSON_VALUE_USE_INTERNAL_MAP - Value::ObjectValues::iterator current_; - // Indicates that iterator is for a null value. - bool isNull_; -#else - union - { - ValueInternalArray::IteratorState array_; - ValueInternalMap::IteratorState map_; - } iterator_; - bool isArray_; -#endif - }; + void copy(const SelfType &other); - /** \brief const iterator for object and array value. - * - */ - class ValueConstIterator : public ValueIteratorBase - { - friend class Value; - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef const Value &reference; - typedef const Value *pointer; - typedef ValueConstIterator SelfType; - - ValueConstIterator(); - private: - /*! \internal Use by Value to create an iterator. - */ +private: #ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueConstIterator( const Value::ObjectValues::iterator ¤t ); + Value::ObjectValues::iterator current_; + // Indicates that iterator is for a null value. + bool isNull_; #else - ValueConstIterator( const ValueInternalArray::IteratorState &state ); - ValueConstIterator( const ValueInternalMap::IteratorState &state ); + union { + ValueInternalArray::IteratorState array_; + ValueInternalMap::IteratorState map_; + } iterator_; + bool isArray_; #endif - public: - SelfType &operator =( const ValueIteratorBase &other ); - - SelfType operator++( int ) - { - SelfType temp( *this ); - ++*this; - return temp; - } - - SelfType operator--( int ) - { - SelfType temp( *this ); - --*this; - return temp; - } - - SelfType &operator--() - { - decrement(); - return *this; - } +}; - SelfType &operator++() - { - increment(); - return *this; - } +/** \brief const iterator for object and array value. + * + */ +class ValueConstIterator : public ValueIteratorBase { + friend class Value; - reference operator *() const - { - return deref(); - } - }; +public: + typedef unsigned int size_t; + typedef int difference_type; + typedef const Value &reference; + typedef const Value *pointer; + typedef ValueConstIterator SelfType; + ValueConstIterator(); - /** \brief Iterator for object and array value. - */ - class ValueIterator : public ValueIteratorBase - { - friend class Value; - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef Value &reference; - typedef Value *pointer; - typedef ValueIterator SelfType; - - ValueIterator(); - ValueIterator( const ValueConstIterator &other ); - ValueIterator( const ValueIterator &other ); - private: - /*! \internal Use by Value to create an iterator. - */ +private: + /*! \internal Use by Value to create an iterator. + */ #ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueIterator( const Value::ObjectValues::iterator ¤t ); + explicit ValueConstIterator(const Value::ObjectValues::iterator ¤t); #else - ValueIterator( const ValueInternalArray::IteratorState &state ); - ValueIterator( const ValueInternalMap::IteratorState &state ); + ValueConstIterator(const ValueInternalArray::IteratorState &state); + ValueConstIterator(const ValueInternalMap::IteratorState &state); #endif - public: - - SelfType &operator =( const SelfType &other ); - - SelfType operator++( int ) - { - SelfType temp( *this ); - ++*this; - return temp; - } - - SelfType operator--( int ) - { - SelfType temp( *this ); - --*this; - return temp; - } - - SelfType &operator--() - { - decrement(); - return *this; - } - - SelfType &operator++() - { - increment(); - return *this; - } - - reference operator *() const - { - return deref(); - } - }; +public: + SelfType &operator=(const ValueIteratorBase &other); + + SelfType operator++(int) { + SelfType temp(*this); + ++*this; + return temp; + } + + SelfType operator--(int) { + SelfType temp(*this); + --*this; + return temp; + } + + SelfType &operator--() { + decrement(); + return *this; + } + + SelfType &operator++() { + increment(); + return *this; + } + + reference operator*() const { return deref(); } +}; +/** \brief Iterator for object and array value. + */ +class ValueIterator : public ValueIteratorBase { + friend class Value; + +public: + typedef unsigned int size_t; + typedef int difference_type; + typedef Value &reference; + typedef Value *pointer; + typedef ValueIterator SelfType; + + ValueIterator(); + ValueIterator(const ValueConstIterator &other); + ValueIterator(const ValueIterator &other); + +private: + /*! \internal Use by Value to create an iterator. + */ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueIterator(const Value::ObjectValues::iterator ¤t); +#else + ValueIterator(const ValueInternalArray::IteratorState &state); + ValueIterator(const ValueInternalMap::IteratorState &state); +#endif +public: + SelfType &operator=(const SelfType &other); + + SelfType operator++(int) { + SelfType temp(*this); + ++*this; + return temp; + } + + SelfType operator--(int) { + SelfType temp(*this); + --*this; + return temp; + } + + SelfType &operator--() { + decrement(); + return *this; + } + + SelfType &operator++() { + increment(); + return *this; + } + + reference operator*() const { return deref(); } +}; } // namespace Json - #endif // CPPTL_JSON_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json/writer.h b/libvisual-plugins/plugins/actor/lcdcontrol/json/writer.h index 478936365..d587dc681 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json/writer.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json/writer.h @@ -4,182 +4,185 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_WRITER_H_INCLUDED -# define JSON_WRITER_H_INCLUDED +#define JSON_WRITER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) -# include "value.h" +#include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) -# include -# include -# include +#include +#include +#include namespace Json { - class Value; - - /** \brief Abstract class for writers. - */ - class JSON_API Writer - { - public: - virtual ~Writer(); - - virtual std::string write( const Value &root ) = 0; - }; - - /** \brief Outputs a Value in JSON format without formatting (not human friendly). - * - * The JSON document is written in a single line. It is not intended for 'human' consumption, - * but may be usefull to support feature such as RPC where bandwith is limited. - * \sa Reader, Value - */ - class JSON_API FastWriter : public Writer - { - public: - FastWriter(); - virtual ~FastWriter(){} - - void enableYAMLCompatibility(); - - public: // overridden from Writer - virtual std::string write( const Value &root ); - - private: - void writeValue( const Value &value ); - - std::string document_; - bool yamlCompatiblityEnabled_; - }; - - /** \brief Writes a Value in JSON format in a human friendly way. - * - * The rules for line break and indent are as follow: - * - Object value: - * - if empty then print {} without indent and line break - * - if not empty the print '{', line break & indent, print one value per line - * and then unindent and line break and print '}'. - * - Array value: - * - if empty then print [] without indent and line break - * - if the array contains no object value, empty array or some other value types, - * and all the values fit on one lines, then print the array on a single line. - * - otherwise, it the values do not fit on one line, or the array contains - * object or non empty array, then print one value per line. - * - * If the Value have comments then they are outputed according to their #CommentPlacement. - * - * \sa Reader, Value, Value::setComment() - */ - class JSON_API StyledWriter: public Writer - { - public: - StyledWriter(); - virtual ~StyledWriter(){} - - public: // overridden from Writer - /** \brief Serialize a Value in JSON format. - * \param root Value to serialize. - * \return String containing the JSON document that represents the root value. - */ - virtual std::string write( const Value &root ); - - private: - void writeValue( const Value &value ); - void writeArrayValue( const Value &value ); - bool isMultineArray( const Value &value ); - void pushValue( const std::string &value ); - void writeIndent(); - void writeWithIndent( const std::string &value ); - void indent(); - void unindent(); - void writeCommentBeforeValue( const Value &root ); - void writeCommentAfterValueOnSameLine( const Value &root ); - bool hasCommentForValue( const Value &value ); - static std::string normalizeEOL( const std::string &text ); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::string document_; - std::string indentString_; - int rightMargin_; - int indentSize_; - bool addChildValues_; - }; - - /** \brief Writes a Value in JSON format in a human friendly way, - to a stream rather than to a string. - * - * The rules for line break and indent are as follow: - * - Object value: - * - if empty then print {} without indent and line break - * - if not empty the print '{', line break & indent, print one value per line - * and then unindent and line break and print '}'. - * - Array value: - * - if empty then print [] without indent and line break - * - if the array contains no object value, empty array or some other value types, - * and all the values fit on one lines, then print the array on a single line. - * - otherwise, it the values do not fit on one line, or the array contains - * object or non empty array, then print one value per line. - * - * If the Value have comments then they are outputed according to their #CommentPlacement. - * - * \param indentation Each level will be indented by this amount extra. - * \sa Reader, Value, Value::setComment() - */ - class JSON_API StyledStreamWriter - { - public: - StyledStreamWriter( std::string indentation="\t" ); - ~StyledStreamWriter(){} - - public: - /** \brief Serialize a Value in JSON format. - * \param out Stream to write to. (Can be ostringstream, e.g.) - * \param root Value to serialize. - * \note There is no point in deriving from Writer, since write() should not return a value. - */ - void write( std::ostream &out, const Value &root ); - - private: - void writeValue( const Value &value ); - void writeArrayValue( const Value &value ); - bool isMultineArray( const Value &value ); - void pushValue( const std::string &value ); - void writeIndent(); - void writeWithIndent( const std::string &value ); - void indent(); - void unindent(); - void writeCommentBeforeValue( const Value &root ); - void writeCommentAfterValueOnSameLine( const Value &root ); - bool hasCommentForValue( const Value &value ); - static std::string normalizeEOL( const std::string &text ); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::ostream* document_; - std::string indentString_; - int rightMargin_; - std::string indentation_; - bool addChildValues_; - }; - -# if defined(JSON_HAS_INT64) - std::string JSON_API valueToString( Int value ); - std::string JSON_API valueToString( UInt value ); -# endif // if defined(JSON_HAS_INT64) - std::string JSON_API valueToString( LargestInt value ); - std::string JSON_API valueToString( LargestUInt value ); - std::string JSON_API valueToString( double value ); - std::string JSON_API valueToString( bool value ); - std::string JSON_API valueToQuotedString( const char *value ); - - /// \brief Output using the StyledStreamWriter. - /// \see Json::operator>>() - std::ostream& operator<<( std::ostream&, const Value &root ); +class Value; + +/** \brief Abstract class for writers. + */ +class JSON_API Writer { +public: + virtual ~Writer(); + + virtual std::string write(const Value &root) = 0; +}; + +/** \brief Outputs a Value in JSON format + * without formatting (not human friendly). + * + * The JSON document is written in a single line. It is not intended for 'human' + * consumption, but may be usefull to support feature such as RPC where bandwith + * is limited. \sa Reader, Value + */ +class JSON_API FastWriter : public Writer { +public: + FastWriter(); + virtual ~FastWriter() {} + + void enableYAMLCompatibility(); + +public: // overridden from Writer + virtual std::string write(const Value &root); + +private: + void writeValue(const Value &value); + + std::string document_; + bool yamlCompatiblityEnabled_; +}; + +/** \brief Writes a Value in JSON format in a + * human friendly way. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per + * line and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value + * types, and all the values fit on one lines, then print the array on a single + * line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * If the Value have comments then they are outputed according to their + * #CommentPlacement. + * + * \sa Reader, Value, Value::setComment() + */ +class JSON_API StyledWriter : public Writer { +public: + StyledWriter(); + virtual ~StyledWriter() {} + +public: // overridden from Writer + /** \brief Serialize a Value in JSON format. + * \param root Value to serialize. + * \return String containing the JSON document that represents the root value. + */ + virtual std::string write(const Value &root); + +private: + void writeValue(const Value &value); + void writeArrayValue(const Value &value); + bool isMultineArray(const Value &value); + void pushValue(const std::string &value); + void writeIndent(); + void writeWithIndent(const std::string &value); + void indent(); + void unindent(); + void writeCommentBeforeValue(const Value &root); + void writeCommentAfterValueOnSameLine(const Value &root); + bool hasCommentForValue(const Value &value); + static std::string normalizeEOL(const std::string &text); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::string document_; + std::string indentString_; + int rightMargin_; + int indentSize_; + bool addChildValues_; +}; + +/** \brief Writes a Value in JSON format in a + human friendly way, to a stream rather than to a string. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per + line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value + types, + * and all the values fit on one lines, then print the array on a single + line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * If the Value have comments then they are outputed according to their + #CommentPlacement. + * + * \param indentation Each level will be indented by this amount extra. + * \sa Reader, Value, Value::setComment() + */ +class JSON_API StyledStreamWriter { +public: + StyledStreamWriter(std::string indentation = "\t"); + ~StyledStreamWriter() {} + +public: + /** \brief Serialize a Value in JSON format. + * \param out Stream to write to. (Can be ostringstream, e.g.) + * \param root Value to serialize. + * \note There is no point in deriving from Writer, since write() should not + * return a value. + */ + void write(std::ostream &out, const Value &root); + +private: + void writeValue(const Value &value); + void writeArrayValue(const Value &value); + bool isMultineArray(const Value &value); + void pushValue(const std::string &value); + void writeIndent(); + void writeWithIndent(const std::string &value); + void indent(); + void unindent(); + void writeCommentBeforeValue(const Value &root); + void writeCommentAfterValueOnSameLine(const Value &root); + bool hasCommentForValue(const Value &value); + static std::string normalizeEOL(const std::string &text); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::ostream *document_; + std::string indentString_; + int rightMargin_; + std::string indentation_; + bool addChildValues_; +}; + +#if defined(JSON_HAS_INT64) +std::string JSON_API valueToString(Int value); +std::string JSON_API valueToString(UInt value); +#endif // if defined(JSON_HAS_INT64) +std::string JSON_API valueToString(LargestInt value); +std::string JSON_API valueToString(LargestUInt value); +std::string JSON_API valueToString(double value); +std::string JSON_API valueToString(bool value); +std::string JSON_API valueToQuotedString(const char *value); + +/// \brief Output using the StyledStreamWriter. +/// \see Json::operator>>() +std::ostream &operator<<(std::ostream &, const Value &root); } // namespace Json - - #endif // JSON_WRITER_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json_batchallocator.h b/libvisual-plugins/plugins/actor/lcdcontrol/json_batchallocator.h index 2a7c02417..536eedefa 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json_batchallocator.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json_batchallocator.h @@ -4,12 +4,12 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED -# define JSONCPP_BATCHALLOCATOR_H_INCLUDED +#define JSONCPP_BATCHALLOCATOR_H_INCLUDED -# include -# include +#include +#include -# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION namespace Json { @@ -18,110 +18,104 @@ namespace Json { * This memory allocator allocates memory for a batch of object (specified by * the page size, the number of object in each page). * - * It does not allow the destruction of a single object. All the allocated objects - * can be destroyed at once. The memory can be either released or reused for future - * allocation. - * - * The in-place new operator must be used to construct the object using the pointer - * returned by allocate. + * It does not allow the destruction of a single object. All the allocated + * objects can be destroyed at once. The memory can be either released or reused + * for future allocation. + * + * The in-place new operator must be used to construct the object using the + * pointer returned by allocate. */ -template -class BatchAllocator -{ +template +class BatchAllocator { public: - BatchAllocator( unsigned int objectsPerPage = 255 ) - : freeHead_( 0 ) - , objectsPerPage_( objectsPerPage ) - { -// printf( "Size: %d => %s\n", sizeof(AllocatedType), typeid(AllocatedType).name() ); - assert( sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *) ); // We must be able to store a slist in the object free space. - assert( objectsPerPage >= 16 ); - batches_ = allocateBatch( 0 ); // allocated a dummy page - currentBatch_ = batches_; - } - - ~BatchAllocator() - { - for ( BatchInfo *batch = batches_; batch; ) + BatchAllocator(unsigned int objectsPerPage = 255) + : freeHead_(0), objectsPerPage_(objectsPerPage) { + // printf( "Size: %d => %s\n", sizeof(AllocatedType), + // typeid(AllocatedType).name() ); + assert(sizeof(AllocatedType) * objectPerAllocation >= + sizeof(AllocatedType *)); // We must be able to store a slist in the + // object free space. + assert(objectsPerPage >= 16); + batches_ = allocateBatch(0); // allocated a dummy page + currentBatch_ = batches_; + } + + ~BatchAllocator() { + for (BatchInfo *batch = batches_; batch;) { + BatchInfo *nextBatch = batch->next_; + free(batch); + batch = nextBatch; + } + } + + /// allocate space for an array of objectPerAllocation object. + /// @warning it is the responsability of the caller to call objects + /// constructors. + AllocatedType *allocate() { + if (freeHead_) // returns node from free list. + { + AllocatedType *object = freeHead_; + freeHead_ = *(AllocatedType **)object; + return object; + } + if (currentBatch_->used_ == currentBatch_->end_) { + currentBatch_ = currentBatch_->next_; + while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_) + currentBatch_ = currentBatch_->next_; + + if (!currentBatch_) // no free batch found, allocate a new one { - BatchInfo *nextBatch = batch->next_; - free( batch ); - batch = nextBatch; + currentBatch_ = allocateBatch(objectsPerPage_); + currentBatch_->next_ = batches_; // insert at the head of the list + batches_ = currentBatch_; } - } - - /// allocate space for an array of objectPerAllocation object. - /// @warning it is the responsability of the caller to call objects constructors. - AllocatedType *allocate() - { - if ( freeHead_ ) // returns node from free list. - { - AllocatedType *object = freeHead_; - freeHead_ = *(AllocatedType **)object; - return object; - } - if ( currentBatch_->used_ == currentBatch_->end_ ) - { - currentBatch_ = currentBatch_->next_; - while ( currentBatch_ && currentBatch_->used_ == currentBatch_->end_ ) - currentBatch_ = currentBatch_->next_; - - if ( !currentBatch_ ) // no free batch found, allocate a new one - { - currentBatch_ = allocateBatch( objectsPerPage_ ); - currentBatch_->next_ = batches_; // insert at the head of the list - batches_ = currentBatch_; - } - } - AllocatedType *allocated = currentBatch_->used_; - currentBatch_->used_ += objectPerAllocation; - return allocated; - } - - /// Release the object. - /// @warning it is the responsability of the caller to actually destruct the object. - void release( AllocatedType *object ) - { - assert( object != 0 ); - *(AllocatedType **)object = freeHead_; - freeHead_ = object; - } + } + AllocatedType *allocated = currentBatch_->used_; + currentBatch_->used_ += objectPerAllocation; + return allocated; + } + + /// Release the object. + /// @warning it is the responsability of the caller to actually destruct the + /// object. + void release(AllocatedType *object) { + assert(object != 0); + *(AllocatedType **)object = freeHead_; + freeHead_ = object; + } private: - struct BatchInfo - { - BatchInfo *next_; - AllocatedType *used_; - AllocatedType *end_; - AllocatedType buffer_[objectPerAllocation]; - }; - - // disabled copy constructor and assignement operator. - BatchAllocator( const BatchAllocator & ); - void operator =( const BatchAllocator &); - - static BatchInfo *allocateBatch( unsigned int objectsPerPage ) - { - const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType)* objectPerAllocation - + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; - BatchInfo *batch = static_cast( malloc( mallocSize ) ); - batch->next_ = 0; - batch->used_ = batch->buffer_; - batch->end_ = batch->buffer_ + objectsPerPage; - return batch; - } - - BatchInfo *batches_; - BatchInfo *currentBatch_; - /// Head of a single linked list within the allocated space of freeed object - AllocatedType *freeHead_; - unsigned int objectsPerPage_; + struct BatchInfo { + BatchInfo *next_; + AllocatedType *used_; + AllocatedType *end_; + AllocatedType buffer_[objectPerAllocation]; + }; + + // disabled copy constructor and assignement operator. + BatchAllocator(const BatchAllocator &); + void operator=(const BatchAllocator &); + + static BatchInfo *allocateBatch(unsigned int objectsPerPage) { + const unsigned int mallocSize = + sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation + + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; + BatchInfo *batch = static_cast(malloc(mallocSize)); + batch->next_ = 0; + batch->used_ = batch->buffer_; + batch->end_ = batch->buffer_ + objectsPerPage; + return batch; + } + + BatchInfo *batches_; + BatchInfo *currentBatch_; + /// Head of a single linked list within the allocated space of freeed object + AllocatedType *freeHead_; + unsigned int objectsPerPage_; }; - } // namespace Json -# endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION +#endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json_reader.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/json_reader.cpp index e55745eab..8e1a2662b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json_reader.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json_reader.cpp @@ -4,10 +4,10 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #if !defined(JSON_IS_AMALGAMATION) -# include -# include -# include -# include "json_tool.h" +#include +#include +#include +#include "json_tool.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include @@ -17,7 +17,8 @@ #include #if _MSC_VER >= 1400 // VC++ 8.0 -#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. +#pragma warning( \ + disable : 4996) // disable warning about strdup being deprecated. #endif namespace Json { @@ -25,888 +26,709 @@ namespace Json { // Implementation of class Features // //////////////////////////////// -Features::Features() - : allowComments_( true ) - , strictRoot_( false ) -{ -} +Features::Features() : allowComments_(true), strictRoot_(false) {} +Features Features::all() { return Features(); } -Features -Features::all() -{ - return Features(); -} - - -Features -Features::strictMode() -{ - Features features; - features.allowComments_ = false; - features.strictRoot_ = true; - return features; +Features Features::strictMode() { + Features features; + features.allowComments_ = false; + features.strictRoot_ = true; + return features; } // Implementation of class Reader // //////////////////////////////// - -static inline bool -in( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4 ) -{ - return c == c1 || c == c2 || c == c3 || c == c4; +static inline bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, + Reader::Char c3, Reader::Char c4) { + return c == c1 || c == c2 || c == c3 || c == c4; } -static inline bool -in( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4, Reader::Char c5 ) -{ - return c == c1 || c == c2 || c == c3 || c == c4 || c == c5; +static inline bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, + Reader::Char c3, Reader::Char c4, Reader::Char c5) { + return c == c1 || c == c2 || c == c3 || c == c4 || c == c5; } - -static bool -containsNewLine( Reader::Location begin, - Reader::Location end ) -{ - for ( ;begin < end; ++begin ) - if ( *begin == '\n' || *begin == '\r' ) - return true; - return false; +static bool containsNewLine(Reader::Location begin, Reader::Location end) { + for (; begin < end; ++begin) + if (*begin == '\n' || *begin == '\r') + return true; + return false; } - // Class Reader // ////////////////////////////////////////////////////////////////// Reader::Reader() - : errors_(), - document_(), - begin_(), - end_(), - current_(), - lastValueEnd_(), - lastValue_(), - commentsBefore_(), - features_( Features::all() ), - collectComments_() -{ -} - - -Reader::Reader( const Features &features ) - : errors_(), - document_(), - begin_(), - end_(), - current_(), - lastValueEnd_(), - lastValue_(), - commentsBefore_(), - features_( features ), - collectComments_() -{ -} - - -bool -Reader::parse( const std::string &document, - Value &root, - bool collectComments ) -{ - document_ = document; - const char *begin = document_.c_str(); - const char *end = begin + document_.length(); - return parse( begin, end, root, collectComments ); -} - - -bool -Reader::parse( std::istream& sin, - Value &root, - bool collectComments ) -{ - //std::istream_iterator begin(sin); - //std::istream_iterator end; - // Those would allow streamed input from a file, if parse() were a - // template function. - - // Since std::string is reference-counted, this at least does not - // create an extra copy. - std::string doc; - std::getline(sin, doc, (char)EOF); - return parse( doc, root, collectComments ); -} - -bool -Reader::parse( const char *beginDoc, const char *endDoc, - Value &root, - bool collectComments ) -{ - if ( !features_.allowComments_ ) - { - collectComments = false; - } - - begin_ = beginDoc; - end_ = endDoc; - collectComments_ = collectComments; - current_ = begin_; - lastValueEnd_ = 0; - lastValue_ = 0; - commentsBefore_ = ""; - errors_.clear(); - while ( !nodes_.empty() ) - nodes_.pop(); - nodes_.push( &root ); - - bool successful = readValue(); - Token token; - skipCommentTokens( token ); - if ( collectComments_ && !commentsBefore_.empty() ) - root.setComment( commentsBefore_, commentAfter ); - if ( features_.strictRoot_ ) - { - if ( !root.isArray() && !root.isObject() ) - { - // Set error location to start of doc, ideally should be first token found in doc - token.type_ = tokenError; - token.start_ = beginDoc; - token.end_ = endDoc; - addError( "A valid JSON document must be either an array or an object value.", - token ); - return false; - } - } - return successful; + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(Features::all()), + collectComments_() {} + +Reader::Reader(const Features &features) + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(features), collectComments_() { +} + +bool Reader::parse(const std::string &document, Value &root, + bool collectComments) { + document_ = document; + const char *begin = document_.c_str(); + const char *end = begin + document_.length(); + return parse(begin, end, root, collectComments); +} + +bool Reader::parse(std::istream &sin, Value &root, bool collectComments) { + // std::istream_iterator begin(sin); + // std::istream_iterator end; + // Those would allow streamed input from a file, if parse() were a + // template function. + + // Since std::string is reference-counted, this at least does not + // create an extra copy. + std::string doc; + std::getline(sin, doc, (char)EOF); + return parse(doc, root, collectComments); +} + +bool Reader::parse(const char *beginDoc, const char *endDoc, Value &root, + bool collectComments) { + if (!features_.allowComments_) { + collectComments = false; + } + + begin_ = beginDoc; + end_ = endDoc; + collectComments_ = collectComments; + current_ = begin_; + lastValueEnd_ = 0; + lastValue_ = 0; + commentsBefore_ = ""; + errors_.clear(); + while (!nodes_.empty()) + nodes_.pop(); + nodes_.push(&root); + + bool successful = readValue(); + Token token; + skipCommentTokens(token); + if (collectComments_ && !commentsBefore_.empty()) + root.setComment(commentsBefore_, commentAfter); + if (features_.strictRoot_) { + if (!root.isArray() && !root.isObject()) { + // Set error location to start of doc, ideally should be first token found + // in doc + token.type_ = tokenError; + token.start_ = beginDoc; + token.end_ = endDoc; + addError( + "A valid JSON document must be either an array or an object value.", + token); + return false; + } + } + return successful; +} + +bool Reader::readValue() { + Token token; + skipCommentTokens(token); + bool successful = true; + + if (collectComments_ && !commentsBefore_.empty()) { + currentValue().setComment(commentsBefore_, commentBefore); + commentsBefore_ = ""; + } + + switch (token.type_) { + case tokenObjectBegin: + successful = readObject(token); + break; + case tokenArrayBegin: + successful = readArray(token); + break; + case tokenNumber: + successful = decodeNumber(token); + break; + case tokenString: + successful = decodeString(token); + break; + case tokenTrue: + currentValue() = true; + break; + case tokenFalse: + currentValue() = false; + break; + case tokenNull: + currentValue() = Value(); + break; + default: + return addError("Syntax error: value, object or array expected.", token); + } + + if (collectComments_) { + lastValueEnd_ = current_; + lastValue_ = ¤tValue(); + } + + return successful; +} + +void Reader::skipCommentTokens(Token &token) { + if (features_.allowComments_) { + do { + readToken(token); + } while (token.type_ == tokenComment); + } else { + readToken(token); + } +} + +bool Reader::expectToken(TokenType type, Token &token, const char *message) { + readToken(token); + if (token.type_ != type) + return addError(message, token); + return true; +} + +bool Reader::readToken(Token &token) { + skipSpaces(); + token.start_ = current_; + Char c = getNextChar(); + bool ok = true; + switch (c) { + case '{': + token.type_ = tokenObjectBegin; + break; + case '}': + token.type_ = tokenObjectEnd; + break; + case '[': + token.type_ = tokenArrayBegin; + break; + case ']': + token.type_ = tokenArrayEnd; + break; + case '"': + token.type_ = tokenString; + ok = readString(); + break; + case '/': + token.type_ = tokenComment; + ok = readComment(); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + token.type_ = tokenNumber; + readNumber(); + break; + case 't': + token.type_ = tokenTrue; + ok = match("rue", 3); + break; + case 'f': + token.type_ = tokenFalse; + ok = match("alse", 4); + break; + case 'n': + token.type_ = tokenNull; + ok = match("ull", 3); + break; + case ',': + token.type_ = tokenArraySeparator; + break; + case ':': + token.type_ = tokenMemberSeparator; + break; + case 0: + token.type_ = tokenEndOfStream; + break; + default: + ok = false; + break; + } + if (!ok) + token.type_ = tokenError; + token.end_ = current_; + return true; +} + +void Reader::skipSpaces() { + while (current_ != end_) { + Char c = *current_; + if (c == ' ' || c == '\t' || c == '\r' || c == '\n') + ++current_; + else + break; + } } - -bool -Reader::readValue() -{ - Token token; - skipCommentTokens( token ); - bool successful = true; - - if ( collectComments_ && !commentsBefore_.empty() ) - { - currentValue().setComment( commentsBefore_, commentBefore ); - commentsBefore_ = ""; - } - - - switch ( token.type_ ) - { - case tokenObjectBegin: - successful = readObject( token ); - break; - case tokenArrayBegin: - successful = readArray( token ); - break; - case tokenNumber: - successful = decodeNumber( token ); - break; - case tokenString: - successful = decodeString( token ); - break; - case tokenTrue: - currentValue() = true; - break; - case tokenFalse: - currentValue() = false; - break; - case tokenNull: - currentValue() = Value(); +bool Reader::match(Location pattern, int patternLength) { + if (end_ - current_ < patternLength) + return false; + int index = patternLength; + while (index--) + if (current_[index] != pattern[index]) + return false; + current_ += patternLength; + return true; +} + +bool Reader::readComment() { + Location commentBegin = current_ - 1; + Char c = getNextChar(); + bool successful = false; + if (c == '*') + successful = readCStyleComment(); + else if (c == '/') + successful = readCppStyleComment(); + if (!successful) + return false; + + if (collectComments_) { + CommentPlacement placement = commentBefore; + if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { + if (c != '*' || !containsNewLine(commentBegin, current_)) + placement = commentAfterOnSameLine; + } + + addComment(commentBegin, current_, placement); + } + return true; +} + +void Reader::addComment(Location begin, Location end, + CommentPlacement placement) { + assert(collectComments_); + if (placement == commentAfterOnSameLine) { + assert(lastValue_ != 0); + lastValue_->setComment(std::string(begin, end), placement); + } else { + if (!commentsBefore_.empty()) + commentsBefore_ += "\n"; + commentsBefore_ += std::string(begin, end); + } +} + +bool Reader::readCStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '*' && *current_ == '/') break; - default: - return addError( "Syntax error: value, object or array expected.", token ); - } - - if ( collectComments_ ) - { - lastValueEnd_ = current_; - lastValue_ = ¤tValue(); - } - - return successful; + } + return getNextChar() == '/'; } - -void -Reader::skipCommentTokens( Token &token ) -{ - if ( features_.allowComments_ ) - { - do - { - readToken( token ); - } - while ( token.type_ == tokenComment ); - } - else - { - readToken( token ); - } -} - - -bool -Reader::expectToken( TokenType type, Token &token, const char *message ) -{ - readToken( token ); - if ( token.type_ != type ) - return addError( message, token ); - return true; -} - - -bool -Reader::readToken( Token &token ) -{ - skipSpaces(); - token.start_ = current_; - Char c = getNextChar(); - bool ok = true; - switch ( c ) - { - case '{': - token.type_ = tokenObjectBegin; - break; - case '}': - token.type_ = tokenObjectEnd; - break; - case '[': - token.type_ = tokenArrayBegin; - break; - case ']': - token.type_ = tokenArrayEnd; - break; - case '"': - token.type_ = tokenString; - ok = readString(); - break; - case '/': - token.type_ = tokenComment; - ok = readComment(); - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '-': - token.type_ = tokenNumber; - readNumber(); - break; - case 't': - token.type_ = tokenTrue; - ok = match( "rue", 3 ); - break; - case 'f': - token.type_ = tokenFalse; - ok = match( "alse", 4 ); - break; - case 'n': - token.type_ = tokenNull; - ok = match( "ull", 3 ); - break; - case ',': - token.type_ = tokenArraySeparator; - break; - case ':': - token.type_ = tokenMemberSeparator; - break; - case 0: - token.type_ = tokenEndOfStream; +bool Reader::readCppStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '\r' || c == '\n') break; - default: - ok = false; - break; - } - if ( !ok ) - token.type_ = tokenError; - token.end_ = current_; - return true; + } + return true; } - -void -Reader::skipSpaces() -{ - while ( current_ != end_ ) - { - Char c = *current_; - if ( c == ' ' || c == '\t' || c == '\r' || c == '\n' ) - ++current_; - else - break; - } +void Reader::readNumber() { + while (current_ != end_) { + if (!(*current_ >= '0' && *current_ <= '9') && + !in(*current_, '.', 'e', 'E', '+', '-')) + break; + ++current_; + } } - -bool -Reader::match( Location pattern, - int patternLength ) -{ - if ( end_ - current_ < patternLength ) - return false; - int index = patternLength; - while ( index-- ) - if ( current_[index] != pattern[index] ) - return false; - current_ += patternLength; - return true; -} - - -bool -Reader::readComment() -{ - Location commentBegin = current_ - 1; - Char c = getNextChar(); - bool successful = false; - if ( c == '*' ) - successful = readCStyleComment(); - else if ( c == '/' ) - successful = readCppStyleComment(); - if ( !successful ) - return false; - - if ( collectComments_ ) - { - CommentPlacement placement = commentBefore; - if ( lastValueEnd_ && !containsNewLine( lastValueEnd_, commentBegin ) ) - { - if ( c != '*' || !containsNewLine( commentBegin, current_ ) ) - placement = commentAfterOnSameLine; - } - - addComment( commentBegin, current_, placement ); - } - return true; -} - - -void -Reader::addComment( Location begin, - Location end, - CommentPlacement placement ) -{ - assert( collectComments_ ); - if ( placement == commentAfterOnSameLine ) - { - assert( lastValue_ != 0 ); - lastValue_->setComment( std::string( begin, end ), placement ); - } - else - { - if ( !commentsBefore_.empty() ) - commentsBefore_ += "\n"; - commentsBefore_ += std::string( begin, end ); - } -} - - -bool -Reader::readCStyleComment() -{ - while ( current_ != end_ ) - { - Char c = getNextChar(); - if ( c == '*' && *current_ == '/' ) - break; - } - return getNextChar() == '/'; -} - - -bool -Reader::readCppStyleComment() -{ - while ( current_ != end_ ) - { - Char c = getNextChar(); - if ( c == '\r' || c == '\n' ) - break; - } - return true; -} - - -void -Reader::readNumber() -{ - while ( current_ != end_ ) - { - if ( !(*current_ >= '0' && *current_ <= '9') && - !in( *current_, '.', 'e', 'E', '+', '-' ) ) - break; - ++current_; - } -} - -bool -Reader::readString() -{ - Char c = 0; - while ( current_ != end_ ) - { - c = getNextChar(); - if ( c == '\\' ) - getNextChar(); - else if ( c == '"' ) - break; - } - return c == '"'; -} - - -bool -Reader::readObject( Token &/*tokenStart*/ ) -{ - Token tokenName; - std::string name; - currentValue() = Value( objectValue ); - while ( readToken( tokenName ) ) - { - bool initialTokenOk = true; - while ( tokenName.type_ == tokenComment && initialTokenOk ) - initialTokenOk = readToken( tokenName ); - if ( !initialTokenOk ) - break; - if ( tokenName.type_ == tokenObjectEnd && name.empty() ) // empty object - return true; - if ( tokenName.type_ != tokenString ) - break; - - name = ""; - if ( !decodeString( tokenName, name ) ) - return recoverFromError( tokenObjectEnd ); - - Token colon; - if ( !readToken( colon ) || colon.type_ != tokenMemberSeparator ) - { - return addErrorAndRecover( "Missing ':' after object member name", - colon, - tokenObjectEnd ); - } - Value &value = currentValue()[ name ]; - nodes_.push( &value ); - bool ok = readValue(); - nodes_.pop(); - if ( !ok ) // error already set - return recoverFromError( tokenObjectEnd ); - - Token comma; - if ( !readToken( comma ) - || ( comma.type_ != tokenObjectEnd && - comma.type_ != tokenArraySeparator && - comma.type_ != tokenComment ) ) - { - return addErrorAndRecover( "Missing ',' or '}' in object declaration", - comma, - tokenObjectEnd ); - } - bool finalizeTokenOk = true; - while ( comma.type_ == tokenComment && - finalizeTokenOk ) - finalizeTokenOk = readToken( comma ); - if ( comma.type_ == tokenObjectEnd ) - return true; - } - return addErrorAndRecover( "Missing '}' or object member name", - tokenName, - tokenObjectEnd ); -} - - -bool -Reader::readArray( Token &/*tokenStart*/ ) -{ - currentValue() = Value( arrayValue ); - skipSpaces(); - if ( *current_ == ']' ) // empty array - { - Token endArray; - readToken( endArray ); +bool Reader::readString() { + Char c = 0; + while (current_ != end_) { + c = getNextChar(); + if (c == '\\') + getNextChar(); + else if (c == '"') + break; + } + return c == '"'; +} + +bool Reader::readObject(Token & /*tokenStart*/) { + Token tokenName; + std::string name; + currentValue() = Value(objectValue); + while (readToken(tokenName)) { + bool initialTokenOk = true; + while (tokenName.type_ == tokenComment && initialTokenOk) + initialTokenOk = readToken(tokenName); + if (!initialTokenOk) + break; + if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object return true; - } - int index = 0; - for (;;) - { - Value &value = currentValue()[ index++ ]; - nodes_.push( &value ); - bool ok = readValue(); - nodes_.pop(); - if ( !ok ) // error already set - return recoverFromError( tokenArrayEnd ); - - Token token; - // Accept Comment after last item in the array. - ok = readToken( token ); - while ( token.type_ == tokenComment && ok ) - { - ok = readToken( token ); - } - bool badTokenType = ( token.type_ != tokenArraySeparator && - token.type_ != tokenArrayEnd ); - if ( !ok || badTokenType ) - { - return addErrorAndRecover( "Missing ',' or ']' in array declaration", - token, - tokenArrayEnd ); - } - if ( token.type_ == tokenArrayEnd ) - break; - } - return true; -} - - -bool -Reader::decodeNumber( Token &token ) -{ - bool isDouble = false; - for ( Location inspect = token.start_; inspect != token.end_; ++inspect ) - { - isDouble = isDouble - || in( *inspect, '.', 'e', 'E', '+' ) - || ( *inspect == '-' && inspect != token.start_ ); - } - if ( isDouble ) - return decodeDouble( token ); - // Attempts to parse the number as an integer. If the number is - // larger than the maximum supported value of an integer then - // we decode the number as a double. - Location current = token.start_; - bool isNegative = *current == '-'; - if ( isNegative ) - ++current; - Value::LargestUInt maxIntegerValue = isNegative ? Value::LargestUInt(-Value::minLargestInt) - : Value::maxLargestUInt; - Value::LargestUInt threshold = maxIntegerValue / 10; - Value::LargestUInt value = 0; - while ( current < token.end_ ) - { - Char c = *current++; - if ( c < '0' || c > '9' ) - return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token ); - Value::UInt digit(c - '0'); - if ( value >= threshold ) - { - // We've hit or exceeded the max value divided by 10 (rounded down). If - // a) we've only just touched the limit, b) this is the last digit, and - // c) it's small enough to fit in that rounding delta, we're okay. - // Otherwise treat this number as a double to avoid overflow. - if (value > threshold || - current != token.end_ || - digit > maxIntegerValue % 10) - { - return decodeDouble( token ); - } - } - value = value * 10 + digit; - } - if ( isNegative ) - currentValue() = -Value::LargestInt( value ); - else if ( value <= Value::LargestUInt(Value::maxInt) ) - currentValue() = Value::LargestInt( value ); - else - currentValue() = value; - return true; -} - - -bool -Reader::decodeDouble( Token &token ) -{ - double value = 0; - const int bufferSize = 32; - int count; - int length = int(token.end_ - token.start_); - - // Sanity check to avoid buffer overflow exploits. - if (length < 0) { - return addError( "Unable to parse token length", token ); - } - - // Avoid using a string constant for the format control string given to - // sscanf, as this can cause hard to debug crashes on OS X. See here for more - // info: - // - // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html - char format[] = "%lf"; - - if ( length <= bufferSize ) - { - Char buffer[bufferSize+1]; - memcpy( buffer, token.start_, length ); - buffer[length] = 0; - count = sscanf( buffer, format, &value ); - } - else - { - std::string buffer( token.start_, token.end_ ); - count = sscanf( buffer.c_str(), format, &value ); - } - - if ( count != 1 ) - return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token ); - currentValue() = value; - return true; -} - - -bool -Reader::decodeString( Token &token ) -{ - std::string decoded; - if ( !decodeString( token, decoded ) ) - return false; - currentValue() = decoded; - return true; -} - - -bool -Reader::decodeString( Token &token, std::string &decoded ) -{ - decoded.reserve( token.end_ - token.start_ - 2 ); - Location current = token.start_ + 1; // skip '"' - Location end = token.end_ - 1; // do not include '"' - while ( current != end ) - { - Char c = *current++; - if ( c == '"' ) - break; - else if ( c == '\\' ) - { - if ( current == end ) - return addError( "Empty escape sequence in string", token, current ); - Char escape = *current++; - switch ( escape ) - { - case '"': decoded += '"'; break; - case '/': decoded += '/'; break; - case '\\': decoded += '\\'; break; - case 'b': decoded += '\b'; break; - case 'f': decoded += '\f'; break; - case 'n': decoded += '\n'; break; - case 'r': decoded += '\r'; break; - case 't': decoded += '\t'; break; - case 'u': - { - unsigned int unicode; - if ( !decodeUnicodeCodePoint( token, current, end, unicode ) ) - return false; - decoded += codePointToUTF8(unicode); - } - break; - default: - return addError( "Bad escape sequence in string", token, current ); - } - } - else - { - decoded += c; - } - } - return true; -} - -bool -Reader::decodeUnicodeCodePoint( Token &token, - Location ¤t, - Location end, - unsigned int &unicode ) -{ + if (tokenName.type_ != tokenString) + break; - if ( !decodeUnicodeEscapeSequence( token, current, end, unicode ) ) - return false; - if (unicode >= 0xD800 && unicode <= 0xDBFF) - { - // surrogate pairs - if (end - current < 6) - return addError( "additional six characters expected to parse unicode surrogate pair.", token, current ); - unsigned int surrogatePair; - if (*(current++) == '\\' && *(current++)== 'u') - { - if (decodeUnicodeEscapeSequence( token, current, end, surrogatePair )) - { - unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); - } - else - return false; - } - else - return addError( "expecting another \\u token to begin the second half of a unicode surrogate pair", token, current ); - } - return true; -} - -bool -Reader::decodeUnicodeEscapeSequence( Token &token, - Location ¤t, - Location end, - unsigned int &unicode ) -{ - if ( end - current < 4 ) - return addError( "Bad unicode escape sequence in string: four digits expected.", token, current ); - unicode = 0; - for ( int index =0; index < 4; ++index ) - { - Char c = *current++; - unicode *= 16; - if ( c >= '0' && c <= '9' ) - unicode += c - '0'; - else if ( c >= 'a' && c <= 'f' ) - unicode += c - 'a' + 10; - else if ( c >= 'A' && c <= 'F' ) - unicode += c - 'A' + 10; - else - return addError( "Bad unicode escape sequence in string: hexadecimal digit expected.", token, current ); - } - return true; -} - - -bool -Reader::addError( const std::string &message, - Token &token, - Location extra ) -{ - ErrorInfo info; - info.token_ = token; - info.message_ = message; - info.extra_ = extra; - errors_.push_back( info ); - return false; -} - - -bool -Reader::recoverFromError( TokenType skipUntilToken ) -{ - int errorCount = int(errors_.size()); - Token skip; - for (;;) - { - if ( !readToken(skip) ) - errors_.resize( errorCount ); // discard errors caused by recovery - if ( skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream ) - break; - } - errors_.resize( errorCount ); - return false; -} - - -bool -Reader::addErrorAndRecover( const std::string &message, - Token &token, - TokenType skipUntilToken ) -{ - addError( message, token ); - return recoverFromError( skipUntilToken ); -} - - -Value & -Reader::currentValue() -{ - return *(nodes_.top()); -} - - -Reader::Char -Reader::getNextChar() -{ - if ( current_ == end_ ) - return 0; - return *current_++; -} - - -void -Reader::getLocationLineAndColumn( Location location, - int &line, - int &column ) const -{ - Location current = begin_; - Location lastLineStart = current; - line = 0; - while ( current < location && current != end_ ) - { - Char c = *current++; - if ( c == '\r' ) - { - if ( *current == '\n' ) - ++current; - lastLineStart = current; - ++line; + name = ""; + if (!decodeString(tokenName, name)) + return recoverFromError(tokenObjectEnd); + + Token colon; + if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { + return addErrorAndRecover("Missing ':' after object member name", colon, + tokenObjectEnd); + } + Value &value = currentValue()[name]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenObjectEnd); + + Token comma; + if (!readToken(comma) || + (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && + comma.type_ != tokenComment)) { + return addErrorAndRecover("Missing ',' or '}' in object declaration", + comma, tokenObjectEnd); + } + bool finalizeTokenOk = true; + while (comma.type_ == tokenComment && finalizeTokenOk) + finalizeTokenOk = readToken(comma); + if (comma.type_ == tokenObjectEnd) + return true; + } + return addErrorAndRecover("Missing '}' or object member name", tokenName, + tokenObjectEnd); +} + +bool Reader::readArray(Token & /*tokenStart*/) { + currentValue() = Value(arrayValue); + skipSpaces(); + if (*current_ == ']') // empty array + { + Token endArray; + readToken(endArray); + return true; + } + int index = 0; + for (;;) { + Value &value = currentValue()[index++]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenArrayEnd); + + Token token; + // Accept Comment after last item in the array. + ok = readToken(token); + while (token.type_ == tokenComment && ok) { + ok = readToken(token); + } + bool badTokenType = + (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); + if (!ok || badTokenType) { + return addErrorAndRecover("Missing ',' or ']' in array declaration", + token, tokenArrayEnd); + } + if (token.type_ == tokenArrayEnd) + break; + } + return true; +} + +bool Reader::decodeNumber(Token &token) { + bool isDouble = false; + for (Location inspect = token.start_; inspect != token.end_; ++inspect) { + isDouble = isDouble || in(*inspect, '.', 'e', 'E', '+') || + (*inspect == '-' && inspect != token.start_); + } + if (isDouble) + return decodeDouble(token); + // Attempts to parse the number as an integer. If the number is + // larger than the maximum supported value of an integer then + // we decode the number as a double. + Location current = token.start_; + bool isNegative = *current == '-'; + if (isNegative) + ++current; + Value::LargestUInt maxIntegerValue = + isNegative ? Value::LargestUInt(-Value::minLargestInt) + : Value::maxLargestUInt; + Value::LargestUInt threshold = maxIntegerValue / 10; + Value::LargestUInt value = 0; + while (current < token.end_) { + Char c = *current++; + if (c < '0' || c > '9') + return addError("'" + std::string(token.start_, token.end_) + + "' is not a number.", + token); + Value::UInt digit(c - '0'); + if (value >= threshold) { + // We've hit or exceeded the max value divided by 10 (rounded down). If + // a) we've only just touched the limit, b) this is the last digit, and + // c) it's small enough to fit in that rounding delta, we're okay. + // Otherwise treat this number as a double to avoid overflow. + if (value > threshold || current != token.end_ || + digit > maxIntegerValue % 10) { + return decodeDouble(token); } - else if ( c == '\n' ) - { - lastLineStart = current; - ++line; + } + value = value * 10 + digit; + } + if (isNegative) + currentValue() = -Value::LargestInt(value); + else if (value <= Value::LargestUInt(Value::maxInt)) + currentValue() = Value::LargestInt(value); + else + currentValue() = value; + return true; +} + +bool Reader::decodeDouble(Token &token) { + double value = 0; + const int bufferSize = 32; + int count; + int length = int(token.end_ - token.start_); + + // Sanity check to avoid buffer overflow exploits. + if (length < 0) { + return addError("Unable to parse token length", token); + } + + // Avoid using a string constant for the format control string given to + // sscanf, as this can cause hard to debug crashes on OS X. See here for more + // info: + // + // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html + char format[] = "%lf"; + + if (length <= bufferSize) { + Char buffer[bufferSize + 1]; + memcpy(buffer, token.start_, length); + buffer[length] = 0; + count = sscanf(buffer, format, &value); + } else { + std::string buffer(token.start_, token.end_); + count = sscanf(buffer.c_str(), format, &value); + } + + if (count != 1) + return addError("'" + std::string(token.start_, token.end_) + + "' is not a number.", + token); + currentValue() = value; + return true; +} + +bool Reader::decodeString(Token &token) { + std::string decoded; + if (!decodeString(token, decoded)) + return false; + currentValue() = decoded; + return true; +} + +bool Reader::decodeString(Token &token, std::string &decoded) { + decoded.reserve(token.end_ - token.start_ - 2); + Location current = token.start_ + 1; // skip '"' + Location end = token.end_ - 1; // do not include '"' + while (current != end) { + Char c = *current++; + if (c == '"') + break; + else if (c == '\\') { + if (current == end) + return addError("Empty escape sequence in string", token, current); + Char escape = *current++; + switch (escape) { + case '"': + decoded += '"'; + break; + case '/': + decoded += '/'; + break; + case '\\': + decoded += '\\'; + break; + case 'b': + decoded += '\b'; + break; + case 'f': + decoded += '\f'; + break; + case 'n': + decoded += '\n'; + break; + case 'r': + decoded += '\r'; + break; + case 't': + decoded += '\t'; + break; + case 'u': { + unsigned int unicode; + if (!decodeUnicodeCodePoint(token, current, end, unicode)) + return false; + decoded += codePointToUTF8(unicode); + } break; + default: + return addError("Bad escape sequence in string", token, current); } - } - // column & line start at 1 - column = int(location - lastLineStart) + 1; - ++line; -} - - -std::string -Reader::getLocationLineAndColumn( Location location ) const -{ - int line, column; - getLocationLineAndColumn( location, line, column ); - char buffer[18+16+16+1]; - sprintf( buffer, "Line %d, Column %d", line, column ); - return buffer; + } else { + decoded += c; + } + } + return true; +} + +bool Reader::decodeUnicodeCodePoint(Token &token, Location ¤t, + Location end, unsigned int &unicode) { + + if (!decodeUnicodeEscapeSequence(token, current, end, unicode)) + return false; + if (unicode >= 0xD800 && unicode <= 0xDBFF) { + // surrogate pairs + if (end - current < 6) + return addError( + "additional six characters expected to parse unicode surrogate pair.", + token, current); + unsigned int surrogatePair; + if (*(current++) == '\\' && *(current++) == 'u') { + if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { + unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); + } else + return false; + } else + return addError("expecting another \\u token to begin the second half of " + "a unicode surrogate pair", + token, current); + } + return true; +} + +bool Reader::decodeUnicodeEscapeSequence(Token &token, Location ¤t, + Location end, unsigned int &unicode) { + if (end - current < 4) + return addError( + "Bad unicode escape sequence in string: four digits expected.", token, + current); + unicode = 0; + for (int index = 0; index < 4; ++index) { + Char c = *current++; + unicode *= 16; + if (c >= '0' && c <= '9') + unicode += c - '0'; + else if (c >= 'a' && c <= 'f') + unicode += c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + unicode += c - 'A' + 10; + else + return addError( + "Bad unicode escape sequence in string: hexadecimal digit expected.", + token, current); + } + return true; +} + +bool Reader::addError(const std::string &message, Token &token, + Location extra) { + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = extra; + errors_.push_back(info); + return false; +} + +bool Reader::recoverFromError(TokenType skipUntilToken) { + int errorCount = int(errors_.size()); + Token skip; + for (;;) { + if (!readToken(skip)) + errors_.resize(errorCount); // discard errors caused by recovery + if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream) + break; + } + errors_.resize(errorCount); + return false; +} + +bool Reader::addErrorAndRecover(const std::string &message, Token &token, + TokenType skipUntilToken) { + addError(message, token); + return recoverFromError(skipUntilToken); +} + +Value &Reader::currentValue() { return *(nodes_.top()); } + +Reader::Char Reader::getNextChar() { + if (current_ == end_) + return 0; + return *current_++; +} + +void Reader::getLocationLineAndColumn(Location location, int &line, + int &column) const { + Location current = begin_; + Location lastLineStart = current; + line = 0; + while (current < location && current != end_) { + Char c = *current++; + if (c == '\r') { + if (*current == '\n') + ++current; + lastLineStart = current; + ++line; + } else if (c == '\n') { + lastLineStart = current; + ++line; + } + } + // column & line start at 1 + column = int(location - lastLineStart) + 1; + ++line; +} + +std::string Reader::getLocationLineAndColumn(Location location) const { + int line, column; + getLocationLineAndColumn(location, line, column); + char buffer[18 + 16 + 16 + 1]; + sprintf(buffer, "Line %d, Column %d", line, column); + return buffer; } - // Deprecated. Preserved for backward compatibility -std::string -Reader::getFormatedErrorMessages() const -{ - return getFormattedErrorMessages(); -} - - -std::string -Reader::getFormattedErrorMessages() const -{ - std::string formattedMessage; - for ( Errors::const_iterator itError = errors_.begin(); - itError != errors_.end(); - ++itError ) - { - const ErrorInfo &error = *itError; - formattedMessage += "* " + getLocationLineAndColumn( error.token_.start_ ) + "\n"; - formattedMessage += " " + error.message_ + "\n"; - if ( error.extra_ ) - formattedMessage += "See " + getLocationLineAndColumn( error.extra_ ) + " for detail.\n"; - } - return formattedMessage; +std::string Reader::getFormatedErrorMessages() const { + return getFormattedErrorMessages(); +} + +std::string Reader::getFormattedErrorMessages() const { + std::string formattedMessage; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); ++itError) { + const ErrorInfo &error = *itError; + formattedMessage += + "* " + getLocationLineAndColumn(error.token_.start_) + "\n"; + formattedMessage += " " + error.message_ + "\n"; + if (error.extra_) + formattedMessage += + "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n"; + } + return formattedMessage; +} + +std::istream &operator>>(std::istream &sin, Value &root) { + Json::Reader reader; + bool ok = reader.parse(sin, root, true); + if (!ok) + JSON_FAIL_MESSAGE(reader.getFormattedErrorMessages()); + return sin; } - -std::istream& operator>>( std::istream &sin, Value &root ) -{ - Json::Reader reader; - bool ok = reader.parse(sin, root, true); - if (!ok) JSON_FAIL_MESSAGE(reader.getFormattedErrorMessages()); - return sin; -} - - } // namespace Json diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json_tool.h b/libvisual-plugins/plugins/actor/lcdcontrol/json_tool.h index 658031bbb..b07a07355 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json_tool.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json_tool.h @@ -4,7 +4,7 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED -# define LIB_JSONCPP_JSON_TOOL_H_INCLUDED +#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED /* This header provides common string manipulation support, such as UTF-8, * portable conversion from/to string... @@ -15,79 +15,59 @@ namespace Json { /// Converts a unicode code-point to UTF-8. -static inline std::string -codePointToUTF8(unsigned int cp) -{ - std::string result; - - // based on description from http://en.wikipedia.org/wiki/UTF-8 +static inline std::string codePointToUTF8(unsigned int cp) { + std::string result; - if (cp <= 0x7f) - { - result.resize(1); - result[0] = static_cast(cp); - } - else if (cp <= 0x7FF) - { - result.resize(2); - result[1] = static_cast(0x80 | (0x3f & cp)); - result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); - } - else if (cp <= 0xFFFF) - { - result.resize(3); - result[2] = static_cast(0x80 | (0x3f & cp)); - result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); - result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); - } - else if (cp <= 0x10FFFF) - { - result.resize(4); - result[3] = static_cast(0x80 | (0x3f & cp)); - result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); - result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); - result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); - } - - return result; -} + // based on description from http://en.wikipedia.org/wiki/UTF-8 + if (cp <= 0x7f) { + result.resize(1); + result[0] = static_cast(cp); + } else if (cp <= 0x7FF) { + result.resize(2); + result[1] = static_cast(0x80 | (0x3f & cp)); + result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); + } else if (cp <= 0xFFFF) { + result.resize(3); + result[2] = static_cast(0x80 | (0x3f & cp)); + result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); + result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); + } else if (cp <= 0x10FFFF) { + result.resize(4); + result[3] = static_cast(0x80 | (0x3f & cp)); + result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); + result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); + result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); + } -/// Returns true if ch is a control character (in range [0,32[). -static inline bool -isControlCharacter(char ch) -{ - return ch > 0 && ch <= 0x1F; + return result; } +/// Returns true if ch is a control character (in range [0,32[). +static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } -enum { - /// Constant that specify the size of the buffer that must be passed to uintToString. - uintToStringBufferSize = 3*sizeof(LargestUInt)+1 +enum { + /// Constant that specify the size of the buffer that must be passed to + /// uintToString. + uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 }; // Defines a char buffer for use with uintToString(). typedef char UIntToStringBuffer[uintToStringBufferSize]; - /** Converts an unsigned integer to string. * @param value Unsigned interger to convert to string - * @param current Input/Output string buffer. + * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ -static inline void -uintToString( LargestUInt value, - char *¤t ) -{ - *--current = 0; - do - { - *--current = char(value % 10) + '0'; - value /= 10; - } - while ( value != 0 ); +static inline void uintToString(LargestUInt value, char *¤t) { + *--current = 0; + do { + *--current = char(value % 10) + '0'; + value /= 10; + } while (value != 0); } -} // namespace Json { +} // namespace Json #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json_value.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/json_value.cpp index 3ba36fe71..b788f2800 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json_value.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json_value.cpp @@ -4,12 +4,12 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #if !defined(JSON_IS_AMALGAMATION) -# include -# include -# include -# ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR -# include "json_batchallocator.h" -# endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +#include +#include +#include +#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +#include "json_batchallocator.h" +#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR #endif // if !defined(JSON_IS_AMALGAMATION) #include #include @@ -19,59 +19,54 @@ #include #include #ifdef JSON_USE_CPPTL -# include +#include #endif -#include // size_t +#include // size_t -#define JSON_ASSERT_UNREACHABLE assert( false ) +#define JSON_ASSERT_UNREACHABLE assert(false) namespace Json { const Value Value::null; -const Int Value::minInt = Int( ~(UInt(-1)/2) ); -const Int Value::maxInt = Int( UInt(-1)/2 ); +const Int Value::minInt = Int(~(UInt(-1) / 2)); +const Int Value::maxInt = Int(UInt(-1) / 2); const UInt Value::maxUInt = UInt(-1); -# if defined(JSON_HAS_INT64) -const Int64 Value::minInt64 = Int64( ~(UInt64(-1)/2) ); -const Int64 Value::maxInt64 = Int64( UInt64(-1)/2 ); +#if defined(JSON_HAS_INT64) +const Int64 Value::minInt64 = Int64(~(UInt64(-1) / 2)); +const Int64 Value::maxInt64 = Int64(UInt64(-1) / 2); const UInt64 Value::maxUInt64 = UInt64(-1); // The constant is hard-coded because some compiler have trouble // converting Value::maxUInt64 to a double correctly (AIX/xlC). // Assumes that UInt64 is a 64 bits integer. static const double maxUInt64AsDouble = 18446744073709551615.0; #endif // defined(JSON_HAS_INT64) -const LargestInt Value::minLargestInt = LargestInt( ~(LargestUInt(-1)/2) ); -const LargestInt Value::maxLargestInt = LargestInt( LargestUInt(-1)/2 ); +const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2)); +const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2); const LargestUInt Value::maxLargestUInt = LargestUInt(-1); - /// Unknown size marker static const unsigned int unknown = (unsigned)-1; #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) template static inline bool InRange(double d, T min, U max) { - return d >= min && d <= max; + return d >= min && d <= max; } -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) -static inline double integerToDouble( Json::UInt64 value ) -{ - return static_cast( Int64(value/2) ) * 2.0 + Int64(value & 1); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) +static inline double integerToDouble(Json::UInt64 value) { + return static_cast(Int64(value / 2)) * 2.0 + Int64(value & 1); } -template -static inline double integerToDouble( T value ) -{ - return static_cast( value ); +template static inline double integerToDouble(T value) { + return static_cast(value); } template static inline bool InRange(double d, T min, U max) { - return d >= integerToDouble(min) && d <= integerToDouble(max); + return d >= integerToDouble(min) && d <= integerToDouble(max); } #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - /** Duplicates the specified string value. * @param value Pointer to the string to duplicate. Must be zero-terminated if * length is "unknown". @@ -79,38 +74,32 @@ static inline bool InRange(double d, T min, U max) { * computed using strlen(value). * @return Pointer on the duplicate instance of string. */ -static inline char * -duplicateStringValue( const char *value, - unsigned int length = unknown ) -{ - if ( length == unknown ) - length = (unsigned int)strlen(value); +static inline char *duplicateStringValue(const char *value, + unsigned int length = unknown) { + if (length == unknown) + length = (unsigned int)strlen(value); - // Avoid an integer overflow in the call to malloc below by limiting length - // to a sane value. - if (length >= (unsigned)Value::maxInt) - length = Value::maxInt - 1; + // Avoid an integer overflow in the call to malloc below by limiting length + // to a sane value. + if (length >= (unsigned)Value::maxInt) + length = Value::maxInt - 1; - char *newString = static_cast( malloc( length + 1 ) ); - JSON_ASSERT_MESSAGE( newString != 0, "Failed to allocate string value buffer" ); - memcpy( newString, value, length ); - newString[length] = 0; - return newString; + char *newString = static_cast(malloc(length + 1)); + JSON_ASSERT_MESSAGE(newString != 0, "Failed to allocate string value buffer"); + memcpy(newString, value, length); + newString[length] = 0; + return newString; } - /** Free the string duplicated by duplicateStringValue(). */ -static inline void -releaseStringValue( char *value ) -{ - if ( value ) - free( value ); +static inline void releaseStringValue(char *value) { + if (value) + free(value); } } // namespace Json - // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -119,12 +108,12 @@ releaseStringValue( char *value ) // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// #if !defined(JSON_IS_AMALGAMATION) -# ifdef JSON_VALUE_USE_INTERNAL_MAP -# include "json_internalarray.inl" -# include "json_internalmap.inl" -# endif // JSON_VALUE_USE_INTERNAL_MAP +#ifdef JSON_VALUE_USE_INTERNAL_MAP +#include "json_internalarray.inl" +#include "json_internalmap.inl" +#endif // JSON_VALUE_USE_INTERNAL_MAP -# include "json_valueiterator.inl" +#include "json_valueiterator.inl" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { @@ -137,31 +126,23 @@ namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// +Value::CommentInfo::CommentInfo() : comment_(0) {} -Value::CommentInfo::CommentInfo() - : comment_( 0 ) -{ -} - -Value::CommentInfo::~CommentInfo() -{ - if ( comment_ ) - releaseStringValue( comment_ ); +Value::CommentInfo::~CommentInfo() { + if (comment_) + releaseStringValue(comment_); } - -void -Value::CommentInfo::setComment( const char *text ) -{ - if ( comment_ ) - releaseStringValue( comment_ ); - JSON_ASSERT( text != 0 ); - JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /"); - // It seems that /**/ style comments are acceptable as well. - comment_ = duplicateStringValue( text ); +void Value::CommentInfo::setComment(const char *text) { + if (comment_) + releaseStringValue(comment_); + JSON_ASSERT(text != 0); + JSON_ASSERT_MESSAGE(text[0] == '\0' || text[0] == '/', + "Comments must start with /"); + // It seems that /**/ style comments are acceptable as well. + comment_ = duplicateStringValue(text); } - // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -169,93 +150,61 @@ Value::CommentInfo::setComment( const char *text ) // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// -# ifndef JSON_VALUE_USE_INTERNAL_MAP +#ifndef JSON_VALUE_USE_INTERNAL_MAP // Notes: index_ indicates if the string was allocated when // a string is stored. -Value::CZString::CZString( ArrayIndex index ) - : cstr_( 0 ) - , index_( index ) -{ -} - -Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) - : cstr_( allocate == duplicate ? duplicateStringValue(cstr) - : cstr ) - , index_( allocate ) -{ -} +Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {} -Value::CZString::CZString( const CZString &other ) -: cstr_( other.index_ != noDuplication && other.cstr_ != 0 - ? duplicateStringValue( other.cstr_ ) - : other.cstr_ ) - , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) - : other.index_ ) -{ -} +Value::CZString::CZString(const char *cstr, DuplicationPolicy allocate) + : cstr_(allocate == duplicate ? duplicateStringValue(cstr) : cstr), + index_(allocate) {} -Value::CZString::~CZString() -{ - if ( cstr_ && index_ == duplicate ) - releaseStringValue( const_cast( cstr_ ) ); -} +Value::CZString::CZString(const CZString &other) + : cstr_(other.index_ != noDuplication && other.cstr_ != 0 + ? duplicateStringValue(other.cstr_) + : other.cstr_), + index_(other.cstr_ + ? (other.index_ == noDuplication ? noDuplication : duplicate) + : other.index_) {} -void -Value::CZString::swap( CZString &other ) -{ - std::swap( cstr_, other.cstr_ ); - std::swap( index_, other.index_ ); +Value::CZString::~CZString() { + if (cstr_ && index_ == duplicate) + releaseStringValue(const_cast(cstr_)); } -Value::CZString & -Value::CZString::operator =( const CZString &other ) -{ - CZString temp( other ); - swap( temp ); - return *this; +void Value::CZString::swap(CZString &other) { + std::swap(cstr_, other.cstr_); + std::swap(index_, other.index_); } -bool -Value::CZString::operator<( const CZString &other ) const -{ - if ( cstr_ ) - return strcmp( cstr_, other.cstr_ ) < 0; - return index_ < other.index_; +Value::CZString &Value::CZString::operator=(const CZString &other) { + CZString temp(other); + swap(temp); + return *this; } -bool -Value::CZString::operator==( const CZString &other ) const -{ - if ( cstr_ ) - return strcmp( cstr_, other.cstr_ ) == 0; - return index_ == other.index_; +bool Value::CZString::operator<(const CZString &other) const { + if (cstr_) + return strcmp(cstr_, other.cstr_) < 0; + return index_ < other.index_; } - -ArrayIndex -Value::CZString::index() const -{ - return index_; +bool Value::CZString::operator==(const CZString &other) const { + if (cstr_) + return strcmp(cstr_, other.cstr_) == 0; + return index_ == other.index_; } +ArrayIndex Value::CZString::index() const { return index_; } -const char * -Value::CZString::c_str() const -{ - return cstr_; -} +const char *Value::CZString::c_str() const { return cstr_; } -bool -Value::CZString::isStaticString() const -{ - return index_ == noDuplication; -} +bool Value::CZString::isStaticString() const { return index_ == noDuplication; } #endif // ifndef JSON_VALUE_USE_INTERNAL_MAP - // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -268,1083 +217,883 @@ Value::CZString::isStaticString() const * memset( this, 0, sizeof(Value) ) * This optimization is used in ValueInternalMap fast allocator. */ -Value::Value( ValueType type ) - : type_( type ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(ValueType type) + : type_(type), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - switch ( type ) - { - case nullValue: - break; - case intValue: - case uintValue: - value_.int_ = 0; - break; - case realValue: - value_.real_ = 0.0; - break; - case stringValue: - value_.string_ = 0; - break; + , + comments_(0) { + switch (type) { + case nullValue: + break; + case intValue: + case uintValue: + value_.int_ = 0; + break; + case realValue: + value_.real_ = 0.0; + break; + case stringValue: + value_.string_ = 0; + break; #ifndef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - case objectValue: - value_.map_ = new ObjectValues(); - break; + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(); + break; #else - case arrayValue: - value_.array_ = arrayAllocator()->newArray(); - break; - case objectValue: - value_.map_ = mapAllocator()->newMap(); - break; + case arrayValue: + value_.array_ = arrayAllocator()->newArray(); + break; + case objectValue: + value_.map_ = mapAllocator()->newMap(); + break; #endif - case booleanValue: - value_.bool_ = false; - break; - default: - JSON_ASSERT_UNREACHABLE; - } + case booleanValue: + value_.bool_ = false; + break; + default: + JSON_ASSERT_UNREACHABLE; + } } - -Value::Value( UInt value ) - : type_( uintValue ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(UInt value) + : type_(uintValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.uint_ = value; + , + comments_(0) { + value_.uint_ = value; } -Value::Value( Int value ) - : type_( intValue ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(Int value) + : type_(intValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.int_ = value; + , + comments_(0) { + value_.int_ = value; } - -# if defined(JSON_HAS_INT64) -Value::Value( Int64 value ) - : type_( intValue ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +#if defined(JSON_HAS_INT64) +Value::Value(Int64 value) + : type_(intValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.int_ = value; + , + comments_(0) { + value_.int_ = value; } - -Value::Value( UInt64 value ) - : type_( uintValue ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(UInt64 value) + : type_(uintValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.uint_ = value; + , + comments_(0) { + value_.uint_ = value; } #endif // defined(JSON_HAS_INT64) -Value::Value( double value ) - : type_( realValue ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(double value) + : type_(realValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.real_ = value; + , + comments_(0) { + value_.real_ = value; } -Value::Value( const char *value ) - : type_( stringValue ) - , allocated_( true ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(const char *value) + : type_(stringValue), allocated_(true) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.string_ = duplicateStringValue( value ); + , + comments_(0) { + value_.string_ = duplicateStringValue(value); } - -Value::Value( const char *beginValue, - const char *endValue ) - : type_( stringValue ) - , allocated_( true ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(const char *beginValue, const char *endValue) + : type_(stringValue), allocated_(true) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.string_ = duplicateStringValue( beginValue, - (unsigned int)(endValue - beginValue) ); + , + comments_(0) { + value_.string_ = + duplicateStringValue(beginValue, (unsigned int)(endValue - beginValue)); } - -Value::Value( const std::string &value ) - : type_( stringValue ) - , allocated_( true ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(const std::string &value) + : type_(stringValue), allocated_(true) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.string_ = duplicateStringValue( value.c_str(), - (unsigned int)value.length() ); - + , + comments_(0) { + value_.string_ = + duplicateStringValue(value.c_str(), (unsigned int)value.length()); } -Value::Value( const StaticString &value ) - : type_( stringValue ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(const StaticString &value) + : type_(stringValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.string_ = const_cast( value.c_str() ); + , + comments_(0) { + value_.string_ = const_cast(value.c_str()); } - -# ifdef JSON_USE_CPPTL -Value::Value( const CppTL::ConstString &value ) - : type_( stringValue ) - , allocated_( true ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +#ifdef JSON_USE_CPPTL +Value::Value(const CppTL::ConstString &value) + : type_(stringValue), allocated_(true) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.string_ = duplicateStringValue( value, value.length() ); + , + comments_(0) { + value_.string_ = duplicateStringValue(value, value.length()); } -# endif +#endif -Value::Value( bool value ) - : type_( booleanValue ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(bool value) + : type_(booleanValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - value_.bool_ = value; + , + comments_(0) { + value_.bool_ = value; } - -Value::Value( const Value &other ) - : type_( other.type_ ) - , allocated_( false ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) +Value::Value(const Value &other) + : type_(other.type_), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) #endif - , comments_( 0 ) -{ - switch ( type_ ) - { - case nullValue: - case intValue: - case uintValue: - case realValue: - case booleanValue: - value_ = other.value_; - break; - case stringValue: - if ( other.value_.string_ ) - { - value_.string_ = duplicateStringValue( other.value_.string_ ); - allocated_ = true; - } - else - value_.string_ = 0; - break; + , + comments_(0) { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + value_ = other.value_; + break; + case stringValue: + if (other.value_.string_) { + value_.string_ = duplicateStringValue(other.value_.string_); + allocated_ = true; + } else + value_.string_ = 0; + break; #ifndef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - case objectValue: - value_.map_ = new ObjectValues( *other.value_.map_ ); - break; + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(*other.value_.map_); + break; #else - case arrayValue: - value_.array_ = arrayAllocator()->newArrayCopy( *other.value_.array_ ); - break; - case objectValue: - value_.map_ = mapAllocator()->newMapCopy( *other.value_.map_ ); - break; + case arrayValue: + value_.array_ = arrayAllocator()->newArrayCopy(*other.value_.array_); + break; + case objectValue: + value_.map_ = mapAllocator()->newMapCopy(*other.value_.map_); + break; #endif - default: - JSON_ASSERT_UNREACHABLE; - } - if ( other.comments_ ) - { - comments_ = new CommentInfo[numberOfCommentPlacement]; - for ( int comment =0; comment < numberOfCommentPlacement; ++comment ) - { - const CommentInfo &otherComment = other.comments_[comment]; - if ( otherComment.comment_ ) - comments_[comment].setComment( otherComment.comment_ ); - } - } -} - - -Value::~Value() -{ - switch ( type_ ) - { - case nullValue: - case intValue: - case uintValue: - case realValue: - case booleanValue: - break; - case stringValue: - if ( allocated_ ) - releaseStringValue( value_.string_ ); - break; + default: + JSON_ASSERT_UNREACHABLE; + } + if (other.comments_) { + comments_ = new CommentInfo[numberOfCommentPlacement]; + for (int comment = 0; comment < numberOfCommentPlacement; ++comment) { + const CommentInfo &otherComment = other.comments_[comment]; + if (otherComment.comment_) + comments_[comment].setComment(otherComment.comment_); + } + } +} + +Value::~Value() { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + break; + case stringValue: + if (allocated_) + releaseStringValue(value_.string_); + break; #ifndef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - case objectValue: - delete value_.map_; - break; + case arrayValue: + case objectValue: + delete value_.map_; + break; #else - case arrayValue: - arrayAllocator()->destructArray( value_.array_ ); - break; - case objectValue: - mapAllocator()->destructMap( value_.map_ ); - break; + case arrayValue: + arrayAllocator()->destructArray(value_.array_); + break; + case objectValue: + mapAllocator()->destructMap(value_.map_); + break; #endif - default: - JSON_ASSERT_UNREACHABLE; - } - - if ( comments_ ) - delete[] comments_; -} - -Value & -Value::operator=( const Value &other ) -{ - Value temp( other ); - swap( temp ); - return *this; -} - -void -Value::swap( Value &other ) -{ - ValueType temp = type_; - type_ = other.type_; - other.type_ = temp; - std::swap( value_, other.value_ ); - int temp2 = allocated_; - allocated_ = other.allocated_; - other.allocated_ = temp2; -} - -ValueType -Value::type() const -{ - return type_; -} - - -int -Value::compare( const Value &other ) const -{ - if ( *this < other ) - return -1; - if ( *this > other ) - return 1; - return 0; -} - - -bool -Value::operator <( const Value &other ) const -{ - int typeDelta = type_ - other.type_; - if ( typeDelta ) - return typeDelta < 0 ? true : false; - switch ( type_ ) - { - case nullValue: - return false; - case intValue: - return value_.int_ < other.value_.int_; - case uintValue: - return value_.uint_ < other.value_.uint_; - case realValue: - return value_.real_ < other.value_.real_; - case booleanValue: - return value_.bool_ < other.value_.bool_; - case stringValue: - return ( value_.string_ == 0 && other.value_.string_ ) - || ( other.value_.string_ - && value_.string_ - && strcmp( value_.string_, other.value_.string_ ) < 0 ); + default: + JSON_ASSERT_UNREACHABLE; + } + + if (comments_) + delete[] comments_; +} + +Value &Value::operator=(const Value &other) { + Value temp(other); + swap(temp); + return *this; +} + +void Value::swap(Value &other) { + ValueType temp = type_; + type_ = other.type_; + other.type_ = temp; + std::swap(value_, other.value_); + int temp2 = allocated_; + allocated_ = other.allocated_; + other.allocated_ = temp2; +} + +ValueType Value::type() const { return type_; } + +int Value::compare(const Value &other) const { + if (*this < other) + return -1; + if (*this > other) + return 1; + return 0; +} + +bool Value::operator<(const Value &other) const { + int typeDelta = type_ - other.type_; + if (typeDelta) + return typeDelta < 0 ? true : false; + switch (type_) { + case nullValue: + return false; + case intValue: + return value_.int_ < other.value_.int_; + case uintValue: + return value_.uint_ < other.value_.uint_; + case realValue: + return value_.real_ < other.value_.real_; + case booleanValue: + return value_.bool_ < other.value_.bool_; + case stringValue: + return (value_.string_ == 0 && other.value_.string_) || + (other.value_.string_ && value_.string_ && + strcmp(value_.string_, other.value_.string_) < 0); #ifndef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - case objectValue: - { - int delta = int( value_.map_->size() - other.value_.map_->size() ); - if ( delta ) - return delta < 0; - return (*value_.map_) < (*other.value_.map_); - } + case arrayValue: + case objectValue: { + int delta = int(value_.map_->size() - other.value_.map_->size()); + if (delta) + return delta < 0; + return (*value_.map_) < (*other.value_.map_); + } #else - case arrayValue: - return value_.array_->compare( *(other.value_.array_) ) < 0; - case objectValue: - return value_.map_->compare( *(other.value_.map_) ) < 0; + case arrayValue: + return value_.array_->compare(*(other.value_.array_)) < 0; + case objectValue: + return value_.map_->compare(*(other.value_.map_)) < 0; #endif - default: - JSON_ASSERT_UNREACHABLE; - } - return false; // unreachable -} - -bool -Value::operator <=( const Value &other ) const -{ - return !(other < *this); -} - -bool -Value::operator >=( const Value &other ) const -{ - return !(*this < other); -} - -bool -Value::operator >( const Value &other ) const -{ - return other < *this; -} - -bool -Value::operator ==( const Value &other ) const -{ - //if ( type_ != other.type_ ) - // GCC 2.95.3 says: - // attempt to take address of bit-field structure member `Json::Value::type_' - // Beats me, but a temp solves the problem. - int temp = other.type_; - if ( type_ != temp ) - return false; - switch ( type_ ) - { - case nullValue: - return true; - case intValue: - return value_.int_ == other.value_.int_; - case uintValue: - return value_.uint_ == other.value_.uint_; - case realValue: - return value_.real_ == other.value_.real_; - case booleanValue: - return value_.bool_ == other.value_.bool_; - case stringValue: - return ( value_.string_ == other.value_.string_ ) - || ( other.value_.string_ - && value_.string_ - && strcmp( value_.string_, other.value_.string_ ) == 0 ); + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable +} + +bool Value::operator<=(const Value &other) const { return !(other < *this); } + +bool Value::operator>=(const Value &other) const { return !(*this < other); } + +bool Value::operator>(const Value &other) const { return other < *this; } + +bool Value::operator==(const Value &other) const { + // if ( type_ != other.type_ ) + // GCC 2.95.3 says: + // attempt to take address of bit-field structure member `Json::Value::type_' + // Beats me, but a temp solves the problem. + int temp = other.type_; + if (type_ != temp) + return false; + switch (type_) { + case nullValue: + return true; + case intValue: + return value_.int_ == other.value_.int_; + case uintValue: + return value_.uint_ == other.value_.uint_; + case realValue: + return value_.real_ == other.value_.real_; + case booleanValue: + return value_.bool_ == other.value_.bool_; + case stringValue: + return (value_.string_ == other.value_.string_) || + (other.value_.string_ && value_.string_ && + strcmp(value_.string_, other.value_.string_) == 0); #ifndef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - case objectValue: - return value_.map_->size() == other.value_.map_->size() - && (*value_.map_) == (*other.value_.map_); + case arrayValue: + case objectValue: + return value_.map_->size() == other.value_.map_->size() && + (*value_.map_) == (*other.value_.map_); #else - case arrayValue: - return value_.array_->compare( *(other.value_.array_) ) == 0; - case objectValue: - return value_.map_->compare( *(other.value_.map_) ) == 0; + case arrayValue: + return value_.array_->compare(*(other.value_.array_)) == 0; + case objectValue: + return value_.map_->compare(*(other.value_.map_)) == 0; #endif - default: - JSON_ASSERT_UNREACHABLE; - } - return false; // unreachable -} - -bool -Value::operator !=( const Value &other ) const -{ - return !( *this == other ); -} - -const char * -Value::asCString() const -{ - JSON_ASSERT( type_ == stringValue ); - return value_.string_; -} - - -std::string -Value::asString() const -{ - switch ( type_ ) - { - case nullValue: - return ""; - case stringValue: - return value_.string_ ? value_.string_ : ""; - case booleanValue: - return value_.bool_ ? "true" : "false"; - case intValue: - return valueToString( value_.int_ ); - case uintValue: - return valueToString( value_.uint_ ); - case realValue: - return valueToString( value_.real_ ); - default: - JSON_FAIL_MESSAGE( "Type is not convertible to string" ); - } -} - -# ifdef JSON_USE_CPPTL -CppTL::ConstString -Value::asConstString() const -{ - return CppTL::ConstString( asString().c_str() ); -} -# endif - - -Value::Int -Value::asInt() const -{ - switch ( type_ ) - { - case intValue: - JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range"); - return Int(value_.int_); - case uintValue: - JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range"); - return Int(value_.uint_); - case realValue: - JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt), "double out of Int range"); - return Int(value_.real_); - case nullValue: - return 0; - case booleanValue: - return value_.bool_ ? 1 : 0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to Int."); -} - - -Value::UInt -Value::asUInt() const -{ - switch ( type_ ) - { - case intValue: - JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range"); - return UInt(value_.int_); - case uintValue: - JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range"); - return UInt(value_.uint_); - case realValue: - JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt), "double out of UInt range"); - return UInt( value_.real_ ); - case nullValue: - return 0; - case booleanValue: - return value_.bool_ ? 1 : 0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to UInt."); -} - - -# if defined(JSON_HAS_INT64) - -Value::Int64 -Value::asInt64() const -{ - switch ( type_ ) - { - case intValue: - return Int64(value_.int_); - case uintValue: - JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range"); - return Int64(value_.uint_); - case realValue: - JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64), "double out of Int64 range"); - return Int64(value_.real_); - case nullValue: - return 0; - case booleanValue: - return value_.bool_ ? 1 : 0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to Int64."); -} - - -Value::UInt64 -Value::asUInt64() const -{ - switch ( type_ ) - { - case intValue: - JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range"); - return UInt64(value_.int_); - case uintValue: - return UInt64(value_.uint_); - case realValue: - JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64), "double out of UInt64 range"); - return UInt64( value_.real_ ); - case nullValue: - return 0; - case booleanValue: - return value_.bool_ ? 1 : 0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to UInt64."); -} -# endif // if defined(JSON_HAS_INT64) - - -LargestInt -Value::asLargestInt() const -{ -#if defined(JSON_NO_INT64) - return asInt(); -#else - return asInt64(); + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable +} + +bool Value::operator!=(const Value &other) const { return !(*this == other); } + +const char *Value::asCString() const { + JSON_ASSERT(type_ == stringValue); + return value_.string_; +} + +std::string Value::asString() const { + switch (type_) { + case nullValue: + return ""; + case stringValue: + return value_.string_ ? value_.string_ : ""; + case booleanValue: + return value_.bool_ ? "true" : "false"; + case intValue: + return valueToString(value_.int_); + case uintValue: + return valueToString(value_.uint_); + case realValue: + return valueToString(value_.real_); + default: + JSON_FAIL_MESSAGE("Type is not convertible to string"); + } +} + +#ifdef JSON_USE_CPPTL +CppTL::ConstString Value::asConstString() const { + return CppTL::ConstString(asString().c_str()); +} #endif + +Value::Int Value::asInt() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range"); + return Int(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range"); + return Int(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt), + "double out of Int range"); + return Int(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to Int."); +} + +Value::UInt Value::asUInt() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range"); + return UInt(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range"); + return UInt(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt), + "double out of UInt range"); + return UInt(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to UInt."); } +#if defined(JSON_HAS_INT64) -LargestUInt -Value::asLargestUInt() const -{ +Value::Int64 Value::asInt64() const { + switch (type_) { + case intValue: + return Int64(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range"); + return Int64(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64), + "double out of Int64 range"); + return Int64(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to Int64."); +} + +Value::UInt64 Value::asUInt64() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range"); + return UInt64(value_.int_); + case uintValue: + return UInt64(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64), + "double out of UInt64 range"); + return UInt64(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to UInt64."); +} +#endif // if defined(JSON_HAS_INT64) + +LargestInt Value::asLargestInt() const { #if defined(JSON_NO_INT64) - return asUInt(); + return asInt(); #else - return asUInt64(); + return asInt64(); #endif } +LargestUInt Value::asLargestUInt() const { +#if defined(JSON_NO_INT64) + return asUInt(); +#else + return asUInt64(); +#endif +} -double -Value::asDouble() const -{ - switch ( type_ ) - { - case intValue: - return static_cast( value_.int_ ); - case uintValue: +double Value::asDouble() const { + switch (type_) { + case intValue: + return static_cast(value_.int_); + case uintValue: #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( value_.uint_ ); -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return integerToDouble( value_.uint_ ); + return static_cast(value_.uint_); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return integerToDouble(value_.uint_); #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - case realValue: - return value_.real_; - case nullValue: - return 0.0; - case booleanValue: - return value_.bool_ ? 1.0 : 0.0; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to double."); -} - -float -Value::asFloat() const -{ - switch ( type_ ) - { - case intValue: - return static_cast( value_.int_ ); - case uintValue: + case realValue: + return value_.real_; + case nullValue: + return 0.0; + case booleanValue: + return value_.bool_ ? 1.0 : 0.0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to double."); +} + +float Value::asFloat() const { + switch (type_) { + case intValue: + return static_cast(value_.int_); + case uintValue: #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( value_.uint_ ); -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return integerToDouble( value_.uint_ ); + return static_cast(value_.uint_); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return integerToDouble(value_.uint_); #endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - case realValue: - return static_cast( value_.real_ ); - case nullValue: - return 0.0; - case booleanValue: - return value_.bool_ ? 1.0f : 0.0f; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to float."); -} - -bool -Value::asBool() const -{ - switch ( type_ ) - { - case booleanValue: - return value_.bool_; - case nullValue: - return false; - case intValue: - return value_.int_ ? true : false; - case uintValue: - return value_.uint_ ? true : false; - case realValue: - return value_.real_ ? true : false; - default: - break; - } - JSON_FAIL_MESSAGE("Value is not convertible to bool."); -} - - -bool -Value::isConvertibleTo( ValueType other ) const -{ - switch ( other ) - { - case nullValue: - return ( isNumeric() && asDouble() == 0.0 ) - || ( type_ == booleanValue && value_.bool_ == false ) - || ( type_ == stringValue && asString() == "" ) - || ( type_ == arrayValue && value_.map_->size() == 0 ) - || ( type_ == objectValue && value_.map_->size() == 0 ) - || type_ == nullValue; - case intValue: - return isInt() - || (type_ == realValue && InRange(value_.real_, minInt, maxInt)) - || type_ == booleanValue - || type_ == nullValue; - case uintValue: - return isUInt() - || (type_ == realValue && InRange(value_.real_, 0, maxUInt)) - || type_ == booleanValue - || type_ == nullValue; - case realValue: - return isNumeric() - || type_ == booleanValue - || type_ == nullValue; - case booleanValue: - return isNumeric() - || type_ == booleanValue - || type_ == nullValue; - case stringValue: - return isNumeric() - || type_ == booleanValue - || type_ == stringValue - || type_ == nullValue; - case arrayValue: - return type_ == arrayValue - || type_ == nullValue; - case objectValue: - return type_ == objectValue - || type_ == nullValue; - } - JSON_ASSERT_UNREACHABLE; - return false; + case realValue: + return static_cast(value_.real_); + case nullValue: + return 0.0; + case booleanValue: + return value_.bool_ ? 1.0f : 0.0f; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to float."); +} + +bool Value::asBool() const { + switch (type_) { + case booleanValue: + return value_.bool_; + case nullValue: + return false; + case intValue: + return value_.int_ ? true : false; + case uintValue: + return value_.uint_ ? true : false; + case realValue: + return value_.real_ ? true : false; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to bool."); +} + +bool Value::isConvertibleTo(ValueType other) const { + switch (other) { + case nullValue: + return (isNumeric() && asDouble() == 0.0) || + (type_ == booleanValue && value_.bool_ == false) || + (type_ == stringValue && asString() == "") || + (type_ == arrayValue && value_.map_->size() == 0) || + (type_ == objectValue && value_.map_->size() == 0) || + type_ == nullValue; + case intValue: + return isInt() || + (type_ == realValue && InRange(value_.real_, minInt, maxInt)) || + type_ == booleanValue || type_ == nullValue; + case uintValue: + return isUInt() || + (type_ == realValue && InRange(value_.real_, 0, maxUInt)) || + type_ == booleanValue || type_ == nullValue; + case realValue: + return isNumeric() || type_ == booleanValue || type_ == nullValue; + case booleanValue: + return isNumeric() || type_ == booleanValue || type_ == nullValue; + case stringValue: + return isNumeric() || type_ == booleanValue || type_ == stringValue || + type_ == nullValue; + case arrayValue: + return type_ == arrayValue || type_ == nullValue; + case objectValue: + return type_ == objectValue || type_ == nullValue; + } + JSON_ASSERT_UNREACHABLE; + return false; } - /// Number of values in array or object -ArrayIndex -Value::size() const -{ - switch ( type_ ) - { - case nullValue: - case intValue: - case uintValue: - case realValue: - case booleanValue: - case stringValue: - return 0; +ArrayIndex Value::size() const { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + case stringValue: + return 0; #ifndef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: // size of the array is highest index + 1 - if ( !value_.map_->empty() ) - { - ObjectValues::const_iterator itLast = value_.map_->end(); - --itLast; - return (*itLast).first.index()+1; - } - return 0; - case objectValue: - return ArrayIndex( value_.map_->size() ); + case arrayValue: // size of the array is highest index + 1 + if (!value_.map_->empty()) { + ObjectValues::const_iterator itLast = value_.map_->end(); + --itLast; + return (*itLast).first.index() + 1; + } + return 0; + case objectValue: + return ArrayIndex(value_.map_->size()); #else - case arrayValue: - return Int( value_.array_->size() ); - case objectValue: - return Int( value_.map_->size() ); + case arrayValue: + return Int(value_.array_->size()); + case objectValue: + return Int(value_.map_->size()); #endif - } - JSON_ASSERT_UNREACHABLE; - return 0; // unreachable; + } + JSON_ASSERT_UNREACHABLE; + return 0; // unreachable; } - -bool -Value::empty() const -{ - if ( isNull() || isArray() || isObject() ) - return size() == 0u; - else - return false; -} - - -bool -Value::operator!() const -{ - return isNull(); +bool Value::empty() const { + if (isNull() || isArray() || isObject()) + return size() == 0u; + else + return false; } +bool Value::operator!() const { return isNull(); } -void -Value::clear() -{ - JSON_ASSERT( type_ == nullValue || type_ == arrayValue || type_ == objectValue ); +void Value::clear() { + JSON_ASSERT(type_ == nullValue || type_ == arrayValue || + type_ == objectValue); - switch ( type_ ) - { + switch (type_) { #ifndef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - case objectValue: - value_.map_->clear(); - break; + case arrayValue: + case objectValue: + value_.map_->clear(); + break; #else - case arrayValue: - value_.array_->clear(); - break; - case objectValue: - value_.map_->clear(); - break; + case arrayValue: + value_.array_->clear(); + break; + case objectValue: + value_.map_->clear(); + break; #endif - default: - break; - } + default: + break; + } } -void -Value::resize( ArrayIndex newSize ) -{ - JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); - if ( type_ == nullValue ) - *this = Value( arrayValue ); +void Value::resize(ArrayIndex newSize) { + JSON_ASSERT(type_ == nullValue || type_ == arrayValue); + if (type_ == nullValue) + *this = Value(arrayValue); #ifndef JSON_VALUE_USE_INTERNAL_MAP - ArrayIndex oldSize = size(); - if ( newSize == 0 ) - clear(); - else if ( newSize > oldSize ) - (*this)[ newSize - 1 ]; - else - { - for ( ArrayIndex index = newSize; index < oldSize; ++index ) - { - value_.map_->erase( index ); - } - assert( size() == newSize ); - } + ArrayIndex oldSize = size(); + if (newSize == 0) + clear(); + else if (newSize > oldSize) + (*this)[newSize - 1]; + else { + for (ArrayIndex index = newSize; index < oldSize; ++index) { + value_.map_->erase(index); + } + assert(size() == newSize); + } #else - value_.array_->resize( newSize ); + value_.array_->resize(newSize); #endif } - -Value & -Value::operator[]( ArrayIndex index ) -{ - JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); - if ( type_ == nullValue ) - *this = Value( arrayValue ); +Value &Value::operator[](ArrayIndex index) { + JSON_ASSERT(type_ == nullValue || type_ == arrayValue); + if (type_ == nullValue) + *this = Value(arrayValue); #ifndef JSON_VALUE_USE_INTERNAL_MAP - CZString key( index ); - ObjectValues::iterator it = value_.map_->lower_bound( key ); - if ( it != value_.map_->end() && (*it).first == key ) - return (*it).second; - - ObjectValues::value_type defaultValue( key, null ); - it = value_.map_->insert( it, defaultValue ); - return (*it).second; + CZString key(index); + ObjectValues::iterator it = value_.map_->lower_bound(key); + if (it != value_.map_->end() && (*it).first == key) + return (*it).second; + + ObjectValues::value_type defaultValue(key, null); + it = value_.map_->insert(it, defaultValue); + return (*it).second; #else - return value_.array_->resolveReference( index ); + return value_.array_->resolveReference(index); #endif } - -Value & -Value::operator[]( int index ) -{ - JSON_ASSERT( index >= 0 ); - return (*this)[ ArrayIndex(index) ]; +Value &Value::operator[](int index) { + JSON_ASSERT(index >= 0); + return (*this)[ArrayIndex(index)]; } - -const Value & -Value::operator[]( ArrayIndex index ) const -{ - JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); - if ( type_ == nullValue ) - return null; +const Value &Value::operator[](ArrayIndex index) const { + JSON_ASSERT(type_ == nullValue || type_ == arrayValue); + if (type_ == nullValue) + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP - CZString key( index ); - ObjectValues::const_iterator it = value_.map_->find( key ); - if ( it == value_.map_->end() ) - return null; - return (*it).second; + CZString key(index); + ObjectValues::const_iterator it = value_.map_->find(key); + if (it == value_.map_->end()) + return null; + return (*it).second; #else - Value *value = value_.array_->find( index ); - return value ? *value : null; + Value *value = value_.array_->find(index); + return value ? *value : null; #endif } - -const Value & -Value::operator[]( int index ) const -{ - JSON_ASSERT( index >= 0 ); - return (*this)[ ArrayIndex(index) ]; +const Value &Value::operator[](int index) const { + JSON_ASSERT(index >= 0); + return (*this)[ArrayIndex(index)]; } - -Value & -Value::operator[]( const char *key ) -{ - return resolveReference( key, false ); +Value &Value::operator[](const char *key) { + return resolveReference(key, false); } - -Value & -Value::resolveReference( const char *key, - bool isStatic ) -{ - JSON_ASSERT( type_ == nullValue || type_ == objectValue ); - if ( type_ == nullValue ) - *this = Value( objectValue ); +Value &Value::resolveReference(const char *key, bool isStatic) { + JSON_ASSERT(type_ == nullValue || type_ == objectValue); + if (type_ == nullValue) + *this = Value(objectValue); #ifndef JSON_VALUE_USE_INTERNAL_MAP - CZString actualKey( key, isStatic ? CZString::noDuplication - : CZString::duplicateOnCopy ); - ObjectValues::iterator it = value_.map_->lower_bound( actualKey ); - if ( it != value_.map_->end() && (*it).first == actualKey ) - return (*it).second; - - ObjectValues::value_type defaultValue( actualKey, null ); - it = value_.map_->insert( it, defaultValue ); - Value &value = (*it).second; - return value; + CZString actualKey(key, isStatic ? CZString::noDuplication + : CZString::duplicateOnCopy); + ObjectValues::iterator it = value_.map_->lower_bound(actualKey); + if (it != value_.map_->end() && (*it).first == actualKey) + return (*it).second; + + ObjectValues::value_type defaultValue(actualKey, null); + it = value_.map_->insert(it, defaultValue); + Value &value = (*it).second; + return value; #else - return value_.map_->resolveReference( key, isStatic ); + return value_.map_->resolveReference(key, isStatic); #endif } - -Value -Value::get( ArrayIndex index, - const Value &defaultValue ) const -{ - const Value *value = &((*this)[index]); - return value == &null ? defaultValue : *value; +Value Value::get(ArrayIndex index, const Value &defaultValue) const { + const Value *value = &((*this)[index]); + return value == &null ? defaultValue : *value; } +bool Value::isValidIndex(ArrayIndex index) const { return index < size(); } -bool -Value::isValidIndex( ArrayIndex index ) const -{ - return index < size(); -} - - - -const Value & -Value::operator[]( const char *key ) const -{ - JSON_ASSERT( type_ == nullValue || type_ == objectValue ); - if ( type_ == nullValue ) - return null; +const Value &Value::operator[](const char *key) const { + JSON_ASSERT(type_ == nullValue || type_ == objectValue); + if (type_ == nullValue) + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP - CZString actualKey( key, CZString::noDuplication ); - ObjectValues::const_iterator it = value_.map_->find( actualKey ); - if ( it == value_.map_->end() ) - return null; - return (*it).second; + CZString actualKey(key, CZString::noDuplication); + ObjectValues::const_iterator it = value_.map_->find(actualKey); + if (it == value_.map_->end()) + return null; + return (*it).second; #else - const Value *value = value_.map_->find( key ); - return value ? *value : null; + const Value *value = value_.map_->find(key); + return value ? *value : null; #endif } - -Value & -Value::operator[]( const std::string &key ) -{ - return (*this)[ key.c_str() ]; -} - - -const Value & -Value::operator[]( const std::string &key ) const -{ - return (*this)[ key.c_str() ]; +Value &Value::operator[](const std::string &key) { + return (*this)[key.c_str()]; } -Value & -Value::operator[]( const StaticString &key ) -{ - return resolveReference( key, true ); +const Value &Value::operator[](const std::string &key) const { + return (*this)[key.c_str()]; } - -# ifdef JSON_USE_CPPTL -Value & -Value::operator[]( const CppTL::ConstString &key ) -{ - return (*this)[ key.c_str() ]; +Value &Value::operator[](const StaticString &key) { + return resolveReference(key, true); } - -const Value & -Value::operator[]( const CppTL::ConstString &key ) const -{ - return (*this)[ key.c_str() ]; +#ifdef JSON_USE_CPPTL +Value &Value::operator[](const CppTL::ConstString &key) { + return (*this)[key.c_str()]; } -# endif - -Value & -Value::append( const Value &value ) -{ - return (*this)[size()] = value; +const Value &Value::operator[](const CppTL::ConstString &key) const { + return (*this)[key.c_str()]; } +#endif +Value &Value::append(const Value &value) { return (*this)[size()] = value; } -Value -Value::get( const char *key, - const Value &defaultValue ) const -{ - const Value *value = &((*this)[key]); - return value == &null ? defaultValue : *value; +Value Value::get(const char *key, const Value &defaultValue) const { + const Value *value = &((*this)[key]); + return value == &null ? defaultValue : *value; } - -Value -Value::get( const std::string &key, - const Value &defaultValue ) const -{ - return get( key.c_str(), defaultValue ); +Value Value::get(const std::string &key, const Value &defaultValue) const { + return get(key.c_str(), defaultValue); } -Value -Value::removeMember( const char* key ) -{ - JSON_ASSERT( type_ == nullValue || type_ == objectValue ); - if ( type_ == nullValue ) - return null; +Value Value::removeMember(const char *key) { + JSON_ASSERT(type_ == nullValue || type_ == objectValue); + if (type_ == nullValue) + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP - CZString actualKey( key, CZString::noDuplication ); - ObjectValues::iterator it = value_.map_->find( actualKey ); - if ( it == value_.map_->end() ) - return null; - Value old(it->second); - value_.map_->erase(it); - return old; + CZString actualKey(key, CZString::noDuplication); + ObjectValues::iterator it = value_.map_->find(actualKey); + if (it == value_.map_->end()) + return null; + Value old(it->second); + value_.map_->erase(it); + return old; #else - Value *value = value_.map_->find( key ); - if (value){ - Value old(*value); - value_.map_.remove( key ); - return old; - } else { - return null; - } + Value *value = value_.map_->find(key); + if (value) { + Value old(*value); + value_.map_.remove(key); + return old; + } else { + return null; + } #endif } -Value -Value::removeMember( const std::string &key ) -{ - return removeMember( key.c_str() ); +Value Value::removeMember(const std::string &key) { + return removeMember(key.c_str()); } -# ifdef JSON_USE_CPPTL -Value -Value::get( const CppTL::ConstString &key, - const Value &defaultValue ) const -{ - return get( key.c_str(), defaultValue ); +#ifdef JSON_USE_CPPTL +Value Value::get(const CppTL::ConstString &key, + const Value &defaultValue) const { + return get(key.c_str(), defaultValue); } -# endif +#endif -bool -Value::isMember( const char *key ) const -{ - const Value *value = &((*this)[key]); - return value != &null; +bool Value::isMember(const char *key) const { + const Value *value = &((*this)[key]); + return value != &null; } - -bool -Value::isMember( const std::string &key ) const -{ - return isMember( key.c_str() ); +bool Value::isMember(const std::string &key) const { + return isMember(key.c_str()); } - -# ifdef JSON_USE_CPPTL -bool -Value::isMember( const CppTL::ConstString &key ) const -{ - return isMember( key.c_str() ); +#ifdef JSON_USE_CPPTL +bool Value::isMember(const CppTL::ConstString &key) const { + return isMember(key.c_str()); } #endif -Value::Members -Value::getMemberNames() const -{ - JSON_ASSERT( type_ == nullValue || type_ == objectValue ); - if ( type_ == nullValue ) - return Value::Members(); - Members members; - members.reserve( value_.map_->size() ); +Value::Members Value::getMemberNames() const { + JSON_ASSERT(type_ == nullValue || type_ == objectValue); + if (type_ == nullValue) + return Value::Members(); + Members members; + members.reserve(value_.map_->size()); #ifndef JSON_VALUE_USE_INTERNAL_MAP - ObjectValues::const_iterator it = value_.map_->begin(); - ObjectValues::const_iterator itEnd = value_.map_->end(); - for ( ; it != itEnd; ++it ) - members.push_back( std::string( (*it).first.c_str() ) ); + ObjectValues::const_iterator it = value_.map_->begin(); + ObjectValues::const_iterator itEnd = value_.map_->end(); + for (; it != itEnd; ++it) + members.push_back(std::string((*it).first.c_str())); #else - ValueInternalMap::IteratorState it; - ValueInternalMap::IteratorState itEnd; - value_.map_->makeBeginIterator( it ); - value_.map_->makeEndIterator( itEnd ); - for ( ; !ValueInternalMap::equals( it, itEnd ); ValueInternalMap::increment(it) ) - members.push_back( std::string( ValueInternalMap::key( it ) ) ); + ValueInternalMap::IteratorState it; + ValueInternalMap::IteratorState itEnd; + value_.map_->makeBeginIterator(it); + value_.map_->makeEndIterator(itEnd); + for (; !ValueInternalMap::equals(it, itEnd); ValueInternalMap::increment(it)) + members.push_back(std::string(ValueInternalMap::key(it))); #endif - return members; + return members; } // -//# ifdef JSON_USE_CPPTL -//EnumMemberNames -//Value::enumMemberNames() const +// # ifdef JSON_USE_CPPTL +// EnumMemberNames +// Value::enumMemberNames() const //{ // if ( type_ == objectValue ) // { @@ -1356,128 +1105,97 @@ Value::getMemberNames() const //} // // -//EnumValues -//Value::enumValues() const +// EnumValues +// Value::enumValues() const //{ // if ( type_ == objectValue || type_ == arrayValue ) -// return CppTL::Enum::anyValues( *(value_.map_), +// return CppTL::Enum::anyValues( *(value_.map_), // CppTL::Type() ); // return EnumValues(); //} // -//# endif +// # endif static bool IsIntegral(double d) { double integral_part; return modf(d, &integral_part) == 0.0; } - -bool -Value::isNull() const -{ - return type_ == nullValue; -} - - -bool -Value::isBool() const -{ - return type_ == booleanValue; -} - - -bool -Value::isInt() const -{ - switch ( type_ ) - { - case intValue: - return value_.int_ >= minInt && value_.int_ <= maxInt; - case uintValue: - return value_.uint_ <= UInt(maxInt); - case realValue: - return value_.real_ >= minInt && - value_.real_ <= maxInt && - IsIntegral(value_.real_); - default: - break; - } - return false; -} - - -bool -Value::isUInt() const -{ - switch ( type_ ) - { - case intValue: - return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt); - case uintValue: - return value_.uint_ <= maxUInt; - case realValue: - return value_.real_ >= 0 && - value_.real_ <= maxUInt && - IsIntegral(value_.real_); - default: - break; - } - return false; -} - -bool -Value::isInt64() const -{ -# if defined(JSON_HAS_INT64) - switch ( type_ ) - { - case intValue: - return true; - case uintValue: - return value_.uint_ <= UInt64(maxInt64); - case realValue: - // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a - // double, so double(maxInt64) will be rounded up to 2^63. Therefore we - // require the value to be strictly less than the limit. - return value_.real_ >= double(minInt64) && - value_.real_ < double(maxInt64) && - IsIntegral(value_.real_); - default: - break; - } -# endif // JSON_HAS_INT64 - return false; -} - -bool -Value::isUInt64() const -{ -# if defined(JSON_HAS_INT64) - switch ( type_ ) - { - case intValue: - return value_.int_ >= 0; - case uintValue: - return true; - case realValue: - // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a - // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we - // require the value to be strictly less than the limit. - return value_.real_ >= 0 && - value_.real_ < maxUInt64AsDouble && - IsIntegral(value_.real_); - default: - break; - } -# endif // JSON_HAS_INT64 - return false; -} - - -bool -Value::isIntegral() const -{ +bool Value::isNull() const { return type_ == nullValue; } + +bool Value::isBool() const { return type_ == booleanValue; } + +bool Value::isInt() const { + switch (type_) { + case intValue: + return value_.int_ >= minInt && value_.int_ <= maxInt; + case uintValue: + return value_.uint_ <= UInt(maxInt); + case realValue: + return value_.real_ >= minInt && value_.real_ <= maxInt && + IsIntegral(value_.real_); + default: + break; + } + return false; +} + +bool Value::isUInt() const { + switch (type_) { + case intValue: + return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt); + case uintValue: + return value_.uint_ <= maxUInt; + case realValue: + return value_.real_ >= 0 && value_.real_ <= maxUInt && + IsIntegral(value_.real_); + default: + break; + } + return false; +} + +bool Value::isInt64() const { +#if defined(JSON_HAS_INT64) + switch (type_) { + case intValue: + return true; + case uintValue: + return value_.uint_ <= UInt64(maxInt64); + case realValue: + // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a + // double, so double(maxInt64) will be rounded up to 2^63. Therefore we + // require the value to be strictly less than the limit. + return value_.real_ >= double(minInt64) && + value_.real_ < double(maxInt64) && IsIntegral(value_.real_); + default: + break; + } +#endif // JSON_HAS_INT64 + return false; +} + +bool Value::isUInt64() const { +#if defined(JSON_HAS_INT64) + switch (type_) { + case intValue: + return value_.int_ >= 0; + case uintValue: + return true; + case realValue: + // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a + // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we + // require the value to be strictly less than the limit. + return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && + IsIntegral(value_.real_); + default: + break; + } +#endif // JSON_HAS_INT64 + return false; +} + +bool Value::isIntegral() const { #if defined(JSON_HAS_INT64) return isInt64() || isUInt64(); #else @@ -1485,437 +1203,296 @@ Value::isIntegral() const #endif } +bool Value::isDouble() const { return type_ == realValue || isIntegral(); } -bool -Value::isDouble() const -{ - return type_ == realValue || isIntegral(); -} +bool Value::isNumeric() const { return isIntegral() || isDouble(); } +bool Value::isString() const { return type_ == stringValue; } -bool -Value::isNumeric() const -{ - return isIntegral() || isDouble(); -} +bool Value::isArray() const { return type_ == arrayValue; } +bool Value::isObject() const { return type_ == objectValue; } -bool -Value::isString() const -{ - return type_ == stringValue; +void Value::setComment(const char *comment, CommentPlacement placement) { + if (!comments_) + comments_ = new CommentInfo[numberOfCommentPlacement]; + comments_[placement].setComment(comment); } - -bool -Value::isArray() const -{ - return type_ == arrayValue; +void Value::setComment(const std::string &comment, CommentPlacement placement) { + setComment(comment.c_str(), placement); } - -bool -Value::isObject() const -{ - return type_ == objectValue; +bool Value::hasComment(CommentPlacement placement) const { + return comments_ != 0 && comments_[placement].comment_ != 0; } - -void -Value::setComment( const char *comment, - CommentPlacement placement ) -{ - if ( !comments_ ) - comments_ = new CommentInfo[numberOfCommentPlacement]; - comments_[placement].setComment( comment ); +std::string Value::getComment(CommentPlacement placement) const { + if (hasComment(placement)) + return comments_[placement].comment_; + return ""; } - -void -Value::setComment( const std::string &comment, - CommentPlacement placement ) -{ - setComment( comment.c_str(), placement ); -} - - -bool -Value::hasComment( CommentPlacement placement ) const -{ - return comments_ != 0 && comments_[placement].comment_ != 0; +std::string Value::toStyledString() const { + StyledWriter writer; + return writer.write(*this); } -std::string -Value::getComment( CommentPlacement placement ) const -{ - if ( hasComment(placement) ) - return comments_[placement].comment_; - return ""; -} - - -std::string -Value::toStyledString() const -{ - StyledWriter writer; - return writer.write( *this ); -} - - -Value::const_iterator -Value::begin() const -{ - switch ( type_ ) - { +Value::const_iterator Value::begin() const { + switch (type_) { #ifdef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - if ( value_.array_ ) - { - ValueInternalArray::IteratorState it; - value_.array_->makeBeginIterator( it ); - return const_iterator( it ); - } - break; - case objectValue: - if ( value_.map_ ) - { - ValueInternalMap::IteratorState it; - value_.map_->makeBeginIterator( it ); - return const_iterator( it ); - } - break; + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeBeginIterator(it); + return const_iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeBeginIterator(it); + return const_iterator(it); + } + break; #else - case arrayValue: - case objectValue: - if ( value_.map_ ) - return const_iterator( value_.map_->begin() ); - break; + case arrayValue: + case objectValue: + if (value_.map_) + return const_iterator(value_.map_->begin()); + break; #endif - default: - break; - } - return const_iterator(); + default: + break; + } + return const_iterator(); } -Value::const_iterator -Value::end() const -{ - switch ( type_ ) - { +Value::const_iterator Value::end() const { + switch (type_) { #ifdef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - if ( value_.array_ ) - { - ValueInternalArray::IteratorState it; - value_.array_->makeEndIterator( it ); - return const_iterator( it ); - } - break; - case objectValue: - if ( value_.map_ ) - { - ValueInternalMap::IteratorState it; - value_.map_->makeEndIterator( it ); - return const_iterator( it ); - } - break; + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeEndIterator(it); + return const_iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator(it); + return const_iterator(it); + } + break; #else - case arrayValue: - case objectValue: - if ( value_.map_ ) - return const_iterator( value_.map_->end() ); - break; + case arrayValue: + case objectValue: + if (value_.map_) + return const_iterator(value_.map_->end()); + break; #endif - default: - break; - } - return const_iterator(); + default: + break; + } + return const_iterator(); } - -Value::iterator -Value::begin() -{ - switch ( type_ ) - { +Value::iterator Value::begin() { + switch (type_) { #ifdef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - if ( value_.array_ ) - { - ValueInternalArray::IteratorState it; - value_.array_->makeBeginIterator( it ); - return iterator( it ); - } - break; - case objectValue: - if ( value_.map_ ) - { - ValueInternalMap::IteratorState it; - value_.map_->makeBeginIterator( it ); - return iterator( it ); - } - break; + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeBeginIterator(it); + return iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeBeginIterator(it); + return iterator(it); + } + break; #else - case arrayValue: - case objectValue: - if ( value_.map_ ) - return iterator( value_.map_->begin() ); - break; + case arrayValue: + case objectValue: + if (value_.map_) + return iterator(value_.map_->begin()); + break; #endif - default: - break; - } - return iterator(); + default: + break; + } + return iterator(); } -Value::iterator -Value::end() -{ - switch ( type_ ) - { +Value::iterator Value::end() { + switch (type_) { #ifdef JSON_VALUE_USE_INTERNAL_MAP - case arrayValue: - if ( value_.array_ ) - { - ValueInternalArray::IteratorState it; - value_.array_->makeEndIterator( it ); - return iterator( it ); - } - break; - case objectValue: - if ( value_.map_ ) - { - ValueInternalMap::IteratorState it; - value_.map_->makeEndIterator( it ); - return iterator( it ); - } - break; + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeEndIterator(it); + return iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator(it); + return iterator(it); + } + break; #else - case arrayValue: - case objectValue: - if ( value_.map_ ) - return iterator( value_.map_->end() ); - break; + case arrayValue: + case objectValue: + if (value_.map_) + return iterator(value_.map_->end()); + break; #endif - default: - break; - } - return iterator(); + default: + break; + } + return iterator(); } - // class PathArgument // ////////////////////////////////////////////////////////////////// -PathArgument::PathArgument() - : key_() - , index_() - , kind_( kindNone ) -{ -} - - -PathArgument::PathArgument( ArrayIndex index ) - : key_() - , index_( index ) - , kind_( kindIndex ) -{ -} - +PathArgument::PathArgument() : key_(), index_(), kind_(kindNone) {} -PathArgument::PathArgument( const char *key ) - : key_( key ) - , index_() - , kind_( kindKey ) -{ -} +PathArgument::PathArgument(ArrayIndex index) + : key_(), index_(index), kind_(kindIndex) {} +PathArgument::PathArgument(const char *key) + : key_(key), index_(), kind_(kindKey) {} -PathArgument::PathArgument( const std::string &key ) - : key_( key.c_str() ) - , index_() - , kind_( kindKey ) -{ -} +PathArgument::PathArgument(const std::string &key) + : key_(key.c_str()), index_(), kind_(kindKey) {} // class Path // ////////////////////////////////////////////////////////////////// -Path::Path( const std::string &path, - const PathArgument &a1, - const PathArgument &a2, - const PathArgument &a3, - const PathArgument &a4, - const PathArgument &a5 ) -{ - InArgs in; - in.push_back( &a1 ); - in.push_back( &a2 ); - in.push_back( &a3 ); - in.push_back( &a4 ); - in.push_back( &a5 ); - makePath( path, in ); -} - - -void -Path::makePath( const std::string &path, - const InArgs &in ) -{ - const char *current = path.c_str(); - const char *end = current + path.length(); - InArgs::const_iterator itInArg = in.begin(); - while ( current != end ) - { - if ( *current == '[' ) - { - ++current; - if ( *current == '%' ) - addPathInArg( path, in, itInArg, PathArgument::kindIndex ); - else - { - ArrayIndex index = 0; - for ( ; current != end && *current >= '0' && *current <= '9'; ++current ) - index = index * 10 + ArrayIndex(*current - '0'); - args_.push_back( index ); - } - if ( current == end || *current++ != ']' ) - invalidPath( path, int(current - path.c_str()) ); - } - else if ( *current == '%' ) - { - addPathInArg( path, in, itInArg, PathArgument::kindKey ); - ++current; +Path::Path(const std::string &path, const PathArgument &a1, + const PathArgument &a2, const PathArgument &a3, + const PathArgument &a4, const PathArgument &a5) { + InArgs in; + in.push_back(&a1); + in.push_back(&a2); + in.push_back(&a3); + in.push_back(&a4); + in.push_back(&a5); + makePath(path, in); +} + +void Path::makePath(const std::string &path, const InArgs &in) { + const char *current = path.c_str(); + const char *end = current + path.length(); + InArgs::const_iterator itInArg = in.begin(); + while (current != end) { + if (*current == '[') { + ++current; + if (*current == '%') + addPathInArg(path, in, itInArg, PathArgument::kindIndex); + else { + ArrayIndex index = 0; + for (; current != end && *current >= '0' && *current <= '9'; ++current) + index = index * 10 + ArrayIndex(*current - '0'); + args_.push_back(index); } - else if ( *current == '.' ) - { - ++current; + if (current == end || *current++ != ']') + invalidPath(path, int(current - path.c_str())); + } else if (*current == '%') { + addPathInArg(path, in, itInArg, PathArgument::kindKey); + ++current; + } else if (*current == '.') { + ++current; + } else { + const char *beginName = current; + while (current != end && !strchr("[.", *current)) + ++current; + args_.push_back(std::string(beginName, current)); + } + } +} + +void Path::addPathInArg(const std::string &path, const InArgs &in, + InArgs::const_iterator &itInArg, + PathArgument::Kind kind) { + if (itInArg == in.end()) { + // Error: missing argument %d + } else if ((*itInArg)->kind_ != kind) { + // Error: bad argument type + } else { + args_.push_back(**itInArg); + } +} + +void Path::invalidPath(const std::string &path, int location) { + // Error: invalid path. +} + +const Value &Path::resolve(const Value &root) const { + const Value *node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument &arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray() || !node->isValidIndex(arg.index_)) { + // Error: unable to resolve path (array value expected at position... } - else - { - const char *beginName = current; - while ( current != end && !strchr( "[.", *current ) ) - ++current; - args_.push_back( std::string( beginName, current ) ); + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) { + // Error: unable to resolve path (object value expected at position...) } - } -} - - -void -Path::addPathInArg( const std::string &path, - const InArgs &in, - InArgs::const_iterator &itInArg, - PathArgument::Kind kind ) -{ - if ( itInArg == in.end() ) - { - // Error: missing argument %d - } - else if ( (*itInArg)->kind_ != kind ) - { - // Error: bad argument type - } - else - { - args_.push_back( **itInArg ); - } -} - - -void -Path::invalidPath( const std::string &path, - int location ) -{ - // Error: invalid path. -} - - -const Value & -Path::resolve( const Value &root ) const -{ - const Value *node = &root; - for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) - { - const PathArgument &arg = *it; - if ( arg.kind_ == PathArgument::kindIndex ) - { - if ( !node->isArray() || !node->isValidIndex( arg.index_ ) ) - { - // Error: unable to resolve path (array value expected at position... - } - node = &((*node)[arg.index_]); + node = &((*node)[arg.key_]); + if (node == &Value::null) { + // Error: unable to resolve path (object has no member named '' at + // position...) } - else if ( arg.kind_ == PathArgument::kindKey ) - { - if ( !node->isObject() ) - { - // Error: unable to resolve path (object value expected at position...) - } - node = &((*node)[arg.key_]); - if ( node == &Value::null ) - { - // Error: unable to resolve path (object has no member named '' at position...) - } + } + } + return *node; +} + +Value Path::resolve(const Value &root, const Value &defaultValue) const { + const Value *node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument &arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray() || !node->isValidIndex(arg.index_)) + return defaultValue; + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) + return defaultValue; + node = &((*node)[arg.key_]); + if (node == &Value::null) + return defaultValue; + } + } + return *node; +} + +Value &Path::make(Value &root) const { + Value *node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument &arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray()) { + // Error: node is not an array at position ... } - } - return *node; -} - - -Value -Path::resolve( const Value &root, - const Value &defaultValue ) const -{ - const Value *node = &root; - for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) - { - const PathArgument &arg = *it; - if ( arg.kind_ == PathArgument::kindIndex ) - { - if ( !node->isArray() || !node->isValidIndex( arg.index_ ) ) - return defaultValue; - node = &((*node)[arg.index_]); + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) { + // Error: node is not an object at position... } - else if ( arg.kind_ == PathArgument::kindKey ) - { - if ( !node->isObject() ) - return defaultValue; - node = &((*node)[arg.key_]); - if ( node == &Value::null ) - return defaultValue; - } - } - return *node; -} - - -Value & -Path::make( Value &root ) const -{ - Value *node = &root; - for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it ) - { - const PathArgument &arg = *it; - if ( arg.kind_ == PathArgument::kindIndex ) - { - if ( !node->isArray() ) - { - // Error: node is not an array at position ... - } - node = &((*node)[arg.index_]); - } - else if ( arg.kind_ == PathArgument::kindKey ) - { - if ( !node->isObject() ) - { - // Error: node is not an object at position... - } - node = &((*node)[arg.key_]); - } - } - return *node; + node = &((*node)[arg.key_]); + } + } + return *node; } - } // namespace Json diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/json_writer.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/json_writer.cpp index 47e768cac..dd9f95e0d 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/json_writer.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/json_writer.cpp @@ -4,8 +4,8 @@ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #if !defined(JSON_IS_AMALGAMATION) -# include -# include "json_tool.h" +#include +#include "json_tool.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include @@ -16,724 +16,581 @@ #include #if _MSC_VER >= 1400 // VC++ 8.0 -#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. +#pragma warning( \ + disable : 4996) // disable warning about strdup being deprecated. #endif namespace Json { -static bool containsControlCharacter( const char* str ) -{ - while ( *str ) - { - if ( isControlCharacter( *(str++) ) ) - return true; - } - return false; +static bool containsControlCharacter(const char *str) { + while (*str) { + if (isControlCharacter(*(str++))) + return true; + } + return false; } - -std::string valueToString( LargestInt value ) -{ - UIntToStringBuffer buffer; - char *current = buffer + sizeof(buffer); - bool isNegative = value < 0; - if ( isNegative ) - value = -value; - uintToString( LargestUInt(value), current ); - if ( isNegative ) - *--current = '-'; - assert( current >= buffer ); - return current; +std::string valueToString(LargestInt value) { + UIntToStringBuffer buffer; + char *current = buffer + sizeof(buffer); + bool isNegative = value < 0; + if (isNegative) + value = -value; + uintToString(LargestUInt(value), current); + if (isNegative) + *--current = '-'; + assert(current >= buffer); + return current; } - -std::string valueToString( LargestUInt value ) -{ - UIntToStringBuffer buffer; - char *current = buffer + sizeof(buffer); - uintToString( value, current ); - assert( current >= buffer ); - return current; +std::string valueToString(LargestUInt value) { + UIntToStringBuffer buffer; + char *current = buffer + sizeof(buffer); + uintToString(value, current); + assert(current >= buffer); + return current; } #if defined(JSON_HAS_INT64) -std::string valueToString( Int value ) -{ - return valueToString( LargestInt(value) ); +std::string valueToString(Int value) { + return valueToString(LargestInt(value)); } - -std::string valueToString( UInt value ) -{ - return valueToString( LargestUInt(value) ); +std::string valueToString(UInt value) { + return valueToString(LargestUInt(value)); } #endif // # if defined(JSON_HAS_INT64) - -std::string valueToString( double value ) -{ - char buffer[32]; -#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning. - sprintf_s(buffer, sizeof(buffer), "%#.16g", value); -#else - sprintf(buffer, "%#.16g", value); +std::string valueToString(double value) { + char buffer[32]; +#if defined(_MSC_VER) && \ + defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 + // to avoid warning. + sprintf_s(buffer, sizeof(buffer), "%#.16g", value); +#else + sprintf(buffer, "%#.16g", value); #endif - char* ch = buffer + strlen(buffer) - 1; - if (*ch != '0') return buffer; // nothing to truncate, so save time - while(ch > buffer && *ch == '0'){ - --ch; - } - char* last_nonzero = ch; - while(ch >= buffer){ - switch(*ch){ - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - --ch; - continue; - case '.': - // Truncate zeroes to save bytes in output, but keep one. - *(last_nonzero+2) = '\0'; - return buffer; - default: - return buffer; - } - } - return buffer; -} - - -std::string valueToString( bool value ) -{ - return value ? "true" : "false"; -} - -std::string valueToQuotedString( const char *value ) -{ - if (value == NULL) - return ""; - // Not sure how to handle unicode... - if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && !containsControlCharacter( value )) - return std::string("\"") + value + "\""; - // We have to walk value and escape any special characters. - // Appending to std::string is not efficient, but this should be rare. - // (Note: forward slashes are *not* rare, but I am not escaping them.) - std::string::size_type maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL - std::string result; - result.reserve(maxsize); // to avoid lots of mallocs - result += "\""; - for (const char* c=value; *c != 0; ++c) - { - switch(*c) - { - case '\"': - result += "\\\""; - break; - case '\\': - result += "\\\\"; - break; - case '\b': - result += "\\b"; - break; - case '\f': - result += "\\f"; - break; - case '\n': - result += "\\n"; - break; - case '\r': - result += "\\r"; - break; - case '\t': - result += "\\t"; - break; - //case '/': - // Even though \/ is considered a legal escape in JSON, a bare - // slash is also legal, so I see no reason to escape it. - // (I hope I am not misunderstanding something. - // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); - result += oss.str(); - } - else - { - result += *c; - } - break; - } - } - result += "\""; - return result; -} - -// Class Writer -// ////////////////////////////////////////////////////////////////// -Writer::~Writer() -{ -} - - -// Class FastWriter -// ////////////////////////////////////////////////////////////////// - -FastWriter::FastWriter() - : yamlCompatiblityEnabled_( false ) -{ -} - - -void -FastWriter::enableYAMLCompatibility() -{ - yamlCompatiblityEnabled_ = true; -} - - -std::string -FastWriter::write( const Value &root ) -{ - document_ = ""; - writeValue( root ); - document_ += "\n"; - return document_; -} - - -void -FastWriter::writeValue( const Value &value ) -{ - switch ( value.type() ) - { - case nullValue: - document_ += "null"; + char *ch = buffer + strlen(buffer) - 1; + if (*ch != '0') + return buffer; // nothing to truncate, so save time + while (ch > buffer && *ch == '0') { + --ch; + } + char *last_nonzero = ch; + while (ch >= buffer) { + switch (*ch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + --ch; + continue; + case '.': + // Truncate zeroes to save bytes in output, but keep one. + *(last_nonzero + 2) = '\0'; + return buffer; + default: + return buffer; + } + } + return buffer; +} + +std::string valueToString(bool value) { return value ? "true" : "false"; } + +std::string valueToQuotedString(const char *value) { + if (value == NULL) + return ""; + // Not sure how to handle unicode... + if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && + !containsControlCharacter(value)) + return std::string("\"") + value + "\""; + // We have to walk value and escape any special characters. + // Appending to std::string is not efficient, but this should be rare. + // (Note: forward slashes are *not* rare, but I am not escaping them.) + std::string::size_type maxsize = + strlen(value) * 2 + 3; // allescaped+quotes+NULL + std::string result; + result.reserve(maxsize); // to avoid lots of mallocs + result += "\""; + for (const char *c = value; *c != 0; ++c) { + switch (*c) { + case '\"': + result += "\\\""; break; - case intValue: - document_ += valueToString( value.asLargestInt() ); + case '\\': + result += "\\\\"; break; - case uintValue: - document_ += valueToString( value.asLargestUInt() ); + case '\b': + result += "\\b"; break; - case realValue: - document_ += valueToString( value.asDouble() ); + case '\f': + result += "\\f"; break; - case stringValue: - document_ += valueToQuotedString( value.asCString() ); + case '\n': + result += "\\n"; break; - case booleanValue: - document_ += valueToString( value.asBool() ); + case '\r': + result += "\\r"; break; - case arrayValue: - { - document_ += "["; - int size = value.size(); - for ( int index =0; index < size; ++index ) - { - if ( index > 0 ) - document_ += ","; - writeValue( value[index] ); - } - document_ += "]"; - } + case '\t': + result += "\\t"; break; - case objectValue: - { - Value::Members members( value.getMemberNames() ); - document_ += "{"; - for ( Value::Members::iterator it = members.begin(); - it != members.end(); - ++it ) - { - const std::string &name = *it; - if ( it != members.begin() ) - document_ += ","; - document_ += valueToQuotedString( name.c_str() ); - document_ += yamlCompatiblityEnabled_ ? ": " - : ":"; - writeValue( value[name] ); - } - document_ += "}"; + // case '/': + // Even though \/ is considered a legal escape in JSON, a bare + // slash is also legal, so I see no reason to escape it. + // (I hope I am not misunderstanding something. + // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); + result += oss.str(); + } else { + result += *c; } break; - } + } + } + result += "\""; + return result; } - -// Class StyledWriter +// Class Writer // ////////////////////////////////////////////////////////////////// +Writer::~Writer() {} -StyledWriter::StyledWriter() - : rightMargin_( 74 ) - , indentSize_( 3 ) - , addChildValues_() -{ -} - +// Class FastWriter +// ////////////////////////////////////////////////////////////////// -std::string -StyledWriter::write( const Value &root ) -{ - document_ = ""; - addChildValues_ = false; - indentString_ = ""; - writeCommentBeforeValue( root ); - writeValue( root ); - writeCommentAfterValueOnSameLine( root ); - document_ += "\n"; - return document_; +FastWriter::FastWriter() : yamlCompatiblityEnabled_(false) {} + +void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; } + +std::string FastWriter::write(const Value &root) { + document_ = ""; + writeValue(root); + document_ += "\n"; + return document_; +} + +void FastWriter::writeValue(const Value &value) { + switch (value.type()) { + case nullValue: + document_ += "null"; + break; + case intValue: + document_ += valueToString(value.asLargestInt()); + break; + case uintValue: + document_ += valueToString(value.asLargestUInt()); + break; + case realValue: + document_ += valueToString(value.asDouble()); + break; + case stringValue: + document_ += valueToQuotedString(value.asCString()); + break; + case booleanValue: + document_ += valueToString(value.asBool()); + break; + case arrayValue: { + document_ += "["; + int size = value.size(); + for (int index = 0; index < size; ++index) { + if (index > 0) + document_ += ","; + writeValue(value[index]); + } + document_ += "]"; + } break; + case objectValue: { + Value::Members members(value.getMemberNames()); + document_ += "{"; + for (Value::Members::iterator it = members.begin(); it != members.end(); + ++it) { + const std::string &name = *it; + if (it != members.begin()) + document_ += ","; + document_ += valueToQuotedString(name.c_str()); + document_ += yamlCompatiblityEnabled_ ? ": " : ":"; + writeValue(value[name]); + } + document_ += "}"; + } break; + } } +// Class StyledWriter +// ////////////////////////////////////////////////////////////////// -void -StyledWriter::writeValue( const Value &value ) -{ - switch ( value.type() ) - { - case nullValue: - pushValue( "null" ); - break; - case intValue: - pushValue( valueToString( value.asLargestInt() ) ); - break; - case uintValue: - pushValue( valueToString( value.asLargestUInt() ) ); - break; - case realValue: - pushValue( valueToString( value.asDouble() ) ); - break; - case stringValue: - pushValue( valueToQuotedString( value.asCString() ) ); - break; - case booleanValue: - pushValue( valueToString( value.asBool() ) ); - break; - case arrayValue: - writeArrayValue( value); - break; - case objectValue: - { - Value::Members members( value.getMemberNames() ); - if ( members.empty() ) - pushValue( "{}" ); - else - { - writeWithIndent( "{" ); - indent(); - Value::Members::iterator it = members.begin(); - for (;;) - { - const std::string &name = *it; - const Value &childValue = value[name]; - writeCommentBeforeValue( childValue ); - writeWithIndent( valueToQuotedString( name.c_str() ) ); - document_ += " : "; - writeValue( childValue ); - if ( ++it == members.end() ) - { - writeCommentAfterValueOnSameLine( childValue ); - break; - } - document_ += ","; - writeCommentAfterValueOnSameLine( childValue ); - } - unindent(); - writeWithIndent( "}" ); - } - } - break; - } -} - - -void -StyledWriter::writeArrayValue( const Value &value ) -{ - unsigned size = value.size(); - if ( size == 0 ) - pushValue( "[]" ); - else - { - bool isArrayMultiLine = isMultineArray( value ); - if ( isArrayMultiLine ) - { - writeWithIndent( "[" ); - indent(); - bool hasChildValue = !childValues_.empty(); - unsigned index =0; - for (;;) - { - const Value &childValue = value[index]; - writeCommentBeforeValue( childValue ); - if ( hasChildValue ) - writeWithIndent( childValues_[index] ); - else - { - writeIndent(); - writeValue( childValue ); - } - if ( ++index == size ) - { - writeCommentAfterValueOnSameLine( childValue ); - break; - } - document_ += ","; - writeCommentAfterValueOnSameLine( childValue ); - } - unindent(); - writeWithIndent( "]" ); +StyledWriter::StyledWriter() + : rightMargin_(74), indentSize_(3), addChildValues_() {} + +std::string StyledWriter::write(const Value &root) { + document_ = ""; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue(root); + writeValue(root); + writeCommentAfterValueOnSameLine(root); + document_ += "\n"; + return document_; +} + +void StyledWriter::writeValue(const Value &value) { + switch (value.type()) { + case nullValue: + pushValue("null"); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + pushValue(valueToQuotedString(value.asCString())); + break; + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + const std::string &name = *it; + const Value &childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedString(name.c_str())); + document_ += " : "; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + document_ += ","; + writeCommentAfterValueOnSameLine(childValue); } - else // output on a single line - { - assert( childValues_.size() == size ); - document_ += "[ "; - for ( unsigned index =0; index < size; ++index ) - { - if ( index > 0 ) - document_ += ", "; - document_ += childValues_[index]; - } - document_ += " ]"; + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void StyledWriter::writeArrayValue(const Value &value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isArrayMultiLine = isMultineArray(value); + if (isArrayMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + const Value &childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + writeIndent(); + writeValue(childValue); + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + document_ += ","; + writeCommentAfterValueOnSameLine(childValue); } - } -} - - -bool -StyledWriter::isMultineArray( const Value &value ) -{ - int size = value.size(); - bool isMultiLine = size*3 >= rightMargin_ ; - childValues_.clear(); - for ( int index =0; index < size && !isMultiLine; ++index ) - { - const Value &childValue = value[index]; - isMultiLine = isMultiLine || - ( (childValue.isArray() || childValue.isObject()) && - childValue.size() > 0 ); - } - if ( !isMultiLine ) // check if line length > max line length - { - childValues_.reserve( size ); - addChildValues_ = true; - int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]' - for ( int index =0; index < size && !isMultiLine; ++index ) - { - writeValue( value[index] ); - lineLength += int( childValues_[index].length() ); - isMultiLine = isMultiLine && hasCommentForValue( value[index] ); + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + document_ += "[ "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + document_ += ", "; + document_ += childValues_[index]; } - addChildValues_ = false; - isMultiLine = isMultiLine || lineLength >= rightMargin_; - } - return isMultiLine; -} - - -void -StyledWriter::pushValue( const std::string &value ) -{ - if ( addChildValues_ ) - childValues_.push_back( value ); - else - document_ += value; -} - - -void -StyledWriter::writeIndent() -{ - if ( !document_.empty() ) - { - char last = document_[document_.length()-1]; - if ( last == ' ' ) // already indented - return; - if ( last != '\n' ) // Comments may add new-line - document_ += '\n'; - } - document_ += indentString_; + document_ += " ]"; + } + } +} + +bool StyledWriter::isMultineArray(const Value &value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + const Value &childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size && !isMultiLine; ++index) { + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + isMultiLine = isMultiLine && hasCommentForValue(value[index]); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void StyledWriter::pushValue(const std::string &value) { + if (addChildValues_) + childValues_.push_back(value); + else + document_ += value; +} + +void StyledWriter::writeIndent() { + if (!document_.empty()) { + char last = document_[document_.length() - 1]; + if (last == ' ') // already indented + return; + if (last != '\n') // Comments may add new-line + document_ += '\n'; + } + document_ += indentString_; } - -void -StyledWriter::writeWithIndent( const std::string &value ) -{ - writeIndent(); - document_ += value; +void StyledWriter::writeWithIndent(const std::string &value) { + writeIndent(); + document_ += value; } +void StyledWriter::indent() { indentString_ += std::string(indentSize_, ' '); } -void -StyledWriter::indent() -{ - indentString_ += std::string( indentSize_, ' ' ); +void StyledWriter::unindent() { + assert(int(indentString_.size()) >= indentSize_); + indentString_.resize(indentString_.size() - indentSize_); } - -void -StyledWriter::unindent() -{ - assert( int(indentString_.size()) >= indentSize_ ); - indentString_.resize( indentString_.size() - indentSize_ ); +void StyledWriter::writeCommentBeforeValue(const Value &root) { + if (!root.hasComment(commentBefore)) + return; + document_ += normalizeEOL(root.getComment(commentBefore)); + document_ += "\n"; } +void StyledWriter::writeCommentAfterValueOnSameLine(const Value &root) { + if (root.hasComment(commentAfterOnSameLine)) + document_ += " " + normalizeEOL(root.getComment(commentAfterOnSameLine)); -void -StyledWriter::writeCommentBeforeValue( const Value &root ) -{ - if ( !root.hasComment( commentBefore ) ) - return; - document_ += normalizeEOL( root.getComment( commentBefore ) ); - document_ += "\n"; + if (root.hasComment(commentAfter)) { + document_ += "\n"; + document_ += normalizeEOL(root.getComment(commentAfter)); + document_ += "\n"; + } } - -void -StyledWriter::writeCommentAfterValueOnSameLine( const Value &root ) -{ - if ( root.hasComment( commentAfterOnSameLine ) ) - document_ += " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) ); - - if ( root.hasComment( commentAfter ) ) - { - document_ += "\n"; - document_ += normalizeEOL( root.getComment( commentAfter ) ); - document_ += "\n"; - } +bool StyledWriter::hasCommentForValue(const Value &value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); } - -bool -StyledWriter::hasCommentForValue( const Value &value ) -{ - return value.hasComment( commentBefore ) - || value.hasComment( commentAfterOnSameLine ) - || value.hasComment( commentAfter ); +std::string StyledWriter::normalizeEOL(const std::string &text) { + std::string normalized; + normalized.reserve(text.length()); + const char *begin = text.c_str(); + const char *end = begin + text.length(); + const char *current = begin; + while (current != end) { + char c = *current++; + if (c == '\r') // mac or dos EOL + { + if (*current == '\n') // convert dos EOL + ++current; + normalized += '\n'; + } else // handle unix EOL & other char + normalized += c; + } + return normalized; } - -std::string -StyledWriter::normalizeEOL( const std::string &text ) -{ - std::string normalized; - normalized.reserve( text.length() ); - const char *begin = text.c_str(); - const char *end = begin + text.length(); - const char *current = begin; - while ( current != end ) - { - char c = *current++; - if ( c == '\r' ) // mac or dos EOL - { - if ( *current == '\n' ) // convert dos EOL - ++current; - normalized += '\n'; - } - else // handle unix EOL & other char - normalized += c; - } - return normalized; -} - - // Class StyledStreamWriter // ////////////////////////////////////////////////////////////////// -StyledStreamWriter::StyledStreamWriter( std::string indentation ) - : document_(NULL) - , rightMargin_( 74 ) - , indentation_( indentation ) - , addChildValues_() -{ -} - - -void -StyledStreamWriter::write( std::ostream &out, const Value &root ) -{ - document_ = &out; - addChildValues_ = false; - indentString_ = ""; - writeCommentBeforeValue( root ); - writeValue( root ); - writeCommentAfterValueOnSameLine( root ); - *document_ << "\n"; - document_ = NULL; // Forget the stream, for safety. -} - - -void -StyledStreamWriter::writeValue( const Value &value ) -{ - switch ( value.type() ) - { - case nullValue: - pushValue( "null" ); - break; - case intValue: - pushValue( valueToString( value.asLargestInt() ) ); - break; - case uintValue: - pushValue( valueToString( value.asLargestUInt() ) ); - break; - case realValue: - pushValue( valueToString( value.asDouble() ) ); - break; - case stringValue: - pushValue( valueToQuotedString( value.asCString() ) ); - break; - case booleanValue: - pushValue( valueToString( value.asBool() ) ); - break; - case arrayValue: - writeArrayValue( value); - break; - case objectValue: - { - Value::Members members( value.getMemberNames() ); - if ( members.empty() ) - pushValue( "{}" ); - else - { - writeWithIndent( "{" ); - indent(); - Value::Members::iterator it = members.begin(); - for (;;) - { - const std::string &name = *it; - const Value &childValue = value[name]; - writeCommentBeforeValue( childValue ); - writeWithIndent( valueToQuotedString( name.c_str() ) ); - *document_ << " : "; - writeValue( childValue ); - if ( ++it == members.end() ) - { - writeCommentAfterValueOnSameLine( childValue ); - break; - } - *document_ << ","; - writeCommentAfterValueOnSameLine( childValue ); - } - unindent(); - writeWithIndent( "}" ); - } +StyledStreamWriter::StyledStreamWriter(std::string indentation) + : document_(NULL), rightMargin_(74), indentation_(indentation), + addChildValues_() {} + +void StyledStreamWriter::write(std::ostream &out, const Value &root) { + document_ = &out; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue(root); + writeValue(root); + writeCommentAfterValueOnSameLine(root); + *document_ << "\n"; + document_ = NULL; // Forget the stream, for safety. +} + +void StyledStreamWriter::writeValue(const Value &value) { + switch (value.type()) { + case nullValue: + pushValue("null"); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + pushValue(valueToQuotedString(value.asCString())); + break; + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + const std::string &name = *it; + const Value &childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedString(name.c_str())); + *document_ << " : "; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine(childValue); } - break; - } -} - - -void -StyledStreamWriter::writeArrayValue( const Value &value ) -{ - unsigned size = value.size(); - if ( size == 0 ) - pushValue( "[]" ); - else - { - bool isArrayMultiLine = isMultineArray( value ); - if ( isArrayMultiLine ) - { - writeWithIndent( "[" ); - indent(); - bool hasChildValue = !childValues_.empty(); - unsigned index =0; - for (;;) - { - const Value &childValue = value[index]; - writeCommentBeforeValue( childValue ); - if ( hasChildValue ) - writeWithIndent( childValues_[index] ); - else - { - writeIndent(); - writeValue( childValue ); - } - if ( ++index == size ) - { - writeCommentAfterValueOnSameLine( childValue ); - break; - } - *document_ << ","; - writeCommentAfterValueOnSameLine( childValue ); - } - unindent(); - writeWithIndent( "]" ); + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void StyledStreamWriter::writeArrayValue(const Value &value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isArrayMultiLine = isMultineArray(value); + if (isArrayMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + const Value &childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + writeIndent(); + writeValue(childValue); + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine(childValue); } - else // output on a single line - { - assert( childValues_.size() == size ); - *document_ << "[ "; - for ( unsigned index =0; index < size; ++index ) - { - if ( index > 0 ) - *document_ << ", "; - *document_ << childValues_[index]; - } - *document_ << " ]"; - } - } -} - - -bool -StyledStreamWriter::isMultineArray( const Value &value ) -{ - int size = value.size(); - bool isMultiLine = size*3 >= rightMargin_ ; - childValues_.clear(); - for ( int index =0; index < size && !isMultiLine; ++index ) - { - const Value &childValue = value[index]; - isMultiLine = isMultiLine || - ( (childValue.isArray() || childValue.isObject()) && - childValue.size() > 0 ); - } - if ( !isMultiLine ) // check if line length > max line length - { - childValues_.reserve( size ); - addChildValues_ = true; - int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]' - for ( int index =0; index < size && !isMultiLine; ++index ) - { - writeValue( value[index] ); - lineLength += int( childValues_[index].length() ); - isMultiLine = isMultiLine && hasCommentForValue( value[index] ); + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + *document_ << "[ "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + *document_ << ", "; + *document_ << childValues_[index]; } - addChildValues_ = false; - isMultiLine = isMultiLine || lineLength >= rightMargin_; - } - return isMultiLine; -} - - -void -StyledStreamWriter::pushValue( const std::string &value ) -{ - if ( addChildValues_ ) - childValues_.push_back( value ); - else - *document_ << value; -} - - -void -StyledStreamWriter::writeIndent() -{ + *document_ << " ]"; + } + } +} + +bool StyledStreamWriter::isMultineArray(const Value &value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + const Value &childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size && !isMultiLine; ++index) { + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + isMultiLine = isMultiLine && hasCommentForValue(value[index]); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void StyledStreamWriter::pushValue(const std::string &value) { + if (addChildValues_) + childValues_.push_back(value); + else + *document_ << value; +} + +void StyledStreamWriter::writeIndent() { /* Some comments in this method would have been nice. ;-) @@ -746,97 +603,68 @@ StyledStreamWriter::writeIndent() *document_ << '\n'; } */ - *document_ << '\n' << indentString_; + *document_ << '\n' << indentString_; } - -void -StyledStreamWriter::writeWithIndent( const std::string &value ) -{ - writeIndent(); - *document_ << value; +void StyledStreamWriter::writeWithIndent(const std::string &value) { + writeIndent(); + *document_ << value; } +void StyledStreamWriter::indent() { indentString_ += indentation_; } -void -StyledStreamWriter::indent() -{ - indentString_ += indentation_; +void StyledStreamWriter::unindent() { + assert(indentString_.size() >= indentation_.size()); + indentString_.resize(indentString_.size() - indentation_.size()); } - -void -StyledStreamWriter::unindent() -{ - assert( indentString_.size() >= indentation_.size() ); - indentString_.resize( indentString_.size() - indentation_.size() ); +void StyledStreamWriter::writeCommentBeforeValue(const Value &root) { + if (!root.hasComment(commentBefore)) + return; + *document_ << normalizeEOL(root.getComment(commentBefore)); + *document_ << "\n"; } +void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value &root) { + if (root.hasComment(commentAfterOnSameLine)) + *document_ << " " + normalizeEOL(root.getComment(commentAfterOnSameLine)); -void -StyledStreamWriter::writeCommentBeforeValue( const Value &root ) -{ - if ( !root.hasComment( commentBefore ) ) - return; - *document_ << normalizeEOL( root.getComment( commentBefore ) ); - *document_ << "\n"; -} - - -void -StyledStreamWriter::writeCommentAfterValueOnSameLine( const Value &root ) -{ - if ( root.hasComment( commentAfterOnSameLine ) ) - *document_ << " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) ); - - if ( root.hasComment( commentAfter ) ) - { - *document_ << "\n"; - *document_ << normalizeEOL( root.getComment( commentAfter ) ); - *document_ << "\n"; - } + if (root.hasComment(commentAfter)) { + *document_ << "\n"; + *document_ << normalizeEOL(root.getComment(commentAfter)); + *document_ << "\n"; + } } - -bool -StyledStreamWriter::hasCommentForValue( const Value &value ) -{ - return value.hasComment( commentBefore ) - || value.hasComment( commentAfterOnSameLine ) - || value.hasComment( commentAfter ); +bool StyledStreamWriter::hasCommentForValue(const Value &value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); } - -std::string -StyledStreamWriter::normalizeEOL( const std::string &text ) -{ - std::string normalized; - normalized.reserve( text.length() ); - const char *begin = text.c_str(); - const char *end = begin + text.length(); - const char *current = begin; - while ( current != end ) - { - char c = *current++; - if ( c == '\r' ) // mac or dos EOL - { - if ( *current == '\n' ) // convert dos EOL - ++current; - normalized += '\n'; - } - else // handle unix EOL & other char - normalized += c; - } - return normalized; +std::string StyledStreamWriter::normalizeEOL(const std::string &text) { + std::string normalized; + normalized.reserve(text.length()); + const char *begin = text.c_str(); + const char *end = begin + text.length(); + const char *current = begin; + while (current != end) { + char c = *current++; + if (c == '\r') // mac or dos EOL + { + if (*current == '\n') // convert dos EOL + ++current; + normalized += '\n'; + } else // handle unix EOL & other char + normalized += c; + } + return normalized; } - -std::ostream& operator<<( std::ostream &sout, const Value &root ) -{ - Json::StyledStreamWriter writer; - writer.write(sout, root); - return sout; +std::ostream &operator<<(std::ostream &sout, const Value &root) { + Json::StyledStreamWriter writer; + writer.write(sout, root); + return sout; } - } // namespace Json diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/lcdcontrol_config.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/lcdcontrol_config.cpp index 0db1cec09..517ecaaea 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/lcdcontrol_config.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/lcdcontrol_config.cpp @@ -1,2184 +1,2266 @@ #include -std::string lcdcontrol_config = "" -"{\n" -" \"variables\": {\n" -" \"foo\": 220\n" -" },\n" -" \"display_video\": {\n" -" \"driver\": \"video\",\n" -" \"layers\": 4,\n" -" \"foreground\": \"FFFFFFFF\",\n" -" \"background\": \"00000000\",\n" -" \"fill\": 1,\n" -" \"cols\": 256,\n" -" \"rows\": 64,\n" -" \"layout-timeout\": 0,\n" -" \"update\": 100,\n" -" //\"widget0\": \"widget_key_up\",\n" -" //\"widget1\": \"widget_key_down\",\n" -" //\"widget2\": \"widget_netstat_script\",\n" -" \"transition-speed\": 100,\n" -" \"refresh-rate\": 5,\n" -" \"layout0\": \"layout_full\"\n" -" },\n" -" \"layout_full\": {\n" -" \"layer4\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_infinite_256x64\"\n" -" }\n" -" },\n" -" \"layer3\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_libvisual_256x64\"\n" -" }\n" -" },\n" -" \"layer2\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_histogram_large\"\n" -" }\n" -" },\n" -" \"layer1\": {\n" -" \"row2\": {\n" -" \"col1\": \"widget_icon_heart\",\n" -" \"col2\": \"widget_icon_heartbeat\",\n" -" \"col3\": \"widget_icon_heart\",\n" -" \"col4\": \"widget_icon_heartbeat\",\n" -" \"col5\": \"widget_icon_heart\",\n" -" \"col6\": \"widget_icon_heartbeat\",\n" -" \"col7\": \"widget_icon_heart\",\n" -" \"col8\": \"widget_icon_heartbeat\",\n" -" \"col9\": \"widget_icon_heart\",\n" -" \"col10\": \"widget_icon_heartbeat\",\n" -" \"col11\": \"widget_icon_heart\",\n" -" \"col12\": \"widget_icon_heartbeat\",\n" -" \"col13\": \"widget_icon_heart\",\n" -" \"col14\": \"widget_icon_heartbeat\",\n" -" \"col15\": \"widget_icon_heart\",\n" -" \"col16\": \"widget_icon_heartbeat\",\n" -" \"col17\": \"widget_icon_heart\",\n" -" \"col18\": \"widget_icon_heartbeat\",\n" -" \"col19\": \"widget_icon_heart\",\n" -" \"col20\": \"widget_icon_heartbeat\"\n" -" },\n" -" \"row3\": {\n" -" \"col4\": \"widget_cpu_label\",\n" -" \"col8\": \"widget_bignums\",\n" -" \"col11\": \"widget_percent\"\n" -" },\n" -" \"row5\": {\n" -" \"col1\": \"widget_FSSpace\"\n" -" },\n" -" \"transition\": \"U\"\n" -" }\n" -" },\n" -" \"layout_2x16\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_CPULabel\",\n" -" \"col5\": \"widget_CPU\"\n" -" },\n" -" \"row2\": {\n" -" \"col1\": \"widget_page_label\",\n" -" \"col11\": \"widget_page\"\n" -" }\n" -" },\n" -" \"layout_histogram_large\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_histogram_large\"\n" -" },\n" -" \"transition\": \"U\"\n" -" },\n" -" \"layout_full_256x64\": {\n" -" \"layer2\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_histogram_large\"\n" -" }\n" -" },\n" -" \"layer3\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_libvisual\"\n" -" }\n" -" },\n" -" \"row1\": {\n" -" \"col1\": \"widget_CPULabel\",\n" -" \"col6\": \"widget_CPU\",\n" -" \"col11\": \"widget_CPUBar\",\n" -" \"col21\": \"widget_RAMLabel\",\n" -" \"col26\": \"widget_RAMFree\",\n" -" \"col31\": \"widget_RAMTotal\"\n" -" },\n" -" \"row2\": {\n" -" \"col1\": \"widget_IDELabel\",\n" -" \"col6\": \"widget_IDEIn\",\n" -" \"col17\": \"widget_IDEOut\",\n" -" \"col28\": \"widget_IDEBar\"\n" -" },\n" -" \"row3\": {\n" -" \"col1\": \"widget_FSSpace\"\n" -" },\n" -" \"row4\": {\n" -" \"col1\": \"widget_WLANLabel\",\n" -" \"col6\": \"widget_WLANIn\",\n" -" \"col17\": \"widget_WLANOut\",\n" -" \"col28\": \"widget_WLANBar\"\n" -" },\n" -" \"row6\": {\n" -" \"col1\": \"widget_icon_heartbeat\",\n" -" \"col2\": \"widget_icon_ekg\",\n" -" \"col3\": \"widget_icon_heart\",\n" -" \"col4\": \"widget_icon_blob\",\n" -" \"col5\": \"widget_icon_wave\",\n" -" \"col6\": \"widget_icon_timer\",\n" -" \"col7\": \"widget_icon_rain\",\n" -" \"col8\": \"widget_icon_karo\",\n" -" \"col9\": \"widget_icon_heartbeat\",\n" -" \"col10\": \"widget_icon_ekg\",\n" -" \"col11\": \"widget_icon_heart\",\n" -" \"col12\": \"widget_icon_blob\",\n" -" \"col13\": \"widget_icon_wave\",\n" -" \"col14\": \"widget_icon_timer\",\n" -" \"col15\": \"widget_icon_rain\",\n" -" \"col16\": \"widget_icon_karo\",\n" -" \"col17\": \"widget_icon_heartbeat\",\n" -" \"col18\": \"widget_icon_ekg\",\n" -" \"col19\": \"widget_icon_heart\",\n" -" \"col20\": \"widget_icon_blob\",\n" -" \"col21\": \"widget_icon_wave\",\n" -" \"col22\": \"widget_icon_timer\",\n" -" \"col23\": \"widget_icon_rain\",\n" -" \"col24\": \"widget_icon_karo\",\n" -" \"col25\": \"widget_icon_heartbeat\",\n" -" \"col26\": \"widget_icon_ekg\",\n" -" \"col27\": \"widget_icon_heart\",\n" -" \"col28\": \"widget_icon_blob\",\n" -" \"col29\": \"widget_icon_wave\",\n" -" \"col30\": \"widget_icon_timer\",\n" -" \"col31\": \"widget_icon_rain\",\n" -" \"col32\": \"widget_icon_karo\",\n" -" \"col33\": \"widget_icon_heartbeat\",\n" -" \"col34\": \"widget_icon_ekg\",\n" -" \"col35\": \"widget_icon_heart\",\n" -" \"col36\": \"widget_icon_blob\",\n" -" \"col37\": \"widget_icon_blob\",\n" -" \"col38\": \"widget_icon_wave\",\n" -" \"col39\": \"widget_icon_timer\",\n" -" \"col40\": \"widget_icon_rain\",\n" -" \"col41\": \"widget_icon_karo\",\n" -" \"col42\": \"widget_icon_heartbeat\"\n" -" \n" -" },\n" -" \"row7\": {\n" -" \"col1\": \"widget_Time\",\n" -" \"col22\": \"widget_UptimeLabel\",\n" -" \"col30\": \"widget_Uptime\"\n" -" },\n" -" \"row8\": {\n" -" \"col1\": \"widget_bottom_ticker\"\n" -" },\n" -" \"transition\": \"U\"\n" -" },\n" -" \"layout_blank\": {\n" -" \"layout-timeout\": 0\n" -" },\n" -" \"layout_pcm_256x64\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_pcm_256x64\"\n" -" },\n" -" \"transition\": \"U\"\n" -" },\n" -" \"layout_pcm_24x16\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_pcm_24x16\"\n" -" }\n" -" },\n" -" \"layout_peak\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_peak\"\n" -" }\n" -" },\n" -" \"layout_spectrum\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_spectrum\"\n" -" },\n" -" \"transition\": \"U\"\n" -" },\n" -" \"layout_1\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_cpu_label\",\n" -" //\"col11\": \"widget_cpu_histogram\",\n" -" \"col6\": \"widget_cpu\"\n" -" }, \n" -" \"row2\": {\n" -" //\"col1\": \"widget_wlan0_label\", \n" -" //\"col11\": \"widget_wlan0_histogram\",\n" -" //\"col7\": \"widget_wlan0\"\n" -" }, \n" -" \"row3\": {\n" -" //\"col1\": \"widget_ram_label\",\n" -" //\"col5\": \"widget_ram_active\",\n" -" //\"col11\": \"widget_ram_total\"\n" -" }, \n" -" \"row4\": {\n" -" //\"col1\": \"widget_bottom_ticker\"\n" -" }, \n" -" \"transition\": \"B\"\n" -" }, \n" -" \"layout_visualization\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_pcm_24x16\"\n" -" //\"col17\": \"widget_pcm_24x16\",\n" -" //\"col9\": \"widget_pcm_24x16\"\n" -" },\n" -" \"row3\": {\n" -" //\"col13\": \"widget_pcm_24x16\",\n" -" //\"col5\": \"widget_pcm_24x16\"\n" -" },\n" -" \"transition\": \"B\"\n" -" },\n" -" \"layout_american_flag\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_gif_american_flag\",\n" -" \"col17\": \"widget_gif_american_flag\", \n" -" \"col9\": \"widget_gif_american_flag\"\n" -" }, \n" -" \"row3\": {\n" -" \"col13\": \"widget_gif_american_flag\", \n" -" \"col5\": \"widget_gif_american_flag\"\n" -" },\n" -" \"transition\": \"D\"\n" -" }, \n" -" \"layout_bar\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_ram_label\",\n" -" \"col10\": \"widget_ram_total\", \n" -" \"col5\": \"widget_ram_active\"\n" -" },\n" -" \"row2\": {\n" -" \"col1\": \"widget_wlan0_label\",\n" -" \"col10\": \"widget_wlan0_bar\",\n" -" \"col7\": \"widget_wlan0\"\n" -" }, \n" -" \"row3\": {\n" -" \"col1\": \"widget_icon_wave\",\n" -" \"col10\": \"widget_icon_ekg\", \n" -" \"col11\": \"widget_icon_rain\", \n" -" \"col12\": \"widget_icon_blob\", \n" -" \"col13\": \"widget_icon_wave\", \n" -" \"col14\": \"widget_icon_ekg\", \n" -" \"col15\": \"widget_icon_rain\", \n" -" \"col16\": \"widget_icon_blob\", \n" -" \"col17\": \"widget_icon_wave\", \n" -" \"col18\": \"widget_icon_ekg\", \n" -" \"col19\": \"widget_icon_rain\",\n" -" \"col2\": \"widget_icon_ekg\", \n" -" \"col20\": \"widget_icon_blob\", \n" -" \"col3\": \"widget_icon_rain\", \n" -" \"col4\": \"widget_icon_blob\", \n" -" \"col5\": \"widget_icon_wave\", \n" -" \"col6\": \"widget_icon_ekg\", \n" -" \"col7\": \"widget_icon_rain\", \n" -" \"col8\": \"widget_icon_blob\", \n" -" \"col9\": \"widget_icon_wave\"\n" -" },\n" -" \"row4\": {\n" -" \"col1\": \"widget_bottom_ticker\"\n" -" }, \n" -" \"transition\": \"U\"\n" -" }, \n" -" \"layout_bignums\": {\n" -" \"row2\": {\n" -" \"col1\": \"widget_cpu_label\", \n" -" \"col10\": \"widget_bignums\"\n" -" }, \n" -" \"row3\": {\n" -" \"col14\": \"widget_percent\"\n" -" },\n" -" \"transition\": \"D\"\n" -" }, \n" -" \"layout_banner\": {\n" -" \"row1\": {\n" -" \"col2\": \"widget_vis_banner\",\n" -" \"col12\": \"widget_vis_banner\"\n" -" },\n" -" \"row2\": {\n" -" \"col2\": \"widget_vis_banner\",\n" -" \"col12\": \"widget_vis_banner\"\n" -" },\n" -" \"row3\": {\n" -" \"col1\": \"widget_Time\"\n" -"\n" -" },\n" -" \"row4\": {\n" -" \"col2\": \"widget_vis_banner\",\n" -" \"col12\": \"widget_vis_banner\"\n" -" },\n" -" \"transition\": \"U\"\n" -" },\n" -" \"layout_bolt\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_gif_bolt\", \n" -" \"col17\": \"widget_gif_bolt\", \n" -" \"col9\": \"widget_gif_bolt\"\n" -" }, \n" -" \"row3\": {\n" -" \"col13\": \"widget_gif_bolt\", \n" -" \"col5\": \"widget_gif_bolt\"\n" -" },\n" -" \"transition\": \"B\"\n" -" }, \n" -" \"layout_dolby\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_gif_dolby\", \n" -" \"col17\": \"widget_gif_dolby\", \n" -" \"col9\": \"widget_gif_dolby\"\n" -" }, \n" -" \"row3\": {\n" -" \"col13\": \"widget_gif_dolby\", \n" -" \"col5\": \"widget_gif_dolby\"\n" -" },\n" -" \"transition\": \"U\"\n" -" }, \n" -" \"layout_icons\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_icon_heartbeat\", \n" -" \"col10\": \"widget_icon_ekg\", \n" -" \"col11\": \"widget_icon_heart\", \n" -" \"col12\": \"widget_icon_blob\", \n" -" \"col13\": \"widget_icon_wave\", \n" -" \"col14\": \"widget_icon_timer\", \n" -" \"col15\": \"widget_icon_rain\", \n" -" \"col16\": \"widget_icon_karo\", \n" -" \"col17\": \"widget_icon_heartbeat\", \n" -" \"col18\": \"widget_icon_ekg\", \n" -" \"col19\": \"widget_icon_heart\", \n" -" \"col2\": \"widget_icon_ekg\", \n" -" \"col20\": \"widget_icon_blob\", \n" -" \"col3\": \"widget_icon_heart\", \n" -" \"col4\": \"widget_icon_blob\", \n" -" \"col5\": \"widget_icon_wave\", \n" -" \"col6\": \"widget_icon_timer\", \n" -" \"col7\": \"widget_icon_rain\", \n" -" \"col8\": \"widget_icon_karo\", \n" -" \"col9\": \"widget_icon_heartbeat\"\n" -" }, \n" -" \"row2\": {\n" -" \"col1\": \"widget_icon_wave\", \n" -" \"col10\": \"widget_icon_timer\", \n" -" \"col11\": \"widget_icon_rain\", \n" -" \"col12\": \"widget_icon_karo\", \n" -" \"col13\": \"widget_icon_heartbeat\", \n" -" \"col14\": \"widget_icon_ekg\", \n" -" \"col15\": \"widget_icon_heart\", \n" -" \"col16\": \"widget_icon_blob\", \n" -" \"col17\": \"widget_icon_wave\", \n" -" \"col18\": \"widget_icon_timer\", \n" -" \"col19\": \"widget_icon_rain\", \n" -" \"col2\": \"widget_icon_timer\", \n" -" \"col20\": \"widget_icon_karo\", \n" -" \"col3\": \"widget_icon_rain\", \n" -" \"col4\": \"widget_icon_karo\", \n" -" \"col5\": \"widget_icon_heartbeat\", \n" -" \"col6\": \"widget_icon_ekg\", \n" -" \"col7\": \"widget_icon_heart\", \n" -" \"col8\": \"widget_icon_blob\", \n" -" \"col9\": \"widget_icon_wave\"\n" -" }, \n" -" \"row3\": {\n" -" \"col1\": \"widget_icon_heartbeat\", \n" -" \"col10\": \"widget_icon_ekg\", \n" -" \"col11\": \"widget_icon_heart\", \n" -" \"col12\": \"widget_icon_blob\", \n" -" \"col13\": \"widget_icon_wave\", \n" -" \"col14\": \"widget_icon_timer\", \n" -" \"col15\": \"widget_icon_rain\", \n" -" \"col16\": \"widget_icon_karo\", \n" -" \"col17\": \"widget_icon_heartbeat\", \n" -" \"col18\": \"widget_icon_ekg\", \n" -" \"col19\": \"widget_icon_heart\", \n" -" \"col2\": \"widget_icon_ekg\", \n" -" \"col20\": \"widget_icon_blob\", \n" -" \"col3\": \"widget_icon_heart\", \n" -" \"col4\": \"widget_icon_blob\", \n" -" \"col5\": \"widget_icon_wave\", \n" -" \"col6\": \"widget_icon_timer\", \n" -" \"col7\": \"widget_icon_rain\", \n" -" \"col8\": \"widget_icon_karo\", \n" -" \"col9\": \"widget_icon_heartbeat\"\n" -" }, \n" -" \"row4\": {\n" -" \"col1\": \"widget_icon_wave\", \n" -" \"col10\": \"widget_icon_timer\", \n" -" \"col11\": \"widget_icon_rain\", \n" -" \"col12\": \"widget_icon_karo\", \n" -" \"col13\": \"widget_icon_heartbeat\", \n" -" \"col14\": \"widget_icon_ekg\", \n" -" \"col15\": \"widget_icon_heart\", \n" -" \"col16\": \"widget_icon_blob\", \n" -" \"col17\": \"widget_icon_wave\", \n" -" \"col18\": \"widget_icon_timer\", \n" -" \"col19\": \"widget_icon_rain\", \n" -" \"col2\": \"widget_icon_timer\", \n" -" \"col20\": \"widget_icon_karo\", \n" -" \"col3\": \"widget_icon_rain\", \n" -" \"col4\": \"widget_icon_karo\", \n" -" \"col5\": \"widget_icon_heartbeat\", \n" -" \"col6\": \"widget_icon_ekg\", \n" -" \"col7\": \"widget_icon_heart\", \n" -" \"col8\": \"widget_icon_blob\", \n" -" \"col9\": \"widget_icon_wave\"\n" -" }, \n" -" \"transition\": \"B\"\n" -" }, \n" -" \"layout_intel\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_gif_intel\", \n" -" \"col17\": \"widget_gif_intel\", \n" -" \"col9\": \"widget_gif_intel\"\n" -" }, \n" -" \"row3\": {\n" -" \"col13\": \"widget_gif_intel\", \n" -" \"col5\": \"widget_gif_intel\"\n" -" },\n" -" \"transition\": \"R\"\n" -" }, \n" -" \"layout_karo\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_icon_karo\", \n" -" \"col10\": \"widget_icon_karo\", \n" -" \"col11\": \"widget_icon_karo\", \n" -" \"col12\": \"widget_icon_karo\", \n" -" \"col13\": \"widget_icon_karo\", \n" -" \"col14\": \"widget_icon_karo\", \n" -" \"col15\": \"widget_icon_karo\", \n" -" \"col16\": \"widget_icon_karo\", \n" -" \"col17\": \"widget_icon_karo\", \n" -" \"col18\": \"widget_icon_karo\", \n" -" \"col19\": \"widget_icon_karo\", \n" -" \"col2\": \"widget_icon_karo\", \n" -" \"col20\": \"widget_icon_karo\", \n" -" \"col3\": \"widget_icon_karo\", \n" -" \"col4\": \"widget_icon_karo\", \n" -" \"col5\": \"widget_icon_karo\", \n" -" \"col6\": \"widget_icon_karo\", \n" -" \"col7\": \"widget_icon_karo\", \n" -" \"col8\": \"widget_icon_karo\", \n" -" \"col9\": \"widget_icon_karo\"\n" -" }, \n" -" \"row2\": {\n" -" \"col1\": \"widget_icon_karo\", \n" -" \"col10\": \"widget_icon_karo\", \n" -" \"col11\": \"widget_icon_karo\", \n" -" \"col12\": \"widget_icon_karo\", \n" -" \"col13\": \"widget_icon_karo\", \n" -" \"col14\": \"widget_icon_karo\", \n" -" \"col15\": \"widget_icon_karo\", \n" -" \"col16\": \"widget_icon_karo\", \n" -" \"col17\": \"widget_icon_karo\", \n" -" \"col18\": \"widget_icon_karo\", \n" -" \"col19\": \"widget_icon_karo\", \n" -" \"col2\": \"widget_icon_karo\", \n" -" \"col20\": \"widget_icon_karo\", \n" -" \"col3\": \"widget_icon_karo\", \n" -" \"col4\": \"widget_icon_karo\", \n" -" \"col5\": \"widget_icon_karo\", \n" -" \"col6\": \"widget_icon_karo\", \n" -" \"col7\": \"widget_icon_karo\", \n" -" \"col8\": \"widget_icon_karo\", \n" -" \"col9\": \"widget_icon_karo\"\n" -" }, \n" -" \"row3\": {\n" -" \"col1\": \"widget_icon_karo\", \n" -" \"col10\": \"widget_icon_karo\", \n" -" \"col11\": \"widget_icon_karo\", \n" -" \"col12\": \"widget_icon_karo\", \n" -" \"col13\": \"widget_icon_karo\", \n" -" \"col14\": \"widget_icon_karo\", \n" -" \"col15\": \"widget_icon_karo\", \n" -" \"col16\": \"widget_icon_karo\", \n" -" \"col17\": \"widget_icon_karo\", \n" -" \"col18\": \"widget_icon_karo\", \n" -" \"col19\": \"widget_icon_karo\", \n" -" \"col2\": \"widget_icon_karo\", \n" -" \"col20\": \"widget_icon_karo\", \n" -" \"col3\": \"widget_icon_karo\", \n" -" \"col4\": \"widget_icon_karo\", \n" -" \"col5\": \"widget_icon_karo\", \n" -" \"col6\": \"widget_icon_karo\", \n" -" \"col7\": \"widget_icon_karo\", \n" -" \"col8\": \"widget_icon_karo\", \n" -" \"col9\": \"widget_icon_karo\"\n" -" }, \n" -" \"row4\": {\n" -" \"col1\": \"widget_icon_karo\", \n" -" \"col10\": \"widget_icon_karo\", \n" -" \"col11\": \"widget_icon_karo\", \n" -" \"col12\": \"widget_icon_karo\", \n" -" \"col13\": \"widget_icon_karo\", \n" -" \"col14\": \"widget_icon_karo\", \n" -" \"col15\": \"widget_icon_karo\", \n" -" \"col16\": \"widget_icon_karo\", \n" -" \"col17\": \"widget_icon_karo\", \n" -" \"col18\": \"widget_icon_karo\", \n" -" \"col19\": \"widget_icon_karo\", \n" -" \"col2\": \"widget_icon_karo\", \n" -" \"col20\": \"widget_icon_karo\", \n" -" \"col3\": \"widget_icon_karo\", \n" -" \"col4\": \"widget_icon_karo\", \n" -" \"col5\": \"widget_icon_karo\", \n" -" \"col6\": \"widget_icon_karo\", \n" -" \"col7\": \"widget_icon_karo\", \n" -" \"col8\": \"widget_icon_karo\", \n" -" \"col9\": \"widget_icon_karo\"\n" -" }, \n" -" \"transition\": \"D\"\n" -" }, \n" -" \"layout_marquee1\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_gif_marquee1\", \n" -" \"col11\": \"widget_gif_marquee1\", \n" -" \"col13\": \"widget_gif_marquee1\", \n" -" \"col15\": \"widget_gif_marquee1\", \n" -" \"col17\": \"widget_gif_marquee1\", \n" -" \"col19\": \"widget_gif_marquee1\", \n" -" \"col3\": \"widget_gif_marquee1\", \n" -" \"col5\": \"widget_gif_marquee1\", \n" -" \"col7\": \"widget_gif_marquee1\", \n" -" \"col9\": \"widget_gif_marquee1\"\n" -" }, \n" -" \"row2\": {\n" -" \"col1\": \"widget_gif_marquee1\", \n" -" \"col12\": \"widget_wlan0_short_bar\", \n" -" \"col19\": \"widget_gif_marquee1\", \n" -" \"col3\": \"widget_wlan0_label\", \n" -" \"col9\": \"widget_wlan0\"\n" -" }, \n" -" \"row3\": {\n" -" \"col1\": \"widget_gif_marquee1\", \n" -" \"col19\": \"widget_gif_marquee1\", \n" -" \"col3\": \"widget_bottom_marquee\"\n" -" }, \n" -" \"row4\": {\n" -" \"col1\": \"widget_gif_marquee1\", \n" -" \"col11\": \"widget_gif_marquee1\", \n" -" \"col13\": \"widget_gif_marquee1\", \n" -" \"col15\": \"widget_gif_marquee1\", \n" -" \"col17\": \"widget_gif_marquee1\", \n" -" \"col19\": \"widget_gif_marquee1\", \n" -" \"col3\": \"widget_gif_marquee1\", \n" -" \"col5\": \"widget_gif_marquee1\", \n" -" \"col7\": \"widget_gif_marquee1\", \n" -" \"col9\": \"widget_gif_marquee1\"\n" -" },\n" -" \"transition\": \"B\"\n" -" }, \n" -" \"layout_marquee2\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_gif_marquee2\", \n" -" \"col11\": \"widget_gif_marquee2\", \n" -" \"col13\": \"widget_gif_marquee2\", \n" -" \"col15\": \"widget_gif_marquee2\", \n" -" \"col17\": \"widget_gif_marquee2\", \n" -" \"col19\": \"widget_gif_marquee2\", \n" -" \"col3\": \"widget_gif_marquee2\", \n" -" \"col5\": \"widget_gif_marquee2\", \n" -" \"col7\": \"widget_gif_marquee2\", \n" -" \"col9\": \"widget_gif_marquee2\"\n" -" }, \n" -" \"row2\": {\n" -" \"col1\": \"widget_gif_marquee2\", \n" -" \"col12\": \"widget_wlan0_short_bar\", \n" -" \"col19\": \"widget_gif_marquee2\", \n" -" \"col3\": \"widget_wlan0_label\", \n" -" \"col9\": \"widget_wlan0\"\n" -" }, \n" -" \"row3\": {\n" -" \"col1\": \"widget_gif_marquee2\", \n" -" \"col19\": \"widget_gif_marquee2\", \n" -" \"col3\": \"widget_bottom_marquee\"\n" -" }, \n" -" \"row4\": {\n" -" \"col1\": \"widget_gif_marquee2\", \n" -" \"col11\": \"widget_gif_marquee2\", \n" -" \"col13\": \"widget_gif_marquee2\", \n" -" \"col15\": \"widget_gif_marquee2\", \n" -" \"col17\": \"widget_gif_marquee2\", \n" -" \"col19\": \"widget_gif_marquee2\", \n" -" \"col3\": \"widget_gif_marquee2\", \n" -" \"col5\": \"widget_gif_marquee2\", \n" -" \"col7\": \"widget_gif_marquee2\", \n" -" \"col9\": \"widget_gif_marquee2\"\n" -" },\n" -" \"transition\": \"U\"\n" -" }, \n" -" \"layout_marquee3\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_gif_marquee3\", \n" -" \"col11\": \"widget_gif_marquee3\", \n" -" \"col13\": \"widget_gif_marquee3\", \n" -" \"col15\": \"widget_gif_marquee3\", \n" -" \"col17\": \"widget_gif_marquee3\", \n" -" \"col19\": \"widget_gif_marquee3\", \n" -" \"col3\": \"widget_gif_marquee3\", \n" -" \"col5\": \"widget_gif_marquee3\", \n" -" \"col7\": \"widget_gif_marquee3\", \n" -" \"col9\": \"widget_gif_marquee3\"\n" -" }, \n" -" \"row2\": {\n" -" \"col1\": \"widget_gif_marquee3\", \n" -" \"col12\": \"widget_wlan0_short_bar\", \n" -" \"col19\": \"widget_gif_marquee3\", \n" -" \"col3\": \"widget_wlan0_label\", \n" -" \"col9\": \"widget_wlan0\"\n" -" }, \n" -" \"row3\": {\n" -" \"col1\": \"widget_gif_marquee3\", \n" -" \"col19\": \"widget_gif_marquee3\", \n" -" \"col3\": \"widget_bottom_marquee\"\n" -" }, \n" -" \"row4\": {\n" -" \"col1\": \"widget_gif_marquee3\", \n" -" \"col11\": \"widget_gif_marquee3\", \n" -" \"col13\": \"widget_gif_marquee3\", \n" -" \"col15\": \"widget_gif_marquee3\", \n" -" \"col17\": \"widget_gif_marquee3\", \n" -" \"col19\": \"widget_gif_marquee3\", \n" -" \"col3\": \"widget_gif_marquee3\", \n" -" \"col5\": \"widget_gif_marquee3\", \n" -" \"col7\": \"widget_gif_marquee3\", \n" -" \"col9\": \"widget_gif_marquee3\"\n" -" },\n" -" \"transition\": \"D\"\n" -" }, \n" -" \"layout_marquee4\": {\n" -" \"row1\": {\n" -" \"col1\": \"widget_gif_marquee4\", \n" -" \"col11\": \"widget_gif_marquee4\", \n" -" \"col13\": \"widget_gif_marquee4\", \n" -" \"col15\": \"widget_gif_marquee4\", \n" -" \"col17\": \"widget_gif_marquee4\", \n" -" \"col19\": \"widget_gif_marquee4\", \n" -" \"col3\": \"widget_gif_marquee4\", \n" -" \"col5\": \"widget_gif_marquee4\", \n" -" \"col7\": \"widget_gif_marquee4\", \n" -" \"col9\": \"widget_gif_marquee4\"\n" -" }, \n" -" \"row2\": {\n" -" \"col1\": \"widget_gif_marquee4\", \n" -" \"col12\": \"widget_wlan0_short_bar\", \n" -" \"col19\": \"widget_gif_marquee4\", \n" -" \"col3\": \"widget_wlan0_label\", \n" -" \"col9\": \"widget_wlan0\"\n" -" }, \n" -" \"row3\": {\n" -" \"col1\": \"widget_gif_marquee4\", \n" -" \"col19\": \"widget_gif_marquee4\", \n" -" \"col3\": \"widget_bottom_marquee\"\n" -" }, \n" -" \"row4\": {\n" -" \"col1\": \"widget_gif_marquee4\", \n" -" \"col11\": \"widget_gif_marquee4\", \n" -" \"col13\": \"widget_gif_marquee4\", \n" -" \"col15\": \"widget_gif_marquee4\", \n" -" \"col17\": \"widget_gif_marquee4\", \n" -" \"col19\": \"widget_gif_marquee4\", \n" -" \"col3\": \"widget_gif_marquee4\", \n" -" \"col5\": \"widget_gif_marquee4\", \n" -" \"col7\": \"widget_gif_marquee4\", \n" -" \"col9\": \"widget_gif_marquee4\"\n" -" },\n" -" \"transition\": \"U\"\n" -" }, \n" -" \"plugins\": {\n" -" \"i2c_sensors-path\": \"/sys/bus/i2c/devices/1-0028/\"\n" -" }, \n" -" \"widget_superscope\": {\n" -" \"init\": [\n" -" \"n=500\",\n" -" \"r=10\",\n" -" \"mx=0\",\n" -" \"my=0\",\n" -" \"mz=0\",\n" -" \"dst=0.2\",\n" -" \"rx=0\",\n" -" \"ry=0\",\n" -" \"rz=0\",\n" -" \"rdx=1\",\n" -" \"rdy=1\",\n" -" \"rdz=1\",\n" -" \"p=3.14159265\",\n" -" \"p2=10.0*p\",\n" -" \"p3=50/p\"\n" -"\n" -" ],\n" -" \"frame\": [\n" -" \"rx=rx+rdx\",\n" -" \"ry=ry+rdy\",\n" -" \"rz=rz+rdz\",\n" -" \"xs=sin(rx/p3)\",\n" -" \"ys=sin(ry/p3)\",\n" -" \"zs=sin(rz/p3)\",\n" -" \"xc=cos(rx/p3)\",\n" -" \"yc=cos(ry/p3)\",\n" -" \"zc=cos(rz/p3)\"\n" -" ],\n" -" \"beat\": [\n" -" \"r=rand(8) + 2\"\n" -" ],\n" -" \"point\": [\n" -" \"x1=v*sin(p2*i)\",\n" -" \"y1=v * i / cos(z1)\",\n" -" \"z1=r*cos(p2*i)\",\n" -" \"y2=y1*xc-z1*xs\",\n" -" \"z2=y1*xs+z1*xc\",\n" -" \"x2=z2*ys+x1*yc\",\n" -" \"z3=z2*yc-x1*ys\",\n" -" \"x3=x2*zc-y2*zs\",\n" -" \"y3=y2*zc+x2*zs\",\n" -" \"x4=mx+x3\",\n" -" \"y4=my+y3\",\n" -" \"z4=mz+z3\",\n" -" \"x=x4/(1+z4/dst)\",\n" -" \"y=y4/(1+z4/dst)\"\n" -"\n" -" ]\n" -" },\n" -" \"widget_page_label\": {\n" -" \"type\": \"text\",\n" -" \"length\": 10,\n" -" \"expression\": \"return 'PAGE FILE:'\"\n" -" },\n" -" \"widged_page\": {\n" -" \"type\": \"text\",\n" -" \"length\": 6,\n" -" \"expression\": \"return procstat.ProcStat('page')\"\n" -" },\n" -" \"widget_histogram_large\": {\n" -" \"type\": \"histogram\",\n" -" \"expression\": \"return procstat.Cpu('busy', 500)\",\n" -" \"foreground\": \"99005500\",\n" -" \"background\": \"77777777\",\n" -" \"height\": 32,\n" -" \"width\": 160,\n" -" \"update\": 100\n" -" },\n" -" \"widget_hddtemp\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return 'IDE Temp: ' .. exec.Exec('hddtemp /dev/sda1 | cut -f 3 -d :', 999)\",\n" -" \"length\": 14,\n" -" \"align\": \"L\",\n" -" \"update\": 999\n" -" },\n" -" \"widget_FSSpace\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"fsspace_a = ((statfs.Statfs('/', 'bavail')*statfs.Statfs('/', 'bsize'))/ 1024/ 1024);fsspace_b = ((statfs.Statfs('/', 'bavail')*statfs.Statfs('/', 'bsize'))/1024/1024);c = '/ ' .. fsspace_a .. 'MB / ' .. fsspace_b .. ' MB'; return c;\n" -" \",\n" -" \"length\": 42,\n" -" \"align\": \"M\",\n" -" \"speed\": 30\n" -" },\n" -" \"widget_CPU\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return procstat.Cpu('busy', 500)\",\n" -" \"postfix\": \"return '% '\",\n" -" \"length\": 5,\n" -" \"precision\": 1,\n" -" \"align\": \"R\",\n" -" \"update\": 50\n" -" },\n" -" \"widget_CPUBar\": {\n" -" \"type\": \"bar\",\n" -" \"expression\": \"return procstat.Cpu('busy', 500)\",\n" -" \"expression2\": \"return procstat.Cpu('system', 500)\",\n" -" \"length\": 10,\n" -" \"min\": \"1\",\n" -" \"max\": \"100\",\n" -" \"direction\": \"E\",\n" -" \"style\": \"H\",\n" -" \"update\": 50\n" -" },\n" -" \"widget_CPULabel\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return 'CPU:'\",\n" -" \"length\": 4,\n" -" \"align\": \"L\",\n" -" \"bold\": 1\n" -" },\n" -" \"widget_RAMTotal\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return meminfo.Meminfo('MemTotal')/1024\",\n" -" \"postfix\": \"return 'MB FREE'\",\n" -" \"length\": 11,\n" -" \"precision\": 0,\n" -" \"align\": \"L\",\n" -" \"update\": 50\n" -" },\n" -" \"widget_RAMFree\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return meminfo.Meminfo('MemFree')/1024\",\n" -" \"postfix\": \"return '/'\",\n" -" \"length\": 5,\n" -" \"precision\": 0,\n" -" \"align\": \"R\",\n" -" \"update\": 50\n" -" },\n" -" \"widget_RAMLabel\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return 'RAM:'\",\n" -" \"length\": 4,\n" -" \"align\": \"L\",\n" -" \"bold\": 1\n" -" },\n" -" \"widget_IDEIn\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return diskstats.Diskstats('sda', 'read_sectors', 100)/2048\",\n" -" \"prefix\": \"return 'In '\",\n" -" \"postfix\": \"return 'MB'\",\n" -" \"precision\": 2,\n" -" \"align\": \"R\",\n" -" \"length\": 10,\n" -" \"update\": 500\n" -" },\n" -" \"widget_IDEOut\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return diskstats.Diskstats('sda', 'write_sectors', 100)/2048\",\n" -" \"prefix\": \"return 'Out'\",\n" -" \"postfix\": \"return 'MB'\",\n" -" \"precision\": 2,\n" -" \"align\": \"R\",\n" -" \"length\": 10,\n" -" \"update\": 500\n" -" },\n" -" \"widget_IDEBar\": {\n" -" \"type\": \"bar\",\n" -" \"expression\": \"return diskstats.Diskstats('sda', 'read_sectors', 100)\",\n" -" \"expression2\": \"return diskstats.Diskstats('sda', 'write_sectors', 100)\",\n" -" \"length\": 14,\n" -" \"direction\": \"E\",\n" -" \"style\": \"H\",\n" -" \"update\": 500\n" -" },\n" -" \"widget_IDELabel\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return 'IDE:'\",\n" -" \"length\": 4,\n" -" \"align\": \"L\",\n" -" \"bold\": 1\n" -" },\n" -" \"widget_WLANLabel\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return 'WLAN:'\",\n" -" \"length\": 5,\n" -" \"align\": \"L\",\n" -" \"bold\": 1\n" -" },\n" -" \"widget_WLANIn\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return netdev.Fast('wlan0', 'Rx_bytes', 500)/1024\",\n" -" \"prefix\": \"'OUT'\",\n" -" \"postfix\": \"'KB'\",\n" -" \"length\": 9,\n" -" \"precision\": 0,\n" -" \"align\": \"R\",\n" -" \"update\": 50\n" -" },\n" -" \"widget_WLANOut\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return netdev.Fast('wlan0', 'Tx_bytes', 500)/1024\",\n" -" \"prefix\": \"'IN'\",\n" -" \"postfix\": \"'KB'\",\n" -" \"length\": 9,\n" -" \"precision\": 0,\n" -" \"align\": \"R\",\n" -" \"update\": 50\n" -" },\n" -" \"widget_WLANBar\": {\n" -" \"type\": \"bar\",\n" -" \"expression\": \"return netdev.Fast('wlan0', 'Rx_bytes', 500)\",\n" -" \"expression2\": \"return netdev.Fast('wlan0', 'Tx_bytes', 500)\",\n" -" \"length\": 14,\n" -" \"direction\": \"E\",\n" -" \"style\": \"H\",\n" -" \"update\": 50\n" -" },\n" -" \"widget_TimeLabel\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return 'TIME:'\",\n" -" \"length\": 5,\n" -" \"align\": \"L\",\n" -" \"bold\": 1\n" -" },\n" -" \"widget_Time\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return time.Strftime('%a,%m/%d %H:%M:%S', time.Time())\",\n" -" \"length\": 20,\n" -" \"align\": \"C\",\n" -" \"update\": 10\n" -" },\n" -" \"widget_UptimeLabel\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return 'UPTIME:'\",\n" -" \"length\": 7,\n" -" \"align\": \"L\",\n" -" \"bold\": 1\n" -" },\n" -" \"widget_Uptime\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return uptime.Uptime('%d d %H:%M:%S')\",\n" -" \"length\": 21,\n" -" \"align\": \"L\",\n" -" \"update\": 999\n" -" },\n" -" \"widget_fps\": {\n" -" \"type\": \"text\",\n" -" \"expression\": \"return fps.avg() .. ' - FPS'\",\n" -" \"length\": 11,\n" -" \"foreground\": \"FFFFFFFF\",\n" -" \"background\": \"ff000000\"\n" -" },\n" -" \"widget_vis_banner\": {\n" -" \"type\": \"filter\",\n" -" \"width\": 48,\n" -" \"height\": 16,\n" -" \"update\": 100,\n" -" \"actor\": \"dmovement\",\n" -" \"style\": \"pcm\"\n" -" },\n" -" \"widget_infinite_256x64\": {\n" -" \"type\": \"visualization\",\n" -" \"width\": 256,\n" -" \"height\": 64,\n" -" \"update\": 50,\n" -" \"morph-timeout\": 5500,\n" -" \"morph-steps\": 5,\n" -" \"skip-actors\": \"gstreamer:gdkpixbuf:lcdcontrol:jess:oinksie:goom2k4:jakdaw\",\n" -" \"actor\": \"corona\",\n" -" \"input\": \"debug\",\n" -" \"morph\": \"slide_up\",\n" -" \"style\": \"pcm\",\n" -" \"alpha\": 50\n" -" },\n" -" \"widget_libvisual_256x64\": {\n" -" \"type\": \"visualization\",\n" -" \"width\": 256,\n" -" \"height\": 64,\n" -" \"update\": 50,\n" -" \"morph-timeout\": 0,\n" -" \"morph-steps\": 18,\n" -" \"skip-actors\": \"gstreamer:gdkpixbuf:lcdcontrol:jess:oinksie:goom2k4:jakdaw\",\n" -" \"actor\": \"lv_analyzer\",\n" -" \"input\": \"debug\",\n" -" \"morph\": \"tentacle\",\n" -" \"style\": \"pcm\",\n" -" \"alpha\": 50,\n" -" \"params\": {\n" -" \"oinksie\": {\n" -" \"acid palette\": 1,\n" -" \"color mode\": 4\n" -" },\n" -" /*\"blursk\": { // blur scope\n" -" \"show_info\": \"Always\",\n" -" \"show_timestamp\": 1,\n" -" \"color\": \"r=246,g=242,b=20\",\n" -" \"color_style\": \"Dimming\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Simple\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Oscilloscope\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\",\n" -" \"beat_sensitivity\": 4\n" -" },*/\n" -" \"blursk\": { // box spectrum\n" -" \"color\": \"r=0,g=254,b=0\",\n" -" \"color_style\": \"Flame\",\n" -" \"signal_color\": \"White signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Backward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Reduced blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Stereo spectrum\",\n" -" \"plot_style\": \"Edges\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Dark bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" /*\"blursk\": { // burning logo\n" -" \"color\": \"r=254,g=98,b=38\",\n" -" \"color_style\": \"Flame\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Cylinder\",\n" -" \"transition_speed\": \"Slow switch\",\n" -" \"blur_when\": \"Reduced blur\",\n" -" \"blur_stencil\": \"Blursk stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Stereo spectrum\",\n" -" \"plot_style\": \"Airbrush\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"Blursk flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"TRUE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },*/\n" -" /*\"blursk\": { // cat scan\n" -" \"color\": \"r=175,g=245,b=0\",\n" -" \"color_style\": \"Rainbow\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Fast fade\",\n" -" \"blur_style\": \"Four way\",\n" -" \"transition_speed\": \"Fast switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Radial spectrum\",\n" -" \"plot_style\": \"Airbrush\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Ripple effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },*/\n" -" /*\"blursk\": { // cubism\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Color stripes\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Tangram\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Melt\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"Mirrored\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"Invert flash\",\n" -" \"overall_effect\": \"Anti-fade effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Dark bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // fan\n" -" \"color\": \"r=0,g=255,b=0\",\n" -" \"color_style\": \"Milky\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 1,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Four way\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"No blur\",\n" -" \"blur_stencil\": \"Tux stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"Radar\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // flag\n" -" \"color\": \"r=0,g=255,b=255\",\n" -" \"color_style\": \"Color bands\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Random\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Reduced blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"Radar\",\n" -" \"thick_on_beats\": 0,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // flame scan\n" -" \"color\": \"r=242,g=74,b=0\",\n" -" \"color_style\": \"Flame\",\n" -" \"signal_color\": \"White signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Flow around\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Stereo spectrum\",\n" -" \"plot_style\": \"Edges\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Ripple effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // flashbulb\n" -" \"color\": \"r=0,g=178,b=246\",\n" -" \"color_style\": \"Dimming\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 1,\n" -" \"hue_on_beats\": 1,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Prismatic\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Melt\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"None\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"Random flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // foil\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Layers\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Forward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Reduced blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Flower\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // frenetic\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Graying\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Fast fade\",\n" -" \"blur_style\": \"Fast forward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Phase shift\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 0,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Flash bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // heat wave\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Color layers\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Rise\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Reduced blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Stereo spectrum\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"black_background\": \"TRUE\",\n" -" \"toggle_bpl\": \"Edge smooth\",\n" -" \"background\": \"White bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // interference\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Color stripes\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 1,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Forward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Flower\",\n" -" \"plot_style\": \"Mirrored\",\n" -" \"thick_on_beats\": 0,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // lens\n" -" \"color\": \"r=249,g=69,b=0\",\n" -" \"color_style\": \"Milky\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 1,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Ripple\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"Mirrored\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // metalic\n" -" \"color\": \"r=0,g=253,b=253\",\n" -" \"color_style\": \"Metal\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Random slow\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Oscilloscope\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Bump effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"black_background\": \"TRUE\",\n" -" \"toggle_bpl\": \"Area smooth\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // nucleus\n" -" \"color\": \"r=11,g=253,b=249\",\n" -" \"color_style\": \"Color stripes\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 1,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Fast forward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Phase shift\",\n" -" \"plot_style\": \"Fuzzy dots\",\n" -" \"thick_on_beats\": 0,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"black_background\": \"TRUE\",\n" -" \"toggle_bpl\": \"Edge smooth\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // quick change\n" -" \"color\": \"r=250,g=129,b=253\",\n" -" \"color_style\": \"Standoff\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Random\",\n" -" \"transition_speed\": \"Fast switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"Radar\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"toggle_bpl\": \"Area smooth\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // random flower\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Random\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Random slow\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Flower\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Random bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // random mirrored spectrum\n" -" \"color\": \"r=252,g=154,b=10\",\n" -" \"color_style\": \"Random\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Random slow\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"Mirrored\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"Random flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Random bkgnd\",\n" -" \"toggle_bpl\": \"Area smooth\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // ripple\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Color stripes\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Random\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"High/Low plot\",\n" -" \"plot_style\": \"Starburst\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Shift bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // roller\n" -" \"color\": \"r=70,g=0,b=251\",\n" -" \"color_style\": \"Stripes\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 1,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Cylinder\",\n" -" \"transition_speed\": \"Fast switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Stereo spectrum\",\n" -" \"plot_style\": \"Airbrush\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Anti-fade effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"toggle_bpl\": \"Area smooth\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // rose\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Rainbow\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Tangram\",\n" -" \"transition_speed\": \"Slow switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Flower\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Anti-fade effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"White bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // scan\n" -" \"color\": \"r=175,g=245,b=0\",\n" -" \"color_style\": \"Rainbow\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Flow around\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Stereo spectrum\",\n" -" \"plot_style\": \"None\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"Invert flash\",\n" -" \"overall_effect\": \"Anti-fade effect\",\n" -" \"random_dots\": \"TRUE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"Slow floaters\"\n" -" },\n" -" \"blursk\": { // sparkler\n" -" \"color\": \"r=252,g=72,b=0\",\n" -" \"color_style\": \"Metal\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 1,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Four way\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"Radar\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // subliminal logo\n" -" \"color\": \"r=175,g=245,b=0\",\n" -" \"color_style\": \"Random\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Random\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Random blur\",\n" -" \"blur_stencil\": \"Random stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Flower\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 0,\n" -" \"flash_style\": \"Random flash\",\n" -" \"overall_effect\": \"Ripple effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // tunnel\n" -" \"color\": \"r=179,g=251,b=0\",\n" -" \"color_style\": \"Color layers\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Forward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Reduced blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Flower\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // tunnel2\n" -" \"color\": \"r=245,g=68,b=0\",\n" -" \"color_style\": \"Color layers\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 1,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Fast forward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Flower\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Dark bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // wiggler\n" -" \"color\": \"r=0,g=253,b=253\",\n" -" \"color_style\": \"Color layers\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Flow around\",\n" -" \"transition_speed\": \"Fast switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Radial spectrum\",\n" -" \"plot_style\": \"Starburst\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Dark bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // xmms\n" -" \"color\": \"r=0,g=254,b=254\",\n" -" \"color_style\": \"Dimming\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Random\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Reduced blur\",\n" -" \"blur_stencil\": \"XMMS stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Flower\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 0,\n" -" \"flash_style\": \"XMMS flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Color bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // bump scope\n" -" \"color\": \"r=246,g=240,b=10\",\n" -" \"color_style\": \"Dimming\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Simple\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Oscilloscope\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Bump effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // wax\n" -" \"color\": \"r=38,g=246,b=9\",\n" -" \"color_style\": \"Flame\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 1,\n" -" \"fade_speed\": \"Fast fade\",\n" -" \"blur_style\": \"Gravity\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Oscilloscope\",\n" -" \"plot_style\": \"Line\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Anti-fade effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"White bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // gas cloud\n" -" \"color\": \"r=247,g=128,b=0\",\n" -" \"color_style\": \"Color layers\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Flow between\",\n" -" \"transition_speed\": \"Fast switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Radial spectrum\",\n" -" \"plot_style\": \"Starburst\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Ripple effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Shift bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // aurora\n" -" \"color\": \"r=251,g=205,b=2\",\n" -" \"color_style\": \"Color standoff\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Forward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Radial spectrum\",\n" -" \"plot_style\": \"Inertia\",\n" -" \"thick_on_beats\": 0,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // fractal drums\n" -" \"color\": \"r=255,g=234,b=0\",\n" -" \"color_style\": \"Brightening\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Fractal sphere\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 1,\n" -" \"signal_style\": \"Phase shift\",\n" -" \"plot_style\": \"Fuzzy dots\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Bump effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"toggle_bpl\": \"Edge smooth\",\n" -" \"background\": \"Black bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // butterfly\n" -" \"color\": \"r=0,g=254,b=0\",\n" -" \"color_style\": \"Color standoff\",\n" -" \"signal_color\": \"White signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Backward\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Smear\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Stereo spectrum\",\n" -" \"plot_style\": \"Edges\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"FALSE\",\n" -" \"background\": \"Shift bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // radioactive bob\n" -" \"color\": \"r=248,g=248,b=0\",\n" -" \"color_style\": \"Milky\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 1,\n" -" \"black_background\": \"FALSE\",\n" -" \"fade_speed\": \"Medium fade\",\n" -" \"blur_style\": \"Tangram\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"Bob stencil\",\n" -" \"slow_motion\": 1,\n" -" \"toggle_bpl\": \"Area smooth\",\n" -" \"signal_style\": \"Phase shift\",\n" -" \"plot_style\": \"None\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"Bob flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"random_dots\": \"TRUE\",\n" -" \"background\": \"Color bkgnd\",\n" -" \"floaters\": \"No floaters\"\n" -" },\n" -" \"blursk\": { // testing 1 2 3\n" -" \"color\": \"r=237,g=5,b=230\",\n" -" \"color_style\": \"Flame\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"background\": \"Random bkgnd\",\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Random slow\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Full blur\",\n" -" \"blur_stencil\": \"Maybe stencil\",\n" -" \"slow_motion\": 0,\n" -" \"toggle_bpl\": \"Area smooth\",\n" -" \"signal_style\": \"Mono spectrum\",\n" -" \"plot_style\": \"Inertia\",\n" -" \"thick_on_beats\": 0,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Normal effect\",\n" -" \"floaters\": \"Fast floaters\"\n" -" },\n" -" \"blursk\": { // drain\n" -" \"color\": \"r=228,g=150,b=0\",\n" -" \"color_style\": \"Rainbow\",\n" -" \"signal_color\": \"Normal signal\",\n" -" \"contour_lines\": 0,\n" -" \"hue_on_beats\": 0,\n" -" \"background\": \"Color bkgnd\",\n" -" \"fade_speed\": \"Slow fade\",\n" -" \"blur_style\": \"Drain\",\n" -" \"transition_speed\": \"Medium switch\",\n" -" \"blur_when\": \"Reduced blur\",\n" -" \"blur_stencil\": \"No stencil\",\n" -" \"slow_motion\": 0,\n" -" \"signal_style\": \"Stereo spectrum\",\n" -" \"plot_style\": \"Edges\",\n" -" \"thick_on_beats\": 1,\n" -" \"flash_style\": \"No flash\",\n" -" \"overall_effect\": \"Anti-fade effect\",\n" -" \"floaters\": \"No floaters\"\n" -" },*/\n" -" \"none\": {}\n" -" }\n" -" },\n" -" \"widget_pcm_24x16\": {\n" -" \"type\": \"visualization\",\n" -" \"width\": 24,\n" -" \"height\": 16,\n" -" \"update\": 100,\n" -" \"style\": \"pcm\",\n" -" \"actor\": \"oinksie\",\n" -" \"morph-timeout\": 0,\n" -" \"skip-actors\": \"gstreamer:gdkpixbuf:jakdaw\"\n" -" },\n" -" \"widget_peak\": {\n" -" \"type\": \"visualization\",\n" -" \"width\": 20,\n" -" \"height\": 4,\n" -" \"update\": 100,\n" -" \"style\": \"peak\"\n" -" },\n" -" \"widget_spectrum\": {\n" -" \"type\": \"visualization\",\n" -" \"width\": 20,\n" -" \"height\": 4,\n" -" \"update\": 100,\n" -" \"style\": \"spectrum\"\n" -" },\n" -" \"widget_bignums\": {\n" -" \"expression\": \"return procstat.Cpu('busy', 200) \", \n" -" \"type\": \"bignums\", \n" -" \"max\": 100,\n" -" \"min\": 0,\n" -" \"update\": 1,\n" -" \"foreground\": \"ffFFFFFF\",\n" -" \"background\": \"00ffffff\"\n" -" }, \n" -" \"widget_cpuinfo_label\": {\n" -" \"expression\": \"return 'CPUInfo: '\",\n" -" \"type\": \"text\",\n" -" \"length\": 10\n" -" },\n" -" \"widget_cpuinfo\": {\n" -" \"expression\": \"return cpuinfo.Cpuinfo('model name') .. ' '\",\n" -" \"type\": \"text\",\n" -" \"length\": 10\n" -" },\n" -" \"widget_bottom_marquee\": {\n" -" \"align\": \"M\", \n" -" \"expression\": \"uname.Uname('sysname') + ' ' + uname.Uname('nodename') + ' ' + uname.Uname('release') + ' ' + cpuinfo.Cpuinfo('model name')\", \n" -" \"type\": \"text\", \n" -" \"speed\": 100, \n" -" \"length\": 16\n" -" }, \n" -" \"widget_bottom_ticker\": {\n" -" \"align\": \"P\", \n" -" \"expression\": \"uname.Uname('sysname') + ' ' + uname.Uname('nodename') + ' ' + uname.Uname('release') + ' ' + cpuinfo.Cpuinfo('model name')\", \n" -" \"type\": \"text\", \n" -" \"speed\": 100,\n" -" \"bold\": 1,\n" -" \"length\": 42\n" -" }, \n" -" \"widget_percent\": {\n" -" \"expression\": \"return '%'\",\n" -" \"length\": 1\n" -" },\n" -" \"widget_cpu\": {\n" -" \"align\": \"R\", \n" -" \"expression\": \"procstat.Cpu('busy', 500)\", \n" -" \"postfix\": \"'%'\", \n" -" \"precision\": 0, \n" -" \"type\": \"text\", \n" -" \"update\": 500, \n" -" \"length\": 5\n" -" }, \n" -" \"widget_cpu_bar\": {\n" -" \"direction\": \"W\", \n" -" \"expression\": \"procstat.Cpu('busy', 500)\", \n" -" \"length\": 10, \n" -" \"max\": \"100\", \n" -" \"min\": \"0\", \n" -" \"style\": \"H\", \n" -" \"type\": \"bar\", \n" -" \"update\": 500\n" -" }, \n" -" \"widget_cpu_histogram\": {\n" -" \"direction\": \"E\", \n" -" \"expression\": \"procstat.Cpu('busy', 500)\", \n" -" \"gap\": 1, \n" -" \"length\": 10, \n" -" \"max\": \"100\", \n" -" \"min\": \"0\", \n" -" \"type\": \"histogram\", \n" -" \"update\": 500\n" -" }, \n" -" \"widget_cpu_label\": {\n" -" \"align\": \"L\", \n" -" \"expression\": \"return 'CPU:'\", \n" -" \"type\": \"text\", \n" -" \"length\": 4\n" -" }, \n" -" \"widget_dow\": {\n" -" \"align\": \"L\", \n" -" \"expression\": \"\", \n" -" \"type\": \"text\"\n" -" }, \n" -" \"widget_dow_end\": {\n" -" \"align\": \"L\", \n" -" \"expression\": \"\", \n" -" \"type\": \"text\", \n" -" \"length\": 1\n" -" }, \n" -" \"widget_dow_label\": {\n" -" \"align\": \"L\", \n" -" \"expression\": \"'Ambient:'\", \n" -" \"type\": \"text\", \n" -" \"length\": 10\n" -" }, \n" -" \"widget_gif_american_flag\": {\n" -" \"file\": \"gifs/American_Flag_ani.gif\", \n" -" \"type\": \"gif\", \n" -" \"update\": \"250\", \n" -" \"xpoint\": 1,\n" -" \"inverted\": 1\n" -" }, \n" -" \"widget_gif_bolt\": {\n" -" \"file\": \"gifs/lightning_bolt_ani.gif\", \n" -" \"type\": \"gif\", \n" -" \"update\": \"250\",\n" -" \"inverted\": 1\n" -" }, \n" -" \"widget_gif_intel\": {\n" -" \"file\": \"gifs/intel_logo_ani.gif\", \n" -" \"start\": 1, \n" -" \"end\": 6, \n" -" \"type\": \"gif\", \n" -" \"update\": \"250\",\n" -" \"inverted\": 1\n" -" }, \n" -" \"widget_gif_marquee1\": {\n" -" \"file\": \"gifs/marquee1.gif\", \n" -" \"height\": 8, \n" -" \"type\": \"gif\", \n" -" \"update\": \"250\", \n" -" \"width\": 12,\n" -" \"height\": 12,\n" -" \"inverted\": 1\n" -" }, \n" -" \"widget_gif_marquee2\": {\n" -" \"file\": \"gifs/marquee2.gif\", \n" -" \"type\": \"gif\", \n" -" \"update\": \"250\",\n" -" \"widget\": 12,\n" -" \"height\": 12,\n" -" \"inverted\": 1\n" -" }, \n" -" \"widget_gif_marquee3\": {\n" -" \"file\": \"gifs/marquee3.gif\", \n" -" \"type\": \"gif\", \n" -" \"update\": \"250\",\n" -" \"widget\": 12,\n" -" \"height\": 12,\n" -" \"inverted\": 1\n" -" }, \n" -" \"widget_gif_marquee4\": {\n" -" \"file\": \"gifs/marquee4.gif\", \n" -" \"type\": \"gif\", \n" -" \"update\": \"250\",\n" -" \"widget\": 12,\n" -" \"height\": 12,\n" -" \"inverted\": 1\n" -" }, \n" -" \"widget_icon_blob\": {\n" -" \"bitmap\": {\n" -" \"row1\": \".....|.....|.....\", \n" -" \"row2\": \".....|.....|.***.\", \n" -" \"row3\": \".....|.***.|*...*\", \n" -" \"row4\": \"..*..|.*.*.|*...*\", \n" -" \"row5\": \".....|.***.|*...*\", \n" -" \"row6\": \".....|.....|.***.\", \n" -" \"row7\": \".....|.....|.....\", \n" -" \"row8\": \".....|.....|.....\"\n" -" }, \n" -" \"speed\": 300, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_icon_ekg\": {\n" -" \"bitmap\": {\n" -" \"row1\": \".....|.....|.....|.....|.....|.....|.....|.....\", \n" -" \"row2\": \".....|....*|...*.|..*..|.*...|*....|.....|.....\", \n" -" \"row3\": \".....|....*|...*.|..*..|.*...|*....|.....|.....\", \n" -" \"row4\": \".....|....*|...**|..**.|.**..|**...|*....|.....\", \n" -" \"row5\": \".....|....*|...**|..**.|.**..|**...|*....|.....\", \n" -" \"row6\": \".....|....*|...*.|..*.*|.*.*.|*.*..|.*...|*....\", \n" -" \"row7\": \"*****|*****|****.|***..|**..*|*..**|..***|.****\", \n" -" \"row8\": \".....|.....|.....|.....|.....|.....|.....|.....\"\n" -" }, \n" -" \"speed\": 30, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_icon_heart\": {\n" -" \"bitmap\": {\n" -" \"row1\": \".....|.....|.....|.....|.....|.....\", \n" -" \"row2\": \".*.*.|.....|.*.*.|.....|.....|.....\", \n" -" \"row3\": \"*****|.*.*.|*****|.*.*.|.*.*.|.*.*.\", \n" -" \"row4\": \"*****|.***.|*****|.***.|.***.|.***.\", \n" -" \"row5\": \".***.|.***.|.***.|.***.|.***.|.***.\", \n" -" \"row6\": \".***.|..*..|.***.|..*..|..*..|..*..\", \n" -" \"row7\": \"..*..|.....|..*..|.....|.....|.....\", \n" -" \"row8\": \".....|.....|.....|.....|.....|.....\"\n" -" }, \n" -" \"speed\": 500, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_icon_heartbeat\": {\n" -" \"bitmap\": {\n" -" \"row1\": \".....|.....\", \n" -" \"row2\": \".*.*.|.*.*.\", \n" -" \"row3\": \"*****|*.*.*\", \n" -" \"row4\": \"*****|*...*\", \n" -" \"row5\": \".***.|.*.*.\", \n" -" \"row6\": \".***.|.*.*.\", \n" -" \"row7\": \"..*..|..*..\", \n" -" \"row8\": \".....|.....\"\n" -" }, \n" -" \"speed\": 500, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_icon_karo\": {\n" -" \"bitmap\": {\n" -" \"row1\": \".....|.....|.....|.....|..*..|.....|.....|.....\", \n" -" \"row2\": \".....|.....|.....|..*..|.*.*.|..*..|.....|.....\", \n" -" \"row3\": \".....|.....|..*..|.*.*.|*...*|.*.*.|..*..|.....\", \n" -" \"row4\": \".....|..*..|.*.*.|*...*|.....|*...*|.*.*.|..*..\", \n" -" \"row5\": \".....|.....|..*..|.*.*.|*...*|.*.*.|..*..|.....\", \n" -" \"row6\": \".....|.....|.....|..*..|.*.*.|..*..|.....|.....\", \n" -" \"row7\": \".....|.....|.....|.....|..*..|.....|.....|.....\", \n" -" \"row8\": \".....|.....|.....|.....|.....|.....|.....|.....\"\n" -" }, \n" -" \"speed\": 100, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_icon_rain\": {\n" -" \"bitmap\": {\n" -" \"row1\": \"...*.|.....|.....|.*...|....*|..*..|.....|*....\", \n" -" \"row2\": \"*....|...*.|.....|.....|.*...|....*|..*..|.....\", \n" -" \"row3\": \".....|*....|...*.|.....|.....|.*...|....*|..*..\", \n" -" \"row4\": \"..*..|.....|*....|...*.|.....|.....|.*...|....*\", \n" -" \"row5\": \"....*|..*..|.....|*....|...*.|.....|.....|.*...\", \n" -" \"row6\": \".*...|....*|..*..|.....|*....|...*.|.....|.....\", \n" -" \"row7\": \".....|.*...|....*|..*..|.....|*....|...*.|.....\", \n" -" \"row8\": \".....|.....|.*...|....*|..*..|.....|*....|...*.\"\n" -" }, \n" -" \"speed\": 100, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_icon_squirrel\": {\n" -" \"bitmap\": {\n" -" \"row1\": \".....|.....|.....|.....|.....|.....\", \n" -" \"row2\": \".....|.....|.....|.....|.....|.....\", \n" -" \"row3\": \".....|.....|.....|.....|.....|.....\", \n" -" \"row4\": \"**...|.**..|..**.|...**|....*|.....\", \n" -" \"row5\": \"*****|*****|*****|*****|*****|*****\", \n" -" \"row6\": \"...**|..**.|.**..|**...|*....|.....\", \n" -" \"row7\": \".....|.....|.....|.....|.....|.....\", \n" -" \"row8\": \".....|.....|.....|.....|.....|.....\"\n" -" }, \n" -" \"speed\": 100, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_icon_timer\": {\n" -" \"bitmap\": {\n" -" \"row1\": \".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|\", \n" -" \"row2\": \".***.|.*+*.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.+++.|.+*+.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|\", \n" -" \"row3\": \"*****|**+**|**++*|**+++|**++.|**++.|**+++|**+++|**+++|**+++|**+++|+++++|+++++|++*++|++**+|++***|++**.|++**.|++***|++***|++***|++***|++***|*****|\", \n" -" \"row4\": \"*****|**+**|**+**|**+**|**+++|**+++|**+++|**+++|**+++|**+++|+++++|+++++|+++++|++*++|++*++|++*++|++***|++***|++***|++***|++***|++***|*****|*****|\", \n" -" \"row5\": \"*****|*****|*****|*****|*****|***++|***++|**+++|*++++|+++++|+++++|+++++|+++++|+++++|+++++|+++++|+++++|+++**|+++**|++***|+****|*****|*****|*****|\", \n" -" \"row6\": \".***.|.***.|.***.|.***.|.***.|.***.|.**+.|.*++.|.+++.|.+++.|.+++.|.+++.|.+++.|.+++.|.+++.|.+++.|.+++.|.+++.|.++*.|.+**.|.***.|.***.|.***.|.***.|\", \n" -" \"row7\": \".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|\", \n" -" \"row8\": \".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|\"\n" -" }, \n" -" \"speed\": 100, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_icon_wave\": {\n" -" \"bitmap\": {\n" -" \"row1\": \"..**.|.**..|**...|*....|.....|.....|.....|.....|....*|...**\", \n" -" \"row2\": \".*..*|*..*.|..*..|.*...|*....|.....|.....|....*|...*.|..*..\", \n" -" \"row3\": \"*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...\", \n" -" \"row4\": \"*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...\", \n" -" \"row5\": \"*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...\", \n" -" \"row6\": \".....|.....|....*|...*.|..*..|.*..*|*..*.|..*..|.*...|*....\", \n" -" \"row7\": \".....|.....|.....|....*|...**|..**.|.**..|**...|*....|.....\", \n" -" \"row8\": \".....|.....|.....|.....|.....|.....|.....|.....|.....|.....\"\n" -" }, \n" -" \"speed\": 100, \n" -" \"type\": \"icon\"\n" -" }, \n" -" \"widget_key_down\": {\n" -" \"expression\": \"return lcd.Transition(-1)\", \n" -" \"key\": 2, \n" -" \"type\": \"key\"\n" -" }, \n" -" \"widget_key_up\": {\n" -" \"expression\": \"return lcd.Transition(1)\", \n" -" \"key\": 1, \n" -" \"type\": \"key\"\n" -" }, \n" -" \"widget_percent\": {\n" -" \"expression\": \"return '%'\", \n" -" \"type\": \"text\"\n" -" }, \n" -" \"widget_ram_active\": {\n" -" \"align\": \"L\", \n" -" \"expression\": \"return meminfo.Meminfo('Active')/1024\", \n" -" \"type\": \"text\", \n" -" \"postfix\": \"'/'\",\n" -" \"precision\": 0,\n" -" \"update\": 500, \n" -" \"length\": 5\n" -" }, \n" -" \"widget_ram_label\": {\n" -" \"align\": \"L\", \n" -" \"expression\": \"return 'Ram:'\", \n" -" \"type\": \"text\", \n" -" \"length\": 4\n" -" }, \n" -" \"widget_ram_total\": {\n" -" \"align\": \"L\", \n" -" \"expression\": \"return meminfo.Meminfo('MemTotal')/1024\", \n" -" \"type\": \"text\", \n" -" \"precision\": 0,\n" -" \"update\": 500, \n" -" \"length\": 5\n" -" }, \n" -" \"widget_system_bar\": {\n" -" \"expression\": \"return procstat.Cpu('system', 500)\", \n" -" \"style\": \"H\", \n" -" \"type\": \"bar\", \n" -" \"width\": 10\n" -" }, \n" -" \"widget_system_histogram\": {\n" -" \"direction\": \"E\", \n" -" \"expressionn\": \"return procstat.Cpu('system', 500)\", \n" -" \"gap\": 1, \n" -" \"type\": \"histogram\", \n" -" \"width\": 10\n" -" }, \n" -" \"widget_system_label\": {\n" -" \"align\": \"R\", \n" -" \"prefix\": \"return 'System: '\", \n" -" \"type\": \"text\", \n" -" \"length\": 10\n" -" }, \n" -" \"widget_wlan0\": {\n" -" \"align\": \"L\", \n" -" \"expression\": \"return netdev.Fast('wlan0', 'Tx_bytes', 100) /1024\", \n" -" \"precision\": 0, \n" -" \"type\": \"text\", \n" -" \"update\": 500, \n" -" \"length\": 3\n" -" }, \n" -" \"widget_wlan0_bar\": {\n" -" \"expression\": \"return netdev.Fast('wlan0', 'Rx_bytes', 500) / 1024\", \n" -" \"expression2\": \"return netdev.Fast('wlan0', 'Tx_bytes', 500) / 1024\", \n" -" //\"style\": \"H\", \n" -" \"type\": \"bar\", \n" -" \"update\": 500, \n" -" \"width\": 10\n" -" }, \n" -" \"widget_wlan0_histogram\": {\n" -" \"direction\": \"E\", \n" -" \"expression\": \n" -"\"return (netdev.Fast('wlan0', 'Rx_bytes', 500) + netdev.Fast('wlan0', 'Tx_bytes', 500)) /1024\", \n" -" \"gap\": 1, \n" -" \"type\": \"histogram\", \n" -" \"update\": 500, \n" -" \"width\": 10\n" -" }, \n" -" \"widget_wlan0_label\": {\n" -" \"expression\": \"return 'wlan0:'\", \n" -" \"type\": \"text\", \n" -" \"length\": 6\n" -" }, \n" -" \"widget_wlan0_short_bar\": {\n" -" \"expression\": \"return (netdev.Fast('wlan0', 'Rx_bytes', 500) + netdev.Fast('wlan0', 'Tx_bytes', 500)) /1024\", \n" -" \"length\": 7, \n" -" \"style\": \"N\", \n" -" \"type\": \"bar\", \n" -" \"update\": 500\n" -" },\n" -" \"widget_netstat_script\": {\n" -" \"file\": \"netstat_script.js\",\n" -" \"type\": \"script\"\n" -" }\n" -"}\n\n"; +std::string lcdcontrol_config = + "" + "{\n" + " \"variables\": {\n" + " \"foo\": 220\n" + " },\n" + " \"display_video\": {\n" + " \"driver\": \"video\",\n" + " \"layers\": 4,\n" + " \"foreground\": \"FFFFFFFF\",\n" + " \"background\": \"00000000\",\n" + " \"fill\": 1,\n" + " \"cols\": 256,\n" + " \"rows\": 64,\n" + " \"layout-timeout\": 0,\n" + " \"update\": 100,\n" + " //\"widget0\": \"widget_key_up\",\n" + " //\"widget1\": \"widget_key_down\",\n" + " //\"widget2\": \"widget_netstat_script\",\n" + " \"transition-speed\": 100,\n" + " \"refresh-rate\": 5,\n" + " \"layout0\": \"layout_full\"\n" + " },\n" + " \"layout_full\": {\n" + " \"layer4\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_infinite_256x64\"\n" + " }\n" + " },\n" + " \"layer3\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_libvisual_256x64\"\n" + " }\n" + " },\n" + " \"layer2\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_histogram_large\"\n" + " }\n" + " },\n" + " \"layer1\": {\n" + " \"row2\": {\n" + " \"col1\": \"widget_icon_heart\",\n" + " \"col2\": \"widget_icon_heartbeat\",\n" + " \"col3\": \"widget_icon_heart\",\n" + " \"col4\": \"widget_icon_heartbeat\",\n" + " \"col5\": \"widget_icon_heart\",\n" + " \"col6\": \"widget_icon_heartbeat\",\n" + " \"col7\": \"widget_icon_heart\",\n" + " \"col8\": \"widget_icon_heartbeat\",\n" + " \"col9\": \"widget_icon_heart\",\n" + " \"col10\": \"widget_icon_heartbeat\",\n" + " \"col11\": \"widget_icon_heart\",\n" + " \"col12\": \"widget_icon_heartbeat\",\n" + " \"col13\": \"widget_icon_heart\",\n" + " \"col14\": \"widget_icon_heartbeat\",\n" + " \"col15\": \"widget_icon_heart\",\n" + " \"col16\": \"widget_icon_heartbeat\",\n" + " \"col17\": \"widget_icon_heart\",\n" + " \"col18\": \"widget_icon_heartbeat\",\n" + " \"col19\": \"widget_icon_heart\",\n" + " \"col20\": \"widget_icon_heartbeat\"\n" + " },\n" + " \"row3\": {\n" + " \"col4\": \"widget_cpu_label\",\n" + " \"col8\": \"widget_bignums\",\n" + " \"col11\": \"widget_percent\"\n" + " },\n" + " \"row5\": {\n" + " \"col1\": \"widget_FSSpace\"\n" + " },\n" + " \"transition\": \"U\"\n" + " }\n" + " },\n" + " \"layout_2x16\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_CPULabel\",\n" + " \"col5\": \"widget_CPU\"\n" + " },\n" + " \"row2\": {\n" + " \"col1\": \"widget_page_label\",\n" + " \"col11\": \"widget_page\"\n" + " }\n" + " },\n" + " \"layout_histogram_large\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_histogram_large\"\n" + " },\n" + " \"transition\": \"U\"\n" + " },\n" + " \"layout_full_256x64\": {\n" + " \"layer2\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_histogram_large\"\n" + " }\n" + " },\n" + " \"layer3\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_libvisual\"\n" + " }\n" + " },\n" + " \"row1\": {\n" + " \"col1\": \"widget_CPULabel\",\n" + " \"col6\": \"widget_CPU\",\n" + " \"col11\": \"widget_CPUBar\",\n" + " \"col21\": \"widget_RAMLabel\",\n" + " \"col26\": \"widget_RAMFree\",\n" + " \"col31\": \"widget_RAMTotal\"\n" + " },\n" + " \"row2\": {\n" + " \"col1\": \"widget_IDELabel\",\n" + " \"col6\": \"widget_IDEIn\",\n" + " \"col17\": \"widget_IDEOut\",\n" + " \"col28\": \"widget_IDEBar\"\n" + " },\n" + " \"row3\": {\n" + " \"col1\": \"widget_FSSpace\"\n" + " },\n" + " \"row4\": {\n" + " \"col1\": \"widget_WLANLabel\",\n" + " \"col6\": \"widget_WLANIn\",\n" + " \"col17\": \"widget_WLANOut\",\n" + " \"col28\": \"widget_WLANBar\"\n" + " },\n" + " \"row6\": {\n" + " \"col1\": \"widget_icon_heartbeat\",\n" + " \"col2\": \"widget_icon_ekg\",\n" + " \"col3\": \"widget_icon_heart\",\n" + " \"col4\": \"widget_icon_blob\",\n" + " \"col5\": \"widget_icon_wave\",\n" + " \"col6\": \"widget_icon_timer\",\n" + " \"col7\": \"widget_icon_rain\",\n" + " \"col8\": \"widget_icon_karo\",\n" + " \"col9\": \"widget_icon_heartbeat\",\n" + " \"col10\": \"widget_icon_ekg\",\n" + " \"col11\": \"widget_icon_heart\",\n" + " \"col12\": \"widget_icon_blob\",\n" + " \"col13\": \"widget_icon_wave\",\n" + " \"col14\": \"widget_icon_timer\",\n" + " \"col15\": \"widget_icon_rain\",\n" + " \"col16\": \"widget_icon_karo\",\n" + " \"col17\": \"widget_icon_heartbeat\",\n" + " \"col18\": \"widget_icon_ekg\",\n" + " \"col19\": \"widget_icon_heart\",\n" + " \"col20\": \"widget_icon_blob\",\n" + " \"col21\": \"widget_icon_wave\",\n" + " \"col22\": \"widget_icon_timer\",\n" + " \"col23\": \"widget_icon_rain\",\n" + " \"col24\": \"widget_icon_karo\",\n" + " \"col25\": \"widget_icon_heartbeat\",\n" + " \"col26\": \"widget_icon_ekg\",\n" + " \"col27\": \"widget_icon_heart\",\n" + " \"col28\": \"widget_icon_blob\",\n" + " \"col29\": \"widget_icon_wave\",\n" + " \"col30\": \"widget_icon_timer\",\n" + " \"col31\": \"widget_icon_rain\",\n" + " \"col32\": \"widget_icon_karo\",\n" + " \"col33\": \"widget_icon_heartbeat\",\n" + " \"col34\": \"widget_icon_ekg\",\n" + " \"col35\": \"widget_icon_heart\",\n" + " \"col36\": \"widget_icon_blob\",\n" + " \"col37\": \"widget_icon_blob\",\n" + " \"col38\": \"widget_icon_wave\",\n" + " \"col39\": \"widget_icon_timer\",\n" + " \"col40\": \"widget_icon_rain\",\n" + " \"col41\": \"widget_icon_karo\",\n" + " \"col42\": \"widget_icon_heartbeat\"\n" + " \n" + " },\n" + " \"row7\": {\n" + " \"col1\": \"widget_Time\",\n" + " \"col22\": \"widget_UptimeLabel\",\n" + " \"col30\": \"widget_Uptime\"\n" + " },\n" + " \"row8\": {\n" + " \"col1\": \"widget_bottom_ticker\"\n" + " },\n" + " \"transition\": \"U\"\n" + " },\n" + " \"layout_blank\": {\n" + " \"layout-timeout\": 0\n" + " },\n" + " \"layout_pcm_256x64\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_pcm_256x64\"\n" + " },\n" + " \"transition\": \"U\"\n" + " },\n" + " \"layout_pcm_24x16\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_pcm_24x16\"\n" + " }\n" + " },\n" + " \"layout_peak\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_peak\"\n" + " }\n" + " },\n" + " \"layout_spectrum\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_spectrum\"\n" + " },\n" + " \"transition\": \"U\"\n" + " },\n" + " \"layout_1\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_cpu_label\",\n" + " //\"col11\": \"widget_cpu_histogram\",\n" + " \"col6\": \"widget_cpu\"\n" + " }, \n" + " \"row2\": {\n" + " //\"col1\": \"widget_wlan0_label\", \n" + " //\"col11\": \"widget_wlan0_histogram\",\n" + " //\"col7\": \"widget_wlan0\"\n" + " }, \n" + " \"row3\": {\n" + " //\"col1\": \"widget_ram_label\",\n" + " //\"col5\": \"widget_ram_active\",\n" + " //\"col11\": \"widget_ram_total\"\n" + " }, \n" + " \"row4\": {\n" + " //\"col1\": \"widget_bottom_ticker\"\n" + " }, \n" + " \"transition\": \"B\"\n" + " }, \n" + " \"layout_visualization\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_pcm_24x16\"\n" + " //\"col17\": \"widget_pcm_24x16\",\n" + " //\"col9\": \"widget_pcm_24x16\"\n" + " },\n" + " \"row3\": {\n" + " //\"col13\": \"widget_pcm_24x16\",\n" + " //\"col5\": \"widget_pcm_24x16\"\n" + " },\n" + " \"transition\": \"B\"\n" + " },\n" + " \"layout_american_flag\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_gif_american_flag\",\n" + " \"col17\": \"widget_gif_american_flag\", \n" + " \"col9\": \"widget_gif_american_flag\"\n" + " }, \n" + " \"row3\": {\n" + " \"col13\": \"widget_gif_american_flag\", \n" + " \"col5\": \"widget_gif_american_flag\"\n" + " },\n" + " \"transition\": \"D\"\n" + " }, \n" + " \"layout_bar\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_ram_label\",\n" + " \"col10\": \"widget_ram_total\", \n" + " \"col5\": \"widget_ram_active\"\n" + " },\n" + " \"row2\": {\n" + " \"col1\": \"widget_wlan0_label\",\n" + " \"col10\": \"widget_wlan0_bar\",\n" + " \"col7\": \"widget_wlan0\"\n" + " }, \n" + " \"row3\": {\n" + " \"col1\": \"widget_icon_wave\",\n" + " \"col10\": \"widget_icon_ekg\", \n" + " \"col11\": \"widget_icon_rain\", \n" + " \"col12\": \"widget_icon_blob\", \n" + " \"col13\": \"widget_icon_wave\", \n" + " \"col14\": \"widget_icon_ekg\", \n" + " \"col15\": \"widget_icon_rain\", \n" + " \"col16\": \"widget_icon_blob\", \n" + " \"col17\": \"widget_icon_wave\", \n" + " \"col18\": \"widget_icon_ekg\", \n" + " \"col19\": \"widget_icon_rain\",\n" + " \"col2\": \"widget_icon_ekg\", \n" + " \"col20\": \"widget_icon_blob\", \n" + " \"col3\": \"widget_icon_rain\", \n" + " \"col4\": \"widget_icon_blob\", \n" + " \"col5\": \"widget_icon_wave\", \n" + " \"col6\": \"widget_icon_ekg\", \n" + " \"col7\": \"widget_icon_rain\", \n" + " \"col8\": \"widget_icon_blob\", \n" + " \"col9\": \"widget_icon_wave\"\n" + " },\n" + " \"row4\": {\n" + " \"col1\": \"widget_bottom_ticker\"\n" + " }, \n" + " \"transition\": \"U\"\n" + " }, \n" + " \"layout_bignums\": {\n" + " \"row2\": {\n" + " \"col1\": \"widget_cpu_label\", \n" + " \"col10\": \"widget_bignums\"\n" + " }, \n" + " \"row3\": {\n" + " \"col14\": \"widget_percent\"\n" + " },\n" + " \"transition\": \"D\"\n" + " }, \n" + " \"layout_banner\": {\n" + " \"row1\": {\n" + " \"col2\": \"widget_vis_banner\",\n" + " \"col12\": \"widget_vis_banner\"\n" + " },\n" + " \"row2\": {\n" + " \"col2\": \"widget_vis_banner\",\n" + " \"col12\": \"widget_vis_banner\"\n" + " },\n" + " \"row3\": {\n" + " \"col1\": \"widget_Time\"\n" + "\n" + " },\n" + " \"row4\": {\n" + " \"col2\": \"widget_vis_banner\",\n" + " \"col12\": \"widget_vis_banner\"\n" + " },\n" + " \"transition\": \"U\"\n" + " },\n" + " \"layout_bolt\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_gif_bolt\", \n" + " \"col17\": \"widget_gif_bolt\", \n" + " \"col9\": \"widget_gif_bolt\"\n" + " }, \n" + " \"row3\": {\n" + " \"col13\": \"widget_gif_bolt\", \n" + " \"col5\": \"widget_gif_bolt\"\n" + " },\n" + " \"transition\": \"B\"\n" + " }, \n" + " \"layout_dolby\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_gif_dolby\", \n" + " \"col17\": \"widget_gif_dolby\", \n" + " \"col9\": \"widget_gif_dolby\"\n" + " }, \n" + " \"row3\": {\n" + " \"col13\": \"widget_gif_dolby\", \n" + " \"col5\": \"widget_gif_dolby\"\n" + " },\n" + " \"transition\": \"U\"\n" + " }, \n" + " \"layout_icons\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_icon_heartbeat\", \n" + " \"col10\": \"widget_icon_ekg\", \n" + " \"col11\": \"widget_icon_heart\", \n" + " \"col12\": \"widget_icon_blob\", \n" + " \"col13\": \"widget_icon_wave\", \n" + " \"col14\": \"widget_icon_timer\", \n" + " \"col15\": \"widget_icon_rain\", \n" + " \"col16\": \"widget_icon_karo\", \n" + " \"col17\": \"widget_icon_heartbeat\", \n" + " \"col18\": \"widget_icon_ekg\", \n" + " \"col19\": \"widget_icon_heart\", \n" + " \"col2\": \"widget_icon_ekg\", \n" + " \"col20\": \"widget_icon_blob\", \n" + " \"col3\": \"widget_icon_heart\", \n" + " \"col4\": \"widget_icon_blob\", \n" + " \"col5\": \"widget_icon_wave\", \n" + " \"col6\": \"widget_icon_timer\", \n" + " \"col7\": \"widget_icon_rain\", \n" + " \"col8\": \"widget_icon_karo\", \n" + " \"col9\": \"widget_icon_heartbeat\"\n" + " }, \n" + " \"row2\": {\n" + " \"col1\": \"widget_icon_wave\", \n" + " \"col10\": \"widget_icon_timer\", \n" + " \"col11\": \"widget_icon_rain\", \n" + " \"col12\": \"widget_icon_karo\", \n" + " \"col13\": \"widget_icon_heartbeat\", \n" + " \"col14\": \"widget_icon_ekg\", \n" + " \"col15\": \"widget_icon_heart\", \n" + " \"col16\": \"widget_icon_blob\", \n" + " \"col17\": \"widget_icon_wave\", \n" + " \"col18\": \"widget_icon_timer\", \n" + " \"col19\": \"widget_icon_rain\", \n" + " \"col2\": \"widget_icon_timer\", \n" + " \"col20\": \"widget_icon_karo\", \n" + " \"col3\": \"widget_icon_rain\", \n" + " \"col4\": \"widget_icon_karo\", \n" + " \"col5\": \"widget_icon_heartbeat\", \n" + " \"col6\": \"widget_icon_ekg\", \n" + " \"col7\": \"widget_icon_heart\", \n" + " \"col8\": \"widget_icon_blob\", \n" + " \"col9\": \"widget_icon_wave\"\n" + " }, \n" + " \"row3\": {\n" + " \"col1\": \"widget_icon_heartbeat\", \n" + " \"col10\": \"widget_icon_ekg\", \n" + " \"col11\": \"widget_icon_heart\", \n" + " \"col12\": \"widget_icon_blob\", \n" + " \"col13\": \"widget_icon_wave\", \n" + " \"col14\": \"widget_icon_timer\", \n" + " \"col15\": \"widget_icon_rain\", \n" + " \"col16\": \"widget_icon_karo\", \n" + " \"col17\": \"widget_icon_heartbeat\", \n" + " \"col18\": \"widget_icon_ekg\", \n" + " \"col19\": \"widget_icon_heart\", \n" + " \"col2\": \"widget_icon_ekg\", \n" + " \"col20\": \"widget_icon_blob\", \n" + " \"col3\": \"widget_icon_heart\", \n" + " \"col4\": \"widget_icon_blob\", \n" + " \"col5\": \"widget_icon_wave\", \n" + " \"col6\": \"widget_icon_timer\", \n" + " \"col7\": \"widget_icon_rain\", \n" + " \"col8\": \"widget_icon_karo\", \n" + " \"col9\": \"widget_icon_heartbeat\"\n" + " }, \n" + " \"row4\": {\n" + " \"col1\": \"widget_icon_wave\", \n" + " \"col10\": \"widget_icon_timer\", \n" + " \"col11\": \"widget_icon_rain\", \n" + " \"col12\": \"widget_icon_karo\", \n" + " \"col13\": \"widget_icon_heartbeat\", \n" + " \"col14\": \"widget_icon_ekg\", \n" + " \"col15\": \"widget_icon_heart\", \n" + " \"col16\": \"widget_icon_blob\", \n" + " \"col17\": \"widget_icon_wave\", \n" + " \"col18\": \"widget_icon_timer\", \n" + " \"col19\": \"widget_icon_rain\", \n" + " \"col2\": \"widget_icon_timer\", \n" + " \"col20\": \"widget_icon_karo\", \n" + " \"col3\": \"widget_icon_rain\", \n" + " \"col4\": \"widget_icon_karo\", \n" + " \"col5\": \"widget_icon_heartbeat\", \n" + " \"col6\": \"widget_icon_ekg\", \n" + " \"col7\": \"widget_icon_heart\", \n" + " \"col8\": \"widget_icon_blob\", \n" + " \"col9\": \"widget_icon_wave\"\n" + " }, \n" + " \"transition\": \"B\"\n" + " }, \n" + " \"layout_intel\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_gif_intel\", \n" + " \"col17\": \"widget_gif_intel\", \n" + " \"col9\": \"widget_gif_intel\"\n" + " }, \n" + " \"row3\": {\n" + " \"col13\": \"widget_gif_intel\", \n" + " \"col5\": \"widget_gif_intel\"\n" + " },\n" + " \"transition\": \"R\"\n" + " }, \n" + " \"layout_karo\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_icon_karo\", \n" + " \"col10\": \"widget_icon_karo\", \n" + " \"col11\": \"widget_icon_karo\", \n" + " \"col12\": \"widget_icon_karo\", \n" + " \"col13\": \"widget_icon_karo\", \n" + " \"col14\": \"widget_icon_karo\", \n" + " \"col15\": \"widget_icon_karo\", \n" + " \"col16\": \"widget_icon_karo\", \n" + " \"col17\": \"widget_icon_karo\", \n" + " \"col18\": \"widget_icon_karo\", \n" + " \"col19\": \"widget_icon_karo\", \n" + " \"col2\": \"widget_icon_karo\", \n" + " \"col20\": \"widget_icon_karo\", \n" + " \"col3\": \"widget_icon_karo\", \n" + " \"col4\": \"widget_icon_karo\", \n" + " \"col5\": \"widget_icon_karo\", \n" + " \"col6\": \"widget_icon_karo\", \n" + " \"col7\": \"widget_icon_karo\", \n" + " \"col8\": \"widget_icon_karo\", \n" + " \"col9\": \"widget_icon_karo\"\n" + " }, \n" + " \"row2\": {\n" + " \"col1\": \"widget_icon_karo\", \n" + " \"col10\": \"widget_icon_karo\", \n" + " \"col11\": \"widget_icon_karo\", \n" + " \"col12\": \"widget_icon_karo\", \n" + " \"col13\": \"widget_icon_karo\", \n" + " \"col14\": \"widget_icon_karo\", \n" + " \"col15\": \"widget_icon_karo\", \n" + " \"col16\": \"widget_icon_karo\", \n" + " \"col17\": \"widget_icon_karo\", \n" + " \"col18\": \"widget_icon_karo\", \n" + " \"col19\": \"widget_icon_karo\", \n" + " \"col2\": \"widget_icon_karo\", \n" + " \"col20\": \"widget_icon_karo\", \n" + " \"col3\": \"widget_icon_karo\", \n" + " \"col4\": \"widget_icon_karo\", \n" + " \"col5\": \"widget_icon_karo\", \n" + " \"col6\": \"widget_icon_karo\", \n" + " \"col7\": \"widget_icon_karo\", \n" + " \"col8\": \"widget_icon_karo\", \n" + " \"col9\": \"widget_icon_karo\"\n" + " }, \n" + " \"row3\": {\n" + " \"col1\": \"widget_icon_karo\", \n" + " \"col10\": \"widget_icon_karo\", \n" + " \"col11\": \"widget_icon_karo\", \n" + " \"col12\": \"widget_icon_karo\", \n" + " \"col13\": \"widget_icon_karo\", \n" + " \"col14\": \"widget_icon_karo\", \n" + " \"col15\": \"widget_icon_karo\", \n" + " \"col16\": \"widget_icon_karo\", \n" + " \"col17\": \"widget_icon_karo\", \n" + " \"col18\": \"widget_icon_karo\", \n" + " \"col19\": \"widget_icon_karo\", \n" + " \"col2\": \"widget_icon_karo\", \n" + " \"col20\": \"widget_icon_karo\", \n" + " \"col3\": \"widget_icon_karo\", \n" + " \"col4\": \"widget_icon_karo\", \n" + " \"col5\": \"widget_icon_karo\", \n" + " \"col6\": \"widget_icon_karo\", \n" + " \"col7\": \"widget_icon_karo\", \n" + " \"col8\": \"widget_icon_karo\", \n" + " \"col9\": \"widget_icon_karo\"\n" + " }, \n" + " \"row4\": {\n" + " \"col1\": \"widget_icon_karo\", \n" + " \"col10\": \"widget_icon_karo\", \n" + " \"col11\": \"widget_icon_karo\", \n" + " \"col12\": \"widget_icon_karo\", \n" + " \"col13\": \"widget_icon_karo\", \n" + " \"col14\": \"widget_icon_karo\", \n" + " \"col15\": \"widget_icon_karo\", \n" + " \"col16\": \"widget_icon_karo\", \n" + " \"col17\": \"widget_icon_karo\", \n" + " \"col18\": \"widget_icon_karo\", \n" + " \"col19\": \"widget_icon_karo\", \n" + " \"col2\": \"widget_icon_karo\", \n" + " \"col20\": \"widget_icon_karo\", \n" + " \"col3\": \"widget_icon_karo\", \n" + " \"col4\": \"widget_icon_karo\", \n" + " \"col5\": \"widget_icon_karo\", \n" + " \"col6\": \"widget_icon_karo\", \n" + " \"col7\": \"widget_icon_karo\", \n" + " \"col8\": \"widget_icon_karo\", \n" + " \"col9\": \"widget_icon_karo\"\n" + " }, \n" + " \"transition\": \"D\"\n" + " }, \n" + " \"layout_marquee1\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_gif_marquee1\", \n" + " \"col11\": \"widget_gif_marquee1\", \n" + " \"col13\": \"widget_gif_marquee1\", \n" + " \"col15\": \"widget_gif_marquee1\", \n" + " \"col17\": \"widget_gif_marquee1\", \n" + " \"col19\": \"widget_gif_marquee1\", \n" + " \"col3\": \"widget_gif_marquee1\", \n" + " \"col5\": \"widget_gif_marquee1\", \n" + " \"col7\": \"widget_gif_marquee1\", \n" + " \"col9\": \"widget_gif_marquee1\"\n" + " }, \n" + " \"row2\": {\n" + " \"col1\": \"widget_gif_marquee1\", \n" + " \"col12\": \"widget_wlan0_short_bar\", \n" + " \"col19\": \"widget_gif_marquee1\", \n" + " \"col3\": \"widget_wlan0_label\", \n" + " \"col9\": \"widget_wlan0\"\n" + " }, \n" + " \"row3\": {\n" + " \"col1\": \"widget_gif_marquee1\", \n" + " \"col19\": \"widget_gif_marquee1\", \n" + " \"col3\": \"widget_bottom_marquee\"\n" + " }, \n" + " \"row4\": {\n" + " \"col1\": \"widget_gif_marquee1\", \n" + " \"col11\": \"widget_gif_marquee1\", \n" + " \"col13\": \"widget_gif_marquee1\", \n" + " \"col15\": \"widget_gif_marquee1\", \n" + " \"col17\": \"widget_gif_marquee1\", \n" + " \"col19\": \"widget_gif_marquee1\", \n" + " \"col3\": \"widget_gif_marquee1\", \n" + " \"col5\": \"widget_gif_marquee1\", \n" + " \"col7\": \"widget_gif_marquee1\", \n" + " \"col9\": \"widget_gif_marquee1\"\n" + " },\n" + " \"transition\": \"B\"\n" + " }, \n" + " \"layout_marquee2\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_gif_marquee2\", \n" + " \"col11\": \"widget_gif_marquee2\", \n" + " \"col13\": \"widget_gif_marquee2\", \n" + " \"col15\": \"widget_gif_marquee2\", \n" + " \"col17\": \"widget_gif_marquee2\", \n" + " \"col19\": \"widget_gif_marquee2\", \n" + " \"col3\": \"widget_gif_marquee2\", \n" + " \"col5\": \"widget_gif_marquee2\", \n" + " \"col7\": \"widget_gif_marquee2\", \n" + " \"col9\": \"widget_gif_marquee2\"\n" + " }, \n" + " \"row2\": {\n" + " \"col1\": \"widget_gif_marquee2\", \n" + " \"col12\": \"widget_wlan0_short_bar\", \n" + " \"col19\": \"widget_gif_marquee2\", \n" + " \"col3\": \"widget_wlan0_label\", \n" + " \"col9\": \"widget_wlan0\"\n" + " }, \n" + " \"row3\": {\n" + " \"col1\": \"widget_gif_marquee2\", \n" + " \"col19\": \"widget_gif_marquee2\", \n" + " \"col3\": \"widget_bottom_marquee\"\n" + " }, \n" + " \"row4\": {\n" + " \"col1\": \"widget_gif_marquee2\", \n" + " \"col11\": \"widget_gif_marquee2\", \n" + " \"col13\": \"widget_gif_marquee2\", \n" + " \"col15\": \"widget_gif_marquee2\", \n" + " \"col17\": \"widget_gif_marquee2\", \n" + " \"col19\": \"widget_gif_marquee2\", \n" + " \"col3\": \"widget_gif_marquee2\", \n" + " \"col5\": \"widget_gif_marquee2\", \n" + " \"col7\": \"widget_gif_marquee2\", \n" + " \"col9\": \"widget_gif_marquee2\"\n" + " },\n" + " \"transition\": \"U\"\n" + " }, \n" + " \"layout_marquee3\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_gif_marquee3\", \n" + " \"col11\": \"widget_gif_marquee3\", \n" + " \"col13\": \"widget_gif_marquee3\", \n" + " \"col15\": \"widget_gif_marquee3\", \n" + " \"col17\": \"widget_gif_marquee3\", \n" + " \"col19\": \"widget_gif_marquee3\", \n" + " \"col3\": \"widget_gif_marquee3\", \n" + " \"col5\": \"widget_gif_marquee3\", \n" + " \"col7\": \"widget_gif_marquee3\", \n" + " \"col9\": \"widget_gif_marquee3\"\n" + " }, \n" + " \"row2\": {\n" + " \"col1\": \"widget_gif_marquee3\", \n" + " \"col12\": \"widget_wlan0_short_bar\", \n" + " \"col19\": \"widget_gif_marquee3\", \n" + " \"col3\": \"widget_wlan0_label\", \n" + " \"col9\": \"widget_wlan0\"\n" + " }, \n" + " \"row3\": {\n" + " \"col1\": \"widget_gif_marquee3\", \n" + " \"col19\": \"widget_gif_marquee3\", \n" + " \"col3\": \"widget_bottom_marquee\"\n" + " }, \n" + " \"row4\": {\n" + " \"col1\": \"widget_gif_marquee3\", \n" + " \"col11\": \"widget_gif_marquee3\", \n" + " \"col13\": \"widget_gif_marquee3\", \n" + " \"col15\": \"widget_gif_marquee3\", \n" + " \"col17\": \"widget_gif_marquee3\", \n" + " \"col19\": \"widget_gif_marquee3\", \n" + " \"col3\": \"widget_gif_marquee3\", \n" + " \"col5\": \"widget_gif_marquee3\", \n" + " \"col7\": \"widget_gif_marquee3\", \n" + " \"col9\": \"widget_gif_marquee3\"\n" + " },\n" + " \"transition\": \"D\"\n" + " }, \n" + " \"layout_marquee4\": {\n" + " \"row1\": {\n" + " \"col1\": \"widget_gif_marquee4\", \n" + " \"col11\": \"widget_gif_marquee4\", \n" + " \"col13\": \"widget_gif_marquee4\", \n" + " \"col15\": \"widget_gif_marquee4\", \n" + " \"col17\": \"widget_gif_marquee4\", \n" + " \"col19\": \"widget_gif_marquee4\", \n" + " \"col3\": \"widget_gif_marquee4\", \n" + " \"col5\": \"widget_gif_marquee4\", \n" + " \"col7\": \"widget_gif_marquee4\", \n" + " \"col9\": \"widget_gif_marquee4\"\n" + " }, \n" + " \"row2\": {\n" + " \"col1\": \"widget_gif_marquee4\", \n" + " \"col12\": \"widget_wlan0_short_bar\", \n" + " \"col19\": \"widget_gif_marquee4\", \n" + " \"col3\": \"widget_wlan0_label\", \n" + " \"col9\": \"widget_wlan0\"\n" + " }, \n" + " \"row3\": {\n" + " \"col1\": \"widget_gif_marquee4\", \n" + " \"col19\": \"widget_gif_marquee4\", \n" + " \"col3\": \"widget_bottom_marquee\"\n" + " }, \n" + " \"row4\": {\n" + " \"col1\": \"widget_gif_marquee4\", \n" + " \"col11\": \"widget_gif_marquee4\", \n" + " \"col13\": \"widget_gif_marquee4\", \n" + " \"col15\": \"widget_gif_marquee4\", \n" + " \"col17\": \"widget_gif_marquee4\", \n" + " \"col19\": \"widget_gif_marquee4\", \n" + " \"col3\": \"widget_gif_marquee4\", \n" + " \"col5\": \"widget_gif_marquee4\", \n" + " \"col7\": \"widget_gif_marquee4\", \n" + " \"col9\": \"widget_gif_marquee4\"\n" + " },\n" + " \"transition\": \"U\"\n" + " }, \n" + " \"plugins\": {\n" + " \"i2c_sensors-path\": \"/sys/bus/i2c/devices/1-0028/\"\n" + " }, \n" + " \"widget_superscope\": {\n" + " \"init\": [\n" + " \"n=500\",\n" + " \"r=10\",\n" + " \"mx=0\",\n" + " \"my=0\",\n" + " \"mz=0\",\n" + " \"dst=0.2\",\n" + " \"rx=0\",\n" + " \"ry=0\",\n" + " \"rz=0\",\n" + " \"rdx=1\",\n" + " \"rdy=1\",\n" + " \"rdz=1\",\n" + " \"p=3.14159265\",\n" + " \"p2=10.0*p\",\n" + " \"p3=50/p\"\n" + "\n" + " ],\n" + " \"frame\": [\n" + " \"rx=rx+rdx\",\n" + " \"ry=ry+rdy\",\n" + " \"rz=rz+rdz\",\n" + " \"xs=sin(rx/p3)\",\n" + " \"ys=sin(ry/p3)\",\n" + " \"zs=sin(rz/p3)\",\n" + " \"xc=cos(rx/p3)\",\n" + " \"yc=cos(ry/p3)\",\n" + " \"zc=cos(rz/p3)\"\n" + " ],\n" + " \"beat\": [\n" + " \"r=rand(8) + 2\"\n" + " ],\n" + " \"point\": [\n" + " \"x1=v*sin(p2*i)\",\n" + " \"y1=v * i / cos(z1)\",\n" + " \"z1=r*cos(p2*i)\",\n" + " \"y2=y1*xc-z1*xs\",\n" + " \"z2=y1*xs+z1*xc\",\n" + " \"x2=z2*ys+x1*yc\",\n" + " \"z3=z2*yc-x1*ys\",\n" + " \"x3=x2*zc-y2*zs\",\n" + " \"y3=y2*zc+x2*zs\",\n" + " \"x4=mx+x3\",\n" + " \"y4=my+y3\",\n" + " \"z4=mz+z3\",\n" + " \"x=x4/(1+z4/dst)\",\n" + " \"y=y4/(1+z4/dst)\"\n" + "\n" + " ]\n" + " },\n" + " \"widget_page_label\": {\n" + " \"type\": \"text\",\n" + " \"length\": 10,\n" + " \"expression\": \"return 'PAGE FILE:'\"\n" + " },\n" + " \"widged_page\": {\n" + " \"type\": \"text\",\n" + " \"length\": 6,\n" + " \"expression\": \"return procstat.ProcStat('page')\"\n" + " },\n" + " \"widget_histogram_large\": {\n" + " \"type\": \"histogram\",\n" + " \"expression\": \"return procstat.Cpu('busy', 500)\",\n" + " \"foreground\": \"99005500\",\n" + " \"background\": \"77777777\",\n" + " \"height\": 32,\n" + " \"width\": 160,\n" + " \"update\": 100\n" + " },\n" + " \"widget_hddtemp\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return 'IDE Temp: ' .. exec.Exec('hddtemp " + "/dev/sda1 | cut -f 3 -d :', 999)\",\n" + " \"length\": 14,\n" + " \"align\": \"L\",\n" + " \"update\": 999\n" + " },\n" + " \"widget_FSSpace\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"fsspace_a = ((statfs.Statfs('/', " + "'bavail')*statfs.Statfs('/', 'bsize'))/ 1024/ 1024);fsspace_b = " + "((statfs.Statfs('/', 'bavail')*statfs.Statfs('/', 'bsize'))/1024/1024);c " + "= '/ ' .. fsspace_a .. 'MB / ' .. fsspace_b .. ' MB'; return c;\n" + " \",\n" + " \"length\": 42,\n" + " \"align\": \"M\",\n" + " \"speed\": 30\n" + " },\n" + " \"widget_CPU\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return procstat.Cpu('busy', 500)\",\n" + " \"postfix\": \"return '% '\",\n" + " \"length\": 5,\n" + " \"precision\": 1,\n" + " \"align\": \"R\",\n" + " \"update\": 50\n" + " },\n" + " \"widget_CPUBar\": {\n" + " \"type\": \"bar\",\n" + " \"expression\": \"return procstat.Cpu('busy', 500)\",\n" + " \"expression2\": \"return procstat.Cpu('system', 500)\",\n" + " \"length\": 10,\n" + " \"min\": \"1\",\n" + " \"max\": \"100\",\n" + " \"direction\": \"E\",\n" + " \"style\": \"H\",\n" + " \"update\": 50\n" + " },\n" + " \"widget_CPULabel\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return 'CPU:'\",\n" + " \"length\": 4,\n" + " \"align\": \"L\",\n" + " \"bold\": 1\n" + " },\n" + " \"widget_RAMTotal\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return meminfo.Meminfo('MemTotal')/1024\",\n" + " \"postfix\": \"return 'MB FREE'\",\n" + " \"length\": 11,\n" + " \"precision\": 0,\n" + " \"align\": \"L\",\n" + " \"update\": 50\n" + " },\n" + " \"widget_RAMFree\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return meminfo.Meminfo('MemFree')/1024\",\n" + " \"postfix\": \"return '/'\",\n" + " \"length\": 5,\n" + " \"precision\": 0,\n" + " \"align\": \"R\",\n" + " \"update\": 50\n" + " },\n" + " \"widget_RAMLabel\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return 'RAM:'\",\n" + " \"length\": 4,\n" + " \"align\": \"L\",\n" + " \"bold\": 1\n" + " },\n" + " \"widget_IDEIn\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return diskstats.Diskstats('sda', " + "'read_sectors', 100)/2048\",\n" + " \"prefix\": \"return 'In '\",\n" + " \"postfix\": \"return 'MB'\",\n" + " \"precision\": 2,\n" + " \"align\": \"R\",\n" + " \"length\": 10,\n" + " \"update\": 500\n" + " },\n" + " \"widget_IDEOut\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return diskstats.Diskstats('sda', " + "'write_sectors', 100)/2048\",\n" + " \"prefix\": \"return 'Out'\",\n" + " \"postfix\": \"return 'MB'\",\n" + " \"precision\": 2,\n" + " \"align\": \"R\",\n" + " \"length\": 10,\n" + " \"update\": 500\n" + " },\n" + " \"widget_IDEBar\": {\n" + " \"type\": \"bar\",\n" + " \"expression\": \"return diskstats.Diskstats('sda', " + "'read_sectors', 100)\",\n" + " \"expression2\": \"return diskstats.Diskstats('sda', " + "'write_sectors', 100)\",\n" + " \"length\": 14,\n" + " \"direction\": \"E\",\n" + " \"style\": \"H\",\n" + " \"update\": 500\n" + " },\n" + " \"widget_IDELabel\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return 'IDE:'\",\n" + " \"length\": 4,\n" + " \"align\": \"L\",\n" + " \"bold\": 1\n" + " },\n" + " \"widget_WLANLabel\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return 'WLAN:'\",\n" + " \"length\": 5,\n" + " \"align\": \"L\",\n" + " \"bold\": 1\n" + " },\n" + " \"widget_WLANIn\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return netdev.Fast('wlan0', 'Rx_bytes', " + "500)/1024\",\n" + " \"prefix\": \"'OUT'\",\n" + " \"postfix\": \"'KB'\",\n" + " \"length\": 9,\n" + " \"precision\": 0,\n" + " \"align\": \"R\",\n" + " \"update\": 50\n" + " },\n" + " \"widget_WLANOut\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return netdev.Fast('wlan0', 'Tx_bytes', " + "500)/1024\",\n" + " \"prefix\": \"'IN'\",\n" + " \"postfix\": \"'KB'\",\n" + " \"length\": 9,\n" + " \"precision\": 0,\n" + " \"align\": \"R\",\n" + " \"update\": 50\n" + " },\n" + " \"widget_WLANBar\": {\n" + " \"type\": \"bar\",\n" + " \"expression\": \"return netdev.Fast('wlan0', 'Rx_bytes', " + "500)\",\n" + " \"expression2\": \"return netdev.Fast('wlan0', 'Tx_bytes', " + "500)\",\n" + " \"length\": 14,\n" + " \"direction\": \"E\",\n" + " \"style\": \"H\",\n" + " \"update\": 50\n" + " },\n" + " \"widget_TimeLabel\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return 'TIME:'\",\n" + " \"length\": 5,\n" + " \"align\": \"L\",\n" + " \"bold\": 1\n" + " },\n" + " \"widget_Time\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return time.Strftime('%a,%m/%d %H:%M:%S', " + "time.Time())\",\n" + " \"length\": 20,\n" + " \"align\": \"C\",\n" + " \"update\": 10\n" + " },\n" + " \"widget_UptimeLabel\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return 'UPTIME:'\",\n" + " \"length\": 7,\n" + " \"align\": \"L\",\n" + " \"bold\": 1\n" + " },\n" + " \"widget_Uptime\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return uptime.Uptime('%d d %H:%M:%S')\",\n" + " \"length\": 21,\n" + " \"align\": \"L\",\n" + " \"update\": 999\n" + " },\n" + " \"widget_fps\": {\n" + " \"type\": \"text\",\n" + " \"expression\": \"return fps.avg() .. ' - FPS'\",\n" + " \"length\": 11,\n" + " \"foreground\": \"FFFFFFFF\",\n" + " \"background\": \"ff000000\"\n" + " },\n" + " \"widget_vis_banner\": {\n" + " \"type\": \"filter\",\n" + " \"width\": 48,\n" + " \"height\": 16,\n" + " \"update\": 100,\n" + " \"actor\": \"dmovement\",\n" + " \"style\": \"pcm\"\n" + " },\n" + " \"widget_infinite_256x64\": {\n" + " \"type\": \"visualization\",\n" + " \"width\": 256,\n" + " \"height\": 64,\n" + " \"update\": 50,\n" + " \"morph-timeout\": 5500,\n" + " \"morph-steps\": 5,\n" + " \"skip-actors\": " + "\"gstreamer:gdkpixbuf:lcdcontrol:jess:oinksie:goom2k4:jakdaw\",\n" + " \"actor\": \"corona\",\n" + " \"input\": \"debug\",\n" + " \"morph\": \"slide_up\",\n" + " \"style\": \"pcm\",\n" + " \"alpha\": 50\n" + " },\n" + " \"widget_libvisual_256x64\": {\n" + " \"type\": \"visualization\",\n" + " \"width\": 256,\n" + " \"height\": 64,\n" + " \"update\": 50,\n" + " \"morph-timeout\": 0,\n" + " \"morph-steps\": 18,\n" + " \"skip-actors\": " + "\"gstreamer:gdkpixbuf:lcdcontrol:jess:oinksie:goom2k4:jakdaw\",\n" + " \"actor\": \"lv_analyzer\",\n" + " \"input\": \"debug\",\n" + " \"morph\": \"tentacle\",\n" + " \"style\": \"pcm\",\n" + " \"alpha\": 50,\n" + " \"params\": {\n" + " \"oinksie\": {\n" + " \"acid palette\": 1,\n" + " \"color mode\": 4\n" + " },\n" + " /*\"blursk\": { // blur scope\n" + " \"show_info\": \"Always\",\n" + " \"show_timestamp\": 1,\n" + " \"color\": \"r=246,g=242,b=20\",\n" + " \"color_style\": \"Dimming\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Simple\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Oscilloscope\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\",\n" + " \"beat_sensitivity\": 4\n" + " },*/\n" + " \"blursk\": { // box spectrum\n" + " \"color\": \"r=0,g=254,b=0\",\n" + " \"color_style\": \"Flame\",\n" + " \"signal_color\": \"White signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Backward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Reduced blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Stereo spectrum\",\n" + " \"plot_style\": \"Edges\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Dark bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " /*\"blursk\": { // burning logo\n" + " \"color\": \"r=254,g=98,b=38\",\n" + " \"color_style\": \"Flame\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Cylinder\",\n" + " \"transition_speed\": \"Slow switch\",\n" + " \"blur_when\": \"Reduced blur\",\n" + " \"blur_stencil\": \"Blursk stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Stereo spectrum\",\n" + " \"plot_style\": \"Airbrush\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"Blursk flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"TRUE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },*/\n" + " /*\"blursk\": { // cat scan\n" + " \"color\": \"r=175,g=245,b=0\",\n" + " \"color_style\": \"Rainbow\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Fast fade\",\n" + " \"blur_style\": \"Four way\",\n" + " \"transition_speed\": \"Fast switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Radial spectrum\",\n" + " \"plot_style\": \"Airbrush\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Ripple effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },*/\n" + " /*\"blursk\": { // cubism\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Color stripes\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Tangram\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Melt\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"Mirrored\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"Invert flash\",\n" + " \"overall_effect\": \"Anti-fade effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Dark bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // fan\n" + " \"color\": \"r=0,g=255,b=0\",\n" + " \"color_style\": \"Milky\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 1,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Four way\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"No blur\",\n" + " \"blur_stencil\": \"Tux stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"Radar\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // flag\n" + " \"color\": \"r=0,g=255,b=255\",\n" + " \"color_style\": \"Color bands\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Random\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Reduced blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"Radar\",\n" + " \"thick_on_beats\": 0,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // flame scan\n" + " \"color\": \"r=242,g=74,b=0\",\n" + " \"color_style\": \"Flame\",\n" + " \"signal_color\": \"White signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Flow around\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Stereo spectrum\",\n" + " \"plot_style\": \"Edges\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Ripple effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // flashbulb\n" + " \"color\": \"r=0,g=178,b=246\",\n" + " \"color_style\": \"Dimming\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 1,\n" + " \"hue_on_beats\": 1,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Prismatic\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Melt\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"None\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"Random flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // foil\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Layers\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Forward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Reduced blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Flower\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // frenetic\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Graying\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Fast fade\",\n" + " \"blur_style\": \"Fast forward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Phase shift\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 0,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Flash bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // heat wave\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Color layers\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Rise\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Reduced blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Stereo spectrum\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"black_background\": \"TRUE\",\n" + " \"toggle_bpl\": \"Edge smooth\",\n" + " \"background\": \"White bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // interference\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Color stripes\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 1,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Forward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Flower\",\n" + " \"plot_style\": \"Mirrored\",\n" + " \"thick_on_beats\": 0,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // lens\n" + " \"color\": \"r=249,g=69,b=0\",\n" + " \"color_style\": \"Milky\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 1,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Ripple\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"Mirrored\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // metalic\n" + " \"color\": \"r=0,g=253,b=253\",\n" + " \"color_style\": \"Metal\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Random slow\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Oscilloscope\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Bump effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"black_background\": \"TRUE\",\n" + " \"toggle_bpl\": \"Area smooth\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // nucleus\n" + " \"color\": \"r=11,g=253,b=249\",\n" + " \"color_style\": \"Color stripes\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 1,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Fast forward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Phase shift\",\n" + " \"plot_style\": \"Fuzzy dots\",\n" + " \"thick_on_beats\": 0,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"black_background\": \"TRUE\",\n" + " \"toggle_bpl\": \"Edge smooth\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // quick change\n" + " \"color\": \"r=250,g=129,b=253\",\n" + " \"color_style\": \"Standoff\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Random\",\n" + " \"transition_speed\": \"Fast switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"Radar\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"toggle_bpl\": \"Area smooth\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // random flower\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Random\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Random slow\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Flower\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Random bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // random mirrored spectrum\n" + " \"color\": \"r=252,g=154,b=10\",\n" + " \"color_style\": \"Random\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Random slow\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"Mirrored\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"Random flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Random bkgnd\",\n" + " \"toggle_bpl\": \"Area smooth\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // ripple\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Color stripes\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Random\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"High/Low plot\",\n" + " \"plot_style\": \"Starburst\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Shift bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // roller\n" + " \"color\": \"r=70,g=0,b=251\",\n" + " \"color_style\": \"Stripes\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 1,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Cylinder\",\n" + " \"transition_speed\": \"Fast switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Stereo spectrum\",\n" + " \"plot_style\": \"Airbrush\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Anti-fade effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"toggle_bpl\": \"Area smooth\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // rose\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Rainbow\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Tangram\",\n" + " \"transition_speed\": \"Slow switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Flower\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Anti-fade effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"White bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // scan\n" + " \"color\": \"r=175,g=245,b=0\",\n" + " \"color_style\": \"Rainbow\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Flow around\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Stereo spectrum\",\n" + " \"plot_style\": \"None\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"Invert flash\",\n" + " \"overall_effect\": \"Anti-fade effect\",\n" + " \"random_dots\": \"TRUE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"Slow floaters\"\n" + " },\n" + " \"blursk\": { // sparkler\n" + " \"color\": \"r=252,g=72,b=0\",\n" + " \"color_style\": \"Metal\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 1,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Four way\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"Radar\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // subliminal logo\n" + " \"color\": \"r=175,g=245,b=0\",\n" + " \"color_style\": \"Random\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Random\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Random blur\",\n" + " \"blur_stencil\": \"Random stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Flower\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 0,\n" + " \"flash_style\": \"Random flash\",\n" + " \"overall_effect\": \"Ripple effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // tunnel\n" + " \"color\": \"r=179,g=251,b=0\",\n" + " \"color_style\": \"Color layers\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Forward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Reduced blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Flower\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // tunnel2\n" + " \"color\": \"r=245,g=68,b=0\",\n" + " \"color_style\": \"Color layers\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 1,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Fast forward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Flower\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Dark bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // wiggler\n" + " \"color\": \"r=0,g=253,b=253\",\n" + " \"color_style\": \"Color layers\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Flow around\",\n" + " \"transition_speed\": \"Fast switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Radial spectrum\",\n" + " \"plot_style\": \"Starburst\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Dark bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // xmms\n" + " \"color\": \"r=0,g=254,b=254\",\n" + " \"color_style\": \"Dimming\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Random\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Reduced blur\",\n" + " \"blur_stencil\": \"XMMS stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Flower\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 0,\n" + " \"flash_style\": \"XMMS flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Color bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // bump scope\n" + " \"color\": \"r=246,g=240,b=10\",\n" + " \"color_style\": \"Dimming\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Simple\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Oscilloscope\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Bump effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // wax\n" + " \"color\": \"r=38,g=246,b=9\",\n" + " \"color_style\": \"Flame\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 1,\n" + " \"fade_speed\": \"Fast fade\",\n" + " \"blur_style\": \"Gravity\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Oscilloscope\",\n" + " \"plot_style\": \"Line\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Anti-fade effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"White bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // gas cloud\n" + " \"color\": \"r=247,g=128,b=0\",\n" + " \"color_style\": \"Color layers\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Flow between\",\n" + " \"transition_speed\": \"Fast switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Radial spectrum\",\n" + " \"plot_style\": \"Starburst\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Ripple effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Shift bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // aurora\n" + " \"color\": \"r=251,g=205,b=2\",\n" + " \"color_style\": \"Color standoff\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Forward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Radial spectrum\",\n" + " \"plot_style\": \"Inertia\",\n" + " \"thick_on_beats\": 0,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // fractal drums\n" + " \"color\": \"r=255,g=234,b=0\",\n" + " \"color_style\": \"Brightening\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Fractal sphere\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 1,\n" + " \"signal_style\": \"Phase shift\",\n" + " \"plot_style\": \"Fuzzy dots\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Bump effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"toggle_bpl\": \"Edge smooth\",\n" + " \"background\": \"Black bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // butterfly\n" + " \"color\": \"r=0,g=254,b=0\",\n" + " \"color_style\": \"Color standoff\",\n" + " \"signal_color\": \"White signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Backward\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Smear\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Stereo spectrum\",\n" + " \"plot_style\": \"Edges\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"FALSE\",\n" + " \"background\": \"Shift bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // radioactive bob\n" + " \"color\": \"r=248,g=248,b=0\",\n" + " \"color_style\": \"Milky\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 1,\n" + " \"black_background\": \"FALSE\",\n" + " \"fade_speed\": \"Medium fade\",\n" + " \"blur_style\": \"Tangram\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"Bob stencil\",\n" + " \"slow_motion\": 1,\n" + " \"toggle_bpl\": \"Area smooth\",\n" + " \"signal_style\": \"Phase shift\",\n" + " \"plot_style\": \"None\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"Bob flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"random_dots\": \"TRUE\",\n" + " \"background\": \"Color bkgnd\",\n" + " \"floaters\": \"No floaters\"\n" + " },\n" + " \"blursk\": { // testing 1 2 3\n" + " \"color\": \"r=237,g=5,b=230\",\n" + " \"color_style\": \"Flame\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"background\": \"Random bkgnd\",\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Random slow\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Full blur\",\n" + " \"blur_stencil\": \"Maybe stencil\",\n" + " \"slow_motion\": 0,\n" + " \"toggle_bpl\": \"Area smooth\",\n" + " \"signal_style\": \"Mono spectrum\",\n" + " \"plot_style\": \"Inertia\",\n" + " \"thick_on_beats\": 0,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Normal effect\",\n" + " \"floaters\": \"Fast floaters\"\n" + " },\n" + " \"blursk\": { // drain\n" + " \"color\": \"r=228,g=150,b=0\",\n" + " \"color_style\": \"Rainbow\",\n" + " \"signal_color\": \"Normal signal\",\n" + " \"contour_lines\": 0,\n" + " \"hue_on_beats\": 0,\n" + " \"background\": \"Color bkgnd\",\n" + " \"fade_speed\": \"Slow fade\",\n" + " \"blur_style\": \"Drain\",\n" + " \"transition_speed\": \"Medium switch\",\n" + " \"blur_when\": \"Reduced blur\",\n" + " \"blur_stencil\": \"No stencil\",\n" + " \"slow_motion\": 0,\n" + " \"signal_style\": \"Stereo spectrum\",\n" + " \"plot_style\": \"Edges\",\n" + " \"thick_on_beats\": 1,\n" + " \"flash_style\": \"No flash\",\n" + " \"overall_effect\": \"Anti-fade effect\",\n" + " \"floaters\": \"No floaters\"\n" + " },*/\n" + " \"none\": {}\n" + " }\n" + " },\n" + " \"widget_pcm_24x16\": {\n" + " \"type\": \"visualization\",\n" + " \"width\": 24,\n" + " \"height\": 16,\n" + " \"update\": 100,\n" + " \"style\": \"pcm\",\n" + " \"actor\": \"oinksie\",\n" + " \"morph-timeout\": 0,\n" + " \"skip-actors\": \"gstreamer:gdkpixbuf:jakdaw\"\n" + " },\n" + " \"widget_peak\": {\n" + " \"type\": \"visualization\",\n" + " \"width\": 20,\n" + " \"height\": 4,\n" + " \"update\": 100,\n" + " \"style\": \"peak\"\n" + " },\n" + " \"widget_spectrum\": {\n" + " \"type\": \"visualization\",\n" + " \"width\": 20,\n" + " \"height\": 4,\n" + " \"update\": 100,\n" + " \"style\": \"spectrum\"\n" + " },\n" + " \"widget_bignums\": {\n" + " \"expression\": \"return procstat.Cpu('busy', 200) \", \n" + " \"type\": \"bignums\", \n" + " \"max\": 100,\n" + " \"min\": 0,\n" + " \"update\": 1,\n" + " \"foreground\": \"ffFFFFFF\",\n" + " \"background\": \"00ffffff\"\n" + " }, \n" + " \"widget_cpuinfo_label\": {\n" + " \"expression\": \"return 'CPUInfo: '\",\n" + " \"type\": \"text\",\n" + " \"length\": 10\n" + " },\n" + " \"widget_cpuinfo\": {\n" + " \"expression\": \"return cpuinfo.Cpuinfo('model name') .. ' " + "'\",\n" + " \"type\": \"text\",\n" + " \"length\": 10\n" + " },\n" + " \"widget_bottom_marquee\": {\n" + " \"align\": \"M\", \n" + " \"expression\": \"uname.Uname('sysname') + ' ' + " + "uname.Uname('nodename') + ' ' + uname.Uname('release') + ' ' + " + "cpuinfo.Cpuinfo('model name')\", \n" + " \"type\": \"text\", \n" + " \"speed\": 100, \n" + " \"length\": 16\n" + " }, \n" + " \"widget_bottom_ticker\": {\n" + " \"align\": \"P\", \n" + " \"expression\": \"uname.Uname('sysname') + ' ' + " + "uname.Uname('nodename') + ' ' + uname.Uname('release') + ' ' + " + "cpuinfo.Cpuinfo('model name')\", \n" + " \"type\": \"text\", \n" + " \"speed\": 100,\n" + " \"bold\": 1,\n" + " \"length\": 42\n" + " }, \n" + " \"widget_percent\": {\n" + " \"expression\": \"return '%'\",\n" + " \"length\": 1\n" + " },\n" + " \"widget_cpu\": {\n" + " \"align\": \"R\", \n" + " \"expression\": \"procstat.Cpu('busy', 500)\", \n" + " \"postfix\": \"'%'\", \n" + " \"precision\": 0, \n" + " \"type\": \"text\", \n" + " \"update\": 500, \n" + " \"length\": 5\n" + " }, \n" + " \"widget_cpu_bar\": {\n" + " \"direction\": \"W\", \n" + " \"expression\": \"procstat.Cpu('busy', 500)\", \n" + " \"length\": 10, \n" + " \"max\": \"100\", \n" + " \"min\": \"0\", \n" + " \"style\": \"H\", \n" + " \"type\": \"bar\", \n" + " \"update\": 500\n" + " }, \n" + " \"widget_cpu_histogram\": {\n" + " \"direction\": \"E\", \n" + " \"expression\": \"procstat.Cpu('busy', 500)\", \n" + " \"gap\": 1, \n" + " \"length\": 10, \n" + " \"max\": \"100\", \n" + " \"min\": \"0\", \n" + " \"type\": \"histogram\", \n" + " \"update\": 500\n" + " }, \n" + " \"widget_cpu_label\": {\n" + " \"align\": \"L\", \n" + " \"expression\": \"return 'CPU:'\", \n" + " \"type\": \"text\", \n" + " \"length\": 4\n" + " }, \n" + " \"widget_dow\": {\n" + " \"align\": \"L\", \n" + " \"expression\": \"\", \n" + " \"type\": \"text\"\n" + " }, \n" + " \"widget_dow_end\": {\n" + " \"align\": \"L\", \n" + " \"expression\": \"\", \n" + " \"type\": \"text\", \n" + " \"length\": 1\n" + " }, \n" + " \"widget_dow_label\": {\n" + " \"align\": \"L\", \n" + " \"expression\": \"'Ambient:'\", \n" + " \"type\": \"text\", \n" + " \"length\": 10\n" + " }, \n" + " \"widget_gif_american_flag\": {\n" + " \"file\": \"gifs/American_Flag_ani.gif\", \n" + " \"type\": \"gif\", \n" + " \"update\": \"250\", \n" + " \"xpoint\": 1,\n" + " \"inverted\": 1\n" + " }, \n" + " \"widget_gif_bolt\": {\n" + " \"file\": \"gifs/lightning_bolt_ani.gif\", \n" + " \"type\": \"gif\", \n" + " \"update\": \"250\",\n" + " \"inverted\": 1\n" + " }, \n" + " \"widget_gif_intel\": {\n" + " \"file\": \"gifs/intel_logo_ani.gif\", \n" + " \"start\": 1, \n" + " \"end\": 6, \n" + " \"type\": \"gif\", \n" + " \"update\": \"250\",\n" + " \"inverted\": 1\n" + " }, \n" + " \"widget_gif_marquee1\": {\n" + " \"file\": \"gifs/marquee1.gif\", \n" + " \"height\": 8, \n" + " \"type\": \"gif\", \n" + " \"update\": \"250\", \n" + " \"width\": 12,\n" + " \"height\": 12,\n" + " \"inverted\": 1\n" + " }, \n" + " \"widget_gif_marquee2\": {\n" + " \"file\": \"gifs/marquee2.gif\", \n" + " \"type\": \"gif\", \n" + " \"update\": \"250\",\n" + " \"widget\": 12,\n" + " \"height\": 12,\n" + " \"inverted\": 1\n" + " }, \n" + " \"widget_gif_marquee3\": {\n" + " \"file\": \"gifs/marquee3.gif\", \n" + " \"type\": \"gif\", \n" + " \"update\": \"250\",\n" + " \"widget\": 12,\n" + " \"height\": 12,\n" + " \"inverted\": 1\n" + " }, \n" + " \"widget_gif_marquee4\": {\n" + " \"file\": \"gifs/marquee4.gif\", \n" + " \"type\": \"gif\", \n" + " \"update\": \"250\",\n" + " \"widget\": 12,\n" + " \"height\": 12,\n" + " \"inverted\": 1\n" + " }, \n" + " \"widget_icon_blob\": {\n" + " \"bitmap\": {\n" + " \"row1\": \".....|.....|.....\", \n" + " \"row2\": \".....|.....|.***.\", \n" + " \"row3\": \".....|.***.|*...*\", \n" + " \"row4\": \"..*..|.*.*.|*...*\", \n" + " \"row5\": \".....|.***.|*...*\", \n" + " \"row6\": \".....|.....|.***.\", \n" + " \"row7\": \".....|.....|.....\", \n" + " \"row8\": \".....|.....|.....\"\n" + " }, \n" + " \"speed\": 300, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_icon_ekg\": {\n" + " \"bitmap\": {\n" + " \"row1\": " + "\".....|.....|.....|.....|.....|.....|.....|.....\", \n" + " \"row2\": " + "\".....|....*|...*.|..*..|.*...|*....|.....|.....\", \n" + " \"row3\": " + "\".....|....*|...*.|..*..|.*...|*....|.....|.....\", \n" + " \"row4\": " + "\".....|....*|...**|..**.|.**..|**...|*....|.....\", \n" + " \"row5\": " + "\".....|....*|...**|..**.|.**..|**...|*....|.....\", \n" + " \"row6\": " + "\".....|....*|...*.|..*.*|.*.*.|*.*..|.*...|*....\", \n" + " \"row7\": " + "\"*****|*****|****.|***..|**..*|*..**|..***|.****\", \n" + " \"row8\": " + "\".....|.....|.....|.....|.....|.....|.....|.....\"\n" + " }, \n" + " \"speed\": 30, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_icon_heart\": {\n" + " \"bitmap\": {\n" + " \"row1\": \".....|.....|.....|.....|.....|.....\", \n" + " \"row2\": \".*.*.|.....|.*.*.|.....|.....|.....\", \n" + " \"row3\": \"*****|.*.*.|*****|.*.*.|.*.*.|.*.*.\", \n" + " \"row4\": \"*****|.***.|*****|.***.|.***.|.***.\", \n" + " \"row5\": \".***.|.***.|.***.|.***.|.***.|.***.\", \n" + " \"row6\": \".***.|..*..|.***.|..*..|..*..|..*..\", \n" + " \"row7\": \"..*..|.....|..*..|.....|.....|.....\", \n" + " \"row8\": \".....|.....|.....|.....|.....|.....\"\n" + " }, \n" + " \"speed\": 500, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_icon_heartbeat\": {\n" + " \"bitmap\": {\n" + " \"row1\": \".....|.....\", \n" + " \"row2\": \".*.*.|.*.*.\", \n" + " \"row3\": \"*****|*.*.*\", \n" + " \"row4\": \"*****|*...*\", \n" + " \"row5\": \".***.|.*.*.\", \n" + " \"row6\": \".***.|.*.*.\", \n" + " \"row7\": \"..*..|..*..\", \n" + " \"row8\": \".....|.....\"\n" + " }, \n" + " \"speed\": 500, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_icon_karo\": {\n" + " \"bitmap\": {\n" + " \"row1\": " + "\".....|.....|.....|.....|..*..|.....|.....|.....\", \n" + " \"row2\": " + "\".....|.....|.....|..*..|.*.*.|..*..|.....|.....\", \n" + " \"row3\": " + "\".....|.....|..*..|.*.*.|*...*|.*.*.|..*..|.....\", \n" + " \"row4\": " + "\".....|..*..|.*.*.|*...*|.....|*...*|.*.*.|..*..\", \n" + " \"row5\": " + "\".....|.....|..*..|.*.*.|*...*|.*.*.|..*..|.....\", \n" + " \"row6\": " + "\".....|.....|.....|..*..|.*.*.|..*..|.....|.....\", \n" + " \"row7\": " + "\".....|.....|.....|.....|..*..|.....|.....|.....\", \n" + " \"row8\": " + "\".....|.....|.....|.....|.....|.....|.....|.....\"\n" + " }, \n" + " \"speed\": 100, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_icon_rain\": {\n" + " \"bitmap\": {\n" + " \"row1\": " + "\"...*.|.....|.....|.*...|....*|..*..|.....|*....\", \n" + " \"row2\": " + "\"*....|...*.|.....|.....|.*...|....*|..*..|.....\", \n" + " \"row3\": " + "\".....|*....|...*.|.....|.....|.*...|....*|..*..\", \n" + " \"row4\": " + "\"..*..|.....|*....|...*.|.....|.....|.*...|....*\", \n" + " \"row5\": " + "\"....*|..*..|.....|*....|...*.|.....|.....|.*...\", \n" + " \"row6\": " + "\".*...|....*|..*..|.....|*....|...*.|.....|.....\", \n" + " \"row7\": " + "\".....|.*...|....*|..*..|.....|*....|...*.|.....\", \n" + " \"row8\": " + "\".....|.....|.*...|....*|..*..|.....|*....|...*.\"\n" + " }, \n" + " \"speed\": 100, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_icon_squirrel\": {\n" + " \"bitmap\": {\n" + " \"row1\": \".....|.....|.....|.....|.....|.....\", \n" + " \"row2\": \".....|.....|.....|.....|.....|.....\", \n" + " \"row3\": \".....|.....|.....|.....|.....|.....\", \n" + " \"row4\": \"**...|.**..|..**.|...**|....*|.....\", \n" + " \"row5\": \"*****|*****|*****|*****|*****|*****\", \n" + " \"row6\": \"...**|..**.|.**..|**...|*....|.....\", \n" + " \"row7\": \".....|.....|.....|.....|.....|.....\", \n" + " \"row8\": \".....|.....|.....|.....|.....|.....\"\n" + " }, \n" + " \"speed\": 100, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_icon_timer\": {\n" + " \"bitmap\": {\n" + " \"row1\": " + "\".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|" + ".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|" + "\", \n" + " \"row2\": " + "\".***.|.*+*.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|.*++.|" + ".+++.|.+*+.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|.+**.|" + "\", \n" + " \"row3\": " + "\"*****|**+**|**++*|**+++|**++.|**++.|**+++|**+++|**+++|**+++|**+++|+++++|" + "+++++|++*++|++**+|++***|++**.|++**.|++***|++***|++***|++***|++***|*****|" + "\", \n" + " \"row4\": " + "\"*****|**+**|**+**|**+**|**+++|**+++|**+++|**+++|**+++|**+++|+++++|+++++|" + "+++++|++*++|++*++|++*++|++***|++***|++***|++***|++***|++***|*****|*****|" + "\", \n" + " \"row5\": " + "\"*****|*****|*****|*****|*****|***++|***++|**+++|*++++|+++++|+++++|+++++|" + "+++++|+++++|+++++|+++++|+++++|+++**|+++**|++***|+****|*****|*****|*****|" + "\", \n" + " \"row6\": " + "\".***.|.***.|.***.|.***.|.***.|.***.|.**+.|.*++.|.+++.|.+++.|.+++.|.+++.|" + ".+++.|.+++.|.+++.|.+++.|.+++.|.+++.|.++*.|.+**.|.***.|.***.|.***.|.***.|" + "\", \n" + " \"row7\": " + "\".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|" + ".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|" + "\", \n" + " \"row8\": " + "\".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|" + ".....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|.....|" + "\"\n" + " }, \n" + " \"speed\": 100, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_icon_wave\": {\n" + " \"bitmap\": {\n" + " \"row1\": " + "\"..**.|.**..|**...|*....|.....|.....|.....|.....|....*|...**\", \n" + " \"row2\": " + "\".*..*|*..*.|..*..|.*...|*....|.....|.....|....*|...*.|..*..\", \n" + " \"row3\": " + "\"*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...\", \n" + " \"row4\": " + "\"*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...\", \n" + " \"row5\": " + "\"*....|....*|...*.|..*..|.*...|*....|....*|...*.|..*..|.*...\", \n" + " \"row6\": " + "\".....|.....|....*|...*.|..*..|.*..*|*..*.|..*..|.*...|*....\", \n" + " \"row7\": " + "\".....|.....|.....|....*|...**|..**.|.**..|**...|*....|.....\", \n" + " \"row8\": " + "\".....|.....|.....|.....|.....|.....|.....|.....|.....|.....\"\n" + " }, \n" + " \"speed\": 100, \n" + " \"type\": \"icon\"\n" + " }, \n" + " \"widget_key_down\": {\n" + " \"expression\": \"return lcd.Transition(-1)\", \n" + " \"key\": 2, \n" + " \"type\": \"key\"\n" + " }, \n" + " \"widget_key_up\": {\n" + " \"expression\": \"return lcd.Transition(1)\", \n" + " \"key\": 1, \n" + " \"type\": \"key\"\n" + " }, \n" + " \"widget_percent\": {\n" + " \"expression\": \"return '%'\", \n" + " \"type\": \"text\"\n" + " }, \n" + " \"widget_ram_active\": {\n" + " \"align\": \"L\", \n" + " \"expression\": \"return meminfo.Meminfo('Active')/1024\", \n" + " \"type\": \"text\", \n" + " \"postfix\": \"'/'\",\n" + " \"precision\": 0,\n" + " \"update\": 500, \n" + " \"length\": 5\n" + " }, \n" + " \"widget_ram_label\": {\n" + " \"align\": \"L\", \n" + " \"expression\": \"return 'Ram:'\", \n" + " \"type\": \"text\", \n" + " \"length\": 4\n" + " }, \n" + " \"widget_ram_total\": {\n" + " \"align\": \"L\", \n" + " \"expression\": \"return meminfo.Meminfo('MemTotal')/1024\", \n" + " \"type\": \"text\", \n" + " \"precision\": 0,\n" + " \"update\": 500, \n" + " \"length\": 5\n" + " }, \n" + " \"widget_system_bar\": {\n" + " \"expression\": \"return procstat.Cpu('system', 500)\", \n" + " \"style\": \"H\", \n" + " \"type\": \"bar\", \n" + " \"width\": 10\n" + " }, \n" + " \"widget_system_histogram\": {\n" + " \"direction\": \"E\", \n" + " \"expressionn\": \"return procstat.Cpu('system', 500)\", \n" + " \"gap\": 1, \n" + " \"type\": \"histogram\", \n" + " \"width\": 10\n" + " }, \n" + " \"widget_system_label\": {\n" + " \"align\": \"R\", \n" + " \"prefix\": \"return 'System: '\", \n" + " \"type\": \"text\", \n" + " \"length\": 10\n" + " }, \n" + " \"widget_wlan0\": {\n" + " \"align\": \"L\", \n" + " \"expression\": \"return netdev.Fast('wlan0', 'Tx_bytes', 100) " + "/1024\", \n" + " \"precision\": 0, \n" + " \"type\": \"text\", \n" + " \"update\": 500, \n" + " \"length\": 3\n" + " }, \n" + " \"widget_wlan0_bar\": {\n" + " \"expression\": \"return netdev.Fast('wlan0', 'Rx_bytes', 500) / " + "1024\", \n" + " \"expression2\": \"return netdev.Fast('wlan0', 'Tx_bytes', 500) / " + "1024\", \n" + " //\"style\": \"H\", \n" + " \"type\": \"bar\", \n" + " \"update\": 500, \n" + " \"width\": 10\n" + " }, \n" + " \"widget_wlan0_histogram\": {\n" + " \"direction\": \"E\", \n" + " \"expression\": \n" + "\"return (netdev.Fast('wlan0', 'Rx_bytes', 500) + netdev.Fast('wlan0', " + "'Tx_bytes', 500)) /1024\", \n" + " \"gap\": 1, \n" + " \"type\": \"histogram\", \n" + " \"update\": 500, \n" + " \"width\": 10\n" + " }, \n" + " \"widget_wlan0_label\": {\n" + " \"expression\": \"return 'wlan0:'\", \n" + " \"type\": \"text\", \n" + " \"length\": 6\n" + " }, \n" + " \"widget_wlan0_short_bar\": {\n" + " \"expression\": \"return (netdev.Fast('wlan0', 'Rx_bytes', 500) + " + "netdev.Fast('wlan0', 'Tx_bytes', 500)) /1024\", \n" + " \"length\": 7, \n" + " \"style\": \"N\", \n" + " \"type\": \"bar\", \n" + " \"update\": 500\n" + " },\n" + " \"widget_netstat_script\": {\n" + " \"file\": \"netstat_script.js\",\n" + " \"type\": \"script\"\n" + " }\n" + "}\n\n"; diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/luascript.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/luascript.cpp index b57d85c1d..b4585f4b5 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/luascript.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/luascript.cpp @@ -9,20 +9,16 @@ lua::lua() { luaL_openlibs(L_); } -lua::~lua() { - lua_close(L_); -} +lua::~lua() { lua_close(L_); } -void lua::bool_arg_t::unpack(lua_State* L, int nparam) { +void lua::bool_arg_t::unpack(lua_State *L, int nparam) { if (lua_isboolean(L, nparam)) value_ = lua_toboolean(L, nparam) ? true : false; else throw lua::exception("bool_arg_t::unpack(), value is not boolean"); } -void lua::bool_arg_t::pack(lua_State* L) { - lua_pushboolean(L, value_); -} +void lua::bool_arg_t::pack(lua_State *L) { lua_pushboolean(L, value_); } std::string lua::bool_arg_t::asString() { std::stringstream fmt; @@ -30,16 +26,14 @@ std::string lua::bool_arg_t::asString() { return fmt.str(); } -void lua::int_arg_t::unpack(lua_State* L, int nparam) { +void lua::int_arg_t::unpack(lua_State *L, int nparam) { if (lua_isnumber(L, nparam)) value_ = lua::int_arg_t::value_type(lua_tointeger(L, nparam)); else throw lua::exception("int_arg_t::unpack(), value is not integer"); } -void lua::int_arg_t::pack(lua_State* L) { - lua_pushinteger(L, value_); -} +void lua::int_arg_t::pack(lua_State *L) { lua_pushinteger(L, value_); } std::string lua::int_arg_t::asString() { std::stringstream fmt; @@ -47,66 +41,62 @@ std::string lua::int_arg_t::asString() { return fmt.str(); } -void lua::string_arg_t::unpack(lua_State* L, int nparam) { +void lua::string_arg_t::unpack(lua_State *L, int nparam) { if (lua_isstring(L, nparam)) value_ = lua_tostring(L, nparam); else throw lua::exception("string_arg_t::unpack(), value is not string"); } -void lua::string_arg_t::pack(lua_State* L) { +void lua::string_arg_t::pack(lua_State *L) { lua_pushstring(L, value_.c_str()); } -std::string lua::string_arg_t::asString() { - return value_; -} +std::string lua::string_arg_t::asString() { return value_; } -lua::args_t::args_t(const lua::args_t& rhs) { +lua::args_t::args_t(const lua::args_t &rhs) { clear(); for (const_iterator i = rhs.begin(); i != rhs.end(); ++i) push_back((*i)->clone()); } -lua::args_t::~args_t() { - std::for_each(begin(), end(), deleter()); -} +lua::args_t::~args_t() { std::for_each(begin(), end(), deleter()); } -lua::args_t& lua::args_t::add(arg_t* arg) { +lua::args_t &lua::args_t::add(arg_t *arg) { push_back(arg); return *this; } -void lua::args_t::unpack(lua_State* L) { +void lua::args_t::unpack(lua_State *L) { for (size_t i = 0; i < size(); ++i) this->at(i)->unpack(L, static_cast(i + 1)); } -void lua::args_t::pack(lua_State* L) { +void lua::args_t::pack(lua_State *L) { for (args_t::const_iterator i = begin(); i != end(); ++i) (*i)->pack(L); } -lua::args_t* lua::args_t::clone() const { - lua::args_t* copy = new args_t(); +lua::args_t *lua::args_t::clone() const { + lua::args_t *copy = new args_t(); for (const_iterator i = begin(); i != end(); ++i) copy->push_back((*i)->clone()); return copy; } -lua::exception::exception(const std::string& msg) : msg_(msg), error_(msg) { +lua::exception::exception(const std::string &msg) : msg_(msg), error_(msg) { size_t i = msg.find("]:"); if (i == std::string::npos) { line_ = 0; } else { - std::sscanf(msg.c_str() + i + 2, "%d", &line_); // NOLINT + std::sscanf(msg.c_str() + i + 2, "%d", &line_); // NOLINT i = msg.rfind(": "); if (i != std::string::npos) error_ = msg.substr(i + 2); } } -void lua::exec(const std::string& script) { +void lua::exec(const std::string &script) { int error = luaL_dostring(L_, script.c_str()); if (error) throw lua::exception(lua_tostring(L_, -1)); diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/luascript.h b/libvisual-plugins/plugins/actor/lcdcontrol/luascript.h index d7accb37f..81f4db53d 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/luascript.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/luascript.h @@ -13,136 +13,132 @@ #include class lua { - public: +public: lua(); ~lua(); class arg_t { - public: + public: virtual ~arg_t() {} - virtual void unpack(lua_State* L, int nparam) = 0; - virtual void pack(lua_State* L) = 0; + virtual void unpack(lua_State *L, int nparam) = 0; + virtual void pack(lua_State *L) = 0; virtual std::string asString() = 0; - virtual arg_t* clone() const = 0; + virtual arg_t *clone() const = 0; }; - class bool_arg_t: public arg_t { - public: + class bool_arg_t : public arg_t { + public: typedef bool value_type; bool_arg_t() : value_(0) {} explicit bool_arg_t(bool value) : value_(value) {} - virtual arg_t* clone() const { return new bool_arg_t(value_); } - virtual void unpack(lua_State* L, int nparam); - virtual void pack(lua_State* L); + virtual arg_t *clone() const { return new bool_arg_t(value_); } + virtual void unpack(lua_State *L, int nparam); + virtual void pack(lua_State *L); std::string asString(); - bool& value() { return value_; } + bool &value() { return value_; } - private: + private: bool value_; }; - class int_arg_t: public arg_t { - public: + class int_arg_t : public arg_t { + public: typedef double value_type; int_arg_t() : value_(0) {} explicit int_arg_t(double value) : value_(value) {} - virtual arg_t* clone() const { return new int_arg_t(value_); } - virtual void unpack(lua_State* L, int nparam); - virtual void pack(lua_State* L); + virtual arg_t *clone() const { return new int_arg_t(value_); } + virtual void unpack(lua_State *L, int nparam); + virtual void pack(lua_State *L); std::string asString(); - double& value() { return value_; } + double &value() { return value_; } - private: + private: value_type value_; }; - class string_arg_t: public arg_t { - private: + class string_arg_t : public arg_t { + private: std::string value_; - public: + + public: typedef std::string value_type; string_arg_t() : value_() {} - explicit string_arg_t(const std::string& value) : value_(value) {} + explicit string_arg_t(const std::string &value) : value_(value) {} - virtual arg_t* clone() const { return new string_arg_t(value_); } - virtual void unpack(lua_State* L, int nparam); - virtual void pack(lua_State* L); + virtual arg_t *clone() const { return new string_arg_t(value_); } + virtual void unpack(lua_State *L, int nparam); + virtual void pack(lua_State *L); std::string asString(); - std::string& value() { return value_; } + std::string &value() { return value_; } }; - class args_t: public std::vector< arg_t* > { - public: + class args_t : public std::vector { + public: args_t() { clear(); } - args_t(const args_t& rhs); + args_t(const args_t &rhs); virtual ~args_t(); - args_t* clone() const; - void unpack(lua_State* L); - void pack(lua_State* L); - args_t& add(arg_t* arg); + args_t *clone() const; + void unpack(lua_State *L); + void pack(lua_State *L); + args_t &add(arg_t *arg); }; - template< class T > - static int lua_callback(lua_State* L); + template static int lua_callback(lua_State *L); class exception : public std::exception { - public: - explicit exception(const std::string& msg); + public: + explicit exception(const std::string &msg); virtual ~exception() throw() {} - const char* what() const throw() { return msg_.c_str(); } + const char *what() const throw() { return msg_.c_str(); } int line() const throw() { return line_; } - const std::string& error() const throw() { return error_; } - private: + const std::string &error() const throw() { return error_; } + + private: std::string msg_; int line_; std::string error_; }; - void exec(const std::string& script); + void exec(const std::string &script); - template< class T > - T get_variable(const std::string& name); + template T get_variable(const std::string &name); - template< class T > - void set_variable(const std::string& name, - const typename T::value_type& value); + template + void set_variable(const std::string &name, + const typename T::value_type &value); - template< class T > - void register_function(); + template void register_function(); class deleter { - public: - template void operator() (const T* p) const { - delete p; - } + public: + template void operator()(const T *p) const { delete p; } }; - protected: - lua(const lua&); - void operator=(const lua&); +protected: + lua(const lua &); + void operator=(const lua &); - private: - lua_State* L_; +private: + lua_State *L_; }; -template< class impl_t > -class lua_func_t { - public: - static const lua::args_t* in_args() { - static lua::args_t* args = 0; +template class lua_func_t { +public: + static const lua::args_t *in_args() { + static lua::args_t *args = 0; if (!args) args = const_cast(impl_t::in_args()); return args; } - static const lua::args_t* out_args() { - static lua::args_t* args = 0; + static const lua::args_t *out_args() { + static lua::args_t *args = 0; if (!args) args = const_cast(impl_t::out_args()); return args; @@ -151,13 +147,12 @@ class lua_func_t { static const std::string ns() { return impl_t::ns(); } static const std::string name() { return impl_t::name(); } - static void calc(const lua::args_t& in, lua::args_t& out) { + static void calc(const lua::args_t &in, lua::args_t &out) { impl_t::calc(in, out); } }; -template< class T > -int lua::lua_callback(lua_State* L) { +template int lua::lua_callback(lua_State *L) { int argc = lua_gettop(L); if (static_cast(lua_func_t::in_args()->size()) != argc) { @@ -177,23 +172,22 @@ int lua::lua_callback(lua_State* L) { return out_args->size(); } -template< class T > -void lua::register_function() { +template void lua::register_function() { if (lua_func_t::ns().length()) { exec(std::string("if ") + lua_func_t::ns() + " == nil then " + - lua_func_t::ns() + " = {}; " + lua_func_t::ns() + + " = {}; " "end"); - lua_register(L_, "dummy", lua_callback< lua_func_t >); - exec(lua_func_t::ns() + "." + - lua_func_t::name().c_str() + " = dummy; dummy = nil"); + lua_register(L_, "dummy", lua_callback>); + exec(lua_func_t::ns() + "." + lua_func_t::name().c_str() + + " = dummy; dummy = nil"); } else { lua_register(L_, lua_func_t::name().c_str(), - lua_callback< lua_func_t >); + lua_callback>); } } -template< class T > -T lua::get_variable(const std::string& name) { +template T lua::get_variable(const std::string &name) { lua_getglobal(L_, name.c_str()); T value; int index = lua_gettop(L_); @@ -202,9 +196,9 @@ T lua::get_variable(const std::string& name) { return value; } -template< class T > -void lua::set_variable(const std::string& name, - const typename T::value_type& value) { +template +void lua::set_variable(const std::string &name, + const typename T::value_type &value) { T var(value); var.pack(L_); lua_setglobal(L_, name.c_str()); diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/main.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/main.cpp index 7d45aaf59..9fff9c6ed 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/main.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/main.cpp @@ -8,10 +8,7 @@ using namespace LCD; class Main { - Main() - { - - } + Main() {} }; extern "C" { @@ -20,16 +17,17 @@ extern "C" { int main(int argc, char **argv) { lua *state = new lua(); - PluginUptime *uptime = new PluginUptime(state); - + PluginUptime *uptime = new PluginUptime(state); + std::string str = "return LCD.uptime('%d d %H:%M:%S')"; std::string val = "error"; try { - state->exec("function __wrap__() " + str + " end; __out__ = __wrap__()"); - val = state->get_variable("__out__").value(); + state->exec("function __wrap__() " + str + " end; __out__ = +__wrap__()"); val = state->get_variable("__out__").value(); } catch (lua::exception &e) { - std::cout << "Lua error: " << e.error() << " line: " << e.line() << "\n"; + std::cout << "Lua error: " << e.error() << " line: " << e.line() << +"\n"; } std::cout << val << "\n"; diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/old/DrvSDL.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/old/DrvSDL.cpp index 55664ac09..973103270 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/old/DrvSDL.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/old/DrvSDL.cpp @@ -27,282 +27,282 @@ using namespace std; using namespace LCD; // LCDGraphic RealBlit -void DrvSDLBlit(LCDGraphic *lcd, const int row, const int col, - const int height, const int width) { - ((DrvSDL *)lcd)->DrvBlit(row, col, height, width); +void DrvSDLBlit(LCDGraphic *lcd, const int row, const int col, const int height, + const int width) { + ((DrvSDL *)lcd)->DrvBlit(row, col, height, width); } - // Constructor -DrvSDL::DrvSDL(std::string name, LCDControl *v, - Json::Value *config, int layers) : - LCDCore(v, name, config, LCD_GRAPHIC, (LCDGraphic *)this), - LCDGraphic((LCDCore *)this), drvFB(0) { +DrvSDL::DrvSDL(std::string name, LCDControl *v, Json::Value *config, int layers) + : LCDCore(v, name, config, LCD_GRAPHIC, (LCDGraphic *)this), + LCDGraphic((LCDCore *)this), drvFB(0) { - GraphicRealBlit = DrvSDLBlit; + GraphicRealBlit = DrvSDLBlit; - Json::Value *val = CFG_Fetch(config, name + ".cols", new Json::Value(SCREEN_W)); - cols_ = val->asInt(); - delete val; + Json::Value *val = + CFG_Fetch(config, name + ".cols", new Json::Value(SCREEN_W)); + cols_ = val->asInt(); + delete val; - val = CFG_Fetch(config, name + ".rows", new Json::Value(SCREEN_H)); - rows_ = val->asInt(); - delete val; + val = CFG_Fetch(config, name + ".rows", new Json::Value(SCREEN_H)); + rows_ = val->asInt(); + delete val; - val = CFG_Fetch(config, name + ".update", new Json::Value(150)); - update_ = val->asInt(); - delete val; + val = CFG_Fetch(config, name + ".update", new Json::Value(150)); + update_ = val->asInt(); + delete val; - val = CFG_Fetch(config, name + ".fill", new Json::Value(0)); - fill_ = val->asInt(); - delete val; + val = CFG_Fetch(config, name + ".fill", new Json::Value(0)); + fill_ = val->asInt(); + delete val; - val = CFG_Fetch_Raw(config, name + ".pixels", new Json::Value("1x1")); - sscanf(val->asCString(), "%dx%d", &pixels.x, &pixels.y); - delete val; + val = CFG_Fetch_Raw(config, name + ".pixels", new Json::Value("1x1")); + sscanf(val->asCString(), "%dx%d", &pixels.x, &pixels.y); + delete val; - GraphicInit(rows_, cols_, 8, 7, layers); + GraphicInit(rows_, cols_, 8, 7, layers); - if(!(drvFB = (RGBA *)malloc(rows_ * pixels.y * cols_ * pixels.x * sizeof(RGBA)))) - LCDError("Could not allocate frame buffer for DrvSDL"); + if (!(drvFB = + (RGBA *)malloc(rows_ * pixels.y * cols_ * pixels.x * sizeof(RGBA)))) + LCDError("Could not allocate frame buffer for DrvSDL"); - wrapper_ = new SDLWrapper((SDLInterface *)this); + wrapper_ = new SDLWrapper((SDLInterface *)this); - update_thread_ = new SDLUpdateThread(this); + update_thread_ = new SDLUpdateThread(this); - //gif_thread_ = new SDLGifThread(this); + // gif_thread_ = new SDLGifThread(this); - if(SDL_Init(SDL_INIT_VIDEO) != 0) { - LCDError("DrvSDL: Unable to init SDL: %s", SDL_GetError()); - } + if (SDL_Init(SDL_INIT_VIDEO) != 0) { + LCDError("DrvSDL: Unable to init SDL: %s", SDL_GetError()); + } - surface_ = SDL_SetVideoMode(cols_ * pixels.x, rows_ * pixels.y, 32, - SDL_RESIZABLE); + surface_ = + SDL_SetVideoMode(cols_ * pixels.x, rows_ * pixels.y, 32, SDL_RESIZABLE); - SDL_WM_SetCaption("LCDControl", "LCDControl"); + SDL_WM_SetCaption("LCDControl", "LCDControl"); - if( surface_ == NULL) { - LCDError("DrvSDL: Unable to set %dx%d video: %s", cols_, rows_, SDL_GetError()); - } + if (surface_ == NULL) { + LCDError("DrvSDL: Unable to set %dx%d video: %s", cols_, rows_, + SDL_GetError()); + } -/* - sdl_timer_.setInterval(update_); - QObject::connect(&sdl_timer_, SIGNAL(timeout()), - wrapper_, SLOT(DrvUpdateSDL())); -*/ + /* + sdl_timer_.setInterval(update_); + QObject::connect(&sdl_timer_, SIGNAL(timeout()), + wrapper_, SLOT(DrvUpdateSDL())); + */ } // Destructor DrvSDL::~DrvSDL() { - update_thread_->wait(); - if(drvFB) {free(drvFB); drvFB = NULL;} - delete wrapper_; - delete update_thread_; - SDL_Quit(); - if(gif_file_ != "" && !image_.empty()) { - WriteGif(); - } + update_thread_->wait(); + if (drvFB) { + free(drvFB); + drvFB = NULL; + } + delete wrapper_; + delete update_thread_; + SDL_Quit(); + if (gif_file_ != "" && !image_.empty()) { + WriteGif(); + } } void DrvSDL::WriteGif() { - std::list gif; - - int num = 0; - for(std::list::iterator it = image_.begin(); it != image_.end(); it++) { - Magick::Image image; - image.magick("RGB"); - image.depth(32); - image.size(Magick::Geometry(cols_ * pixels.x, rows_ * pixels.y)); - Magick::PixelPacket *pixel_cache = image.getPixels(0, 0, cols_ * pixels.x, rows_ * pixels.y); - for(int n = 0; n < rows_ * pixels.y * cols_ * pixels.x; n++) { - int col = ((int *)(*it).data())[n]; - uint8_t *rgb = (uint8_t *) &col; - Magick::PixelPacket *gif_pixel = pixel_cache + n; - *gif_pixel = Magick::ColorRGB(rgb[0] / 256.0, rgb[1] / 256.0, rgb[2] / 256.0); - } - image.syncPixels(); - gif.push_back(image); - LCDInfo("Image %d", num++); + std::list gif; + + int num = 0; + for (std::list::iterator it = image_.begin(); + it != image_.end(); it++) { + Magick::Image image; + image.magick("RGB"); + image.depth(32); + image.size(Magick::Geometry(cols_ * pixels.x, rows_ * pixels.y)); + Magick::PixelPacket *pixel_cache = + image.getPixels(0, 0, cols_ * pixels.x, rows_ * pixels.y); + for (int n = 0; n < rows_ * pixels.y * cols_ * pixels.x; n++) { + int col = ((int *)(*it).data())[n]; + uint8_t *rgb = (uint8_t *)&col; + Magick::PixelPacket *gif_pixel = pixel_cache + n; + *gif_pixel = + Magick::ColorRGB(rgb[0] / 256.0, rgb[1] / 256.0, rgb[2] / 256.0); } - LCDInfo("Writing GIF image..."); - for_each(gif.begin(), gif.end(), Magick::animationDelayImage(ani_speed_ / 10)); - Magick::writeImages(gif.begin(), gif.end(), gif_file_); + image.syncPixels(); + gif.push_back(image); + LCDInfo("Image %d", num++); + } + LCDInfo("Writing GIF image..."); + for_each(gif.begin(), gif.end(), + Magick::animationDelayImage(ani_speed_ / 10)); + Magick::writeImages(gif.begin(), gif.end(), gif_file_); } void DrvSDL::DrvUpdateGif() { - if( SDL_MUSTLOCK(surface_)) - if(SDL_LockSurface(surface_) < 0) - return; + if (SDL_MUSTLOCK(surface_)) + if (SDL_LockSurface(surface_) < 0) + return; - image_.push_back(Magick::Blob(surface_->pixels, rows_ * pixels.y * surface_->pitch)); + image_.push_back( + Magick::Blob(surface_->pixels, rows_ * pixels.y * surface_->pitch)); - if(SDL_MUSTLOCK(surface_)) - SDL_UnlockSurface(surface_); + if (SDL_MUSTLOCK(surface_)) + SDL_UnlockSurface(surface_); } // Initialize device void DrvSDL::SetupDevice() { - if(update_ < 0) - return; - GraphicStart(); + if (update_ < 0) + return; + GraphicStart(); } // Deinit driver -void DrvSDL::TakeDown() { - Disconnect(); -} +void DrvSDL::TakeDown() { Disconnect(); } // Configuration setup -void DrvSDL::CFGSetup() { - LCDCore::CFGSetup(); -} +void DrvSDL::CFGSetup() { LCDCore::CFGSetup(); } // Connect -- generic method called from main code void DrvSDL::Connect() { - DrvClear(); - update_thread_->start(); - if(gif_file_ != "") - gif_timer_.start(); - sdl_timer_.start(); + DrvClear(); + update_thread_->start(); + if (gif_file_ != "") + gif_timer_.start(); + sdl_timer_.start(); } // Disconnect -- deinit -void DrvSDL::Disconnect() { -} +void DrvSDL::Disconnect() {} /*void DrvSDL::DrvUpdateSDL() { }*/ -void DrvSDL::UpdateThread() { -} +void DrvSDL::UpdateThread() {} void DrvSDL::DrvUpdateSDL() { - DrvUpdateImg(); - SDL_Flip(surface_); - SDL_Event event; - while(SDL_PollEvent(&event)) { - switch(event.type) { - case SDL_KEYDOWN: - switch(event.key.keysym.sym) { - case SDLK_UP: - emit static_cast(visitor_->GetWrapper())->_KeypadEvent(1); - break; - case SDLK_DOWN: - emit static_cast(visitor_->GetWrapper())->_KeypadEvent(2); - break; - case SDLK_TAB: - ToggleFullScreen(); - break; - case SDLK_ESCAPE: - if(IsFullScreen()) - ToggleFullScreen(); - else - goto quit; - break; - default: - break; - } - break; - case SDL_QUIT: - quit: - Disconnect(); - GetApp()->Stop(); - break; - case SDL_VIDEORESIZE: - LCDInfo("Resize %dx%d", event.resize.w, event.resize.h); - Resize(event.resize.h, event.resize.w); - break; - default: - break; - } - } + DrvUpdateImg(); + SDL_Flip(surface_); + SDL_Event event; + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_KEYDOWN: + switch (event.key.keysym.sym) { + case SDLK_UP: + emit static_cast(visitor_->GetWrapper())->_KeypadEvent(1); + break; + case SDLK_DOWN: + emit static_cast(visitor_->GetWrapper())->_KeypadEvent(2); + break; + case SDLK_TAB: + ToggleFullScreen(); + break; + case SDLK_ESCAPE: + if (IsFullScreen()) + ToggleFullScreen(); + else + goto quit; + break; + default: + break; + } + break; + case SDL_QUIT: + quit: + Disconnect(); + GetApp()->Stop(); + break; + case SDL_VIDEORESIZE: + LCDInfo("Resize %dx%d", event.resize.w, event.resize.h); + Resize(event.resize.h, event.resize.w); + break; + default: + break; + } + } } int DrvSDL::LockSDL() { - if( SDL_MUSTLOCK(surface_)) - return SDL_LockSurface(surface_) < 0; - return 0; + if (SDL_MUSTLOCK(surface_)) + return SDL_LockSurface(surface_) < 0; + return 0; } void DrvSDL::UnlockSDL() { - if(SDL_MUSTLOCK(surface_)) - SDL_UnlockSurface(surface_); + if (SDL_MUSTLOCK(surface_)) + SDL_UnlockSurface(surface_); } void DrvSDL::DrvUpdateImg() { - if(LockSDL() < 0) - return; - - for(int r = 0; r < rows_; r++) { - for(int c = 0; c < cols_; c++) { - SDL_Rect rect; - rect.y = r * pixels.y; - rect.x = c * pixels.x; - rect.h = pixels.y; - rect.w = pixels.x; - RGBA rgb = drvFB[r * cols_ + c]; - int col = (256 << 24) + (rgb.R << 16) + (rgb.G << 8) + rgb.B; - SDL_FillRect(surface_, &rect, col); - } + if (LockSDL() < 0) + return; + + for (int r = 0; r < rows_; r++) { + for (int c = 0; c < cols_; c++) { + SDL_Rect rect; + rect.y = r * pixels.y; + rect.x = c * pixels.x; + rect.h = pixels.y; + rect.w = pixels.x; + RGBA rgb = drvFB[r * cols_ + c]; + int col = (256 << 24) + (rgb.R << 16) + (rgb.G << 8) + rgb.B; + SDL_FillRect(surface_, &rect, col); } - - UnlockSDL(); + } + + UnlockSDL(); - SDL_UpdateRect(surface_, 0, 0, cols_ * pixels.x, rows_ * pixels.y); + SDL_UpdateRect(surface_, 0, 0, cols_ * pixels.x, rows_ * pixels.y); } // Driver-side blit method -void DrvSDL::DrvBlit(const int row, const int col, - const int height, const int width) { - mutex_.lock(); - for(int r = row; r < row + height; r++) { - for(int c = col; c < col + width; c++) { - drvFB[r * cols_ + c] = GraphicRGB(r, c); - } +void DrvSDL::DrvBlit(const int row, const int col, const int height, + const int width) { + mutex_.lock(); + for (int r = row; r < row + height; r++) { + for (int c = col; c < col + width; c++) { + drvFB[r * cols_ + c] = GraphicRGB(r, c); } - mutex_.unlock(); + } + mutex_.unlock(); } // Clear the LCD void DrvSDL::DrvClear() { - GraphicClear(); - if(fill_) - GraphicFill(); + GraphicClear(); + if (fill_) + GraphicFill(); } -int DrvSDL::IsFullScreen() { - return (surface_->flags & SDL_FULLSCREEN) > 0; -} +int DrvSDL::IsFullScreen() { return (surface_->flags & SDL_FULLSCREEN) > 0; } void DrvSDL::ToggleFullScreen() { - SDL_WM_ToggleFullScreen( surface_ ); - SDL_ShowCursor( IsFullScreen() ? SDL_DISABLE : SDL_ENABLE ); + SDL_WM_ToggleFullScreen(surface_); + SDL_ShowCursor(IsFullScreen() ? SDL_DISABLE : SDL_ENABLE); } void DrvSDL::Resize(const int rows, const int cols) { - mutex_.lock(); - RGBA *tmp = (RGBA *)realloc(drvFB, - rows * cols * sizeof(RGBA)); - if(!tmp) { - LCDError("DrvSDL: Unable to reallocate buffer"); - return; - } - drvFB = tmp; - emit static_cast(visitor_->GetWrapper())->_ResizeBefore(rows, cols); - LockSDL(); - SDL_FreeSurface(surface_); - surface_ = SDL_SetVideoMode(cols, rows, 32, SDL_RESIZABLE); - UnlockSDL(); - if(!surface_) { - LCDError("Unable to resize SDL surface"); - sdl_timer_.stop(); - } - rows_ = rows / pixels.y; - cols_ = cols / pixels.x; - if(visitor_->ResizeLCD(rows / pixels.y, cols / pixels.x) == 0) { - emit static_cast(visitor_->GetWrapper())->_ResizeAfter(); - } - mutex_.unlock(); + mutex_.lock(); + RGBA *tmp = (RGBA *)realloc(drvFB, rows * cols * sizeof(RGBA)); + if (!tmp) { + LCDError("DrvSDL: Unable to reallocate buffer"); + return; + } + drvFB = tmp; + emit static_cast(visitor_->GetWrapper()) + ->_ResizeBefore(rows, cols); + LockSDL(); + SDL_FreeSurface(surface_); + surface_ = SDL_SetVideoMode(cols, rows, 32, SDL_RESIZABLE); + UnlockSDL(); + if (!surface_) { + LCDError("Unable to resize SDL surface"); + sdl_timer_.stop(); + } + rows_ = rows / pixels.y; + cols_ = cols / pixels.x; + if (visitor_->ResizeLCD(rows / pixels.y, cols / pixels.x) == 0) { + emit static_cast(visitor_->GetWrapper())->_ResizeAfter(); + } + mutex_.unlock(); } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/old/DrvSDL.h b/libvisual-plugins/plugins/actor/lcdcontrol/old/DrvSDL.h index f5b33d316..ca6354ece 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/old/DrvSDL.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/old/DrvSDL.h @@ -9,7 +9,6 @@ #include #include - #include "LCDGraphic.h" #include "LCDCore.h" #include "LCDControl.h" @@ -23,58 +22,58 @@ namespace LCD { class SDLUpdateThread; -class DrvSDL : public LCDCore, public LCDGraphic, - public SDLInterface { - - SDL_Surface *surface_; - - SDLWrapper *wrapper_; - SDLUpdateThread *update_thread_; - RGBA *drvFB; - //std::vector drvFB; - -/* - QMutex mutex_; - QTimer gif_timer_; - QTimer sdl_timer_; -*/ - - std::list image_; - - bool connected_; - int update_; - int cols_; - int rows_; - std::string gif_file_; - int ani_speed_; - int fill_; - struct _pixels { int y; int x; } pixels; - timeval gif_last_update_; - - void DrvClear(); - void DrvUpdateImg(); - void DrvUpdate(); - - public: - DrvSDL(std::string name, LCDControl *v, - Json::Value *config, int layers); - ~DrvSDL(); - void SetupDevice(); - void TakeDown(); - void CFGSetup(); - void Connect(); - void Disconnect(); - void UpdateThread(); - void DrvUpdateGif(); - void DrvUpdateSDL(); - int LockSDL(); - void UnlockSDL(); - void WriteGif(); - int IsFullScreen(); - void ToggleFullScreen(); - void Resize(const int rows, const int cols); - void DrvBlit(const int row, const int col, const int height, const int width); - +class DrvSDL : public LCDCore, public LCDGraphic, public SDLInterface { + + SDL_Surface *surface_; + + SDLWrapper *wrapper_; + SDLUpdateThread *update_thread_; + RGBA *drvFB; + // std::vector drvFB; + + /* + QMutex mutex_; + QTimer gif_timer_; + QTimer sdl_timer_; + */ + + std::list image_; + + bool connected_; + int update_; + int cols_; + int rows_; + std::string gif_file_; + int ani_speed_; + int fill_; + struct _pixels { + int y; + int x; + } pixels; + timeval gif_last_update_; + + void DrvClear(); + void DrvUpdateImg(); + void DrvUpdate(); + +public: + DrvSDL(std::string name, LCDControl *v, Json::Value *config, int layers); + ~DrvSDL(); + void SetupDevice(); + void TakeDown(); + void CFGSetup(); + void Connect(); + void Disconnect(); + void UpdateThread(); + void DrvUpdateGif(); + void DrvUpdateSDL(); + int LockSDL(); + void UnlockSDL(); + void WriteGif(); + int IsFullScreen(); + void ToggleFullScreen(); + void Resize(const int rows, const int cols); + void DrvBlit(const int row, const int col, const int height, const int width); }; /* @@ -89,6 +88,6 @@ class SDLUpdateThread : public QThread { SDLUpdateThread(DrvSDL *v) { visitor_ = v; } }; */ -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/old/Main.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/old/Main.cpp index e8cb902c7..2f1c9f138 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/old/Main.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/old/Main.cpp @@ -25,28 +25,27 @@ #include "LCDControl.h" #include "debug.h" #include - + LCD::LCDControl *lcdControl; -void handler(int signal){ - LCDDebug("got signal %d", signal); - lcdControl->Stop(); +void handler(int signal) { + LCDDebug("got signal %d", signal); + lcdControl->Stop(); } - int main(int argc, char *argv[]) { - verbose_level = 3; - signal(SIGHUP, handler); - signal(SIGINT, handler); - signal(SIGQUIT, handler); - signal(SIGTERM, handler); - visual_init(&argc, &argv); - visual_log_set_verboseness(VISUAL_LOG_DEBUG); - QApplication *app = new QApplication(argc, argv); - lcdControl = new LCD::LCDControl(app); - int ret = lcdControl->Start(); - visual_quit(); - delete lcdControl; - delete app; - return ret; + verbose_level = 3; + signal(SIGHUP, handler); + signal(SIGINT, handler); + signal(SIGQUIT, handler); + signal(SIGTERM, handler); + visual_init(&argc, &argv); + visual_log_set_verboseness(VISUAL_LOG_DEBUG); + QApplication *app = new QApplication(argc, argv); + lcdControl = new LCD::LCDControl(app); + int ret = lcdControl->Start(); + visual_quit(); + delete lcdControl; + delete app; + return ret; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/old/WidgetGif.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/old/WidgetGif.cpp index f6312be1e..c30e7088b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/old/WidgetGif.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/old/WidgetGif.cpp @@ -32,286 +32,287 @@ using namespace LCD; extern void TextGifDraw(WidgetGif *w); extern void GraphicGifDraw(WidgetGif *w); -WidgetGif::WidgetGif(LCDCore *v, std::string name, Json::Value *config, - int row, int col, int layer) : Widget(v, name, config, row, col, layer, - WIDGET_TYPE_GIF | WIDGET_TYPE_SPECIAL | WIDGET_TYPE_RC) { - - if(lcd_type_ == LCD_TEXT) - Draw = TextGifDraw; - else if(lcd_type_ == LCD_GRAPHIC) - Draw = GraphicGifDraw; - else - Draw = NULL; - - update_ = NULL; - visible_ = NULL; - file_ = NULL; - bitmap_ = NULL; - - started_ = false; - has_chars_ = false; - - Json::Value *val; - val = v->CFG_Fetch(section_, "start", new Json::Value(0)); - int start = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "end", new Json::Value(-1)); - int end = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "xpoint", new Json::Value(0)); - xpoint_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "ypoint", new Json::Value(0)); - ypoint_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "width", new Json::Value(-1)); - cols_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "height", new Json::Value(-1)); - rows_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "layer", new Json::Value(0)); - layer_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "showbackground", new Json::Value(0)); - showbackground_ = val->asInt(); - delete val; - - val = v->CFG_Fetch(section_, "inverted", new Json::Value(0)); - inverted_ = val->asInt(); - delete val; - - update_ = new Property(v, section_, "update", new Json::Value("500")); - visible_ = new Property(v, section_, "visible", new Json::Value("1")); - - file_ = v->CFG_Fetch_Raw(section_, "file", new Json::Value("")); - - if( strcmp(file_->asCString(), "") == 0 ) { - LCDError("You must specify a GIF file: %s", name_.c_str()); - update_->SetValue(Json::Value(-1)); - return; - } +WidgetGif::WidgetGif(LCDCore *v, std::string name, Json::Value *config, int row, + int col, int layer) + : Widget(v, name, config, row, col, layer, + WIDGET_TYPE_GIF | WIDGET_TYPE_SPECIAL | WIDGET_TYPE_RC) { - Magick::readImages(&image_, file_->asString()); - Magick::coalesceImages(&image_, image_.begin(), image_.end()); + if (lcd_type_ == LCD_TEXT) + Draw = TextGifDraw; + else if (lcd_type_ == LCD_GRAPHIC) + Draw = GraphicGifDraw; + else + Draw = NULL; - if(inverted_) { - for_each(image_.begin(), image_.end(), Magick::negateImage()); - } + update_ = NULL; + visible_ = NULL; + file_ = NULL; + bitmap_ = NULL; - if(image_.size() == 0) { - LCDError("Gif: Image read failed <%s>", file_->asCString()); - update_ = new Property(v, section_, "", new Json::Value("-1")); - return; - } + started_ = false; + has_chars_ = false; - background_ = image_.begin()->backgroundColor(); + Json::Value *val; + val = v->CFG_Fetch(section_, "start", new Json::Value(0)); + int start = val->asInt(); + delete val; - has_transparent_ = false; + val = v->CFG_Fetch(section_, "end", new Json::Value(-1)); + int end = val->asInt(); + delete val; - if(image_.begin()->matte()) { - has_transparent_ = true; - transparent_ = image_.begin()->matteColor(); - } + val = v->CFG_Fetch(section_, "xpoint", new Json::Value(0)); + xpoint_ = val->asInt(); + delete val; - framePtr_ = image_.begin(); + val = v->CFG_Fetch(section_, "ypoint", new Json::Value(0)); + ypoint_ = val->asInt(); + delete val; - for(int i = 0; i < start && framePtr_ != image_.end(); i++) - framePtr_++; + val = v->CFG_Fetch(section_, "width", new Json::Value(-1)); + cols_ = val->asInt(); + delete val; - start_ = framePtr_; + val = v->CFG_Fetch(section_, "height", new Json::Value(-1)); + rows_ = val->asInt(); + delete val; - if( end < 0 ) - end_ = image_.end(); - else { - for(int i = start; i < end && framePtr_ != image_.end(); i++) - framePtr_++; - end_ = framePtr_; - } + val = v->CFG_Fetch(section_, "layer", new Json::Value(0)); + layer_ = val->asInt(); + delete val; - framePtr_ = start_; + val = v->CFG_Fetch(section_, "showbackground", new Json::Value(0)); + showbackground_ = val->asInt(); + delete val; + val = v->CFG_Fetch(section_, "inverted", new Json::Value(0)); + inverted_ = val->asInt(); + delete val; - if( rows_ == -1 ) { - rows_ = image_.begin()->rows(); - } + update_ = new Property(v, section_, "update", new Json::Value("500")); + visible_ = new Property(v, section_, "visible", new Json::Value("1")); - if( cols_ == -1 ) { - cols_ = image_.begin()->columns(); - } + file_ = v->CFG_Fetch_Raw(section_, "file", new Json::Value("")); - for(int row = 0; row < rows_; row++) { - for(int col = 0; col < cols_; col++) { - Magick::Color pixel = (++image_.begin())->pixelColor(col, row); - } - } + if (strcmp(file_->asCString(), "") == 0) { + LCDError("You must specify a GIF file: %s", name_.c_str()); + update_->SetValue(Json::Value(-1)); + return; + } - bitmap_ = new RGBA[cols_ * rows_]; + Magick::readImages(&image_, file_->asString()); + Magick::coalesceImages(&image_, image_.begin(), image_.end()); - cols_ = cols_ / v->GetLCD()->XRES; - rows_ = rows_ / v->GetLCD()->YRES; + if (inverted_) { + for_each(image_.begin(), image_.end(), Magick::negateImage()); + } -#define min(a, b) (ab?a:b) + if (image_.size() == 0) { + LCDError("Gif: Image read failed <%s>", file_->asCString()); + update_ = new Property(v, section_, "", new Json::Value("-1")); + return; + } - if(col_ + cols_ > v->GetLCD()->LCOLS) { - int diff = (col_ + cols_) - v->GetLCD()->LCOLS; - if((cols_-=diff) < 0) cols_ = 0; - } - if(row_ + rows_ > v->GetLCD()->LROWS) { - int diff = (row_ + rows_) - v->GetLCD()->LROWS; - if((rows_-=diff) < 0) rows_ = 0; - } + background_ = image_.begin()->backgroundColor(); - x2_ = col_ + cols_; - y2_ = row_ + rows_; + has_transparent_ = false; -/* - timer_ = new QTimer(); - timer_->setSingleShot(false); - timer_->setInterval(update_->P2INT()); - QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); + if (image_.begin()->matte()) { + has_transparent_ = true; + transparent_ = image_.begin()->matteColor(); + } - QObject::connect(visitor_->GetWrapper(), SIGNAL(_ResizeLCD(int, int, int, int)), - this, SLOT(Resize(int, int, int, int))); -*/ -} + framePtr_ = image_.begin(); + + for (int i = 0; i < start && framePtr_ != image_.end(); i++) + framePtr_++; + + start_ = framePtr_; + + if (end < 0) + end_ = image_.end(); + else { + for (int i = start; i < end && framePtr_ != image_.end(); i++) + framePtr_++; + end_ = framePtr_; + } + framePtr_ = start_; + + if (rows_ == -1) { + rows_ = image_.begin()->rows(); + } + + if (cols_ == -1) { + cols_ = image_.begin()->columns(); + } + + for (int row = 0; row < rows_; row++) { + for (int col = 0; col < cols_; col++) { + Magick::Color pixel = (++image_.begin())->pixelColor(col, row); + } + } + + bitmap_ = new RGBA[cols_ * rows_]; + + cols_ = cols_ / v->GetLCD()->XRES; + rows_ = rows_ / v->GetLCD()->YRES; + +#define min(a, b) (a < b ? a : b) +#define max(a, b) (a > b ? a : b) + + if (col_ + cols_ > v->GetLCD()->LCOLS) { + int diff = (col_ + cols_) - v->GetLCD()->LCOLS; + if ((cols_ -= diff) < 0) + cols_ = 0; + } + if (row_ + rows_ > v->GetLCD()->LROWS) { + int diff = (row_ + rows_) - v->GetLCD()->LROWS; + if ((rows_ -= diff) < 0) + rows_ = 0; + } + + x2_ = col_ + cols_; + y2_ = row_ + rows_; + + /* + timer_ = new QTimer(); + timer_->setSingleShot(false); + timer_->setInterval(update_->P2INT()); + QObject::connect(timer_, SIGNAL(timeout()), this, SLOT(Update())); + + QObject::connect(visitor_->GetWrapper(), SIGNAL(_ResizeLCD(int, int, int, + int)), this, SLOT(Resize(int, int, int, int))); + */ +} WidgetGif::~WidgetGif() { - Stop(); - if(update_) delete update_; - if(visible_) delete visible_; - if(bitmap_) delete []bitmap_; - if(timer_) delete timer_; - if(file_) delete file_; + Stop(); + if (update_) + delete update_; + if (visible_) + delete visible_; + if (bitmap_) + delete[] bitmap_; + if (timer_) + delete timer_; + if (file_) + delete file_; } void WidgetGif::Resize(int rows, int cols, int old_rows, int old_cols) { - int yres = visitor_->GetLCD()->YRES; - int xres = visitor_->GetLCD()->XRES; - float r = row_ * yres / (float)old_rows; - float c = col_ * xres / (float)old_cols; - row_ = round(rows * r / yres); - col_ = round(cols * c / xres); - Update(); + int yres = visitor_->GetLCD()->YRES; + int xres = visitor_->GetLCD()->XRES; + float r = row_ * yres / (float)old_rows; + float c = col_ * xres / (float)old_cols; + row_ = round(rows * r / yres); + col_ = round(cols * c / xres); + Update(); } void WidgetGif::Update() { - if(update_->P2INT() < 0) - return; - - int xres = visitor_->GetLCD()->XRES; - int yres = visitor_->GetLCD()->YRES; - - int cols = cols_ * xres; - int rows = rows_ * yres; - - memset(bitmap_, 0, cols * rows * sizeof(RGBA)); - - visible_->Eval(); - - for(int row = ypoint_; row + ypoint_ < rows; - row++ ) { - for(int col = xpoint_; col + xpoint_ < cols; - col++ ) { - if(visible_->P2INT()) { - Magick::Color pixel = framePtr_->pixelColor(col, row); -//LCDError("pixel %d %d %d", pixel.redQuantum() / 256, pixel.greenQuantum() / 256, pixel.blueQuantum() / 256); - if(showbackground_ == 0 && pixel == background_) { - continue; - } - bitmap_[row * cols + col].R = pixel.redQuantum() / 256; - bitmap_[row * cols + col].G = pixel.greenQuantum() / 256; - bitmap_[row * cols + col].B = pixel.blueQuantum() / 256; - if(!has_transparent_ || pixel != transparent_) - bitmap_[row * cols + col].A = 255; - } + if (update_->P2INT() < 0) + return; + + int xres = visitor_->GetLCD()->XRES; + int yres = visitor_->GetLCD()->YRES; + + int cols = cols_ * xres; + int rows = rows_ * yres; + + memset(bitmap_, 0, cols * rows * sizeof(RGBA)); + + visible_->Eval(); + + for (int row = ypoint_; row + ypoint_ < rows; row++) { + for (int col = xpoint_; col + xpoint_ < cols; col++) { + if (visible_->P2INT()) { + Magick::Color pixel = framePtr_->pixelColor(col, row); + // LCDError("pixel %d %d %d", pixel.redQuantum() / 256, + // pixel.greenQuantum() / 256, pixel.blueQuantum() / 256); + if (showbackground_ == 0 && pixel == background_) { + continue; } + bitmap_[row * cols + col].R = pixel.redQuantum() / 256; + bitmap_[row * cols + col].G = pixel.greenQuantum() / 256; + bitmap_[row * cols + col].B = pixel.blueQuantum() / 256; + if (!has_transparent_ || pixel != transparent_) + bitmap_[row * cols + col].A = 255; + } } + } - - if(++framePtr_ == end_) - framePtr_ = start_; - - if(Draw) - Draw(this); - else - LCDError("WidgetGif: No draw method."); + if (++framePtr_ == end_) + framePtr_ = start_; + if (Draw) + Draw(this); + else + LCDError("WidgetGif: No draw method."); } void WidgetGif::Start() { - if(update_->P2INT() < 0) - return; - std::map widgets; - widgets = visitor_->GetWidgets(); - for(std::map::iterator it = - widgets.begin(); - it != widgets.end(); it++) { - if(it->second->GetWidgetBase() == widget_base_ && - it->second->GetLayoutBase() == layout_base_ && - it->second->GetStarted()) { - started_ = true; - break; - } - } - if(!started_) { - timer_->start(); - started_ = true; + if (update_->P2INT() < 0) + return; + std::map widgets; + widgets = visitor_->GetWidgets(); + for (std::map::iterator it = widgets.begin(); + it != widgets.end(); it++) { + if (it->second->GetWidgetBase() == widget_base_ && + it->second->GetLayoutBase() == layout_base_ && + it->second->GetStarted()) { + started_ = true; + break; } - Update(); + } + if (!started_) { + timer_->start(); + started_ = true; + } + Update(); } void WidgetGif::Stop() { - timer_->stop(); - started_ = false; - has_chars_ = false; - ch_.clear(); + timer_->stop(); + started_ = false; + has_chars_ = false; + ch_.clear(); } void WidgetGif::SetupChars() { - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - ch_.resize(rows_ * cols_); - std::map widgets1; - std::map widgets2; - widgets1 = visitor_->GetWidgets(); - widgets2 = visitor_->GetWidgets(); - for(std::map::iterator ii=widgets1.begin(); - ii != widgets1.end(); ii++) { - if(ii->second->GetWidgetBase() == widget_base_ && - ((WidgetGif *)ii->second)->HasChars()) { - for(int i = 0; i < rows_ * cols_; i++ ) { - if(i >= (int)lcd->CHARS) { - LCDError("1) GIF too large: %s, %d", name_.c_str(), - lcd->CHARS); - if(update_) delete update_; - update_ = new Property(visitor_, section_, "", - new Json::Value("-1")); - return; - } - ch_[i] = ((WidgetGif *)widgets2[ii->first])->GetChars()[i]; - } - return; + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + ch_.resize(rows_ * cols_); + std::map widgets1; + std::map widgets2; + widgets1 = visitor_->GetWidgets(); + widgets2 = visitor_->GetWidgets(); + for (std::map::iterator ii = widgets1.begin(); + ii != widgets1.end(); ii++) { + if (ii->second->GetWidgetBase() == widget_base_ && + ((WidgetGif *)ii->second)->HasChars()) { + for (int i = 0; i < rows_ * cols_; i++) { + if (i >= (int)lcd->CHARS) { + LCDError("1) GIF too large: %s, %d", name_.c_str(), lcd->CHARS); + if (update_) + delete update_; + update_ = new Property(visitor_, section_, "", new Json::Value("-1")); + return; } + ch_[i] = ((WidgetGif *)widgets2[ii->first])->GetChars()[i]; + } + return; } - for(int i = 0; i < rows_ * cols_; i++) { - if( (int)lcd->special_chars.size() >= lcd->CHARS ) { - LCDError("2) GIF too large: %s", name_.c_str()); - if( update_) delete update_; - update_ = new Property(visitor_, section_, "", - new Json::Value("-1")); - return; - } - lcd->special_chars.push_back(SpecialChar(lcd->YRES)); - ch_[i] = lcd->special_chars.size() - 1; + } + for (int i = 0; i < rows_ * cols_; i++) { + if ((int)lcd->special_chars.size() >= lcd->CHARS) { + LCDError("2) GIF too large: %s", name_.c_str()); + if (update_) + delete update_; + update_ = new Property(visitor_, section_, "", new Json::Value("-1")); + return; } - has_chars_ = true; + lcd->special_chars.push_back(SpecialChar(lcd->YRES)); + ch_[i] = lcd->special_chars.size() - 1; + } + has_chars_ = true; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/old/WidgetGif.h b/libvisual-plugins/plugins/actor/lcdcontrol/old/WidgetGif.h index 1be20821e..c1b7e1907 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/old/WidgetGif.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/old/WidgetGif.h @@ -38,53 +38,52 @@ class LCDGraphic; class LCDCore; class WidgetGif : public Widget { - Property *update_; /* update interval (msec) */ - Property *visible_; - Json::Value *file_; - int xpoint_; - int ypoint_; - //int *ascii_; - Magick::Color transparent_; - Magick::Color background_; - bool has_transparent_; - int showbackground_; - int inverted_; - bool has_chars_; - std::vector ch_; - RGBA *bitmap_; - std::list image_; - std::list::iterator framePtr_; - std::list::iterator start_; - std::list::iterator end_; - void (*Draw)(WidgetGif *w); + Property *update_; /* update interval (msec) */ + Property *visible_; + Json::Value *file_; + int xpoint_; + int ypoint_; + // int *ascii_; + Magick::Color transparent_; + Magick::Color background_; + bool has_transparent_; + int showbackground_; + int inverted_; + bool has_chars_; + std::vector ch_; + RGBA *bitmap_; + std::list image_; + std::list::iterator framePtr_; + std::list::iterator start_; + std::list::iterator end_; + void (*Draw)(WidgetGif *w); - public: - WidgetGif(LCDCore *visitor, std::string name, Json::Value *section, - int row, int col, int layer); - ~WidgetGif(); - void Start(); - void Stop(); - void SetupChars(); - bool HasChars() { return has_chars_; }; - RGBA *Bitmap() { return bitmap_; }; - std::vector GetChars() { return ch_; }; - int GetXpoint() { return xpoint_; }; - int GetYpoint() { return ypoint_; }; - int GetInverted() { return inverted_; } - Magick::Color GetBackground() { return background_; }; - Magick::Color GetTransparent() { return transparent_; }; - RGBA *GetBitmap() { return bitmap_; }; - Property *GetVisible() { return visible_; } +public: + WidgetGif(LCDCore *visitor, std::string name, Json::Value *section, int row, + int col, int layer); + ~WidgetGif(); + void Start(); + void Stop(); + void SetupChars(); + bool HasChars() { return has_chars_; }; + RGBA *Bitmap() { return bitmap_; }; + std::vector GetChars() { return ch_; }; + int GetXpoint() { return xpoint_; }; + int GetYpoint() { return ypoint_; }; + int GetInverted() { return inverted_; } + Magick::Color GetBackground() { return background_; }; + Magick::Color GetTransparent() { return transparent_; }; + RGBA *GetBitmap() { return bitmap_; }; + Property *GetVisible() { return visible_; } - // Slots - void Update(); - void TextScroll() {} - - public slots: - void Resize(int rows, int cols, int old_rows, int old_cols); -}; + // Slots + void Update(); + void TextScroll() {} -}; // End namespace +public slots: + void Resize(int rows, int cols, int old_rows, int old_cols); +}; +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginExec.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginExec.cpp index bcd41bda7..4cbf1853f 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginExec.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginExec.cpp @@ -35,75 +35,72 @@ // CRC borrowed from LCD4Linux #define CRCPOLY 0x8408 -static unsigned short CRC(const char *s) -{ - int i; - unsigned short crc; - - /* seed value */ - crc = 0xffff; - - while (*s != '\0') { - crc ^= *s++; - for (i = 0; i < 8; i++) - crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY : 0); - } - return crc; +static unsigned short CRC(const char *s) { + int i; + unsigned short crc; + + /* seed value */ + crc = 0xffff; + + while (*s != '\0') { + crc ^= *s++; + for (i = 0; i < 8; i++) + crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY : 0); + } + return crc; } using namespace LCD; int PluginExec::DoExec(char *cmd, char *key, int delay) { - - int age = hash_age(&hash_, key); - if(age < 0) { - hash_put(&hash_, key, ""); + int age = hash_age(&hash_, key); - if(delay < 10) - delay = 10; + if (age < 0) { + hash_put(&hash_, key, ""); - //threads_.push_back(new PluginExecThread(cmd, key, delay)); - return 0; - } + if (delay < 10) + delay = 10; - if(age < 10) - return 0; + // threads_.push_back(new PluginExecThread(cmd, key, delay)); + return 0; + } -/* - for(std::list::iterator it = threads_.begin(); - it != threads_.end(); it++) { - if(strcmp(key, (*it)->GetKey()) == 0) { - (*it)->GetMutex().lock(); - hash_put(&hash_, key, (*it)->GetRet()); - (*it)->GetMutex().unlock(); - return 0; - } - } -*/ + if (age < 10) + return 0; - LCDError("internal error: could not find thread exec-%s", key); - return -1; + /* + for(std::list::iterator it = threads_.begin(); + it != threads_.end(); it++) { + if(strcmp(key, (*it)->GetKey()) == 0) { + (*it)->GetMutex().lock(); + hash_put(&hash_, key, (*it)->GetRet()); + (*it)->GetMutex().unlock(); + return 0; + } + } + */ + + LCDError("internal error: could not find thread exec-%s", key); + return -1; } -std::string PluginExec::Exec(std::string arg1, int delay) -{ - const char *cmd; - char key[5], *val; +std::string PluginExec::Exec(std::string arg1, int delay) { + const char *cmd; + char key[5], *val; - cmd = arg1.c_str(); + cmd = arg1.c_str(); - qprintf(key, sizeof(key), "%x", CRC(cmd)); + qprintf(key, sizeof(key), "%x", CRC(cmd)); - if(DoExec((char *)cmd, key, delay) < 0) { - return ""; - } + if (DoExec((char *)cmd, key, delay) < 0) { + return ""; + } - val = hash_get(&hash_, key, NULL); - return val ? val : ""; + val = hash_get(&hash_, key, NULL); + return val ? val : ""; } - /* void PluginExecThread::run() { running_ = true; @@ -117,13 +114,11 @@ void PluginExecThread::run() { pipe = popen(cmd_, "r"); if(pipe == NULL) { - LCDError("exec error: could not run pipe '%s': %s", cmd_, strerror(errno)); - len = 0; - } else { - len = fread(buffer, 1, MEM_SIZE - 1, pipe); + LCDError("exec error: could not run pipe '%s': %s", cmd_, +strerror(errno)); len = 0; } else { len = fread(buffer, 1, MEM_SIZE - 1, pipe); if(len <= 0) { - LCDError("exec error: could not read from pipe '%s': %s", cmd_, strerror(errno)); - len = 0; + LCDError("exec error: could not read from pipe '%s': %s", cmd_, +strerror(errno)); len = 0; } pclose(pipe); } @@ -144,20 +139,19 @@ void PluginExecThread::run() { */ void PluginExec::Connect(Evaluator *visitor) { -/* - QScriptEngine *engine = visitor->GetEngine(); - QScriptValue val = engine->newObject(); - QScriptValue objVal = engine->newQObject(val, this); - engine->globalObject().setProperty("exec", objVal); -*/ + /* + QScriptEngine *engine = visitor->GetEngine(); + QScriptValue val = engine->newObject(); + QScriptValue objVal = engine->newQObject(val, this); + engine->globalObject().setProperty("exec", objVal); + */ } void PluginExec::Disconnect() { -/* - for(std::list::iterator it = threads_.begin(); - it != threads_.end(); it++) { - (*it)->Stop(); - } -*/ + /* + for(std::list::iterator it = threads_.begin(); + it != threads_.end(); it++) { + (*it)->Stop(); + } + */ } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginExec.h b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginExec.h index 94595dbf7..135852ff5 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginExec.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginExec.h @@ -36,18 +36,20 @@ class Evaluator; class PluginExecThread; class PluginExec { - HASH hash_; - //std::list threads_; - int DoExec(char *cmd, char *key, int delay); - - public: - PluginExec() { hash_create(&hash_); } - ~PluginExec() { Disconnect(); hash_destroy(&hash_); } - void Connect(Evaluator *visitor); - void Disconnect(); - - std::string Exec(std::string arg1, int timeout); - + HASH hash_; + // std::list threads_; + int DoExec(char *cmd, char *key, int delay); + +public: + PluginExec() { hash_create(&hash_); } + ~PluginExec() { + Disconnect(); + hash_destroy(&hash_); + } + void Connect(Evaluator *visitor); + void Disconnect(); + + std::string Exec(std::string arg1, int timeout); }; #define MEM_SIZE 4096 @@ -64,7 +66,7 @@ class PluginExecThread { void run(); public: - PluginExecThread(char *cmd, char *key, int delay) { + PluginExecThread(char *cmd, char *key, int delay) { storage_.setLocalData(new char[MEM_SIZE]); cmd_ = strdup(cmd); key_ = strdup(key); @@ -77,14 +79,14 @@ class PluginExecThread { } void Stop() { running_ = false; } char *GetKey() { return key_; } - char *GetRet() { - if(!storage_.hasLocalData()) - return NULL; + char *GetRet() { + if(!storage_.hasLocalData()) + return NULL; return storage_.localData(); } }; */ -}; +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginFile.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginFile.cpp index 5e8693510..f77f6405b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginFile.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginFile.cpp @@ -38,43 +38,43 @@ using namespace LCD; /* returns text of that line */ std::string PluginFile::Readline(std::string arg1, int arg2) { - char value[80], val2[80]; - FILE *fp; - int reqline, i, size; + char value[80], val2[80]; + FILE *fp; + int reqline, i, size; - reqline = arg2; - fp = fopen(arg1.c_str(), "r"); - if (!fp) { - LCDError("readline couldn't open file '%s'", arg1.c_str()); - value[0] = '\0'; - } else { - i = 0; - while (!feof(fp) && i++ < reqline) { - fgets(val2, sizeof(val2), fp); - size = strcspn(val2, "\r\n"); - strncpy(value, val2, size); - value[size] = '\0'; - /* more than 80 chars, chew up rest of line */ - while (!feof(fp) && strchr(val2, '\n') == NULL) { - fgets(val2, sizeof(val2), fp); - } - } - fclose(fp); - if (i <= reqline) { - LCDError("readline requested line %d but file only had %d lines", reqline, i - 1); - value[0] = '\0'; - } + reqline = arg2; + fp = fopen(arg1.c_str(), "r"); + if (!fp) { + LCDError("readline couldn't open file '%s'", arg1.c_str()); + value[0] = '\0'; + } else { + i = 0; + while (!feof(fp) && i++ < reqline) { + fgets(val2, sizeof(val2), fp); + size = strcspn(val2, "\r\n"); + strncpy(value, val2, size); + value[size] = '\0'; + /* more than 80 chars, chew up rest of line */ + while (!feof(fp) && strchr(val2, '\n') == NULL) { + fgets(val2, sizeof(val2), fp); + } } + fclose(fp); + if (i <= reqline) { + LCDError("readline requested line %d but file only had %d lines", reqline, + i - 1); + value[0] = '\0'; + } + } - return value; + return value; } void PluginFile::Connect(Evaluator *visitor) { -/* - QScriptEngine *engine = visitor->GetEngine(); - QScriptValue val = engine->newObject(); - QScriptValue objVal = engine->newQObject(val, this); - engine->globalObject().setProperty("file", objVal); -*/ + /* + QScriptEngine *engine = visitor->GetEngine(); + QScriptValue val = engine->newObject(); + QScriptValue objVal = engine->newQObject(val, this); + engine->globalObject().setProperty("file", objVal); + */ } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginFile.h b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginFile.h index 1d692860c..06a7dd8a1 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginFile.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginFile.h @@ -32,11 +32,11 @@ class Evaluator; class PluginFile { - void Connect(Evaluator *visitor); - void Disconnect() {} + void Connect(Evaluator *visitor); + void Disconnect() {} - std::string Readline(std::string arg1, int arg2); + std::string Readline(std::string arg1, int arg2); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginLCD.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginLCD.cpp index 71863a4c9..f41ff797b 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginLCD.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginLCD.cpp @@ -34,168 +34,158 @@ using namespace LCD; using namespace std; void PluginLCD::TickUpdate() { - //emit _TickUpdate(); + // emit _TickUpdate(); } -void PluginLCD::Transition(int i) { - visitor_->Transition(i); -} +void PluginLCD::Transition(int i) { visitor_->Transition(i); } void PluginLCD::SelectLayout(string layout) { - if(type_ == LCD_TEXT) - visitor_->SelectLayout(layout); - else if(type_ == LCD_GRAPHIC) - visitor_->SelectLayout(layout); + if (type_ == LCD_TEXT) + visitor_->SelectLayout(layout); + else if (type_ == LCD_GRAPHIC) + visitor_->SelectLayout(layout); } int PluginLCD::RemoveWidget(string widget) { - return visitor_->RemoveWidget(widget); + return visitor_->RemoveWidget(widget); } -string PluginLCD::AddWidget(string layout, - int row, int col, int layer, string object) { - return string(visitor_->AddWidget(layout, row, col, - layer, object).c_str()); +string PluginLCD::AddWidget(string layout, int row, int col, int layer, + string object) { + return string(visitor_->AddWidget(layout, row, col, layer, object).c_str()); } int PluginLCD::MoveWidget(string widget, int rows, int cols) { - return visitor_->MoveWidget(widget, rows, cols); + return visitor_->MoveWidget(widget, rows, cols); } int PluginLCD::ResizeLCD(int rows, int cols) { - return visitor_->ResizeLCD(rows, cols); -} - -void PluginLCD::SendData(int row, int col, - int layer, string val) { -/* - QByteArray data = val.toAscii(); - if(type_ == LCD_TEXT) { - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - if(layer >= lcd->LAYERS) { - LCDError("PluginLCD::SendData: Invalid layer"); - return; - } - unsigned char *FB = lcd->LayoutFB[layer]; - int cols = lcd->LCOLS; - int rows = lcd->LROWS; - if( row >= rows ) - return; - for(int i = 0; i < (int)data.size() && - i + col < cols; i++) { - FB[row * cols + col + i] = data[i]; - } - lcd->TextBlit(row, col, 1, data.size()); - } else if(type_ == LCD_GRAPHIC) { - LCDGraphic *lcd = (LCDGraphic *)visitor_->GetLCD(); - RGBA fg_(0, 0, 0); - RGBA bg_(255, 255, 255); - row*=lcd->YRES; - col*=lcd->XRES; - if(layer >= lcd->LAYERS) { - LCDError("PluginLCD::SendData: Invalid layer"); - return; - } - lcd->GraphicRender(layer, row, col, fg_, bg_, val.c_str(), 0, 0, GetCurrentLayout().c_str()); - lcd->GraphicBlit(0, 0, lcd->LROWS, lcd->LCOLS); - } -*/ + return visitor_->ResizeLCD(rows, cols); +} + +void PluginLCD::SendData(int row, int col, int layer, string val) { + /* + QByteArray data = val.toAscii(); + if(type_ == LCD_TEXT) { + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + if(layer >= lcd->LAYERS) { + LCDError("PluginLCD::SendData: Invalid layer"); + return; + } + unsigned char *FB = lcd->LayoutFB[layer]; + int cols = lcd->LCOLS; + int rows = lcd->LROWS; + if( row >= rows ) + return; + for(int i = 0; i < (int)data.size() && + i + col < cols; i++) { + FB[row * cols + col + i] = data[i]; + } + lcd->TextBlit(row, col, 1, data.size()); + } else if(type_ == LCD_GRAPHIC) { + LCDGraphic *lcd = (LCDGraphic *)visitor_->GetLCD(); + RGBA fg_(0, 0, 0); + RGBA bg_(255, 255, 255); + row*=lcd->YRES; + col*=lcd->XRES; + if(layer >= lcd->LAYERS) { + LCDError("PluginLCD::SendData: Invalid layer"); + return; + } + lcd->GraphicRender(layer, row, col, fg_, bg_, val.c_str(), 0, 0, + GetCurrentLayout().c_str()); lcd->GraphicBlit(0, 0, lcd->LROWS, + lcd->LCOLS); + } + */ } void PluginLCD::SetSpecialChar(int ch, SpecialChar matrix) { - if(type_ == LCD_TEXT) { - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - lcd->special_chars[ch] = matrix; - lcd->TextSpecialCharChanged(ch); - } + if (type_ == LCD_TEXT) { + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + lcd->special_chars[ch] = matrix; + lcd->TextSpecialCharChanged(ch); + } } void PluginLCD::AddSpecialChar(SpecialChar matrix) { - if(type_ == LCD_TEXT) { - LCDText *lcd = (LCDText *)visitor_->GetLCD(); - int size = lcd->special_chars.size(); - if(size < lcd->CHARS) { - lcd->special_chars.push_back( - SpecialChar(matrix.Size())); - SetSpecialChar(size, matrix); - } + if (type_ == LCD_TEXT) { + LCDText *lcd = (LCDText *)visitor_->GetLCD(); + int size = lcd->special_chars.size(); + if (size < lcd->CHARS) { + lcd->special_chars.push_back(SpecialChar(matrix.Size())); + SetSpecialChar(size, matrix); } + } } void PluginLCD::Clear() { - if(type_ == LCD_TEXT) - ((LCDText *)visitor_->GetLCD())->TextClear(); - else if(type_ == LCD_GRAPHIC) - ((LCDGraphic *)visitor_->GetLCD())->GraphicClear(); + if (type_ == LCD_TEXT) + ((LCDText *)visitor_->GetLCD())->TextClear(); + else if (type_ == LCD_GRAPHIC) + ((LCDGraphic *)visitor_->GetLCD())->GraphicClear(); } void PluginLCD::ClearChars() { - if(type_ == LCD_TEXT) - ((LCDText *)visitor_->GetLCD())->TextClearChars(); + if (type_ == LCD_TEXT) + ((LCDText *)visitor_->GetLCD())->TextClearChars(); } string PluginLCD::GetCurrentLayout() { - return visitor_->GetCurrentLayout().c_str(); + return visitor_->GetCurrentLayout().c_str(); } int PluginLCD::GetRows() { - if (type_ == LCD_TEXT) { - return visitor_->GetLCD()->DROWS; - } else { - return visitor_->GetLCD()->LROWS / visitor_->GetLCD()->YRES; - } + if (type_ == LCD_TEXT) { + return visitor_->GetLCD()->DROWS; + } else { + return visitor_->GetLCD()->LROWS / visitor_->GetLCD()->YRES; + } } int PluginLCD::GetCols() { - if (type_ == LCD_TEXT) { - return visitor_->GetLCD()->DCOLS; - } else { - return visitor_->GetLCD()->LCOLS / visitor_->GetLCD()->XRES; - } + if (type_ == LCD_TEXT) { + return visitor_->GetLCD()->DCOLS; + } else { + return visitor_->GetLCD()->LCOLS / visitor_->GetLCD()->XRES; + } } -int PluginLCD::GetXres() { - return visitor_->GetLCD()->XRES; -} +int PluginLCD::GetXres() { return visitor_->GetLCD()->XRES; } -int PluginLCD::GetYres() { - return visitor_->GetLCD()->YRES; -} +int PluginLCD::GetYres() { return visitor_->GetLCD()->YRES; } string PluginLCD::GetType() { - if ( type_ == LCD_TEXT ) { - return "text"; - } else if (type_ == LCD_GRAPHIC) { - return "graphic"; - } - return "none"; + if (type_ == LCD_TEXT) { + return "text"; + } else if (type_ == LCD_GRAPHIC) { + return "graphic"; + } + return "none"; } void PluginLCD::SetTimeout(int val) { -/* - tick_timer_->setInterval(val); - tick_timer_->start(); -*/ + /* + tick_timer_->setInterval(val); + tick_timer_->start(); + */ } PluginLCD::PluginLCD(LCDCore *visitor) { - visitor_ = visitor; - type_ = visitor_->GetType(); + visitor_ = visitor; + type_ = visitor_->GetType(); -/* - QObject::connect(visitor_->GetWrapper(), SIGNAL(_KeypadEvent(const int)), - this, SIGNAL(_KeypadEvent(const int))); -*/ - -/* - tick_timer_ = new QTimer(); - tick_timer_->setInterval(500); - QObject::connect(tick_timer_, SIGNAL(timeout()), - this, SLOT(TickUpdate())); - tick_timer_->start(); -*/ -} + /* + QObject::connect(visitor_->GetWrapper(), SIGNAL(_KeypadEvent(const int)), + this, SIGNAL(_KeypadEvent(const int))); + */ -PluginLCD::~PluginLCD() { + /* + tick_timer_ = new QTimer(); + tick_timer_->setInterval(500); + QObject::connect(tick_timer_, SIGNAL(timeout()), + this, SLOT(TickUpdate())); + tick_timer_->start(); + */ } +PluginLCD::~PluginLCD() {} diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginLCD.h b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginLCD.h index 82f762ab0..db3633eb9 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginLCD.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginLCD.h @@ -34,43 +34,41 @@ class LCDCore; class PluginLCD { - LCDCore *visitor_; - int type_; + LCDCore *visitor_; + int type_; - void Setup(); + void Setup(); - public: - PluginLCD(LCDCore *visitor); - ~PluginLCD(); +public: + PluginLCD(LCDCore *visitor); + ~PluginLCD(); - public : - void Transition(int i); - void SelectLayout(string layout); - int RemoveWidget(string widget); - string AddWidget(string layout, int row, int col, - int layer, string object); - int MoveWidget(string widget, int rows, int cols); - int ResizeLCD(int rows, int cols); - void SendData(int row, int col, int layer, - string data); - void SetSpecialChar(int ch, SpecialChar matrix); - void AddSpecialChar(SpecialChar matrix); - void Clear(); - void ClearChars(); - string GetCurrentLayout(); - int GetRows(); - int GetCols(); - int GetXres(); - int GetYres(); - string GetType(); +public: + void Transition(int i); + void SelectLayout(string layout); + int RemoveWidget(string widget); + string AddWidget(string layout, int row, int col, int layer, string object); + int MoveWidget(string widget, int rows, int cols); + int ResizeLCD(int rows, int cols); + void SendData(int row, int col, int layer, string data); + void SetSpecialChar(int ch, SpecialChar matrix); + void AddSpecialChar(SpecialChar matrix); + void Clear(); + void ClearChars(); + string GetCurrentLayout(); + int GetRows(); + int GetCols(); + int GetXres(); + int GetYres(); + string GetType(); - void TickUpdate(); - void SetTimeout(int val); + void TickUpdate(); + void SetTimeout(int val); - void _TickUpdate(); - void _KeypadEvent(const int); + void _TickUpdate(); + void _KeypadEvent(const int); }; -}; // End namespace +}; // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginNetStat.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginNetStat.cpp index 6c04c025b..926904d09 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginNetStat.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginNetStat.cpp @@ -35,155 +35,155 @@ using namespace LCD; int PluginNetStat::ParseNetStat() { - const char *DELIMITER = " :\t\n"; - int age; - int row, col; - - age = hash_age(&NetStat, NULL); - if(age >= 0 && age <= 1) - return 0; - if( Stream == NULL ) - Stream = fopen("/proc/net/tcp", "r"); - if( Stream == NULL ) { - LCDError("fopen(/proc/net/tcp) failed: %s", strerror(errno)); - return -1; - } - - rewind(Stream); - row = 0; - linecount = 0; - - while(!feof(Stream)) { - char buffer[256]; - char line[16]; - char *beg, *end; - unsigned int len; + const char *DELIMITER = " :\t\n"; + int age; + int row, col; - if(fgets(buffer, sizeof(buffer), Stream) == NULL) + age = hash_age(&NetStat, NULL); + if (age >= 0 && age <= 1) + return 0; + if (Stream == NULL) + Stream = fopen("/proc/net/tcp", "r"); + if (Stream == NULL) { + LCDError("fopen(/proc/net/tcp) failed: %s", strerror(errno)); + return -1; + } + + rewind(Stream); + row = 0; + linecount = 0; + + while (!feof(Stream)) { + char buffer[256]; + char line[16]; + char *beg, *end; + unsigned int len; + + if (fgets(buffer, sizeof(buffer), Stream) == NULL) + break; + + switch (++row) { + case 1: + if (first_time) { + first_time = false; + col = 0; + beg = buffer; + + while (beg) { + switch (col) { + case 2: + hash_set_column(&NetStat, col++, "local_port"); + while (strlen(beg) > 0 && strchr(DELIMITER, *beg)) + beg++; break; - - switch(++row) { - case 1: - if(first_time) { - first_time = false; - col = 0; - beg = buffer; - - while(beg) { - switch(col) { - case 2: - hash_set_column(&NetStat, col++, "local_port"); - while(strlen(beg) > 0 && strchr(DELIMITER, *beg)) - beg++; - break; - case 4: - hash_set_column(&NetStat, col++, "rem_port"); - while(strlen(beg) > 0 && strchr(DELIMITER, *beg)) - beg++; - break; - default: - char key[32]; - while(strlen(beg) > 0 && strchr(DELIMITER, *beg)) - beg++; - if((end = strpbrk(beg, DELIMITER)) != NULL) - *end = '\0'; - qprintf(key, sizeof(key), "%s", beg); - hash_set_column(&NetStat, col++, key); - beg = end ? end + 1 : NULL; - break; - } - } - } - default: - beg = buffer; - while(*beg && *beg == ' ') - beg++; - end = beg + 1; - while(*end && *end != ':') - end++; - len = end - beg; - if( len >= sizeof(line)) - len = sizeof(line) - 1; - strncpy(line, beg, len); - line[len] = '\0'; - - hash_put_delta(&NetStat, line, buffer); - linecount++; + case 4: + hash_set_column(&NetStat, col++, "rem_port"); + while (strlen(beg) > 0 && strchr(DELIMITER, *beg)) + beg++; + break; + default: + char key[32]; + while (strlen(beg) > 0 && strchr(DELIMITER, *beg)) + beg++; + if ((end = strpbrk(beg, DELIMITER)) != NULL) + *end = '\0'; + qprintf(key, sizeof(key), "%s", beg); + hash_set_column(&NetStat, col++, key); + beg = end ? end + 1 : NULL; + break; + } } + } + default: + beg = buffer; + while (*beg && *beg == ' ') + beg++; + end = beg + 1; + while (*end && *end != ':') + end++; + len = end - beg; + if (len >= sizeof(line)) + len = sizeof(line) - 1; + strncpy(line, beg, len); + line[len] = '\0'; + + hash_put_delta(&NetStat, line, buffer); + linecount++; } - return 0; + } + return 0; } std::string PluginNetStat::Netstat(std::string arg1, std::string arg2) { - std::string line, column; - - if(ParseNetStat() < 0) { - return "Error"; - } - - line = arg1; - column = arg2; - - const char *val = hash_get(&NetStat, line.c_str(), column.c_str()); - - if(val == NULL) - return ""; - - char buffer[17]; - buffer[0] = 0; - if(column == "local_address" || column == "rem_address" ) { - char *tmp = (char*)val; - unsigned int s_addr1, s_addr2; - sscanf(tmp, "%4X", &s_addr1); - tmp+=4; - sscanf(tmp, "%X", &s_addr2); - unsigned long s_addr = (s_addr2 << 16) + s_addr1; - unsigned int a1 = s_addr / pow(256, 3); - unsigned int a2 = (s_addr % (int)pow(256, 3)) / pow(256, 2); - unsigned int a3 = ((s_addr % (int)pow(256, 3)) % - (int)pow(256, 2)) / pow(256, 1); - unsigned int a4 = (((s_addr % (int)pow(256, 3)) % - (int)pow(256, 2)) % (int)pow(256, 1)) / pow(256, 0); - qprintf(buffer, sizeof(buffer), "%d.%d.%d.%d", a1, a2, a3, a4); - - } else if(column == "local_port" || column == "rem_port" ) { - unsigned int s_port; - sscanf(val, "%X", &s_port); - qprintf(buffer, sizeof(buffer), "%d", s_port); - } - - return buffer[0] == 0 ? val : buffer; + std::string line, column; + + if (ParseNetStat() < 0) { + return "Error"; + } + + line = arg1; + column = arg2; + + const char *val = hash_get(&NetStat, line.c_str(), column.c_str()); + + if (val == NULL) + return ""; + + char buffer[17]; + buffer[0] = 0; + if (column == "local_address" || column == "rem_address") { + char *tmp = (char *)val; + unsigned int s_addr1, s_addr2; + sscanf(tmp, "%4X", &s_addr1); + tmp += 4; + sscanf(tmp, "%X", &s_addr2); + unsigned long s_addr = (s_addr2 << 16) + s_addr1; + unsigned int a1 = s_addr / pow(256, 3); + unsigned int a2 = (s_addr % (int)pow(256, 3)) / pow(256, 2); + unsigned int a3 = + ((s_addr % (int)pow(256, 3)) % (int)pow(256, 2)) / pow(256, 1); + unsigned int a4 = + (((s_addr % (int)pow(256, 3)) % (int)pow(256, 2)) % (int)pow(256, 1)) / + pow(256, 0); + qprintf(buffer, sizeof(buffer), "%d.%d.%d.%d", a1, a2, a3, a4); + + } else if (column == "local_port" || column == "rem_port") { + unsigned int s_port; + sscanf(val, "%X", &s_port); + qprintf(buffer, sizeof(buffer), "%d", s_port); + } + + return buffer[0] == 0 ? val : buffer; } int PluginNetStat::LineCount() { - if(ParseNetStat() < 0) { - return -1; - } - return linecount; + if (ParseNetStat() < 0) { + return -1; + } + return linecount; } PluginNetStat::PluginNetStat() { - first_time = true; - linecount = 0; - Stream = NULL; - hash_create(&NetStat); - hash_set_delimiter(&NetStat, " :\t\n"); + first_time = true; + linecount = 0; + Stream = NULL; + hash_create(&NetStat); + hash_set_delimiter(&NetStat, " :\t\n"); } PluginNetStat::~PluginNetStat() { - if(Stream != NULL) { - fclose(Stream); - Stream = NULL; - } - hash_destroy(&NetStat); + if (Stream != NULL) { + fclose(Stream); + Stream = NULL; + } + hash_destroy(&NetStat); } void PluginNetStat::Connect(Evaluator *visitor) { -/* - QScriptEngine *engine = visitor->GetEngine(); - QScriptValue val = engine->newObject(); - QScriptValue objVal = engine->newQObject(val, this); - engine->globalObject().setProperty("netstat", objVal); -*/ + /* + QScriptEngine *engine = visitor->GetEngine(); + QScriptValue val = engine->newObject(); + QScriptValue objVal = engine->newQObject(val, this); + engine->globalObject().setProperty("netstat", objVal); + */ } - diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginNetStat.h b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginNetStat.h index 3fccdc308..c4b054782 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginNetStat.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginNetStat.h @@ -32,23 +32,23 @@ class Evaluator; class PluginNetStat { - HASH NetStat; - FILE *Stream; - bool first_time; - int linecount; + HASH NetStat; + FILE *Stream; + bool first_time; + int linecount; - int ParseNetStat(); + int ParseNetStat(); - public: - PluginNetStat(); - ~PluginNetStat(); - void Connect(Evaluator *visitor); - void Disconnect() {} +public: + PluginNetStat(); + ~PluginNetStat(); + void Connect(Evaluator *visitor); + void Disconnect() {} - std::string Netstat(std::string arg1, std::string arg2); - int LineCount(); + std::string Netstat(std::string arg1, std::string arg2); + int LineCount(); }; -} // End namespace +} // namespace LCD #endif diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginWrapper.hpp b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginWrapper.hpp index dcd0ec7eb..04f1aec84 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginWrapper.hpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/plugins/PluginWrapper.hpp @@ -1,24 +1,15 @@ class LunaWrapper { - public: - LunaWrapper(lua_State *L) { - printf("in constructor\n"); - } +public: + LunaWrapper(lua_State *L) { printf("in constructor\n"); } - int foo(lua_State *L) { - printf("in foo\n"); - } + int foo(lua_State *L) { printf("in foo\n"); } - ~LunaWrapper() { - printf("in destructor\n"); - } + ~LunaWrapper() { printf("in destructor\n"); } - static const char className[]; - static const Luna::RegType Register[]; + static const char className[]; + static const Luna::RegType Register[]; }; const char LunaWrapper::className[] = "LunaWrapper"; const Luna::RegType LunaWrapper::Register[] = { - { "foo", &LunaWrapper::foo }, - { 0 } -}; - + {"foo", &LunaWrapper::foo}, {0}}; diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/qprintf.cpp b/libvisual-plugins/plugins/actor/lcdcontrol/qprintf.cpp index 8cbf62abd..c5b5dd929 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/qprintf.cpp +++ b/libvisual-plugins/plugins/actor/lcdcontrol/qprintf.cpp @@ -22,232 +22,228 @@ * along with LCDControl. If not, see . */ -/* +/* * exported functions: - * + * * int qprintf(char *str, size_t size, const char *format, ...) * works like snprintf(), but format only knows about %d, %x, %u and %s * and for the numbers an optional length like %d. If beginns * with '0' the free space is filled with '0's, otherwise with ' ' */ - #include #include #include #include -static char *itoa(char *buffer, const size_t size, int value, unsigned int fixedlen, unsigned int fill0) -{ - char *p; - int sign; - - /* sanity checks */ - if (buffer == NULL || size < 2) - return (NULL); - - /* remember sign of value */ - sign = 0; - if (value < 0) { - sign = 1; - if (fill0) - fixedlen -= 1; - value = -value; +static char *itoa(char *buffer, const size_t size, int value, + unsigned int fixedlen, unsigned int fill0) { + char *p; + int sign; + + /* sanity checks */ + if (buffer == NULL || size < 2) + return (NULL); + + /* remember sign of value */ + sign = 0; + if (value < 0) { + sign = 1; + if (fill0) + fixedlen -= 1; + value = -value; + } + + /* p points to last char */ + p = buffer + size - 1; + + /* set terminating zero */ + *p = '\0'; + + do { + *--p = value % 10 + '0'; + value = value / 10; + } while (value != 0 && p > buffer); + + if (sign && !fill0 && p > buffer) + *--p = '-'; + + /* fill fixed length */ + while (p > buffer && strlen(p) < fixedlen) { + if (fill0) { + *--p = '0'; + } else { + *--p = ' '; } + } - /* p points to last char */ - p = buffer + size - 1; - - /* set terminating zero */ - *p = '\0'; - - do { - *--p = value % 10 + '0'; - value = value / 10; - } while (value != 0 && p > buffer); + if (sign && fill0 && p > buffer) + *--p = '-'; - if (sign && !fill0 && p > buffer) - *--p = '-'; - - /* fill fixed length */ - while (p > buffer && strlen(p) < fixedlen) { - if (fill0) { - *--p = '0'; - } else { - *--p = ' '; - } - } - - if (sign && fill0 && p > buffer) - *--p = '-'; - - return p; + return p; } +static char *utoa(char *buffer, const size_t size, unsigned int value, + unsigned int fixedlen, unsigned int fill0) { + char *p; -static char *utoa(char *buffer, const size_t size, unsigned int value, unsigned int fixedlen, unsigned int fill0) -{ - char *p; - - /* sanity checks */ - if (buffer == NULL || size < 2) - return (NULL); + /* sanity checks */ + if (buffer == NULL || size < 2) + return (NULL); - /* p points to last char */ - p = buffer + size - 1; + /* p points to last char */ + p = buffer + size - 1; - /* set terminating zero */ - *p = '\0'; + /* set terminating zero */ + *p = '\0'; - do { - *--p = value % 10 + '0'; - value = value / 10; - } while (value != 0 && p > buffer); + do { + *--p = value % 10 + '0'; + value = value / 10; + } while (value != 0 && p > buffer); - /* fill fixed length */ - while (p > buffer && strlen(p) < fixedlen) { - if (fill0) { - *--p = '0'; - } else { - *--p = ' '; - } + /* fill fixed length */ + while (p > buffer && strlen(p) < fixedlen) { + if (fill0) { + *--p = '0'; + } else { + *--p = ' '; } + } - return p; + return p; } - -static char *utox(char *buffer, const size_t size, unsigned int value, unsigned int fixedlen, unsigned int fill0) -{ - char *p; - int digit; - - /* sanity checks */ - if (buffer == NULL || size < 2) - return (NULL); - - /* p points to last char */ - p = buffer + size - 1; - - /* set terminating zero */ - *p = '\0'; - - do { - digit = value % 16; - value = value / 16; - *--p = (digit < 10 ? '0' : 'a' - 10) + digit; - } while (value != 0 && p > buffer); - - /* fill fixed length */ - while (p > buffer && strlen(p) < fixedlen) { - if (fill0) { - *--p = '0'; - } else { - *--p = ' '; - } +static char *utox(char *buffer, const size_t size, unsigned int value, + unsigned int fixedlen, unsigned int fill0) { + char *p; + int digit; + + /* sanity checks */ + if (buffer == NULL || size < 2) + return (NULL); + + /* p points to last char */ + p = buffer + size - 1; + + /* set terminating zero */ + *p = '\0'; + + do { + digit = value % 16; + value = value / 16; + *--p = (digit < 10 ? '0' : 'a' - 10) + digit; + } while (value != 0 && p > buffer); + + /* fill fixed length */ + while (p > buffer && strlen(p) < fixedlen) { + if (fill0) { + *--p = '0'; + } else { + *--p = ' '; } + } - return p; + return p; } - /*! @function qprintf @abstract quick print values into string - @discussion similar to snprintf(), but only support for "%s", "%d", "%u", "%x" with optional length for the numbers - like "%5d" (filled with ' ') or "%05x" (filled with '0') + @discussion similar to snprintf(), but only support for "%s", "%d", "%u", + "%x" with optional length for the numbers like "%5d" (filled with ' ') or + "%05x" (filled with '0') @param str destination @param size maximum length of destination string @param format (like printf() with reduced number of formats) @result length of produced string */ -int qprintf(char *str, const size_t size, const char *format, ...) -{ - - va_list ap; - const char *src; - char *dst; - unsigned int len; - - src = format; - dst = str; - len = 0; - - va_start(ap, format); - - /* use size-1 for terminating zero */ - while (len < size - 1) { - - if (*src == '%') { - char buf[12], *s; - int d; - unsigned int u; - unsigned int fixedlen = 0; - unsigned int fill0 = 0; - - if (*++src == '0') - fill0 = 1; - while (*src >= '0' && *src <= '9') { - fixedlen = fixedlen * 10 + (*src - '0'); - src++; - } - - switch (*src) { - case 's': - src++; - s = va_arg(ap, char *); - while (len < size - 1 && *s != '\0') { - len++; - *dst++ = *s++; - } - break; - case 'd': - src++; - d = va_arg(ap, int); - s = itoa(buf, sizeof(buf), d, fixedlen, fill0); - while (len < size && *s != '\0') { - len++; - *dst++ = *s++; - } - break; - case 'u': - src++; - u = va_arg(ap, unsigned int); - s = utoa(buf, sizeof(buf), u, fixedlen, fill0); - while (len < size - 1 && *s != '\0') { - len++; - *dst++ = *s++; - } - break; - case 'x': - src++; - u = va_arg(ap, unsigned int); - s = utox(buf, sizeof(buf), u, fixedlen, fill0); - while (len < size - 1 && *s != '\0') { - len++; - *dst++ = *s++; - } - break; - default: - len++; - *dst++ = '%'; - } - } else { - len++; - *dst++ = *src; - if (*src++ == '\0') - break; +int qprintf(char *str, const size_t size, const char *format, ...) { + + va_list ap; + const char *src; + char *dst; + unsigned int len; + + src = format; + dst = str; + len = 0; + + va_start(ap, format); + + /* use size-1 for terminating zero */ + while (len < size - 1) { + + if (*src == '%') { + char buf[12], *s; + int d; + unsigned int u; + unsigned int fixedlen = 0; + unsigned int fill0 = 0; + + if (*++src == '0') + fill0 = 1; + while (*src >= '0' && *src <= '9') { + fixedlen = fixedlen * 10 + (*src - '0'); + src++; + } + + switch (*src) { + case 's': + src++; + s = va_arg(ap, char *); + while (len < size - 1 && *s != '\0') { + len++; + *dst++ = *s++; } + break; + case 'd': + src++; + d = va_arg(ap, int); + s = itoa(buf, sizeof(buf), d, fixedlen, fill0); + while (len < size && *s != '\0') { + len++; + *dst++ = *s++; + } + break; + case 'u': + src++; + u = va_arg(ap, unsigned int); + s = utoa(buf, sizeof(buf), u, fixedlen, fill0); + while (len < size - 1 && *s != '\0') { + len++; + *dst++ = *s++; + } + break; + case 'x': + src++; + u = va_arg(ap, unsigned int); + s = utox(buf, sizeof(buf), u, fixedlen, fill0); + while (len < size - 1 && *s != '\0') { + len++; + *dst++ = *s++; + } + break; + default: + len++; + *dst++ = '%'; + } + } else { + len++; + *dst++ = *src; + if (*src++ == '\0') + break; } + } - va_end(ap); + va_end(ap); - /* enforce terminating zero */ - if (len >= size - 1 && *(dst - 1) != '\0') { - len++; - *dst = '\0'; - } + /* enforce terminating zero */ + if (len >= size - 1 && *(dst - 1) != '\0') { + len++; + *dst = '\0'; + } - /* do not count terminating zero */ - return len - 1; + /* do not count terminating zero */ + return len - 1; } diff --git a/libvisual-plugins/plugins/actor/lcdcontrol/qprintf.h b/libvisual-plugins/plugins/actor/lcdcontrol/qprintf.h index 4c7dd0241..7dc2f0d10 100644 --- a/libvisual-plugins/plugins/actor/lcdcontrol/qprintf.h +++ b/libvisual-plugins/plugins/actor/lcdcontrol/qprintf.h @@ -20,7 +20,7 @@ * * You should have received a copy of the GNU General Public License * along with LCDControl. If not, see . - */ + */ #ifndef _QPRINTF_H_ #define _QPRINTF_H_ diff --git a/libvisual-plugins/plugins/actor/lv_analyzer/actor_lv_analyzer.c b/libvisual-plugins/plugins/actor/lv_analyzer/actor_lv_analyzer.c index e9a7a4b7b..0dcdd0310 100644 --- a/libvisual-plugins/plugins/actor/lv_analyzer/actor_lv_analyzer.c +++ b/libvisual-plugins/plugins/actor/lv_analyzer/actor_lv_analyzer.c @@ -30,340 +30,319 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR /** default space between bars in pixels */ #define BARS_DEFAULT_SPACE 0 - /* helper macro */ -#define QTY(array) (sizeof(array) / sizeof(*(array))) - -typedef struct -{ - VisPalette *pal; - int bars; - int bar_space; - int width, height; - VisBuffer *pcm_buffer; - VisBuffer *freq_buffer; +#define QTY(array) (sizeof(array) / sizeof(*(array))) + +typedef struct { + VisPalette *pal; + int bars; + int bar_space; + int width, height; + VisBuffer *pcm_buffer; + VisBuffer *freq_buffer; } AnalyzerPrivate; -static int lv_analyzer_init (VisPluginData *plugin); -static void lv_analyzer_cleanup (VisPluginData *plugin); -static void lv_analyzer_requisition (VisPluginData *plugin, int *width, int *height); -static int lv_analyzer_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_analyzer_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_analyzer_palette (VisPluginData *plugin); - - - - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = lv_analyzer_requisition, - .palette = lv_analyzer_palette, - .render = lv_analyzer_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "lv_analyzer", - .name = "libvisual analyzer", - .author = "Dennis Smit ", - .version = "1.1", - .about = N_("Libvisual analyzer plugin"), - .help = N_("A nice simple spectrum analyzer plugin."), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_analyzer_init, - .cleanup = lv_analyzer_cleanup, - .events = lv_analyzer_events, - .plugin = &actor - }; - - return &info; +static int lv_analyzer_init(VisPluginData *plugin); +static void lv_analyzer_cleanup(VisPluginData *plugin); +static void lv_analyzer_requisition(VisPluginData *plugin, int *width, + int *height); +static int lv_analyzer_events(VisPluginData *plugin, VisEventQueue *events); +static void lv_analyzer_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *lv_analyzer_palette(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = lv_analyzer_requisition, + .palette = lv_analyzer_palette, + .render = lv_analyzer_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "lv_analyzer", + .name = "libvisual analyzer", + .author = "Dennis Smit ", + .version = "1.1", + .about = N_("Libvisual analyzer plugin"), + .help = N_("A nice simple spectrum analyzer plugin."), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_analyzer_init, + .cleanup = lv_analyzer_cleanup, + .events = lv_analyzer_events, + .plugin = &actor}; + + return &info; } - -static int lv_analyzer_init (VisPluginData *plugin) -{ +static int lv_analyzer_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - AnalyzerPrivate *priv = visual_mem_new0 (AnalyzerPrivate, 1); - visual_plugin_set_private (plugin, priv); - - /* get plugins param-container */ - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_integer ("bars", "Number of bars in graph", BARS_DEFAULT, NULL), - visual_param_new_integer ("bar-space", "Amount of pixels between bars in graph", BARS_DEFAULT_SPACE, NULL), - NULL); - - /* default values */ - priv->bars = BARS_DEFAULT; - priv->bar_space = BARS_DEFAULT_SPACE; - - /* allocate buffers */ - priv->pcm_buffer = visual_buffer_new_allocate (priv->bars*2 * sizeof (float)); - priv->freq_buffer = visual_buffer_new_allocate (priv->bars * sizeof (float)); - - /* allocate space for palette */ - priv->pal = visual_palette_new (256); - - /* initialize palette */ - VisColor *pal_colors = visual_palette_get_colors (priv->pal); - int i; - - for (i = 0; i < 256; i++) { - pal_colors[i].r = 0; - pal_colors[i].g = 0; - pal_colors[i].b = 0; - } - - for (i = 1; i < 64; i++) { - pal_colors[i].r = i * 4; - pal_colors[i].g = 255; - pal_colors[i].b = 0; - - pal_colors[i + 63].r = 255; - pal_colors[i + 63].g = (63 - i) * 4; - pal_colors[i + 63].b = 0; - } - - return TRUE; + AnalyzerPrivate *priv = visual_mem_new0(AnalyzerPrivate, 1); + visual_plugin_set_private(plugin, priv); + + /* get plugins param-container */ + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, + visual_param_new_integer("bars", "Number of bars in graph", BARS_DEFAULT, + NULL), + visual_param_new_integer("bar-space", + "Amount of pixels between bars in graph", + BARS_DEFAULT_SPACE, NULL), + NULL); + + /* default values */ + priv->bars = BARS_DEFAULT; + priv->bar_space = BARS_DEFAULT_SPACE; + + /* allocate buffers */ + priv->pcm_buffer = visual_buffer_new_allocate(priv->bars * 2 * sizeof(float)); + priv->freq_buffer = visual_buffer_new_allocate(priv->bars * sizeof(float)); + + /* allocate space for palette */ + priv->pal = visual_palette_new(256); + + /* initialize palette */ + VisColor *pal_colors = visual_palette_get_colors(priv->pal); + int i; + + for (i = 0; i < 256; i++) { + pal_colors[i].r = 0; + pal_colors[i].g = 0; + pal_colors[i].b = 0; + } + + for (i = 1; i < 64; i++) { + pal_colors[i].r = i * 4; + pal_colors[i].g = 255; + pal_colors[i].b = 0; + + pal_colors[i + 63].r = 255; + pal_colors[i + 63].g = (63 - i) * 4; + pal_colors[i + 63].b = 0; + } + + return TRUE; } -static void lv_analyzer_cleanup (VisPluginData *plugin) -{ - AnalyzerPrivate *priv = visual_plugin_get_private (plugin); +static void lv_analyzer_cleanup(VisPluginData *plugin) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); + + visual_buffer_unref(priv->freq_buffer); + visual_buffer_unref(priv->pcm_buffer); - visual_buffer_unref (priv->freq_buffer); - visual_buffer_unref (priv->pcm_buffer); - - visual_palette_free (priv->pal); + visual_palette_free(priv->pal); - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_analyzer_requisition (VisPluginData *plugin, int *width, int *height) -{ - AnalyzerPrivate *priv = visual_plugin_get_private (plugin); +static void lv_analyzer_requisition(VisPluginData *plugin, int *width, + int *height) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); - int total_space = priv->bar_space * (priv->bars - 1); + int total_space = priv->bar_space * (priv->bars - 1); - int min_width = priv->bars + total_space; + int min_width = priv->bars + total_space; - if (*width < min_width) { - *width = min_width; - } + if (*width < min_width) { + *width = min_width; + } } -static int _validate_bar_space(VisPluginData *plugin, int *bar_space) -{ - AnalyzerPrivate *priv = visual_plugin_get_private (plugin); +static int _validate_bar_space(VisPluginData *plugin, int *bar_space) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); - if(*bar_space > 0 && - priv->bars + *bar_space * (priv->bars - 1) < priv->width) - return 1; + if (*bar_space > 0 && + priv->bars + *bar_space * (priv->bars - 1) < priv->width) + return 1; - return 0; + return 0; } -static int _validate_bars(VisPluginData *plugin, int *bars) -{ - AnalyzerPrivate *priv = visual_plugin_get_private (plugin); +static int _validate_bars(VisPluginData *plugin, int *bars) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); - if(*bars > 0 && *bars < priv->width) - return 1; + if (*bars > 0 && *bars < priv->width) + return 1; - return 0; + return 0; } -static void _change_bar_space(VisPluginData *plugin, - VisParam *p, - int (*validator)(VisPluginData *plugin, void *value)) -{ - AnalyzerPrivate *priv = visual_plugin_get_private(plugin); +static void _change_bar_space(VisPluginData *plugin, VisParam *p, + int (*validator)(VisPluginData *plugin, + void *value)) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); - int integer = visual_param_get_value_integer(p); + int integer = visual_param_get_value_integer(p); - if(!validator || validator(plugin, &integer)) - { - priv->bar_space = integer; - return; - } - /* reset to previous value */ - else - visual_param_set_value_integer(p, priv->bar_space); + if (!validator || validator(plugin, &integer)) { + priv->bar_space = integer; + return; + } + /* reset to previous value */ + else + visual_param_set_value_integer(p, priv->bar_space); } -static void _change_bars(VisPluginData *plugin, - VisParam *p, - int (*validator)(VisPluginData *plugin, void *value)) -{ - AnalyzerPrivate *priv = visual_plugin_get_private (plugin); +static void _change_bars(VisPluginData *plugin, VisParam *p, + int (*validator)(VisPluginData *plugin, void *value)) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); - int integer = visual_param_get_value_integer(p); + int integer = visual_param_get_value_integer(p); - if(!validator || validator(plugin, &integer)) - { - priv->bars = integer; + if (!validator || validator(plugin, &integer)) { + priv->bars = integer; - /* resize buffers */ + /* resize buffers */ - visual_buffer_unref(priv->pcm_buffer); - visual_buffer_unref(priv->freq_buffer); + visual_buffer_unref(priv->pcm_buffer); + visual_buffer_unref(priv->freq_buffer); - priv->pcm_buffer = visual_buffer_new_allocate(priv->bars*2 * sizeof (float)); - priv->freq_buffer = visual_buffer_new_allocate(priv->bars * sizeof (float)); - return; - } - /* reset to previous value */ - else - visual_param_set_value_integer(p, priv->bars); + priv->pcm_buffer = + visual_buffer_new_allocate(priv->bars * 2 * sizeof(float)); + priv->freq_buffer = visual_buffer_new_allocate(priv->bars * sizeof(float)); + return; + } + /* reset to previous value */ + else + visual_param_set_value_integer(p, priv->bars); } -static void _change_param(VisPluginData *plugin, VisParam *p) -{ - /** - * structure defining handler functions for configuration values - */ - struct - { - /* parameter-name */ - char *name; - /* validator function */ - int (*validator)(void *value); - /* function called to change parameter */ - void (*change)(VisPluginData *plugin, - VisParam *parameter, int (*validator)(void *value)); - /* function called after parameter change */ - void (*postchange)(VisPluginData *plugin); - } parms[] = - { - {"bars", (void *) _validate_bars, (void *) _change_bars, NULL}, - {"bar-space", (void *) _validate_bar_space, (void *) _change_bar_space, NULL}, - }; +static void _change_param(VisPluginData *plugin, VisParam *p) { + /** + * structure defining handler functions for configuration values + */ + struct { + /* parameter-name */ + char *name; + /* validator function */ + int (*validator)(void *value); + /* function called to change parameter */ + void (*change)(VisPluginData *plugin, VisParam *parameter, + int (*validator)(void *value)); + /* function called after parameter change */ + void (*postchange)(VisPluginData *plugin); + } parms[] = { + {"bars", (void *)_validate_bars, (void *)_change_bars, NULL}, + {"bar-space", (void *)_validate_bar_space, (void *)_change_bar_space, + NULL}, + }; + + /** look for parameter in our structure */ + int i; + for (i = 0; i < QTY(parms); i++) { + /* not our parameter? -> continue the quest */ + if (!visual_param_has_name(p, parms[i].name)) + continue; + + /* call this parameters' change handler */ + if (parms[i].change) + parms[i].change(plugin, p, parms[i].validator); + + /* call this parameters' post-change handler */ + if (parms[i].postchange) + parms[i].postchange(plugin); + + return; + } + + visual_log(VISUAL_LOG_WARNING, "Unknown param '%s'", + visual_param_get_name(p)); +} - /** look for parameter in our structure */ - int i; - for(i = 0; i < QTY(parms); i++) - { - /* not our parameter? -> continue the quest */ - if(!visual_param_has_name(p, parms[i].name)) - continue; +static void lv_analyzer_resize(VisPluginData *plugin, int width, int height) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); - /* call this parameters' change handler */ - if(parms[i].change) - parms[i].change(plugin, p, parms[i].validator); + priv->width = width; + priv->height = height; +} - /* call this parameters' post-change handler */ - if(parms[i].postchange) - parms[i].postchange(plugin); +static int lv_analyzer_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; - return; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_PARAM: { + VisParam *param = ev.event.param.param; + /* change config parameter */ + _change_param(plugin, param); + break; } - visual_log(VISUAL_LOG_WARNING, "Unknown param '%s'", visual_param_get_name(p)); -} - -static void lv_analyzer_resize (VisPluginData *plugin, int width, int height) -{ - AnalyzerPrivate *priv = visual_plugin_get_private (plugin); + case VISUAL_EVENT_RESIZE: { + lv_analyzer_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; + } - priv->width = width; - priv->height = height; -} + default: /* to avoid warnings */ + { + break; + } + } + } -static int lv_analyzer_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - while (visual_event_queue_poll (events, &ev)) - { - switch (ev.type) - { - case VISUAL_EVENT_PARAM: - { - VisParam *param = ev.event.param.param; - /* change config parameter */ - _change_param(plugin, param); - break; - } - - case VISUAL_EVENT_RESIZE: - { - lv_analyzer_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; - } - - default: /* to avoid warnings */ - { - break; - } - } - } - - return TRUE; + return TRUE; } -static VisPalette *lv_analyzer_palette (VisPluginData *plugin) -{ - AnalyzerPrivate *priv = visual_plugin_get_private (plugin); - return priv->pal; +static VisPalette *lv_analyzer_palette(VisPluginData *plugin) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); + return priv->pal; } -static inline void draw_bar (VisVideo *video, int x, int width, float amplitude) -{ - /* NOTES: - * - We use 16:16 fixed point to incrementally calculate the color at each y - * - Bar row color must be in [1,126] - */ - int video_height = visual_video_get_height (video); - int video_pitch = visual_video_get_pitch (video); - int y = (1.0 - amplitude) * video_height; +static inline void draw_bar(VisVideo *video, int x, int width, + float amplitude) { + /* NOTES: + * - We use 16:16 fixed point to incrementally calculate the color at each y + * - Bar row color must be in [1,126] + */ + int video_height = visual_video_get_height(video); + int video_pitch = visual_video_get_pitch(video); + int y = (1.0 - amplitude) * video_height; - if (y >= video_height) - return; - - int color = (1 << 16) + (amplitude * (125 << 16)); - int dcolor = (125 << 16) / video_height; + if (y >= video_height) + return; - uint8_t *row = (uint8_t *) visual_video_get_pixel_ptr (video, x, y); + int color = (1 << 16) + (amplitude * (125 << 16)); + int dcolor = (125 << 16) / video_height; - while (y < video_height) { - visual_mem_set (row, color >> 16, width); + uint8_t *row = (uint8_t *)visual_video_get_pixel_ptr(video, x, y); - y++; row += video_pitch; - color -= dcolor; - } + while (y < video_height) { + visual_mem_set(row, color >> 16, width); + y++; + row += video_pitch; + color -= dcolor; + } } /** * render analyzer - calledback */ -static void lv_analyzer_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - AnalyzerPrivate *priv = visual_plugin_get_private (plugin); - - visual_audio_get_sample_mixed_simple (audio, priv->pcm_buffer, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); - visual_audio_get_spectrum_for_sample (priv->freq_buffer, priv->pcm_buffer, TRUE); - - - int spaces = priv->bar_space * (priv->bars - 1); - int width = (visual_video_get_width (video) - spaces) / priv->bars; - int x = ((visual_video_get_width (video) - spaces) % priv->bars) / 2; - - visual_video_fill_color (video, NULL); - - float *freq = (float *) visual_buffer_get_data (priv->freq_buffer); - - for(int i = 0; i < priv->bars; i++) { - draw_bar (video, x, width, freq[i]); - x += width + priv->bar_space; - } +static void lv_analyzer_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + AnalyzerPrivate *priv = visual_plugin_get_private(plugin); + + visual_audio_get_sample_mixed_simple(audio, priv->pcm_buffer, 2, + VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); + visual_audio_get_spectrum_for_sample(priv->freq_buffer, priv->pcm_buffer, + TRUE); + + int spaces = priv->bar_space * (priv->bars - 1); + int width = (visual_video_get_width(video) - spaces) / priv->bars; + int x = ((visual_video_get_width(video) - spaces) % priv->bars) / 2; + + visual_video_fill_color(video, NULL); + + float *freq = (float *)visual_buffer_get_data(priv->freq_buffer); + + for (int i = 0; i < priv->bars; i++) { + draw_bar(video, x, width, freq[i]); + x += width + priv->bar_space; + } } diff --git a/libvisual-plugins/plugins/actor/lv_dump/actor_lv_dump.c b/libvisual-plugins/plugins/actor/lv_dump/actor_lv_dump.c index c7dcca99a..88b25ee09 100644 --- a/libvisual-plugins/plugins/actor/lv_dump/actor_lv_dump.c +++ b/libvisual-plugins/plugins/actor/lv_dump/actor_lv_dump.c @@ -28,148 +28,136 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #define SAMPLES_PER_FRAME_DEFAULT 512 -#define MIN(a,b) ((a) <= (b) ? (a) : (b)) +#define MIN(a, b) ((a) <= (b) ? (a) : (b)) typedef struct { - unsigned int samples_per_frame; + unsigned int samples_per_frame; } LVDumpPrivate; -static int lv_dump_init (VisPluginData *plugin); -static void lv_dump_cleanup (VisPluginData *plugin); -static void lv_dump_requisition (VisPluginData *plugin, int *width, int *height); -static void lv_dump_resize (VisPluginData *plugin, int width, int height); -static int lv_dump_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_dump_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_dump_palette (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = lv_dump_requisition, - .palette = lv_dump_palette, - .render = lv_dump_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_32BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "lv_dump", - .name = "libvisual PCM data dump", - .author = "Chong Kai Xiong ", - .version = "1.0", - .about = N_("Libvisual data dump plugin"), - .help = N_("A plugin that simply dumps floating-point PCM data for debugging"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_dump_init, - .cleanup = lv_dump_cleanup, - .events = lv_dump_events, - - .plugin = &actor - }; - - return &info; +static int lv_dump_init(VisPluginData *plugin); +static void lv_dump_cleanup(VisPluginData *plugin); +static void lv_dump_requisition(VisPluginData *plugin, int *width, int *height); +static void lv_dump_resize(VisPluginData *plugin, int width, int height); +static int lv_dump_events(VisPluginData *plugin, VisEventQueue *events); +static void lv_dump_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *lv_dump_palette(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = lv_dump_requisition, + .palette = lv_dump_palette, + .render = lv_dump_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_32BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "lv_dump", + .name = "libvisual PCM data dump", + .author = "Chong Kai Xiong ", + .version = "1.0", + .about = N_("Libvisual data dump plugin"), + .help = N_( + "A plugin that simply dumps floating-point PCM data for debugging"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_dump_init, + .cleanup = lv_dump_cleanup, + .events = lv_dump_events, + + .plugin = &actor}; + + return &info; } -static int lv_dump_init (VisPluginData *plugin) -{ +static int lv_dump_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - LVDumpPrivate *priv = visual_mem_new0 (LVDumpPrivate, 1); - visual_plugin_set_private (plugin, priv); + LVDumpPrivate *priv = visual_mem_new0(LVDumpPrivate, 1); + visual_plugin_set_private(plugin, priv); - /* Parameter specifications */ - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_integer ("samples_per_frame", "Samples per frame", - SAMPLES_PER_FRAME_DEFAULT, - NULL), - NULL); + /* Parameter specifications */ + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, + visual_param_new_integer("samples_per_frame", "Samples per frame", + SAMPLES_PER_FRAME_DEFAULT, NULL), + NULL); - /* Default values */ - priv->samples_per_frame = SAMPLES_PER_FRAME_DEFAULT; + /* Default values */ + priv->samples_per_frame = SAMPLES_PER_FRAME_DEFAULT; - return TRUE; + return TRUE; } -static void lv_dump_cleanup (VisPluginData *plugin) -{ - LVDumpPrivate *priv = visual_plugin_get_private (plugin); +static void lv_dump_cleanup(VisPluginData *plugin) { + LVDumpPrivate *priv = visual_plugin_get_private(plugin); - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_dump_requisition (VisPluginData *plugin, int *width, int *height) -{ - LVDumpPrivate *priv = visual_plugin_get_private (plugin); +static void lv_dump_requisition(VisPluginData *plugin, int *width, + int *height) { + LVDumpPrivate *priv = visual_plugin_get_private(plugin); - /* We will dump all data into a single row, 1 float sample per 32-bit pixel */ - *width = priv->samples_per_frame; - *height = 1; + /* We will dump all data into a single row, 1 float sample per 32-bit pixel */ + *width = priv->samples_per_frame; + *height = 1; } -static void lv_dump_resize (VisPluginData *plugin, int width, int height) -{ - /* Nothing to resize. We will pad, clip and wrap the dump - * according to the given dimensions */ +static void lv_dump_resize(VisPluginData *plugin, int width, int height) { + /* Nothing to resize. We will pad, clip and wrap the dump + * according to the given dimensions */ } -static int lv_dump_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - while (visual_event_queue_poll (events, &ev)) - { - switch (ev.type) - { - case VISUAL_EVENT_PARAM: - { - /* TODO: Handle this */ - break; - } - - case VISUAL_EVENT_RESIZE: - { - lv_dump_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; - } - - default:; - /* Ignore the rest */ - } +static int lv_dump_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; + + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_PARAM: { + /* TODO: Handle this */ + break; } - return TRUE; -} + case VISUAL_EVENT_RESIZE: { + lv_dump_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; + } -static VisPalette *lv_dump_palette (VisPluginData *plugin) -{ - return NULL; + default:; + /* Ignore the rest */ + } + } + + return TRUE; } -static void lv_dump_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - LVDumpPrivate *priv = visual_plugin_get_private (plugin); +static VisPalette *lv_dump_palette(VisPluginData *plugin) { return NULL; } + +static void lv_dump_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + LVDumpPrivate *priv = visual_plugin_get_private(plugin); - VisBuffer *pcm_buffer = visual_buffer_new_allocate (priv->samples_per_frame * sizeof (float)); + VisBuffer *pcm_buffer = + visual_buffer_new_allocate(priv->samples_per_frame * sizeof(float)); - visual_audio_get_sample_mixed_simple (audio, pcm_buffer, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); + visual_audio_get_sample_mixed_simple(audio, pcm_buffer, 2, + VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); - int width = visual_video_get_width (video); - int height = visual_video_get_height (video); + int width = visual_video_get_width(video); + int height = visual_video_get_height(video); - unsigned int samples_to_render = MIN(width * height, priv->samples_per_frame); + unsigned int samples_to_render = MIN(width * height, priv->samples_per_frame); - visual_video_fill_color (video, NULL); + visual_video_fill_color(video, NULL); - visual_mem_copy (visual_video_get_pixels(video), - visual_buffer_get_data (pcm_buffer), - samples_to_render * sizeof(float)); + visual_mem_copy(visual_video_get_pixels(video), + visual_buffer_get_data(pcm_buffer), + samples_to_render * sizeof(float)); - visual_buffer_unref (pcm_buffer); + visual_buffer_unref(pcm_buffer); } diff --git a/libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c b/libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c index 7e4646ea9..a95662c6a 100644 --- a/libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c +++ b/libvisual-plugins/plugins/actor/lv_gltest/actor_lv_gltest.c @@ -36,351 +36,347 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -#define BARS 16 +#define BARS 16 -static int xranges[] = {0, 1, 2, 3, 5, 7, 10, 14, 20, 28, 40, 54, 74, 101, 137, 187, 255}; +static int xranges[] = {0, 1, 2, 3, 5, 7, 10, 14, 20, + 28, 40, 54, 74, 101, 137, 187, 255}; typedef struct { - GLfloat y_angle; - GLfloat y_initial_angle; - GLfloat y_speed; // degrees per second - GLfloat x_angle; - GLfloat x_initial_angle; - GLfloat x_speed; // degrees per second - GLfloat z_angle; - GLfloat z_initial_angle; - GLfloat z_speed; // degrees per second - GLfloat heights[16][16]; - - int transparent; - - VisTimer * started_at; + GLfloat y_angle; + GLfloat y_initial_angle; + GLfloat y_speed; // degrees per second + GLfloat x_angle; + GLfloat x_initial_angle; + GLfloat x_speed; // degrees per second + GLfloat z_angle; + GLfloat z_initial_angle; + GLfloat z_speed; // degrees per second + GLfloat heights[16][16]; + + int transparent; + + VisTimer *started_at; } GLtestPrivate; -static int lv_gltest_init (VisPluginData *plugin); -static void lv_gltest_cleanup (VisPluginData *plugin); -static void lv_gltest_requisition (VisPluginData *plugin, int *width, int *height); -static void lv_gltest_resize (VisPluginData *plugin, int width, int height); -static int lv_gltest_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_gltest_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_gltest_palette (VisPluginData *plugin); - -static void draw_bars (GLtestPrivate *priv); -static void draw_rectangle (GLtestPrivate *priv, GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2); -static void draw_bar (GLtestPrivate *priv, GLfloat x_offset, GLfloat z_offset, GLfloat height, GLfloat red, GLfloat green, GLfloat blue); -static void draw_bars (GLtestPrivate *priv); +static int lv_gltest_init(VisPluginData *plugin); +static void lv_gltest_cleanup(VisPluginData *plugin); +static void lv_gltest_requisition(VisPluginData *plugin, int *width, + int *height); +static void lv_gltest_resize(VisPluginData *plugin, int width, int height); +static int lv_gltest_events(VisPluginData *plugin, VisEventQueue *events); +static void lv_gltest_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *lv_gltest_palette(VisPluginData *plugin); + +static void draw_bars(GLtestPrivate *priv); +static void draw_rectangle(GLtestPrivate *priv, GLfloat x1, GLfloat y1, + GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2); +static void draw_bar(GLtestPrivate *priv, GLfloat x_offset, GLfloat z_offset, + GLfloat height, GLfloat red, GLfloat green, GLfloat blue); +static void draw_bars(GLtestPrivate *priv); /* Main plugin stuff */ -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = lv_gltest_requisition, - .palette = lv_gltest_palette, - .render = lv_gltest_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_GL - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "lv_gltest", - .name = "libvisual GL analyzer", - .author = N_("Original by: Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies, Port by: Dennis Smit "), - .version = "0.1", - .about = N_("Libvisual GL analyzer plugin"), - .help = N_("This plugin shows an openGL bar analyzer like the xmms one"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_gltest_init, - .cleanup = lv_gltest_cleanup, - .events = lv_gltest_events, - .plugin = &actor - }; - - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, 1); - - return &info; +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = lv_gltest_requisition, + .palette = lv_gltest_palette, + .render = lv_gltest_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_GL}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "lv_gltest", + .name = "libvisual GL analyzer", + .author = N_("Original by: Peter Alm, Mikael Alm, Olle Hallnas, Thomas " + "Nilsson and 4Front Technologies, Port by: Dennis Smit " + ""), + .version = "0.1", + .about = N_("Libvisual GL analyzer plugin"), + .help = N_("This plugin shows an openGL bar analyzer like the xmms one"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_gltest_init, + .cleanup = lv_gltest_cleanup, + .events = lv_gltest_events, + .plugin = &actor}; + + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, + 1); + + return &info; } -static int lv_gltest_init (VisPluginData *plugin) -{ +static int lv_gltest_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - GLtestPrivate *priv = visual_mem_new0 (GLtestPrivate, 1); - visual_plugin_set_private (plugin, priv); + GLtestPrivate *priv = visual_mem_new0(GLtestPrivate, 1); + visual_plugin_set_private(plugin, priv); - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_bool ("transparent_bars", - N_("Transparent bars"), - TRUE, - NULL), - NULL); + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many(params, + visual_param_new_bool("transparent_bars", + N_("Transparent bars"), TRUE, + NULL), + NULL); - /* GL setting up the rest! */ - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + /* GL setting up the rest! */ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glMatrixMode (GL_PROJECTION); + glMatrixMode(GL_PROJECTION); - glLoadIdentity (); + glLoadIdentity(); #ifdef USE_OPENGL_ES - glFrustumf (-1, 1, -1, 1, 1.5, 10); + glFrustumf(-1, 1, -1, 1, 1.5, 10); #else - glFrustum (-1, 1, -1, 1, 1.5, 10); + glFrustum(-1, 1, -1, 1, 1.5, 10); #endif - glMatrixMode (GL_MODELVIEW); - glLoadIdentity (); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); - glEnable (GL_DEPTH_TEST); - glDepthFunc (GL_LESS); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); - glBlendFunc (GL_SRC_ALPHA,GL_ONE); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); - int x, y; + int x, y; - for (x = 0; x < 16; x++) { - for (y = 0; y < 16; y++) { - priv->heights[y][x] = 0.0; - } - } + for (x = 0; x < 16; x++) { + for (y = 0; y < 16; y++) { + priv->heights[y][x] = 0.0; + } + } - priv->x_speed = 0.0f; - priv->y_speed = 360.0f / 13.0f; - priv->z_speed = 0.0f; - priv->x_initial_angle = 20.0f; - priv->y_initial_angle = 45.0f; - priv->z_initial_angle = 0.0f; + priv->x_speed = 0.0f; + priv->y_speed = 360.0f / 13.0f; + priv->z_speed = 0.0f; + priv->x_initial_angle = 20.0f; + priv->y_initial_angle = 45.0f; + priv->z_initial_angle = 0.0f; - priv->started_at = visual_timer_new(); - visual_return_val_if_fail( priv->started_at != NULL, -1 ); + priv->started_at = visual_timer_new(); + visual_return_val_if_fail(priv->started_at != NULL, -1); - visual_timer_start(priv->started_at); + visual_timer_start(priv->started_at); - return TRUE; + return TRUE; } -static void lv_gltest_cleanup (VisPluginData *plugin) -{ - GLtestPrivate *priv = visual_plugin_get_private (plugin); +static void lv_gltest_cleanup(VisPluginData *plugin) { + GLtestPrivate *priv = visual_plugin_get_private(plugin); - if (priv) { - visual_timer_free (priv->started_at); - } + if (priv) { + visual_timer_free(priv->started_at); + } - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_gltest_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void lv_gltest_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - if (reqw < 1) - reqw = 1; + if (reqw < 1) + reqw = 1; - if (reqh < 1) - reqh = 1; + if (reqh < 1) + reqh = 1; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } +static void lv_gltest_resize(VisPluginData *plugin, int width, int height) { + GLfloat ratio; -static void lv_gltest_resize (VisPluginData *plugin, int width, int height) -{ - GLfloat ratio; - - ratio = (GLfloat) width / (GLfloat) height; + ratio = (GLfloat)width / (GLfloat)height; - glViewport (0, 0, (GLsizei) width, (GLsizei) height); - glMatrixMode (GL_PROJECTION); - glLoadIdentity (); + glViewport(0, 0, (GLsizei)width, (GLsizei)height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); - gluPerspective (45.0, ratio, 0.1, 100.0); + gluPerspective(45.0, ratio, 0.1, 100.0); - glMatrixMode (GL_MODELVIEW); - glLoadIdentity (); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); } -static int lv_gltest_events (VisPluginData *plugin, VisEventQueue *events) -{ - GLtestPrivate *priv = visual_plugin_get_private (plugin); - VisEvent ev; - VisParam *param; +static int lv_gltest_events(VisPluginData *plugin, VisEventQueue *events) { + GLtestPrivate *priv = visual_plugin_get_private(plugin); + VisEvent ev; + VisParam *param; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_gltest_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_gltest_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; - case VISUAL_EVENT_PARAM: - param = ev.event.param.param; + case VISUAL_EVENT_PARAM: + param = ev.event.param.param; - if (visual_param_has_name (param, "transparent_bars")) { - priv->transparent = visual_param_get_value_bool (param); + if (visual_param_has_name(param, "transparent_bars")) { + priv->transparent = visual_param_get_value_bool(param); - if (priv->transparent == FALSE) - glDisable (GL_BLEND); - else - glEnable (GL_BLEND); - } + if (priv->transparent == FALSE) + glDisable(GL_BLEND); + else + glEnable(GL_BLEND); + } - default: /* to avoid warnings */ - break; - } - } + default: /* to avoid warnings */ + break; + } + } - return TRUE; + return TRUE; } -static VisPalette *lv_gltest_palette (VisPluginData *plugin) -{ - return NULL; -} +static VisPalette *lv_gltest_palette(VisPluginData *plugin) { return NULL; } -static void lv_gltest_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - GLtestPrivate *priv = visual_plugin_get_private (plugin); +static void lv_gltest_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + GLtestPrivate *priv = visual_plugin_get_private(plugin); - int i,c; - int y; - float ff; + int i, c; + int y; + float ff; - VisBuffer *pcm_buffer = visual_buffer_new_allocate (512 * sizeof (float)); - visual_audio_get_sample_mixed_simple (audio, pcm_buffer, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); + VisBuffer *pcm_buffer = visual_buffer_new_allocate(512 * sizeof(float)); + visual_audio_get_sample_mixed_simple(audio, pcm_buffer, 2, + VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); - VisBuffer *freq_buffer = visual_buffer_new_allocate (256 * sizeof (float)); - visual_audio_get_spectrum_for_sample (freq_buffer, pcm_buffer, TRUE); + VisBuffer *freq_buffer = visual_buffer_new_allocate(256 * sizeof(float)); + visual_audio_get_spectrum_for_sample(freq_buffer, pcm_buffer, TRUE); - visual_buffer_unref (pcm_buffer); + visual_buffer_unref(pcm_buffer); - float *freq = (float *) visual_buffer_get_data (freq_buffer); + float *freq = (float *)visual_buffer_get_data(freq_buffer); - for (y = BARS - 1; y > 0; y--) - { - for(i = 0; i < BARS; i++) - { - priv->heights[y][i] = priv->heights[y - 1][i]; - } - } + for (y = BARS - 1; y > 0; y--) { + for (i = 0; i < BARS; i++) { + priv->heights[y][i] = priv->heights[y - 1][i]; + } + } - for (i = 0; i < BARS; i++) - { - ff = 0; - for (c = xranges[i]; c < xranges[i + 1]; c++) - { - if (freq[c] > ff) - ff = freq[c]; - } + for (i = 0; i < BARS; i++) { + ff = 0; + for (c = xranges[i]; c < xranges[i + 1]; c++) { + if (freq[c] > ff) + ff = freq[c]; + } - priv->heights[0][i] = ff * 10; - } + priv->heights[0][i] = ff * 10; + } - const float seconds_elapsed = visual_timer_elapsed_msecs(priv->started_at) / 1000.0f; + const float seconds_elapsed = + visual_timer_elapsed_msecs(priv->started_at) / 1000.0f; - priv->x_angle = fmodf(priv->x_initial_angle + priv->x_speed * seconds_elapsed, 360.0); - priv->y_angle = fmodf(priv->y_initial_angle + priv->y_speed * seconds_elapsed, 360.0); - priv->z_angle = fmodf(priv->z_initial_angle + priv->z_speed * seconds_elapsed, 360.0); + priv->x_angle = + fmodf(priv->x_initial_angle + priv->x_speed * seconds_elapsed, 360.0); + priv->y_angle = + fmodf(priv->y_initial_angle + priv->y_speed * seconds_elapsed, 360.0); + priv->z_angle = + fmodf(priv->z_initial_angle + priv->z_speed * seconds_elapsed, 360.0); - draw_bars (priv); + draw_bars(priv); - visual_buffer_unref (freq_buffer); + visual_buffer_unref(freq_buffer); } /* Drawing stuff */ -static void draw_rectangle (GLtestPrivate *priv, GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2) -{ - glEnableClientState(GL_VERTEX_ARRAY); - if (y1 == y2) { - - const GLfloat vertices[] = { - x1, y1, z1, - x2, y1, z1, - x2, y2, z2, - - x2, y2, z2, - x1, y2, z2, - x1, y1, z1, - - }; - glVertexPointer(3, GL_FLOAT, 0, vertices); - glDrawArrays(GL_TRIANGLES, 0, 6); - - } else { - const GLfloat vertices[] = { - x1, y1, z1, - x2, y1, z2, - x2, y2, z2, - - x2, y2, z2, - x1, y2, z1, - x1, y1, z1, - }; - glVertexPointer(3, GL_FLOAT, 0, vertices); - glDrawArrays(GL_TRIANGLES, 0, 6); - } - glDisableClientState(GL_VERTEX_ARRAY); +static void draw_rectangle(GLtestPrivate *priv, GLfloat x1, GLfloat y1, + GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2) { + glEnableClientState(GL_VERTEX_ARRAY); + if (y1 == y2) { + + const GLfloat vertices[] = { + x1, y1, z1, x2, y1, z1, x2, y2, z2, + + x2, y2, z2, x1, y2, z2, x1, y1, z1, + + }; + glVertexPointer(3, GL_FLOAT, 0, vertices); + glDrawArrays(GL_TRIANGLES, 0, 6); + + } else { + const GLfloat vertices[] = { + x1, y1, z1, x2, y1, z2, x2, y2, z2, + + x2, y2, z2, x1, y2, z1, x1, y1, z1, + }; + glVertexPointer(3, GL_FLOAT, 0, vertices); + glDrawArrays(GL_TRIANGLES, 0, 6); + } + glDisableClientState(GL_VERTEX_ARRAY); } -static void draw_bar (GLtestPrivate *priv, GLfloat x_offset, GLfloat z_offset, GLfloat height, GLfloat red, GLfloat green, GLfloat blue) -{ - GLfloat width = 0.1; +static void draw_bar(GLtestPrivate *priv, GLfloat x_offset, GLfloat z_offset, + GLfloat height, GLfloat red, GLfloat green, GLfloat blue) { + GLfloat width = 0.1; - glColor4f(red, green, blue, 1.0f); + glColor4f(red, green, blue, 1.0f); - draw_rectangle (priv, x_offset, height, z_offset, x_offset + width, height, z_offset + 0.1); - draw_rectangle (priv, x_offset, 0, z_offset, x_offset + width, 0, z_offset + 0.1); + draw_rectangle(priv, x_offset, height, z_offset, x_offset + width, height, + z_offset + 0.1); + draw_rectangle(priv, x_offset, 0, z_offset, x_offset + width, 0, + z_offset + 0.1); - glColor4f(0.5 * red, 0.5 * green, 0.5 * blue, 1.0f); - draw_rectangle (priv, x_offset, 0.0, z_offset + 0.1, x_offset + width, height, z_offset + 0.1); - draw_rectangle (priv, x_offset, 0.0, z_offset, x_offset + width, height, z_offset ); + glColor4f(0.5 * red, 0.5 * green, 0.5 * blue, 1.0f); + draw_rectangle(priv, x_offset, 0.0, z_offset + 0.1, x_offset + width, height, + z_offset + 0.1); + draw_rectangle(priv, x_offset, 0.0, z_offset, x_offset + width, height, + z_offset); - glColor4f(0.25 * red, 0.25 * green, 0.25 * blue, 1.0f); - draw_rectangle (priv, x_offset, 0.0, z_offset , x_offset, height, z_offset + 0.1); - draw_rectangle (priv, x_offset + width, 0.0, z_offset , x_offset + width, height, z_offset + 0.1); + glColor4f(0.25 * red, 0.25 * green, 0.25 * blue, 1.0f); + draw_rectangle(priv, x_offset, 0.0, z_offset, x_offset, height, + z_offset + 0.1); + draw_rectangle(priv, x_offset + width, 0.0, z_offset, x_offset + width, + height, z_offset + 0.1); } -static void draw_bars (GLtestPrivate *priv) -{ - int x,y; - GLfloat x_offset, z_offset, r_base, b_base; +static void draw_bars(GLtestPrivate *priv) { + int x, y; + GLfloat x_offset, z_offset, r_base, b_base; - glClearColor (0,0,0,0); - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glPushMatrix (); - glTranslatef (0.0,-0.5,-5.0); - glRotatef (priv->x_angle,1.0,0.0,0.0); - glRotatef (priv->y_angle,0.0,1.0,0.0); - glRotatef (priv->z_angle,0.0,0.0,1.0); + glPushMatrix(); + glTranslatef(0.0, -0.5, -5.0); + glRotatef(priv->x_angle, 1.0, 0.0, 0.0); + glRotatef(priv->y_angle, 0.0, 1.0, 0.0); + glRotatef(priv->z_angle, 0.0, 0.0, 1.0); - for (y = 0; y < 16; y++) - { - z_offset = -1.6 + ((15 - y) * 0.2); + for (y = 0; y < 16; y++) { + z_offset = -1.6 + ((15 - y) * 0.2); - b_base = y * (1.0 / 15); - r_base = 1.0 - b_base; + b_base = y * (1.0 / 15); + r_base = 1.0 - b_base; - for(x = 0; x < 16; x++) - { - x_offset = -1.6 + (x * 0.2); - draw_bar (priv, x_offset, z_offset, priv->heights[y][x] * 0.2, r_base - (x * (r_base / 15.0)), x * (1.0 / 15), b_base); - } - } + for (x = 0; x < 16; x++) { + x_offset = -1.6 + (x * 0.2); + draw_bar(priv, x_offset, z_offset, priv->heights[y][x] * 0.2, + r_base - (x * (r_base / 15.0)), x * (1.0 / 15), b_base); + } + } - glPopMatrix (); + glPopMatrix(); } diff --git a/libvisual-plugins/plugins/actor/lv_scope/actor_lv_scope.c b/libvisual-plugins/plugins/actor/lv_scope/actor_lv_scope.c index 53fd8ee1e..69eccd853 100644 --- a/libvisual-plugins/plugins/actor/lv_scope/actor_lv_scope.c +++ b/libvisual-plugins/plugins/actor/lv_scope/actor_lv_scope.c @@ -31,278 +31,262 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #define PCM_SIZE 512 typedef struct { - VisPalette *pal; - VisBuffer *pcm; - double n, b, x, y, i, v, w, h, color, linesize, skip, drawmode, t, d; - double zo, z1, r1, r2, r3; - int channel_source, needs_init; - VisTimer *timer; + VisPalette *pal; + VisBuffer *pcm; + double n, b, x, y, i, v, w, h, color, linesize, skip, drawmode, t, d; + double zo, z1, r1, r2, r3; + int channel_source, needs_init; + VisTimer *timer; } ScopePrivate; -static int lv_scope_init (VisPluginData *plugin); -static void lv_scope_cleanup (VisPluginData *plugin); -static void lv_scope_requisition (VisPluginData *plugin, int *width, int *height); -static void lv_scope_resize (VisPluginData *plugin, int width, int height); -static int lv_scope_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_scope_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_scope_palette (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = lv_scope_requisition, - .palette = lv_scope_palette, - .render = lv_scope_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "lv_scope", - .name = "libvisual scope", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("Libvisual scope plugin"), - .help = N_("This is a test plugin that'll display a simple scope"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_scope_init, - .cleanup = lv_scope_cleanup, - .events = lv_scope_events, - .plugin = &actor - }; - - return &info; +static int lv_scope_init(VisPluginData *plugin); +static void lv_scope_cleanup(VisPluginData *plugin); +static void lv_scope_requisition(VisPluginData *plugin, int *width, + int *height); +static void lv_scope_resize(VisPluginData *plugin, int width, int height); +static int lv_scope_events(VisPluginData *plugin, VisEventQueue *events); +static void lv_scope_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *lv_scope_palette(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = lv_scope_requisition, + .palette = lv_scope_palette, + .render = lv_scope_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "lv_scope", + .name = "libvisual scope", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("Libvisual scope plugin"), + .help = N_("This is a test plugin that'll display a simple scope"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_scope_init, + .cleanup = lv_scope_cleanup, + .events = lv_scope_events, + .plugin = &actor}; + + return &info; } -static int lv_scope_init (VisPluginData *plugin) -{ - ScopePrivate *priv; +static int lv_scope_init(VisPluginData *plugin) { + ScopePrivate *priv; #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - priv = visual_mem_new0 (ScopePrivate, 1); - visual_plugin_set_private (plugin, priv); + priv = visual_mem_new0(ScopePrivate, 1); + visual_plugin_set_private(plugin, priv); - priv->pal = visual_palette_new (256); + priv->pal = visual_palette_new(256); - priv->pcm = visual_buffer_new_allocate (sizeof (float) * PCM_SIZE); + priv->pcm = visual_buffer_new_allocate(sizeof(float) * PCM_SIZE); - priv->needs_init = TRUE; + priv->needs_init = TRUE; - priv->timer = visual_timer_new(); + priv->timer = visual_timer_new(); - return TRUE; + return TRUE; } -static void lv_scope_cleanup (VisPluginData *plugin) -{ - ScopePrivate *priv = visual_plugin_get_private (plugin); +static void lv_scope_cleanup(VisPluginData *plugin) { + ScopePrivate *priv = visual_plugin_get_private(plugin); - visual_palette_free (priv->pal); + visual_palette_free(priv->pal); - visual_buffer_unref (priv->pcm); + visual_buffer_unref(priv->pcm); - visual_timer_free(priv->timer); + visual_timer_free(priv->timer); - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_scope_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void lv_scope_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - while (reqw % 2 || (reqw / 2) % 2) - reqw--; + while (reqw % 2 || (reqw / 2) % 2) + reqw--; - while (reqh % 2 || (reqh / 2) % 2) - reqh--; + while (reqh % 2 || (reqh / 2) % 2) + reqh--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static void lv_scope_resize (VisPluginData *plugin, int width, int height) -{ -} +static void lv_scope_resize(VisPluginData *plugin, int width, int height) {} + +static int lv_scope_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; -static int lv_scope_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_scope_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; - default: /* to avoid warnings */ - break; - } + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_scope_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; + default: /* to avoid warnings */ + break; } + } - return TRUE; + return TRUE; } -static VisPalette *lv_scope_palette (VisPluginData *plugin) -{ - ScopePrivate *priv = visual_plugin_get_private (plugin); - VisColor *pal_colors = visual_palette_get_colors (priv->pal); - int i; +static VisPalette *lv_scope_palette(VisPluginData *plugin) { + ScopePrivate *priv = visual_plugin_get_private(plugin); + VisColor *pal_colors = visual_palette_get_colors(priv->pal); + int i; - for (i = 0; i < 256; i++) { - pal_colors[i].r = i; - pal_colors[i].g = i; - pal_colors[i].b = i; - } + for (i = 0; i < 256; i++) { + pal_colors[i].r = i; + pal_colors[i].g = i; + pal_colors[i].b = i; + } - return priv->pal; + return priv->pal; } -static void run_init(ScopePrivate *priv) -{ - priv->n = 128; - priv->zo = 0; - priv->d = 0; - visual_timer_start(priv->timer); +static void run_init(ScopePrivate *priv) { + priv->n = 128; + priv->zo = 0; + priv->d = 0; + visual_timer_start(priv->timer); } -static void run_frame(ScopePrivate *priv) -{ - priv->zo=visual_timer_elapsed_usecs(priv->timer) / 1000.0 / 1000.0; - priv->r1=1/7.0; - priv->r2=4/9.0; - priv->r3=5/3.0; - priv->d += priv->zo; +static void run_frame(ScopePrivate *priv) { + priv->zo = visual_timer_elapsed_usecs(priv->timer) / 1000.0 / 1000.0; + priv->r1 = 1 / 7.0; + priv->r2 = 4 / 9.0; + priv->r3 = 5 / 3.0; + priv->d += priv->zo; } -static void run_beat(ScopePrivate *priv) -{ - priv->zo = visual_timer_elapsed_msecs(priv->timer) + 1000; +static void run_beat(ScopePrivate *priv) { + priv->zo = visual_timer_elapsed_msecs(priv->timer) + 1000; } -static void run_point(ScopePrivate *priv) -{ - priv->r1=priv->r2*9333.2312311+priv->r3*33222.93329; - priv->r1=priv->r1-floor(priv->r1); - priv->r2=priv->r3*6233.73553+priv->r1*9423.1323219; - priv->r2=priv->r2-floor(priv->r2); - priv->r3=priv->r1*373.871324+priv->r2*43322.4323441; - priv->r3=priv->r3-floor(priv->r3); - - priv->z1=priv->r3-priv->zo; - priv->z1=.5/(priv->z1-floor(priv->z1)+.2); - - priv->x=(priv->r2*2-1)*priv->z1; - priv->y=(priv->r1*2-1)*priv->z1; - priv->color=(1-exp(-priv->z1*priv->z1)) * 255.0; -} +static void run_point(ScopePrivate *priv) { + priv->r1 = priv->r2 * 9333.2312311 + priv->r3 * 33222.93329; + priv->r1 = priv->r1 - floor(priv->r1); + priv->r2 = priv->r3 * 6233.73553 + priv->r1 * 9423.1323219; + priv->r2 = priv->r2 - floor(priv->r2); + priv->r3 = priv->r1 * 373.871324 + priv->r2 * 43322.4323441; + priv->r3 = priv->r3 - floor(priv->r3); -static void lv_scope_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - ScopePrivate *priv = visual_plugin_get_private (plugin); - VisColor col; - float *pcmbuf; - int y, x; - int video_width, video_height, video_pitch; - uint8_t *buf; - int isBeat = 0; + priv->z1 = priv->r3 - priv->zo; + priv->z1 = .5 / (priv->z1 - floor(priv->z1) + .2); - int a, l; - int ws=(priv->channel_source&4)?1:0; - int xorv = (ws*128)^128; - int size = visual_video_get_width(video)/4.0; + priv->x = (priv->r2 * 2 - 1) * priv->z1; + priv->y = (priv->r1 * 2 - 1) * priv->z1; + priv->color = (1 - exp(-priv->z1 * priv->z1)) * 255.0; +} - video_width = visual_video_get_width (video); - video_height = visual_video_get_height (video); - video_pitch = visual_video_get_pitch (video); +static void lv_scope_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + ScopePrivate *priv = visual_plugin_get_private(plugin); + VisColor col; + float *pcmbuf; + int y, x; + int video_width, video_height, video_pitch; + uint8_t *buf; + int isBeat = 0; - visual_audio_get_sample_mixed_simple (audio, priv->pcm, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); + int a, l; + int ws = (priv->channel_source & 4) ? 1 : 0; + int xorv = (ws * 128) ^ 128; + int size = visual_video_get_width(video) / 4.0; - pcmbuf = visual_buffer_get_data (priv->pcm); + video_width = visual_video_get_width(video); + video_height = visual_video_get_height(video); + video_pitch = visual_video_get_pitch(video); - buf = (uint8_t *) visual_video_get_pixels (video); + visual_audio_get_sample_mixed_simple(audio, priv->pcm, 2, + VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); - visual_color_set(&col, 0, 0, 0); + pcmbuf = visual_buffer_get_data(priv->pcm); - visual_video_fill_color(video, &col); + buf = (uint8_t *)visual_video_get_pixels(video); - // Star field + visual_color_set(&col, 0, 0, 0); - if(priv->needs_init) - { - run_init(priv); - priv->needs_init = FALSE; - } + visual_video_fill_color(video, &col); - priv->h = video_height; - priv->w = video_width; - priv->b = 0; + // Star field - run_frame(priv); + if (priv->needs_init) { + run_init(priv); + priv->needs_init = FALSE; + } - if(isBeat) - run_beat(priv); + priv->h = video_height; + priv->w = video_width; + priv->b = 0; - l = priv->n; + run_frame(priv); - if(l >= 128*size) - l = 128*size - 1; + if (isBeat) + run_beat(priv); + l = priv->n; - for(a = 0; a < l; a++) - { - double r=(a*size)/(double)l; - double s1=r-(int)r; - int val1 = (pcmbuf[(int)r]/(float)UCHAR_MAX + 1) / 2.0 * 128; - int val2 = (pcmbuf[(int)r+1]/(float)UCHAR_MAX + 1) / 2.0 * 128; - double yr = (val1^xorv)*(1.0-s1)+(val2^xorv)*(s1); - priv->y = yr/128.0; - priv->i = (double)a/(double)(l-1); + if (l >= 128 * size) + l = 128 * size - 1; - run_point(priv); + for (a = 0; a < l; a++) { + double r = (a * size) / (double)l; + double s1 = r - (int)r; + int val1 = (pcmbuf[(int)r] / (float)UCHAR_MAX + 1) / 2.0 * 128; + int val2 = (pcmbuf[(int)r + 1] / (float)UCHAR_MAX + 1) / 2.0 * 128; + double yr = (val1 ^ xorv) * (1.0 - s1) + (val2 ^ xorv) * (s1); + priv->y = yr / 128.0; + priv->i = (double)a / (double)(l - 1); - uint8_t this_color = priv->color; + run_point(priv); - x = (int)((priv->x + 1) * (double)video_width * 0.5); - y = (int)((priv->y + 1) * (double)video_height * 0.5); + uint8_t this_color = priv->color; - if(y >= 0 && y < video_height && x >= 0 && x < video_width) - { - buf[x+y*video_width] = this_color; - } + x = (int)((priv->x + 1) * (double)video_width * 0.5); + y = (int)((priv->y + 1) * (double)video_height * 0.5); + + if (y >= 0 && y < video_height && x >= 0 && x < video_width) { + buf[x + y * video_width] = this_color; } + } - // Scope - const int max_displacement = video_height / 4; - const int y_origin = video_height / 2; - int i; + // Scope + const int max_displacement = video_height / 4; + const int y_origin = video_height / 2; + int i; - for (i = 0; i < video_width; i++) { - int j; + for (i = 0; i < video_width; i++) { + int j; - const int y_tip = y_origin + (pcmbuf[(i >> 1) % PCM_SIZE] * (max_displacement)); + const int y_tip = + y_origin + (pcmbuf[(i >> 1) % PCM_SIZE] * (max_displacement)); - if (y_tip > y_origin) { - for (j = y_origin; j < y_tip; j++) - buf[(j * video_pitch) + i] = 255; - } else { - for (j = y_tip; j <= y_origin; j++) - buf[(j * video_pitch) + i] = 255; - } + if (y_tip > y_origin) { + for (j = y_origin; j < y_tip; j++) + buf[(j * video_pitch) + i] = 255; + } else { + for (j = y_tip; j <= y_origin; j++) + buf[(j * video_pitch) + i] = 255; } + } } - diff --git a/libvisual-plugins/plugins/actor/madspin/madspin.c b/libvisual-plugins/plugins/actor/madspin/madspin.c index 1d633eda4..085a63084 100644 --- a/libvisual-plugins/plugins/actor/madspin/madspin.c +++ b/libvisual-plugins/plugins/actor/madspin/madspin.c @@ -36,438 +36,428 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR typedef struct { - int initialized; + int initialized; - int draw_mode; + int draw_mode; - GLuint textures[2]; - VisVideo *texture_images[2]; + GLuint textures[2]; + VisVideo *texture_images[2]; - int maxlines; - float texsize; - float xrot; - float yrot; - float zrot; - float total; - float frame; + int maxlines; + float texsize; + float xrot; + float yrot; + float zrot; + float total; + float frame; - float gdata[256]; + float gdata[256]; - VisTimer *timer; + VisTimer *timer; - /* Config */ - int num_stars; - int speed; + /* Config */ + int num_stars; + int speed; - VisRandomContext *rcontext; + VisRandomContext *rcontext; } MadspinPrivate; -static int lv_madspin_init (VisPluginData *plugin); -static void lv_madspin_cleanup (VisPluginData *plugin); -static void lv_madspin_requisition (VisPluginData *plugin, int *width, int *height); -static void lv_madspin_resize (VisPluginData *plugin, int width, int height); -static int lv_madspin_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_madspin_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_madspin_palette (VisPluginData *plugin); +static int lv_madspin_init(VisPluginData *plugin); +static void lv_madspin_cleanup(VisPluginData *plugin); +static void lv_madspin_requisition(VisPluginData *plugin, int *width, + int *height); +static void lv_madspin_resize(VisPluginData *plugin, int width, int height); +static int lv_madspin_events(VisPluginData *plugin, VisEventQueue *events); +static void lv_madspin_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *lv_madspin_palette(VisPluginData *plugin); -static int madspin_load_textures (MadspinPrivate *priv); -static int madspin_sound (MadspinPrivate *priv, VisAudio *audio); -static int madspin_draw (MadspinPrivate *priv, VisVideo *video); +static int madspin_load_textures(MadspinPrivate *priv); +static int madspin_sound(MadspinPrivate *priv, VisAudio *audio); +static int madspin_draw(MadspinPrivate *priv, VisVideo *video); /* Main plugin stuff */ -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = lv_madspin_requisition, - .palette = lv_madspin_palette, - .render = lv_madspin_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_GL - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "madspin", - .name = "libvisual madspin port", - .author = N_("Original by: Andrew Birck , Port by: Dennis Smit "), - .version = "0.1", - .about = N_("Libvisual madspin plugin"), - .help = N_("This plugin shows a nifty visual effect using openGL"), - .license = VISUAL_PLUGIN_LICENSE_GPL, - - .init = lv_madspin_init, - .cleanup = lv_madspin_cleanup, - .events = lv_madspin_events, - .plugin = &actor - }; - - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, 1); - - return &info; +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = lv_madspin_requisition, + .palette = lv_madspin_palette, + .render = lv_madspin_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_GL}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "madspin", + .name = "libvisual madspin port", + .author = N_("Original by: Andrew Birck , Port by: " + "Dennis Smit "), + .version = "0.1", + .about = N_("Libvisual madspin plugin"), + .help = N_("This plugin shows a nifty visual effect using openGL"), + .license = VISUAL_PLUGIN_LICENSE_GPL, + + .init = lv_madspin_init, + .cleanup = lv_madspin_cleanup, + .events = lv_madspin_events, + .plugin = &actor}; + + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, + 1); + + return &info; } -static int lv_madspin_init (VisPluginData *plugin) -{ +static int lv_madspin_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - MadspinPrivate *priv = visual_mem_new0 (MadspinPrivate, 1); - visual_plugin_set_private (plugin, priv); + MadspinPrivate *priv = visual_mem_new0(MadspinPrivate, 1); + visual_plugin_set_private(plugin, priv); - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_integer ("num_stars", N_("Number of stars"), - 512, - NULL), - visual_param_new_integer ("speed", N_("Speed"), - 715, - NULL), - NULL); + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, + visual_param_new_integer("num_stars", N_("Number of stars"), 512, NULL), + visual_param_new_integer("speed", N_("Speed"), 715, NULL), NULL); - priv->rcontext = visual_plugin_get_random_context (plugin); + priv->rcontext = visual_plugin_get_random_context(plugin); - priv->maxlines = 1; - priv->texsize = 0.25f; - priv->xrot = 0.0f; - priv->yrot = 0.0f; - priv->zrot = 0.0f; - priv->total = 0; - priv->frame = 0; - priv->num_stars = 512; - priv->speed = 715; + priv->maxlines = 1; + priv->texsize = 0.25f; + priv->xrot = 0.0f; + priv->yrot = 0.0f; + priv->zrot = 0.0f; + priv->total = 0; + priv->frame = 0; + priv->num_stars = 512; + priv->speed = 715; - priv->timer = visual_timer_new (); + priv->timer = visual_timer_new(); - priv->initialized = TRUE; + priv->initialized = TRUE; - madspin_load_textures (priv); + madspin_load_textures(priv); - return TRUE; + return TRUE; } -static void lv_madspin_cleanup (VisPluginData *plugin) -{ - MadspinPrivate *priv = visual_plugin_get_private (plugin); +static void lv_madspin_cleanup(VisPluginData *plugin) { + MadspinPrivate *priv = visual_plugin_get_private(plugin); - if (priv->initialized == TRUE) { - visual_timer_free (priv->timer); + if (priv->initialized == TRUE) { + visual_timer_free(priv->timer); - visual_video_unref (priv->texture_images[0]); - visual_video_unref (priv->texture_images[1]); + visual_video_unref(priv->texture_images[0]); + visual_video_unref(priv->texture_images[1]); - glDeleteTextures (2, priv->textures); - } + glDeleteTextures(2, priv->textures); + } - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_madspin_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void lv_madspin_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - if (reqw < 1) - reqw = 1; + if (reqw < 1) + reqw = 1; - if (reqh < 1) - reqh = 1; + if (reqh < 1) + reqh = 1; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } - -static void bind_texture (GLuint texture, VisVideo *image) -{ - glBindTexture (GL_TEXTURE_2D, texture); - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, visual_video_get_width (image), visual_video_get_height (image), 0, - GL_RGB, GL_UNSIGNED_BYTE, visual_video_get_pixels (image)); +static void bind_texture(GLuint texture, VisVideo *image) { + glBindTexture(GL_TEXTURE_2D, texture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, visual_video_get_width(image), + visual_video_get_height(image), 0, GL_RGB, GL_UNSIGNED_BYTE, + visual_video_get_pixels(image)); } -static void lv_madspin_setup_gl (VisPluginData *plugin) -{ - MadspinPrivate *priv = visual_plugin_get_private (plugin); +static void lv_madspin_setup_gl(VisPluginData *plugin) { + MadspinPrivate *priv = visual_plugin_get_private(plugin); - /* GL and the such */ - glMatrixMode (GL_PROJECTION); + /* GL and the such */ + glMatrixMode(GL_PROJECTION); - glLoadIdentity (); + glLoadIdentity(); #ifdef USE_OPENGL_ES - glOrthof (-4.0f, 4.0f, -4.0f, 4.0f, -18.0f, 18.0f); + glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, -18.0f, 18.0f); #else - glOrtho (-4.0, 4.0, -4.0, 4.0, -18.0, 18.0); + glOrtho(-4.0, 4.0, -4.0, 4.0, -18.0, 18.0); #endif - glMatrixMode (GL_MODELVIEW); - glLoadIdentity (); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); - glDisable (GL_DEPTH_TEST); + glDisable(GL_DEPTH_TEST); - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glShadeModel (GL_SMOOTH); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glShadeModel(GL_SMOOTH); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); #ifdef USE_OPENGL_ES - glClearDepthf (1.0f); + glClearDepthf(1.0f); #else - glClearDepth (1.0); + glClearDepth(1.0); #endif - glBlendFunc (GL_SRC_ALPHA,GL_ONE); - glEnable (GL_BLEND); - glEnable (GL_TEXTURE_2D); - glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - - glGenTextures (2, priv->textures); - bind_texture (priv->textures[0], priv->texture_images[0]); - bind_texture (priv->textures[1], priv->texture_images[1]); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + + glGenTextures(2, priv->textures); + bind_texture(priv->textures[0], priv->texture_images[0]); + bind_texture(priv->textures[1], priv->texture_images[1]); } -static void lv_madspin_resize (VisPluginData *plugin, int width, int height) -{ - glViewport (0, 0, width, height); +static void lv_madspin_resize(VisPluginData *plugin, int width, int height) { + glViewport(0, 0, width, height); - lv_madspin_setup_gl (plugin); + lv_madspin_setup_gl(plugin); } -static int lv_madspin_events (VisPluginData *plugin, VisEventQueue *events) -{ - MadspinPrivate *priv = visual_plugin_get_private (plugin); - VisEvent ev; - VisParam *param; +static int lv_madspin_events(VisPluginData *plugin, VisEventQueue *events) { + MadspinPrivate *priv = visual_plugin_get_private(plugin); + VisEvent ev; + VisParam *param; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_madspin_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_madspin_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; - case VISUAL_EVENT_PARAM: - param = ev.event.param.param; + case VISUAL_EVENT_PARAM: + param = ev.event.param.param; - if (visual_param_has_name (param, "num stars")) - priv->num_stars = visual_param_get_value_integer (param); - else if (visual_param_has_name (param, "speed")) - priv->speed = visual_param_get_value_integer (param); + if (visual_param_has_name(param, "num stars")) + priv->num_stars = visual_param_get_value_integer(param); + else if (visual_param_has_name(param, "speed")) + priv->speed = visual_param_get_value_integer(param); - default: /* to avoid warnings */ - break; - } - } + default: /* to avoid warnings */ + break; + } + } - return TRUE; + return TRUE; } -static VisPalette *lv_madspin_palette (VisPluginData *plugin) -{ - return NULL; -} +static VisPalette *lv_madspin_palette(VisPluginData *plugin) { return NULL; } -static void lv_madspin_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - MadspinPrivate *priv = visual_plugin_get_private (plugin); +static void lv_madspin_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + MadspinPrivate *priv = visual_plugin_get_private(plugin); - madspin_sound (priv, audio); - madspin_draw (priv, video); + madspin_sound(priv, audio); + madspin_draw(priv, video); } -static int madspin_load_textures (MadspinPrivate *priv) -{ - priv->texture_images[0] = visual_video_load_from_file (STAR_DIR "/star1.bmp"); - if (!priv->texture_images[0]) { - visual_log (VISUAL_LOG_ERROR, "Failed to load first texture"); - return FALSE; - } - - priv->texture_images[1] = visual_video_load_from_file (STAR_DIR "/star2.bmp"); - if (!priv->texture_images[1]) { - visual_log (VISUAL_LOG_ERROR, "Failed to load second texture"); - return FALSE; - } - - return TRUE; -} - -static int madspin_sound (MadspinPrivate *priv, VisAudio *audio) -{ - int i; - VisBuffer* buffer; - VisBuffer* pcmb; - float freq[256]; - float pcm[256]; - - buffer = visual_buffer_new_wrap_data (freq, sizeof (freq), FALSE); - pcmb = visual_buffer_new_wrap_data (pcm, sizeof (pcm), FALSE); +static int madspin_load_textures(MadspinPrivate *priv) { + priv->texture_images[0] = visual_video_load_from_file(STAR_DIR "/star1.bmp"); + if (!priv->texture_images[0]) { + visual_log(VISUAL_LOG_ERROR, "Failed to load first texture"); + return FALSE; + } - visual_audio_get_sample_mixed_simple (audio, pcmb, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); + priv->texture_images[1] = visual_video_load_from_file(STAR_DIR "/star2.bmp"); + if (!priv->texture_images[1]) { + visual_log(VISUAL_LOG_ERROR, "Failed to load second texture"); + return FALSE; + } - visual_audio_get_spectrum_for_sample (buffer, pcmb, TRUE); - - visual_buffer_unref (buffer); - visual_buffer_unref (pcmb); + return TRUE; +} - /* Make our data from the freq data */ - for (i = 0; i < 256; i++) { - priv->gdata[i] = (float) freq[i] * 2000.0; +static int madspin_sound(MadspinPrivate *priv, VisAudio *audio) { + int i; + VisBuffer *buffer; + VisBuffer *pcmb; + float freq[256]; + float pcm[256]; - if (priv->gdata[i] > 1.0) - priv->gdata[i] = 1.0; - if (i > 80) - priv->gdata[i] = priv->gdata[i] * (2 + (i /256)); - } + buffer = visual_buffer_new_wrap_data(freq, sizeof(freq), FALSE); + pcmb = visual_buffer_new_wrap_data(pcm, sizeof(pcm), FALSE); - return 0; -} + visual_audio_get_sample_mixed_simple( + audio, pcmb, 2, VISUAL_AUDIO_CHANNEL_LEFT, VISUAL_AUDIO_CHANNEL_RIGHT); -static int madspin_draw (MadspinPrivate *priv, VisVideo *video) -{ - double csab, csapb; - double snab, snapb; - double sa, ca, s5; - double s1r, s1g, s1b, s1a; - double s2r, s2g, s2b, s2a; - float point; - int line; - int trail = 40; - float b; - float aa, a; - double x, y, z; - int i; - int ampl = 200; - float elapsed_time; - - const GLfloat vertices[4][2] = { - { 1.0f, 1.0f }, - { -1.0f, 1.0f }, - { 1.0f, -1.0f }, - { -1.0f, -1.0f } - }; - - const GLfloat texcoords[4][2] = { - { 1.0f, 1.0f }, - { 0.0f, 1.0f }, - { 1.0f, 0.0f }, - { 0.0f, 0.0f } - }; - - visual_timer_start (priv->timer); - - for (i = 1; i < 50; i++) - priv->total += priv->gdata[i]; - - if (priv->total > 2.5) - priv->total = 2.5; - - priv->total /= 2.5f; - - glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glBlendFunc (GL_SRC_ALPHA,GL_ONE); - glClearColor (0.0f, 0.0f, 0.0f, 0.0f); - - glMatrixMode (GL_MODELVIEW); - glPushMatrix (); - glLoadIdentity (); - - glEnableClientState (GL_VERTEX_ARRAY); - glEnableClientState (GL_TEXTURE_COORD_ARRAY); - - glVertexPointer (2, GL_FLOAT, 0, vertices); - glTexCoordPointer (2, GL_FLOAT, 0, texcoords); - - for (line = priv->maxlines; line > 0; line--) { - for (point = 0; point <= priv->num_stars; point++) { - b = 1.5f + point / 33.33333f; - aa = trail - line * 1.0f; - a = (aa + priv->frame) / 33.33333f; - - csab = cos (a / b); - csapb = cos (a + b); - snab = sin (a / b); - snapb = sin (a + b); - - sa = sin (a * .1f); - ca = cos (a * .1f); - s5 = sin (a * .05f); - - x = sa * snapb * ampl * csab + ca * (csapb * ampl * b * csab + s5 * (ampl * (csab + 2 *snapb))); - y = sa * csapb * ampl * csab + ca * (csapb * ampl * b * snab + s5 * (ampl * (csab + 2 *csapb))); - z = ca * csapb * ampl * csab + ca * (snapb * ampl * b * snab + s5 * (ampl * (snab + 2 *snapb))); - - x /= 255.0f; - y /= 255.0f; - z /= 255.0f; - - glPushMatrix (); - - s1a = ((priv->gdata[(int) (point / priv->num_stars * 220)] + (priv->total / 200.0f)) / 4.0f); - s2a = (priv->gdata[(int) (point / priv->num_stars * 220)] / 2.0f ); - - if (s1a > 0.008f) { - s1r = ((point * 1.0f) / priv->num_stars); - s1g = (priv->num_stars - point) / (priv->num_stars * 1.0f); - s1b = ((point * 1.0f) / priv->num_stars) * 0.5f; - - priv->texsize = (((priv->gdata[(int) (point / priv->num_stars * 220)])) - / (2048.01f - (point * 4.0f))) * - (((point - priv->num_stars) / (-priv->num_stars)) * 18.0f) + 0.15f; - - glBindTexture (GL_TEXTURE_2D, priv->textures[0]); - glTranslatef ((float) x, (float) y, (float) z); - - glPushMatrix (); - glTranslatef (0.0f, 0.0f, (float) z); - glScalef (priv->texsize, priv->texsize, 1.0f); - glColor4f ((float) s1r, (float) s1g, (float) s1b, (float) s1a); - glDrawArrays (GL_TRIANGLE_STRIP, 0, 4); - glPopMatrix (); - } - - if (s2a > 0.005f) { - s2r = sin (priv->frame / 400.0f); - s2g = cos (priv->frame / 200.0f); - s2b = cos (priv->frame / 300.0f); + visual_audio_get_spectrum_for_sample(buffer, pcmb, TRUE); - priv->texsize = (((priv->gdata[(int) (point / priv->num_stars * 220)])) - / (2048.01f - (point * 4.0f))) * - (((point - priv->num_stars) / (-priv->num_stars)) * 18.0f) + 0.35f; + visual_buffer_unref(buffer); + visual_buffer_unref(pcmb); - priv->texsize *= ((visual_random_context_int(priv->rcontext) % 100) / 100.0f) * 2.0f; + /* Make our data from the freq data */ + for (i = 0; i < 256; i++) { + priv->gdata[i] = (float)freq[i] * 2000.0; - glBindTexture (GL_TEXTURE_2D, priv->textures[1]); - glRotatef (priv->frame + point, 0.0f, 0.0f, 1.0f); + if (priv->gdata[i] > 1.0) + priv->gdata[i] = 1.0; + if (i > 80) + priv->gdata[i] = priv->gdata[i] * (2 + (i / 256)); + } - glPushMatrix (); - glTranslatef (0.0f, 0.0f, (float) z); - glScalef (priv->texsize, priv->texsize, 1.0f); - glColor4f ((float) s2r, (float) s2g, (float) s2b, (float) s2a); - glDrawArrays (GL_TRIANGLE_STRIP, 0, 4); - glPopMatrix (); - } - - glPopMatrix (); - } - } + return 0; +} - glDisableClientState (GL_VERTEX_ARRAY); - glDisableClientState (GL_TEXTURE_COORD_ARRAY); +static int madspin_draw(MadspinPrivate *priv, VisVideo *video) { + double csab, csapb; + double snab, snapb; + double sa, ca, s5; + double s1r, s1g, s1b, s1a; + double s2r, s2g, s2b, s2a; + float point; + int line; + int trail = 40; + float b; + float aa, a; + double x, y, z; + int i; + int ampl = 200; + float elapsed_time; + + const GLfloat vertices[4][2] = { + {1.0f, 1.0f}, {-1.0f, 1.0f}, {1.0f, -1.0f}, {-1.0f, -1.0f}}; + + const GLfloat texcoords[4][2] = { + {1.0f, 1.0f}, {0.0f, 1.0f}, {1.0f, 0.0f}, {0.0f, 0.0f}}; + + visual_timer_start(priv->timer); + + for (i = 1; i < 50; i++) + priv->total += priv->gdata[i]; + + if (priv->total > 2.5) + priv->total = 2.5; + + priv->total /= 2.5f; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + glVertexPointer(2, GL_FLOAT, 0, vertices); + glTexCoordPointer(2, GL_FLOAT, 0, texcoords); + + for (line = priv->maxlines; line > 0; line--) { + for (point = 0; point <= priv->num_stars; point++) { + b = 1.5f + point / 33.33333f; + aa = trail - line * 1.0f; + a = (aa + priv->frame) / 33.33333f; + + csab = cos(a / b); + csapb = cos(a + b); + snab = sin(a / b); + snapb = sin(a + b); + + sa = sin(a * .1f); + ca = cos(a * .1f); + s5 = sin(a * .05f); + + x = sa * snapb * ampl * csab + + ca * (csapb * ampl * b * csab + s5 * (ampl * (csab + 2 * snapb))); + y = sa * csapb * ampl * csab + + ca * (csapb * ampl * b * snab + s5 * (ampl * (csab + 2 * csapb))); + z = ca * csapb * ampl * csab + + ca * (snapb * ampl * b * snab + s5 * (ampl * (snab + 2 * snapb))); + + x /= 255.0f; + y /= 255.0f; + z /= 255.0f; + + glPushMatrix(); + + s1a = ((priv->gdata[(int)(point / priv->num_stars * 220)] + + (priv->total / 200.0f)) / + 4.0f); + s2a = (priv->gdata[(int)(point / priv->num_stars * 220)] / 2.0f); + + if (s1a > 0.008f) { + s1r = ((point * 1.0f) / priv->num_stars); + s1g = (priv->num_stars - point) / (priv->num_stars * 1.0f); + s1b = ((point * 1.0f) / priv->num_stars) * 0.5f; + + priv->texsize = + (((priv->gdata[(int)(point / priv->num_stars * 220)])) / + (2048.01f - (point * 4.0f))) * + (((point - priv->num_stars) / (-priv->num_stars)) * 18.0f) + + 0.15f; + + glBindTexture(GL_TEXTURE_2D, priv->textures[0]); + glTranslatef((float)x, (float)y, (float)z); + + glPushMatrix(); + glTranslatef(0.0f, 0.0f, (float)z); + glScalef(priv->texsize, priv->texsize, 1.0f); + glColor4f((float)s1r, (float)s1g, (float)s1b, (float)s1a); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + glPopMatrix(); + } + + if (s2a > 0.005f) { + s2r = sin(priv->frame / 400.0f); + s2g = cos(priv->frame / 200.0f); + s2b = cos(priv->frame / 300.0f); + + priv->texsize = + (((priv->gdata[(int)(point / priv->num_stars * 220)])) / + (2048.01f - (point * 4.0f))) * + (((point - priv->num_stars) / (-priv->num_stars)) * 18.0f) + + 0.35f; - glPopMatrix (); + priv->texsize *= + ((visual_random_context_int(priv->rcontext) % 100) / 100.0f) * 2.0f; - elapsed_time = (float) visual_timer_elapsed_usecs (priv->timer) / 1000000; + glBindTexture(GL_TEXTURE_2D, priv->textures[1]); + glRotatef(priv->frame + point, 0.0f, 0.0f, 1.0f); - if (elapsed_time < 0) - elapsed_time = 0; + glPushMatrix(); + glTranslatef(0.0f, 0.0f, (float)z); + glScalef(priv->texsize, priv->texsize, 1.0f); + glColor4f((float)s2r, (float)s2g, (float)s2b, (float)s2a); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + glPopMatrix(); + } - priv->frame += elapsed_time * priv->speed; + glPopMatrix(); + } + } - return 0; + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + + glPopMatrix(); + + elapsed_time = (float)visual_timer_elapsed_usecs(priv->timer) / 1000000; + + if (elapsed_time < 0) + elapsed_time = 0; + + priv->frame += elapsed_time * priv->speed; + + return 0; } diff --git a/libvisual-plugins/plugins/actor/nastyfft/actor_nastyfft.c b/libvisual-plugins/plugins/actor/nastyfft/actor_nastyfft.c index 5a8656f07..9f45f38f7 100644 --- a/libvisual-plugins/plugins/actor/nastyfft/actor_nastyfft.c +++ b/libvisual-plugins/plugins/actor/nastyfft/actor_nastyfft.c @@ -31,382 +31,368 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #define SCOPE_DEPTH 16 typedef struct { - float cam_y; - float rot_x; - float step_z; - float fdist_z; - int nw; //=640; - int nh; //=480; - float heights[SCOPE_DEPTH][NUM_BANDS]; - float scale; //1.0 - GLuint CYLINDER; - int dx; - int catch; - int dy; + float cam_y; + float rot_x; + float step_z; + float fdist_z; + int nw; //=640; + int nh; //=480; + float heights[SCOPE_DEPTH][NUM_BANDS]; + float scale; // 1.0 + GLuint CYLINDER; + int dx; + int catch; + int dy; } NastyfftPrivate; -static int lv_nastyfft_init (VisPluginData *plugin); -static void lv_nastyfft_cleanup (VisPluginData *plugin); -static void lv_nastyfft_requisition (VisPluginData *plugin, int *width, int *height); -static void lv_nastyfft_resize (VisPluginData *plugin, int width, int height); -static int lv_nastyfft_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_nastyfft_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_nastyfft_palette (VisPluginData *plugin); - -static int nastyfft_sound (NastyfftPrivate *priv, VisAudio *audio); -static int nastyfft_draw (NastyfftPrivate *priv, VisVideo *video); - -static void init_gl (NastyfftPrivate *priv); -static void draw_scene (NastyfftPrivate *priv); -static void make_all (NastyfftPrivate *priv); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = lv_nastyfft_requisition, - .palette = lv_nastyfft_palette, - .render = lv_nastyfft_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_GL - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "nastyfft", - .name = N_("Libvisual NastyFFT plugin"), - .author = "yodor ", - .version = "0.5", - .about = N_("The Libvisual NastyFFT plugin"), - .help = N_("This plugin shows nasty fft visualization effect using OpenGL"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_nastyfft_init, - .cleanup = lv_nastyfft_cleanup, - .events = lv_nastyfft_events, - .plugin = &actor - }; - - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, 1); - - return &info; +static int lv_nastyfft_init(VisPluginData *plugin); +static void lv_nastyfft_cleanup(VisPluginData *plugin); +static void lv_nastyfft_requisition(VisPluginData *plugin, int *width, + int *height); +static void lv_nastyfft_resize(VisPluginData *plugin, int width, int height); +static int lv_nastyfft_events(VisPluginData *plugin, VisEventQueue *events); +static void lv_nastyfft_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *lv_nastyfft_palette(VisPluginData *plugin); + +static int nastyfft_sound(NastyfftPrivate *priv, VisAudio *audio); +static int nastyfft_draw(NastyfftPrivate *priv, VisVideo *video); + +static void init_gl(NastyfftPrivate *priv); +static void draw_scene(NastyfftPrivate *priv); +static void make_all(NastyfftPrivate *priv); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = lv_nastyfft_requisition, + .palette = lv_nastyfft_palette, + .render = lv_nastyfft_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_GL}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "nastyfft", + .name = N_("Libvisual NastyFFT plugin"), + .author = "yodor ", + .version = "0.5", + .about = N_("The Libvisual NastyFFT plugin"), + .help = + N_("This plugin shows nasty fft visualization effect using OpenGL"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_nastyfft_init, + .cleanup = lv_nastyfft_cleanup, + .events = lv_nastyfft_events, + .plugin = &actor}; + + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, + 1); + + return &info; } -static int lv_nastyfft_init (VisPluginData *plugin) -{ - NastyfftPrivate *priv = visual_mem_new0 (NastyfftPrivate, 1); +static int lv_nastyfft_init(VisPluginData *plugin) { + NastyfftPrivate *priv = visual_mem_new0(NastyfftPrivate, 1); - visual_plugin_set_private (plugin, priv); + visual_plugin_set_private(plugin, priv); #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - priv->cam_y=-1.0f; - priv->rot_x=5.0f; - priv->step_z=1.0f; - priv->fdist_z=-63.0f; - priv->scale=1.0f; - priv->dx=0; - priv->dy=0; - priv->catch=0; - priv->CYLINDER=1; - - int x=0; - int z=0; - for (z=SCOPE_DEPTH-1;z>=0;z--) - { - for (x=0;xheights[z][x]=0.0f; - } - } - - return TRUE; + priv->cam_y = -1.0f; + priv->rot_x = 5.0f; + priv->step_z = 1.0f; + priv->fdist_z = -63.0f; + priv->scale = 1.0f; + priv->dx = 0; + priv->dy = 0; + priv->catch = 0; + priv->CYLINDER = 1; + + int x = 0; + int z = 0; + for (z = SCOPE_DEPTH - 1; z >= 0; z--) { + for (x = 0; x < NUM_BANDS; x++) { + priv->heights[z][x] = 0.0f; + } + } + + return TRUE; } -static void lv_nastyfft_cleanup (VisPluginData *plugin) -{ - NastyfftPrivate *priv = visual_plugin_get_private (plugin); +static void lv_nastyfft_cleanup(VisPluginData *plugin) { + NastyfftPrivate *priv = visual_plugin_get_private(plugin); - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_nastyfft_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void lv_nastyfft_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static VisPalette *lv_nastyfft_palette (VisPluginData *plugin) -{ - return NULL; -} +static VisPalette *lv_nastyfft_palette(VisPluginData *plugin) { return NULL; } -static void lv_nastyfft_resize (VisPluginData *plugin, int width, int height) -{ - NastyfftPrivate *priv = visual_plugin_get_private (plugin); +static void lv_nastyfft_resize(VisPluginData *plugin, int width, int height) { + NastyfftPrivate *priv = visual_plugin_get_private(plugin); - priv->nw = width; - priv->nh = height; + priv->nw = width; + priv->nh = height; - init_gl(priv); + init_gl(priv); } -static int lv_nastyfft_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - NastyfftPrivate *priv = visual_plugin_get_private (plugin); - - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_nastyfft_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; - case VISUAL_EVENT_MOUSEBUTTONUP: - priv->catch=0; - break; - case VISUAL_EVENT_MOUSEBUTTONDOWN: - - switch (ev.event.mousebutton.button) - { - case 2: - priv->catch=-2; - break; - case 1: - priv->catch=-1; - break; - case 4: - priv->step_z+=(GLfloat)0.1; - break; - case 5: - priv->step_z-=(GLfloat)0.1; - break; - } - if (priv->step_z<0) - priv->step_z=(GLfloat)0; - break; - - case VISUAL_EVENT_MOUSEMOTION : - - if (priv->catch==-1) - { - priv->dx+=ev.event.mousemotion.yrel; - priv->dy+=ev.event.mousemotion.xrel; - if (priv->dx>360)priv->dx=0; - if (priv->dy>360)priv->dy=0; - } - else if (priv->catch==-2) - { - priv->fdist_z+=(GLfloat)ev.event.mousemotion.yrel; - } - break; - default: - break; - } - } - - return TRUE; +static int lv_nastyfft_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; + + NastyfftPrivate *priv = visual_plugin_get_private(plugin); + + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_nastyfft_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; + case VISUAL_EVENT_MOUSEBUTTONUP: + priv->catch = 0; + break; + case VISUAL_EVENT_MOUSEBUTTONDOWN: + + switch (ev.event.mousebutton.button) { + case 2: + priv->catch = -2; + break; + case 1: + priv->catch = -1; + break; + case 4: + priv->step_z += (GLfloat)0.1; + break; + case 5: + priv->step_z -= (GLfloat)0.1; + break; + } + if (priv->step_z < 0) + priv->step_z = (GLfloat)0; + break; + + case VISUAL_EVENT_MOUSEMOTION: + + if (priv->catch == -1) { + priv->dx += ev.event.mousemotion.yrel; + priv->dy += ev.event.mousemotion.xrel; + if (priv->dx > 360) + priv->dx = 0; + if (priv->dy > 360) + priv->dy = 0; + } else if (priv->catch == -2) { + priv->fdist_z += (GLfloat)ev.event.mousemotion.yrel; + } + break; + default: + break; + } + } + + return TRUE; } -static void lv_nastyfft_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - NastyfftPrivate *priv = visual_plugin_get_private (plugin); +static void lv_nastyfft_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + NastyfftPrivate *priv = visual_plugin_get_private(plugin); - nastyfft_sound (priv, audio); - nastyfft_draw (priv, video); + nastyfft_sound(priv, audio); + nastyfft_draw(priv, video); } -static int nastyfft_sound (NastyfftPrivate *priv, VisAudio *audio) -{ - int i, c, y; - GLfloat val; - int xscale[] = { 0, 1, 2, 3, 5, 7, 10, 14, 20, 28, 40, 54, 74, 101, 137, 187, 255 }; - VisBuffer *buffer; - VisBuffer *pcmb; - - float freq[256]; - unsigned short rfreq[256]; - float pcm[256]; - - buffer = visual_buffer_new_wrap_data (freq, sizeof (freq), FALSE); - pcmb = visual_buffer_new_wrap_data (pcm, sizeof (pcm), FALSE); - - visual_audio_get_sample_mixed_simple (audio, pcmb, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); - - visual_audio_get_spectrum_for_sample (buffer, pcmb, TRUE); - - visual_buffer_unref (buffer); - visual_buffer_unref (pcmb); - - for (i = 0; i < 256; i++) - rfreq[i] = freq[i] * 320000.0; - - for(y = SCOPE_DEPTH-1; y > 0; y--) { - for(i = 0; i < NUM_BANDS; i++) - priv->heights[y][i] = priv->heights[y - 1][i]; - } - - for(i = 0; i < NUM_BANDS; i++) { - for(c = xscale[i], y = 0; c < xscale[i + 1]; c++) { - if(rfreq[c] > y) - y = rfreq[c]; - } - y >>= 7; - if(y > 0) - val = (log(y) * priv->scale); - else - val = 0; - priv->heights[0][i] = val; - } - - return 0; +static int nastyfft_sound(NastyfftPrivate *priv, VisAudio *audio) { + int i, c, y; + GLfloat val; + int xscale[] = {0, 1, 2, 3, 5, 7, 10, 14, 20, + 28, 40, 54, 74, 101, 137, 187, 255}; + VisBuffer *buffer; + VisBuffer *pcmb; + + float freq[256]; + unsigned short rfreq[256]; + float pcm[256]; + + buffer = visual_buffer_new_wrap_data(freq, sizeof(freq), FALSE); + pcmb = visual_buffer_new_wrap_data(pcm, sizeof(pcm), FALSE); + + visual_audio_get_sample_mixed_simple( + audio, pcmb, 2, VISUAL_AUDIO_CHANNEL_LEFT, VISUAL_AUDIO_CHANNEL_RIGHT); + + visual_audio_get_spectrum_for_sample(buffer, pcmb, TRUE); + + visual_buffer_unref(buffer); + visual_buffer_unref(pcmb); + + for (i = 0; i < 256; i++) + rfreq[i] = freq[i] * 320000.0; + + for (y = SCOPE_DEPTH - 1; y > 0; y--) { + for (i = 0; i < NUM_BANDS; i++) + priv->heights[y][i] = priv->heights[y - 1][i]; + } + + for (i = 0; i < NUM_BANDS; i++) { + for (c = xscale[i], y = 0; c < xscale[i + 1]; c++) { + if (rfreq[c] > y) + y = rfreq[c]; + } + y >>= 7; + if (y > 0) + val = (log(y) * priv->scale); + else + val = 0; + priv->heights[0][i] = val; + } + + return 0; } -static int nastyfft_draw (NastyfftPrivate *priv, VisVideo *video) -{ - draw_scene (priv); +static int nastyfft_draw(NastyfftPrivate *priv, VisVideo *video) { + draw_scene(priv); - return 0; + return 0; } -static void init_gl(NastyfftPrivate *priv) -{ - const double defFOVY = 30.0; // field-of-view in degrees in up direction - double aspect = priv->nw/priv->nh; - // field-of-view - double fov = (priv->nw < priv->nh) ? defFOVY : defFOVY/aspect; - float nearDist = 0.1f; - float farDist = 500.0f; +static void init_gl(NastyfftPrivate *priv) { + const double defFOVY = 30.0; // field-of-view in degrees in up direction + double aspect = priv->nw / priv->nh; + // field-of-view + double fov = (priv->nw < priv->nh) ? defFOVY : defFOVY / aspect; + float nearDist = 0.1f; + float farDist = 500.0f; - glViewport(0, 0, priv->nw, priv->nh); + glViewport(0, 0, priv->nw, priv->nh); - make_all(priv); + make_all(priv); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); - gluPerspective(fov, aspect, nearDist, farDist); + gluPerspective(fov, aspect, nearDist, farDist); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); - //GLfloat ambientMaterial[] = { 1.0, 1.0, 1.0, 1.0 }; - //GLfloat difuseMaterial[] = { .5, .5, .5, 1.0 }; - GLfloat mat_specular[] = { 0.2, 0.2, 0.2, 1.0 }; + // GLfloat ambientMaterial[] = { 1.0, 1.0, 1.0, 1.0 }; + // GLfloat difuseMaterial[] = { .5, .5, .5, 1.0 }; + GLfloat mat_specular[] = {0.2, 0.2, 0.2, 1.0}; - glDepthFunc(GL_LEQUAL); - glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); + glEnable(GL_DEPTH_TEST); - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable (GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); - //glShadeModel (GL_SMOOTH); - //glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + // glShadeModel (GL_SMOOTH); + // glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - //glMaterialfv(GL_FRONT, GL_DIFFUSE, ambientMaterial); - glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + // glMaterialfv(GL_FRONT, GL_DIFFUSE, ambientMaterial); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); - //glMaterialf(GL_FRONT, GL_SHININESS, 0.5); + // glMaterialf(GL_FRONT, GL_SHININESS, 0.5); - //glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); - glEnable(GL_CULL_FACE); - glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); + // glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + glEnable(GL_CULL_FACE); + glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); - glEnable(GL_COLOR_MATERIAL); - GLfloat light_position1[] = { 0, 10, 0, 1.0 }; - glLightfv(GL_LIGHT0, GL_POSITION, light_position1); - glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); + glEnable(GL_COLOR_MATERIAL); + GLfloat light_position1[] = {0, 10, 0, 1.0}; + glLightfv(GL_LIGHT0, GL_POSITION, light_position1); + glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); } -static void make_all(NastyfftPrivate *priv) -{ - //cylinder - GLUquadric *obj = gluNewQuadric(); - priv->CYLINDER = glGenLists(1); - glNewList(priv->CYLINDER, GL_COMPILE); - - glRotatef(-90.0f,1.0f,0.0f,0.0f); - glRotatef(-90.0f,0.0f,0.0f,1.0f); - gluCylinder(obj, 0.5f, 0.5f, 0.1f , 6,6); - glRotatef(180,1,0,0); - gluDisk(obj, 0, 0.5f ,6,6); - glRotatef(-180,1,0,0); - glTranslatef(0,0,0.1f); - gluDisk(obj, 0, 0.5f ,6,6); - - glEndList(); - gluDeleteQuadric(obj); +static void make_all(NastyfftPrivate *priv) { + // cylinder + GLUquadric *obj = gluNewQuadric(); + priv->CYLINDER = glGenLists(1); + glNewList(priv->CYLINDER, GL_COMPILE); + + glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); + glRotatef(-90.0f, 0.0f, 0.0f, 1.0f); + gluCylinder(obj, 0.5f, 0.5f, 0.1f, 6, 6); + glRotatef(180, 1, 0, 0); + gluDisk(obj, 0, 0.5f, 6, 6); + glRotatef(-180, 1, 0, 0); + glTranslatef(0, 0, 0.1f); + gluDisk(obj, 0, 0.5f, 6, 6); + + glEndList(); + gluDeleteQuadric(obj); } -static void draw_scene(NastyfftPrivate *priv) -{ - glClearColor( 0.13, 0.17, 0.32, 0.0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - +static void draw_scene(NastyfftPrivate *priv) { + glClearColor(0.13, 0.17, 0.32, 0.0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glLoadIdentity(); + glLoadIdentity(); - glTranslatef(-(NUM_BANDS/2.0f)+0.5f,priv->cam_y,priv->fdist_z); + glTranslatef(-(NUM_BANDS / 2.0f) + 0.5f, priv->cam_y, priv->fdist_z); - glRotatef(priv->rot_x+priv->dx,1,0,0); - glRotatef(priv->dy,0,1,0); + glRotatef(priv->rot_x + priv->dx, 1, 0, 0); + glRotatef(priv->dy, 0, 1, 0); - double alpha=1.0; - double s = 0.0; - double xx=0.0; + double alpha = 1.0; + double s = 0.0; + double xx = 0.0; - int a,z; + int a, z; - for (z=SCOPE_DEPTH-1;z>=0;z--) - { + for (z = SCOPE_DEPTH - 1; z >= 0; z--) { - xx=0.0; - alpha=1-sqrt((double)z/(double)SCOPE_DEPTH); + xx = 0.0; + alpha = 1 - sqrt((double)z / (double)SCOPE_DEPTH); + for (a = 0; a < NUM_BANDS; a++) { + s = priv->heights[z][a]; - for (a=0;aheights[z][a]; + if (s > 10.0f) + s = 10.0f; + if (s < 0.1f) + s = 0.1f; - if (s>10.0f)s=10.0f; - if (s<0.1f)s=0.1f; + double d = (double)a / (double)NUM_BANDS; - double d = (double)a/(double)NUM_BANDS; + glPushMatrix(); + glColor4d(d, 0, 1 - d, alpha); - glPushMatrix(); - glColor4d(d,0,1-d,alpha); + glScaled(1, s * 10, 1); + glCallList(priv->CYLINDER); - glScaled(1,s*10,1); - glCallList(priv->CYLINDER); + glPopMatrix(); - glPopMatrix(); - - glTranslated(1,0,0); - xx+=1.0; - } - glTranslated(-xx,0,0); - glTranslated(0,0,priv->step_z); - } + glTranslated(1, 0, 0); + xx += 1.0; + } + glTranslated(-xx, 0, 0); + glTranslated(0, 0, priv->step_z); + } } - diff --git a/libvisual-plugins/plugins/actor/nebulus/child.c b/libvisual-plugins/plugins/actor/nebulus/child.c index 55819cde7..61c165542 100644 --- a/libvisual-plugins/plugins/actor/nebulus/child.c +++ b/libvisual-plugins/plugins/actor/nebulus/child.c @@ -7,10 +7,7 @@ GLfloat child_time, child_speed = 0.35f, old_child_speed = 0.35f; GLuint childdl = 0; int child_first = TRUE; - -static void -createchild(void) -{ +static void createchild(void) { int i; childdl = glGenLists(1); @@ -19,37 +16,39 @@ createchild(void) glBegin(GL_TRIANGLES); for (i = 0; i < childNormals; i++) { glNormal3f(child_normals[i][0], child_normals[i][1], child_normals[i][2]); - glVertex3f(child_vertices[i][0], child_vertices[i][1], child_vertices[i][2]); + glVertex3f(child_vertices[i][0], child_vertices[i][1], + child_vertices[i][2]); } glEnd(); glEndList(); } - -static void -drawchild(void) -{ +static void drawchild(void) { glPushMatrix(); glTranslatef(0.0f, 0.0f, -4.0f); - glRotatef(child_time*2.0f, 0.0f, 0.0f, 1.0f); + glRotatef(child_time * 2.0f, 0.0f, 0.0f, 1.0f); glScalef(4.0f, 4.0f, 1.0f); use_energy_texture(); glBegin(GL_QUADS); glColor3f(0.75f, 0.65f, 0.55f); - glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -0.5f); - glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 0.5f); - glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, 1.0f, 0.5f); - glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, -1.0f, -0.5f); + glTexCoord2f(0.0f, 1.0f); + glVertex3f(-1.0f, -1.0f, -0.5f); + glTexCoord2f(0.0f, 0.0f); + glVertex3f(-1.0f, 1.0f, 0.5f); + glTexCoord2f(1.0f, 0.0f); + glVertex3f(1.0f, 1.0f, 0.5f); + glTexCoord2f(1.0f, 1.0f); + glVertex3f(1.0f, -1.0f, -0.5f); glEnd(); glTranslatef(0.0f, 0.0f, 1.6f); glScalef(0.25f, 0.25f, 1.0f); - glRotatef(child_time*2, 1.f, 0.0f, 0.0f); - glRotatef(child_time*5, 0.0f, 1.0f ,0.0f); - glRotatef(child_time*2, 0.0f, 0.0f, 1.0f); + glRotatef(child_time * 2, 1.f, 0.0f, 0.0f); + glRotatef(child_time * 5, 0.0f, 1.0f, 0.0f); + glRotatef(child_time * 2, 0.0f, 0.0f, 1.0f); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); - glTexGenf(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP); - glTexGenf(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP); + glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); + glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); use_child_texture(); @@ -63,16 +62,13 @@ drawchild(void) glPopMatrix(); } - -static void -render_child(void) -{ +static void render_child(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(55.0f, (GLfloat)640/480, 1.0f, 20.0f); + gluPerspective(55.0f, (GLfloat)640 / 480, 1.0f, 20.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDisable(GL_BLEND); @@ -81,10 +77,7 @@ render_child(void) glEnable(GL_TEXTURE_2D); } - -void -draw_child(void) -{ +void draw_child(void) { if (child_first) createchild(); child_speed = old_child_speed; diff --git a/libvisual-plugins/plugins/actor/nebulus/child_data.c b/libvisual-plugins/plugins/actor/nebulus/child_data.c index 464afac62..11f1e7346 100644 --- a/libvisual-plugins/plugins/actor/nebulus/child_data.c +++ b/libvisual-plugins/plugins/actor/nebulus/child_data.c @@ -3,12311 +3,6159 @@ GLuint childNormals = 6153; GLfloat child_normals[6153][3] = { -{-0.643897f,-0.625762f,-0.440249f}, -{-0.733042f,-0.570025f,0.371107f}, -{-0.796480f,-0.556747f,0.235906f}, -{-0.733042f,-0.570025f,0.371107f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.557313f,-0.738582f,-0.379340f}, -{-0.557313f,-0.738582f,-0.379340f}, -{-0.642754f,-0.761216f,0.086129f}, -{-0.733042f,-0.570025f,0.371107f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.642754f,-0.761216f,0.086129f}, -{-0.557313f,-0.738582f,-0.379340f}, -{-0.642754f,-0.761216f,0.086129f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.747244f,-0.641429f,-0.173771f}, -{-0.760333f,-0.433986f,-0.483269f}, -{-0.747244f,-0.641429f,-0.173771f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.747244f,-0.641429f,-0.173771f}, -{-0.760333f,-0.433986f,-0.483269f}, -{-0.847343f,-0.525593f,-0.075905f}, -{-0.936740f,-0.257134f,-0.237486f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.847343f,-0.525593f,-0.075905f}, -{-0.847343f,-0.525593f,-0.075905f}, -{-0.760333f,-0.433986f,-0.483269f}, -{-0.936740f,-0.257134f,-0.237486f}, -{-0.993996f,-0.108687f,-0.012591f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.936740f,-0.257134f,-0.237486f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.993996f,-0.108687f,-0.012591f}, -{-0.998091f,-0.059508f,-0.016551f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.557313f,-0.738582f,-0.379340f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.637519f,-0.362869f,-0.679629f}, -{-0.760333f,-0.433986f,-0.483269f}, -{-0.778525f,-0.178140f,-0.601801f}, -{-0.760333f,-0.433986f,-0.483269f}, -{-0.637519f,-0.362869f,-0.679629f}, -{-0.760333f,-0.433986f,-0.483269f}, -{-0.778525f,-0.178140f,-0.601801f}, -{-0.936740f,-0.257134f,-0.237486f}, -{-0.440606f,-0.256999f,-0.860127f}, -{-0.637519f,-0.362869f,-0.679629f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.634710f,-0.070034f,-0.769570f}, -{-0.637519f,-0.362869f,-0.679629f}, -{-0.440606f,-0.256999f,-0.860127f}, -{-0.637519f,-0.362869f,-0.679629f}, -{-0.634710f,-0.070034f,-0.769570f}, -{-0.778525f,-0.178140f,-0.601801f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.557313f,-0.738582f,-0.379340f}, -{-0.442724f,-0.602735f,-0.663857f}, -{-0.442724f,-0.602735f,-0.663857f}, -{-0.557313f,-0.738582f,-0.379340f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.398389f,0.113569f,-0.910158f}, -{-0.440606f,-0.256999f,-0.860127f}, -{-0.090844f,-0.184718f,-0.978584f}, -{-0.090844f,-0.184718f,-0.978584f}, -{-0.440606f,-0.256999f,-0.860127f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.398389f,0.113569f,-0.910158f}, -{-0.634710f,-0.070034f,-0.769570f}, -{-0.440606f,-0.256999f,-0.860127f}, -{-0.019661f,0.388870f,-0.921083f}, -{-0.186193f,0.428663f,-0.884070f}, -{-0.398389f,0.113569f,-0.910158f}, -{-0.398389f,0.113569f,-0.910158f}, -{-0.090844f,-0.184718f,-0.978584f}, -{-0.019661f,0.388870f,-0.921083f}, -{0.287050f,0.728087f,-0.622488f}, -{-0.186193f,0.428663f,-0.884070f}, -{-0.019661f,0.388870f,-0.921083f}, -{0.042877f,-0.197790f,-0.979306f}, -{-0.019661f,0.388870f,-0.921083f}, -{-0.090844f,-0.184718f,-0.978584f}, -{0.287050f,0.728087f,-0.622488f}, -{-0.019661f,0.388870f,-0.921083f}, -{0.042877f,-0.197790f,-0.979306f}, -{-0.278250f,0.635043f,-0.720623f}, -{-0.186193f,0.428663f,-0.884070f}, -{0.287050f,0.728087f,-0.622488f}, -{0.821866f,0.360450f,-0.441149f}, -{0.287050f,0.728087f,-0.622488f}, -{0.641193f,0.754088f,-0.142208f}, -{0.641193f,0.754088f,-0.142208f}, -{0.287050f,0.728087f,-0.622488f}, -{0.042877f,-0.197790f,-0.979306f}, -{0.821866f,0.360450f,-0.441149f}, -{0.230458f,0.971546f,0.054663f}, -{0.284305f,0.951327f,-0.118946f}, -{0.284305f,0.951327f,-0.118946f}, -{0.287050f,0.728087f,-0.622488f}, -{0.821866f,0.360450f,-0.441149f}, -{0.821866f,0.360450f,-0.441149f}, -{0.042877f,-0.197790f,-0.979306f}, -{0.082124f,-0.826703f,-0.556612f}, -{0.821866f,0.360450f,-0.441149f}, -{0.641193f,0.754088f,-0.142208f}, -{0.042877f,-0.197790f,-0.979306f}, -{0.852965f,0.480626f,0.203590f}, -{0.457403f,0.886731f,-0.067019f}, -{0.821866f,0.360450f,-0.441149f}, -{0.091380f,0.995375f,-0.029645f}, -{0.230458f,0.971546f,0.054663f}, -{0.457403f,0.886731f,-0.067019f}, -{0.230458f,0.971546f,0.054663f}, -{0.821866f,0.360450f,-0.441149f}, -{0.457403f,0.886731f,-0.067019f}, -{0.852965f,0.480626f,0.203590f}, -{0.821866f,0.360450f,-0.441149f}, -{0.326383f,-0.937944f,0.117199f}, -{0.326383f,-0.937944f,0.117199f}, -{0.821866f,0.360450f,-0.441149f}, -{0.082124f,-0.826703f,-0.556612f}, -{0.852965f,0.480626f,0.203590f}, -{0.391443f,0.867414f,0.307189f}, -{0.457403f,0.886731f,-0.067019f}, -{0.391443f,0.867414f,0.307189f}, -{0.171867f,0.984952f,0.018213f}, -{0.457403f,0.886731f,-0.067019f}, -{0.457403f,0.886731f,-0.067019f}, -{0.171867f,0.984952f,0.018213f}, -{0.091380f,0.995375f,-0.029645f}, -{0.326383f,-0.937944f,0.117199f}, -{0.638555f,0.563372f,-0.524271f}, -{0.852965f,0.480626f,0.203590f}, -{0.852965f,0.480626f,0.203590f}, -{0.638555f,0.563372f,-0.524271f}, -{0.380659f,0.883110f,0.274255f}, -{0.380659f,0.883110f,0.274255f}, -{0.391443f,0.867414f,0.307189f}, -{0.852965f,0.480626f,0.203590f}, -{0.380659f,0.883110f,0.274255f}, -{0.638555f,0.563372f,-0.524271f}, -{0.323534f,0.555600f,0.765921f}, -{0.391443f,0.867414f,0.307189f}, -{0.380659f,0.883110f,0.274255f}, -{0.323534f,0.555600f,0.765921f}, -{0.391443f,0.867414f,0.307189f}, -{0.323534f,0.555600f,0.765921f}, -{-0.169148f,0.752509f,0.636489f}, -{-0.479804f,-0.294644f,0.826422f}, -{-0.323965f,-0.562074f,0.760999f}, -{0.638555f,0.563372f,-0.524271f}, -{-0.383781f,0.133156f,0.913773f}, -{0.323534f,0.555600f,0.765921f}, -{-0.323965f,-0.562074f,0.760999f}, -{0.638555f,0.563372f,-0.524271f}, -{-0.323965f,-0.562074f,0.760999f}, -{0.323534f,0.555600f,0.765921f}, -{0.323534f,0.555600f,0.765921f}, -{-0.383781f,0.133156f,0.913773f}, -{-0.169148f,0.752509f,0.636489f}, -{-0.509397f,-0.633656f,0.582233f}, -{-0.323965f,-0.562074f,0.760999f}, -{0.090523f,-0.836358f,0.540658f}, -{-0.323965f,-0.562074f,0.760999f}, -{-0.509397f,-0.633656f,0.582233f}, -{-0.479804f,-0.294644f,0.826422f}, -{-0.515082f,-0.226506f,0.826671f}, -{-0.383781f,0.133156f,0.913773f}, -{-0.323965f,-0.562074f,0.760999f}, -{-0.479804f,-0.294644f,0.826422f}, -{-0.515082f,-0.226506f,0.826671f}, -{-0.323965f,-0.562074f,0.760999f}, -{-0.509397f,-0.633656f,0.582233f}, -{0.090523f,-0.836358f,0.540658f}, -{-0.258966f,-0.584187f,0.769196f}, -{-0.540569f,-0.299709f,0.786104f}, -{-0.479804f,-0.294644f,0.826422f}, -{-0.509397f,-0.633656f,0.582233f}, -{-0.479804f,-0.294644f,0.826422f}, -{-0.540569f,-0.299709f,0.786104f}, -{-0.515082f,-0.226506f,0.826671f}, -{-0.571065f,-0.018014f,0.820707f}, -{-0.515082f,-0.226506f,0.826671f}, -{-0.540569f,-0.299709f,0.786104f}, -{-0.515082f,-0.226506f,0.826671f}, -{-0.571065f,-0.018014f,0.820707f}, -{-0.383781f,0.133156f,0.913773f}, -{-0.642754f,-0.761216f,0.086129f}, -{-0.521880f,-0.609673f,0.596608f}, -{-0.733042f,-0.570025f,0.371107f}, -{-0.521880f,-0.609673f,0.596608f}, -{-0.642754f,-0.761216f,0.086129f}, -{-0.509397f,-0.633656f,0.582233f}, -{-0.509397f,-0.633656f,0.582233f}, -{-0.258966f,-0.584187f,0.769196f}, -{-0.521880f,-0.609673f,0.596608f}, -{-0.739603f,-0.203658f,0.641491f}, -{-0.571065f,-0.018014f,0.820707f}, -{-0.540569f,-0.299709f,0.786104f}, -{-0.721820f,-0.653257f,0.228542f}, -{-0.509397f,-0.633656f,0.582233f}, -{-0.642754f,-0.761216f,0.086129f}, -{-0.776219f,-0.526329f,0.347076f}, -{-0.509397f,-0.633656f,0.582233f}, -{-0.721820f,-0.653257f,0.228542f}, -{-0.509397f,-0.633656f,0.582233f}, -{-0.776219f,-0.526329f,0.347076f}, -{-0.540569f,-0.299709f,0.786104f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.739603f,-0.203658f,0.641491f}, -{-0.776219f,-0.526329f,0.347076f}, -{-0.776219f,-0.526329f,0.347076f}, -{-0.739603f,-0.203658f,0.641491f}, -{-0.540569f,-0.299709f,0.786104f}, -{-0.642754f,-0.761216f,0.086129f}, -{-0.747244f,-0.641429f,-0.173771f}, -{-0.721820f,-0.653257f,0.228542f}, -{-0.847343f,-0.525593f,-0.075905f}, -{-0.776219f,-0.526329f,0.347076f}, -{-0.747244f,-0.641429f,-0.173771f}, -{-0.747244f,-0.641429f,-0.173771f}, -{-0.776219f,-0.526329f,0.347076f}, -{-0.721820f,-0.653257f,0.228542f}, -{-0.776219f,-0.526329f,0.347076f}, -{-0.847343f,-0.525593f,-0.075905f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.998091f,-0.059508f,-0.016551f}, -{-0.988032f,-0.151826f,-0.027217f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.019689f,-0.435906f,-0.899777f}, -{-0.090844f,-0.184718f,-0.978584f}, -{-0.323965f,-0.562074f,0.760999f}, -{-0.258966f,-0.584187f,0.769196f}, -{0.090523f,-0.836358f,0.540658f}, -{-0.984283f,-0.051648f,0.168875f}, -{-0.977075f,-0.105183f,0.185099f}, -{-0.988032f,-0.151826f,-0.027217f}, -{-0.977075f,-0.105183f,0.185099f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.699688f,0.204704f,0.684495f}, -{-0.571065f,-0.018014f,0.820707f}, -{-0.699688f,0.204704f,0.684495f}, -{-0.518049f,0.451465f,0.726502f}, -{-0.383781f,0.133156f,0.913773f}, -{-0.518049f,0.451465f,0.726502f}, -{-0.169148f,0.752509f,0.636489f}, -{-0.383781f,0.133156f,0.913773f}, -{0.155388f,0.934199f,0.321135f}, -{0.171867f,0.984952f,0.018213f}, -{0.391443f,0.867414f,0.307189f}, -{0.284305f,0.951327f,-0.118946f}, -{0.079728f,0.876478f,-0.474795f}, -{0.287050f,0.728087f,-0.622488f}, -{-0.278250f,0.635043f,-0.720623f}, -{-0.519937f,0.399504f,-0.755024f}, -{-0.186193f,0.428663f,-0.884070f}, -{-0.519937f,0.399504f,-0.755024f}, -{-0.704461f,0.199354f,-0.681170f}, -{-0.398389f,0.113569f,-0.910158f}, -{-0.704461f,0.199354f,-0.681170f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.634710f,-0.070034f,-0.769570f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.954040f,-0.136257f,-0.266912f}, -{-0.936740f,-0.257134f,-0.237486f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.796480f,-0.556747f,0.235906f}, -{-0.807580f,-0.530334f,-0.257994f}, -{-0.998091f,-0.059508f,-0.016551f}, -{-0.993996f,-0.108687f,-0.012591f}, -{-0.954040f,-0.136257f,-0.266912f}, -{-0.993996f,-0.108687f,-0.012591f}, -{-0.936740f,-0.257134f,-0.237486f}, -{-0.954040f,-0.136257f,-0.266912f}, -{-0.936740f,-0.257134f,-0.237486f}, -{-0.778525f,-0.178140f,-0.601801f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.778525f,-0.178140f,-0.601801f}, -{-0.634710f,-0.070034f,-0.769570f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.442724f,-0.602735f,-0.663857f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.634710f,-0.070034f,-0.769570f}, -{-0.398389f,0.113569f,-0.910158f}, -{-0.704461f,0.199354f,-0.681170f}, -{-0.090844f,-0.184718f,-0.978584f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.452521f,-0.605412f,-0.654753f}, -{-0.442724f,-0.602735f,-0.663857f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.398389f,0.113569f,-0.910158f}, -{-0.186193f,0.428663f,-0.884070f}, -{-0.519937f,0.399504f,-0.755024f}, -{-0.278250f,0.635043f,-0.720623f}, -{0.287050f,0.728087f,-0.622488f}, -{0.079728f,0.876478f,-0.474795f}, -{0.284305f,0.951327f,-0.118946f}, -{0.230458f,0.971546f,0.054663f}, -{0.194831f,0.980831f,0.003437f}, -{0.391443f,0.867414f,0.307189f}, -{-0.169148f,0.752509f,0.636489f}, -{0.155388f,0.934199f,0.321135f}, -{-0.383781f,0.133156f,0.913773f}, -{-0.571065f,-0.018014f,0.820707f}, -{-0.699688f,0.204704f,0.684495f}, -{-0.571065f,-0.018014f,0.820707f}, -{-0.739603f,-0.203658f,0.641491f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.739603f,-0.203658f,0.641491f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.988032f,-0.151826f,-0.027217f}, -{-0.998091f,-0.059508f,-0.016551f}, -{-0.984283f,-0.051648f,0.168875f}, -{-0.958659f,-0.254635f,0.127019f}, -{-0.988032f,-0.151826f,-0.027217f}, -{-0.977075f,-0.105183f,0.185099f}, -{0.091380f,0.995375f,-0.029645f}, -{0.053011f,0.996626f,0.062659f}, -{0.230458f,0.971546f,0.054663f}, -{0.620591f,-0.499874f,-0.604147f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.794733f,-0.564204f,-0.223772f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.794733f,-0.564204f,-0.223772f}, -{0.905975f,-0.285316f,0.312736f}, -{0.731439f,-0.641897f,0.230140f}, -{0.905975f,-0.285316f,0.312736f}, -{0.794733f,-0.564204f,-0.223772f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.377927f,-0.670422f,0.638518f}, -{0.731439f,-0.641897f,0.230140f}, -{0.905975f,-0.285316f,0.312736f}, -{0.377927f,-0.670422f,0.638518f}, -{0.905975f,-0.285316f,0.312736f}, -{0.494162f,-0.533573f,0.686370f}, -{0.494162f,-0.533573f,0.686370f}, -{0.905975f,-0.285316f,0.312736f}, -{0.727540f,-0.551473f,0.408122f}, -{0.955992f,-0.182282f,-0.229898f}, -{0.905975f,-0.285316f,0.312736f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.897263f,-0.335441f,0.287051f}, -{0.905975f,-0.285316f,0.312736f}, -{0.955992f,-0.182282f,-0.229898f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.436552f,-0.507212f,-0.743073f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.620591f,-0.499874f,-0.604147f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.620591f,-0.499874f,-0.604147f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.434623f,-0.584735f,-0.684973f}, -{0.794733f,-0.564204f,-0.223772f}, -{0.434623f,-0.584735f,-0.684973f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.794733f,-0.564204f,-0.223772f}, -{0.057722f,-0.995047f,0.080931f}, -{0.057722f,-0.995047f,0.080931f}, -{0.794733f,-0.564204f,-0.223772f}, -{0.731439f,-0.641897f,0.230140f}, -{0.057722f,-0.995047f,0.080931f}, -{0.731439f,-0.641897f,0.230140f}, -{0.377927f,-0.670422f,0.638518f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.830792f,-0.235644f,-0.504239f}, -{0.955992f,-0.182282f,-0.229898f}, -{0.830792f,-0.235644f,-0.504239f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.641591f,-0.300012f,-0.705942f}, -{0.436552f,-0.507212f,-0.743073f}, -{0.641591f,-0.300012f,-0.705942f}, -{0.865167f,-0.282605f,-0.414271f}, -{0.641591f,-0.300012f,-0.705942f}, -{0.436552f,-0.507212f,-0.743073f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.059714f,-0.610369f,-0.789863f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.434623f,-0.584735f,-0.684973f}, -{0.434623f,-0.584735f,-0.684973f}, -{-0.077148f,-0.752303f,-0.654285f}, -{0.059714f,-0.610369f,-0.789863f}, -{-0.077148f,-0.752303f,-0.654285f}, -{0.434623f,-0.584735f,-0.684973f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.082124f,-0.826703f,-0.556612f}, -{-0.077148f,-0.752303f,-0.654285f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.057722f,-0.995047f,0.080931f}, -{0.326383f,-0.937944f,0.117199f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.326383f,-0.937944f,0.117199f}, -{0.082124f,-0.826703f,-0.556612f}, -{0.284753f,-0.804205f,-0.521699f}, -{0.050233f,-0.840017f,0.540230f}, -{0.057722f,-0.995047f,0.080931f}, -{0.377927f,-0.670422f,0.638518f}, -{0.057722f,-0.995047f,0.080931f}, -{0.050233f,-0.840017f,0.540230f}, -{0.326383f,-0.937944f,0.117199f}, -{-0.037199f,-0.690716f,0.722169f}, -{0.050233f,-0.840017f,0.540230f}, -{0.377927f,-0.670422f,0.638518f}, -{0.494162f,-0.533573f,0.686370f}, -{-0.037199f,-0.690716f,0.722169f}, -{0.377927f,-0.670422f,0.638518f}, -{0.727540f,-0.551473f,0.408122f}, -{0.775380f,-0.270998f,0.570391f}, -{0.494162f,-0.533573f,0.686370f}, -{0.905975f,-0.285316f,0.312736f}, -{0.775380f,-0.270998f,0.570391f}, -{0.727540f,-0.551473f,0.408122f}, -{0.905975f,-0.285316f,0.312736f}, -{0.711881f,-0.387475f,0.585738f}, -{0.775380f,-0.270998f,0.570391f}, -{0.711881f,-0.387475f,0.585738f}, -{0.905975f,-0.285316f,0.312736f}, -{0.897263f,-0.335441f,0.287051f}, -{0.946658f,-0.224326f,-0.231337f}, -{0.897263f,-0.335441f,0.287051f}, -{0.955992f,-0.182282f,-0.229898f}, -{0.897263f,-0.335441f,0.287051f}, -{0.946658f,-0.224326f,-0.231337f}, -{0.957081f,-0.194526f,0.214836f}, -{0.447404f,-0.239211f,-0.861747f}, -{0.641591f,-0.300012f,-0.705942f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.375415f,-0.352812f,-0.857081f}, -{0.447404f,-0.239211f,-0.861747f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.057774f,-0.634148f,-0.771050f}, -{0.375415f,-0.352812f,-0.857081f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.059714f,-0.610369f,-0.789863f}, -{0.057774f,-0.634148f,-0.771050f}, -{0.597464f,-0.400423f,-0.694765f}, -{0.326383f,-0.937944f,0.117199f}, -{0.050233f,-0.840017f,0.540230f}, -{0.638555f,0.563372f,-0.524271f}, -{0.112344f,-0.521124f,0.846055f}, -{-0.037199f,-0.690716f,0.722169f}, -{0.494162f,-0.533573f,0.686370f}, -{0.494162f,-0.533573f,0.686370f}, -{0.428002f,-0.339070f,0.837762f}, -{0.112344f,-0.521124f,0.846055f}, -{0.494162f,-0.533573f,0.686370f}, -{0.569239f,-0.127567f,0.812215f}, -{0.428002f,-0.339070f,0.837762f}, -{0.494162f,-0.533573f,0.686370f}, -{0.775380f,-0.270998f,0.570391f}, -{0.569239f,-0.127567f,0.812215f}, -{0.711881f,-0.387475f,0.585738f}, -{0.897263f,-0.335441f,0.287051f}, -{0.957081f,-0.194526f,0.214836f}, -{0.774173f,-0.231223f,-0.589231f}, -{0.946658f,-0.224326f,-0.231337f}, -{0.955992f,-0.182282f,-0.229898f}, -{0.830792f,-0.235644f,-0.504239f}, -{0.774173f,-0.231223f,-0.589231f}, -{0.955992f,-0.182282f,-0.229898f}, -{0.615604f,-0.093277f,-0.782516f}, -{0.774173f,-0.231223f,-0.589231f}, -{0.641591f,-0.300012f,-0.705942f}, -{0.774173f,-0.231223f,-0.589231f}, -{0.830792f,-0.235644f,-0.504239f}, -{0.641591f,-0.300012f,-0.705942f}, -{0.641591f,-0.300012f,-0.705942f}, -{0.491392f,-0.105577f,-0.864515f}, -{0.615604f,-0.093277f,-0.782516f}, -{0.447404f,-0.239211f,-0.861747f}, -{0.491392f,-0.105577f,-0.864515f}, -{0.641591f,-0.300012f,-0.705942f}, -{0.375415f,-0.352812f,-0.857081f}, -{0.107082f,-0.340453f,-0.934144f}, -{0.447404f,-0.239211f,-0.861747f}, -{0.057774f,-0.634148f,-0.771050f}, -{0.107082f,-0.340453f,-0.934144f}, -{0.375415f,-0.352812f,-0.857081f}, -{0.059714f,-0.610369f,-0.789863f}, -{-0.086571f,-0.554962f,-0.827359f}, -{0.057774f,-0.634148f,-0.771050f}, -{-0.086571f,-0.554962f,-0.827359f}, -{0.059714f,-0.610369f,-0.789863f}, -{-0.169205f,-0.681509f,-0.711980f}, -{-0.077148f,-0.752303f,-0.654285f}, -{-0.169205f,-0.681509f,-0.711980f}, -{0.059714f,-0.610369f,-0.789863f}, -{-0.077148f,-0.752303f,-0.654285f}, -{-0.125367f,-0.654637f,-0.745475f}, -{-0.169205f,-0.681509f,-0.711980f}, -{-0.125367f,-0.654637f,-0.745475f}, -{0.082124f,-0.826703f,-0.556612f}, -{0.042877f,-0.197790f,-0.979306f}, -{0.082124f,-0.826703f,-0.556612f}, -{-0.125367f,-0.654637f,-0.745475f}, -{-0.077148f,-0.752303f,-0.654285f}, -{0.050233f,-0.840017f,0.540230f}, -{-0.069496f,-0.587019f,0.806585f}, -{0.323534f,0.555600f,0.765921f}, -{-0.037199f,-0.690716f,0.722169f}, -{-0.069496f,-0.587019f,0.806585f}, -{0.050233f,-0.840017f,0.540230f}, -{-0.069496f,-0.587019f,0.806585f}, -{-0.037199f,-0.690716f,0.722169f}, -{-0.166613f,-0.620232f,0.766520f}, -{0.112344f,-0.521124f,0.846055f}, -{-0.166613f,-0.620232f,0.766520f}, -{-0.037199f,-0.690716f,0.722169f}, -{0.229739f,-0.190651f,0.954396f}, -{0.112344f,-0.521124f,0.846055f}, -{0.428002f,-0.339070f,0.837762f}, -{0.229739f,-0.190651f,0.954396f}, -{0.428002f,-0.339070f,0.837762f}, -{0.569239f,-0.127567f,0.812215f}, -{0.775380f,-0.270998f,0.570391f}, -{0.544375f,-0.130958f,0.828556f}, -{0.569239f,-0.127567f,0.812215f}, -{0.775380f,-0.270998f,0.570391f}, -{0.621653f,-0.272622f,0.734319f}, -{0.544375f,-0.130958f,0.828556f}, -{0.775380f,-0.270998f,0.570391f}, -{0.711881f,-0.387475f,0.585738f}, -{0.831595f,-0.152778f,0.533955f}, -{0.621653f,-0.272622f,0.734319f}, -{0.775380f,-0.270998f,0.570391f}, -{0.831595f,-0.152778f,0.533955f}, -{0.957081f,-0.194526f,0.214836f}, -{0.831595f,-0.152778f,0.533955f}, -{0.711881f,-0.387475f,0.585738f}, -{0.948798f,-0.108951f,-0.296501f}, -{0.957081f,-0.194526f,0.214836f}, -{0.946658f,-0.224326f,-0.231337f}, -{0.957081f,-0.194526f,0.214836f}, -{0.948798f,-0.108951f,-0.296501f}, -{0.991941f,-0.008091f,0.126439f}, -{0.946658f,-0.224326f,-0.231337f}, -{0.845738f,-0.047474f,-0.531482f}, -{0.948798f,-0.108951f,-0.296501f}, -{0.845738f,-0.047474f,-0.531482f}, -{0.946658f,-0.224326f,-0.231337f}, -{0.774173f,-0.231223f,-0.589231f}, -{0.447404f,-0.239211f,-0.861747f}, -{0.258663f,-0.124805f,-0.957871f}, -{0.491392f,-0.105577f,-0.864515f}, -{0.107082f,-0.340453f,-0.934144f}, -{0.258663f,-0.124805f,-0.957871f}, -{0.447404f,-0.239211f,-0.861747f}, -{-0.165337f,-0.517504f,-0.839555f}, -{0.107082f,-0.340453f,-0.934144f}, -{0.057774f,-0.634148f,-0.771050f}, -{-0.086571f,-0.554962f,-0.827359f}, -{-0.165337f,-0.517504f,-0.839555f}, -{0.057774f,-0.634148f,-0.771050f}, -{-0.225805f,-0.587739f,-0.776901f}, -{-0.169205f,-0.681509f,-0.711980f}, -{-0.125367f,-0.654637f,-0.745475f}, -{-0.019689f,-0.435906f,-0.899777f}, -{-0.125367f,-0.654637f,-0.745475f}, -{0.042877f,-0.197790f,-0.979306f}, -{-0.125367f,-0.654637f,-0.745475f}, -{-0.019689f,-0.435906f,-0.899777f}, -{-0.225805f,-0.587739f,-0.776901f}, -{-0.084651f,-0.587452f,0.804819f}, -{-0.323965f,-0.562074f,0.760999f}, -{0.323534f,0.555600f,0.765921f}, -{-0.069496f,-0.587019f,0.806585f}, -{-0.084651f,-0.587452f,0.804819f}, -{0.323534f,0.555600f,0.765921f}, -{-0.063776f,-0.450833f,0.890327f}, -{-0.166613f,-0.620232f,0.766520f}, -{0.112344f,-0.521124f,0.846055f}, -{0.229739f,-0.190651f,0.954396f}, -{-0.063776f,-0.450833f,0.890327f}, -{0.112344f,-0.521124f,0.846055f}, -{0.411118f,0.050506f,0.910182f}, -{0.229739f,-0.190651f,0.954396f}, -{0.569239f,-0.127567f,0.812215f}, -{0.544375f,-0.130958f,0.828556f}, -{0.411118f,0.050506f,0.910182f}, -{0.569239f,-0.127567f,0.812215f}, -{0.544375f,-0.130958f,0.828556f}, -{0.621653f,-0.272622f,0.734319f}, -{0.831595f,-0.152778f,0.533955f}, -{0.991941f,-0.008091f,0.126439f}, -{0.857203f,-0.004873f,0.514956f}, -{0.957081f,-0.194526f,0.214836f}, -{0.957081f,-0.194526f,0.214836f}, -{0.857203f,-0.004873f,0.514956f}, -{0.831595f,-0.152778f,0.533955f}, -{0.845738f,-0.047474f,-0.531482f}, -{0.774173f,-0.231223f,-0.589231f}, -{0.659882f,0.017743f,-0.751160f}, -{0.615604f,-0.093277f,-0.782516f}, -{0.659882f,0.017743f,-0.751160f}, -{0.774173f,-0.231223f,-0.589231f}, -{0.659882f,0.017743f,-0.751160f}, -{0.615604f,-0.093277f,-0.782516f}, -{0.478818f,0.067491f,-0.875316f}, -{0.491392f,-0.105577f,-0.864515f}, -{0.478818f,0.067491f,-0.875316f}, -{0.615604f,-0.093277f,-0.782516f}, -{0.491392f,-0.105577f,-0.864515f}, -{0.258663f,-0.124805f,-0.957871f}, -{0.478818f,0.067491f,-0.875316f}, -{0.127284f,-0.160096f,-0.978861f}, -{0.258663f,-0.124805f,-0.957871f}, -{0.107082f,-0.340453f,-0.934144f}, -{-0.165337f,-0.517504f,-0.839555f}, -{0.127284f,-0.160096f,-0.978861f}, -{0.107082f,-0.340453f,-0.934144f}, -{-0.086571f,-0.554962f,-0.827359f}, -{-0.193053f,-0.500818f,-0.843749f}, -{-0.165337f,-0.517504f,-0.839555f}, -{-0.193053f,-0.500818f,-0.843749f}, -{-0.086571f,-0.554962f,-0.827359f}, -{-0.317524f,-0.620412f,-0.717124f}, -{-0.317524f,-0.620412f,-0.717124f}, -{-0.225805f,-0.587739f,-0.776901f}, -{-0.193053f,-0.500818f,-0.843749f}, -{-0.169205f,-0.681509f,-0.711980f}, -{-0.225805f,-0.587739f,-0.776901f}, -{-0.317524f,-0.620412f,-0.717124f}, -{-0.317524f,-0.620412f,-0.717124f}, -{-0.086571f,-0.554962f,-0.827359f}, -{-0.169205f,-0.681509f,-0.711980f}, -{-0.153380f,-0.642062f,0.751153f}, -{-0.084651f,-0.587452f,0.804819f}, -{-0.069496f,-0.587019f,0.806585f}, -{-0.069496f,-0.587019f,0.806585f}, -{-0.166613f,-0.620232f,0.766520f}, -{-0.153380f,-0.642062f,0.751153f}, -{-0.166613f,-0.620232f,0.766520f}, -{-0.234185f,-0.582943f,0.778033f}, -{-0.153380f,-0.642062f,0.751153f}, -{-0.234185f,-0.582943f,0.778033f}, -{-0.166613f,-0.620232f,0.766520f}, -{-0.063776f,-0.450833f,0.890327f}, -{0.229739f,-0.190651f,0.954396f}, -{0.179281f,-0.164585f,0.969933f}, -{-0.063776f,-0.450833f,0.890327f}, -{0.229739f,-0.190651f,0.954396f}, -{0.411118f,0.050506f,0.910182f}, -{0.179281f,-0.164585f,0.969933f}, -{0.527283f,-0.011259f,0.849615f}, -{0.411118f,0.050506f,0.910182f}, -{0.544375f,-0.130958f,0.828556f}, -{0.831595f,-0.152778f,0.533955f}, -{0.527283f,-0.011259f,0.849615f}, -{0.544375f,-0.130958f,0.828556f}, -{0.527283f,-0.011259f,0.849615f}, -{0.831595f,-0.152778f,0.533955f}, -{0.857203f,-0.004873f,0.514956f}, -{0.918800f,0.243044f,-0.311025f}, -{0.991941f,-0.008091f,0.126439f}, -{0.948798f,-0.108951f,-0.296501f}, -{0.991941f,-0.008091f,0.126439f}, -{0.918800f,0.243044f,-0.311025f}, -{0.927065f,0.363616f,0.091291f}, -{0.739626f,0.244446f,-0.627056f}, -{0.948798f,-0.108951f,-0.296501f}, -{0.845738f,-0.047474f,-0.531482f}, -{0.948798f,-0.108951f,-0.296501f}, -{0.739626f,0.244446f,-0.627056f}, -{0.918800f,0.243044f,-0.311025f}, -{0.478818f,0.067491f,-0.875316f}, -{0.739626f,0.244446f,-0.627056f}, -{0.659882f,0.017743f,-0.751160f}, -{0.659882f,0.017743f,-0.751160f}, -{0.739626f,0.244446f,-0.627056f}, -{0.845738f,-0.047474f,-0.531482f}, -{0.258663f,-0.124805f,-0.957871f}, -{0.274301f,0.028423f,-0.961224f}, -{0.478818f,0.067491f,-0.875316f}, -{0.258663f,-0.124805f,-0.957871f}, -{0.127284f,-0.160096f,-0.978861f}, -{0.274301f,0.028423f,-0.961224f}, -{-0.067677f,-0.209660f,-0.975429f}, -{0.127284f,-0.160096f,-0.978861f}, -{-0.165337f,-0.517504f,-0.839555f}, -{-0.067677f,-0.209660f,-0.975429f}, -{-0.165337f,-0.517504f,-0.839555f}, -{-0.193053f,-0.500818f,-0.843749f}, -{-0.193053f,-0.500818f,-0.843749f}, -{-0.225805f,-0.587739f,-0.776901f}, -{-0.209838f,-0.630881f,-0.746966f}, -{-0.225805f,-0.587739f,-0.776901f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.209838f,-0.630881f,-0.746966f}, -{-0.265754f,-0.553200f,0.789522f}, -{-0.258966f,-0.584187f,0.769196f}, -{-0.084651f,-0.587452f,0.804819f}, -{-0.153380f,-0.642062f,0.751153f}, -{-0.265754f,-0.553200f,0.789522f}, -{-0.084651f,-0.587452f,0.804819f}, -{-0.265754f,-0.553200f,0.789522f}, -{-0.153380f,-0.642062f,0.751153f}, -{-0.234185f,-0.582943f,0.778033f}, -{-0.234185f,-0.582943f,0.778033f}, -{-0.063776f,-0.450833f,0.890327f}, -{-0.090166f,-0.412736f,0.906377f}, -{-0.063776f,-0.450833f,0.890327f}, -{0.179281f,-0.164585f,0.969933f}, -{-0.090166f,-0.412736f,0.906377f}, -{0.376794f,-0.013627f,0.926197f}, -{0.179281f,-0.164585f,0.969933f}, -{0.411118f,0.050506f,0.910182f}, -{0.376794f,-0.013627f,0.926197f}, -{0.411118f,0.050506f,0.910182f}, -{0.527283f,-0.011259f,0.849615f}, -{0.640907f,0.116796f,0.758681f}, -{0.527283f,-0.011259f,0.849615f}, -{0.857203f,-0.004873f,0.514956f}, -{0.850722f,0.190453f,0.489898f}, -{0.640907f,0.116796f,0.758681f}, -{0.857203f,-0.004873f,0.514956f}, -{0.991941f,-0.008091f,0.126439f}, -{0.850722f,0.190453f,0.489898f}, -{0.857203f,-0.004873f,0.514956f}, -{0.991941f,-0.008091f,0.126439f}, -{0.927065f,0.363616f,0.091291f}, -{0.850722f,0.190453f,0.489898f}, -{0.395134f,0.282959f,-0.873958f}, -{0.544847f,0.348199f,-0.762823f}, -{0.478818f,0.067491f,-0.875316f}, -{0.478818f,0.067491f,-0.875316f}, -{0.544847f,0.348199f,-0.762823f}, -{0.739626f,0.244446f,-0.627056f}, -{0.298945f,0.221806f,-0.928135f}, -{0.395134f,0.282959f,-0.873958f}, -{0.274301f,0.028423f,-0.961224f}, -{0.274301f,0.028423f,-0.961224f}, -{0.395134f,0.282959f,-0.873958f}, -{0.478818f,0.067491f,-0.875316f}, -{0.189929f,0.005792f,-0.981781f}, -{0.274301f,0.028423f,-0.961224f}, -{0.127284f,-0.160096f,-0.978861f}, -{-0.193053f,-0.500818f,-0.843749f}, -{-0.272935f,-0.219522f,-0.936652f}, -{-0.067677f,-0.209660f,-0.975429f}, -{-0.193053f,-0.500818f,-0.843749f}, -{-0.251380f,-0.456256f,-0.853603f}, -{-0.272935f,-0.219522f,-0.936652f}, -{-0.251380f,-0.456256f,-0.853603f}, -{-0.193053f,-0.500818f,-0.843749f}, -{-0.209838f,-0.630881f,-0.746966f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.209838f,-0.630881f,-0.746966f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.561849f,-0.579983f,-0.589869f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.597460f,-0.489542f,0.635130f}, -{-0.521880f,-0.609673f,0.596608f}, -{-0.258966f,-0.584187f,0.769196f}, -{-0.265754f,-0.553200f,0.789522f}, -{-0.597460f,-0.489542f,0.635130f}, -{-0.258966f,-0.584187f,0.769196f}, -{-0.289543f,-0.300206f,0.908868f}, -{-0.265754f,-0.553200f,0.789522f}, -{-0.234185f,-0.582943f,0.778033f}, -{-0.090166f,-0.412736f,0.906377f}, -{-0.289543f,-0.300206f,0.908868f}, -{-0.234185f,-0.582943f,0.778033f}, -{-0.008813f,-0.156680f,0.987610f}, -{-0.234185f,-0.582943f,0.778033f}, -{-0.090166f,-0.412736f,0.906377f}, -{-0.008813f,-0.156680f,0.987610f}, -{-0.090166f,-0.412736f,0.906377f}, -{0.179281f,-0.164585f,0.969933f}, -{0.122983f,-0.097750f,0.987583f}, -{-0.008813f,-0.156680f,0.987610f}, -{0.179281f,-0.164585f,0.969933f}, -{0.158118f,0.020858f,0.987200f}, -{0.122983f,-0.097750f,0.987583f}, -{0.179281f,-0.164585f,0.969933f}, -{0.242667f,0.026390f,0.969751f}, -{0.158118f,0.020858f,0.987200f}, -{0.179281f,-0.164585f,0.969933f}, -{0.376794f,-0.013627f,0.926197f}, -{0.242667f,0.026390f,0.969751f}, -{0.179281f,-0.164585f,0.969933f}, -{0.565043f,0.231831f,0.791821f}, -{0.376794f,-0.013627f,0.926197f}, -{0.527283f,-0.011259f,0.849615f}, -{0.376794f,-0.013627f,0.926197f}, -{0.565043f,0.231831f,0.791821f}, -{0.414697f,0.103739f,0.904027f}, -{0.565043f,0.231831f,0.791821f}, -{0.527283f,-0.011259f,0.849615f}, -{0.640907f,0.116796f,0.758681f}, -{0.640907f,0.116796f,0.758681f}, -{0.850722f,0.190453f,0.489898f}, -{0.565043f,0.231831f,0.791821f}, -{0.787274f,0.549331f,-0.280064f}, -{0.927065f,0.363616f,0.091291f}, -{0.918800f,0.243044f,-0.311025f}, -{0.927065f,0.363616f,0.091291f}, -{0.787274f,0.549331f,-0.280064f}, -{0.814012f,0.575435f,0.079117f}, -{0.720146f,0.422107f,-0.550650f}, -{0.787274f,0.549331f,-0.280064f}, -{0.739626f,0.244446f,-0.627056f}, -{0.739626f,0.244446f,-0.627056f}, -{0.787274f,0.549331f,-0.280064f}, -{0.918800f,0.243044f,-0.311025f}, -{0.601037f,0.444240f,-0.664383f}, -{0.720146f,0.422107f,-0.550650f}, -{0.739626f,0.244446f,-0.627056f}, -{0.544847f,0.348199f,-0.762823f}, -{0.601037f,0.444240f,-0.664383f}, -{0.739626f,0.244446f,-0.627056f}, -{0.274301f,0.028423f,-0.961224f}, -{0.159629f,0.129378f,-0.978662f}, -{0.298945f,0.221806f,-0.928135f}, -{0.159629f,0.129378f,-0.978662f}, -{0.274301f,0.028423f,-0.961224f}, -{0.189929f,0.005792f,-0.981781f}, -{0.044948f,0.027639f,-0.998607f}, -{0.189929f,0.005792f,-0.981781f}, -{0.127284f,-0.160096f,-0.978861f}, -{-0.019661f,0.026870f,-0.999446f}, -{0.127284f,-0.160096f,-0.978861f}, -{-0.067677f,-0.209660f,-0.975429f}, -{0.127284f,-0.160096f,-0.978861f}, -{-0.019661f,0.026870f,-0.999446f}, -{0.044948f,0.027639f,-0.998607f}, -{-0.251380f,-0.456256f,-0.853603f}, -{-0.550195f,-0.213155f,-0.807373f}, -{-0.272935f,-0.219522f,-0.936652f}, -{-0.395419f,-0.465090f,-0.792045f}, -{-0.251380f,-0.456256f,-0.853603f}, -{-0.209838f,-0.630881f,-0.746966f}, -{-0.251380f,-0.456256f,-0.853603f}, -{-0.395419f,-0.465090f,-0.792045f}, -{-0.550195f,-0.213155f,-0.807373f}, -{-0.209838f,-0.630881f,-0.746966f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.395419f,-0.465090f,-0.792045f}, -{-0.265754f,-0.553200f,0.789522f}, -{-0.446685f,-0.386504f,0.806900f}, -{-0.597460f,-0.489542f,0.635130f}, -{-0.508226f,-0.208610f,0.835576f}, -{-0.446685f,-0.386504f,0.806900f}, -{-0.265754f,-0.553200f,0.789522f}, -{-0.289543f,-0.300206f,0.908868f}, -{-0.508226f,-0.208610f,0.835576f}, -{-0.265754f,-0.553200f,0.789522f}, -{-0.361869f,-0.333272f,0.870621f}, -{-0.289543f,-0.300206f,0.908868f}, -{-0.090166f,-0.412736f,0.906377f}, -{-0.008813f,-0.156680f,0.987610f}, -{-0.361869f,-0.333272f,0.870621f}, -{-0.090166f,-0.412736f,0.906377f}, -{0.122983f,-0.097750f,0.987583f}, -{-0.070118f,0.049294f,0.996320f}, -{-0.008813f,-0.156680f,0.987610f}, -{0.158118f,0.020858f,0.987200f}, -{-0.070118f,0.049294f,0.996320f}, -{0.122983f,-0.097750f,0.987583f}, -{0.186062f,0.180368f,0.965841f}, -{0.158118f,0.020858f,0.987200f}, -{0.242667f,0.026390f,0.969751f}, -{0.376794f,-0.013627f,0.926197f}, -{0.186062f,0.180368f,0.965841f}, -{0.242667f,0.026390f,0.969751f}, -{0.414697f,0.103739f,0.904027f}, -{0.186062f,0.180368f,0.965841f}, -{0.376794f,-0.013627f,0.926197f}, -{0.678340f,0.537250f,0.501215f}, -{0.565043f,0.231831f,0.791821f}, -{0.850722f,0.190453f,0.489898f}, -{0.850722f,0.190453f,0.489898f}, -{0.894621f,0.342989f,0.286376f}, -{0.678340f,0.537250f,0.501215f}, -{0.814012f,0.575435f,0.079117f}, -{0.850722f,0.190453f,0.489898f}, -{0.927065f,0.363616f,0.091291f}, -{0.850722f,0.190453f,0.489898f}, -{0.814012f,0.575435f,0.079117f}, -{0.894621f,0.342989f,0.286376f}, -{0.601037f,0.444240f,-0.664383f}, -{0.675467f,0.612012f,-0.411322f}, -{0.720146f,0.422107f,-0.550650f}, -{0.720146f,0.422107f,-0.550650f}, -{0.675467f,0.612012f,-0.411322f}, -{0.787274f,0.549331f,-0.280064f}, -{0.398680f,0.419429f,-0.815558f}, -{0.601037f,0.444240f,-0.664383f}, -{0.395134f,0.282959f,-0.873958f}, -{0.395134f,0.282959f,-0.873958f}, -{0.601037f,0.444240f,-0.664383f}, -{0.544847f,0.348199f,-0.762823f}, -{0.298945f,0.221806f,-0.928135f}, -{0.398680f,0.419429f,-0.815558f}, -{0.395134f,0.282959f,-0.873958f}, -{0.189929f,0.005792f,-0.981781f}, -{0.041871f,0.175597f,-0.983571f}, -{0.159629f,0.129378f,-0.978662f}, -{0.041871f,0.175597f,-0.983571f}, -{0.189929f,0.005792f,-0.981781f}, -{0.044948f,0.027639f,-0.998607f}, -{-0.315195f,0.056880f,-0.947321f}, -{-0.019661f,0.026870f,-0.999446f}, -{-0.067677f,-0.209660f,-0.975429f}, -{-0.315195f,0.056880f,-0.947321f}, -{-0.067677f,-0.209660f,-0.975429f}, -{-0.272935f,-0.219522f,-0.936652f}, -{-0.272935f,-0.219522f,-0.936652f}, -{-0.568896f,0.078875f,-0.818618f}, -{-0.315195f,0.056880f,-0.947321f}, -{-0.272935f,-0.219522f,-0.936652f}, -{-0.550195f,-0.213155f,-0.807373f}, -{-0.568896f,0.078875f,-0.818618f}, -{-0.550195f,-0.213155f,-0.807373f}, -{-0.395419f,-0.465090f,-0.792045f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.728572f,-0.301687f,-0.614954f}, -{-0.550195f,-0.213155f,-0.807373f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.804099f,-0.162968f,-0.571722f}, -{-0.728572f,-0.301687f,-0.614954f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.779610f,-0.366216f,-0.508029f}, -{-0.804099f,-0.162968f,-0.571722f}, -{-0.828833f,-0.150655f,0.538832f}, -{-0.830713f,-0.342849f,0.438601f}, -{-0.597460f,-0.489542f,0.635130f}, -{-0.684092f,-0.290992f,0.668836f}, -{-0.828833f,-0.150655f,0.538832f}, -{-0.597460f,-0.489542f,0.635130f}, -{-0.508226f,-0.208610f,0.835576f}, -{-0.684092f,-0.290992f,0.668836f}, -{-0.446685f,-0.386504f,0.806900f}, -{-0.446685f,-0.386504f,0.806900f}, -{-0.684092f,-0.290992f,0.668836f}, -{-0.597460f,-0.489542f,0.635130f}, -{-0.573384f,0.006584f,0.819261f}, -{-0.508226f,-0.208610f,0.835576f}, -{-0.289543f,-0.300206f,0.908868f}, -{-0.500157f,0.003273f,0.865929f}, -{-0.573384f,0.006584f,0.819261f}, -{-0.289543f,-0.300206f,0.908868f}, -{-0.285360f,-0.026680f,0.958049f}, -{-0.500157f,0.003273f,0.865929f}, -{-0.361869f,-0.333272f,0.870621f}, -{-0.361869f,-0.333272f,0.870621f}, -{-0.500157f,0.003273f,0.865929f}, -{-0.289543f,-0.300206f,0.908868f}, -{-0.008813f,-0.156680f,0.987610f}, -{-0.285360f,-0.026680f,0.958049f}, -{-0.361869f,-0.333272f,0.870621f}, -{-0.070118f,0.049294f,0.996320f}, -{-0.285360f,-0.026680f,0.958049f}, -{-0.008813f,-0.156680f,0.987610f}, -{0.158118f,0.020858f,0.987200f}, -{-0.142540f,0.179234f,0.973426f}, -{-0.070118f,0.049294f,0.996320f}, -{0.139288f,0.151287f,0.978627f}, -{-0.142540f,0.179234f,0.973426f}, -{0.158118f,0.020858f,0.987200f}, -{0.186062f,0.180368f,0.965841f}, -{0.139288f,0.151287f,0.978627f}, -{0.158118f,0.020858f,0.987200f}, -{0.349553f,0.420370f,0.837318f}, -{0.414697f,0.103739f,0.904027f}, -{0.565043f,0.231831f,0.791821f}, -{0.565043f,0.231831f,0.791821f}, -{0.484507f,0.439082f,0.756611f}, -{0.349553f,0.420370f,0.837318f}, -{0.565043f,0.231831f,0.791821f}, -{0.678340f,0.537250f,0.501215f}, -{0.484507f,0.439082f,0.756611f}, -{0.894621f,0.342989f,0.286376f}, -{0.814012f,0.575435f,0.079117f}, -{0.678340f,0.537250f,0.501215f}, -{0.657250f,0.722508f,-0.214485f}, -{0.624305f,0.777832f,-0.072254f}, -{0.787274f,0.549331f,-0.280064f}, -{0.787274f,0.549331f,-0.280064f}, -{0.624305f,0.777832f,-0.072254f}, -{0.814012f,0.575435f,0.079117f}, -{0.675467f,0.612012f,-0.411322f}, -{0.657250f,0.722508f,-0.214485f}, -{0.787274f,0.549331f,-0.280064f}, -{0.733091f,0.411928f,-0.541196f}, -{0.657250f,0.722508f,-0.214485f}, -{0.601037f,0.444240f,-0.664383f}, -{0.601037f,0.444240f,-0.664383f}, -{0.657250f,0.722508f,-0.214485f}, -{0.675467f,0.612012f,-0.411322f}, -{0.398680f,0.419429f,-0.815558f}, -{0.399040f,0.539230f,-0.741619f}, -{0.601037f,0.444240f,-0.664383f}, -{0.174832f,0.368797f,-0.912920f}, -{0.398680f,0.419429f,-0.815558f}, -{0.298945f,0.221806f,-0.928135f}, -{0.174832f,0.368797f,-0.912920f}, -{0.298945f,0.221806f,-0.928135f}, -{0.159629f,0.129378f,-0.978662f}, -{-0.243339f,0.229860f,-0.942311f}, -{0.044948f,0.027639f,-0.998607f}, -{-0.019661f,0.026870f,-0.999446f}, -{0.044948f,0.027639f,-0.998607f}, -{-0.243339f,0.229860f,-0.942311f}, -{0.041871f,0.175597f,-0.983571f}, -{-0.243339f,0.229860f,-0.942311f}, -{-0.019661f,0.026870f,-0.999446f}, -{-0.315195f,0.056880f,-0.947321f}, -{-0.550195f,-0.213155f,-0.807373f}, -{-0.705271f,-0.074692f,-0.704993f}, -{-0.568896f,0.078875f,-0.818618f}, -{-0.804099f,-0.162968f,-0.571722f}, -{-0.550195f,-0.213155f,-0.807373f}, -{-0.728572f,-0.301687f,-0.614954f}, -{-0.550195f,-0.213155f,-0.807373f}, -{-0.804099f,-0.162968f,-0.571722f}, -{-0.705271f,-0.074692f,-0.704993f}, -{-0.944767f,-0.159931f,-0.286072f}, -{-0.779610f,-0.366216f,-0.508029f}, -{-0.913250f,-0.339474f,-0.225238f}, -{-0.779610f,-0.366216f,-0.508029f}, -{-0.944767f,-0.159931f,-0.286072f}, -{-0.804099f,-0.162968f,-0.571722f}, -{-0.976443f,-0.186556f,0.108426f}, -{-0.913250f,-0.339474f,-0.225238f}, -{-0.903101f,-0.355778f,0.240479f}, -{-0.913250f,-0.339474f,-0.225238f}, -{-0.976443f,-0.186556f,0.108426f}, -{-0.944767f,-0.159931f,-0.286072f}, -{-0.828833f,-0.150655f,0.538832f}, -{-0.976443f,-0.186556f,0.108426f}, -{-0.830713f,-0.342849f,0.438601f}, -{-0.830713f,-0.342849f,0.438601f}, -{-0.976443f,-0.186556f,0.108426f}, -{-0.903101f,-0.355778f,0.240479f}, -{-0.573384f,0.006584f,0.819261f}, -{-0.828833f,-0.150655f,0.538832f}, -{-0.508226f,-0.208610f,0.835576f}, -{-0.508226f,-0.208610f,0.835576f}, -{-0.828833f,-0.150655f,0.538832f}, -{-0.684092f,-0.290992f,0.668836f}, -{-0.273342f,0.301606f,0.913410f}, -{-0.500157f,0.003273f,0.865929f}, -{-0.285360f,-0.026680f,0.958049f}, -{-0.126486f,0.332554f,0.934564f}, -{-0.273342f,0.301606f,0.913410f}, -{-0.070118f,0.049294f,0.996320f}, -{-0.070118f,0.049294f,0.996320f}, -{-0.273342f,0.301606f,0.913410f}, -{-0.285360f,-0.026680f,0.958049f}, -{-0.142540f,0.179234f,0.973426f}, -{-0.126486f,0.332554f,0.934564f}, -{-0.070118f,0.049294f,0.996320f}, -{0.186062f,0.180368f,0.965841f}, -{-0.182504f,0.169825f,0.968427f}, -{0.139288f,0.151287f,0.978627f}, -{0.139288f,0.151287f,0.978627f}, -{-0.182504f,0.169825f,0.968427f}, -{-0.142540f,0.179234f,0.973426f}, -{0.414697f,0.103739f,0.904027f}, -{0.153831f,0.381338f,0.911547f}, -{0.186062f,0.180368f,0.965841f}, -{0.414697f,0.103739f,0.904027f}, -{0.349553f,0.420370f,0.837318f}, -{0.153831f,0.381338f,0.911547f}, -{0.321825f,0.624026f,0.712054f}, -{0.349553f,0.420370f,0.837318f}, -{0.484507f,0.439082f,0.756611f}, -{0.484507f,0.439082f,0.756611f}, -{0.678340f,0.537250f,0.501215f}, -{0.321825f,0.624026f,0.712054f}, -{0.624305f,0.777832f,-0.072254f}, -{0.678340f,0.537250f,0.501215f}, -{0.814012f,0.575435f,0.079117f}, -{0.678340f,0.537250f,0.501215f}, -{0.624305f,0.777832f,-0.072254f}, -{0.785302f,0.584117f,0.205203f}, -{0.319978f,0.802093f,-0.504243f}, -{0.657250f,0.722508f,-0.214485f}, -{0.733091f,0.411928f,-0.541196f}, -{0.601037f,0.444240f,-0.664383f}, -{0.319978f,0.802093f,-0.504243f}, -{0.733091f,0.411928f,-0.541196f}, -{0.399040f,0.539230f,-0.741619f}, -{0.319978f,0.802093f,-0.504243f}, -{0.601037f,0.444240f,-0.664383f}, -{0.398680f,0.419429f,-0.815558f}, -{0.319978f,0.802093f,-0.504243f}, -{0.399040f,0.539230f,-0.741619f}, -{0.302165f,0.624606f,-0.720114f}, -{0.319978f,0.802093f,-0.504243f}, -{0.398680f,0.419429f,-0.815558f}, -{0.174832f,0.368797f,-0.912920f}, -{0.302165f,0.624606f,-0.720114f}, -{0.398680f,0.419429f,-0.815558f}, -{-0.099541f,0.373676f,-0.922203f}, -{0.174832f,0.368797f,-0.912920f}, -{0.159629f,0.129378f,-0.978662f}, -{-0.099541f,0.373676f,-0.922203f}, -{0.159629f,0.129378f,-0.978662f}, -{0.041871f,0.175597f,-0.983571f}, -{0.041871f,0.175597f,-0.983571f}, -{-0.243339f,0.229860f,-0.942311f}, -{-0.099541f,0.373676f,-0.922203f}, -{-0.315195f,0.056880f,-0.947321f}, -{-0.579699f,0.235714f,-0.779992f}, -{-0.243339f,0.229860f,-0.942311f}, -{-0.579699f,0.235714f,-0.779992f}, -{-0.315195f,0.056880f,-0.947321f}, -{-0.568896f,0.078875f,-0.818618f}, -{-0.808406f,0.056503f,-0.585907f}, -{-0.568896f,0.078875f,-0.818618f}, -{-0.705271f,-0.074692f,-0.704993f}, -{-0.808406f,0.056503f,-0.585907f}, -{-0.705271f,-0.074692f,-0.704993f}, -{-0.804099f,-0.162968f,-0.571722f}, -{-0.804099f,-0.162968f,-0.571722f}, -{-0.940520f,0.091826f,-0.327093f}, -{-0.808406f,0.056503f,-0.585907f}, -{-0.940520f,0.091826f,-0.327093f}, -{-0.804099f,-0.162968f,-0.571722f}, -{-0.944767f,-0.159931f,-0.286072f}, -{-0.997577f,-0.016674f,0.067545f}, -{-0.944767f,-0.159931f,-0.286072f}, -{-0.976443f,-0.186556f,0.108426f}, -{-0.944767f,-0.159931f,-0.286072f}, -{-0.997577f,-0.016674f,0.067545f}, -{-0.940520f,0.091826f,-0.327093f}, -{-0.884576f,-0.002331f,0.466390f}, -{-0.997577f,-0.016674f,0.067545f}, -{-0.828833f,-0.150655f,0.538832f}, -{-0.828833f,-0.150655f,0.538832f}, -{-0.997577f,-0.016674f,0.067545f}, -{-0.976443f,-0.186556f,0.108426f}, -{-0.711453f,0.027449f,0.702197f}, -{-0.884576f,-0.002331f,0.466390f}, -{-0.573384f,0.006584f,0.819261f}, -{-0.573384f,0.006584f,0.819261f}, -{-0.884576f,-0.002331f,0.466390f}, -{-0.828833f,-0.150655f,0.538832f}, -{-0.500157f,0.003273f,0.865929f}, -{-0.718362f,0.188940f,0.669521f}, -{-0.573384f,0.006584f,0.819261f}, -{-0.273342f,0.301606f,0.913410f}, -{-0.718362f,0.188940f,0.669521f}, -{-0.500157f,0.003273f,0.865929f}, -{-0.142540f,0.179234f,0.973426f}, -{-0.273342f,0.301606f,0.913410f}, -{-0.126486f,0.332554f,0.934564f}, -{-0.222935f,0.386297f,0.895027f}, -{-0.273342f,0.301606f,0.913410f}, -{-0.142540f,0.179234f,0.973426f}, -{-0.182504f,0.169825f,0.968427f}, -{-0.222935f,0.386297f,0.895027f}, -{-0.142540f,0.179234f,0.973426f}, -{0.186062f,0.180368f,0.965841f}, -{-0.222935f,0.386297f,0.895027f}, -{-0.182504f,0.169825f,0.968427f}, -{0.153831f,0.381338f,0.911547f}, -{-0.222935f,0.386297f,0.895027f}, -{0.186062f,0.180368f,0.965841f}, -{0.349553f,0.420370f,0.837318f}, -{0.316223f,0.656311f,0.685025f}, -{0.153831f,0.381338f,0.911547f}, -{0.318433f,0.826794f,0.463694f}, -{0.349553f,0.420370f,0.837318f}, -{0.321825f,0.624026f,0.712054f}, -{0.349553f,0.420370f,0.837318f}, -{0.318433f,0.826794f,0.463694f}, -{0.316223f,0.656311f,0.685025f}, -{0.318433f,0.826794f,0.463694f}, -{0.321825f,0.624026f,0.712054f}, -{0.678340f,0.537250f,0.501215f}, -{0.318433f,0.826794f,0.463694f}, -{0.678340f,0.537250f,0.501215f}, -{0.785302f,0.584117f,0.205203f}, -{0.785302f,0.584117f,0.205203f}, -{0.624305f,0.777832f,-0.072254f}, -{0.318433f,0.826794f,0.463694f}, -{0.296834f,0.948255f,-0.112704f}, -{0.255764f,0.965764f,0.043409f}, -{0.657250f,0.722508f,-0.214485f}, -{0.657250f,0.722508f,-0.214485f}, -{0.255764f,0.965764f,0.043409f}, -{0.624305f,0.777832f,-0.072254f}, -{0.319978f,0.802093f,-0.504243f}, -{0.296834f,0.948255f,-0.112704f}, -{0.657250f,0.722508f,-0.214485f}, -{0.302165f,0.624606f,-0.720114f}, -{0.354022f,0.868325f,-0.347391f}, -{0.319978f,0.802093f,-0.504243f}, -{0.134018f,0.739202f,-0.660015f}, -{0.354022f,0.868325f,-0.347391f}, -{0.174832f,0.368797f,-0.912920f}, -{0.174832f,0.368797f,-0.912920f}, -{0.354022f,0.868325f,-0.347391f}, -{0.302165f,0.624606f,-0.720114f}, -{-0.119566f,0.747988f,-0.652853f}, -{0.134018f,0.739202f,-0.660015f}, -{0.174832f,0.368797f,-0.912920f}, -{-0.099541f,0.373676f,-0.922203f}, -{-0.119566f,0.747988f,-0.652853f}, -{0.174832f,0.368797f,-0.912920f}, -{-0.293826f,0.478971f,-0.827196f}, -{-0.099541f,0.373676f,-0.922203f}, -{-0.243339f,0.229860f,-0.942311f}, -{-0.538344f,0.484286f,-0.689676f}, -{-0.243339f,0.229860f,-0.942311f}, -{-0.579699f,0.235714f,-0.779992f}, -{-0.243339f,0.229860f,-0.942311f}, -{-0.538344f,0.484286f,-0.689676f}, -{-0.293826f,0.478971f,-0.827196f}, -{-0.682500f,0.299461f,-0.666721f}, -{-0.579699f,0.235714f,-0.779992f}, -{-0.568896f,0.078875f,-0.818618f}, -{-0.775401f,0.319263f,-0.544817f}, -{-0.568896f,0.078875f,-0.818618f}, -{-0.808406f,0.056503f,-0.585907f}, -{-0.568896f,0.078875f,-0.818618f}, -{-0.775401f,0.319263f,-0.544817f}, -{-0.682500f,0.299461f,-0.666721f}, -{-0.920289f,0.369469f,-0.128688f}, -{-0.808406f,0.056503f,-0.585907f}, -{-0.940520f,0.091826f,-0.327093f}, -{-0.808406f,0.056503f,-0.585907f}, -{-0.920289f,0.369469f,-0.128688f}, -{-0.775401f,0.319263f,-0.544817f}, -{-0.924440f,0.373403f,0.077340f}, -{-0.940520f,0.091826f,-0.327093f}, -{-0.997577f,-0.016674f,0.067545f}, -{-0.940520f,0.091826f,-0.327093f}, -{-0.924440f,0.373403f,0.077340f}, -{-0.920289f,0.369469f,-0.128688f}, -{-0.789878f,0.261331f,0.554797f}, -{-0.924440f,0.373403f,0.077340f}, -{-0.884576f,-0.002331f,0.466390f}, -{-0.884576f,-0.002331f,0.466390f}, -{-0.924440f,0.373403f,0.077340f}, -{-0.997577f,-0.016674f,0.067545f}, -{-0.711453f,0.027449f,0.702197f}, -{-0.789878f,0.261331f,0.554797f}, -{-0.884576f,-0.002331f,0.466390f}, -{-0.718362f,0.188940f,0.669521f}, -{-0.789878f,0.261331f,0.554797f}, -{-0.573384f,0.006584f,0.819261f}, -{-0.573384f,0.006584f,0.819261f}, -{-0.789878f,0.261331f,0.554797f}, -{-0.711453f,0.027449f,0.702197f}, -{-0.397768f,0.588769f,0.703655f}, -{-0.612838f,0.530118f,0.586007f}, -{-0.273342f,0.301606f,0.913410f}, -{-0.273342f,0.301606f,0.913410f}, -{-0.612838f,0.530118f,0.586007f}, -{-0.718362f,0.188940f,0.669521f}, -{-0.222935f,0.386297f,0.895027f}, -{-0.397768f,0.588769f,0.703655f}, -{-0.273342f,0.301606f,0.913410f}, -{0.153831f,0.381338f,0.911547f}, -{-0.095818f,0.712020f,0.695590f}, -{-0.222935f,0.386297f,0.895027f}, -{0.153831f,0.381338f,0.911547f}, -{0.135316f,0.709200f,0.691900f}, -{-0.095818f,0.712020f,0.695590f}, -{0.135316f,0.709200f,0.691900f}, -{0.153831f,0.381338f,0.911547f}, -{0.316223f,0.656311f,0.685025f}, -{0.316223f,0.656311f,0.685025f}, -{0.062599f,0.945507f,0.319528f}, -{0.135316f,0.709200f,0.691900f}, -{0.316223f,0.656311f,0.685025f}, -{0.318433f,0.826794f,0.463694f}, -{0.062599f,0.945507f,0.319528f}, -{0.255764f,0.965764f,0.043409f}, -{0.318433f,0.826794f,0.463694f}, -{0.624305f,0.777832f,-0.072254f}, -{0.354022f,0.868325f,-0.347391f}, -{0.074752f,0.976718f,-0.201083f}, -{0.319978f,0.802093f,-0.504243f}, -{0.319978f,0.802093f,-0.504243f}, -{0.074752f,0.976718f,-0.201083f}, -{0.296834f,0.948255f,-0.112704f}, -{-0.102846f,0.927150f,-0.360300f}, -{0.354022f,0.868325f,-0.347391f}, -{0.134018f,0.739202f,-0.660015f}, -{-0.119566f,0.747988f,-0.652853f}, -{-0.102846f,0.927150f,-0.360300f}, -{0.134018f,0.739202f,-0.660015f}, -{-0.099541f,0.373676f,-0.922203f}, -{-0.278258f,0.639920f,-0.716293f}, -{-0.119566f,0.747988f,-0.652853f}, -{-0.099541f,0.373676f,-0.922203f}, -{-0.293826f,0.478971f,-0.827196f}, -{-0.278258f,0.639920f,-0.716293f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.538344f,0.484286f,-0.689676f}, -{-0.579699f,0.235714f,-0.779992f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.579699f,0.235714f,-0.779992f}, -{-0.682500f,0.299461f,-0.666721f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.682500f,0.299461f,-0.666721f}, -{-0.775401f,0.319263f,-0.544817f}, -{-0.775401f,0.319263f,-0.544817f}, -{-0.765919f,0.473886f,-0.434512f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.775401f,0.319263f,-0.544817f}, -{-0.920289f,0.369469f,-0.128688f}, -{-0.765919f,0.473886f,-0.434512f}, -{-0.797912f,0.474437f,0.371815f}, -{-0.924440f,0.373403f,0.077340f}, -{-0.789878f,0.261331f,0.554797f}, -{-0.703599f,0.591217f,0.394222f}, -{-0.797912f,0.474437f,0.371815f}, -{-0.789878f,0.261331f,0.554797f}, -{-0.718362f,0.188940f,0.669521f}, -{-0.703599f,0.591217f,0.394222f}, -{-0.789878f,0.261331f,0.554797f}, -{-0.612838f,0.530118f,0.586007f}, -{-0.703599f,0.591217f,0.394222f}, -{-0.718362f,0.188940f,0.669521f}, -{-0.290902f,0.695856f,0.656628f}, -{-0.397768f,0.588769f,0.703655f}, -{-0.222935f,0.386297f,0.895027f}, -{-0.095818f,0.712020f,0.695590f}, -{-0.290902f,0.695856f,0.656628f}, -{-0.222935f,0.386297f,0.895027f}, -{0.135316f,0.709200f,0.691900f}, -{-0.046220f,0.930211f,0.364103f}, -{-0.095818f,0.712020f,0.695590f}, -{0.135316f,0.709200f,0.691900f}, -{0.062599f,0.945507f,0.319528f}, -{-0.046220f,0.930211f,0.364103f}, -{0.318433f,0.826794f,0.463694f}, -{0.255764f,0.965764f,0.043409f}, -{0.062599f,0.945507f,0.319528f}, -{0.074752f,0.976718f,-0.201083f}, -{-0.012574f,0.999472f,-0.029950f}, -{0.296834f,0.948255f,-0.112704f}, -{0.296834f,0.948255f,-0.112704f}, -{-0.012574f,0.999472f,-0.029950f}, -{0.255764f,0.965764f,0.043409f}, -{-0.375341f,0.768018f,-0.518910f}, -{-0.119566f,0.747988f,-0.652853f}, -{-0.278258f,0.639920f,-0.716293f}, -{-0.119566f,0.747988f,-0.652853f}, -{-0.375341f,0.768018f,-0.518910f}, -{-0.102846f,0.927150f,-0.360300f}, -{-0.375341f,0.768018f,-0.518910f}, -{-0.278258f,0.639920f,-0.716293f}, -{-0.293826f,0.478971f,-0.827196f}, -{-0.375341f,0.768018f,-0.518910f}, -{-0.293826f,0.478971f,-0.827196f}, -{-0.538344f,0.484286f,-0.689676f}, -{-0.538344f,0.484286f,-0.689676f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.375341f,0.768018f,-0.518910f}, -{-0.723262f,0.643881f,-0.249619f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.765919f,0.473886f,-0.434512f}, -{-0.723262f,0.643881f,-0.249619f}, -{-0.765919f,0.473886f,-0.434512f}, -{-0.920289f,0.369469f,-0.128688f}, -{-0.920289f,0.369469f,-0.128688f}, -{-0.722290f,0.687307f,-0.076851f}, -{-0.723262f,0.643881f,-0.249619f}, -{-0.756368f,0.654141f,0.002648f}, -{-0.920289f,0.369469f,-0.128688f}, -{-0.924440f,0.373403f,0.077340f}, -{-0.920289f,0.369469f,-0.128688f}, -{-0.756368f,0.654141f,0.002648f}, -{-0.722290f,0.687307f,-0.076851f}, -{-0.724438f,0.657641f,0.206634f}, -{-0.756368f,0.654141f,0.002648f}, -{-0.924440f,0.373403f,0.077340f}, -{-0.797912f,0.474437f,0.371815f}, -{-0.724438f,0.657641f,0.206634f}, -{-0.924440f,0.373403f,0.077340f}, -{-0.703599f,0.591217f,0.394222f}, -{-0.724438f,0.657641f,0.206634f}, -{-0.797912f,0.474437f,0.371815f}, -{-0.293101f,0.861731f,0.414140f}, -{-0.703599f,0.591217f,0.394222f}, -{-0.612838f,0.530118f,0.586007f}, -{-0.397768f,0.588769f,0.703655f}, -{-0.293101f,0.861731f,0.414140f}, -{-0.612838f,0.530118f,0.586007f}, -{-0.290902f,0.695856f,0.656628f}, -{-0.293101f,0.861731f,0.414140f}, -{-0.397768f,0.588769f,0.703655f}, -{-0.046220f,0.930211f,0.364103f}, -{-0.293101f,0.861731f,0.414140f}, -{-0.095818f,0.712020f,0.695590f}, -{-0.095818f,0.712020f,0.695590f}, -{-0.293101f,0.861731f,0.414140f}, -{-0.290902f,0.695856f,0.656628f}, -{-0.012574f,0.999472f,-0.029950f}, -{0.062599f,0.945507f,0.319528f}, -{0.255764f,0.965764f,0.043409f}, -{0.354022f,0.868325f,-0.347391f}, -{-0.138152f,0.986340f,-0.089709f}, -{0.074752f,0.976718f,-0.201083f}, -{-0.102846f,0.927150f,-0.360300f}, -{-0.138152f,0.986340f,-0.089709f}, -{0.354022f,0.868325f,-0.347391f}, -{-0.375341f,0.768018f,-0.518910f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.405200f,0.877247f,-0.257393f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.568164f,0.814559f,-0.116979f}, -{-0.405200f,0.877247f,-0.257393f}, -{-0.723262f,0.643881f,-0.249619f}, -{-0.568164f,0.814559f,-0.116979f}, -{-0.638911f,0.597556f,-0.484479f}, -{-0.568164f,0.814559f,-0.116979f}, -{-0.723262f,0.643881f,-0.249619f}, -{-0.722290f,0.687307f,-0.076851f}, -{-0.625314f,0.776642f,0.076228f}, -{-0.722290f,0.687307f,-0.076851f}, -{-0.756368f,0.654141f,0.002648f}, -{-0.722290f,0.687307f,-0.076851f}, -{-0.625314f,0.776642f,0.076228f}, -{-0.568164f,0.814559f,-0.116979f}, -{-0.724438f,0.657641f,0.206634f}, -{-0.625314f,0.776642f,0.076228f}, -{-0.756368f,0.654141f,0.002648f}, -{-0.703599f,0.591217f,0.394222f}, -{-0.625314f,0.776642f,0.076228f}, -{-0.724438f,0.657641f,0.206634f}, -{-0.625314f,0.776642f,0.076228f}, -{-0.703599f,0.591217f,0.394222f}, -{-0.574023f,0.790035f,0.215271f}, -{-0.703599f,0.591217f,0.394222f}, -{-0.293101f,0.861731f,0.414140f}, -{-0.574023f,0.790035f,0.215271f}, -{0.062599f,0.945507f,0.319528f}, -{-0.250129f,0.966122f,0.063592f}, -{-0.046220f,0.930211f,0.364103f}, -{-0.250129f,0.966122f,0.063592f}, -{0.062599f,0.945507f,0.319528f}, -{-0.012574f,0.999472f,-0.029950f}, -{-0.138152f,0.986340f,-0.089709f}, -{-0.012574f,0.999472f,-0.029950f}, -{0.074752f,0.976718f,-0.201083f}, -{-0.012574f,0.999472f,-0.029950f}, -{-0.138152f,0.986340f,-0.089709f}, -{-0.250129f,0.966122f,0.063592f}, -{-0.102846f,0.927150f,-0.360300f}, -{-0.405200f,0.877247f,-0.257393f}, -{-0.138152f,0.986340f,-0.089709f}, -{-0.405200f,0.877247f,-0.257393f}, -{-0.102846f,0.927150f,-0.360300f}, -{-0.375341f,0.768018f,-0.518910f}, -{-0.328676f,0.944200f,0.021421f}, -{-0.568164f,0.814559f,-0.116979f}, -{-0.625314f,0.776642f,0.076228f}, -{-0.568164f,0.814559f,-0.116979f}, -{-0.328676f,0.944200f,0.021421f}, -{-0.405200f,0.877247f,-0.257393f}, -{-0.328676f,0.944200f,0.021421f}, -{-0.625314f,0.776642f,0.076228f}, -{-0.574023f,0.790035f,0.215271f}, -{-0.293101f,0.861731f,0.414140f}, -{-0.328676f,0.944200f,0.021421f}, -{-0.574023f,0.790035f,0.215271f}, -{-0.046220f,0.930211f,0.364103f}, -{-0.328676f,0.944200f,0.021421f}, -{-0.293101f,0.861731f,0.414140f}, -{-0.250129f,0.966122f,0.063592f}, -{-0.328676f,0.944200f,0.021421f}, -{-0.046220f,0.930211f,0.364103f}, -{-0.138152f,0.986340f,-0.089709f}, -{-0.328676f,0.944200f,0.021421f}, -{-0.250129f,0.966122f,0.063592f}, -{-0.328676f,0.944200f,0.021421f}, -{-0.138152f,0.986340f,-0.089709f}, -{-0.405200f,0.877247f,-0.257393f}, -{-0.807580f,-0.530334f,-0.257994f}, -{-0.779610f,-0.366216f,-0.508029f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.561849f,-0.579983f,-0.589869f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.243728f,-0.567734f,-0.786304f}, -{-0.225805f,-0.587739f,-0.776901f}, -{-0.019689f,-0.435906f,-0.899777f}, -{-0.019689f,-0.435906f,-0.899777f}, -{-0.225805f,-0.587739f,-0.776901f}, -{-0.090844f,-0.184718f,-0.978584f}, -{-0.323965f,-0.562074f,0.760999f}, -{-0.084651f,-0.587452f,0.804819f}, -{-0.258966f,-0.584187f,0.769196f}, -{-0.733042f,-0.570025f,0.371107f}, -{-0.903101f,-0.355778f,0.240479f}, -{-0.796480f,-0.556747f,0.235906f}, -{0.050233f,-0.840017f,0.540230f}, -{0.323534f,0.555600f,0.765921f}, -{0.638555f,0.563372f,-0.524271f}, -{0.042877f,-0.197790f,-0.979306f}, -{-0.090844f,-0.184718f,-0.978584f}, -{-0.019689f,-0.435906f,-0.899777f}, -{-0.561849f,-0.579983f,-0.589869f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.597460f,-0.489542f,0.635130f}, -{-0.733042f,-0.570025f,0.371107f}, -{-0.521880f,-0.609673f,0.596608f}, -{-0.603996f,-0.470107f,-0.643574f}, -{-0.643897f,-0.625762f,-0.440249f}, -{-0.779610f,-0.366216f,-0.508029f}, -{-0.779610f,-0.366216f,-0.508029f}, -{-0.807580f,-0.530334f,-0.257994f}, -{-0.913250f,-0.339474f,-0.225238f}, -{-0.807580f,-0.530334f,-0.257994f}, -{-0.903101f,-0.355778f,0.240479f}, -{-0.913250f,-0.339474f,-0.225238f}, -{-0.903101f,-0.355778f,0.240479f}, -{-0.733042f,-0.570025f,0.371107f}, -{-0.830713f,-0.342849f,0.438601f}, -{-0.830713f,-0.342849f,0.438601f}, -{-0.733042f,-0.570025f,0.371107f}, -{-0.597460f,-0.489542f,0.635130f}, -{-0.796480f,-0.556747f,0.235906f}, -{-0.903101f,-0.355778f,0.240479f}, -{-0.807580f,-0.530334f,-0.257994f}, -{-0.927303f,-0.337884f,0.161072f}, -{-0.937303f,-0.346680f,0.035733f}, -{-0.799842f,-0.598163f,0.049534f}, -{-0.800970f,-0.540007f,0.258532f}, -{-0.925595f,-0.219969f,0.308037f}, -{-0.927303f,-0.337884f,0.161072f}, -{-0.799842f,-0.598163f,0.049534f}, -{-0.800970f,-0.540007f,0.258532f}, -{-0.927303f,-0.337884f,0.161072f}, -{-0.925595f,-0.219969f,0.308037f}, -{-0.988514f,-0.140680f,0.055221f}, -{-0.927303f,-0.337884f,0.161072f}, -{-0.988514f,-0.140680f,0.055221f}, -{-0.925595f,-0.219969f,0.308037f}, -{-0.946894f,-0.083377f,0.310547f}, -{-0.927303f,-0.337884f,0.161072f}, -{-0.988514f,-0.140680f,0.055221f}, -{-0.937303f,-0.346680f,0.035733f}, -{-0.793268f,-0.380270f,0.475521f}, -{-0.925595f,-0.219969f,0.308037f}, -{-0.753868f,-0.528527f,0.390310f}, -{-0.925595f,-0.219969f,0.308037f}, -{-0.793268f,-0.380270f,0.475521f}, -{-0.912801f,-0.112862f,0.392499f}, -{-0.753868f,-0.528527f,0.390310f}, -{-0.925595f,-0.219969f,0.308037f}, -{-0.800970f,-0.540007f,0.258532f}, -{-0.878151f,-0.009979f,0.478279f}, -{-0.787639f,-0.269027f,0.554301f}, -{-0.850583f,0.097851f,0.516657f}, -{-0.787639f,-0.269027f,0.554301f}, -{-0.912801f,-0.112862f,0.392499f}, -{-0.793268f,-0.380270f,0.475521f}, -{-0.912801f,-0.112862f,0.392499f}, -{-0.787639f,-0.269027f,0.554301f}, -{-0.878151f,-0.009979f,0.478279f}, -{-0.669551f,0.202368f,0.714667f}, -{-0.616256f,0.410615f,0.672029f}, -{-0.542040f,0.629184f,0.557063f}, -{-0.542040f,0.629184f,0.557063f}, -{-0.586320f,0.540668f,0.603247f}, -{-0.669551f,0.202368f,0.714667f}, -{-0.669551f,0.202368f,0.714667f}, -{-0.760001f,0.324191f,0.563293f}, -{-0.755415f,0.076920f,0.650716f}, -{-0.760001f,0.324191f,0.563293f}, -{-0.669551f,0.202368f,0.714667f}, -{-0.586320f,0.540668f,0.603247f}, -{-0.124844f,0.873959f,0.469691f}, -{-0.542040f,0.629184f,0.557063f}, -{-0.335869f,0.689550f,0.641648f}, -{-0.542040f,0.629184f,0.557063f}, -{-0.616256f,0.410615f,0.672029f}, -{-0.335869f,0.689550f,0.641648f}, -{0.135575f,0.967464f,0.213620f}, -{0.134729f,0.972475f,0.190106f}, -{0.071823f,0.988827f,0.130627f}, -{0.071526f,0.972134f,0.223247f}, -{0.098032f,0.964604f,0.244805f}, -{0.135575f,0.967464f,0.213620f}, -{0.071823f,0.988827f,0.130627f}, -{0.071526f,0.972134f,0.223247f}, -{0.135575f,0.967464f,0.213620f}, -{0.077268f,0.992763f,0.091936f}, -{0.134729f,0.972475f,0.190106f}, -{0.125966f,0.985447f,0.114132f}, -{0.053007f,0.998593f,0.001737f}, -{0.077268f,0.992763f,0.091936f}, -{0.125966f,0.985447f,0.114132f}, -{0.077268f,0.992763f,0.091936f}, -{0.071823f,0.988827f,0.130627f}, -{0.134729f,0.972475f,0.190106f}, -{0.135970f,0.988769f,0.062032f}, -{0.041037f,0.999024f,0.016341f}, -{0.125966f,0.985447f,0.114132f}, -{0.125966f,0.985447f,0.114132f}, -{0.041037f,0.999024f,0.016341f}, -{0.053007f,0.998593f,0.001737f}, -{0.139528f,0.980985f,-0.134911f}, -{0.029330f,0.999344f,-0.021255f}, -{0.128835f,0.990367f,-0.050748f}, -{0.029330f,0.999344f,-0.021255f}, -{0.139528f,0.980985f,-0.134911f}, -{0.057898f,0.998302f,0.006430f}, -{0.128835f,0.990367f,-0.050748f}, -{0.041037f,0.999024f,0.016341f}, -{0.135970f,0.988769f,0.062032f}, -{0.041037f,0.999024f,0.016341f}, -{0.128835f,0.990367f,-0.050748f}, -{0.029330f,0.999344f,-0.021255f}, -{0.138558f,0.971214f,-0.193767f}, -{0.111817f,0.988378f,-0.102986f}, -{0.139528f,0.980985f,-0.134911f}, -{0.057898f,0.998302f,0.006430f}, -{0.139528f,0.980985f,-0.134911f}, -{0.111817f,0.988378f,-0.102986f}, -{0.058741f,0.975100f,-0.213843f}, -{0.140515f,0.968515f,-0.205508f}, -{0.095780f,0.971889f,-0.215078f}, -{-0.397014f,0.641777f,-0.656127f}, -{-0.598070f,0.462524f,-0.654510f}, -{-0.537060f,0.609628f,-0.583027f}, -{-0.537060f,0.609628f,-0.583027f}, -{-0.237835f,0.825207f,-0.512316f}, -{-0.397014f,0.641777f,-0.656127f}, -{-0.759992f,-0.028623f,-0.649302f}, -{-0.739554f,0.361004f,-0.568099f}, -{-0.671768f,0.233451f,-0.703014f}, -{-0.671768f,0.233451f,-0.703014f}, -{-0.739554f,0.361004f,-0.568099f}, -{-0.601154f,0.511409f,-0.614064f}, -{-0.537060f,0.609628f,-0.583027f}, -{-0.598070f,0.462524f,-0.654510f}, -{-0.671768f,0.233451f,-0.703014f}, -{-0.601154f,0.511409f,-0.614064f}, -{-0.537060f,0.609628f,-0.583027f}, -{-0.671768f,0.233451f,-0.703014f}, -{-0.762666f,-0.418919f,-0.492796f}, -{-0.916145f,-0.160493f,-0.367314f}, -{-0.792261f,-0.268380f,-0.547992f}, -{-0.792261f,-0.268380f,-0.547992f}, -{-0.916145f,-0.160493f,-0.367314f}, -{-0.885015f,-0.020410f,-0.465115f}, -{-0.792261f,-0.268380f,-0.547992f}, -{-0.885015f,-0.020410f,-0.465115f}, -{-0.847640f,0.110414f,-0.518956f}, -{-0.779406f,-0.555755f,-0.289246f}, -{-0.913898f,-0.318786f,-0.251330f}, -{-0.773243f,-0.498286f,-0.392182f}, -{-0.773243f,-0.498286f,-0.392182f}, -{-0.913898f,-0.318786f,-0.251330f}, -{-0.916145f,-0.160493f,-0.367314f}, -{-0.773243f,-0.498286f,-0.392182f}, -{-0.916145f,-0.160493f,-0.367314f}, -{-0.762666f,-0.418919f,-0.492796f}, -{-0.799842f,-0.598163f,0.049534f}, -{-0.937303f,-0.346680f,0.035733f}, -{-0.935713f,-0.338361f,-0.099759f}, -{-0.783854f,-0.600732f,-0.157143f}, -{-0.799842f,-0.598163f,0.049534f}, -{-0.935713f,-0.338361f,-0.099759f}, -{-0.937303f,-0.346680f,0.035733f}, -{-0.988514f,-0.140680f,0.055221f}, -{-0.935713f,-0.338361f,-0.099759f}, -{-0.935713f,-0.338361f,-0.099759f}, -{-0.988514f,-0.140680f,0.055221f}, -{-0.958645f,-0.131653f,-0.252323f}, -{-0.935713f,-0.338361f,-0.099759f}, -{-0.958645f,-0.131653f,-0.252323f}, -{-0.913898f,-0.318786f,-0.251330f}, -{-0.783854f,-0.600732f,-0.157143f}, -{-0.935713f,-0.338361f,-0.099759f}, -{-0.913898f,-0.318786f,-0.251330f}, -{-0.779406f,-0.555755f,-0.289246f}, -{-0.783854f,-0.600732f,-0.157143f}, -{-0.913898f,-0.318786f,-0.251330f}, -{-0.621396f,-0.736146f,0.268247f}, -{-0.800970f,-0.540007f,0.258532f}, -{-0.799842f,-0.598163f,0.049534f}, -{-0.615287f,-0.788146f,-0.015744f}, -{-0.621396f,-0.736146f,0.268247f}, -{-0.799842f,-0.598163f,0.049534f}, -{-0.753868f,-0.528527f,0.390310f}, -{-0.800970f,-0.540007f,0.258532f}, -{-0.621396f,-0.736146f,0.268247f}, -{-0.600251f,-0.614652f,0.511764f}, -{-0.793268f,-0.380270f,0.475521f}, -{-0.753868f,-0.528527f,0.390310f}, -{-0.621396f,-0.736146f,0.268247f}, -{-0.600251f,-0.614652f,0.511764f}, -{-0.753868f,-0.528527f,0.390310f}, -{-0.787639f,-0.269027f,0.554301f}, -{-0.793268f,-0.380270f,0.475521f}, -{-0.600251f,-0.614652f,0.511764f}, -{-0.600251f,-0.614652f,0.511764f}, -{-0.502597f,-0.561961f,0.656959f}, -{-0.633175f,-0.455326f,0.625914f}, -{-0.633175f,-0.455326f,0.625914f}, -{-0.787639f,-0.269027f,0.554301f}, -{-0.600251f,-0.614652f,0.511764f}, -{-0.237230f,-0.360647f,0.902029f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.399666f,-0.459233f,0.793330f}, -{-0.814055f,-0.041024f,0.579337f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.755415f,0.076920f,0.650716f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.787639f,-0.269027f,0.554301f}, -{-0.633175f,-0.455326f,0.625914f}, -{-0.787639f,-0.269027f,0.554301f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.814055f,-0.041024f,0.579337f}, -{-0.399666f,-0.459233f,0.793330f}, -{-0.633175f,-0.455326f,0.625914f}, -{-0.502597f,-0.561961f,0.656959f}, -{-0.633175f,-0.455326f,0.625914f}, -{-0.399666f,-0.459233f,0.793330f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.382842f,0.339600f,0.859130f}, -{-0.616256f,0.410615f,0.672029f}, -{-0.499130f,0.176378f,0.848387f}, -{-0.499130f,0.176378f,0.848387f}, -{-0.616256f,0.410615f,0.672029f}, -{-0.669551f,0.202368f,0.714667f}, -{-0.669551f,0.202368f,0.714667f}, -{-0.370077f,-0.091471f,0.924487f}, -{-0.499130f,0.176378f,0.848387f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.370077f,-0.091471f,0.924487f}, -{-0.669551f,0.202368f,0.714667f}, -{-0.755415f,0.076920f,0.650716f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.669551f,0.202368f,0.714667f}, -{-0.162448f,-0.277452f,0.946906f}, -{-0.370077f,-0.091471f,0.924487f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.568417f,-0.260486f,0.780416f}, -{-0.237230f,-0.360647f,0.902029f}, -{-0.162448f,-0.277452f,0.946906f}, -{-0.382842f,0.339600f,0.859130f}, -{-0.335869f,0.689550f,0.641648f}, -{-0.616256f,0.410615f,0.672029f}, -{0.444480f,0.855660f,0.265111f}, -{0.332144f,0.915062f,0.228784f}, -{0.429695f,0.814320f,0.390185f}, -{0.429695f,0.814320f,0.390185f}, -{0.332144f,0.915062f,0.228784f}, -{0.334402f,0.886440f,0.320000f}, -{0.267882f,0.921692f,0.280576f}, -{0.334402f,0.886440f,0.320000f}, -{0.332144f,0.915062f,0.228784f}, -{0.332144f,0.915062f,0.228784f}, -{0.231329f,0.957766f,0.170795f}, -{0.267882f,0.921692f,0.280576f}, -{0.231329f,0.957766f,0.170795f}, -{0.187050f,0.956413f,0.224247f}, -{0.267882f,0.921692f,0.280576f}, -{0.231329f,0.957766f,0.170795f}, -{0.125966f,0.985447f,0.114132f}, -{0.187050f,0.956413f,0.224247f}, -{0.125966f,0.985447f,0.114132f}, -{0.134729f,0.972475f,0.190106f}, -{0.187050f,0.956413f,0.224247f}, -{0.429695f,0.814320f,0.390185f}, -{0.334402f,0.886440f,0.320000f}, -{0.213363f,0.870099f,0.444302f}, -{0.470076f,0.713698f,0.519292f}, -{0.429695f,0.814320f,0.390185f}, -{0.213363f,0.870099f,0.444302f}, -{0.213363f,0.870099f,0.444302f}, -{0.334402f,0.886440f,0.320000f}, -{0.267882f,0.921692f,0.280576f}, -{0.135970f,0.988769f,0.062032f}, -{0.125966f,0.985447f,0.114132f}, -{0.231329f,0.957766f,0.170795f}, -{0.269249f,0.963068f,-0.002114f}, -{0.135970f,0.988769f,0.062032f}, -{0.231329f,0.957766f,0.170795f}, -{0.332144f,0.915062f,0.228784f}, -{0.444480f,0.855660f,0.265111f}, -{0.495685f,0.868428f,0.011380f}, -{0.269249f,0.963068f,-0.002114f}, -{0.231329f,0.957766f,0.170795f}, -{0.332144f,0.915062f,0.228784f}, -{0.495685f,0.868428f,0.011380f}, -{0.269249f,0.963068f,-0.002114f}, -{0.332144f,0.915062f,0.228784f}, -{0.269249f,0.963068f,-0.002114f}, -{0.267189f,0.943676f,-0.195156f}, -{0.128835f,0.990367f,-0.050748f}, -{0.267189f,0.943676f,-0.195156f}, -{0.139528f,0.980985f,-0.134911f}, -{0.128835f,0.990367f,-0.050748f}, -{0.128835f,0.990367f,-0.050748f}, -{0.135970f,0.988769f,0.062032f}, -{0.269249f,0.963068f,-0.002114f}, -{0.269249f,0.963068f,-0.002114f}, -{0.439209f,0.866819f,-0.236050f}, -{0.267189f,0.943676f,-0.195156f}, -{0.439209f,0.866819f,-0.236050f}, -{0.269249f,0.963068f,-0.002114f}, -{0.495685f,0.868428f,0.011380f}, -{0.274319f,0.922629f,-0.271118f}, -{0.139528f,0.980985f,-0.134911f}, -{0.267189f,0.943676f,-0.195156f}, -{0.445390f,0.806344f,-0.389150f}, -{0.267189f,0.943676f,-0.195156f}, -{0.439209f,0.866819f,-0.236050f}, -{0.267189f,0.943676f,-0.195156f}, -{0.445390f,0.806344f,-0.389150f}, -{0.274319f,0.922629f,-0.271118f}, -{-0.397014f,0.641777f,-0.656127f}, -{-0.374744f,0.269451f,-0.887109f}, -{-0.598070f,0.462524f,-0.654510f}, -{-0.371621f,-0.383998f,-0.845247f}, -{-0.561989f,-0.242615f,-0.790763f}, -{-0.398928f,-0.136055f,-0.906832f}, -{-0.371621f,-0.383998f,-0.845247f}, -{-0.398928f,-0.136055f,-0.906832f}, -{-0.172576f,-0.266778f,-0.948181f}, -{-0.221868f,-0.404965f,-0.887005f}, -{-0.371621f,-0.383998f,-0.845247f}, -{-0.172576f,-0.266778f,-0.948181f}, -{-0.398928f,-0.136055f,-0.906832f}, -{-0.561989f,-0.242615f,-0.790763f}, -{-0.759992f,-0.028623f,-0.649302f}, -{-0.671768f,0.233451f,-0.703014f}, -{-0.398928f,-0.136055f,-0.906832f}, -{-0.759992f,-0.028623f,-0.649302f}, -{-0.398928f,-0.136055f,-0.906832f}, -{-0.671768f,0.233451f,-0.703014f}, -{-0.374744f,0.269451f,-0.887109f}, -{-0.598070f,0.462524f,-0.654510f}, -{-0.374744f,0.269451f,-0.887109f}, -{-0.671768f,0.233451f,-0.703014f}, -{-0.423759f,-0.527154f,-0.736571f}, -{-0.637959f,-0.496443f,-0.588687f}, -{-0.616894f,-0.353384f,-0.703251f}, -{-0.637959f,-0.496443f,-0.588687f}, -{-0.792261f,-0.268380f,-0.547992f}, -{-0.616894f,-0.353384f,-0.703251f}, -{-0.616894f,-0.353384f,-0.703251f}, -{-0.792261f,-0.268380f,-0.547992f}, -{-0.759992f,-0.028623f,-0.649302f}, -{-0.616894f,-0.353384f,-0.703251f}, -{-0.759992f,-0.028623f,-0.649302f}, -{-0.561989f,-0.242615f,-0.790763f}, -{-0.371621f,-0.383998f,-0.845247f}, -{-0.221868f,-0.404965f,-0.887005f}, -{-0.423759f,-0.527154f,-0.736571f}, -{-0.616894f,-0.353384f,-0.703251f}, -{-0.561989f,-0.242615f,-0.790763f}, -{-0.371621f,-0.383998f,-0.845247f}, -{-0.423759f,-0.527154f,-0.736571f}, -{-0.616894f,-0.353384f,-0.703251f}, -{-0.371621f,-0.383998f,-0.845247f}, -{-0.637959f,-0.496443f,-0.588687f}, -{-0.423759f,-0.527154f,-0.736571f}, -{-0.591266f,-0.619562f,-0.516282f}, -{-0.591266f,-0.619562f,-0.516282f}, -{-0.762666f,-0.418919f,-0.492796f}, -{-0.792261f,-0.268380f,-0.547992f}, -{-0.792261f,-0.268380f,-0.547992f}, -{-0.637959f,-0.496443f,-0.588687f}, -{-0.591266f,-0.619562f,-0.516282f}, -{-0.773243f,-0.498286f,-0.392182f}, -{-0.762666f,-0.418919f,-0.492796f}, -{-0.591266f,-0.619562f,-0.516282f}, -{-0.617572f,-0.732629f,-0.286111f}, -{-0.779406f,-0.555755f,-0.289246f}, -{-0.773243f,-0.498286f,-0.392182f}, -{-0.591266f,-0.619562f,-0.516282f}, -{-0.617572f,-0.732629f,-0.286111f}, -{-0.773243f,-0.498286f,-0.392182f}, -{-0.783854f,-0.600732f,-0.157143f}, -{-0.779406f,-0.555755f,-0.289246f}, -{-0.617572f,-0.732629f,-0.286111f}, -{-0.615287f,-0.788146f,-0.015744f}, -{-0.799842f,-0.598163f,0.049534f}, -{-0.783854f,-0.600732f,-0.157143f}, -{-0.617572f,-0.732629f,-0.286111f}, -{-0.615287f,-0.788146f,-0.015744f}, -{-0.783854f,-0.600732f,-0.157143f}, -{-0.544593f,-0.801876f,0.245791f}, -{-0.615287f,-0.788146f,-0.015744f}, -{-0.559228f,-0.828703f,0.022699f}, -{-0.615287f,-0.788146f,-0.015744f}, -{-0.544593f,-0.801876f,0.245791f}, -{-0.621396f,-0.736146f,0.268247f}, -{-0.479683f,-0.713959f,0.510065f}, -{-0.621396f,-0.736146f,0.268247f}, -{-0.544593f,-0.801876f,0.245791f}, -{-0.621396f,-0.736146f,0.268247f}, -{-0.479683f,-0.713959f,0.510065f}, -{-0.600251f,-0.614652f,0.511764f}, -{-0.326762f,-0.532459f,0.780842f}, -{-0.600251f,-0.614652f,0.511764f}, -{-0.479683f,-0.713959f,0.510065f}, -{-0.600251f,-0.614652f,0.511764f}, -{-0.326762f,-0.532459f,0.780842f}, -{-0.502597f,-0.561961f,0.656959f}, -{-0.171511f,-0.381440f,0.908343f}, -{-0.237230f,-0.360647f,0.902029f}, -{-0.399666f,-0.459233f,0.793330f}, -{-0.399666f,-0.459233f,0.793330f}, -{-0.502597f,-0.561961f,0.656959f}, -{-0.326762f,-0.532459f,0.780842f}, -{-0.326762f,-0.532459f,0.780842f}, -{-0.117200f,-0.310540f,0.943308f}, -{-0.171511f,-0.381440f,0.908343f}, -{-0.171511f,-0.381440f,0.908343f}, -{-0.399666f,-0.459233f,0.793330f}, -{-0.326762f,-0.532459f,0.780842f}, -{0.130191f,0.048489f,0.990303f}, -{0.171247f,-0.059534f,0.983428f}, -{0.026827f,-0.132269f,0.990851f}, -{0.026827f,-0.132269f,0.990851f}, -{0.171247f,-0.059534f,0.983428f}, -{0.000108f,-0.223144f,0.974786f}, -{0.000108f,-0.223144f,0.974786f}, -{-0.237230f,-0.360647f,0.902029f}, -{-0.171511f,-0.381440f,0.908343f}, -{-0.237230f,-0.360647f,0.902029f}, -{0.000108f,-0.223144f,0.974786f}, -{-0.162448f,-0.277452f,0.946906f}, -{0.026827f,-0.132269f,0.990851f}, -{0.000108f,-0.223144f,0.974786f}, -{-0.117200f,-0.310540f,0.943308f}, -{-0.117200f,-0.310540f,0.943308f}, -{0.000108f,-0.223144f,0.974786f}, -{-0.171511f,-0.381440f,0.908343f}, -{0.317441f,0.247702f,0.915355f}, -{0.290566f,0.151929f,0.944716f}, -{0.254985f,0.199097f,0.946226f}, -{0.254985f,0.199097f,0.946226f}, -{0.290566f,0.151929f,0.944716f}, -{0.171346f,0.146714f,0.974226f}, -{0.426351f,0.434721f,0.793248f}, -{0.504959f,0.440850f,0.742070f}, -{0.372522f,0.318324f,0.871721f}, -{0.372522f,0.318324f,0.871721f}, -{0.504959f,0.440850f,0.742070f}, -{0.728545f,-0.669331f,0.145667f}, -{0.525348f,0.543657f,0.654558f}, -{0.523016f,0.598786f,0.606555f}, -{0.504959f,0.440850f,0.742070f}, -{0.525348f,0.543657f,0.654558f}, -{0.504959f,0.440850f,0.742070f}, -{0.426351f,0.434721f,0.793248f}, -{0.650707f,0.673098f,0.351454f}, -{0.582767f,0.746767f,0.320501f}, -{0.585545f,0.614605f,0.528581f}, -{0.585545f,0.614605f,0.528581f}, -{0.582767f,0.746767f,0.320501f}, -{0.541314f,0.664654f,0.514990f}, -{0.582767f,0.746767f,0.320501f}, -{0.444480f,0.855660f,0.265111f}, -{0.429695f,0.814320f,0.390185f}, -{0.541314f,0.664654f,0.514990f}, -{0.582767f,0.746767f,0.320501f}, -{0.429695f,0.814320f,0.390185f}, -{0.541314f,0.664654f,0.514990f}, -{0.429695f,0.814320f,0.390185f}, -{0.470076f,0.713698f,0.519292f}, -{0.523016f,0.598786f,0.606555f}, -{0.541314f,0.664654f,0.514990f}, -{0.470076f,0.713698f,0.519292f}, -{0.585545f,0.614605f,0.528581f}, -{0.541314f,0.664654f,0.514990f}, -{0.525348f,0.543657f,0.654558f}, -{0.525348f,0.543657f,0.654558f}, -{0.541314f,0.664654f,0.514990f}, -{0.523016f,0.598786f,0.606555f}, -{0.495685f,0.868428f,0.011380f}, -{0.444480f,0.855660f,0.265111f}, -{0.582767f,0.746767f,0.320501f}, -{0.582767f,0.746767f,0.320501f}, -{0.650707f,0.673098f,0.351454f}, -{0.659182f,0.751371f,0.030346f}, -{0.495685f,0.868428f,0.011380f}, -{0.582767f,0.746767f,0.320501f}, -{0.659182f,0.751371f,0.030346f}, -{0.599586f,0.716545f,-0.356455f}, -{0.495685f,0.868428f,0.011380f}, -{0.659182f,0.751371f,0.030346f}, -{0.495685f,0.868428f,0.011380f}, -{0.599586f,0.716545f,-0.356455f}, -{0.439209f,0.866819f,-0.236050f}, -{0.536759f,0.614025f,-0.578673f}, -{0.489136f,0.689178f,-0.534583f}, -{0.445390f,0.806344f,-0.389150f}, -{0.445390f,0.806344f,-0.389150f}, -{0.439209f,0.866819f,-0.236050f}, -{0.599586f,0.716545f,-0.356455f}, -{0.599586f,0.716545f,-0.356455f}, -{0.536041f,0.584026f,-0.609568f}, -{0.536759f,0.614025f,-0.578673f}, -{0.536759f,0.614025f,-0.578673f}, -{0.445390f,0.806344f,-0.389150f}, -{0.599586f,0.716545f,-0.356455f}, -{0.473121f,0.350571f,-0.808243f}, -{0.566193f,0.539475f,-0.623211f}, -{0.479171f,0.493236f,-0.726026f}, -{0.566193f,0.539475f,-0.623211f}, -{0.473121f,0.350571f,-0.808243f}, -{0.901109f,0.387318f,0.194905f}, -{0.479171f,0.493236f,-0.726026f}, -{0.536759f,0.614025f,-0.578673f}, -{0.536041f,0.584026f,-0.609568f}, -{0.536759f,0.614025f,-0.578673f}, -{0.479171f,0.493236f,-0.726026f}, -{0.566193f,0.539475f,-0.623211f}, -{0.285257f,0.243329f,-0.927049f}, -{0.352300f,0.203514f,-0.913492f}, -{0.345386f,0.307643f,-0.886602f}, -{0.345386f,0.307643f,-0.886602f}, -{0.332521f,0.099016f,-0.937883f}, -{0.473121f,0.350571f,-0.808243f}, -{0.210972f,0.052291f,-0.976092f}, -{0.047518f,-0.108157f,-0.992998f}, -{0.144672f,-0.040964f,-0.988631f}, -{0.144672f,-0.040964f,-0.988631f}, -{0.358432f,-0.028939f,-0.933107f}, -{0.210972f,0.052291f,-0.976092f}, -{0.358432f,-0.028939f,-0.933107f}, -{0.144672f,-0.040964f,-0.988631f}, -{0.053473f,-0.177418f,-0.982682f}, -{0.210972f,0.052291f,-0.976092f}, -{0.352300f,0.203514f,-0.913492f}, -{0.236355f,0.191172f,-0.952675f}, -{-0.119178f,-0.301546f,-0.945974f}, -{0.053473f,-0.177418f,-0.982682f}, -{0.047518f,-0.108157f,-0.992998f}, -{0.053473f,-0.177418f,-0.982682f}, -{-0.119178f,-0.301546f,-0.945974f}, -{-0.173650f,-0.377497f,-0.909583f}, -{-0.221868f,-0.404965f,-0.887005f}, -{-0.172576f,-0.266778f,-0.948181f}, -{-0.041588f,-0.272536f,-0.961246f}, -{-0.041588f,-0.272536f,-0.961246f}, -{0.053473f,-0.177418f,-0.982682f}, -{-0.173650f,-0.377497f,-0.909583f}, -{-0.221868f,-0.404965f,-0.887005f}, -{-0.041588f,-0.272536f,-0.961246f}, -{-0.173650f,-0.377497f,-0.909583f}, -{0.023188f,-0.279177f,-0.959960f}, -{0.053473f,-0.177418f,-0.982682f}, -{-0.041588f,-0.272536f,-0.961246f}, -{0.053473f,-0.177418f,-0.982682f}, -{0.144672f,-0.040964f,-0.988631f}, -{0.047518f,-0.108157f,-0.992998f}, -{-0.423759f,-0.527154f,-0.736571f}, -{-0.221868f,-0.404965f,-0.887005f}, -{-0.173650f,-0.377497f,-0.909583f}, -{-0.173650f,-0.377497f,-0.909583f}, -{-0.119178f,-0.301546f,-0.945974f}, -{-0.323750f,-0.525381f,-0.786868f}, -{-0.423759f,-0.527154f,-0.736571f}, -{-0.173650f,-0.377497f,-0.909583f}, -{-0.323750f,-0.525381f,-0.786868f}, -{-0.475085f,-0.713472f,-0.515026f}, -{-0.591266f,-0.619562f,-0.516282f}, -{-0.323750f,-0.525381f,-0.786868f}, -{-0.323750f,-0.525381f,-0.786868f}, -{-0.591266f,-0.619562f,-0.516282f}, -{-0.423759f,-0.527154f,-0.736571f}, -{-0.541824f,-0.807389f,-0.233557f}, -{-0.617572f,-0.732629f,-0.286111f}, -{-0.475085f,-0.713472f,-0.515026f}, -{-0.475085f,-0.713472f,-0.515026f}, -{-0.617572f,-0.732629f,-0.286111f}, -{-0.591266f,-0.619562f,-0.516282f}, -{-0.559228f,-0.828703f,0.022699f}, -{-0.615287f,-0.788146f,-0.015744f}, -{-0.541824f,-0.807389f,-0.233557f}, -{-0.541824f,-0.807389f,-0.233557f}, -{-0.615287f,-0.788146f,-0.015744f}, -{-0.617572f,-0.732629f,-0.286111f}, -{-0.473477f,-0.841369f,0.260610f}, -{-0.559228f,-0.828703f,0.022699f}, -{-0.497328f,-0.867562f,-0.000172f}, -{-0.559228f,-0.828703f,0.022699f}, -{-0.473477f,-0.841369f,0.260610f}, -{-0.544593f,-0.801876f,0.245791f}, -{-0.395440f,-0.748771f,0.531948f}, -{-0.544593f,-0.801876f,0.245791f}, -{-0.473477f,-0.841369f,0.260610f}, -{-0.544593f,-0.801876f,0.245791f}, -{-0.395440f,-0.748771f,0.531948f}, -{-0.479683f,-0.713959f,0.510065f}, -{-0.284739f,-0.583770f,0.760353f}, -{-0.479683f,-0.713959f,0.510065f}, -{-0.395440f,-0.748771f,0.531948f}, -{-0.479683f,-0.713959f,0.510065f}, -{-0.284739f,-0.583770f,0.760353f}, -{-0.326762f,-0.532459f,0.780842f}, -{-0.074163f,-0.290879f,0.953881f}, -{-0.326762f,-0.532459f,0.780842f}, -{-0.284739f,-0.583770f,0.760353f}, -{-0.326762f,-0.532459f,0.780842f}, -{-0.074163f,-0.290879f,0.953881f}, -{-0.117200f,-0.310540f,0.943308f}, -{0.095176f,0.009486f,0.995415f}, -{0.130191f,0.048489f,0.990303f}, -{0.026827f,-0.132269f,0.990851f}, -{0.026827f,-0.132269f,0.990851f}, -{-0.117200f,-0.310540f,0.943308f}, -{-0.074163f,-0.290879f,0.953881f}, -{-0.074163f,-0.290879f,0.953881f}, -{0.140657f,0.004780f,0.990047f}, -{0.095176f,0.009486f,0.995415f}, -{0.095176f,0.009486f,0.995415f}, -{0.026827f,-0.132269f,0.990851f}, -{-0.074163f,-0.290879f,0.953881f}, -{0.279216f,0.291053f,0.915056f}, -{0.239223f,0.215280f,0.946798f}, -{0.235467f,0.147537f,0.960619f}, -{0.254985f,0.199097f,0.946226f}, -{0.171346f,0.146714f,0.974226f}, -{0.239223f,0.215280f,0.946798f}, -{0.239223f,0.215280f,0.946798f}, -{0.317441f,0.247702f,0.915355f}, -{0.254985f,0.199097f,0.946226f}, -{0.239223f,0.215280f,0.946798f}, -{0.171346f,0.146714f,0.974226f}, -{0.095176f,0.009486f,0.995415f}, -{0.095176f,0.009486f,0.995415f}, -{0.171346f,0.146714f,0.974226f}, -{0.130191f,0.048489f,0.990303f}, -{0.235467f,0.147537f,0.960619f}, -{0.239223f,0.215280f,0.946798f}, -{0.140657f,0.004780f,0.990047f}, -{0.140657f,0.004780f,0.990047f}, -{0.239223f,0.215280f,0.946798f}, -{0.095176f,0.009486f,0.995415f}, -{0.331846f,0.370169f,0.867671f}, -{0.372522f,0.318324f,0.871721f}, -{0.239223f,0.215280f,0.946798f}, -{0.372522f,0.318324f,0.871721f}, -{0.317441f,0.247702f,0.915355f}, -{0.239223f,0.215280f,0.946798f}, -{0.239223f,0.215280f,0.946798f}, -{0.279216f,0.291053f,0.915056f}, -{0.331846f,0.370169f,0.867671f}, -{0.331846f,0.370169f,0.867671f}, -{0.426351f,0.434721f,0.793248f}, -{0.372522f,0.318324f,0.871721f}, -{0.426351f,0.434721f,0.793248f}, -{0.331846f,0.370169f,0.867671f}, -{0.387776f,0.473954f,0.790568f}, -{0.525348f,0.543657f,0.654558f}, -{0.368866f,0.575503f,0.729886f}, -{0.539938f,0.587035f,0.603206f}, -{0.368866f,0.575503f,0.729886f}, -{0.369157f,0.773111f,0.515774f}, -{0.539938f,0.587035f,0.603206f}, -{0.525348f,0.543657f,0.654558f}, -{0.387776f,0.473954f,0.790568f}, -{0.368866f,0.575503f,0.729886f}, -{0.387776f,0.473954f,0.790568f}, -{0.525348f,0.543657f,0.654558f}, -{0.426351f,0.434721f,0.793248f}, -{0.502365f,0.707499f,0.497066f}, -{0.515681f,0.796653f,0.315305f}, -{0.624538f,0.710203f,0.324907f}, -{0.624538f,0.710203f,0.324907f}, -{0.573487f,0.633805f,0.519041f}, -{0.502365f,0.707499f,0.497066f}, -{0.624538f,0.710203f,0.324907f}, -{0.650707f,0.673098f,0.351454f}, -{0.573487f,0.633805f,0.519041f}, -{0.573487f,0.633805f,0.519041f}, -{0.650707f,0.673098f,0.351454f}, -{0.585545f,0.614605f,0.528581f}, -{0.573487f,0.633805f,0.519041f}, -{0.585545f,0.614605f,0.528581f}, -{0.539938f,0.587035f,0.603206f}, -{0.539938f,0.587035f,0.603206f}, -{0.585545f,0.614605f,0.528581f}, -{0.525348f,0.543657f,0.654558f}, -{0.502365f,0.707499f,0.497066f}, -{0.573487f,0.633805f,0.519041f}, -{0.369157f,0.773111f,0.515774f}, -{0.369157f,0.773111f,0.515774f}, -{0.573487f,0.633805f,0.519041f}, -{0.539938f,0.587035f,0.603206f}, -{0.624538f,0.710203f,0.324907f}, -{0.515681f,0.796653f,0.315305f}, -{0.539602f,0.840918f,0.041068f}, -{0.659182f,0.751371f,0.030346f}, -{0.650707f,0.673098f,0.351454f}, -{0.624538f,0.710203f,0.324907f}, -{0.624538f,0.710203f,0.324907f}, -{0.539602f,0.840918f,0.041068f}, -{0.659182f,0.751371f,0.030346f}, -{0.549529f,0.775081f,-0.311877f}, -{0.659182f,0.751371f,0.030346f}, -{0.539602f,0.840918f,0.041068f}, -{0.659182f,0.751371f,0.030346f}, -{0.549529f,0.775081f,-0.311877f}, -{0.599586f,0.716545f,-0.356455f}, -{0.599586f,0.716545f,-0.356455f}, -{0.549529f,0.775081f,-0.311877f}, -{0.478100f,0.677135f,-0.559383f}, -{0.536041f,0.584026f,-0.609568f}, -{0.599586f,0.716545f,-0.356455f}, -{0.478100f,0.677135f,-0.559383f}, -{0.479171f,0.493236f,-0.726026f}, -{0.418080f,0.549169f,-0.723617f}, -{0.411254f,0.447659f,-0.794023f}, -{0.418080f,0.549169f,-0.723617f}, -{0.370038f,0.477205f,-0.797087f}, -{0.411254f,0.447659f,-0.794023f}, -{0.411254f,0.447659f,-0.794023f}, -{0.473121f,0.350571f,-0.808243f}, -{0.479171f,0.493236f,-0.726026f}, -{0.479171f,0.493236f,-0.726026f}, -{0.536041f,0.584026f,-0.609568f}, -{0.418080f,0.549169f,-0.723617f}, -{0.418080f,0.549169f,-0.723617f}, -{0.536041f,0.584026f,-0.609568f}, -{0.478100f,0.677135f,-0.559383f}, -{0.258142f,0.203290f,-0.944476f}, -{0.356955f,0.354913f,-0.864072f}, -{0.337143f,0.377704f,-0.862365f}, -{0.356955f,0.354913f,-0.864072f}, -{0.258142f,0.203290f,-0.944476f}, -{0.291596f,0.266743f,-0.918597f}, -{0.345386f,0.307643f,-0.886602f}, -{0.473121f,0.350571f,-0.808243f}, -{0.356955f,0.354913f,-0.864072f}, -{0.291596f,0.266743f,-0.918597f}, -{0.285257f,0.243329f,-0.927049f}, -{0.345386f,0.307643f,-0.886602f}, -{0.356955f,0.354913f,-0.864072f}, -{0.291596f,0.266743f,-0.918597f}, -{0.345386f,0.307643f,-0.886602f}, -{0.356955f,0.354913f,-0.864072f}, -{0.473121f,0.350571f,-0.808243f}, -{0.411254f,0.447659f,-0.794023f}, -{0.337143f,0.377704f,-0.862365f}, -{0.411254f,0.447659f,-0.794023f}, -{0.370038f,0.477205f,-0.797087f}, -{0.411254f,0.447659f,-0.794023f}, -{0.337143f,0.377704f,-0.862365f}, -{0.356955f,0.354913f,-0.864072f}, -{0.136445f,-0.001587f,-0.990646f}, -{0.209959f,0.159652f,-0.964587f}, -{0.258142f,0.203290f,-0.944476f}, -{0.209959f,0.159652f,-0.964587f}, -{0.136445f,-0.001587f,-0.990646f}, -{0.095053f,-0.015287f,-0.995355f}, -{0.210972f,0.052291f,-0.976092f}, -{0.236355f,0.191172f,-0.952675f}, -{0.209959f,0.159652f,-0.964587f}, -{0.095053f,-0.015287f,-0.995355f}, -{0.047518f,-0.108157f,-0.992998f}, -{0.210972f,0.052291f,-0.976092f}, -{0.209959f,0.159652f,-0.964587f}, -{0.095053f,-0.015287f,-0.995355f}, -{0.210972f,0.052291f,-0.976092f}, -{0.236355f,0.191172f,-0.952675f}, -{0.285257f,0.243329f,-0.927049f}, -{0.291596f,0.266743f,-0.918597f}, -{0.291596f,0.266743f,-0.918597f}, -{0.209959f,0.159652f,-0.964587f}, -{0.236355f,0.191172f,-0.952675f}, -{0.291596f,0.266743f,-0.918597f}, -{0.258142f,0.203290f,-0.944476f}, -{0.209959f,0.159652f,-0.964587f}, -{0.095053f,-0.015287f,-0.995355f}, -{0.136445f,-0.001587f,-0.990646f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.119178f,-0.301546f,-0.945974f}, -{0.047518f,-0.108157f,-0.992998f}, -{0.047518f,-0.108157f,-0.992998f}, -{0.095053f,-0.015287f,-0.995355f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.273805f,-0.598068f,-0.753223f}, -{-0.323750f,-0.525381f,-0.786868f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.323750f,-0.525381f,-0.786868f}, -{-0.119178f,-0.301546f,-0.945974f}, -{-0.407844f,-0.770366f,-0.490101f}, -{-0.475085f,-0.713472f,-0.515026f}, -{-0.273805f,-0.598068f,-0.753223f}, -{-0.273805f,-0.598068f,-0.753223f}, -{-0.475085f,-0.713472f,-0.515026f}, -{-0.323750f,-0.525381f,-0.786868f}, -{-0.466057f,-0.851463f,-0.240420f}, -{-0.541824f,-0.807389f,-0.233557f}, -{-0.407844f,-0.770366f,-0.490101f}, -{-0.407844f,-0.770366f,-0.490101f}, -{-0.541824f,-0.807389f,-0.233557f}, -{-0.475085f,-0.713472f,-0.515026f}, -{-0.497328f,-0.867562f,-0.000172f}, -{-0.541824f,-0.807389f,-0.233557f}, -{-0.466057f,-0.851463f,-0.240420f}, -{-0.541824f,-0.807389f,-0.233557f}, -{-0.497328f,-0.867562f,-0.000172f}, -{-0.559228f,-0.828703f,0.022699f}, -{-0.377208f,-0.892118f,0.248676f}, -{-0.497328f,-0.867562f,-0.000172f}, -{-0.374004f,-0.927402f,-0.006768f}, -{-0.497328f,-0.867562f,-0.000172f}, -{-0.377208f,-0.892118f,0.248676f}, -{-0.473477f,-0.841369f,0.260610f}, -{-0.314829f,-0.809345f,0.495826f}, -{-0.473477f,-0.841369f,0.260610f}, -{-0.377208f,-0.892118f,0.248676f}, -{-0.473477f,-0.841369f,0.260610f}, -{-0.314829f,-0.809345f,0.495826f}, -{-0.395440f,-0.748771f,0.531948f}, -{-0.190355f,-0.597144f,0.779220f}, -{-0.395440f,-0.748771f,0.531948f}, -{-0.314829f,-0.809345f,0.495826f}, -{-0.395440f,-0.748771f,0.531948f}, -{-0.190355f,-0.597144f,0.779220f}, -{-0.284739f,-0.583770f,0.760353f}, -{-0.005255f,-0.269980f,0.962852f}, -{-0.074163f,-0.290879f,0.953881f}, -{-0.190355f,-0.597144f,0.779220f}, -{-0.190355f,-0.597144f,0.779220f}, -{-0.074163f,-0.290879f,0.953881f}, -{-0.284739f,-0.583770f,0.760353f}, -{0.116133f,0.039387f,0.992452f}, -{0.140657f,0.004780f,0.990047f}, -{-0.005255f,-0.269980f,0.962852f}, -{-0.005255f,-0.269980f,0.962852f}, -{0.140657f,0.004780f,0.990047f}, -{-0.074163f,-0.290879f,0.953881f}, -{0.257029f,0.521014f,0.813929f}, -{0.387776f,0.473954f,0.790568f}, -{0.289593f,0.427276f,0.856488f}, -{0.289593f,0.427276f,0.856488f}, -{0.387776f,0.473954f,0.790568f}, -{0.331846f,0.370169f,0.867671f}, -{0.289593f,0.427276f,0.856488f}, -{0.331846f,0.370169f,0.867671f}, -{0.237922f,0.252894f,0.937784f}, -{0.237922f,0.252894f,0.937784f}, -{0.331846f,0.370169f,0.867671f}, -{0.279216f,0.291053f,0.915056f}, -{0.430884f,0.865455f,0.255590f}, -{0.515681f,0.796653f,0.315305f}, -{0.117155f,0.955892f,0.269343f}, -{0.117155f,0.955892f,0.269343f}, -{0.515681f,0.796653f,0.315305f}, -{0.502365f,0.707499f,0.497066f}, -{0.394247f,0.868528f,-0.300381f}, -{0.394155f,0.919019f,0.006732f}, -{0.389407f,0.917268f,-0.083558f}, -{0.394155f,0.919019f,0.006732f}, -{0.363541f,0.930338f,0.048048f}, -{0.389407f,0.917268f,-0.083558f}, -{0.394247f,0.868528f,-0.300381f}, -{0.539602f,0.840918f,0.041068f}, -{0.394155f,0.919019f,0.006732f}, -{0.539602f,0.840918f,0.041068f}, -{0.394247f,0.868528f,-0.300381f}, -{0.549529f,0.775081f,-0.311877f}, -{0.302614f,0.739474f,-0.601335f}, -{0.549529f,0.775081f,-0.311877f}, -{0.394247f,0.868528f,-0.300381f}, -{0.549529f,0.775081f,-0.311877f}, -{0.302614f,0.739474f,-0.601335f}, -{0.478100f,0.677135f,-0.559383f}, -{0.302614f,0.739474f,-0.601335f}, -{0.394247f,0.868528f,-0.300381f}, -{0.389407f,0.917268f,-0.083558f}, -{0.287894f,0.519724f,-0.804365f}, -{0.418080f,0.549169f,-0.723617f}, -{0.271568f,0.608361f,-0.745753f}, -{0.418080f,0.549169f,-0.723617f}, -{0.287894f,0.519724f,-0.804365f}, -{0.370038f,0.477205f,-0.797087f}, -{0.271568f,0.608361f,-0.745753f}, -{0.478100f,0.677135f,-0.559383f}, -{0.302614f,0.739474f,-0.601335f}, -{0.478100f,0.677135f,-0.559383f}, -{0.271568f,0.608361f,-0.745753f}, -{0.418080f,0.549169f,-0.723617f}, -{0.258142f,0.203290f,-0.944476f}, -{0.337143f,0.377704f,-0.862365f}, -{0.221229f,0.403398f,-0.887878f}, -{0.221229f,0.403398f,-0.887878f}, -{0.370038f,0.477205f,-0.797087f}, -{0.287894f,0.519724f,-0.804365f}, -{0.370038f,0.477205f,-0.797087f}, -{0.221229f,0.403398f,-0.887878f}, -{0.337143f,0.377704f,-0.862365f}, -{0.157104f,0.219159f,-0.962958f}, -{0.000501f,0.173705f,-0.984798f}, -{0.141854f,0.051803f,-0.988531f}, -{0.137342f,0.019641f,-0.990329f}, -{0.213913f,0.195514f,-0.957087f}, -{0.157104f,0.219159f,-0.962958f}, -{0.157104f,0.219159f,-0.962958f}, -{0.141854f,0.051803f,-0.988531f}, -{0.137342f,0.019641f,-0.990329f}, -{0.137342f,0.019641f,-0.990329f}, -{0.258142f,0.203290f,-0.944476f}, -{0.213913f,0.195514f,-0.957087f}, -{0.258142f,0.203290f,-0.944476f}, -{0.137342f,0.019641f,-0.990329f}, -{0.136445f,-0.001587f,-0.990646f}, -{0.258142f,0.203290f,-0.944476f}, -{0.221229f,0.403398f,-0.887878f}, -{0.213913f,0.195514f,-0.957087f}, -{0.221229f,0.403398f,-0.887878f}, -{0.157104f,0.219159f,-0.962958f}, -{0.213913f,0.195514f,-0.957087f}, -{0.137342f,0.019641f,-0.990329f}, -{0.141854f,0.051803f,-0.988531f}, -{0.094557f,-0.119319f,-0.988343f}, -{0.094557f,-0.119319f,-0.988343f}, -{-0.037497f,-0.313765f,-0.948760f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.043007f,-0.262075f,-0.964089f}, -{0.136445f,-0.001587f,-0.990646f}, -{0.137342f,0.019641f,-0.990329f}, -{0.137342f,0.019641f,-0.990329f}, -{0.094557f,-0.119319f,-0.988343f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.152504f,-0.546578f,-0.823404f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.037497f,-0.313765f,-0.948760f}, -{-0.043007f,-0.262075f,-0.964089f}, -{-0.152504f,-0.546578f,-0.823404f}, -{-0.273805f,-0.598068f,-0.753223f}, -{-0.280507f,-0.780886f,-0.558151f}, -{-0.273805f,-0.598068f,-0.753223f}, -{-0.152504f,-0.546578f,-0.823404f}, -{-0.273805f,-0.598068f,-0.753223f}, -{-0.280507f,-0.780886f,-0.558151f}, -{-0.407844f,-0.770366f,-0.490101f}, -{-0.350952f,-0.897033f,-0.268635f}, -{-0.407844f,-0.770366f,-0.490101f}, -{-0.280507f,-0.780886f,-0.558151f}, -{-0.407844f,-0.770366f,-0.490101f}, -{-0.350952f,-0.897033f,-0.268635f}, -{-0.466057f,-0.851463f,-0.240420f}, -{-0.374004f,-0.927402f,-0.006768f}, -{-0.466057f,-0.851463f,-0.240420f}, -{-0.350952f,-0.897033f,-0.268635f}, -{-0.466057f,-0.851463f,-0.240420f}, -{-0.374004f,-0.927402f,-0.006768f}, -{-0.497328f,-0.867562f,-0.000172f}, -{-0.163343f,-0.970222f,0.178855f}, -{-0.374004f,-0.927402f,-0.006768f}, -{-0.102058f,-0.994587f,0.019515f}, -{-0.374004f,-0.927402f,-0.006768f}, -{-0.163343f,-0.970222f,0.178855f}, -{-0.377208f,-0.892118f,0.248676f}, -{-0.137914f,-0.869049f,0.475114f}, -{-0.314829f,-0.809345f,0.495826f}, -{-0.163343f,-0.970222f,0.178855f}, -{-0.163343f,-0.970222f,0.178855f}, -{-0.314829f,-0.809345f,0.495826f}, -{-0.377208f,-0.892118f,0.248676f}, -{-0.033047f,-0.638409f,0.768987f}, -{-0.190355f,-0.597144f,0.779220f}, -{-0.137914f,-0.869049f,0.475114f}, -{-0.137914f,-0.869049f,0.475114f}, -{-0.190355f,-0.597144f,0.779220f}, -{-0.314829f,-0.809345f,0.495826f}, -{0.120066f,-0.362929f,0.924049f}, -{-0.005255f,-0.269980f,0.962852f}, -{-0.033047f,-0.638409f,0.768987f}, -{-0.033047f,-0.638409f,0.768987f}, -{-0.005255f,-0.269980f,0.962852f}, -{-0.190355f,-0.597144f,0.779220f}, -{0.127212f,-0.007665f,0.991846f}, -{0.116133f,0.039387f,0.992452f}, -{-0.005255f,-0.269980f,0.962852f}, -{0.120066f,-0.362929f,0.924049f}, -{0.280039f,-0.109783f,0.953691f}, -{0.127212f,-0.007665f,0.991846f}, -{-0.005255f,-0.269980f,0.962852f}, -{0.120066f,-0.362929f,0.924049f}, -{0.127212f,-0.007665f,0.991846f}, -{0.210996f,0.179609f,0.960844f}, -{0.164650f,0.189698f,0.967939f}, -{0.127212f,-0.007665f,0.991846f}, -{0.127212f,-0.007665f,0.991846f}, -{0.164650f,0.189698f,0.967939f}, -{0.116133f,0.039387f,0.992452f}, -{0.341647f,0.023101f,0.939544f}, -{0.210996f,0.179609f,0.960844f}, -{0.280039f,-0.109783f,0.953691f}, -{0.280039f,-0.109783f,0.953691f}, -{0.210996f,0.179609f,0.960844f}, -{0.127212f,-0.007665f,0.991846f}, -{0.799601f,0.586555f,-0.128808f}, -{0.389407f,0.917268f,-0.083558f}, -{0.786920f,0.596066f,-0.159568f}, -{0.538710f,0.837608f,0.090582f}, -{0.389407f,0.917268f,-0.083558f}, -{0.363541f,0.930338f,0.048048f}, -{0.786920f,0.596066f,-0.159568f}, -{0.389407f,0.917268f,-0.083558f}, -{0.731872f,0.676764f,0.079707f}, -{0.731872f,0.676764f,0.079707f}, -{0.389407f,0.917268f,-0.083558f}, -{0.538710f,0.837608f,0.090582f}, -{0.264590f,-0.079383f,-0.961088f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.392398f,-0.002293f,-0.919793f}, -{0.392398f,-0.002293f,-0.919793f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.424145f,-0.020815f,-0.905355f}, -{0.094557f,-0.119319f,-0.988343f}, -{0.044211f,-0.240634f,-0.969609f}, -{-0.037497f,-0.313765f,-0.948760f}, -{0.093003f,0.009710f,-0.995618f}, -{0.148955f,-0.048469f,-0.987655f}, -{0.044211f,-0.240634f,-0.969609f}, -{0.094557f,-0.119319f,-0.988343f}, -{0.141854f,0.051803f,-0.988531f}, -{0.093003f,0.009710f,-0.995618f}, -{0.044211f,-0.240634f,-0.969609f}, -{0.094557f,-0.119319f,-0.988343f}, -{0.093003f,0.009710f,-0.995618f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.264590f,-0.079383f,-0.961088f}, -{0.169240f,-0.249393f,-0.953499f}, -{0.044211f,-0.240634f,-0.969609f}, -{0.148955f,-0.048469f,-0.987655f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.169240f,-0.249393f,-0.953499f}, -{0.044211f,-0.240634f,-0.969609f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.044211f,-0.240634f,-0.969609f}, -{0.169240f,-0.249393f,-0.953499f}, -{-0.016049f,-0.585754f,-0.810330f}, -{-0.152504f,-0.546578f,-0.823404f}, -{-0.037497f,-0.313765f,-0.948760f}, -{0.044211f,-0.240634f,-0.969609f}, -{0.044211f,-0.240634f,-0.969609f}, -{-0.016049f,-0.585754f,-0.810330f}, -{-0.152504f,-0.546578f,-0.823404f}, -{-0.152504f,-0.546578f,-0.823404f}, -{-0.016049f,-0.585754f,-0.810330f}, -{-0.143380f,-0.826198f,-0.544830f}, -{-0.280507f,-0.780886f,-0.558151f}, -{-0.152504f,-0.546578f,-0.823404f}, -{-0.143380f,-0.826198f,-0.544830f}, -{-0.280507f,-0.780886f,-0.558151f}, -{-0.143380f,-0.826198f,-0.544830f}, -{-0.191971f,-0.942758f,-0.272679f}, -{-0.350952f,-0.897033f,-0.268635f}, -{-0.280507f,-0.780886f,-0.558151f}, -{-0.191971f,-0.942758f,-0.272679f}, -{-0.102058f,-0.994587f,0.019515f}, -{-0.350952f,-0.897033f,-0.268635f}, -{-0.191971f,-0.942758f,-0.272679f}, -{-0.350952f,-0.897033f,-0.268635f}, -{-0.102058f,-0.994587f,0.019515f}, -{-0.374004f,-0.927402f,-0.006768f}, -{0.210930f,-0.976875f,-0.034974f}, -{0.190097f,-0.981642f,-0.015539f}, -{-0.163343f,-0.970222f,0.178855f}, -{-0.163343f,-0.970222f,0.178855f}, -{-0.102058f,-0.994587f,0.019515f}, -{0.210930f,-0.976875f,-0.034974f}, -{0.190097f,-0.981642f,-0.015539f}, -{0.224199f,-0.938395f,0.262962f}, -{-0.137914f,-0.869049f,0.475114f}, -{-0.137914f,-0.869049f,0.475114f}, -{-0.163343f,-0.970222f,0.178855f}, -{0.190097f,-0.981642f,-0.015539f}, -{-0.033047f,-0.638409f,0.768987f}, -{-0.137914f,-0.869049f,0.475114f}, -{0.224199f,-0.938395f,0.262962f}, -{0.353777f,-0.726420f,0.589199f}, -{0.511608f,-0.561882f,0.650036f}, -{0.120066f,-0.362929f,0.924049f}, -{-0.033047f,-0.638409f,0.768987f}, -{0.224199f,-0.938395f,0.262962f}, -{0.353777f,-0.726420f,0.589199f}, -{0.120066f,-0.362929f,0.924049f}, -{-0.033047f,-0.638409f,0.768987f}, -{0.353777f,-0.726420f,0.589199f}, -{0.511608f,-0.561882f,0.650036f}, -{0.639533f,-0.264203f,0.721938f}, -{0.280039f,-0.109783f,0.953691f}, -{0.280039f,-0.109783f,0.953691f}, -{0.120066f,-0.362929f,0.924049f}, -{0.511608f,-0.561882f,0.650036f}, -{0.341647f,0.023101f,0.939544f}, -{0.639533f,-0.264203f,0.721938f}, -{0.598439f,0.005316f,0.801151f}, -{0.639533f,-0.264203f,0.721938f}, -{0.804716f,-0.105957f,0.584128f}, -{0.598439f,0.005316f,0.801151f}, -{0.598439f,0.005316f,0.801151f}, -{0.439946f,0.175781f,0.880652f}, -{0.341647f,0.023101f,0.939544f}, -{0.341647f,0.023101f,0.939544f}, -{0.280039f,-0.109783f,0.953691f}, -{0.639533f,-0.264203f,0.721938f}, -{0.687959f,0.142898f,0.711542f}, -{0.547075f,0.225477f,0.806145f}, -{0.439946f,0.175781f,0.880652f}, -{0.598439f,0.005316f,0.801151f}, -{0.687959f,0.142898f,0.711542f}, -{0.439946f,0.175781f,0.880652f}, -{0.861301f,-0.000411f,0.508095f}, -{0.598439f,0.005316f,0.801151f}, -{0.804716f,-0.105957f,0.584128f}, -{0.598439f,0.005316f,0.801151f}, -{0.861301f,-0.000411f,0.508095f}, -{0.687959f,0.142898f,0.711542f}, -{0.951587f,0.108524f,0.287584f}, -{0.865086f,0.209543f,0.455760f}, -{0.789740f,0.237525f,0.565590f}, -{0.896752f,0.083947f,0.434498f}, -{0.951587f,0.108524f,0.287584f}, -{0.789740f,0.237525f,0.565590f}, -{0.896752f,0.083947f,0.434498f}, -{0.687959f,0.142898f,0.711542f}, -{0.861301f,-0.000411f,0.508095f}, -{0.687959f,0.142898f,0.711542f}, -{0.896752f,0.083947f,0.434498f}, -{0.789740f,0.237525f,0.565590f}, -{0.985392f,0.139742f,0.097340f}, -{0.910755f,0.278726f,0.304691f}, -{0.951587f,0.108524f,0.287584f}, -{0.910755f,0.278726f,0.304691f}, -{0.985392f,0.139742f,0.097340f}, -{0.918588f,0.375123f,0.124412f}, -{0.988068f,0.082398f,-0.130127f}, -{0.950230f,0.289648f,-0.114750f}, -{0.993675f,0.098244f,-0.054396f}, -{0.894765f,0.304007f,-0.327071f}, -{0.799601f,0.586555f,-0.128808f}, -{0.786920f,0.596066f,-0.159568f}, -{0.786920f,0.596066f,-0.159568f}, -{0.950230f,0.289648f,-0.114750f}, -{0.894765f,0.304007f,-0.327071f}, -{0.950230f,0.289648f,-0.114750f}, -{0.786920f,0.596066f,-0.159568f}, -{0.918588f,0.375123f,0.124412f}, -{0.918588f,0.375123f,0.124412f}, -{0.786920f,0.596066f,-0.159568f}, -{0.731872f,0.676764f,0.079707f}, -{0.993675f,0.098244f,-0.054396f}, -{0.950230f,0.289648f,-0.114750f}, -{0.985392f,0.139742f,0.097340f}, -{0.985392f,0.139742f,0.097340f}, -{0.950230f,0.289648f,-0.114750f}, -{0.918588f,0.375123f,0.124412f}, -{0.967595f,0.066322f,-0.243640f}, -{0.962907f,0.011074f,-0.269605f}, -{0.858324f,0.212906f,-0.466852f}, -{0.894765f,0.304007f,-0.327071f}, -{0.950230f,0.289648f,-0.114750f}, -{0.988068f,0.082398f,-0.130127f}, -{0.967595f,0.066322f,-0.243640f}, -{0.858324f,0.212906f,-0.466852f}, -{0.894765f,0.304007f,-0.327071f}, -{0.988068f,0.082398f,-0.130127f}, -{0.967595f,0.066322f,-0.243640f}, -{0.894765f,0.304007f,-0.327071f}, -{0.791501f,0.092271f,-0.604162f}, -{0.858268f,0.137759f,-0.494366f}, -{0.962907f,0.011074f,-0.269605f}, -{0.858268f,0.137759f,-0.494366f}, -{0.858324f,0.212906f,-0.466852f}, -{0.962907f,0.011074f,-0.269605f}, -{0.589576f,-0.007204f,-0.807680f}, -{0.791501f,0.092271f,-0.604162f}, -{0.769738f,-0.265371f,-0.580588f}, -{0.904838f,0.008526f,-0.425672f}, -{0.769738f,-0.265371f,-0.580588f}, -{0.791501f,0.092271f,-0.604162f}, -{0.791501f,0.092271f,-0.604162f}, -{0.962907f,0.011074f,-0.269605f}, -{0.904838f,0.008526f,-0.425672f}, -{0.485485f,-0.220888f,-0.845880f}, -{0.589576f,-0.007204f,-0.807680f}, -{0.769738f,-0.265371f,-0.580588f}, -{0.392398f,-0.002293f,-0.919793f}, -{0.424145f,-0.020815f,-0.905355f}, -{0.589576f,-0.007204f,-0.807680f}, -{0.485485f,-0.220888f,-0.845880f}, -{0.264590f,-0.079383f,-0.961088f}, -{0.392398f,-0.002293f,-0.919793f}, -{0.589576f,-0.007204f,-0.807680f}, -{0.485485f,-0.220888f,-0.845880f}, -{0.392398f,-0.002293f,-0.919793f}, -{0.240533f,-0.622708f,-0.744566f}, -{0.399127f,-0.383298f,-0.832935f}, -{0.524647f,-0.678988f,-0.513537f}, -{0.240533f,-0.622708f,-0.744566f}, -{0.169240f,-0.249393f,-0.953499f}, -{0.399127f,-0.383298f,-0.832935f}, -{0.399127f,-0.383298f,-0.832935f}, -{0.169240f,-0.249393f,-0.953499f}, -{0.485485f,-0.220888f,-0.845880f}, -{0.485485f,-0.220888f,-0.845880f}, -{0.169240f,-0.249393f,-0.953499f}, -{0.264590f,-0.079383f,-0.961088f}, -{0.485485f,-0.220888f,-0.845880f}, -{0.769738f,-0.265371f,-0.580588f}, -{0.524647f,-0.678988f,-0.513537f}, -{0.399127f,-0.383298f,-0.832935f}, -{0.485485f,-0.220888f,-0.845880f}, -{0.524647f,-0.678988f,-0.513537f}, -{0.452065f,-0.827090f,-0.334004f}, -{0.240533f,-0.622708f,-0.744566f}, -{0.524647f,-0.678988f,-0.513537f}, -{0.240533f,-0.622708f,-0.744566f}, -{0.452065f,-0.827090f,-0.334004f}, -{0.095670f,-0.882752f,-0.459997f}, -{0.095670f,-0.882752f,-0.459997f}, -{-0.016049f,-0.585754f,-0.810330f}, -{0.240533f,-0.622708f,-0.744566f}, -{0.169240f,-0.249393f,-0.953499f}, -{0.240533f,-0.622708f,-0.744566f}, -{-0.016049f,-0.585754f,-0.810330f}, -{-0.016049f,-0.585754f,-0.810330f}, -{0.095670f,-0.882752f,-0.459997f}, -{-0.143380f,-0.826198f,-0.544830f}, -{0.367012f,-0.929957f,-0.021950f}, -{0.095670f,-0.882752f,-0.459997f}, -{0.452065f,-0.827090f,-0.334004f}, -{0.296586f,-0.951540f,0.081293f}, -{0.033029f,-0.994150f,-0.102832f}, -{0.367012f,-0.929957f,-0.021950f}, -{0.033029f,-0.994150f,-0.102832f}, -{-0.143380f,-0.826198f,-0.544830f}, -{0.095670f,-0.882752f,-0.459997f}, -{-0.143380f,-0.826198f,-0.544830f}, -{0.033029f,-0.994150f,-0.102832f}, -{-0.191971f,-0.942758f,-0.272679f}, -{0.095670f,-0.882752f,-0.459997f}, -{0.367012f,-0.929957f,-0.021950f}, -{0.033029f,-0.994150f,-0.102832f}, -{0.296586f,-0.951540f,0.081293f}, -{0.210930f,-0.976875f,-0.034974f}, -{-0.102058f,-0.994587f,0.019515f}, -{-0.102058f,-0.994587f,0.019515f}, -{-0.191971f,-0.942758f,-0.272679f}, -{0.033029f,-0.994150f,-0.102832f}, -{0.033029f,-0.994150f,-0.102832f}, -{0.296586f,-0.951540f,0.081293f}, -{-0.102058f,-0.994587f,0.019515f}, -{0.562522f,-0.811846f,-0.156445f}, -{0.928867f,-0.368286f,0.039641f}, -{0.787910f,-0.615693f,0.010936f}, -{0.210930f,-0.976875f,-0.034974f}, -{0.562522f,-0.811846f,-0.156445f}, -{0.190097f,-0.981642f,-0.015539f}, -{0.589205f,-0.804726f,0.072478f}, -{0.787910f,-0.615693f,0.010936f}, -{0.471417f,-0.864277f,-0.175471f}, -{0.589205f,-0.804726f,0.072478f}, -{0.471417f,-0.864277f,-0.175471f}, -{0.224199f,-0.938395f,0.262962f}, -{0.224199f,-0.938395f,0.262962f}, -{0.190097f,-0.981642f,-0.015539f}, -{0.589205f,-0.804726f,0.072478f}, -{0.562522f,-0.811846f,-0.156445f}, -{0.589205f,-0.804726f,0.072478f}, -{0.190097f,-0.981642f,-0.015539f}, -{0.562522f,-0.811846f,-0.156445f}, -{0.787910f,-0.615693f,0.010936f}, -{0.589205f,-0.804726f,0.072478f}, -{0.928867f,-0.368286f,0.039641f}, -{0.589205f,-0.804726f,0.072478f}, -{0.787910f,-0.615693f,0.010936f}, -{0.928867f,-0.368286f,0.039641f}, -{0.805306f,-0.555204f,0.207920f}, -{0.589205f,-0.804726f,0.072478f}, -{0.805306f,-0.555204f,0.207920f}, -{0.511608f,-0.561882f,0.650036f}, -{0.589205f,-0.804726f,0.072478f}, -{0.589205f,-0.804726f,0.072478f}, -{0.511608f,-0.561882f,0.650036f}, -{0.353777f,-0.726420f,0.589199f}, -{0.589205f,-0.804726f,0.072478f}, -{0.353777f,-0.726420f,0.589199f}, -{0.224199f,-0.938395f,0.262962f}, -{0.805306f,-0.555204f,0.207920f}, -{0.639533f,-0.264203f,0.721938f}, -{0.511608f,-0.561882f,0.650036f}, -{0.929898f,-0.245520f,0.273877f}, -{0.804716f,-0.105957f,0.584128f}, -{0.639533f,-0.264203f,0.721938f}, -{0.929898f,-0.245520f,0.273877f}, -{0.639533f,-0.264203f,0.721938f}, -{0.805306f,-0.555204f,0.207920f}, -{0.928867f,-0.368286f,0.039641f}, -{0.929898f,-0.245520f,0.273877f}, -{0.805306f,-0.555204f,0.207920f}, -{0.804716f,-0.105957f,0.584128f}, -{0.929898f,-0.245520f,0.273877f}, -{0.861301f,-0.000411f,0.508095f}, -{0.896752f,0.083947f,0.434498f}, -{0.980217f,-0.098379f,0.171745f}, -{0.951587f,0.108524f,0.287584f}, -{0.980217f,-0.098379f,0.171745f}, -{0.861301f,-0.000411f,0.508095f}, -{0.929898f,-0.245520f,0.273877f}, -{0.861301f,-0.000411f,0.508095f}, -{0.980217f,-0.098379f,0.171745f}, -{0.896752f,0.083947f,0.434498f}, -{0.928867f,-0.368286f,0.039641f}, -{0.980217f,-0.098379f,0.171745f}, -{0.929898f,-0.245520f,0.273877f}, -{0.928867f,-0.368286f,0.039641f}, -{0.996618f,-0.074480f,0.034711f}, -{0.980217f,-0.098379f,0.171745f}, -{0.996618f,-0.074480f,0.034711f}, -{0.951587f,0.108524f,0.287584f}, -{0.980217f,-0.098379f,0.171745f}, -{0.951587f,0.108524f,0.287584f}, -{0.996618f,-0.074480f,0.034711f}, -{0.985392f,0.139742f,0.097340f}, -{0.928867f,-0.368286f,0.039641f}, -{0.993594f,-0.112836f,-0.006314f}, -{0.996618f,-0.074480f,0.034711f}, -{0.993594f,-0.112836f,-0.006314f}, -{0.988068f,0.082398f,-0.130127f}, -{0.996618f,-0.074480f,0.034711f}, -{0.996618f,-0.074480f,0.034711f}, -{0.988068f,0.082398f,-0.130127f}, -{0.993675f,0.098244f,-0.054396f}, -{0.996618f,-0.074480f,0.034711f}, -{0.993675f,0.098244f,-0.054396f}, -{0.985392f,0.139742f,0.097340f}, -{0.928867f,-0.368286f,0.039641f}, -{0.954357f,-0.296682f,-0.034380f}, -{0.993594f,-0.112836f,-0.006314f}, -{0.993594f,-0.112836f,-0.006314f}, -{0.954357f,-0.296682f,-0.034380f}, -{0.962907f,0.011074f,-0.269605f}, -{0.967595f,0.066322f,-0.243640f}, -{0.993594f,-0.112836f,-0.006314f}, -{0.962907f,0.011074f,-0.269605f}, -{0.993594f,-0.112836f,-0.006314f}, -{0.967595f,0.066322f,-0.243640f}, -{0.988068f,0.082398f,-0.130127f}, -{0.962907f,0.011074f,-0.269605f}, -{0.954357f,-0.296682f,-0.034380f}, -{0.935929f,-0.237631f,-0.259939f}, -{0.935929f,-0.237631f,-0.259939f}, -{0.769738f,-0.265371f,-0.580588f}, -{0.904838f,0.008526f,-0.425672f}, -{0.935929f,-0.237631f,-0.259939f}, -{0.904838f,0.008526f,-0.425672f}, -{0.962907f,0.011074f,-0.269605f}, -{0.835200f,-0.521825f,-0.173607f}, -{0.954357f,-0.296682f,-0.034380f}, -{0.928867f,-0.368286f,0.039641f}, -{0.835200f,-0.521825f,-0.173607f}, -{0.769738f,-0.265371f,-0.580588f}, -{0.935929f,-0.237631f,-0.259939f}, -{0.835200f,-0.521825f,-0.173607f}, -{0.935929f,-0.237631f,-0.259939f}, -{0.954357f,-0.296682f,-0.034380f}, -{0.655852f,-0.754472f,0.025082f}, -{0.835200f,-0.521825f,-0.173607f}, -{0.928867f,-0.368286f,0.039641f}, -{0.769738f,-0.265371f,-0.580588f}, -{0.835200f,-0.521825f,-0.173607f}, -{0.524647f,-0.678988f,-0.513537f}, -{0.524647f,-0.678988f,-0.513537f}, -{0.655852f,-0.754472f,0.025082f}, -{0.452065f,-0.827090f,-0.334004f}, -{0.655852f,-0.754472f,0.025082f}, -{0.524647f,-0.678988f,-0.513537f}, -{0.835200f,-0.521825f,-0.173607f}, -{0.928867f,-0.368286f,0.039641f}, -{0.599964f,-0.793085f,0.105169f}, -{0.655852f,-0.754472f,0.025082f}, -{0.599964f,-0.793085f,0.105169f}, -{0.367012f,-0.929957f,-0.021950f}, -{0.655852f,-0.754472f,0.025082f}, -{0.452065f,-0.827090f,-0.334004f}, -{0.655852f,-0.754472f,0.025082f}, -{0.367012f,-0.929957f,-0.021950f}, -{0.367012f,-0.929957f,-0.021950f}, -{0.599964f,-0.793085f,0.105169f}, -{0.296586f,-0.951540f,0.081293f}, -{0.928867f,-0.368286f,0.039641f}, -{0.562522f,-0.811846f,-0.156445f}, -{0.599964f,-0.793085f,0.105169f}, -{0.562522f,-0.811846f,-0.156445f}, -{0.296586f,-0.951540f,0.081293f}, -{0.599964f,-0.793085f,0.105169f}, -{0.296586f,-0.951540f,0.081293f}, -{0.562522f,-0.811846f,-0.156445f}, -{0.210930f,-0.976875f,-0.034974f}, -{-0.998091f,-0.059508f,-0.016551f}, -{-0.954040f,-0.136257f,-0.266912f}, -{-0.958645f,-0.131653f,-0.252323f}, -{-0.954040f,-0.136257f,-0.266912f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.958645f,-0.131653f,-0.252323f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.704461f,0.199354f,-0.681170f}, -{-0.847640f,0.110414f,-0.518956f}, -{-0.704461f,0.199354f,-0.681170f}, -{-0.519937f,0.399504f,-0.755024f}, -{-0.739554f,0.361004f,-0.568099f}, -{-0.519937f,0.399504f,-0.755024f}, -{-0.278250f,0.635043f,-0.720623f}, -{-0.601154f,0.511409f,-0.614064f}, -{-0.278250f,0.635043f,-0.720623f}, -{0.079728f,0.876478f,-0.474795f}, -{-0.237835f,0.825207f,-0.512316f}, -{0.079728f,0.876478f,-0.474795f}, -{0.284305f,0.951327f,-0.118946f}, -{0.140515f,0.968515f,-0.205508f}, -{0.284305f,0.951327f,-0.118946f}, -{0.194831f,0.980831f,0.003437f}, -{0.140515f,0.968515f,-0.205508f}, -{0.194831f,0.980831f,0.003437f}, -{0.230458f,0.971546f,0.054663f}, -{0.111817f,0.988378f,-0.102986f}, -{0.230458f,0.971546f,0.054663f}, -{0.053011f,0.996626f,0.062659f}, -{0.057898f,0.998302f,0.006430f}, -{0.053011f,0.996626f,0.062659f}, -{0.091380f,0.995375f,-0.029645f}, -{0.029330f,0.999344f,-0.021255f}, -{0.091380f,0.995375f,-0.029645f}, -{0.171867f,0.984952f,0.018213f}, -{0.053007f,0.998593f,0.001737f}, -{0.171867f,0.984952f,0.018213f}, -{0.155388f,0.934199f,0.321135f}, -{0.071526f,0.972134f,0.223247f}, -{0.155388f,0.934199f,0.321135f}, -{-0.169148f,0.752509f,0.636489f}, -{-0.124844f,0.873959f,0.469691f}, -{-0.169148f,0.752509f,0.636489f}, -{-0.518049f,0.451465f,0.726502f}, -{-0.586320f,0.540668f,0.603247f}, -{-0.518049f,0.451465f,0.726502f}, -{-0.699688f,0.204704f,0.684495f}, -{-0.760001f,0.324191f,0.563293f}, -{-0.699688f,0.204704f,0.684495f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.850583f,0.097851f,0.516657f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.977075f,-0.105183f,0.185099f}, -{-0.946894f,-0.083377f,0.310547f}, -{-0.977075f,-0.105183f,0.185099f}, -{-0.984283f,-0.051648f,0.168875f}, -{-0.946894f,-0.083377f,0.310547f}, -{-0.984283f,-0.051648f,0.168875f}, -{-0.998091f,-0.059508f,-0.016551f}, -{-0.988514f,-0.140680f,0.055221f}, -{0.003651f,0.946181f,-0.323619f}, -{-0.186767f,0.925548f,-0.329360f}, -{-0.237835f,0.825207f,-0.512316f}, -{-0.186767f,0.925548f,-0.329360f}, -{-0.251965f,0.757212f,-0.602614f}, -{-0.397014f,0.641777f,-0.656127f}, -{-0.337693f,0.105630f,-0.935311f}, -{-0.254922f,-0.206536f,-0.944647f}, -{-0.398928f,-0.136055f,-0.906832f}, -{-0.254922f,-0.206536f,-0.944647f}, -{0.093083f,0.278572f,0.955894f}, -{-0.172576f,-0.266778f,-0.948181f}, -{0.189436f,-0.361622f,-0.912876f}, -{0.358432f,-0.028939f,-0.933107f}, -{0.053473f,-0.177418f,-0.982682f}, -{0.352300f,0.203514f,-0.913492f}, -{0.343328f,0.248380f,-0.905778f}, -{0.345386f,0.307643f,-0.886602f}, -{0.343328f,0.248380f,-0.905778f}, -{0.361705f,-0.132388f,-0.922845f}, -{0.332521f,0.099016f,-0.937883f}, -{0.901109f,0.387318f,0.194905f}, -{0.489136f,0.689178f,-0.534583f}, -{0.566193f,0.539475f,-0.623211f}, -{0.322542f,0.653191f,-0.685060f}, -{0.387867f,0.814848f,-0.430791f}, -{0.489136f,0.689178f,-0.534583f}, -{0.387867f,0.814848f,-0.430791f}, -{0.248974f,0.936959f,-0.245195f}, -{0.274319f,0.922629f,-0.271118f}, -{0.248974f,0.936959f,-0.245195f}, -{0.204352f,0.947276f,-0.246795f}, -{0.138558f,0.971214f,-0.193767f}, -{0.204352f,0.947276f,-0.246795f}, -{0.058741f,0.975100f,-0.213843f}, -{0.095780f,0.971889f,-0.215078f}, -{0.297002f,0.053309f,0.953388f}, -{0.252548f,-0.116382f,0.960560f}, -{0.171247f,-0.059534f,0.983428f}, -{0.252548f,-0.116382f,0.960560f}, -{0.085830f,-0.307324f,0.947726f}, -{0.000108f,-0.223144f,0.974786f}, -{0.085830f,-0.307324f,0.947726f}, -{-0.173549f,-0.262745f,0.949129f}, -{-0.162448f,-0.277452f,0.946906f}, -{-0.173549f,-0.262745f,0.949129f}, -{-0.370077f,-0.091471f,0.924487f}, -{-0.162448f,-0.277452f,0.946906f}, -{-0.334198f,0.410925f,0.848205f}, -{-0.321627f,0.659738f,0.679192f}, -{-0.382842f,0.339600f,0.859130f}, -{-0.321627f,0.659738f,0.679192f}, -{-0.228362f,0.861117f,0.454234f}, -{-0.124844f,0.873959f,0.469691f}, -{-0.228362f,0.861117f,0.454234f}, -{-0.058113f,0.949457f,0.308470f}, -{-0.124844f,0.873959f,0.469691f}, -{-0.058113f,0.949457f,0.308470f}, -{0.061960f,0.962691f,0.263414f}, -{0.071526f,0.972134f,0.223247f}, -{0.135575f,0.967464f,0.213620f}, -{0.356397f,0.851081f,0.385542f}, -{0.134729f,0.972475f,0.190106f}, -{0.213363f,0.870099f,0.444302f}, -{-0.043041f,0.825406f,0.562896f}, -{0.470076f,0.713698f,0.519292f}, -{-0.043041f,0.825406f,0.562896f}, -{0.115037f,0.723134f,0.681061f}, -{0.470076f,0.713698f,0.519292f}, -{0.115037f,0.723134f,0.681061f}, -{0.287673f,0.507493f,0.812216f}, -{0.504959f,0.440850f,0.742070f}, -{0.287673f,0.507493f,0.812216f}, -{0.113449f,0.132333f,-0.984691f}, -{0.504959f,0.440850f,0.742070f}, -{0.113449f,0.132333f,-0.984691f}, -{0.728545f,-0.669331f,0.145667f}, -{0.504959f,0.440850f,0.742070f}, -{0.728545f,-0.669331f,0.145667f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.290566f,0.151929f,0.944716f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.297002f,0.053309f,0.953388f}, -{0.290566f,0.151929f,0.944716f}, -{0.222328f,0.928824f,0.296407f}, -{0.338569f,0.794483f,0.504150f}, -{0.363541f,0.930338f,0.048048f}, -{0.338569f,0.794483f,0.504150f}, -{0.449200f,0.852911f,0.266011f}, -{0.538710f,0.837608f,0.090582f}, -{0.449200f,0.852911f,0.266011f}, -{0.611084f,0.776183f,0.155293f}, -{0.538710f,0.837608f,0.090582f}, -{0.611084f,0.776183f,0.155293f}, -{0.828419f,0.545369f,0.127650f}, -{0.731872f,0.676764f,0.079707f}, -{0.812721f,0.298228f,0.500545f}, -{0.789740f,0.237525f,0.565590f}, -{0.865086f,0.209543f,0.455760f}, -{0.676305f,0.266081f,0.686886f}, -{0.547075f,0.225477f,0.806145f}, -{0.687959f,0.142898f,0.711542f}, -{0.192348f,0.279380f,0.940717f}, -{0.205985f,0.284205f,0.936375f}, -{0.210996f,0.179609f,0.960844f}, -{0.205985f,0.284205f,0.936375f}, -{0.149035f,0.415524f,0.897290f}, -{0.237922f,0.252894f,0.937784f}, -{0.149035f,0.415524f,0.897290f}, -{0.289593f,0.427276f,0.856488f}, -{0.237922f,0.252894f,0.937784f}, -{0.208222f,0.491946f,0.845360f}, -{-0.548609f,0.702264f,0.453711f}, -{0.368866f,0.575503f,0.729886f}, -{-0.548609f,0.702264f,0.453711f}, -{0.117155f,0.955892f,0.269343f}, -{0.369157f,0.773111f,0.515774f}, -{-0.469991f,0.877912f,0.091534f}, -{-0.001691f,0.910378f,-0.413774f}, -{0.389407f,0.917268f,-0.083558f}, -{-0.001691f,0.910378f,-0.413774f}, -{-0.175008f,0.794447f,-0.581572f}, -{0.302614f,0.739474f,-0.601335f}, -{0.271568f,0.608361f,-0.745753f}, -{0.018296f,0.623996f,-0.781214f}, -{0.287894f,0.519724f,-0.804365f}, -{0.018296f,0.623996f,-0.781214f}, -{-0.172056f,0.421403f,-0.890402f}, -{0.221229f,0.403398f,-0.887878f}, -{-0.172056f,0.421403f,-0.890402f}, -{0.000501f,0.173705f,-0.984798f}, -{0.221229f,0.403398f,-0.887878f}, -{0.154202f,-0.039256f,-0.987259f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.148955f,-0.048469f,-0.987655f}, -{0.552213f,-0.032889f,-0.833054f}, -{0.705586f,0.025699f,-0.708158f}, -{0.589576f,-0.007204f,-0.807680f}, -{0.705586f,0.025699f,-0.708158f}, -{0.781353f,0.225266f,-0.582016f}, -{0.791501f,0.092271f,-0.604162f}, -{0.781353f,0.225266f,-0.582016f}, -{0.894765f,0.304007f,-0.327071f}, -{0.858324f,0.212906f,-0.466852f}, -{0.895721f,0.419400f,-0.147605f}, -{0.799601f,0.586555f,-0.128808f}, -{0.894765f,0.304007f,-0.327071f}, -{-0.988514f,-0.140680f,0.055221f}, -{-0.998091f,-0.059508f,-0.016551f}, -{-0.958645f,-0.131653f,-0.252323f}, -{-0.988514f,-0.140680f,0.055221f}, -{-0.946894f,-0.083377f,0.310547f}, -{-0.984283f,-0.051648f,0.168875f}, -{-0.925595f,-0.219969f,0.308037f}, -{-0.912801f,-0.112862f,0.392499f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.850583f,0.097851f,0.516657f}, -{-0.787639f,-0.269027f,0.554301f}, -{-0.814055f,-0.041024f,0.579337f}, -{-0.878151f,-0.009979f,0.478279f}, -{-0.850583f,0.097851f,0.516657f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.912801f,-0.112862f,0.392499f}, -{-0.878151f,-0.009979f,0.478279f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.586320f,0.540668f,0.603247f}, -{-0.542040f,0.629184f,0.557063f}, -{-0.169148f,0.752509f,0.636489f}, -{-0.760001f,0.324191f,0.563293f}, -{-0.586320f,0.540668f,0.603247f}, -{-0.518049f,0.451465f,0.726502f}, -{-0.755415f,0.076920f,0.650716f}, -{-0.760001f,0.324191f,0.563293f}, -{-0.814055f,-0.041024f,0.579337f}, -{-0.542040f,0.629184f,0.557063f}, -{-0.124844f,0.873959f,0.469691f}, -{-0.169148f,0.752509f,0.636489f}, -{-0.124844f,0.873959f,0.469691f}, -{-0.335869f,0.689550f,0.641648f}, -{-0.321627f,0.659738f,0.679192f}, -{0.071526f,0.972134f,0.223247f}, -{0.071823f,0.988827f,0.130627f}, -{0.171867f,0.984952f,0.018213f}, -{0.098032f,0.964604f,0.244805f}, -{0.071526f,0.972134f,0.223247f}, -{0.061960f,0.962691f,0.263414f}, -{0.077268f,0.992763f,0.091936f}, -{0.053007f,0.998593f,0.001737f}, -{0.171867f,0.984952f,0.018213f}, -{0.071823f,0.988827f,0.130627f}, -{0.077268f,0.992763f,0.091936f}, -{0.171867f,0.984952f,0.018213f}, -{0.053007f,0.998593f,0.001737f}, -{0.041037f,0.999024f,0.016341f}, -{0.091380f,0.995375f,-0.029645f}, -{0.029330f,0.999344f,-0.021255f}, -{0.057898f,0.998302f,0.006430f}, -{0.053011f,0.996626f,0.062659f}, -{0.041037f,0.999024f,0.016341f}, -{0.029330f,0.999344f,-0.021255f}, -{0.091380f,0.995375f,-0.029645f}, -{0.111817f,0.988378f,-0.102986f}, -{0.138558f,0.971214f,-0.193767f}, -{0.095780f,0.971889f,-0.215078f}, -{0.138558f,0.971214f,-0.193767f}, -{0.139528f,0.980985f,-0.134911f}, -{0.248974f,0.936959f,-0.245195f}, -{0.057898f,0.998302f,0.006430f}, -{0.111817f,0.988378f,-0.102986f}, -{0.230458f,0.971546f,0.054663f}, -{0.140515f,0.968515f,-0.205508f}, -{0.058741f,0.975100f,-0.213843f}, -{0.003651f,0.946181f,-0.323619f}, -{0.095780f,0.971889f,-0.215078f}, -{0.140515f,0.968515f,-0.205508f}, -{0.111817f,0.988378f,-0.102986f}, -{-0.237835f,0.825207f,-0.512316f}, -{-0.537060f,0.609628f,-0.583027f}, -{-0.278250f,0.635043f,-0.720623f}, -{-0.397014f,0.641777f,-0.656127f}, -{-0.237835f,0.825207f,-0.512316f}, -{-0.186767f,0.925548f,-0.329360f}, -{-0.601154f,0.511409f,-0.614064f}, -{-0.739554f,0.361004f,-0.568099f}, -{-0.519937f,0.399504f,-0.755024f}, -{-0.537060f,0.609628f,-0.583027f}, -{-0.601154f,0.511409f,-0.614064f}, -{-0.278250f,0.635043f,-0.720623f}, -{-0.885015f,-0.020410f,-0.465115f}, -{-0.916145f,-0.160493f,-0.367314f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.847640f,0.110414f,-0.518956f}, -{-0.885015f,-0.020410f,-0.465115f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.792261f,-0.268380f,-0.547992f}, -{-0.847640f,0.110414f,-0.518956f}, -{-0.759992f,-0.028623f,-0.649302f}, -{-0.916145f,-0.160493f,-0.367314f}, -{-0.913898f,-0.318786f,-0.251330f}, -{-0.958645f,-0.131653f,-0.252323f}, -{-0.499130f,0.176378f,0.848387f}, -{-0.370077f,-0.091471f,0.924487f}, -{-0.382842f,0.339600f,0.859130f}, -{0.267882f,0.921692f,0.280576f}, -{0.187050f,0.956413f,0.224247f}, -{0.356397f,0.851081f,0.385542f}, -{0.139528f,0.980985f,-0.134911f}, -{0.274319f,0.922629f,-0.271118f}, -{0.248974f,0.936959f,-0.245195f}, -{0.274319f,0.922629f,-0.271118f}, -{0.445390f,0.806344f,-0.389150f}, -{0.387867f,0.814848f,-0.430791f}, -{-0.172576f,-0.266778f,-0.948181f}, -{-0.398928f,-0.136055f,-0.906832f}, -{-0.254922f,-0.206536f,-0.944647f}, -{0.171247f,-0.059534f,0.983428f}, -{0.130191f,0.048489f,0.990303f}, -{0.290566f,0.151929f,0.944716f}, -{0.000108f,-0.223144f,0.974786f}, -{0.171247f,-0.059534f,0.983428f}, -{0.252548f,-0.116382f,0.960560f}, -{-0.162448f,-0.277452f,0.946906f}, -{0.000108f,-0.223144f,0.974786f}, -{0.085830f,-0.307324f,0.947726f}, -{0.290566f,0.151929f,0.944716f}, -{0.317441f,0.247702f,0.915355f}, -{0.372522f,0.318324f,0.871721f}, -{0.171346f,0.146714f,0.974226f}, -{0.290566f,0.151929f,0.944716f}, -{0.130191f,0.048489f,0.990303f}, -{0.372522f,0.318324f,0.871721f}, -{0.728545f,-0.669331f,0.145667f}, -{0.290566f,0.151929f,0.944716f}, -{0.504959f,0.440850f,0.742070f}, -{0.523016f,0.598786f,0.606555f}, -{0.470076f,0.713698f,0.519292f}, -{0.445390f,0.806344f,-0.389150f}, -{0.489136f,0.689178f,-0.534583f}, -{0.387867f,0.814848f,-0.430791f}, -{0.901109f,0.387318f,0.194905f}, -{0.473121f,0.350571f,-0.808243f}, -{0.332521f,0.099016f,-0.937883f}, -{0.536759f,0.614025f,-0.578673f}, -{0.566193f,0.539475f,-0.623211f}, -{0.489136f,0.689178f,-0.534583f}, -{0.332521f,0.099016f,-0.937883f}, -{0.345386f,0.307643f,-0.886602f}, -{0.343328f,0.248380f,-0.905778f}, -{0.352300f,0.203514f,-0.913492f}, -{0.210972f,0.052291f,-0.976092f}, -{0.358432f,-0.028939f,-0.933107f}, -{0.236355f,0.191172f,-0.952675f}, -{0.352300f,0.203514f,-0.913492f}, -{0.285257f,0.243329f,-0.927049f}, -{-0.041588f,-0.272536f,-0.961246f}, -{-0.172576f,-0.266778f,-0.948181f}, -{0.023188f,-0.279177f,-0.959960f}, -{0.053473f,-0.177418f,-0.982682f}, -{0.023188f,-0.279177f,-0.959960f}, -{0.189436f,-0.361622f,-0.912876f}, -{0.279216f,0.291053f,0.915056f}, -{0.235467f,0.147537f,0.960619f}, -{0.237922f,0.252894f,0.937784f}, -{0.235467f,0.147537f,0.960619f}, -{0.140657f,0.004780f,0.990047f}, -{0.237922f,0.252894f,0.937784f}, -{0.369157f,0.773111f,0.515774f}, -{0.368866f,0.575503f,0.729886f}, -{-0.548609f,0.702264f,0.453711f}, -{0.368866f,0.575503f,0.729886f}, -{0.387776f,0.473954f,0.790568f}, -{0.257029f,0.521014f,0.813929f}, -{0.502365f,0.707499f,0.497066f}, -{0.369157f,0.773111f,0.515774f}, -{0.117155f,0.955892f,0.269343f}, -{0.539602f,0.840918f,0.041068f}, -{0.515681f,0.796653f,0.315305f}, -{0.430884f,0.865455f,0.255590f}, -{0.140657f,0.004780f,0.990047f}, -{0.116133f,0.039387f,0.992452f}, -{0.237922f,0.252894f,0.937784f}, -{0.363541f,0.930338f,0.048048f}, -{0.394155f,0.919019f,0.006732f}, -{0.222328f,0.928824f,0.296407f}, -{0.394155f,0.919019f,0.006732f}, -{0.539602f,0.840918f,0.041068f}, -{0.430884f,0.865455f,0.255590f}, -{0.222328f,0.928824f,0.296407f}, -{0.394155f,0.919019f,0.006732f}, -{0.430884f,0.865455f,0.255590f}, -{0.302614f,0.739474f,-0.601335f}, -{0.389407f,0.917268f,-0.083558f}, -{-0.001691f,0.910378f,-0.413774f}, -{0.271568f,0.608361f,-0.745753f}, -{0.302614f,0.739474f,-0.601335f}, -{-0.175008f,0.794447f,-0.581572f}, -{0.157104f,0.219159f,-0.962958f}, -{0.221229f,0.403398f,-0.887878f}, -{0.000501f,0.173705f,-0.984798f}, -{0.221229f,0.403398f,-0.887878f}, -{0.287894f,0.519724f,-0.804365f}, -{0.018296f,0.623996f,-0.781214f}, -{0.141854f,0.051803f,-0.988531f}, -{0.000501f,0.173705f,-0.984798f}, -{0.093003f,0.009710f,-0.995618f}, -{0.164650f,0.189698f,0.967939f}, -{0.210996f,0.179609f,0.960844f}, -{0.205985f,0.284205f,0.936375f}, -{0.116133f,0.039387f,0.992452f}, -{0.164650f,0.189698f,0.967939f}, -{0.237922f,0.252894f,0.937784f}, -{0.210996f,0.179609f,0.960844f}, -{0.341647f,0.023101f,0.939544f}, -{0.307422f,0.250640f,0.917971f}, -{0.731872f,0.676764f,0.079707f}, -{0.538710f,0.837608f,0.090582f}, -{0.611084f,0.776183f,0.155293f}, -{0.538710f,0.837608f,0.090582f}, -{0.363541f,0.930338f,0.048048f}, -{0.338569f,0.794483f,0.504150f}, -{0.148955f,-0.048469f,-0.987655f}, -{0.093003f,0.009710f,-0.995618f}, -{0.154202f,-0.039256f,-0.987259f}, -{0.341647f,0.023101f,0.939544f}, -{0.439946f,0.175781f,0.880652f}, -{0.307422f,0.250640f,0.917971f}, -{0.865086f,0.209543f,0.455760f}, -{0.951587f,0.108524f,0.287584f}, -{0.910755f,0.278726f,0.304691f}, -{0.687959f,0.142898f,0.711542f}, -{0.789740f,0.237525f,0.565590f}, -{0.676305f,0.266081f,0.686886f}, -{0.918588f,0.375123f,0.124412f}, -{0.731872f,0.676764f,0.079707f}, -{0.828419f,0.545369f,0.127650f}, -{0.910755f,0.278726f,0.304691f}, -{0.918588f,0.375123f,0.124412f}, -{0.828419f,0.545369f,0.127650f}, -{0.858268f,0.137759f,-0.494366f}, -{0.791501f,0.092271f,-0.604162f}, -{0.781353f,0.225266f,-0.582016f}, -{0.858324f,0.212906f,-0.466852f}, -{0.858268f,0.137759f,-0.494366f}, -{0.781353f,0.225266f,-0.582016f}, -{0.791501f,0.092271f,-0.604162f}, -{0.589576f,-0.007204f,-0.807680f}, -{0.705586f,0.025699f,-0.708158f}, -{-0.958645f,-0.131653f,-0.252323f}, -{-0.857051f,0.000315f,-0.515232f}, -{-0.916145f,-0.160493f,-0.367314f}, -{-0.847640f,0.110414f,-0.518956f}, -{-0.704461f,0.199354f,-0.681170f}, -{-0.739554f,0.361004f,-0.568099f}, -{-0.237835f,0.825207f,-0.512316f}, -{0.079728f,0.876478f,-0.474795f}, -{0.003651f,0.946181f,-0.323619f}, -{0.079728f,0.876478f,-0.474795f}, -{0.140515f,0.968515f,-0.205508f}, -{0.003651f,0.946181f,-0.323619f}, -{0.140515f,0.968515f,-0.205508f}, -{0.194831f,0.980831f,0.003437f}, -{0.111817f,0.988378f,-0.102986f}, -{0.071526f,0.972134f,0.223247f}, -{0.155388f,0.934199f,0.321135f}, -{-0.124844f,0.873959f,0.469691f}, -{-0.760001f,0.324191f,0.563293f}, -{-0.699688f,0.204704f,0.684495f}, -{-0.850583f,0.097851f,0.516657f}, -{-0.861320f,0.008996f,0.507982f}, -{-0.946894f,-0.083377f,0.310547f}, -{-0.925595f,-0.219969f,0.308037f}, -{-0.374744f,0.269451f,-0.887109f}, -{-0.337693f,0.105630f,-0.935311f}, -{-0.398928f,-0.136055f,-0.906832f}, -{0.332521f,0.099016f,-0.937883f}, -{0.361705f,-0.132388f,-0.922845f}, -{0.901109f,0.387318f,0.194905f}, -{0.138558f,0.971214f,-0.193767f}, -{0.204352f,0.947276f,-0.246795f}, -{0.095780f,0.971889f,-0.215078f}, -{-0.382842f,0.339600f,0.859130f}, -{-0.321627f,0.659738f,0.679192f}, -{-0.335869f,0.689550f,0.641648f}, -{-0.124844f,0.873959f,0.469691f}, -{-0.058113f,0.949457f,0.308470f}, -{0.071526f,0.972134f,0.223247f}, -{0.134729f,0.972475f,0.190106f}, -{0.356397f,0.851081f,0.385542f}, -{0.187050f,0.956413f,0.224247f}, -{0.470076f,0.713698f,0.519292f}, -{0.115037f,0.723134f,0.681061f}, -{0.504959f,0.440850f,0.742070f}, -{0.290566f,0.151929f,0.944716f}, -{0.297002f,0.053309f,0.953388f}, -{0.171247f,-0.059534f,0.983428f}, -{0.910755f,0.278726f,0.304691f}, -{0.812721f,0.298228f,0.500545f}, -{0.865086f,0.209543f,0.455760f}, -{0.164650f,0.189698f,0.967939f}, -{0.205985f,0.284205f,0.936375f}, -{0.237922f,0.252894f,0.937784f}, -{0.257029f,0.521014f,0.813929f}, -{0.208222f,0.491946f,0.845360f}, -{0.368866f,0.575503f,0.729886f}, -{0.424145f,-0.020815f,-0.905355f}, -{0.552213f,-0.032889f,-0.833054f}, -{0.589576f,-0.007204f,-0.807680f}, -{-0.850583f,0.097851f,0.516657f}, -{-0.814055f,-0.041024f,0.579337f}, -{-0.760001f,0.324191f,0.563293f}, -{-0.739554f,0.361004f,-0.568099f}, -{-0.759992f,-0.028623f,-0.649302f}, -{-0.847640f,0.110414f,-0.518956f}, -{0.058741f,0.975100f,-0.213843f}, -{-0.186767f,0.925548f,-0.329360f}, -{0.003651f,0.946181f,-0.323619f}, -{0.008718f,0.993857f,-0.110329f}, -{-0.186767f,0.925548f,-0.329360f}, -{0.058741f,0.975100f,-0.213843f}, -{0.008718f,0.993857f,-0.110329f}, -{-0.266064f,0.934779f,-0.235369f}, -{-0.186767f,0.925548f,-0.329360f}, -{-0.270780f,0.835824f,-0.477574f}, -{-0.266064f,0.934779f,-0.235369f}, -{0.094141f,0.990417f,-0.101053f}, -{0.035931f,0.978315f,-0.203983f}, -{-0.270780f,0.835824f,-0.477574f}, -{0.094141f,0.990417f,-0.101053f}, -{-0.505664f,0.701933f,-0.501591f}, -{-0.323200f,0.597578f,-0.733786f}, -{-0.266064f,0.934779f,-0.235369f}, -{-0.266064f,0.934779f,-0.235369f}, -{-0.323200f,0.597578f,-0.733786f}, -{-0.186767f,0.925548f,-0.329360f}, -{-0.571689f,0.504383f,-0.647124f}, -{-0.505664f,0.701933f,-0.501591f}, -{-0.266064f,0.934779f,-0.235369f}, -{-0.270780f,0.835824f,-0.477574f}, -{-0.571689f,0.504383f,-0.647124f}, -{-0.266064f,0.934779f,-0.235369f}, -{-0.352461f,0.629926f,-0.692073f}, -{-0.571689f,0.504383f,-0.647124f}, -{-0.270780f,0.835824f,-0.477574f}, -{-0.425243f,0.410651f,-0.806557f}, -{-0.352461f,0.629926f,-0.692073f}, -{-0.270780f,0.835824f,-0.477574f}, -{-0.571689f,0.504383f,-0.647124f}, -{-0.476675f,0.332956f,-0.813585f}, -{-0.505664f,0.701933f,-0.501591f}, -{-0.505664f,0.701933f,-0.501591f}, -{-0.476675f,0.332956f,-0.813585f}, -{-0.323200f,0.597578f,-0.733786f}, -{-0.425243f,0.410651f,-0.806557f}, -{-0.571689f,0.504383f,-0.647124f}, -{-0.352461f,0.629926f,-0.692073f}, -{-0.476675f,0.332956f,-0.813585f}, -{-0.337693f,0.105630f,-0.935311f}, -{-0.323200f,0.597578f,-0.733786f}, -{-0.490588f,-0.032522f,-0.870785f}, -{-0.476675f,0.332956f,-0.813585f}, -{-0.571689f,0.504383f,-0.647124f}, -{-0.476675f,0.332956f,-0.813585f}, -{-0.490588f,-0.032522f,-0.870785f}, -{-0.337693f,0.105630f,-0.935311f}, -{-0.599674f,0.029426f,-0.799703f}, -{-0.490588f,-0.032522f,-0.870785f}, -{-0.571689f,0.504383f,-0.647124f}, -{-0.436192f,-0.277165f,-0.856105f}, -{-0.599674f,0.029426f,-0.799703f}, -{-0.425243f,0.410651f,-0.806557f}, -{-0.425243f,0.410651f,-0.806557f}, -{-0.599674f,0.029426f,-0.799703f}, -{-0.571689f,0.504383f,-0.647124f}, -{-0.490588f,-0.032522f,-0.870785f}, -{-0.254922f,-0.206536f,-0.944647f}, -{-0.337693f,0.105630f,-0.935311f}, -{-0.254922f,-0.206536f,-0.944647f}, -{-0.490588f,-0.032522f,-0.870785f}, -{-0.171305f,-0.437287f,-0.882856f}, -{-0.393296f,-0.439975f,-0.807304f}, -{-0.490588f,-0.032522f,-0.870785f}, -{-0.599674f,0.029426f,-0.799703f}, -{-0.490588f,-0.032522f,-0.870785f}, -{-0.393296f,-0.439975f,-0.807304f}, -{-0.171305f,-0.437287f,-0.882856f}, -{-0.599674f,0.029426f,-0.799703f}, -{-0.436192f,-0.277165f,-0.856105f}, -{-0.393296f,-0.439975f,-0.807304f}, -{0.023188f,-0.279177f,-0.959960f}, -{-0.172576f,-0.266778f,-0.948181f}, -{-0.254922f,-0.206536f,-0.944647f}, -{-0.171305f,-0.437287f,-0.882856f}, -{0.023188f,-0.279177f,-0.959960f}, -{-0.254922f,-0.206536f,-0.944647f}, -{-0.037497f,-0.669143f,-0.742187f}, -{-0.171305f,-0.437287f,-0.882856f}, -{-0.393296f,-0.439975f,-0.807304f}, -{-0.436192f,-0.277165f,-0.856105f}, -{-0.037497f,-0.669143f,-0.742187f}, -{-0.393296f,-0.439975f,-0.807304f}, -{-0.283861f,-0.608680f,-0.740899f}, -{-0.037497f,-0.669143f,-0.742187f}, -{-0.436192f,-0.277165f,-0.856105f}, -{0.189436f,-0.361622f,-0.912876f}, -{0.023188f,-0.279177f,-0.959960f}, -{-0.171305f,-0.437287f,-0.882856f}, -{0.189436f,-0.361622f,-0.912876f}, -{-0.171305f,-0.437287f,-0.882856f}, -{-0.037497f,-0.669143f,-0.742187f}, -{-0.283861f,-0.608680f,-0.740899f}, -{-0.058529f,-0.935295f,-0.348995f}, -{-0.037497f,-0.669143f,-0.742187f}, -{0.358432f,-0.028939f,-0.933107f}, -{-0.037497f,-0.669143f,-0.742187f}, -{0.416569f,-0.491733f,-0.764636f}, -{0.189436f,-0.361622f,-0.912876f}, -{-0.037497f,-0.669143f,-0.742187f}, -{0.358432f,-0.028939f,-0.933107f}, -{0.416569f,-0.491733f,-0.764636f}, -{-0.037497f,-0.669143f,-0.742187f}, -{-0.058529f,-0.935295f,-0.348995f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.352300f,0.203514f,-0.913492f}, -{0.416569f,-0.491733f,-0.764636f}, -{0.358432f,-0.028939f,-0.933107f}, -{0.416569f,-0.491733f,-0.764636f}, -{0.352300f,0.203514f,-0.913492f}, -{0.361705f,-0.132388f,-0.922845f}, -{0.343328f,0.248380f,-0.905778f}, -{0.352300f,0.203514f,-0.913492f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.361705f,-0.132388f,-0.922845f}, -{0.352300f,0.203514f,-0.913492f}, -{0.361705f,-0.132388f,-0.922845f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.416569f,-0.491733f,-0.764636f}, -{0.361705f,-0.132388f,-0.922845f}, -{0.416569f,-0.491733f,-0.764636f}, -{-0.137885f,-0.308339f,0.941231f}, -{0.646168f,0.395237f,-0.652882f}, -{0.361705f,-0.132388f,-0.922845f}, -{-0.137885f,-0.308339f,0.941231f}, -{0.361705f,-0.132388f,-0.922845f}, -{0.646168f,0.395237f,-0.652882f}, -{-0.015615f,0.612257f,-0.790504f}, -{0.322542f,0.653191f,-0.685060f}, -{-0.015615f,0.612257f,-0.790504f}, -{0.382350f,0.413473f,-0.826346f}, -{-0.015615f,0.612257f,-0.790504f}, -{0.646168f,0.395237f,-0.652882f}, -{0.382350f,0.413473f,-0.826346f}, -{0.693419f,0.720347f,-0.016479f}, -{0.382350f,0.413473f,-0.826346f}, -{0.646168f,0.395237f,-0.652882f}, -{0.503276f,0.641041f,-0.579465f}, -{0.355285f,0.831634f,-0.426799f}, -{0.322542f,0.653191f,-0.685060f}, -{0.322542f,0.653191f,-0.685060f}, -{0.355285f,0.831634f,-0.426799f}, -{0.387867f,0.814848f,-0.430791f}, -{0.693419f,0.720347f,-0.016479f}, -{0.503276f,0.641041f,-0.579465f}, -{0.382350f,0.413473f,-0.826346f}, -{0.382350f,0.413473f,-0.826346f}, -{0.503276f,0.641041f,-0.579465f}, -{0.322542f,0.653191f,-0.685060f}, -{0.502068f,0.816762f,-0.284302f}, -{0.355285f,0.831634f,-0.426799f}, -{0.693419f,0.720347f,-0.016479f}, -{0.693419f,0.720347f,-0.016479f}, -{0.355285f,0.831634f,-0.426799f}, -{0.503276f,0.641041f,-0.579465f}, -{0.297541f,0.942425f,-0.152656f}, -{0.502068f,0.816762f,-0.284302f}, -{0.693419f,0.720347f,-0.016479f}, -{0.351359f,0.907094f,0.231790f}, -{0.693419f,0.720347f,-0.016479f}, -{0.353403f,0.775754f,0.522793f}, -{0.693419f,0.720347f,-0.016479f}, -{0.351359f,0.907094f,0.231790f}, -{0.502068f,0.816762f,-0.284302f}, -{0.297541f,0.942425f,-0.152656f}, -{0.204352f,0.947276f,-0.246795f}, -{0.502068f,0.816762f,-0.284302f}, -{0.502068f,0.816762f,-0.284302f}, -{0.204352f,0.947276f,-0.246795f}, -{0.355285f,0.831634f,-0.426799f}, -{0.094141f,0.990417f,-0.101053f}, -{0.297541f,0.942425f,-0.152656f}, -{0.502068f,0.816762f,-0.284302f}, -{0.351359f,0.907094f,0.231790f}, -{0.094141f,0.990417f,-0.101053f}, -{0.502068f,0.816762f,-0.284302f}, -{0.297541f,0.942425f,-0.152656f}, -{0.058741f,0.975100f,-0.213843f}, -{0.204352f,0.947276f,-0.246795f}, -{0.008718f,0.993857f,-0.110329f}, -{0.058741f,0.975100f,-0.213843f}, -{0.297541f,0.942425f,-0.152656f}, -{-0.266064f,0.934779f,-0.235369f}, -{0.008718f,0.993857f,-0.110329f}, -{0.297541f,0.942425f,-0.152656f}, -{0.094141f,0.990417f,-0.101053f}, -{-0.266064f,0.934779f,-0.235369f}, -{0.297541f,0.942425f,-0.152656f}, -{0.035931f,0.978315f,-0.203983f}, -{0.094141f,0.990417f,-0.101053f}, -{0.351359f,0.907094f,0.231790f}, -{-0.251965f,0.757212f,-0.602614f}, -{-0.323200f,0.597578f,-0.733786f}, -{-0.397014f,0.641777f,-0.656127f}, -{-0.397014f,0.641777f,-0.656127f}, -{-0.323200f,0.597578f,-0.733786f}, -{-0.374744f,0.269451f,-0.887109f}, -{0.901109f,0.387318f,0.194905f}, -{0.322542f,0.653191f,-0.685060f}, -{0.489136f,0.689178f,-0.534583f}, -{-0.283861f,-0.608680f,-0.740899f}, -{-0.436192f,-0.277165f,-0.856105f}, -{-0.237882f,-0.043628f,-0.970314f}, -{-0.237882f,-0.043628f,-0.970314f}, -{-0.425243f,0.410651f,-0.806557f}, -{-0.131874f,0.668345f,-0.732068f}, -{-0.131874f,0.668345f,-0.732068f}, -{-0.425243f,0.410651f,-0.806557f}, -{-0.140997f,0.780001f,-0.609687f}, -{-0.140997f,0.780001f,-0.609687f}, -{-0.270780f,0.835824f,-0.477574f}, -{0.035931f,0.978315f,-0.203983f}, -{-0.270780f,0.835824f,-0.477574f}, -{-0.140997f,0.780001f,-0.609687f}, -{-0.425243f,0.410651f,-0.806557f}, -{-0.323200f,0.597578f,-0.733786f}, -{-0.251965f,0.757212f,-0.602614f}, -{-0.186767f,0.925548f,-0.329360f}, -{-0.425243f,0.410651f,-0.806557f}, -{-0.237882f,-0.043628f,-0.970314f}, -{-0.436192f,-0.277165f,-0.856105f}, -{0.355285f,0.831634f,-0.426799f}, -{0.248974f,0.936959f,-0.245195f}, -{0.387867f,0.814848f,-0.430791f}, -{0.204352f,0.947276f,-0.246795f}, -{0.248974f,0.936959f,-0.245195f}, -{0.355285f,0.831634f,-0.426799f}, -{-0.323200f,0.597578f,-0.733786f}, -{-0.337693f,0.105630f,-0.935311f}, -{-0.374744f,0.269451f,-0.887109f}, -{0.361705f,-0.132388f,-0.922845f}, -{-0.015615f,0.612257f,-0.790504f}, -{0.901109f,0.387318f,0.194905f}, -{-0.015615f,0.612257f,-0.790504f}, -{0.322542f,0.653191f,-0.685060f}, -{0.901109f,0.387318f,0.194905f}, -{0.780155f,0.040807f,0.624254f}, -{0.993281f,-0.050399f,-0.104180f}, -{0.991736f,-0.022423f,0.126318f}, -{0.863378f,-0.022015f,0.504077f}, -{0.993281f,-0.050399f,-0.104180f}, -{0.780155f,0.040807f,0.624254f}, -{0.993281f,-0.050399f,-0.104180f}, -{0.863378f,-0.022015f,0.504077f}, -{0.992445f,-0.006490f,-0.122517f}, -{0.902485f,-0.052899f,0.427461f}, -{0.992445f,-0.006490f,-0.122517f}, -{0.863378f,-0.022015f,0.504077f}, -{0.992445f,-0.006490f,-0.122517f}, -{0.902485f,-0.052899f,0.427461f}, -{0.989261f,-0.125403f,-0.075082f}, -{0.893791f,-0.347000f,0.284129f}, -{0.989261f,-0.125403f,-0.075082f}, -{0.902485f,-0.052899f,0.427461f}, -{0.989261f,-0.125403f,-0.075082f}, -{0.893791f,-0.347000f,0.284129f}, -{0.900619f,-0.419869f,-0.112231f}, -{0.779374f,-0.503516f,0.372891f}, -{0.900619f,-0.419869f,-0.112231f}, -{0.893791f,-0.347000f,0.284129f}, -{0.900619f,-0.419869f,-0.112231f}, -{0.779374f,-0.503516f,0.372891f}, -{0.849845f,-0.527033f,0.000431f}, -{0.849845f,-0.527033f,0.000431f}, -{0.779374f,-0.503516f,0.372891f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.779374f,-0.503516f,0.372891f}, -{0.713482f,-0.698031f,0.060801f}, -{0.326831f,-0.888389f,0.322408f}, -{0.713482f,-0.698031f,0.060801f}, -{0.779374f,-0.503516f,0.372891f}, -{0.713482f,-0.698031f,0.060801f}, -{0.326831f,-0.888389f,0.322408f}, -{0.286696f,-0.954926f,-0.076954f}, -{0.117638f,-0.795798f,0.594026f}, -{0.286696f,-0.954926f,-0.076954f}, -{0.326831f,-0.888389f,0.322408f}, -{0.286696f,-0.954926f,-0.076954f}, -{0.117638f,-0.795798f,0.594026f}, -{0.166013f,-0.980090f,-0.108918f}, -{0.117638f,-0.795798f,0.594026f}, -{-0.178557f,-0.826586f,0.533736f}, -{-0.058265f,-0.998112f,-0.019421f}, -{0.166013f,-0.980090f,-0.108918f}, -{0.117638f,-0.795798f,0.594026f}, -{-0.058265f,-0.998112f,-0.019421f}, -{0.053441f,-0.926371f,0.372801f}, -{-0.058265f,-0.998112f,-0.019421f}, -{-0.178557f,-0.826586f,0.533736f}, -{-0.178557f,-0.826586f,0.533736f}, -{-0.270018f,-0.827184f,0.492804f}, -{0.053441f,-0.926371f,0.372801f}, -{0.252548f,-0.116382f,0.960560f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.053441f,-0.926371f,0.372801f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.252548f,-0.116382f,0.960560f}, -{0.297002f,0.053309f,0.953388f}, -{0.677379f,0.169613f,0.715813f}, -{0.780155f,0.040807f,0.624254f}, -{0.991736f,-0.022423f,0.126318f}, -{0.902485f,-0.052899f,0.427461f}, -{0.725415f,-0.299431f,0.619770f}, -{0.893791f,-0.347000f,0.284129f}, -{0.893791f,-0.347000f,0.284129f}, -{0.725415f,-0.299431f,0.619770f}, -{0.779374f,-0.503516f,0.372891f}, -{0.779374f,-0.503516f,0.372891f}, -{0.231919f,-0.774503f,0.588522f}, -{0.326831f,-0.888389f,0.322408f}, -{0.117638f,-0.795798f,0.594026f}, -{0.326831f,-0.888389f,0.322408f}, -{0.231919f,-0.774503f,0.588522f}, -{-0.129625f,-0.629575f,0.766050f}, -{0.053441f,-0.926371f,0.372801f}, -{-0.270018f,-0.827184f,0.492804f}, -{0.085830f,-0.307324f,0.947726f}, -{0.252548f,-0.116382f,0.960560f}, -{0.053441f,-0.926371f,0.372801f}, -{-0.129625f,-0.629575f,0.766050f}, -{0.085830f,-0.307324f,0.947726f}, -{0.053441f,-0.926371f,0.372801f}, -{0.084648f,0.310344f,0.946848f}, -{0.780155f,0.040807f,0.624254f}, -{0.677379f,0.169613f,0.715813f}, -{0.106053f,0.082179f,0.990959f}, -{0.780155f,0.040807f,0.624254f}, -{0.084648f,0.310344f,0.946848f}, -{0.208645f,0.041640f,0.977104f}, -{0.780155f,0.040807f,0.624254f}, -{0.106053f,0.082179f,0.990959f}, -{0.780155f,0.040807f,0.624254f}, -{0.208645f,0.041640f,0.977104f}, -{0.863378f,-0.022015f,0.504077f}, -{0.433703f,0.105428f,0.894867f}, -{0.863378f,-0.022015f,0.504077f}, -{0.208645f,0.041640f,0.977104f}, -{0.863378f,-0.022015f,0.504077f}, -{0.433703f,0.105428f,0.894867f}, -{0.902485f,-0.052899f,0.427461f}, -{0.902485f,-0.052899f,0.427461f}, -{0.433703f,0.105428f,0.894867f}, -{0.725415f,-0.299431f,0.619770f}, -{0.346095f,-0.109424f,0.931797f}, -{0.725415f,-0.299431f,0.619770f}, -{0.433703f,0.105428f,0.894867f}, -{0.725415f,-0.299431f,0.619770f}, -{0.346095f,-0.109424f,0.931797f}, -{0.779374f,-0.503516f,0.372891f}, -{0.063100f,-0.113359f,0.991548f}, -{0.779374f,-0.503516f,0.372891f}, -{0.346095f,-0.109424f,0.931797f}, -{0.779374f,-0.503516f,0.372891f}, -{0.063100f,-0.113359f,0.991548f}, -{0.231919f,-0.774503f,0.588522f}, -{-0.010970f,-0.239405f,0.970858f}, -{0.231919f,-0.774503f,0.588522f}, -{0.063100f,-0.113359f,0.991548f}, -{0.231919f,-0.774503f,0.588522f}, -{-0.010970f,-0.239405f,0.970858f}, -{0.117638f,-0.795798f,0.594026f}, -{-0.043589f,-0.232065f,0.971723f}, -{0.117638f,-0.795798f,0.594026f}, -{-0.010970f,-0.239405f,0.970858f}, -{0.117638f,-0.795798f,0.594026f}, -{-0.043589f,-0.232065f,0.971723f}, -{-0.178557f,-0.826586f,0.533736f}, -{-0.398829f,-0.462338f,0.791946f}, -{-0.270018f,-0.827184f,0.492804f}, -{-0.178557f,-0.826586f,0.533736f}, -{-0.398829f,-0.462338f,0.791946f}, -{-0.178557f,-0.826586f,0.533736f}, -{-0.043589f,-0.232065f,0.971723f}, -{-0.498915f,-0.129739f,0.856885f}, -{-0.398829f,-0.462338f,0.791946f}, -{-0.592193f,-0.093682f,0.800332f}, -{-0.398829f,-0.462338f,0.791946f}, -{-0.498915f,-0.129739f,0.856885f}, -{-0.129625f,-0.629575f,0.766050f}, -{-0.129625f,-0.629575f,0.766050f}, -{-0.270018f,-0.827184f,0.492804f}, -{-0.398829f,-0.462338f,0.791946f}, -{-0.129625f,-0.629575f,0.766050f}, -{-0.498915f,-0.129739f,0.856885f}, -{-0.173549f,-0.262745f,0.949129f}, -{0.346095f,-0.109424f,0.931797f}, -{0.433703f,0.105428f,0.894867f}, -{-0.097050f,0.313710f,0.944546f}, -{0.346095f,-0.109424f,0.931797f}, -{-0.052094f,0.410808f,0.910232f}, -{0.063100f,-0.113359f,0.991548f}, -{-0.298910f,-0.075028f,0.951327f}, -{-0.398829f,-0.462338f,0.791946f}, -{-0.043589f,-0.232065f,0.971723f}, -{-0.592193f,-0.093682f,0.800332f}, -{-0.398829f,-0.462338f,0.791946f}, -{-0.298910f,-0.075028f,0.951327f}, -{-0.313337f,0.085931f,0.945746f}, -{-0.173549f,-0.262745f,0.949129f}, -{-0.498915f,-0.129739f,0.856885f}, -{-0.718504f,0.115581f,0.685852f}, -{0.208645f,0.041640f,0.977104f}, -{0.106053f,0.082179f,0.990959f}, -{-0.418312f,0.515880f,0.747584f}, -{0.208645f,0.041640f,0.977104f}, -{-0.718504f,0.115581f,0.685852f}, -{0.208645f,0.041640f,0.977104f}, -{-0.418312f,0.515880f,0.747584f}, -{0.433703f,0.105428f,0.894867f}, -{0.433703f,0.105428f,0.894867f}, -{-0.418312f,0.515880f,0.747584f}, -{-0.097050f,0.313710f,0.944546f}, -{-0.097050f,0.313710f,0.944546f}, -{-0.418312f,0.515880f,0.747584f}, -{0.346095f,-0.109424f,0.931797f}, -{-0.052094f,0.410808f,0.910232f}, -{0.346095f,-0.109424f,0.931797f}, -{-0.418312f,0.515880f,0.747584f}, -{-0.052094f,0.410808f,0.910232f}, -{-0.053319f,0.381164f,0.922969f}, -{0.063100f,-0.113359f,0.991548f}, -{0.063100f,-0.113359f,0.991548f}, -{-0.053319f,0.381164f,0.922969f}, -{-0.010970f,-0.239405f,0.970858f}, -{-0.093299f,0.354639f,0.930337f}, -{-0.010970f,-0.239405f,0.970858f}, -{-0.053319f,0.381164f,0.922969f}, -{-0.093299f,0.354639f,0.930337f}, -{-0.043589f,-0.232065f,0.971723f}, -{-0.010970f,-0.239405f,0.970858f}, -{-0.093299f,0.354639f,0.930337f}, -{-0.376120f,0.455561f,0.806844f}, -{-0.301348f,0.098811f,0.948381f}, -{-0.301348f,0.098811f,0.948381f}, -{-0.298910f,-0.075028f,0.951327f}, -{-0.043589f,-0.232065f,0.971723f}, -{-0.093299f,0.354639f,0.930337f}, -{-0.301348f,0.098811f,0.948381f}, -{-0.043589f,-0.232065f,0.971723f}, -{-0.529356f,0.588430f,0.611173f}, -{-0.498915f,-0.129739f,0.856885f}, -{-0.709964f,0.208725f,0.672596f}, -{-0.498915f,-0.129739f,0.856885f}, -{-0.592193f,-0.093682f,0.800332f}, -{-0.709964f,0.208725f,0.672596f}, -{-0.709964f,0.208725f,0.672596f}, -{-0.592193f,-0.093682f,0.800332f}, -{-0.301348f,0.098811f,0.948381f}, -{-0.301348f,0.098811f,0.948381f}, -{-0.592193f,-0.093682f,0.800332f}, -{-0.298910f,-0.075028f,0.951327f}, -{-0.709964f,0.208725f,0.672596f}, -{-0.301348f,0.098811f,0.948381f}, -{-0.376120f,0.455561f,0.806844f}, -{-0.298963f,0.372674f,0.878485f}, -{-0.498915f,-0.129739f,0.856885f}, -{-0.529356f,0.588430f,0.611173f}, -{-0.498915f,-0.129739f,0.856885f}, -{-0.298963f,0.372674f,0.878485f}, -{-0.313337f,0.085931f,0.945746f}, -{-0.761597f,0.208208f,0.613693f}, -{0.084648f,0.310344f,0.946848f}, -{-0.820035f,0.215202f,0.530313f}, -{0.084648f,0.310344f,0.946848f}, -{-0.761597f,0.208208f,0.613693f}, -{0.106053f,0.082179f,0.990959f}, -{-0.718504f,0.115581f,0.685852f}, -{0.106053f,0.082179f,0.990959f}, -{-0.761597f,0.208208f,0.613693f}, -{-0.252730f,0.685448f,0.682854f}, -{-0.052094f,0.410808f,0.910232f}, -{-0.418312f,0.515880f,0.747584f}, -{-0.052094f,0.410808f,0.910232f}, -{-0.252730f,0.685448f,0.682854f}, -{-0.053319f,0.381164f,0.922969f}, -{-0.108489f,0.699798f,0.706055f}, -{-0.093299f,0.354639f,0.930337f}, -{-0.252730f,0.685448f,0.682854f}, -{-0.252730f,0.685448f,0.682854f}, -{-0.093299f,0.354639f,0.930337f}, -{-0.053319f,0.381164f,0.922969f}, -{-0.093299f,0.354639f,0.930337f}, -{-0.108489f,0.699798f,0.706055f}, -{-0.376120f,0.455561f,0.806844f}, -{-0.305471f,0.897750f,0.317384f}, -{-0.252730f,0.685448f,0.682854f}, -{-0.418312f,0.515880f,0.747584f}, -{-0.070961f,0.861561f,0.502670f}, -{-0.108489f,0.699798f,0.706055f}, -{-0.305471f,0.897750f,0.317384f}, -{-0.305471f,0.897750f,0.317384f}, -{-0.108489f,0.699798f,0.706055f}, -{-0.252730f,0.685448f,0.682854f}, -{-0.070961f,0.861561f,0.502670f}, -{-0.378639f,0.772705f,0.509470f}, -{-0.376120f,0.455561f,0.806844f}, -{-0.070961f,0.861561f,0.502670f}, -{-0.376120f,0.455561f,0.806844f}, -{-0.108489f,0.699798f,0.706055f}, -{-0.176836f,0.958998f,0.221477f}, -{-0.529356f,0.588430f,0.611173f}, -{-0.444656f,0.839265f,0.312915f}, -{-0.529356f,0.588430f,0.611173f}, -{-0.709964f,0.208725f,0.672596f}, -{-0.378639f,0.772705f,0.509470f}, -{-0.378639f,0.772705f,0.509470f}, -{-0.709964f,0.208725f,0.672596f}, -{-0.376120f,0.455561f,0.806844f}, -{-0.444656f,0.839265f,0.312915f}, -{-0.529356f,0.588430f,0.611173f}, -{-0.378639f,0.772705f,0.509470f}, -{-0.820035f,0.215202f,0.530313f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.965616f,0.103795f,-0.238352f}, -{-0.959333f,0.100496f,-0.263783f}, -{-0.820035f,0.215202f,0.530313f}, -{-0.965616f,0.103795f,-0.238352f}, -{-0.820035f,0.215202f,0.530313f}, -{-0.959333f,0.100496f,-0.263783f}, -{-0.761597f,0.208208f,0.613693f}, -{-0.973130f,0.166733f,-0.158802f}, -{-0.761597f,0.208208f,0.613693f}, -{-0.959333f,0.100496f,-0.263783f}, -{-0.761597f,0.208208f,0.613693f}, -{-0.973130f,0.166733f,-0.158802f}, -{-0.718504f,0.115581f,0.685852f}, -{-0.890645f,0.441936f,-0.106979f}, -{-0.718504f,0.115581f,0.685852f}, -{-0.973130f,0.166733f,-0.158802f}, -{-0.718504f,0.115581f,0.685852f}, -{-0.890645f,0.441936f,-0.106979f}, -{-0.418312f,0.515880f,0.747584f}, -{-0.218742f,0.961904f,-0.163990f}, -{-0.305471f,0.897750f,0.317384f}, -{-0.890645f,0.441936f,-0.106979f}, -{-0.890645f,0.441936f,-0.106979f}, -{-0.305471f,0.897750f,0.317384f}, -{-0.418312f,0.515880f,0.747584f}, -{-0.008932f,0.996373f,0.084627f}, -{-0.070961f,0.861561f,0.502670f}, -{-0.218742f,0.961904f,-0.163990f}, -{-0.218742f,0.961904f,-0.163990f}, -{-0.070961f,0.861561f,0.502670f}, -{-0.305471f,0.897750f,0.317384f}, -{-0.087446f,0.996168f,-0.001799f}, -{-0.378639f,0.772705f,0.509470f}, -{-0.008932f,0.996373f,0.084627f}, -{-0.070961f,0.861561f,0.502670f}, -{-0.008932f,0.996373f,0.084627f}, -{-0.378639f,0.772705f,0.509470f}, -{-0.176836f,0.958998f,0.221477f}, -{-0.444656f,0.839265f,0.312915f}, -{-0.087446f,0.996168f,-0.001799f}, -{-0.087446f,0.996168f,-0.001799f}, -{-0.444656f,0.839265f,0.312915f}, -{-0.378639f,0.772705f,0.509470f}, -{0.132411f,0.904094f,-0.406302f}, -{-0.218742f,0.961904f,-0.163990f}, -{0.073976f,0.846295f,-0.527554f}, -{-0.218742f,0.961904f,-0.163990f}, -{0.132411f,0.904094f,-0.406302f}, -{-0.008932f,0.996373f,0.084627f}, -{-0.087446f,0.996168f,-0.001799f}, -{0.309223f,0.924513f,-0.222839f}, -{-0.176836f,0.958998f,0.221477f}, -{0.282941f,0.879788f,0.381992f}, -{0.061960f,0.962691f,0.263414f}, -{0.309223f,0.924513f,-0.222839f}, -{0.309223f,0.924513f,-0.222839f}, -{0.061960f,0.962691f,0.263414f}, -{-0.176836f,0.958998f,0.221477f}, -{-0.732186f,0.093289f,-0.674685f}, -{-0.959333f,0.100496f,-0.263783f}, -{-0.726149f,0.143539f,-0.672387f}, -{-0.726149f,0.143539f,-0.672387f}, -{-0.959333f,0.100496f,-0.263783f}, -{-0.965616f,0.103795f,-0.238352f}, -{-0.753084f,0.217457f,-0.620949f}, -{-0.973130f,0.166733f,-0.158802f}, -{-0.732186f,0.093289f,-0.674685f}, -{-0.732186f,0.093289f,-0.674685f}, -{-0.973130f,0.166733f,-0.158802f}, -{-0.959333f,0.100496f,-0.263783f}, -{-0.489190f,0.364342f,-0.792432f}, -{-0.890645f,0.441936f,-0.106979f}, -{-0.753084f,0.217457f,-0.620949f}, -{-0.753084f,0.217457f,-0.620949f}, -{-0.890645f,0.441936f,-0.106979f}, -{-0.973130f,0.166733f,-0.158802f}, -{-0.489190f,0.364342f,-0.792432f}, -{-0.218742f,0.961904f,-0.163990f}, -{-0.890645f,0.441936f,-0.106979f}, -{-0.160436f,0.526272f,-0.835044f}, -{-0.218742f,0.961904f,-0.163990f}, -{-0.489190f,0.364342f,-0.792432f}, -{-0.218742f,0.961904f,-0.163990f}, -{-0.160436f,0.526272f,-0.835044f}, -{0.073976f,0.846295f,-0.527554f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.073976f,0.846295f,-0.527554f}, -{-0.160436f,0.526272f,-0.835044f}, -{0.073976f,0.846295f,-0.527554f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.132411f,0.904094f,-0.406302f}, -{-0.008932f,0.996373f,0.084627f}, -{0.132411f,0.904094f,-0.406302f}, -{-0.087446f,0.996168f,-0.001799f}, -{0.309223f,0.924513f,-0.222839f}, -{-0.087446f,0.996168f,-0.001799f}, -{0.132411f,0.904094f,-0.406302f}, -{-0.009330f,0.026474f,-0.999606f}, -{-0.732186f,0.093289f,-0.674685f}, -{0.042255f,0.119108f,-0.991982f}, -{0.042255f,0.119108f,-0.991982f}, -{-0.732186f,0.093289f,-0.674685f}, -{-0.726149f,0.143539f,-0.672387f}, -{0.015366f,0.312552f,-0.949776f}, -{-0.160436f,0.526272f,-0.835044f}, -{-0.489190f,0.364342f,-0.792432f}, -{0.132411f,0.904094f,-0.406302f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.309223f,0.924513f,-0.222839f}, -{0.282941f,0.879788f,0.381992f}, -{0.309223f,0.924513f,-0.222839f}, -{0.692544f,0.674674f,0.255337f}, -{0.495485f,0.585601f,0.641534f}, -{0.282941f,0.879788f,0.381992f}, -{0.692544f,0.674674f,0.255337f}, -{0.420713f,0.463778f,0.779686f}, -{0.495485f,0.585601f,0.641534f}, -{0.692544f,0.674674f,0.255337f}, -{0.692544f,0.674674f,0.255337f}, -{0.309223f,0.924513f,-0.222839f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.356397f,0.851081f,0.385542f}, -{0.282941f,0.879788f,0.381992f}, -{0.495485f,0.585601f,0.641534f}, -{0.000368f,0.101015f,-0.994885f}, -{-0.732186f,0.093289f,-0.674685f}, -{-0.009330f,0.026474f,-0.999606f}, -{0.000368f,0.101015f,-0.994885f}, -{-0.753084f,0.217457f,-0.620949f}, -{-0.732186f,0.093289f,-0.674685f}, -{0.165505f,0.112084f,-0.979819f}, -{-0.489190f,0.364342f,-0.792432f}, -{0.000368f,0.101015f,-0.994885f}, -{0.000368f,0.101015f,-0.994885f}, -{-0.489190f,0.364342f,-0.792432f}, -{-0.753084f,0.217457f,-0.620949f}, -{-0.160436f,0.526272f,-0.835044f}, -{0.113449f,0.132333f,-0.984691f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.356397f,0.851081f,0.385542f}, -{0.289826f,0.746379f,0.599099f}, -{0.213363f,0.870099f,0.444302f}, -{0.213363f,0.870099f,0.444302f}, -{0.289826f,0.746379f,0.599099f}, -{0.115037f,0.723134f,0.681061f}, -{0.420713f,0.463778f,0.779686f}, -{0.356397f,0.851081f,0.385542f}, -{0.495485f,0.585601f,0.641534f}, -{0.420713f,0.463778f,0.779686f}, -{0.289826f,0.746379f,0.599099f}, -{0.356397f,0.851081f,0.385542f}, -{0.420713f,0.463778f,0.779686f}, -{0.115037f,0.723134f,0.681061f}, -{0.289826f,0.746379f,0.599099f}, -{0.536734f,-0.145434f,-0.831123f}, -{-0.489190f,0.364342f,-0.792432f}, -{0.165505f,0.112084f,-0.979819f}, -{0.536734f,-0.145434f,-0.831123f}, -{0.015366f,0.312552f,-0.949776f}, -{-0.489190f,0.364342f,-0.792432f}, -{0.113449f,0.132333f,-0.984691f}, -{-0.160436f,0.526272f,-0.835044f}, -{0.149477f,-0.160720f,-0.975615f}, -{0.149477f,-0.160720f,-0.975615f}, -{-0.160436f,0.526272f,-0.835044f}, -{0.015366f,0.312552f,-0.949776f}, -{-0.095328f,-0.237646f,-0.966663f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.113449f,0.132333f,-0.984691f}, -{0.113449f,0.132333f,-0.984691f}, -{0.031226f,-0.207174f,-0.977806f}, -{-0.095328f,-0.237646f,-0.966663f}, -{0.638570f,-0.380460f,-0.668939f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.031226f,-0.207174f,-0.977806f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.638570f,-0.380460f,-0.668939f}, -{0.692544f,0.674674f,0.255337f}, -{-0.095328f,-0.237646f,-0.966663f}, -{0.031226f,-0.207174f,-0.977806f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.390828f,-0.239009f,-0.888892f}, -{0.015366f,0.312552f,-0.949776f}, -{0.536734f,-0.145434f,-0.831123f}, -{0.149477f,-0.160720f,-0.975615f}, -{0.015366f,0.312552f,-0.949776f}, -{0.390828f,-0.239009f,-0.888892f}, -{0.420713f,0.463778f,0.779686f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.031226f,-0.207174f,-0.977806f}, -{0.420713f,0.463778f,0.779686f}, -{0.692544f,0.674674f,0.255337f}, -{0.638570f,-0.380460f,-0.668939f}, -{-0.013651f,0.267781f,-0.963383f}, -{0.420713f,0.463778f,0.779686f}, -{0.638570f,-0.380460f,-0.668939f}, -{0.287673f,0.507493f,0.812216f}, -{0.115037f,0.723134f,0.681061f}, -{0.113449f,0.132333f,-0.984691f}, -{0.115037f,0.723134f,0.681061f}, -{0.420713f,0.463778f,0.779686f}, -{0.031226f,-0.207174f,-0.977806f}, -{0.031226f,-0.207174f,-0.977806f}, -{0.113449f,0.132333f,-0.984691f}, -{0.115037f,0.723134f,0.681061f}, -{0.670641f,0.006062f,-0.741757f}, -{0.042255f,0.119108f,-0.991982f}, -{0.756764f,0.013200f,-0.653555f}, -{0.670641f,0.006062f,-0.741757f}, -{-0.009330f,0.026474f,-0.999606f}, -{0.042255f,0.119108f,-0.991982f}, -{0.731140f,-0.030964f,-0.681525f}, -{0.000368f,0.101015f,-0.994885f}, -{0.670641f,0.006062f,-0.741757f}, -{0.670641f,0.006062f,-0.741757f}, -{0.000368f,0.101015f,-0.994885f}, -{-0.009330f,0.026474f,-0.999606f}, -{0.756383f,0.012930f,-0.654002f}, -{0.000368f,0.101015f,-0.994885f}, -{0.731140f,-0.030964f,-0.681525f}, -{0.756383f,0.012930f,-0.654002f}, -{0.165505f,0.112084f,-0.979819f}, -{0.000368f,0.101015f,-0.994885f}, -{0.853969f,-0.265216f,-0.447658f}, -{0.536734f,-0.145434f,-0.831123f}, -{0.756383f,0.012930f,-0.654002f}, -{0.756383f,0.012930f,-0.654002f}, -{0.536734f,-0.145434f,-0.831123f}, -{0.165505f,0.112084f,-0.979819f}, -{0.728545f,-0.669331f,0.145667f}, -{0.113449f,0.132333f,-0.984691f}, -{0.300398f,-0.631217f,-0.715071f}, -{0.300398f,-0.631217f,-0.715071f}, -{0.113449f,0.132333f,-0.984691f}, -{0.149477f,-0.160720f,-0.975615f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.031226f,-0.207174f,-0.977806f}, -{0.113449f,0.132333f,-0.984691f}, -{0.113449f,0.132333f,-0.984691f}, -{0.728545f,-0.669331f,0.145667f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.228623f,-0.362769f,-0.903399f}, -{0.031226f,-0.207174f,-0.977806f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.031226f,-0.207174f,-0.977806f}, -{0.228623f,-0.362769f,-0.903399f}, -{0.638570f,-0.380460f,-0.668939f}, -{0.993281f,-0.050399f,-0.104180f}, -{0.670641f,0.006062f,-0.741757f}, -{0.991736f,-0.022423f,0.126318f}, -{0.991736f,-0.022423f,0.126318f}, -{0.670641f,0.006062f,-0.741757f}, -{0.756764f,0.013200f,-0.653555f}, -{0.992445f,-0.006490f,-0.122517f}, -{0.731140f,-0.030964f,-0.681525f}, -{0.993281f,-0.050399f,-0.104180f}, -{0.993281f,-0.050399f,-0.104180f}, -{0.731140f,-0.030964f,-0.681525f}, -{0.670641f,0.006062f,-0.741757f}, -{0.989261f,-0.125403f,-0.075082f}, -{0.756383f,0.012930f,-0.654002f}, -{0.992445f,-0.006490f,-0.122517f}, -{0.992445f,-0.006490f,-0.122517f}, -{0.756383f,0.012930f,-0.654002f}, -{0.731140f,-0.030964f,-0.681525f}, -{0.900619f,-0.419869f,-0.112231f}, -{0.853969f,-0.265216f,-0.447658f}, -{0.989261f,-0.125403f,-0.075082f}, -{0.989261f,-0.125403f,-0.075082f}, -{0.853969f,-0.265216f,-0.447658f}, -{0.756383f,0.012930f,-0.654002f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.536734f,-0.145434f,-0.831123f}, -{0.900619f,-0.419869f,-0.112231f}, -{0.900619f,-0.419869f,-0.112231f}, -{0.536734f,-0.145434f,-0.831123f}, -{0.853969f,-0.265216f,-0.447658f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.390828f,-0.239009f,-0.888892f}, -{0.536734f,-0.145434f,-0.831123f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.149477f,-0.160720f,-0.975615f}, -{0.390828f,-0.239009f,-0.888892f}, -{0.286696f,-0.954926f,-0.076954f}, -{0.300398f,-0.631217f,-0.715071f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.300398f,-0.631217f,-0.715071f}, -{0.149477f,-0.160720f,-0.975615f}, -{0.166013f,-0.980090f,-0.108918f}, -{0.728545f,-0.669331f,0.145667f}, -{0.286696f,-0.954926f,-0.076954f}, -{0.286696f,-0.954926f,-0.076954f}, -{0.728545f,-0.669331f,0.145667f}, -{0.300398f,-0.631217f,-0.715071f}, -{0.166013f,-0.980090f,-0.108918f}, -{-0.058265f,-0.998112f,-0.019421f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.728545f,-0.669331f,0.145667f}, -{0.166013f,-0.980090f,-0.108918f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.849845f,-0.527033f,0.000431f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.900619f,-0.419869f,-0.112231f}, -{0.286696f,-0.954926f,-0.076954f}, -{0.711462f,-0.546075f,-0.442293f}, -{0.713482f,-0.698031f,0.060801f}, -{0.053441f,-0.926371f,0.372801f}, -{0.318728f,-0.924816f,-0.207674f}, -{-0.058265f,-0.998112f,-0.019421f}, -{0.318728f,-0.924816f,-0.207674f}, -{0.053441f,-0.926371f,0.372801f}, -{0.228623f,-0.362769f,-0.903399f}, -{0.998986f,-0.041054f,0.018474f}, -{0.414669f,0.339052f,0.844449f}, -{0.677379f,0.169613f,0.715813f}, -{0.414669f,0.339052f,0.844449f}, -{-0.148039f,0.454733f,0.878238f}, -{0.084648f,0.310344f,0.946848f}, -{-0.148039f,0.454733f,0.878238f}, -{-0.402786f,0.530606f,0.745802f}, -{-0.820035f,0.215202f,0.530313f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.571566f,0.341734f,-0.746010f}, -{-0.726149f,0.143539f,-0.672387f}, -{-0.571566f,0.341734f,-0.746010f}, -{-0.092026f,0.015743f,-0.995632f}, -{0.042255f,0.119108f,-0.991982f}, -{-0.092026f,0.015743f,-0.995632f}, -{0.585771f,-0.102870f,-0.803922f}, -{0.756764f,0.013200f,-0.653555f}, -{0.585771f,-0.102870f,-0.803922f}, -{0.998986f,-0.041054f,0.018474f}, -{0.756764f,0.013200f,-0.653555f}, -{0.135575f,0.967464f,0.213620f}, -{0.098032f,0.964604f,0.244805f}, -{0.282941f,0.879788f,0.381992f}, -{-0.058113f,0.949457f,0.308470f}, -{-0.228362f,0.861117f,0.454234f}, -{-0.176836f,0.958998f,0.221477f}, -{-0.228362f,0.861117f,0.454234f}, -{-0.321627f,0.659738f,0.679192f}, -{-0.529356f,0.588430f,0.611173f}, -{-0.321627f,0.659738f,0.679192f}, -{-0.334198f,0.410925f,0.848205f}, -{-0.298963f,0.372674f,0.878485f}, -{-0.334198f,0.410925f,0.848205f}, -{-0.382842f,0.339600f,0.859130f}, -{-0.313337f,0.085931f,0.945746f}, -{-0.382842f,0.339600f,0.859130f}, -{-0.370077f,-0.091471f,0.924487f}, -{-0.313337f,0.085931f,0.945746f}, -{0.677379f,0.169613f,0.715813f}, -{0.991736f,-0.022423f,0.126318f}, -{0.998986f,-0.041054f,0.018474f}, -{0.084648f,0.310344f,0.946848f}, -{0.677379f,0.169613f,0.715813f}, -{0.414669f,0.339052f,0.844449f}, -{-0.129625f,-0.629575f,0.766050f}, -{-0.173549f,-0.262745f,0.949129f}, -{0.085830f,-0.307324f,0.947726f}, -{-0.173549f,-0.262745f,0.949129f}, -{-0.313337f,0.085931f,0.945746f}, -{-0.370077f,-0.091471f,0.924487f}, -{-0.313337f,0.085931f,0.945746f}, -{-0.298963f,0.372674f,0.878485f}, -{-0.334198f,0.410925f,0.848205f}, -{-0.820035f,0.215202f,0.530313f}, -{0.084648f,0.310344f,0.946848f}, -{-0.148039f,0.454733f,0.878238f}, -{-0.529356f,0.588430f,0.611173f}, -{-0.176836f,0.958998f,0.221477f}, -{-0.228362f,0.861117f,0.454234f}, -{-0.965616f,0.103795f,-0.238352f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.726149f,0.143539f,-0.672387f}, -{0.061960f,0.962691f,0.263414f}, -{0.282941f,0.879788f,0.381992f}, -{0.098032f,0.964604f,0.244805f}, -{0.282941f,0.879788f,0.381992f}, -{0.356397f,0.851081f,0.385542f}, -{0.135575f,0.967464f,0.213620f}, -{0.042255f,0.119108f,-0.991982f}, -{-0.726149f,0.143539f,-0.672387f}, -{-0.571566f,0.341734f,-0.746010f}, -{0.213363f,0.870099f,0.444302f}, -{0.267882f,0.921692f,0.280576f}, -{0.356397f,0.851081f,0.385542f}, -{0.756764f,0.013200f,-0.653555f}, -{0.042255f,0.119108f,-0.991982f}, -{-0.092026f,0.015743f,-0.995632f}, -{0.991736f,-0.022423f,0.126318f}, -{0.756764f,0.013200f,-0.653555f}, -{0.998986f,-0.041054f,0.018474f}, -{-0.820035f,0.215202f,0.530313f}, -{-0.402786f,0.530606f,0.745802f}, -{-0.940879f,0.334753f,0.051831f}, -{0.115037f,0.723134f,0.681061f}, -{-0.043041f,0.825406f,0.562896f}, -{0.213363f,0.870099f,0.444302f}, -{0.061960f,0.962691f,0.263414f}, -{-0.058113f,0.949457f,0.308470f}, -{-0.176836f,0.958998f,0.221477f}, -{-0.321627f,0.659738f,0.679192f}, -{-0.298963f,0.372674f,0.878485f}, -{-0.529356f,0.588430f,0.611173f}, -{-0.082479f,-0.124314f,-0.988809f}, -{0.063165f,-0.217624f,-0.973987f}, -{-0.603162f,-0.412592f,-0.682616f}, -{-0.603162f,-0.412592f,-0.682616f}, -{-0.652896f,-0.384826f,-0.652408f}, -{-0.082479f,-0.124314f,-0.988809f}, -{-0.082479f,-0.124314f,-0.988809f}, -{-0.008657f,-0.284713f,-0.958574f}, -{0.063165f,-0.217624f,-0.973987f}, -{0.488229f,-0.233882f,-0.840792f}, -{0.585771f,-0.102870f,-0.803922f}, -{-0.092026f,0.015743f,-0.995632f}, -{0.063165f,-0.217624f,-0.973987f}, -{0.488229f,-0.233882f,-0.840792f}, -{-0.092026f,0.015743f,-0.995632f}, -{-0.008657f,-0.284713f,-0.958574f}, -{0.488229f,-0.233882f,-0.840792f}, -{0.063165f,-0.217624f,-0.973987f}, -{0.252834f,-0.236691f,-0.938111f}, -{0.715267f,0.435709f,-0.546398f}, -{-0.652896f,-0.384826f,-0.652408f}, -{0.488229f,-0.233882f,-0.840792f}, -{0.998986f,-0.041054f,0.018474f}, -{0.585771f,-0.102870f,-0.803922f}, -{0.359159f,-0.071660f,-0.930521f}, -{-0.082479f,-0.124314f,-0.988809f}, -{0.207102f,-0.054878f,-0.976779f}, -{-0.082479f,-0.124314f,-0.988809f}, -{0.359159f,-0.071660f,-0.930521f}, -{-0.008657f,-0.284713f,-0.958574f}, -{-0.082479f,-0.124314f,-0.988809f}, -{-0.652896f,-0.384826f,-0.652408f}, -{0.207102f,-0.054878f,-0.976779f}, -{-0.652896f,-0.384826f,-0.652408f}, -{0.715267f,0.435709f,-0.546398f}, -{-0.485875f,0.322781f,-0.812242f}, -{0.488229f,-0.233882f,-0.840792f}, -{0.923325f,-0.045392f,0.381328f}, -{0.998986f,-0.041054f,0.018474f}, -{0.488229f,-0.233882f,-0.840792f}, -{-0.008657f,-0.284713f,-0.958574f}, -{0.923325f,-0.045392f,0.381328f}, -{-0.485875f,0.322781f,-0.812242f}, -{0.207102f,-0.054878f,-0.976779f}, -{-0.652896f,-0.384826f,-0.652408f}, -{0.271688f,-0.209927f,0.939211f}, -{0.923325f,-0.045392f,0.381328f}, -{-0.008657f,-0.284713f,-0.958574f}, -{-0.485875f,0.322781f,-0.812242f}, -{-0.652896f,-0.384826f,-0.652408f}, -{-0.929057f,0.250064f,0.272619f}, -{-0.929057f,0.250064f,0.272619f}, -{-0.652896f,-0.384826f,-0.652408f}, -{-0.797014f,0.041121f,0.602559f}, -{-0.652896f,-0.384826f,-0.652408f}, -{-0.485875f,0.322781f,-0.812242f}, -{-0.195533f,0.844067f,-0.499317f}, -{0.998986f,-0.041054f,0.018474f}, -{0.923325f,-0.045392f,0.381328f}, -{0.414669f,0.339052f,0.844449f}, -{0.715267f,0.435709f,-0.546398f}, -{-0.195533f,0.844067f,-0.499317f}, -{-0.485875f,0.322781f,-0.812242f}, -{-0.236733f,0.073606f,0.968783f}, -{0.414669f,0.339052f,0.844449f}, -{0.923325f,-0.045392f,0.381328f}, -{0.414669f,0.339052f,0.844449f}, -{-0.236733f,0.073606f,0.968783f}, -{-0.148039f,0.454733f,0.878238f}, -{-0.214278f,0.219313f,0.951833f}, -{0.271688f,-0.209927f,0.939211f}, -{0.502129f,0.255443f,0.826205f}, -{-0.124403f,0.480106f,0.868344f}, -{-0.214278f,0.219313f,0.951833f}, -{0.502129f,0.255443f,0.826205f}, -{-0.797014f,0.041121f,0.602559f}, -{-0.124403f,0.480106f,0.868344f}, -{-0.929057f,0.250064f,0.272619f}, -{-0.214278f,0.219313f,0.951833f}, -{-0.124403f,0.480106f,0.868344f}, -{-0.797014f,0.041121f,0.602559f}, -{-0.797014f,0.041121f,0.602559f}, -{-0.652896f,-0.384826f,-0.652408f}, -{-0.195533f,0.844067f,-0.499317f}, -{-0.236733f,0.073606f,0.968783f}, -{0.923325f,-0.045392f,0.381328f}, -{0.271688f,-0.209927f,0.939211f}, -{0.271688f,-0.209927f,0.939211f}, -{-0.214278f,0.219313f,0.951833f}, -{-0.236733f,0.073606f,0.968783f}, -{0.252834f,-0.236691f,-0.938111f}, -{-0.195533f,0.844067f,-0.499317f}, -{0.715267f,0.435709f,-0.546398f}, -{-0.148039f,0.454733f,0.878238f}, -{-0.236733f,0.073606f,0.968783f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.797014f,0.041121f,0.602559f}, -{-0.236733f,0.073606f,0.968783f}, -{-0.214278f,0.219313f,0.951833f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.236733f,0.073606f,0.968783f}, -{-0.926643f,-0.282984f,0.247491f}, -{-0.797014f,0.041121f,0.602559f}, -{-0.926643f,-0.282984f,0.247491f}, -{-0.236733f,0.073606f,0.968783f}, -{-0.652896f,-0.384826f,-0.652408f}, -{-0.926643f,-0.282984f,0.247491f}, -{-0.797014f,0.041121f,0.602559f}, -{-0.652896f,-0.384826f,-0.652408f}, -{-0.603162f,-0.412592f,-0.682616f}, -{-0.926643f,-0.282984f,0.247491f}, -{-0.195533f,0.844067f,-0.499317f}, -{0.252834f,-0.236691f,-0.938111f}, -{-0.652896f,-0.384826f,-0.652408f}, -{-0.092026f,0.015743f,-0.995632f}, -{-0.603162f,-0.412592f,-0.682616f}, -{0.063165f,-0.217624f,-0.973987f}, -{-0.603162f,-0.412592f,-0.682616f}, -{-0.092026f,0.015743f,-0.995632f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.926643f,-0.282984f,0.247491f}, -{-0.603162f,-0.412592f,-0.682616f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.148039f,0.454733f,0.878238f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.402786f,0.530606f,0.745802f}, -{-0.940879f,0.334753f,0.051831f}, -{-0.092026f,0.015743f,-0.995632f}, -{-0.571566f,0.341734f,-0.746010f}, -{0.943895f,-0.083144f,0.319609f}, -{0.502129f,0.255443f,0.826205f}, -{0.271688f,-0.209927f,0.939211f}, -{-0.124403f,0.480106f,0.868344f}, -{0.207102f,-0.054878f,-0.976779f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.929057f,0.250064f,0.272619f}, -{-0.124403f,0.480106f,0.868344f}, -{-0.698819f,0.671416f,0.246683f}, -{-0.698819f,0.671416f,0.246683f}, -{-0.124403f,0.480106f,0.868344f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.698819f,0.671416f,0.246683f}, -{-0.485875f,0.322781f,-0.812242f}, -{-0.929057f,0.250064f,0.272619f}, -{-0.456617f,0.884616f,0.094629f}, -{0.060396f,0.883178f,-0.465132f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.631285f,0.736281f,-0.243659f}, -{-0.456617f,0.884616f,0.094629f}, -{0.060396f,0.883178f,-0.465132f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.456617f,0.884616f,0.094629f}, -{-0.698819f,0.671416f,0.246683f}, -{-0.698819f,0.671416f,0.246683f}, -{-0.456617f,0.884616f,0.094629f}, -{-0.881965f,0.471315f,0.000469f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.456617f,0.884616f,0.094629f}, -{0.207102f,-0.054878f,-0.976779f}, -{-0.485875f,0.322781f,-0.812242f}, -{0.017919f,0.992644f,-0.119740f}, -{0.207102f,-0.054878f,-0.976779f}, -{-0.485875f,0.322781f,-0.812242f}, -{-0.698819f,0.671416f,0.246683f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.578365f,0.813992f,-0.053954f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.367095f,0.920895f,0.131122f}, -{0.359159f,-0.071660f,-0.930521f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.367095f,0.920895f,0.131122f}, -{0.502129f,0.255443f,0.826205f}, -{0.359159f,-0.071660f,-0.930521f}, -{-0.367095f,0.920895f,0.131122f}, -{-0.083840f,0.561957f,0.822906f}, -{0.502129f,0.255443f,0.826205f}, -{-0.367095f,0.920895f,0.131122f}, -{-0.367095f,0.920895f,0.131122f}, -{-0.404940f,0.622606f,0.669616f}, -{-0.083840f,0.561957f,0.822906f}, -{-0.404940f,0.622606f,0.669616f}, -{-0.367095f,0.920895f,0.131122f}, -{0.017919f,0.992644f,-0.119740f}, -{0.359159f,-0.071660f,-0.930521f}, -{0.207102f,-0.054878f,-0.976779f}, -{0.017919f,0.992644f,-0.119740f}, -{-0.083840f,0.561957f,0.822906f}, -{-0.124403f,0.480106f,0.868344f}, -{0.502129f,0.255443f,0.826205f}, -{-0.404940f,0.622606f,0.669616f}, -{-0.124403f,0.480106f,0.868344f}, -{-0.083840f,0.561957f,0.822906f}, -{-0.124403f,0.480106f,0.868344f}, -{-0.404940f,0.622606f,0.669616f}, -{0.017919f,0.992644f,-0.119740f}, -{0.943895f,-0.083144f,0.319609f}, -{-0.008657f,-0.284713f,-0.958574f}, -{0.359159f,-0.071660f,-0.930521f}, -{-0.515950f,-0.597013f,-0.614305f}, -{0.413933f,-0.902597f,-0.118231f}, -{0.502129f,0.255443f,0.826205f}, -{0.359159f,-0.071660f,-0.930521f}, -{0.502129f,0.255443f,0.826205f}, -{0.943895f,-0.083144f,0.319609f}, -{0.502129f,0.255443f,0.826205f}, -{0.359159f,-0.071660f,-0.930521f}, -{-0.515950f,-0.597013f,-0.614305f}, -{-0.367095f,0.920895f,0.131122f}, -{-0.817381f,-0.561716f,0.127917f}, -{-0.791704f,-0.424893f,-0.438942f}, -{-0.791704f,-0.424893f,-0.438942f}, -{-0.817381f,-0.561716f,0.127917f}, -{-0.515950f,-0.597013f,-0.614305f}, -{-0.791704f,-0.424893f,-0.438942f}, -{0.359159f,-0.071660f,-0.930521f}, -{-0.367095f,0.920895f,0.131122f}, -{0.359159f,-0.071660f,-0.930521f}, -{-0.791704f,-0.424893f,-0.438942f}, -{-0.515950f,-0.597013f,-0.614305f}, -{-0.552023f,-0.815259f,-0.174998f}, -{-0.008657f,-0.284713f,-0.958574f}, -{-0.515950f,-0.597013f,-0.614305f}, -{0.359159f,-0.071660f,-0.930521f}, -{-0.515950f,-0.597013f,-0.614305f}, -{-0.008657f,-0.284713f,-0.958574f}, -{0.943895f,-0.083144f,0.319609f}, -{-0.552023f,-0.815259f,-0.174998f}, -{-0.515950f,-0.597013f,-0.614305f}, -{0.943895f,-0.083144f,0.319609f}, -{-0.515950f,-0.597013f,-0.614305f}, -{0.413933f,-0.902597f,-0.118231f}, -{-0.515950f,-0.597013f,-0.614305f}, -{0.359159f,-0.071660f,-0.930521f}, -{0.943895f,-0.083144f,0.319609f}, -{0.943895f,-0.083144f,0.319609f}, -{-0.008657f,-0.284713f,-0.958574f}, -{-0.552023f,-0.815259f,-0.174998f}, -{-0.008657f,-0.284713f,-0.958574f}, -{-0.552023f,-0.815259f,-0.174998f}, -{0.271688f,-0.209927f,0.939211f}, -{0.943895f,-0.083144f,0.319609f}, -{0.271688f,-0.209927f,0.939211f}, -{-0.552023f,-0.815259f,-0.174998f}, -{0.117155f,0.955892f,0.269343f}, -{0.222328f,0.928824f,0.296407f}, -{0.430884f,0.865455f,0.255590f}, -{0.117155f,0.955892f,0.269343f}, -{-0.164629f,0.921121f,-0.352752f}, -{0.222328f,0.928824f,0.296407f}, -{-0.164629f,0.921121f,-0.352752f}, -{0.117155f,0.955892f,0.269343f}, -{-0.548609f,0.702264f,0.453711f}, -{-0.562847f,0.006894f,-0.826533f}, -{-0.164629f,0.921121f,-0.352752f}, -{-0.548609f,0.702264f,0.453711f}, -{-0.548609f,0.702264f,0.453711f}, -{-0.848249f,-0.257559f,0.462749f}, -{-0.562847f,0.006894f,-0.826533f}, -{-0.548609f,0.702264f,0.453711f}, -{0.117155f,0.955892f,0.269343f}, -{-0.329259f,0.449023f,0.830642f}, -{-0.548609f,0.702264f,0.453711f}, -{-0.648301f,0.066617f,0.758465f}, -{-0.848249f,-0.257559f,0.462749f}, -{-0.329259f,0.449023f,0.830642f}, -{-0.679288f,0.294342f,0.672258f}, -{-0.548609f,0.702264f,0.453711f}, -{-0.648301f,0.066617f,0.758465f}, -{-0.548609f,0.702264f,0.453711f}, -{-0.679288f,0.294342f,0.672258f}, -{0.149035f,0.415524f,0.897290f}, -{-0.092537f,0.267623f,0.959070f}, -{-0.329259f,0.449023f,0.830642f}, -{-0.329259f,0.449023f,0.830642f}, -{-0.092537f,0.267623f,0.959070f}, -{-0.340947f,0.077736f,0.936863f}, -{-0.679288f,0.294342f,0.672258f}, -{-0.329259f,0.449023f,0.830642f}, -{-0.340947f,0.077736f,0.936863f}, -{-0.648301f,0.066617f,0.758465f}, -{-0.679288f,0.294342f,0.672258f}, -{-0.340947f,0.077736f,0.936863f}, -{0.192348f,0.279380f,0.940717f}, -{0.149035f,0.415524f,0.897290f}, -{0.205985f,0.284205f,0.936375f}, -{0.192348f,0.279380f,0.940717f}, -{-0.092537f,0.267623f,0.959070f}, -{0.149035f,0.415524f,0.897290f}, -{-0.182422f,-0.095195f,0.978601f}, -{-0.648301f,0.066617f,0.758465f}, -{-0.340947f,0.077736f,0.936863f}, -{-0.316714f,-0.098371f,0.943406f}, -{-0.848249f,-0.257559f,0.462749f}, -{-0.648301f,0.066617f,0.758465f}, -{-0.648301f,0.066617f,0.758465f}, -{-0.182422f,-0.095195f,0.978601f}, -{-0.316714f,-0.098371f,0.943406f}, -{0.192348f,0.279380f,0.940717f}, -{0.191387f,0.118163f,0.974376f}, -{-0.092537f,0.267623f,0.959070f}, -{-0.340947f,0.077736f,0.936863f}, -{-0.092537f,0.267623f,0.959070f}, -{0.191387f,0.118163f,0.974376f}, -{0.191387f,0.118163f,0.974376f}, -{0.207239f,-0.116274f,0.971356f}, -{-0.340947f,0.077736f,0.936863f}, -{0.217805f,-0.124169f,0.968062f}, -{-0.182422f,-0.095195f,0.978601f}, -{0.207239f,-0.116274f,0.971356f}, -{0.207239f,-0.116274f,0.971356f}, -{-0.182422f,-0.095195f,0.978601f}, -{-0.340947f,0.077736f,0.936863f}, -{0.110990f,0.007382f,0.993794f}, -{-0.316714f,-0.098371f,0.943406f}, -{-0.182422f,-0.095195f,0.978601f}, -{-0.182422f,-0.095195f,0.978601f}, -{0.217805f,-0.124169f,0.968062f}, -{0.110990f,0.007382f,0.993794f}, -{0.423686f,-0.005740f,0.905791f}, -{0.191387f,0.118163f,0.974376f}, -{0.340456f,0.148097f,0.928524f}, -{0.340456f,0.148097f,0.928524f}, -{0.191387f,0.118163f,0.974376f}, -{0.192348f,0.279380f,0.940717f}, -{0.423686f,-0.005740f,0.905791f}, -{0.207239f,-0.116274f,0.971356f}, -{0.191387f,0.118163f,0.974376f}, -{0.699403f,0.167149f,0.694908f}, -{0.423686f,-0.005740f,0.905791f}, -{0.497283f,0.178068f,0.849118f}, -{0.497283f,0.178068f,0.849118f}, -{0.423686f,-0.005740f,0.905791f}, -{0.340456f,0.148097f,0.928524f}, -{0.669948f,-0.177201f,0.720951f}, -{0.423686f,-0.005740f,0.905791f}, -{0.699403f,0.167149f,0.694908f}, -{0.423686f,-0.005740f,0.905791f}, -{0.669948f,-0.177201f,0.720951f}, -{0.207239f,-0.116274f,0.971356f}, -{0.574724f,-0.087039f,0.813706f}, -{0.207239f,-0.116274f,0.971356f}, -{0.669948f,-0.177201f,0.720951f}, -{0.207239f,-0.116274f,0.971356f}, -{0.574724f,-0.087039f,0.813706f}, -{0.217805f,-0.124169f,0.968062f}, -{0.532600f,0.170685f,0.828977f}, -{0.217805f,-0.124169f,0.968062f}, -{0.574724f,-0.087039f,0.813706f}, -{0.217805f,-0.124169f,0.968062f}, -{0.532600f,0.170685f,0.828977f}, -{0.110990f,0.007382f,0.993794f}, -{0.699403f,0.167149f,0.694908f}, -{0.497283f,0.178068f,0.849118f}, -{0.708291f,0.192457f,0.679179f}, -{0.669948f,-0.177201f,0.720951f}, -{0.936542f,0.200793f,0.287354f}, -{0.574724f,-0.087039f,0.813706f}, -{0.880685f,0.301175f,0.365632f}, -{0.574724f,-0.087039f,0.813706f}, -{0.936542f,0.200793f,0.287354f}, -{0.574724f,-0.087039f,0.813706f}, -{0.880685f,0.301175f,0.365632f}, -{0.532600f,0.170685f,0.828977f}, -{0.708291f,0.192457f,0.679179f}, -{0.818805f,0.324094f,0.473837f}, -{0.827430f,0.318705f,0.462371f}, -{0.699403f,0.167149f,0.694908f}, -{0.708291f,0.192457f,0.679179f}, -{0.827430f,0.318705f,0.462371f}, -{0.944621f,0.317956f,-0.081206f}, -{0.960131f,-0.115252f,0.254686f}, -{0.669948f,-0.177201f,0.720951f}, -{0.699403f,0.167149f,0.694908f}, -{0.827430f,0.318705f,0.462371f}, -{0.944621f,0.317956f,-0.081206f}, -{0.669948f,-0.177201f,0.720951f}, -{0.699403f,0.167149f,0.694908f}, -{0.944621f,0.317956f,-0.081206f}, -{0.669948f,-0.177201f,0.720951f}, -{0.960131f,-0.115252f,0.254686f}, -{0.936542f,0.200793f,0.287354f}, -{0.658963f,0.309216f,-0.685677f}, -{0.960131f,-0.115252f,0.254686f}, -{0.944621f,0.317956f,-0.081206f}, -{0.960131f,-0.115252f,0.254686f}, -{0.658963f,0.309216f,-0.685677f}, -{0.936542f,0.200793f,0.287354f}, -{0.880685f,0.301175f,0.365632f}, -{0.936542f,0.200793f,0.287354f}, -{0.802815f,0.408657f,-0.434152f}, -{0.936542f,0.200793f,0.287354f}, -{0.658963f,0.309216f,-0.685677f}, -{0.802815f,0.408657f,-0.434152f}, -{0.818805f,0.324094f,0.473837f}, -{0.828419f,0.545369f,0.127650f}, -{0.827430f,0.318705f,0.462371f}, -{0.828419f,0.545369f,0.127650f}, -{0.818805f,0.324094f,0.473837f}, -{0.910755f,0.278726f,0.304691f}, -{0.944621f,0.317956f,-0.081206f}, -{0.827430f,0.318705f,0.462371f}, -{0.828419f,0.545369f,0.127650f}, -{0.385960f,0.714582f,-0.583444f}, -{0.658963f,0.309216f,-0.685677f}, -{0.944621f,0.317956f,-0.081206f}, -{0.838981f,0.354286f,-0.413029f}, -{0.880685f,0.301175f,0.365632f}, -{0.802815f,0.408657f,-0.434152f}, -{0.880685f,0.301175f,0.365632f}, -{0.838981f,0.354286f,-0.413029f}, -{0.881510f,0.445674f,0.155930f}, -{0.828419f,0.545369f,0.127650f}, -{0.611084f,0.776183f,0.155293f}, -{0.385960f,0.714582f,-0.583444f}, -{0.385960f,0.714582f,-0.583444f}, -{0.944621f,0.317956f,-0.081206f}, -{0.828419f,0.545369f,0.127650f}, -{0.658963f,0.309216f,-0.685677f}, -{0.344945f,0.229757f,-0.910069f}, -{0.802815f,0.408657f,-0.434152f}, -{0.538352f,0.183130f,-0.822581f}, -{0.838981f,0.354286f,-0.413029f}, -{0.344945f,0.229757f,-0.910069f}, -{0.344945f,0.229757f,-0.910069f}, -{0.838981f,0.354286f,-0.413029f}, -{0.802815f,0.408657f,-0.434152f}, -{0.611084f,0.776183f,0.155293f}, -{0.449200f,0.852911f,0.266011f}, -{0.385960f,0.714582f,-0.583444f}, -{0.273760f,0.685970f,-0.674167f}, -{0.658963f,0.309216f,-0.685677f}, -{0.385960f,0.714582f,-0.583444f}, -{0.344945f,0.229757f,-0.910069f}, -{0.658963f,0.309216f,-0.685677f}, -{0.273760f,0.685970f,-0.674167f}, -{0.464427f,0.885444f,0.017201f}, -{0.385960f,0.714582f,-0.583444f}, -{0.449200f,0.852911f,0.266011f}, -{0.273760f,0.685970f,-0.674167f}, -{0.323219f,0.936774f,-0.134107f}, -{0.464427f,0.885444f,0.017201f}, -{0.464427f,0.885444f,0.017201f}, -{0.323219f,0.936774f,-0.134107f}, -{0.385960f,0.714582f,-0.583444f}, -{0.273760f,0.685970f,-0.674167f}, -{0.385960f,0.714582f,-0.583444f}, -{0.323219f,0.936774f,-0.134107f}, -{-0.164629f,0.921121f,-0.352752f}, -{0.273760f,0.685970f,-0.674167f}, -{0.222328f,0.928824f,0.296407f}, -{0.222328f,0.928824f,0.296407f}, -{0.273760f,0.685970f,-0.674167f}, -{0.338569f,0.794483f,0.504150f}, -{0.338569f,0.794483f,0.504150f}, -{0.273760f,0.685970f,-0.674167f}, -{0.464427f,0.885444f,0.017201f}, -{0.273760f,0.685970f,-0.674167f}, -{-0.164629f,0.921121f,-0.352752f}, -{-0.562847f,0.006894f,-0.826533f}, -{0.344945f,0.229757f,-0.910069f}, -{0.273760f,0.685970f,-0.674167f}, -{-0.562847f,0.006894f,-0.826533f}, -{-0.548609f,0.702264f,0.453711f}, -{0.208222f,0.491946f,0.845360f}, -{-0.329259f,0.449023f,0.830642f}, -{0.208222f,0.491946f,0.845360f}, -{0.257029f,0.521014f,0.813929f}, -{-0.329259f,0.449023f,0.830642f}, -{0.257029f,0.521014f,0.813929f}, -{0.289593f,0.427276f,0.856488f}, -{0.149035f,0.415524f,0.897290f}, -{0.210996f,0.179609f,0.960844f}, -{0.307422f,0.250640f,0.917971f}, -{0.192348f,0.279380f,0.940717f}, -{0.307422f,0.250640f,0.917971f}, -{0.439946f,0.175781f,0.880652f}, -{0.497283f,0.178068f,0.849118f}, -{0.439946f,0.175781f,0.880652f}, -{0.547075f,0.225477f,0.806145f}, -{0.497283f,0.178068f,0.849118f}, -{0.547075f,0.225477f,0.806145f}, -{0.676305f,0.266081f,0.686886f}, -{0.708291f,0.192457f,0.679179f}, -{0.676305f,0.266081f,0.686886f}, -{0.789740f,0.237525f,0.565590f}, -{0.818805f,0.324094f,0.473837f}, -{0.789740f,0.237525f,0.565590f}, -{0.812721f,0.298228f,0.500545f}, -{0.818805f,0.324094f,0.473837f}, -{-0.350539f,-0.164048f,-0.922069f}, -{0.538352f,0.183130f,-0.822581f}, -{-0.562847f,0.006894f,-0.826533f}, -{0.902613f,0.405339f,0.144882f}, -{0.529713f,0.169994f,0.830967f}, -{0.881510f,0.445674f,0.155930f}, -{0.529713f,0.169994f,0.830967f}, -{-0.429658f,-0.124707f,0.894339f}, -{0.110990f,0.007382f,0.993794f}, -{-0.429658f,-0.124707f,0.894339f}, -{-0.800545f,-0.557866f,-0.218892f}, -{-0.848249f,-0.257559f,0.462749f}, -{-0.800545f,-0.557866f,-0.218892f}, -{-0.961236f,-0.254299f,-0.106572f}, -{-0.848249f,-0.257559f,0.462749f}, -{-0.800545f,-0.557866f,-0.218892f}, -{-0.350539f,-0.164048f,-0.922069f}, -{-0.562847f,0.006894f,-0.826533f}, -{-0.562847f,0.006894f,-0.826533f}, -{-0.848249f,-0.257559f,0.462749f}, -{-0.800545f,-0.557866f,-0.218892f}, -{-0.848249f,-0.257559f,0.462749f}, -{-0.316714f,-0.098371f,0.943406f}, -{-0.429658f,-0.124707f,0.894339f}, -{-0.316714f,-0.098371f,0.943406f}, -{0.110990f,0.007382f,0.993794f}, -{-0.429658f,-0.124707f,0.894339f}, -{0.340456f,0.148097f,0.928524f}, -{0.192348f,0.279380f,0.940717f}, -{0.307422f,0.250640f,0.917971f}, -{0.497283f,0.178068f,0.849118f}, -{0.340456f,0.148097f,0.928524f}, -{0.307422f,0.250640f,0.917971f}, -{0.110990f,0.007382f,0.993794f}, -{0.532600f,0.170685f,0.828977f}, -{0.529713f,0.169994f,0.830967f}, -{0.708291f,0.192457f,0.679179f}, -{0.497283f,0.178068f,0.849118f}, -{0.547075f,0.225477f,0.806145f}, -{0.532600f,0.170685f,0.828977f}, -{0.880685f,0.301175f,0.365632f}, -{0.881510f,0.445674f,0.155930f}, -{0.818805f,0.324094f,0.473837f}, -{0.812721f,0.298228f,0.500545f}, -{0.910755f,0.278726f,0.304691f}, -{0.344945f,0.229757f,-0.910069f}, -{-0.562847f,0.006894f,-0.826533f}, -{0.538352f,0.183130f,-0.822581f}, -{0.257029f,0.521014f,0.813929f}, -{0.149035f,0.415524f,0.897290f}, -{-0.329259f,0.449023f,0.830642f}, -{0.708291f,0.192457f,0.679179f}, -{0.676305f,0.266081f,0.686886f}, -{0.818805f,0.324094f,0.473837f}, -{0.449200f,0.852911f,0.266011f}, -{0.338569f,0.794483f,0.504150f}, -{0.464427f,0.885444f,0.017201f}, -{0.881510f,0.445674f,0.155930f}, -{0.529713f,0.169994f,0.830967f}, -{0.532600f,0.170685f,0.828977f}, -{0.843904f,-0.534691f,-0.043957f}, -{0.427200f,-0.264457f,0.864617f}, -{0.529713f,0.169994f,0.830967f}, -{0.529713f,0.169994f,0.830967f}, -{0.902613f,0.405339f,0.144882f}, -{0.843904f,-0.534691f,-0.043957f}, -{0.322492f,-0.895759f,-0.305966f}, -{0.184599f,-0.693801f,0.696106f}, -{0.843904f,-0.534691f,-0.043957f}, -{0.843904f,-0.534691f,-0.043957f}, -{0.184599f,-0.693801f,0.696106f}, -{0.427200f,-0.264457f,0.864617f}, -{0.269201f,-0.924425f,-0.270126f}, -{0.226980f,-0.748456f,0.623132f}, -{0.322492f,-0.895759f,-0.305966f}, -{0.322492f,-0.895759f,-0.305966f}, -{0.226980f,-0.748456f,0.623132f}, -{0.184599f,-0.693801f,0.696106f}, -{0.269201f,-0.924425f,-0.270126f}, -{0.310233f,-0.946662f,-0.087099f}, -{0.226980f,-0.748456f,0.623132f}, -{0.226980f,-0.748456f,0.623132f}, -{0.103756f,-0.458200f,0.882773f}, -{0.036832f,-0.090172f,0.995245f}, -{0.137532f,-0.990470f,-0.007369f}, -{0.103756f,-0.458200f,0.882773f}, -{0.310233f,-0.946662f,-0.087099f}, -{0.310233f,-0.946662f,-0.087099f}, -{0.103756f,-0.458200f,0.882773f}, -{0.226980f,-0.748456f,0.623132f}, -{0.137532f,-0.990470f,-0.007369f}, -{0.757921f,-0.639321f,-0.129711f}, -{0.574630f,-0.510161f,0.639950f}, -{0.103756f,-0.458200f,0.882773f}, -{0.137532f,-0.990470f,-0.007369f}, -{0.574630f,-0.510161f,0.639950f}, -{0.574630f,-0.510161f,0.639950f}, -{0.757921f,-0.639321f,-0.129711f}, -{0.991725f,0.071842f,-0.106395f}, -{0.991725f,0.071842f,-0.106395f}, -{0.542871f,0.079788f,0.836017f}, -{0.574630f,-0.510161f,0.639950f}, -{0.542871f,0.079788f,0.836017f}, -{0.958246f,0.244027f,-0.149051f}, -{0.874203f,0.192696f,0.445688f}, -{0.958246f,0.244027f,-0.149051f}, -{0.542871f,0.079788f,0.836017f}, -{0.991725f,0.071842f,-0.106395f}, -{0.894736f,0.434207f,-0.104456f}, -{0.874203f,0.192696f,0.445688f}, -{0.958246f,0.244027f,-0.149051f}, -{0.874203f,0.192696f,0.445688f}, -{0.894736f,0.434207f,-0.104456f}, -{0.794391f,0.464231f,0.391704f}, -{-0.134647f,0.858667f,0.494532f}, -{-0.237040f,0.096035f,0.966742f}, -{0.794391f,0.464231f,0.391704f}, -{0.307273f,-0.165243f,0.937165f}, -{0.794391f,0.464231f,0.391704f}, -{0.894736f,0.434207f,-0.104456f}, -{0.794391f,0.464231f,0.391704f}, -{0.307273f,-0.165243f,0.937165f}, -{-0.134647f,0.858667f,0.494532f}, -{0.894736f,0.434207f,-0.104456f}, -{-0.606543f,-0.526765f,0.595503f}, -{0.307273f,-0.165243f,0.937165f}, -{0.902613f,0.405339f,0.144882f}, -{0.881510f,0.445674f,0.155930f}, -{0.538352f,0.183130f,-0.822581f}, -{0.843904f,-0.534691f,-0.043957f}, -{0.902613f,0.405339f,0.144882f}, -{0.538352f,0.183130f,-0.822581f}, -{0.538352f,0.183130f,-0.822581f}, -{0.376617f,-0.217386f,-0.900502f}, -{0.843904f,-0.534691f,-0.043957f}, -{0.194550f,-0.522844f,-0.829930f}, -{0.322492f,-0.895759f,-0.305966f}, -{0.376617f,-0.217386f,-0.900502f}, -{0.322492f,-0.895759f,-0.305966f}, -{0.843904f,-0.534691f,-0.043957f}, -{0.376617f,-0.217386f,-0.900502f}, -{0.321286f,-0.732722f,-0.599912f}, -{0.322492f,-0.895759f,-0.305966f}, -{0.194550f,-0.522844f,-0.829930f}, -{0.322492f,-0.895759f,-0.305966f}, -{0.321286f,-0.732722f,-0.599912f}, -{0.269201f,-0.924425f,-0.270126f}, -{0.282382f,-0.633241f,-0.720601f}, -{0.269201f,-0.924425f,-0.270126f}, -{0.321286f,-0.732722f,-0.599912f}, -{0.269201f,-0.924425f,-0.270126f}, -{0.282382f,-0.633241f,-0.720601f}, -{0.310233f,-0.946662f,-0.087099f}, -{0.310233f,-0.946662f,-0.087099f}, -{0.282382f,-0.633241f,-0.720601f}, -{0.137532f,-0.990470f,-0.007369f}, -{0.454473f,-0.471380f,-0.755814f}, -{0.757921f,-0.639321f,-0.129711f}, -{0.137532f,-0.990470f,-0.007369f}, -{0.137532f,-0.990470f,-0.007369f}, -{0.282382f,-0.633241f,-0.720601f}, -{0.454473f,-0.471380f,-0.755814f}, -{0.991725f,0.071842f,-0.106395f}, -{0.757921f,-0.639321f,-0.129711f}, -{0.454473f,-0.471380f,-0.755814f}, -{0.642628f,-0.075132f,-0.762486f}, -{0.991725f,0.071842f,-0.106395f}, -{0.454473f,-0.471380f,-0.755814f}, -{0.991725f,0.071842f,-0.106395f}, -{0.642628f,-0.075132f,-0.762486f}, -{0.958246f,0.244027f,-0.149051f}, -{0.958246f,0.244027f,-0.149051f}, -{0.642628f,-0.075132f,-0.762486f}, -{0.603742f,0.160505f,-0.780855f}, -{0.674295f,0.612725f,-0.412183f}, -{0.894736f,0.434207f,-0.104456f}, -{0.603742f,0.160505f,-0.780855f}, -{0.603742f,0.160505f,-0.780855f}, -{0.894736f,0.434207f,-0.104456f}, -{0.958246f,0.244027f,-0.149051f}, -{0.077862f,-0.111324f,-0.990729f}, -{0.194550f,-0.522844f,-0.829930f}, -{-0.049438f,0.127782f,-0.990569f}, -{0.194550f,-0.522844f,-0.829930f}, -{0.077862f,-0.111324f,-0.990729f}, -{0.321286f,-0.732722f,-0.599912f}, -{0.321286f,-0.732722f,-0.599912f}, -{0.077862f,-0.111324f,-0.990729f}, -{0.282382f,-0.633241f,-0.720601f}, -{0.730976f,0.408730f,-0.546456f}, -{-0.831249f,0.454782f,-0.319687f}, -{0.674295f,0.612725f,-0.412183f}, -{-0.831249f,0.454782f,-0.319687f}, -{0.894736f,0.434207f,-0.104456f}, -{0.674295f,0.612725f,-0.412183f}, -{0.603742f,0.160505f,-0.780855f}, -{0.730976f,0.408730f,-0.546456f}, -{0.674295f,0.612725f,-0.412183f}, -{-0.831249f,0.454782f,-0.319687f}, -{0.307273f,-0.165243f,0.937165f}, -{0.894736f,0.434207f,-0.104456f}, -{-0.831249f,0.454782f,-0.319687f}, -{0.730976f,0.408730f,-0.546456f}, -{0.307273f,-0.165243f,0.937165f}, -{0.730976f,0.408730f,-0.546456f}, -{0.654331f,-0.147778f,0.741629f}, -{0.307273f,-0.165243f,0.937165f}, -{-0.350539f,-0.164048f,-0.922069f}, -{-0.057903f,0.084077f,-0.994775f}, -{0.376617f,-0.217386f,-0.900502f}, -{0.538352f,0.183130f,-0.822581f}, -{-0.350539f,-0.164048f,-0.922069f}, -{0.376617f,-0.217386f,-0.900502f}, -{0.376617f,-0.217386f,-0.900502f}, -{-0.012782f,0.317890f,-0.948042f}, -{0.194550f,-0.522844f,-0.829930f}, -{-0.049438f,0.127782f,-0.990569f}, -{0.194550f,-0.522844f,-0.829930f}, -{-0.012782f,0.317890f,-0.948042f}, -{-0.108390f,0.198573f,-0.974074f}, -{0.642628f,-0.075132f,-0.762486f}, -{0.282382f,-0.633241f,-0.720601f}, -{0.282382f,-0.633241f,-0.720601f}, -{0.642628f,-0.075132f,-0.762486f}, -{0.454473f,-0.471380f,-0.755814f}, -{-0.532940f,-0.026708f,-0.845732f}, -{0.730976f,0.408730f,-0.546456f}, -{0.603742f,0.160505f,-0.780855f}, -{-0.057903f,0.084077f,-0.994775f}, -{-0.480303f,0.693690f,-0.536753f}, -{-0.012782f,0.317890f,-0.948042f}, -{-0.012782f,0.317890f,-0.948042f}, -{0.376617f,-0.217386f,-0.900502f}, -{-0.057903f,0.084077f,-0.994775f}, -{-0.108390f,0.198573f,-0.974074f}, -{0.282382f,-0.633241f,-0.720601f}, -{0.077862f,-0.111324f,-0.990729f}, -{0.077862f,-0.111324f,-0.990729f}, -{-0.248173f,0.769914f,-0.587914f}, -{-0.108390f,0.198573f,-0.974074f}, -{-0.108390f,0.198573f,-0.974074f}, -{-0.532940f,-0.026708f,-0.845732f}, -{0.642628f,-0.075132f,-0.762486f}, -{-0.532940f,-0.026708f,-0.845732f}, -{0.603742f,0.160505f,-0.780855f}, -{0.642628f,-0.075132f,-0.762486f}, -{-0.012782f,0.317890f,-0.948042f}, -{-0.045936f,0.791705f,-0.609174f}, -{-0.049438f,0.127782f,-0.990569f}, -{-0.248173f,0.769914f,-0.587914f}, -{-0.049438f,0.127782f,-0.990569f}, -{-0.045936f,0.791705f,-0.609174f}, -{-0.049438f,0.127782f,-0.990569f}, -{-0.248173f,0.769914f,-0.587914f}, -{0.077862f,-0.111324f,-0.990729f}, -{-0.791004f,0.090632f,-0.605061f}, -{-0.057903f,0.084077f,-0.994775f}, -{-0.350539f,-0.164048f,-0.922069f}, -{-0.350539f,-0.164048f,-0.922069f}, -{-0.736312f,-0.381662f,-0.558729f}, -{-0.791004f,0.090632f,-0.605061f}, -{-0.480303f,0.693690f,-0.536753f}, -{-0.057903f,0.084077f,-0.994775f}, -{-0.791004f,0.090632f,-0.605061f}, -{-0.480303f,0.693690f,-0.536753f}, -{-0.308976f,0.885968f,-0.345824f}, -{-0.012782f,0.317890f,-0.948042f}, -{-0.045936f,0.791705f,-0.609174f}, -{-0.012782f,0.317890f,-0.948042f}, -{-0.308976f,0.885968f,-0.345824f}, -{-0.045936f,0.791705f,-0.609174f}, -{-0.241969f,0.938448f,0.246507f}, -{-0.248173f,0.769914f,-0.587914f}, -{-0.241969f,0.938448f,0.246507f}, -{-0.249921f,0.966334f,0.061141f}, -{-0.248173f,0.769914f,-0.587914f}, -{-0.248173f,0.769914f,-0.587914f}, -{-0.553630f,0.770550f,-0.315825f}, -{-0.108390f,0.198573f,-0.974074f}, -{-0.248173f,0.769914f,-0.587914f}, -{-0.249921f,0.966334f,0.061141f}, -{-0.553630f,0.770550f,-0.315825f}, -{-0.961874f,0.084580f,-0.260087f}, -{-0.532940f,-0.026708f,-0.845732f}, -{-0.108390f,0.198573f,-0.974074f}, -{-0.961874f,0.084580f,-0.260087f}, -{-0.108390f,0.198573f,-0.974074f}, -{-0.553630f,0.770550f,-0.315825f}, -{-0.831249f,0.454782f,-0.319687f}, -{-0.532940f,-0.026708f,-0.845732f}, -{-0.961874f,0.084580f,-0.260087f}, -{0.730976f,0.408730f,-0.546456f}, -{-0.532940f,-0.026708f,-0.845732f}, -{-0.831249f,0.454782f,-0.319687f}, -{-0.736312f,-0.381662f,-0.558729f}, -{-0.961236f,-0.254299f,-0.106572f}, -{-0.791004f,0.090632f,-0.605061f}, -{-0.791004f,0.090632f,-0.605061f}, -{-0.961236f,-0.254299f,-0.106572f}, -{-0.935861f,0.336108f,0.105809f}, -{-0.772121f,0.609980f,0.178194f}, -{-0.791004f,0.090632f,-0.605061f}, -{-0.935861f,0.336108f,0.105809f}, -{-0.791004f,0.090632f,-0.605061f}, -{-0.772121f,0.609980f,0.178194f}, -{-0.480303f,0.693690f,-0.536753f}, -{-0.480303f,0.693690f,-0.536753f}, -{-0.772121f,0.609980f,0.178194f}, -{-0.594004f,0.743409f,0.307413f}, -{-0.290261f,0.853479f,0.432808f}, -{-0.480303f,0.693690f,-0.536753f}, -{-0.594004f,0.743409f,0.307413f}, -{-0.480303f,0.693690f,-0.536753f}, -{-0.290261f,0.853479f,0.432808f}, -{-0.308976f,0.885968f,-0.345824f}, -{-0.241969f,0.938448f,0.246507f}, -{-0.308976f,0.885968f,-0.345824f}, -{-0.290261f,0.853479f,0.432808f}, -{-0.308976f,0.885968f,-0.345824f}, -{-0.241969f,0.938448f,0.246507f}, -{-0.045936f,0.791705f,-0.609174f}, -{-0.237040f,0.096035f,0.966742f}, -{-0.831249f,0.454782f,-0.319687f}, -{-0.588608f,0.118159f,0.799737f}, -{-0.961874f,0.084580f,-0.260087f}, -{-0.588608f,0.118159f,0.799737f}, -{-0.831249f,0.454782f,-0.319687f}, -{-0.164873f,0.655558f,0.736927f}, -{-0.114112f,0.634512f,0.764443f}, -{-0.249921f,0.966334f,0.061141f}, -{-0.241969f,0.938448f,0.246507f}, -{-0.164873f,0.655558f,0.736927f}, -{-0.249921f,0.966334f,0.061141f}, -{-0.249921f,0.966334f,0.061141f}, -{-0.343146f,0.561925f,0.752656f}, -{-0.553630f,0.770550f,-0.315825f}, -{-0.343146f,0.561925f,0.752656f}, -{-0.249921f,0.966334f,0.061141f}, -{-0.114112f,0.634512f,0.764443f}, -{-0.588608f,0.118159f,0.799737f}, -{-0.961874f,0.084580f,-0.260087f}, -{-0.553630f,0.770550f,-0.315825f}, -{-0.588608f,0.118159f,0.799737f}, -{-0.553630f,0.770550f,-0.315825f}, -{-0.343146f,0.561925f,0.752656f}, -{-0.800545f,-0.557866f,-0.218892f}, -{-0.429658f,-0.124707f,0.894339f}, -{-0.961236f,-0.254299f,-0.106572f}, -{-0.961236f,-0.254299f,-0.106572f}, -{-0.623191f,0.218421f,0.750950f}, -{-0.935861f,0.336108f,0.105809f}, -{-0.623191f,0.218421f,0.750950f}, -{-0.961236f,-0.254299f,-0.106572f}, -{-0.429658f,-0.124707f,0.894339f}, -{-0.023163f,-0.074290f,0.996968f}, -{-0.376399f,0.292230f,0.879162f}, -{-0.623191f,0.218421f,0.750950f}, -{-0.376399f,0.292230f,0.879162f}, -{-0.772121f,0.609980f,0.178194f}, -{-0.623191f,0.218421f,0.750950f}, -{-0.623191f,0.218421f,0.750950f}, -{-0.772121f,0.609980f,0.178194f}, -{-0.935861f,0.336108f,0.105809f}, -{-0.594004f,0.743409f,0.307413f}, -{-0.772121f,0.609980f,0.178194f}, -{-0.376399f,0.292230f,0.879162f}, -{-0.036591f,0.219387f,0.974951f}, -{-0.290261f,0.853479f,0.432808f}, -{-0.376399f,0.292230f,0.879162f}, -{-0.376399f,0.292230f,0.879162f}, -{-0.290261f,0.853479f,0.432808f}, -{-0.594004f,0.743409f,0.307413f}, -{-0.164873f,0.655558f,0.736927f}, -{-0.241969f,0.938448f,0.246507f}, -{-0.036591f,0.219387f,0.974951f}, -{-0.036591f,0.219387f,0.974951f}, -{-0.241969f,0.938448f,0.246507f}, -{-0.290261f,0.853479f,0.432808f}, -{-0.023163f,-0.074290f,0.996968f}, -{-0.623191f,0.218421f,0.750950f}, -{-0.429658f,-0.124707f,0.894339f}, -{0.015105f,0.084406f,0.996317f}, -{-0.164873f,0.655558f,0.736927f}, -{-0.036591f,0.219387f,0.974951f}, -{0.015105f,0.084406f,0.996317f}, -{0.036832f,-0.090172f,0.995245f}, -{-0.114112f,0.634512f,0.764443f}, -{-0.164873f,0.655558f,0.736927f}, -{0.015105f,0.084406f,0.996317f}, -{-0.114112f,0.634512f,0.764443f}, -{0.036832f,-0.090172f,0.995245f}, -{0.103756f,-0.458200f,0.882773f}, -{-0.343146f,0.561925f,0.752656f}, -{-0.114112f,0.634512f,0.764443f}, -{0.036832f,-0.090172f,0.995245f}, -{-0.343146f,0.561925f,0.752656f}, -{-0.036591f,0.219387f,0.974951f}, -{-0.376399f,0.292230f,0.879162f}, -{-0.023163f,-0.074290f,0.996968f}, -{0.542871f,0.079788f,0.836017f}, -{-0.343146f,0.561925f,0.752656f}, -{0.103756f,-0.458200f,0.882773f}, -{0.542871f,0.079788f,0.836017f}, -{0.874203f,0.192696f,0.445688f}, -{-0.588608f,0.118159f,0.799737f}, -{-0.588608f,0.118159f,0.799737f}, -{-0.343146f,0.561925f,0.752656f}, -{0.542871f,0.079788f,0.836017f}, -{0.529713f,0.169994f,0.830967f}, -{0.427200f,-0.264457f,0.864617f}, -{-0.023163f,-0.074290f,0.996968f}, -{-0.429658f,-0.124707f,0.894339f}, -{0.529713f,0.169994f,0.830967f}, -{-0.023163f,-0.074290f,0.996968f}, -{-0.036591f,0.219387f,0.974951f}, -{-0.023163f,-0.074290f,0.996968f}, -{0.427200f,-0.264457f,0.864617f}, -{0.427200f,-0.264457f,0.864617f}, -{0.015105f,0.084406f,0.996317f}, -{-0.036591f,0.219387f,0.974951f}, -{0.542871f,0.079788f,0.836017f}, -{0.103756f,-0.458200f,0.882773f}, -{0.574630f,-0.510161f,0.639950f}, -{-0.588608f,0.118159f,0.799737f}, -{0.874203f,0.192696f,0.445688f}, -{-0.237040f,0.096035f,0.966742f}, -{0.184599f,-0.693801f,0.696106f}, -{0.015105f,0.084406f,0.996317f}, -{0.427200f,-0.264457f,0.864617f}, -{0.226980f,-0.748456f,0.623132f}, -{0.036832f,-0.090172f,0.995245f}, -{0.184599f,-0.693801f,0.696106f}, -{0.184599f,-0.693801f,0.696106f}, -{0.036832f,-0.090172f,0.995245f}, -{0.015105f,0.084406f,0.996317f}, -{0.874203f,0.192696f,0.445688f}, -{0.794391f,0.464231f,0.391704f}, -{-0.237040f,0.096035f,0.966742f}, -{-0.350539f,-0.164048f,-0.922069f}, -{-0.800545f,-0.557866f,-0.218892f}, -{-0.736312f,-0.381662f,-0.558729f}, -{0.538352f,0.183130f,-0.822581f}, -{0.881510f,0.445674f,0.155930f}, -{0.838981f,0.354286f,-0.413029f}, -{-0.961236f,-0.254299f,-0.106572f}, -{-0.736312f,-0.381662f,-0.558729f}, -{-0.800545f,-0.557866f,-0.218892f}, -{0.307273f,-0.165243f,0.937165f}, -{-0.831249f,0.454782f,-0.319687f}, -{-0.237040f,0.096035f,0.966742f}, -{-0.237040f,0.096035f,0.966742f}, -{-0.134647f,0.858667f,0.494532f}, -{0.307273f,-0.165243f,0.937165f}, -{-0.134647f,0.858667f,0.494532f}, -{0.848073f,-0.281316f,0.449037f}, -{-0.383839f,0.906225f,-0.177268f}, -{-0.383839f,0.906225f,-0.177268f}, -{0.307273f,-0.165243f,0.937165f}, -{-0.134647f,0.858667f,0.494532f}, -{0.848073f,-0.281316f,0.449037f}, -{0.307273f,-0.165243f,0.937165f}, -{-0.383839f,0.906225f,-0.177268f}, -{0.848073f,-0.281316f,0.449037f}, -{-0.134647f,0.858667f,0.494532f}, -{0.307273f,-0.165243f,0.937165f}, -{0.683516f,-0.675504f,0.276588f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.559951f,-0.798324f,-0.221661f}, -{0.055770f,-0.976201f,-0.209576f}, -{0.559951f,-0.798324f,-0.221661f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.901109f,0.387318f,0.194905f}, -{0.361705f,-0.132388f,-0.922845f}, -{0.683516f,-0.675504f,0.276588f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.683516f,-0.675504f,0.276588f}, -{0.361705f,-0.132388f,-0.922845f}, -{-0.151863f,0.379451f,-0.912663f}, -{-0.131874f,0.668345f,-0.732068f}, -{-0.184452f,0.855665f,-0.483544f}, -{-0.184452f,0.855665f,-0.483544f}, -{-0.131874f,0.668345f,-0.732068f}, -{0.023087f,0.983535f,-0.179238f}, -{-0.129631f,-0.183454f,-0.974444f}, -{-0.237882f,-0.043628f,-0.970314f}, -{-0.151863f,0.379451f,-0.912663f}, -{-0.151863f,0.379451f,-0.912663f}, -{-0.237882f,-0.043628f,-0.970314f}, -{-0.131874f,0.668345f,-0.732068f}, -{0.559951f,-0.798324f,-0.221661f}, -{0.055770f,-0.976201f,-0.209576f}, -{0.167578f,-0.745812f,-0.644734f}, -{0.559951f,-0.798324f,-0.221661f}, -{0.901109f,0.387318f,0.194905f}, -{0.683516f,-0.675504f,0.276588f}, -{-0.671918f,0.537053f,-0.510000f}, -{0.023087f,0.983535f,-0.179238f}, -{-0.339246f,0.630741f,0.697910f}, -{-0.339246f,0.630741f,0.697910f}, -{0.023087f,0.983535f,-0.179238f}, -{0.048201f,0.967562f,0.247995f}, -{-0.339246f,0.630741f,0.697910f}, -{0.133994f,0.708701f,0.692668f}, -{0.901109f,0.387318f,0.194905f}, -{0.133994f,0.708701f,0.692668f}, -{-0.339246f,0.630741f,0.697910f}, -{0.048201f,0.967562f,0.247995f}, -{0.739721f,-0.663774f,-0.110528f}, -{-0.151863f,0.379451f,-0.912663f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.151863f,0.379451f,-0.912663f}, -{-0.184452f,0.855665f,-0.483544f}, -{0.023087f,0.983535f,-0.179238f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.184452f,0.855665f,-0.483544f}, -{-0.151863f,0.379451f,-0.912663f}, -{-0.310798f,0.261443f,-0.913812f}, -{-0.129631f,-0.183454f,-0.974444f}, -{-0.310798f,0.261443f,-0.913812f}, -{-0.151863f,0.379451f,-0.912663f}, -{0.739721f,-0.663774f,-0.110528f}, -{-0.310798f,0.261443f,-0.913812f}, -{0.134356f,-0.695658f,-0.705697f}, -{-0.129631f,-0.183454f,-0.974444f}, -{0.134356f,-0.695658f,-0.705697f}, -{0.739721f,-0.663774f,-0.110528f}, -{0.167578f,-0.745812f,-0.644734f}, -{0.167578f,-0.745812f,-0.644734f}, -{-0.129631f,-0.183454f,-0.974444f}, -{0.134356f,-0.695658f,-0.705697f}, -{0.739721f,-0.663774f,-0.110528f}, -{0.559951f,-0.798324f,-0.221661f}, -{0.167578f,-0.745812f,-0.644734f}, -{0.702009f,-0.466389f,0.538205f}, -{0.901109f,0.387318f,0.194905f}, -{0.559951f,-0.798324f,-0.221661f}, -{0.559951f,-0.798324f,-0.221661f}, -{0.697735f,-0.553562f,-0.454681f}, -{0.702009f,-0.466389f,0.538205f}, -{-0.310798f,0.261443f,-0.913812f}, -{-0.274142f,0.209109f,-0.938680f}, -{0.327271f,-0.044087f,-0.943901f}, -{-0.310798f,0.261443f,-0.913812f}, -{0.739721f,-0.663774f,-0.110528f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.274142f,0.209109f,-0.938680f}, -{-0.310798f,0.261443f,-0.913812f}, -{-0.310798f,0.261443f,-0.913812f}, -{0.327271f,-0.044087f,-0.943901f}, -{0.134356f,-0.695658f,-0.705697f}, -{0.697735f,-0.553562f,-0.454681f}, -{0.134356f,-0.695658f,-0.705697f}, -{0.327271f,-0.044087f,-0.943901f}, -{0.134356f,-0.695658f,-0.705697f}, -{0.697735f,-0.553562f,-0.454681f}, -{0.739721f,-0.663774f,-0.110528f}, -{0.697735f,-0.553562f,-0.454681f}, -{0.559951f,-0.798324f,-0.221661f}, -{0.739721f,-0.663774f,-0.110528f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.702009f,-0.466389f,0.538205f}, -{0.697735f,-0.553562f,-0.454681f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.177384f,0.110986f,0.977864f}, -{0.702009f,-0.466389f,0.538205f}, -{0.901109f,0.387318f,0.194905f}, -{0.702009f,-0.466389f,0.538205f}, -{0.177384f,0.110986f,0.977864f}, -{0.177384f,0.110986f,0.977864f}, -{-0.339246f,0.630741f,0.697910f}, -{0.901109f,0.387318f,0.194905f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.296435f,0.138514f,-0.944955f}, -{-0.274142f,0.209109f,-0.938680f}, -{-0.274142f,0.209109f,-0.938680f}, -{-0.296435f,0.138514f,-0.944955f}, -{0.468993f,-0.018847f,-0.883001f}, -{0.327271f,-0.044087f,-0.943901f}, -{-0.274142f,0.209109f,-0.938680f}, -{0.468993f,-0.018847f,-0.883001f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.697735f,-0.553562f,-0.454681f}, -{0.327271f,-0.044087f,-0.943901f}, -{0.468993f,-0.018847f,-0.883001f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.327271f,-0.044087f,-0.943901f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.997269f,-0.039027f,0.062704f}, -{0.371997f,0.003804f,0.928226f}, -{0.177384f,0.110986f,0.977864f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.371997f,0.003804f,0.928226f}, -{-0.339246f,0.630741f,0.697910f}, -{0.177384f,0.110986f,0.977864f}, -{0.371997f,0.003804f,0.928226f}, -{-0.389041f,0.208605f,0.897291f}, -{-0.878746f,0.266489f,0.395965f}, -{-0.339246f,0.630741f,0.697910f}, -{-0.339246f,0.630741f,0.697910f}, -{0.371997f,0.003804f,0.928226f}, -{-0.389041f,0.208605f,0.897291f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.339246f,0.630741f,0.697910f}, -{-0.878746f,0.266489f,0.395965f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.878746f,0.266489f,0.395965f}, -{-0.846678f,0.355922f,-0.395545f}, -{-0.846678f,0.355922f,-0.395545f}, -{-0.537819f,0.296240f,-0.789299f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.537819f,0.296240f,-0.789299f}, -{0.140010f,0.021538f,-0.989916f}, -{-0.671918f,0.537053f,-0.510000f}, -{-0.671918f,0.537053f,-0.510000f}, -{0.140010f,0.021538f,-0.989916f}, -{-0.296435f,0.138514f,-0.944955f}, -{0.468993f,-0.018847f,-0.883001f}, -{-0.296435f,0.138514f,-0.944955f}, -{0.140010f,0.021538f,-0.989916f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.468993f,-0.018847f,-0.883001f}, -{0.140010f,0.021538f,-0.989916f}, -{0.140010f,0.021538f,-0.989916f}, -{0.826623f,-0.154051f,-0.541261f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.826623f,-0.154051f,-0.541261f}, -{0.997269f,-0.039027f,0.062704f}, -{0.981598f,-0.185945f,-0.043461f}, -{0.240729f,0.183380f,0.953111f}, -{0.371997f,0.003804f,0.928226f}, -{0.556554f,0.028917f,0.830308f}, -{0.963918f,-0.104371f,0.244887f}, -{0.556554f,0.028917f,0.830308f}, -{0.371997f,0.003804f,0.928226f}, -{0.371997f,0.003804f,0.928226f}, -{0.997269f,-0.039027f,0.062704f}, -{0.963918f,-0.104371f,0.244887f}, -{-0.440502f,0.276883f,0.853987f}, -{-0.538988f,0.456125f,0.708126f}, -{-0.878746f,0.266489f,0.395965f}, -{-0.389041f,0.208605f,0.897291f}, -{0.240729f,0.183380f,0.953111f}, -{-0.440502f,0.276883f,0.853987f}, -{-0.878746f,0.266489f,0.395965f}, -{-0.389041f,0.208605f,0.897291f}, -{-0.440502f,0.276883f,0.853987f}, -{0.240729f,0.183380f,0.953111f}, -{-0.389041f,0.208605f,0.897291f}, -{0.371997f,0.003804f,0.928226f}, -{-0.684218f,0.672334f,-0.282511f}, -{-0.878746f,0.266489f,0.395965f}, -{-0.538988f,0.456125f,0.708126f}, -{-0.744455f,0.394741f,-0.538486f}, -{-0.846678f,0.355922f,-0.395545f}, -{-0.684218f,0.672334f,-0.282511f}, -{-0.878746f,0.266489f,0.395965f}, -{-0.684218f,0.672334f,-0.282511f}, -{-0.846678f,0.355922f,-0.395545f}, -{-0.537819f,0.296240f,-0.789299f}, -{-0.151191f,0.316424f,-0.936492f}, -{0.140010f,0.021538f,-0.989916f}, -{-0.151191f,0.316424f,-0.936492f}, -{-0.537819f,0.296240f,-0.789299f}, -{-0.846678f,0.355922f,-0.395545f}, -{-0.151191f,0.316424f,-0.936492f}, -{0.780903f,-0.084524f,-0.618907f}, -{0.140010f,0.021538f,-0.989916f}, -{0.780903f,-0.084524f,-0.618907f}, -{0.826623f,-0.154051f,-0.541261f}, -{0.140010f,0.021538f,-0.989916f}, -{0.826623f,-0.154051f,-0.541261f}, -{0.780903f,-0.084524f,-0.618907f}, -{0.963918f,-0.104371f,0.244887f}, -{0.997269f,-0.039027f,0.062704f}, -{0.826623f,-0.154051f,-0.541261f}, -{0.963918f,-0.104371f,0.244887f}, -{0.035931f,0.978315f,-0.203983f}, -{0.351359f,0.907094f,0.231790f}, -{0.023087f,0.983535f,-0.179238f}, -{0.351359f,0.907094f,0.231790f}, -{0.693419f,0.720347f,-0.016479f}, -{0.133994f,0.708701f,0.692668f}, -{0.693419f,0.720347f,-0.016479f}, -{0.646168f,0.395237f,-0.652882f}, -{0.901109f,0.387318f,0.194905f}, -{0.646168f,0.395237f,-0.652882f}, -{-0.137885f,-0.308339f,0.941231f}, -{-0.015615f,0.612257f,-0.790504f}, -{-0.137885f,-0.308339f,0.941231f}, -{0.416569f,-0.491733f,-0.764636f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.416569f,-0.491733f,-0.764636f}, -{-0.058529f,-0.935295f,-0.348995f}, -{0.055770f,-0.976201f,-0.209576f}, -{-0.058529f,-0.935295f,-0.348995f}, -{-0.283861f,-0.608680f,-0.740899f}, -{0.167578f,-0.745812f,-0.644734f}, -{-0.283861f,-0.608680f,-0.740899f}, -{-0.237882f,-0.043628f,-0.970314f}, -{0.167578f,-0.745812f,-0.644734f}, -{-0.140997f,0.780001f,-0.609687f}, -{0.035931f,0.978315f,-0.203983f}, -{0.023087f,0.983535f,-0.179238f}, -{0.757243f,-0.437019f,0.485384f}, -{-0.538988f,0.456125f,0.708126f}, -{0.240729f,0.183380f,0.953111f}, -{-0.684218f,0.672334f,-0.282511f}, -{-0.396819f,0.535445f,-0.745543f}, -{-0.744455f,0.394741f,-0.538486f}, -{-0.396819f,0.535445f,-0.745543f}, -{0.332223f,0.118859f,-0.935682f}, -{-0.151191f,0.316424f,-0.936492f}, -{0.055770f,-0.976201f,-0.209576f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.416569f,-0.491733f,-0.764636f}, -{0.361705f,-0.132388f,-0.922845f}, -{-0.015615f,0.612257f,-0.790504f}, -{-0.137885f,-0.308339f,0.941231f}, -{0.343314f,-0.935035f,-0.088572f}, -{0.361705f,-0.132388f,-0.922845f}, -{-0.137885f,-0.308339f,0.941231f}, -{0.048201f,0.967562f,0.247995f}, -{0.023087f,0.983535f,-0.179238f}, -{0.351359f,0.907094f,0.231790f}, -{0.023087f,0.983535f,-0.179238f}, -{-0.131874f,0.668345f,-0.732068f}, -{-0.140997f,0.780001f,-0.609687f}, -{-0.129631f,-0.183454f,-0.974444f}, -{0.167578f,-0.745812f,-0.644734f}, -{-0.237882f,-0.043628f,-0.970314f}, -{0.167578f,-0.745812f,-0.644734f}, -{0.055770f,-0.976201f,-0.209576f}, -{-0.058529f,-0.935295f,-0.348995f}, -{0.901109f,0.387318f,0.194905f}, -{0.133994f,0.708701f,0.692668f}, -{0.693419f,0.720347f,-0.016479f}, -{0.133994f,0.708701f,0.692668f}, -{0.048201f,0.967562f,0.247995f}, -{0.351359f,0.907094f,0.231790f}, -{0.240729f,0.183380f,0.953111f}, -{0.556554f,0.028917f,0.830308f}, -{0.963918f,-0.104371f,0.244887f}, -{-0.151191f,0.316424f,-0.936492f}, -{-0.846678f,0.355922f,-0.395545f}, -{-0.396819f,0.535445f,-0.745543f}, -{0.780903f,-0.084524f,-0.618907f}, -{-0.151191f,0.316424f,-0.936492f}, -{0.332223f,0.118859f,-0.935682f}, -{0.901109f,0.387318f,0.194905f}, -{0.646168f,0.395237f,-0.652882f}, -{-0.015615f,0.612257f,-0.790504f}, -{0.963918f,-0.104371f,0.244887f}, -{0.757243f,-0.437019f,0.485384f}, -{0.240729f,0.183380f,0.953111f}, -{-0.538988f,0.456125f,0.708126f}, -{-0.440502f,0.276883f,0.853987f}, -{0.240729f,0.183380f,0.953111f}, -{-0.744455f,0.394741f,-0.538486f}, -{-0.396819f,0.535445f,-0.745543f}, -{-0.846678f,0.355922f,-0.395545f}, -{-0.333604f,-0.214808f,0.917914f}, -{-0.800669f,0.298791f,-0.519281f}, -{-0.538988f,0.456125f,0.708126f}, -{0.226039f,-0.146424f,0.963050f}, -{-0.800669f,0.298791f,-0.519281f}, -{-0.333604f,-0.214808f,0.917914f}, -{0.371776f,-0.300019f,0.878505f}, -{-0.333604f,-0.214808f,0.917914f}, -{0.226039f,-0.146424f,0.963050f}, -{-0.453499f,-0.702736f,0.548180f}, -{-0.333604f,-0.214808f,0.917914f}, -{0.371776f,-0.300019f,0.878505f}, -{0.442401f,-0.895907f,-0.040408f}, -{-0.453499f,-0.702736f,0.548180f}, -{0.624067f,-0.719845f,0.303913f}, -{0.019280f,-0.351952f,0.935820f}, -{-0.333604f,-0.214808f,0.917914f}, -{0.757243f,-0.437019f,0.485384f}, -{0.757243f,-0.437019f,0.485384f}, -{-0.333604f,-0.214808f,0.917914f}, -{-0.538988f,0.456125f,0.708126f}, -{0.019280f,-0.351952f,0.935820f}, -{0.226039f,-0.146424f,0.963050f}, -{-0.333604f,-0.214808f,0.917914f}, -{0.371776f,-0.300019f,0.878505f}, -{0.056592f,0.684051f,0.727235f}, -{0.624067f,-0.719845f,0.303913f}, -{-0.453499f,-0.702736f,0.548180f}, -{0.371776f,-0.300019f,0.878505f}, -{0.624067f,-0.719845f,0.303913f}, -{0.684440f,-0.422099f,0.594453f}, -{0.226039f,-0.146424f,0.963050f}, -{0.019280f,-0.351952f,0.935820f}, -{0.546047f,-0.307234f,0.779384f}, -{0.226039f,-0.146424f,0.963050f}, -{0.684440f,-0.422099f,0.594453f}, -{0.546047f,-0.307234f,0.779384f}, -{0.371776f,-0.300019f,0.878505f}, -{0.226039f,-0.146424f,0.963050f}, -{0.056592f,0.684051f,0.727235f}, -{0.371776f,-0.300019f,0.878505f}, -{-0.453499f,-0.702736f,0.548180f}, -{0.684440f,-0.422099f,0.594453f}, -{0.019280f,-0.351952f,0.935820f}, -{0.757243f,-0.437019f,0.485384f}, -{0.546047f,-0.307234f,0.779384f}, -{0.684440f,-0.422099f,0.594453f}, -{0.990990f,-0.123953f,0.050743f}, -{0.029983f,-0.232355f,0.972169f}, -{0.056592f,0.684051f,0.727235f}, -{0.371776f,-0.300019f,0.878505f}, -{0.371776f,-0.300019f,0.878505f}, -{0.546047f,-0.307234f,0.779384f}, -{0.029983f,-0.232355f,0.972169f}, -{-0.697006f,0.712234f,0.083096f}, -{0.056592f,0.684051f,0.727235f}, -{-0.453499f,-0.702736f,0.548180f}, -{0.056592f,0.684051f,0.727235f}, -{-0.596428f,0.792428f,0.127799f}, -{0.624067f,-0.719845f,0.303913f}, -{0.684440f,-0.422099f,0.594453f}, -{0.757243f,-0.437019f,0.485384f}, -{0.788748f,-0.614145f,0.026503f}, -{-0.697006f,0.712234f,0.083096f}, -{0.371776f,-0.300019f,0.878505f}, -{0.056592f,0.684051f,0.727235f}, -{0.371776f,-0.300019f,0.878505f}, -{-0.697006f,0.712234f,0.083096f}, -{-0.453499f,-0.702736f,0.548180f}, -{-0.697006f,0.712234f,0.083096f}, -{0.056592f,0.684051f,0.727235f}, -{-0.243956f,0.825248f,-0.509364f}, -{-0.675257f,0.519192f,-0.523897f}, -{-0.697006f,0.712234f,0.083096f}, -{-0.243956f,0.825248f,-0.509364f}, -{-0.596428f,0.792428f,0.127799f}, -{0.056592f,0.684051f,0.727235f}, -{-0.697006f,0.712234f,0.083096f}, -{0.471585f,-0.379214f,-0.796118f}, -{0.757243f,-0.437019f,0.485384f}, -{0.332223f,0.118859f,-0.935682f}, -{0.757243f,-0.437019f,0.485384f}, -{0.471585f,-0.379214f,-0.796118f}, -{0.684440f,-0.422099f,0.594453f}, -{0.332223f,0.118859f,-0.935682f}, -{-0.063761f,0.125876f,-0.989995f}, -{0.471585f,-0.379214f,-0.796118f}, -{-0.697006f,0.712234f,0.083096f}, -{-0.675257f,0.519192f,-0.523897f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.165552f,0.135145f,-0.976897f}, -{0.471585f,-0.379214f,-0.796118f}, -{-0.063761f,0.125876f,-0.989995f}, -{0.471585f,-0.379214f,-0.796118f}, -{-0.165552f,0.135145f,-0.976897f}, -{0.310564f,0.143864f,-0.939603f}, -{0.285248f,0.462213f,-0.839639f}, -{0.310564f,0.143864f,-0.939603f}, -{-0.165552f,0.135145f,-0.976897f}, -{-0.165552f,0.135145f,-0.976897f}, -{-0.243956f,0.825248f,-0.509364f}, -{0.285248f,0.462213f,-0.839639f}, -{-0.165552f,0.135145f,-0.976897f}, -{-0.530630f,0.554441f,-0.641114f}, -{-0.243956f,0.825248f,-0.509364f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.675257f,0.519192f,-0.523897f}, -{-0.530630f,0.554441f,-0.641114f}, -{-0.530630f,0.554441f,-0.641114f}, -{-0.675257f,0.519192f,-0.523897f}, -{-0.243956f,0.825248f,-0.509364f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.453499f,-0.702736f,0.548180f}, -{-0.697006f,0.712234f,0.083096f}, -{-0.508446f,0.276092f,-0.815633f}, -{-0.530630f,0.554441f,-0.641114f}, -{-0.165552f,0.135145f,-0.976897f}, -{-0.508446f,0.276092f,-0.815633f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.530630f,0.554441f,-0.641114f}, -{-0.396819f,0.535445f,-0.745543f}, -{-0.524475f,0.203183f,-0.826827f}, -{0.332223f,0.118859f,-0.935682f}, -{-0.063761f,0.125876f,-0.989995f}, -{0.332223f,0.118859f,-0.935682f}, -{-0.524475f,0.203183f,-0.826827f}, -{0.481896f,0.685829f,-0.545358f}, -{-0.453499f,-0.702736f,0.548180f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.453499f,-0.702736f,0.548180f}, -{-0.596428f,0.792428f,0.127799f}, -{-0.697006f,0.712234f,0.083096f}, -{0.481896f,0.685829f,-0.545358f}, -{-0.697006f,0.712234f,0.083096f}, -{-0.453499f,-0.702736f,0.548180f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.063761f,0.125876f,-0.989995f}, -{-0.524475f,0.203183f,-0.826827f}, -{-0.063761f,0.125876f,-0.989995f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.165552f,0.135145f,-0.976897f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.508446f,0.276092f,-0.815633f}, -{-0.165552f,0.135145f,-0.976897f}, -{-0.524475f,0.203183f,-0.826827f}, -{-0.396819f,0.535445f,-0.745543f}, -{-0.538988f,0.456125f,0.708126f}, -{-0.524475f,0.203183f,-0.826827f}, -{-0.538988f,0.456125f,0.708126f}, -{-0.800669f,0.298791f,-0.519281f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.524475f,0.203183f,-0.826827f}, -{-0.800669f,0.298791f,-0.519281f}, -{-0.453499f,-0.702736f,0.548180f}, -{0.442401f,-0.895907f,-0.040408f}, -{-0.596428f,0.792428f,0.127799f}, -{-0.684218f,0.672334f,-0.282511f}, -{-0.800669f,0.298791f,-0.519281f}, -{-0.538988f,0.456125f,0.708126f}, -{-0.333604f,-0.214808f,0.917914f}, -{-0.453499f,-0.702736f,0.548180f}, -{-0.800669f,0.298791f,-0.519281f}, -{-0.453499f,-0.702736f,0.548180f}, -{-0.662811f,0.352057f,-0.660861f}, -{-0.800669f,0.298791f,-0.519281f}, -{0.442401f,-0.895907f,-0.040408f}, -{0.624067f,-0.719845f,0.303913f}, -{-0.596428f,0.792428f,0.127799f}, -{0.963918f,-0.104371f,0.244887f}, -{0.780903f,-0.084524f,-0.618907f}, -{0.757243f,-0.437019f,0.485384f}, -{-0.396819f,0.535445f,-0.745543f}, -{-0.684218f,0.672334f,-0.282511f}, -{-0.538988f,0.456125f,0.708126f}, -{0.896895f,0.289706f,-0.334140f}, -{0.029983f,-0.232355f,0.972169f}, -{0.546047f,-0.307234f,0.779384f}, -{0.546047f,-0.307234f,0.779384f}, -{0.990990f,-0.123953f,0.050743f}, -{0.896895f,0.289706f,-0.334140f}, -{0.332223f,0.118859f,-0.935682f}, -{0.757243f,-0.437019f,0.485384f}, -{0.780903f,-0.084524f,-0.618907f}, -{0.990990f,-0.123953f,0.050743f}, -{0.310564f,0.143864f,-0.939603f}, -{0.896895f,0.289706f,-0.334140f}, -{0.310564f,0.143864f,-0.939603f}, -{0.285248f,0.462213f,-0.839639f}, -{0.896895f,0.289706f,-0.334140f}, -{0.285248f,0.462213f,-0.839639f}, -{-0.243956f,0.825248f,-0.509364f}, -{0.896895f,0.289706f,-0.334140f}, -{0.896895f,0.289706f,-0.334140f}, -{-0.243956f,0.825248f,-0.509364f}, -{0.056592f,0.684051f,0.727235f}, -{0.896895f,0.289706f,-0.334140f}, -{0.056592f,0.684051f,0.727235f}, -{0.029983f,-0.232355f,0.972169f}, -{-0.243956f,0.825248f,-0.509364f}, -{-0.492137f,-0.058279f,0.868565f}, -{-0.330693f,0.784698f,-0.524301f}, -{0.056592f,0.684051f,0.727235f}, -{-0.492137f,-0.058279f,0.868565f}, -{-0.243956f,0.825248f,-0.509364f}, -{0.780180f,0.494981f,0.382509f}, -{-0.508722f,-0.782644f,0.358705f}, -{0.391596f,0.719198f,-0.573939f}, -{-0.508722f,-0.782644f,0.358705f}, -{0.780180f,0.494981f,0.382509f}, -{0.110626f,-0.629172f,0.769353f}, -{-0.276021f,0.641848f,-0.715433f}, -{0.780180f,0.494981f,0.382509f}, -{0.391596f,0.719198f,-0.573939f}, -{-0.458589f,0.150160f,0.875870f}, -{0.780180f,0.494981f,0.382509f}, -{-0.276021f,0.641848f,-0.715433f}, -{-0.458589f,0.150160f,0.875870f}, -{0.110626f,-0.629172f,0.769353f}, -{0.780180f,0.494981f,0.382509f}, -{-0.276021f,0.641848f,-0.715433f}, -{0.391596f,0.719198f,-0.573939f}, -{-0.508722f,-0.782644f,0.358705f}, -{0.029983f,-0.232355f,0.972169f}, -{0.110626f,-0.629172f,0.769353f}, -{-0.458589f,0.150160f,0.875870f}, -{0.896895f,0.289706f,-0.334140f}, -{-0.276021f,0.641848f,-0.715433f}, -{-0.508722f,-0.782644f,0.358705f}, -{-0.276021f,0.641848f,-0.715433f}, -{0.896895f,0.289706f,-0.334140f}, -{-0.458589f,0.150160f,0.875870f}, -{0.029983f,-0.232355f,0.972169f}, -{-0.458589f,0.150160f,0.875870f}, -{0.896895f,0.289706f,-0.334140f}, -{0.896895f,0.289706f,-0.334140f}, -{0.110626f,-0.629172f,0.769353f}, -{0.029983f,-0.232355f,0.972169f}, -{0.110626f,-0.629172f,0.769353f}, -{0.896895f,0.289706f,-0.334140f}, -{-0.508722f,-0.782644f,0.358705f}, -{0.029983f,-0.232355f,0.972169f}, -{-0.458589f,0.150160f,0.875870f}, -{-0.492137f,-0.058279f,0.868565f}, -{-0.330693f,0.784698f,-0.524301f}, -{-0.458589f,0.150160f,0.875870f}, -{-0.276021f,0.641848f,-0.715433f}, -{-0.492137f,-0.058279f,0.868565f}, -{-0.458589f,0.150160f,0.875870f}, -{-0.330693f,0.784698f,-0.524301f}, -{-0.492137f,-0.058279f,0.868565f}, -{0.056592f,0.684051f,0.727235f}, -{0.029983f,-0.232355f,0.972169f}, -{-0.243956f,0.825248f,-0.509364f}, -{-0.330693f,0.784698f,-0.524301f}, -{-0.276021f,0.641848f,-0.715433f}, -{-0.276021f,0.641848f,-0.715433f}, -{0.896895f,0.289706f,-0.334140f}, -{-0.243956f,0.825248f,-0.509364f}, -{0.684440f,-0.422099f,0.594453f}, -{-0.832833f,0.419088f,0.361599f}, -{-0.310490f,-0.158720f,0.937232f}, -{-0.310490f,-0.158720f,0.937232f}, -{0.990990f,-0.123953f,0.050743f}, -{0.684440f,-0.422099f,0.594453f}, -{0.471585f,-0.379214f,-0.796118f}, -{0.990990f,-0.123953f,0.050743f}, -{0.684440f,-0.422099f,0.594453f}, -{0.471585f,-0.379214f,-0.796118f}, -{0.310564f,0.143864f,-0.939603f}, -{0.990990f,-0.123953f,0.050743f}, -{-0.508722f,-0.782644f,0.358705f}, -{0.110626f,-0.629172f,0.769353f}, -{-0.310490f,-0.158720f,0.937232f}, -{-0.310490f,-0.158720f,0.937232f}, -{0.110626f,-0.629172f,0.769353f}, -{-0.999665f,-0.016924f,0.019604f}, -{-0.310490f,-0.158720f,0.937232f}, -{-0.999665f,-0.016924f,0.019604f}, -{-0.508722f,-0.782644f,0.358705f}, -{-0.508722f,-0.782644f,0.358705f}, -{-0.999665f,-0.016924f,0.019604f}, -{0.110626f,-0.629172f,0.769353f}, -{0.978822f,0.189139f,0.078319f}, -{0.799601f,0.586555f,-0.128808f}, -{0.978935f,0.057892f,-0.195791f}, -{0.895721f,0.419400f,-0.147605f}, -{0.978935f,0.057892f,-0.195791f}, -{0.799601f,0.586555f,-0.128808f}, -{0.895721f,0.419400f,-0.147605f}, -{0.909502f,0.114469f,-0.399629f}, -{0.978935f,0.057892f,-0.195791f}, -{0.896953f,-0.202900f,-0.392819f}, -{0.978822f,0.189139f,0.078319f}, -{0.978935f,0.057892f,-0.195791f}, -{0.909502f,0.114469f,-0.399629f}, -{0.896953f,-0.202900f,-0.392819f}, -{0.978935f,0.057892f,-0.195791f}, -{0.684765f,-0.276304f,-0.674354f}, -{0.896953f,-0.202900f,-0.392819f}, -{0.909502f,0.114469f,-0.399629f}, -{0.315234f,0.307499f,-0.897815f}, -{0.376178f,0.063480f,-0.924370f}, -{0.896953f,-0.202900f,-0.392819f}, -{0.896953f,-0.202900f,-0.392819f}, -{0.376178f,0.063480f,-0.924370f}, -{0.978822f,0.189139f,0.078319f}, -{0.705586f,0.025699f,-0.708158f}, -{0.684765f,-0.276304f,-0.674354f}, -{0.909502f,0.114469f,-0.399629f}, -{0.365018f,-0.102094f,-0.925386f}, -{0.315234f,0.307499f,-0.897815f}, -{0.896953f,-0.202900f,-0.392819f}, -{0.396845f,-0.326687f,-0.857782f}, -{0.365018f,-0.102094f,-0.925386f}, -{0.684765f,-0.276304f,-0.674354f}, -{0.684765f,-0.276304f,-0.674354f}, -{0.365018f,-0.102094f,-0.925386f}, -{0.896953f,-0.202900f,-0.392819f}, -{0.560179f,-0.208414f,-0.801725f}, -{0.684765f,-0.276304f,-0.674354f}, -{0.705586f,0.025699f,-0.708158f}, -{0.684765f,-0.276304f,-0.674354f}, -{0.560179f,-0.208414f,-0.801725f}, -{0.396845f,-0.326687f,-0.857782f}, -{0.365018f,-0.102094f,-0.925386f}, -{-0.347096f,0.445740f,-0.825130f}, -{0.315234f,0.307499f,-0.897815f}, -{0.315234f,0.307499f,-0.897815f}, -{-0.347096f,0.445740f,-0.825130f}, -{0.376178f,0.063480f,-0.924370f}, -{0.395088f,-0.199017f,-0.896827f}, -{0.396845f,-0.326687f,-0.857782f}, -{0.560179f,-0.208414f,-0.801725f}, -{0.112749f,-0.256784f,-0.959870f}, -{0.365018f,-0.102094f,-0.925386f}, -{0.396845f,-0.326687f,-0.857782f}, -{0.204648f,-0.217000f,-0.954479f}, -{0.396845f,-0.326687f,-0.857782f}, -{0.395088f,-0.199017f,-0.896827f}, -{0.396845f,-0.326687f,-0.857782f}, -{0.204648f,-0.217000f,-0.954479f}, -{0.112749f,-0.256784f,-0.959870f}, -{-0.118976f,-0.078121f,-0.989819f}, -{-0.347096f,0.445740f,-0.825130f}, -{0.365018f,-0.102094f,-0.925386f}, -{0.365018f,-0.102094f,-0.925386f}, -{0.112749f,-0.256784f,-0.959870f}, -{-0.118976f,-0.078121f,-0.989819f}, -{-0.006045f,-0.084607f,-0.996396f}, -{0.112749f,-0.256784f,-0.959870f}, -{0.204648f,-0.217000f,-0.954479f}, -{-0.006045f,-0.084607f,-0.996396f}, -{-0.118976f,-0.078121f,-0.989819f}, -{0.112749f,-0.256784f,-0.959870f}, -{-0.370925f,0.185437f,-0.909960f}, -{-0.347096f,0.445740f,-0.825130f}, -{-0.118976f,-0.078121f,-0.989819f}, -{-0.370925f,0.185437f,-0.909960f}, -{-0.118976f,-0.078121f,-0.989819f}, -{-0.006045f,-0.084607f,-0.996396f}, -{-0.602262f,0.541713f,-0.586369f}, -{-0.347096f,0.445740f,-0.825130f}, -{-0.370925f,0.185437f,-0.909960f}, -{0.000501f,0.173705f,-0.984798f}, -{-0.370925f,0.185437f,-0.909960f}, -{-0.006045f,-0.084607f,-0.996396f}, -{-0.370925f,0.185437f,-0.909960f}, -{0.000501f,0.173705f,-0.984798f}, -{-0.172056f,0.421403f,-0.890402f}, -{-0.175008f,0.794447f,-0.581572f}, -{-0.347096f,0.445740f,-0.825130f}, -{-0.602262f,0.541713f,-0.586369f}, -{-0.347096f,0.445740f,-0.825130f}, -{-0.175008f,0.794447f,-0.581572f}, -{-0.469991f,0.877912f,0.091534f}, -{-0.520696f,0.528607f,-0.670410f}, -{-0.602262f,0.541713f,-0.586369f}, -{-0.370925f,0.185437f,-0.909960f}, -{-0.602262f,0.541713f,-0.586369f}, -{-0.520696f,0.528607f,-0.670410f}, -{-0.175008f,0.794447f,-0.581572f}, -{-0.520696f,0.528607f,-0.670410f}, -{-0.172056f,0.421403f,-0.890402f}, -{0.018296f,0.623996f,-0.781214f}, -{-0.370925f,0.185437f,-0.909960f}, -{-0.172056f,0.421403f,-0.890402f}, -{-0.520696f,0.528607f,-0.670410f}, -{-0.520696f,0.528607f,-0.670410f}, -{0.018296f,0.623996f,-0.781214f}, -{-0.175008f,0.794447f,-0.581572f}, -{0.271568f,0.608361f,-0.745753f}, -{-0.175008f,0.794447f,-0.581572f}, -{0.018296f,0.623996f,-0.781214f}, -{-0.175008f,0.794447f,-0.581572f}, -{-0.001691f,0.910378f,-0.413774f}, -{-0.469991f,0.877912f,0.091534f}, -{0.978822f,0.189139f,0.078319f}, -{0.389407f,0.917268f,-0.083558f}, -{0.799601f,0.586555f,-0.128808f}, -{-0.469991f,0.877912f,0.091534f}, -{0.389407f,0.917268f,-0.083558f}, -{0.978822f,0.189139f,0.078319f}, -{-0.771662f,0.222797f,-0.595735f}, -{-0.469991f,0.877912f,0.091534f}, -{-0.609520f,0.157193f,0.777030f}, -{0.093003f,0.009710f,-0.995618f}, -{-0.006045f,-0.084607f,-0.996396f}, -{0.154202f,-0.039256f,-0.987259f}, -{0.154202f,-0.039256f,-0.987259f}, -{0.204648f,-0.217000f,-0.954479f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.395088f,-0.199017f,-0.896827f}, -{0.424145f,-0.020815f,-0.905355f}, -{0.424145f,-0.020815f,-0.905355f}, -{0.395088f,-0.199017f,-0.896827f}, -{0.552213f,-0.032889f,-0.833054f}, -{0.552213f,-0.032889f,-0.833054f}, -{0.560179f,-0.208414f,-0.801725f}, -{0.705586f,0.025699f,-0.708158f}, -{0.705586f,0.025699f,-0.708158f}, -{0.909502f,0.114469f,-0.399629f}, -{0.781353f,0.225266f,-0.582016f}, -{0.781353f,0.225266f,-0.582016f}, -{0.909502f,0.114469f,-0.399629f}, -{0.894765f,0.304007f,-0.327071f}, -{0.895721f,0.419400f,-0.147605f}, -{0.894765f,0.304007f,-0.327071f}, -{0.909502f,0.114469f,-0.399629f}, -{0.560179f,-0.208414f,-0.801725f}, -{0.552213f,-0.032889f,-0.833054f}, -{0.395088f,-0.199017f,-0.896827f}, -{0.395088f,-0.199017f,-0.896827f}, -{0.234090f,-0.070518f,-0.969654f}, -{0.204648f,-0.217000f,-0.954479f}, -{0.204648f,-0.217000f,-0.954479f}, -{0.154202f,-0.039256f,-0.987259f}, -{-0.006045f,-0.084607f,-0.996396f}, -{-0.006045f,-0.084607f,-0.996396f}, -{0.093003f,0.009710f,-0.995618f}, -{0.000501f,0.173705f,-0.984798f}, -{-0.469991f,0.877912f,0.091534f}, -{-0.771662f,0.222797f,-0.595735f}, -{-0.347096f,0.445740f,-0.825130f}, -{-0.476862f,-0.418624f,0.772889f}, -{0.282688f,-0.869536f,-0.404962f}, -{0.090842f,-0.706426f,0.701933f}, -{0.925951f,-0.365651f,-0.094413f}, -{0.090842f,-0.706426f,0.701933f}, -{0.282688f,-0.869536f,-0.404962f}, -{0.951249f,-0.066067f,-0.301265f}, -{0.353325f,0.570819f,0.741166f}, -{0.925951f,-0.365651f,-0.094413f}, -{0.925951f,-0.365651f,-0.094413f}, -{0.353325f,0.570819f,0.741166f}, -{0.090842f,-0.706426f,0.701933f}, -{0.353325f,0.570819f,0.741166f}, -{0.951249f,-0.066067f,-0.301265f}, -{0.894661f,-0.378257f,0.237706f}, -{0.824487f,-0.425770f,0.372749f}, -{0.894661f,-0.378257f,0.237706f}, -{0.951249f,-0.066067f,-0.301265f}, -{0.170181f,0.328361f,-0.929095f}, -{0.028694f,-0.784460f,0.619515f}, -{0.549144f,-0.113573f,-0.827975f}, -{0.282688f,-0.869536f,-0.404962f}, -{0.028694f,-0.784460f,0.619515f}, -{0.170181f,0.328361f,-0.929095f}, -{0.170181f,0.328361f,-0.929095f}, -{0.673077f,-0.041174f,-0.738425f}, -{0.282688f,-0.869536f,-0.404962f}, -{0.224894f,0.876939f,-0.424736f}, -{0.282688f,-0.869536f,-0.404962f}, -{0.673077f,-0.041174f,-0.738425f}, -{-0.313396f,0.513795f,-0.798622f}, -{0.549144f,-0.113573f,-0.827975f}, -{-0.771662f,0.222797f,-0.595735f}, -{0.549144f,-0.113573f,-0.827975f}, -{-0.313396f,0.513795f,-0.798622f}, -{0.170181f,0.328361f,-0.929095f}, -{0.170181f,0.328361f,-0.929095f}, -{0.224894f,0.876939f,-0.424736f}, -{0.673077f,-0.041174f,-0.738425f}, -{0.224894f,0.876939f,-0.424736f}, -{0.951249f,-0.066067f,-0.301265f}, -{0.282688f,-0.869536f,-0.404962f}, -{0.951249f,-0.066067f,-0.301265f}, -{0.925951f,-0.365651f,-0.094413f}, -{0.282688f,-0.869536f,-0.404962f}, -{0.224894f,0.876939f,-0.424736f}, -{0.170181f,0.328361f,-0.929095f}, -{-0.466786f,0.614812f,0.635702f}, -{0.170181f,0.328361f,-0.929095f}, -{-0.313396f,0.513795f,-0.798622f}, -{-0.616242f,0.611902f,0.495804f}, -{-0.616242f,0.611902f,0.495804f}, -{-0.466786f,0.614812f,0.635702f}, -{0.170181f,0.328361f,-0.929095f}, -{-0.525886f,0.559638f,0.640506f}, -{0.353325f,0.570819f,0.741166f}, -{0.224894f,0.876939f,-0.424736f}, -{0.353325f,0.570819f,0.741166f}, -{0.951249f,-0.066067f,-0.301265f}, -{0.224894f,0.876939f,-0.424736f}, -{-0.616242f,0.611902f,0.495804f}, -{-0.771662f,0.222797f,-0.595735f}, -{-0.609520f,0.157193f,0.777030f}, -{-0.771662f,0.222797f,-0.595735f}, -{-0.616242f,0.611902f,0.495804f}, -{-0.313396f,0.513795f,-0.798622f}, -{-0.525886f,0.559638f,0.640506f}, -{0.224894f,0.876939f,-0.424736f}, -{-0.466786f,0.614812f,0.635702f}, -{0.353325f,0.570819f,0.741166f}, -{-0.525886f,0.559638f,0.640506f}, -{-0.476862f,-0.418624f,0.772889f}, -{-0.466786f,0.614812f,0.635702f}, -{-0.476862f,-0.418624f,0.772889f}, -{-0.525886f,0.559638f,0.640506f}, -{-0.476862f,-0.418624f,0.772889f}, -{0.090842f,-0.706426f,0.701933f}, -{0.353325f,0.570819f,0.741166f}, -{-0.466786f,0.614812f,0.635702f}, -{-0.616242f,0.611902f,0.495804f}, -{0.028694f,-0.784460f,0.619515f}, -{-0.609520f,0.157193f,0.777030f}, -{0.028694f,-0.784460f,0.619515f}, -{-0.616242f,0.611902f,0.495804f}, -{0.282688f,-0.869536f,-0.404962f}, -{-0.476862f,-0.418624f,0.772889f}, -{0.028694f,-0.784460f,0.619515f}, -{0.028694f,-0.784460f,0.619515f}, -{-0.476862f,-0.418624f,0.772889f}, -{-0.466786f,0.614812f,0.635702f}, -{-0.469991f,0.877912f,0.091534f}, -{0.978822f,0.189139f,0.078319f}, -{-0.609520f,0.157193f,0.777030f}, -{0.978822f,0.189139f,0.078319f}, -{0.376178f,0.063480f,-0.924370f}, -{0.549144f,-0.113573f,-0.827975f}, -{0.376178f,0.063480f,-0.924370f}, -{-0.347096f,0.445740f,-0.825130f}, -{-0.771662f,0.222797f,-0.595735f}, -{0.028694f,-0.784460f,0.619515f}, -{-0.609520f,0.157193f,0.777030f}, -{0.978822f,0.189139f,0.078319f}, -{0.549144f,-0.113573f,-0.827975f}, -{0.028694f,-0.784460f,0.619515f}, -{0.978822f,0.189139f,0.078319f}, -{-0.771662f,0.222797f,-0.595735f}, -{0.549144f,-0.113573f,-0.827975f}, -{0.376178f,0.063480f,-0.924370f}}; + {-0.643897f, -0.625762f, -0.440249f}, {-0.733042f, -0.570025f, 0.371107f}, + {-0.796480f, -0.556747f, 0.235906f}, {-0.733042f, -0.570025f, 0.371107f}, + {-0.643897f, -0.625762f, -0.440249f}, {-0.557313f, -0.738582f, -0.379340f}, + {-0.557313f, -0.738582f, -0.379340f}, {-0.642754f, -0.761216f, 0.086129f}, + {-0.733042f, -0.570025f, 0.371107f}, {-0.452521f, -0.605412f, -0.654753f}, + {-0.642754f, -0.761216f, 0.086129f}, {-0.557313f, -0.738582f, -0.379340f}, + {-0.642754f, -0.761216f, 0.086129f}, {-0.452521f, -0.605412f, -0.654753f}, + {-0.747244f, -0.641429f, -0.173771f}, {-0.760333f, -0.433986f, -0.483269f}, + {-0.747244f, -0.641429f, -0.173771f}, {-0.452521f, -0.605412f, -0.654753f}, + {-0.747244f, -0.641429f, -0.173771f}, {-0.760333f, -0.433986f, -0.483269f}, + {-0.847343f, -0.525593f, -0.075905f}, {-0.936740f, -0.257134f, -0.237486f}, + {-0.958659f, -0.254635f, 0.127019f}, {-0.847343f, -0.525593f, -0.075905f}, + {-0.847343f, -0.525593f, -0.075905f}, {-0.760333f, -0.433986f, -0.483269f}, + {-0.936740f, -0.257134f, -0.237486f}, {-0.993996f, -0.108687f, -0.012591f}, + {-0.958659f, -0.254635f, 0.127019f}, {-0.936740f, -0.257134f, -0.237486f}, + {-0.958659f, -0.254635f, 0.127019f}, {-0.993996f, -0.108687f, -0.012591f}, + {-0.998091f, -0.059508f, -0.016551f}, {-0.452521f, -0.605412f, -0.654753f}, + {-0.557313f, -0.738582f, -0.379340f}, {-0.643897f, -0.625762f, -0.440249f}, + {-0.452521f, -0.605412f, -0.654753f}, {-0.637519f, -0.362869f, -0.679629f}, + {-0.760333f, -0.433986f, -0.483269f}, {-0.778525f, -0.178140f, -0.601801f}, + {-0.760333f, -0.433986f, -0.483269f}, {-0.637519f, -0.362869f, -0.679629f}, + {-0.760333f, -0.433986f, -0.483269f}, {-0.778525f, -0.178140f, -0.601801f}, + {-0.936740f, -0.257134f, -0.237486f}, {-0.440606f, -0.256999f, -0.860127f}, + {-0.637519f, -0.362869f, -0.679629f}, {-0.452521f, -0.605412f, -0.654753f}, + {-0.634710f, -0.070034f, -0.769570f}, {-0.637519f, -0.362869f, -0.679629f}, + {-0.440606f, -0.256999f, -0.860127f}, {-0.637519f, -0.362869f, -0.679629f}, + {-0.634710f, -0.070034f, -0.769570f}, {-0.778525f, -0.178140f, -0.601801f}, + {-0.452521f, -0.605412f, -0.654753f}, {-0.557313f, -0.738582f, -0.379340f}, + {-0.442724f, -0.602735f, -0.663857f}, {-0.442724f, -0.602735f, -0.663857f}, + {-0.557313f, -0.738582f, -0.379340f}, {-0.643897f, -0.625762f, -0.440249f}, + {-0.398389f, 0.113569f, -0.910158f}, {-0.440606f, -0.256999f, -0.860127f}, + {-0.090844f, -0.184718f, -0.978584f}, {-0.090844f, -0.184718f, -0.978584f}, + {-0.440606f, -0.256999f, -0.860127f}, {-0.452521f, -0.605412f, -0.654753f}, + {-0.398389f, 0.113569f, -0.910158f}, {-0.634710f, -0.070034f, -0.769570f}, + {-0.440606f, -0.256999f, -0.860127f}, {-0.019661f, 0.388870f, -0.921083f}, + {-0.186193f, 0.428663f, -0.884070f}, {-0.398389f, 0.113569f, -0.910158f}, + {-0.398389f, 0.113569f, -0.910158f}, {-0.090844f, -0.184718f, -0.978584f}, + {-0.019661f, 0.388870f, -0.921083f}, {0.287050f, 0.728087f, -0.622488f}, + {-0.186193f, 0.428663f, -0.884070f}, {-0.019661f, 0.388870f, -0.921083f}, + {0.042877f, -0.197790f, -0.979306f}, {-0.019661f, 0.388870f, -0.921083f}, + {-0.090844f, -0.184718f, -0.978584f}, {0.287050f, 0.728087f, -0.622488f}, + {-0.019661f, 0.388870f, -0.921083f}, {0.042877f, -0.197790f, -0.979306f}, + {-0.278250f, 0.635043f, -0.720623f}, {-0.186193f, 0.428663f, -0.884070f}, + {0.287050f, 0.728087f, -0.622488f}, {0.821866f, 0.360450f, -0.441149f}, + {0.287050f, 0.728087f, -0.622488f}, {0.641193f, 0.754088f, -0.142208f}, + {0.641193f, 0.754088f, -0.142208f}, {0.287050f, 0.728087f, -0.622488f}, + {0.042877f, -0.197790f, -0.979306f}, {0.821866f, 0.360450f, -0.441149f}, + {0.230458f, 0.971546f, 0.054663f}, {0.284305f, 0.951327f, -0.118946f}, + {0.284305f, 0.951327f, -0.118946f}, {0.287050f, 0.728087f, -0.622488f}, + {0.821866f, 0.360450f, -0.441149f}, {0.821866f, 0.360450f, -0.441149f}, + {0.042877f, -0.197790f, -0.979306f}, {0.082124f, -0.826703f, -0.556612f}, + {0.821866f, 0.360450f, -0.441149f}, {0.641193f, 0.754088f, -0.142208f}, + {0.042877f, -0.197790f, -0.979306f}, {0.852965f, 0.480626f, 0.203590f}, + {0.457403f, 0.886731f, -0.067019f}, {0.821866f, 0.360450f, -0.441149f}, + {0.091380f, 0.995375f, -0.029645f}, {0.230458f, 0.971546f, 0.054663f}, + {0.457403f, 0.886731f, -0.067019f}, {0.230458f, 0.971546f, 0.054663f}, + {0.821866f, 0.360450f, -0.441149f}, {0.457403f, 0.886731f, -0.067019f}, + {0.852965f, 0.480626f, 0.203590f}, {0.821866f, 0.360450f, -0.441149f}, + {0.326383f, -0.937944f, 0.117199f}, {0.326383f, -0.937944f, 0.117199f}, + {0.821866f, 0.360450f, -0.441149f}, {0.082124f, -0.826703f, -0.556612f}, + {0.852965f, 0.480626f, 0.203590f}, {0.391443f, 0.867414f, 0.307189f}, + {0.457403f, 0.886731f, -0.067019f}, {0.391443f, 0.867414f, 0.307189f}, + {0.171867f, 0.984952f, 0.018213f}, {0.457403f, 0.886731f, -0.067019f}, + {0.457403f, 0.886731f, -0.067019f}, {0.171867f, 0.984952f, 0.018213f}, + {0.091380f, 0.995375f, -0.029645f}, {0.326383f, -0.937944f, 0.117199f}, + {0.638555f, 0.563372f, -0.524271f}, {0.852965f, 0.480626f, 0.203590f}, + {0.852965f, 0.480626f, 0.203590f}, {0.638555f, 0.563372f, -0.524271f}, + {0.380659f, 0.883110f, 0.274255f}, {0.380659f, 0.883110f, 0.274255f}, + {0.391443f, 0.867414f, 0.307189f}, {0.852965f, 0.480626f, 0.203590f}, + {0.380659f, 0.883110f, 0.274255f}, {0.638555f, 0.563372f, -0.524271f}, + {0.323534f, 0.555600f, 0.765921f}, {0.391443f, 0.867414f, 0.307189f}, + {0.380659f, 0.883110f, 0.274255f}, {0.323534f, 0.555600f, 0.765921f}, + {0.391443f, 0.867414f, 0.307189f}, {0.323534f, 0.555600f, 0.765921f}, + {-0.169148f, 0.752509f, 0.636489f}, {-0.479804f, -0.294644f, 0.826422f}, + {-0.323965f, -0.562074f, 0.760999f}, {0.638555f, 0.563372f, -0.524271f}, + {-0.383781f, 0.133156f, 0.913773f}, {0.323534f, 0.555600f, 0.765921f}, + {-0.323965f, -0.562074f, 0.760999f}, {0.638555f, 0.563372f, -0.524271f}, + {-0.323965f, -0.562074f, 0.760999f}, {0.323534f, 0.555600f, 0.765921f}, + {0.323534f, 0.555600f, 0.765921f}, {-0.383781f, 0.133156f, 0.913773f}, + {-0.169148f, 0.752509f, 0.636489f}, {-0.509397f, -0.633656f, 0.582233f}, + {-0.323965f, -0.562074f, 0.760999f}, {0.090523f, -0.836358f, 0.540658f}, + {-0.323965f, -0.562074f, 0.760999f}, {-0.509397f, -0.633656f, 0.582233f}, + {-0.479804f, -0.294644f, 0.826422f}, {-0.515082f, -0.226506f, 0.826671f}, + {-0.383781f, 0.133156f, 0.913773f}, {-0.323965f, -0.562074f, 0.760999f}, + {-0.479804f, -0.294644f, 0.826422f}, {-0.515082f, -0.226506f, 0.826671f}, + {-0.323965f, -0.562074f, 0.760999f}, {-0.509397f, -0.633656f, 0.582233f}, + {0.090523f, -0.836358f, 0.540658f}, {-0.258966f, -0.584187f, 0.769196f}, + {-0.540569f, -0.299709f, 0.786104f}, {-0.479804f, -0.294644f, 0.826422f}, + {-0.509397f, -0.633656f, 0.582233f}, {-0.479804f, -0.294644f, 0.826422f}, + {-0.540569f, -0.299709f, 0.786104f}, {-0.515082f, -0.226506f, 0.826671f}, + {-0.571065f, -0.018014f, 0.820707f}, {-0.515082f, -0.226506f, 0.826671f}, + {-0.540569f, -0.299709f, 0.786104f}, {-0.515082f, -0.226506f, 0.826671f}, + {-0.571065f, -0.018014f, 0.820707f}, {-0.383781f, 0.133156f, 0.913773f}, + {-0.642754f, -0.761216f, 0.086129f}, {-0.521880f, -0.609673f, 0.596608f}, + {-0.733042f, -0.570025f, 0.371107f}, {-0.521880f, -0.609673f, 0.596608f}, + {-0.642754f, -0.761216f, 0.086129f}, {-0.509397f, -0.633656f, 0.582233f}, + {-0.509397f, -0.633656f, 0.582233f}, {-0.258966f, -0.584187f, 0.769196f}, + {-0.521880f, -0.609673f, 0.596608f}, {-0.739603f, -0.203658f, 0.641491f}, + {-0.571065f, -0.018014f, 0.820707f}, {-0.540569f, -0.299709f, 0.786104f}, + {-0.721820f, -0.653257f, 0.228542f}, {-0.509397f, -0.633656f, 0.582233f}, + {-0.642754f, -0.761216f, 0.086129f}, {-0.776219f, -0.526329f, 0.347076f}, + {-0.509397f, -0.633656f, 0.582233f}, {-0.721820f, -0.653257f, 0.228542f}, + {-0.509397f, -0.633656f, 0.582233f}, {-0.776219f, -0.526329f, 0.347076f}, + {-0.540569f, -0.299709f, 0.786104f}, {-0.958659f, -0.254635f, 0.127019f}, + {-0.739603f, -0.203658f, 0.641491f}, {-0.776219f, -0.526329f, 0.347076f}, + {-0.776219f, -0.526329f, 0.347076f}, {-0.739603f, -0.203658f, 0.641491f}, + {-0.540569f, -0.299709f, 0.786104f}, {-0.642754f, -0.761216f, 0.086129f}, + {-0.747244f, -0.641429f, -0.173771f}, {-0.721820f, -0.653257f, 0.228542f}, + {-0.847343f, -0.525593f, -0.075905f}, {-0.776219f, -0.526329f, 0.347076f}, + {-0.747244f, -0.641429f, -0.173771f}, {-0.747244f, -0.641429f, -0.173771f}, + {-0.776219f, -0.526329f, 0.347076f}, {-0.721820f, -0.653257f, 0.228542f}, + {-0.776219f, -0.526329f, 0.347076f}, {-0.847343f, -0.525593f, -0.075905f}, + {-0.958659f, -0.254635f, 0.127019f}, {-0.998091f, -0.059508f, -0.016551f}, + {-0.988032f, -0.151826f, -0.027217f}, {-0.958659f, -0.254635f, 0.127019f}, + {-0.243728f, -0.567734f, -0.786304f}, {-0.019689f, -0.435906f, -0.899777f}, + {-0.090844f, -0.184718f, -0.978584f}, {-0.323965f, -0.562074f, 0.760999f}, + {-0.258966f, -0.584187f, 0.769196f}, {0.090523f, -0.836358f, 0.540658f}, + {-0.984283f, -0.051648f, 0.168875f}, {-0.977075f, -0.105183f, 0.185099f}, + {-0.988032f, -0.151826f, -0.027217f}, {-0.977075f, -0.105183f, 0.185099f}, + {-0.861320f, 0.008996f, 0.507982f}, {-0.958659f, -0.254635f, 0.127019f}, + {-0.861320f, 0.008996f, 0.507982f}, {-0.699688f, 0.204704f, 0.684495f}, + {-0.571065f, -0.018014f, 0.820707f}, {-0.699688f, 0.204704f, 0.684495f}, + {-0.518049f, 0.451465f, 0.726502f}, {-0.383781f, 0.133156f, 0.913773f}, + {-0.518049f, 0.451465f, 0.726502f}, {-0.169148f, 0.752509f, 0.636489f}, + {-0.383781f, 0.133156f, 0.913773f}, {0.155388f, 0.934199f, 0.321135f}, + {0.171867f, 0.984952f, 0.018213f}, {0.391443f, 0.867414f, 0.307189f}, + {0.284305f, 0.951327f, -0.118946f}, {0.079728f, 0.876478f, -0.474795f}, + {0.287050f, 0.728087f, -0.622488f}, {-0.278250f, 0.635043f, -0.720623f}, + {-0.519937f, 0.399504f, -0.755024f}, {-0.186193f, 0.428663f, -0.884070f}, + {-0.519937f, 0.399504f, -0.755024f}, {-0.704461f, 0.199354f, -0.681170f}, + {-0.398389f, 0.113569f, -0.910158f}, {-0.704461f, 0.199354f, -0.681170f}, + {-0.857051f, 0.000315f, -0.515232f}, {-0.634710f, -0.070034f, -0.769570f}, + {-0.857051f, 0.000315f, -0.515232f}, {-0.954040f, -0.136257f, -0.266912f}, + {-0.936740f, -0.257134f, -0.237486f}, {-0.643897f, -0.625762f, -0.440249f}, + {-0.796480f, -0.556747f, 0.235906f}, {-0.807580f, -0.530334f, -0.257994f}, + {-0.998091f, -0.059508f, -0.016551f}, {-0.993996f, -0.108687f, -0.012591f}, + {-0.954040f, -0.136257f, -0.266912f}, {-0.993996f, -0.108687f, -0.012591f}, + {-0.936740f, -0.257134f, -0.237486f}, {-0.954040f, -0.136257f, -0.266912f}, + {-0.936740f, -0.257134f, -0.237486f}, {-0.778525f, -0.178140f, -0.601801f}, + {-0.857051f, 0.000315f, -0.515232f}, {-0.778525f, -0.178140f, -0.601801f}, + {-0.634710f, -0.070034f, -0.769570f}, {-0.857051f, 0.000315f, -0.515232f}, + {-0.442724f, -0.602735f, -0.663857f}, {-0.643897f, -0.625762f, -0.440249f}, + {-0.243728f, -0.567734f, -0.786304f}, {-0.634710f, -0.070034f, -0.769570f}, + {-0.398389f, 0.113569f, -0.910158f}, {-0.704461f, 0.199354f, -0.681170f}, + {-0.090844f, -0.184718f, -0.978584f}, {-0.452521f, -0.605412f, -0.654753f}, + {-0.243728f, -0.567734f, -0.786304f}, {-0.452521f, -0.605412f, -0.654753f}, + {-0.442724f, -0.602735f, -0.663857f}, {-0.243728f, -0.567734f, -0.786304f}, + {-0.398389f, 0.113569f, -0.910158f}, {-0.186193f, 0.428663f, -0.884070f}, + {-0.519937f, 0.399504f, -0.755024f}, {-0.278250f, 0.635043f, -0.720623f}, + {0.287050f, 0.728087f, -0.622488f}, {0.079728f, 0.876478f, -0.474795f}, + {0.284305f, 0.951327f, -0.118946f}, {0.230458f, 0.971546f, 0.054663f}, + {0.194831f, 0.980831f, 0.003437f}, {0.391443f, 0.867414f, 0.307189f}, + {-0.169148f, 0.752509f, 0.636489f}, {0.155388f, 0.934199f, 0.321135f}, + {-0.383781f, 0.133156f, 0.913773f}, {-0.571065f, -0.018014f, 0.820707f}, + {-0.699688f, 0.204704f, 0.684495f}, {-0.571065f, -0.018014f, 0.820707f}, + {-0.739603f, -0.203658f, 0.641491f}, {-0.861320f, 0.008996f, 0.507982f}, + {-0.739603f, -0.203658f, 0.641491f}, {-0.958659f, -0.254635f, 0.127019f}, + {-0.861320f, 0.008996f, 0.507982f}, {-0.988032f, -0.151826f, -0.027217f}, + {-0.998091f, -0.059508f, -0.016551f}, {-0.984283f, -0.051648f, 0.168875f}, + {-0.958659f, -0.254635f, 0.127019f}, {-0.988032f, -0.151826f, -0.027217f}, + {-0.977075f, -0.105183f, 0.185099f}, {0.091380f, 0.995375f, -0.029645f}, + {0.053011f, 0.996626f, 0.062659f}, {0.230458f, 0.971546f, 0.054663f}, + {0.620591f, -0.499874f, -0.604147f}, {0.865167f, -0.282605f, -0.414271f}, + {0.284753f, -0.804205f, -0.521699f}, {0.794733f, -0.564204f, -0.223772f}, + {0.284753f, -0.804205f, -0.521699f}, {0.865167f, -0.282605f, -0.414271f}, + {0.794733f, -0.564204f, -0.223772f}, {0.905975f, -0.285316f, 0.312736f}, + {0.731439f, -0.641897f, 0.230140f}, {0.905975f, -0.285316f, 0.312736f}, + {0.794733f, -0.564204f, -0.223772f}, {0.865167f, -0.282605f, -0.414271f}, + {0.377927f, -0.670422f, 0.638518f}, {0.731439f, -0.641897f, 0.230140f}, + {0.905975f, -0.285316f, 0.312736f}, {0.377927f, -0.670422f, 0.638518f}, + {0.905975f, -0.285316f, 0.312736f}, {0.494162f, -0.533573f, 0.686370f}, + {0.494162f, -0.533573f, 0.686370f}, {0.905975f, -0.285316f, 0.312736f}, + {0.727540f, -0.551473f, 0.408122f}, {0.955992f, -0.182282f, -0.229898f}, + {0.905975f, -0.285316f, 0.312736f}, {0.865167f, -0.282605f, -0.414271f}, + {0.897263f, -0.335441f, 0.287051f}, {0.905975f, -0.285316f, 0.312736f}, + {0.955992f, -0.182282f, -0.229898f}, {0.597464f, -0.400423f, -0.694765f}, + {0.436552f, -0.507212f, -0.743073f}, {0.865167f, -0.282605f, -0.414271f}, + {0.597464f, -0.400423f, -0.694765f}, {0.865167f, -0.282605f, -0.414271f}, + {0.620591f, -0.499874f, -0.604147f}, {0.284753f, -0.804205f, -0.521699f}, + {0.597464f, -0.400423f, -0.694765f}, {0.620591f, -0.499874f, -0.604147f}, + {0.597464f, -0.400423f, -0.694765f}, {0.284753f, -0.804205f, -0.521699f}, + {0.434623f, -0.584735f, -0.684973f}, {0.794733f, -0.564204f, -0.223772f}, + {0.434623f, -0.584735f, -0.684973f}, {0.284753f, -0.804205f, -0.521699f}, + {0.284753f, -0.804205f, -0.521699f}, {0.794733f, -0.564204f, -0.223772f}, + {0.057722f, -0.995047f, 0.080931f}, {0.057722f, -0.995047f, 0.080931f}, + {0.794733f, -0.564204f, -0.223772f}, {0.731439f, -0.641897f, 0.230140f}, + {0.057722f, -0.995047f, 0.080931f}, {0.731439f, -0.641897f, 0.230140f}, + {0.377927f, -0.670422f, 0.638518f}, {0.865167f, -0.282605f, -0.414271f}, + {0.830792f, -0.235644f, -0.504239f}, {0.955992f, -0.182282f, -0.229898f}, + {0.830792f, -0.235644f, -0.504239f}, {0.865167f, -0.282605f, -0.414271f}, + {0.641591f, -0.300012f, -0.705942f}, {0.436552f, -0.507212f, -0.743073f}, + {0.641591f, -0.300012f, -0.705942f}, {0.865167f, -0.282605f, -0.414271f}, + {0.641591f, -0.300012f, -0.705942f}, {0.436552f, -0.507212f, -0.743073f}, + {0.597464f, -0.400423f, -0.694765f}, {0.059714f, -0.610369f, -0.789863f}, + {0.597464f, -0.400423f, -0.694765f}, {0.434623f, -0.584735f, -0.684973f}, + {0.434623f, -0.584735f, -0.684973f}, {-0.077148f, -0.752303f, -0.654285f}, + {0.059714f, -0.610369f, -0.789863f}, {-0.077148f, -0.752303f, -0.654285f}, + {0.434623f, -0.584735f, -0.684973f}, {0.284753f, -0.804205f, -0.521699f}, + {0.082124f, -0.826703f, -0.556612f}, {-0.077148f, -0.752303f, -0.654285f}, + {0.284753f, -0.804205f, -0.521699f}, {0.057722f, -0.995047f, 0.080931f}, + {0.326383f, -0.937944f, 0.117199f}, {0.284753f, -0.804205f, -0.521699f}, + {0.326383f, -0.937944f, 0.117199f}, {0.082124f, -0.826703f, -0.556612f}, + {0.284753f, -0.804205f, -0.521699f}, {0.050233f, -0.840017f, 0.540230f}, + {0.057722f, -0.995047f, 0.080931f}, {0.377927f, -0.670422f, 0.638518f}, + {0.057722f, -0.995047f, 0.080931f}, {0.050233f, -0.840017f, 0.540230f}, + {0.326383f, -0.937944f, 0.117199f}, {-0.037199f, -0.690716f, 0.722169f}, + {0.050233f, -0.840017f, 0.540230f}, {0.377927f, -0.670422f, 0.638518f}, + {0.494162f, -0.533573f, 0.686370f}, {-0.037199f, -0.690716f, 0.722169f}, + {0.377927f, -0.670422f, 0.638518f}, {0.727540f, -0.551473f, 0.408122f}, + {0.775380f, -0.270998f, 0.570391f}, {0.494162f, -0.533573f, 0.686370f}, + {0.905975f, -0.285316f, 0.312736f}, {0.775380f, -0.270998f, 0.570391f}, + {0.727540f, -0.551473f, 0.408122f}, {0.905975f, -0.285316f, 0.312736f}, + {0.711881f, -0.387475f, 0.585738f}, {0.775380f, -0.270998f, 0.570391f}, + {0.711881f, -0.387475f, 0.585738f}, {0.905975f, -0.285316f, 0.312736f}, + {0.897263f, -0.335441f, 0.287051f}, {0.946658f, -0.224326f, -0.231337f}, + {0.897263f, -0.335441f, 0.287051f}, {0.955992f, -0.182282f, -0.229898f}, + {0.897263f, -0.335441f, 0.287051f}, {0.946658f, -0.224326f, -0.231337f}, + {0.957081f, -0.194526f, 0.214836f}, {0.447404f, -0.239211f, -0.861747f}, + {0.641591f, -0.300012f, -0.705942f}, {0.597464f, -0.400423f, -0.694765f}, + {0.375415f, -0.352812f, -0.857081f}, {0.447404f, -0.239211f, -0.861747f}, + {0.597464f, -0.400423f, -0.694765f}, {0.057774f, -0.634148f, -0.771050f}, + {0.375415f, -0.352812f, -0.857081f}, {0.597464f, -0.400423f, -0.694765f}, + {0.059714f, -0.610369f, -0.789863f}, {0.057774f, -0.634148f, -0.771050f}, + {0.597464f, -0.400423f, -0.694765f}, {0.326383f, -0.937944f, 0.117199f}, + {0.050233f, -0.840017f, 0.540230f}, {0.638555f, 0.563372f, -0.524271f}, + {0.112344f, -0.521124f, 0.846055f}, {-0.037199f, -0.690716f, 0.722169f}, + {0.494162f, -0.533573f, 0.686370f}, {0.494162f, -0.533573f, 0.686370f}, + {0.428002f, -0.339070f, 0.837762f}, {0.112344f, -0.521124f, 0.846055f}, + {0.494162f, -0.533573f, 0.686370f}, {0.569239f, -0.127567f, 0.812215f}, + {0.428002f, -0.339070f, 0.837762f}, {0.494162f, -0.533573f, 0.686370f}, + {0.775380f, -0.270998f, 0.570391f}, {0.569239f, -0.127567f, 0.812215f}, + {0.711881f, -0.387475f, 0.585738f}, {0.897263f, -0.335441f, 0.287051f}, + {0.957081f, -0.194526f, 0.214836f}, {0.774173f, -0.231223f, -0.589231f}, + {0.946658f, -0.224326f, -0.231337f}, {0.955992f, -0.182282f, -0.229898f}, + {0.830792f, -0.235644f, -0.504239f}, {0.774173f, -0.231223f, -0.589231f}, + {0.955992f, -0.182282f, -0.229898f}, {0.615604f, -0.093277f, -0.782516f}, + {0.774173f, -0.231223f, -0.589231f}, {0.641591f, -0.300012f, -0.705942f}, + {0.774173f, -0.231223f, -0.589231f}, {0.830792f, -0.235644f, -0.504239f}, + {0.641591f, -0.300012f, -0.705942f}, {0.641591f, -0.300012f, -0.705942f}, + {0.491392f, -0.105577f, -0.864515f}, {0.615604f, -0.093277f, -0.782516f}, + {0.447404f, -0.239211f, -0.861747f}, {0.491392f, -0.105577f, -0.864515f}, + {0.641591f, -0.300012f, -0.705942f}, {0.375415f, -0.352812f, -0.857081f}, + {0.107082f, -0.340453f, -0.934144f}, {0.447404f, -0.239211f, -0.861747f}, + {0.057774f, -0.634148f, -0.771050f}, {0.107082f, -0.340453f, -0.934144f}, + {0.375415f, -0.352812f, -0.857081f}, {0.059714f, -0.610369f, -0.789863f}, + {-0.086571f, -0.554962f, -0.827359f}, {0.057774f, -0.634148f, -0.771050f}, + {-0.086571f, -0.554962f, -0.827359f}, {0.059714f, -0.610369f, -0.789863f}, + {-0.169205f, -0.681509f, -0.711980f}, {-0.077148f, -0.752303f, -0.654285f}, + {-0.169205f, -0.681509f, -0.711980f}, {0.059714f, -0.610369f, -0.789863f}, + {-0.077148f, -0.752303f, -0.654285f}, {-0.125367f, -0.654637f, -0.745475f}, + {-0.169205f, -0.681509f, -0.711980f}, {-0.125367f, -0.654637f, -0.745475f}, + {0.082124f, -0.826703f, -0.556612f}, {0.042877f, -0.197790f, -0.979306f}, + {0.082124f, -0.826703f, -0.556612f}, {-0.125367f, -0.654637f, -0.745475f}, + {-0.077148f, -0.752303f, -0.654285f}, {0.050233f, -0.840017f, 0.540230f}, + {-0.069496f, -0.587019f, 0.806585f}, {0.323534f, 0.555600f, 0.765921f}, + {-0.037199f, -0.690716f, 0.722169f}, {-0.069496f, -0.587019f, 0.806585f}, + {0.050233f, -0.840017f, 0.540230f}, {-0.069496f, -0.587019f, 0.806585f}, + {-0.037199f, -0.690716f, 0.722169f}, {-0.166613f, -0.620232f, 0.766520f}, + {0.112344f, -0.521124f, 0.846055f}, {-0.166613f, -0.620232f, 0.766520f}, + {-0.037199f, -0.690716f, 0.722169f}, {0.229739f, -0.190651f, 0.954396f}, + {0.112344f, -0.521124f, 0.846055f}, {0.428002f, -0.339070f, 0.837762f}, + {0.229739f, -0.190651f, 0.954396f}, {0.428002f, -0.339070f, 0.837762f}, + {0.569239f, -0.127567f, 0.812215f}, {0.775380f, -0.270998f, 0.570391f}, + {0.544375f, -0.130958f, 0.828556f}, {0.569239f, -0.127567f, 0.812215f}, + {0.775380f, -0.270998f, 0.570391f}, {0.621653f, -0.272622f, 0.734319f}, + {0.544375f, -0.130958f, 0.828556f}, {0.775380f, -0.270998f, 0.570391f}, + {0.711881f, -0.387475f, 0.585738f}, {0.831595f, -0.152778f, 0.533955f}, + {0.621653f, -0.272622f, 0.734319f}, {0.775380f, -0.270998f, 0.570391f}, + {0.831595f, -0.152778f, 0.533955f}, {0.957081f, -0.194526f, 0.214836f}, + {0.831595f, -0.152778f, 0.533955f}, {0.711881f, -0.387475f, 0.585738f}, + {0.948798f, -0.108951f, -0.296501f}, {0.957081f, -0.194526f, 0.214836f}, + {0.946658f, -0.224326f, -0.231337f}, {0.957081f, -0.194526f, 0.214836f}, + {0.948798f, -0.108951f, -0.296501f}, {0.991941f, -0.008091f, 0.126439f}, + {0.946658f, -0.224326f, -0.231337f}, {0.845738f, -0.047474f, -0.531482f}, + {0.948798f, -0.108951f, -0.296501f}, {0.845738f, -0.047474f, -0.531482f}, + {0.946658f, -0.224326f, -0.231337f}, {0.774173f, -0.231223f, -0.589231f}, + {0.447404f, -0.239211f, -0.861747f}, {0.258663f, -0.124805f, -0.957871f}, + {0.491392f, -0.105577f, -0.864515f}, {0.107082f, -0.340453f, -0.934144f}, + {0.258663f, -0.124805f, -0.957871f}, {0.447404f, -0.239211f, -0.861747f}, + {-0.165337f, -0.517504f, -0.839555f}, {0.107082f, -0.340453f, -0.934144f}, + {0.057774f, -0.634148f, -0.771050f}, {-0.086571f, -0.554962f, -0.827359f}, + {-0.165337f, -0.517504f, -0.839555f}, {0.057774f, -0.634148f, -0.771050f}, + {-0.225805f, -0.587739f, -0.776901f}, {-0.169205f, -0.681509f, -0.711980f}, + {-0.125367f, -0.654637f, -0.745475f}, {-0.019689f, -0.435906f, -0.899777f}, + {-0.125367f, -0.654637f, -0.745475f}, {0.042877f, -0.197790f, -0.979306f}, + {-0.125367f, -0.654637f, -0.745475f}, {-0.019689f, -0.435906f, -0.899777f}, + {-0.225805f, -0.587739f, -0.776901f}, {-0.084651f, -0.587452f, 0.804819f}, + {-0.323965f, -0.562074f, 0.760999f}, {0.323534f, 0.555600f, 0.765921f}, + {-0.069496f, -0.587019f, 0.806585f}, {-0.084651f, -0.587452f, 0.804819f}, + {0.323534f, 0.555600f, 0.765921f}, {-0.063776f, -0.450833f, 0.890327f}, + {-0.166613f, -0.620232f, 0.766520f}, {0.112344f, -0.521124f, 0.846055f}, + {0.229739f, -0.190651f, 0.954396f}, {-0.063776f, -0.450833f, 0.890327f}, + {0.112344f, -0.521124f, 0.846055f}, {0.411118f, 0.050506f, 0.910182f}, + {0.229739f, -0.190651f, 0.954396f}, {0.569239f, -0.127567f, 0.812215f}, + {0.544375f, -0.130958f, 0.828556f}, {0.411118f, 0.050506f, 0.910182f}, + {0.569239f, -0.127567f, 0.812215f}, {0.544375f, -0.130958f, 0.828556f}, + {0.621653f, -0.272622f, 0.734319f}, {0.831595f, -0.152778f, 0.533955f}, + {0.991941f, -0.008091f, 0.126439f}, {0.857203f, -0.004873f, 0.514956f}, + {0.957081f, -0.194526f, 0.214836f}, {0.957081f, -0.194526f, 0.214836f}, + {0.857203f, -0.004873f, 0.514956f}, {0.831595f, -0.152778f, 0.533955f}, + {0.845738f, -0.047474f, -0.531482f}, {0.774173f, -0.231223f, -0.589231f}, + {0.659882f, 0.017743f, -0.751160f}, {0.615604f, -0.093277f, -0.782516f}, + {0.659882f, 0.017743f, -0.751160f}, {0.774173f, -0.231223f, -0.589231f}, + {0.659882f, 0.017743f, -0.751160f}, {0.615604f, -0.093277f, -0.782516f}, + {0.478818f, 0.067491f, -0.875316f}, {0.491392f, -0.105577f, -0.864515f}, + {0.478818f, 0.067491f, -0.875316f}, {0.615604f, -0.093277f, -0.782516f}, + {0.491392f, -0.105577f, -0.864515f}, {0.258663f, -0.124805f, -0.957871f}, + {0.478818f, 0.067491f, -0.875316f}, {0.127284f, -0.160096f, -0.978861f}, + {0.258663f, -0.124805f, -0.957871f}, {0.107082f, -0.340453f, -0.934144f}, + {-0.165337f, -0.517504f, -0.839555f}, {0.127284f, -0.160096f, -0.978861f}, + {0.107082f, -0.340453f, -0.934144f}, {-0.086571f, -0.554962f, -0.827359f}, + {-0.193053f, -0.500818f, -0.843749f}, {-0.165337f, -0.517504f, -0.839555f}, + {-0.193053f, -0.500818f, -0.843749f}, {-0.086571f, -0.554962f, -0.827359f}, + {-0.317524f, -0.620412f, -0.717124f}, {-0.317524f, -0.620412f, -0.717124f}, + {-0.225805f, -0.587739f, -0.776901f}, {-0.193053f, -0.500818f, -0.843749f}, + {-0.169205f, -0.681509f, -0.711980f}, {-0.225805f, -0.587739f, -0.776901f}, + {-0.317524f, -0.620412f, -0.717124f}, {-0.317524f, -0.620412f, -0.717124f}, + {-0.086571f, -0.554962f, -0.827359f}, {-0.169205f, -0.681509f, -0.711980f}, + {-0.153380f, -0.642062f, 0.751153f}, {-0.084651f, -0.587452f, 0.804819f}, + {-0.069496f, -0.587019f, 0.806585f}, {-0.069496f, -0.587019f, 0.806585f}, + {-0.166613f, -0.620232f, 0.766520f}, {-0.153380f, -0.642062f, 0.751153f}, + {-0.166613f, -0.620232f, 0.766520f}, {-0.234185f, -0.582943f, 0.778033f}, + {-0.153380f, -0.642062f, 0.751153f}, {-0.234185f, -0.582943f, 0.778033f}, + {-0.166613f, -0.620232f, 0.766520f}, {-0.063776f, -0.450833f, 0.890327f}, + {0.229739f, -0.190651f, 0.954396f}, {0.179281f, -0.164585f, 0.969933f}, + {-0.063776f, -0.450833f, 0.890327f}, {0.229739f, -0.190651f, 0.954396f}, + {0.411118f, 0.050506f, 0.910182f}, {0.179281f, -0.164585f, 0.969933f}, + {0.527283f, -0.011259f, 0.849615f}, {0.411118f, 0.050506f, 0.910182f}, + {0.544375f, -0.130958f, 0.828556f}, {0.831595f, -0.152778f, 0.533955f}, + {0.527283f, -0.011259f, 0.849615f}, {0.544375f, -0.130958f, 0.828556f}, + {0.527283f, -0.011259f, 0.849615f}, {0.831595f, -0.152778f, 0.533955f}, + {0.857203f, -0.004873f, 0.514956f}, {0.918800f, 0.243044f, -0.311025f}, + {0.991941f, -0.008091f, 0.126439f}, {0.948798f, -0.108951f, -0.296501f}, + {0.991941f, -0.008091f, 0.126439f}, {0.918800f, 0.243044f, -0.311025f}, + {0.927065f, 0.363616f, 0.091291f}, {0.739626f, 0.244446f, -0.627056f}, + {0.948798f, -0.108951f, -0.296501f}, {0.845738f, -0.047474f, -0.531482f}, + {0.948798f, -0.108951f, -0.296501f}, {0.739626f, 0.244446f, -0.627056f}, + {0.918800f, 0.243044f, -0.311025f}, {0.478818f, 0.067491f, -0.875316f}, + {0.739626f, 0.244446f, -0.627056f}, {0.659882f, 0.017743f, -0.751160f}, + {0.659882f, 0.017743f, -0.751160f}, {0.739626f, 0.244446f, -0.627056f}, + {0.845738f, -0.047474f, -0.531482f}, {0.258663f, -0.124805f, -0.957871f}, + {0.274301f, 0.028423f, -0.961224f}, {0.478818f, 0.067491f, -0.875316f}, + {0.258663f, -0.124805f, -0.957871f}, {0.127284f, -0.160096f, -0.978861f}, + {0.274301f, 0.028423f, -0.961224f}, {-0.067677f, -0.209660f, -0.975429f}, + {0.127284f, -0.160096f, -0.978861f}, {-0.165337f, -0.517504f, -0.839555f}, + {-0.067677f, -0.209660f, -0.975429f}, {-0.165337f, -0.517504f, -0.839555f}, + {-0.193053f, -0.500818f, -0.843749f}, {-0.193053f, -0.500818f, -0.843749f}, + {-0.225805f, -0.587739f, -0.776901f}, {-0.209838f, -0.630881f, -0.746966f}, + {-0.225805f, -0.587739f, -0.776901f}, {-0.243728f, -0.567734f, -0.786304f}, + {-0.209838f, -0.630881f, -0.746966f}, {-0.265754f, -0.553200f, 0.789522f}, + {-0.258966f, -0.584187f, 0.769196f}, {-0.084651f, -0.587452f, 0.804819f}, + {-0.153380f, -0.642062f, 0.751153f}, {-0.265754f, -0.553200f, 0.789522f}, + {-0.084651f, -0.587452f, 0.804819f}, {-0.265754f, -0.553200f, 0.789522f}, + {-0.153380f, -0.642062f, 0.751153f}, {-0.234185f, -0.582943f, 0.778033f}, + {-0.234185f, -0.582943f, 0.778033f}, {-0.063776f, -0.450833f, 0.890327f}, + {-0.090166f, -0.412736f, 0.906377f}, {-0.063776f, -0.450833f, 0.890327f}, + {0.179281f, -0.164585f, 0.969933f}, {-0.090166f, -0.412736f, 0.906377f}, + {0.376794f, -0.013627f, 0.926197f}, {0.179281f, -0.164585f, 0.969933f}, + {0.411118f, 0.050506f, 0.910182f}, {0.376794f, -0.013627f, 0.926197f}, + {0.411118f, 0.050506f, 0.910182f}, {0.527283f, -0.011259f, 0.849615f}, + {0.640907f, 0.116796f, 0.758681f}, {0.527283f, -0.011259f, 0.849615f}, + {0.857203f, -0.004873f, 0.514956f}, {0.850722f, 0.190453f, 0.489898f}, + {0.640907f, 0.116796f, 0.758681f}, {0.857203f, -0.004873f, 0.514956f}, + {0.991941f, -0.008091f, 0.126439f}, {0.850722f, 0.190453f, 0.489898f}, + {0.857203f, -0.004873f, 0.514956f}, {0.991941f, -0.008091f, 0.126439f}, + {0.927065f, 0.363616f, 0.091291f}, {0.850722f, 0.190453f, 0.489898f}, + {0.395134f, 0.282959f, -0.873958f}, {0.544847f, 0.348199f, -0.762823f}, + {0.478818f, 0.067491f, -0.875316f}, {0.478818f, 0.067491f, -0.875316f}, + {0.544847f, 0.348199f, -0.762823f}, {0.739626f, 0.244446f, -0.627056f}, + {0.298945f, 0.221806f, -0.928135f}, {0.395134f, 0.282959f, -0.873958f}, + {0.274301f, 0.028423f, -0.961224f}, {0.274301f, 0.028423f, -0.961224f}, + {0.395134f, 0.282959f, -0.873958f}, {0.478818f, 0.067491f, -0.875316f}, + {0.189929f, 0.005792f, -0.981781f}, {0.274301f, 0.028423f, -0.961224f}, + {0.127284f, -0.160096f, -0.978861f}, {-0.193053f, -0.500818f, -0.843749f}, + {-0.272935f, -0.219522f, -0.936652f}, {-0.067677f, -0.209660f, -0.975429f}, + {-0.193053f, -0.500818f, -0.843749f}, {-0.251380f, -0.456256f, -0.853603f}, + {-0.272935f, -0.219522f, -0.936652f}, {-0.251380f, -0.456256f, -0.853603f}, + {-0.193053f, -0.500818f, -0.843749f}, {-0.209838f, -0.630881f, -0.746966f}, + {-0.243728f, -0.567734f, -0.786304f}, {-0.603996f, -0.470107f, -0.643574f}, + {-0.209838f, -0.630881f, -0.746966f}, {-0.243728f, -0.567734f, -0.786304f}, + {-0.561849f, -0.579983f, -0.589869f}, {-0.603996f, -0.470107f, -0.643574f}, + {-0.597460f, -0.489542f, 0.635130f}, {-0.521880f, -0.609673f, 0.596608f}, + {-0.258966f, -0.584187f, 0.769196f}, {-0.265754f, -0.553200f, 0.789522f}, + {-0.597460f, -0.489542f, 0.635130f}, {-0.258966f, -0.584187f, 0.769196f}, + {-0.289543f, -0.300206f, 0.908868f}, {-0.265754f, -0.553200f, 0.789522f}, + {-0.234185f, -0.582943f, 0.778033f}, {-0.090166f, -0.412736f, 0.906377f}, + {-0.289543f, -0.300206f, 0.908868f}, {-0.234185f, -0.582943f, 0.778033f}, + {-0.008813f, -0.156680f, 0.987610f}, {-0.234185f, -0.582943f, 0.778033f}, + {-0.090166f, -0.412736f, 0.906377f}, {-0.008813f, -0.156680f, 0.987610f}, + {-0.090166f, -0.412736f, 0.906377f}, {0.179281f, -0.164585f, 0.969933f}, + {0.122983f, -0.097750f, 0.987583f}, {-0.008813f, -0.156680f, 0.987610f}, + {0.179281f, -0.164585f, 0.969933f}, {0.158118f, 0.020858f, 0.987200f}, + {0.122983f, -0.097750f, 0.987583f}, {0.179281f, -0.164585f, 0.969933f}, + {0.242667f, 0.026390f, 0.969751f}, {0.158118f, 0.020858f, 0.987200f}, + {0.179281f, -0.164585f, 0.969933f}, {0.376794f, -0.013627f, 0.926197f}, + {0.242667f, 0.026390f, 0.969751f}, {0.179281f, -0.164585f, 0.969933f}, + {0.565043f, 0.231831f, 0.791821f}, {0.376794f, -0.013627f, 0.926197f}, + {0.527283f, -0.011259f, 0.849615f}, {0.376794f, -0.013627f, 0.926197f}, + {0.565043f, 0.231831f, 0.791821f}, {0.414697f, 0.103739f, 0.904027f}, + {0.565043f, 0.231831f, 0.791821f}, {0.527283f, -0.011259f, 0.849615f}, + {0.640907f, 0.116796f, 0.758681f}, {0.640907f, 0.116796f, 0.758681f}, + {0.850722f, 0.190453f, 0.489898f}, {0.565043f, 0.231831f, 0.791821f}, + {0.787274f, 0.549331f, -0.280064f}, {0.927065f, 0.363616f, 0.091291f}, + {0.918800f, 0.243044f, -0.311025f}, {0.927065f, 0.363616f, 0.091291f}, + {0.787274f, 0.549331f, -0.280064f}, {0.814012f, 0.575435f, 0.079117f}, + {0.720146f, 0.422107f, -0.550650f}, {0.787274f, 0.549331f, -0.280064f}, + {0.739626f, 0.244446f, -0.627056f}, {0.739626f, 0.244446f, -0.627056f}, + {0.787274f, 0.549331f, -0.280064f}, {0.918800f, 0.243044f, -0.311025f}, + {0.601037f, 0.444240f, -0.664383f}, {0.720146f, 0.422107f, -0.550650f}, + {0.739626f, 0.244446f, -0.627056f}, {0.544847f, 0.348199f, -0.762823f}, + {0.601037f, 0.444240f, -0.664383f}, {0.739626f, 0.244446f, -0.627056f}, + {0.274301f, 0.028423f, -0.961224f}, {0.159629f, 0.129378f, -0.978662f}, + {0.298945f, 0.221806f, -0.928135f}, {0.159629f, 0.129378f, -0.978662f}, + {0.274301f, 0.028423f, -0.961224f}, {0.189929f, 0.005792f, -0.981781f}, + {0.044948f, 0.027639f, -0.998607f}, {0.189929f, 0.005792f, -0.981781f}, + {0.127284f, -0.160096f, -0.978861f}, {-0.019661f, 0.026870f, -0.999446f}, + {0.127284f, -0.160096f, -0.978861f}, {-0.067677f, -0.209660f, -0.975429f}, + {0.127284f, -0.160096f, -0.978861f}, {-0.019661f, 0.026870f, -0.999446f}, + {0.044948f, 0.027639f, -0.998607f}, {-0.251380f, -0.456256f, -0.853603f}, + {-0.550195f, -0.213155f, -0.807373f}, {-0.272935f, -0.219522f, -0.936652f}, + {-0.395419f, -0.465090f, -0.792045f}, {-0.251380f, -0.456256f, -0.853603f}, + {-0.209838f, -0.630881f, -0.746966f}, {-0.251380f, -0.456256f, -0.853603f}, + {-0.395419f, -0.465090f, -0.792045f}, {-0.550195f, -0.213155f, -0.807373f}, + {-0.209838f, -0.630881f, -0.746966f}, {-0.603996f, -0.470107f, -0.643574f}, + {-0.395419f, -0.465090f, -0.792045f}, {-0.265754f, -0.553200f, 0.789522f}, + {-0.446685f, -0.386504f, 0.806900f}, {-0.597460f, -0.489542f, 0.635130f}, + {-0.508226f, -0.208610f, 0.835576f}, {-0.446685f, -0.386504f, 0.806900f}, + {-0.265754f, -0.553200f, 0.789522f}, {-0.289543f, -0.300206f, 0.908868f}, + {-0.508226f, -0.208610f, 0.835576f}, {-0.265754f, -0.553200f, 0.789522f}, + {-0.361869f, -0.333272f, 0.870621f}, {-0.289543f, -0.300206f, 0.908868f}, + {-0.090166f, -0.412736f, 0.906377f}, {-0.008813f, -0.156680f, 0.987610f}, + {-0.361869f, -0.333272f, 0.870621f}, {-0.090166f, -0.412736f, 0.906377f}, + {0.122983f, -0.097750f, 0.987583f}, {-0.070118f, 0.049294f, 0.996320f}, + {-0.008813f, -0.156680f, 0.987610f}, {0.158118f, 0.020858f, 0.987200f}, + {-0.070118f, 0.049294f, 0.996320f}, {0.122983f, -0.097750f, 0.987583f}, + {0.186062f, 0.180368f, 0.965841f}, {0.158118f, 0.020858f, 0.987200f}, + {0.242667f, 0.026390f, 0.969751f}, {0.376794f, -0.013627f, 0.926197f}, + {0.186062f, 0.180368f, 0.965841f}, {0.242667f, 0.026390f, 0.969751f}, + {0.414697f, 0.103739f, 0.904027f}, {0.186062f, 0.180368f, 0.965841f}, + {0.376794f, -0.013627f, 0.926197f}, {0.678340f, 0.537250f, 0.501215f}, + {0.565043f, 0.231831f, 0.791821f}, {0.850722f, 0.190453f, 0.489898f}, + {0.850722f, 0.190453f, 0.489898f}, {0.894621f, 0.342989f, 0.286376f}, + {0.678340f, 0.537250f, 0.501215f}, {0.814012f, 0.575435f, 0.079117f}, + {0.850722f, 0.190453f, 0.489898f}, {0.927065f, 0.363616f, 0.091291f}, + {0.850722f, 0.190453f, 0.489898f}, {0.814012f, 0.575435f, 0.079117f}, + {0.894621f, 0.342989f, 0.286376f}, {0.601037f, 0.444240f, -0.664383f}, + {0.675467f, 0.612012f, -0.411322f}, {0.720146f, 0.422107f, -0.550650f}, + {0.720146f, 0.422107f, -0.550650f}, {0.675467f, 0.612012f, -0.411322f}, + {0.787274f, 0.549331f, -0.280064f}, {0.398680f, 0.419429f, -0.815558f}, + {0.601037f, 0.444240f, -0.664383f}, {0.395134f, 0.282959f, -0.873958f}, + {0.395134f, 0.282959f, -0.873958f}, {0.601037f, 0.444240f, -0.664383f}, + {0.544847f, 0.348199f, -0.762823f}, {0.298945f, 0.221806f, -0.928135f}, + {0.398680f, 0.419429f, -0.815558f}, {0.395134f, 0.282959f, -0.873958f}, + {0.189929f, 0.005792f, -0.981781f}, {0.041871f, 0.175597f, -0.983571f}, + {0.159629f, 0.129378f, -0.978662f}, {0.041871f, 0.175597f, -0.983571f}, + {0.189929f, 0.005792f, -0.981781f}, {0.044948f, 0.027639f, -0.998607f}, + {-0.315195f, 0.056880f, -0.947321f}, {-0.019661f, 0.026870f, -0.999446f}, + {-0.067677f, -0.209660f, -0.975429f}, {-0.315195f, 0.056880f, -0.947321f}, + {-0.067677f, -0.209660f, -0.975429f}, {-0.272935f, -0.219522f, -0.936652f}, + {-0.272935f, -0.219522f, -0.936652f}, {-0.568896f, 0.078875f, -0.818618f}, + {-0.315195f, 0.056880f, -0.947321f}, {-0.272935f, -0.219522f, -0.936652f}, + {-0.550195f, -0.213155f, -0.807373f}, {-0.568896f, 0.078875f, -0.818618f}, + {-0.550195f, -0.213155f, -0.807373f}, {-0.395419f, -0.465090f, -0.792045f}, + {-0.603996f, -0.470107f, -0.643574f}, {-0.603996f, -0.470107f, -0.643574f}, + {-0.728572f, -0.301687f, -0.614954f}, {-0.550195f, -0.213155f, -0.807373f}, + {-0.603996f, -0.470107f, -0.643574f}, {-0.804099f, -0.162968f, -0.571722f}, + {-0.728572f, -0.301687f, -0.614954f}, {-0.603996f, -0.470107f, -0.643574f}, + {-0.779610f, -0.366216f, -0.508029f}, {-0.804099f, -0.162968f, -0.571722f}, + {-0.828833f, -0.150655f, 0.538832f}, {-0.830713f, -0.342849f, 0.438601f}, + {-0.597460f, -0.489542f, 0.635130f}, {-0.684092f, -0.290992f, 0.668836f}, + {-0.828833f, -0.150655f, 0.538832f}, {-0.597460f, -0.489542f, 0.635130f}, + {-0.508226f, -0.208610f, 0.835576f}, {-0.684092f, -0.290992f, 0.668836f}, + {-0.446685f, -0.386504f, 0.806900f}, {-0.446685f, -0.386504f, 0.806900f}, + {-0.684092f, -0.290992f, 0.668836f}, {-0.597460f, -0.489542f, 0.635130f}, + {-0.573384f, 0.006584f, 0.819261f}, {-0.508226f, -0.208610f, 0.835576f}, + {-0.289543f, -0.300206f, 0.908868f}, {-0.500157f, 0.003273f, 0.865929f}, + {-0.573384f, 0.006584f, 0.819261f}, {-0.289543f, -0.300206f, 0.908868f}, + {-0.285360f, -0.026680f, 0.958049f}, {-0.500157f, 0.003273f, 0.865929f}, + {-0.361869f, -0.333272f, 0.870621f}, {-0.361869f, -0.333272f, 0.870621f}, + {-0.500157f, 0.003273f, 0.865929f}, {-0.289543f, -0.300206f, 0.908868f}, + {-0.008813f, -0.156680f, 0.987610f}, {-0.285360f, -0.026680f, 0.958049f}, + {-0.361869f, -0.333272f, 0.870621f}, {-0.070118f, 0.049294f, 0.996320f}, + {-0.285360f, -0.026680f, 0.958049f}, {-0.008813f, -0.156680f, 0.987610f}, + {0.158118f, 0.020858f, 0.987200f}, {-0.142540f, 0.179234f, 0.973426f}, + {-0.070118f, 0.049294f, 0.996320f}, {0.139288f, 0.151287f, 0.978627f}, + {-0.142540f, 0.179234f, 0.973426f}, {0.158118f, 0.020858f, 0.987200f}, + {0.186062f, 0.180368f, 0.965841f}, {0.139288f, 0.151287f, 0.978627f}, + {0.158118f, 0.020858f, 0.987200f}, {0.349553f, 0.420370f, 0.837318f}, + {0.414697f, 0.103739f, 0.904027f}, {0.565043f, 0.231831f, 0.791821f}, + {0.565043f, 0.231831f, 0.791821f}, {0.484507f, 0.439082f, 0.756611f}, + {0.349553f, 0.420370f, 0.837318f}, {0.565043f, 0.231831f, 0.791821f}, + {0.678340f, 0.537250f, 0.501215f}, {0.484507f, 0.439082f, 0.756611f}, + {0.894621f, 0.342989f, 0.286376f}, {0.814012f, 0.575435f, 0.079117f}, + {0.678340f, 0.537250f, 0.501215f}, {0.657250f, 0.722508f, -0.214485f}, + {0.624305f, 0.777832f, -0.072254f}, {0.787274f, 0.549331f, -0.280064f}, + {0.787274f, 0.549331f, -0.280064f}, {0.624305f, 0.777832f, -0.072254f}, + {0.814012f, 0.575435f, 0.079117f}, {0.675467f, 0.612012f, -0.411322f}, + {0.657250f, 0.722508f, -0.214485f}, {0.787274f, 0.549331f, -0.280064f}, + {0.733091f, 0.411928f, -0.541196f}, {0.657250f, 0.722508f, -0.214485f}, + {0.601037f, 0.444240f, -0.664383f}, {0.601037f, 0.444240f, -0.664383f}, + {0.657250f, 0.722508f, -0.214485f}, {0.675467f, 0.612012f, -0.411322f}, + {0.398680f, 0.419429f, -0.815558f}, {0.399040f, 0.539230f, -0.741619f}, + {0.601037f, 0.444240f, -0.664383f}, {0.174832f, 0.368797f, -0.912920f}, + {0.398680f, 0.419429f, -0.815558f}, {0.298945f, 0.221806f, -0.928135f}, + {0.174832f, 0.368797f, -0.912920f}, {0.298945f, 0.221806f, -0.928135f}, + {0.159629f, 0.129378f, -0.978662f}, {-0.243339f, 0.229860f, -0.942311f}, + {0.044948f, 0.027639f, -0.998607f}, {-0.019661f, 0.026870f, -0.999446f}, + {0.044948f, 0.027639f, -0.998607f}, {-0.243339f, 0.229860f, -0.942311f}, + {0.041871f, 0.175597f, -0.983571f}, {-0.243339f, 0.229860f, -0.942311f}, + {-0.019661f, 0.026870f, -0.999446f}, {-0.315195f, 0.056880f, -0.947321f}, + {-0.550195f, -0.213155f, -0.807373f}, {-0.705271f, -0.074692f, -0.704993f}, + {-0.568896f, 0.078875f, -0.818618f}, {-0.804099f, -0.162968f, -0.571722f}, + {-0.550195f, -0.213155f, -0.807373f}, {-0.728572f, -0.301687f, -0.614954f}, + {-0.550195f, -0.213155f, -0.807373f}, {-0.804099f, -0.162968f, -0.571722f}, + {-0.705271f, -0.074692f, -0.704993f}, {-0.944767f, -0.159931f, -0.286072f}, + {-0.779610f, -0.366216f, -0.508029f}, {-0.913250f, -0.339474f, -0.225238f}, + {-0.779610f, -0.366216f, -0.508029f}, {-0.944767f, -0.159931f, -0.286072f}, + {-0.804099f, -0.162968f, -0.571722f}, {-0.976443f, -0.186556f, 0.108426f}, + {-0.913250f, -0.339474f, -0.225238f}, {-0.903101f, -0.355778f, 0.240479f}, + {-0.913250f, -0.339474f, -0.225238f}, {-0.976443f, -0.186556f, 0.108426f}, + {-0.944767f, -0.159931f, -0.286072f}, {-0.828833f, -0.150655f, 0.538832f}, + {-0.976443f, -0.186556f, 0.108426f}, {-0.830713f, -0.342849f, 0.438601f}, + {-0.830713f, -0.342849f, 0.438601f}, {-0.976443f, -0.186556f, 0.108426f}, + {-0.903101f, -0.355778f, 0.240479f}, {-0.573384f, 0.006584f, 0.819261f}, + {-0.828833f, -0.150655f, 0.538832f}, {-0.508226f, -0.208610f, 0.835576f}, + {-0.508226f, -0.208610f, 0.835576f}, {-0.828833f, -0.150655f, 0.538832f}, + {-0.684092f, -0.290992f, 0.668836f}, {-0.273342f, 0.301606f, 0.913410f}, + {-0.500157f, 0.003273f, 0.865929f}, {-0.285360f, -0.026680f, 0.958049f}, + {-0.126486f, 0.332554f, 0.934564f}, {-0.273342f, 0.301606f, 0.913410f}, + {-0.070118f, 0.049294f, 0.996320f}, {-0.070118f, 0.049294f, 0.996320f}, + {-0.273342f, 0.301606f, 0.913410f}, {-0.285360f, -0.026680f, 0.958049f}, + {-0.142540f, 0.179234f, 0.973426f}, {-0.126486f, 0.332554f, 0.934564f}, + {-0.070118f, 0.049294f, 0.996320f}, {0.186062f, 0.180368f, 0.965841f}, + {-0.182504f, 0.169825f, 0.968427f}, {0.139288f, 0.151287f, 0.978627f}, + {0.139288f, 0.151287f, 0.978627f}, {-0.182504f, 0.169825f, 0.968427f}, + {-0.142540f, 0.179234f, 0.973426f}, {0.414697f, 0.103739f, 0.904027f}, + {0.153831f, 0.381338f, 0.911547f}, {0.186062f, 0.180368f, 0.965841f}, + {0.414697f, 0.103739f, 0.904027f}, {0.349553f, 0.420370f, 0.837318f}, + {0.153831f, 0.381338f, 0.911547f}, {0.321825f, 0.624026f, 0.712054f}, + {0.349553f, 0.420370f, 0.837318f}, {0.484507f, 0.439082f, 0.756611f}, + {0.484507f, 0.439082f, 0.756611f}, {0.678340f, 0.537250f, 0.501215f}, + {0.321825f, 0.624026f, 0.712054f}, {0.624305f, 0.777832f, -0.072254f}, + {0.678340f, 0.537250f, 0.501215f}, {0.814012f, 0.575435f, 0.079117f}, + {0.678340f, 0.537250f, 0.501215f}, {0.624305f, 0.777832f, -0.072254f}, + {0.785302f, 0.584117f, 0.205203f}, {0.319978f, 0.802093f, -0.504243f}, + {0.657250f, 0.722508f, -0.214485f}, {0.733091f, 0.411928f, -0.541196f}, + {0.601037f, 0.444240f, -0.664383f}, {0.319978f, 0.802093f, -0.504243f}, + {0.733091f, 0.411928f, -0.541196f}, {0.399040f, 0.539230f, -0.741619f}, + {0.319978f, 0.802093f, -0.504243f}, {0.601037f, 0.444240f, -0.664383f}, + {0.398680f, 0.419429f, -0.815558f}, {0.319978f, 0.802093f, -0.504243f}, + {0.399040f, 0.539230f, -0.741619f}, {0.302165f, 0.624606f, -0.720114f}, + {0.319978f, 0.802093f, -0.504243f}, {0.398680f, 0.419429f, -0.815558f}, + {0.174832f, 0.368797f, -0.912920f}, {0.302165f, 0.624606f, -0.720114f}, + {0.398680f, 0.419429f, -0.815558f}, {-0.099541f, 0.373676f, -0.922203f}, + {0.174832f, 0.368797f, -0.912920f}, {0.159629f, 0.129378f, -0.978662f}, + {-0.099541f, 0.373676f, -0.922203f}, {0.159629f, 0.129378f, -0.978662f}, + {0.041871f, 0.175597f, -0.983571f}, {0.041871f, 0.175597f, -0.983571f}, + {-0.243339f, 0.229860f, -0.942311f}, {-0.099541f, 0.373676f, -0.922203f}, + {-0.315195f, 0.056880f, -0.947321f}, {-0.579699f, 0.235714f, -0.779992f}, + {-0.243339f, 0.229860f, -0.942311f}, {-0.579699f, 0.235714f, -0.779992f}, + {-0.315195f, 0.056880f, -0.947321f}, {-0.568896f, 0.078875f, -0.818618f}, + {-0.808406f, 0.056503f, -0.585907f}, {-0.568896f, 0.078875f, -0.818618f}, + {-0.705271f, -0.074692f, -0.704993f}, {-0.808406f, 0.056503f, -0.585907f}, + {-0.705271f, -0.074692f, -0.704993f}, {-0.804099f, -0.162968f, -0.571722f}, + {-0.804099f, -0.162968f, -0.571722f}, {-0.940520f, 0.091826f, -0.327093f}, + {-0.808406f, 0.056503f, -0.585907f}, {-0.940520f, 0.091826f, -0.327093f}, + {-0.804099f, -0.162968f, -0.571722f}, {-0.944767f, -0.159931f, -0.286072f}, + {-0.997577f, -0.016674f, 0.067545f}, {-0.944767f, -0.159931f, -0.286072f}, + {-0.976443f, -0.186556f, 0.108426f}, {-0.944767f, -0.159931f, -0.286072f}, + {-0.997577f, -0.016674f, 0.067545f}, {-0.940520f, 0.091826f, -0.327093f}, + {-0.884576f, -0.002331f, 0.466390f}, {-0.997577f, -0.016674f, 0.067545f}, + {-0.828833f, -0.150655f, 0.538832f}, {-0.828833f, -0.150655f, 0.538832f}, + {-0.997577f, -0.016674f, 0.067545f}, {-0.976443f, -0.186556f, 0.108426f}, + {-0.711453f, 0.027449f, 0.702197f}, {-0.884576f, -0.002331f, 0.466390f}, + {-0.573384f, 0.006584f, 0.819261f}, {-0.573384f, 0.006584f, 0.819261f}, + {-0.884576f, -0.002331f, 0.466390f}, {-0.828833f, -0.150655f, 0.538832f}, + {-0.500157f, 0.003273f, 0.865929f}, {-0.718362f, 0.188940f, 0.669521f}, + {-0.573384f, 0.006584f, 0.819261f}, {-0.273342f, 0.301606f, 0.913410f}, + {-0.718362f, 0.188940f, 0.669521f}, {-0.500157f, 0.003273f, 0.865929f}, + {-0.142540f, 0.179234f, 0.973426f}, {-0.273342f, 0.301606f, 0.913410f}, + {-0.126486f, 0.332554f, 0.934564f}, {-0.222935f, 0.386297f, 0.895027f}, + {-0.273342f, 0.301606f, 0.913410f}, {-0.142540f, 0.179234f, 0.973426f}, + {-0.182504f, 0.169825f, 0.968427f}, {-0.222935f, 0.386297f, 0.895027f}, + {-0.142540f, 0.179234f, 0.973426f}, {0.186062f, 0.180368f, 0.965841f}, + {-0.222935f, 0.386297f, 0.895027f}, {-0.182504f, 0.169825f, 0.968427f}, + {0.153831f, 0.381338f, 0.911547f}, {-0.222935f, 0.386297f, 0.895027f}, + {0.186062f, 0.180368f, 0.965841f}, {0.349553f, 0.420370f, 0.837318f}, + {0.316223f, 0.656311f, 0.685025f}, {0.153831f, 0.381338f, 0.911547f}, + {0.318433f, 0.826794f, 0.463694f}, {0.349553f, 0.420370f, 0.837318f}, + {0.321825f, 0.624026f, 0.712054f}, {0.349553f, 0.420370f, 0.837318f}, + {0.318433f, 0.826794f, 0.463694f}, {0.316223f, 0.656311f, 0.685025f}, + {0.318433f, 0.826794f, 0.463694f}, {0.321825f, 0.624026f, 0.712054f}, + {0.678340f, 0.537250f, 0.501215f}, {0.318433f, 0.826794f, 0.463694f}, + {0.678340f, 0.537250f, 0.501215f}, {0.785302f, 0.584117f, 0.205203f}, + {0.785302f, 0.584117f, 0.205203f}, {0.624305f, 0.777832f, -0.072254f}, + {0.318433f, 0.826794f, 0.463694f}, {0.296834f, 0.948255f, -0.112704f}, + {0.255764f, 0.965764f, 0.043409f}, {0.657250f, 0.722508f, -0.214485f}, + {0.657250f, 0.722508f, -0.214485f}, {0.255764f, 0.965764f, 0.043409f}, + {0.624305f, 0.777832f, -0.072254f}, {0.319978f, 0.802093f, -0.504243f}, + {0.296834f, 0.948255f, -0.112704f}, {0.657250f, 0.722508f, -0.214485f}, + {0.302165f, 0.624606f, -0.720114f}, {0.354022f, 0.868325f, -0.347391f}, + {0.319978f, 0.802093f, -0.504243f}, {0.134018f, 0.739202f, -0.660015f}, + {0.354022f, 0.868325f, -0.347391f}, {0.174832f, 0.368797f, -0.912920f}, + {0.174832f, 0.368797f, -0.912920f}, {0.354022f, 0.868325f, -0.347391f}, + {0.302165f, 0.624606f, -0.720114f}, {-0.119566f, 0.747988f, -0.652853f}, + {0.134018f, 0.739202f, -0.660015f}, {0.174832f, 0.368797f, -0.912920f}, + {-0.099541f, 0.373676f, -0.922203f}, {-0.119566f, 0.747988f, -0.652853f}, + {0.174832f, 0.368797f, -0.912920f}, {-0.293826f, 0.478971f, -0.827196f}, + {-0.099541f, 0.373676f, -0.922203f}, {-0.243339f, 0.229860f, -0.942311f}, + {-0.538344f, 0.484286f, -0.689676f}, {-0.243339f, 0.229860f, -0.942311f}, + {-0.579699f, 0.235714f, -0.779992f}, {-0.243339f, 0.229860f, -0.942311f}, + {-0.538344f, 0.484286f, -0.689676f}, {-0.293826f, 0.478971f, -0.827196f}, + {-0.682500f, 0.299461f, -0.666721f}, {-0.579699f, 0.235714f, -0.779992f}, + {-0.568896f, 0.078875f, -0.818618f}, {-0.775401f, 0.319263f, -0.544817f}, + {-0.568896f, 0.078875f, -0.818618f}, {-0.808406f, 0.056503f, -0.585907f}, + {-0.568896f, 0.078875f, -0.818618f}, {-0.775401f, 0.319263f, -0.544817f}, + {-0.682500f, 0.299461f, -0.666721f}, {-0.920289f, 0.369469f, -0.128688f}, + {-0.808406f, 0.056503f, -0.585907f}, {-0.940520f, 0.091826f, -0.327093f}, + {-0.808406f, 0.056503f, -0.585907f}, {-0.920289f, 0.369469f, -0.128688f}, + {-0.775401f, 0.319263f, -0.544817f}, {-0.924440f, 0.373403f, 0.077340f}, + {-0.940520f, 0.091826f, -0.327093f}, {-0.997577f, -0.016674f, 0.067545f}, + {-0.940520f, 0.091826f, -0.327093f}, {-0.924440f, 0.373403f, 0.077340f}, + {-0.920289f, 0.369469f, -0.128688f}, {-0.789878f, 0.261331f, 0.554797f}, + {-0.924440f, 0.373403f, 0.077340f}, {-0.884576f, -0.002331f, 0.466390f}, + {-0.884576f, -0.002331f, 0.466390f}, {-0.924440f, 0.373403f, 0.077340f}, + {-0.997577f, -0.016674f, 0.067545f}, {-0.711453f, 0.027449f, 0.702197f}, + {-0.789878f, 0.261331f, 0.554797f}, {-0.884576f, -0.002331f, 0.466390f}, + {-0.718362f, 0.188940f, 0.669521f}, {-0.789878f, 0.261331f, 0.554797f}, + {-0.573384f, 0.006584f, 0.819261f}, {-0.573384f, 0.006584f, 0.819261f}, + {-0.789878f, 0.261331f, 0.554797f}, {-0.711453f, 0.027449f, 0.702197f}, + {-0.397768f, 0.588769f, 0.703655f}, {-0.612838f, 0.530118f, 0.586007f}, + {-0.273342f, 0.301606f, 0.913410f}, {-0.273342f, 0.301606f, 0.913410f}, + {-0.612838f, 0.530118f, 0.586007f}, {-0.718362f, 0.188940f, 0.669521f}, + {-0.222935f, 0.386297f, 0.895027f}, {-0.397768f, 0.588769f, 0.703655f}, + {-0.273342f, 0.301606f, 0.913410f}, {0.153831f, 0.381338f, 0.911547f}, + {-0.095818f, 0.712020f, 0.695590f}, {-0.222935f, 0.386297f, 0.895027f}, + {0.153831f, 0.381338f, 0.911547f}, {0.135316f, 0.709200f, 0.691900f}, + {-0.095818f, 0.712020f, 0.695590f}, {0.135316f, 0.709200f, 0.691900f}, + {0.153831f, 0.381338f, 0.911547f}, {0.316223f, 0.656311f, 0.685025f}, + {0.316223f, 0.656311f, 0.685025f}, {0.062599f, 0.945507f, 0.319528f}, + {0.135316f, 0.709200f, 0.691900f}, {0.316223f, 0.656311f, 0.685025f}, + {0.318433f, 0.826794f, 0.463694f}, {0.062599f, 0.945507f, 0.319528f}, + {0.255764f, 0.965764f, 0.043409f}, {0.318433f, 0.826794f, 0.463694f}, + {0.624305f, 0.777832f, -0.072254f}, {0.354022f, 0.868325f, -0.347391f}, + {0.074752f, 0.976718f, -0.201083f}, {0.319978f, 0.802093f, -0.504243f}, + {0.319978f, 0.802093f, -0.504243f}, {0.074752f, 0.976718f, -0.201083f}, + {0.296834f, 0.948255f, -0.112704f}, {-0.102846f, 0.927150f, -0.360300f}, + {0.354022f, 0.868325f, -0.347391f}, {0.134018f, 0.739202f, -0.660015f}, + {-0.119566f, 0.747988f, -0.652853f}, {-0.102846f, 0.927150f, -0.360300f}, + {0.134018f, 0.739202f, -0.660015f}, {-0.099541f, 0.373676f, -0.922203f}, + {-0.278258f, 0.639920f, -0.716293f}, {-0.119566f, 0.747988f, -0.652853f}, + {-0.099541f, 0.373676f, -0.922203f}, {-0.293826f, 0.478971f, -0.827196f}, + {-0.278258f, 0.639920f, -0.716293f}, {-0.638911f, 0.597556f, -0.484479f}, + {-0.538344f, 0.484286f, -0.689676f}, {-0.579699f, 0.235714f, -0.779992f}, + {-0.638911f, 0.597556f, -0.484479f}, {-0.579699f, 0.235714f, -0.779992f}, + {-0.682500f, 0.299461f, -0.666721f}, {-0.638911f, 0.597556f, -0.484479f}, + {-0.682500f, 0.299461f, -0.666721f}, {-0.775401f, 0.319263f, -0.544817f}, + {-0.775401f, 0.319263f, -0.544817f}, {-0.765919f, 0.473886f, -0.434512f}, + {-0.638911f, 0.597556f, -0.484479f}, {-0.775401f, 0.319263f, -0.544817f}, + {-0.920289f, 0.369469f, -0.128688f}, {-0.765919f, 0.473886f, -0.434512f}, + {-0.797912f, 0.474437f, 0.371815f}, {-0.924440f, 0.373403f, 0.077340f}, + {-0.789878f, 0.261331f, 0.554797f}, {-0.703599f, 0.591217f, 0.394222f}, + {-0.797912f, 0.474437f, 0.371815f}, {-0.789878f, 0.261331f, 0.554797f}, + {-0.718362f, 0.188940f, 0.669521f}, {-0.703599f, 0.591217f, 0.394222f}, + {-0.789878f, 0.261331f, 0.554797f}, {-0.612838f, 0.530118f, 0.586007f}, + {-0.703599f, 0.591217f, 0.394222f}, {-0.718362f, 0.188940f, 0.669521f}, + {-0.290902f, 0.695856f, 0.656628f}, {-0.397768f, 0.588769f, 0.703655f}, + {-0.222935f, 0.386297f, 0.895027f}, {-0.095818f, 0.712020f, 0.695590f}, + {-0.290902f, 0.695856f, 0.656628f}, {-0.222935f, 0.386297f, 0.895027f}, + {0.135316f, 0.709200f, 0.691900f}, {-0.046220f, 0.930211f, 0.364103f}, + {-0.095818f, 0.712020f, 0.695590f}, {0.135316f, 0.709200f, 0.691900f}, + {0.062599f, 0.945507f, 0.319528f}, {-0.046220f, 0.930211f, 0.364103f}, + {0.318433f, 0.826794f, 0.463694f}, {0.255764f, 0.965764f, 0.043409f}, + {0.062599f, 0.945507f, 0.319528f}, {0.074752f, 0.976718f, -0.201083f}, + {-0.012574f, 0.999472f, -0.029950f}, {0.296834f, 0.948255f, -0.112704f}, + {0.296834f, 0.948255f, -0.112704f}, {-0.012574f, 0.999472f, -0.029950f}, + {0.255764f, 0.965764f, 0.043409f}, {-0.375341f, 0.768018f, -0.518910f}, + {-0.119566f, 0.747988f, -0.652853f}, {-0.278258f, 0.639920f, -0.716293f}, + {-0.119566f, 0.747988f, -0.652853f}, {-0.375341f, 0.768018f, -0.518910f}, + {-0.102846f, 0.927150f, -0.360300f}, {-0.375341f, 0.768018f, -0.518910f}, + {-0.278258f, 0.639920f, -0.716293f}, {-0.293826f, 0.478971f, -0.827196f}, + {-0.375341f, 0.768018f, -0.518910f}, {-0.293826f, 0.478971f, -0.827196f}, + {-0.538344f, 0.484286f, -0.689676f}, {-0.538344f, 0.484286f, -0.689676f}, + {-0.638911f, 0.597556f, -0.484479f}, {-0.375341f, 0.768018f, -0.518910f}, + {-0.723262f, 0.643881f, -0.249619f}, {-0.638911f, 0.597556f, -0.484479f}, + {-0.765919f, 0.473886f, -0.434512f}, {-0.723262f, 0.643881f, -0.249619f}, + {-0.765919f, 0.473886f, -0.434512f}, {-0.920289f, 0.369469f, -0.128688f}, + {-0.920289f, 0.369469f, -0.128688f}, {-0.722290f, 0.687307f, -0.076851f}, + {-0.723262f, 0.643881f, -0.249619f}, {-0.756368f, 0.654141f, 0.002648f}, + {-0.920289f, 0.369469f, -0.128688f}, {-0.924440f, 0.373403f, 0.077340f}, + {-0.920289f, 0.369469f, -0.128688f}, {-0.756368f, 0.654141f, 0.002648f}, + {-0.722290f, 0.687307f, -0.076851f}, {-0.724438f, 0.657641f, 0.206634f}, + {-0.756368f, 0.654141f, 0.002648f}, {-0.924440f, 0.373403f, 0.077340f}, + {-0.797912f, 0.474437f, 0.371815f}, {-0.724438f, 0.657641f, 0.206634f}, + {-0.924440f, 0.373403f, 0.077340f}, {-0.703599f, 0.591217f, 0.394222f}, + {-0.724438f, 0.657641f, 0.206634f}, {-0.797912f, 0.474437f, 0.371815f}, + {-0.293101f, 0.861731f, 0.414140f}, {-0.703599f, 0.591217f, 0.394222f}, + {-0.612838f, 0.530118f, 0.586007f}, {-0.397768f, 0.588769f, 0.703655f}, + {-0.293101f, 0.861731f, 0.414140f}, {-0.612838f, 0.530118f, 0.586007f}, + {-0.290902f, 0.695856f, 0.656628f}, {-0.293101f, 0.861731f, 0.414140f}, + {-0.397768f, 0.588769f, 0.703655f}, {-0.046220f, 0.930211f, 0.364103f}, + {-0.293101f, 0.861731f, 0.414140f}, {-0.095818f, 0.712020f, 0.695590f}, + {-0.095818f, 0.712020f, 0.695590f}, {-0.293101f, 0.861731f, 0.414140f}, + {-0.290902f, 0.695856f, 0.656628f}, {-0.012574f, 0.999472f, -0.029950f}, + {0.062599f, 0.945507f, 0.319528f}, {0.255764f, 0.965764f, 0.043409f}, + {0.354022f, 0.868325f, -0.347391f}, {-0.138152f, 0.986340f, -0.089709f}, + {0.074752f, 0.976718f, -0.201083f}, {-0.102846f, 0.927150f, -0.360300f}, + {-0.138152f, 0.986340f, -0.089709f}, {0.354022f, 0.868325f, -0.347391f}, + {-0.375341f, 0.768018f, -0.518910f}, {-0.638911f, 0.597556f, -0.484479f}, + {-0.405200f, 0.877247f, -0.257393f}, {-0.638911f, 0.597556f, -0.484479f}, + {-0.568164f, 0.814559f, -0.116979f}, {-0.405200f, 0.877247f, -0.257393f}, + {-0.723262f, 0.643881f, -0.249619f}, {-0.568164f, 0.814559f, -0.116979f}, + {-0.638911f, 0.597556f, -0.484479f}, {-0.568164f, 0.814559f, -0.116979f}, + {-0.723262f, 0.643881f, -0.249619f}, {-0.722290f, 0.687307f, -0.076851f}, + {-0.625314f, 0.776642f, 0.076228f}, {-0.722290f, 0.687307f, -0.076851f}, + {-0.756368f, 0.654141f, 0.002648f}, {-0.722290f, 0.687307f, -0.076851f}, + {-0.625314f, 0.776642f, 0.076228f}, {-0.568164f, 0.814559f, -0.116979f}, + {-0.724438f, 0.657641f, 0.206634f}, {-0.625314f, 0.776642f, 0.076228f}, + {-0.756368f, 0.654141f, 0.002648f}, {-0.703599f, 0.591217f, 0.394222f}, + {-0.625314f, 0.776642f, 0.076228f}, {-0.724438f, 0.657641f, 0.206634f}, + {-0.625314f, 0.776642f, 0.076228f}, {-0.703599f, 0.591217f, 0.394222f}, + {-0.574023f, 0.790035f, 0.215271f}, {-0.703599f, 0.591217f, 0.394222f}, + {-0.293101f, 0.861731f, 0.414140f}, {-0.574023f, 0.790035f, 0.215271f}, + {0.062599f, 0.945507f, 0.319528f}, {-0.250129f, 0.966122f, 0.063592f}, + {-0.046220f, 0.930211f, 0.364103f}, {-0.250129f, 0.966122f, 0.063592f}, + {0.062599f, 0.945507f, 0.319528f}, {-0.012574f, 0.999472f, -0.029950f}, + {-0.138152f, 0.986340f, -0.089709f}, {-0.012574f, 0.999472f, -0.029950f}, + {0.074752f, 0.976718f, -0.201083f}, {-0.012574f, 0.999472f, -0.029950f}, + {-0.138152f, 0.986340f, -0.089709f}, {-0.250129f, 0.966122f, 0.063592f}, + {-0.102846f, 0.927150f, -0.360300f}, {-0.405200f, 0.877247f, -0.257393f}, + {-0.138152f, 0.986340f, -0.089709f}, {-0.405200f, 0.877247f, -0.257393f}, + {-0.102846f, 0.927150f, -0.360300f}, {-0.375341f, 0.768018f, -0.518910f}, + {-0.328676f, 0.944200f, 0.021421f}, {-0.568164f, 0.814559f, -0.116979f}, + {-0.625314f, 0.776642f, 0.076228f}, {-0.568164f, 0.814559f, -0.116979f}, + {-0.328676f, 0.944200f, 0.021421f}, {-0.405200f, 0.877247f, -0.257393f}, + {-0.328676f, 0.944200f, 0.021421f}, {-0.625314f, 0.776642f, 0.076228f}, + {-0.574023f, 0.790035f, 0.215271f}, {-0.293101f, 0.861731f, 0.414140f}, + {-0.328676f, 0.944200f, 0.021421f}, {-0.574023f, 0.790035f, 0.215271f}, + {-0.046220f, 0.930211f, 0.364103f}, {-0.328676f, 0.944200f, 0.021421f}, + {-0.293101f, 0.861731f, 0.414140f}, {-0.250129f, 0.966122f, 0.063592f}, + {-0.328676f, 0.944200f, 0.021421f}, {-0.046220f, 0.930211f, 0.364103f}, + {-0.138152f, 0.986340f, -0.089709f}, {-0.328676f, 0.944200f, 0.021421f}, + {-0.250129f, 0.966122f, 0.063592f}, {-0.328676f, 0.944200f, 0.021421f}, + {-0.138152f, 0.986340f, -0.089709f}, {-0.405200f, 0.877247f, -0.257393f}, + {-0.807580f, -0.530334f, -0.257994f}, {-0.779610f, -0.366216f, -0.508029f}, + {-0.643897f, -0.625762f, -0.440249f}, {-0.643897f, -0.625762f, -0.440249f}, + {-0.561849f, -0.579983f, -0.589869f}, {-0.243728f, -0.567734f, -0.786304f}, + {-0.243728f, -0.567734f, -0.786304f}, {-0.225805f, -0.587739f, -0.776901f}, + {-0.019689f, -0.435906f, -0.899777f}, {-0.019689f, -0.435906f, -0.899777f}, + {-0.225805f, -0.587739f, -0.776901f}, {-0.090844f, -0.184718f, -0.978584f}, + {-0.323965f, -0.562074f, 0.760999f}, {-0.084651f, -0.587452f, 0.804819f}, + {-0.258966f, -0.584187f, 0.769196f}, {-0.733042f, -0.570025f, 0.371107f}, + {-0.903101f, -0.355778f, 0.240479f}, {-0.796480f, -0.556747f, 0.235906f}, + {0.050233f, -0.840017f, 0.540230f}, {0.323534f, 0.555600f, 0.765921f}, + {0.638555f, 0.563372f, -0.524271f}, {0.042877f, -0.197790f, -0.979306f}, + {-0.090844f, -0.184718f, -0.978584f}, {-0.019689f, -0.435906f, -0.899777f}, + {-0.561849f, -0.579983f, -0.589869f}, {-0.643897f, -0.625762f, -0.440249f}, + {-0.603996f, -0.470107f, -0.643574f}, {-0.597460f, -0.489542f, 0.635130f}, + {-0.733042f, -0.570025f, 0.371107f}, {-0.521880f, -0.609673f, 0.596608f}, + {-0.603996f, -0.470107f, -0.643574f}, {-0.643897f, -0.625762f, -0.440249f}, + {-0.779610f, -0.366216f, -0.508029f}, {-0.779610f, -0.366216f, -0.508029f}, + {-0.807580f, -0.530334f, -0.257994f}, {-0.913250f, -0.339474f, -0.225238f}, + {-0.807580f, -0.530334f, -0.257994f}, {-0.903101f, -0.355778f, 0.240479f}, + {-0.913250f, -0.339474f, -0.225238f}, {-0.903101f, -0.355778f, 0.240479f}, + {-0.733042f, -0.570025f, 0.371107f}, {-0.830713f, -0.342849f, 0.438601f}, + {-0.830713f, -0.342849f, 0.438601f}, {-0.733042f, -0.570025f, 0.371107f}, + {-0.597460f, -0.489542f, 0.635130f}, {-0.796480f, -0.556747f, 0.235906f}, + {-0.903101f, -0.355778f, 0.240479f}, {-0.807580f, -0.530334f, -0.257994f}, + {-0.927303f, -0.337884f, 0.161072f}, {-0.937303f, -0.346680f, 0.035733f}, + {-0.799842f, -0.598163f, 0.049534f}, {-0.800970f, -0.540007f, 0.258532f}, + {-0.925595f, -0.219969f, 0.308037f}, {-0.927303f, -0.337884f, 0.161072f}, + {-0.799842f, -0.598163f, 0.049534f}, {-0.800970f, -0.540007f, 0.258532f}, + {-0.927303f, -0.337884f, 0.161072f}, {-0.925595f, -0.219969f, 0.308037f}, + {-0.988514f, -0.140680f, 0.055221f}, {-0.927303f, -0.337884f, 0.161072f}, + {-0.988514f, -0.140680f, 0.055221f}, {-0.925595f, -0.219969f, 0.308037f}, + {-0.946894f, -0.083377f, 0.310547f}, {-0.927303f, -0.337884f, 0.161072f}, + {-0.988514f, -0.140680f, 0.055221f}, {-0.937303f, -0.346680f, 0.035733f}, + {-0.793268f, -0.380270f, 0.475521f}, {-0.925595f, -0.219969f, 0.308037f}, + {-0.753868f, -0.528527f, 0.390310f}, {-0.925595f, -0.219969f, 0.308037f}, + {-0.793268f, -0.380270f, 0.475521f}, {-0.912801f, -0.112862f, 0.392499f}, + {-0.753868f, -0.528527f, 0.390310f}, {-0.925595f, -0.219969f, 0.308037f}, + {-0.800970f, -0.540007f, 0.258532f}, {-0.878151f, -0.009979f, 0.478279f}, + {-0.787639f, -0.269027f, 0.554301f}, {-0.850583f, 0.097851f, 0.516657f}, + {-0.787639f, -0.269027f, 0.554301f}, {-0.912801f, -0.112862f, 0.392499f}, + {-0.793268f, -0.380270f, 0.475521f}, {-0.912801f, -0.112862f, 0.392499f}, + {-0.787639f, -0.269027f, 0.554301f}, {-0.878151f, -0.009979f, 0.478279f}, + {-0.669551f, 0.202368f, 0.714667f}, {-0.616256f, 0.410615f, 0.672029f}, + {-0.542040f, 0.629184f, 0.557063f}, {-0.542040f, 0.629184f, 0.557063f}, + {-0.586320f, 0.540668f, 0.603247f}, {-0.669551f, 0.202368f, 0.714667f}, + {-0.669551f, 0.202368f, 0.714667f}, {-0.760001f, 0.324191f, 0.563293f}, + {-0.755415f, 0.076920f, 0.650716f}, {-0.760001f, 0.324191f, 0.563293f}, + {-0.669551f, 0.202368f, 0.714667f}, {-0.586320f, 0.540668f, 0.603247f}, + {-0.124844f, 0.873959f, 0.469691f}, {-0.542040f, 0.629184f, 0.557063f}, + {-0.335869f, 0.689550f, 0.641648f}, {-0.542040f, 0.629184f, 0.557063f}, + {-0.616256f, 0.410615f, 0.672029f}, {-0.335869f, 0.689550f, 0.641648f}, + {0.135575f, 0.967464f, 0.213620f}, {0.134729f, 0.972475f, 0.190106f}, + {0.071823f, 0.988827f, 0.130627f}, {0.071526f, 0.972134f, 0.223247f}, + {0.098032f, 0.964604f, 0.244805f}, {0.135575f, 0.967464f, 0.213620f}, + {0.071823f, 0.988827f, 0.130627f}, {0.071526f, 0.972134f, 0.223247f}, + {0.135575f, 0.967464f, 0.213620f}, {0.077268f, 0.992763f, 0.091936f}, + {0.134729f, 0.972475f, 0.190106f}, {0.125966f, 0.985447f, 0.114132f}, + {0.053007f, 0.998593f, 0.001737f}, {0.077268f, 0.992763f, 0.091936f}, + {0.125966f, 0.985447f, 0.114132f}, {0.077268f, 0.992763f, 0.091936f}, + {0.071823f, 0.988827f, 0.130627f}, {0.134729f, 0.972475f, 0.190106f}, + {0.135970f, 0.988769f, 0.062032f}, {0.041037f, 0.999024f, 0.016341f}, + {0.125966f, 0.985447f, 0.114132f}, {0.125966f, 0.985447f, 0.114132f}, + {0.041037f, 0.999024f, 0.016341f}, {0.053007f, 0.998593f, 0.001737f}, + {0.139528f, 0.980985f, -0.134911f}, {0.029330f, 0.999344f, -0.021255f}, + {0.128835f, 0.990367f, -0.050748f}, {0.029330f, 0.999344f, -0.021255f}, + {0.139528f, 0.980985f, -0.134911f}, {0.057898f, 0.998302f, 0.006430f}, + {0.128835f, 0.990367f, -0.050748f}, {0.041037f, 0.999024f, 0.016341f}, + {0.135970f, 0.988769f, 0.062032f}, {0.041037f, 0.999024f, 0.016341f}, + {0.128835f, 0.990367f, -0.050748f}, {0.029330f, 0.999344f, -0.021255f}, + {0.138558f, 0.971214f, -0.193767f}, {0.111817f, 0.988378f, -0.102986f}, + {0.139528f, 0.980985f, -0.134911f}, {0.057898f, 0.998302f, 0.006430f}, + {0.139528f, 0.980985f, -0.134911f}, {0.111817f, 0.988378f, -0.102986f}, + {0.058741f, 0.975100f, -0.213843f}, {0.140515f, 0.968515f, -0.205508f}, + {0.095780f, 0.971889f, -0.215078f}, {-0.397014f, 0.641777f, -0.656127f}, + {-0.598070f, 0.462524f, -0.654510f}, {-0.537060f, 0.609628f, -0.583027f}, + {-0.537060f, 0.609628f, -0.583027f}, {-0.237835f, 0.825207f, -0.512316f}, + {-0.397014f, 0.641777f, -0.656127f}, {-0.759992f, -0.028623f, -0.649302f}, + {-0.739554f, 0.361004f, -0.568099f}, {-0.671768f, 0.233451f, -0.703014f}, + {-0.671768f, 0.233451f, -0.703014f}, {-0.739554f, 0.361004f, -0.568099f}, + {-0.601154f, 0.511409f, -0.614064f}, {-0.537060f, 0.609628f, -0.583027f}, + {-0.598070f, 0.462524f, -0.654510f}, {-0.671768f, 0.233451f, -0.703014f}, + {-0.601154f, 0.511409f, -0.614064f}, {-0.537060f, 0.609628f, -0.583027f}, + {-0.671768f, 0.233451f, -0.703014f}, {-0.762666f, -0.418919f, -0.492796f}, + {-0.916145f, -0.160493f, -0.367314f}, {-0.792261f, -0.268380f, -0.547992f}, + {-0.792261f, -0.268380f, -0.547992f}, {-0.916145f, -0.160493f, -0.367314f}, + {-0.885015f, -0.020410f, -0.465115f}, {-0.792261f, -0.268380f, -0.547992f}, + {-0.885015f, -0.020410f, -0.465115f}, {-0.847640f, 0.110414f, -0.518956f}, + {-0.779406f, -0.555755f, -0.289246f}, {-0.913898f, -0.318786f, -0.251330f}, + {-0.773243f, -0.498286f, -0.392182f}, {-0.773243f, -0.498286f, -0.392182f}, + {-0.913898f, -0.318786f, -0.251330f}, {-0.916145f, -0.160493f, -0.367314f}, + {-0.773243f, -0.498286f, -0.392182f}, {-0.916145f, -0.160493f, -0.367314f}, + {-0.762666f, -0.418919f, -0.492796f}, {-0.799842f, -0.598163f, 0.049534f}, + {-0.937303f, -0.346680f, 0.035733f}, {-0.935713f, -0.338361f, -0.099759f}, + {-0.783854f, -0.600732f, -0.157143f}, {-0.799842f, -0.598163f, 0.049534f}, + {-0.935713f, -0.338361f, -0.099759f}, {-0.937303f, -0.346680f, 0.035733f}, + {-0.988514f, -0.140680f, 0.055221f}, {-0.935713f, -0.338361f, -0.099759f}, + {-0.935713f, -0.338361f, -0.099759f}, {-0.988514f, -0.140680f, 0.055221f}, + {-0.958645f, -0.131653f, -0.252323f}, {-0.935713f, -0.338361f, -0.099759f}, + {-0.958645f, -0.131653f, -0.252323f}, {-0.913898f, -0.318786f, -0.251330f}, + {-0.783854f, -0.600732f, -0.157143f}, {-0.935713f, -0.338361f, -0.099759f}, + {-0.913898f, -0.318786f, -0.251330f}, {-0.779406f, -0.555755f, -0.289246f}, + {-0.783854f, -0.600732f, -0.157143f}, {-0.913898f, -0.318786f, -0.251330f}, + {-0.621396f, -0.736146f, 0.268247f}, {-0.800970f, -0.540007f, 0.258532f}, + {-0.799842f, -0.598163f, 0.049534f}, {-0.615287f, -0.788146f, -0.015744f}, + {-0.621396f, -0.736146f, 0.268247f}, {-0.799842f, -0.598163f, 0.049534f}, + {-0.753868f, -0.528527f, 0.390310f}, {-0.800970f, -0.540007f, 0.258532f}, + {-0.621396f, -0.736146f, 0.268247f}, {-0.600251f, -0.614652f, 0.511764f}, + {-0.793268f, -0.380270f, 0.475521f}, {-0.753868f, -0.528527f, 0.390310f}, + {-0.621396f, -0.736146f, 0.268247f}, {-0.600251f, -0.614652f, 0.511764f}, + {-0.753868f, -0.528527f, 0.390310f}, {-0.787639f, -0.269027f, 0.554301f}, + {-0.793268f, -0.380270f, 0.475521f}, {-0.600251f, -0.614652f, 0.511764f}, + {-0.600251f, -0.614652f, 0.511764f}, {-0.502597f, -0.561961f, 0.656959f}, + {-0.633175f, -0.455326f, 0.625914f}, {-0.633175f, -0.455326f, 0.625914f}, + {-0.787639f, -0.269027f, 0.554301f}, {-0.600251f, -0.614652f, 0.511764f}, + {-0.237230f, -0.360647f, 0.902029f}, {-0.568417f, -0.260486f, 0.780416f}, + {-0.399666f, -0.459233f, 0.793330f}, {-0.814055f, -0.041024f, 0.579337f}, + {-0.568417f, -0.260486f, 0.780416f}, {-0.755415f, 0.076920f, 0.650716f}, + {-0.568417f, -0.260486f, 0.780416f}, {-0.787639f, -0.269027f, 0.554301f}, + {-0.633175f, -0.455326f, 0.625914f}, {-0.787639f, -0.269027f, 0.554301f}, + {-0.568417f, -0.260486f, 0.780416f}, {-0.814055f, -0.041024f, 0.579337f}, + {-0.399666f, -0.459233f, 0.793330f}, {-0.633175f, -0.455326f, 0.625914f}, + {-0.502597f, -0.561961f, 0.656959f}, {-0.633175f, -0.455326f, 0.625914f}, + {-0.399666f, -0.459233f, 0.793330f}, {-0.568417f, -0.260486f, 0.780416f}, + {-0.382842f, 0.339600f, 0.859130f}, {-0.616256f, 0.410615f, 0.672029f}, + {-0.499130f, 0.176378f, 0.848387f}, {-0.499130f, 0.176378f, 0.848387f}, + {-0.616256f, 0.410615f, 0.672029f}, {-0.669551f, 0.202368f, 0.714667f}, + {-0.669551f, 0.202368f, 0.714667f}, {-0.370077f, -0.091471f, 0.924487f}, + {-0.499130f, 0.176378f, 0.848387f}, {-0.568417f, -0.260486f, 0.780416f}, + {-0.370077f, -0.091471f, 0.924487f}, {-0.669551f, 0.202368f, 0.714667f}, + {-0.755415f, 0.076920f, 0.650716f}, {-0.568417f, -0.260486f, 0.780416f}, + {-0.669551f, 0.202368f, 0.714667f}, {-0.162448f, -0.277452f, 0.946906f}, + {-0.370077f, -0.091471f, 0.924487f}, {-0.568417f, -0.260486f, 0.780416f}, + {-0.568417f, -0.260486f, 0.780416f}, {-0.237230f, -0.360647f, 0.902029f}, + {-0.162448f, -0.277452f, 0.946906f}, {-0.382842f, 0.339600f, 0.859130f}, + {-0.335869f, 0.689550f, 0.641648f}, {-0.616256f, 0.410615f, 0.672029f}, + {0.444480f, 0.855660f, 0.265111f}, {0.332144f, 0.915062f, 0.228784f}, + {0.429695f, 0.814320f, 0.390185f}, {0.429695f, 0.814320f, 0.390185f}, + {0.332144f, 0.915062f, 0.228784f}, {0.334402f, 0.886440f, 0.320000f}, + {0.267882f, 0.921692f, 0.280576f}, {0.334402f, 0.886440f, 0.320000f}, + {0.332144f, 0.915062f, 0.228784f}, {0.332144f, 0.915062f, 0.228784f}, + {0.231329f, 0.957766f, 0.170795f}, {0.267882f, 0.921692f, 0.280576f}, + {0.231329f, 0.957766f, 0.170795f}, {0.187050f, 0.956413f, 0.224247f}, + {0.267882f, 0.921692f, 0.280576f}, {0.231329f, 0.957766f, 0.170795f}, + {0.125966f, 0.985447f, 0.114132f}, {0.187050f, 0.956413f, 0.224247f}, + {0.125966f, 0.985447f, 0.114132f}, {0.134729f, 0.972475f, 0.190106f}, + {0.187050f, 0.956413f, 0.224247f}, {0.429695f, 0.814320f, 0.390185f}, + {0.334402f, 0.886440f, 0.320000f}, {0.213363f, 0.870099f, 0.444302f}, + {0.470076f, 0.713698f, 0.519292f}, {0.429695f, 0.814320f, 0.390185f}, + {0.213363f, 0.870099f, 0.444302f}, {0.213363f, 0.870099f, 0.444302f}, + {0.334402f, 0.886440f, 0.320000f}, {0.267882f, 0.921692f, 0.280576f}, + {0.135970f, 0.988769f, 0.062032f}, {0.125966f, 0.985447f, 0.114132f}, + {0.231329f, 0.957766f, 0.170795f}, {0.269249f, 0.963068f, -0.002114f}, + {0.135970f, 0.988769f, 0.062032f}, {0.231329f, 0.957766f, 0.170795f}, + {0.332144f, 0.915062f, 0.228784f}, {0.444480f, 0.855660f, 0.265111f}, + {0.495685f, 0.868428f, 0.011380f}, {0.269249f, 0.963068f, -0.002114f}, + {0.231329f, 0.957766f, 0.170795f}, {0.332144f, 0.915062f, 0.228784f}, + {0.495685f, 0.868428f, 0.011380f}, {0.269249f, 0.963068f, -0.002114f}, + {0.332144f, 0.915062f, 0.228784f}, {0.269249f, 0.963068f, -0.002114f}, + {0.267189f, 0.943676f, -0.195156f}, {0.128835f, 0.990367f, -0.050748f}, + {0.267189f, 0.943676f, -0.195156f}, {0.139528f, 0.980985f, -0.134911f}, + {0.128835f, 0.990367f, -0.050748f}, {0.128835f, 0.990367f, -0.050748f}, + {0.135970f, 0.988769f, 0.062032f}, {0.269249f, 0.963068f, -0.002114f}, + {0.269249f, 0.963068f, -0.002114f}, {0.439209f, 0.866819f, -0.236050f}, + {0.267189f, 0.943676f, -0.195156f}, {0.439209f, 0.866819f, -0.236050f}, + {0.269249f, 0.963068f, -0.002114f}, {0.495685f, 0.868428f, 0.011380f}, + {0.274319f, 0.922629f, -0.271118f}, {0.139528f, 0.980985f, -0.134911f}, + {0.267189f, 0.943676f, -0.195156f}, {0.445390f, 0.806344f, -0.389150f}, + {0.267189f, 0.943676f, -0.195156f}, {0.439209f, 0.866819f, -0.236050f}, + {0.267189f, 0.943676f, -0.195156f}, {0.445390f, 0.806344f, -0.389150f}, + {0.274319f, 0.922629f, -0.271118f}, {-0.397014f, 0.641777f, -0.656127f}, + {-0.374744f, 0.269451f, -0.887109f}, {-0.598070f, 0.462524f, -0.654510f}, + {-0.371621f, -0.383998f, -0.845247f}, {-0.561989f, -0.242615f, -0.790763f}, + {-0.398928f, -0.136055f, -0.906832f}, {-0.371621f, -0.383998f, -0.845247f}, + {-0.398928f, -0.136055f, -0.906832f}, {-0.172576f, -0.266778f, -0.948181f}, + {-0.221868f, -0.404965f, -0.887005f}, {-0.371621f, -0.383998f, -0.845247f}, + {-0.172576f, -0.266778f, -0.948181f}, {-0.398928f, -0.136055f, -0.906832f}, + {-0.561989f, -0.242615f, -0.790763f}, {-0.759992f, -0.028623f, -0.649302f}, + {-0.671768f, 0.233451f, -0.703014f}, {-0.398928f, -0.136055f, -0.906832f}, + {-0.759992f, -0.028623f, -0.649302f}, {-0.398928f, -0.136055f, -0.906832f}, + {-0.671768f, 0.233451f, -0.703014f}, {-0.374744f, 0.269451f, -0.887109f}, + {-0.598070f, 0.462524f, -0.654510f}, {-0.374744f, 0.269451f, -0.887109f}, + {-0.671768f, 0.233451f, -0.703014f}, {-0.423759f, -0.527154f, -0.736571f}, + {-0.637959f, -0.496443f, -0.588687f}, {-0.616894f, -0.353384f, -0.703251f}, + {-0.637959f, -0.496443f, -0.588687f}, {-0.792261f, -0.268380f, -0.547992f}, + {-0.616894f, -0.353384f, -0.703251f}, {-0.616894f, -0.353384f, -0.703251f}, + {-0.792261f, -0.268380f, -0.547992f}, {-0.759992f, -0.028623f, -0.649302f}, + {-0.616894f, -0.353384f, -0.703251f}, {-0.759992f, -0.028623f, -0.649302f}, + {-0.561989f, -0.242615f, -0.790763f}, {-0.371621f, -0.383998f, -0.845247f}, + {-0.221868f, -0.404965f, -0.887005f}, {-0.423759f, -0.527154f, -0.736571f}, + {-0.616894f, -0.353384f, -0.703251f}, {-0.561989f, -0.242615f, -0.790763f}, + {-0.371621f, -0.383998f, -0.845247f}, {-0.423759f, -0.527154f, -0.736571f}, + {-0.616894f, -0.353384f, -0.703251f}, {-0.371621f, -0.383998f, -0.845247f}, + {-0.637959f, -0.496443f, -0.588687f}, {-0.423759f, -0.527154f, -0.736571f}, + {-0.591266f, -0.619562f, -0.516282f}, {-0.591266f, -0.619562f, -0.516282f}, + {-0.762666f, -0.418919f, -0.492796f}, {-0.792261f, -0.268380f, -0.547992f}, + {-0.792261f, -0.268380f, -0.547992f}, {-0.637959f, -0.496443f, -0.588687f}, + {-0.591266f, -0.619562f, -0.516282f}, {-0.773243f, -0.498286f, -0.392182f}, + {-0.762666f, -0.418919f, -0.492796f}, {-0.591266f, -0.619562f, -0.516282f}, + {-0.617572f, -0.732629f, -0.286111f}, {-0.779406f, -0.555755f, -0.289246f}, + {-0.773243f, -0.498286f, -0.392182f}, {-0.591266f, -0.619562f, -0.516282f}, + {-0.617572f, -0.732629f, -0.286111f}, {-0.773243f, -0.498286f, -0.392182f}, + {-0.783854f, -0.600732f, -0.157143f}, {-0.779406f, -0.555755f, -0.289246f}, + {-0.617572f, -0.732629f, -0.286111f}, {-0.615287f, -0.788146f, -0.015744f}, + {-0.799842f, -0.598163f, 0.049534f}, {-0.783854f, -0.600732f, -0.157143f}, + {-0.617572f, -0.732629f, -0.286111f}, {-0.615287f, -0.788146f, -0.015744f}, + {-0.783854f, -0.600732f, -0.157143f}, {-0.544593f, -0.801876f, 0.245791f}, + {-0.615287f, -0.788146f, -0.015744f}, {-0.559228f, -0.828703f, 0.022699f}, + {-0.615287f, -0.788146f, -0.015744f}, {-0.544593f, -0.801876f, 0.245791f}, + {-0.621396f, -0.736146f, 0.268247f}, {-0.479683f, -0.713959f, 0.510065f}, + {-0.621396f, -0.736146f, 0.268247f}, {-0.544593f, -0.801876f, 0.245791f}, + {-0.621396f, -0.736146f, 0.268247f}, {-0.479683f, -0.713959f, 0.510065f}, + {-0.600251f, -0.614652f, 0.511764f}, {-0.326762f, -0.532459f, 0.780842f}, + {-0.600251f, -0.614652f, 0.511764f}, {-0.479683f, -0.713959f, 0.510065f}, + {-0.600251f, -0.614652f, 0.511764f}, {-0.326762f, -0.532459f, 0.780842f}, + {-0.502597f, -0.561961f, 0.656959f}, {-0.171511f, -0.381440f, 0.908343f}, + {-0.237230f, -0.360647f, 0.902029f}, {-0.399666f, -0.459233f, 0.793330f}, + {-0.399666f, -0.459233f, 0.793330f}, {-0.502597f, -0.561961f, 0.656959f}, + {-0.326762f, -0.532459f, 0.780842f}, {-0.326762f, -0.532459f, 0.780842f}, + {-0.117200f, -0.310540f, 0.943308f}, {-0.171511f, -0.381440f, 0.908343f}, + {-0.171511f, -0.381440f, 0.908343f}, {-0.399666f, -0.459233f, 0.793330f}, + {-0.326762f, -0.532459f, 0.780842f}, {0.130191f, 0.048489f, 0.990303f}, + {0.171247f, -0.059534f, 0.983428f}, {0.026827f, -0.132269f, 0.990851f}, + {0.026827f, -0.132269f, 0.990851f}, {0.171247f, -0.059534f, 0.983428f}, + {0.000108f, -0.223144f, 0.974786f}, {0.000108f, -0.223144f, 0.974786f}, + {-0.237230f, -0.360647f, 0.902029f}, {-0.171511f, -0.381440f, 0.908343f}, + {-0.237230f, -0.360647f, 0.902029f}, {0.000108f, -0.223144f, 0.974786f}, + {-0.162448f, -0.277452f, 0.946906f}, {0.026827f, -0.132269f, 0.990851f}, + {0.000108f, -0.223144f, 0.974786f}, {-0.117200f, -0.310540f, 0.943308f}, + {-0.117200f, -0.310540f, 0.943308f}, {0.000108f, -0.223144f, 0.974786f}, + {-0.171511f, -0.381440f, 0.908343f}, {0.317441f, 0.247702f, 0.915355f}, + {0.290566f, 0.151929f, 0.944716f}, {0.254985f, 0.199097f, 0.946226f}, + {0.254985f, 0.199097f, 0.946226f}, {0.290566f, 0.151929f, 0.944716f}, + {0.171346f, 0.146714f, 0.974226f}, {0.426351f, 0.434721f, 0.793248f}, + {0.504959f, 0.440850f, 0.742070f}, {0.372522f, 0.318324f, 0.871721f}, + {0.372522f, 0.318324f, 0.871721f}, {0.504959f, 0.440850f, 0.742070f}, + {0.728545f, -0.669331f, 0.145667f}, {0.525348f, 0.543657f, 0.654558f}, + {0.523016f, 0.598786f, 0.606555f}, {0.504959f, 0.440850f, 0.742070f}, + {0.525348f, 0.543657f, 0.654558f}, {0.504959f, 0.440850f, 0.742070f}, + {0.426351f, 0.434721f, 0.793248f}, {0.650707f, 0.673098f, 0.351454f}, + {0.582767f, 0.746767f, 0.320501f}, {0.585545f, 0.614605f, 0.528581f}, + {0.585545f, 0.614605f, 0.528581f}, {0.582767f, 0.746767f, 0.320501f}, + {0.541314f, 0.664654f, 0.514990f}, {0.582767f, 0.746767f, 0.320501f}, + {0.444480f, 0.855660f, 0.265111f}, {0.429695f, 0.814320f, 0.390185f}, + {0.541314f, 0.664654f, 0.514990f}, {0.582767f, 0.746767f, 0.320501f}, + {0.429695f, 0.814320f, 0.390185f}, {0.541314f, 0.664654f, 0.514990f}, + {0.429695f, 0.814320f, 0.390185f}, {0.470076f, 0.713698f, 0.519292f}, + {0.523016f, 0.598786f, 0.606555f}, {0.541314f, 0.664654f, 0.514990f}, + {0.470076f, 0.713698f, 0.519292f}, {0.585545f, 0.614605f, 0.528581f}, + {0.541314f, 0.664654f, 0.514990f}, {0.525348f, 0.543657f, 0.654558f}, + {0.525348f, 0.543657f, 0.654558f}, {0.541314f, 0.664654f, 0.514990f}, + {0.523016f, 0.598786f, 0.606555f}, {0.495685f, 0.868428f, 0.011380f}, + {0.444480f, 0.855660f, 0.265111f}, {0.582767f, 0.746767f, 0.320501f}, + {0.582767f, 0.746767f, 0.320501f}, {0.650707f, 0.673098f, 0.351454f}, + {0.659182f, 0.751371f, 0.030346f}, {0.495685f, 0.868428f, 0.011380f}, + {0.582767f, 0.746767f, 0.320501f}, {0.659182f, 0.751371f, 0.030346f}, + {0.599586f, 0.716545f, -0.356455f}, {0.495685f, 0.868428f, 0.011380f}, + {0.659182f, 0.751371f, 0.030346f}, {0.495685f, 0.868428f, 0.011380f}, + {0.599586f, 0.716545f, -0.356455f}, {0.439209f, 0.866819f, -0.236050f}, + {0.536759f, 0.614025f, -0.578673f}, {0.489136f, 0.689178f, -0.534583f}, + {0.445390f, 0.806344f, -0.389150f}, {0.445390f, 0.806344f, -0.389150f}, + {0.439209f, 0.866819f, -0.236050f}, {0.599586f, 0.716545f, -0.356455f}, + {0.599586f, 0.716545f, -0.356455f}, {0.536041f, 0.584026f, -0.609568f}, + {0.536759f, 0.614025f, -0.578673f}, {0.536759f, 0.614025f, -0.578673f}, + {0.445390f, 0.806344f, -0.389150f}, {0.599586f, 0.716545f, -0.356455f}, + {0.473121f, 0.350571f, -0.808243f}, {0.566193f, 0.539475f, -0.623211f}, + {0.479171f, 0.493236f, -0.726026f}, {0.566193f, 0.539475f, -0.623211f}, + {0.473121f, 0.350571f, -0.808243f}, {0.901109f, 0.387318f, 0.194905f}, + {0.479171f, 0.493236f, -0.726026f}, {0.536759f, 0.614025f, -0.578673f}, + {0.536041f, 0.584026f, -0.609568f}, {0.536759f, 0.614025f, -0.578673f}, + {0.479171f, 0.493236f, -0.726026f}, {0.566193f, 0.539475f, -0.623211f}, + {0.285257f, 0.243329f, -0.927049f}, {0.352300f, 0.203514f, -0.913492f}, + {0.345386f, 0.307643f, -0.886602f}, {0.345386f, 0.307643f, -0.886602f}, + {0.332521f, 0.099016f, -0.937883f}, {0.473121f, 0.350571f, -0.808243f}, + {0.210972f, 0.052291f, -0.976092f}, {0.047518f, -0.108157f, -0.992998f}, + {0.144672f, -0.040964f, -0.988631f}, {0.144672f, -0.040964f, -0.988631f}, + {0.358432f, -0.028939f, -0.933107f}, {0.210972f, 0.052291f, -0.976092f}, + {0.358432f, -0.028939f, -0.933107f}, {0.144672f, -0.040964f, -0.988631f}, + {0.053473f, -0.177418f, -0.982682f}, {0.210972f, 0.052291f, -0.976092f}, + {0.352300f, 0.203514f, -0.913492f}, {0.236355f, 0.191172f, -0.952675f}, + {-0.119178f, -0.301546f, -0.945974f}, {0.053473f, -0.177418f, -0.982682f}, + {0.047518f, -0.108157f, -0.992998f}, {0.053473f, -0.177418f, -0.982682f}, + {-0.119178f, -0.301546f, -0.945974f}, {-0.173650f, -0.377497f, -0.909583f}, + {-0.221868f, -0.404965f, -0.887005f}, {-0.172576f, -0.266778f, -0.948181f}, + {-0.041588f, -0.272536f, -0.961246f}, {-0.041588f, -0.272536f, -0.961246f}, + {0.053473f, -0.177418f, -0.982682f}, {-0.173650f, -0.377497f, -0.909583f}, + {-0.221868f, -0.404965f, -0.887005f}, {-0.041588f, -0.272536f, -0.961246f}, + {-0.173650f, -0.377497f, -0.909583f}, {0.023188f, -0.279177f, -0.959960f}, + {0.053473f, -0.177418f, -0.982682f}, {-0.041588f, -0.272536f, -0.961246f}, + {0.053473f, -0.177418f, -0.982682f}, {0.144672f, -0.040964f, -0.988631f}, + {0.047518f, -0.108157f, -0.992998f}, {-0.423759f, -0.527154f, -0.736571f}, + {-0.221868f, -0.404965f, -0.887005f}, {-0.173650f, -0.377497f, -0.909583f}, + {-0.173650f, -0.377497f, -0.909583f}, {-0.119178f, -0.301546f, -0.945974f}, + {-0.323750f, -0.525381f, -0.786868f}, {-0.423759f, -0.527154f, -0.736571f}, + {-0.173650f, -0.377497f, -0.909583f}, {-0.323750f, -0.525381f, -0.786868f}, + {-0.475085f, -0.713472f, -0.515026f}, {-0.591266f, -0.619562f, -0.516282f}, + {-0.323750f, -0.525381f, -0.786868f}, {-0.323750f, -0.525381f, -0.786868f}, + {-0.591266f, -0.619562f, -0.516282f}, {-0.423759f, -0.527154f, -0.736571f}, + {-0.541824f, -0.807389f, -0.233557f}, {-0.617572f, -0.732629f, -0.286111f}, + {-0.475085f, -0.713472f, -0.515026f}, {-0.475085f, -0.713472f, -0.515026f}, + {-0.617572f, -0.732629f, -0.286111f}, {-0.591266f, -0.619562f, -0.516282f}, + {-0.559228f, -0.828703f, 0.022699f}, {-0.615287f, -0.788146f, -0.015744f}, + {-0.541824f, -0.807389f, -0.233557f}, {-0.541824f, -0.807389f, -0.233557f}, + {-0.615287f, -0.788146f, -0.015744f}, {-0.617572f, -0.732629f, -0.286111f}, + {-0.473477f, -0.841369f, 0.260610f}, {-0.559228f, -0.828703f, 0.022699f}, + {-0.497328f, -0.867562f, -0.000172f}, {-0.559228f, -0.828703f, 0.022699f}, + {-0.473477f, -0.841369f, 0.260610f}, {-0.544593f, -0.801876f, 0.245791f}, + {-0.395440f, -0.748771f, 0.531948f}, {-0.544593f, -0.801876f, 0.245791f}, + {-0.473477f, -0.841369f, 0.260610f}, {-0.544593f, -0.801876f, 0.245791f}, + {-0.395440f, -0.748771f, 0.531948f}, {-0.479683f, -0.713959f, 0.510065f}, + {-0.284739f, -0.583770f, 0.760353f}, {-0.479683f, -0.713959f, 0.510065f}, + {-0.395440f, -0.748771f, 0.531948f}, {-0.479683f, -0.713959f, 0.510065f}, + {-0.284739f, -0.583770f, 0.760353f}, {-0.326762f, -0.532459f, 0.780842f}, + {-0.074163f, -0.290879f, 0.953881f}, {-0.326762f, -0.532459f, 0.780842f}, + {-0.284739f, -0.583770f, 0.760353f}, {-0.326762f, -0.532459f, 0.780842f}, + {-0.074163f, -0.290879f, 0.953881f}, {-0.117200f, -0.310540f, 0.943308f}, + {0.095176f, 0.009486f, 0.995415f}, {0.130191f, 0.048489f, 0.990303f}, + {0.026827f, -0.132269f, 0.990851f}, {0.026827f, -0.132269f, 0.990851f}, + {-0.117200f, -0.310540f, 0.943308f}, {-0.074163f, -0.290879f, 0.953881f}, + {-0.074163f, -0.290879f, 0.953881f}, {0.140657f, 0.004780f, 0.990047f}, + {0.095176f, 0.009486f, 0.995415f}, {0.095176f, 0.009486f, 0.995415f}, + {0.026827f, -0.132269f, 0.990851f}, {-0.074163f, -0.290879f, 0.953881f}, + {0.279216f, 0.291053f, 0.915056f}, {0.239223f, 0.215280f, 0.946798f}, + {0.235467f, 0.147537f, 0.960619f}, {0.254985f, 0.199097f, 0.946226f}, + {0.171346f, 0.146714f, 0.974226f}, {0.239223f, 0.215280f, 0.946798f}, + {0.239223f, 0.215280f, 0.946798f}, {0.317441f, 0.247702f, 0.915355f}, + {0.254985f, 0.199097f, 0.946226f}, {0.239223f, 0.215280f, 0.946798f}, + {0.171346f, 0.146714f, 0.974226f}, {0.095176f, 0.009486f, 0.995415f}, + {0.095176f, 0.009486f, 0.995415f}, {0.171346f, 0.146714f, 0.974226f}, + {0.130191f, 0.048489f, 0.990303f}, {0.235467f, 0.147537f, 0.960619f}, + {0.239223f, 0.215280f, 0.946798f}, {0.140657f, 0.004780f, 0.990047f}, + {0.140657f, 0.004780f, 0.990047f}, {0.239223f, 0.215280f, 0.946798f}, + {0.095176f, 0.009486f, 0.995415f}, {0.331846f, 0.370169f, 0.867671f}, + {0.372522f, 0.318324f, 0.871721f}, {0.239223f, 0.215280f, 0.946798f}, + {0.372522f, 0.318324f, 0.871721f}, {0.317441f, 0.247702f, 0.915355f}, + {0.239223f, 0.215280f, 0.946798f}, {0.239223f, 0.215280f, 0.946798f}, + {0.279216f, 0.291053f, 0.915056f}, {0.331846f, 0.370169f, 0.867671f}, + {0.331846f, 0.370169f, 0.867671f}, {0.426351f, 0.434721f, 0.793248f}, + {0.372522f, 0.318324f, 0.871721f}, {0.426351f, 0.434721f, 0.793248f}, + {0.331846f, 0.370169f, 0.867671f}, {0.387776f, 0.473954f, 0.790568f}, + {0.525348f, 0.543657f, 0.654558f}, {0.368866f, 0.575503f, 0.729886f}, + {0.539938f, 0.587035f, 0.603206f}, {0.368866f, 0.575503f, 0.729886f}, + {0.369157f, 0.773111f, 0.515774f}, {0.539938f, 0.587035f, 0.603206f}, + {0.525348f, 0.543657f, 0.654558f}, {0.387776f, 0.473954f, 0.790568f}, + {0.368866f, 0.575503f, 0.729886f}, {0.387776f, 0.473954f, 0.790568f}, + {0.525348f, 0.543657f, 0.654558f}, {0.426351f, 0.434721f, 0.793248f}, + {0.502365f, 0.707499f, 0.497066f}, {0.515681f, 0.796653f, 0.315305f}, + {0.624538f, 0.710203f, 0.324907f}, {0.624538f, 0.710203f, 0.324907f}, + {0.573487f, 0.633805f, 0.519041f}, {0.502365f, 0.707499f, 0.497066f}, + {0.624538f, 0.710203f, 0.324907f}, {0.650707f, 0.673098f, 0.351454f}, + {0.573487f, 0.633805f, 0.519041f}, {0.573487f, 0.633805f, 0.519041f}, + {0.650707f, 0.673098f, 0.351454f}, {0.585545f, 0.614605f, 0.528581f}, + {0.573487f, 0.633805f, 0.519041f}, {0.585545f, 0.614605f, 0.528581f}, + {0.539938f, 0.587035f, 0.603206f}, {0.539938f, 0.587035f, 0.603206f}, + {0.585545f, 0.614605f, 0.528581f}, {0.525348f, 0.543657f, 0.654558f}, + {0.502365f, 0.707499f, 0.497066f}, {0.573487f, 0.633805f, 0.519041f}, + {0.369157f, 0.773111f, 0.515774f}, {0.369157f, 0.773111f, 0.515774f}, + {0.573487f, 0.633805f, 0.519041f}, {0.539938f, 0.587035f, 0.603206f}, + {0.624538f, 0.710203f, 0.324907f}, {0.515681f, 0.796653f, 0.315305f}, + {0.539602f, 0.840918f, 0.041068f}, {0.659182f, 0.751371f, 0.030346f}, + {0.650707f, 0.673098f, 0.351454f}, {0.624538f, 0.710203f, 0.324907f}, + {0.624538f, 0.710203f, 0.324907f}, {0.539602f, 0.840918f, 0.041068f}, + {0.659182f, 0.751371f, 0.030346f}, {0.549529f, 0.775081f, -0.311877f}, + {0.659182f, 0.751371f, 0.030346f}, {0.539602f, 0.840918f, 0.041068f}, + {0.659182f, 0.751371f, 0.030346f}, {0.549529f, 0.775081f, -0.311877f}, + {0.599586f, 0.716545f, -0.356455f}, {0.599586f, 0.716545f, -0.356455f}, + {0.549529f, 0.775081f, -0.311877f}, {0.478100f, 0.677135f, -0.559383f}, + {0.536041f, 0.584026f, -0.609568f}, {0.599586f, 0.716545f, -0.356455f}, + {0.478100f, 0.677135f, -0.559383f}, {0.479171f, 0.493236f, -0.726026f}, + {0.418080f, 0.549169f, -0.723617f}, {0.411254f, 0.447659f, -0.794023f}, + {0.418080f, 0.549169f, -0.723617f}, {0.370038f, 0.477205f, -0.797087f}, + {0.411254f, 0.447659f, -0.794023f}, {0.411254f, 0.447659f, -0.794023f}, + {0.473121f, 0.350571f, -0.808243f}, {0.479171f, 0.493236f, -0.726026f}, + {0.479171f, 0.493236f, -0.726026f}, {0.536041f, 0.584026f, -0.609568f}, + {0.418080f, 0.549169f, -0.723617f}, {0.418080f, 0.549169f, -0.723617f}, + {0.536041f, 0.584026f, -0.609568f}, {0.478100f, 0.677135f, -0.559383f}, + {0.258142f, 0.203290f, -0.944476f}, {0.356955f, 0.354913f, -0.864072f}, + {0.337143f, 0.377704f, -0.862365f}, {0.356955f, 0.354913f, -0.864072f}, + {0.258142f, 0.203290f, -0.944476f}, {0.291596f, 0.266743f, -0.918597f}, + {0.345386f, 0.307643f, -0.886602f}, {0.473121f, 0.350571f, -0.808243f}, + {0.356955f, 0.354913f, -0.864072f}, {0.291596f, 0.266743f, -0.918597f}, + {0.285257f, 0.243329f, -0.927049f}, {0.345386f, 0.307643f, -0.886602f}, + {0.356955f, 0.354913f, -0.864072f}, {0.291596f, 0.266743f, -0.918597f}, + {0.345386f, 0.307643f, -0.886602f}, {0.356955f, 0.354913f, -0.864072f}, + {0.473121f, 0.350571f, -0.808243f}, {0.411254f, 0.447659f, -0.794023f}, + {0.337143f, 0.377704f, -0.862365f}, {0.411254f, 0.447659f, -0.794023f}, + {0.370038f, 0.477205f, -0.797087f}, {0.411254f, 0.447659f, -0.794023f}, + {0.337143f, 0.377704f, -0.862365f}, {0.356955f, 0.354913f, -0.864072f}, + {0.136445f, -0.001587f, -0.990646f}, {0.209959f, 0.159652f, -0.964587f}, + {0.258142f, 0.203290f, -0.944476f}, {0.209959f, 0.159652f, -0.964587f}, + {0.136445f, -0.001587f, -0.990646f}, {0.095053f, -0.015287f, -0.995355f}, + {0.210972f, 0.052291f, -0.976092f}, {0.236355f, 0.191172f, -0.952675f}, + {0.209959f, 0.159652f, -0.964587f}, {0.095053f, -0.015287f, -0.995355f}, + {0.047518f, -0.108157f, -0.992998f}, {0.210972f, 0.052291f, -0.976092f}, + {0.209959f, 0.159652f, -0.964587f}, {0.095053f, -0.015287f, -0.995355f}, + {0.210972f, 0.052291f, -0.976092f}, {0.236355f, 0.191172f, -0.952675f}, + {0.285257f, 0.243329f, -0.927049f}, {0.291596f, 0.266743f, -0.918597f}, + {0.291596f, 0.266743f, -0.918597f}, {0.209959f, 0.159652f, -0.964587f}, + {0.236355f, 0.191172f, -0.952675f}, {0.291596f, 0.266743f, -0.918597f}, + {0.258142f, 0.203290f, -0.944476f}, {0.209959f, 0.159652f, -0.964587f}, + {0.095053f, -0.015287f, -0.995355f}, {0.136445f, -0.001587f, -0.990646f}, + {-0.043007f, -0.262075f, -0.964089f}, {-0.043007f, -0.262075f, -0.964089f}, + {-0.119178f, -0.301546f, -0.945974f}, {0.047518f, -0.108157f, -0.992998f}, + {0.047518f, -0.108157f, -0.992998f}, {0.095053f, -0.015287f, -0.995355f}, + {-0.043007f, -0.262075f, -0.964089f}, {-0.273805f, -0.598068f, -0.753223f}, + {-0.323750f, -0.525381f, -0.786868f}, {-0.043007f, -0.262075f, -0.964089f}, + {-0.043007f, -0.262075f, -0.964089f}, {-0.323750f, -0.525381f, -0.786868f}, + {-0.119178f, -0.301546f, -0.945974f}, {-0.407844f, -0.770366f, -0.490101f}, + {-0.475085f, -0.713472f, -0.515026f}, {-0.273805f, -0.598068f, -0.753223f}, + {-0.273805f, -0.598068f, -0.753223f}, {-0.475085f, -0.713472f, -0.515026f}, + {-0.323750f, -0.525381f, -0.786868f}, {-0.466057f, -0.851463f, -0.240420f}, + {-0.541824f, -0.807389f, -0.233557f}, {-0.407844f, -0.770366f, -0.490101f}, + {-0.407844f, -0.770366f, -0.490101f}, {-0.541824f, -0.807389f, -0.233557f}, + {-0.475085f, -0.713472f, -0.515026f}, {-0.497328f, -0.867562f, -0.000172f}, + {-0.541824f, -0.807389f, -0.233557f}, {-0.466057f, -0.851463f, -0.240420f}, + {-0.541824f, -0.807389f, -0.233557f}, {-0.497328f, -0.867562f, -0.000172f}, + {-0.559228f, -0.828703f, 0.022699f}, {-0.377208f, -0.892118f, 0.248676f}, + {-0.497328f, -0.867562f, -0.000172f}, {-0.374004f, -0.927402f, -0.006768f}, + {-0.497328f, -0.867562f, -0.000172f}, {-0.377208f, -0.892118f, 0.248676f}, + {-0.473477f, -0.841369f, 0.260610f}, {-0.314829f, -0.809345f, 0.495826f}, + {-0.473477f, -0.841369f, 0.260610f}, {-0.377208f, -0.892118f, 0.248676f}, + {-0.473477f, -0.841369f, 0.260610f}, {-0.314829f, -0.809345f, 0.495826f}, + {-0.395440f, -0.748771f, 0.531948f}, {-0.190355f, -0.597144f, 0.779220f}, + {-0.395440f, -0.748771f, 0.531948f}, {-0.314829f, -0.809345f, 0.495826f}, + {-0.395440f, -0.748771f, 0.531948f}, {-0.190355f, -0.597144f, 0.779220f}, + {-0.284739f, -0.583770f, 0.760353f}, {-0.005255f, -0.269980f, 0.962852f}, + {-0.074163f, -0.290879f, 0.953881f}, {-0.190355f, -0.597144f, 0.779220f}, + {-0.190355f, -0.597144f, 0.779220f}, {-0.074163f, -0.290879f, 0.953881f}, + {-0.284739f, -0.583770f, 0.760353f}, {0.116133f, 0.039387f, 0.992452f}, + {0.140657f, 0.004780f, 0.990047f}, {-0.005255f, -0.269980f, 0.962852f}, + {-0.005255f, -0.269980f, 0.962852f}, {0.140657f, 0.004780f, 0.990047f}, + {-0.074163f, -0.290879f, 0.953881f}, {0.257029f, 0.521014f, 0.813929f}, + {0.387776f, 0.473954f, 0.790568f}, {0.289593f, 0.427276f, 0.856488f}, + {0.289593f, 0.427276f, 0.856488f}, {0.387776f, 0.473954f, 0.790568f}, + {0.331846f, 0.370169f, 0.867671f}, {0.289593f, 0.427276f, 0.856488f}, + {0.331846f, 0.370169f, 0.867671f}, {0.237922f, 0.252894f, 0.937784f}, + {0.237922f, 0.252894f, 0.937784f}, {0.331846f, 0.370169f, 0.867671f}, + {0.279216f, 0.291053f, 0.915056f}, {0.430884f, 0.865455f, 0.255590f}, + {0.515681f, 0.796653f, 0.315305f}, {0.117155f, 0.955892f, 0.269343f}, + {0.117155f, 0.955892f, 0.269343f}, {0.515681f, 0.796653f, 0.315305f}, + {0.502365f, 0.707499f, 0.497066f}, {0.394247f, 0.868528f, -0.300381f}, + {0.394155f, 0.919019f, 0.006732f}, {0.389407f, 0.917268f, -0.083558f}, + {0.394155f, 0.919019f, 0.006732f}, {0.363541f, 0.930338f, 0.048048f}, + {0.389407f, 0.917268f, -0.083558f}, {0.394247f, 0.868528f, -0.300381f}, + {0.539602f, 0.840918f, 0.041068f}, {0.394155f, 0.919019f, 0.006732f}, + {0.539602f, 0.840918f, 0.041068f}, {0.394247f, 0.868528f, -0.300381f}, + {0.549529f, 0.775081f, -0.311877f}, {0.302614f, 0.739474f, -0.601335f}, + {0.549529f, 0.775081f, -0.311877f}, {0.394247f, 0.868528f, -0.300381f}, + {0.549529f, 0.775081f, -0.311877f}, {0.302614f, 0.739474f, -0.601335f}, + {0.478100f, 0.677135f, -0.559383f}, {0.302614f, 0.739474f, -0.601335f}, + {0.394247f, 0.868528f, -0.300381f}, {0.389407f, 0.917268f, -0.083558f}, + {0.287894f, 0.519724f, -0.804365f}, {0.418080f, 0.549169f, -0.723617f}, + {0.271568f, 0.608361f, -0.745753f}, {0.418080f, 0.549169f, -0.723617f}, + {0.287894f, 0.519724f, -0.804365f}, {0.370038f, 0.477205f, -0.797087f}, + {0.271568f, 0.608361f, -0.745753f}, {0.478100f, 0.677135f, -0.559383f}, + {0.302614f, 0.739474f, -0.601335f}, {0.478100f, 0.677135f, -0.559383f}, + {0.271568f, 0.608361f, -0.745753f}, {0.418080f, 0.549169f, -0.723617f}, + {0.258142f, 0.203290f, -0.944476f}, {0.337143f, 0.377704f, -0.862365f}, + {0.221229f, 0.403398f, -0.887878f}, {0.221229f, 0.403398f, -0.887878f}, + {0.370038f, 0.477205f, -0.797087f}, {0.287894f, 0.519724f, -0.804365f}, + {0.370038f, 0.477205f, -0.797087f}, {0.221229f, 0.403398f, -0.887878f}, + {0.337143f, 0.377704f, -0.862365f}, {0.157104f, 0.219159f, -0.962958f}, + {0.000501f, 0.173705f, -0.984798f}, {0.141854f, 0.051803f, -0.988531f}, + {0.137342f, 0.019641f, -0.990329f}, {0.213913f, 0.195514f, -0.957087f}, + {0.157104f, 0.219159f, -0.962958f}, {0.157104f, 0.219159f, -0.962958f}, + {0.141854f, 0.051803f, -0.988531f}, {0.137342f, 0.019641f, -0.990329f}, + {0.137342f, 0.019641f, -0.990329f}, {0.258142f, 0.203290f, -0.944476f}, + {0.213913f, 0.195514f, -0.957087f}, {0.258142f, 0.203290f, -0.944476f}, + {0.137342f, 0.019641f, -0.990329f}, {0.136445f, -0.001587f, -0.990646f}, + {0.258142f, 0.203290f, -0.944476f}, {0.221229f, 0.403398f, -0.887878f}, + {0.213913f, 0.195514f, -0.957087f}, {0.221229f, 0.403398f, -0.887878f}, + {0.157104f, 0.219159f, -0.962958f}, {0.213913f, 0.195514f, -0.957087f}, + {0.137342f, 0.019641f, -0.990329f}, {0.141854f, 0.051803f, -0.988531f}, + {0.094557f, -0.119319f, -0.988343f}, {0.094557f, -0.119319f, -0.988343f}, + {-0.037497f, -0.313765f, -0.948760f}, {-0.043007f, -0.262075f, -0.964089f}, + {-0.043007f, -0.262075f, -0.964089f}, {0.136445f, -0.001587f, -0.990646f}, + {0.137342f, 0.019641f, -0.990329f}, {0.137342f, 0.019641f, -0.990329f}, + {0.094557f, -0.119319f, -0.988343f}, {-0.043007f, -0.262075f, -0.964089f}, + {-0.152504f, -0.546578f, -0.823404f}, {-0.043007f, -0.262075f, -0.964089f}, + {-0.037497f, -0.313765f, -0.948760f}, {-0.043007f, -0.262075f, -0.964089f}, + {-0.152504f, -0.546578f, -0.823404f}, {-0.273805f, -0.598068f, -0.753223f}, + {-0.280507f, -0.780886f, -0.558151f}, {-0.273805f, -0.598068f, -0.753223f}, + {-0.152504f, -0.546578f, -0.823404f}, {-0.273805f, -0.598068f, -0.753223f}, + {-0.280507f, -0.780886f, -0.558151f}, {-0.407844f, -0.770366f, -0.490101f}, + {-0.350952f, -0.897033f, -0.268635f}, {-0.407844f, -0.770366f, -0.490101f}, + {-0.280507f, -0.780886f, -0.558151f}, {-0.407844f, -0.770366f, -0.490101f}, + {-0.350952f, -0.897033f, -0.268635f}, {-0.466057f, -0.851463f, -0.240420f}, + {-0.374004f, -0.927402f, -0.006768f}, {-0.466057f, -0.851463f, -0.240420f}, + {-0.350952f, -0.897033f, -0.268635f}, {-0.466057f, -0.851463f, -0.240420f}, + {-0.374004f, -0.927402f, -0.006768f}, {-0.497328f, -0.867562f, -0.000172f}, + {-0.163343f, -0.970222f, 0.178855f}, {-0.374004f, -0.927402f, -0.006768f}, + {-0.102058f, -0.994587f, 0.019515f}, {-0.374004f, -0.927402f, -0.006768f}, + {-0.163343f, -0.970222f, 0.178855f}, {-0.377208f, -0.892118f, 0.248676f}, + {-0.137914f, -0.869049f, 0.475114f}, {-0.314829f, -0.809345f, 0.495826f}, + {-0.163343f, -0.970222f, 0.178855f}, {-0.163343f, -0.970222f, 0.178855f}, + {-0.314829f, -0.809345f, 0.495826f}, {-0.377208f, -0.892118f, 0.248676f}, + {-0.033047f, -0.638409f, 0.768987f}, {-0.190355f, -0.597144f, 0.779220f}, + {-0.137914f, -0.869049f, 0.475114f}, {-0.137914f, -0.869049f, 0.475114f}, + {-0.190355f, -0.597144f, 0.779220f}, {-0.314829f, -0.809345f, 0.495826f}, + {0.120066f, -0.362929f, 0.924049f}, {-0.005255f, -0.269980f, 0.962852f}, + {-0.033047f, -0.638409f, 0.768987f}, {-0.033047f, -0.638409f, 0.768987f}, + {-0.005255f, -0.269980f, 0.962852f}, {-0.190355f, -0.597144f, 0.779220f}, + {0.127212f, -0.007665f, 0.991846f}, {0.116133f, 0.039387f, 0.992452f}, + {-0.005255f, -0.269980f, 0.962852f}, {0.120066f, -0.362929f, 0.924049f}, + {0.280039f, -0.109783f, 0.953691f}, {0.127212f, -0.007665f, 0.991846f}, + {-0.005255f, -0.269980f, 0.962852f}, {0.120066f, -0.362929f, 0.924049f}, + {0.127212f, -0.007665f, 0.991846f}, {0.210996f, 0.179609f, 0.960844f}, + {0.164650f, 0.189698f, 0.967939f}, {0.127212f, -0.007665f, 0.991846f}, + {0.127212f, -0.007665f, 0.991846f}, {0.164650f, 0.189698f, 0.967939f}, + {0.116133f, 0.039387f, 0.992452f}, {0.341647f, 0.023101f, 0.939544f}, + {0.210996f, 0.179609f, 0.960844f}, {0.280039f, -0.109783f, 0.953691f}, + {0.280039f, -0.109783f, 0.953691f}, {0.210996f, 0.179609f, 0.960844f}, + {0.127212f, -0.007665f, 0.991846f}, {0.799601f, 0.586555f, -0.128808f}, + {0.389407f, 0.917268f, -0.083558f}, {0.786920f, 0.596066f, -0.159568f}, + {0.538710f, 0.837608f, 0.090582f}, {0.389407f, 0.917268f, -0.083558f}, + {0.363541f, 0.930338f, 0.048048f}, {0.786920f, 0.596066f, -0.159568f}, + {0.389407f, 0.917268f, -0.083558f}, {0.731872f, 0.676764f, 0.079707f}, + {0.731872f, 0.676764f, 0.079707f}, {0.389407f, 0.917268f, -0.083558f}, + {0.538710f, 0.837608f, 0.090582f}, {0.264590f, -0.079383f, -0.961088f}, + {0.234090f, -0.070518f, -0.969654f}, {0.392398f, -0.002293f, -0.919793f}, + {0.392398f, -0.002293f, -0.919793f}, {0.234090f, -0.070518f, -0.969654f}, + {0.424145f, -0.020815f, -0.905355f}, {0.094557f, -0.119319f, -0.988343f}, + {0.044211f, -0.240634f, -0.969609f}, {-0.037497f, -0.313765f, -0.948760f}, + {0.093003f, 0.009710f, -0.995618f}, {0.148955f, -0.048469f, -0.987655f}, + {0.044211f, -0.240634f, -0.969609f}, {0.094557f, -0.119319f, -0.988343f}, + {0.141854f, 0.051803f, -0.988531f}, {0.093003f, 0.009710f, -0.995618f}, + {0.044211f, -0.240634f, -0.969609f}, {0.094557f, -0.119319f, -0.988343f}, + {0.093003f, 0.009710f, -0.995618f}, {0.234090f, -0.070518f, -0.969654f}, + {0.264590f, -0.079383f, -0.961088f}, {0.169240f, -0.249393f, -0.953499f}, + {0.044211f, -0.240634f, -0.969609f}, {0.148955f, -0.048469f, -0.987655f}, + {0.234090f, -0.070518f, -0.969654f}, {0.169240f, -0.249393f, -0.953499f}, + {0.044211f, -0.240634f, -0.969609f}, {0.234090f, -0.070518f, -0.969654f}, + {0.044211f, -0.240634f, -0.969609f}, {0.169240f, -0.249393f, -0.953499f}, + {-0.016049f, -0.585754f, -0.810330f}, {-0.152504f, -0.546578f, -0.823404f}, + {-0.037497f, -0.313765f, -0.948760f}, {0.044211f, -0.240634f, -0.969609f}, + {0.044211f, -0.240634f, -0.969609f}, {-0.016049f, -0.585754f, -0.810330f}, + {-0.152504f, -0.546578f, -0.823404f}, {-0.152504f, -0.546578f, -0.823404f}, + {-0.016049f, -0.585754f, -0.810330f}, {-0.143380f, -0.826198f, -0.544830f}, + {-0.280507f, -0.780886f, -0.558151f}, {-0.152504f, -0.546578f, -0.823404f}, + {-0.143380f, -0.826198f, -0.544830f}, {-0.280507f, -0.780886f, -0.558151f}, + {-0.143380f, -0.826198f, -0.544830f}, {-0.191971f, -0.942758f, -0.272679f}, + {-0.350952f, -0.897033f, -0.268635f}, {-0.280507f, -0.780886f, -0.558151f}, + {-0.191971f, -0.942758f, -0.272679f}, {-0.102058f, -0.994587f, 0.019515f}, + {-0.350952f, -0.897033f, -0.268635f}, {-0.191971f, -0.942758f, -0.272679f}, + {-0.350952f, -0.897033f, -0.268635f}, {-0.102058f, -0.994587f, 0.019515f}, + {-0.374004f, -0.927402f, -0.006768f}, {0.210930f, -0.976875f, -0.034974f}, + {0.190097f, -0.981642f, -0.015539f}, {-0.163343f, -0.970222f, 0.178855f}, + {-0.163343f, -0.970222f, 0.178855f}, {-0.102058f, -0.994587f, 0.019515f}, + {0.210930f, -0.976875f, -0.034974f}, {0.190097f, -0.981642f, -0.015539f}, + {0.224199f, -0.938395f, 0.262962f}, {-0.137914f, -0.869049f, 0.475114f}, + {-0.137914f, -0.869049f, 0.475114f}, {-0.163343f, -0.970222f, 0.178855f}, + {0.190097f, -0.981642f, -0.015539f}, {-0.033047f, -0.638409f, 0.768987f}, + {-0.137914f, -0.869049f, 0.475114f}, {0.224199f, -0.938395f, 0.262962f}, + {0.353777f, -0.726420f, 0.589199f}, {0.511608f, -0.561882f, 0.650036f}, + {0.120066f, -0.362929f, 0.924049f}, {-0.033047f, -0.638409f, 0.768987f}, + {0.224199f, -0.938395f, 0.262962f}, {0.353777f, -0.726420f, 0.589199f}, + {0.120066f, -0.362929f, 0.924049f}, {-0.033047f, -0.638409f, 0.768987f}, + {0.353777f, -0.726420f, 0.589199f}, {0.511608f, -0.561882f, 0.650036f}, + {0.639533f, -0.264203f, 0.721938f}, {0.280039f, -0.109783f, 0.953691f}, + {0.280039f, -0.109783f, 0.953691f}, {0.120066f, -0.362929f, 0.924049f}, + {0.511608f, -0.561882f, 0.650036f}, {0.341647f, 0.023101f, 0.939544f}, + {0.639533f, -0.264203f, 0.721938f}, {0.598439f, 0.005316f, 0.801151f}, + {0.639533f, -0.264203f, 0.721938f}, {0.804716f, -0.105957f, 0.584128f}, + {0.598439f, 0.005316f, 0.801151f}, {0.598439f, 0.005316f, 0.801151f}, + {0.439946f, 0.175781f, 0.880652f}, {0.341647f, 0.023101f, 0.939544f}, + {0.341647f, 0.023101f, 0.939544f}, {0.280039f, -0.109783f, 0.953691f}, + {0.639533f, -0.264203f, 0.721938f}, {0.687959f, 0.142898f, 0.711542f}, + {0.547075f, 0.225477f, 0.806145f}, {0.439946f, 0.175781f, 0.880652f}, + {0.598439f, 0.005316f, 0.801151f}, {0.687959f, 0.142898f, 0.711542f}, + {0.439946f, 0.175781f, 0.880652f}, {0.861301f, -0.000411f, 0.508095f}, + {0.598439f, 0.005316f, 0.801151f}, {0.804716f, -0.105957f, 0.584128f}, + {0.598439f, 0.005316f, 0.801151f}, {0.861301f, -0.000411f, 0.508095f}, + {0.687959f, 0.142898f, 0.711542f}, {0.951587f, 0.108524f, 0.287584f}, + {0.865086f, 0.209543f, 0.455760f}, {0.789740f, 0.237525f, 0.565590f}, + {0.896752f, 0.083947f, 0.434498f}, {0.951587f, 0.108524f, 0.287584f}, + {0.789740f, 0.237525f, 0.565590f}, {0.896752f, 0.083947f, 0.434498f}, + {0.687959f, 0.142898f, 0.711542f}, {0.861301f, -0.000411f, 0.508095f}, + {0.687959f, 0.142898f, 0.711542f}, {0.896752f, 0.083947f, 0.434498f}, + {0.789740f, 0.237525f, 0.565590f}, {0.985392f, 0.139742f, 0.097340f}, + {0.910755f, 0.278726f, 0.304691f}, {0.951587f, 0.108524f, 0.287584f}, + {0.910755f, 0.278726f, 0.304691f}, {0.985392f, 0.139742f, 0.097340f}, + {0.918588f, 0.375123f, 0.124412f}, {0.988068f, 0.082398f, -0.130127f}, + {0.950230f, 0.289648f, -0.114750f}, {0.993675f, 0.098244f, -0.054396f}, + {0.894765f, 0.304007f, -0.327071f}, {0.799601f, 0.586555f, -0.128808f}, + {0.786920f, 0.596066f, -0.159568f}, {0.786920f, 0.596066f, -0.159568f}, + {0.950230f, 0.289648f, -0.114750f}, {0.894765f, 0.304007f, -0.327071f}, + {0.950230f, 0.289648f, -0.114750f}, {0.786920f, 0.596066f, -0.159568f}, + {0.918588f, 0.375123f, 0.124412f}, {0.918588f, 0.375123f, 0.124412f}, + {0.786920f, 0.596066f, -0.159568f}, {0.731872f, 0.676764f, 0.079707f}, + {0.993675f, 0.098244f, -0.054396f}, {0.950230f, 0.289648f, -0.114750f}, + {0.985392f, 0.139742f, 0.097340f}, {0.985392f, 0.139742f, 0.097340f}, + {0.950230f, 0.289648f, -0.114750f}, {0.918588f, 0.375123f, 0.124412f}, + {0.967595f, 0.066322f, -0.243640f}, {0.962907f, 0.011074f, -0.269605f}, + {0.858324f, 0.212906f, -0.466852f}, {0.894765f, 0.304007f, -0.327071f}, + {0.950230f, 0.289648f, -0.114750f}, {0.988068f, 0.082398f, -0.130127f}, + {0.967595f, 0.066322f, -0.243640f}, {0.858324f, 0.212906f, -0.466852f}, + {0.894765f, 0.304007f, -0.327071f}, {0.988068f, 0.082398f, -0.130127f}, + {0.967595f, 0.066322f, -0.243640f}, {0.894765f, 0.304007f, -0.327071f}, + {0.791501f, 0.092271f, -0.604162f}, {0.858268f, 0.137759f, -0.494366f}, + {0.962907f, 0.011074f, -0.269605f}, {0.858268f, 0.137759f, -0.494366f}, + {0.858324f, 0.212906f, -0.466852f}, {0.962907f, 0.011074f, -0.269605f}, + {0.589576f, -0.007204f, -0.807680f}, {0.791501f, 0.092271f, -0.604162f}, + {0.769738f, -0.265371f, -0.580588f}, {0.904838f, 0.008526f, -0.425672f}, + {0.769738f, -0.265371f, -0.580588f}, {0.791501f, 0.092271f, -0.604162f}, + {0.791501f, 0.092271f, -0.604162f}, {0.962907f, 0.011074f, -0.269605f}, + {0.904838f, 0.008526f, -0.425672f}, {0.485485f, -0.220888f, -0.845880f}, + {0.589576f, -0.007204f, -0.807680f}, {0.769738f, -0.265371f, -0.580588f}, + {0.392398f, -0.002293f, -0.919793f}, {0.424145f, -0.020815f, -0.905355f}, + {0.589576f, -0.007204f, -0.807680f}, {0.485485f, -0.220888f, -0.845880f}, + {0.264590f, -0.079383f, -0.961088f}, {0.392398f, -0.002293f, -0.919793f}, + {0.589576f, -0.007204f, -0.807680f}, {0.485485f, -0.220888f, -0.845880f}, + {0.392398f, -0.002293f, -0.919793f}, {0.240533f, -0.622708f, -0.744566f}, + {0.399127f, -0.383298f, -0.832935f}, {0.524647f, -0.678988f, -0.513537f}, + {0.240533f, -0.622708f, -0.744566f}, {0.169240f, -0.249393f, -0.953499f}, + {0.399127f, -0.383298f, -0.832935f}, {0.399127f, -0.383298f, -0.832935f}, + {0.169240f, -0.249393f, -0.953499f}, {0.485485f, -0.220888f, -0.845880f}, + {0.485485f, -0.220888f, -0.845880f}, {0.169240f, -0.249393f, -0.953499f}, + {0.264590f, -0.079383f, -0.961088f}, {0.485485f, -0.220888f, -0.845880f}, + {0.769738f, -0.265371f, -0.580588f}, {0.524647f, -0.678988f, -0.513537f}, + {0.399127f, -0.383298f, -0.832935f}, {0.485485f, -0.220888f, -0.845880f}, + {0.524647f, -0.678988f, -0.513537f}, {0.452065f, -0.827090f, -0.334004f}, + {0.240533f, -0.622708f, -0.744566f}, {0.524647f, -0.678988f, -0.513537f}, + {0.240533f, -0.622708f, -0.744566f}, {0.452065f, -0.827090f, -0.334004f}, + {0.095670f, -0.882752f, -0.459997f}, {0.095670f, -0.882752f, -0.459997f}, + {-0.016049f, -0.585754f, -0.810330f}, {0.240533f, -0.622708f, -0.744566f}, + {0.169240f, -0.249393f, -0.953499f}, {0.240533f, -0.622708f, -0.744566f}, + {-0.016049f, -0.585754f, -0.810330f}, {-0.016049f, -0.585754f, -0.810330f}, + {0.095670f, -0.882752f, -0.459997f}, {-0.143380f, -0.826198f, -0.544830f}, + {0.367012f, -0.929957f, -0.021950f}, {0.095670f, -0.882752f, -0.459997f}, + {0.452065f, -0.827090f, -0.334004f}, {0.296586f, -0.951540f, 0.081293f}, + {0.033029f, -0.994150f, -0.102832f}, {0.367012f, -0.929957f, -0.021950f}, + {0.033029f, -0.994150f, -0.102832f}, {-0.143380f, -0.826198f, -0.544830f}, + {0.095670f, -0.882752f, -0.459997f}, {-0.143380f, -0.826198f, -0.544830f}, + {0.033029f, -0.994150f, -0.102832f}, {-0.191971f, -0.942758f, -0.272679f}, + {0.095670f, -0.882752f, -0.459997f}, {0.367012f, -0.929957f, -0.021950f}, + {0.033029f, -0.994150f, -0.102832f}, {0.296586f, -0.951540f, 0.081293f}, + {0.210930f, -0.976875f, -0.034974f}, {-0.102058f, -0.994587f, 0.019515f}, + {-0.102058f, -0.994587f, 0.019515f}, {-0.191971f, -0.942758f, -0.272679f}, + {0.033029f, -0.994150f, -0.102832f}, {0.033029f, -0.994150f, -0.102832f}, + {0.296586f, -0.951540f, 0.081293f}, {-0.102058f, -0.994587f, 0.019515f}, + {0.562522f, -0.811846f, -0.156445f}, {0.928867f, -0.368286f, 0.039641f}, + {0.787910f, -0.615693f, 0.010936f}, {0.210930f, -0.976875f, -0.034974f}, + {0.562522f, -0.811846f, -0.156445f}, {0.190097f, -0.981642f, -0.015539f}, + {0.589205f, -0.804726f, 0.072478f}, {0.787910f, -0.615693f, 0.010936f}, + {0.471417f, -0.864277f, -0.175471f}, {0.589205f, -0.804726f, 0.072478f}, + {0.471417f, -0.864277f, -0.175471f}, {0.224199f, -0.938395f, 0.262962f}, + {0.224199f, -0.938395f, 0.262962f}, {0.190097f, -0.981642f, -0.015539f}, + {0.589205f, -0.804726f, 0.072478f}, {0.562522f, -0.811846f, -0.156445f}, + {0.589205f, -0.804726f, 0.072478f}, {0.190097f, -0.981642f, -0.015539f}, + {0.562522f, -0.811846f, -0.156445f}, {0.787910f, -0.615693f, 0.010936f}, + {0.589205f, -0.804726f, 0.072478f}, {0.928867f, -0.368286f, 0.039641f}, + {0.589205f, -0.804726f, 0.072478f}, {0.787910f, -0.615693f, 0.010936f}, + {0.928867f, -0.368286f, 0.039641f}, {0.805306f, -0.555204f, 0.207920f}, + {0.589205f, -0.804726f, 0.072478f}, {0.805306f, -0.555204f, 0.207920f}, + {0.511608f, -0.561882f, 0.650036f}, {0.589205f, -0.804726f, 0.072478f}, + {0.589205f, -0.804726f, 0.072478f}, {0.511608f, -0.561882f, 0.650036f}, + {0.353777f, -0.726420f, 0.589199f}, {0.589205f, -0.804726f, 0.072478f}, + {0.353777f, -0.726420f, 0.589199f}, {0.224199f, -0.938395f, 0.262962f}, + {0.805306f, -0.555204f, 0.207920f}, {0.639533f, -0.264203f, 0.721938f}, + {0.511608f, -0.561882f, 0.650036f}, {0.929898f, -0.245520f, 0.273877f}, + {0.804716f, -0.105957f, 0.584128f}, {0.639533f, -0.264203f, 0.721938f}, + {0.929898f, -0.245520f, 0.273877f}, {0.639533f, -0.264203f, 0.721938f}, + {0.805306f, -0.555204f, 0.207920f}, {0.928867f, -0.368286f, 0.039641f}, + {0.929898f, -0.245520f, 0.273877f}, {0.805306f, -0.555204f, 0.207920f}, + {0.804716f, -0.105957f, 0.584128f}, {0.929898f, -0.245520f, 0.273877f}, + {0.861301f, -0.000411f, 0.508095f}, {0.896752f, 0.083947f, 0.434498f}, + {0.980217f, -0.098379f, 0.171745f}, {0.951587f, 0.108524f, 0.287584f}, + {0.980217f, -0.098379f, 0.171745f}, {0.861301f, -0.000411f, 0.508095f}, + {0.929898f, -0.245520f, 0.273877f}, {0.861301f, -0.000411f, 0.508095f}, + {0.980217f, -0.098379f, 0.171745f}, {0.896752f, 0.083947f, 0.434498f}, + {0.928867f, -0.368286f, 0.039641f}, {0.980217f, -0.098379f, 0.171745f}, + {0.929898f, -0.245520f, 0.273877f}, {0.928867f, -0.368286f, 0.039641f}, + {0.996618f, -0.074480f, 0.034711f}, {0.980217f, -0.098379f, 0.171745f}, + {0.996618f, -0.074480f, 0.034711f}, {0.951587f, 0.108524f, 0.287584f}, + {0.980217f, -0.098379f, 0.171745f}, {0.951587f, 0.108524f, 0.287584f}, + {0.996618f, -0.074480f, 0.034711f}, {0.985392f, 0.139742f, 0.097340f}, + {0.928867f, -0.368286f, 0.039641f}, {0.993594f, -0.112836f, -0.006314f}, + {0.996618f, -0.074480f, 0.034711f}, {0.993594f, -0.112836f, -0.006314f}, + {0.988068f, 0.082398f, -0.130127f}, {0.996618f, -0.074480f, 0.034711f}, + {0.996618f, -0.074480f, 0.034711f}, {0.988068f, 0.082398f, -0.130127f}, + {0.993675f, 0.098244f, -0.054396f}, {0.996618f, -0.074480f, 0.034711f}, + {0.993675f, 0.098244f, -0.054396f}, {0.985392f, 0.139742f, 0.097340f}, + {0.928867f, -0.368286f, 0.039641f}, {0.954357f, -0.296682f, -0.034380f}, + {0.993594f, -0.112836f, -0.006314f}, {0.993594f, -0.112836f, -0.006314f}, + {0.954357f, -0.296682f, -0.034380f}, {0.962907f, 0.011074f, -0.269605f}, + {0.967595f, 0.066322f, -0.243640f}, {0.993594f, -0.112836f, -0.006314f}, + {0.962907f, 0.011074f, -0.269605f}, {0.993594f, -0.112836f, -0.006314f}, + {0.967595f, 0.066322f, -0.243640f}, {0.988068f, 0.082398f, -0.130127f}, + {0.962907f, 0.011074f, -0.269605f}, {0.954357f, -0.296682f, -0.034380f}, + {0.935929f, -0.237631f, -0.259939f}, {0.935929f, -0.237631f, -0.259939f}, + {0.769738f, -0.265371f, -0.580588f}, {0.904838f, 0.008526f, -0.425672f}, + {0.935929f, -0.237631f, -0.259939f}, {0.904838f, 0.008526f, -0.425672f}, + {0.962907f, 0.011074f, -0.269605f}, {0.835200f, -0.521825f, -0.173607f}, + {0.954357f, -0.296682f, -0.034380f}, {0.928867f, -0.368286f, 0.039641f}, + {0.835200f, -0.521825f, -0.173607f}, {0.769738f, -0.265371f, -0.580588f}, + {0.935929f, -0.237631f, -0.259939f}, {0.835200f, -0.521825f, -0.173607f}, + {0.935929f, -0.237631f, -0.259939f}, {0.954357f, -0.296682f, -0.034380f}, + {0.655852f, -0.754472f, 0.025082f}, {0.835200f, -0.521825f, -0.173607f}, + {0.928867f, -0.368286f, 0.039641f}, {0.769738f, -0.265371f, -0.580588f}, + {0.835200f, -0.521825f, -0.173607f}, {0.524647f, -0.678988f, -0.513537f}, + {0.524647f, -0.678988f, -0.513537f}, {0.655852f, -0.754472f, 0.025082f}, + {0.452065f, -0.827090f, -0.334004f}, {0.655852f, -0.754472f, 0.025082f}, + {0.524647f, -0.678988f, -0.513537f}, {0.835200f, -0.521825f, -0.173607f}, + {0.928867f, -0.368286f, 0.039641f}, {0.599964f, -0.793085f, 0.105169f}, + {0.655852f, -0.754472f, 0.025082f}, {0.599964f, -0.793085f, 0.105169f}, + {0.367012f, -0.929957f, -0.021950f}, {0.655852f, -0.754472f, 0.025082f}, + {0.452065f, -0.827090f, -0.334004f}, {0.655852f, -0.754472f, 0.025082f}, + {0.367012f, -0.929957f, -0.021950f}, {0.367012f, -0.929957f, -0.021950f}, + {0.599964f, -0.793085f, 0.105169f}, {0.296586f, -0.951540f, 0.081293f}, + {0.928867f, -0.368286f, 0.039641f}, {0.562522f, -0.811846f, -0.156445f}, + {0.599964f, -0.793085f, 0.105169f}, {0.562522f, -0.811846f, -0.156445f}, + {0.296586f, -0.951540f, 0.081293f}, {0.599964f, -0.793085f, 0.105169f}, + {0.296586f, -0.951540f, 0.081293f}, {0.562522f, -0.811846f, -0.156445f}, + {0.210930f, -0.976875f, -0.034974f}, {-0.998091f, -0.059508f, -0.016551f}, + {-0.954040f, -0.136257f, -0.266912f}, {-0.958645f, -0.131653f, -0.252323f}, + {-0.954040f, -0.136257f, -0.266912f}, {-0.857051f, 0.000315f, -0.515232f}, + {-0.958645f, -0.131653f, -0.252323f}, {-0.857051f, 0.000315f, -0.515232f}, + {-0.704461f, 0.199354f, -0.681170f}, {-0.847640f, 0.110414f, -0.518956f}, + {-0.704461f, 0.199354f, -0.681170f}, {-0.519937f, 0.399504f, -0.755024f}, + {-0.739554f, 0.361004f, -0.568099f}, {-0.519937f, 0.399504f, -0.755024f}, + {-0.278250f, 0.635043f, -0.720623f}, {-0.601154f, 0.511409f, -0.614064f}, + {-0.278250f, 0.635043f, -0.720623f}, {0.079728f, 0.876478f, -0.474795f}, + {-0.237835f, 0.825207f, -0.512316f}, {0.079728f, 0.876478f, -0.474795f}, + {0.284305f, 0.951327f, -0.118946f}, {0.140515f, 0.968515f, -0.205508f}, + {0.284305f, 0.951327f, -0.118946f}, {0.194831f, 0.980831f, 0.003437f}, + {0.140515f, 0.968515f, -0.205508f}, {0.194831f, 0.980831f, 0.003437f}, + {0.230458f, 0.971546f, 0.054663f}, {0.111817f, 0.988378f, -0.102986f}, + {0.230458f, 0.971546f, 0.054663f}, {0.053011f, 0.996626f, 0.062659f}, + {0.057898f, 0.998302f, 0.006430f}, {0.053011f, 0.996626f, 0.062659f}, + {0.091380f, 0.995375f, -0.029645f}, {0.029330f, 0.999344f, -0.021255f}, + {0.091380f, 0.995375f, -0.029645f}, {0.171867f, 0.984952f, 0.018213f}, + {0.053007f, 0.998593f, 0.001737f}, {0.171867f, 0.984952f, 0.018213f}, + {0.155388f, 0.934199f, 0.321135f}, {0.071526f, 0.972134f, 0.223247f}, + {0.155388f, 0.934199f, 0.321135f}, {-0.169148f, 0.752509f, 0.636489f}, + {-0.124844f, 0.873959f, 0.469691f}, {-0.169148f, 0.752509f, 0.636489f}, + {-0.518049f, 0.451465f, 0.726502f}, {-0.586320f, 0.540668f, 0.603247f}, + {-0.518049f, 0.451465f, 0.726502f}, {-0.699688f, 0.204704f, 0.684495f}, + {-0.760001f, 0.324191f, 0.563293f}, {-0.699688f, 0.204704f, 0.684495f}, + {-0.861320f, 0.008996f, 0.507982f}, {-0.850583f, 0.097851f, 0.516657f}, + {-0.861320f, 0.008996f, 0.507982f}, {-0.977075f, -0.105183f, 0.185099f}, + {-0.946894f, -0.083377f, 0.310547f}, {-0.977075f, -0.105183f, 0.185099f}, + {-0.984283f, -0.051648f, 0.168875f}, {-0.946894f, -0.083377f, 0.310547f}, + {-0.984283f, -0.051648f, 0.168875f}, {-0.998091f, -0.059508f, -0.016551f}, + {-0.988514f, -0.140680f, 0.055221f}, {0.003651f, 0.946181f, -0.323619f}, + {-0.186767f, 0.925548f, -0.329360f}, {-0.237835f, 0.825207f, -0.512316f}, + {-0.186767f, 0.925548f, -0.329360f}, {-0.251965f, 0.757212f, -0.602614f}, + {-0.397014f, 0.641777f, -0.656127f}, {-0.337693f, 0.105630f, -0.935311f}, + {-0.254922f, -0.206536f, -0.944647f}, {-0.398928f, -0.136055f, -0.906832f}, + {-0.254922f, -0.206536f, -0.944647f}, {0.093083f, 0.278572f, 0.955894f}, + {-0.172576f, -0.266778f, -0.948181f}, {0.189436f, -0.361622f, -0.912876f}, + {0.358432f, -0.028939f, -0.933107f}, {0.053473f, -0.177418f, -0.982682f}, + {0.352300f, 0.203514f, -0.913492f}, {0.343328f, 0.248380f, -0.905778f}, + {0.345386f, 0.307643f, -0.886602f}, {0.343328f, 0.248380f, -0.905778f}, + {0.361705f, -0.132388f, -0.922845f}, {0.332521f, 0.099016f, -0.937883f}, + {0.901109f, 0.387318f, 0.194905f}, {0.489136f, 0.689178f, -0.534583f}, + {0.566193f, 0.539475f, -0.623211f}, {0.322542f, 0.653191f, -0.685060f}, + {0.387867f, 0.814848f, -0.430791f}, {0.489136f, 0.689178f, -0.534583f}, + {0.387867f, 0.814848f, -0.430791f}, {0.248974f, 0.936959f, -0.245195f}, + {0.274319f, 0.922629f, -0.271118f}, {0.248974f, 0.936959f, -0.245195f}, + {0.204352f, 0.947276f, -0.246795f}, {0.138558f, 0.971214f, -0.193767f}, + {0.204352f, 0.947276f, -0.246795f}, {0.058741f, 0.975100f, -0.213843f}, + {0.095780f, 0.971889f, -0.215078f}, {0.297002f, 0.053309f, 0.953388f}, + {0.252548f, -0.116382f, 0.960560f}, {0.171247f, -0.059534f, 0.983428f}, + {0.252548f, -0.116382f, 0.960560f}, {0.085830f, -0.307324f, 0.947726f}, + {0.000108f, -0.223144f, 0.974786f}, {0.085830f, -0.307324f, 0.947726f}, + {-0.173549f, -0.262745f, 0.949129f}, {-0.162448f, -0.277452f, 0.946906f}, + {-0.173549f, -0.262745f, 0.949129f}, {-0.370077f, -0.091471f, 0.924487f}, + {-0.162448f, -0.277452f, 0.946906f}, {-0.334198f, 0.410925f, 0.848205f}, + {-0.321627f, 0.659738f, 0.679192f}, {-0.382842f, 0.339600f, 0.859130f}, + {-0.321627f, 0.659738f, 0.679192f}, {-0.228362f, 0.861117f, 0.454234f}, + {-0.124844f, 0.873959f, 0.469691f}, {-0.228362f, 0.861117f, 0.454234f}, + {-0.058113f, 0.949457f, 0.308470f}, {-0.124844f, 0.873959f, 0.469691f}, + {-0.058113f, 0.949457f, 0.308470f}, {0.061960f, 0.962691f, 0.263414f}, + {0.071526f, 0.972134f, 0.223247f}, {0.135575f, 0.967464f, 0.213620f}, + {0.356397f, 0.851081f, 0.385542f}, {0.134729f, 0.972475f, 0.190106f}, + {0.213363f, 0.870099f, 0.444302f}, {-0.043041f, 0.825406f, 0.562896f}, + {0.470076f, 0.713698f, 0.519292f}, {-0.043041f, 0.825406f, 0.562896f}, + {0.115037f, 0.723134f, 0.681061f}, {0.470076f, 0.713698f, 0.519292f}, + {0.115037f, 0.723134f, 0.681061f}, {0.287673f, 0.507493f, 0.812216f}, + {0.504959f, 0.440850f, 0.742070f}, {0.287673f, 0.507493f, 0.812216f}, + {0.113449f, 0.132333f, -0.984691f}, {0.504959f, 0.440850f, 0.742070f}, + {0.113449f, 0.132333f, -0.984691f}, {0.728545f, -0.669331f, 0.145667f}, + {0.504959f, 0.440850f, 0.742070f}, {0.728545f, -0.669331f, 0.145667f}, + {0.318728f, -0.924816f, -0.207674f}, {0.290566f, 0.151929f, 0.944716f}, + {0.318728f, -0.924816f, -0.207674f}, {0.297002f, 0.053309f, 0.953388f}, + {0.290566f, 0.151929f, 0.944716f}, {0.222328f, 0.928824f, 0.296407f}, + {0.338569f, 0.794483f, 0.504150f}, {0.363541f, 0.930338f, 0.048048f}, + {0.338569f, 0.794483f, 0.504150f}, {0.449200f, 0.852911f, 0.266011f}, + {0.538710f, 0.837608f, 0.090582f}, {0.449200f, 0.852911f, 0.266011f}, + {0.611084f, 0.776183f, 0.155293f}, {0.538710f, 0.837608f, 0.090582f}, + {0.611084f, 0.776183f, 0.155293f}, {0.828419f, 0.545369f, 0.127650f}, + {0.731872f, 0.676764f, 0.079707f}, {0.812721f, 0.298228f, 0.500545f}, + {0.789740f, 0.237525f, 0.565590f}, {0.865086f, 0.209543f, 0.455760f}, + {0.676305f, 0.266081f, 0.686886f}, {0.547075f, 0.225477f, 0.806145f}, + {0.687959f, 0.142898f, 0.711542f}, {0.192348f, 0.279380f, 0.940717f}, + {0.205985f, 0.284205f, 0.936375f}, {0.210996f, 0.179609f, 0.960844f}, + {0.205985f, 0.284205f, 0.936375f}, {0.149035f, 0.415524f, 0.897290f}, + {0.237922f, 0.252894f, 0.937784f}, {0.149035f, 0.415524f, 0.897290f}, + {0.289593f, 0.427276f, 0.856488f}, {0.237922f, 0.252894f, 0.937784f}, + {0.208222f, 0.491946f, 0.845360f}, {-0.548609f, 0.702264f, 0.453711f}, + {0.368866f, 0.575503f, 0.729886f}, {-0.548609f, 0.702264f, 0.453711f}, + {0.117155f, 0.955892f, 0.269343f}, {0.369157f, 0.773111f, 0.515774f}, + {-0.469991f, 0.877912f, 0.091534f}, {-0.001691f, 0.910378f, -0.413774f}, + {0.389407f, 0.917268f, -0.083558f}, {-0.001691f, 0.910378f, -0.413774f}, + {-0.175008f, 0.794447f, -0.581572f}, {0.302614f, 0.739474f, -0.601335f}, + {0.271568f, 0.608361f, -0.745753f}, {0.018296f, 0.623996f, -0.781214f}, + {0.287894f, 0.519724f, -0.804365f}, {0.018296f, 0.623996f, -0.781214f}, + {-0.172056f, 0.421403f, -0.890402f}, {0.221229f, 0.403398f, -0.887878f}, + {-0.172056f, 0.421403f, -0.890402f}, {0.000501f, 0.173705f, -0.984798f}, + {0.221229f, 0.403398f, -0.887878f}, {0.154202f, -0.039256f, -0.987259f}, + {0.234090f, -0.070518f, -0.969654f}, {0.148955f, -0.048469f, -0.987655f}, + {0.552213f, -0.032889f, -0.833054f}, {0.705586f, 0.025699f, -0.708158f}, + {0.589576f, -0.007204f, -0.807680f}, {0.705586f, 0.025699f, -0.708158f}, + {0.781353f, 0.225266f, -0.582016f}, {0.791501f, 0.092271f, -0.604162f}, + {0.781353f, 0.225266f, -0.582016f}, {0.894765f, 0.304007f, -0.327071f}, + {0.858324f, 0.212906f, -0.466852f}, {0.895721f, 0.419400f, -0.147605f}, + {0.799601f, 0.586555f, -0.128808f}, {0.894765f, 0.304007f, -0.327071f}, + {-0.988514f, -0.140680f, 0.055221f}, {-0.998091f, -0.059508f, -0.016551f}, + {-0.958645f, -0.131653f, -0.252323f}, {-0.988514f, -0.140680f, 0.055221f}, + {-0.946894f, -0.083377f, 0.310547f}, {-0.984283f, -0.051648f, 0.168875f}, + {-0.925595f, -0.219969f, 0.308037f}, {-0.912801f, -0.112862f, 0.392499f}, + {-0.861320f, 0.008996f, 0.507982f}, {-0.850583f, 0.097851f, 0.516657f}, + {-0.787639f, -0.269027f, 0.554301f}, {-0.814055f, -0.041024f, 0.579337f}, + {-0.878151f, -0.009979f, 0.478279f}, {-0.850583f, 0.097851f, 0.516657f}, + {-0.861320f, 0.008996f, 0.507982f}, {-0.912801f, -0.112862f, 0.392499f}, + {-0.878151f, -0.009979f, 0.478279f}, {-0.861320f, 0.008996f, 0.507982f}, + {-0.586320f, 0.540668f, 0.603247f}, {-0.542040f, 0.629184f, 0.557063f}, + {-0.169148f, 0.752509f, 0.636489f}, {-0.760001f, 0.324191f, 0.563293f}, + {-0.586320f, 0.540668f, 0.603247f}, {-0.518049f, 0.451465f, 0.726502f}, + {-0.755415f, 0.076920f, 0.650716f}, {-0.760001f, 0.324191f, 0.563293f}, + {-0.814055f, -0.041024f, 0.579337f}, {-0.542040f, 0.629184f, 0.557063f}, + {-0.124844f, 0.873959f, 0.469691f}, {-0.169148f, 0.752509f, 0.636489f}, + {-0.124844f, 0.873959f, 0.469691f}, {-0.335869f, 0.689550f, 0.641648f}, + {-0.321627f, 0.659738f, 0.679192f}, {0.071526f, 0.972134f, 0.223247f}, + {0.071823f, 0.988827f, 0.130627f}, {0.171867f, 0.984952f, 0.018213f}, + {0.098032f, 0.964604f, 0.244805f}, {0.071526f, 0.972134f, 0.223247f}, + {0.061960f, 0.962691f, 0.263414f}, {0.077268f, 0.992763f, 0.091936f}, + {0.053007f, 0.998593f, 0.001737f}, {0.171867f, 0.984952f, 0.018213f}, + {0.071823f, 0.988827f, 0.130627f}, {0.077268f, 0.992763f, 0.091936f}, + {0.171867f, 0.984952f, 0.018213f}, {0.053007f, 0.998593f, 0.001737f}, + {0.041037f, 0.999024f, 0.016341f}, {0.091380f, 0.995375f, -0.029645f}, + {0.029330f, 0.999344f, -0.021255f}, {0.057898f, 0.998302f, 0.006430f}, + {0.053011f, 0.996626f, 0.062659f}, {0.041037f, 0.999024f, 0.016341f}, + {0.029330f, 0.999344f, -0.021255f}, {0.091380f, 0.995375f, -0.029645f}, + {0.111817f, 0.988378f, -0.102986f}, {0.138558f, 0.971214f, -0.193767f}, + {0.095780f, 0.971889f, -0.215078f}, {0.138558f, 0.971214f, -0.193767f}, + {0.139528f, 0.980985f, -0.134911f}, {0.248974f, 0.936959f, -0.245195f}, + {0.057898f, 0.998302f, 0.006430f}, {0.111817f, 0.988378f, -0.102986f}, + {0.230458f, 0.971546f, 0.054663f}, {0.140515f, 0.968515f, -0.205508f}, + {0.058741f, 0.975100f, -0.213843f}, {0.003651f, 0.946181f, -0.323619f}, + {0.095780f, 0.971889f, -0.215078f}, {0.140515f, 0.968515f, -0.205508f}, + {0.111817f, 0.988378f, -0.102986f}, {-0.237835f, 0.825207f, -0.512316f}, + {-0.537060f, 0.609628f, -0.583027f}, {-0.278250f, 0.635043f, -0.720623f}, + {-0.397014f, 0.641777f, -0.656127f}, {-0.237835f, 0.825207f, -0.512316f}, + {-0.186767f, 0.925548f, -0.329360f}, {-0.601154f, 0.511409f, -0.614064f}, + {-0.739554f, 0.361004f, -0.568099f}, {-0.519937f, 0.399504f, -0.755024f}, + {-0.537060f, 0.609628f, -0.583027f}, {-0.601154f, 0.511409f, -0.614064f}, + {-0.278250f, 0.635043f, -0.720623f}, {-0.885015f, -0.020410f, -0.465115f}, + {-0.916145f, -0.160493f, -0.367314f}, {-0.857051f, 0.000315f, -0.515232f}, + {-0.847640f, 0.110414f, -0.518956f}, {-0.885015f, -0.020410f, -0.465115f}, + {-0.857051f, 0.000315f, -0.515232f}, {-0.792261f, -0.268380f, -0.547992f}, + {-0.847640f, 0.110414f, -0.518956f}, {-0.759992f, -0.028623f, -0.649302f}, + {-0.916145f, -0.160493f, -0.367314f}, {-0.913898f, -0.318786f, -0.251330f}, + {-0.958645f, -0.131653f, -0.252323f}, {-0.499130f, 0.176378f, 0.848387f}, + {-0.370077f, -0.091471f, 0.924487f}, {-0.382842f, 0.339600f, 0.859130f}, + {0.267882f, 0.921692f, 0.280576f}, {0.187050f, 0.956413f, 0.224247f}, + {0.356397f, 0.851081f, 0.385542f}, {0.139528f, 0.980985f, -0.134911f}, + {0.274319f, 0.922629f, -0.271118f}, {0.248974f, 0.936959f, -0.245195f}, + {0.274319f, 0.922629f, -0.271118f}, {0.445390f, 0.806344f, -0.389150f}, + {0.387867f, 0.814848f, -0.430791f}, {-0.172576f, -0.266778f, -0.948181f}, + {-0.398928f, -0.136055f, -0.906832f}, {-0.254922f, -0.206536f, -0.944647f}, + {0.171247f, -0.059534f, 0.983428f}, {0.130191f, 0.048489f, 0.990303f}, + {0.290566f, 0.151929f, 0.944716f}, {0.000108f, -0.223144f, 0.974786f}, + {0.171247f, -0.059534f, 0.983428f}, {0.252548f, -0.116382f, 0.960560f}, + {-0.162448f, -0.277452f, 0.946906f}, {0.000108f, -0.223144f, 0.974786f}, + {0.085830f, -0.307324f, 0.947726f}, {0.290566f, 0.151929f, 0.944716f}, + {0.317441f, 0.247702f, 0.915355f}, {0.372522f, 0.318324f, 0.871721f}, + {0.171346f, 0.146714f, 0.974226f}, {0.290566f, 0.151929f, 0.944716f}, + {0.130191f, 0.048489f, 0.990303f}, {0.372522f, 0.318324f, 0.871721f}, + {0.728545f, -0.669331f, 0.145667f}, {0.290566f, 0.151929f, 0.944716f}, + {0.504959f, 0.440850f, 0.742070f}, {0.523016f, 0.598786f, 0.606555f}, + {0.470076f, 0.713698f, 0.519292f}, {0.445390f, 0.806344f, -0.389150f}, + {0.489136f, 0.689178f, -0.534583f}, {0.387867f, 0.814848f, -0.430791f}, + {0.901109f, 0.387318f, 0.194905f}, {0.473121f, 0.350571f, -0.808243f}, + {0.332521f, 0.099016f, -0.937883f}, {0.536759f, 0.614025f, -0.578673f}, + {0.566193f, 0.539475f, -0.623211f}, {0.489136f, 0.689178f, -0.534583f}, + {0.332521f, 0.099016f, -0.937883f}, {0.345386f, 0.307643f, -0.886602f}, + {0.343328f, 0.248380f, -0.905778f}, {0.352300f, 0.203514f, -0.913492f}, + {0.210972f, 0.052291f, -0.976092f}, {0.358432f, -0.028939f, -0.933107f}, + {0.236355f, 0.191172f, -0.952675f}, {0.352300f, 0.203514f, -0.913492f}, + {0.285257f, 0.243329f, -0.927049f}, {-0.041588f, -0.272536f, -0.961246f}, + {-0.172576f, -0.266778f, -0.948181f}, {0.023188f, -0.279177f, -0.959960f}, + {0.053473f, -0.177418f, -0.982682f}, {0.023188f, -0.279177f, -0.959960f}, + {0.189436f, -0.361622f, -0.912876f}, {0.279216f, 0.291053f, 0.915056f}, + {0.235467f, 0.147537f, 0.960619f}, {0.237922f, 0.252894f, 0.937784f}, + {0.235467f, 0.147537f, 0.960619f}, {0.140657f, 0.004780f, 0.990047f}, + {0.237922f, 0.252894f, 0.937784f}, {0.369157f, 0.773111f, 0.515774f}, + {0.368866f, 0.575503f, 0.729886f}, {-0.548609f, 0.702264f, 0.453711f}, + {0.368866f, 0.575503f, 0.729886f}, {0.387776f, 0.473954f, 0.790568f}, + {0.257029f, 0.521014f, 0.813929f}, {0.502365f, 0.707499f, 0.497066f}, + {0.369157f, 0.773111f, 0.515774f}, {0.117155f, 0.955892f, 0.269343f}, + {0.539602f, 0.840918f, 0.041068f}, {0.515681f, 0.796653f, 0.315305f}, + {0.430884f, 0.865455f, 0.255590f}, {0.140657f, 0.004780f, 0.990047f}, + {0.116133f, 0.039387f, 0.992452f}, {0.237922f, 0.252894f, 0.937784f}, + {0.363541f, 0.930338f, 0.048048f}, {0.394155f, 0.919019f, 0.006732f}, + {0.222328f, 0.928824f, 0.296407f}, {0.394155f, 0.919019f, 0.006732f}, + {0.539602f, 0.840918f, 0.041068f}, {0.430884f, 0.865455f, 0.255590f}, + {0.222328f, 0.928824f, 0.296407f}, {0.394155f, 0.919019f, 0.006732f}, + {0.430884f, 0.865455f, 0.255590f}, {0.302614f, 0.739474f, -0.601335f}, + {0.389407f, 0.917268f, -0.083558f}, {-0.001691f, 0.910378f, -0.413774f}, + {0.271568f, 0.608361f, -0.745753f}, {0.302614f, 0.739474f, -0.601335f}, + {-0.175008f, 0.794447f, -0.581572f}, {0.157104f, 0.219159f, -0.962958f}, + {0.221229f, 0.403398f, -0.887878f}, {0.000501f, 0.173705f, -0.984798f}, + {0.221229f, 0.403398f, -0.887878f}, {0.287894f, 0.519724f, -0.804365f}, + {0.018296f, 0.623996f, -0.781214f}, {0.141854f, 0.051803f, -0.988531f}, + {0.000501f, 0.173705f, -0.984798f}, {0.093003f, 0.009710f, -0.995618f}, + {0.164650f, 0.189698f, 0.967939f}, {0.210996f, 0.179609f, 0.960844f}, + {0.205985f, 0.284205f, 0.936375f}, {0.116133f, 0.039387f, 0.992452f}, + {0.164650f, 0.189698f, 0.967939f}, {0.237922f, 0.252894f, 0.937784f}, + {0.210996f, 0.179609f, 0.960844f}, {0.341647f, 0.023101f, 0.939544f}, + {0.307422f, 0.250640f, 0.917971f}, {0.731872f, 0.676764f, 0.079707f}, + {0.538710f, 0.837608f, 0.090582f}, {0.611084f, 0.776183f, 0.155293f}, + {0.538710f, 0.837608f, 0.090582f}, {0.363541f, 0.930338f, 0.048048f}, + {0.338569f, 0.794483f, 0.504150f}, {0.148955f, -0.048469f, -0.987655f}, + {0.093003f, 0.009710f, -0.995618f}, {0.154202f, -0.039256f, -0.987259f}, + {0.341647f, 0.023101f, 0.939544f}, {0.439946f, 0.175781f, 0.880652f}, + {0.307422f, 0.250640f, 0.917971f}, {0.865086f, 0.209543f, 0.455760f}, + {0.951587f, 0.108524f, 0.287584f}, {0.910755f, 0.278726f, 0.304691f}, + {0.687959f, 0.142898f, 0.711542f}, {0.789740f, 0.237525f, 0.565590f}, + {0.676305f, 0.266081f, 0.686886f}, {0.918588f, 0.375123f, 0.124412f}, + {0.731872f, 0.676764f, 0.079707f}, {0.828419f, 0.545369f, 0.127650f}, + {0.910755f, 0.278726f, 0.304691f}, {0.918588f, 0.375123f, 0.124412f}, + {0.828419f, 0.545369f, 0.127650f}, {0.858268f, 0.137759f, -0.494366f}, + {0.791501f, 0.092271f, -0.604162f}, {0.781353f, 0.225266f, -0.582016f}, + {0.858324f, 0.212906f, -0.466852f}, {0.858268f, 0.137759f, -0.494366f}, + {0.781353f, 0.225266f, -0.582016f}, {0.791501f, 0.092271f, -0.604162f}, + {0.589576f, -0.007204f, -0.807680f}, {0.705586f, 0.025699f, -0.708158f}, + {-0.958645f, -0.131653f, -0.252323f}, {-0.857051f, 0.000315f, -0.515232f}, + {-0.916145f, -0.160493f, -0.367314f}, {-0.847640f, 0.110414f, -0.518956f}, + {-0.704461f, 0.199354f, -0.681170f}, {-0.739554f, 0.361004f, -0.568099f}, + {-0.237835f, 0.825207f, -0.512316f}, {0.079728f, 0.876478f, -0.474795f}, + {0.003651f, 0.946181f, -0.323619f}, {0.079728f, 0.876478f, -0.474795f}, + {0.140515f, 0.968515f, -0.205508f}, {0.003651f, 0.946181f, -0.323619f}, + {0.140515f, 0.968515f, -0.205508f}, {0.194831f, 0.980831f, 0.003437f}, + {0.111817f, 0.988378f, -0.102986f}, {0.071526f, 0.972134f, 0.223247f}, + {0.155388f, 0.934199f, 0.321135f}, {-0.124844f, 0.873959f, 0.469691f}, + {-0.760001f, 0.324191f, 0.563293f}, {-0.699688f, 0.204704f, 0.684495f}, + {-0.850583f, 0.097851f, 0.516657f}, {-0.861320f, 0.008996f, 0.507982f}, + {-0.946894f, -0.083377f, 0.310547f}, {-0.925595f, -0.219969f, 0.308037f}, + {-0.374744f, 0.269451f, -0.887109f}, {-0.337693f, 0.105630f, -0.935311f}, + {-0.398928f, -0.136055f, -0.906832f}, {0.332521f, 0.099016f, -0.937883f}, + {0.361705f, -0.132388f, -0.922845f}, {0.901109f, 0.387318f, 0.194905f}, + {0.138558f, 0.971214f, -0.193767f}, {0.204352f, 0.947276f, -0.246795f}, + {0.095780f, 0.971889f, -0.215078f}, {-0.382842f, 0.339600f, 0.859130f}, + {-0.321627f, 0.659738f, 0.679192f}, {-0.335869f, 0.689550f, 0.641648f}, + {-0.124844f, 0.873959f, 0.469691f}, {-0.058113f, 0.949457f, 0.308470f}, + {0.071526f, 0.972134f, 0.223247f}, {0.134729f, 0.972475f, 0.190106f}, + {0.356397f, 0.851081f, 0.385542f}, {0.187050f, 0.956413f, 0.224247f}, + {0.470076f, 0.713698f, 0.519292f}, {0.115037f, 0.723134f, 0.681061f}, + {0.504959f, 0.440850f, 0.742070f}, {0.290566f, 0.151929f, 0.944716f}, + {0.297002f, 0.053309f, 0.953388f}, {0.171247f, -0.059534f, 0.983428f}, + {0.910755f, 0.278726f, 0.304691f}, {0.812721f, 0.298228f, 0.500545f}, + {0.865086f, 0.209543f, 0.455760f}, {0.164650f, 0.189698f, 0.967939f}, + {0.205985f, 0.284205f, 0.936375f}, {0.237922f, 0.252894f, 0.937784f}, + {0.257029f, 0.521014f, 0.813929f}, {0.208222f, 0.491946f, 0.845360f}, + {0.368866f, 0.575503f, 0.729886f}, {0.424145f, -0.020815f, -0.905355f}, + {0.552213f, -0.032889f, -0.833054f}, {0.589576f, -0.007204f, -0.807680f}, + {-0.850583f, 0.097851f, 0.516657f}, {-0.814055f, -0.041024f, 0.579337f}, + {-0.760001f, 0.324191f, 0.563293f}, {-0.739554f, 0.361004f, -0.568099f}, + {-0.759992f, -0.028623f, -0.649302f}, {-0.847640f, 0.110414f, -0.518956f}, + {0.058741f, 0.975100f, -0.213843f}, {-0.186767f, 0.925548f, -0.329360f}, + {0.003651f, 0.946181f, -0.323619f}, {0.008718f, 0.993857f, -0.110329f}, + {-0.186767f, 0.925548f, -0.329360f}, {0.058741f, 0.975100f, -0.213843f}, + {0.008718f, 0.993857f, -0.110329f}, {-0.266064f, 0.934779f, -0.235369f}, + {-0.186767f, 0.925548f, -0.329360f}, {-0.270780f, 0.835824f, -0.477574f}, + {-0.266064f, 0.934779f, -0.235369f}, {0.094141f, 0.990417f, -0.101053f}, + {0.035931f, 0.978315f, -0.203983f}, {-0.270780f, 0.835824f, -0.477574f}, + {0.094141f, 0.990417f, -0.101053f}, {-0.505664f, 0.701933f, -0.501591f}, + {-0.323200f, 0.597578f, -0.733786f}, {-0.266064f, 0.934779f, -0.235369f}, + {-0.266064f, 0.934779f, -0.235369f}, {-0.323200f, 0.597578f, -0.733786f}, + {-0.186767f, 0.925548f, -0.329360f}, {-0.571689f, 0.504383f, -0.647124f}, + {-0.505664f, 0.701933f, -0.501591f}, {-0.266064f, 0.934779f, -0.235369f}, + {-0.270780f, 0.835824f, -0.477574f}, {-0.571689f, 0.504383f, -0.647124f}, + {-0.266064f, 0.934779f, -0.235369f}, {-0.352461f, 0.629926f, -0.692073f}, + {-0.571689f, 0.504383f, -0.647124f}, {-0.270780f, 0.835824f, -0.477574f}, + {-0.425243f, 0.410651f, -0.806557f}, {-0.352461f, 0.629926f, -0.692073f}, + {-0.270780f, 0.835824f, -0.477574f}, {-0.571689f, 0.504383f, -0.647124f}, + {-0.476675f, 0.332956f, -0.813585f}, {-0.505664f, 0.701933f, -0.501591f}, + {-0.505664f, 0.701933f, -0.501591f}, {-0.476675f, 0.332956f, -0.813585f}, + {-0.323200f, 0.597578f, -0.733786f}, {-0.425243f, 0.410651f, -0.806557f}, + {-0.571689f, 0.504383f, -0.647124f}, {-0.352461f, 0.629926f, -0.692073f}, + {-0.476675f, 0.332956f, -0.813585f}, {-0.337693f, 0.105630f, -0.935311f}, + {-0.323200f, 0.597578f, -0.733786f}, {-0.490588f, -0.032522f, -0.870785f}, + {-0.476675f, 0.332956f, -0.813585f}, {-0.571689f, 0.504383f, -0.647124f}, + {-0.476675f, 0.332956f, -0.813585f}, {-0.490588f, -0.032522f, -0.870785f}, + {-0.337693f, 0.105630f, -0.935311f}, {-0.599674f, 0.029426f, -0.799703f}, + {-0.490588f, -0.032522f, -0.870785f}, {-0.571689f, 0.504383f, -0.647124f}, + {-0.436192f, -0.277165f, -0.856105f}, {-0.599674f, 0.029426f, -0.799703f}, + {-0.425243f, 0.410651f, -0.806557f}, {-0.425243f, 0.410651f, -0.806557f}, + {-0.599674f, 0.029426f, -0.799703f}, {-0.571689f, 0.504383f, -0.647124f}, + {-0.490588f, -0.032522f, -0.870785f}, {-0.254922f, -0.206536f, -0.944647f}, + {-0.337693f, 0.105630f, -0.935311f}, {-0.254922f, -0.206536f, -0.944647f}, + {-0.490588f, -0.032522f, -0.870785f}, {-0.171305f, -0.437287f, -0.882856f}, + {-0.393296f, -0.439975f, -0.807304f}, {-0.490588f, -0.032522f, -0.870785f}, + {-0.599674f, 0.029426f, -0.799703f}, {-0.490588f, -0.032522f, -0.870785f}, + {-0.393296f, -0.439975f, -0.807304f}, {-0.171305f, -0.437287f, -0.882856f}, + {-0.599674f, 0.029426f, -0.799703f}, {-0.436192f, -0.277165f, -0.856105f}, + {-0.393296f, -0.439975f, -0.807304f}, {0.023188f, -0.279177f, -0.959960f}, + {-0.172576f, -0.266778f, -0.948181f}, {-0.254922f, -0.206536f, -0.944647f}, + {-0.171305f, -0.437287f, -0.882856f}, {0.023188f, -0.279177f, -0.959960f}, + {-0.254922f, -0.206536f, -0.944647f}, {-0.037497f, -0.669143f, -0.742187f}, + {-0.171305f, -0.437287f, -0.882856f}, {-0.393296f, -0.439975f, -0.807304f}, + {-0.436192f, -0.277165f, -0.856105f}, {-0.037497f, -0.669143f, -0.742187f}, + {-0.393296f, -0.439975f, -0.807304f}, {-0.283861f, -0.608680f, -0.740899f}, + {-0.037497f, -0.669143f, -0.742187f}, {-0.436192f, -0.277165f, -0.856105f}, + {0.189436f, -0.361622f, -0.912876f}, {0.023188f, -0.279177f, -0.959960f}, + {-0.171305f, -0.437287f, -0.882856f}, {0.189436f, -0.361622f, -0.912876f}, + {-0.171305f, -0.437287f, -0.882856f}, {-0.037497f, -0.669143f, -0.742187f}, + {-0.283861f, -0.608680f, -0.740899f}, {-0.058529f, -0.935295f, -0.348995f}, + {-0.037497f, -0.669143f, -0.742187f}, {0.358432f, -0.028939f, -0.933107f}, + {-0.037497f, -0.669143f, -0.742187f}, {0.416569f, -0.491733f, -0.764636f}, + {0.189436f, -0.361622f, -0.912876f}, {-0.037497f, -0.669143f, -0.742187f}, + {0.358432f, -0.028939f, -0.933107f}, {0.416569f, -0.491733f, -0.764636f}, + {-0.037497f, -0.669143f, -0.742187f}, {-0.058529f, -0.935295f, -0.348995f}, + {0.343314f, -0.935035f, -0.088572f}, {0.352300f, 0.203514f, -0.913492f}, + {0.416569f, -0.491733f, -0.764636f}, {0.358432f, -0.028939f, -0.933107f}, + {0.416569f, -0.491733f, -0.764636f}, {0.352300f, 0.203514f, -0.913492f}, + {0.361705f, -0.132388f, -0.922845f}, {0.343328f, 0.248380f, -0.905778f}, + {0.352300f, 0.203514f, -0.913492f}, {0.343314f, -0.935035f, -0.088572f}, + {0.361705f, -0.132388f, -0.922845f}, {0.352300f, 0.203514f, -0.913492f}, + {0.361705f, -0.132388f, -0.922845f}, {0.343314f, -0.935035f, -0.088572f}, + {0.416569f, -0.491733f, -0.764636f}, {0.361705f, -0.132388f, -0.922845f}, + {0.416569f, -0.491733f, -0.764636f}, {-0.137885f, -0.308339f, 0.941231f}, + {0.646168f, 0.395237f, -0.652882f}, {0.361705f, -0.132388f, -0.922845f}, + {-0.137885f, -0.308339f, 0.941231f}, {0.361705f, -0.132388f, -0.922845f}, + {0.646168f, 0.395237f, -0.652882f}, {-0.015615f, 0.612257f, -0.790504f}, + {0.322542f, 0.653191f, -0.685060f}, {-0.015615f, 0.612257f, -0.790504f}, + {0.382350f, 0.413473f, -0.826346f}, {-0.015615f, 0.612257f, -0.790504f}, + {0.646168f, 0.395237f, -0.652882f}, {0.382350f, 0.413473f, -0.826346f}, + {0.693419f, 0.720347f, -0.016479f}, {0.382350f, 0.413473f, -0.826346f}, + {0.646168f, 0.395237f, -0.652882f}, {0.503276f, 0.641041f, -0.579465f}, + {0.355285f, 0.831634f, -0.426799f}, {0.322542f, 0.653191f, -0.685060f}, + {0.322542f, 0.653191f, -0.685060f}, {0.355285f, 0.831634f, -0.426799f}, + {0.387867f, 0.814848f, -0.430791f}, {0.693419f, 0.720347f, -0.016479f}, + {0.503276f, 0.641041f, -0.579465f}, {0.382350f, 0.413473f, -0.826346f}, + {0.382350f, 0.413473f, -0.826346f}, {0.503276f, 0.641041f, -0.579465f}, + {0.322542f, 0.653191f, -0.685060f}, {0.502068f, 0.816762f, -0.284302f}, + {0.355285f, 0.831634f, -0.426799f}, {0.693419f, 0.720347f, -0.016479f}, + {0.693419f, 0.720347f, -0.016479f}, {0.355285f, 0.831634f, -0.426799f}, + {0.503276f, 0.641041f, -0.579465f}, {0.297541f, 0.942425f, -0.152656f}, + {0.502068f, 0.816762f, -0.284302f}, {0.693419f, 0.720347f, -0.016479f}, + {0.351359f, 0.907094f, 0.231790f}, {0.693419f, 0.720347f, -0.016479f}, + {0.353403f, 0.775754f, 0.522793f}, {0.693419f, 0.720347f, -0.016479f}, + {0.351359f, 0.907094f, 0.231790f}, {0.502068f, 0.816762f, -0.284302f}, + {0.297541f, 0.942425f, -0.152656f}, {0.204352f, 0.947276f, -0.246795f}, + {0.502068f, 0.816762f, -0.284302f}, {0.502068f, 0.816762f, -0.284302f}, + {0.204352f, 0.947276f, -0.246795f}, {0.355285f, 0.831634f, -0.426799f}, + {0.094141f, 0.990417f, -0.101053f}, {0.297541f, 0.942425f, -0.152656f}, + {0.502068f, 0.816762f, -0.284302f}, {0.351359f, 0.907094f, 0.231790f}, + {0.094141f, 0.990417f, -0.101053f}, {0.502068f, 0.816762f, -0.284302f}, + {0.297541f, 0.942425f, -0.152656f}, {0.058741f, 0.975100f, -0.213843f}, + {0.204352f, 0.947276f, -0.246795f}, {0.008718f, 0.993857f, -0.110329f}, + {0.058741f, 0.975100f, -0.213843f}, {0.297541f, 0.942425f, -0.152656f}, + {-0.266064f, 0.934779f, -0.235369f}, {0.008718f, 0.993857f, -0.110329f}, + {0.297541f, 0.942425f, -0.152656f}, {0.094141f, 0.990417f, -0.101053f}, + {-0.266064f, 0.934779f, -0.235369f}, {0.297541f, 0.942425f, -0.152656f}, + {0.035931f, 0.978315f, -0.203983f}, {0.094141f, 0.990417f, -0.101053f}, + {0.351359f, 0.907094f, 0.231790f}, {-0.251965f, 0.757212f, -0.602614f}, + {-0.323200f, 0.597578f, -0.733786f}, {-0.397014f, 0.641777f, -0.656127f}, + {-0.397014f, 0.641777f, -0.656127f}, {-0.323200f, 0.597578f, -0.733786f}, + {-0.374744f, 0.269451f, -0.887109f}, {0.901109f, 0.387318f, 0.194905f}, + {0.322542f, 0.653191f, -0.685060f}, {0.489136f, 0.689178f, -0.534583f}, + {-0.283861f, -0.608680f, -0.740899f}, {-0.436192f, -0.277165f, -0.856105f}, + {-0.237882f, -0.043628f, -0.970314f}, {-0.237882f, -0.043628f, -0.970314f}, + {-0.425243f, 0.410651f, -0.806557f}, {-0.131874f, 0.668345f, -0.732068f}, + {-0.131874f, 0.668345f, -0.732068f}, {-0.425243f, 0.410651f, -0.806557f}, + {-0.140997f, 0.780001f, -0.609687f}, {-0.140997f, 0.780001f, -0.609687f}, + {-0.270780f, 0.835824f, -0.477574f}, {0.035931f, 0.978315f, -0.203983f}, + {-0.270780f, 0.835824f, -0.477574f}, {-0.140997f, 0.780001f, -0.609687f}, + {-0.425243f, 0.410651f, -0.806557f}, {-0.323200f, 0.597578f, -0.733786f}, + {-0.251965f, 0.757212f, -0.602614f}, {-0.186767f, 0.925548f, -0.329360f}, + {-0.425243f, 0.410651f, -0.806557f}, {-0.237882f, -0.043628f, -0.970314f}, + {-0.436192f, -0.277165f, -0.856105f}, {0.355285f, 0.831634f, -0.426799f}, + {0.248974f, 0.936959f, -0.245195f}, {0.387867f, 0.814848f, -0.430791f}, + {0.204352f, 0.947276f, -0.246795f}, {0.248974f, 0.936959f, -0.245195f}, + {0.355285f, 0.831634f, -0.426799f}, {-0.323200f, 0.597578f, -0.733786f}, + {-0.337693f, 0.105630f, -0.935311f}, {-0.374744f, 0.269451f, -0.887109f}, + {0.361705f, -0.132388f, -0.922845f}, {-0.015615f, 0.612257f, -0.790504f}, + {0.901109f, 0.387318f, 0.194905f}, {-0.015615f, 0.612257f, -0.790504f}, + {0.322542f, 0.653191f, -0.685060f}, {0.901109f, 0.387318f, 0.194905f}, + {0.780155f, 0.040807f, 0.624254f}, {0.993281f, -0.050399f, -0.104180f}, + {0.991736f, -0.022423f, 0.126318f}, {0.863378f, -0.022015f, 0.504077f}, + {0.993281f, -0.050399f, -0.104180f}, {0.780155f, 0.040807f, 0.624254f}, + {0.993281f, -0.050399f, -0.104180f}, {0.863378f, -0.022015f, 0.504077f}, + {0.992445f, -0.006490f, -0.122517f}, {0.902485f, -0.052899f, 0.427461f}, + {0.992445f, -0.006490f, -0.122517f}, {0.863378f, -0.022015f, 0.504077f}, + {0.992445f, -0.006490f, -0.122517f}, {0.902485f, -0.052899f, 0.427461f}, + {0.989261f, -0.125403f, -0.075082f}, {0.893791f, -0.347000f, 0.284129f}, + {0.989261f, -0.125403f, -0.075082f}, {0.902485f, -0.052899f, 0.427461f}, + {0.989261f, -0.125403f, -0.075082f}, {0.893791f, -0.347000f, 0.284129f}, + {0.900619f, -0.419869f, -0.112231f}, {0.779374f, -0.503516f, 0.372891f}, + {0.900619f, -0.419869f, -0.112231f}, {0.893791f, -0.347000f, 0.284129f}, + {0.900619f, -0.419869f, -0.112231f}, {0.779374f, -0.503516f, 0.372891f}, + {0.849845f, -0.527033f, 0.000431f}, {0.849845f, -0.527033f, 0.000431f}, + {0.779374f, -0.503516f, 0.372891f}, {0.711462f, -0.546075f, -0.442293f}, + {0.711462f, -0.546075f, -0.442293f}, {0.779374f, -0.503516f, 0.372891f}, + {0.713482f, -0.698031f, 0.060801f}, {0.326831f, -0.888389f, 0.322408f}, + {0.713482f, -0.698031f, 0.060801f}, {0.779374f, -0.503516f, 0.372891f}, + {0.713482f, -0.698031f, 0.060801f}, {0.326831f, -0.888389f, 0.322408f}, + {0.286696f, -0.954926f, -0.076954f}, {0.117638f, -0.795798f, 0.594026f}, + {0.286696f, -0.954926f, -0.076954f}, {0.326831f, -0.888389f, 0.322408f}, + {0.286696f, -0.954926f, -0.076954f}, {0.117638f, -0.795798f, 0.594026f}, + {0.166013f, -0.980090f, -0.108918f}, {0.117638f, -0.795798f, 0.594026f}, + {-0.178557f, -0.826586f, 0.533736f}, {-0.058265f, -0.998112f, -0.019421f}, + {0.166013f, -0.980090f, -0.108918f}, {0.117638f, -0.795798f, 0.594026f}, + {-0.058265f, -0.998112f, -0.019421f}, {0.053441f, -0.926371f, 0.372801f}, + {-0.058265f, -0.998112f, -0.019421f}, {-0.178557f, -0.826586f, 0.533736f}, + {-0.178557f, -0.826586f, 0.533736f}, {-0.270018f, -0.827184f, 0.492804f}, + {0.053441f, -0.926371f, 0.372801f}, {0.252548f, -0.116382f, 0.960560f}, + {0.318728f, -0.924816f, -0.207674f}, {0.053441f, -0.926371f, 0.372801f}, + {0.318728f, -0.924816f, -0.207674f}, {0.252548f, -0.116382f, 0.960560f}, + {0.297002f, 0.053309f, 0.953388f}, {0.677379f, 0.169613f, 0.715813f}, + {0.780155f, 0.040807f, 0.624254f}, {0.991736f, -0.022423f, 0.126318f}, + {0.902485f, -0.052899f, 0.427461f}, {0.725415f, -0.299431f, 0.619770f}, + {0.893791f, -0.347000f, 0.284129f}, {0.893791f, -0.347000f, 0.284129f}, + {0.725415f, -0.299431f, 0.619770f}, {0.779374f, -0.503516f, 0.372891f}, + {0.779374f, -0.503516f, 0.372891f}, {0.231919f, -0.774503f, 0.588522f}, + {0.326831f, -0.888389f, 0.322408f}, {0.117638f, -0.795798f, 0.594026f}, + {0.326831f, -0.888389f, 0.322408f}, {0.231919f, -0.774503f, 0.588522f}, + {-0.129625f, -0.629575f, 0.766050f}, {0.053441f, -0.926371f, 0.372801f}, + {-0.270018f, -0.827184f, 0.492804f}, {0.085830f, -0.307324f, 0.947726f}, + {0.252548f, -0.116382f, 0.960560f}, {0.053441f, -0.926371f, 0.372801f}, + {-0.129625f, -0.629575f, 0.766050f}, {0.085830f, -0.307324f, 0.947726f}, + {0.053441f, -0.926371f, 0.372801f}, {0.084648f, 0.310344f, 0.946848f}, + {0.780155f, 0.040807f, 0.624254f}, {0.677379f, 0.169613f, 0.715813f}, + {0.106053f, 0.082179f, 0.990959f}, {0.780155f, 0.040807f, 0.624254f}, + {0.084648f, 0.310344f, 0.946848f}, {0.208645f, 0.041640f, 0.977104f}, + {0.780155f, 0.040807f, 0.624254f}, {0.106053f, 0.082179f, 0.990959f}, + {0.780155f, 0.040807f, 0.624254f}, {0.208645f, 0.041640f, 0.977104f}, + {0.863378f, -0.022015f, 0.504077f}, {0.433703f, 0.105428f, 0.894867f}, + {0.863378f, -0.022015f, 0.504077f}, {0.208645f, 0.041640f, 0.977104f}, + {0.863378f, -0.022015f, 0.504077f}, {0.433703f, 0.105428f, 0.894867f}, + {0.902485f, -0.052899f, 0.427461f}, {0.902485f, -0.052899f, 0.427461f}, + {0.433703f, 0.105428f, 0.894867f}, {0.725415f, -0.299431f, 0.619770f}, + {0.346095f, -0.109424f, 0.931797f}, {0.725415f, -0.299431f, 0.619770f}, + {0.433703f, 0.105428f, 0.894867f}, {0.725415f, -0.299431f, 0.619770f}, + {0.346095f, -0.109424f, 0.931797f}, {0.779374f, -0.503516f, 0.372891f}, + {0.063100f, -0.113359f, 0.991548f}, {0.779374f, -0.503516f, 0.372891f}, + {0.346095f, -0.109424f, 0.931797f}, {0.779374f, -0.503516f, 0.372891f}, + {0.063100f, -0.113359f, 0.991548f}, {0.231919f, -0.774503f, 0.588522f}, + {-0.010970f, -0.239405f, 0.970858f}, {0.231919f, -0.774503f, 0.588522f}, + {0.063100f, -0.113359f, 0.991548f}, {0.231919f, -0.774503f, 0.588522f}, + {-0.010970f, -0.239405f, 0.970858f}, {0.117638f, -0.795798f, 0.594026f}, + {-0.043589f, -0.232065f, 0.971723f}, {0.117638f, -0.795798f, 0.594026f}, + {-0.010970f, -0.239405f, 0.970858f}, {0.117638f, -0.795798f, 0.594026f}, + {-0.043589f, -0.232065f, 0.971723f}, {-0.178557f, -0.826586f, 0.533736f}, + {-0.398829f, -0.462338f, 0.791946f}, {-0.270018f, -0.827184f, 0.492804f}, + {-0.178557f, -0.826586f, 0.533736f}, {-0.398829f, -0.462338f, 0.791946f}, + {-0.178557f, -0.826586f, 0.533736f}, {-0.043589f, -0.232065f, 0.971723f}, + {-0.498915f, -0.129739f, 0.856885f}, {-0.398829f, -0.462338f, 0.791946f}, + {-0.592193f, -0.093682f, 0.800332f}, {-0.398829f, -0.462338f, 0.791946f}, + {-0.498915f, -0.129739f, 0.856885f}, {-0.129625f, -0.629575f, 0.766050f}, + {-0.129625f, -0.629575f, 0.766050f}, {-0.270018f, -0.827184f, 0.492804f}, + {-0.398829f, -0.462338f, 0.791946f}, {-0.129625f, -0.629575f, 0.766050f}, + {-0.498915f, -0.129739f, 0.856885f}, {-0.173549f, -0.262745f, 0.949129f}, + {0.346095f, -0.109424f, 0.931797f}, {0.433703f, 0.105428f, 0.894867f}, + {-0.097050f, 0.313710f, 0.944546f}, {0.346095f, -0.109424f, 0.931797f}, + {-0.052094f, 0.410808f, 0.910232f}, {0.063100f, -0.113359f, 0.991548f}, + {-0.298910f, -0.075028f, 0.951327f}, {-0.398829f, -0.462338f, 0.791946f}, + {-0.043589f, -0.232065f, 0.971723f}, {-0.592193f, -0.093682f, 0.800332f}, + {-0.398829f, -0.462338f, 0.791946f}, {-0.298910f, -0.075028f, 0.951327f}, + {-0.313337f, 0.085931f, 0.945746f}, {-0.173549f, -0.262745f, 0.949129f}, + {-0.498915f, -0.129739f, 0.856885f}, {-0.718504f, 0.115581f, 0.685852f}, + {0.208645f, 0.041640f, 0.977104f}, {0.106053f, 0.082179f, 0.990959f}, + {-0.418312f, 0.515880f, 0.747584f}, {0.208645f, 0.041640f, 0.977104f}, + {-0.718504f, 0.115581f, 0.685852f}, {0.208645f, 0.041640f, 0.977104f}, + {-0.418312f, 0.515880f, 0.747584f}, {0.433703f, 0.105428f, 0.894867f}, + {0.433703f, 0.105428f, 0.894867f}, {-0.418312f, 0.515880f, 0.747584f}, + {-0.097050f, 0.313710f, 0.944546f}, {-0.097050f, 0.313710f, 0.944546f}, + {-0.418312f, 0.515880f, 0.747584f}, {0.346095f, -0.109424f, 0.931797f}, + {-0.052094f, 0.410808f, 0.910232f}, {0.346095f, -0.109424f, 0.931797f}, + {-0.418312f, 0.515880f, 0.747584f}, {-0.052094f, 0.410808f, 0.910232f}, + {-0.053319f, 0.381164f, 0.922969f}, {0.063100f, -0.113359f, 0.991548f}, + {0.063100f, -0.113359f, 0.991548f}, {-0.053319f, 0.381164f, 0.922969f}, + {-0.010970f, -0.239405f, 0.970858f}, {-0.093299f, 0.354639f, 0.930337f}, + {-0.010970f, -0.239405f, 0.970858f}, {-0.053319f, 0.381164f, 0.922969f}, + {-0.093299f, 0.354639f, 0.930337f}, {-0.043589f, -0.232065f, 0.971723f}, + {-0.010970f, -0.239405f, 0.970858f}, {-0.093299f, 0.354639f, 0.930337f}, + {-0.376120f, 0.455561f, 0.806844f}, {-0.301348f, 0.098811f, 0.948381f}, + {-0.301348f, 0.098811f, 0.948381f}, {-0.298910f, -0.075028f, 0.951327f}, + {-0.043589f, -0.232065f, 0.971723f}, {-0.093299f, 0.354639f, 0.930337f}, + {-0.301348f, 0.098811f, 0.948381f}, {-0.043589f, -0.232065f, 0.971723f}, + {-0.529356f, 0.588430f, 0.611173f}, {-0.498915f, -0.129739f, 0.856885f}, + {-0.709964f, 0.208725f, 0.672596f}, {-0.498915f, -0.129739f, 0.856885f}, + {-0.592193f, -0.093682f, 0.800332f}, {-0.709964f, 0.208725f, 0.672596f}, + {-0.709964f, 0.208725f, 0.672596f}, {-0.592193f, -0.093682f, 0.800332f}, + {-0.301348f, 0.098811f, 0.948381f}, {-0.301348f, 0.098811f, 0.948381f}, + {-0.592193f, -0.093682f, 0.800332f}, {-0.298910f, -0.075028f, 0.951327f}, + {-0.709964f, 0.208725f, 0.672596f}, {-0.301348f, 0.098811f, 0.948381f}, + {-0.376120f, 0.455561f, 0.806844f}, {-0.298963f, 0.372674f, 0.878485f}, + {-0.498915f, -0.129739f, 0.856885f}, {-0.529356f, 0.588430f, 0.611173f}, + {-0.498915f, -0.129739f, 0.856885f}, {-0.298963f, 0.372674f, 0.878485f}, + {-0.313337f, 0.085931f, 0.945746f}, {-0.761597f, 0.208208f, 0.613693f}, + {0.084648f, 0.310344f, 0.946848f}, {-0.820035f, 0.215202f, 0.530313f}, + {0.084648f, 0.310344f, 0.946848f}, {-0.761597f, 0.208208f, 0.613693f}, + {0.106053f, 0.082179f, 0.990959f}, {-0.718504f, 0.115581f, 0.685852f}, + {0.106053f, 0.082179f, 0.990959f}, {-0.761597f, 0.208208f, 0.613693f}, + {-0.252730f, 0.685448f, 0.682854f}, {-0.052094f, 0.410808f, 0.910232f}, + {-0.418312f, 0.515880f, 0.747584f}, {-0.052094f, 0.410808f, 0.910232f}, + {-0.252730f, 0.685448f, 0.682854f}, {-0.053319f, 0.381164f, 0.922969f}, + {-0.108489f, 0.699798f, 0.706055f}, {-0.093299f, 0.354639f, 0.930337f}, + {-0.252730f, 0.685448f, 0.682854f}, {-0.252730f, 0.685448f, 0.682854f}, + {-0.093299f, 0.354639f, 0.930337f}, {-0.053319f, 0.381164f, 0.922969f}, + {-0.093299f, 0.354639f, 0.930337f}, {-0.108489f, 0.699798f, 0.706055f}, + {-0.376120f, 0.455561f, 0.806844f}, {-0.305471f, 0.897750f, 0.317384f}, + {-0.252730f, 0.685448f, 0.682854f}, {-0.418312f, 0.515880f, 0.747584f}, + {-0.070961f, 0.861561f, 0.502670f}, {-0.108489f, 0.699798f, 0.706055f}, + {-0.305471f, 0.897750f, 0.317384f}, {-0.305471f, 0.897750f, 0.317384f}, + {-0.108489f, 0.699798f, 0.706055f}, {-0.252730f, 0.685448f, 0.682854f}, + {-0.070961f, 0.861561f, 0.502670f}, {-0.378639f, 0.772705f, 0.509470f}, + {-0.376120f, 0.455561f, 0.806844f}, {-0.070961f, 0.861561f, 0.502670f}, + {-0.376120f, 0.455561f, 0.806844f}, {-0.108489f, 0.699798f, 0.706055f}, + {-0.176836f, 0.958998f, 0.221477f}, {-0.529356f, 0.588430f, 0.611173f}, + {-0.444656f, 0.839265f, 0.312915f}, {-0.529356f, 0.588430f, 0.611173f}, + {-0.709964f, 0.208725f, 0.672596f}, {-0.378639f, 0.772705f, 0.509470f}, + {-0.378639f, 0.772705f, 0.509470f}, {-0.709964f, 0.208725f, 0.672596f}, + {-0.376120f, 0.455561f, 0.806844f}, {-0.444656f, 0.839265f, 0.312915f}, + {-0.529356f, 0.588430f, 0.611173f}, {-0.378639f, 0.772705f, 0.509470f}, + {-0.820035f, 0.215202f, 0.530313f}, {-0.940879f, 0.334753f, 0.051831f}, + {-0.965616f, 0.103795f, -0.238352f}, {-0.959333f, 0.100496f, -0.263783f}, + {-0.820035f, 0.215202f, 0.530313f}, {-0.965616f, 0.103795f, -0.238352f}, + {-0.820035f, 0.215202f, 0.530313f}, {-0.959333f, 0.100496f, -0.263783f}, + {-0.761597f, 0.208208f, 0.613693f}, {-0.973130f, 0.166733f, -0.158802f}, + {-0.761597f, 0.208208f, 0.613693f}, {-0.959333f, 0.100496f, -0.263783f}, + {-0.761597f, 0.208208f, 0.613693f}, {-0.973130f, 0.166733f, -0.158802f}, + {-0.718504f, 0.115581f, 0.685852f}, {-0.890645f, 0.441936f, -0.106979f}, + {-0.718504f, 0.115581f, 0.685852f}, {-0.973130f, 0.166733f, -0.158802f}, + {-0.718504f, 0.115581f, 0.685852f}, {-0.890645f, 0.441936f, -0.106979f}, + {-0.418312f, 0.515880f, 0.747584f}, {-0.218742f, 0.961904f, -0.163990f}, + {-0.305471f, 0.897750f, 0.317384f}, {-0.890645f, 0.441936f, -0.106979f}, + {-0.890645f, 0.441936f, -0.106979f}, {-0.305471f, 0.897750f, 0.317384f}, + {-0.418312f, 0.515880f, 0.747584f}, {-0.008932f, 0.996373f, 0.084627f}, + {-0.070961f, 0.861561f, 0.502670f}, {-0.218742f, 0.961904f, -0.163990f}, + {-0.218742f, 0.961904f, -0.163990f}, {-0.070961f, 0.861561f, 0.502670f}, + {-0.305471f, 0.897750f, 0.317384f}, {-0.087446f, 0.996168f, -0.001799f}, + {-0.378639f, 0.772705f, 0.509470f}, {-0.008932f, 0.996373f, 0.084627f}, + {-0.070961f, 0.861561f, 0.502670f}, {-0.008932f, 0.996373f, 0.084627f}, + {-0.378639f, 0.772705f, 0.509470f}, {-0.176836f, 0.958998f, 0.221477f}, + {-0.444656f, 0.839265f, 0.312915f}, {-0.087446f, 0.996168f, -0.001799f}, + {-0.087446f, 0.996168f, -0.001799f}, {-0.444656f, 0.839265f, 0.312915f}, + {-0.378639f, 0.772705f, 0.509470f}, {0.132411f, 0.904094f, -0.406302f}, + {-0.218742f, 0.961904f, -0.163990f}, {0.073976f, 0.846295f, -0.527554f}, + {-0.218742f, 0.961904f, -0.163990f}, {0.132411f, 0.904094f, -0.406302f}, + {-0.008932f, 0.996373f, 0.084627f}, {-0.087446f, 0.996168f, -0.001799f}, + {0.309223f, 0.924513f, -0.222839f}, {-0.176836f, 0.958998f, 0.221477f}, + {0.282941f, 0.879788f, 0.381992f}, {0.061960f, 0.962691f, 0.263414f}, + {0.309223f, 0.924513f, -0.222839f}, {0.309223f, 0.924513f, -0.222839f}, + {0.061960f, 0.962691f, 0.263414f}, {-0.176836f, 0.958998f, 0.221477f}, + {-0.732186f, 0.093289f, -0.674685f}, {-0.959333f, 0.100496f, -0.263783f}, + {-0.726149f, 0.143539f, -0.672387f}, {-0.726149f, 0.143539f, -0.672387f}, + {-0.959333f, 0.100496f, -0.263783f}, {-0.965616f, 0.103795f, -0.238352f}, + {-0.753084f, 0.217457f, -0.620949f}, {-0.973130f, 0.166733f, -0.158802f}, + {-0.732186f, 0.093289f, -0.674685f}, {-0.732186f, 0.093289f, -0.674685f}, + {-0.973130f, 0.166733f, -0.158802f}, {-0.959333f, 0.100496f, -0.263783f}, + {-0.489190f, 0.364342f, -0.792432f}, {-0.890645f, 0.441936f, -0.106979f}, + {-0.753084f, 0.217457f, -0.620949f}, {-0.753084f, 0.217457f, -0.620949f}, + {-0.890645f, 0.441936f, -0.106979f}, {-0.973130f, 0.166733f, -0.158802f}, + {-0.489190f, 0.364342f, -0.792432f}, {-0.218742f, 0.961904f, -0.163990f}, + {-0.890645f, 0.441936f, -0.106979f}, {-0.160436f, 0.526272f, -0.835044f}, + {-0.218742f, 0.961904f, -0.163990f}, {-0.489190f, 0.364342f, -0.792432f}, + {-0.218742f, 0.961904f, -0.163990f}, {-0.160436f, 0.526272f, -0.835044f}, + {0.073976f, 0.846295f, -0.527554f}, {-0.013651f, 0.267781f, -0.963383f}, + {0.073976f, 0.846295f, -0.527554f}, {-0.160436f, 0.526272f, -0.835044f}, + {0.073976f, 0.846295f, -0.527554f}, {-0.013651f, 0.267781f, -0.963383f}, + {0.132411f, 0.904094f, -0.406302f}, {-0.008932f, 0.996373f, 0.084627f}, + {0.132411f, 0.904094f, -0.406302f}, {-0.087446f, 0.996168f, -0.001799f}, + {0.309223f, 0.924513f, -0.222839f}, {-0.087446f, 0.996168f, -0.001799f}, + {0.132411f, 0.904094f, -0.406302f}, {-0.009330f, 0.026474f, -0.999606f}, + {-0.732186f, 0.093289f, -0.674685f}, {0.042255f, 0.119108f, -0.991982f}, + {0.042255f, 0.119108f, -0.991982f}, {-0.732186f, 0.093289f, -0.674685f}, + {-0.726149f, 0.143539f, -0.672387f}, {0.015366f, 0.312552f, -0.949776f}, + {-0.160436f, 0.526272f, -0.835044f}, {-0.489190f, 0.364342f, -0.792432f}, + {0.132411f, 0.904094f, -0.406302f}, {-0.013651f, 0.267781f, -0.963383f}, + {0.309223f, 0.924513f, -0.222839f}, {0.282941f, 0.879788f, 0.381992f}, + {0.309223f, 0.924513f, -0.222839f}, {0.692544f, 0.674674f, 0.255337f}, + {0.495485f, 0.585601f, 0.641534f}, {0.282941f, 0.879788f, 0.381992f}, + {0.692544f, 0.674674f, 0.255337f}, {0.420713f, 0.463778f, 0.779686f}, + {0.495485f, 0.585601f, 0.641534f}, {0.692544f, 0.674674f, 0.255337f}, + {0.692544f, 0.674674f, 0.255337f}, {0.309223f, 0.924513f, -0.222839f}, + {-0.013651f, 0.267781f, -0.963383f}, {0.356397f, 0.851081f, 0.385542f}, + {0.282941f, 0.879788f, 0.381992f}, {0.495485f, 0.585601f, 0.641534f}, + {0.000368f, 0.101015f, -0.994885f}, {-0.732186f, 0.093289f, -0.674685f}, + {-0.009330f, 0.026474f, -0.999606f}, {0.000368f, 0.101015f, -0.994885f}, + {-0.753084f, 0.217457f, -0.620949f}, {-0.732186f, 0.093289f, -0.674685f}, + {0.165505f, 0.112084f, -0.979819f}, {-0.489190f, 0.364342f, -0.792432f}, + {0.000368f, 0.101015f, -0.994885f}, {0.000368f, 0.101015f, -0.994885f}, + {-0.489190f, 0.364342f, -0.792432f}, {-0.753084f, 0.217457f, -0.620949f}, + {-0.160436f, 0.526272f, -0.835044f}, {0.113449f, 0.132333f, -0.984691f}, + {-0.013651f, 0.267781f, -0.963383f}, {0.356397f, 0.851081f, 0.385542f}, + {0.289826f, 0.746379f, 0.599099f}, {0.213363f, 0.870099f, 0.444302f}, + {0.213363f, 0.870099f, 0.444302f}, {0.289826f, 0.746379f, 0.599099f}, + {0.115037f, 0.723134f, 0.681061f}, {0.420713f, 0.463778f, 0.779686f}, + {0.356397f, 0.851081f, 0.385542f}, {0.495485f, 0.585601f, 0.641534f}, + {0.420713f, 0.463778f, 0.779686f}, {0.289826f, 0.746379f, 0.599099f}, + {0.356397f, 0.851081f, 0.385542f}, {0.420713f, 0.463778f, 0.779686f}, + {0.115037f, 0.723134f, 0.681061f}, {0.289826f, 0.746379f, 0.599099f}, + {0.536734f, -0.145434f, -0.831123f}, {-0.489190f, 0.364342f, -0.792432f}, + {0.165505f, 0.112084f, -0.979819f}, {0.536734f, -0.145434f, -0.831123f}, + {0.015366f, 0.312552f, -0.949776f}, {-0.489190f, 0.364342f, -0.792432f}, + {0.113449f, 0.132333f, -0.984691f}, {-0.160436f, 0.526272f, -0.835044f}, + {0.149477f, -0.160720f, -0.975615f}, {0.149477f, -0.160720f, -0.975615f}, + {-0.160436f, 0.526272f, -0.835044f}, {0.015366f, 0.312552f, -0.949776f}, + {-0.095328f, -0.237646f, -0.966663f}, {-0.013651f, 0.267781f, -0.963383f}, + {0.113449f, 0.132333f, -0.984691f}, {0.113449f, 0.132333f, -0.984691f}, + {0.031226f, -0.207174f, -0.977806f}, {-0.095328f, -0.237646f, -0.966663f}, + {0.638570f, -0.380460f, -0.668939f}, {-0.013651f, 0.267781f, -0.963383f}, + {0.031226f, -0.207174f, -0.977806f}, {-0.013651f, 0.267781f, -0.963383f}, + {0.638570f, -0.380460f, -0.668939f}, {0.692544f, 0.674674f, 0.255337f}, + {-0.095328f, -0.237646f, -0.966663f}, {0.031226f, -0.207174f, -0.977806f}, + {-0.013651f, 0.267781f, -0.963383f}, {0.390828f, -0.239009f, -0.888892f}, + {0.015366f, 0.312552f, -0.949776f}, {0.536734f, -0.145434f, -0.831123f}, + {0.149477f, -0.160720f, -0.975615f}, {0.015366f, 0.312552f, -0.949776f}, + {0.390828f, -0.239009f, -0.888892f}, {0.420713f, 0.463778f, 0.779686f}, + {-0.013651f, 0.267781f, -0.963383f}, {0.031226f, -0.207174f, -0.977806f}, + {0.420713f, 0.463778f, 0.779686f}, {0.692544f, 0.674674f, 0.255337f}, + {0.638570f, -0.380460f, -0.668939f}, {-0.013651f, 0.267781f, -0.963383f}, + {0.420713f, 0.463778f, 0.779686f}, {0.638570f, -0.380460f, -0.668939f}, + {0.287673f, 0.507493f, 0.812216f}, {0.115037f, 0.723134f, 0.681061f}, + {0.113449f, 0.132333f, -0.984691f}, {0.115037f, 0.723134f, 0.681061f}, + {0.420713f, 0.463778f, 0.779686f}, {0.031226f, -0.207174f, -0.977806f}, + {0.031226f, -0.207174f, -0.977806f}, {0.113449f, 0.132333f, -0.984691f}, + {0.115037f, 0.723134f, 0.681061f}, {0.670641f, 0.006062f, -0.741757f}, + {0.042255f, 0.119108f, -0.991982f}, {0.756764f, 0.013200f, -0.653555f}, + {0.670641f, 0.006062f, -0.741757f}, {-0.009330f, 0.026474f, -0.999606f}, + {0.042255f, 0.119108f, -0.991982f}, {0.731140f, -0.030964f, -0.681525f}, + {0.000368f, 0.101015f, -0.994885f}, {0.670641f, 0.006062f, -0.741757f}, + {0.670641f, 0.006062f, -0.741757f}, {0.000368f, 0.101015f, -0.994885f}, + {-0.009330f, 0.026474f, -0.999606f}, {0.756383f, 0.012930f, -0.654002f}, + {0.000368f, 0.101015f, -0.994885f}, {0.731140f, -0.030964f, -0.681525f}, + {0.756383f, 0.012930f, -0.654002f}, {0.165505f, 0.112084f, -0.979819f}, + {0.000368f, 0.101015f, -0.994885f}, {0.853969f, -0.265216f, -0.447658f}, + {0.536734f, -0.145434f, -0.831123f}, {0.756383f, 0.012930f, -0.654002f}, + {0.756383f, 0.012930f, -0.654002f}, {0.536734f, -0.145434f, -0.831123f}, + {0.165505f, 0.112084f, -0.979819f}, {0.728545f, -0.669331f, 0.145667f}, + {0.113449f, 0.132333f, -0.984691f}, {0.300398f, -0.631217f, -0.715071f}, + {0.300398f, -0.631217f, -0.715071f}, {0.113449f, 0.132333f, -0.984691f}, + {0.149477f, -0.160720f, -0.975615f}, {0.318728f, -0.924816f, -0.207674f}, + {0.031226f, -0.207174f, -0.977806f}, {0.113449f, 0.132333f, -0.984691f}, + {0.113449f, 0.132333f, -0.984691f}, {0.728545f, -0.669331f, 0.145667f}, + {0.318728f, -0.924816f, -0.207674f}, {0.228623f, -0.362769f, -0.903399f}, + {0.031226f, -0.207174f, -0.977806f}, {0.318728f, -0.924816f, -0.207674f}, + {0.031226f, -0.207174f, -0.977806f}, {0.228623f, -0.362769f, -0.903399f}, + {0.638570f, -0.380460f, -0.668939f}, {0.993281f, -0.050399f, -0.104180f}, + {0.670641f, 0.006062f, -0.741757f}, {0.991736f, -0.022423f, 0.126318f}, + {0.991736f, -0.022423f, 0.126318f}, {0.670641f, 0.006062f, -0.741757f}, + {0.756764f, 0.013200f, -0.653555f}, {0.992445f, -0.006490f, -0.122517f}, + {0.731140f, -0.030964f, -0.681525f}, {0.993281f, -0.050399f, -0.104180f}, + {0.993281f, -0.050399f, -0.104180f}, {0.731140f, -0.030964f, -0.681525f}, + {0.670641f, 0.006062f, -0.741757f}, {0.989261f, -0.125403f, -0.075082f}, + {0.756383f, 0.012930f, -0.654002f}, {0.992445f, -0.006490f, -0.122517f}, + {0.992445f, -0.006490f, -0.122517f}, {0.756383f, 0.012930f, -0.654002f}, + {0.731140f, -0.030964f, -0.681525f}, {0.900619f, -0.419869f, -0.112231f}, + {0.853969f, -0.265216f, -0.447658f}, {0.989261f, -0.125403f, -0.075082f}, + {0.989261f, -0.125403f, -0.075082f}, {0.853969f, -0.265216f, -0.447658f}, + {0.756383f, 0.012930f, -0.654002f}, {0.711462f, -0.546075f, -0.442293f}, + {0.536734f, -0.145434f, -0.831123f}, {0.900619f, -0.419869f, -0.112231f}, + {0.900619f, -0.419869f, -0.112231f}, {0.536734f, -0.145434f, -0.831123f}, + {0.853969f, -0.265216f, -0.447658f}, {0.711462f, -0.546075f, -0.442293f}, + {0.390828f, -0.239009f, -0.888892f}, {0.536734f, -0.145434f, -0.831123f}, + {0.711462f, -0.546075f, -0.442293f}, {0.149477f, -0.160720f, -0.975615f}, + {0.390828f, -0.239009f, -0.888892f}, {0.286696f, -0.954926f, -0.076954f}, + {0.300398f, -0.631217f, -0.715071f}, {0.711462f, -0.546075f, -0.442293f}, + {0.711462f, -0.546075f, -0.442293f}, {0.300398f, -0.631217f, -0.715071f}, + {0.149477f, -0.160720f, -0.975615f}, {0.166013f, -0.980090f, -0.108918f}, + {0.728545f, -0.669331f, 0.145667f}, {0.286696f, -0.954926f, -0.076954f}, + {0.286696f, -0.954926f, -0.076954f}, {0.728545f, -0.669331f, 0.145667f}, + {0.300398f, -0.631217f, -0.715071f}, {0.166013f, -0.980090f, -0.108918f}, + {-0.058265f, -0.998112f, -0.019421f}, {0.318728f, -0.924816f, -0.207674f}, + {0.728545f, -0.669331f, 0.145667f}, {0.166013f, -0.980090f, -0.108918f}, + {0.318728f, -0.924816f, -0.207674f}, {0.849845f, -0.527033f, 0.000431f}, + {0.711462f, -0.546075f, -0.442293f}, {0.900619f, -0.419869f, -0.112231f}, + {0.286696f, -0.954926f, -0.076954f}, {0.711462f, -0.546075f, -0.442293f}, + {0.713482f, -0.698031f, 0.060801f}, {0.053441f, -0.926371f, 0.372801f}, + {0.318728f, -0.924816f, -0.207674f}, {-0.058265f, -0.998112f, -0.019421f}, + {0.318728f, -0.924816f, -0.207674f}, {0.053441f, -0.926371f, 0.372801f}, + {0.228623f, -0.362769f, -0.903399f}, {0.998986f, -0.041054f, 0.018474f}, + {0.414669f, 0.339052f, 0.844449f}, {0.677379f, 0.169613f, 0.715813f}, + {0.414669f, 0.339052f, 0.844449f}, {-0.148039f, 0.454733f, 0.878238f}, + {0.084648f, 0.310344f, 0.946848f}, {-0.148039f, 0.454733f, 0.878238f}, + {-0.402786f, 0.530606f, 0.745802f}, {-0.820035f, 0.215202f, 0.530313f}, + {-0.940879f, 0.334753f, 0.051831f}, {-0.571566f, 0.341734f, -0.746010f}, + {-0.726149f, 0.143539f, -0.672387f}, {-0.571566f, 0.341734f, -0.746010f}, + {-0.092026f, 0.015743f, -0.995632f}, {0.042255f, 0.119108f, -0.991982f}, + {-0.092026f, 0.015743f, -0.995632f}, {0.585771f, -0.102870f, -0.803922f}, + {0.756764f, 0.013200f, -0.653555f}, {0.585771f, -0.102870f, -0.803922f}, + {0.998986f, -0.041054f, 0.018474f}, {0.756764f, 0.013200f, -0.653555f}, + {0.135575f, 0.967464f, 0.213620f}, {0.098032f, 0.964604f, 0.244805f}, + {0.282941f, 0.879788f, 0.381992f}, {-0.058113f, 0.949457f, 0.308470f}, + {-0.228362f, 0.861117f, 0.454234f}, {-0.176836f, 0.958998f, 0.221477f}, + {-0.228362f, 0.861117f, 0.454234f}, {-0.321627f, 0.659738f, 0.679192f}, + {-0.529356f, 0.588430f, 0.611173f}, {-0.321627f, 0.659738f, 0.679192f}, + {-0.334198f, 0.410925f, 0.848205f}, {-0.298963f, 0.372674f, 0.878485f}, + {-0.334198f, 0.410925f, 0.848205f}, {-0.382842f, 0.339600f, 0.859130f}, + {-0.313337f, 0.085931f, 0.945746f}, {-0.382842f, 0.339600f, 0.859130f}, + {-0.370077f, -0.091471f, 0.924487f}, {-0.313337f, 0.085931f, 0.945746f}, + {0.677379f, 0.169613f, 0.715813f}, {0.991736f, -0.022423f, 0.126318f}, + {0.998986f, -0.041054f, 0.018474f}, {0.084648f, 0.310344f, 0.946848f}, + {0.677379f, 0.169613f, 0.715813f}, {0.414669f, 0.339052f, 0.844449f}, + {-0.129625f, -0.629575f, 0.766050f}, {-0.173549f, -0.262745f, 0.949129f}, + {0.085830f, -0.307324f, 0.947726f}, {-0.173549f, -0.262745f, 0.949129f}, + {-0.313337f, 0.085931f, 0.945746f}, {-0.370077f, -0.091471f, 0.924487f}, + {-0.313337f, 0.085931f, 0.945746f}, {-0.298963f, 0.372674f, 0.878485f}, + {-0.334198f, 0.410925f, 0.848205f}, {-0.820035f, 0.215202f, 0.530313f}, + {0.084648f, 0.310344f, 0.946848f}, {-0.148039f, 0.454733f, 0.878238f}, + {-0.529356f, 0.588430f, 0.611173f}, {-0.176836f, 0.958998f, 0.221477f}, + {-0.228362f, 0.861117f, 0.454234f}, {-0.965616f, 0.103795f, -0.238352f}, + {-0.940879f, 0.334753f, 0.051831f}, {-0.726149f, 0.143539f, -0.672387f}, + {0.061960f, 0.962691f, 0.263414f}, {0.282941f, 0.879788f, 0.381992f}, + {0.098032f, 0.964604f, 0.244805f}, {0.282941f, 0.879788f, 0.381992f}, + {0.356397f, 0.851081f, 0.385542f}, {0.135575f, 0.967464f, 0.213620f}, + {0.042255f, 0.119108f, -0.991982f}, {-0.726149f, 0.143539f, -0.672387f}, + {-0.571566f, 0.341734f, -0.746010f}, {0.213363f, 0.870099f, 0.444302f}, + {0.267882f, 0.921692f, 0.280576f}, {0.356397f, 0.851081f, 0.385542f}, + {0.756764f, 0.013200f, -0.653555f}, {0.042255f, 0.119108f, -0.991982f}, + {-0.092026f, 0.015743f, -0.995632f}, {0.991736f, -0.022423f, 0.126318f}, + {0.756764f, 0.013200f, -0.653555f}, {0.998986f, -0.041054f, 0.018474f}, + {-0.820035f, 0.215202f, 0.530313f}, {-0.402786f, 0.530606f, 0.745802f}, + {-0.940879f, 0.334753f, 0.051831f}, {0.115037f, 0.723134f, 0.681061f}, + {-0.043041f, 0.825406f, 0.562896f}, {0.213363f, 0.870099f, 0.444302f}, + {0.061960f, 0.962691f, 0.263414f}, {-0.058113f, 0.949457f, 0.308470f}, + {-0.176836f, 0.958998f, 0.221477f}, {-0.321627f, 0.659738f, 0.679192f}, + {-0.298963f, 0.372674f, 0.878485f}, {-0.529356f, 0.588430f, 0.611173f}, + {-0.082479f, -0.124314f, -0.988809f}, {0.063165f, -0.217624f, -0.973987f}, + {-0.603162f, -0.412592f, -0.682616f}, {-0.603162f, -0.412592f, -0.682616f}, + {-0.652896f, -0.384826f, -0.652408f}, {-0.082479f, -0.124314f, -0.988809f}, + {-0.082479f, -0.124314f, -0.988809f}, {-0.008657f, -0.284713f, -0.958574f}, + {0.063165f, -0.217624f, -0.973987f}, {0.488229f, -0.233882f, -0.840792f}, + {0.585771f, -0.102870f, -0.803922f}, {-0.092026f, 0.015743f, -0.995632f}, + {0.063165f, -0.217624f, -0.973987f}, {0.488229f, -0.233882f, -0.840792f}, + {-0.092026f, 0.015743f, -0.995632f}, {-0.008657f, -0.284713f, -0.958574f}, + {0.488229f, -0.233882f, -0.840792f}, {0.063165f, -0.217624f, -0.973987f}, + {0.252834f, -0.236691f, -0.938111f}, {0.715267f, 0.435709f, -0.546398f}, + {-0.652896f, -0.384826f, -0.652408f}, {0.488229f, -0.233882f, -0.840792f}, + {0.998986f, -0.041054f, 0.018474f}, {0.585771f, -0.102870f, -0.803922f}, + {0.359159f, -0.071660f, -0.930521f}, {-0.082479f, -0.124314f, -0.988809f}, + {0.207102f, -0.054878f, -0.976779f}, {-0.082479f, -0.124314f, -0.988809f}, + {0.359159f, -0.071660f, -0.930521f}, {-0.008657f, -0.284713f, -0.958574f}, + {-0.082479f, -0.124314f, -0.988809f}, {-0.652896f, -0.384826f, -0.652408f}, + {0.207102f, -0.054878f, -0.976779f}, {-0.652896f, -0.384826f, -0.652408f}, + {0.715267f, 0.435709f, -0.546398f}, {-0.485875f, 0.322781f, -0.812242f}, + {0.488229f, -0.233882f, -0.840792f}, {0.923325f, -0.045392f, 0.381328f}, + {0.998986f, -0.041054f, 0.018474f}, {0.488229f, -0.233882f, -0.840792f}, + {-0.008657f, -0.284713f, -0.958574f}, {0.923325f, -0.045392f, 0.381328f}, + {-0.485875f, 0.322781f, -0.812242f}, {0.207102f, -0.054878f, -0.976779f}, + {-0.652896f, -0.384826f, -0.652408f}, {0.271688f, -0.209927f, 0.939211f}, + {0.923325f, -0.045392f, 0.381328f}, {-0.008657f, -0.284713f, -0.958574f}, + {-0.485875f, 0.322781f, -0.812242f}, {-0.652896f, -0.384826f, -0.652408f}, + {-0.929057f, 0.250064f, 0.272619f}, {-0.929057f, 0.250064f, 0.272619f}, + {-0.652896f, -0.384826f, -0.652408f}, {-0.797014f, 0.041121f, 0.602559f}, + {-0.652896f, -0.384826f, -0.652408f}, {-0.485875f, 0.322781f, -0.812242f}, + {-0.195533f, 0.844067f, -0.499317f}, {0.998986f, -0.041054f, 0.018474f}, + {0.923325f, -0.045392f, 0.381328f}, {0.414669f, 0.339052f, 0.844449f}, + {0.715267f, 0.435709f, -0.546398f}, {-0.195533f, 0.844067f, -0.499317f}, + {-0.485875f, 0.322781f, -0.812242f}, {-0.236733f, 0.073606f, 0.968783f}, + {0.414669f, 0.339052f, 0.844449f}, {0.923325f, -0.045392f, 0.381328f}, + {0.414669f, 0.339052f, 0.844449f}, {-0.236733f, 0.073606f, 0.968783f}, + {-0.148039f, 0.454733f, 0.878238f}, {-0.214278f, 0.219313f, 0.951833f}, + {0.271688f, -0.209927f, 0.939211f}, {0.502129f, 0.255443f, 0.826205f}, + {-0.124403f, 0.480106f, 0.868344f}, {-0.214278f, 0.219313f, 0.951833f}, + {0.502129f, 0.255443f, 0.826205f}, {-0.797014f, 0.041121f, 0.602559f}, + {-0.124403f, 0.480106f, 0.868344f}, {-0.929057f, 0.250064f, 0.272619f}, + {-0.214278f, 0.219313f, 0.951833f}, {-0.124403f, 0.480106f, 0.868344f}, + {-0.797014f, 0.041121f, 0.602559f}, {-0.797014f, 0.041121f, 0.602559f}, + {-0.652896f, -0.384826f, -0.652408f}, {-0.195533f, 0.844067f, -0.499317f}, + {-0.236733f, 0.073606f, 0.968783f}, {0.923325f, -0.045392f, 0.381328f}, + {0.271688f, -0.209927f, 0.939211f}, {0.271688f, -0.209927f, 0.939211f}, + {-0.214278f, 0.219313f, 0.951833f}, {-0.236733f, 0.073606f, 0.968783f}, + {0.252834f, -0.236691f, -0.938111f}, {-0.195533f, 0.844067f, -0.499317f}, + {0.715267f, 0.435709f, -0.546398f}, {-0.148039f, 0.454733f, 0.878238f}, + {-0.236733f, 0.073606f, 0.968783f}, {-0.940879f, 0.334753f, 0.051831f}, + {-0.797014f, 0.041121f, 0.602559f}, {-0.236733f, 0.073606f, 0.968783f}, + {-0.214278f, 0.219313f, 0.951833f}, {-0.940879f, 0.334753f, 0.051831f}, + {-0.236733f, 0.073606f, 0.968783f}, {-0.926643f, -0.282984f, 0.247491f}, + {-0.797014f, 0.041121f, 0.602559f}, {-0.926643f, -0.282984f, 0.247491f}, + {-0.236733f, 0.073606f, 0.968783f}, {-0.652896f, -0.384826f, -0.652408f}, + {-0.926643f, -0.282984f, 0.247491f}, {-0.797014f, 0.041121f, 0.602559f}, + {-0.652896f, -0.384826f, -0.652408f}, {-0.603162f, -0.412592f, -0.682616f}, + {-0.926643f, -0.282984f, 0.247491f}, {-0.195533f, 0.844067f, -0.499317f}, + {0.252834f, -0.236691f, -0.938111f}, {-0.652896f, -0.384826f, -0.652408f}, + {-0.092026f, 0.015743f, -0.995632f}, {-0.603162f, -0.412592f, -0.682616f}, + {0.063165f, -0.217624f, -0.973987f}, {-0.603162f, -0.412592f, -0.682616f}, + {-0.092026f, 0.015743f, -0.995632f}, {-0.940879f, 0.334753f, 0.051831f}, + {-0.926643f, -0.282984f, 0.247491f}, {-0.603162f, -0.412592f, -0.682616f}, + {-0.940879f, 0.334753f, 0.051831f}, {-0.148039f, 0.454733f, 0.878238f}, + {-0.940879f, 0.334753f, 0.051831f}, {-0.402786f, 0.530606f, 0.745802f}, + {-0.940879f, 0.334753f, 0.051831f}, {-0.092026f, 0.015743f, -0.995632f}, + {-0.571566f, 0.341734f, -0.746010f}, {0.943895f, -0.083144f, 0.319609f}, + {0.502129f, 0.255443f, 0.826205f}, {0.271688f, -0.209927f, 0.939211f}, + {-0.124403f, 0.480106f, 0.868344f}, {0.207102f, -0.054878f, -0.976779f}, + {0.017919f, 0.992644f, -0.119740f}, {-0.929057f, 0.250064f, 0.272619f}, + {-0.124403f, 0.480106f, 0.868344f}, {-0.698819f, 0.671416f, 0.246683f}, + {-0.698819f, 0.671416f, 0.246683f}, {-0.124403f, 0.480106f, 0.868344f}, + {0.017919f, 0.992644f, -0.119740f}, {-0.698819f, 0.671416f, 0.246683f}, + {-0.485875f, 0.322781f, -0.812242f}, {-0.929057f, 0.250064f, 0.272619f}, + {-0.456617f, 0.884616f, 0.094629f}, {0.060396f, 0.883178f, -0.465132f}, + {0.017919f, 0.992644f, -0.119740f}, {-0.631285f, 0.736281f, -0.243659f}, + {-0.456617f, 0.884616f, 0.094629f}, {0.060396f, 0.883178f, -0.465132f}, + {0.017919f, 0.992644f, -0.119740f}, {-0.456617f, 0.884616f, 0.094629f}, + {-0.698819f, 0.671416f, 0.246683f}, {-0.698819f, 0.671416f, 0.246683f}, + {-0.456617f, 0.884616f, 0.094629f}, {-0.881965f, 0.471315f, 0.000469f}, + {0.017919f, 0.992644f, -0.119740f}, {-0.456617f, 0.884616f, 0.094629f}, + {0.207102f, -0.054878f, -0.976779f}, {-0.485875f, 0.322781f, -0.812242f}, + {0.017919f, 0.992644f, -0.119740f}, {0.207102f, -0.054878f, -0.976779f}, + {-0.485875f, 0.322781f, -0.812242f}, {-0.698819f, 0.671416f, 0.246683f}, + {0.017919f, 0.992644f, -0.119740f}, {-0.578365f, 0.813992f, -0.053954f}, + {0.017919f, 0.992644f, -0.119740f}, {-0.367095f, 0.920895f, 0.131122f}, + {0.359159f, -0.071660f, -0.930521f}, {0.017919f, 0.992644f, -0.119740f}, + {-0.367095f, 0.920895f, 0.131122f}, {0.502129f, 0.255443f, 0.826205f}, + {0.359159f, -0.071660f, -0.930521f}, {-0.367095f, 0.920895f, 0.131122f}, + {-0.083840f, 0.561957f, 0.822906f}, {0.502129f, 0.255443f, 0.826205f}, + {-0.367095f, 0.920895f, 0.131122f}, {-0.367095f, 0.920895f, 0.131122f}, + {-0.404940f, 0.622606f, 0.669616f}, {-0.083840f, 0.561957f, 0.822906f}, + {-0.404940f, 0.622606f, 0.669616f}, {-0.367095f, 0.920895f, 0.131122f}, + {0.017919f, 0.992644f, -0.119740f}, {0.359159f, -0.071660f, -0.930521f}, + {0.207102f, -0.054878f, -0.976779f}, {0.017919f, 0.992644f, -0.119740f}, + {-0.083840f, 0.561957f, 0.822906f}, {-0.124403f, 0.480106f, 0.868344f}, + {0.502129f, 0.255443f, 0.826205f}, {-0.404940f, 0.622606f, 0.669616f}, + {-0.124403f, 0.480106f, 0.868344f}, {-0.083840f, 0.561957f, 0.822906f}, + {-0.124403f, 0.480106f, 0.868344f}, {-0.404940f, 0.622606f, 0.669616f}, + {0.017919f, 0.992644f, -0.119740f}, {0.943895f, -0.083144f, 0.319609f}, + {-0.008657f, -0.284713f, -0.958574f}, {0.359159f, -0.071660f, -0.930521f}, + {-0.515950f, -0.597013f, -0.614305f}, {0.413933f, -0.902597f, -0.118231f}, + {0.502129f, 0.255443f, 0.826205f}, {0.359159f, -0.071660f, -0.930521f}, + {0.502129f, 0.255443f, 0.826205f}, {0.943895f, -0.083144f, 0.319609f}, + {0.502129f, 0.255443f, 0.826205f}, {0.359159f, -0.071660f, -0.930521f}, + {-0.515950f, -0.597013f, -0.614305f}, {-0.367095f, 0.920895f, 0.131122f}, + {-0.817381f, -0.561716f, 0.127917f}, {-0.791704f, -0.424893f, -0.438942f}, + {-0.791704f, -0.424893f, -0.438942f}, {-0.817381f, -0.561716f, 0.127917f}, + {-0.515950f, -0.597013f, -0.614305f}, {-0.791704f, -0.424893f, -0.438942f}, + {0.359159f, -0.071660f, -0.930521f}, {-0.367095f, 0.920895f, 0.131122f}, + {0.359159f, -0.071660f, -0.930521f}, {-0.791704f, -0.424893f, -0.438942f}, + {-0.515950f, -0.597013f, -0.614305f}, {-0.552023f, -0.815259f, -0.174998f}, + {-0.008657f, -0.284713f, -0.958574f}, {-0.515950f, -0.597013f, -0.614305f}, + {0.359159f, -0.071660f, -0.930521f}, {-0.515950f, -0.597013f, -0.614305f}, + {-0.008657f, -0.284713f, -0.958574f}, {0.943895f, -0.083144f, 0.319609f}, + {-0.552023f, -0.815259f, -0.174998f}, {-0.515950f, -0.597013f, -0.614305f}, + {0.943895f, -0.083144f, 0.319609f}, {-0.515950f, -0.597013f, -0.614305f}, + {0.413933f, -0.902597f, -0.118231f}, {-0.515950f, -0.597013f, -0.614305f}, + {0.359159f, -0.071660f, -0.930521f}, {0.943895f, -0.083144f, 0.319609f}, + {0.943895f, -0.083144f, 0.319609f}, {-0.008657f, -0.284713f, -0.958574f}, + {-0.552023f, -0.815259f, -0.174998f}, {-0.008657f, -0.284713f, -0.958574f}, + {-0.552023f, -0.815259f, -0.174998f}, {0.271688f, -0.209927f, 0.939211f}, + {0.943895f, -0.083144f, 0.319609f}, {0.271688f, -0.209927f, 0.939211f}, + {-0.552023f, -0.815259f, -0.174998f}, {0.117155f, 0.955892f, 0.269343f}, + {0.222328f, 0.928824f, 0.296407f}, {0.430884f, 0.865455f, 0.255590f}, + {0.117155f, 0.955892f, 0.269343f}, {-0.164629f, 0.921121f, -0.352752f}, + {0.222328f, 0.928824f, 0.296407f}, {-0.164629f, 0.921121f, -0.352752f}, + {0.117155f, 0.955892f, 0.269343f}, {-0.548609f, 0.702264f, 0.453711f}, + {-0.562847f, 0.006894f, -0.826533f}, {-0.164629f, 0.921121f, -0.352752f}, + {-0.548609f, 0.702264f, 0.453711f}, {-0.548609f, 0.702264f, 0.453711f}, + {-0.848249f, -0.257559f, 0.462749f}, {-0.562847f, 0.006894f, -0.826533f}, + {-0.548609f, 0.702264f, 0.453711f}, {0.117155f, 0.955892f, 0.269343f}, + {-0.329259f, 0.449023f, 0.830642f}, {-0.548609f, 0.702264f, 0.453711f}, + {-0.648301f, 0.066617f, 0.758465f}, {-0.848249f, -0.257559f, 0.462749f}, + {-0.329259f, 0.449023f, 0.830642f}, {-0.679288f, 0.294342f, 0.672258f}, + {-0.548609f, 0.702264f, 0.453711f}, {-0.648301f, 0.066617f, 0.758465f}, + {-0.548609f, 0.702264f, 0.453711f}, {-0.679288f, 0.294342f, 0.672258f}, + {0.149035f, 0.415524f, 0.897290f}, {-0.092537f, 0.267623f, 0.959070f}, + {-0.329259f, 0.449023f, 0.830642f}, {-0.329259f, 0.449023f, 0.830642f}, + {-0.092537f, 0.267623f, 0.959070f}, {-0.340947f, 0.077736f, 0.936863f}, + {-0.679288f, 0.294342f, 0.672258f}, {-0.329259f, 0.449023f, 0.830642f}, + {-0.340947f, 0.077736f, 0.936863f}, {-0.648301f, 0.066617f, 0.758465f}, + {-0.679288f, 0.294342f, 0.672258f}, {-0.340947f, 0.077736f, 0.936863f}, + {0.192348f, 0.279380f, 0.940717f}, {0.149035f, 0.415524f, 0.897290f}, + {0.205985f, 0.284205f, 0.936375f}, {0.192348f, 0.279380f, 0.940717f}, + {-0.092537f, 0.267623f, 0.959070f}, {0.149035f, 0.415524f, 0.897290f}, + {-0.182422f, -0.095195f, 0.978601f}, {-0.648301f, 0.066617f, 0.758465f}, + {-0.340947f, 0.077736f, 0.936863f}, {-0.316714f, -0.098371f, 0.943406f}, + {-0.848249f, -0.257559f, 0.462749f}, {-0.648301f, 0.066617f, 0.758465f}, + {-0.648301f, 0.066617f, 0.758465f}, {-0.182422f, -0.095195f, 0.978601f}, + {-0.316714f, -0.098371f, 0.943406f}, {0.192348f, 0.279380f, 0.940717f}, + {0.191387f, 0.118163f, 0.974376f}, {-0.092537f, 0.267623f, 0.959070f}, + {-0.340947f, 0.077736f, 0.936863f}, {-0.092537f, 0.267623f, 0.959070f}, + {0.191387f, 0.118163f, 0.974376f}, {0.191387f, 0.118163f, 0.974376f}, + {0.207239f, -0.116274f, 0.971356f}, {-0.340947f, 0.077736f, 0.936863f}, + {0.217805f, -0.124169f, 0.968062f}, {-0.182422f, -0.095195f, 0.978601f}, + {0.207239f, -0.116274f, 0.971356f}, {0.207239f, -0.116274f, 0.971356f}, + {-0.182422f, -0.095195f, 0.978601f}, {-0.340947f, 0.077736f, 0.936863f}, + {0.110990f, 0.007382f, 0.993794f}, {-0.316714f, -0.098371f, 0.943406f}, + {-0.182422f, -0.095195f, 0.978601f}, {-0.182422f, -0.095195f, 0.978601f}, + {0.217805f, -0.124169f, 0.968062f}, {0.110990f, 0.007382f, 0.993794f}, + {0.423686f, -0.005740f, 0.905791f}, {0.191387f, 0.118163f, 0.974376f}, + {0.340456f, 0.148097f, 0.928524f}, {0.340456f, 0.148097f, 0.928524f}, + {0.191387f, 0.118163f, 0.974376f}, {0.192348f, 0.279380f, 0.940717f}, + {0.423686f, -0.005740f, 0.905791f}, {0.207239f, -0.116274f, 0.971356f}, + {0.191387f, 0.118163f, 0.974376f}, {0.699403f, 0.167149f, 0.694908f}, + {0.423686f, -0.005740f, 0.905791f}, {0.497283f, 0.178068f, 0.849118f}, + {0.497283f, 0.178068f, 0.849118f}, {0.423686f, -0.005740f, 0.905791f}, + {0.340456f, 0.148097f, 0.928524f}, {0.669948f, -0.177201f, 0.720951f}, + {0.423686f, -0.005740f, 0.905791f}, {0.699403f, 0.167149f, 0.694908f}, + {0.423686f, -0.005740f, 0.905791f}, {0.669948f, -0.177201f, 0.720951f}, + {0.207239f, -0.116274f, 0.971356f}, {0.574724f, -0.087039f, 0.813706f}, + {0.207239f, -0.116274f, 0.971356f}, {0.669948f, -0.177201f, 0.720951f}, + {0.207239f, -0.116274f, 0.971356f}, {0.574724f, -0.087039f, 0.813706f}, + {0.217805f, -0.124169f, 0.968062f}, {0.532600f, 0.170685f, 0.828977f}, + {0.217805f, -0.124169f, 0.968062f}, {0.574724f, -0.087039f, 0.813706f}, + {0.217805f, -0.124169f, 0.968062f}, {0.532600f, 0.170685f, 0.828977f}, + {0.110990f, 0.007382f, 0.993794f}, {0.699403f, 0.167149f, 0.694908f}, + {0.497283f, 0.178068f, 0.849118f}, {0.708291f, 0.192457f, 0.679179f}, + {0.669948f, -0.177201f, 0.720951f}, {0.936542f, 0.200793f, 0.287354f}, + {0.574724f, -0.087039f, 0.813706f}, {0.880685f, 0.301175f, 0.365632f}, + {0.574724f, -0.087039f, 0.813706f}, {0.936542f, 0.200793f, 0.287354f}, + {0.574724f, -0.087039f, 0.813706f}, {0.880685f, 0.301175f, 0.365632f}, + {0.532600f, 0.170685f, 0.828977f}, {0.708291f, 0.192457f, 0.679179f}, + {0.818805f, 0.324094f, 0.473837f}, {0.827430f, 0.318705f, 0.462371f}, + {0.699403f, 0.167149f, 0.694908f}, {0.708291f, 0.192457f, 0.679179f}, + {0.827430f, 0.318705f, 0.462371f}, {0.944621f, 0.317956f, -0.081206f}, + {0.960131f, -0.115252f, 0.254686f}, {0.669948f, -0.177201f, 0.720951f}, + {0.699403f, 0.167149f, 0.694908f}, {0.827430f, 0.318705f, 0.462371f}, + {0.944621f, 0.317956f, -0.081206f}, {0.669948f, -0.177201f, 0.720951f}, + {0.699403f, 0.167149f, 0.694908f}, {0.944621f, 0.317956f, -0.081206f}, + {0.669948f, -0.177201f, 0.720951f}, {0.960131f, -0.115252f, 0.254686f}, + {0.936542f, 0.200793f, 0.287354f}, {0.658963f, 0.309216f, -0.685677f}, + {0.960131f, -0.115252f, 0.254686f}, {0.944621f, 0.317956f, -0.081206f}, + {0.960131f, -0.115252f, 0.254686f}, {0.658963f, 0.309216f, -0.685677f}, + {0.936542f, 0.200793f, 0.287354f}, {0.880685f, 0.301175f, 0.365632f}, + {0.936542f, 0.200793f, 0.287354f}, {0.802815f, 0.408657f, -0.434152f}, + {0.936542f, 0.200793f, 0.287354f}, {0.658963f, 0.309216f, -0.685677f}, + {0.802815f, 0.408657f, -0.434152f}, {0.818805f, 0.324094f, 0.473837f}, + {0.828419f, 0.545369f, 0.127650f}, {0.827430f, 0.318705f, 0.462371f}, + {0.828419f, 0.545369f, 0.127650f}, {0.818805f, 0.324094f, 0.473837f}, + {0.910755f, 0.278726f, 0.304691f}, {0.944621f, 0.317956f, -0.081206f}, + {0.827430f, 0.318705f, 0.462371f}, {0.828419f, 0.545369f, 0.127650f}, + {0.385960f, 0.714582f, -0.583444f}, {0.658963f, 0.309216f, -0.685677f}, + {0.944621f, 0.317956f, -0.081206f}, {0.838981f, 0.354286f, -0.413029f}, + {0.880685f, 0.301175f, 0.365632f}, {0.802815f, 0.408657f, -0.434152f}, + {0.880685f, 0.301175f, 0.365632f}, {0.838981f, 0.354286f, -0.413029f}, + {0.881510f, 0.445674f, 0.155930f}, {0.828419f, 0.545369f, 0.127650f}, + {0.611084f, 0.776183f, 0.155293f}, {0.385960f, 0.714582f, -0.583444f}, + {0.385960f, 0.714582f, -0.583444f}, {0.944621f, 0.317956f, -0.081206f}, + {0.828419f, 0.545369f, 0.127650f}, {0.658963f, 0.309216f, -0.685677f}, + {0.344945f, 0.229757f, -0.910069f}, {0.802815f, 0.408657f, -0.434152f}, + {0.538352f, 0.183130f, -0.822581f}, {0.838981f, 0.354286f, -0.413029f}, + {0.344945f, 0.229757f, -0.910069f}, {0.344945f, 0.229757f, -0.910069f}, + {0.838981f, 0.354286f, -0.413029f}, {0.802815f, 0.408657f, -0.434152f}, + {0.611084f, 0.776183f, 0.155293f}, {0.449200f, 0.852911f, 0.266011f}, + {0.385960f, 0.714582f, -0.583444f}, {0.273760f, 0.685970f, -0.674167f}, + {0.658963f, 0.309216f, -0.685677f}, {0.385960f, 0.714582f, -0.583444f}, + {0.344945f, 0.229757f, -0.910069f}, {0.658963f, 0.309216f, -0.685677f}, + {0.273760f, 0.685970f, -0.674167f}, {0.464427f, 0.885444f, 0.017201f}, + {0.385960f, 0.714582f, -0.583444f}, {0.449200f, 0.852911f, 0.266011f}, + {0.273760f, 0.685970f, -0.674167f}, {0.323219f, 0.936774f, -0.134107f}, + {0.464427f, 0.885444f, 0.017201f}, {0.464427f, 0.885444f, 0.017201f}, + {0.323219f, 0.936774f, -0.134107f}, {0.385960f, 0.714582f, -0.583444f}, + {0.273760f, 0.685970f, -0.674167f}, {0.385960f, 0.714582f, -0.583444f}, + {0.323219f, 0.936774f, -0.134107f}, {-0.164629f, 0.921121f, -0.352752f}, + {0.273760f, 0.685970f, -0.674167f}, {0.222328f, 0.928824f, 0.296407f}, + {0.222328f, 0.928824f, 0.296407f}, {0.273760f, 0.685970f, -0.674167f}, + {0.338569f, 0.794483f, 0.504150f}, {0.338569f, 0.794483f, 0.504150f}, + {0.273760f, 0.685970f, -0.674167f}, {0.464427f, 0.885444f, 0.017201f}, + {0.273760f, 0.685970f, -0.674167f}, {-0.164629f, 0.921121f, -0.352752f}, + {-0.562847f, 0.006894f, -0.826533f}, {0.344945f, 0.229757f, -0.910069f}, + {0.273760f, 0.685970f, -0.674167f}, {-0.562847f, 0.006894f, -0.826533f}, + {-0.548609f, 0.702264f, 0.453711f}, {0.208222f, 0.491946f, 0.845360f}, + {-0.329259f, 0.449023f, 0.830642f}, {0.208222f, 0.491946f, 0.845360f}, + {0.257029f, 0.521014f, 0.813929f}, {-0.329259f, 0.449023f, 0.830642f}, + {0.257029f, 0.521014f, 0.813929f}, {0.289593f, 0.427276f, 0.856488f}, + {0.149035f, 0.415524f, 0.897290f}, {0.210996f, 0.179609f, 0.960844f}, + {0.307422f, 0.250640f, 0.917971f}, {0.192348f, 0.279380f, 0.940717f}, + {0.307422f, 0.250640f, 0.917971f}, {0.439946f, 0.175781f, 0.880652f}, + {0.497283f, 0.178068f, 0.849118f}, {0.439946f, 0.175781f, 0.880652f}, + {0.547075f, 0.225477f, 0.806145f}, {0.497283f, 0.178068f, 0.849118f}, + {0.547075f, 0.225477f, 0.806145f}, {0.676305f, 0.266081f, 0.686886f}, + {0.708291f, 0.192457f, 0.679179f}, {0.676305f, 0.266081f, 0.686886f}, + {0.789740f, 0.237525f, 0.565590f}, {0.818805f, 0.324094f, 0.473837f}, + {0.789740f, 0.237525f, 0.565590f}, {0.812721f, 0.298228f, 0.500545f}, + {0.818805f, 0.324094f, 0.473837f}, {-0.350539f, -0.164048f, -0.922069f}, + {0.538352f, 0.183130f, -0.822581f}, {-0.562847f, 0.006894f, -0.826533f}, + {0.902613f, 0.405339f, 0.144882f}, {0.529713f, 0.169994f, 0.830967f}, + {0.881510f, 0.445674f, 0.155930f}, {0.529713f, 0.169994f, 0.830967f}, + {-0.429658f, -0.124707f, 0.894339f}, {0.110990f, 0.007382f, 0.993794f}, + {-0.429658f, -0.124707f, 0.894339f}, {-0.800545f, -0.557866f, -0.218892f}, + {-0.848249f, -0.257559f, 0.462749f}, {-0.800545f, -0.557866f, -0.218892f}, + {-0.961236f, -0.254299f, -0.106572f}, {-0.848249f, -0.257559f, 0.462749f}, + {-0.800545f, -0.557866f, -0.218892f}, {-0.350539f, -0.164048f, -0.922069f}, + {-0.562847f, 0.006894f, -0.826533f}, {-0.562847f, 0.006894f, -0.826533f}, + {-0.848249f, -0.257559f, 0.462749f}, {-0.800545f, -0.557866f, -0.218892f}, + {-0.848249f, -0.257559f, 0.462749f}, {-0.316714f, -0.098371f, 0.943406f}, + {-0.429658f, -0.124707f, 0.894339f}, {-0.316714f, -0.098371f, 0.943406f}, + {0.110990f, 0.007382f, 0.993794f}, {-0.429658f, -0.124707f, 0.894339f}, + {0.340456f, 0.148097f, 0.928524f}, {0.192348f, 0.279380f, 0.940717f}, + {0.307422f, 0.250640f, 0.917971f}, {0.497283f, 0.178068f, 0.849118f}, + {0.340456f, 0.148097f, 0.928524f}, {0.307422f, 0.250640f, 0.917971f}, + {0.110990f, 0.007382f, 0.993794f}, {0.532600f, 0.170685f, 0.828977f}, + {0.529713f, 0.169994f, 0.830967f}, {0.708291f, 0.192457f, 0.679179f}, + {0.497283f, 0.178068f, 0.849118f}, {0.547075f, 0.225477f, 0.806145f}, + {0.532600f, 0.170685f, 0.828977f}, {0.880685f, 0.301175f, 0.365632f}, + {0.881510f, 0.445674f, 0.155930f}, {0.818805f, 0.324094f, 0.473837f}, + {0.812721f, 0.298228f, 0.500545f}, {0.910755f, 0.278726f, 0.304691f}, + {0.344945f, 0.229757f, -0.910069f}, {-0.562847f, 0.006894f, -0.826533f}, + {0.538352f, 0.183130f, -0.822581f}, {0.257029f, 0.521014f, 0.813929f}, + {0.149035f, 0.415524f, 0.897290f}, {-0.329259f, 0.449023f, 0.830642f}, + {0.708291f, 0.192457f, 0.679179f}, {0.676305f, 0.266081f, 0.686886f}, + {0.818805f, 0.324094f, 0.473837f}, {0.449200f, 0.852911f, 0.266011f}, + {0.338569f, 0.794483f, 0.504150f}, {0.464427f, 0.885444f, 0.017201f}, + {0.881510f, 0.445674f, 0.155930f}, {0.529713f, 0.169994f, 0.830967f}, + {0.532600f, 0.170685f, 0.828977f}, {0.843904f, -0.534691f, -0.043957f}, + {0.427200f, -0.264457f, 0.864617f}, {0.529713f, 0.169994f, 0.830967f}, + {0.529713f, 0.169994f, 0.830967f}, {0.902613f, 0.405339f, 0.144882f}, + {0.843904f, -0.534691f, -0.043957f}, {0.322492f, -0.895759f, -0.305966f}, + {0.184599f, -0.693801f, 0.696106f}, {0.843904f, -0.534691f, -0.043957f}, + {0.843904f, -0.534691f, -0.043957f}, {0.184599f, -0.693801f, 0.696106f}, + {0.427200f, -0.264457f, 0.864617f}, {0.269201f, -0.924425f, -0.270126f}, + {0.226980f, -0.748456f, 0.623132f}, {0.322492f, -0.895759f, -0.305966f}, + {0.322492f, -0.895759f, -0.305966f}, {0.226980f, -0.748456f, 0.623132f}, + {0.184599f, -0.693801f, 0.696106f}, {0.269201f, -0.924425f, -0.270126f}, + {0.310233f, -0.946662f, -0.087099f}, {0.226980f, -0.748456f, 0.623132f}, + {0.226980f, -0.748456f, 0.623132f}, {0.103756f, -0.458200f, 0.882773f}, + {0.036832f, -0.090172f, 0.995245f}, {0.137532f, -0.990470f, -0.007369f}, + {0.103756f, -0.458200f, 0.882773f}, {0.310233f, -0.946662f, -0.087099f}, + {0.310233f, -0.946662f, -0.087099f}, {0.103756f, -0.458200f, 0.882773f}, + {0.226980f, -0.748456f, 0.623132f}, {0.137532f, -0.990470f, -0.007369f}, + {0.757921f, -0.639321f, -0.129711f}, {0.574630f, -0.510161f, 0.639950f}, + {0.103756f, -0.458200f, 0.882773f}, {0.137532f, -0.990470f, -0.007369f}, + {0.574630f, -0.510161f, 0.639950f}, {0.574630f, -0.510161f, 0.639950f}, + {0.757921f, -0.639321f, -0.129711f}, {0.991725f, 0.071842f, -0.106395f}, + {0.991725f, 0.071842f, -0.106395f}, {0.542871f, 0.079788f, 0.836017f}, + {0.574630f, -0.510161f, 0.639950f}, {0.542871f, 0.079788f, 0.836017f}, + {0.958246f, 0.244027f, -0.149051f}, {0.874203f, 0.192696f, 0.445688f}, + {0.958246f, 0.244027f, -0.149051f}, {0.542871f, 0.079788f, 0.836017f}, + {0.991725f, 0.071842f, -0.106395f}, {0.894736f, 0.434207f, -0.104456f}, + {0.874203f, 0.192696f, 0.445688f}, {0.958246f, 0.244027f, -0.149051f}, + {0.874203f, 0.192696f, 0.445688f}, {0.894736f, 0.434207f, -0.104456f}, + {0.794391f, 0.464231f, 0.391704f}, {-0.134647f, 0.858667f, 0.494532f}, + {-0.237040f, 0.096035f, 0.966742f}, {0.794391f, 0.464231f, 0.391704f}, + {0.307273f, -0.165243f, 0.937165f}, {0.794391f, 0.464231f, 0.391704f}, + {0.894736f, 0.434207f, -0.104456f}, {0.794391f, 0.464231f, 0.391704f}, + {0.307273f, -0.165243f, 0.937165f}, {-0.134647f, 0.858667f, 0.494532f}, + {0.894736f, 0.434207f, -0.104456f}, {-0.606543f, -0.526765f, 0.595503f}, + {0.307273f, -0.165243f, 0.937165f}, {0.902613f, 0.405339f, 0.144882f}, + {0.881510f, 0.445674f, 0.155930f}, {0.538352f, 0.183130f, -0.822581f}, + {0.843904f, -0.534691f, -0.043957f}, {0.902613f, 0.405339f, 0.144882f}, + {0.538352f, 0.183130f, -0.822581f}, {0.538352f, 0.183130f, -0.822581f}, + {0.376617f, -0.217386f, -0.900502f}, {0.843904f, -0.534691f, -0.043957f}, + {0.194550f, -0.522844f, -0.829930f}, {0.322492f, -0.895759f, -0.305966f}, + {0.376617f, -0.217386f, -0.900502f}, {0.322492f, -0.895759f, -0.305966f}, + {0.843904f, -0.534691f, -0.043957f}, {0.376617f, -0.217386f, -0.900502f}, + {0.321286f, -0.732722f, -0.599912f}, {0.322492f, -0.895759f, -0.305966f}, + {0.194550f, -0.522844f, -0.829930f}, {0.322492f, -0.895759f, -0.305966f}, + {0.321286f, -0.732722f, -0.599912f}, {0.269201f, -0.924425f, -0.270126f}, + {0.282382f, -0.633241f, -0.720601f}, {0.269201f, -0.924425f, -0.270126f}, + {0.321286f, -0.732722f, -0.599912f}, {0.269201f, -0.924425f, -0.270126f}, + {0.282382f, -0.633241f, -0.720601f}, {0.310233f, -0.946662f, -0.087099f}, + {0.310233f, -0.946662f, -0.087099f}, {0.282382f, -0.633241f, -0.720601f}, + {0.137532f, -0.990470f, -0.007369f}, {0.454473f, -0.471380f, -0.755814f}, + {0.757921f, -0.639321f, -0.129711f}, {0.137532f, -0.990470f, -0.007369f}, + {0.137532f, -0.990470f, -0.007369f}, {0.282382f, -0.633241f, -0.720601f}, + {0.454473f, -0.471380f, -0.755814f}, {0.991725f, 0.071842f, -0.106395f}, + {0.757921f, -0.639321f, -0.129711f}, {0.454473f, -0.471380f, -0.755814f}, + {0.642628f, -0.075132f, -0.762486f}, {0.991725f, 0.071842f, -0.106395f}, + {0.454473f, -0.471380f, -0.755814f}, {0.991725f, 0.071842f, -0.106395f}, + {0.642628f, -0.075132f, -0.762486f}, {0.958246f, 0.244027f, -0.149051f}, + {0.958246f, 0.244027f, -0.149051f}, {0.642628f, -0.075132f, -0.762486f}, + {0.603742f, 0.160505f, -0.780855f}, {0.674295f, 0.612725f, -0.412183f}, + {0.894736f, 0.434207f, -0.104456f}, {0.603742f, 0.160505f, -0.780855f}, + {0.603742f, 0.160505f, -0.780855f}, {0.894736f, 0.434207f, -0.104456f}, + {0.958246f, 0.244027f, -0.149051f}, {0.077862f, -0.111324f, -0.990729f}, + {0.194550f, -0.522844f, -0.829930f}, {-0.049438f, 0.127782f, -0.990569f}, + {0.194550f, -0.522844f, -0.829930f}, {0.077862f, -0.111324f, -0.990729f}, + {0.321286f, -0.732722f, -0.599912f}, {0.321286f, -0.732722f, -0.599912f}, + {0.077862f, -0.111324f, -0.990729f}, {0.282382f, -0.633241f, -0.720601f}, + {0.730976f, 0.408730f, -0.546456f}, {-0.831249f, 0.454782f, -0.319687f}, + {0.674295f, 0.612725f, -0.412183f}, {-0.831249f, 0.454782f, -0.319687f}, + {0.894736f, 0.434207f, -0.104456f}, {0.674295f, 0.612725f, -0.412183f}, + {0.603742f, 0.160505f, -0.780855f}, {0.730976f, 0.408730f, -0.546456f}, + {0.674295f, 0.612725f, -0.412183f}, {-0.831249f, 0.454782f, -0.319687f}, + {0.307273f, -0.165243f, 0.937165f}, {0.894736f, 0.434207f, -0.104456f}, + {-0.831249f, 0.454782f, -0.319687f}, {0.730976f, 0.408730f, -0.546456f}, + {0.307273f, -0.165243f, 0.937165f}, {0.730976f, 0.408730f, -0.546456f}, + {0.654331f, -0.147778f, 0.741629f}, {0.307273f, -0.165243f, 0.937165f}, + {-0.350539f, -0.164048f, -0.922069f}, {-0.057903f, 0.084077f, -0.994775f}, + {0.376617f, -0.217386f, -0.900502f}, {0.538352f, 0.183130f, -0.822581f}, + {-0.350539f, -0.164048f, -0.922069f}, {0.376617f, -0.217386f, -0.900502f}, + {0.376617f, -0.217386f, -0.900502f}, {-0.012782f, 0.317890f, -0.948042f}, + {0.194550f, -0.522844f, -0.829930f}, {-0.049438f, 0.127782f, -0.990569f}, + {0.194550f, -0.522844f, -0.829930f}, {-0.012782f, 0.317890f, -0.948042f}, + {-0.108390f, 0.198573f, -0.974074f}, {0.642628f, -0.075132f, -0.762486f}, + {0.282382f, -0.633241f, -0.720601f}, {0.282382f, -0.633241f, -0.720601f}, + {0.642628f, -0.075132f, -0.762486f}, {0.454473f, -0.471380f, -0.755814f}, + {-0.532940f, -0.026708f, -0.845732f}, {0.730976f, 0.408730f, -0.546456f}, + {0.603742f, 0.160505f, -0.780855f}, {-0.057903f, 0.084077f, -0.994775f}, + {-0.480303f, 0.693690f, -0.536753f}, {-0.012782f, 0.317890f, -0.948042f}, + {-0.012782f, 0.317890f, -0.948042f}, {0.376617f, -0.217386f, -0.900502f}, + {-0.057903f, 0.084077f, -0.994775f}, {-0.108390f, 0.198573f, -0.974074f}, + {0.282382f, -0.633241f, -0.720601f}, {0.077862f, -0.111324f, -0.990729f}, + {0.077862f, -0.111324f, -0.990729f}, {-0.248173f, 0.769914f, -0.587914f}, + {-0.108390f, 0.198573f, -0.974074f}, {-0.108390f, 0.198573f, -0.974074f}, + {-0.532940f, -0.026708f, -0.845732f}, {0.642628f, -0.075132f, -0.762486f}, + {-0.532940f, -0.026708f, -0.845732f}, {0.603742f, 0.160505f, -0.780855f}, + {0.642628f, -0.075132f, -0.762486f}, {-0.012782f, 0.317890f, -0.948042f}, + {-0.045936f, 0.791705f, -0.609174f}, {-0.049438f, 0.127782f, -0.990569f}, + {-0.248173f, 0.769914f, -0.587914f}, {-0.049438f, 0.127782f, -0.990569f}, + {-0.045936f, 0.791705f, -0.609174f}, {-0.049438f, 0.127782f, -0.990569f}, + {-0.248173f, 0.769914f, -0.587914f}, {0.077862f, -0.111324f, -0.990729f}, + {-0.791004f, 0.090632f, -0.605061f}, {-0.057903f, 0.084077f, -0.994775f}, + {-0.350539f, -0.164048f, -0.922069f}, {-0.350539f, -0.164048f, -0.922069f}, + {-0.736312f, -0.381662f, -0.558729f}, {-0.791004f, 0.090632f, -0.605061f}, + {-0.480303f, 0.693690f, -0.536753f}, {-0.057903f, 0.084077f, -0.994775f}, + {-0.791004f, 0.090632f, -0.605061f}, {-0.480303f, 0.693690f, -0.536753f}, + {-0.308976f, 0.885968f, -0.345824f}, {-0.012782f, 0.317890f, -0.948042f}, + {-0.045936f, 0.791705f, -0.609174f}, {-0.012782f, 0.317890f, -0.948042f}, + {-0.308976f, 0.885968f, -0.345824f}, {-0.045936f, 0.791705f, -0.609174f}, + {-0.241969f, 0.938448f, 0.246507f}, {-0.248173f, 0.769914f, -0.587914f}, + {-0.241969f, 0.938448f, 0.246507f}, {-0.249921f, 0.966334f, 0.061141f}, + {-0.248173f, 0.769914f, -0.587914f}, {-0.248173f, 0.769914f, -0.587914f}, + {-0.553630f, 0.770550f, -0.315825f}, {-0.108390f, 0.198573f, -0.974074f}, + {-0.248173f, 0.769914f, -0.587914f}, {-0.249921f, 0.966334f, 0.061141f}, + {-0.553630f, 0.770550f, -0.315825f}, {-0.961874f, 0.084580f, -0.260087f}, + {-0.532940f, -0.026708f, -0.845732f}, {-0.108390f, 0.198573f, -0.974074f}, + {-0.961874f, 0.084580f, -0.260087f}, {-0.108390f, 0.198573f, -0.974074f}, + {-0.553630f, 0.770550f, -0.315825f}, {-0.831249f, 0.454782f, -0.319687f}, + {-0.532940f, -0.026708f, -0.845732f}, {-0.961874f, 0.084580f, -0.260087f}, + {0.730976f, 0.408730f, -0.546456f}, {-0.532940f, -0.026708f, -0.845732f}, + {-0.831249f, 0.454782f, -0.319687f}, {-0.736312f, -0.381662f, -0.558729f}, + {-0.961236f, -0.254299f, -0.106572f}, {-0.791004f, 0.090632f, -0.605061f}, + {-0.791004f, 0.090632f, -0.605061f}, {-0.961236f, -0.254299f, -0.106572f}, + {-0.935861f, 0.336108f, 0.105809f}, {-0.772121f, 0.609980f, 0.178194f}, + {-0.791004f, 0.090632f, -0.605061f}, {-0.935861f, 0.336108f, 0.105809f}, + {-0.791004f, 0.090632f, -0.605061f}, {-0.772121f, 0.609980f, 0.178194f}, + {-0.480303f, 0.693690f, -0.536753f}, {-0.480303f, 0.693690f, -0.536753f}, + {-0.772121f, 0.609980f, 0.178194f}, {-0.594004f, 0.743409f, 0.307413f}, + {-0.290261f, 0.853479f, 0.432808f}, {-0.480303f, 0.693690f, -0.536753f}, + {-0.594004f, 0.743409f, 0.307413f}, {-0.480303f, 0.693690f, -0.536753f}, + {-0.290261f, 0.853479f, 0.432808f}, {-0.308976f, 0.885968f, -0.345824f}, + {-0.241969f, 0.938448f, 0.246507f}, {-0.308976f, 0.885968f, -0.345824f}, + {-0.290261f, 0.853479f, 0.432808f}, {-0.308976f, 0.885968f, -0.345824f}, + {-0.241969f, 0.938448f, 0.246507f}, {-0.045936f, 0.791705f, -0.609174f}, + {-0.237040f, 0.096035f, 0.966742f}, {-0.831249f, 0.454782f, -0.319687f}, + {-0.588608f, 0.118159f, 0.799737f}, {-0.961874f, 0.084580f, -0.260087f}, + {-0.588608f, 0.118159f, 0.799737f}, {-0.831249f, 0.454782f, -0.319687f}, + {-0.164873f, 0.655558f, 0.736927f}, {-0.114112f, 0.634512f, 0.764443f}, + {-0.249921f, 0.966334f, 0.061141f}, {-0.241969f, 0.938448f, 0.246507f}, + {-0.164873f, 0.655558f, 0.736927f}, {-0.249921f, 0.966334f, 0.061141f}, + {-0.249921f, 0.966334f, 0.061141f}, {-0.343146f, 0.561925f, 0.752656f}, + {-0.553630f, 0.770550f, -0.315825f}, {-0.343146f, 0.561925f, 0.752656f}, + {-0.249921f, 0.966334f, 0.061141f}, {-0.114112f, 0.634512f, 0.764443f}, + {-0.588608f, 0.118159f, 0.799737f}, {-0.961874f, 0.084580f, -0.260087f}, + {-0.553630f, 0.770550f, -0.315825f}, {-0.588608f, 0.118159f, 0.799737f}, + {-0.553630f, 0.770550f, -0.315825f}, {-0.343146f, 0.561925f, 0.752656f}, + {-0.800545f, -0.557866f, -0.218892f}, {-0.429658f, -0.124707f, 0.894339f}, + {-0.961236f, -0.254299f, -0.106572f}, {-0.961236f, -0.254299f, -0.106572f}, + {-0.623191f, 0.218421f, 0.750950f}, {-0.935861f, 0.336108f, 0.105809f}, + {-0.623191f, 0.218421f, 0.750950f}, {-0.961236f, -0.254299f, -0.106572f}, + {-0.429658f, -0.124707f, 0.894339f}, {-0.023163f, -0.074290f, 0.996968f}, + {-0.376399f, 0.292230f, 0.879162f}, {-0.623191f, 0.218421f, 0.750950f}, + {-0.376399f, 0.292230f, 0.879162f}, {-0.772121f, 0.609980f, 0.178194f}, + {-0.623191f, 0.218421f, 0.750950f}, {-0.623191f, 0.218421f, 0.750950f}, + {-0.772121f, 0.609980f, 0.178194f}, {-0.935861f, 0.336108f, 0.105809f}, + {-0.594004f, 0.743409f, 0.307413f}, {-0.772121f, 0.609980f, 0.178194f}, + {-0.376399f, 0.292230f, 0.879162f}, {-0.036591f, 0.219387f, 0.974951f}, + {-0.290261f, 0.853479f, 0.432808f}, {-0.376399f, 0.292230f, 0.879162f}, + {-0.376399f, 0.292230f, 0.879162f}, {-0.290261f, 0.853479f, 0.432808f}, + {-0.594004f, 0.743409f, 0.307413f}, {-0.164873f, 0.655558f, 0.736927f}, + {-0.241969f, 0.938448f, 0.246507f}, {-0.036591f, 0.219387f, 0.974951f}, + {-0.036591f, 0.219387f, 0.974951f}, {-0.241969f, 0.938448f, 0.246507f}, + {-0.290261f, 0.853479f, 0.432808f}, {-0.023163f, -0.074290f, 0.996968f}, + {-0.623191f, 0.218421f, 0.750950f}, {-0.429658f, -0.124707f, 0.894339f}, + {0.015105f, 0.084406f, 0.996317f}, {-0.164873f, 0.655558f, 0.736927f}, + {-0.036591f, 0.219387f, 0.974951f}, {0.015105f, 0.084406f, 0.996317f}, + {0.036832f, -0.090172f, 0.995245f}, {-0.114112f, 0.634512f, 0.764443f}, + {-0.164873f, 0.655558f, 0.736927f}, {0.015105f, 0.084406f, 0.996317f}, + {-0.114112f, 0.634512f, 0.764443f}, {0.036832f, -0.090172f, 0.995245f}, + {0.103756f, -0.458200f, 0.882773f}, {-0.343146f, 0.561925f, 0.752656f}, + {-0.114112f, 0.634512f, 0.764443f}, {0.036832f, -0.090172f, 0.995245f}, + {-0.343146f, 0.561925f, 0.752656f}, {-0.036591f, 0.219387f, 0.974951f}, + {-0.376399f, 0.292230f, 0.879162f}, {-0.023163f, -0.074290f, 0.996968f}, + {0.542871f, 0.079788f, 0.836017f}, {-0.343146f, 0.561925f, 0.752656f}, + {0.103756f, -0.458200f, 0.882773f}, {0.542871f, 0.079788f, 0.836017f}, + {0.874203f, 0.192696f, 0.445688f}, {-0.588608f, 0.118159f, 0.799737f}, + {-0.588608f, 0.118159f, 0.799737f}, {-0.343146f, 0.561925f, 0.752656f}, + {0.542871f, 0.079788f, 0.836017f}, {0.529713f, 0.169994f, 0.830967f}, + {0.427200f, -0.264457f, 0.864617f}, {-0.023163f, -0.074290f, 0.996968f}, + {-0.429658f, -0.124707f, 0.894339f}, {0.529713f, 0.169994f, 0.830967f}, + {-0.023163f, -0.074290f, 0.996968f}, {-0.036591f, 0.219387f, 0.974951f}, + {-0.023163f, -0.074290f, 0.996968f}, {0.427200f, -0.264457f, 0.864617f}, + {0.427200f, -0.264457f, 0.864617f}, {0.015105f, 0.084406f, 0.996317f}, + {-0.036591f, 0.219387f, 0.974951f}, {0.542871f, 0.079788f, 0.836017f}, + {0.103756f, -0.458200f, 0.882773f}, {0.574630f, -0.510161f, 0.639950f}, + {-0.588608f, 0.118159f, 0.799737f}, {0.874203f, 0.192696f, 0.445688f}, + {-0.237040f, 0.096035f, 0.966742f}, {0.184599f, -0.693801f, 0.696106f}, + {0.015105f, 0.084406f, 0.996317f}, {0.427200f, -0.264457f, 0.864617f}, + {0.226980f, -0.748456f, 0.623132f}, {0.036832f, -0.090172f, 0.995245f}, + {0.184599f, -0.693801f, 0.696106f}, {0.184599f, -0.693801f, 0.696106f}, + {0.036832f, -0.090172f, 0.995245f}, {0.015105f, 0.084406f, 0.996317f}, + {0.874203f, 0.192696f, 0.445688f}, {0.794391f, 0.464231f, 0.391704f}, + {-0.237040f, 0.096035f, 0.966742f}, {-0.350539f, -0.164048f, -0.922069f}, + {-0.800545f, -0.557866f, -0.218892f}, {-0.736312f, -0.381662f, -0.558729f}, + {0.538352f, 0.183130f, -0.822581f}, {0.881510f, 0.445674f, 0.155930f}, + {0.838981f, 0.354286f, -0.413029f}, {-0.961236f, -0.254299f, -0.106572f}, + {-0.736312f, -0.381662f, -0.558729f}, {-0.800545f, -0.557866f, -0.218892f}, + {0.307273f, -0.165243f, 0.937165f}, {-0.831249f, 0.454782f, -0.319687f}, + {-0.237040f, 0.096035f, 0.966742f}, {-0.237040f, 0.096035f, 0.966742f}, + {-0.134647f, 0.858667f, 0.494532f}, {0.307273f, -0.165243f, 0.937165f}, + {-0.134647f, 0.858667f, 0.494532f}, {0.848073f, -0.281316f, 0.449037f}, + {-0.383839f, 0.906225f, -0.177268f}, {-0.383839f, 0.906225f, -0.177268f}, + {0.307273f, -0.165243f, 0.937165f}, {-0.134647f, 0.858667f, 0.494532f}, + {0.848073f, -0.281316f, 0.449037f}, {0.307273f, -0.165243f, 0.937165f}, + {-0.383839f, 0.906225f, -0.177268f}, {0.848073f, -0.281316f, 0.449037f}, + {-0.134647f, 0.858667f, 0.494532f}, {0.307273f, -0.165243f, 0.937165f}, + {0.683516f, -0.675504f, 0.276588f}, {0.343314f, -0.935035f, -0.088572f}, + {0.559951f, -0.798324f, -0.221661f}, {0.055770f, -0.976201f, -0.209576f}, + {0.559951f, -0.798324f, -0.221661f}, {0.343314f, -0.935035f, -0.088572f}, + {0.901109f, 0.387318f, 0.194905f}, {0.361705f, -0.132388f, -0.922845f}, + {0.683516f, -0.675504f, 0.276588f}, {0.343314f, -0.935035f, -0.088572f}, + {0.683516f, -0.675504f, 0.276588f}, {0.361705f, -0.132388f, -0.922845f}, + {-0.151863f, 0.379451f, -0.912663f}, {-0.131874f, 0.668345f, -0.732068f}, + {-0.184452f, 0.855665f, -0.483544f}, {-0.184452f, 0.855665f, -0.483544f}, + {-0.131874f, 0.668345f, -0.732068f}, {0.023087f, 0.983535f, -0.179238f}, + {-0.129631f, -0.183454f, -0.974444f}, {-0.237882f, -0.043628f, -0.970314f}, + {-0.151863f, 0.379451f, -0.912663f}, {-0.151863f, 0.379451f, -0.912663f}, + {-0.237882f, -0.043628f, -0.970314f}, {-0.131874f, 0.668345f, -0.732068f}, + {0.559951f, -0.798324f, -0.221661f}, {0.055770f, -0.976201f, -0.209576f}, + {0.167578f, -0.745812f, -0.644734f}, {0.559951f, -0.798324f, -0.221661f}, + {0.901109f, 0.387318f, 0.194905f}, {0.683516f, -0.675504f, 0.276588f}, + {-0.671918f, 0.537053f, -0.510000f}, {0.023087f, 0.983535f, -0.179238f}, + {-0.339246f, 0.630741f, 0.697910f}, {-0.339246f, 0.630741f, 0.697910f}, + {0.023087f, 0.983535f, -0.179238f}, {0.048201f, 0.967562f, 0.247995f}, + {-0.339246f, 0.630741f, 0.697910f}, {0.133994f, 0.708701f, 0.692668f}, + {0.901109f, 0.387318f, 0.194905f}, {0.133994f, 0.708701f, 0.692668f}, + {-0.339246f, 0.630741f, 0.697910f}, {0.048201f, 0.967562f, 0.247995f}, + {0.739721f, -0.663774f, -0.110528f}, {-0.151863f, 0.379451f, -0.912663f}, + {-0.671918f, 0.537053f, -0.510000f}, {-0.671918f, 0.537053f, -0.510000f}, + {-0.151863f, 0.379451f, -0.912663f}, {-0.184452f, 0.855665f, -0.483544f}, + {0.023087f, 0.983535f, -0.179238f}, {-0.671918f, 0.537053f, -0.510000f}, + {-0.184452f, 0.855665f, -0.483544f}, {-0.151863f, 0.379451f, -0.912663f}, + {-0.310798f, 0.261443f, -0.913812f}, {-0.129631f, -0.183454f, -0.974444f}, + {-0.310798f, 0.261443f, -0.913812f}, {-0.151863f, 0.379451f, -0.912663f}, + {0.739721f, -0.663774f, -0.110528f}, {-0.310798f, 0.261443f, -0.913812f}, + {0.134356f, -0.695658f, -0.705697f}, {-0.129631f, -0.183454f, -0.974444f}, + {0.134356f, -0.695658f, -0.705697f}, {0.739721f, -0.663774f, -0.110528f}, + {0.167578f, -0.745812f, -0.644734f}, {0.167578f, -0.745812f, -0.644734f}, + {-0.129631f, -0.183454f, -0.974444f}, {0.134356f, -0.695658f, -0.705697f}, + {0.739721f, -0.663774f, -0.110528f}, {0.559951f, -0.798324f, -0.221661f}, + {0.167578f, -0.745812f, -0.644734f}, {0.702009f, -0.466389f, 0.538205f}, + {0.901109f, 0.387318f, 0.194905f}, {0.559951f, -0.798324f, -0.221661f}, + {0.559951f, -0.798324f, -0.221661f}, {0.697735f, -0.553562f, -0.454681f}, + {0.702009f, -0.466389f, 0.538205f}, {-0.310798f, 0.261443f, -0.913812f}, + {-0.274142f, 0.209109f, -0.938680f}, {0.327271f, -0.044087f, -0.943901f}, + {-0.310798f, 0.261443f, -0.913812f}, {0.739721f, -0.663774f, -0.110528f}, + {-0.671918f, 0.537053f, -0.510000f}, {-0.671918f, 0.537053f, -0.510000f}, + {-0.274142f, 0.209109f, -0.938680f}, {-0.310798f, 0.261443f, -0.913812f}, + {-0.310798f, 0.261443f, -0.913812f}, {0.327271f, -0.044087f, -0.943901f}, + {0.134356f, -0.695658f, -0.705697f}, {0.697735f, -0.553562f, -0.454681f}, + {0.134356f, -0.695658f, -0.705697f}, {0.327271f, -0.044087f, -0.943901f}, + {0.134356f, -0.695658f, -0.705697f}, {0.697735f, -0.553562f, -0.454681f}, + {0.739721f, -0.663774f, -0.110528f}, {0.697735f, -0.553562f, -0.454681f}, + {0.559951f, -0.798324f, -0.221661f}, {0.739721f, -0.663774f, -0.110528f}, + {0.981598f, -0.185945f, -0.043461f}, {0.702009f, -0.466389f, 0.538205f}, + {0.697735f, -0.553562f, -0.454681f}, {0.981598f, -0.185945f, -0.043461f}, + {0.177384f, 0.110986f, 0.977864f}, {0.702009f, -0.466389f, 0.538205f}, + {0.901109f, 0.387318f, 0.194905f}, {0.702009f, -0.466389f, 0.538205f}, + {0.177384f, 0.110986f, 0.977864f}, {0.177384f, 0.110986f, 0.977864f}, + {-0.339246f, 0.630741f, 0.697910f}, {0.901109f, 0.387318f, 0.194905f}, + {-0.671918f, 0.537053f, -0.510000f}, {-0.296435f, 0.138514f, -0.944955f}, + {-0.274142f, 0.209109f, -0.938680f}, {-0.274142f, 0.209109f, -0.938680f}, + {-0.296435f, 0.138514f, -0.944955f}, {0.468993f, -0.018847f, -0.883001f}, + {0.327271f, -0.044087f, -0.943901f}, {-0.274142f, 0.209109f, -0.938680f}, + {0.468993f, -0.018847f, -0.883001f}, {0.981598f, -0.185945f, -0.043461f}, + {0.697735f, -0.553562f, -0.454681f}, {0.327271f, -0.044087f, -0.943901f}, + {0.468993f, -0.018847f, -0.883001f}, {0.981598f, -0.185945f, -0.043461f}, + {0.327271f, -0.044087f, -0.943901f}, {0.981598f, -0.185945f, -0.043461f}, + {0.997269f, -0.039027f, 0.062704f}, {0.371997f, 0.003804f, 0.928226f}, + {0.177384f, 0.110986f, 0.977864f}, {0.981598f, -0.185945f, -0.043461f}, + {0.371997f, 0.003804f, 0.928226f}, {-0.339246f, 0.630741f, 0.697910f}, + {0.177384f, 0.110986f, 0.977864f}, {0.371997f, 0.003804f, 0.928226f}, + {-0.389041f, 0.208605f, 0.897291f}, {-0.878746f, 0.266489f, 0.395965f}, + {-0.339246f, 0.630741f, 0.697910f}, {-0.339246f, 0.630741f, 0.697910f}, + {0.371997f, 0.003804f, 0.928226f}, {-0.389041f, 0.208605f, 0.897291f}, + {-0.671918f, 0.537053f, -0.510000f}, {-0.339246f, 0.630741f, 0.697910f}, + {-0.878746f, 0.266489f, 0.395965f}, {-0.671918f, 0.537053f, -0.510000f}, + {-0.878746f, 0.266489f, 0.395965f}, {-0.846678f, 0.355922f, -0.395545f}, + {-0.846678f, 0.355922f, -0.395545f}, {-0.537819f, 0.296240f, -0.789299f}, + {-0.671918f, 0.537053f, -0.510000f}, {-0.537819f, 0.296240f, -0.789299f}, + {0.140010f, 0.021538f, -0.989916f}, {-0.671918f, 0.537053f, -0.510000f}, + {-0.671918f, 0.537053f, -0.510000f}, {0.140010f, 0.021538f, -0.989916f}, + {-0.296435f, 0.138514f, -0.944955f}, {0.468993f, -0.018847f, -0.883001f}, + {-0.296435f, 0.138514f, -0.944955f}, {0.140010f, 0.021538f, -0.989916f}, + {0.981598f, -0.185945f, -0.043461f}, {0.468993f, -0.018847f, -0.883001f}, + {0.140010f, 0.021538f, -0.989916f}, {0.140010f, 0.021538f, -0.989916f}, + {0.826623f, -0.154051f, -0.541261f}, {0.981598f, -0.185945f, -0.043461f}, + {0.826623f, -0.154051f, -0.541261f}, {0.997269f, -0.039027f, 0.062704f}, + {0.981598f, -0.185945f, -0.043461f}, {0.240729f, 0.183380f, 0.953111f}, + {0.371997f, 0.003804f, 0.928226f}, {0.556554f, 0.028917f, 0.830308f}, + {0.963918f, -0.104371f, 0.244887f}, {0.556554f, 0.028917f, 0.830308f}, + {0.371997f, 0.003804f, 0.928226f}, {0.371997f, 0.003804f, 0.928226f}, + {0.997269f, -0.039027f, 0.062704f}, {0.963918f, -0.104371f, 0.244887f}, + {-0.440502f, 0.276883f, 0.853987f}, {-0.538988f, 0.456125f, 0.708126f}, + {-0.878746f, 0.266489f, 0.395965f}, {-0.389041f, 0.208605f, 0.897291f}, + {0.240729f, 0.183380f, 0.953111f}, {-0.440502f, 0.276883f, 0.853987f}, + {-0.878746f, 0.266489f, 0.395965f}, {-0.389041f, 0.208605f, 0.897291f}, + {-0.440502f, 0.276883f, 0.853987f}, {0.240729f, 0.183380f, 0.953111f}, + {-0.389041f, 0.208605f, 0.897291f}, {0.371997f, 0.003804f, 0.928226f}, + {-0.684218f, 0.672334f, -0.282511f}, {-0.878746f, 0.266489f, 0.395965f}, + {-0.538988f, 0.456125f, 0.708126f}, {-0.744455f, 0.394741f, -0.538486f}, + {-0.846678f, 0.355922f, -0.395545f}, {-0.684218f, 0.672334f, -0.282511f}, + {-0.878746f, 0.266489f, 0.395965f}, {-0.684218f, 0.672334f, -0.282511f}, + {-0.846678f, 0.355922f, -0.395545f}, {-0.537819f, 0.296240f, -0.789299f}, + {-0.151191f, 0.316424f, -0.936492f}, {0.140010f, 0.021538f, -0.989916f}, + {-0.151191f, 0.316424f, -0.936492f}, {-0.537819f, 0.296240f, -0.789299f}, + {-0.846678f, 0.355922f, -0.395545f}, {-0.151191f, 0.316424f, -0.936492f}, + {0.780903f, -0.084524f, -0.618907f}, {0.140010f, 0.021538f, -0.989916f}, + {0.780903f, -0.084524f, -0.618907f}, {0.826623f, -0.154051f, -0.541261f}, + {0.140010f, 0.021538f, -0.989916f}, {0.826623f, -0.154051f, -0.541261f}, + {0.780903f, -0.084524f, -0.618907f}, {0.963918f, -0.104371f, 0.244887f}, + {0.997269f, -0.039027f, 0.062704f}, {0.826623f, -0.154051f, -0.541261f}, + {0.963918f, -0.104371f, 0.244887f}, {0.035931f, 0.978315f, -0.203983f}, + {0.351359f, 0.907094f, 0.231790f}, {0.023087f, 0.983535f, -0.179238f}, + {0.351359f, 0.907094f, 0.231790f}, {0.693419f, 0.720347f, -0.016479f}, + {0.133994f, 0.708701f, 0.692668f}, {0.693419f, 0.720347f, -0.016479f}, + {0.646168f, 0.395237f, -0.652882f}, {0.901109f, 0.387318f, 0.194905f}, + {0.646168f, 0.395237f, -0.652882f}, {-0.137885f, -0.308339f, 0.941231f}, + {-0.015615f, 0.612257f, -0.790504f}, {-0.137885f, -0.308339f, 0.941231f}, + {0.416569f, -0.491733f, -0.764636f}, {0.343314f, -0.935035f, -0.088572f}, + {0.416569f, -0.491733f, -0.764636f}, {-0.058529f, -0.935295f, -0.348995f}, + {0.055770f, -0.976201f, -0.209576f}, {-0.058529f, -0.935295f, -0.348995f}, + {-0.283861f, -0.608680f, -0.740899f}, {0.167578f, -0.745812f, -0.644734f}, + {-0.283861f, -0.608680f, -0.740899f}, {-0.237882f, -0.043628f, -0.970314f}, + {0.167578f, -0.745812f, -0.644734f}, {-0.140997f, 0.780001f, -0.609687f}, + {0.035931f, 0.978315f, -0.203983f}, {0.023087f, 0.983535f, -0.179238f}, + {0.757243f, -0.437019f, 0.485384f}, {-0.538988f, 0.456125f, 0.708126f}, + {0.240729f, 0.183380f, 0.953111f}, {-0.684218f, 0.672334f, -0.282511f}, + {-0.396819f, 0.535445f, -0.745543f}, {-0.744455f, 0.394741f, -0.538486f}, + {-0.396819f, 0.535445f, -0.745543f}, {0.332223f, 0.118859f, -0.935682f}, + {-0.151191f, 0.316424f, -0.936492f}, {0.055770f, -0.976201f, -0.209576f}, + {0.343314f, -0.935035f, -0.088572f}, {0.416569f, -0.491733f, -0.764636f}, + {0.361705f, -0.132388f, -0.922845f}, {-0.015615f, 0.612257f, -0.790504f}, + {-0.137885f, -0.308339f, 0.941231f}, {0.343314f, -0.935035f, -0.088572f}, + {0.361705f, -0.132388f, -0.922845f}, {-0.137885f, -0.308339f, 0.941231f}, + {0.048201f, 0.967562f, 0.247995f}, {0.023087f, 0.983535f, -0.179238f}, + {0.351359f, 0.907094f, 0.231790f}, {0.023087f, 0.983535f, -0.179238f}, + {-0.131874f, 0.668345f, -0.732068f}, {-0.140997f, 0.780001f, -0.609687f}, + {-0.129631f, -0.183454f, -0.974444f}, {0.167578f, -0.745812f, -0.644734f}, + {-0.237882f, -0.043628f, -0.970314f}, {0.167578f, -0.745812f, -0.644734f}, + {0.055770f, -0.976201f, -0.209576f}, {-0.058529f, -0.935295f, -0.348995f}, + {0.901109f, 0.387318f, 0.194905f}, {0.133994f, 0.708701f, 0.692668f}, + {0.693419f, 0.720347f, -0.016479f}, {0.133994f, 0.708701f, 0.692668f}, + {0.048201f, 0.967562f, 0.247995f}, {0.351359f, 0.907094f, 0.231790f}, + {0.240729f, 0.183380f, 0.953111f}, {0.556554f, 0.028917f, 0.830308f}, + {0.963918f, -0.104371f, 0.244887f}, {-0.151191f, 0.316424f, -0.936492f}, + {-0.846678f, 0.355922f, -0.395545f}, {-0.396819f, 0.535445f, -0.745543f}, + {0.780903f, -0.084524f, -0.618907f}, {-0.151191f, 0.316424f, -0.936492f}, + {0.332223f, 0.118859f, -0.935682f}, {0.901109f, 0.387318f, 0.194905f}, + {0.646168f, 0.395237f, -0.652882f}, {-0.015615f, 0.612257f, -0.790504f}, + {0.963918f, -0.104371f, 0.244887f}, {0.757243f, -0.437019f, 0.485384f}, + {0.240729f, 0.183380f, 0.953111f}, {-0.538988f, 0.456125f, 0.708126f}, + {-0.440502f, 0.276883f, 0.853987f}, {0.240729f, 0.183380f, 0.953111f}, + {-0.744455f, 0.394741f, -0.538486f}, {-0.396819f, 0.535445f, -0.745543f}, + {-0.846678f, 0.355922f, -0.395545f}, {-0.333604f, -0.214808f, 0.917914f}, + {-0.800669f, 0.298791f, -0.519281f}, {-0.538988f, 0.456125f, 0.708126f}, + {0.226039f, -0.146424f, 0.963050f}, {-0.800669f, 0.298791f, -0.519281f}, + {-0.333604f, -0.214808f, 0.917914f}, {0.371776f, -0.300019f, 0.878505f}, + {-0.333604f, -0.214808f, 0.917914f}, {0.226039f, -0.146424f, 0.963050f}, + {-0.453499f, -0.702736f, 0.548180f}, {-0.333604f, -0.214808f, 0.917914f}, + {0.371776f, -0.300019f, 0.878505f}, {0.442401f, -0.895907f, -0.040408f}, + {-0.453499f, -0.702736f, 0.548180f}, {0.624067f, -0.719845f, 0.303913f}, + {0.019280f, -0.351952f, 0.935820f}, {-0.333604f, -0.214808f, 0.917914f}, + {0.757243f, -0.437019f, 0.485384f}, {0.757243f, -0.437019f, 0.485384f}, + {-0.333604f, -0.214808f, 0.917914f}, {-0.538988f, 0.456125f, 0.708126f}, + {0.019280f, -0.351952f, 0.935820f}, {0.226039f, -0.146424f, 0.963050f}, + {-0.333604f, -0.214808f, 0.917914f}, {0.371776f, -0.300019f, 0.878505f}, + {0.056592f, 0.684051f, 0.727235f}, {0.624067f, -0.719845f, 0.303913f}, + {-0.453499f, -0.702736f, 0.548180f}, {0.371776f, -0.300019f, 0.878505f}, + {0.624067f, -0.719845f, 0.303913f}, {0.684440f, -0.422099f, 0.594453f}, + {0.226039f, -0.146424f, 0.963050f}, {0.019280f, -0.351952f, 0.935820f}, + {0.546047f, -0.307234f, 0.779384f}, {0.226039f, -0.146424f, 0.963050f}, + {0.684440f, -0.422099f, 0.594453f}, {0.546047f, -0.307234f, 0.779384f}, + {0.371776f, -0.300019f, 0.878505f}, {0.226039f, -0.146424f, 0.963050f}, + {0.056592f, 0.684051f, 0.727235f}, {0.371776f, -0.300019f, 0.878505f}, + {-0.453499f, -0.702736f, 0.548180f}, {0.684440f, -0.422099f, 0.594453f}, + {0.019280f, -0.351952f, 0.935820f}, {0.757243f, -0.437019f, 0.485384f}, + {0.546047f, -0.307234f, 0.779384f}, {0.684440f, -0.422099f, 0.594453f}, + {0.990990f, -0.123953f, 0.050743f}, {0.029983f, -0.232355f, 0.972169f}, + {0.056592f, 0.684051f, 0.727235f}, {0.371776f, -0.300019f, 0.878505f}, + {0.371776f, -0.300019f, 0.878505f}, {0.546047f, -0.307234f, 0.779384f}, + {0.029983f, -0.232355f, 0.972169f}, {-0.697006f, 0.712234f, 0.083096f}, + {0.056592f, 0.684051f, 0.727235f}, {-0.453499f, -0.702736f, 0.548180f}, + {0.056592f, 0.684051f, 0.727235f}, {-0.596428f, 0.792428f, 0.127799f}, + {0.624067f, -0.719845f, 0.303913f}, {0.684440f, -0.422099f, 0.594453f}, + {0.757243f, -0.437019f, 0.485384f}, {0.788748f, -0.614145f, 0.026503f}, + {-0.697006f, 0.712234f, 0.083096f}, {0.371776f, -0.300019f, 0.878505f}, + {0.056592f, 0.684051f, 0.727235f}, {0.371776f, -0.300019f, 0.878505f}, + {-0.697006f, 0.712234f, 0.083096f}, {-0.453499f, -0.702736f, 0.548180f}, + {-0.697006f, 0.712234f, 0.083096f}, {0.056592f, 0.684051f, 0.727235f}, + {-0.243956f, 0.825248f, -0.509364f}, {-0.675257f, 0.519192f, -0.523897f}, + {-0.697006f, 0.712234f, 0.083096f}, {-0.243956f, 0.825248f, -0.509364f}, + {-0.596428f, 0.792428f, 0.127799f}, {0.056592f, 0.684051f, 0.727235f}, + {-0.697006f, 0.712234f, 0.083096f}, {0.471585f, -0.379214f, -0.796118f}, + {0.757243f, -0.437019f, 0.485384f}, {0.332223f, 0.118859f, -0.935682f}, + {0.757243f, -0.437019f, 0.485384f}, {0.471585f, -0.379214f, -0.796118f}, + {0.684440f, -0.422099f, 0.594453f}, {0.332223f, 0.118859f, -0.935682f}, + {-0.063761f, 0.125876f, -0.989995f}, {0.471585f, -0.379214f, -0.796118f}, + {-0.697006f, 0.712234f, 0.083096f}, {-0.675257f, 0.519192f, -0.523897f}, + {-0.662811f, 0.352057f, -0.660861f}, {-0.165552f, 0.135145f, -0.976897f}, + {0.471585f, -0.379214f, -0.796118f}, {-0.063761f, 0.125876f, -0.989995f}, + {0.471585f, -0.379214f, -0.796118f}, {-0.165552f, 0.135145f, -0.976897f}, + {0.310564f, 0.143864f, -0.939603f}, {0.285248f, 0.462213f, -0.839639f}, + {0.310564f, 0.143864f, -0.939603f}, {-0.165552f, 0.135145f, -0.976897f}, + {-0.165552f, 0.135145f, -0.976897f}, {-0.243956f, 0.825248f, -0.509364f}, + {0.285248f, 0.462213f, -0.839639f}, {-0.165552f, 0.135145f, -0.976897f}, + {-0.530630f, 0.554441f, -0.641114f}, {-0.243956f, 0.825248f, -0.509364f}, + {-0.662811f, 0.352057f, -0.660861f}, {-0.675257f, 0.519192f, -0.523897f}, + {-0.530630f, 0.554441f, -0.641114f}, {-0.530630f, 0.554441f, -0.641114f}, + {-0.675257f, 0.519192f, -0.523897f}, {-0.243956f, 0.825248f, -0.509364f}, + {-0.662811f, 0.352057f, -0.660861f}, {-0.453499f, -0.702736f, 0.548180f}, + {-0.697006f, 0.712234f, 0.083096f}, {-0.508446f, 0.276092f, -0.815633f}, + {-0.530630f, 0.554441f, -0.641114f}, {-0.165552f, 0.135145f, -0.976897f}, + {-0.508446f, 0.276092f, -0.815633f}, {-0.662811f, 0.352057f, -0.660861f}, + {-0.530630f, 0.554441f, -0.641114f}, {-0.396819f, 0.535445f, -0.745543f}, + {-0.524475f, 0.203183f, -0.826827f}, {0.332223f, 0.118859f, -0.935682f}, + {-0.063761f, 0.125876f, -0.989995f}, {0.332223f, 0.118859f, -0.935682f}, + {-0.524475f, 0.203183f, -0.826827f}, {0.481896f, 0.685829f, -0.545358f}, + {-0.453499f, -0.702736f, 0.548180f}, {-0.662811f, 0.352057f, -0.660861f}, + {-0.453499f, -0.702736f, 0.548180f}, {-0.596428f, 0.792428f, 0.127799f}, + {-0.697006f, 0.712234f, 0.083096f}, {0.481896f, 0.685829f, -0.545358f}, + {-0.697006f, 0.712234f, 0.083096f}, {-0.453499f, -0.702736f, 0.548180f}, + {-0.662811f, 0.352057f, -0.660861f}, {-0.063761f, 0.125876f, -0.989995f}, + {-0.524475f, 0.203183f, -0.826827f}, {-0.063761f, 0.125876f, -0.989995f}, + {-0.662811f, 0.352057f, -0.660861f}, {-0.165552f, 0.135145f, -0.976897f}, + {-0.662811f, 0.352057f, -0.660861f}, {-0.508446f, 0.276092f, -0.815633f}, + {-0.165552f, 0.135145f, -0.976897f}, {-0.524475f, 0.203183f, -0.826827f}, + {-0.396819f, 0.535445f, -0.745543f}, {-0.538988f, 0.456125f, 0.708126f}, + {-0.524475f, 0.203183f, -0.826827f}, {-0.538988f, 0.456125f, 0.708126f}, + {-0.800669f, 0.298791f, -0.519281f}, {-0.662811f, 0.352057f, -0.660861f}, + {-0.524475f, 0.203183f, -0.826827f}, {-0.800669f, 0.298791f, -0.519281f}, + {-0.453499f, -0.702736f, 0.548180f}, {0.442401f, -0.895907f, -0.040408f}, + {-0.596428f, 0.792428f, 0.127799f}, {-0.684218f, 0.672334f, -0.282511f}, + {-0.800669f, 0.298791f, -0.519281f}, {-0.538988f, 0.456125f, 0.708126f}, + {-0.333604f, -0.214808f, 0.917914f}, {-0.453499f, -0.702736f, 0.548180f}, + {-0.800669f, 0.298791f, -0.519281f}, {-0.453499f, -0.702736f, 0.548180f}, + {-0.662811f, 0.352057f, -0.660861f}, {-0.800669f, 0.298791f, -0.519281f}, + {0.442401f, -0.895907f, -0.040408f}, {0.624067f, -0.719845f, 0.303913f}, + {-0.596428f, 0.792428f, 0.127799f}, {0.963918f, -0.104371f, 0.244887f}, + {0.780903f, -0.084524f, -0.618907f}, {0.757243f, -0.437019f, 0.485384f}, + {-0.396819f, 0.535445f, -0.745543f}, {-0.684218f, 0.672334f, -0.282511f}, + {-0.538988f, 0.456125f, 0.708126f}, {0.896895f, 0.289706f, -0.334140f}, + {0.029983f, -0.232355f, 0.972169f}, {0.546047f, -0.307234f, 0.779384f}, + {0.546047f, -0.307234f, 0.779384f}, {0.990990f, -0.123953f, 0.050743f}, + {0.896895f, 0.289706f, -0.334140f}, {0.332223f, 0.118859f, -0.935682f}, + {0.757243f, -0.437019f, 0.485384f}, {0.780903f, -0.084524f, -0.618907f}, + {0.990990f, -0.123953f, 0.050743f}, {0.310564f, 0.143864f, -0.939603f}, + {0.896895f, 0.289706f, -0.334140f}, {0.310564f, 0.143864f, -0.939603f}, + {0.285248f, 0.462213f, -0.839639f}, {0.896895f, 0.289706f, -0.334140f}, + {0.285248f, 0.462213f, -0.839639f}, {-0.243956f, 0.825248f, -0.509364f}, + {0.896895f, 0.289706f, -0.334140f}, {0.896895f, 0.289706f, -0.334140f}, + {-0.243956f, 0.825248f, -0.509364f}, {0.056592f, 0.684051f, 0.727235f}, + {0.896895f, 0.289706f, -0.334140f}, {0.056592f, 0.684051f, 0.727235f}, + {0.029983f, -0.232355f, 0.972169f}, {-0.243956f, 0.825248f, -0.509364f}, + {-0.492137f, -0.058279f, 0.868565f}, {-0.330693f, 0.784698f, -0.524301f}, + {0.056592f, 0.684051f, 0.727235f}, {-0.492137f, -0.058279f, 0.868565f}, + {-0.243956f, 0.825248f, -0.509364f}, {0.780180f, 0.494981f, 0.382509f}, + {-0.508722f, -0.782644f, 0.358705f}, {0.391596f, 0.719198f, -0.573939f}, + {-0.508722f, -0.782644f, 0.358705f}, {0.780180f, 0.494981f, 0.382509f}, + {0.110626f, -0.629172f, 0.769353f}, {-0.276021f, 0.641848f, -0.715433f}, + {0.780180f, 0.494981f, 0.382509f}, {0.391596f, 0.719198f, -0.573939f}, + {-0.458589f, 0.150160f, 0.875870f}, {0.780180f, 0.494981f, 0.382509f}, + {-0.276021f, 0.641848f, -0.715433f}, {-0.458589f, 0.150160f, 0.875870f}, + {0.110626f, -0.629172f, 0.769353f}, {0.780180f, 0.494981f, 0.382509f}, + {-0.276021f, 0.641848f, -0.715433f}, {0.391596f, 0.719198f, -0.573939f}, + {-0.508722f, -0.782644f, 0.358705f}, {0.029983f, -0.232355f, 0.972169f}, + {0.110626f, -0.629172f, 0.769353f}, {-0.458589f, 0.150160f, 0.875870f}, + {0.896895f, 0.289706f, -0.334140f}, {-0.276021f, 0.641848f, -0.715433f}, + {-0.508722f, -0.782644f, 0.358705f}, {-0.276021f, 0.641848f, -0.715433f}, + {0.896895f, 0.289706f, -0.334140f}, {-0.458589f, 0.150160f, 0.875870f}, + {0.029983f, -0.232355f, 0.972169f}, {-0.458589f, 0.150160f, 0.875870f}, + {0.896895f, 0.289706f, -0.334140f}, {0.896895f, 0.289706f, -0.334140f}, + {0.110626f, -0.629172f, 0.769353f}, {0.029983f, -0.232355f, 0.972169f}, + {0.110626f, -0.629172f, 0.769353f}, {0.896895f, 0.289706f, -0.334140f}, + {-0.508722f, -0.782644f, 0.358705f}, {0.029983f, -0.232355f, 0.972169f}, + {-0.458589f, 0.150160f, 0.875870f}, {-0.492137f, -0.058279f, 0.868565f}, + {-0.330693f, 0.784698f, -0.524301f}, {-0.458589f, 0.150160f, 0.875870f}, + {-0.276021f, 0.641848f, -0.715433f}, {-0.492137f, -0.058279f, 0.868565f}, + {-0.458589f, 0.150160f, 0.875870f}, {-0.330693f, 0.784698f, -0.524301f}, + {-0.492137f, -0.058279f, 0.868565f}, {0.056592f, 0.684051f, 0.727235f}, + {0.029983f, -0.232355f, 0.972169f}, {-0.243956f, 0.825248f, -0.509364f}, + {-0.330693f, 0.784698f, -0.524301f}, {-0.276021f, 0.641848f, -0.715433f}, + {-0.276021f, 0.641848f, -0.715433f}, {0.896895f, 0.289706f, -0.334140f}, + {-0.243956f, 0.825248f, -0.509364f}, {0.684440f, -0.422099f, 0.594453f}, + {-0.832833f, 0.419088f, 0.361599f}, {-0.310490f, -0.158720f, 0.937232f}, + {-0.310490f, -0.158720f, 0.937232f}, {0.990990f, -0.123953f, 0.050743f}, + {0.684440f, -0.422099f, 0.594453f}, {0.471585f, -0.379214f, -0.796118f}, + {0.990990f, -0.123953f, 0.050743f}, {0.684440f, -0.422099f, 0.594453f}, + {0.471585f, -0.379214f, -0.796118f}, {0.310564f, 0.143864f, -0.939603f}, + {0.990990f, -0.123953f, 0.050743f}, {-0.508722f, -0.782644f, 0.358705f}, + {0.110626f, -0.629172f, 0.769353f}, {-0.310490f, -0.158720f, 0.937232f}, + {-0.310490f, -0.158720f, 0.937232f}, {0.110626f, -0.629172f, 0.769353f}, + {-0.999665f, -0.016924f, 0.019604f}, {-0.310490f, -0.158720f, 0.937232f}, + {-0.999665f, -0.016924f, 0.019604f}, {-0.508722f, -0.782644f, 0.358705f}, + {-0.508722f, -0.782644f, 0.358705f}, {-0.999665f, -0.016924f, 0.019604f}, + {0.110626f, -0.629172f, 0.769353f}, {0.978822f, 0.189139f, 0.078319f}, + {0.799601f, 0.586555f, -0.128808f}, {0.978935f, 0.057892f, -0.195791f}, + {0.895721f, 0.419400f, -0.147605f}, {0.978935f, 0.057892f, -0.195791f}, + {0.799601f, 0.586555f, -0.128808f}, {0.895721f, 0.419400f, -0.147605f}, + {0.909502f, 0.114469f, -0.399629f}, {0.978935f, 0.057892f, -0.195791f}, + {0.896953f, -0.202900f, -0.392819f}, {0.978822f, 0.189139f, 0.078319f}, + {0.978935f, 0.057892f, -0.195791f}, {0.909502f, 0.114469f, -0.399629f}, + {0.896953f, -0.202900f, -0.392819f}, {0.978935f, 0.057892f, -0.195791f}, + {0.684765f, -0.276304f, -0.674354f}, {0.896953f, -0.202900f, -0.392819f}, + {0.909502f, 0.114469f, -0.399629f}, {0.315234f, 0.307499f, -0.897815f}, + {0.376178f, 0.063480f, -0.924370f}, {0.896953f, -0.202900f, -0.392819f}, + {0.896953f, -0.202900f, -0.392819f}, {0.376178f, 0.063480f, -0.924370f}, + {0.978822f, 0.189139f, 0.078319f}, {0.705586f, 0.025699f, -0.708158f}, + {0.684765f, -0.276304f, -0.674354f}, {0.909502f, 0.114469f, -0.399629f}, + {0.365018f, -0.102094f, -0.925386f}, {0.315234f, 0.307499f, -0.897815f}, + {0.896953f, -0.202900f, -0.392819f}, {0.396845f, -0.326687f, -0.857782f}, + {0.365018f, -0.102094f, -0.925386f}, {0.684765f, -0.276304f, -0.674354f}, + {0.684765f, -0.276304f, -0.674354f}, {0.365018f, -0.102094f, -0.925386f}, + {0.896953f, -0.202900f, -0.392819f}, {0.560179f, -0.208414f, -0.801725f}, + {0.684765f, -0.276304f, -0.674354f}, {0.705586f, 0.025699f, -0.708158f}, + {0.684765f, -0.276304f, -0.674354f}, {0.560179f, -0.208414f, -0.801725f}, + {0.396845f, -0.326687f, -0.857782f}, {0.365018f, -0.102094f, -0.925386f}, + {-0.347096f, 0.445740f, -0.825130f}, {0.315234f, 0.307499f, -0.897815f}, + {0.315234f, 0.307499f, -0.897815f}, {-0.347096f, 0.445740f, -0.825130f}, + {0.376178f, 0.063480f, -0.924370f}, {0.395088f, -0.199017f, -0.896827f}, + {0.396845f, -0.326687f, -0.857782f}, {0.560179f, -0.208414f, -0.801725f}, + {0.112749f, -0.256784f, -0.959870f}, {0.365018f, -0.102094f, -0.925386f}, + {0.396845f, -0.326687f, -0.857782f}, {0.204648f, -0.217000f, -0.954479f}, + {0.396845f, -0.326687f, -0.857782f}, {0.395088f, -0.199017f, -0.896827f}, + {0.396845f, -0.326687f, -0.857782f}, {0.204648f, -0.217000f, -0.954479f}, + {0.112749f, -0.256784f, -0.959870f}, {-0.118976f, -0.078121f, -0.989819f}, + {-0.347096f, 0.445740f, -0.825130f}, {0.365018f, -0.102094f, -0.925386f}, + {0.365018f, -0.102094f, -0.925386f}, {0.112749f, -0.256784f, -0.959870f}, + {-0.118976f, -0.078121f, -0.989819f}, {-0.006045f, -0.084607f, -0.996396f}, + {0.112749f, -0.256784f, -0.959870f}, {0.204648f, -0.217000f, -0.954479f}, + {-0.006045f, -0.084607f, -0.996396f}, {-0.118976f, -0.078121f, -0.989819f}, + {0.112749f, -0.256784f, -0.959870f}, {-0.370925f, 0.185437f, -0.909960f}, + {-0.347096f, 0.445740f, -0.825130f}, {-0.118976f, -0.078121f, -0.989819f}, + {-0.370925f, 0.185437f, -0.909960f}, {-0.118976f, -0.078121f, -0.989819f}, + {-0.006045f, -0.084607f, -0.996396f}, {-0.602262f, 0.541713f, -0.586369f}, + {-0.347096f, 0.445740f, -0.825130f}, {-0.370925f, 0.185437f, -0.909960f}, + {0.000501f, 0.173705f, -0.984798f}, {-0.370925f, 0.185437f, -0.909960f}, + {-0.006045f, -0.084607f, -0.996396f}, {-0.370925f, 0.185437f, -0.909960f}, + {0.000501f, 0.173705f, -0.984798f}, {-0.172056f, 0.421403f, -0.890402f}, + {-0.175008f, 0.794447f, -0.581572f}, {-0.347096f, 0.445740f, -0.825130f}, + {-0.602262f, 0.541713f, -0.586369f}, {-0.347096f, 0.445740f, -0.825130f}, + {-0.175008f, 0.794447f, -0.581572f}, {-0.469991f, 0.877912f, 0.091534f}, + {-0.520696f, 0.528607f, -0.670410f}, {-0.602262f, 0.541713f, -0.586369f}, + {-0.370925f, 0.185437f, -0.909960f}, {-0.602262f, 0.541713f, -0.586369f}, + {-0.520696f, 0.528607f, -0.670410f}, {-0.175008f, 0.794447f, -0.581572f}, + {-0.520696f, 0.528607f, -0.670410f}, {-0.172056f, 0.421403f, -0.890402f}, + {0.018296f, 0.623996f, -0.781214f}, {-0.370925f, 0.185437f, -0.909960f}, + {-0.172056f, 0.421403f, -0.890402f}, {-0.520696f, 0.528607f, -0.670410f}, + {-0.520696f, 0.528607f, -0.670410f}, {0.018296f, 0.623996f, -0.781214f}, + {-0.175008f, 0.794447f, -0.581572f}, {0.271568f, 0.608361f, -0.745753f}, + {-0.175008f, 0.794447f, -0.581572f}, {0.018296f, 0.623996f, -0.781214f}, + {-0.175008f, 0.794447f, -0.581572f}, {-0.001691f, 0.910378f, -0.413774f}, + {-0.469991f, 0.877912f, 0.091534f}, {0.978822f, 0.189139f, 0.078319f}, + {0.389407f, 0.917268f, -0.083558f}, {0.799601f, 0.586555f, -0.128808f}, + {-0.469991f, 0.877912f, 0.091534f}, {0.389407f, 0.917268f, -0.083558f}, + {0.978822f, 0.189139f, 0.078319f}, {-0.771662f, 0.222797f, -0.595735f}, + {-0.469991f, 0.877912f, 0.091534f}, {-0.609520f, 0.157193f, 0.777030f}, + {0.093003f, 0.009710f, -0.995618f}, {-0.006045f, -0.084607f, -0.996396f}, + {0.154202f, -0.039256f, -0.987259f}, {0.154202f, -0.039256f, -0.987259f}, + {0.204648f, -0.217000f, -0.954479f}, {0.234090f, -0.070518f, -0.969654f}, + {0.234090f, -0.070518f, -0.969654f}, {0.395088f, -0.199017f, -0.896827f}, + {0.424145f, -0.020815f, -0.905355f}, {0.424145f, -0.020815f, -0.905355f}, + {0.395088f, -0.199017f, -0.896827f}, {0.552213f, -0.032889f, -0.833054f}, + {0.552213f, -0.032889f, -0.833054f}, {0.560179f, -0.208414f, -0.801725f}, + {0.705586f, 0.025699f, -0.708158f}, {0.705586f, 0.025699f, -0.708158f}, + {0.909502f, 0.114469f, -0.399629f}, {0.781353f, 0.225266f, -0.582016f}, + {0.781353f, 0.225266f, -0.582016f}, {0.909502f, 0.114469f, -0.399629f}, + {0.894765f, 0.304007f, -0.327071f}, {0.895721f, 0.419400f, -0.147605f}, + {0.894765f, 0.304007f, -0.327071f}, {0.909502f, 0.114469f, -0.399629f}, + {0.560179f, -0.208414f, -0.801725f}, {0.552213f, -0.032889f, -0.833054f}, + {0.395088f, -0.199017f, -0.896827f}, {0.395088f, -0.199017f, -0.896827f}, + {0.234090f, -0.070518f, -0.969654f}, {0.204648f, -0.217000f, -0.954479f}, + {0.204648f, -0.217000f, -0.954479f}, {0.154202f, -0.039256f, -0.987259f}, + {-0.006045f, -0.084607f, -0.996396f}, {-0.006045f, -0.084607f, -0.996396f}, + {0.093003f, 0.009710f, -0.995618f}, {0.000501f, 0.173705f, -0.984798f}, + {-0.469991f, 0.877912f, 0.091534f}, {-0.771662f, 0.222797f, -0.595735f}, + {-0.347096f, 0.445740f, -0.825130f}, {-0.476862f, -0.418624f, 0.772889f}, + {0.282688f, -0.869536f, -0.404962f}, {0.090842f, -0.706426f, 0.701933f}, + {0.925951f, -0.365651f, -0.094413f}, {0.090842f, -0.706426f, 0.701933f}, + {0.282688f, -0.869536f, -0.404962f}, {0.951249f, -0.066067f, -0.301265f}, + {0.353325f, 0.570819f, 0.741166f}, {0.925951f, -0.365651f, -0.094413f}, + {0.925951f, -0.365651f, -0.094413f}, {0.353325f, 0.570819f, 0.741166f}, + {0.090842f, -0.706426f, 0.701933f}, {0.353325f, 0.570819f, 0.741166f}, + {0.951249f, -0.066067f, -0.301265f}, {0.894661f, -0.378257f, 0.237706f}, + {0.824487f, -0.425770f, 0.372749f}, {0.894661f, -0.378257f, 0.237706f}, + {0.951249f, -0.066067f, -0.301265f}, {0.170181f, 0.328361f, -0.929095f}, + {0.028694f, -0.784460f, 0.619515f}, {0.549144f, -0.113573f, -0.827975f}, + {0.282688f, -0.869536f, -0.404962f}, {0.028694f, -0.784460f, 0.619515f}, + {0.170181f, 0.328361f, -0.929095f}, {0.170181f, 0.328361f, -0.929095f}, + {0.673077f, -0.041174f, -0.738425f}, {0.282688f, -0.869536f, -0.404962f}, + {0.224894f, 0.876939f, -0.424736f}, {0.282688f, -0.869536f, -0.404962f}, + {0.673077f, -0.041174f, -0.738425f}, {-0.313396f, 0.513795f, -0.798622f}, + {0.549144f, -0.113573f, -0.827975f}, {-0.771662f, 0.222797f, -0.595735f}, + {0.549144f, -0.113573f, -0.827975f}, {-0.313396f, 0.513795f, -0.798622f}, + {0.170181f, 0.328361f, -0.929095f}, {0.170181f, 0.328361f, -0.929095f}, + {0.224894f, 0.876939f, -0.424736f}, {0.673077f, -0.041174f, -0.738425f}, + {0.224894f, 0.876939f, -0.424736f}, {0.951249f, -0.066067f, -0.301265f}, + {0.282688f, -0.869536f, -0.404962f}, {0.951249f, -0.066067f, -0.301265f}, + {0.925951f, -0.365651f, -0.094413f}, {0.282688f, -0.869536f, -0.404962f}, + {0.224894f, 0.876939f, -0.424736f}, {0.170181f, 0.328361f, -0.929095f}, + {-0.466786f, 0.614812f, 0.635702f}, {0.170181f, 0.328361f, -0.929095f}, + {-0.313396f, 0.513795f, -0.798622f}, {-0.616242f, 0.611902f, 0.495804f}, + {-0.616242f, 0.611902f, 0.495804f}, {-0.466786f, 0.614812f, 0.635702f}, + {0.170181f, 0.328361f, -0.929095f}, {-0.525886f, 0.559638f, 0.640506f}, + {0.353325f, 0.570819f, 0.741166f}, {0.224894f, 0.876939f, -0.424736f}, + {0.353325f, 0.570819f, 0.741166f}, {0.951249f, -0.066067f, -0.301265f}, + {0.224894f, 0.876939f, -0.424736f}, {-0.616242f, 0.611902f, 0.495804f}, + {-0.771662f, 0.222797f, -0.595735f}, {-0.609520f, 0.157193f, 0.777030f}, + {-0.771662f, 0.222797f, -0.595735f}, {-0.616242f, 0.611902f, 0.495804f}, + {-0.313396f, 0.513795f, -0.798622f}, {-0.525886f, 0.559638f, 0.640506f}, + {0.224894f, 0.876939f, -0.424736f}, {-0.466786f, 0.614812f, 0.635702f}, + {0.353325f, 0.570819f, 0.741166f}, {-0.525886f, 0.559638f, 0.640506f}, + {-0.476862f, -0.418624f, 0.772889f}, {-0.466786f, 0.614812f, 0.635702f}, + {-0.476862f, -0.418624f, 0.772889f}, {-0.525886f, 0.559638f, 0.640506f}, + {-0.476862f, -0.418624f, 0.772889f}, {0.090842f, -0.706426f, 0.701933f}, + {0.353325f, 0.570819f, 0.741166f}, {-0.466786f, 0.614812f, 0.635702f}, + {-0.616242f, 0.611902f, 0.495804f}, {0.028694f, -0.784460f, 0.619515f}, + {-0.609520f, 0.157193f, 0.777030f}, {0.028694f, -0.784460f, 0.619515f}, + {-0.616242f, 0.611902f, 0.495804f}, {0.282688f, -0.869536f, -0.404962f}, + {-0.476862f, -0.418624f, 0.772889f}, {0.028694f, -0.784460f, 0.619515f}, + {0.028694f, -0.784460f, 0.619515f}, {-0.476862f, -0.418624f, 0.772889f}, + {-0.466786f, 0.614812f, 0.635702f}, {-0.469991f, 0.877912f, 0.091534f}, + {0.978822f, 0.189139f, 0.078319f}, {-0.609520f, 0.157193f, 0.777030f}, + {0.978822f, 0.189139f, 0.078319f}, {0.376178f, 0.063480f, -0.924370f}, + {0.549144f, -0.113573f, -0.827975f}, {0.376178f, 0.063480f, -0.924370f}, + {-0.347096f, 0.445740f, -0.825130f}, {-0.771662f, 0.222797f, -0.595735f}, + {0.028694f, -0.784460f, 0.619515f}, {-0.609520f, 0.157193f, 0.777030f}, + {0.978822f, 0.189139f, 0.078319f}, {0.549144f, -0.113573f, -0.827975f}, + {0.028694f, -0.784460f, 0.619515f}, {0.978822f, 0.189139f, 0.078319f}, + {-0.771662f, 0.222797f, -0.595735f}, {0.549144f, -0.113573f, -0.827975f}, + {0.376178f, 0.063480f, -0.924370f}}; GLfloat child_vertices[6153][3] = { -{-0.810726f,0.143830f,-0.062953f}, -{-0.824779f,0.142876f,0.066613f}, -{-0.909153f,0.230021f,0.038237f}, -{-0.824779f,0.142876f,0.066613f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.763976f,0.075361f,-0.011269f}, -{-0.763976f,0.075361f,-0.011269f}, -{-0.766739f,0.070280f,0.015291f}, -{-0.824779f,0.142876f,0.066613f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.766739f,0.070280f,0.015291f}, -{-0.763976f,0.075361f,-0.011269f}, -{-0.766739f,0.070280f,0.015291f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.685581f,-0.007301f,0.011902f}, -{-0.613969f,-0.075783f,-0.022107f}, -{-0.685581f,-0.007301f,0.011902f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.685581f,-0.007301f,0.011902f}, -{-0.613969f,-0.075783f,-0.022107f}, -{-0.620262f,-0.088090f,0.011132f}, -{-0.570308f,-0.166966f,-0.034320f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.620262f,-0.088090f,0.011132f}, -{-0.620262f,-0.088090f,0.011132f}, -{-0.613969f,-0.075783f,-0.022107f}, -{-0.570308f,-0.166966f,-0.034320f}, -{-0.560206f,-0.219211f,-0.041656f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.570308f,-0.166966f,-0.034320f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.560206f,-0.219211f,-0.041656f}, -{-0.568154f,-0.237707f,0.011206f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.763976f,0.075361f,-0.011269f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.599417f,-0.052334f,-0.058643f}, -{-0.613969f,-0.075783f,-0.022107f}, -{-0.553026f,-0.132014f,-0.074772f}, -{-0.613969f,-0.075783f,-0.022107f}, -{-0.599417f,-0.052334f,-0.058643f}, -{-0.613969f,-0.075783f,-0.022107f}, -{-0.553026f,-0.132014f,-0.074772f}, -{-0.570308f,-0.166966f,-0.034320f}, -{-0.579028f,-0.029826f,-0.085716f}, -{-0.599417f,-0.052334f,-0.058643f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.529673f,-0.093704f,-0.102418f}, -{-0.599417f,-0.052334f,-0.058643f}, -{-0.579028f,-0.029826f,-0.085716f}, -{-0.599417f,-0.052334f,-0.058643f}, -{-0.529673f,-0.093704f,-0.102418f}, -{-0.553026f,-0.132014f,-0.074772f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.763976f,0.075361f,-0.011269f}, -{-0.730243f,0.143489f,-0.120320f}, -{-0.730243f,0.143489f,-0.120320f}, -{-0.763976f,0.075361f,-0.011269f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.498736f,-0.059239f,-0.121040f}, -{-0.579028f,-0.029826f,-0.085716f}, -{-0.569195f,0.047207f,-0.105737f}, -{-0.569195f,0.047207f,-0.105737f}, -{-0.579028f,-0.029826f,-0.085716f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.498736f,-0.059239f,-0.121040f}, -{-0.529673f,-0.093704f,-0.102418f}, -{-0.579028f,-0.029826f,-0.085716f}, -{-0.443061f,-0.008344f,-0.121911f}, -{-0.434308f,-0.049440f,-0.141814f}, -{-0.498736f,-0.059239f,-0.121040f}, -{-0.498736f,-0.059239f,-0.121040f}, -{-0.569195f,0.047207f,-0.105737f}, -{-0.443061f,-0.008344f,-0.121911f}, -{-0.392288f,-0.021238f,-0.122528f}, -{-0.434308f,-0.049440f,-0.141814f}, -{-0.443061f,-0.008344f,-0.121911f}, -{-0.450839f,0.043866f,-0.092489f}, -{-0.443061f,-0.008344f,-0.121911f}, -{-0.569195f,0.047207f,-0.105737f}, -{-0.392288f,-0.021238f,-0.122528f}, -{-0.443061f,-0.008344f,-0.121911f}, -{-0.450839f,0.043866f,-0.092489f}, -{-0.416822f,-0.064653f,-0.153867f}, -{-0.434308f,-0.049440f,-0.141814f}, -{-0.392288f,-0.021238f,-0.122528f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.392288f,-0.021238f,-0.122528f}, -{-0.368997f,-0.010198f,-0.052637f}, -{-0.368997f,-0.010198f,-0.052637f}, -{-0.392288f,-0.021238f,-0.122528f}, -{-0.450839f,0.043866f,-0.092489f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.287041f,-0.058157f,-0.051717f}, -{-0.311455f,-0.045609f,-0.117366f}, -{-0.311455f,-0.045609f,-0.117366f}, -{-0.392288f,-0.021238f,-0.122528f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.450839f,0.043866f,-0.092489f}, -{-0.270557f,0.066073f,-0.108951f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.368997f,-0.010198f,-0.052637f}, -{-0.450839f,0.043866f,-0.092489f}, -{-0.315943f,-0.010941f,0.022180f}, -{-0.263859f,-0.064473f,0.041852f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.252851f,-0.067050f,0.043792f}, -{-0.287041f,-0.058157f,-0.051717f}, -{-0.263859f,-0.064473f,0.041852f}, -{-0.287041f,-0.058157f,-0.051717f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.263859f,-0.064473f,0.041852f}, -{-0.315943f,-0.010941f,0.022180f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.281354f,0.026363f,0.040343f}, -{-0.281354f,0.026363f,0.040343f}, -{-0.356137f,-0.022271f,-0.050570f}, -{-0.270557f,0.066073f,-0.108951f}, -{-0.315943f,-0.010941f,0.022180f}, -{-0.351919f,-0.024601f,0.107836f}, -{-0.263859f,-0.064473f,0.041852f}, -{-0.351919f,-0.024601f,0.107836f}, -{-0.258619f,-0.061028f,0.084698f}, -{-0.263859f,-0.064473f,0.041852f}, -{-0.263859f,-0.064473f,0.041852f}, -{-0.258619f,-0.061028f,0.084698f}, -{-0.252851f,-0.067050f,0.043792f}, -{-0.281354f,0.026363f,0.040343f}, -{-0.475109f,0.019966f,0.128767f}, -{-0.315943f,-0.010941f,0.022180f}, -{-0.315943f,-0.010941f,0.022180f}, -{-0.475109f,0.019966f,0.128767f}, -{-0.377767f,-0.006200f,0.098291f}, -{-0.377767f,-0.006200f,0.098291f}, -{-0.351919f,-0.024601f,0.107836f}, -{-0.315943f,-0.010941f,0.022180f}, -{-0.377767f,-0.006200f,0.098291f}, -{-0.475109f,0.019966f,0.128767f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.351919f,-0.024601f,0.107836f}, -{-0.377767f,-0.006200f,0.098291f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.351919f,-0.024601f,0.107836f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.381471f,-0.048737f,0.171259f}, -{-0.565198f,0.021489f,0.127682f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.475109f,0.019966f,0.128767f}, -{-0.485471f,-0.061573f,0.150521f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.475109f,0.019966f,0.128767f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.485471f,-0.061573f,0.150521f}, -{-0.381471f,-0.048737f,0.171259f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.630007f,0.094660f,0.132972f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.565198f,0.021489f,0.127682f}, -{-0.520765f,-0.017238f,0.136983f}, -{-0.485471f,-0.061573f,0.150521f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.565198f,0.021489f,0.127682f}, -{-0.520765f,-0.017238f,0.136983f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.630007f,0.094660f,0.132972f}, -{-0.726777f,0.165369f,0.156838f}, -{-0.603672f,-0.060984f,0.087429f}, -{-0.565198f,0.021489f,0.127682f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.565198f,0.021489f,0.127682f}, -{-0.603672f,-0.060984f,0.087429f}, -{-0.520765f,-0.017238f,0.136983f}, -{-0.525348f,-0.098759f,0.129554f}, -{-0.520765f,-0.017238f,0.136983f}, -{-0.603672f,-0.060984f,0.087429f}, -{-0.520765f,-0.017238f,0.136983f}, -{-0.525348f,-0.098759f,0.129554f}, -{-0.485471f,-0.061573f,0.150521f}, -{-0.766739f,0.070280f,0.015291f}, -{-0.815154f,0.196699f,0.134399f}, -{-0.824779f,0.142876f,0.066613f}, -{-0.815154f,0.196699f,0.134399f}, -{-0.766739f,0.070280f,0.015291f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.726777f,0.165369f,0.156838f}, -{-0.815154f,0.196699f,0.134399f}, -{-0.556125f,-0.136236f,0.101263f}, -{-0.525348f,-0.098759f,0.129554f}, -{-0.603672f,-0.060984f,0.087429f}, -{-0.683554f,-0.002336f,0.045803f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.766739f,0.070280f,0.015291f}, -{-0.618036f,-0.079248f,0.052331f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.683554f,-0.002336f,0.045803f}, -{-0.728176f,0.068044f,0.083828f}, -{-0.618036f,-0.079248f,0.052331f}, -{-0.603672f,-0.060984f,0.087429f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.556125f,-0.136236f,0.101263f}, -{-0.618036f,-0.079248f,0.052331f}, -{-0.618036f,-0.079248f,0.052331f}, -{-0.556125f,-0.136236f,0.101263f}, -{-0.603672f,-0.060984f,0.087429f}, -{-0.766739f,0.070280f,0.015291f}, -{-0.685581f,-0.007301f,0.011902f}, -{-0.683554f,-0.002336f,0.045803f}, -{-0.620262f,-0.088090f,0.011132f}, -{-0.618036f,-0.079248f,0.052331f}, -{-0.685581f,-0.007301f,0.011902f}, -{-0.685581f,-0.007301f,0.011902f}, -{-0.618036f,-0.079248f,0.052331f}, -{-0.683554f,-0.002336f,0.045803f}, -{-0.618036f,-0.079248f,0.052331f}, -{-0.620262f,-0.088090f,0.011132f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.568154f,-0.237707f,0.011206f}, -{-0.560344f,-0.218030f,0.069971f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.600774f,0.120701f,-0.133308f}, -{-0.569195f,0.047207f,-0.105737f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.726777f,0.165369f,0.156838f}, -{-0.630007f,0.094660f,0.132972f}, -{-0.561506f,-0.286111f,0.048810f}, -{-0.554011f,-0.266026f,0.081342f}, -{-0.560344f,-0.218030f,0.069971f}, -{-0.554011f,-0.266026f,0.081342f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.496944f,-0.145170f,0.157557f}, -{-0.525348f,-0.098759f,0.129554f}, -{-0.496944f,-0.145170f,0.157557f}, -{-0.447572f,-0.087580f,0.174226f}, -{-0.485471f,-0.061573f,0.150521f}, -{-0.447572f,-0.087580f,0.174226f}, -{-0.381471f,-0.048737f,0.171259f}, -{-0.485471f,-0.061573f,0.150521f}, -{-0.345111f,-0.042992f,0.158522f}, -{-0.258619f,-0.061028f,0.084698f}, -{-0.351919f,-0.024601f,0.107836f}, -{-0.311455f,-0.045609f,-0.117366f}, -{-0.345446f,-0.043039f,-0.136387f}, -{-0.392288f,-0.021238f,-0.122528f}, -{-0.416822f,-0.064653f,-0.153867f}, -{-0.448058f,-0.087913f,-0.151966f}, -{-0.434308f,-0.049440f,-0.141814f}, -{-0.448058f,-0.087913f,-0.151966f}, -{-0.497145f,-0.145443f,-0.135271f}, -{-0.498736f,-0.059239f,-0.121040f}, -{-0.497145f,-0.145443f,-0.135271f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.529673f,-0.093704f,-0.102418f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.554298f,-0.266533f,-0.059249f}, -{-0.570308f,-0.166966f,-0.034320f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.909153f,0.230021f,0.038237f}, -{-0.913709f,0.248567f,-0.048017f}, -{-0.568154f,-0.237707f,0.011206f}, -{-0.560206f,-0.219211f,-0.041656f}, -{-0.554298f,-0.266533f,-0.059249f}, -{-0.560206f,-0.219211f,-0.041656f}, -{-0.570308f,-0.166966f,-0.034320f}, -{-0.554298f,-0.266533f,-0.059249f}, -{-0.570308f,-0.166966f,-0.034320f}, -{-0.553026f,-0.132014f,-0.074772f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.553026f,-0.132014f,-0.074772f}, -{-0.529673f,-0.093704f,-0.102418f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.730243f,0.143489f,-0.120320f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.529673f,-0.093704f,-0.102418f}, -{-0.498736f,-0.059239f,-0.121040f}, -{-0.497145f,-0.145443f,-0.135271f}, -{-0.569195f,0.047207f,-0.105737f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.660314f,0.072532f,-0.096358f}, -{-0.730243f,0.143489f,-0.120320f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.498736f,-0.059239f,-0.121040f}, -{-0.434308f,-0.049440f,-0.141814f}, -{-0.448058f,-0.087913f,-0.151966f}, -{-0.416822f,-0.064653f,-0.153867f}, -{-0.392288f,-0.021238f,-0.122528f}, -{-0.345446f,-0.043039f,-0.136387f}, -{-0.311455f,-0.045609f,-0.117366f}, -{-0.287041f,-0.058157f,-0.051717f}, -{-0.281868f,-0.052914f,-0.093357f}, -{-0.351919f,-0.024601f,0.107836f}, -{-0.381471f,-0.048737f,0.171259f}, -{-0.345111f,-0.042992f,0.158522f}, -{-0.485471f,-0.061573f,0.150521f}, -{-0.525348f,-0.098759f,0.129554f}, -{-0.496944f,-0.145170f,0.157557f}, -{-0.525348f,-0.098759f,0.129554f}, -{-0.556125f,-0.136236f,0.101263f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.556125f,-0.136236f,0.101263f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.560344f,-0.218030f,0.069971f}, -{-0.568154f,-0.237707f,0.011206f}, -{-0.561506f,-0.286111f,0.048810f}, -{-0.572362f,-0.168127f,0.063372f}, -{-0.560344f,-0.218030f,0.069971f}, -{-0.554011f,-0.266026f,0.081342f}, -{-0.252851f,-0.067050f,0.043792f}, -{-0.243884f,-0.066668f,-0.027679f}, -{-0.287041f,-0.058157f,-0.051717f}, -{-0.099865f,0.138177f,-0.122074f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.082858f,0.051277f,-0.052142f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.082858f,0.051277f,-0.052142f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.075137f,0.034598f,0.018860f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.082858f,0.051277f,-0.052142f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.172313f,0.089176f,0.156758f}, -{-0.075137f,0.034598f,0.018860f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.172313f,0.089176f,0.156758f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.201634f,0.188471f,0.245212f}, -{-0.201634f,0.188471f,0.245212f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.088767f,0.167544f,0.136712f}, -{-0.064364f,0.318450f,-0.106142f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.048513f,0.268338f,0.094717f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.064364f,0.318450f,-0.106142f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.093481f,0.234137f,-0.137276f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.099865f,0.138177f,-0.122074f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.099865f,0.138177f,-0.122074f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.168774f,0.110476f,-0.156291f}, -{-0.082858f,0.051277f,-0.052142f}, -{-0.168774f,0.110476f,-0.156291f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.082858f,0.051277f,-0.052142f}, -{-0.173409f,0.017343f,0.008831f}, -{-0.173409f,0.017343f,0.008831f}, -{-0.082858f,0.051277f,-0.052142f}, -{-0.075137f,0.034598f,0.018860f}, -{-0.173409f,0.017343f,0.008831f}, -{-0.075137f,0.034598f,0.018860f}, -{-0.172313f,0.089176f,0.156758f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.072768f,0.345724f,-0.136227f}, -{-0.064364f,0.318450f,-0.106142f}, -{-0.072768f,0.345724f,-0.136227f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.159817f,0.308307f,-0.249994f}, -{-0.093481f,0.234137f,-0.137276f}, -{-0.159817f,0.308307f,-0.249994f}, -{-0.053491f,0.167386f,-0.083278f}, -{-0.159817f,0.308307f,-0.249994f}, -{-0.093481f,0.234137f,-0.137276f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.299468f,0.184643f,-0.257095f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.168774f,0.110476f,-0.156291f}, -{-0.168774f,0.110476f,-0.156291f}, -{-0.335566f,0.126338f,-0.195860f}, -{-0.299468f,0.184643f,-0.257095f}, -{-0.335566f,0.126338f,-0.195860f}, -{-0.168774f,0.110476f,-0.156291f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.270557f,0.066073f,-0.108951f}, -{-0.335566f,0.126338f,-0.195860f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.173409f,0.017343f,0.008831f}, -{-0.281354f,0.026363f,0.040343f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.281354f,0.026363f,0.040343f}, -{-0.270557f,0.066073f,-0.108951f}, -{-0.176203f,0.060074f,-0.106186f}, -{-0.350603f,0.093083f,0.164192f}, -{-0.173409f,0.017343f,0.008831f}, -{-0.172313f,0.089176f,0.156758f}, -{-0.173409f,0.017343f,0.008831f}, -{-0.350603f,0.093083f,0.164192f}, -{-0.281354f,0.026363f,0.040343f}, -{-0.325605f,0.144724f,0.236982f}, -{-0.350603f,0.093083f,0.164192f}, -{-0.172313f,0.089176f,0.156758f}, -{-0.201634f,0.188471f,0.245212f}, -{-0.325605f,0.144724f,0.236982f}, -{-0.172313f,0.089176f,0.156758f}, -{-0.088767f,0.167544f,0.136712f}, -{-0.101458f,0.293739f,0.179849f}, -{-0.201634f,0.188471f,0.245212f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.101458f,0.293739f,0.179849f}, -{-0.088767f,0.167544f,0.136712f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.071366f,0.314877f,0.134458f}, -{-0.101458f,0.293739f,0.179849f}, -{-0.071366f,0.314877f,0.134458f}, -{-0.075951f,0.167834f,0.024523f}, -{-0.048513f,0.268338f,0.094717f}, -{-0.033153f,0.424027f,-0.094593f}, -{-0.048513f,0.268338f,0.094717f}, -{-0.064364f,0.318450f,-0.106142f}, -{-0.048513f,0.268338f,0.094717f}, -{-0.033153f,0.424027f,-0.094593f}, -{-0.033433f,0.401933f,0.129332f}, -{-0.200682f,0.272439f,-0.272401f}, -{-0.159817f,0.308307f,-0.249994f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.217682f,0.258313f,-0.275721f}, -{-0.200682f,0.272439f,-0.272401f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.259098f,0.222339f,-0.274714f}, -{-0.217682f,0.258313f,-0.275721f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.299468f,0.184643f,-0.257095f}, -{-0.259098f,0.222339f,-0.274714f}, -{-0.141987f,0.178210f,-0.173643f}, -{-0.281354f,0.026363f,0.040343f}, -{-0.350603f,0.093083f,0.164192f}, -{-0.475109f,0.019966f,0.128767f}, -{-0.258617f,0.222761f,0.292483f}, -{-0.325605f,0.144724f,0.236982f}, -{-0.201634f,0.188471f,0.245212f}, -{-0.201634f,0.188471f,0.245212f}, -{-0.218834f,0.257368f,0.293536f}, -{-0.258617f,0.222761f,0.292483f}, -{-0.201634f,0.188471f,0.245212f}, -{-0.184774f,0.369677f,0.309949f}, -{-0.218834f,0.257368f,0.293536f}, -{-0.201634f,0.188471f,0.245212f}, -{-0.101458f,0.293739f,0.179849f}, -{-0.184774f,0.369677f,0.309949f}, -{-0.071366f,0.314877f,0.134458f}, -{-0.048513f,0.268338f,0.094717f}, -{-0.033433f,0.401933f,0.129332f}, -{-0.081331f,0.435318f,-0.215997f}, -{-0.033153f,0.424027f,-0.094593f}, -{-0.064364f,0.318450f,-0.106142f}, -{-0.072768f,0.345724f,-0.136227f}, -{-0.081331f,0.435318f,-0.215997f}, -{-0.064364f,0.318450f,-0.106142f}, -{-0.123359f,0.455237f,-0.258829f}, -{-0.081331f,0.435318f,-0.215997f}, -{-0.159817f,0.308307f,-0.249994f}, -{-0.081331f,0.435318f,-0.215997f}, -{-0.072768f,0.345724f,-0.136227f}, -{-0.159817f,0.308307f,-0.249994f}, -{-0.159817f,0.308307f,-0.249994f}, -{-0.166088f,0.471620f,-0.293476f}, -{-0.123359f,0.455237f,-0.258829f}, -{-0.200682f,0.272439f,-0.272401f}, -{-0.166088f,0.471620f,-0.293476f}, -{-0.159817f,0.308307f,-0.249994f}, -{-0.217682f,0.258313f,-0.275721f}, -{-0.321807f,0.267667f,-0.306258f}, -{-0.200682f,0.272439f,-0.272401f}, -{-0.259098f,0.222339f,-0.274714f}, -{-0.321807f,0.267667f,-0.306258f}, -{-0.217682f,0.258313f,-0.275721f}, -{-0.299468f,0.184643f,-0.257095f}, -{-0.457076f,0.250396f,-0.276312f}, -{-0.259098f,0.222339f,-0.274714f}, -{-0.457076f,0.250396f,-0.276312f}, -{-0.299468f,0.184643f,-0.257095f}, -{-0.452257f,0.146554f,-0.174479f}, -{-0.335566f,0.126338f,-0.195860f}, -{-0.452257f,0.146554f,-0.174479f}, -{-0.299468f,0.184643f,-0.257095f}, -{-0.335566f,0.126338f,-0.195860f}, -{-0.431898f,0.109969f,-0.146768f}, -{-0.452257f,0.146554f,-0.174479f}, -{-0.431898f,0.109969f,-0.146768f}, -{-0.270557f,0.066073f,-0.108951f}, -{-0.450839f,0.043866f,-0.092489f}, -{-0.270557f,0.066073f,-0.108951f}, -{-0.431898f,0.109969f,-0.146768f}, -{-0.335566f,0.126338f,-0.195860f}, -{-0.350603f,0.093083f,0.164192f}, -{-0.456742f,0.135001f,0.178754f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.325605f,0.144724f,0.236982f}, -{-0.456742f,0.135001f,0.178754f}, -{-0.350603f,0.093083f,0.164192f}, -{-0.456742f,0.135001f,0.178754f}, -{-0.325605f,0.144724f,0.236982f}, -{-0.444583f,0.245210f,0.284110f}, -{-0.258617f,0.222761f,0.292483f}, -{-0.444583f,0.245210f,0.284110f}, -{-0.325605f,0.144724f,0.236982f}, -{-0.293541f,0.379121f,0.356764f}, -{-0.258617f,0.222761f,0.292483f}, -{-0.218834f,0.257368f,0.293536f}, -{-0.293541f,0.379121f,0.356764f}, -{-0.218834f,0.257368f,0.293536f}, -{-0.184774f,0.369677f,0.309949f}, -{-0.101458f,0.293739f,0.179849f}, -{-0.143556f,0.485021f,0.296972f}, -{-0.184774f,0.369677f,0.309949f}, -{-0.101458f,0.293739f,0.179849f}, -{-0.101418f,0.421808f,0.251017f}, -{-0.143556f,0.485021f,0.296972f}, -{-0.101458f,0.293739f,0.179849f}, -{-0.071366f,0.314877f,0.134458f}, -{-0.045579f,0.454792f,0.188508f}, -{-0.101418f,0.421808f,0.251017f}, -{-0.101458f,0.293739f,0.179849f}, -{-0.045579f,0.454792f,0.188508f}, -{-0.033433f,0.401933f,0.129332f}, -{-0.045579f,0.454792f,0.188508f}, -{-0.071366f,0.314877f,0.134458f}, -{0.014534f,0.554231f,-0.064379f}, -{-0.033433f,0.401933f,0.129332f}, -{-0.033153f,0.424027f,-0.094593f}, -{-0.033433f,0.401933f,0.129332f}, -{0.014534f,0.554231f,-0.064379f}, -{0.024689f,0.563433f,0.008831f}, -{-0.033153f,0.424027f,-0.094593f}, -{-0.060378f,0.523962f,-0.203184f}, -{0.014534f,0.554231f,-0.064379f}, -{-0.060378f,0.523962f,-0.203184f}, -{-0.033153f,0.424027f,-0.094593f}, -{-0.081331f,0.435318f,-0.215997f}, -{-0.200682f,0.272439f,-0.272401f}, -{-0.348878f,0.428678f,-0.347622f}, -{-0.166088f,0.471620f,-0.293476f}, -{-0.321807f,0.267667f,-0.306258f}, -{-0.348878f,0.428678f,-0.347622f}, -{-0.200682f,0.272439f,-0.272401f}, -{-0.376674f,0.318942f,-0.326180f}, -{-0.321807f,0.267667f,-0.306258f}, -{-0.259098f,0.222339f,-0.274714f}, -{-0.457076f,0.250396f,-0.276312f}, -{-0.376674f,0.318942f,-0.326180f}, -{-0.259098f,0.222339f,-0.274714f}, -{-0.499776f,0.133654f,-0.150582f}, -{-0.452257f,0.146554f,-0.174479f}, -{-0.431898f,0.109969f,-0.146768f}, -{-0.600774f,0.120701f,-0.133308f}, -{-0.431898f,0.109969f,-0.146768f}, -{-0.450839f,0.043866f,-0.092489f}, -{-0.431898f,0.109969f,-0.146768f}, -{-0.600774f,0.120701f,-0.133308f}, -{-0.499776f,0.133654f,-0.150582f}, -{-0.543369f,0.227401f,0.245080f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.456742f,0.135001f,0.178754f}, -{-0.543369f,0.227401f,0.245080f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.380244f,0.268127f,0.316402f}, -{-0.444583f,0.245210f,0.284110f}, -{-0.258617f,0.222761f,0.292483f}, -{-0.293541f,0.379121f,0.356764f}, -{-0.380244f,0.268127f,0.316402f}, -{-0.258617f,0.222761f,0.292483f}, -{-0.351059f,0.426911f,0.365447f}, -{-0.293541f,0.379121f,0.356764f}, -{-0.184774f,0.369677f,0.309949f}, -{-0.143556f,0.485021f,0.296972f}, -{-0.351059f,0.426911f,0.365447f}, -{-0.184774f,0.369677f,0.309949f}, -{-0.143556f,0.485021f,0.296972f}, -{-0.101418f,0.421808f,0.251017f}, -{-0.045579f,0.454792f,0.188508f}, -{0.024689f,0.563433f,0.008831f}, -{-0.060964f,0.523669f,0.221527f}, -{-0.033433f,0.401933f,0.129332f}, -{-0.033433f,0.401933f,0.129332f}, -{-0.060964f,0.523669f,0.221527f}, -{-0.045579f,0.454792f,0.188508f}, -{-0.060378f,0.523962f,-0.203184f}, -{-0.081331f,0.435318f,-0.215997f}, -{-0.108599f,0.580739f,-0.256673f}, -{-0.123359f,0.455237f,-0.258829f}, -{-0.108599f,0.580739f,-0.256673f}, -{-0.081331f,0.435318f,-0.215997f}, -{-0.108599f,0.580739f,-0.256673f}, -{-0.123359f,0.455237f,-0.258829f}, -{-0.193596f,0.625096f,-0.307288f}, -{-0.166088f,0.471620f,-0.293476f}, -{-0.193596f,0.625096f,-0.307288f}, -{-0.123359f,0.455237f,-0.258829f}, -{-0.166088f,0.471620f,-0.293476f}, -{-0.348878f,0.428678f,-0.347622f}, -{-0.193596f,0.625096f,-0.307288f}, -{-0.379941f,0.405196f,-0.348948f}, -{-0.348878f,0.428678f,-0.347622f}, -{-0.321807f,0.267667f,-0.306258f}, -{-0.376674f,0.318942f,-0.326180f}, -{-0.379941f,0.405196f,-0.348948f}, -{-0.321807f,0.267667f,-0.306258f}, -{-0.457076f,0.250396f,-0.276312f}, -{-0.506311f,0.312499f,-0.305863f}, -{-0.376674f,0.318942f,-0.326180f}, -{-0.506311f,0.312499f,-0.305863f}, -{-0.457076f,0.250396f,-0.276312f}, -{-0.495779f,0.239103f,-0.265777f}, -{-0.495779f,0.239103f,-0.265777f}, -{-0.499776f,0.133654f,-0.150582f}, -{-0.506311f,0.312499f,-0.305863f}, -{-0.452257f,0.146554f,-0.174479f}, -{-0.499776f,0.133654f,-0.150582f}, -{-0.495779f,0.239103f,-0.265777f}, -{-0.495779f,0.239103f,-0.265777f}, -{-0.457076f,0.250396f,-0.276312f}, -{-0.452257f,0.146554f,-0.174479f}, -{-0.533412f,0.256306f,0.274081f}, -{-0.543369f,0.227401f,0.245080f}, -{-0.456742f,0.135001f,0.178754f}, -{-0.456742f,0.135001f,0.178754f}, -{-0.444583f,0.245210f,0.284110f}, -{-0.533412f,0.256306f,0.274081f}, -{-0.444583f,0.245210f,0.284110f}, -{-0.490027f,0.335189f,0.341267f}, -{-0.533412f,0.256306f,0.274081f}, -{-0.490027f,0.335189f,0.341267f}, -{-0.444583f,0.245210f,0.284110f}, -{-0.380244f,0.268127f,0.316402f}, -{-0.293541f,0.379121f,0.356764f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.380244f,0.268127f,0.316402f}, -{-0.293541f,0.379121f,0.356764f}, -{-0.351059f,0.426911f,0.365447f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.135558f,0.572838f,0.295510f}, -{-0.351059f,0.426911f,0.365447f}, -{-0.143556f,0.485021f,0.296972f}, -{-0.045579f,0.454792f,0.188508f}, -{-0.135558f,0.572838f,0.295510f}, -{-0.143556f,0.485021f,0.296972f}, -{-0.135558f,0.572838f,0.295510f}, -{-0.045579f,0.454792f,0.188508f}, -{-0.060964f,0.523669f,0.221527f}, -{-0.012797f,0.766036f,-0.073718f}, -{0.024689f,0.563433f,0.008831f}, -{0.014534f,0.554231f,-0.064379f}, -{0.024689f,0.563433f,0.008831f}, -{-0.012797f,0.766036f,-0.073718f}, -{-0.002218f,0.774701f,0.008831f}, -{-0.096693f,0.731137f,-0.217039f}, -{0.014534f,0.554231f,-0.064379f}, -{-0.060378f,0.523962f,-0.203184f}, -{0.014534f,0.554231f,-0.064379f}, -{-0.096693f,0.731137f,-0.217039f}, -{-0.012797f,0.766036f,-0.073718f}, -{-0.193596f,0.625096f,-0.307288f}, -{-0.096693f,0.731137f,-0.217039f}, -{-0.108599f,0.580739f,-0.256673f}, -{-0.108599f,0.580739f,-0.256673f}, -{-0.096693f,0.731137f,-0.217039f}, -{-0.060378f,0.523962f,-0.203184f}, -{-0.348878f,0.428678f,-0.347622f}, -{-0.296639f,0.565833f,-0.345484f}, -{-0.193596f,0.625096f,-0.307288f}, -{-0.348878f,0.428678f,-0.347622f}, -{-0.379941f,0.405196f,-0.348948f}, -{-0.296639f,0.565833f,-0.345484f}, -{-0.610271f,0.513866f,-0.389491f}, -{-0.379941f,0.405196f,-0.348948f}, -{-0.376674f,0.318942f,-0.326180f}, -{-0.610271f,0.513866f,-0.389491f}, -{-0.376674f,0.318942f,-0.326180f}, -{-0.506311f,0.312499f,-0.305863f}, -{-0.506311f,0.312499f,-0.305863f}, -{-0.499776f,0.133654f,-0.150582f}, -{-0.628432f,0.268044f,-0.259038f}, -{-0.499776f,0.133654f,-0.150582f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.628432f,0.268044f,-0.259038f}, -{-0.711124f,0.325157f,0.299759f}, -{-0.726777f,0.165369f,0.156838f}, -{-0.543369f,0.227401f,0.245080f}, -{-0.533412f,0.256306f,0.274081f}, -{-0.711124f,0.325157f,0.299759f}, -{-0.543369f,0.227401f,0.245080f}, -{-0.711124f,0.325157f,0.299759f}, -{-0.533412f,0.256306f,0.274081f}, -{-0.490027f,0.335189f,0.341267f}, -{-0.490027f,0.335189f,0.341267f}, -{-0.380244f,0.268127f,0.316402f}, -{-0.522925f,0.395937f,0.372776f}, -{-0.380244f,0.268127f,0.316402f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.522925f,0.395937f,0.372776f}, -{-0.298037f,0.564787f,0.363519f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.351059f,0.426911f,0.365447f}, -{-0.298037f,0.564787f,0.363519f}, -{-0.351059f,0.426911f,0.365447f}, -{-0.135558f,0.572838f,0.295510f}, -{-0.098052f,0.653213f,0.258196f}, -{-0.135558f,0.572838f,0.295510f}, -{-0.060964f,0.523669f,0.221527f}, -{-0.071181f,0.665468f,0.230173f}, -{-0.098052f,0.653213f,0.258196f}, -{-0.060964f,0.523669f,0.221527f}, -{0.024689f,0.563433f,0.008831f}, -{-0.071181f,0.665468f,0.230173f}, -{-0.060964f,0.523669f,0.221527f}, -{0.024689f,0.563433f,0.008831f}, -{-0.002218f,0.774701f,0.008831f}, -{-0.071181f,0.665468f,0.230173f}, -{-0.224929f,0.755269f,-0.296463f}, -{-0.158199f,0.779210f,-0.246508f}, -{-0.193596f,0.625096f,-0.307288f}, -{-0.193596f,0.625096f,-0.307288f}, -{-0.158199f,0.779210f,-0.246508f}, -{-0.096693f,0.731137f,-0.217039f}, -{-0.328057f,0.781113f,-0.328310f}, -{-0.224929f,0.755269f,-0.296463f}, -{-0.296639f,0.565833f,-0.345484f}, -{-0.296639f,0.565833f,-0.345484f}, -{-0.224929f,0.755269f,-0.296463f}, -{-0.193596f,0.625096f,-0.307288f}, -{-0.459669f,0.613243f,-0.383921f}, -{-0.296639f,0.565833f,-0.345484f}, -{-0.379941f,0.405196f,-0.348948f}, -{-0.506311f,0.312499f,-0.305863f}, -{-0.647998f,0.489653f,-0.380638f}, -{-0.610271f,0.513866f,-0.389491f}, -{-0.506311f,0.312499f,-0.305863f}, -{-0.686582f,0.350216f,-0.308334f}, -{-0.647998f,0.489653f,-0.380638f}, -{-0.686582f,0.350216f,-0.308334f}, -{-0.506311f,0.312499f,-0.305863f}, -{-0.628432f,0.268044f,-0.259038f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.628432f,0.268044f,-0.259038f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.816246f,0.219594f,-0.137372f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.832685f,0.336639f,0.247367f}, -{-0.815154f,0.196699f,0.134399f}, -{-0.726777f,0.165369f,0.156838f}, -{-0.711124f,0.325157f,0.299759f}, -{-0.832685f,0.336639f,0.247367f}, -{-0.726777f,0.165369f,0.156838f}, -{-0.712499f,0.442192f,0.366363f}, -{-0.711124f,0.325157f,0.299759f}, -{-0.490027f,0.335189f,0.341267f}, -{-0.522925f,0.395937f,0.372776f}, -{-0.712499f,0.442192f,0.366363f}, -{-0.490027f,0.335189f,0.341267f}, -{-0.529404f,0.468138f,0.398086f}, -{-0.490027f,0.335189f,0.341267f}, -{-0.522925f,0.395937f,0.372776f}, -{-0.529404f,0.468138f,0.398086f}, -{-0.522925f,0.395937f,0.372776f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.462505f,0.516786f,0.397493f}, -{-0.529404f,0.468138f,0.398086f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.462074f,0.611579f,0.402017f}, -{-0.462505f,0.516786f,0.397493f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.362704f,0.594687f,0.380730f}, -{-0.462074f,0.611579f,0.402017f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.298037f,0.564787f,0.363519f}, -{-0.362704f,0.594687f,0.380730f}, -{-0.361848f,0.507432f,0.376099f}, -{-0.159492f,0.778669f,0.265326f}, -{-0.298037f,0.564787f,0.363519f}, -{-0.135558f,0.572838f,0.295510f}, -{-0.298037f,0.564787f,0.363519f}, -{-0.159492f,0.778669f,0.265326f}, -{-0.258656f,0.662749f,0.346457f}, -{-0.159492f,0.778669f,0.265326f}, -{-0.135558f,0.572838f,0.295510f}, -{-0.098052f,0.653213f,0.258196f}, -{-0.098052f,0.653213f,0.258196f}, -{-0.071181f,0.665468f,0.230173f}, -{-0.159492f,0.778669f,0.265326f}, -{-0.045862f,0.829432f,-0.074246f}, -{-0.002218f,0.774701f,0.008831f}, -{-0.012797f,0.766036f,-0.073718f}, -{-0.002218f,0.774701f,0.008831f}, -{-0.045862f,0.829432f,-0.074246f}, -{-0.079333f,0.894907f,0.008831f}, -{-0.079513f,0.813181f,-0.150325f}, -{-0.045862f,0.829432f,-0.074246f}, -{-0.096693f,0.731137f,-0.217039f}, -{-0.096693f,0.731137f,-0.217039f}, -{-0.045862f,0.829432f,-0.074246f}, -{-0.012797f,0.766036f,-0.073718f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.079513f,0.813181f,-0.150325f}, -{-0.096693f,0.731137f,-0.217039f}, -{-0.158199f,0.779210f,-0.246508f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.096693f,0.731137f,-0.217039f}, -{-0.296639f,0.565833f,-0.345484f}, -{-0.361853f,0.680293f,-0.357897f}, -{-0.328057f,0.781113f,-0.328310f}, -{-0.361853f,0.680293f,-0.357897f}, -{-0.296639f,0.565833f,-0.345484f}, -{-0.459669f,0.613243f,-0.383921f}, -{-0.495109f,0.589192f,-0.389346f}, -{-0.459669f,0.613243f,-0.383921f}, -{-0.379941f,0.405196f,-0.348948f}, -{-0.572922f,0.536479f,-0.393769f}, -{-0.379941f,0.405196f,-0.348948f}, -{-0.610271f,0.513866f,-0.389491f}, -{-0.379941f,0.405196f,-0.348948f}, -{-0.572922f,0.536479f,-0.393769f}, -{-0.495109f,0.589192f,-0.389346f}, -{-0.686582f,0.350216f,-0.308334f}, -{-0.826559f,0.463864f,-0.290584f}, -{-0.647998f,0.489653f,-0.380638f}, -{-0.789021f,0.378309f,-0.281768f}, -{-0.686582f,0.350216f,-0.308334f}, -{-0.628432f,0.268044f,-0.259038f}, -{-0.686582f,0.350216f,-0.308334f}, -{-0.789021f,0.378309f,-0.281768f}, -{-0.826559f,0.463864f,-0.290584f}, -{-0.628432f,0.268044f,-0.259038f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.789021f,0.378309f,-0.281768f}, -{-0.711124f,0.325157f,0.299759f}, -{-0.789972f,0.377442f,0.298419f}, -{-0.832685f,0.336639f,0.247367f}, -{-0.778837f,0.501733f,0.351168f}, -{-0.789972f,0.377442f,0.298419f}, -{-0.711124f,0.325157f,0.299759f}, -{-0.712499f,0.442192f,0.366363f}, -{-0.778837f,0.501733f,0.351168f}, -{-0.711124f,0.325157f,0.299759f}, -{-0.648681f,0.489172f,0.398073f}, -{-0.712499f,0.442192f,0.366363f}, -{-0.522925f,0.395937f,0.372776f}, -{-0.529404f,0.468138f,0.398086f}, -{-0.648681f,0.489172f,0.398073f}, -{-0.522925f,0.395937f,0.372776f}, -{-0.462505f,0.516786f,0.397493f}, -{-0.609458f,0.611316f,0.410140f}, -{-0.529404f,0.468138f,0.398086f}, -{-0.462074f,0.611579f,0.402017f}, -{-0.609458f,0.611316f,0.410140f}, -{-0.462505f,0.516786f,0.397493f}, -{-0.427199f,0.724323f,0.384757f}, -{-0.462074f,0.611579f,0.402017f}, -{-0.362704f,0.594687f,0.380730f}, -{-0.298037f,0.564787f,0.363519f}, -{-0.427199f,0.724323f,0.384757f}, -{-0.362704f,0.594687f,0.380730f}, -{-0.258656f,0.662749f,0.346457f}, -{-0.427199f,0.724323f,0.384757f}, -{-0.298037f,0.564787f,0.363519f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.159492f,0.778669f,0.265326f}, -{-0.071181f,0.665468f,0.230173f}, -{-0.071181f,0.665468f,0.230173f}, -{-0.061161f,0.822120f,0.134128f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.079333f,0.894907f,0.008831f}, -{-0.071181f,0.665468f,0.230173f}, -{-0.002218f,0.774701f,0.008831f}, -{-0.071181f,0.665468f,0.230173f}, -{-0.079333f,0.894907f,0.008831f}, -{-0.061161f,0.822120f,0.134128f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.103501f,0.881260f,-0.113156f}, -{-0.079513f,0.813181f,-0.150325f}, -{-0.079513f,0.813181f,-0.150325f}, -{-0.103501f,0.881260f,-0.113156f}, -{-0.045862f,0.829432f,-0.074246f}, -{-0.294467f,0.798679f,-0.311306f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.224929f,0.755269f,-0.296463f}, -{-0.224929f,0.755269f,-0.296463f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.158199f,0.779210f,-0.246508f}, -{-0.328057f,0.781113f,-0.328310f}, -{-0.294467f,0.798679f,-0.311306f}, -{-0.224929f,0.755269f,-0.296463f}, -{-0.459669f,0.613243f,-0.383921f}, -{-0.490606f,0.683646f,-0.382547f}, -{-0.361853f,0.680293f,-0.357897f}, -{-0.490606f,0.683646f,-0.382547f}, -{-0.459669f,0.613243f,-0.383921f}, -{-0.495109f,0.589192f,-0.389346f}, -{-0.714978f,0.640885f,-0.362201f}, -{-0.572922f,0.536479f,-0.393769f}, -{-0.610271f,0.513866f,-0.389491f}, -{-0.714978f,0.640885f,-0.362201f}, -{-0.610271f,0.513866f,-0.389491f}, -{-0.647998f,0.489653f,-0.380638f}, -{-0.647998f,0.489653f,-0.380638f}, -{-0.851767f,0.550087f,-0.281611f}, -{-0.714978f,0.640885f,-0.362201f}, -{-0.647998f,0.489653f,-0.380638f}, -{-0.826559f,0.463864f,-0.290584f}, -{-0.851767f,0.550087f,-0.281611f}, -{-0.826559f,0.463864f,-0.290584f}, -{-0.789021f,0.378309f,-0.281768f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.872584f,0.425972f,-0.239293f}, -{-0.826559f,0.463864f,-0.290584f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.921662f,0.499711f,-0.204303f}, -{-0.872584f,0.425972f,-0.239293f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.935086f,0.373720f,-0.140379f}, -{-0.921662f,0.499711f,-0.204303f}, -{-0.922564f,0.499065f,0.220763f}, -{-0.936187f,0.372794f,0.155570f}, -{-0.832685f,0.336639f,0.247367f}, -{-0.872941f,0.425676f,0.256514f}, -{-0.922564f,0.499065f,0.220763f}, -{-0.832685f,0.336639f,0.247367f}, -{-0.778837f,0.501733f,0.351168f}, -{-0.872941f,0.425676f,0.256514f}, -{-0.789972f,0.377442f,0.298419f}, -{-0.789972f,0.377442f,0.298419f}, -{-0.872941f,0.425676f,0.256514f}, -{-0.832685f,0.336639f,0.247367f}, -{-0.776732f,0.602283f,0.355783f}, -{-0.778837f,0.501733f,0.351168f}, -{-0.712499f,0.442192f,0.366363f}, -{-0.715654f,0.640483f,0.379688f}, -{-0.776732f,0.602283f,0.355783f}, -{-0.712499f,0.442192f,0.366363f}, -{-0.689622f,0.565154f,0.398218f}, -{-0.715654f,0.640483f,0.379688f}, -{-0.648681f,0.489172f,0.398073f}, -{-0.648681f,0.489172f,0.398073f}, -{-0.715654f,0.640483f,0.379688f}, -{-0.712499f,0.442192f,0.366363f}, -{-0.529404f,0.468138f,0.398086f}, -{-0.689622f,0.565154f,0.398218f}, -{-0.648681f,0.489172f,0.398073f}, -{-0.609458f,0.611316f,0.410140f}, -{-0.689622f,0.565154f,0.398218f}, -{-0.529404f,0.468138f,0.398086f}, -{-0.462074f,0.611579f,0.402017f}, -{-0.493066f,0.682107f,0.400627f}, -{-0.609458f,0.611316f,0.410140f}, -{-0.459453f,0.703602f,0.393687f}, -{-0.493066f,0.682107f,0.400627f}, -{-0.462074f,0.611579f,0.402017f}, -{-0.427199f,0.724323f,0.384757f}, -{-0.459453f,0.703602f,0.393687f}, -{-0.462074f,0.611579f,0.402017f}, -{-0.297408f,0.797186f,0.330554f}, -{-0.258656f,0.662749f,0.346457f}, -{-0.159492f,0.778669f,0.265326f}, -{-0.159492f,0.778669f,0.265326f}, -{-0.200245f,0.837065f,0.263018f}, -{-0.297408f,0.797186f,0.330554f}, -{-0.159492f,0.778669f,0.265326f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.200245f,0.837065f,0.263018f}, -{-0.061161f,0.822120f,0.134128f}, -{-0.079333f,0.894907f,0.008831f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.153197f,0.929399f,-0.110639f}, -{-0.192389f,0.980613f,0.008831f}, -{-0.045862f,0.829432f,-0.074246f}, -{-0.045862f,0.829432f,-0.074246f}, -{-0.192389f,0.980613f,0.008831f}, -{-0.079333f,0.894907f,0.008831f}, -{-0.103501f,0.881260f,-0.113156f}, -{-0.153197f,0.929399f,-0.110639f}, -{-0.045862f,0.829432f,-0.074246f}, -{-0.171562f,0.920980f,-0.145760f}, -{-0.153197f,0.929399f,-0.110639f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.153197f,0.929399f,-0.110639f}, -{-0.103501f,0.881260f,-0.113156f}, -{-0.294467f,0.798679f,-0.311306f}, -{-0.243881f,0.888252f,-0.238363f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.486757f,0.850333f,-0.341353f}, -{-0.294467f,0.798679f,-0.311306f}, -{-0.328057f,0.781113f,-0.328310f}, -{-0.486757f,0.850333f,-0.341353f}, -{-0.328057f,0.781113f,-0.328310f}, -{-0.361853f,0.680293f,-0.357897f}, -{-0.731848f,0.719053f,-0.342454f}, -{-0.495109f,0.589192f,-0.389346f}, -{-0.572922f,0.536479f,-0.393769f}, -{-0.495109f,0.589192f,-0.389346f}, -{-0.731848f,0.719053f,-0.342454f}, -{-0.490606f,0.683646f,-0.382547f}, -{-0.731848f,0.719053f,-0.342454f}, -{-0.572922f,0.536479f,-0.393769f}, -{-0.714978f,0.640885f,-0.362201f}, -{-0.826559f,0.463864f,-0.290584f}, -{-0.876872f,0.531976f,-0.256823f}, -{-0.851767f,0.550087f,-0.281611f}, -{-0.921662f,0.499711f,-0.204303f}, -{-0.826559f,0.463864f,-0.290584f}, -{-0.872584f,0.425972f,-0.239293f}, -{-0.826559f,0.463864f,-0.290584f}, -{-0.921662f,0.499711f,-0.204303f}, -{-0.876872f,0.531976f,-0.256823f}, -{-0.993248f,0.448807f,-0.048683f}, -{-0.935086f,0.373720f,-0.140379f}, -{-0.964325f,0.349059f,-0.050380f}, -{-0.935086f,0.373720f,-0.140379f}, -{-0.993248f,0.448807f,-0.048683f}, -{-0.921662f,0.499711f,-0.204303f}, -{-0.999414f,0.444451f,0.008831f}, -{-0.964325f,0.349059f,-0.050380f}, -{-0.970256f,0.344040f,0.008831f}, -{-0.964325f,0.349059f,-0.050380f}, -{-0.999414f,0.444451f,0.008831f}, -{-0.993248f,0.448807f,-0.048683f}, -{-0.922564f,0.499065f,0.220763f}, -{-0.999414f,0.444451f,0.008831f}, -{-0.936187f,0.372794f,0.155570f}, -{-0.936187f,0.372794f,0.155570f}, -{-0.999414f,0.444451f,0.008831f}, -{-0.970256f,0.344040f,0.008831f}, -{-0.776732f,0.602283f,0.355783f}, -{-0.922564f,0.499065f,0.220763f}, -{-0.778837f,0.501733f,0.351168f}, -{-0.778837f,0.501733f,0.351168f}, -{-0.922564f,0.499065f,0.220763f}, -{-0.872941f,0.425676f,0.256514f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.715654f,0.640483f,0.379688f}, -{-0.689622f,0.565154f,0.398218f}, -{-0.636801f,0.683411f,0.392246f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.609458f,0.611316f,0.410140f}, -{-0.609458f,0.611316f,0.410140f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.689622f,0.565154f,0.398218f}, -{-0.493066f,0.682107f,0.400627f}, -{-0.636801f,0.683411f,0.392246f}, -{-0.609458f,0.611316f,0.410140f}, -{-0.427199f,0.724323f,0.384757f}, -{-0.519637f,0.750650f,0.388987f}, -{-0.459453f,0.703602f,0.393687f}, -{-0.459453f,0.703602f,0.393687f}, -{-0.519637f,0.750650f,0.388987f}, -{-0.493066f,0.682107f,0.400627f}, -{-0.258656f,0.662749f,0.346457f}, -{-0.424831f,0.807488f,0.366791f}, -{-0.427199f,0.724323f,0.384757f}, -{-0.258656f,0.662749f,0.346457f}, -{-0.297408f,0.797186f,0.330554f}, -{-0.424831f,0.807488f,0.366791f}, -{-0.245052f,0.887736f,0.257123f}, -{-0.297408f,0.797186f,0.330554f}, -{-0.200245f,0.837065f,0.263018f}, -{-0.200245f,0.837065f,0.263018f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.245052f,0.887736f,0.257123f}, -{-0.192389f,0.980613f,0.008831f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.079333f,0.894907f,0.008831f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.192389f,0.980613f,0.008831f}, -{-0.154234f,0.928941f,0.130620f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.153197f,0.929399f,-0.110639f}, -{-0.171562f,0.920980f,-0.145760f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.171562f,0.920980f,-0.145760f}, -{-0.243881f,0.888252f,-0.238363f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.194396f,0.911266f,-0.180200f}, -{-0.294467f,0.798679f,-0.311306f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.243881f,0.888252f,-0.238363f}, -{-0.353576f,0.913907f,-0.272511f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.294467f,0.798679f,-0.311306f}, -{-0.486757f,0.850333f,-0.341353f}, -{-0.353576f,0.913907f,-0.272511f}, -{-0.294467f,0.798679f,-0.311306f}, -{-0.574064f,0.880628f,-0.320614f}, -{-0.486757f,0.850333f,-0.341353f}, -{-0.361853f,0.680293f,-0.357897f}, -{-0.574064f,0.880628f,-0.320614f}, -{-0.361853f,0.680293f,-0.357897f}, -{-0.490606f,0.683646f,-0.382547f}, -{-0.490606f,0.683646f,-0.382547f}, -{-0.731848f,0.719053f,-0.342454f}, -{-0.574064f,0.880628f,-0.320614f}, -{-0.714978f,0.640885f,-0.362201f}, -{-0.815809f,0.672171f,-0.305503f}, -{-0.731848f,0.719053f,-0.342454f}, -{-0.815809f,0.672171f,-0.305503f}, -{-0.714978f,0.640885f,-0.362201f}, -{-0.851767f,0.550087f,-0.281611f}, -{-0.910114f,0.613191f,-0.222200f}, -{-0.851767f,0.550087f,-0.281611f}, -{-0.876872f,0.531976f,-0.256823f}, -{-0.910114f,0.613191f,-0.222200f}, -{-0.876872f,0.531976f,-0.256823f}, -{-0.921662f,0.499711f,-0.204303f}, -{-0.921662f,0.499711f,-0.204303f}, -{-0.990920f,0.564170f,-0.089404f}, -{-0.910114f,0.613191f,-0.222200f}, -{-0.990920f,0.564170f,-0.089404f}, -{-0.921662f,0.499711f,-0.204303f}, -{-0.993248f,0.448807f,-0.048683f}, -{-1.009633f,0.553243f,0.008831f}, -{-0.993248f,0.448807f,-0.048683f}, -{-0.999414f,0.444451f,0.008831f}, -{-0.993248f,0.448807f,-0.048683f}, -{-1.009633f,0.553243f,0.008831f}, -{-0.990920f,0.564170f,-0.089404f}, -{-0.974611f,0.573813f,0.145808f}, -{-1.009633f,0.553243f,0.008831f}, -{-0.922564f,0.499065f,0.220763f}, -{-0.922564f,0.499065f,0.220763f}, -{-1.009633f,0.553243f,0.008831f}, -{-0.999414f,0.444451f,0.008831f}, -{-0.889064f,0.626333f,0.262181f}, -{-0.974611f,0.573813f,0.145808f}, -{-0.776732f,0.602283f,0.355783f}, -{-0.776732f,0.602283f,0.355783f}, -{-0.974611f,0.573813f,0.145808f}, -{-0.922564f,0.499065f,0.220763f}, -{-0.715654f,0.640483f,0.379688f}, -{-0.817347f,0.671244f,0.322110f}, -{-0.776732f,0.602283f,0.355783f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.817347f,0.671244f,0.322110f}, -{-0.715654f,0.640483f,0.379688f}, -{-0.493066f,0.682107f,0.400627f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.636801f,0.683411f,0.392246f}, -{-0.576086f,0.879597f,0.338471f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.493066f,0.682107f,0.400627f}, -{-0.519637f,0.750650f,0.388987f}, -{-0.576086f,0.879597f,0.338471f}, -{-0.493066f,0.682107f,0.400627f}, -{-0.427199f,0.724323f,0.384757f}, -{-0.576086f,0.879597f,0.338471f}, -{-0.519637f,0.750650f,0.388987f}, -{-0.424831f,0.807488f,0.366791f}, -{-0.576086f,0.879597f,0.338471f}, -{-0.427199f,0.724323f,0.384757f}, -{-0.297408f,0.797186f,0.330554f}, -{-0.352404f,0.914374f,0.289321f}, -{-0.424831f,0.807488f,0.366791f}, -{-0.293374f,0.992236f,0.150088f}, -{-0.297408f,0.797186f,0.330554f}, -{-0.245052f,0.887736f,0.257123f}, -{-0.297408f,0.797186f,0.330554f}, -{-0.293374f,0.992236f,0.150088f}, -{-0.352404f,0.914374f,0.289321f}, -{-0.293374f,0.992236f,0.150088f}, -{-0.245052f,0.887736f,0.257123f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.293374f,0.992236f,0.150088f}, -{-0.145167f,0.861934f,0.200777f}, -{-0.154234f,0.928941f,0.130620f}, -{-0.154234f,0.928941f,0.130620f}, -{-0.192389f,0.980613f,0.008831f}, -{-0.293374f,0.992236f,0.150088f}, -{-0.264987f,1.003105f,-0.064779f}, -{-0.332119f,1.025650f,0.008831f}, -{-0.153197f,0.929399f,-0.110639f}, -{-0.153197f,0.929399f,-0.110639f}, -{-0.332119f,1.025650f,0.008831f}, -{-0.192389f,0.980613f,0.008831f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.264987f,1.003105f,-0.064779f}, -{-0.153197f,0.929399f,-0.110639f}, -{-0.353576f,0.913907f,-0.272511f}, -{-0.460142f,0.988548f,-0.212304f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.451818f,0.937811f,-0.279528f}, -{-0.460142f,0.988548f,-0.212304f}, -{-0.486757f,0.850333f,-0.341353f}, -{-0.486757f,0.850333f,-0.341353f}, -{-0.460142f,0.988548f,-0.212304f}, -{-0.353576f,0.913907f,-0.272511f}, -{-0.576517f,0.945698f,-0.268811f}, -{-0.451818f,0.937811f,-0.279528f}, -{-0.486757f,0.850333f,-0.341353f}, -{-0.574064f,0.880628f,-0.320614f}, -{-0.576517f,0.945698f,-0.268811f}, -{-0.486757f,0.850333f,-0.341353f}, -{-0.673981f,0.830009f,-0.323608f}, -{-0.574064f,0.880628f,-0.320614f}, -{-0.731848f,0.719053f,-0.342454f}, -{-0.761288f,0.860279f,-0.263174f}, -{-0.731848f,0.719053f,-0.342454f}, -{-0.815809f,0.672171f,-0.305503f}, -{-0.731848f,0.719053f,-0.342454f}, -{-0.761288f,0.860279f,-0.263174f}, -{-0.673981f,0.830009f,-0.323608f}, -{-0.861645f,0.733082f,-0.247140f}, -{-0.815809f,0.672171f,-0.305503f}, -{-0.851767f,0.550087f,-0.281611f}, -{-0.945193f,0.686743f,-0.153102f}, -{-0.851767f,0.550087f,-0.281611f}, -{-0.910114f,0.613191f,-0.222200f}, -{-0.851767f,0.550087f,-0.281611f}, -{-0.945193f,0.686743f,-0.153102f}, -{-0.861645f,0.733082f,-0.247140f}, -{-0.941942f,0.772379f,-0.070777f}, -{-0.910114f,0.613191f,-0.222200f}, -{-0.990920f,0.564170f,-0.089404f}, -{-0.910114f,0.613191f,-0.222200f}, -{-0.941942f,0.772379f,-0.070777f}, -{-0.945193f,0.686743f,-0.153102f}, -{-0.956689f,0.765584f,0.008831f}, -{-0.990920f,0.564170f,-0.089404f}, -{-1.009633f,0.553243f,0.008831f}, -{-0.990920f,0.564170f,-0.089404f}, -{-0.956689f,0.765584f,0.008831f}, -{-0.941942f,0.772379f,-0.070777f}, -{-0.926588f,0.696818f,0.196804f}, -{-0.956689f,0.765584f,0.008831f}, -{-0.974611f,0.573813f,0.145808f}, -{-0.974611f,0.573813f,0.145808f}, -{-0.956689f,0.765584f,0.008831f}, -{-1.009633f,0.553243f,0.008831f}, -{-0.889064f,0.626333f,0.262181f}, -{-0.926588f,0.696818f,0.196804f}, -{-0.974611f,0.573813f,0.145808f}, -{-0.817347f,0.671244f,0.322110f}, -{-0.926588f,0.696818f,0.196804f}, -{-0.776732f,0.602283f,0.355783f}, -{-0.776732f,0.602283f,0.355783f}, -{-0.926588f,0.696818f,0.196804f}, -{-0.889064f,0.626333f,0.262181f}, -{-0.736999f,0.870850f,0.288701f}, -{-0.782699f,0.850967f,0.271116f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.782699f,0.850967f,0.271116f}, -{-0.817347f,0.671244f,0.322110f}, -{-0.576086f,0.879597f,0.338471f}, -{-0.736999f,0.870850f,0.288701f}, -{-0.732489f,0.718709f,0.359961f}, -{-0.424831f,0.807488f,0.366791f}, -{-0.577227f,0.945386f,0.286633f}, -{-0.576086f,0.879597f,0.338471f}, -{-0.424831f,0.807488f,0.366791f}, -{-0.451608f,0.937898f,0.297067f}, -{-0.577227f,0.945386f,0.286633f}, -{-0.451608f,0.937898f,0.297067f}, -{-0.424831f,0.807488f,0.366791f}, -{-0.352404f,0.914374f,0.289321f}, -{-0.352404f,0.914374f,0.289321f}, -{-0.470619f,1.014874f,0.163578f}, -{-0.451608f,0.937898f,0.297067f}, -{-0.352404f,0.914374f,0.289321f}, -{-0.293374f,0.992236f,0.150088f}, -{-0.470619f,1.014874f,0.163578f}, -{-0.332119f,1.025650f,0.008831f}, -{-0.293374f,0.992236f,0.150088f}, -{-0.192389f,0.980613f,0.008831f}, -{-0.460142f,0.988548f,-0.212304f}, -{-0.425596f,1.026073f,-0.091742f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.311559f,0.985330f,-0.161251f}, -{-0.425596f,1.026073f,-0.091742f}, -{-0.264987f,1.003105f,-0.064779f}, -{-0.504029f,1.007214f,-0.168846f}, -{-0.460142f,0.988548f,-0.212304f}, -{-0.451818f,0.937811f,-0.279528f}, -{-0.576517f,0.945698f,-0.268811f}, -{-0.504029f,1.007214f,-0.168846f}, -{-0.451818f,0.937811f,-0.279528f}, -{-0.574064f,0.880628f,-0.320614f}, -{-0.622462f,0.924528f,-0.275492f}, -{-0.576517f,0.945698f,-0.268811f}, -{-0.574064f,0.880628f,-0.320614f}, -{-0.673981f,0.830009f,-0.323608f}, -{-0.622462f,0.924528f,-0.275492f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.761288f,0.860279f,-0.263174f}, -{-0.815809f,0.672171f,-0.305503f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.815809f,0.672171f,-0.305503f}, -{-0.861645f,0.733082f,-0.247140f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.861645f,0.733082f,-0.247140f}, -{-0.945193f,0.686743f,-0.153102f}, -{-0.945193f,0.686743f,-0.153102f}, -{-0.912459f,0.786374f,-0.132209f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.945193f,0.686743f,-0.153102f}, -{-0.941942f,0.772379f,-0.070777f}, -{-0.912459f,0.786374f,-0.132209f}, -{-0.913197f,0.786017f,0.148708f}, -{-0.956689f,0.765584f,0.008831f}, -{-0.926588f,0.696818f,0.196804f}, -{-0.761481f,0.910490f,0.221616f}, -{-0.913197f,0.786017f,0.148708f}, -{-0.926588f,0.696818f,0.196804f}, -{-0.817347f,0.671244f,0.322110f}, -{-0.761481f,0.910490f,0.221616f}, -{-0.926588f,0.696818f,0.196804f}, -{-0.782699f,0.850967f,0.271116f}, -{-0.761481f,0.910490f,0.221616f}, -{-0.817347f,0.671244f,0.322110f}, -{-0.624131f,0.923742f,0.293310f}, -{-0.736999f,0.870850f,0.288701f}, -{-0.576086f,0.879597f,0.338471f}, -{-0.577227f,0.945386f,0.286633f}, -{-0.624131f,0.923742f,0.293310f}, -{-0.576086f,0.879597f,0.338471f}, -{-0.451608f,0.937898f,0.297067f}, -{-0.498123f,0.976199f,0.254142f}, -{-0.577227f,0.945386f,0.286633f}, -{-0.451608f,0.937898f,0.297067f}, -{-0.470619f,1.014874f,0.163578f}, -{-0.498123f,0.976199f,0.254142f}, -{-0.293374f,0.992236f,0.150088f}, -{-0.332119f,1.025650f,0.008831f}, -{-0.470619f,1.014874f,0.163578f}, -{-0.425596f,1.026073f,-0.091742f}, -{-0.472224f,1.033508f,0.008831f}, -{-0.264987f,1.003105f,-0.064779f}, -{-0.264987f,1.003105f,-0.064779f}, -{-0.472224f,1.033508f,0.008831f}, -{-0.332119f,1.025650f,0.008831f}, -{-0.723771f,0.925663f,-0.219441f}, -{-0.576517f,0.945698f,-0.268811f}, -{-0.622462f,0.924528f,-0.275492f}, -{-0.576517f,0.945698f,-0.268811f}, -{-0.723771f,0.925663f,-0.219441f}, -{-0.504029f,1.007214f,-0.168846f}, -{-0.723771f,0.925663f,-0.219441f}, -{-0.622462f,0.924528f,-0.275492f}, -{-0.673981f,0.830009f,-0.323608f}, -{-0.723771f,0.925663f,-0.219441f}, -{-0.673981f,0.830009f,-0.323608f}, -{-0.761288f,0.860279f,-0.263174f}, -{-0.761288f,0.860279f,-0.263174f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.723771f,0.925663f,-0.219441f}, -{-0.865650f,0.862620f,-0.106504f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.912459f,0.786374f,-0.132209f}, -{-0.865650f,0.862620f,-0.106504f}, -{-0.912459f,0.786374f,-0.132209f}, -{-0.941942f,0.772379f,-0.070777f}, -{-0.941942f,0.772379f,-0.070777f}, -{-0.896793f,0.848784f,-0.027677f}, -{-0.865650f,0.862620f,-0.106504f}, -{-0.900574f,0.847134f,0.008831f}, -{-0.941942f,0.772379f,-0.070777f}, -{-0.956689f,0.765584f,0.008831f}, -{-0.941942f,0.772379f,-0.070777f}, -{-0.900574f,0.847134f,0.008831f}, -{-0.896793f,0.848784f,-0.027677f}, -{-0.878808f,0.856710f,0.099709f}, -{-0.900574f,0.847134f,0.008831f}, -{-0.956689f,0.765584f,0.008831f}, -{-0.913197f,0.786017f,0.148708f}, -{-0.878808f,0.856710f,0.099709f}, -{-0.956689f,0.765584f,0.008831f}, -{-0.761481f,0.910490f,0.221616f}, -{-0.878808f,0.856710f,0.099709f}, -{-0.913197f,0.786017f,0.148708f}, -{-0.653617f,0.986254f,0.171957f}, -{-0.761481f,0.910490f,0.221616f}, -{-0.782699f,0.850967f,0.271116f}, -{-0.736999f,0.870850f,0.288701f}, -{-0.653617f,0.986254f,0.171957f}, -{-0.782699f,0.850967f,0.271116f}, -{-0.624131f,0.923742f,0.293310f}, -{-0.653617f,0.986254f,0.171957f}, -{-0.736999f,0.870850f,0.288701f}, -{-0.498123f,0.976199f,0.254142f}, -{-0.653617f,0.986254f,0.171957f}, -{-0.577227f,0.945386f,0.286633f}, -{-0.577227f,0.945386f,0.286633f}, -{-0.653617f,0.986254f,0.171957f}, -{-0.624131f,0.923742f,0.293310f}, -{-0.472224f,1.033508f,0.008831f}, -{-0.470619f,1.014874f,0.163578f}, -{-0.332119f,1.025650f,0.008831f}, -{-0.460142f,0.988548f,-0.212304f}, -{-0.559824f,1.014232f,-0.120742f}, -{-0.425596f,1.026073f,-0.091742f}, -{-0.504029f,1.007214f,-0.168846f}, -{-0.559824f,1.014232f,-0.120742f}, -{-0.460142f,0.988548f,-0.212304f}, -{-0.723771f,0.925663f,-0.219441f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.743215f,0.953685f,-0.130043f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.805015f,0.929169f,-0.056431f}, -{-0.743215f,0.953685f,-0.130043f}, -{-0.865650f,0.862620f,-0.106504f}, -{-0.805015f,0.929169f,-0.056431f}, -{-0.808318f,0.889257f,-0.171204f}, -{-0.805015f,0.929169f,-0.056431f}, -{-0.865650f,0.862620f,-0.106504f}, -{-0.896793f,0.848784f,-0.027677f}, -{-0.756722f,0.960121f,0.071069f}, -{-0.896793f,0.848784f,-0.027677f}, -{-0.900574f,0.847134f,0.008831f}, -{-0.896793f,0.848784f,-0.027677f}, -{-0.756722f,0.960121f,0.071069f}, -{-0.805015f,0.929169f,-0.056431f}, -{-0.878808f,0.856710f,0.099709f}, -{-0.756722f,0.960121f,0.071069f}, -{-0.900574f,0.847134f,0.008831f}, -{-0.761481f,0.910490f,0.221616f}, -{-0.756722f,0.960121f,0.071069f}, -{-0.878808f,0.856710f,0.099709f}, -{-0.756722f,0.960121f,0.071069f}, -{-0.761481f,0.910490f,0.221616f}, -{-0.754114f,0.949394f,0.139330f}, -{-0.761481f,0.910490f,0.221616f}, -{-0.653617f,0.986254f,0.171957f}, -{-0.754114f,0.949394f,0.139330f}, -{-0.470619f,1.014874f,0.163578f}, -{-0.618183f,1.014147f,0.008831f}, -{-0.498123f,0.976199f,0.254142f}, -{-0.618183f,1.014147f,0.008831f}, -{-0.470619f,1.014874f,0.163578f}, -{-0.472224f,1.033508f,0.008831f}, -{-0.559824f,1.014232f,-0.120742f}, -{-0.472224f,1.033508f,0.008831f}, -{-0.425596f,1.026073f,-0.091742f}, -{-0.472224f,1.033508f,0.008831f}, -{-0.559824f,1.014232f,-0.120742f}, -{-0.618183f,1.014147f,0.008831f}, -{-0.504029f,1.007214f,-0.168846f}, -{-0.743215f,0.953685f,-0.130043f}, -{-0.559824f,1.014232f,-0.120742f}, -{-0.743215f,0.953685f,-0.130043f}, -{-0.504029f,1.007214f,-0.168846f}, -{-0.723771f,0.925663f,-0.219441f}, -{-0.685379f,0.992249f,0.085837f}, -{-0.805015f,0.929169f,-0.056431f}, -{-0.756722f,0.960121f,0.071069f}, -{-0.805015f,0.929169f,-0.056431f}, -{-0.685379f,0.992249f,0.085837f}, -{-0.743215f,0.953685f,-0.130043f}, -{-0.685379f,0.992249f,0.085837f}, -{-0.756722f,0.960121f,0.071069f}, -{-0.754114f,0.949394f,0.139330f}, -{-0.653617f,0.986254f,0.171957f}, -{-0.685379f,0.992249f,0.085837f}, -{-0.754114f,0.949394f,0.139330f}, -{-0.498123f,0.976199f,0.254142f}, -{-0.685379f,0.992249f,0.085837f}, -{-0.653617f,0.986254f,0.171957f}, -{-0.618183f,1.014147f,0.008831f}, -{-0.685379f,0.992249f,0.085837f}, -{-0.498123f,0.976199f,0.254142f}, -{-0.559824f,1.014232f,-0.120742f}, -{-0.685379f,0.992249f,0.085837f}, -{-0.618183f,1.014147f,0.008831f}, -{-0.685379f,0.992249f,0.085837f}, -{-0.559824f,1.014232f,-0.120742f}, -{-0.743215f,0.953685f,-0.130043f}, -{-0.913709f,0.248567f,-0.048017f}, -{-0.935086f,0.373720f,-0.140379f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.816246f,0.219594f,-0.137372f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.697237f,0.190662f,-0.171178f}, -{-0.499776f,0.133654f,-0.150582f}, -{-0.600774f,0.120701f,-0.133308f}, -{-0.600774f,0.120701f,-0.133308f}, -{-0.499776f,0.133654f,-0.150582f}, -{-0.569195f,0.047207f,-0.105737f}, -{-0.590373f,0.117014f,0.149670f}, -{-0.543369f,0.227401f,0.245080f}, -{-0.726777f,0.165369f,0.156838f}, -{-0.824779f,0.142876f,0.066613f}, -{-0.970256f,0.344040f,0.008831f}, -{-0.909153f,0.230021f,0.038237f}, -{-0.350603f,0.093083f,0.164192f}, -{-0.426302f,0.003976f,0.129716f}, -{-0.475109f,0.019966f,0.128767f}, -{-0.450839f,0.043866f,-0.092489f}, -{-0.569195f,0.047207f,-0.105737f}, -{-0.600774f,0.120701f,-0.133308f}, -{-0.816246f,0.219594f,-0.137372f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.832685f,0.336639f,0.247367f}, -{-0.824779f,0.142876f,0.066613f}, -{-0.815154f,0.196699f,0.134399f}, -{-0.832357f,0.336963f,-0.230141f}, -{-0.810726f,0.143830f,-0.062953f}, -{-0.935086f,0.373720f,-0.140379f}, -{-0.935086f,0.373720f,-0.140379f}, -{-0.913709f,0.248567f,-0.048017f}, -{-0.964325f,0.349059f,-0.050380f}, -{-0.913709f,0.248567f,-0.048017f}, -{-0.970256f,0.344040f,0.008831f}, -{-0.964325f,0.349059f,-0.050380f}, -{-0.970256f,0.344040f,0.008831f}, -{-0.824779f,0.142876f,0.066613f}, -{-0.936187f,0.372794f,0.155570f}, -{-0.936187f,0.372794f,0.155570f}, -{-0.824779f,0.142876f,0.066613f}, -{-0.832685f,0.336639f,0.247367f}, -{-0.909153f,0.230021f,0.038237f}, -{-0.970256f,0.344040f,0.008831f}, -{-0.913709f,0.248567f,-0.048017f}, -{-0.547332f,-0.388743f,0.063119f}, -{-0.550079f,-0.398043f,0.011138f}, -{-0.501412f,-0.488300f,0.011196f}, -{-0.497945f,-0.471270f,0.097842f}, -{-0.545130f,-0.381469f,0.080591f}, -{-0.547332f,-0.388743f,0.063119f}, -{-0.501412f,-0.488300f,0.011196f}, -{-0.497945f,-0.471270f,0.097842f}, -{-0.547332f,-0.388743f,0.063119f}, -{-0.545130f,-0.381469f,0.080591f}, -{-0.560722f,-0.349176f,0.011072f}, -{-0.547332f,-0.388743f,0.063119f}, -{-0.560722f,-0.349176f,0.011072f}, -{-0.545130f,-0.381469f,0.080591f}, -{-0.555103f,-0.332963f,0.071434f}, -{-0.547332f,-0.388743f,0.063119f}, -{-0.560722f,-0.349176f,0.011072f}, -{-0.550079f,-0.398043f,0.011138f}, -{-0.486613f,-0.419177f,0.182356f}, -{-0.545130f,-0.381469f,0.080591f}, -{-0.493364f,-0.449554f,0.140799f}, -{-0.545130f,-0.381469f,0.080591f}, -{-0.486613f,-0.419177f,0.182356f}, -{-0.528754f,-0.330569f,0.148089f}, -{-0.493364f,-0.449554f,0.140799f}, -{-0.545130f,-0.381469f,0.080591f}, -{-0.497945f,-0.471270f,0.097842f}, -{-0.515971f,-0.296022f,0.177163f}, -{-0.477385f,-0.383358f,0.220877f}, -{-0.499401f,-0.258668f,0.203390f}, -{-0.477385f,-0.383358f,0.220877f}, -{-0.528754f,-0.330569f,0.148089f}, -{-0.486613f,-0.419177f,0.182356f}, -{-0.528754f,-0.330569f,0.148089f}, -{-0.477385f,-0.383358f,0.220877f}, -{-0.515971f,-0.296022f,0.177163f}, -{-0.368336f,-0.254687f,0.378404f}, -{-0.360789f,-0.182434f,0.358609f}, -{-0.389042f,-0.124913f,0.264001f}, -{-0.389042f,-0.124913f,0.264001f}, -{-0.421948f,-0.151893f,0.259289f}, -{-0.368336f,-0.254687f,0.378404f}, -{-0.368336f,-0.254687f,0.378404f}, -{-0.451868f,-0.184248f,0.246310f}, -{-0.424058f,-0.259452f,0.324576f}, -{-0.451868f,-0.184248f,0.246310f}, -{-0.368336f,-0.254687f,0.378404f}, -{-0.421948f,-0.151893f,0.259289f}, -{-0.327785f,-0.092566f,0.250131f}, -{-0.389042f,-0.124913f,0.264001f}, -{-0.326741f,-0.154667f,0.355902f}, -{-0.389042f,-0.124913f,0.264001f}, -{-0.360789f,-0.182434f,0.358609f}, -{-0.326741f,-0.154667f,0.355902f}, -{-0.147168f,-0.085620f,0.215947f}, -{-0.111865f,-0.080516f,0.168778f}, -{-0.203782f,-0.067624f,0.150119f}, -{-0.231992f,-0.070347f,0.181147f}, -{-0.166414f,-0.088964f,0.238733f}, -{-0.147168f,-0.085620f,0.215947f}, -{-0.203782f,-0.067624f,0.150119f}, -{-0.231992f,-0.070347f,0.181147f}, -{-0.147168f,-0.085620f,0.215947f}, -{-0.179432f,-0.066110f,0.116692f}, -{-0.111865f,-0.080516f,0.168778f}, -{-0.074181f,-0.074924f,0.103180f}, -{-0.162304f,-0.065348f,0.084402f}, -{-0.179432f,-0.066110f,0.116692f}, -{-0.074181f,-0.074924f,0.103180f}, -{-0.179432f,-0.066110f,0.116692f}, -{-0.203782f,-0.067624f,0.150119f}, -{-0.111865f,-0.080516f,0.168778f}, -{-0.058041f,-0.071582f,0.051683f}, -{-0.148016f,-0.064903f,0.011139f}, -{-0.074181f,-0.074924f,0.103180f}, -{-0.074181f,-0.074924f,0.103180f}, -{-0.148016f,-0.064903f,0.011139f}, -{-0.162304f,-0.065348f,0.084402f}, -{-0.070942f,-0.074729f,-0.076541f}, -{-0.149523f,-0.064983f,-0.019151f}, -{-0.057529f,-0.071583f,-0.027618f}, -{-0.149523f,-0.064983f,-0.019151f}, -{-0.070942f,-0.074729f,-0.076541f}, -{-0.159933f,-0.065380f,-0.058577f}, -{-0.057529f,-0.071583f,-0.027618f}, -{-0.148016f,-0.064903f,0.011139f}, -{-0.058041f,-0.071582f,0.051683f}, -{-0.148016f,-0.064903f,0.011139f}, -{-0.057529f,-0.071583f,-0.027618f}, -{-0.149523f,-0.064983f,-0.019151f}, -{-0.125219f,-0.083233f,-0.170020f}, -{-0.201037f,-0.067664f,-0.127122f}, -{-0.070942f,-0.074729f,-0.076541f}, -{-0.159933f,-0.065380f,-0.058577f}, -{-0.070942f,-0.074729f,-0.076541f}, -{-0.201037f,-0.067664f,-0.127122f}, -{-0.202742f,-0.086092f,-0.217563f}, -{-0.243362f,-0.072214f,-0.171929f}, -{-0.198765f,-0.079337f,-0.188027f}, -{-0.297547f,-0.174158f,-0.365961f}, -{-0.360519f,-0.184392f,-0.340340f}, -{-0.388213f,-0.126167f,-0.242428f}, -{-0.388213f,-0.126167f,-0.242428f}, -{-0.358086f,-0.107641f,-0.238958f}, -{-0.297547f,-0.174158f,-0.365961f}, -{-0.423572f,-0.261461f,-0.305663f}, -{-0.450836f,-0.185466f,-0.224737f}, -{-0.368294f,-0.257902f,-0.361736f}, -{-0.368294f,-0.257902f,-0.361736f}, -{-0.450836f,-0.185466f,-0.224737f}, -{-0.421068f,-0.153229f,-0.237698f}, -{-0.388213f,-0.126167f,-0.242428f}, -{-0.360519f,-0.184392f,-0.340340f}, -{-0.368294f,-0.257902f,-0.361736f}, -{-0.421068f,-0.153229f,-0.237698f}, -{-0.388213f,-0.126167f,-0.242428f}, -{-0.368294f,-0.257902f,-0.361736f}, -{-0.485707f,-0.422426f,-0.161048f}, -{-0.537555f,-0.360128f,-0.095471f}, -{-0.476087f,-0.385187f,-0.201486f}, -{-0.476087f,-0.385187f,-0.201486f}, -{-0.537555f,-0.360128f,-0.095471f}, -{-0.514781f,-0.296720f,-0.156380f}, -{-0.476087f,-0.385187f,-0.201486f}, -{-0.514781f,-0.296720f,-0.156380f}, -{-0.497319f,-0.257788f,-0.183325f}, -{-0.497077f,-0.470775f,-0.080759f}, -{-0.544261f,-0.380273f,-0.062496f}, -{-0.492253f,-0.450493f,-0.121733f}, -{-0.492253f,-0.450493f,-0.121733f}, -{-0.544261f,-0.380273f,-0.062496f}, -{-0.537555f,-0.360128f,-0.095471f}, -{-0.492253f,-0.450493f,-0.121733f}, -{-0.537555f,-0.360128f,-0.095471f}, -{-0.485707f,-0.422426f,-0.161048f}, -{-0.501412f,-0.488300f,0.011196f}, -{-0.550079f,-0.398043f,0.011138f}, -{-0.549727f,-0.396914f,-0.007060f}, -{-0.500334f,-0.483986f,-0.035067f}, -{-0.501412f,-0.488300f,0.011196f}, -{-0.549727f,-0.396914f,-0.007060f}, -{-0.550079f,-0.398043f,0.011138f}, -{-0.560722f,-0.349176f,0.011072f}, -{-0.549727f,-0.396914f,-0.007060f}, -{-0.549727f,-0.396914f,-0.007060f}, -{-0.560722f,-0.349176f,0.011072f}, -{-0.559234f,-0.344801f,-0.020738f}, -{-0.549727f,-0.396914f,-0.007060f}, -{-0.559234f,-0.344801f,-0.020738f}, -{-0.544261f,-0.380273f,-0.062496f}, -{-0.500334f,-0.483986f,-0.035067f}, -{-0.549727f,-0.396914f,-0.007060f}, -{-0.544261f,-0.380273f,-0.062496f}, -{-0.497077f,-0.470775f,-0.080759f}, -{-0.500334f,-0.483986f,-0.035067f}, -{-0.544261f,-0.380273f,-0.062496f}, -{-0.341625f,-0.613177f,0.116191f}, -{-0.497945f,-0.471270f,0.097842f}, -{-0.501412f,-0.488300f,0.011196f}, -{-0.342783f,-0.627706f,0.011084f}, -{-0.341625f,-0.613177f,0.116191f}, -{-0.501412f,-0.488300f,0.011196f}, -{-0.493364f,-0.449554f,0.140799f}, -{-0.497945f,-0.471270f,0.097842f}, -{-0.341625f,-0.613177f,0.116191f}, -{-0.335468f,-0.568181f,0.217848f}, -{-0.486613f,-0.419177f,0.182356f}, -{-0.493364f,-0.449554f,0.140799f}, -{-0.341625f,-0.613177f,0.116191f}, -{-0.335468f,-0.568181f,0.217848f}, -{-0.493364f,-0.449554f,0.140799f}, -{-0.477385f,-0.383358f,0.220877f}, -{-0.486613f,-0.419177f,0.182356f}, -{-0.335468f,-0.568181f,0.217848f}, -{-0.335468f,-0.568181f,0.217848f}, -{-0.318029f,-0.499234f,0.306984f}, -{-0.399403f,-0.425711f,0.292753f}, -{-0.399403f,-0.425711f,0.292753f}, -{-0.477385f,-0.383358f,0.220877f}, -{-0.335468f,-0.568181f,0.217848f}, -{-0.277373f,-0.411288f,0.380856f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.301072f,-0.456809f,0.347211f}, -{-0.446964f,-0.301290f,0.293249f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.424058f,-0.259452f,0.324576f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.477385f,-0.383358f,0.220877f}, -{-0.399403f,-0.425711f,0.292753f}, -{-0.477385f,-0.383358f,0.220877f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.446964f,-0.301290f,0.293249f}, -{-0.301072f,-0.456809f,0.347211f}, -{-0.399403f,-0.425711f,0.292753f}, -{-0.318029f,-0.499234f,0.306984f}, -{-0.399403f,-0.425711f,0.292753f}, -{-0.301072f,-0.456809f,0.347211f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.332758f,-0.213138f,0.390733f}, -{-0.360789f,-0.182434f,0.358609f}, -{-0.351462f,-0.233598f,0.386572f}, -{-0.351462f,-0.233598f,0.386572f}, -{-0.360789f,-0.182434f,0.358609f}, -{-0.368336f,-0.254687f,0.378404f}, -{-0.368336f,-0.254687f,0.378404f}, -{-0.332791f,-0.291448f,0.397380f}, -{-0.351462f,-0.233598f,0.386572f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.332791f,-0.291448f,0.397380f}, -{-0.368336f,-0.254687f,0.378404f}, -{-0.424058f,-0.259452f,0.324576f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.368336f,-0.254687f,0.378404f}, -{-0.246428f,-0.363260f,0.404451f}, -{-0.332791f,-0.291448f,0.397380f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.361743f,-0.337329f,0.370439f}, -{-0.277373f,-0.411288f,0.380856f}, -{-0.246428f,-0.363260f,0.404451f}, -{-0.332758f,-0.213138f,0.390733f}, -{-0.326741f,-0.154667f,0.355902f}, -{-0.360789f,-0.182434f,0.358609f}, -{0.105245f,-0.127328f,0.122333f}, -{0.064387f,-0.109897f,0.119940f}, -{0.080289f,-0.135971f,0.171230f}, -{0.080289f,-0.135971f,0.171230f}, -{0.064387f,-0.109897f,0.119940f}, -{0.046433f,-0.115236f,0.155983f}, -{-0.019773f,-0.099603f,0.173257f}, -{0.046433f,-0.115236f,0.155983f}, -{0.064387f,-0.109897f,0.119940f}, -{0.064387f,-0.109897f,0.119940f}, -{0.019487f,-0.095112f,0.116059f}, -{-0.019773f,-0.099603f,0.173257f}, -{0.019487f,-0.095112f,0.116059f}, -{-0.067799f,-0.090509f,0.181699f}, -{-0.019773f,-0.099603f,0.173257f}, -{0.019487f,-0.095112f,0.116059f}, -{-0.074181f,-0.074924f,0.103180f}, -{-0.067799f,-0.090509f,0.181699f}, -{-0.074181f,-0.074924f,0.103180f}, -{-0.111865f,-0.080516f,0.168778f}, -{-0.067799f,-0.090509f,0.181699f}, -{0.080289f,-0.135971f,0.171230f}, -{0.046433f,-0.115236f,0.155983f}, -{0.004368f,-0.124361f,0.220649f}, -{0.045404f,-0.146120f,0.224543f}, -{0.080289f,-0.135971f,0.171230f}, -{0.004368f,-0.124361f,0.220649f}, -{0.004368f,-0.124361f,0.220649f}, -{0.046433f,-0.115236f,0.155983f}, -{-0.019773f,-0.099603f,0.173257f}, -{-0.058041f,-0.071582f,0.051683f}, -{-0.074181f,-0.074924f,0.103180f}, -{0.019487f,-0.095112f,0.116059f}, -{0.040617f,-0.088053f,0.011084f}, -{-0.058041f,-0.071582f,0.051683f}, -{0.019487f,-0.095112f,0.116059f}, -{0.064387f,-0.109897f,0.119940f}, -{0.105245f,-0.127328f,0.122333f}, -{0.126617f,-0.117726f,0.011206f}, -{0.040617f,-0.088053f,0.011084f}, -{0.019487f,-0.095112f,0.116059f}, -{0.064387f,-0.109897f,0.119940f}, -{0.126617f,-0.117726f,0.011206f}, -{0.040617f,-0.088053f,0.011084f}, -{0.064387f,-0.109897f,0.119940f}, -{0.040617f,-0.088053f,0.011084f}, -{0.023791f,-0.094983f,-0.088852f}, -{-0.057529f,-0.071583f,-0.027618f}, -{0.023791f,-0.094983f,-0.088852f}, -{-0.070942f,-0.074729f,-0.076541f}, -{-0.057529f,-0.071583f,-0.027618f}, -{-0.057529f,-0.071583f,-0.027618f}, -{-0.058041f,-0.071582f,0.051683f}, -{0.040617f,-0.088053f,0.011084f}, -{0.040617f,-0.088053f,0.011084f}, -{0.109742f,-0.127612f,-0.093903f}, -{0.023791f,-0.094983f,-0.088852f}, -{0.109742f,-0.127612f,-0.093903f}, -{0.040617f,-0.088053f,0.011084f}, -{0.126617f,-0.117726f,0.011206f}, -{0.000189f,-0.101606f,-0.138466f}, -{-0.070942f,-0.074729f,-0.076541f}, -{0.023791f,-0.094983f,-0.088852f}, -{0.086466f,-0.137432f,-0.143963f}, -{0.023791f,-0.094983f,-0.088852f}, -{0.109742f,-0.127612f,-0.093903f}, -{0.023791f,-0.094983f,-0.088852f}, -{0.086466f,-0.137432f,-0.143963f}, -{0.000189f,-0.101606f,-0.138466f}, -{-0.297547f,-0.174158f,-0.365961f}, -{-0.332583f,-0.216149f,-0.374513f}, -{-0.360519f,-0.184392f,-0.340340f}, -{-0.316237f,-0.379687f,-0.358090f}, -{-0.359857f,-0.341236f,-0.352227f}, -{-0.331117f,-0.295393f,-0.379450f}, -{-0.316237f,-0.379687f,-0.358090f}, -{-0.331117f,-0.295393f,-0.379450f}, -{-0.286552f,-0.332472f,-0.383720f}, -{-0.270431f,-0.415366f,-0.356798f}, -{-0.316237f,-0.379687f,-0.358090f}, -{-0.286552f,-0.332472f,-0.383720f}, -{-0.331117f,-0.295393f,-0.379450f}, -{-0.359857f,-0.341236f,-0.352227f}, -{-0.423572f,-0.261461f,-0.305663f}, -{-0.368294f,-0.257902f,-0.361736f}, -{-0.331117f,-0.295393f,-0.379450f}, -{-0.423572f,-0.261461f,-0.305663f}, -{-0.331117f,-0.295393f,-0.379450f}, -{-0.368294f,-0.257902f,-0.361736f}, -{-0.332583f,-0.216149f,-0.374513f}, -{-0.360519f,-0.184392f,-0.340340f}, -{-0.332583f,-0.216149f,-0.374513f}, -{-0.368294f,-0.257902f,-0.361736f}, -{-0.310779f,-0.500492f,-0.286636f}, -{-0.396413f,-0.427564f,-0.275969f}, -{-0.381031f,-0.385120f,-0.316489f}, -{-0.396413f,-0.427564f,-0.275969f}, -{-0.476087f,-0.385187f,-0.201486f}, -{-0.381031f,-0.385120f,-0.316489f}, -{-0.381031f,-0.385120f,-0.316489f}, -{-0.476087f,-0.385187f,-0.201486f}, -{-0.423572f,-0.261461f,-0.305663f}, -{-0.381031f,-0.385120f,-0.316489f}, -{-0.423572f,-0.261461f,-0.305663f}, -{-0.359857f,-0.341236f,-0.352227f}, -{-0.316237f,-0.379687f,-0.358090f}, -{-0.270431f,-0.415366f,-0.356798f}, -{-0.310779f,-0.500492f,-0.286636f}, -{-0.381031f,-0.385120f,-0.316489f}, -{-0.359857f,-0.341236f,-0.352227f}, -{-0.316237f,-0.379687f,-0.358090f}, -{-0.310779f,-0.500492f,-0.286636f}, -{-0.381031f,-0.385120f,-0.316489f}, -{-0.316237f,-0.379687f,-0.358090f}, -{-0.396413f,-0.427564f,-0.275969f}, -{-0.310779f,-0.500492f,-0.286636f}, -{-0.330254f,-0.571802f,-0.194693f}, -{-0.330254f,-0.571802f,-0.194693f}, -{-0.485707f,-0.422426f,-0.161048f}, -{-0.476087f,-0.385187f,-0.201486f}, -{-0.476087f,-0.385187f,-0.201486f}, -{-0.396413f,-0.427564f,-0.275969f}, -{-0.330254f,-0.571802f,-0.194693f}, -{-0.492253f,-0.450493f,-0.121733f}, -{-0.485707f,-0.422426f,-0.161048f}, -{-0.330254f,-0.571802f,-0.194693f}, -{-0.339017f,-0.613021f,-0.099116f}, -{-0.497077f,-0.470775f,-0.080759f}, -{-0.492253f,-0.450493f,-0.121733f}, -{-0.330254f,-0.571802f,-0.194693f}, -{-0.339017f,-0.613021f,-0.099116f}, -{-0.492253f,-0.450493f,-0.121733f}, -{-0.500334f,-0.483986f,-0.035067f}, -{-0.497077f,-0.470775f,-0.080759f}, -{-0.339017f,-0.613021f,-0.099116f}, -{-0.342783f,-0.627706f,0.011084f}, -{-0.501412f,-0.488300f,0.011196f}, -{-0.500334f,-0.483986f,-0.035067f}, -{-0.339017f,-0.613021f,-0.099116f}, -{-0.342783f,-0.627706f,0.011084f}, -{-0.500334f,-0.483986f,-0.035067f}, -{-0.168862f,-0.736367f,0.119910f}, -{-0.342783f,-0.627706f,0.011084f}, -{-0.170794f,-0.750320f,0.011127f}, -{-0.342783f,-0.627706f,0.011084f}, -{-0.168862f,-0.736367f,0.119910f}, -{-0.341625f,-0.613177f,0.116191f}, -{-0.157275f,-0.695104f,0.223596f}, -{-0.341625f,-0.613177f,0.116191f}, -{-0.168862f,-0.736367f,0.119910f}, -{-0.341625f,-0.613177f,0.116191f}, -{-0.157275f,-0.695104f,0.223596f}, -{-0.335468f,-0.568181f,0.217848f}, -{-0.130035f,-0.631608f,0.306778f}, -{-0.335468f,-0.568181f,0.217848f}, -{-0.157275f,-0.695104f,0.223596f}, -{-0.335468f,-0.568181f,0.217848f}, -{-0.130035f,-0.631608f,0.306778f}, -{-0.318029f,-0.499234f,0.306984f}, -{-0.177641f,-0.480891f,0.368749f}, -{-0.277373f,-0.411288f,0.380856f}, -{-0.301072f,-0.456809f,0.347211f}, -{-0.301072f,-0.456809f,0.347211f}, -{-0.318029f,-0.499234f,0.306984f}, -{-0.130035f,-0.631608f,0.306778f}, -{-0.130035f,-0.631608f,0.306778f}, -{-0.077398f,-0.547866f,0.359727f}, -{-0.177641f,-0.480891f,0.368749f}, -{-0.177641f,-0.480891f,0.368749f}, -{-0.301072f,-0.456809f,0.347211f}, -{-0.130035f,-0.631608f,0.306778f}, -{-0.004625f,-0.457333f,0.370803f}, -{-0.105466f,-0.386213f,0.388652f}, -{-0.042697f,-0.502379f,0.370860f}, -{-0.042697f,-0.502379f,0.370860f}, -{-0.105466f,-0.386213f,0.388652f}, -{-0.144161f,-0.433891f,0.384889f}, -{-0.144161f,-0.433891f,0.384889f}, -{-0.277373f,-0.411288f,0.380856f}, -{-0.177641f,-0.480891f,0.368749f}, -{-0.277373f,-0.411288f,0.380856f}, -{-0.144161f,-0.433891f,0.384889f}, -{-0.246428f,-0.363260f,0.404451f}, -{-0.042697f,-0.502379f,0.370860f}, -{-0.144161f,-0.433891f,0.384889f}, -{-0.077398f,-0.547866f,0.359727f}, -{-0.077398f,-0.547866f,0.359727f}, -{-0.144161f,-0.433891f,0.384889f}, -{-0.177641f,-0.480891f,0.368749f}, -{0.064971f,-0.385246f,0.344817f}, -{0.017426f,-0.346902f,0.352166f}, -{0.047139f,-0.402582f,0.354264f}, -{0.047139f,-0.402582f,0.354264f}, -{0.017426f,-0.346902f,0.352166f}, -{0.029571f,-0.420403f,0.361776f}, -{0.137173f,-0.322251f,0.289443f}, -{0.090711f,-0.222883f,0.263048f}, -{0.100829f,-0.352558f,0.320623f}, -{0.100829f,-0.352558f,0.320623f}, -{0.090711f,-0.222883f,0.263048f}, -{-0.005216f,-0.266256f,0.343910f}, -{0.202477f,-0.273317f,0.214283f}, -{0.126724f,-0.204070f,0.218727f}, -{0.090711f,-0.222883f,0.263048f}, -{0.202477f,-0.273317f,0.214283f}, -{0.090711f,-0.222883f,0.263048f}, -{0.137173f,-0.322251f,0.289443f}, -{0.250232f,-0.240956f,0.124853f}, -{0.181153f,-0.176556f,0.124057f}, -{0.229969f,-0.254352f,0.170133f}, -{0.229969f,-0.254352f,0.170133f}, -{0.181153f,-0.176556f,0.124057f}, -{0.158271f,-0.188463f,0.170843f}, -{0.181153f,-0.176556f,0.124057f}, -{0.105245f,-0.127328f,0.122333f}, -{0.080289f,-0.135971f,0.171230f}, -{0.158271f,-0.188463f,0.170843f}, -{0.181153f,-0.176556f,0.124057f}, -{0.080289f,-0.135971f,0.171230f}, -{0.158271f,-0.188463f,0.170843f}, -{0.080289f,-0.135971f,0.171230f}, -{0.045404f,-0.146120f,0.224543f}, -{0.126724f,-0.204070f,0.218727f}, -{0.158271f,-0.188463f,0.170843f}, -{0.045404f,-0.146120f,0.224543f}, -{0.229969f,-0.254352f,0.170133f}, -{0.158271f,-0.188463f,0.170843f}, -{0.202477f,-0.273317f,0.214283f}, -{0.202477f,-0.273317f,0.214283f}, -{0.158271f,-0.188463f,0.170843f}, -{0.126724f,-0.204070f,0.218727f}, -{0.126617f,-0.117726f,0.011206f}, -{0.105245f,-0.127328f,0.122333f}, -{0.181153f,-0.176556f,0.124057f}, -{0.181153f,-0.176556f,0.124057f}, -{0.250232f,-0.240956f,0.124853f}, -{0.268612f,-0.229703f,0.011213f}, -{0.126617f,-0.117726f,0.011206f}, -{0.181153f,-0.176556f,0.124057f}, -{0.268612f,-0.229703f,0.011213f}, -{0.255319f,-0.242254f,-0.097017f}, -{0.126617f,-0.117726f,0.011206f}, -{0.268612f,-0.229703f,0.011213f}, -{0.126617f,-0.117726f,0.011206f}, -{0.255319f,-0.242254f,-0.097017f}, -{0.109742f,-0.127612f,-0.093903f}, -{0.133485f,-0.207118f,-0.193611f}, -{0.051721f,-0.148377f,-0.198787f}, -{0.086466f,-0.137432f,-0.143963f}, -{0.086466f,-0.137432f,-0.143963f}, -{0.109742f,-0.127612f,-0.093903f}, -{0.255319f,-0.242254f,-0.097017f}, -{0.255319f,-0.242254f,-0.097017f}, -{0.210673f,-0.278437f,-0.190560f}, -{0.133485f,-0.207118f,-0.193611f}, -{0.133485f,-0.207118f,-0.193611f}, -{0.086466f,-0.137432f,-0.143963f}, -{0.255319f,-0.242254f,-0.097017f}, -{0.149091f,-0.327626f,-0.264295f}, -{0.099286f,-0.226394f,-0.236522f}, -{0.181427f,-0.301468f,-0.229379f}, -{0.099286f,-0.226394f,-0.236522f}, -{0.149091f,-0.327626f,-0.264295f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.181427f,-0.301468f,-0.229379f}, -{0.133485f,-0.207118f,-0.193611f}, -{0.210673f,-0.278437f,-0.190560f}, -{0.133485f,-0.207118f,-0.193611f}, -{0.181427f,-0.301468f,-0.229379f}, -{0.099286f,-0.226394f,-0.236522f}, -{0.075309f,-0.393092f,-0.322131f}, -{-0.005142f,-0.356243f,-0.339157f}, -{0.093577f,-0.375942f,-0.310486f}, -{0.093577f,-0.375942f,-0.310486f}, -{0.065259f,-0.319680f,-0.302512f}, -{0.149091f,-0.327626f,-0.264295f}, -{-0.029094f,-0.409284f,-0.350942f}, -{-0.032181f,-0.509782f,-0.348797f}, -{-0.046569f,-0.428486f,-0.354151f}, -{-0.046569f,-0.428486f,-0.354151f}, -{-0.052308f,-0.329493f,-0.359209f}, -{-0.029094f,-0.409284f,-0.350942f}, -{-0.052308f,-0.329493f,-0.359209f}, -{-0.046569f,-0.428486f,-0.354151f}, -{-0.136648f,-0.439410f,-0.360300f}, -{-0.029094f,-0.409284f,-0.350942f}, -{-0.005142f,-0.356243f,-0.339157f}, -{0.039885f,-0.428334f,-0.339342f}, -{-0.066672f,-0.554861f,-0.337899f}, -{-0.136648f,-0.439410f,-0.360300f}, -{-0.032181f,-0.509782f,-0.348797f}, -{-0.136648f,-0.439410f,-0.360300f}, -{-0.066672f,-0.554861f,-0.337899f}, -{-0.170142f,-0.485858f,-0.344920f}, -{-0.270431f,-0.415366f,-0.356798f}, -{-0.286552f,-0.332472f,-0.383720f}, -{-0.187485f,-0.404612f,-0.370293f}, -{-0.187485f,-0.404612f,-0.370293f}, -{-0.136648f,-0.439410f,-0.360300f}, -{-0.170142f,-0.485858f,-0.344920f}, -{-0.270431f,-0.415366f,-0.356798f}, -{-0.187485f,-0.404612f,-0.370293f}, -{-0.170142f,-0.485858f,-0.344920f}, -{-0.168986f,-0.380329f,-0.375081f}, -{-0.136648f,-0.439410f,-0.360300f}, -{-0.187485f,-0.404612f,-0.370293f}, -{-0.136648f,-0.439410f,-0.360300f}, -{-0.046569f,-0.428486f,-0.354151f}, -{-0.032181f,-0.509782f,-0.348797f}, -{-0.310779f,-0.500492f,-0.286636f}, -{-0.270431f,-0.415366f,-0.356798f}, -{-0.170142f,-0.485858f,-0.344920f}, -{-0.170142f,-0.485858f,-0.344920f}, -{-0.066672f,-0.554861f,-0.337899f}, -{-0.118406f,-0.636644f,-0.287254f}, -{-0.310779f,-0.500492f,-0.286636f}, -{-0.170142f,-0.485858f,-0.344920f}, -{-0.118406f,-0.636644f,-0.287254f}, -{-0.148354f,-0.702664f,-0.200996f}, -{-0.330254f,-0.571802f,-0.194693f}, -{-0.118406f,-0.636644f,-0.287254f}, -{-0.118406f,-0.636644f,-0.287254f}, -{-0.330254f,-0.571802f,-0.194693f}, -{-0.310779f,-0.500492f,-0.286636f}, -{-0.163792f,-0.738713f,-0.103214f}, -{-0.339017f,-0.613021f,-0.099116f}, -{-0.148354f,-0.702664f,-0.200996f}, -{-0.148354f,-0.702664f,-0.200996f}, -{-0.339017f,-0.613021f,-0.099116f}, -{-0.330254f,-0.571802f,-0.194693f}, -{-0.170794f,-0.750320f,0.011127f}, -{-0.342783f,-0.627706f,0.011084f}, -{-0.163792f,-0.738713f,-0.103214f}, -{-0.163792f,-0.738713f,-0.103214f}, -{-0.342783f,-0.627706f,0.011084f}, -{-0.339017f,-0.613021f,-0.099116f}, -{0.021871f,-0.860812f,0.116084f}, -{-0.170794f,-0.750320f,0.011127f}, -{0.019093f,-0.873822f,0.010949f}, -{-0.170794f,-0.750320f,0.011127f}, -{0.021871f,-0.860812f,0.116084f}, -{-0.168862f,-0.736367f,0.119910f}, -{0.038067f,-0.821837f,0.216278f}, -{-0.168862f,-0.736367f,0.119910f}, -{0.021871f,-0.860812f,0.116084f}, -{-0.168862f,-0.736367f,0.119910f}, -{0.038067f,-0.821837f,0.216278f}, -{-0.157275f,-0.695104f,0.223596f}, -{0.071696f,-0.760990f,0.295716f}, -{-0.157275f,-0.695104f,0.223596f}, -{0.038067f,-0.821837f,0.216278f}, -{-0.157275f,-0.695104f,0.223596f}, -{0.071696f,-0.760990f,0.295716f}, -{-0.130035f,-0.631608f,0.306778f}, -{0.126308f,-0.679929f,0.344803f}, -{-0.130035f,-0.631608f,0.306778f}, -{0.071696f,-0.760990f,0.295716f}, -{-0.130035f,-0.631608f,0.306778f}, -{0.126308f,-0.679929f,0.344803f}, -{-0.077398f,-0.547866f,0.359727f}, -{0.092958f,-0.526013f,0.364328f}, -{-0.004625f,-0.457333f,0.370803f}, -{-0.042697f,-0.502379f,0.370860f}, -{-0.042697f,-0.502379f,0.370860f}, -{-0.077398f,-0.547866f,0.359727f}, -{0.126308f,-0.679929f,0.344803f}, -{0.126308f,-0.679929f,0.344803f}, -{0.193603f,-0.592279f,0.353649f}, -{0.092958f,-0.526013f,0.364328f}, -{0.092958f,-0.526013f,0.364328f}, -{-0.042697f,-0.502379f,0.370860f}, -{0.126308f,-0.679929f,0.344803f}, -{0.252808f,-0.522574f,0.328424f}, -{0.124713f,-0.490457f,0.354959f}, -{0.223172f,-0.556659f,0.344670f}, -{0.047139f,-0.402582f,0.354264f}, -{0.029571f,-0.420403f,0.361776f}, -{0.124713f,-0.490457f,0.354959f}, -{0.124713f,-0.490457f,0.354959f}, -{0.064971f,-0.385246f,0.344817f}, -{0.047139f,-0.402582f,0.354264f}, -{0.124713f,-0.490457f,0.354959f}, -{0.029571f,-0.420403f,0.361776f}, -{0.092958f,-0.526013f,0.364328f}, -{0.092958f,-0.526013f,0.364328f}, -{0.029571f,-0.420403f,0.361776f}, -{-0.004625f,-0.457333f,0.370803f}, -{0.223172f,-0.556659f,0.344670f}, -{0.124713f,-0.490457f,0.354959f}, -{0.193603f,-0.592279f,0.353649f}, -{0.193603f,-0.592279f,0.353649f}, -{0.124713f,-0.490457f,0.354959f}, -{0.092958f,-0.526013f,0.364328f}, -{0.282066f,-0.490450f,0.305592f}, -{0.100829f,-0.352558f,0.320623f}, -{0.124713f,-0.490457f,0.354959f}, -{0.100829f,-0.352558f,0.320623f}, -{0.064971f,-0.385246f,0.344817f}, -{0.124713f,-0.490457f,0.354959f}, -{0.124713f,-0.490457f,0.354959f}, -{0.252808f,-0.522574f,0.328424f}, -{0.282066f,-0.490450f,0.305592f}, -{0.282066f,-0.490450f,0.305592f}, -{0.137173f,-0.322251f,0.289443f}, -{0.100829f,-0.352558f,0.320623f}, -{0.137173f,-0.322251f,0.289443f}, -{0.282066f,-0.490450f,0.305592f}, -{0.311144f,-0.459972f,0.276415f}, -{0.202477f,-0.273317f,0.214283f}, -{0.338082f,-0.432901f,0.243222f}, -{0.278345f,-0.344613f,0.212043f}, -{0.338082f,-0.432901f,0.243222f}, -{0.362755f,-0.409030f,0.206062f}, -{0.278345f,-0.344613f,0.212043f}, -{0.202477f,-0.273317f,0.214283f}, -{0.311144f,-0.459972f,0.276415f}, -{0.338082f,-0.432901f,0.243222f}, -{0.311144f,-0.459972f,0.276415f}, -{0.202477f,-0.273317f,0.214283f}, -{0.137173f,-0.322251f,0.289443f}, -{0.384681f,-0.388667f,0.164260f}, -{0.401346f,-0.373992f,0.120819f}, -{0.320534f,-0.311006f,0.124348f}, -{0.320534f,-0.311006f,0.124348f}, -{0.302481f,-0.324884f,0.169041f}, -{0.384681f,-0.388667f,0.164260f}, -{0.320534f,-0.311006f,0.124348f}, -{0.250232f,-0.240956f,0.124853f}, -{0.302481f,-0.324884f,0.169041f}, -{0.302481f,-0.324884f,0.169041f}, -{0.250232f,-0.240956f,0.124853f}, -{0.229969f,-0.254352f,0.170133f}, -{0.302481f,-0.324884f,0.169041f}, -{0.229969f,-0.254352f,0.170133f}, -{0.278345f,-0.344613f,0.212043f}, -{0.278345f,-0.344613f,0.212043f}, -{0.229969f,-0.254352f,0.170133f}, -{0.202477f,-0.273317f,0.214283f}, -{0.384681f,-0.388667f,0.164260f}, -{0.302481f,-0.324884f,0.169041f}, -{0.362755f,-0.409030f,0.206062f}, -{0.362755f,-0.409030f,0.206062f}, -{0.302481f,-0.324884f,0.169041f}, -{0.278345f,-0.344613f,0.212043f}, -{0.320534f,-0.311006f,0.124348f}, -{0.401346f,-0.373992f,0.120819f}, -{0.417136f,-0.361486f,0.011309f}, -{0.268612f,-0.229703f,0.011213f}, -{0.250232f,-0.240956f,0.124853f}, -{0.320534f,-0.311006f,0.124348f}, -{0.320534f,-0.311006f,0.124348f}, -{0.417136f,-0.361486f,0.011309f}, -{0.268612f,-0.229703f,0.011213f}, -{0.408641f,-0.376017f,-0.092199f}, -{0.268612f,-0.229703f,0.011213f}, -{0.417136f,-0.361486f,0.011309f}, -{0.268612f,-0.229703f,0.011213f}, -{0.408641f,-0.376017f,-0.092199f}, -{0.255319f,-0.242254f,-0.097017f}, -{0.255319f,-0.242254f,-0.097017f}, -{0.408641f,-0.376017f,-0.092199f}, -{0.395967f,-0.393034f,-0.137406f}, -{0.210673f,-0.278437f,-0.190560f}, -{0.255319f,-0.242254f,-0.097017f}, -{0.395967f,-0.393034f,-0.137406f}, -{0.181427f,-0.301468f,-0.229379f}, -{0.354045f,-0.440030f,-0.216989f}, -{0.235734f,-0.401509f,-0.258827f}, -{0.354045f,-0.440030f,-0.216989f}, -{0.328839f,-0.467111f,-0.249364f}, -{0.235734f,-0.401509f,-0.258827f}, -{0.235734f,-0.401509f,-0.258827f}, -{0.149091f,-0.327626f,-0.264295f}, -{0.181427f,-0.301468f,-0.229379f}, -{0.181427f,-0.301468f,-0.229379f}, -{0.210673f,-0.278437f,-0.190560f}, -{0.354045f,-0.440030f,-0.216989f}, -{0.354045f,-0.440030f,-0.216989f}, -{0.210673f,-0.278437f,-0.190560f}, -{0.395967f,-0.393034f,-0.137406f}, -{0.239839f,-0.567318f,-0.319538f}, -{0.203163f,-0.432978f,-0.290261f}, -{0.299352f,-0.499207f,-0.279647f}, -{0.203163f,-0.432978f,-0.290261f}, -{0.239839f,-0.567318f,-0.319538f}, -{0.170466f,-0.466029f,-0.314782f}, -{0.093577f,-0.375942f,-0.310486f}, -{0.149091f,-0.327626f,-0.264295f}, -{0.203163f,-0.432978f,-0.290261f}, -{0.170466f,-0.466029f,-0.314782f}, -{0.075309f,-0.393092f,-0.322131f}, -{0.093577f,-0.375942f,-0.310486f}, -{0.203163f,-0.432978f,-0.290261f}, -{0.170466f,-0.466029f,-0.314782f}, -{0.093577f,-0.375942f,-0.310486f}, -{0.203163f,-0.432978f,-0.290261f}, -{0.149091f,-0.327626f,-0.264295f}, -{0.235734f,-0.401509f,-0.258827f}, -{0.299352f,-0.499207f,-0.279647f}, -{0.235734f,-0.401509f,-0.258827f}, -{0.328839f,-0.467111f,-0.249364f}, -{0.235734f,-0.401509f,-0.258827f}, -{0.299352f,-0.499207f,-0.279647f}, -{0.203163f,-0.432978f,-0.290261f}, -{0.210298f,-0.603129f,-0.328548f}, -{0.138377f,-0.500197f,-0.331799f}, -{0.239839f,-0.567318f,-0.319538f}, -{0.138377f,-0.500197f,-0.331799f}, -{0.210298f,-0.603129f,-0.328548f}, -{0.106767f,-0.535860f,-0.341259f}, -{-0.029094f,-0.409284f,-0.350942f}, -{0.039885f,-0.428334f,-0.339342f}, -{0.138377f,-0.500197f,-0.331799f}, -{0.106767f,-0.535860f,-0.341259f}, -{-0.032181f,-0.509782f,-0.348797f}, -{-0.029094f,-0.409284f,-0.350942f}, -{0.138377f,-0.500197f,-0.331799f}, -{0.106767f,-0.535860f,-0.341259f}, -{-0.029094f,-0.409284f,-0.350942f}, -{0.039885f,-0.428334f,-0.339342f}, -{0.075309f,-0.393092f,-0.322131f}, -{0.170466f,-0.466029f,-0.314782f}, -{0.170466f,-0.466029f,-0.314782f}, -{0.138377f,-0.500197f,-0.331799f}, -{0.039885f,-0.428334f,-0.339342f}, -{0.170466f,-0.466029f,-0.314782f}, -{0.239839f,-0.567318f,-0.319538f}, -{0.138377f,-0.500197f,-0.331799f}, -{0.106767f,-0.535860f,-0.341259f}, -{0.210298f,-0.603129f,-0.328548f}, -{0.143614f,-0.690113f,-0.319882f}, -{0.143614f,-0.690113f,-0.319882f}, -{-0.066672f,-0.554861f,-0.337899f}, -{-0.032181f,-0.509782f,-0.348797f}, -{-0.032181f,-0.509782f,-0.348797f}, -{0.106767f,-0.535860f,-0.341259f}, -{0.143614f,-0.690113f,-0.319882f}, -{0.090455f,-0.768783f,-0.273230f}, -{-0.118406f,-0.636644f,-0.287254f}, -{0.143614f,-0.690113f,-0.319882f}, -{0.143614f,-0.690113f,-0.319882f}, -{-0.118406f,-0.636644f,-0.287254f}, -{-0.066672f,-0.554861f,-0.337899f}, -{0.053516f,-0.831094f,-0.191752f}, -{-0.148354f,-0.702664f,-0.200996f}, -{0.090455f,-0.768783f,-0.273230f}, -{0.090455f,-0.768783f,-0.273230f}, -{-0.148354f,-0.702664f,-0.200996f}, -{-0.118406f,-0.636644f,-0.287254f}, -{0.030425f,-0.863922f,-0.098354f}, -{-0.163792f,-0.738713f,-0.103214f}, -{0.053516f,-0.831094f,-0.191752f}, -{0.053516f,-0.831094f,-0.191752f}, -{-0.163792f,-0.738713f,-0.103214f}, -{-0.148354f,-0.702664f,-0.200996f}, -{0.019093f,-0.873822f,0.010949f}, -{-0.163792f,-0.738713f,-0.103214f}, -{0.030425f,-0.863922f,-0.098354f}, -{-0.163792f,-0.738713f,-0.103214f}, -{0.019093f,-0.873822f,0.010949f}, -{-0.170794f,-0.750320f,0.011127f}, -{0.198877f,-0.949927f,0.108911f}, -{0.019093f,-0.873822f,0.010949f}, -{0.195592f,-0.963238f,0.011117f}, -{0.019093f,-0.873822f,0.010949f}, -{0.198877f,-0.949927f,0.108911f}, -{0.021871f,-0.860812f,0.116084f}, -{0.217919f,-0.911539f,0.202049f}, -{0.021871f,-0.860812f,0.116084f}, -{0.198877f,-0.949927f,0.108911f}, -{0.021871f,-0.860812f,0.116084f}, -{0.217919f,-0.911539f,0.202049f}, -{0.038067f,-0.821837f,0.216278f}, -{0.255789f,-0.852713f,0.275299f}, -{0.038067f,-0.821837f,0.216278f}, -{0.217919f,-0.911539f,0.202049f}, -{0.038067f,-0.821837f,0.216278f}, -{0.255789f,-0.852713f,0.275299f}, -{0.071696f,-0.760990f,0.295716f}, -{0.312412f,-0.771638f,0.320289f}, -{0.126308f,-0.679929f,0.344803f}, -{0.255789f,-0.852713f,0.275299f}, -{0.255789f,-0.852713f,0.275299f}, -{0.126308f,-0.679929f,0.344803f}, -{0.071696f,-0.760990f,0.295716f}, -{0.377954f,-0.680866f,0.328231f}, -{0.193603f,-0.592279f,0.353649f}, -{0.312412f,-0.771638f,0.320289f}, -{0.312412f,-0.771638f,0.320289f}, -{0.193603f,-0.592279f,0.353649f}, -{0.126308f,-0.679929f,0.344803f}, -{0.418586f,-0.517778f,0.265251f}, -{0.311144f,-0.459972f,0.276415f}, -{0.367921f,-0.536689f,0.293184f}, -{0.367921f,-0.536689f,0.293184f}, -{0.311144f,-0.459972f,0.276415f}, -{0.282066f,-0.490450f,0.305592f}, -{0.367921f,-0.536689f,0.293184f}, -{0.282066f,-0.490450f,0.305592f}, -{0.340174f,-0.570143f,0.314960f}, -{0.340174f,-0.570143f,0.314960f}, -{0.282066f,-0.490450f,0.305592f}, -{0.252808f,-0.522574f,0.328424f}, -{0.440027f,-0.395373f,0.118574f}, -{0.401346f,-0.373992f,0.120819f}, -{0.464039f,-0.418657f,0.141699f}, -{0.464039f,-0.418657f,0.141699f}, -{0.401346f,-0.373992f,0.120819f}, -{0.384681f,-0.388667f,0.164260f}, -{0.489372f,-0.414605f,-0.087908f}, -{0.496337f,-0.400178f,0.011387f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.496337f,-0.400178f,0.011387f}, -{0.578564f,-0.431239f,0.056949f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.489372f,-0.414605f,-0.087908f}, -{0.417136f,-0.361486f,0.011309f}, -{0.496337f,-0.400178f,0.011387f}, -{0.417136f,-0.361486f,0.011309f}, -{0.489372f,-0.414605f,-0.087908f}, -{0.408641f,-0.376017f,-0.092199f}, -{0.460483f,-0.455762f,-0.172921f}, -{0.408641f,-0.376017f,-0.092199f}, -{0.489372f,-0.414605f,-0.087908f}, -{0.408641f,-0.376017f,-0.092199f}, -{0.460483f,-0.455762f,-0.172921f}, -{0.395967f,-0.393034f,-0.137406f}, -{0.460483f,-0.455762f,-0.172921f}, -{0.489372f,-0.414605f,-0.087908f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.416254f,-0.510086f,-0.238332f}, -{0.354045f,-0.440030f,-0.216989f}, -{0.478382f,-0.512709f,-0.219323f}, -{0.354045f,-0.440030f,-0.216989f}, -{0.416254f,-0.510086f,-0.238332f}, -{0.328839f,-0.467111f,-0.249364f}, -{0.478382f,-0.512709f,-0.219323f}, -{0.395967f,-0.393034f,-0.137406f}, -{0.460483f,-0.455762f,-0.172921f}, -{0.395967f,-0.393034f,-0.137406f}, -{0.478382f,-0.512709f,-0.219323f}, -{0.354045f,-0.440030f,-0.216989f}, -{0.239839f,-0.567318f,-0.319538f}, -{0.299352f,-0.499207f,-0.279647f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.328839f,-0.467111f,-0.249364f}, -{0.416254f,-0.510086f,-0.238332f}, -{0.328839f,-0.467111f,-0.249364f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.299352f,-0.499207f,-0.279647f}, -{0.394032f,-0.615157f,-0.293048f}, -{0.472991f,-0.630213f,-0.286776f}, -{0.401041f,-0.689464f,-0.303962f}, -{0.303234f,-0.651611f,-0.313823f}, -{0.331758f,-0.614794f,-0.305214f}, -{0.394032f,-0.615157f,-0.293048f}, -{0.394032f,-0.615157f,-0.293048f}, -{0.401041f,-0.689464f,-0.303962f}, -{0.303234f,-0.651611f,-0.313823f}, -{0.303234f,-0.651611f,-0.313823f}, -{0.239839f,-0.567318f,-0.319538f}, -{0.331758f,-0.614794f,-0.305214f}, -{0.239839f,-0.567318f,-0.319538f}, -{0.303234f,-0.651611f,-0.313823f}, -{0.210298f,-0.603129f,-0.328548f}, -{0.239839f,-0.567318f,-0.319538f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.331758f,-0.614794f,-0.305214f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.394032f,-0.615157f,-0.293048f}, -{0.331758f,-0.614794f,-0.305214f}, -{0.303234f,-0.651611f,-0.313823f}, -{0.401041f,-0.689464f,-0.303962f}, -{0.368102f,-0.735134f,-0.304811f}, -{0.368102f,-0.735134f,-0.304811f}, -{0.335687f,-0.780497f,-0.296099f}, -{0.143614f,-0.690113f,-0.319882f}, -{0.143614f,-0.690113f,-0.319882f}, -{0.210298f,-0.603129f,-0.328548f}, -{0.303234f,-0.651611f,-0.313823f}, -{0.303234f,-0.651611f,-0.313823f}, -{0.368102f,-0.735134f,-0.304811f}, -{0.143614f,-0.690113f,-0.319882f}, -{0.280025f,-0.860182f,-0.253183f}, -{0.143614f,-0.690113f,-0.319882f}, -{0.335687f,-0.780497f,-0.296099f}, -{0.143614f,-0.690113f,-0.319882f}, -{0.280025f,-0.860182f,-0.253183f}, -{0.090455f,-0.768783f,-0.273230f}, -{0.237553f,-0.921077f,-0.177884f}, -{0.090455f,-0.768783f,-0.273230f}, -{0.280025f,-0.860182f,-0.253183f}, -{0.090455f,-0.768783f,-0.273230f}, -{0.237553f,-0.921077f,-0.177884f}, -{0.053516f,-0.831094f,-0.191752f}, -{0.209422f,-0.953038f,-0.090887f}, -{0.053516f,-0.831094f,-0.191752f}, -{0.237553f,-0.921077f,-0.177884f}, -{0.053516f,-0.831094f,-0.191752f}, -{0.209422f,-0.953038f,-0.090887f}, -{0.030425f,-0.863922f,-0.098354f}, -{0.195592f,-0.963238f,0.011117f}, -{0.030425f,-0.863922f,-0.098354f}, -{0.209422f,-0.953038f,-0.090887f}, -{0.030425f,-0.863922f,-0.098354f}, -{0.195592f,-0.963238f,0.011117f}, -{0.019093f,-0.873822f,0.010949f}, -{0.413555f,-1.020967f,0.099800f}, -{0.195592f,-0.963238f,0.011117f}, -{0.409885f,-1.028627f,0.011343f}, -{0.195592f,-0.963238f,0.011117f}, -{0.413555f,-1.020967f,0.099800f}, -{0.198877f,-0.949927f,0.108911f}, -{0.435744f,-0.995293f,0.184588f}, -{0.217919f,-0.911539f,0.202049f}, -{0.413555f,-1.020967f,0.099800f}, -{0.413555f,-1.020967f,0.099800f}, -{0.217919f,-0.911539f,0.202049f}, -{0.198877f,-0.949927f,0.108911f}, -{0.478132f,-0.946687f,0.250943f}, -{0.255789f,-0.852713f,0.275299f}, -{0.435744f,-0.995293f,0.184588f}, -{0.435744f,-0.995293f,0.184588f}, -{0.255789f,-0.852713f,0.275299f}, -{0.217919f,-0.911539f,0.202049f}, -{0.534351f,-0.873781f,0.291707f}, -{0.312412f,-0.771638f,0.320289f}, -{0.478132f,-0.946687f,0.250943f}, -{0.478132f,-0.946687f,0.250943f}, -{0.312412f,-0.771638f,0.320289f}, -{0.255789f,-0.852713f,0.275299f}, -{0.490049f,-0.728040f,0.317341f}, -{0.377954f,-0.680866f,0.328231f}, -{0.312412f,-0.771638f,0.320289f}, -{0.534351f,-0.873781f,0.291707f}, -{0.592498f,-0.788204f,0.299064f}, -{0.490049f,-0.728040f,0.317341f}, -{0.312412f,-0.771638f,0.320289f}, -{0.534351f,-0.873781f,0.291707f}, -{0.490049f,-0.728040f,0.317341f}, -{0.534812f,-0.654828f,0.297562f}, -{0.405685f,-0.643118f,0.319928f}, -{0.490049f,-0.728040f,0.317341f}, -{0.490049f,-0.728040f,0.317341f}, -{0.405685f,-0.643118f,0.319928f}, -{0.377954f,-0.680866f,0.328231f}, -{0.615209f,-0.751537f,0.291641f}, -{0.534812f,-0.654828f,0.297562f}, -{0.592498f,-0.788204f,0.299064f}, -{0.592498f,-0.788204f,0.299064f}, -{0.534812f,-0.654828f,0.297562f}, -{0.490049f,-0.728040f,0.317341f}, -{0.720657f,-0.563569f,-0.126581f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.738879f,-0.537016f,-0.026636f}, -{0.668793f,-0.472827f,0.054810f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.578564f,-0.431239f,0.056949f}, -{0.738879f,-0.537016f,-0.026636f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.737736f,-0.534172f,0.053169f}, -{0.737736f,-0.534172f,0.053169f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.668793f,-0.472827f,0.054810f}, -{0.613783f,-0.805559f,-0.269572f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.624854f,-0.787610f,-0.266611f}, -{0.624854f,-0.787610f,-0.266611f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.623118f,-0.726832f,-0.262889f}, -{0.368102f,-0.735134f,-0.304811f}, -{0.449892f,-0.829966f,-0.285116f}, -{0.335687f,-0.780497f,-0.296099f}, -{0.468667f,-0.664724f,-0.291909f}, -{0.512534f,-0.739842f,-0.292882f}, -{0.449892f,-0.829966f,-0.285116f}, -{0.368102f,-0.735134f,-0.304811f}, -{0.401041f,-0.689464f,-0.303962f}, -{0.468667f,-0.664724f,-0.291909f}, -{0.449892f,-0.829966f,-0.285116f}, -{0.368102f,-0.735134f,-0.304811f}, -{0.468667f,-0.664724f,-0.291909f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.613783f,-0.805559f,-0.269572f}, -{0.586448f,-0.847414f,-0.270350f}, -{0.449892f,-0.829966f,-0.285116f}, -{0.512534f,-0.739842f,-0.292882f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.586448f,-0.847414f,-0.270350f}, -{0.449892f,-0.829966f,-0.285116f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.449892f,-0.829966f,-0.285116f}, -{0.586448f,-0.847414f,-0.270350f}, -{0.504289f,-0.956408f,-0.224492f}, -{0.280025f,-0.860182f,-0.253183f}, -{0.335687f,-0.780497f,-0.296099f}, -{0.449892f,-0.829966f,-0.285116f}, -{0.449892f,-0.829966f,-0.285116f}, -{0.504289f,-0.956408f,-0.224492f}, -{0.280025f,-0.860182f,-0.253183f}, -{0.280025f,-0.860182f,-0.253183f}, -{0.504289f,-0.956408f,-0.224492f}, -{0.479698f,-0.983592f,-0.193867f}, -{0.237553f,-0.921077f,-0.177884f}, -{0.280025f,-0.860182f,-0.253183f}, -{0.479698f,-0.983592f,-0.193867f}, -{0.237553f,-0.921077f,-0.177884f}, -{0.479698f,-0.983592f,-0.193867f}, -{0.425486f,-1.025458f,-0.079576f}, -{0.209422f,-0.953038f,-0.090887f}, -{0.237553f,-0.921077f,-0.177884f}, -{0.425486f,-1.025458f,-0.079576f}, -{0.409885f,-1.028627f,0.011343f}, -{0.209422f,-0.953038f,-0.090887f}, -{0.425486f,-1.025458f,-0.079576f}, -{0.209422f,-0.953038f,-0.090887f}, -{0.409885f,-1.028627f,0.011343f}, -{0.195592f,-0.963238f,0.011117f}, -{0.622828f,-1.010850f,0.039370f}, -{0.621666f,-1.020964f,0.103462f}, -{0.413555f,-1.020967f,0.099800f}, -{0.413555f,-1.020967f,0.099800f}, -{0.409885f,-1.028627f,0.011343f}, -{0.622828f,-1.010850f,0.039370f}, -{0.621666f,-1.020964f,0.103462f}, -{0.642121f,-1.011563f,0.157687f}, -{0.435744f,-0.995293f,0.184588f}, -{0.435744f,-0.995293f,0.184588f}, -{0.413555f,-1.020967f,0.099800f}, -{0.621666f,-1.020964f,0.103462f}, -{0.478132f,-0.946687f,0.250943f}, -{0.435744f,-0.995293f,0.184588f}, -{0.642121f,-1.011563f,0.157687f}, -{0.677433f,-0.978595f,0.194888f}, -{0.696335f,-0.955003f,0.205747f}, -{0.534351f,-0.873781f,0.291707f}, -{0.478132f,-0.946687f,0.250943f}, -{0.642121f,-1.011563f,0.157687f}, -{0.677433f,-0.978595f,0.194888f}, -{0.534351f,-0.873781f,0.291707f}, -{0.478132f,-0.946687f,0.250943f}, -{0.677433f,-0.978595f,0.194888f}, -{0.696335f,-0.955003f,0.205747f}, -{0.731104f,-0.899784f,0.210321f}, -{0.592498f,-0.788204f,0.299064f}, -{0.592498f,-0.788204f,0.299064f}, -{0.534351f,-0.873781f,0.291707f}, -{0.696335f,-0.955003f,0.205747f}, -{0.615209f,-0.751537f,0.291641f}, -{0.731104f,-0.899784f,0.210321f}, -{0.701557f,-0.782319f,0.248627f}, -{0.731104f,-0.899784f,0.210321f}, -{0.754234f,-0.849776f,0.195999f}, -{0.701557f,-0.782319f,0.248627f}, -{0.701557f,-0.782319f,0.248627f}, -{0.636516f,-0.715392f,0.278183f}, -{0.615209f,-0.751537f,0.291641f}, -{0.615209f,-0.751537f,0.291641f}, -{0.592498f,-0.788204f,0.299064f}, -{0.731104f,-0.899784f,0.210321f}, -{0.716496f,-0.750669f,0.231711f}, -{0.656324f,-0.680370f,0.259240f}, -{0.636516f,-0.715392f,0.278183f}, -{0.701557f,-0.782319f,0.248627f}, -{0.716496f,-0.750669f,0.231711f}, -{0.636516f,-0.715392f,0.278183f}, -{0.763638f,-0.824658f,0.183142f}, -{0.701557f,-0.782319f,0.248627f}, -{0.754234f,-0.849776f,0.195999f}, -{0.701557f,-0.782319f,0.248627f}, -{0.763638f,-0.824658f,0.183142f}, -{0.716496f,-0.750669f,0.231711f}, -{0.790792f,-0.735889f,0.101690f}, -{0.752845f,-0.664541f,0.158286f}, -{0.742165f,-0.690772f,0.185737f}, -{0.778968f,-0.776051f,0.147898f}, -{0.790792f,-0.735889f,0.101690f}, -{0.742165f,-0.690772f,0.185737f}, -{0.778968f,-0.776051f,0.147898f}, -{0.716496f,-0.750669f,0.231711f}, -{0.763638f,-0.824658f,0.183142f}, -{0.716496f,-0.750669f,0.231711f}, -{0.778968f,-0.776051f,0.147898f}, -{0.742165f,-0.690772f,0.185737f}, -{0.799994f,-0.711662f,0.038060f}, -{0.770297f,-0.623219f,0.094728f}, -{0.790792f,-0.735889f,0.101690f}, -{0.770297f,-0.623219f,0.094728f}, -{0.799994f,-0.711662f,0.038060f}, -{0.777168f,-0.609113f,0.049431f}, -{0.798869f,-0.735644f,-0.045503f}, -{0.778146f,-0.612369f,-0.021031f}, -{0.800574f,-0.714476f,-0.014567f}, -{0.774117f,-0.644992f,-0.078104f}, -{0.720657f,-0.563569f,-0.126581f}, -{0.738879f,-0.537016f,-0.026636f}, -{0.738879f,-0.537016f,-0.026636f}, -{0.778146f,-0.612369f,-0.021031f}, -{0.774117f,-0.644992f,-0.078104f}, -{0.778146f,-0.612369f,-0.021031f}, -{0.738879f,-0.537016f,-0.026636f}, -{0.777168f,-0.609113f,0.049431f}, -{0.777168f,-0.609113f,0.049431f}, -{0.738879f,-0.537016f,-0.026636f}, -{0.737736f,-0.534172f,0.053169f}, -{0.800574f,-0.714476f,-0.014567f}, -{0.778146f,-0.612369f,-0.021031f}, -{0.799994f,-0.711662f,0.038060f}, -{0.799994f,-0.711662f,0.038060f}, -{0.778146f,-0.612369f,-0.021031f}, -{0.777168f,-0.609113f,0.049431f}, -{0.796312f,-0.759138f,-0.070088f}, -{0.797256f,-0.823745f,-0.069483f}, -{0.768696f,-0.671546f,-0.109799f}, -{0.774117f,-0.644992f,-0.078104f}, -{0.778146f,-0.612369f,-0.021031f}, -{0.798869f,-0.735644f,-0.045503f}, -{0.796312f,-0.759138f,-0.070088f}, -{0.768696f,-0.671546f,-0.109799f}, -{0.774117f,-0.644992f,-0.078104f}, -{0.798869f,-0.735644f,-0.045503f}, -{0.796312f,-0.759138f,-0.070088f}, -{0.774117f,-0.644992f,-0.078104f}, -{0.734784f,-0.771894f,-0.194041f}, -{0.756868f,-0.712629f,-0.150208f}, -{0.797256f,-0.823745f,-0.069483f}, -{0.756868f,-0.712629f,-0.150208f}, -{0.768696f,-0.671546f,-0.109799f}, -{0.797256f,-0.823745f,-0.069483f}, -{0.705973f,-0.834184f,-0.222231f}, -{0.734784f,-0.771894f,-0.194041f}, -{0.750992f,-0.910564f,-0.159361f}, -{0.780059f,-0.836025f,-0.131824f}, -{0.750992f,-0.910564f,-0.159361f}, -{0.734784f,-0.771894f,-0.194041f}, -{0.734784f,-0.771894f,-0.194041f}, -{0.797256f,-0.823745f,-0.069483f}, -{0.780059f,-0.836025f,-0.131824f}, -{0.689263f,-0.864797f,-0.228743f}, -{0.705973f,-0.834184f,-0.222231f}, -{0.750992f,-0.910564f,-0.159361f}, -{0.624854f,-0.787610f,-0.266611f}, -{0.623118f,-0.726832f,-0.262889f}, -{0.705973f,-0.834184f,-0.222231f}, -{0.689263f,-0.864797f,-0.228743f}, -{0.613783f,-0.805559f,-0.269572f}, -{0.624854f,-0.787610f,-0.266611f}, -{0.705973f,-0.834184f,-0.222231f}, -{0.689263f,-0.864797f,-0.228743f}, -{0.624854f,-0.787610f,-0.266611f}, -{0.620851f,-0.963088f,-0.210127f}, -{0.667539f,-0.899978f,-0.229579f}, -{0.724016f,-0.954800f,-0.154705f}, -{0.620851f,-0.963088f,-0.210127f}, -{0.586448f,-0.847414f,-0.270350f}, -{0.667539f,-0.899978f,-0.229579f}, -{0.667539f,-0.899978f,-0.229579f}, -{0.586448f,-0.847414f,-0.270350f}, -{0.689263f,-0.864797f,-0.228743f}, -{0.689263f,-0.864797f,-0.228743f}, -{0.586448f,-0.847414f,-0.270350f}, -{0.613783f,-0.805559f,-0.269572f}, -{0.689263f,-0.864797f,-0.228743f}, -{0.750992f,-0.910564f,-0.159361f}, -{0.724016f,-0.954800f,-0.154705f}, -{0.667539f,-0.899978f,-0.229579f}, -{0.689263f,-0.864797f,-0.228743f}, -{0.724016f,-0.954800f,-0.154705f}, -{0.695551f,-0.988153f,-0.133608f}, -{0.620851f,-0.963088f,-0.210127f}, -{0.724016f,-0.954800f,-0.154705f}, -{0.620851f,-0.963088f,-0.210127f}, -{0.695551f,-0.988153f,-0.133608f}, -{0.576126f,-1.008893f,-0.164606f}, -{0.576126f,-1.008893f,-0.164606f}, -{0.504289f,-0.956408f,-0.224492f}, -{0.620851f,-0.963088f,-0.210127f}, -{0.586448f,-0.847414f,-0.270350f}, -{0.620851f,-0.963088f,-0.210127f}, -{0.504289f,-0.956408f,-0.224492f}, -{0.504289f,-0.956408f,-0.224492f}, -{0.576126f,-1.008893f,-0.164606f}, -{0.479698f,-0.983592f,-0.193867f}, -{0.666975f,-1.007574f,-0.096091f}, -{0.576126f,-1.008893f,-0.164606f}, -{0.695551f,-0.988153f,-0.133608f}, -{0.629602f,-1.010061f,-0.019446f}, -{0.524377f,-1.033508f,-0.066525f}, -{0.666975f,-1.007574f,-0.096091f}, -{0.524377f,-1.033508f,-0.066525f}, -{0.479698f,-0.983592f,-0.193867f}, -{0.576126f,-1.008893f,-0.164606f}, -{0.479698f,-0.983592f,-0.193867f}, -{0.524377f,-1.033508f,-0.066525f}, -{0.425486f,-1.025458f,-0.079576f}, -{0.576126f,-1.008893f,-0.164606f}, -{0.666975f,-1.007574f,-0.096091f}, -{0.524377f,-1.033508f,-0.066525f}, -{0.629602f,-1.010061f,-0.019446f}, -{0.622828f,-1.010850f,0.039370f}, -{0.409885f,-1.028627f,0.011343f}, -{0.409885f,-1.028627f,0.011343f}, -{0.425486f,-1.025458f,-0.079576f}, -{0.524377f,-1.033508f,-0.066525f}, -{0.524377f,-1.033508f,-0.066525f}, -{0.629602f,-1.010061f,-0.019446f}, -{0.409885f,-1.028627f,0.011343f}, -{0.722878f,-0.961497f,0.026901f}, -{0.780515f,-0.889902f,0.033648f}, -{0.758852f,-0.938246f,0.054834f}, -{0.622828f,-1.010850f,0.039370f}, -{0.722878f,-0.961497f,0.026901f}, -{0.621666f,-1.020964f,0.103462f}, -{0.720834f,-0.977022f,0.073803f}, -{0.758852f,-0.938246f,0.054834f}, -{0.722764f,-0.977602f,0.081846f}, -{0.720834f,-0.977022f,0.073803f}, -{0.722764f,-0.977602f,0.081846f}, -{0.642121f,-1.011563f,0.157687f}, -{0.642121f,-1.011563f,0.157687f}, -{0.621666f,-1.020964f,0.103462f}, -{0.720834f,-0.977022f,0.073803f}, -{0.722878f,-0.961497f,0.026901f}, -{0.720834f,-0.977022f,0.073803f}, -{0.621666f,-1.020964f,0.103462f}, -{0.722878f,-0.961497f,0.026901f}, -{0.758852f,-0.938246f,0.054834f}, -{0.720834f,-0.977022f,0.073803f}, -{0.780515f,-0.889902f,0.033648f}, -{0.720834f,-0.977022f,0.073803f}, -{0.758852f,-0.938246f,0.054834f}, -{0.780515f,-0.889902f,0.033648f}, -{0.763842f,-0.933357f,0.124726f}, -{0.720834f,-0.977022f,0.073803f}, -{0.763842f,-0.933357f,0.124726f}, -{0.696335f,-0.955003f,0.205747f}, -{0.720834f,-0.977022f,0.073803f}, -{0.720834f,-0.977022f,0.073803f}, -{0.696335f,-0.955003f,0.205747f}, -{0.677433f,-0.978595f,0.194888f}, -{0.720834f,-0.977022f,0.073803f}, -{0.677433f,-0.978595f,0.194888f}, -{0.642121f,-1.011563f,0.157687f}, -{0.763842f,-0.933357f,0.124726f}, -{0.731104f,-0.899784f,0.210321f}, -{0.696335f,-0.955003f,0.205747f}, -{0.783015f,-0.889531f,0.119378f}, -{0.754234f,-0.849776f,0.195999f}, -{0.731104f,-0.899784f,0.210321f}, -{0.783015f,-0.889531f,0.119378f}, -{0.731104f,-0.899784f,0.210321f}, -{0.763842f,-0.933357f,0.124726f}, -{0.780515f,-0.889902f,0.033648f}, -{0.783015f,-0.889531f,0.119378f}, -{0.763842f,-0.933357f,0.124726f}, -{0.754234f,-0.849776f,0.195999f}, -{0.783015f,-0.889531f,0.119378f}, -{0.763638f,-0.824658f,0.183142f}, -{0.778968f,-0.776051f,0.147898f}, -{0.794576f,-0.845281f,0.094182f}, -{0.790792f,-0.735889f,0.101690f}, -{0.794576f,-0.845281f,0.094182f}, -{0.763638f,-0.824658f,0.183142f}, -{0.783015f,-0.889531f,0.119378f}, -{0.763638f,-0.824658f,0.183142f}, -{0.794576f,-0.845281f,0.094182f}, -{0.778968f,-0.776051f,0.147898f}, -{0.780515f,-0.889902f,0.033648f}, -{0.794576f,-0.845281f,0.094182f}, -{0.783015f,-0.889531f,0.119378f}, -{0.780515f,-0.889902f,0.033648f}, -{0.800155f,-0.816098f,0.049902f}, -{0.794576f,-0.845281f,0.094182f}, -{0.800155f,-0.816098f,0.049902f}, -{0.790792f,-0.735889f,0.101690f}, -{0.794576f,-0.845281f,0.094182f}, -{0.790792f,-0.735889f,0.101690f}, -{0.800155f,-0.816098f,0.049902f}, -{0.799994f,-0.711662f,0.038060f}, -{0.780515f,-0.889902f,0.033648f}, -{0.797267f,-0.840557f,-0.029326f}, -{0.800155f,-0.816098f,0.049902f}, -{0.797267f,-0.840557f,-0.029326f}, -{0.798869f,-0.735644f,-0.045503f}, -{0.800155f,-0.816098f,0.049902f}, -{0.800155f,-0.816098f,0.049902f}, -{0.798869f,-0.735644f,-0.045503f}, -{0.800574f,-0.714476f,-0.014567f}, -{0.800155f,-0.816098f,0.049902f}, -{0.800574f,-0.714476f,-0.014567f}, -{0.799994f,-0.711662f,0.038060f}, -{0.780515f,-0.889902f,0.033648f}, -{0.789044f,-0.885143f,-0.059601f}, -{0.797267f,-0.840557f,-0.029326f}, -{0.797267f,-0.840557f,-0.029326f}, -{0.789044f,-0.885143f,-0.059601f}, -{0.797256f,-0.823745f,-0.069483f}, -{0.796312f,-0.759138f,-0.070088f}, -{0.797267f,-0.840557f,-0.029326f}, -{0.797256f,-0.823745f,-0.069483f}, -{0.797267f,-0.840557f,-0.029326f}, -{0.796312f,-0.759138f,-0.070088f}, -{0.798869f,-0.735644f,-0.045503f}, -{0.797256f,-0.823745f,-0.069483f}, -{0.789044f,-0.885143f,-0.059601f}, -{0.784543f,-0.880758f,-0.105733f}, -{0.784543f,-0.880758f,-0.105733f}, -{0.750992f,-0.910564f,-0.159361f}, -{0.780059f,-0.836025f,-0.131824f}, -{0.784543f,-0.880758f,-0.105733f}, -{0.780059f,-0.836025f,-0.131824f}, -{0.797256f,-0.823745f,-0.069483f}, -{0.752494f,-0.949283f,-0.111358f}, -{0.789044f,-0.885143f,-0.059601f}, -{0.780515f,-0.889902f,0.033648f}, -{0.752494f,-0.949283f,-0.111358f}, -{0.750992f,-0.910564f,-0.159361f}, -{0.784543f,-0.880758f,-0.105733f}, -{0.752494f,-0.949283f,-0.111358f}, -{0.784543f,-0.880758f,-0.105733f}, -{0.789044f,-0.885143f,-0.059601f}, -{0.764674f,-0.938707f,-0.059184f}, -{0.752494f,-0.949283f,-0.111358f}, -{0.780515f,-0.889902f,0.033648f}, -{0.750992f,-0.910564f,-0.159361f}, -{0.752494f,-0.949283f,-0.111358f}, -{0.724016f,-0.954800f,-0.154705f}, -{0.724016f,-0.954800f,-0.154705f}, -{0.764674f,-0.938707f,-0.059184f}, -{0.695551f,-0.988153f,-0.133608f}, -{0.764674f,-0.938707f,-0.059184f}, -{0.724016f,-0.954800f,-0.154705f}, -{0.752494f,-0.949283f,-0.111358f}, -{0.780515f,-0.889902f,0.033648f}, -{0.727597f,-0.957916f,-0.002770f}, -{0.764674f,-0.938707f,-0.059184f}, -{0.727597f,-0.957916f,-0.002770f}, -{0.666975f,-1.007574f,-0.096091f}, -{0.764674f,-0.938707f,-0.059184f}, -{0.695551f,-0.988153f,-0.133608f}, -{0.764674f,-0.938707f,-0.059184f}, -{0.666975f,-1.007574f,-0.096091f}, -{0.666975f,-1.007574f,-0.096091f}, -{0.727597f,-0.957916f,-0.002770f}, -{0.629602f,-1.010061f,-0.019446f}, -{0.780515f,-0.889902f,0.033648f}, -{0.722878f,-0.961497f,0.026901f}, -{0.727597f,-0.957916f,-0.002770f}, -{0.722878f,-0.961497f,0.026901f}, -{0.629602f,-1.010061f,-0.019446f}, -{0.727597f,-0.957916f,-0.002770f}, -{0.629602f,-1.010061f,-0.019446f}, -{0.722878f,-0.961497f,0.026901f}, -{0.622828f,-1.010850f,0.039370f}, -{-0.568154f,-0.237707f,0.011206f}, -{-0.554298f,-0.266533f,-0.059249f}, -{-0.559234f,-0.344801f,-0.020738f}, -{-0.554298f,-0.266533f,-0.059249f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.559234f,-0.344801f,-0.020738f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.497145f,-0.145443f,-0.135271f}, -{-0.497319f,-0.257788f,-0.183325f}, -{-0.497145f,-0.145443f,-0.135271f}, -{-0.448058f,-0.087913f,-0.151966f}, -{-0.450836f,-0.185466f,-0.224737f}, -{-0.448058f,-0.087913f,-0.151966f}, -{-0.416822f,-0.064653f,-0.153867f}, -{-0.421068f,-0.153229f,-0.237698f}, -{-0.416822f,-0.064653f,-0.153867f}, -{-0.345446f,-0.043039f,-0.136387f}, -{-0.358086f,-0.107641f,-0.238958f}, -{-0.345446f,-0.043039f,-0.136387f}, -{-0.311455f,-0.045609f,-0.117366f}, -{-0.243362f,-0.072214f,-0.171929f}, -{-0.311455f,-0.045609f,-0.117366f}, -{-0.281868f,-0.052914f,-0.093357f}, -{-0.243362f,-0.072214f,-0.171929f}, -{-0.281868f,-0.052914f,-0.093357f}, -{-0.287041f,-0.058157f,-0.051717f}, -{-0.201037f,-0.067664f,-0.127122f}, -{-0.287041f,-0.058157f,-0.051717f}, -{-0.243884f,-0.066668f,-0.027679f}, -{-0.159933f,-0.065380f,-0.058577f}, -{-0.243884f,-0.066668f,-0.027679f}, -{-0.252851f,-0.067050f,0.043792f}, -{-0.149523f,-0.064983f,-0.019151f}, -{-0.252851f,-0.067050f,0.043792f}, -{-0.258619f,-0.061028f,0.084698f}, -{-0.162304f,-0.065348f,0.084402f}, -{-0.258619f,-0.061028f,0.084698f}, -{-0.345111f,-0.042992f,0.158522f}, -{-0.231992f,-0.070347f,0.181147f}, -{-0.345111f,-0.042992f,0.158522f}, -{-0.381471f,-0.048737f,0.171259f}, -{-0.327785f,-0.092566f,0.250131f}, -{-0.381471f,-0.048737f,0.171259f}, -{-0.447572f,-0.087580f,0.174226f}, -{-0.421948f,-0.151893f,0.259289f}, -{-0.447572f,-0.087580f,0.174226f}, -{-0.496944f,-0.145170f,0.157557f}, -{-0.451868f,-0.184248f,0.246310f}, -{-0.496944f,-0.145170f,0.157557f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.499401f,-0.258668f,0.203390f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.554011f,-0.266026f,0.081342f}, -{-0.555103f,-0.332963f,0.071434f}, -{-0.554011f,-0.266026f,0.081342f}, -{-0.561506f,-0.286111f,0.048810f}, -{-0.555103f,-0.332963f,0.071434f}, -{-0.561506f,-0.286111f,0.048810f}, -{-0.568154f,-0.237707f,0.011206f}, -{-0.560722f,-0.349176f,0.011072f}, -{-0.245134f,-0.087132f,-0.227843f}, -{-0.252367f,-0.105630f,-0.289763f}, -{-0.358086f,-0.107641f,-0.238958f}, -{-0.252367f,-0.105630f,-0.289763f}, -{-0.292079f,-0.134864f,-0.326030f}, -{-0.297547f,-0.174158f,-0.365961f}, -{-0.265985f,-0.237324f,-0.396676f}, -{-0.235057f,-0.292748f,-0.400311f}, -{-0.331117f,-0.295393f,-0.379450f}, -{-0.235057f,-0.292748f,-0.400311f}, -{-0.277944f,-0.320479f,-0.388053f}, -{-0.286552f,-0.332472f,-0.383720f}, -{-0.122778f,-0.359717f,-0.370968f}, -{-0.052308f,-0.329493f,-0.359209f}, -{-0.136648f,-0.439410f,-0.360300f}, -{-0.005142f,-0.356243f,-0.339157f}, -{0.024576f,-0.327260f,-0.322519f}, -{0.093577f,-0.375942f,-0.310486f}, -{0.024576f,-0.327260f,-0.322519f}, -{0.016993f,-0.279886f,-0.313177f}, -{0.065259f,-0.319680f,-0.302512f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.051721f,-0.148377f,-0.198787f}, -{0.099286f,-0.226394f,-0.236522f}, -{0.024228f,-0.180434f,-0.258813f}, -{-0.021328f,-0.129250f,-0.234450f}, -{0.051721f,-0.148377f,-0.198787f}, -{-0.021328f,-0.129250f,-0.234450f}, -{-0.061376f,-0.099199f,-0.188071f}, -{0.000189f,-0.101606f,-0.138466f}, -{-0.061376f,-0.099199f,-0.188071f}, -{-0.099257f,-0.097014f,-0.213617f}, -{-0.125219f,-0.083233f,-0.170020f}, -{-0.099257f,-0.097014f,-0.213617f}, -{-0.202742f,-0.086092f,-0.217563f}, -{-0.198765f,-0.079337f,-0.188027f}, -{-0.079684f,-0.340384f,0.384449f}, -{-0.116941f,-0.334306f,0.394759f}, -{-0.105466f,-0.386213f,0.388652f}, -{-0.116941f,-0.334306f,0.394759f}, -{-0.215595f,-0.327438f,0.412834f}, -{-0.144161f,-0.433891f,0.384889f}, -{-0.215595f,-0.327438f,0.412834f}, -{-0.238253f,-0.289343f,0.423071f}, -{-0.246428f,-0.363260f,0.404451f}, -{-0.238253f,-0.289343f,0.423071f}, -{-0.332791f,-0.291448f,0.397380f}, -{-0.246428f,-0.363260f,0.404451f}, -{-0.302821f,-0.194571f,0.394099f}, -{-0.292608f,-0.161980f,0.375790f}, -{-0.332758f,-0.213138f,0.390733f}, -{-0.292608f,-0.161980f,0.375790f}, -{-0.263218f,-0.116928f,0.324979f}, -{-0.327785f,-0.092566f,0.250131f}, -{-0.263218f,-0.116928f,0.324979f}, -{-0.241642f,-0.103722f,0.298771f}, -{-0.327785f,-0.092566f,0.250131f}, -{-0.241642f,-0.103722f,0.298771f}, -{-0.183628f,-0.106776f,0.311577f}, -{-0.231992f,-0.070347f,0.181147f}, -{-0.147168f,-0.085620f,0.215947f}, -{-0.075522f,-0.108091f,0.248564f}, -{-0.111865f,-0.080516f,0.168778f}, -{0.004368f,-0.124361f,0.220649f}, -{0.007341f,-0.138552f,0.245721f}, -{0.045404f,-0.146120f,0.224543f}, -{0.007341f,-0.138552f,0.245721f}, -{0.009331f,-0.168087f,0.282574f}, -{0.045404f,-0.146120f,0.224543f}, -{0.009331f,-0.168087f,0.282574f}, -{-0.008683f,-0.203947f,0.322526f}, -{0.090711f,-0.222883f,0.263048f}, -{-0.008683f,-0.203947f,0.322526f}, -{-0.024666f,-0.217238f,0.332742f}, -{0.090711f,-0.222883f,0.263048f}, -{-0.024666f,-0.217238f,0.332742f}, -{-0.005216f,-0.266256f,0.343910f}, -{0.090711f,-0.222883f,0.263048f}, -{-0.005216f,-0.266256f,0.343910f}, -{-0.037718f,-0.276171f,0.358543f}, -{0.017426f,-0.346902f,0.352166f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.079684f,-0.340384f,0.384449f}, -{0.017426f,-0.346902f,0.352166f}, -{0.503896f,-0.419118f,0.106868f}, -{0.574343f,-0.443898f,0.127927f}, -{0.578564f,-0.431239f,0.056949f}, -{0.574343f,-0.443898f,0.127927f}, -{0.667875f,-0.494357f,0.117842f}, -{0.668793f,-0.472827f,0.054810f}, -{0.667875f,-0.494357f,0.117842f}, -{0.693869f,-0.505420f,0.099781f}, -{0.668793f,-0.472827f,0.054810f}, -{0.693869f,-0.505420f,0.099781f}, -{0.725466f,-0.549910f,0.117326f}, -{0.737736f,-0.534172f,0.053169f}, -{0.754382f,-0.641772f,0.143444f}, -{0.742165f,-0.690772f,0.185737f}, -{0.752845f,-0.664541f,0.158286f}, -{0.699804f,-0.664386f,0.222474f}, -{0.656324f,-0.680370f,0.259240f}, -{0.716496f,-0.750669f,0.231711f}, -{0.505459f,-0.646147f,0.302026f}, -{0.435241f,-0.592881f,0.299367f}, -{0.534812f,-0.654828f,0.297562f}, -{0.435241f,-0.592881f,0.299367f}, -{0.467798f,-0.560190f,0.278831f}, -{0.340174f,-0.570143f,0.314960f}, -{0.467798f,-0.560190f,0.278831f}, -{0.367921f,-0.536689f,0.293184f}, -{0.340174f,-0.570143f,0.314960f}, -{0.419554f,-0.494469f,0.248712f}, -{0.487713f,-0.414396f,0.194702f}, -{0.338082f,-0.432901f,0.243222f}, -{0.487713f,-0.414396f,0.194702f}, -{0.464039f,-0.418657f,0.141699f}, -{0.362755f,-0.409030f,0.206062f}, -{0.588326f,-0.459820f,-0.149694f}, -{0.519126f,-0.484408f,-0.182053f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.519126f,-0.484408f,-0.182053f}, -{0.493554f,-0.502430f,-0.206613f}, -{0.460483f,-0.455762f,-0.172921f}, -{0.478382f,-0.512709f,-0.219323f}, -{0.462747f,-0.557010f,-0.256818f}, -{0.416254f,-0.510086f,-0.238332f}, -{0.462747f,-0.557010f,-0.256818f}, -{0.478024f,-0.583510f,-0.277120f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.478024f,-0.583510f,-0.277120f}, -{0.472991f,-0.630213f,-0.286776f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.543268f,-0.710829f,-0.285133f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.512534f,-0.739842f,-0.292882f}, -{0.671667f,-0.722656f,-0.237407f}, -{0.711722f,-0.704296f,-0.201800f}, -{0.705973f,-0.834184f,-0.222231f}, -{0.711722f,-0.704296f,-0.201800f}, -{0.727599f,-0.690301f,-0.181027f}, -{0.734784f,-0.771894f,-0.194041f}, -{0.727599f,-0.690301f,-0.181027f}, -{0.774117f,-0.644992f,-0.078104f}, -{0.768696f,-0.671546f,-0.109799f}, -{0.734388f,-0.587478f,-0.118492f}, -{0.720657f,-0.563569f,-0.126581f}, -{0.774117f,-0.644992f,-0.078104f}, -{-0.560722f,-0.349176f,0.011072f}, -{-0.568154f,-0.237707f,0.011206f}, -{-0.559234f,-0.344801f,-0.020738f}, -{-0.560722f,-0.349176f,0.011072f}, -{-0.555103f,-0.332963f,0.071434f}, -{-0.561506f,-0.286111f,0.048810f}, -{-0.545130f,-0.381469f,0.080591f}, -{-0.528754f,-0.330569f,0.148089f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.499401f,-0.258668f,0.203390f}, -{-0.477385f,-0.383358f,0.220877f}, -{-0.446964f,-0.301290f,0.293249f}, -{-0.515971f,-0.296022f,0.177163f}, -{-0.499401f,-0.258668f,0.203390f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.528754f,-0.330569f,0.148089f}, -{-0.515971f,-0.296022f,0.177163f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.421948f,-0.151893f,0.259289f}, -{-0.389042f,-0.124913f,0.264001f}, -{-0.381471f,-0.048737f,0.171259f}, -{-0.451868f,-0.184248f,0.246310f}, -{-0.421948f,-0.151893f,0.259289f}, -{-0.447572f,-0.087580f,0.174226f}, -{-0.424058f,-0.259452f,0.324576f}, -{-0.451868f,-0.184248f,0.246310f}, -{-0.446964f,-0.301290f,0.293249f}, -{-0.389042f,-0.124913f,0.264001f}, -{-0.327785f,-0.092566f,0.250131f}, -{-0.381471f,-0.048737f,0.171259f}, -{-0.327785f,-0.092566f,0.250131f}, -{-0.326741f,-0.154667f,0.355902f}, -{-0.292608f,-0.161980f,0.375790f}, -{-0.231992f,-0.070347f,0.181147f}, -{-0.203782f,-0.067624f,0.150119f}, -{-0.258619f,-0.061028f,0.084698f}, -{-0.166414f,-0.088964f,0.238733f}, -{-0.231992f,-0.070347f,0.181147f}, -{-0.183628f,-0.106776f,0.311577f}, -{-0.179432f,-0.066110f,0.116692f}, -{-0.162304f,-0.065348f,0.084402f}, -{-0.258619f,-0.061028f,0.084698f}, -{-0.203782f,-0.067624f,0.150119f}, -{-0.179432f,-0.066110f,0.116692f}, -{-0.258619f,-0.061028f,0.084698f}, -{-0.162304f,-0.065348f,0.084402f}, -{-0.148016f,-0.064903f,0.011139f}, -{-0.252851f,-0.067050f,0.043792f}, -{-0.149523f,-0.064983f,-0.019151f}, -{-0.159933f,-0.065380f,-0.058577f}, -{-0.243884f,-0.066668f,-0.027679f}, -{-0.148016f,-0.064903f,0.011139f}, -{-0.149523f,-0.064983f,-0.019151f}, -{-0.252851f,-0.067050f,0.043792f}, -{-0.201037f,-0.067664f,-0.127122f}, -{-0.125219f,-0.083233f,-0.170020f}, -{-0.198765f,-0.079337f,-0.188027f}, -{-0.125219f,-0.083233f,-0.170020f}, -{-0.070942f,-0.074729f,-0.076541f}, -{-0.061376f,-0.099199f,-0.188071f}, -{-0.159933f,-0.065380f,-0.058577f}, -{-0.201037f,-0.067664f,-0.127122f}, -{-0.287041f,-0.058157f,-0.051717f}, -{-0.243362f,-0.072214f,-0.171929f}, -{-0.202742f,-0.086092f,-0.217563f}, -{-0.245134f,-0.087132f,-0.227843f}, -{-0.198765f,-0.079337f,-0.188027f}, -{-0.243362f,-0.072214f,-0.171929f}, -{-0.201037f,-0.067664f,-0.127122f}, -{-0.358086f,-0.107641f,-0.238958f}, -{-0.388213f,-0.126167f,-0.242428f}, -{-0.416822f,-0.064653f,-0.153867f}, -{-0.297547f,-0.174158f,-0.365961f}, -{-0.358086f,-0.107641f,-0.238958f}, -{-0.252367f,-0.105630f,-0.289763f}, -{-0.421068f,-0.153229f,-0.237698f}, -{-0.450836f,-0.185466f,-0.224737f}, -{-0.448058f,-0.087913f,-0.151966f}, -{-0.388213f,-0.126167f,-0.242428f}, -{-0.421068f,-0.153229f,-0.237698f}, -{-0.416822f,-0.064653f,-0.153867f}, -{-0.514781f,-0.296720f,-0.156380f}, -{-0.537555f,-0.360128f,-0.095471f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.497319f,-0.257788f,-0.183325f}, -{-0.514781f,-0.296720f,-0.156380f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.476087f,-0.385187f,-0.201486f}, -{-0.497319f,-0.257788f,-0.183325f}, -{-0.423572f,-0.261461f,-0.305663f}, -{-0.537555f,-0.360128f,-0.095471f}, -{-0.544261f,-0.380273f,-0.062496f}, -{-0.559234f,-0.344801f,-0.020738f}, -{-0.351462f,-0.233598f,0.386572f}, -{-0.332791f,-0.291448f,0.397380f}, -{-0.332758f,-0.213138f,0.390733f}, -{-0.019773f,-0.099603f,0.173257f}, -{-0.067799f,-0.090509f,0.181699f}, -{-0.075522f,-0.108091f,0.248564f}, -{-0.070942f,-0.074729f,-0.076541f}, -{0.000189f,-0.101606f,-0.138466f}, -{-0.061376f,-0.099199f,-0.188071f}, -{0.000189f,-0.101606f,-0.138466f}, -{0.086466f,-0.137432f,-0.143963f}, -{-0.021328f,-0.129250f,-0.234450f}, -{-0.286552f,-0.332472f,-0.383720f}, -{-0.331117f,-0.295393f,-0.379450f}, -{-0.235057f,-0.292748f,-0.400311f}, -{-0.105466f,-0.386213f,0.388652f}, -{-0.004625f,-0.457333f,0.370803f}, -{0.017426f,-0.346902f,0.352166f}, -{-0.144161f,-0.433891f,0.384889f}, -{-0.105466f,-0.386213f,0.388652f}, -{-0.116941f,-0.334306f,0.394759f}, -{-0.246428f,-0.363260f,0.404451f}, -{-0.144161f,-0.433891f,0.384889f}, -{-0.215595f,-0.327438f,0.412834f}, -{0.017426f,-0.346902f,0.352166f}, -{0.064971f,-0.385246f,0.344817f}, -{0.100829f,-0.352558f,0.320623f}, -{0.029571f,-0.420403f,0.361776f}, -{0.017426f,-0.346902f,0.352166f}, -{-0.004625f,-0.457333f,0.370803f}, -{0.100829f,-0.352558f,0.320623f}, -{-0.005216f,-0.266256f,0.343910f}, -{0.017426f,-0.346902f,0.352166f}, -{0.090711f,-0.222883f,0.263048f}, -{0.126724f,-0.204070f,0.218727f}, -{0.045404f,-0.146120f,0.224543f}, -{0.086466f,-0.137432f,-0.143963f}, -{0.051721f,-0.148377f,-0.198787f}, -{-0.021328f,-0.129250f,-0.234450f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.149091f,-0.327626f,-0.264295f}, -{0.065259f,-0.319680f,-0.302512f}, -{0.133485f,-0.207118f,-0.193611f}, -{0.099286f,-0.226394f,-0.236522f}, -{0.051721f,-0.148377f,-0.198787f}, -{0.065259f,-0.319680f,-0.302512f}, -{0.093577f,-0.375942f,-0.310486f}, -{0.024576f,-0.327260f,-0.322519f}, -{-0.005142f,-0.356243f,-0.339157f}, -{-0.029094f,-0.409284f,-0.350942f}, -{-0.052308f,-0.329493f,-0.359209f}, -{0.039885f,-0.428334f,-0.339342f}, -{-0.005142f,-0.356243f,-0.339157f}, -{0.075309f,-0.393092f,-0.322131f}, -{-0.187485f,-0.404612f,-0.370293f}, -{-0.286552f,-0.332472f,-0.383720f}, -{-0.168986f,-0.380329f,-0.375081f}, -{-0.136648f,-0.439410f,-0.360300f}, -{-0.168986f,-0.380329f,-0.375081f}, -{-0.122778f,-0.359717f,-0.370968f}, -{0.252808f,-0.522574f,0.328424f}, -{0.223172f,-0.556659f,0.344670f}, -{0.340174f,-0.570143f,0.314960f}, -{0.223172f,-0.556659f,0.344670f}, -{0.193603f,-0.592279f,0.353649f}, -{0.340174f,-0.570143f,0.314960f}, -{0.362755f,-0.409030f,0.206062f}, -{0.338082f,-0.432901f,0.243222f}, -{0.487713f,-0.414396f,0.194702f}, -{0.338082f,-0.432901f,0.243222f}, -{0.311144f,-0.459972f,0.276415f}, -{0.418586f,-0.517778f,0.265251f}, -{0.384681f,-0.388667f,0.164260f}, -{0.362755f,-0.409030f,0.206062f}, -{0.464039f,-0.418657f,0.141699f}, -{0.417136f,-0.361486f,0.011309f}, -{0.401346f,-0.373992f,0.120819f}, -{0.440027f,-0.395373f,0.118574f}, -{0.193603f,-0.592279f,0.353649f}, -{0.377954f,-0.680866f,0.328231f}, -{0.340174f,-0.570143f,0.314960f}, -{0.578564f,-0.431239f,0.056949f}, -{0.496337f,-0.400178f,0.011387f}, -{0.503896f,-0.419118f,0.106868f}, -{0.496337f,-0.400178f,0.011387f}, -{0.417136f,-0.361486f,0.011309f}, -{0.440027f,-0.395373f,0.118574f}, -{0.503896f,-0.419118f,0.106868f}, -{0.496337f,-0.400178f,0.011387f}, -{0.440027f,-0.395373f,0.118574f}, -{0.460483f,-0.455762f,-0.172921f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.519126f,-0.484408f,-0.182053f}, -{0.478382f,-0.512709f,-0.219323f}, -{0.460483f,-0.455762f,-0.172921f}, -{0.493554f,-0.502430f,-0.206613f}, -{0.394032f,-0.615157f,-0.293048f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.472991f,-0.630213f,-0.286776f}, -{0.388471f,-0.543888f,-0.267182f}, -{0.416254f,-0.510086f,-0.238332f}, -{0.462747f,-0.557010f,-0.256818f}, -{0.401041f,-0.689464f,-0.303962f}, -{0.472991f,-0.630213f,-0.286776f}, -{0.468667f,-0.664724f,-0.291909f}, -{0.405685f,-0.643118f,0.319928f}, -{0.534812f,-0.654828f,0.297562f}, -{0.435241f,-0.592881f,0.299367f}, -{0.377954f,-0.680866f,0.328231f}, -{0.405685f,-0.643118f,0.319928f}, -{0.340174f,-0.570143f,0.314960f}, -{0.534812f,-0.654828f,0.297562f}, -{0.615209f,-0.751537f,0.291641f}, -{0.562744f,-0.660393f,0.291692f}, -{0.737736f,-0.534172f,0.053169f}, -{0.668793f,-0.472827f,0.054810f}, -{0.693869f,-0.505420f,0.099781f}, -{0.668793f,-0.472827f,0.054810f}, -{0.578564f,-0.431239f,0.056949f}, -{0.574343f,-0.443898f,0.127927f}, -{0.512534f,-0.739842f,-0.292882f}, -{0.468667f,-0.664724f,-0.291909f}, -{0.543268f,-0.710829f,-0.285133f}, -{0.615209f,-0.751537f,0.291641f}, -{0.636516f,-0.715392f,0.278183f}, -{0.562744f,-0.660393f,0.291692f}, -{0.752845f,-0.664541f,0.158286f}, -{0.790792f,-0.735889f,0.101690f}, -{0.770297f,-0.623219f,0.094728f}, -{0.716496f,-0.750669f,0.231711f}, -{0.742165f,-0.690772f,0.185737f}, -{0.699804f,-0.664386f,0.222474f}, -{0.777168f,-0.609113f,0.049431f}, -{0.737736f,-0.534172f,0.053169f}, -{0.725466f,-0.549910f,0.117326f}, -{0.770297f,-0.623219f,0.094728f}, -{0.777168f,-0.609113f,0.049431f}, -{0.725466f,-0.549910f,0.117326f}, -{0.756868f,-0.712629f,-0.150208f}, -{0.734784f,-0.771894f,-0.194041f}, -{0.727599f,-0.690301f,-0.181027f}, -{0.768696f,-0.671546f,-0.109799f}, -{0.756868f,-0.712629f,-0.150208f}, -{0.727599f,-0.690301f,-0.181027f}, -{0.734784f,-0.771894f,-0.194041f}, -{0.705973f,-0.834184f,-0.222231f}, -{0.711722f,-0.704296f,-0.201800f}, -{-0.559234f,-0.344801f,-0.020738f}, -{-0.531076f,-0.209118f,-0.105800f}, -{-0.537555f,-0.360128f,-0.095471f}, -{-0.497319f,-0.257788f,-0.183325f}, -{-0.497145f,-0.145443f,-0.135271f}, -{-0.450836f,-0.185466f,-0.224737f}, -{-0.358086f,-0.107641f,-0.238958f}, -{-0.345446f,-0.043039f,-0.136387f}, -{-0.245134f,-0.087132f,-0.227843f}, -{-0.345446f,-0.043039f,-0.136387f}, -{-0.243362f,-0.072214f,-0.171929f}, -{-0.245134f,-0.087132f,-0.227843f}, -{-0.243362f,-0.072214f,-0.171929f}, -{-0.281868f,-0.052914f,-0.093357f}, -{-0.201037f,-0.067664f,-0.127122f}, -{-0.231992f,-0.070347f,0.181147f}, -{-0.345111f,-0.042992f,0.158522f}, -{-0.327785f,-0.092566f,0.250131f}, -{-0.451868f,-0.184248f,0.246310f}, -{-0.496944f,-0.145170f,0.157557f}, -{-0.499401f,-0.258668f,0.203390f}, -{-0.530825f,-0.208599f,0.127619f}, -{-0.555103f,-0.332963f,0.071434f}, -{-0.545130f,-0.381469f,0.080591f}, -{-0.332583f,-0.216149f,-0.374513f}, -{-0.265985f,-0.237324f,-0.396676f}, -{-0.331117f,-0.295393f,-0.379450f}, -{0.065259f,-0.319680f,-0.302512f}, -{0.016993f,-0.279886f,-0.313177f}, -{0.051779f,-0.246869f,-0.321229f}, -{-0.125219f,-0.083233f,-0.170020f}, -{-0.099257f,-0.097014f,-0.213617f}, -{-0.198765f,-0.079337f,-0.188027f}, -{-0.332758f,-0.213138f,0.390733f}, -{-0.292608f,-0.161980f,0.375790f}, -{-0.326741f,-0.154667f,0.355902f}, -{-0.327785f,-0.092566f,0.250131f}, -{-0.241642f,-0.103722f,0.298771f}, -{-0.231992f,-0.070347f,0.181147f}, -{-0.111865f,-0.080516f,0.168778f}, -{-0.075522f,-0.108091f,0.248564f}, -{-0.067799f,-0.090509f,0.181699f}, -{0.045404f,-0.146120f,0.224543f}, -{0.009331f,-0.168087f,0.282574f}, -{0.090711f,-0.222883f,0.263048f}, -{0.017426f,-0.346902f,0.352166f}, -{-0.079684f,-0.340384f,0.384449f}, -{-0.105466f,-0.386213f,0.388652f}, -{0.770297f,-0.623219f,0.094728f}, -{0.754382f,-0.641772f,0.143444f}, -{0.752845f,-0.664541f,0.158286f}, -{0.405685f,-0.643118f,0.319928f}, -{0.435241f,-0.592881f,0.299367f}, -{0.340174f,-0.570143f,0.314960f}, -{0.418586f,-0.517778f,0.265251f}, -{0.419554f,-0.494469f,0.248712f}, -{0.338082f,-0.432901f,0.243222f}, -{0.623118f,-0.726832f,-0.262889f}, -{0.671667f,-0.722656f,-0.237407f}, -{0.705973f,-0.834184f,-0.222231f}, -{-0.499401f,-0.258668f,0.203390f}, -{-0.446964f,-0.301290f,0.293249f}, -{-0.451868f,-0.184248f,0.246310f}, -{-0.450836f,-0.185466f,-0.224737f}, -{-0.423572f,-0.261461f,-0.305663f}, -{-0.497319f,-0.257788f,-0.183325f}, -{-0.202742f,-0.086092f,-0.217563f}, -{-0.252367f,-0.105630f,-0.289763f}, -{-0.245134f,-0.087132f,-0.227843f}, -{-0.184861f,-0.099577f,-0.310004f}, -{-0.252367f,-0.105630f,-0.289763f}, -{-0.202742f,-0.086092f,-0.217563f}, -{-0.184861f,-0.099577f,-0.310004f}, -{-0.167464f,-0.101732f,-0.336713f}, -{-0.252367f,-0.105630f,-0.289763f}, -{-0.134646f,-0.119311f,-0.426173f}, -{-0.167464f,-0.101732f,-0.336713f}, -{-0.146428f,-0.102969f,-0.364004f}, -{-0.067899f,-0.111653f,-0.434320f}, -{-0.134646f,-0.119311f,-0.426173f}, -{-0.146428f,-0.102969f,-0.364004f}, -{-0.213416f,-0.140062f,-0.382713f}, -{-0.268909f,-0.179846f,-0.378474f}, -{-0.167464f,-0.101732f,-0.336713f}, -{-0.167464f,-0.101732f,-0.336713f}, -{-0.268909f,-0.179846f,-0.378474f}, -{-0.252367f,-0.105630f,-0.289763f}, -{-0.164693f,-0.141383f,-0.430850f}, -{-0.213416f,-0.140062f,-0.382713f}, -{-0.167464f,-0.101732f,-0.336713f}, -{-0.134646f,-0.119311f,-0.426173f}, -{-0.164693f,-0.141383f,-0.430850f}, -{-0.167464f,-0.101732f,-0.336713f}, -{-0.138511f,-0.142112f,-0.454333f}, -{-0.164693f,-0.141383f,-0.430850f}, -{-0.134646f,-0.119311f,-0.426173f}, -{-0.110489f,-0.177192f,-0.490422f}, -{-0.138511f,-0.142112f,-0.454333f}, -{-0.134646f,-0.119311f,-0.426173f}, -{-0.164693f,-0.141383f,-0.430850f}, -{-0.241831f,-0.184946f,-0.393921f}, -{-0.213416f,-0.140062f,-0.382713f}, -{-0.213416f,-0.140062f,-0.382713f}, -{-0.241831f,-0.184946f,-0.393921f}, -{-0.268909f,-0.179846f,-0.378474f}, -{-0.110489f,-0.177192f,-0.490422f}, -{-0.164693f,-0.141383f,-0.430850f}, -{-0.138511f,-0.142112f,-0.454333f}, -{-0.241831f,-0.184946f,-0.393921f}, -{-0.265985f,-0.237324f,-0.396676f}, -{-0.268909f,-0.179846f,-0.378474f}, -{-0.212072f,-0.229481f,-0.420893f}, -{-0.241831f,-0.184946f,-0.393921f}, -{-0.164693f,-0.141383f,-0.430850f}, -{-0.241831f,-0.184946f,-0.393921f}, -{-0.212072f,-0.229481f,-0.420893f}, -{-0.265985f,-0.237324f,-0.396676f}, -{-0.162885f,-0.214970f,-0.458097f}, -{-0.212072f,-0.229481f,-0.420893f}, -{-0.164693f,-0.141383f,-0.430850f}, -{-0.110036f,-0.214782f,-0.494281f}, -{-0.162885f,-0.214970f,-0.458097f}, -{-0.110489f,-0.177192f,-0.490422f}, -{-0.110489f,-0.177192f,-0.490422f}, -{-0.162885f,-0.214970f,-0.458097f}, -{-0.164693f,-0.141383f,-0.430850f}, -{-0.212072f,-0.229481f,-0.420893f}, -{-0.235057f,-0.292748f,-0.400311f}, -{-0.265985f,-0.237324f,-0.396676f}, -{-0.235057f,-0.292748f,-0.400311f}, -{-0.212072f,-0.229481f,-0.420893f}, -{-0.189197f,-0.289148f,-0.413892f}, -{-0.155734f,-0.252472f,-0.452610f}, -{-0.212072f,-0.229481f,-0.420893f}, -{-0.162885f,-0.214970f,-0.458097f}, -{-0.212072f,-0.229481f,-0.420893f}, -{-0.155734f,-0.252472f,-0.452610f}, -{-0.189197f,-0.289148f,-0.413892f}, -{-0.162885f,-0.214970f,-0.458097f}, -{-0.110036f,-0.214782f,-0.494281f}, -{-0.155734f,-0.252472f,-0.452610f}, -{-0.168986f,-0.380329f,-0.375081f}, -{-0.286552f,-0.332472f,-0.383720f}, -{-0.235057f,-0.292748f,-0.400311f}, -{-0.189197f,-0.289148f,-0.413892f}, -{-0.168986f,-0.380329f,-0.375081f}, -{-0.235057f,-0.292748f,-0.400311f}, -{-0.120262f,-0.311237f,-0.403812f}, -{-0.189197f,-0.289148f,-0.413892f}, -{-0.155734f,-0.252472f,-0.452610f}, -{-0.110036f,-0.214782f,-0.494281f}, -{-0.120262f,-0.311237f,-0.403812f}, -{-0.155734f,-0.252472f,-0.452610f}, -{-0.074597f,-0.288433f,-0.473379f}, -{-0.120262f,-0.311237f,-0.403812f}, -{-0.110036f,-0.214782f,-0.494281f}, -{-0.122778f,-0.359717f,-0.370968f}, -{-0.168986f,-0.380329f,-0.375081f}, -{-0.189197f,-0.289148f,-0.413892f}, -{-0.122778f,-0.359717f,-0.370968f}, -{-0.189197f,-0.289148f,-0.413892f}, -{-0.120262f,-0.311237f,-0.403812f}, -{-0.074597f,-0.288433f,-0.473379f}, -{-0.068822f,-0.305460f,-0.446860f}, -{-0.120262f,-0.311237f,-0.403812f}, -{-0.052308f,-0.329493f,-0.359209f}, -{-0.120262f,-0.311237f,-0.403812f}, -{-0.050941f,-0.312602f,-0.352088f}, -{-0.122778f,-0.359717f,-0.370968f}, -{-0.120262f,-0.311237f,-0.403812f}, -{-0.052308f,-0.329493f,-0.359209f}, -{-0.050941f,-0.312602f,-0.352088f}, -{-0.120262f,-0.311237f,-0.403812f}, -{-0.068822f,-0.305460f,-0.446860f}, -{-0.022763f,-0.310064f,-0.335019f}, -{-0.005142f,-0.356243f,-0.339157f}, -{-0.050941f,-0.312602f,-0.352088f}, -{-0.052308f,-0.329493f,-0.359209f}, -{-0.050941f,-0.312602f,-0.352088f}, -{-0.005142f,-0.356243f,-0.339157f}, -{0.016993f,-0.279886f,-0.313177f}, -{0.024576f,-0.327260f,-0.322519f}, -{-0.005142f,-0.356243f,-0.339157f}, -{-0.022763f,-0.310064f,-0.335019f}, -{0.016993f,-0.279886f,-0.313177f}, -{-0.005142f,-0.356243f,-0.339157f}, -{0.016993f,-0.279886f,-0.313177f}, -{-0.022763f,-0.310064f,-0.335019f}, -{-0.050941f,-0.312602f,-0.352088f}, -{0.016993f,-0.279886f,-0.313177f}, -{-0.050941f,-0.312602f,-0.352088f}, -{-0.059422f,-0.267293f,-0.313983f}, -{-0.057381f,-0.200179f,-0.293350f}, -{0.016993f,-0.279886f,-0.313177f}, -{-0.059422f,-0.267293f,-0.313983f}, -{0.016993f,-0.279886f,-0.313177f}, -{-0.057381f,-0.200179f,-0.293350f}, -{0.002521f,-0.248492f,-0.310613f}, -{0.024228f,-0.180434f,-0.258813f}, -{0.002521f,-0.248492f,-0.310613f}, -{-0.010288f,-0.188253f,-0.277203f}, -{0.002521f,-0.248492f,-0.310613f}, -{-0.057381f,-0.200179f,-0.293350f}, -{-0.010288f,-0.188253f,-0.277203f}, -{-0.073301f,-0.143606f,-0.309418f}, -{-0.010288f,-0.188253f,-0.277203f}, -{-0.057381f,-0.200179f,-0.293350f}, -{-0.035937f,-0.136006f,-0.252683f}, -{-0.047893f,-0.120479f,-0.242248f}, -{0.024228f,-0.180434f,-0.258813f}, -{0.024228f,-0.180434f,-0.258813f}, -{-0.047893f,-0.120479f,-0.242248f}, -{-0.021328f,-0.129250f,-0.234450f}, -{-0.073301f,-0.143606f,-0.309418f}, -{-0.035937f,-0.136006f,-0.252683f}, -{-0.010288f,-0.188253f,-0.277203f}, -{-0.010288f,-0.188253f,-0.277203f}, -{-0.035937f,-0.136006f,-0.252683f}, -{0.024228f,-0.180434f,-0.258813f}, -{-0.058882f,-0.127144f,-0.263512f}, -{-0.047893f,-0.120479f,-0.242248f}, -{-0.073301f,-0.143606f,-0.309418f}, -{-0.073301f,-0.143606f,-0.309418f}, -{-0.047893f,-0.120479f,-0.242248f}, -{-0.035937f,-0.136006f,-0.252683f}, -{-0.098048f,-0.112313f,-0.290612f}, -{-0.058882f,-0.127144f,-0.263512f}, -{-0.073301f,-0.143606f,-0.309418f}, -{-0.073557f,-0.120718f,-0.343207f}, -{-0.073301f,-0.143606f,-0.309418f}, -{-0.068683f,-0.132488f,-0.329037f}, -{-0.073301f,-0.143606f,-0.309418f}, -{-0.073557f,-0.120718f,-0.343207f}, -{-0.058882f,-0.127144f,-0.263512f}, -{-0.098048f,-0.112313f,-0.290612f}, -{-0.099257f,-0.097014f,-0.213617f}, -{-0.058882f,-0.127144f,-0.263512f}, -{-0.058882f,-0.127144f,-0.263512f}, -{-0.099257f,-0.097014f,-0.213617f}, -{-0.047893f,-0.120479f,-0.242248f}, -{-0.146428f,-0.102969f,-0.364004f}, -{-0.098048f,-0.112313f,-0.290612f}, -{-0.058882f,-0.127144f,-0.263512f}, -{-0.073557f,-0.120718f,-0.343207f}, -{-0.146428f,-0.102969f,-0.364004f}, -{-0.058882f,-0.127144f,-0.263512f}, -{-0.098048f,-0.112313f,-0.290612f}, -{-0.202742f,-0.086092f,-0.217563f}, -{-0.099257f,-0.097014f,-0.213617f}, -{-0.184861f,-0.099577f,-0.310004f}, -{-0.202742f,-0.086092f,-0.217563f}, -{-0.098048f,-0.112313f,-0.290612f}, -{-0.167464f,-0.101732f,-0.336713f}, -{-0.184861f,-0.099577f,-0.310004f}, -{-0.098048f,-0.112313f,-0.290612f}, -{-0.146428f,-0.102969f,-0.364004f}, -{-0.167464f,-0.101732f,-0.336713f}, -{-0.098048f,-0.112313f,-0.290612f}, -{-0.067899f,-0.111653f,-0.434320f}, -{-0.146428f,-0.102969f,-0.364004f}, -{-0.073557f,-0.120718f,-0.343207f}, -{-0.292079f,-0.134864f,-0.326030f}, -{-0.268909f,-0.179846f,-0.378474f}, -{-0.297547f,-0.174158f,-0.365961f}, -{-0.297547f,-0.174158f,-0.365961f}, -{-0.268909f,-0.179846f,-0.378474f}, -{-0.332583f,-0.216149f,-0.374513f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.024228f,-0.180434f,-0.258813f}, -{0.051721f,-0.148377f,-0.198787f}, -{-0.074597f,-0.288433f,-0.473379f}, -{-0.110036f,-0.214782f,-0.494281f}, -{-0.080153f,-0.196721f,-0.505826f}, -{-0.080153f,-0.196721f,-0.505826f}, -{-0.110489f,-0.177192f,-0.490422f}, -{-0.077027f,-0.151393f,-0.488505f}, -{-0.077027f,-0.151393f,-0.488505f}, -{-0.110489f,-0.177192f,-0.490422f}, -{-0.073041f,-0.127692f,-0.464992f}, -{-0.073041f,-0.127692f,-0.464992f}, -{-0.134646f,-0.119311f,-0.426173f}, -{-0.067899f,-0.111653f,-0.434320f}, -{-0.134646f,-0.119311f,-0.426173f}, -{-0.073041f,-0.127692f,-0.464992f}, -{-0.110489f,-0.177192f,-0.490422f}, -{-0.268909f,-0.179846f,-0.378474f}, -{-0.292079f,-0.134864f,-0.326030f}, -{-0.252367f,-0.105630f,-0.289763f}, -{-0.110489f,-0.177192f,-0.490422f}, -{-0.080153f,-0.196721f,-0.505826f}, -{-0.110036f,-0.214782f,-0.494281f}, -{-0.047893f,-0.120479f,-0.242248f}, -{-0.061376f,-0.099199f,-0.188071f}, -{-0.021328f,-0.129250f,-0.234450f}, -{-0.099257f,-0.097014f,-0.213617f}, -{-0.061376f,-0.099199f,-0.188071f}, -{-0.047893f,-0.120479f,-0.242248f}, -{-0.268909f,-0.179846f,-0.378474f}, -{-0.265985f,-0.237324f,-0.396676f}, -{-0.332583f,-0.216149f,-0.374513f}, -{0.016993f,-0.279886f,-0.313177f}, -{0.002521f,-0.248492f,-0.310613f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.002521f,-0.248492f,-0.310613f}, -{0.024228f,-0.180434f,-0.258813f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.173783f,0.019667f,0.489404f}, -{0.189265f,0.014700f,0.405084f}, -{0.192401f,0.102763f,0.450311f}, -{0.170613f,-0.022366f,0.490332f}, -{0.189265f,0.014700f,0.405084f}, -{0.173783f,0.019667f,0.489404f}, -{0.189265f,0.014700f,0.405084f}, -{0.170613f,-0.022366f,0.490332f}, -{0.186794f,-0.028377f,0.406230f}, -{0.183692f,-0.114543f,0.465884f}, -{0.186794f,-0.028377f,0.406230f}, -{0.170613f,-0.022366f,0.490332f}, -{0.186794f,-0.028377f,0.406230f}, -{0.183692f,-0.114543f,0.465884f}, -{0.189374f,-0.117511f,0.434152f}, -{0.175029f,-0.156493f,0.466953f}, -{0.189374f,-0.117511f,0.434152f}, -{0.183692f,-0.114543f,0.465884f}, -{0.189374f,-0.117511f,0.434152f}, -{0.175029f,-0.156493f,0.466953f}, -{0.180354f,-0.160444f,0.433432f}, -{0.102438f,-0.258291f,0.468472f}, -{0.180354f,-0.160444f,0.433432f}, -{0.175029f,-0.156493f,0.466953f}, -{0.180354f,-0.160444f,0.433432f}, -{0.102438f,-0.258291f,0.468472f}, -{0.164912f,-0.200796f,0.432580f}, -{0.164912f,-0.200796f,0.432580f}, -{0.102438f,-0.258291f,0.468472f}, -{0.102908f,-0.259200f,0.395727f}, -{0.102908f,-0.259200f,0.395727f}, -{0.102438f,-0.258291f,0.468472f}, -{0.105493f,-0.264449f,0.430840f}, -{0.063529f,-0.278173f,0.468451f}, -{0.105493f,-0.264449f,0.430840f}, -{0.102438f,-0.258291f,0.468472f}, -{0.105493f,-0.264449f,0.430840f}, -{0.063529f,-0.278173f,0.468451f}, -{0.065472f,-0.284820f,0.430177f}, -{0.020645f,-0.270519f,0.504641f}, -{0.065472f,-0.284820f,0.430177f}, -{0.063529f,-0.278173f,0.468451f}, -{0.065472f,-0.284820f,0.430177f}, -{0.020645f,-0.270519f,0.504641f}, -{0.025294f,-0.298244f,0.429898f}, -{0.020645f,-0.270519f,0.504641f}, -{-0.087839f,-0.276188f,0.502768f}, -{-0.062057f,-0.301063f,0.408702f}, -{0.025294f,-0.298244f,0.429898f}, -{0.020645f,-0.270519f,0.504641f}, -{-0.062057f,-0.301063f,0.408702f}, -{-0.111146f,-0.290201f,0.406636f}, -{-0.062057f,-0.301063f,0.408702f}, -{-0.087839f,-0.276188f,0.502768f}, -{-0.087839f,-0.276188f,0.502768f}, -{-0.149581f,-0.270250f,0.465072f}, -{-0.111146f,-0.290201f,0.406636f}, -{-0.116941f,-0.334306f,0.394759f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.111146f,-0.290201f,0.406636f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.116941f,-0.334306f,0.394759f}, -{-0.079684f,-0.340384f,0.384449f}, -{0.178298f,0.106376f,0.471320f}, -{0.173783f,0.019667f,0.489404f}, -{0.192401f,0.102763f,0.450311f}, -{0.183692f,-0.114543f,0.465884f}, -{0.146396f,-0.181654f,0.501253f}, -{0.175029f,-0.156493f,0.466953f}, -{0.175029f,-0.156493f,0.466953f}, -{0.146396f,-0.181654f,0.501253f}, -{0.102438f,-0.258291f,0.468472f}, -{0.102438f,-0.258291f,0.468472f}, -{0.093735f,-0.240226f,0.504393f}, -{0.063529f,-0.278173f,0.468451f}, -{0.020645f,-0.270519f,0.504641f}, -{0.063529f,-0.278173f,0.468451f}, -{0.093735f,-0.240226f,0.504393f}, -{-0.177267f,-0.285820f,0.431560f}, -{-0.111146f,-0.290201f,0.406636f}, -{-0.149581f,-0.270250f,0.465072f}, -{-0.215595f,-0.327438f,0.412834f}, -{-0.116941f,-0.334306f,0.394759f}, -{-0.111146f,-0.290201f,0.406636f}, -{-0.177267f,-0.285820f,0.431560f}, -{-0.215595f,-0.327438f,0.412834f}, -{-0.111146f,-0.290201f,0.406636f}, -{0.132595f,0.075979f,0.502449f}, -{0.173783f,0.019667f,0.489404f}, -{0.178298f,0.106376f,0.471320f}, -{0.152034f,0.026694f,0.506102f}, -{0.173783f,0.019667f,0.489404f}, -{0.132595f,0.075979f,0.502449f}, -{0.148313f,-0.014253f,0.507090f}, -{0.173783f,0.019667f,0.489404f}, -{0.152034f,0.026694f,0.506102f}, -{0.173783f,0.019667f,0.489404f}, -{0.148313f,-0.014253f,0.507090f}, -{0.170613f,-0.022366f,0.490332f}, -{0.141854f,-0.093459f,0.513026f}, -{0.170613f,-0.022366f,0.490332f}, -{0.148313f,-0.014253f,0.507090f}, -{0.170613f,-0.022366f,0.490332f}, -{0.141854f,-0.093459f,0.513026f}, -{0.183692f,-0.114543f,0.465884f}, -{0.183692f,-0.114543f,0.465884f}, -{0.141854f,-0.093459f,0.513026f}, -{0.146396f,-0.181654f,0.501253f}, -{0.107195f,-0.189367f,0.527567f}, -{0.146396f,-0.181654f,0.501253f}, -{0.141854f,-0.093459f,0.513026f}, -{0.146396f,-0.181654f,0.501253f}, -{0.107195f,-0.189367f,0.527567f}, -{0.102438f,-0.258291f,0.468472f}, -{0.049453f,-0.228821f,0.528059f}, -{0.102438f,-0.258291f,0.468472f}, -{0.107195f,-0.189367f,0.527567f}, -{0.102438f,-0.258291f,0.468472f}, -{0.049453f,-0.228821f,0.528059f}, -{0.093735f,-0.240226f,0.504393f}, -{-0.028744f,-0.207652f,0.534506f}, -{0.093735f,-0.240226f,0.504393f}, -{0.049453f,-0.228821f,0.528059f}, -{0.093735f,-0.240226f,0.504393f}, -{-0.028744f,-0.207652f,0.534506f}, -{0.020645f,-0.270519f,0.504641f}, -{-0.066299f,-0.243798f,0.526206f}, -{0.020645f,-0.270519f,0.504641f}, -{-0.028744f,-0.207652f,0.534506f}, -{0.020645f,-0.270519f,0.504641f}, -{-0.066299f,-0.243798f,0.526206f}, -{-0.087839f,-0.276188f,0.502768f}, -{-0.110606f,-0.241566f,0.518826f}, -{-0.149581f,-0.270250f,0.465072f}, -{-0.087839f,-0.276188f,0.502768f}, -{-0.110606f,-0.241566f,0.518826f}, -{-0.087839f,-0.276188f,0.502768f}, -{-0.066299f,-0.243798f,0.526206f}, -{-0.208803f,-0.256321f,0.441297f}, -{-0.110606f,-0.241566f,0.518826f}, -{-0.175242f,-0.207831f,0.486986f}, -{-0.110606f,-0.241566f,0.518826f}, -{-0.208803f,-0.256321f,0.441297f}, -{-0.177267f,-0.285820f,0.431560f}, -{-0.177267f,-0.285820f,0.431560f}, -{-0.149581f,-0.270250f,0.465072f}, -{-0.110606f,-0.241566f,0.518826f}, -{-0.177267f,-0.285820f,0.431560f}, -{-0.208803f,-0.256321f,0.441297f}, -{-0.238253f,-0.289343f,0.423071f}, -{0.107195f,-0.189367f,0.527567f}, -{0.141854f,-0.093459f,0.513026f}, -{0.111665f,-0.109927f,0.525720f}, -{0.107195f,-0.189367f,0.527567f}, -{0.066073f,-0.132092f,0.522930f}, -{0.049453f,-0.228821f,0.528059f}, -{-0.110515f,-0.206986f,0.526612f}, -{-0.110606f,-0.241566f,0.518826f}, -{-0.066299f,-0.243798f,0.526206f}, -{-0.175242f,-0.207831f,0.486986f}, -{-0.110606f,-0.241566f,0.518826f}, -{-0.110515f,-0.206986f,0.526612f}, -{-0.264678f,-0.250049f,0.422652f}, -{-0.238253f,-0.289343f,0.423071f}, -{-0.208803f,-0.256321f,0.441297f}, -{0.065802f,-0.057222f,0.491657f}, -{0.148313f,-0.014253f,0.507090f}, -{0.152034f,0.026694f,0.506102f}, -{0.060296f,-0.094964f,0.495957f}, -{0.148313f,-0.014253f,0.507090f}, -{0.065802f,-0.057222f,0.491657f}, -{0.148313f,-0.014253f,0.507090f}, -{0.060296f,-0.094964f,0.495957f}, -{0.141854f,-0.093459f,0.513026f}, -{0.141854f,-0.093459f,0.513026f}, -{0.060296f,-0.094964f,0.495957f}, -{0.111665f,-0.109927f,0.525720f}, -{0.111665f,-0.109927f,0.525720f}, -{0.060296f,-0.094964f,0.495957f}, -{0.107195f,-0.189367f,0.527567f}, -{0.066073f,-0.132092f,0.522930f}, -{0.107195f,-0.189367f,0.527567f}, -{0.060296f,-0.094964f,0.495957f}, -{0.066073f,-0.132092f,0.522930f}, -{0.001553f,-0.167038f,0.522021f}, -{0.049453f,-0.228821f,0.528059f}, -{0.049453f,-0.228821f,0.528059f}, -{0.001553f,-0.167038f,0.522021f}, -{-0.028744f,-0.207652f,0.534506f}, -{-0.085636f,-0.165849f,0.523053f}, -{-0.028744f,-0.207652f,0.534506f}, -{0.001553f,-0.167038f,0.522021f}, -{-0.085636f,-0.165849f,0.523053f}, -{-0.066299f,-0.243798f,0.526206f}, -{-0.028744f,-0.207652f,0.534506f}, -{-0.085636f,-0.165849f,0.523053f}, -{-0.146136f,-0.169646f,0.505211f}, -{-0.110236f,-0.186252f,0.525382f}, -{-0.110236f,-0.186252f,0.525382f}, -{-0.110515f,-0.206986f,0.526612f}, -{-0.066299f,-0.243798f,0.526206f}, -{-0.085636f,-0.165849f,0.523053f}, -{-0.110236f,-0.186252f,0.525382f}, -{-0.066299f,-0.243798f,0.526206f}, -{-0.210728f,-0.147052f,0.404630f}, -{-0.208803f,-0.256321f,0.441297f}, -{-0.176935f,-0.188241f,0.485347f}, -{-0.208803f,-0.256321f,0.441297f}, -{-0.175242f,-0.207831f,0.486986f}, -{-0.176935f,-0.188241f,0.485347f}, -{-0.176935f,-0.188241f,0.485347f}, -{-0.175242f,-0.207831f,0.486986f}, -{-0.110236f,-0.186252f,0.525382f}, -{-0.110236f,-0.186252f,0.525382f}, -{-0.175242f,-0.207831f,0.486986f}, -{-0.110515f,-0.206986f,0.526612f}, -{-0.176935f,-0.188241f,0.485347f}, -{-0.110236f,-0.186252f,0.525382f}, -{-0.146136f,-0.169646f,0.505211f}, -{-0.255827f,-0.186573f,0.407580f}, -{-0.208803f,-0.256321f,0.441297f}, -{-0.210728f,-0.147052f,0.404630f}, -{-0.208803f,-0.256321f,0.441297f}, -{-0.255827f,-0.186573f,0.407580f}, -{-0.264678f,-0.250049f,0.422652f}, -{0.083686f,0.047976f,0.485253f}, -{0.132595f,0.075979f,0.502449f}, -{0.077541f,0.090817f,0.455719f}, -{0.132595f,0.075979f,0.502449f}, -{0.083686f,0.047976f,0.485253f}, -{0.152034f,0.026694f,0.506102f}, -{0.065802f,-0.057222f,0.491657f}, -{0.152034f,0.026694f,0.506102f}, -{0.083686f,0.047976f,0.485253f}, -{0.018047f,-0.134913f,0.498017f}, -{0.066073f,-0.132092f,0.522930f}, -{0.060296f,-0.094964f,0.495957f}, -{0.066073f,-0.132092f,0.522930f}, -{0.018047f,-0.134913f,0.498017f}, -{0.001553f,-0.167038f,0.522021f}, -{-0.085906f,-0.150030f,0.513193f}, -{-0.085636f,-0.165849f,0.523053f}, -{0.018047f,-0.134913f,0.498017f}, -{0.018047f,-0.134913f,0.498017f}, -{-0.085636f,-0.165849f,0.523053f}, -{0.001553f,-0.167038f,0.522021f}, -{-0.085636f,-0.165849f,0.523053f}, -{-0.085906f,-0.150030f,0.513193f}, -{-0.146136f,-0.169646f,0.505211f}, -{0.012459f,-0.121160f,0.465763f}, -{0.018047f,-0.134913f,0.498017f}, -{0.060296f,-0.094964f,0.495957f}, -{-0.096133f,-0.126726f,0.486596f}, -{-0.085906f,-0.150030f,0.513193f}, -{0.012459f,-0.121160f,0.465763f}, -{0.012459f,-0.121160f,0.465763f}, -{-0.085906f,-0.150030f,0.513193f}, -{0.018047f,-0.134913f,0.498017f}, -{-0.096133f,-0.126726f,0.486596f}, -{-0.127823f,-0.129616f,0.484378f}, -{-0.146136f,-0.169646f,0.505211f}, -{-0.096133f,-0.126726f,0.486596f}, -{-0.146136f,-0.169646f,0.505211f}, -{-0.085906f,-0.150030f,0.513193f}, -{-0.192117f,-0.124391f,0.375139f}, -{-0.210728f,-0.147052f,0.404630f}, -{-0.165005f,-0.123056f,0.436698f}, -{-0.210728f,-0.147052f,0.404630f}, -{-0.176935f,-0.188241f,0.485347f}, -{-0.127823f,-0.129616f,0.484378f}, -{-0.127823f,-0.129616f,0.484378f}, -{-0.176935f,-0.188241f,0.485347f}, -{-0.146136f,-0.169646f,0.505211f}, -{-0.165005f,-0.123056f,0.436698f}, -{-0.210728f,-0.147052f,0.404630f}, -{-0.127823f,-0.129616f,0.484378f}, -{0.077541f,0.090817f,0.455719f}, -{0.076853f,0.159067f,0.432497f}, -{0.078665f,0.090483f,0.401198f}, -{0.067733f,0.013602f,0.402306f}, -{0.077541f,0.090817f,0.455719f}, -{0.078665f,0.090483f,0.401198f}, -{0.077541f,0.090817f,0.455719f}, -{0.067733f,0.013602f,0.402306f}, -{0.083686f,0.047976f,0.485253f}, -{0.054107f,-0.017198f,0.431411f}, -{0.083686f,0.047976f,0.485253f}, -{0.067733f,0.013602f,0.402306f}, -{0.083686f,0.047976f,0.485253f}, -{0.054107f,-0.017198f,0.431411f}, -{0.065802f,-0.057222f,0.491657f}, -{0.051088f,-0.086941f,0.396159f}, -{0.065802f,-0.057222f,0.491657f}, -{0.054107f,-0.017198f,0.431411f}, -{0.065802f,-0.057222f,0.491657f}, -{0.051088f,-0.086941f,0.396159f}, -{0.060296f,-0.094964f,0.495957f}, -{0.010694f,-0.116948f,0.426696f}, -{0.012459f,-0.121160f,0.465763f}, -{0.051088f,-0.086941f,0.396159f}, -{0.051088f,-0.086941f,0.396159f}, -{0.012459f,-0.121160f,0.465763f}, -{0.060296f,-0.094964f,0.495957f}, -{-0.088441f,-0.111720f,0.431756f}, -{-0.096133f,-0.126726f,0.486596f}, -{0.010694f,-0.116948f,0.426696f}, -{0.010694f,-0.116948f,0.426696f}, -{-0.096133f,-0.126726f,0.486596f}, -{0.012459f,-0.121160f,0.465763f}, -{-0.132311f,-0.112266f,0.420061f}, -{-0.127823f,-0.129616f,0.484378f}, -{-0.088441f,-0.111720f,0.431756f}, -{-0.096133f,-0.126726f,0.486596f}, -{-0.088441f,-0.111720f,0.431756f}, -{-0.127823f,-0.129616f,0.484378f}, -{-0.192117f,-0.124391f,0.375139f}, -{-0.165005f,-0.123056f,0.436698f}, -{-0.132311f,-0.112266f,0.420061f}, -{-0.132311f,-0.112266f,0.420061f}, -{-0.165005f,-0.123056f,0.436698f}, -{-0.127823f,-0.129616f,0.484378f}, -{-0.088973f,-0.121204f,0.381822f}, -{0.010694f,-0.116948f,0.426696f}, -{-0.008942f,-0.126028f,0.389332f}, -{0.010694f,-0.116948f,0.426696f}, -{-0.088973f,-0.121204f,0.381822f}, -{-0.088441f,-0.111720f,0.431756f}, -{-0.132311f,-0.112266f,0.420061f}, -{-0.116337f,-0.126779f,0.356972f}, -{-0.192117f,-0.124391f,0.375139f}, -{-0.104743f,-0.111724f,0.293694f}, -{-0.183628f,-0.106776f,0.311577f}, -{-0.116337f,-0.126779f,0.356972f}, -{-0.116337f,-0.126779f,0.356972f}, -{-0.183628f,-0.106776f,0.311577f}, -{-0.192117f,-0.124391f,0.375139f}, -{0.096394f,0.003944f,0.364084f}, -{0.067733f,0.013602f,0.402306f}, -{0.092054f,0.121642f,0.384333f}, -{0.092054f,0.121642f,0.384333f}, -{0.067733f,0.013602f,0.402306f}, -{0.078665f,0.090483f,0.401198f}, -{0.066319f,-0.057457f,0.376144f}, -{0.054107f,-0.017198f,0.431411f}, -{0.096394f,0.003944f,0.364084f}, -{0.096394f,0.003944f,0.364084f}, -{0.054107f,-0.017198f,0.431411f}, -{0.067733f,0.013602f,0.402306f}, -{0.060765f,-0.095509f,0.368646f}, -{0.051088f,-0.086941f,0.396159f}, -{0.066319f,-0.057457f,0.376144f}, -{0.066319f,-0.057457f,0.376144f}, -{0.051088f,-0.086941f,0.396159f}, -{0.054107f,-0.017198f,0.431411f}, -{0.060765f,-0.095509f,0.368646f}, -{0.010694f,-0.116948f,0.426696f}, -{0.051088f,-0.086941f,0.396159f}, -{0.026448f,-0.157020f,0.339667f}, -{0.010694f,-0.116948f,0.426696f}, -{0.060765f,-0.095509f,0.368646f}, -{0.010694f,-0.116948f,0.426696f}, -{0.026448f,-0.157020f,0.339667f}, -{-0.008942f,-0.126028f,0.389332f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.008942f,-0.126028f,0.389332f}, -{0.026448f,-0.157020f,0.339667f}, -{-0.008942f,-0.126028f,0.389332f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.088973f,-0.121204f,0.381822f}, -{-0.088441f,-0.111720f,0.431756f}, -{-0.088973f,-0.121204f,0.381822f}, -{-0.132311f,-0.112266f,0.420061f}, -{-0.116337f,-0.126779f,0.356972f}, -{-0.132311f,-0.112266f,0.420061f}, -{-0.088973f,-0.121204f,0.381822f}, -{0.100969f,0.042712f,0.363792f}, -{0.096394f,0.003944f,0.364084f}, -{0.142891f,0.111766f,0.365137f}, -{0.142891f,0.111766f,0.365137f}, -{0.096394f,0.003944f,0.364084f}, -{0.092054f,0.121642f,0.384333f}, -{0.046608f,-0.145926f,0.340170f}, -{0.026448f,-0.157020f,0.339667f}, -{0.060765f,-0.095509f,0.368646f}, -{-0.088973f,-0.121204f,0.381822f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.116337f,-0.126779f,0.356972f}, -{-0.104743f,-0.111724f,0.293694f}, -{-0.116337f,-0.126779f,0.356972f}, -{-0.104228f,-0.165174f,0.337607f}, -{-0.094904f,-0.129069f,0.312433f}, -{-0.104743f,-0.111724f,0.293694f}, -{-0.104228f,-0.165174f,0.337607f}, -{-0.077283f,-0.175418f,0.316832f}, -{-0.094904f,-0.129069f,0.312433f}, -{-0.104228f,-0.165174f,0.337607f}, -{-0.104228f,-0.165174f,0.337607f}, -{-0.116337f,-0.126779f,0.356972f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.075522f,-0.108091f,0.248564f}, -{-0.104743f,-0.111724f,0.293694f}, -{-0.094904f,-0.129069f,0.312433f}, -{0.112453f,-0.040719f,0.355112f}, -{0.096394f,0.003944f,0.364084f}, -{0.100969f,0.042712f,0.363792f}, -{0.112453f,-0.040719f,0.355112f}, -{0.066319f,-0.057457f,0.376144f}, -{0.096394f,0.003944f,0.364084f}, -{0.125007f,-0.085296f,0.349489f}, -{0.060765f,-0.095509f,0.368646f}, -{0.112453f,-0.040719f,0.355112f}, -{0.112453f,-0.040719f,0.355112f}, -{0.060765f,-0.095509f,0.368646f}, -{0.066319f,-0.057457f,0.376144f}, -{0.026448f,-0.157020f,0.339667f}, -{-0.024666f,-0.217238f,0.332742f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.075522f,-0.108091f,0.248564f}, -{-0.032919f,-0.130421f,0.254410f}, -{0.004368f,-0.124361f,0.220649f}, -{0.004368f,-0.124361f,0.220649f}, -{-0.032919f,-0.130421f,0.254410f}, -{0.009331f,-0.168087f,0.282574f}, -{-0.077283f,-0.175418f,0.316832f}, -{-0.075522f,-0.108091f,0.248564f}, -{-0.094904f,-0.129069f,0.312433f}, -{-0.077283f,-0.175418f,0.316832f}, -{-0.032919f,-0.130421f,0.254410f}, -{-0.075522f,-0.108091f,0.248564f}, -{-0.077283f,-0.175418f,0.316832f}, -{0.009331f,-0.168087f,0.282574f}, -{-0.032919f,-0.130421f,0.254410f}, -{0.132617f,-0.167078f,0.346294f}, -{0.060765f,-0.095509f,0.368646f}, -{0.125007f,-0.085296f,0.349489f}, -{0.132617f,-0.167078f,0.346294f}, -{0.046608f,-0.145926f,0.340170f}, -{0.060765f,-0.095509f,0.368646f}, -{-0.024666f,-0.217238f,0.332742f}, -{0.026448f,-0.157020f,0.339667f}, -{0.043147f,-0.207479f,0.326207f}, -{0.043147f,-0.207479f,0.326207f}, -{0.026448f,-0.157020f,0.339667f}, -{0.046608f,-0.145926f,0.340170f}, -{-0.066588f,-0.204002f,0.324637f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.024666f,-0.217238f,0.332742f}, -{-0.024666f,-0.217238f,0.332742f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.066588f,-0.204002f,0.324637f}, -{-0.098582f,-0.220776f,0.328576f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.098582f,-0.220776f,0.328576f}, -{-0.104228f,-0.165174f,0.337607f}, -{-0.066588f,-0.204002f,0.324637f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.076426f,-0.192884f,0.325616f}, -{0.112983f,-0.197888f,0.341171f}, -{0.046608f,-0.145926f,0.340170f}, -{0.132617f,-0.167078f,0.346294f}, -{0.043147f,-0.207479f,0.326207f}, -{0.046608f,-0.145926f,0.340170f}, -{0.112983f,-0.197888f,0.341171f}, -{-0.077283f,-0.175418f,0.316832f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.077283f,-0.175418f,0.316832f}, -{-0.104228f,-0.165174f,0.337607f}, -{-0.098582f,-0.220776f,0.328576f}, -{-0.076426f,-0.192884f,0.325616f}, -{-0.077283f,-0.175418f,0.316832f}, -{-0.098582f,-0.220776f,0.328576f}, -{-0.008683f,-0.203947f,0.322526f}, -{0.009331f,-0.168087f,0.282574f}, -{-0.024666f,-0.217238f,0.332742f}, -{0.009331f,-0.168087f,0.282574f}, -{-0.077283f,-0.175418f,0.316832f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.024666f,-0.217238f,0.332742f}, -{0.009331f,-0.168087f,0.282574f}, -{0.179721f,0.062086f,0.381562f}, -{0.142891f,0.111766f,0.365137f}, -{0.181134f,0.104308f,0.385340f}, -{0.179721f,0.062086f,0.381562f}, -{0.100969f,0.042712f,0.363792f}, -{0.142891f,0.111766f,0.365137f}, -{0.174508f,-0.023827f,0.381969f}, -{0.112453f,-0.040719f,0.355112f}, -{0.179721f,0.062086f,0.381562f}, -{0.179721f,0.062086f,0.381562f}, -{0.112453f,-0.040719f,0.355112f}, -{0.100969f,0.042712f,0.363792f}, -{0.170862f,-0.107936f,0.378486f}, -{0.112453f,-0.040719f,0.355112f}, -{0.174508f,-0.023827f,0.381969f}, -{0.170862f,-0.107936f,0.378486f}, -{0.125007f,-0.085296f,0.349489f}, -{0.112453f,-0.040719f,0.355112f}, -{0.163224f,-0.147754f,0.373968f}, -{0.132617f,-0.167078f,0.346294f}, -{0.170862f,-0.107936f,0.378486f}, -{0.170862f,-0.107936f,0.378486f}, -{0.132617f,-0.167078f,0.346294f}, -{0.125007f,-0.085296f,0.349489f}, -{-0.005216f,-0.266256f,0.343910f}, -{-0.024666f,-0.217238f,0.332742f}, -{0.059361f,-0.263459f,0.362001f}, -{0.059361f,-0.263459f,0.362001f}, -{-0.024666f,-0.217238f,0.332742f}, -{0.043147f,-0.207479f,0.326207f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.024666f,-0.217238f,0.332742f}, -{-0.024666f,-0.217238f,0.332742f}, -{-0.005216f,-0.266256f,0.343910f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.106992f,-0.262287f,0.349994f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.081501f,-0.256777f,0.360540f}, -{-0.106992f,-0.262287f,0.349994f}, -{-0.098582f,-0.220776f,0.328576f}, -{0.189265f,0.014700f,0.405084f}, -{0.179721f,0.062086f,0.381562f}, -{0.192401f,0.102763f,0.450311f}, -{0.192401f,0.102763f,0.450311f}, -{0.179721f,0.062086f,0.381562f}, -{0.181134f,0.104308f,0.385340f}, -{0.186794f,-0.028377f,0.406230f}, -{0.174508f,-0.023827f,0.381969f}, -{0.189265f,0.014700f,0.405084f}, -{0.189265f,0.014700f,0.405084f}, -{0.174508f,-0.023827f,0.381969f}, -{0.179721f,0.062086f,0.381562f}, -{0.189374f,-0.117511f,0.434152f}, -{0.170862f,-0.107936f,0.378486f}, -{0.186794f,-0.028377f,0.406230f}, -{0.186794f,-0.028377f,0.406230f}, -{0.170862f,-0.107936f,0.378486f}, -{0.174508f,-0.023827f,0.381969f}, -{0.180354f,-0.160444f,0.433432f}, -{0.163224f,-0.147754f,0.373968f}, -{0.189374f,-0.117511f,0.434152f}, -{0.189374f,-0.117511f,0.434152f}, -{0.163224f,-0.147754f,0.373968f}, -{0.170862f,-0.107936f,0.378486f}, -{0.102908f,-0.259200f,0.395727f}, -{0.132617f,-0.167078f,0.346294f}, -{0.180354f,-0.160444f,0.433432f}, -{0.180354f,-0.160444f,0.433432f}, -{0.132617f,-0.167078f,0.346294f}, -{0.163224f,-0.147754f,0.373968f}, -{0.102908f,-0.259200f,0.395727f}, -{0.112983f,-0.197888f,0.341171f}, -{0.132617f,-0.167078f,0.346294f}, -{0.102908f,-0.259200f,0.395727f}, -{0.043147f,-0.207479f,0.326207f}, -{0.112983f,-0.197888f,0.341171f}, -{0.065472f,-0.284820f,0.430177f}, -{0.059361f,-0.263459f,0.362001f}, -{0.102908f,-0.259200f,0.395727f}, -{0.102908f,-0.259200f,0.395727f}, -{0.059361f,-0.263459f,0.362001f}, -{0.043147f,-0.207479f,0.326207f}, -{0.025294f,-0.298244f,0.429898f}, -{-0.005216f,-0.266256f,0.343910f}, -{0.065472f,-0.284820f,0.430177f}, -{0.065472f,-0.284820f,0.430177f}, -{-0.005216f,-0.266256f,0.343910f}, -{0.059361f,-0.263459f,0.362001f}, -{0.025294f,-0.298244f,0.429898f}, -{-0.062057f,-0.301063f,0.408702f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.005216f,-0.266256f,0.343910f}, -{0.025294f,-0.298244f,0.429898f}, -{-0.037718f,-0.276171f,0.358543f}, -{0.164912f,-0.200796f,0.432580f}, -{0.102908f,-0.259200f,0.395727f}, -{0.180354f,-0.160444f,0.433432f}, -{0.065472f,-0.284820f,0.430177f}, -{0.102908f,-0.259200f,0.395727f}, -{0.105493f,-0.264449f,0.430840f}, -{-0.111146f,-0.290201f,0.406636f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.062057f,-0.301063f,0.408702f}, -{-0.037718f,-0.276171f,0.358543f}, -{-0.111146f,-0.290201f,0.406636f}, -{-0.106992f,-0.262287f,0.349994f}, -{0.198832f,0.143810f,0.433749f}, -{0.163968f,0.167990f,0.461420f}, -{0.178298f,0.106376f,0.471320f}, -{0.163968f,0.167990f,0.461420f}, -{0.157324f,0.149704f,0.469691f}, -{0.132595f,0.075979f,0.502449f}, -{0.157324f,0.149704f,0.469691f}, -{0.093801f,0.154547f,0.455308f}, -{0.077541f,0.090817f,0.455719f}, -{0.076853f,0.159067f,0.432497f}, -{0.097574f,0.151120f,0.385996f}, -{0.092054f,0.121642f,0.384333f}, -{0.097574f,0.151120f,0.385996f}, -{0.137804f,0.173277f,0.376054f}, -{0.142891f,0.111766f,0.365137f}, -{0.137804f,0.173277f,0.376054f}, -{0.173451f,0.180724f,0.382212f}, -{0.181134f,0.104308f,0.385340f}, -{0.173451f,0.180724f,0.382212f}, -{0.198832f,0.143810f,0.433749f}, -{0.181134f,0.104308f,0.385340f}, -{-0.147168f,-0.085620f,0.215947f}, -{-0.166414f,-0.088964f,0.238733f}, -{-0.104743f,-0.111724f,0.293694f}, -{-0.241642f,-0.103722f,0.298771f}, -{-0.263218f,-0.116928f,0.324979f}, -{-0.192117f,-0.124391f,0.375139f}, -{-0.263218f,-0.116928f,0.324979f}, -{-0.292608f,-0.161980f,0.375790f}, -{-0.210728f,-0.147052f,0.404630f}, -{-0.292608f,-0.161980f,0.375790f}, -{-0.302821f,-0.194571f,0.394099f}, -{-0.255827f,-0.186573f,0.407580f}, -{-0.302821f,-0.194571f,0.394099f}, -{-0.332758f,-0.213138f,0.390733f}, -{-0.264678f,-0.250049f,0.422652f}, -{-0.332758f,-0.213138f,0.390733f}, -{-0.332791f,-0.291448f,0.397380f}, -{-0.264678f,-0.250049f,0.422652f}, -{0.178298f,0.106376f,0.471320f}, -{0.192401f,0.102763f,0.450311f}, -{0.198832f,0.143810f,0.433749f}, -{0.132595f,0.075979f,0.502449f}, -{0.178298f,0.106376f,0.471320f}, -{0.163968f,0.167990f,0.461420f}, -{-0.177267f,-0.285820f,0.431560f}, -{-0.238253f,-0.289343f,0.423071f}, -{-0.215595f,-0.327438f,0.412834f}, -{-0.238253f,-0.289343f,0.423071f}, -{-0.264678f,-0.250049f,0.422652f}, -{-0.332791f,-0.291448f,0.397380f}, -{-0.264678f,-0.250049f,0.422652f}, -{-0.255827f,-0.186573f,0.407580f}, -{-0.302821f,-0.194571f,0.394099f}, -{0.077541f,0.090817f,0.455719f}, -{0.132595f,0.075979f,0.502449f}, -{0.157324f,0.149704f,0.469691f}, -{-0.210728f,-0.147052f,0.404630f}, -{-0.192117f,-0.124391f,0.375139f}, -{-0.263218f,-0.116928f,0.324979f}, -{0.078665f,0.090483f,0.401198f}, -{0.076853f,0.159067f,0.432497f}, -{0.092054f,0.121642f,0.384333f}, -{-0.183628f,-0.106776f,0.311577f}, -{-0.104743f,-0.111724f,0.293694f}, -{-0.166414f,-0.088964f,0.238733f}, -{-0.104743f,-0.111724f,0.293694f}, -{-0.075522f,-0.108091f,0.248564f}, -{-0.147168f,-0.085620f,0.215947f}, -{0.142891f,0.111766f,0.365137f}, -{0.092054f,0.121642f,0.384333f}, -{0.097574f,0.151120f,0.385996f}, -{0.004368f,-0.124361f,0.220649f}, -{-0.019773f,-0.099603f,0.173257f}, -{-0.075522f,-0.108091f,0.248564f}, -{0.181134f,0.104308f,0.385340f}, -{0.142891f,0.111766f,0.365137f}, -{0.137804f,0.173277f,0.376054f}, -{0.192401f,0.102763f,0.450311f}, -{0.181134f,0.104308f,0.385340f}, -{0.198832f,0.143810f,0.433749f}, -{0.077541f,0.090817f,0.455719f}, -{0.093801f,0.154547f,0.455308f}, -{0.076853f,0.159067f,0.432497f}, -{0.009331f,-0.168087f,0.282574f}, -{0.007341f,-0.138552f,0.245721f}, -{0.004368f,-0.124361f,0.220649f}, -{-0.183628f,-0.106776f,0.311577f}, -{-0.241642f,-0.103722f,0.298771f}, -{-0.192117f,-0.124391f,0.375139f}, -{-0.292608f,-0.161980f,0.375790f}, -{-0.255827f,-0.186573f,0.407580f}, -{-0.210728f,-0.147052f,0.404630f}, -{0.100238f,0.292530f,0.345014f}, -{0.144718f,0.245703f,0.360360f}, -{0.090277f,0.241053f,0.379391f}, -{0.090277f,0.241053f,0.379391f}, -{0.073742f,0.264260f,0.366811f}, -{0.100238f,0.292530f,0.345014f}, -{0.100238f,0.292530f,0.345014f}, -{0.224844f,0.321542f,0.381851f}, -{0.144718f,0.245703f,0.360360f}, -{0.178925f,0.219842f,0.374929f}, -{0.173451f,0.180724f,0.382212f}, -{0.137804f,0.173277f,0.376054f}, -{0.144718f,0.245703f,0.360360f}, -{0.178925f,0.219842f,0.374929f}, -{0.137804f,0.173277f,0.376054f}, -{0.224844f,0.321542f,0.381851f}, -{0.178925f,0.219842f,0.374929f}, -{0.144718f,0.245703f,0.360360f}, -{0.072391f,0.309744f,0.301789f}, -{0.075226f,0.327221f,0.310529f}, -{0.073742f,0.264260f,0.366811f}, -{0.178925f,0.219842f,0.374929f}, -{0.198832f,0.143810f,0.433749f}, -{0.173451f,0.180724f,0.382212f}, -{0.218692f,0.364927f,0.375351f}, -{0.100238f,0.292530f,0.345014f}, -{0.125847f,0.372481f,0.363354f}, -{0.100238f,0.292530f,0.345014f}, -{0.218692f,0.364927f,0.375351f}, -{0.224844f,0.321542f,0.381851f}, -{0.100238f,0.292530f,0.345014f}, -{0.073742f,0.264260f,0.366811f}, -{0.125847f,0.372481f,0.363354f}, -{0.073742f,0.264260f,0.366811f}, -{0.075226f,0.327221f,0.310529f}, -{0.087033f,0.337040f,0.355232f}, -{0.178925f,0.219842f,0.374929f}, -{0.213846f,0.226346f,0.401880f}, -{0.198832f,0.143810f,0.433749f}, -{0.178925f,0.219842f,0.374929f}, -{0.224844f,0.321542f,0.381851f}, -{0.213846f,0.226346f,0.401880f}, -{0.087033f,0.337040f,0.355232f}, -{0.125847f,0.372481f,0.363354f}, -{0.073742f,0.264260f,0.366811f}, -{0.203835f,0.312668f,0.428433f}, -{0.213846f,0.226346f,0.401880f}, -{0.224844f,0.321542f,0.381851f}, -{0.087033f,0.337040f,0.355232f}, -{0.073742f,0.264260f,0.366811f}, -{0.082346f,0.349859f,0.401974f}, -{0.082346f,0.349859f,0.401974f}, -{0.073742f,0.264260f,0.366811f}, -{0.071884f,0.272774f,0.419164f}, -{0.073742f,0.264260f,0.366811f}, -{0.087033f,0.337040f,0.355232f}, -{0.031744f,0.327872f,0.315833f}, -{0.198832f,0.143810f,0.433749f}, -{0.213846f,0.226346f,0.401880f}, -{0.163968f,0.167990f,0.461420f}, -{0.075226f,0.327221f,0.310529f}, -{0.031744f,0.327872f,0.315833f}, -{0.087033f,0.337040f,0.355232f}, -{0.106191f,0.232493f,0.435024f}, -{0.163968f,0.167990f,0.461420f}, -{0.213846f,0.226346f,0.401880f}, -{0.163968f,0.167990f,0.461420f}, -{0.106191f,0.232493f,0.435024f}, -{0.157324f,0.149704f,0.469691f}, -{0.100878f,0.301270f,0.436906f}, -{0.203835f,0.312668f,0.428433f}, -{0.224049f,0.364554f,0.402736f}, -{0.105476f,0.347881f,0.419554f}, -{0.100878f,0.301270f,0.436906f}, -{0.224049f,0.364554f,0.402736f}, -{0.071884f,0.272774f,0.419164f}, -{0.105476f,0.347881f,0.419554f}, -{0.082346f,0.349859f,0.401974f}, -{0.100878f,0.301270f,0.436906f}, -{0.105476f,0.347881f,0.419554f}, -{0.071884f,0.272774f,0.419164f}, -{0.071884f,0.272774f,0.419164f}, -{0.073742f,0.264260f,0.366811f}, -{0.031744f,0.327872f,0.315833f}, -{0.106191f,0.232493f,0.435024f}, -{0.213846f,0.226346f,0.401880f}, -{0.203835f,0.312668f,0.428433f}, -{0.203835f,0.312668f,0.428433f}, -{0.100878f,0.301270f,0.436906f}, -{0.106191f,0.232493f,0.435024f}, -{0.072391f,0.309744f,0.301789f}, -{0.031744f,0.327872f,0.315833f}, -{0.075226f,0.327221f,0.310529f}, -{0.157324f,0.149704f,0.469691f}, -{0.106191f,0.232493f,0.435024f}, -{0.076853f,0.159067f,0.432497f}, -{0.071884f,0.272774f,0.419164f}, -{0.106191f,0.232493f,0.435024f}, -{0.100878f,0.301270f,0.436906f}, -{0.076853f,0.159067f,0.432497f}, -{0.106191f,0.232493f,0.435024f}, -{0.086215f,0.245936f,0.414467f}, -{0.071884f,0.272774f,0.419164f}, -{0.086215f,0.245936f,0.414467f}, -{0.106191f,0.232493f,0.435024f}, -{0.073742f,0.264260f,0.366811f}, -{0.086215f,0.245936f,0.414467f}, -{0.071884f,0.272774f,0.419164f}, -{0.073742f,0.264260f,0.366811f}, -{0.090277f,0.241053f,0.379391f}, -{0.086215f,0.245936f,0.414467f}, -{0.031744f,0.327872f,0.315833f}, -{0.072391f,0.309744f,0.301789f}, -{0.073742f,0.264260f,0.366811f}, -{0.137804f,0.173277f,0.376054f}, -{0.090277f,0.241053f,0.379391f}, -{0.144718f,0.245703f,0.360360f}, -{0.090277f,0.241053f,0.379391f}, -{0.137804f,0.173277f,0.376054f}, -{0.076853f,0.159067f,0.432497f}, -{0.086215f,0.245936f,0.414467f}, -{0.090277f,0.241053f,0.379391f}, -{0.076853f,0.159067f,0.432497f}, -{0.157324f,0.149704f,0.469691f}, -{0.076853f,0.159067f,0.432497f}, -{0.093801f,0.154547f,0.455308f}, -{0.076853f,0.159067f,0.432497f}, -{0.137804f,0.173277f,0.376054f}, -{0.097574f,0.151120f,0.385996f}, -{0.245224f,0.302361f,0.397077f}, -{0.224049f,0.364554f,0.402736f}, -{0.203835f,0.312668f,0.428433f}, -{0.105476f,0.347881f,0.419554f}, -{0.125847f,0.372481f,0.363354f}, -{0.140576f,0.434851f,0.338246f}, -{0.082346f,0.349859f,0.401974f}, -{0.105476f,0.347881f,0.419554f}, -{0.094745f,0.413346f,0.374057f}, -{0.094745f,0.413346f,0.374057f}, -{0.105476f,0.347881f,0.419554f}, -{0.140576f,0.434851f,0.338246f}, -{0.094745f,0.413346f,0.374057f}, -{0.087033f,0.337040f,0.355232f}, -{0.082346f,0.349859f,0.401974f}, -{0.111453f,0.444682f,0.302121f}, -{0.116305f,0.456438f,0.325072f}, -{0.140576f,0.434851f,0.338246f}, -{0.118966f,0.456137f,0.317268f}, -{0.111453f,0.444682f,0.302121f}, -{0.116305f,0.456438f,0.325072f}, -{0.140576f,0.434851f,0.338246f}, -{0.111453f,0.444682f,0.302121f}, -{0.094745f,0.413346f,0.374057f}, -{0.094745f,0.413346f,0.374057f}, -{0.111453f,0.444682f,0.302121f}, -{0.097266f,0.418123f,0.313772f}, -{0.140576f,0.434851f,0.338246f}, -{0.111453f,0.444682f,0.302121f}, -{0.125847f,0.372481f,0.363354f}, -{0.087033f,0.337040f,0.355232f}, -{0.140576f,0.434851f,0.338246f}, -{0.125847f,0.372481f,0.363354f}, -{0.087033f,0.337040f,0.355232f}, -{0.094745f,0.413346f,0.374057f}, -{0.140576f,0.434851f,0.338246f}, -{0.171989f,0.457261f,0.339601f}, -{0.140576f,0.434851f,0.338246f}, -{0.168853f,0.455869f,0.352221f}, -{0.218692f,0.364927f,0.375351f}, -{0.140576f,0.434851f,0.338246f}, -{0.168853f,0.455869f,0.352221f}, -{0.224049f,0.364554f,0.402736f}, -{0.218692f,0.364927f,0.375351f}, -{0.168853f,0.455869f,0.352221f}, -{0.170697f,0.392613f,0.398557f}, -{0.224049f,0.364554f,0.402736f}, -{0.168853f,0.455869f,0.352221f}, -{0.168853f,0.455869f,0.352221f}, -{0.158039f,0.395383f,0.390222f}, -{0.170697f,0.392613f,0.398557f}, -{0.158039f,0.395383f,0.390222f}, -{0.168853f,0.455869f,0.352221f}, -{0.140576f,0.434851f,0.338246f}, -{0.218692f,0.364927f,0.375351f}, -{0.125847f,0.372481f,0.363354f}, -{0.140576f,0.434851f,0.338246f}, -{0.170697f,0.392613f,0.398557f}, -{0.105476f,0.347881f,0.419554f}, -{0.224049f,0.364554f,0.402736f}, -{0.158039f,0.395383f,0.390222f}, -{0.105476f,0.347881f,0.419554f}, -{0.170697f,0.392613f,0.398557f}, -{0.105476f,0.347881f,0.419554f}, -{0.158039f,0.395383f,0.390222f}, -{0.140576f,0.434851f,0.338246f}, -{0.245224f,0.302361f,0.397077f}, -{0.224844f,0.321542f,0.381851f}, -{0.218692f,0.364927f,0.375351f}, -{0.244755f,0.370089f,0.343383f}, -{0.231071f,0.356882f,0.396296f}, -{0.224049f,0.364554f,0.402736f}, -{0.218692f,0.364927f,0.375351f}, -{0.224049f,0.364554f,0.402736f}, -{0.245224f,0.302361f,0.397077f}, -{0.224049f,0.364554f,0.402736f}, -{0.218692f,0.364927f,0.375351f}, -{0.244755f,0.370089f,0.343383f}, -{0.168853f,0.455869f,0.352221f}, -{0.236185f,0.396084f,0.324371f}, -{0.233489f,0.408364f,0.361071f}, -{0.233489f,0.408364f,0.361071f}, -{0.236185f,0.396084f,0.324371f}, -{0.244755f,0.370089f,0.343383f}, -{0.233489f,0.408364f,0.361071f}, -{0.218692f,0.364927f,0.375351f}, -{0.168853f,0.455869f,0.352221f}, -{0.218692f,0.364927f,0.375351f}, -{0.233489f,0.408364f,0.361071f}, -{0.244755f,0.370089f,0.343383f}, -{0.235468f,0.292809f,0.378970f}, -{0.224844f,0.321542f,0.381851f}, -{0.244755f,0.370089f,0.343383f}, -{0.218692f,0.364927f,0.375351f}, -{0.244755f,0.370089f,0.343383f}, -{0.224844f,0.321542f,0.381851f}, -{0.245224f,0.302361f,0.397077f}, -{0.235468f,0.292809f,0.378970f}, -{0.244755f,0.370089f,0.343383f}, -{0.245224f,0.302361f,0.397077f}, -{0.244755f,0.370089f,0.343383f}, -{0.231071f,0.356882f,0.396296f}, -{0.244755f,0.370089f,0.343383f}, -{0.218692f,0.364927f,0.375351f}, -{0.245224f,0.302361f,0.397077f}, -{0.245224f,0.302361f,0.397077f}, -{0.224844f,0.321542f,0.381851f}, -{0.235468f,0.292809f,0.378970f}, -{0.224844f,0.321542f,0.381851f}, -{0.235468f,0.292809f,0.378970f}, -{0.203835f,0.312668f,0.428433f}, -{0.245224f,0.302361f,0.397077f}, -{0.203835f,0.312668f,0.428433f}, -{0.235468f,0.292809f,0.378970f}, -{0.464039f,-0.418657f,0.141699f}, -{0.503896f,-0.419118f,0.106868f}, -{0.440027f,-0.395373f,0.118574f}, -{0.464039f,-0.418657f,0.141699f}, -{0.499703f,-0.416660f,0.141487f}, -{0.503896f,-0.419118f,0.106868f}, -{0.499703f,-0.416660f,0.141487f}, -{0.464039f,-0.418657f,0.141699f}, -{0.487713f,-0.414396f,0.194702f}, -{0.524408f,-0.338867f,0.161547f}, -{0.499703f,-0.416660f,0.141487f}, -{0.487713f,-0.414396f,0.194702f}, -{0.487713f,-0.414396f,0.194702f}, -{0.512066f,-0.342428f,0.259328f}, -{0.524408f,-0.338867f,0.161547f}, -{0.487713f,-0.414396f,0.194702f}, -{0.464039f,-0.418657f,0.141699f}, -{0.469969f,-0.465363f,0.224098f}, -{0.487713f,-0.414396f,0.194702f}, -{0.518994f,-0.425438f,0.257654f}, -{0.512066f,-0.342428f,0.259328f}, -{0.469969f,-0.465363f,0.224098f}, -{0.494446f,-0.459193f,0.242959f}, -{0.487713f,-0.414396f,0.194702f}, -{0.518994f,-0.425438f,0.257654f}, -{0.487713f,-0.414396f,0.194702f}, -{0.494446f,-0.459193f,0.242959f}, -{0.467798f,-0.560190f,0.278831f}, -{0.526052f,-0.543999f,0.274603f}, -{0.469969f,-0.465363f,0.224098f}, -{0.469969f,-0.465363f,0.224098f}, -{0.526052f,-0.543999f,0.274603f}, -{0.513155f,-0.478561f,0.260600f}, -{0.494446f,-0.459193f,0.242959f}, -{0.469969f,-0.465363f,0.224098f}, -{0.513155f,-0.478561f,0.260600f}, -{0.518994f,-0.425438f,0.257654f}, -{0.494446f,-0.459193f,0.242959f}, -{0.513155f,-0.478561f,0.260600f}, -{0.505459f,-0.646147f,0.302026f}, -{0.467798f,-0.560190f,0.278831f}, -{0.435241f,-0.592881f,0.299367f}, -{0.505459f,-0.646147f,0.302026f}, -{0.526052f,-0.543999f,0.274603f}, -{0.467798f,-0.560190f,0.278831f}, -{0.545442f,-0.429782f,0.271112f}, -{0.518994f,-0.425438f,0.257654f}, -{0.513155f,-0.478561f,0.260600f}, -{0.548194f,-0.338697f,0.279463f}, -{0.512066f,-0.342428f,0.259328f}, -{0.518994f,-0.425438f,0.257654f}, -{0.518994f,-0.425438f,0.257654f}, -{0.545442f,-0.429782f,0.271112f}, -{0.548194f,-0.338697f,0.279463f}, -{0.505459f,-0.646147f,0.302026f}, -{0.561908f,-0.545868f,0.269837f}, -{0.526052f,-0.543999f,0.274603f}, -{0.513155f,-0.478561f,0.260600f}, -{0.526052f,-0.543999f,0.274603f}, -{0.561908f,-0.545868f,0.269837f}, -{0.561908f,-0.545868f,0.269837f}, -{0.606443f,-0.479804f,0.263402f}, -{0.513155f,-0.478561f,0.260600f}, -{0.606454f,-0.420102f,0.274100f}, -{0.545442f,-0.429782f,0.271112f}, -{0.606443f,-0.479804f,0.263402f}, -{0.606443f,-0.479804f,0.263402f}, -{0.545442f,-0.429782f,0.271112f}, -{0.513155f,-0.478561f,0.260600f}, -{0.597133f,-0.359606f,0.281943f}, -{0.548194f,-0.338697f,0.279463f}, -{0.545442f,-0.429782f,0.271112f}, -{0.545442f,-0.429782f,0.271112f}, -{0.606454f,-0.420102f,0.274100f}, -{0.597133f,-0.359606f,0.281943f}, -{0.603536f,-0.543671f,0.257522f}, -{0.561908f,-0.545868f,0.269837f}, -{0.601267f,-0.604461f,0.264327f}, -{0.601267f,-0.604461f,0.264327f}, -{0.561908f,-0.545868f,0.269837f}, -{0.505459f,-0.646147f,0.302026f}, -{0.603536f,-0.543671f,0.257522f}, -{0.606443f,-0.479804f,0.263402f}, -{0.561908f,-0.545868f,0.269837f}, -{0.676518f,-0.536839f,0.208727f}, -{0.603536f,-0.543671f,0.257522f}, -{0.647577f,-0.603970f,0.242052f}, -{0.647577f,-0.603970f,0.242052f}, -{0.603536f,-0.543671f,0.257522f}, -{0.601267f,-0.604461f,0.264327f}, -{0.638354f,-0.477243f,0.249196f}, -{0.603536f,-0.543671f,0.257522f}, -{0.676518f,-0.536839f,0.208727f}, -{0.603536f,-0.543671f,0.257522f}, -{0.638354f,-0.477243f,0.249196f}, -{0.606443f,-0.479804f,0.263402f}, -{0.633233f,-0.416557f,0.263481f}, -{0.606443f,-0.479804f,0.263402f}, -{0.638354f,-0.477243f,0.249196f}, -{0.606443f,-0.479804f,0.263402f}, -{0.633233f,-0.416557f,0.263481f}, -{0.606454f,-0.420102f,0.274100f}, -{0.619915f,-0.355237f,0.273543f}, -{0.606454f,-0.420102f,0.274100f}, -{0.633233f,-0.416557f,0.263481f}, -{0.606454f,-0.420102f,0.274100f}, -{0.619915f,-0.355237f,0.273543f}, -{0.597133f,-0.359606f,0.281943f}, -{0.676518f,-0.536839f,0.208727f}, -{0.647577f,-0.603970f,0.242052f}, -{0.689975f,-0.599189f,0.204332f}, -{0.638354f,-0.477243f,0.249196f}, -{0.672723f,-0.408883f,0.214860f}, -{0.633233f,-0.416557f,0.263481f}, -{0.641909f,-0.351023f,0.255692f}, -{0.633233f,-0.416557f,0.263481f}, -{0.672723f,-0.408883f,0.214860f}, -{0.633233f,-0.416557f,0.263481f}, -{0.641909f,-0.351023f,0.255692f}, -{0.619915f,-0.355237f,0.273543f}, -{0.689975f,-0.599189f,0.204332f}, -{0.742464f,-0.591913f,0.129906f}, -{0.700597f,-0.527910f,0.175787f}, -{0.676518f,-0.536839f,0.208727f}, -{0.689975f,-0.599189f,0.204332f}, -{0.700597f,-0.527910f,0.175787f}, -{0.686774f,-0.482371f,0.152911f}, -{0.685216f,-0.467132f,0.196870f}, -{0.638354f,-0.477243f,0.249196f}, -{0.676518f,-0.536839f,0.208727f}, -{0.700597f,-0.527910f,0.175787f}, -{0.686774f,-0.482371f,0.152911f}, -{0.638354f,-0.477243f,0.249196f}, -{0.676518f,-0.536839f,0.208727f}, -{0.686774f,-0.482371f,0.152911f}, -{0.638354f,-0.477243f,0.249196f}, -{0.685216f,-0.467132f,0.196870f}, -{0.672723f,-0.408883f,0.214860f}, -{0.675741f,-0.435348f,0.165633f}, -{0.685216f,-0.467132f,0.196870f}, -{0.686774f,-0.482371f,0.152911f}, -{0.685216f,-0.467132f,0.196870f}, -{0.675741f,-0.435348f,0.165633f}, -{0.672723f,-0.408883f,0.214860f}, -{0.641909f,-0.351023f,0.255692f}, -{0.672723f,-0.408883f,0.214860f}, -{0.644879f,-0.376380f,0.167291f}, -{0.672723f,-0.408883f,0.214860f}, -{0.675741f,-0.435348f,0.165633f}, -{0.644879f,-0.376380f,0.167291f}, -{0.742464f,-0.591913f,0.129906f}, -{0.725466f,-0.549910f,0.117326f}, -{0.700597f,-0.527910f,0.175787f}, -{0.725466f,-0.549910f,0.117326f}, -{0.742464f,-0.591913f,0.129906f}, -{0.770297f,-0.623219f,0.094728f}, -{0.686774f,-0.482371f,0.152911f}, -{0.700597f,-0.527910f,0.175787f}, -{0.725466f,-0.549910f,0.117326f}, -{0.664395f,-0.486457f,0.150271f}, -{0.675741f,-0.435348f,0.165633f}, -{0.686774f,-0.482371f,0.152911f}, -{0.633953f,-0.321082f,0.191574f}, -{0.641909f,-0.351023f,0.255692f}, -{0.644879f,-0.376380f,0.167291f}, -{0.641909f,-0.351023f,0.255692f}, -{0.633953f,-0.321082f,0.191574f}, -{0.626102f,-0.289908f,0.209634f}, -{0.725466f,-0.549910f,0.117326f}, -{0.693869f,-0.505420f,0.099781f}, -{0.664395f,-0.486457f,0.150271f}, -{0.664395f,-0.486457f,0.150271f}, -{0.686774f,-0.482371f,0.152911f}, -{0.725466f,-0.549910f,0.117326f}, -{0.675741f,-0.435348f,0.165633f}, -{0.615859f,-0.345183f,0.162910f}, -{0.644879f,-0.376380f,0.167291f}, -{0.578148f,-0.271692f,0.158037f}, -{0.633953f,-0.321082f,0.191574f}, -{0.615859f,-0.345183f,0.162910f}, -{0.615859f,-0.345183f,0.162910f}, -{0.633953f,-0.321082f,0.191574f}, -{0.644879f,-0.376380f,0.167291f}, -{0.693869f,-0.505420f,0.099781f}, -{0.667875f,-0.494357f,0.117842f}, -{0.664395f,-0.486457f,0.150271f}, -{0.595557f,-0.455054f,0.134553f}, -{0.675741f,-0.435348f,0.165633f}, -{0.664395f,-0.486457f,0.150271f}, -{0.615859f,-0.345183f,0.162910f}, -{0.675741f,-0.435348f,0.165633f}, -{0.595557f,-0.455054f,0.134553f}, -{0.599688f,-0.458945f,0.125524f}, -{0.664395f,-0.486457f,0.150271f}, -{0.667875f,-0.494357f,0.117842f}, -{0.595557f,-0.455054f,0.134553f}, -{0.609721f,-0.456537f,0.146889f}, -{0.599688f,-0.458945f,0.125524f}, -{0.599688f,-0.458945f,0.125524f}, -{0.609721f,-0.456537f,0.146889f}, -{0.664395f,-0.486457f,0.150271f}, -{0.595557f,-0.455054f,0.134553f}, -{0.664395f,-0.486457f,0.150271f}, -{0.609721f,-0.456537f,0.146889f}, -{0.499703f,-0.416660f,0.141487f}, -{0.595557f,-0.455054f,0.134553f}, -{0.503896f,-0.419118f,0.106868f}, -{0.503896f,-0.419118f,0.106868f}, -{0.595557f,-0.455054f,0.134553f}, -{0.574343f,-0.443898f,0.127927f}, -{0.574343f,-0.443898f,0.127927f}, -{0.595557f,-0.455054f,0.134553f}, -{0.599688f,-0.458945f,0.125524f}, -{0.595557f,-0.455054f,0.134553f}, -{0.499703f,-0.416660f,0.141487f}, -{0.524408f,-0.338867f,0.161547f}, -{0.615859f,-0.345183f,0.162910f}, -{0.595557f,-0.455054f,0.134553f}, -{0.524408f,-0.338867f,0.161547f}, -{0.487713f,-0.414396f,0.194702f}, -{0.419554f,-0.494469f,0.248712f}, -{0.469969f,-0.465363f,0.224098f}, -{0.419554f,-0.494469f,0.248712f}, -{0.418586f,-0.517778f,0.265251f}, -{0.469969f,-0.465363f,0.224098f}, -{0.418586f,-0.517778f,0.265251f}, -{0.367921f,-0.536689f,0.293184f}, -{0.467798f,-0.560190f,0.278831f}, -{0.534812f,-0.654828f,0.297562f}, -{0.562744f,-0.660393f,0.291692f}, -{0.505459f,-0.646147f,0.302026f}, -{0.562744f,-0.660393f,0.291692f}, -{0.636516f,-0.715392f,0.278183f}, -{0.647577f,-0.603970f,0.242052f}, -{0.636516f,-0.715392f,0.278183f}, -{0.656324f,-0.680370f,0.259240f}, -{0.647577f,-0.603970f,0.242052f}, -{0.656324f,-0.680370f,0.259240f}, -{0.699804f,-0.664386f,0.222474f}, -{0.689975f,-0.599189f,0.204332f}, -{0.699804f,-0.664386f,0.222474f}, -{0.742165f,-0.690772f,0.185737f}, -{0.742464f,-0.591913f,0.129906f}, -{0.742165f,-0.690772f,0.185737f}, -{0.754382f,-0.641772f,0.143444f}, -{0.742464f,-0.591913f,0.129906f}, -{0.505571f,-0.270936f,0.157994f}, -{0.578148f,-0.271692f,0.158037f}, -{0.524408f,-0.338867f,0.161547f}, -{0.616432f,-0.280548f,0.244818f}, -{0.601863f,-0.295910f,0.268799f}, -{0.626102f,-0.289908f,0.209634f}, -{0.601863f,-0.295910f,0.268799f}, -{0.513371f,-0.274058f,0.279083f}, -{0.597133f,-0.359606f,0.281943f}, -{0.513371f,-0.274058f,0.279083f}, -{0.489709f,-0.323488f,0.234250f}, -{0.512066f,-0.342428f,0.259328f}, -{0.489709f,-0.323488f,0.234250f}, -{0.470683f,-0.272389f,0.208779f}, -{0.512066f,-0.342428f,0.259328f}, -{0.489709f,-0.323488f,0.234250f}, -{0.505571f,-0.270936f,0.157994f}, -{0.524408f,-0.338867f,0.161547f}, -{0.524408f,-0.338867f,0.161547f}, -{0.512066f,-0.342428f,0.259328f}, -{0.489709f,-0.323488f,0.234250f}, -{0.512066f,-0.342428f,0.259328f}, -{0.548194f,-0.338697f,0.279463f}, -{0.513371f,-0.274058f,0.279083f}, -{0.548194f,-0.338697f,0.279463f}, -{0.597133f,-0.359606f,0.281943f}, -{0.513371f,-0.274058f,0.279083f}, -{0.601267f,-0.604461f,0.264327f}, -{0.505459f,-0.646147f,0.302026f}, -{0.562744f,-0.660393f,0.291692f}, -{0.647577f,-0.603970f,0.242052f}, -{0.601267f,-0.604461f,0.264327f}, -{0.562744f,-0.660393f,0.291692f}, -{0.597133f,-0.359606f,0.281943f}, -{0.619915f,-0.355237f,0.273543f}, -{0.601863f,-0.295910f,0.268799f}, -{0.689975f,-0.599189f,0.204332f}, -{0.647577f,-0.603970f,0.242052f}, -{0.656324f,-0.680370f,0.259240f}, -{0.619915f,-0.355237f,0.273543f}, -{0.641909f,-0.351023f,0.255692f}, -{0.626102f,-0.289908f,0.209634f}, -{0.742464f,-0.591913f,0.129906f}, -{0.754382f,-0.641772f,0.143444f}, -{0.770297f,-0.623219f,0.094728f}, -{0.615859f,-0.345183f,0.162910f}, -{0.524408f,-0.338867f,0.161547f}, -{0.578148f,-0.271692f,0.158037f}, -{0.418586f,-0.517778f,0.265251f}, -{0.467798f,-0.560190f,0.278831f}, -{0.469969f,-0.465363f,0.224098f}, -{0.689975f,-0.599189f,0.204332f}, -{0.699804f,-0.664386f,0.222474f}, -{0.742464f,-0.591913f,0.129906f}, -{0.667875f,-0.494357f,0.117842f}, -{0.574343f,-0.443898f,0.127927f}, -{0.599688f,-0.458945f,0.125524f}, -{0.626102f,-0.289908f,0.209634f}, -{0.601863f,-0.295910f,0.268799f}, -{0.619915f,-0.355237f,0.273543f}, -{0.610492f,-0.254762f,0.195736f}, -{0.583479f,-0.225726f,0.278210f}, -{0.601863f,-0.295910f,0.268799f}, -{0.601863f,-0.295910f,0.268799f}, -{0.616432f,-0.280548f,0.244818f}, -{0.610492f,-0.254762f,0.195736f}, -{0.671734f,-0.226293f,0.202596f}, -{0.632198f,-0.215710f,0.271850f}, -{0.610492f,-0.254762f,0.195736f}, -{0.610492f,-0.254762f,0.195736f}, -{0.632198f,-0.215710f,0.271850f}, -{0.583479f,-0.225726f,0.278210f}, -{0.708091f,-0.218209f,0.253239f}, -{0.748928f,-0.198612f,0.263357f}, -{0.671734f,-0.226293f,0.202596f}, -{0.671734f,-0.226293f,0.202596f}, -{0.748928f,-0.198612f,0.263357f}, -{0.632198f,-0.215710f,0.271850f}, -{0.708091f,-0.218209f,0.253239f}, -{0.754366f,-0.204877f,0.228968f}, -{0.748928f,-0.198612f,0.263357f}, -{0.748928f,-0.198612f,0.263357f}, -{0.784538f,-0.160902f,0.290280f}, -{0.736002f,-0.165452f,0.290642f}, -{0.800719f,-0.190499f,0.240558f}, -{0.784538f,-0.160902f,0.290280f}, -{0.754366f,-0.204877f,0.228968f}, -{0.754366f,-0.204877f,0.228968f}, -{0.784538f,-0.160902f,0.290280f}, -{0.748928f,-0.198612f,0.263357f}, -{0.800719f,-0.190499f,0.240558f}, -{0.860632f,-0.175459f,0.225442f}, -{0.845126f,-0.159761f,0.286952f}, -{0.784538f,-0.160902f,0.290280f}, -{0.800719f,-0.190499f,0.240558f}, -{0.845126f,-0.159761f,0.286952f}, -{0.845126f,-0.159761f,0.286952f}, -{0.860632f,-0.175459f,0.225442f}, -{0.864732f,-0.113038f,0.246390f}, -{0.864732f,-0.113038f,0.246390f}, -{0.844207f,-0.092998f,0.292218f}, -{0.845126f,-0.159761f,0.286952f}, -{0.844207f,-0.092998f,0.292218f}, -{0.833673f,-0.017866f,0.199048f}, -{0.824046f,-0.017914f,0.292112f}, -{0.833673f,-0.017866f,0.199048f}, -{0.844207f,-0.092998f,0.292218f}, -{0.864732f,-0.113038f,0.246390f}, -{0.821274f,0.049230f,0.235809f}, -{0.824046f,-0.017914f,0.292112f}, -{0.833673f,-0.017866f,0.199048f}, -{0.824046f,-0.017914f,0.292112f}, -{0.821274f,0.049230f,0.235809f}, -{0.819477f,0.017770f,0.279878f}, -{0.772347f,0.127306f,0.305872f}, -{0.803152f,0.000009f,0.309893f}, -{0.819477f,0.017770f,0.279878f}, -{0.770118f,0.069198f,0.201368f}, -{0.819477f,0.017770f,0.279878f}, -{0.821274f,0.049230f,0.235809f}, -{0.819477f,0.017770f,0.279878f}, -{0.770118f,0.069198f,0.201368f}, -{0.772347f,0.127306f,0.305872f}, -{0.821274f,0.049230f,0.235809f}, -{0.814998f,0.067310f,0.245410f}, -{0.770118f,0.069198f,0.201368f}, -{0.616432f,-0.280548f,0.244818f}, -{0.626102f,-0.289908f,0.209634f}, -{0.578148f,-0.271692f,0.158037f}, -{0.610492f,-0.254762f,0.195736f}, -{0.616432f,-0.280548f,0.244818f}, -{0.578148f,-0.271692f,0.158037f}, -{0.578148f,-0.271692f,0.158037f}, -{0.596911f,-0.238733f,0.171494f}, -{0.610492f,-0.254762f,0.195736f}, -{0.639687f,-0.214237f,0.176437f}, -{0.671734f,-0.226293f,0.202596f}, -{0.596911f,-0.238733f,0.171494f}, -{0.671734f,-0.226293f,0.202596f}, -{0.610492f,-0.254762f,0.195736f}, -{0.596911f,-0.238733f,0.171494f}, -{0.709188f,-0.203710f,0.177646f}, -{0.671734f,-0.226293f,0.202596f}, -{0.639687f,-0.214237f,0.176437f}, -{0.671734f,-0.226293f,0.202596f}, -{0.709188f,-0.203710f,0.177646f}, -{0.708091f,-0.218209f,0.253239f}, -{0.789159f,-0.146078f,0.174762f}, -{0.708091f,-0.218209f,0.253239f}, -{0.709188f,-0.203710f,0.177646f}, -{0.708091f,-0.218209f,0.253239f}, -{0.789159f,-0.146078f,0.174762f}, -{0.754366f,-0.204877f,0.228968f}, -{0.754366f,-0.204877f,0.228968f}, -{0.789159f,-0.146078f,0.174762f}, -{0.800719f,-0.190499f,0.240558f}, -{0.827286f,-0.166450f,0.186169f}, -{0.860632f,-0.175459f,0.225442f}, -{0.800719f,-0.190499f,0.240558f}, -{0.800719f,-0.190499f,0.240558f}, -{0.789159f,-0.146078f,0.174762f}, -{0.827286f,-0.166450f,0.186169f}, -{0.864732f,-0.113038f,0.246390f}, -{0.860632f,-0.175459f,0.225442f}, -{0.827286f,-0.166450f,0.186169f}, -{0.831026f,-0.085459f,0.177007f}, -{0.864732f,-0.113038f,0.246390f}, -{0.827286f,-0.166450f,0.186169f}, -{0.864732f,-0.113038f,0.246390f}, -{0.831026f,-0.085459f,0.177007f}, -{0.833673f,-0.017866f,0.199048f}, -{0.833673f,-0.017866f,0.199048f}, -{0.831026f,-0.085459f,0.177007f}, -{0.827299f,-0.034443f,0.177152f}, -{0.822074f,0.023724f,0.192644f}, -{0.821274f,0.049230f,0.235809f}, -{0.827299f,-0.034443f,0.177152f}, -{0.827299f,-0.034443f,0.177152f}, -{0.821274f,0.049230f,0.235809f}, -{0.833673f,-0.017866f,0.199048f}, -{0.696577f,-0.157530f,0.156543f}, -{0.639687f,-0.214237f,0.176437f}, -{0.659243f,-0.191554f,0.163081f}, -{0.639687f,-0.214237f,0.176437f}, -{0.696577f,-0.157530f,0.156543f}, -{0.709188f,-0.203710f,0.177646f}, -{0.709188f,-0.203710f,0.177646f}, -{0.696577f,-0.157530f,0.156543f}, -{0.789159f,-0.146078f,0.174762f}, -{0.791499f,0.036867f,0.176061f}, -{0.769286f,0.049952f,0.202471f}, -{0.822074f,0.023724f,0.192644f}, -{0.769286f,0.049952f,0.202471f}, -{0.821274f,0.049230f,0.235809f}, -{0.822074f,0.023724f,0.192644f}, -{0.827299f,-0.034443f,0.177152f}, -{0.791499f,0.036867f,0.176061f}, -{0.822074f,0.023724f,0.192644f}, -{0.769286f,0.049952f,0.202471f}, -{0.770118f,0.069198f,0.201368f}, -{0.821274f,0.049230f,0.235809f}, -{0.769286f,0.049952f,0.202471f}, -{0.791499f,0.036867f,0.176061f}, -{0.770118f,0.069198f,0.201368f}, -{0.791499f,0.036867f,0.176061f}, -{0.795889f,0.107338f,0.186230f}, -{0.770118f,0.069198f,0.201368f}, -{0.505571f,-0.270936f,0.157994f}, -{0.548771f,-0.200063f,0.146810f}, -{0.596911f,-0.238733f,0.171494f}, -{0.578148f,-0.271692f,0.158037f}, -{0.505571f,-0.270936f,0.157994f}, -{0.596911f,-0.238733f,0.171494f}, -{0.596911f,-0.238733f,0.171494f}, -{0.593352f,-0.140490f,0.168059f}, -{0.639687f,-0.214237f,0.176437f}, -{0.659243f,-0.191554f,0.163081f}, -{0.639687f,-0.214237f,0.176437f}, -{0.593352f,-0.140490f,0.168059f}, -{0.807389f,-0.119094f,0.170497f}, -{0.831026f,-0.085459f,0.177007f}, -{0.789159f,-0.146078f,0.174762f}, -{0.789159f,-0.146078f,0.174762f}, -{0.831026f,-0.085459f,0.177007f}, -{0.827286f,-0.166450f,0.186169f}, -{0.798697f,-0.058998f,0.184047f}, -{0.791499f,0.036867f,0.176061f}, -{0.827299f,-0.034443f,0.177152f}, -{0.548771f,-0.200063f,0.146810f}, -{0.495267f,-0.176730f,0.172856f}, -{0.593352f,-0.140490f,0.168059f}, -{0.593352f,-0.140490f,0.168059f}, -{0.596911f,-0.238733f,0.171494f}, -{0.548771f,-0.200063f,0.146810f}, -{0.807389f,-0.119094f,0.170497f}, -{0.789159f,-0.146078f,0.174762f}, -{0.696577f,-0.157530f,0.156543f}, -{0.696577f,-0.157530f,0.156543f}, -{0.730637f,-0.113809f,0.185622f}, -{0.807389f,-0.119094f,0.170497f}, -{0.807389f,-0.119094f,0.170497f}, -{0.798697f,-0.058998f,0.184047f}, -{0.831026f,-0.085459f,0.177007f}, -{0.798697f,-0.058998f,0.184047f}, -{0.827299f,-0.034443f,0.177152f}, -{0.831026f,-0.085459f,0.177007f}, -{0.593352f,-0.140490f,0.168059f}, -{0.628693f,-0.113428f,0.191697f}, -{0.659243f,-0.191554f,0.163081f}, -{0.730637f,-0.113809f,0.185622f}, -{0.659243f,-0.191554f,0.163081f}, -{0.628693f,-0.113428f,0.191697f}, -{0.659243f,-0.191554f,0.163081f}, -{0.730637f,-0.113809f,0.185622f}, -{0.696577f,-0.157530f,0.156543f}, -{0.479218f,-0.223300f,0.171730f}, -{0.548771f,-0.200063f,0.146810f}, -{0.505571f,-0.270936f,0.157994f}, -{0.505571f,-0.270936f,0.157994f}, -{0.486146f,-0.271233f,0.173914f}, -{0.479218f,-0.223300f,0.171730f}, -{0.495267f,-0.176730f,0.172856f}, -{0.548771f,-0.200063f,0.146810f}, -{0.479218f,-0.223300f,0.171730f}, -{0.495267f,-0.176730f,0.172856f}, -{0.583071f,-0.127127f,0.185267f}, -{0.593352f,-0.140490f,0.168059f}, -{0.628693f,-0.113428f,0.191697f}, -{0.593352f,-0.140490f,0.168059f}, -{0.583071f,-0.127127f,0.185267f}, -{0.628693f,-0.113428f,0.191697f}, -{0.621452f,-0.108239f,0.259498f}, -{0.730637f,-0.113809f,0.185622f}, -{0.621452f,-0.108239f,0.259498f}, -{0.723237f,-0.092902f,0.224550f}, -{0.730637f,-0.113809f,0.185622f}, -{0.730637f,-0.113809f,0.185622f}, -{0.765094f,-0.082036f,0.211752f}, -{0.807389f,-0.119094f,0.170497f}, -{0.730637f,-0.113809f,0.185622f}, -{0.723237f,-0.092902f,0.224550f}, -{0.765094f,-0.082036f,0.211752f}, -{0.774932f,-0.045526f,0.220469f}, -{0.798697f,-0.058998f,0.184047f}, -{0.807389f,-0.119094f,0.170497f}, -{0.774932f,-0.045526f,0.220469f}, -{0.807389f,-0.119094f,0.170497f}, -{0.765094f,-0.082036f,0.211752f}, -{0.769286f,0.049952f,0.202471f}, -{0.798697f,-0.058998f,0.184047f}, -{0.774932f,-0.045526f,0.220469f}, -{0.791499f,0.036867f,0.176061f}, -{0.798697f,-0.058998f,0.184047f}, -{0.769286f,0.049952f,0.202471f}, -{0.486146f,-0.271233f,0.173914f}, -{0.470683f,-0.272389f,0.208779f}, -{0.479218f,-0.223300f,0.171730f}, -{0.479218f,-0.223300f,0.171730f}, -{0.470683f,-0.272389f,0.208779f}, -{0.469917f,-0.196686f,0.225703f}, -{0.485931f,-0.173853f,0.198562f}, -{0.479218f,-0.223300f,0.171730f}, -{0.469917f,-0.196686f,0.225703f}, -{0.479218f,-0.223300f,0.171730f}, -{0.485931f,-0.173853f,0.198562f}, -{0.495267f,-0.176730f,0.172856f}, -{0.495267f,-0.176730f,0.172856f}, -{0.485931f,-0.173853f,0.198562f}, -{0.525709f,-0.145946f,0.256652f}, -{0.574634f,-0.123101f,0.258179f}, -{0.495267f,-0.176730f,0.172856f}, -{0.525709f,-0.145946f,0.256652f}, -{0.495267f,-0.176730f,0.172856f}, -{0.574634f,-0.123101f,0.258179f}, -{0.583071f,-0.127127f,0.185267f}, -{0.621452f,-0.108239f,0.259498f}, -{0.583071f,-0.127127f,0.185267f}, -{0.574634f,-0.123101f,0.258179f}, -{0.583071f,-0.127127f,0.185267f}, -{0.621452f,-0.108239f,0.259498f}, -{0.628693f,-0.113428f,0.191697f}, -{0.803152f,0.000009f,0.309893f}, -{0.769286f,0.049952f,0.202471f}, -{0.810694f,-0.051873f,0.307606f}, -{0.774932f,-0.045526f,0.220469f}, -{0.810694f,-0.051873f,0.307606f}, -{0.769286f,0.049952f,0.202471f}, -{0.625738f,-0.123910f,0.276218f}, -{0.722323f,-0.109193f,0.274129f}, -{0.723237f,-0.092902f,0.224550f}, -{0.621452f,-0.108239f,0.259498f}, -{0.625738f,-0.123910f,0.276218f}, -{0.723237f,-0.092902f,0.224550f}, -{0.723237f,-0.092902f,0.224550f}, -{0.761846f,-0.086392f,0.263489f}, -{0.765094f,-0.082036f,0.211752f}, -{0.761846f,-0.086392f,0.263489f}, -{0.723237f,-0.092902f,0.224550f}, -{0.722323f,-0.109193f,0.274129f}, -{0.810694f,-0.051873f,0.307606f}, -{0.774932f,-0.045526f,0.220469f}, -{0.765094f,-0.082036f,0.211752f}, -{0.810694f,-0.051873f,0.307606f}, -{0.765094f,-0.082036f,0.211752f}, -{0.761846f,-0.086392f,0.263489f}, -{0.489709f,-0.323488f,0.234250f}, -{0.513371f,-0.274058f,0.279083f}, -{0.470683f,-0.272389f,0.208779f}, -{0.470683f,-0.272389f,0.208779f}, -{0.477604f,-0.227012f,0.262152f}, -{0.469917f,-0.196686f,0.225703f}, -{0.477604f,-0.227012f,0.262152f}, -{0.470683f,-0.272389f,0.208779f}, -{0.513371f,-0.274058f,0.279083f}, -{0.549948f,-0.244189f,0.286292f}, -{0.552916f,-0.170604f,0.287407f}, -{0.477604f,-0.227012f,0.262152f}, -{0.552916f,-0.170604f,0.287407f}, -{0.485931f,-0.173853f,0.198562f}, -{0.477604f,-0.227012f,0.262152f}, -{0.477604f,-0.227012f,0.262152f}, -{0.485931f,-0.173853f,0.198562f}, -{0.469917f,-0.196686f,0.225703f}, -{0.525709f,-0.145946f,0.256652f}, -{0.485931f,-0.173853f,0.198562f}, -{0.552916f,-0.170604f,0.287407f}, -{0.572179f,-0.187304f,0.290519f}, -{0.574634f,-0.123101f,0.258179f}, -{0.552916f,-0.170604f,0.287407f}, -{0.552916f,-0.170604f,0.287407f}, -{0.574634f,-0.123101f,0.258179f}, -{0.525709f,-0.145946f,0.256652f}, -{0.625738f,-0.123910f,0.276218f}, -{0.621452f,-0.108239f,0.259498f}, -{0.572179f,-0.187304f,0.290519f}, -{0.572179f,-0.187304f,0.290519f}, -{0.621452f,-0.108239f,0.259498f}, -{0.574634f,-0.123101f,0.258179f}, -{0.549948f,-0.244189f,0.286292f}, -{0.477604f,-0.227012f,0.262152f}, -{0.513371f,-0.274058f,0.279083f}, -{0.631887f,-0.143794f,0.285959f}, -{0.625738f,-0.123910f,0.276218f}, -{0.572179f,-0.187304f,0.290519f}, -{0.631887f,-0.143794f,0.285959f}, -{0.736002f,-0.165452f,0.290642f}, -{0.722323f,-0.109193f,0.274129f}, -{0.625738f,-0.123910f,0.276218f}, -{0.631887f,-0.143794f,0.285959f}, -{0.722323f,-0.109193f,0.274129f}, -{0.736002f,-0.165452f,0.290642f}, -{0.784538f,-0.160902f,0.290280f}, -{0.761846f,-0.086392f,0.263489f}, -{0.722323f,-0.109193f,0.274129f}, -{0.736002f,-0.165452f,0.290642f}, -{0.761846f,-0.086392f,0.263489f}, -{0.572179f,-0.187304f,0.290519f}, -{0.552916f,-0.170604f,0.287407f}, -{0.549948f,-0.244189f,0.286292f}, -{0.844207f,-0.092998f,0.292218f}, -{0.761846f,-0.086392f,0.263489f}, -{0.784538f,-0.160902f,0.290280f}, -{0.844207f,-0.092998f,0.292218f}, -{0.824046f,-0.017914f,0.292112f}, -{0.810694f,-0.051873f,0.307606f}, -{0.810694f,-0.051873f,0.307606f}, -{0.761846f,-0.086392f,0.263489f}, -{0.844207f,-0.092998f,0.292218f}, -{0.601863f,-0.295910f,0.268799f}, -{0.583479f,-0.225726f,0.278210f}, -{0.549948f,-0.244189f,0.286292f}, -{0.513371f,-0.274058f,0.279083f}, -{0.601863f,-0.295910f,0.268799f}, -{0.549948f,-0.244189f,0.286292f}, -{0.572179f,-0.187304f,0.290519f}, -{0.549948f,-0.244189f,0.286292f}, -{0.583479f,-0.225726f,0.278210f}, -{0.583479f,-0.225726f,0.278210f}, -{0.631887f,-0.143794f,0.285959f}, -{0.572179f,-0.187304f,0.290519f}, -{0.844207f,-0.092998f,0.292218f}, -{0.784538f,-0.160902f,0.290280f}, -{0.845126f,-0.159761f,0.286952f}, -{0.810694f,-0.051873f,0.307606f}, -{0.824046f,-0.017914f,0.292112f}, -{0.803152f,0.000009f,0.309893f}, -{0.632198f,-0.215710f,0.271850f}, -{0.631887f,-0.143794f,0.285959f}, -{0.583479f,-0.225726f,0.278210f}, -{0.748928f,-0.198612f,0.263357f}, -{0.736002f,-0.165452f,0.290642f}, -{0.632198f,-0.215710f,0.271850f}, -{0.632198f,-0.215710f,0.271850f}, -{0.736002f,-0.165452f,0.290642f}, -{0.631887f,-0.143794f,0.285959f}, -{0.824046f,-0.017914f,0.292112f}, -{0.819477f,0.017770f,0.279878f}, -{0.803152f,0.000009f,0.309893f}, -{0.505571f,-0.270936f,0.157994f}, -{0.489709f,-0.323488f,0.234250f}, -{0.486146f,-0.271233f,0.173914f}, -{0.578148f,-0.271692f,0.158037f}, -{0.626102f,-0.289908f,0.209634f}, -{0.633953f,-0.321082f,0.191574f}, -{0.470683f,-0.272389f,0.208779f}, -{0.486146f,-0.271233f,0.173914f}, -{0.489709f,-0.323488f,0.234250f}, -{0.770118f,0.069198f,0.201368f}, -{0.769286f,0.049952f,0.202471f}, -{0.803152f,0.000009f,0.309893f}, -{0.803152f,0.000009f,0.309893f}, -{0.772347f,0.127306f,0.305872f}, -{0.770118f,0.069198f,0.201368f}, -{0.772347f,0.127306f,0.305872f}, -{0.784647f,0.133362f,0.304053f}, -{0.792862f,0.132402f,0.241771f}, -{0.792862f,0.132402f,0.241771f}, -{0.770118f,0.069198f,0.201368f}, -{0.772347f,0.127306f,0.305872f}, -{0.784647f,0.133362f,0.304053f}, -{0.770118f,0.069198f,0.201368f}, -{0.792862f,0.132402f,0.241771f}, -{0.784647f,0.133362f,0.304053f}, -{0.772347f,0.127306f,0.305872f}, -{0.770118f,0.069198f,0.201368f}, -{0.049804f,-0.300258f,-0.381494f}, -{-0.022763f,-0.310064f,-0.335019f}, -{0.044711f,-0.307317f,-0.420360f}, -{-0.010476f,-0.311957f,-0.431746f}, -{0.044711f,-0.307317f,-0.420360f}, -{-0.022763f,-0.310064f,-0.335019f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.016993f,-0.279886f,-0.313177f}, -{0.049804f,-0.300258f,-0.381494f}, -{-0.022763f,-0.310064f,-0.335019f}, -{0.049804f,-0.300258f,-0.381494f}, -{0.016993f,-0.279886f,-0.313177f}, -{0.009293f,-0.185508f,-0.514013f}, -{-0.077027f,-0.151393f,-0.488505f}, -{0.007567f,-0.128619f,-0.457644f}, -{0.007567f,-0.128619f,-0.457644f}, -{-0.077027f,-0.151393f,-0.488505f}, -{0.009523f,-0.123303f,-0.437621f}, -{0.019062f,-0.244133f,-0.517293f}, -{-0.080153f,-0.196721f,-0.505826f}, -{0.009293f,-0.185508f,-0.514013f}, -{0.009293f,-0.185508f,-0.514013f}, -{-0.080153f,-0.196721f,-0.505826f}, -{-0.077027f,-0.151393f,-0.488505f}, -{0.044711f,-0.307317f,-0.420360f}, -{-0.010476f,-0.311957f,-0.431746f}, -{0.023283f,-0.262212f,-0.508761f}, -{0.044711f,-0.307317f,-0.420360f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.049804f,-0.300258f,-0.381494f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.009523f,-0.123303f,-0.437621f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.009523f,-0.123303f,-0.437621f}, -{0.020998f,-0.127884f,-0.374942f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.025781f,-0.136359f,-0.357453f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.025781f,-0.136359f,-0.357453f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.020998f,-0.127884f,-0.374942f}, -{0.041026f,-0.132330f,-0.480236f}, -{0.009293f,-0.185508f,-0.514013f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.009293f,-0.185508f,-0.514013f}, -{0.007567f,-0.128619f,-0.457644f}, -{0.009523f,-0.123303f,-0.437621f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.007567f,-0.128619f,-0.457644f}, -{0.009293f,-0.185508f,-0.514013f}, -{0.078472f,-0.157983f,-0.525924f}, -{0.019062f,-0.244133f,-0.517293f}, -{0.078472f,-0.157983f,-0.525924f}, -{0.009293f,-0.185508f,-0.514013f}, -{0.041026f,-0.132330f,-0.480236f}, -{0.078472f,-0.157983f,-0.525924f}, -{0.109561f,-0.227561f,-0.523122f}, -{0.019062f,-0.244133f,-0.517293f}, -{0.109561f,-0.227561f,-0.523122f}, -{0.041026f,-0.132330f,-0.480236f}, -{0.023283f,-0.262212f,-0.508761f}, -{0.023283f,-0.262212f,-0.508761f}, -{0.019062f,-0.244133f,-0.517293f}, -{0.109561f,-0.227561f,-0.523122f}, -{0.041026f,-0.132330f,-0.480236f}, -{0.044711f,-0.307317f,-0.420360f}, -{0.023283f,-0.262212f,-0.508761f}, -{0.175604f,-0.213666f,-0.373520f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.044711f,-0.307317f,-0.420360f}, -{0.044711f,-0.307317f,-0.420360f}, -{0.193913f,-0.187648f,-0.484504f}, -{0.175604f,-0.213666f,-0.373520f}, -{0.078472f,-0.157983f,-0.525924f}, -{0.131427f,-0.090448f,-0.527039f}, -{0.126882f,-0.184309f,-0.534506f}, -{0.078472f,-0.157983f,-0.525924f}, -{0.041026f,-0.132330f,-0.480236f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.131427f,-0.090448f,-0.527039f}, -{0.078472f,-0.157983f,-0.525924f}, -{0.078472f,-0.157983f,-0.525924f}, -{0.126882f,-0.184309f,-0.534506f}, -{0.109561f,-0.227561f,-0.523122f}, -{0.193913f,-0.187648f,-0.484504f}, -{0.109561f,-0.227561f,-0.523122f}, -{0.126882f,-0.184309f,-0.534506f}, -{0.109561f,-0.227561f,-0.523122f}, -{0.193913f,-0.187648f,-0.484504f}, -{0.041026f,-0.132330f,-0.480236f}, -{0.193913f,-0.187648f,-0.484504f}, -{0.044711f,-0.307317f,-0.420360f}, -{0.041026f,-0.132330f,-0.480236f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.175604f,-0.213666f,-0.373520f}, -{0.193913f,-0.187648f,-0.484504f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.166337f,-0.045176f,-0.362721f}, -{0.175604f,-0.213666f,-0.373520f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.175604f,-0.213666f,-0.373520f}, -{0.166337f,-0.045176f,-0.362721f}, -{0.166337f,-0.045176f,-0.362721f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.143345f,-0.046971f,-0.523037f}, -{0.131427f,-0.090448f,-0.527039f}, -{0.131427f,-0.090448f,-0.527039f}, -{0.143345f,-0.046971f,-0.523037f}, -{0.168822f,-0.060403f,-0.522480f}, -{0.126882f,-0.184309f,-0.534506f}, -{0.131427f,-0.090448f,-0.527039f}, -{0.168822f,-0.060403f,-0.522480f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.193913f,-0.187648f,-0.484504f}, -{0.126882f,-0.184309f,-0.534506f}, -{0.168822f,-0.060403f,-0.522480f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.126882f,-0.184309f,-0.534506f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.253287f,0.059093f,-0.446568f}, -{0.216205f,0.036780f,-0.377147f}, -{0.166337f,-0.045176f,-0.362721f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.216205f,0.036780f,-0.377147f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.166337f,-0.045176f,-0.362721f}, -{0.216205f,0.036780f,-0.377147f}, -{0.156253f,0.067187f,-0.384105f}, -{0.146703f,0.115372f,-0.421301f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.216205f,0.036780f,-0.377147f}, -{0.156253f,0.067187f,-0.384105f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.092933f,-0.129552f,-0.355037f}, -{0.146703f,0.115372f,-0.421301f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.146703f,0.115372f,-0.421301f}, -{0.129428f,0.073931f,-0.468573f}, -{0.129428f,0.073931f,-0.468573f}, -{0.156459f,0.055979f,-0.514490f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.156459f,0.055979f,-0.514490f}, -{0.168683f,0.049186f,-0.519843f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.067474f,-0.120738f,-0.483753f}, -{0.168683f,0.049186f,-0.519843f}, -{0.143345f,-0.046971f,-0.523037f}, -{0.168822f,-0.060403f,-0.522480f}, -{0.143345f,-0.046971f,-0.523037f}, -{0.168683f,0.049186f,-0.519843f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.168822f,-0.060403f,-0.522480f}, -{0.168683f,0.049186f,-0.519843f}, -{0.168683f,0.049186f,-0.519843f}, -{0.235551f,0.064408f,-0.491246f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.235551f,0.064408f,-0.491246f}, -{0.253287f,0.059093f,-0.446568f}, -{0.217588f,-0.075151f,-0.396281f}, -{0.213802f,0.084868f,-0.377648f}, -{0.216205f,0.036780f,-0.377147f}, -{0.236314f,0.072263f,-0.391506f}, -{0.242245f,0.097024f,-0.396558f}, -{0.236314f,0.072263f,-0.391506f}, -{0.216205f,0.036780f,-0.377147f}, -{0.216205f,0.036780f,-0.377147f}, -{0.253287f,0.059093f,-0.446568f}, -{0.242245f,0.097024f,-0.396558f}, -{0.174125f,0.128174f,-0.392255f}, -{0.168541f,0.176016f,-0.411029f}, -{0.146703f,0.115372f,-0.421301f}, -{0.156253f,0.067187f,-0.384105f}, -{0.213802f,0.084868f,-0.377648f}, -{0.174125f,0.128174f,-0.392255f}, -{0.146703f,0.115372f,-0.421301f}, -{0.156253f,0.067187f,-0.384105f}, -{0.174125f,0.128174f,-0.392255f}, -{0.213802f,0.084868f,-0.377648f}, -{0.156253f,0.067187f,-0.384105f}, -{0.216205f,0.036780f,-0.377147f}, -{0.159666f,0.179724f,-0.432110f}, -{0.146703f,0.115372f,-0.421301f}, -{0.168541f,0.176016f,-0.411029f}, -{0.150557f,0.134796f,-0.461481f}, -{0.129428f,0.073931f,-0.468573f}, -{0.159666f,0.179724f,-0.432110f}, -{0.146703f,0.115372f,-0.421301f}, -{0.159666f,0.179724f,-0.432110f}, -{0.129428f,0.073931f,-0.468573f}, -{0.156459f,0.055979f,-0.514490f}, -{0.181537f,0.090257f,-0.510970f}, -{0.168683f,0.049186f,-0.519843f}, -{0.181537f,0.090257f,-0.510970f}, -{0.156459f,0.055979f,-0.514490f}, -{0.129428f,0.073931f,-0.468573f}, -{0.181537f,0.090257f,-0.510970f}, -{0.258623f,0.127712f,-0.476460f}, -{0.168683f,0.049186f,-0.519843f}, -{0.258623f,0.127712f,-0.476460f}, -{0.235551f,0.064408f,-0.491246f}, -{0.168683f,0.049186f,-0.519843f}, -{0.235551f,0.064408f,-0.491246f}, -{0.258623f,0.127712f,-0.476460f}, -{0.242245f,0.097024f,-0.396558f}, -{0.253287f,0.059093f,-0.446568f}, -{0.235551f,0.064408f,-0.491246f}, -{0.242245f,0.097024f,-0.396558f}, -{-0.067899f,-0.111653f,-0.434320f}, -{-0.073557f,-0.120718f,-0.343207f}, -{0.009523f,-0.123303f,-0.437621f}, -{-0.073557f,-0.120718f,-0.343207f}, -{-0.073301f,-0.143606f,-0.309418f}, -{0.025781f,-0.136359f,-0.357453f}, -{-0.073301f,-0.143606f,-0.309418f}, -{-0.057381f,-0.200179f,-0.293350f}, -{0.051779f,-0.246869f,-0.321229f}, -{-0.057381f,-0.200179f,-0.293350f}, -{-0.059422f,-0.267293f,-0.313983f}, -{0.002521f,-0.248492f,-0.310613f}, -{-0.059422f,-0.267293f,-0.313983f}, -{-0.050941f,-0.312602f,-0.352088f}, -{-0.022763f,-0.310064f,-0.335019f}, -{-0.050941f,-0.312602f,-0.352088f}, -{-0.068822f,-0.305460f,-0.446860f}, -{-0.010476f,-0.311957f,-0.431746f}, -{-0.068822f,-0.305460f,-0.446860f}, -{-0.074597f,-0.288433f,-0.473379f}, -{0.023283f,-0.262212f,-0.508761f}, -{-0.074597f,-0.288433f,-0.473379f}, -{-0.080153f,-0.196721f,-0.505826f}, -{0.023283f,-0.262212f,-0.508761f}, -{-0.073041f,-0.127692f,-0.464992f}, -{-0.067899f,-0.111653f,-0.434320f}, -{0.009523f,-0.123303f,-0.437621f}, -{0.271516f,0.146054f,-0.422461f}, -{0.168541f,0.176016f,-0.411029f}, -{0.213802f,0.084868f,-0.377648f}, -{0.159666f,0.179724f,-0.432110f}, -{0.180821f,0.155294f,-0.477739f}, -{0.150557f,0.134796f,-0.461481f}, -{0.180821f,0.155294f,-0.477739f}, -{0.247549f,0.153196f,-0.482049f}, -{0.181537f,0.090257f,-0.510970f}, -{-0.010476f,-0.311957f,-0.431746f}, -{-0.022763f,-0.310064f,-0.335019f}, -{-0.050941f,-0.312602f,-0.352088f}, -{0.016993f,-0.279886f,-0.313177f}, -{0.002521f,-0.248492f,-0.310613f}, -{-0.059422f,-0.267293f,-0.313983f}, -{-0.022763f,-0.310064f,-0.335019f}, -{0.016993f,-0.279886f,-0.313177f}, -{-0.059422f,-0.267293f,-0.313983f}, -{0.020998f,-0.127884f,-0.374942f}, -{0.009523f,-0.123303f,-0.437621f}, -{-0.073557f,-0.120718f,-0.343207f}, -{0.009523f,-0.123303f,-0.437621f}, -{-0.077027f,-0.151393f,-0.488505f}, -{-0.073041f,-0.127692f,-0.464992f}, -{0.019062f,-0.244133f,-0.517293f}, -{0.023283f,-0.262212f,-0.508761f}, -{-0.080153f,-0.196721f,-0.505826f}, -{0.023283f,-0.262212f,-0.508761f}, -{-0.010476f,-0.311957f,-0.431746f}, -{-0.068822f,-0.305460f,-0.446860f}, -{0.051779f,-0.246869f,-0.321229f}, -{0.025781f,-0.136359f,-0.357453f}, -{-0.073301f,-0.143606f,-0.309418f}, -{0.025781f,-0.136359f,-0.357453f}, -{0.020998f,-0.127884f,-0.374942f}, -{-0.073557f,-0.120718f,-0.343207f}, -{0.213802f,0.084868f,-0.377648f}, -{0.236314f,0.072263f,-0.391506f}, -{0.242245f,0.097024f,-0.396558f}, -{0.181537f,0.090257f,-0.510970f}, -{0.129428f,0.073931f,-0.468573f}, -{0.180821f,0.155294f,-0.477739f}, -{0.258623f,0.127712f,-0.476460f}, -{0.181537f,0.090257f,-0.510970f}, -{0.247549f,0.153196f,-0.482049f}, -{0.051779f,-0.246869f,-0.321229f}, -{-0.057381f,-0.200179f,-0.293350f}, -{0.002521f,-0.248492f,-0.310613f}, -{0.242245f,0.097024f,-0.396558f}, -{0.271516f,0.146054f,-0.422461f}, -{0.213802f,0.084868f,-0.377648f}, -{0.168541f,0.176016f,-0.411029f}, -{0.174125f,0.128174f,-0.392255f}, -{0.213802f,0.084868f,-0.377648f}, -{0.150557f,0.134796f,-0.461481f}, -{0.180821f,0.155294f,-0.477739f}, -{0.129428f,0.073931f,-0.468573f}, -{0.210101f,0.237839f,-0.387570f}, -{0.171718f,0.217893f,-0.427529f}, -{0.168541f,0.176016f,-0.411029f}, -{0.232487f,0.224679f,-0.385991f}, -{0.171718f,0.217893f,-0.427529f}, -{0.210101f,0.237839f,-0.387570f}, -{0.228778f,0.324259f,-0.372027f}, -{0.210101f,0.237839f,-0.387570f}, -{0.232487f,0.224679f,-0.385991f}, -{0.191521f,0.286310f,-0.375222f}, -{0.210101f,0.237839f,-0.387570f}, -{0.228778f,0.324259f,-0.372027f}, -{0.181761f,0.321654f,-0.317338f}, -{0.191521f,0.286310f,-0.375222f}, -{0.229646f,0.340011f,-0.322848f}, -{0.243374f,0.201270f,-0.391908f}, -{0.210101f,0.237839f,-0.387570f}, -{0.271516f,0.146054f,-0.422461f}, -{0.271516f,0.146054f,-0.422461f}, -{0.210101f,0.237839f,-0.387570f}, -{0.168541f,0.176016f,-0.411029f}, -{0.243374f,0.201270f,-0.391908f}, -{0.232487f,0.224679f,-0.385991f}, -{0.210101f,0.237839f,-0.387570f}, -{0.228778f,0.324259f,-0.372027f}, -{0.247163f,0.347510f,-0.378687f}, -{0.229646f,0.340011f,-0.322848f}, -{0.191521f,0.286310f,-0.375222f}, -{0.228778f,0.324259f,-0.372027f}, -{0.229646f,0.340011f,-0.322848f}, -{0.333949f,0.225631f,-0.436516f}, -{0.232487f,0.224679f,-0.385991f}, -{0.243374f,0.201270f,-0.391908f}, -{0.309896f,0.280434f,-0.385472f}, -{0.232487f,0.224679f,-0.385991f}, -{0.333949f,0.225631f,-0.436516f}, -{0.309896f,0.280434f,-0.385472f}, -{0.228778f,0.324259f,-0.372027f}, -{0.232487f,0.224679f,-0.385991f}, -{0.247163f,0.347510f,-0.378687f}, -{0.228778f,0.324259f,-0.372027f}, -{0.191521f,0.286310f,-0.375222f}, -{0.333949f,0.225631f,-0.436516f}, -{0.243374f,0.201270f,-0.391908f}, -{0.271516f,0.146054f,-0.422461f}, -{0.309896f,0.280434f,-0.385472f}, -{0.333949f,0.225631f,-0.436516f}, -{0.357923f,0.280463f,-0.436879f}, -{0.337862f,0.362983f,-0.390960f}, -{0.247163f,0.347510f,-0.378687f}, -{0.228778f,0.324259f,-0.372027f}, -{0.228778f,0.324259f,-0.372027f}, -{0.309896f,0.280434f,-0.385472f}, -{0.337862f,0.362983f,-0.390960f}, -{0.174043f,0.338241f,-0.359307f}, -{0.247163f,0.347510f,-0.378687f}, -{0.191521f,0.286310f,-0.375222f}, -{0.247163f,0.347510f,-0.378687f}, -{0.223985f,0.337541f,-0.314411f}, -{0.229646f,0.340011f,-0.322848f}, -{0.333949f,0.225631f,-0.436516f}, -{0.271516f,0.146054f,-0.422461f}, -{0.309951f,0.195000f,-0.432098f}, -{0.174043f,0.338241f,-0.359307f}, -{0.228778f,0.324259f,-0.372027f}, -{0.247163f,0.347510f,-0.378687f}, -{0.228778f,0.324259f,-0.372027f}, -{0.174043f,0.338241f,-0.359307f}, -{0.191521f,0.286310f,-0.375222f}, -{0.174043f,0.338241f,-0.359307f}, -{0.247163f,0.347510f,-0.378687f}, -{0.267332f,0.372804f,-0.425810f}, -{0.204467f,0.341703f,-0.404503f}, -{0.174043f,0.338241f,-0.359307f}, -{0.267332f,0.372804f,-0.425810f}, -{0.223985f,0.337541f,-0.314411f}, -{0.247163f,0.347510f,-0.378687f}, -{0.174043f,0.338241f,-0.359307f}, -{0.332668f,0.241970f,-0.458633f}, -{0.271516f,0.146054f,-0.422461f}, -{0.247549f,0.153196f,-0.482049f}, -{0.271516f,0.146054f,-0.422461f}, -{0.332668f,0.241970f,-0.458633f}, -{0.333949f,0.225631f,-0.436516f}, -{0.247549f,0.153196f,-0.482049f}, -{0.262287f,0.212896f,-0.475284f}, -{0.332668f,0.241970f,-0.458633f}, -{0.174043f,0.338241f,-0.359307f}, -{0.204467f,0.341703f,-0.404503f}, -{0.215665f,0.267503f,-0.453827f}, -{0.281315f,0.304736f,-0.465868f}, -{0.332668f,0.241970f,-0.458633f}, -{0.262287f,0.212896f,-0.475284f}, -{0.332668f,0.241970f,-0.458633f}, -{0.281315f,0.304736f,-0.465868f}, -{0.314392f,0.267140f,-0.468557f}, -{0.295855f,0.326401f,-0.458177f}, -{0.314392f,0.267140f,-0.468557f}, -{0.281315f,0.304736f,-0.465868f}, -{0.281315f,0.304736f,-0.465868f}, -{0.267332f,0.372804f,-0.425810f}, -{0.295855f,0.326401f,-0.458177f}, -{0.281315f,0.304736f,-0.465868f}, -{0.238459f,0.321833f,-0.455783f}, -{0.267332f,0.372804f,-0.425810f}, -{0.215665f,0.267503f,-0.453827f}, -{0.204467f,0.341703f,-0.404503f}, -{0.238459f,0.321833f,-0.455783f}, -{0.238459f,0.321833f,-0.455783f}, -{0.204467f,0.341703f,-0.404503f}, -{0.267332f,0.372804f,-0.425810f}, -{0.215665f,0.267503f,-0.453827f}, -{0.191521f,0.286310f,-0.375222f}, -{0.174043f,0.338241f,-0.359307f}, -{0.227678f,0.308117f,-0.457078f}, -{0.238459f,0.321833f,-0.455783f}, -{0.281315f,0.304736f,-0.465868f}, -{0.227678f,0.308117f,-0.457078f}, -{0.215665f,0.267503f,-0.453827f}, -{0.238459f,0.321833f,-0.455783f}, -{0.180821f,0.155294f,-0.477739f}, -{0.201362f,0.215441f,-0.460082f}, -{0.247549f,0.153196f,-0.482049f}, -{0.262287f,0.212896f,-0.475284f}, -{0.247549f,0.153196f,-0.482049f}, -{0.201362f,0.215441f,-0.460082f}, -{0.161299f,0.308650f,-0.373832f}, -{0.191521f,0.286310f,-0.375222f}, -{0.215665f,0.267503f,-0.453827f}, -{0.191521f,0.286310f,-0.375222f}, -{0.223985f,0.337541f,-0.314411f}, -{0.174043f,0.338241f,-0.359307f}, -{0.161299f,0.308650f,-0.373832f}, -{0.174043f,0.338241f,-0.359307f}, -{0.191521f,0.286310f,-0.375222f}, -{0.215665f,0.267503f,-0.453827f}, -{0.262287f,0.212896f,-0.475284f}, -{0.201362f,0.215441f,-0.460082f}, -{0.262287f,0.212896f,-0.475284f}, -{0.215665f,0.267503f,-0.453827f}, -{0.281315f,0.304736f,-0.465868f}, -{0.215665f,0.267503f,-0.453827f}, -{0.227678f,0.308117f,-0.457078f}, -{0.281315f,0.304736f,-0.465868f}, -{0.201362f,0.215441f,-0.460082f}, -{0.180821f,0.155294f,-0.477739f}, -{0.168541f,0.176016f,-0.411029f}, -{0.201362f,0.215441f,-0.460082f}, -{0.168541f,0.176016f,-0.411029f}, -{0.171718f,0.217893f,-0.427529f}, -{0.215665f,0.267503f,-0.453827f}, -{0.201362f,0.215441f,-0.460082f}, -{0.171718f,0.217893f,-0.427529f}, -{0.191521f,0.286310f,-0.375222f}, -{0.181761f,0.321654f,-0.317338f}, -{0.223985f,0.337541f,-0.314411f}, -{0.159666f,0.179724f,-0.432110f}, -{0.171718f,0.217893f,-0.427529f}, -{0.168541f,0.176016f,-0.411029f}, -{0.210101f,0.237839f,-0.387570f}, -{0.191521f,0.286310f,-0.375222f}, -{0.171718f,0.217893f,-0.427529f}, -{0.191521f,0.286310f,-0.375222f}, -{0.215665f,0.267503f,-0.453827f}, -{0.171718f,0.217893f,-0.427529f}, -{0.181761f,0.321654f,-0.317338f}, -{0.229646f,0.340011f,-0.322848f}, -{0.223985f,0.337541f,-0.314411f}, -{0.242245f,0.097024f,-0.396558f}, -{0.258623f,0.127712f,-0.476460f}, -{0.271516f,0.146054f,-0.422461f}, -{0.180821f,0.155294f,-0.477739f}, -{0.159666f,0.179724f,-0.432110f}, -{0.168541f,0.176016f,-0.411029f}, -{0.333768f,0.367511f,-0.391747f}, -{0.337862f,0.362983f,-0.390960f}, -{0.309896f,0.280434f,-0.385472f}, -{0.309896f,0.280434f,-0.385472f}, -{0.357923f,0.280463f,-0.436879f}, -{0.333768f,0.367511f,-0.391747f}, -{0.247549f,0.153196f,-0.482049f}, -{0.271516f,0.146054f,-0.422461f}, -{0.258623f,0.127712f,-0.476460f}, -{0.357923f,0.280463f,-0.436879f}, -{0.314392f,0.267140f,-0.468557f}, -{0.333768f,0.367511f,-0.391747f}, -{0.314392f,0.267140f,-0.468557f}, -{0.295855f,0.326401f,-0.458177f}, -{0.333768f,0.367511f,-0.391747f}, -{0.295855f,0.326401f,-0.458177f}, -{0.267332f,0.372804f,-0.425810f}, -{0.333768f,0.367511f,-0.391747f}, -{0.333768f,0.367511f,-0.391747f}, -{0.267332f,0.372804f,-0.425810f}, -{0.247163f,0.347510f,-0.378687f}, -{0.333768f,0.367511f,-0.391747f}, -{0.247163f,0.347510f,-0.378687f}, -{0.337862f,0.362983f,-0.390960f}, -{0.267332f,0.372804f,-0.425810f}, -{0.275327f,0.411720f,-0.369176f}, -{0.260547f,0.392466f,-0.398260f}, -{0.247163f,0.347510f,-0.378687f}, -{0.275327f,0.411720f,-0.369176f}, -{0.267332f,0.372804f,-0.425810f}, -{0.379538f,0.403157f,-0.376999f}, -{0.375592f,0.334024f,-0.412810f}, -{0.367003f,0.410626f,-0.398491f}, -{0.375592f,0.334024f,-0.412810f}, -{0.379538f,0.403157f,-0.376999f}, -{0.371817f,0.366593f,-0.388727f}, -{0.295708f,0.392187f,-0.406384f}, -{0.379538f,0.403157f,-0.376999f}, -{0.367003f,0.410626f,-0.398491f}, -{0.326387f,0.435131f,-0.362228f}, -{0.379538f,0.403157f,-0.376999f}, -{0.295708f,0.392187f,-0.406384f}, -{0.326387f,0.435131f,-0.362228f}, -{0.371817f,0.366593f,-0.388727f}, -{0.379538f,0.403157f,-0.376999f}, -{0.295708f,0.392187f,-0.406384f}, -{0.367003f,0.410626f,-0.398491f}, -{0.375592f,0.334024f,-0.412810f}, -{0.337862f,0.362983f,-0.390960f}, -{0.371817f,0.366593f,-0.388727f}, -{0.326387f,0.435131f,-0.362228f}, -{0.333768f,0.367511f,-0.391747f}, -{0.295708f,0.392187f,-0.406384f}, -{0.375592f,0.334024f,-0.412810f}, -{0.295708f,0.392187f,-0.406384f}, -{0.333768f,0.367511f,-0.391747f}, -{0.326387f,0.435131f,-0.362228f}, -{0.337862f,0.362983f,-0.390960f}, -{0.326387f,0.435131f,-0.362228f}, -{0.333768f,0.367511f,-0.391747f}, -{0.333768f,0.367511f,-0.391747f}, -{0.371817f,0.366593f,-0.388727f}, -{0.337862f,0.362983f,-0.390960f}, -{0.371817f,0.366593f,-0.388727f}, -{0.333768f,0.367511f,-0.391747f}, -{0.375592f,0.334024f,-0.412810f}, -{0.337862f,0.362983f,-0.390960f}, -{0.326387f,0.435131f,-0.362228f}, -{0.275327f,0.411720f,-0.369176f}, -{0.260547f,0.392466f,-0.398260f}, -{0.326387f,0.435131f,-0.362228f}, -{0.295708f,0.392187f,-0.406384f}, -{0.275327f,0.411720f,-0.369176f}, -{0.326387f,0.435131f,-0.362228f}, -{0.260547f,0.392466f,-0.398260f}, -{0.275327f,0.411720f,-0.369176f}, -{0.247163f,0.347510f,-0.378687f}, -{0.337862f,0.362983f,-0.390960f}, -{0.267332f,0.372804f,-0.425810f}, -{0.260547f,0.392466f,-0.398260f}, -{0.295708f,0.392187f,-0.406384f}, -{0.295708f,0.392187f,-0.406384f}, -{0.333768f,0.367511f,-0.391747f}, -{0.267332f,0.372804f,-0.425810f}, -{0.333949f,0.225631f,-0.436516f}, -{0.362128f,0.256153f,-0.406989f}, -{0.371481f,0.302999f,-0.439742f}, -{0.371481f,0.302999f,-0.439742f}, -{0.357923f,0.280463f,-0.436879f}, -{0.333949f,0.225631f,-0.436516f}, -{0.332668f,0.241970f,-0.458633f}, -{0.357923f,0.280463f,-0.436879f}, -{0.333949f,0.225631f,-0.436516f}, -{0.332668f,0.241970f,-0.458633f}, -{0.314392f,0.267140f,-0.468557f}, -{0.357923f,0.280463f,-0.436879f}, -{0.375592f,0.334024f,-0.412810f}, -{0.371817f,0.366593f,-0.388727f}, -{0.371481f,0.302999f,-0.439742f}, -{0.371481f,0.302999f,-0.439742f}, -{0.371817f,0.366593f,-0.388727f}, -{0.381019f,0.271362f,-0.379119f}, -{0.371481f,0.302999f,-0.439742f}, -{0.381019f,0.271362f,-0.379119f}, -{0.375592f,0.334024f,-0.412810f}, -{0.375592f,0.334024f,-0.412810f}, -{0.381019f,0.271362f,-0.379119f}, -{0.371817f,0.366593f,-0.388727f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.720657f,-0.563569f,-0.126581f}, -{0.713467f,-0.543734f,-0.142669f}, -{0.734388f,-0.587478f,-0.118492f}, -{0.713467f,-0.543734f,-0.142669f}, -{0.720657f,-0.563569f,-0.126581f}, -{0.734388f,-0.587478f,-0.118492f}, -{0.731095f,-0.621472f,-0.162779f}, -{0.713467f,-0.543734f,-0.142669f}, -{0.702371f,-0.573362f,-0.260196f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.713467f,-0.543734f,-0.142669f}, -{0.731095f,-0.621472f,-0.162779f}, -{0.702371f,-0.573362f,-0.260196f}, -{0.713467f,-0.543734f,-0.142669f}, -{0.693914f,-0.617080f,-0.244177f}, -{0.702371f,-0.573362f,-0.260196f}, -{0.731095f,-0.621472f,-0.162779f}, -{0.712612f,-0.529432f,-0.270936f}, -{0.702833f,-0.481449f,-0.298941f}, -{0.702371f,-0.573362f,-0.260196f}, -{0.702371f,-0.573362f,-0.260196f}, -{0.702833f,-0.481449f,-0.298941f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.711722f,-0.704296f,-0.201800f}, -{0.693914f,-0.617080f,-0.244177f}, -{0.731095f,-0.621472f,-0.162779f}, -{0.661019f,-0.524413f,-0.311967f}, -{0.712612f,-0.529432f,-0.270936f}, -{0.702371f,-0.573362f,-0.260196f}, -{0.633983f,-0.622554f,-0.286089f}, -{0.661019f,-0.524413f,-0.311967f}, -{0.693914f,-0.617080f,-0.244177f}, -{0.693914f,-0.617080f,-0.244177f}, -{0.661019f,-0.524413f,-0.311967f}, -{0.702371f,-0.573362f,-0.260196f}, -{0.662332f,-0.669297f,-0.249134f}, -{0.693914f,-0.617080f,-0.244177f}, -{0.711722f,-0.704296f,-0.201800f}, -{0.693914f,-0.617080f,-0.244177f}, -{0.662332f,-0.669297f,-0.249134f}, -{0.633983f,-0.622554f,-0.286089f}, -{0.661019f,-0.524413f,-0.311967f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.712612f,-0.529432f,-0.270936f}, -{0.712612f,-0.529432f,-0.270936f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.702833f,-0.481449f,-0.298941f}, -{0.625252f,-0.672432f,-0.269750f}, -{0.633983f,-0.622554f,-0.286089f}, -{0.662332f,-0.669297f,-0.249134f}, -{0.604107f,-0.616324f,-0.295926f}, -{0.661019f,-0.524413f,-0.311967f}, -{0.633983f,-0.622554f,-0.286089f}, -{0.590344f,-0.666837f,-0.282277f}, -{0.633983f,-0.622554f,-0.286089f}, -{0.625252f,-0.672432f,-0.269750f}, -{0.633983f,-0.622554f,-0.286089f}, -{0.590344f,-0.666837f,-0.282277f}, -{0.604107f,-0.616324f,-0.295926f}, -{0.588446f,-0.553549f,-0.308191f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.661019f,-0.524413f,-0.311967f}, -{0.661019f,-0.524413f,-0.311967f}, -{0.604107f,-0.616324f,-0.295926f}, -{0.588446f,-0.553549f,-0.308191f}, -{0.551275f,-0.650472f,-0.289342f}, -{0.604107f,-0.616324f,-0.295926f}, -{0.590344f,-0.666837f,-0.282277f}, -{0.551275f,-0.650472f,-0.289342f}, -{0.588446f,-0.553549f,-0.308191f}, -{0.604107f,-0.616324f,-0.295926f}, -{0.522898f,-0.568872f,-0.289301f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.588446f,-0.553549f,-0.308191f}, -{0.522898f,-0.568872f,-0.289301f}, -{0.588446f,-0.553549f,-0.308191f}, -{0.551275f,-0.650472f,-0.289342f}, -{0.538608f,-0.506152f,-0.275547f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.522898f,-0.568872f,-0.289301f}, -{0.472991f,-0.630213f,-0.286776f}, -{0.522898f,-0.568872f,-0.289301f}, -{0.551275f,-0.650472f,-0.289342f}, -{0.522898f,-0.568872f,-0.289301f}, -{0.472991f,-0.630213f,-0.286776f}, -{0.478024f,-0.583510f,-0.277120f}, -{0.493554f,-0.502430f,-0.206613f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.538608f,-0.506152f,-0.275547f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.493554f,-0.502430f,-0.206613f}, -{0.588326f,-0.459820f,-0.149694f}, -{0.510656f,-0.521353f,-0.256432f}, -{0.538608f,-0.506152f,-0.275547f}, -{0.522898f,-0.568872f,-0.289301f}, -{0.538608f,-0.506152f,-0.275547f}, -{0.510656f,-0.521353f,-0.256432f}, -{0.493554f,-0.502430f,-0.206613f}, -{0.510656f,-0.521353f,-0.256432f}, -{0.478024f,-0.583510f,-0.277120f}, -{0.462747f,-0.557010f,-0.256818f}, -{0.522898f,-0.568872f,-0.289301f}, -{0.478024f,-0.583510f,-0.277120f}, -{0.510656f,-0.521353f,-0.256432f}, -{0.510656f,-0.521353f,-0.256432f}, -{0.462747f,-0.557010f,-0.256818f}, -{0.493554f,-0.502430f,-0.206613f}, -{0.478382f,-0.512709f,-0.219323f}, -{0.493554f,-0.502430f,-0.206613f}, -{0.462747f,-0.557010f,-0.256818f}, -{0.493554f,-0.502430f,-0.206613f}, -{0.519126f,-0.484408f,-0.182053f}, -{0.588326f,-0.459820f,-0.149694f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.720657f,-0.563569f,-0.126581f}, -{0.588326f,-0.459820f,-0.149694f}, -{0.600226f,-0.471206f,-0.122602f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.578587f,-0.390491f,-0.263057f}, -{0.588326f,-0.459820f,-0.149694f}, -{0.576231f,-0.389789f,-0.247438f}, -{0.468667f,-0.664724f,-0.291909f}, -{0.551275f,-0.650472f,-0.289342f}, -{0.543268f,-0.710829f,-0.285133f}, -{0.543268f,-0.710829f,-0.285133f}, -{0.590344f,-0.666837f,-0.282277f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.625252f,-0.672432f,-0.269750f}, -{0.623118f,-0.726832f,-0.262889f}, -{0.623118f,-0.726832f,-0.262889f}, -{0.625252f,-0.672432f,-0.269750f}, -{0.671667f,-0.722656f,-0.237407f}, -{0.671667f,-0.722656f,-0.237407f}, -{0.662332f,-0.669297f,-0.249134f}, -{0.711722f,-0.704296f,-0.201800f}, -{0.711722f,-0.704296f,-0.201800f}, -{0.731095f,-0.621472f,-0.162779f}, -{0.727599f,-0.690301f,-0.181027f}, -{0.727599f,-0.690301f,-0.181027f}, -{0.731095f,-0.621472f,-0.162779f}, -{0.774117f,-0.644992f,-0.078104f}, -{0.734388f,-0.587478f,-0.118492f}, -{0.774117f,-0.644992f,-0.078104f}, -{0.731095f,-0.621472f,-0.162779f}, -{0.662332f,-0.669297f,-0.249134f}, -{0.671667f,-0.722656f,-0.237407f}, -{0.625252f,-0.672432f,-0.269750f}, -{0.625252f,-0.672432f,-0.269750f}, -{0.596126f,-0.724274f,-0.272534f}, -{0.590344f,-0.666837f,-0.282277f}, -{0.590344f,-0.666837f,-0.282277f}, -{0.543268f,-0.710829f,-0.285133f}, -{0.551275f,-0.650472f,-0.289342f}, -{0.551275f,-0.650472f,-0.289342f}, -{0.468667f,-0.664724f,-0.291909f}, -{0.472991f,-0.630213f,-0.286776f}, -{0.588326f,-0.459820f,-0.149694f}, -{0.578587f,-0.390491f,-0.263057f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.866112f,-0.309084f,-0.121136f}, -{0.841497f,-0.318153f,-0.203204f}, -{0.960513f,-0.281200f,-0.060842f}, -{0.964126f,-0.355337f,-0.131839f}, -{0.960513f,-0.281200f,-0.060842f}, -{0.841497f,-0.318153f,-0.203204f}, -{0.964776f,-0.218251f,-0.165152f}, -{0.957239f,-0.210717f,-0.066624f}, -{0.964126f,-0.355337f,-0.131839f}, -{0.964126f,-0.355337f,-0.131839f}, -{0.957239f,-0.210717f,-0.066624f}, -{0.960513f,-0.281200f,-0.060842f}, -{0.957239f,-0.210717f,-0.066624f}, -{0.964776f,-0.218251f,-0.165152f}, -{1.003311f,-0.085081f,-0.098274f}, -{1.009633f,-0.123172f,-0.155768f}, -{1.003311f,-0.085081f,-0.098274f}, -{0.964776f,-0.218251f,-0.165152f}, -{0.748921f,-0.251520f,-0.292421f}, -{0.780247f,-0.298239f,-0.173676f}, -{0.725204f,-0.379108f,-0.272777f}, -{0.841497f,-0.318153f,-0.203204f}, -{0.780247f,-0.298239f,-0.173676f}, -{0.748921f,-0.251520f,-0.292421f}, -{0.748921f,-0.251520f,-0.292421f}, -{0.829233f,-0.236954f,-0.261700f}, -{0.841497f,-0.318153f,-0.203204f}, -{0.829584f,-0.211497f,-0.251499f}, -{0.841497f,-0.318153f,-0.203204f}, -{0.829233f,-0.236954f,-0.261700f}, -{0.648469f,-0.235141f,-0.312228f}, -{0.725204f,-0.379108f,-0.272777f}, -{0.578587f,-0.390491f,-0.263057f}, -{0.725204f,-0.379108f,-0.272777f}, -{0.648469f,-0.235141f,-0.312228f}, -{0.748921f,-0.251520f,-0.292421f}, -{0.748921f,-0.251520f,-0.292421f}, -{0.829584f,-0.211497f,-0.251499f}, -{0.829233f,-0.236954f,-0.261700f}, -{0.829584f,-0.211497f,-0.251499f}, -{0.964776f,-0.218251f,-0.165152f}, -{0.841497f,-0.318153f,-0.203204f}, -{0.964776f,-0.218251f,-0.165152f}, -{0.964126f,-0.355337f,-0.131839f}, -{0.841497f,-0.318153f,-0.203204f}, -{0.829584f,-0.211497f,-0.251499f}, -{0.748921f,-0.251520f,-0.292421f}, -{0.738573f,-0.212239f,-0.156084f}, -{0.748921f,-0.251520f,-0.292421f}, -{0.648469f,-0.235141f,-0.312228f}, -{0.675594f,-0.258867f,-0.180009f}, -{0.675594f,-0.258867f,-0.180009f}, -{0.738573f,-0.212239f,-0.156084f}, -{0.748921f,-0.251520f,-0.292421f}, -{0.916396f,-0.228440f,-0.117147f}, -{0.957239f,-0.210717f,-0.066624f}, -{0.829584f,-0.211497f,-0.251499f}, -{0.957239f,-0.210717f,-0.066624f}, -{0.964776f,-0.218251f,-0.165152f}, -{0.829584f,-0.211497f,-0.251499f}, -{0.675594f,-0.258867f,-0.180009f}, -{0.578587f,-0.390491f,-0.263057f}, -{0.576231f,-0.389789f,-0.247438f}, -{0.578587f,-0.390491f,-0.263057f}, -{0.675594f,-0.258867f,-0.180009f}, -{0.648469f,-0.235141f,-0.312228f}, -{0.916396f,-0.228440f,-0.117147f}, -{0.829584f,-0.211497f,-0.251499f}, -{0.738573f,-0.212239f,-0.156084f}, -{0.957239f,-0.210717f,-0.066624f}, -{0.916396f,-0.228440f,-0.117147f}, -{0.866112f,-0.309084f,-0.121136f}, -{0.738573f,-0.212239f,-0.156084f}, -{0.866112f,-0.309084f,-0.121136f}, -{0.916396f,-0.228440f,-0.117147f}, -{0.866112f,-0.309084f,-0.121136f}, -{0.960513f,-0.281200f,-0.060842f}, -{0.957239f,-0.210717f,-0.066624f}, -{0.738573f,-0.212239f,-0.156084f}, -{0.675594f,-0.258867f,-0.180009f}, -{0.780247f,-0.298239f,-0.173676f}, -{0.576231f,-0.389789f,-0.247438f}, -{0.780247f,-0.298239f,-0.173676f}, -{0.675594f,-0.258867f,-0.180009f}, -{0.841497f,-0.318153f,-0.203204f}, -{0.866112f,-0.309084f,-0.121136f}, -{0.780247f,-0.298239f,-0.173676f}, -{0.780247f,-0.298239f,-0.173676f}, -{0.866112f,-0.309084f,-0.121136f}, -{0.738573f,-0.212239f,-0.156084f}, -{0.588326f,-0.459820f,-0.149694f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.576231f,-0.389789f,-0.247438f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.702833f,-0.481449f,-0.298941f}, -{0.725204f,-0.379108f,-0.272777f}, -{0.702833f,-0.481449f,-0.298941f}, -{0.584546f,-0.493636f,-0.305000f}, -{0.578587f,-0.390491f,-0.263057f}, -{0.780247f,-0.298239f,-0.173676f}, -{0.576231f,-0.389789f,-0.247438f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.725204f,-0.379108f,-0.272777f}, -{0.780247f,-0.298239f,-0.173676f}, -{0.731164f,-0.482356f,-0.244570f}, -{0.578587f,-0.390491f,-0.263057f}, -{0.725204f,-0.379108f,-0.272777f}, -{0.702833f,-0.481449f,-0.298941f}}; + {-0.810726f, 0.143830f, -0.062953f}, {-0.824779f, 0.142876f, 0.066613f}, + {-0.909153f, 0.230021f, 0.038237f}, {-0.824779f, 0.142876f, 0.066613f}, + {-0.810726f, 0.143830f, -0.062953f}, {-0.763976f, 0.075361f, -0.011269f}, + {-0.763976f, 0.075361f, -0.011269f}, {-0.766739f, 0.070280f, 0.015291f}, + {-0.824779f, 0.142876f, 0.066613f}, {-0.660314f, 0.072532f, -0.096358f}, + {-0.766739f, 0.070280f, 0.015291f}, {-0.763976f, 0.075361f, -0.011269f}, + {-0.766739f, 0.070280f, 0.015291f}, {-0.660314f, 0.072532f, -0.096358f}, + {-0.685581f, -0.007301f, 0.011902f}, {-0.613969f, -0.075783f, -0.022107f}, + {-0.685581f, -0.007301f, 0.011902f}, {-0.660314f, 0.072532f, -0.096358f}, + {-0.685581f, -0.007301f, 0.011902f}, {-0.613969f, -0.075783f, -0.022107f}, + {-0.620262f, -0.088090f, 0.011132f}, {-0.570308f, -0.166966f, -0.034320f}, + {-0.572362f, -0.168127f, 0.063372f}, {-0.620262f, -0.088090f, 0.011132f}, + {-0.620262f, -0.088090f, 0.011132f}, {-0.613969f, -0.075783f, -0.022107f}, + {-0.570308f, -0.166966f, -0.034320f}, {-0.560206f, -0.219211f, -0.041656f}, + {-0.572362f, -0.168127f, 0.063372f}, {-0.570308f, -0.166966f, -0.034320f}, + {-0.572362f, -0.168127f, 0.063372f}, {-0.560206f, -0.219211f, -0.041656f}, + {-0.568154f, -0.237707f, 0.011206f}, {-0.660314f, 0.072532f, -0.096358f}, + {-0.763976f, 0.075361f, -0.011269f}, {-0.810726f, 0.143830f, -0.062953f}, + {-0.660314f, 0.072532f, -0.096358f}, {-0.599417f, -0.052334f, -0.058643f}, + {-0.613969f, -0.075783f, -0.022107f}, {-0.553026f, -0.132014f, -0.074772f}, + {-0.613969f, -0.075783f, -0.022107f}, {-0.599417f, -0.052334f, -0.058643f}, + {-0.613969f, -0.075783f, -0.022107f}, {-0.553026f, -0.132014f, -0.074772f}, + {-0.570308f, -0.166966f, -0.034320f}, {-0.579028f, -0.029826f, -0.085716f}, + {-0.599417f, -0.052334f, -0.058643f}, {-0.660314f, 0.072532f, -0.096358f}, + {-0.529673f, -0.093704f, -0.102418f}, {-0.599417f, -0.052334f, -0.058643f}, + {-0.579028f, -0.029826f, -0.085716f}, {-0.599417f, -0.052334f, -0.058643f}, + {-0.529673f, -0.093704f, -0.102418f}, {-0.553026f, -0.132014f, -0.074772f}, + {-0.660314f, 0.072532f, -0.096358f}, {-0.763976f, 0.075361f, -0.011269f}, + {-0.730243f, 0.143489f, -0.120320f}, {-0.730243f, 0.143489f, -0.120320f}, + {-0.763976f, 0.075361f, -0.011269f}, {-0.810726f, 0.143830f, -0.062953f}, + {-0.498736f, -0.059239f, -0.121040f}, {-0.579028f, -0.029826f, -0.085716f}, + {-0.569195f, 0.047207f, -0.105737f}, {-0.569195f, 0.047207f, -0.105737f}, + {-0.579028f, -0.029826f, -0.085716f}, {-0.660314f, 0.072532f, -0.096358f}, + {-0.498736f, -0.059239f, -0.121040f}, {-0.529673f, -0.093704f, -0.102418f}, + {-0.579028f, -0.029826f, -0.085716f}, {-0.443061f, -0.008344f, -0.121911f}, + {-0.434308f, -0.049440f, -0.141814f}, {-0.498736f, -0.059239f, -0.121040f}, + {-0.498736f, -0.059239f, -0.121040f}, {-0.569195f, 0.047207f, -0.105737f}, + {-0.443061f, -0.008344f, -0.121911f}, {-0.392288f, -0.021238f, -0.122528f}, + {-0.434308f, -0.049440f, -0.141814f}, {-0.443061f, -0.008344f, -0.121911f}, + {-0.450839f, 0.043866f, -0.092489f}, {-0.443061f, -0.008344f, -0.121911f}, + {-0.569195f, 0.047207f, -0.105737f}, {-0.392288f, -0.021238f, -0.122528f}, + {-0.443061f, -0.008344f, -0.121911f}, {-0.450839f, 0.043866f, -0.092489f}, + {-0.416822f, -0.064653f, -0.153867f}, {-0.434308f, -0.049440f, -0.141814f}, + {-0.392288f, -0.021238f, -0.122528f}, {-0.356137f, -0.022271f, -0.050570f}, + {-0.392288f, -0.021238f, -0.122528f}, {-0.368997f, -0.010198f, -0.052637f}, + {-0.368997f, -0.010198f, -0.052637f}, {-0.392288f, -0.021238f, -0.122528f}, + {-0.450839f, 0.043866f, -0.092489f}, {-0.356137f, -0.022271f, -0.050570f}, + {-0.287041f, -0.058157f, -0.051717f}, {-0.311455f, -0.045609f, -0.117366f}, + {-0.311455f, -0.045609f, -0.117366f}, {-0.392288f, -0.021238f, -0.122528f}, + {-0.356137f, -0.022271f, -0.050570f}, {-0.356137f, -0.022271f, -0.050570f}, + {-0.450839f, 0.043866f, -0.092489f}, {-0.270557f, 0.066073f, -0.108951f}, + {-0.356137f, -0.022271f, -0.050570f}, {-0.368997f, -0.010198f, -0.052637f}, + {-0.450839f, 0.043866f, -0.092489f}, {-0.315943f, -0.010941f, 0.022180f}, + {-0.263859f, -0.064473f, 0.041852f}, {-0.356137f, -0.022271f, -0.050570f}, + {-0.252851f, -0.067050f, 0.043792f}, {-0.287041f, -0.058157f, -0.051717f}, + {-0.263859f, -0.064473f, 0.041852f}, {-0.287041f, -0.058157f, -0.051717f}, + {-0.356137f, -0.022271f, -0.050570f}, {-0.263859f, -0.064473f, 0.041852f}, + {-0.315943f, -0.010941f, 0.022180f}, {-0.356137f, -0.022271f, -0.050570f}, + {-0.281354f, 0.026363f, 0.040343f}, {-0.281354f, 0.026363f, 0.040343f}, + {-0.356137f, -0.022271f, -0.050570f}, {-0.270557f, 0.066073f, -0.108951f}, + {-0.315943f, -0.010941f, 0.022180f}, {-0.351919f, -0.024601f, 0.107836f}, + {-0.263859f, -0.064473f, 0.041852f}, {-0.351919f, -0.024601f, 0.107836f}, + {-0.258619f, -0.061028f, 0.084698f}, {-0.263859f, -0.064473f, 0.041852f}, + {-0.263859f, -0.064473f, 0.041852f}, {-0.258619f, -0.061028f, 0.084698f}, + {-0.252851f, -0.067050f, 0.043792f}, {-0.281354f, 0.026363f, 0.040343f}, + {-0.475109f, 0.019966f, 0.128767f}, {-0.315943f, -0.010941f, 0.022180f}, + {-0.315943f, -0.010941f, 0.022180f}, {-0.475109f, 0.019966f, 0.128767f}, + {-0.377767f, -0.006200f, 0.098291f}, {-0.377767f, -0.006200f, 0.098291f}, + {-0.351919f, -0.024601f, 0.107836f}, {-0.315943f, -0.010941f, 0.022180f}, + {-0.377767f, -0.006200f, 0.098291f}, {-0.475109f, 0.019966f, 0.128767f}, + {-0.426302f, 0.003976f, 0.129716f}, {-0.351919f, -0.024601f, 0.107836f}, + {-0.377767f, -0.006200f, 0.098291f}, {-0.426302f, 0.003976f, 0.129716f}, + {-0.351919f, -0.024601f, 0.107836f}, {-0.426302f, 0.003976f, 0.129716f}, + {-0.381471f, -0.048737f, 0.171259f}, {-0.565198f, 0.021489f, 0.127682f}, + {-0.590373f, 0.117014f, 0.149670f}, {-0.475109f, 0.019966f, 0.128767f}, + {-0.485471f, -0.061573f, 0.150521f}, {-0.426302f, 0.003976f, 0.129716f}, + {-0.590373f, 0.117014f, 0.149670f}, {-0.475109f, 0.019966f, 0.128767f}, + {-0.590373f, 0.117014f, 0.149670f}, {-0.426302f, 0.003976f, 0.129716f}, + {-0.426302f, 0.003976f, 0.129716f}, {-0.485471f, -0.061573f, 0.150521f}, + {-0.381471f, -0.048737f, 0.171259f}, {-0.728176f, 0.068044f, 0.083828f}, + {-0.590373f, 0.117014f, 0.149670f}, {-0.630007f, 0.094660f, 0.132972f}, + {-0.590373f, 0.117014f, 0.149670f}, {-0.728176f, 0.068044f, 0.083828f}, + {-0.565198f, 0.021489f, 0.127682f}, {-0.520765f, -0.017238f, 0.136983f}, + {-0.485471f, -0.061573f, 0.150521f}, {-0.590373f, 0.117014f, 0.149670f}, + {-0.565198f, 0.021489f, 0.127682f}, {-0.520765f, -0.017238f, 0.136983f}, + {-0.590373f, 0.117014f, 0.149670f}, {-0.728176f, 0.068044f, 0.083828f}, + {-0.630007f, 0.094660f, 0.132972f}, {-0.726777f, 0.165369f, 0.156838f}, + {-0.603672f, -0.060984f, 0.087429f}, {-0.565198f, 0.021489f, 0.127682f}, + {-0.728176f, 0.068044f, 0.083828f}, {-0.565198f, 0.021489f, 0.127682f}, + {-0.603672f, -0.060984f, 0.087429f}, {-0.520765f, -0.017238f, 0.136983f}, + {-0.525348f, -0.098759f, 0.129554f}, {-0.520765f, -0.017238f, 0.136983f}, + {-0.603672f, -0.060984f, 0.087429f}, {-0.520765f, -0.017238f, 0.136983f}, + {-0.525348f, -0.098759f, 0.129554f}, {-0.485471f, -0.061573f, 0.150521f}, + {-0.766739f, 0.070280f, 0.015291f}, {-0.815154f, 0.196699f, 0.134399f}, + {-0.824779f, 0.142876f, 0.066613f}, {-0.815154f, 0.196699f, 0.134399f}, + {-0.766739f, 0.070280f, 0.015291f}, {-0.728176f, 0.068044f, 0.083828f}, + {-0.728176f, 0.068044f, 0.083828f}, {-0.726777f, 0.165369f, 0.156838f}, + {-0.815154f, 0.196699f, 0.134399f}, {-0.556125f, -0.136236f, 0.101263f}, + {-0.525348f, -0.098759f, 0.129554f}, {-0.603672f, -0.060984f, 0.087429f}, + {-0.683554f, -0.002336f, 0.045803f}, {-0.728176f, 0.068044f, 0.083828f}, + {-0.766739f, 0.070280f, 0.015291f}, {-0.618036f, -0.079248f, 0.052331f}, + {-0.728176f, 0.068044f, 0.083828f}, {-0.683554f, -0.002336f, 0.045803f}, + {-0.728176f, 0.068044f, 0.083828f}, {-0.618036f, -0.079248f, 0.052331f}, + {-0.603672f, -0.060984f, 0.087429f}, {-0.572362f, -0.168127f, 0.063372f}, + {-0.556125f, -0.136236f, 0.101263f}, {-0.618036f, -0.079248f, 0.052331f}, + {-0.618036f, -0.079248f, 0.052331f}, {-0.556125f, -0.136236f, 0.101263f}, + {-0.603672f, -0.060984f, 0.087429f}, {-0.766739f, 0.070280f, 0.015291f}, + {-0.685581f, -0.007301f, 0.011902f}, {-0.683554f, -0.002336f, 0.045803f}, + {-0.620262f, -0.088090f, 0.011132f}, {-0.618036f, -0.079248f, 0.052331f}, + {-0.685581f, -0.007301f, 0.011902f}, {-0.685581f, -0.007301f, 0.011902f}, + {-0.618036f, -0.079248f, 0.052331f}, {-0.683554f, -0.002336f, 0.045803f}, + {-0.618036f, -0.079248f, 0.052331f}, {-0.620262f, -0.088090f, 0.011132f}, + {-0.572362f, -0.168127f, 0.063372f}, {-0.568154f, -0.237707f, 0.011206f}, + {-0.560344f, -0.218030f, 0.069971f}, {-0.572362f, -0.168127f, 0.063372f}, + {-0.697237f, 0.190662f, -0.171178f}, {-0.600774f, 0.120701f, -0.133308f}, + {-0.569195f, 0.047207f, -0.105737f}, {-0.590373f, 0.117014f, 0.149670f}, + {-0.726777f, 0.165369f, 0.156838f}, {-0.630007f, 0.094660f, 0.132972f}, + {-0.561506f, -0.286111f, 0.048810f}, {-0.554011f, -0.266026f, 0.081342f}, + {-0.560344f, -0.218030f, 0.069971f}, {-0.554011f, -0.266026f, 0.081342f}, + {-0.530825f, -0.208599f, 0.127619f}, {-0.572362f, -0.168127f, 0.063372f}, + {-0.530825f, -0.208599f, 0.127619f}, {-0.496944f, -0.145170f, 0.157557f}, + {-0.525348f, -0.098759f, 0.129554f}, {-0.496944f, -0.145170f, 0.157557f}, + {-0.447572f, -0.087580f, 0.174226f}, {-0.485471f, -0.061573f, 0.150521f}, + {-0.447572f, -0.087580f, 0.174226f}, {-0.381471f, -0.048737f, 0.171259f}, + {-0.485471f, -0.061573f, 0.150521f}, {-0.345111f, -0.042992f, 0.158522f}, + {-0.258619f, -0.061028f, 0.084698f}, {-0.351919f, -0.024601f, 0.107836f}, + {-0.311455f, -0.045609f, -0.117366f}, {-0.345446f, -0.043039f, -0.136387f}, + {-0.392288f, -0.021238f, -0.122528f}, {-0.416822f, -0.064653f, -0.153867f}, + {-0.448058f, -0.087913f, -0.151966f}, {-0.434308f, -0.049440f, -0.141814f}, + {-0.448058f, -0.087913f, -0.151966f}, {-0.497145f, -0.145443f, -0.135271f}, + {-0.498736f, -0.059239f, -0.121040f}, {-0.497145f, -0.145443f, -0.135271f}, + {-0.531076f, -0.209118f, -0.105800f}, {-0.529673f, -0.093704f, -0.102418f}, + {-0.531076f, -0.209118f, -0.105800f}, {-0.554298f, -0.266533f, -0.059249f}, + {-0.570308f, -0.166966f, -0.034320f}, {-0.810726f, 0.143830f, -0.062953f}, + {-0.909153f, 0.230021f, 0.038237f}, {-0.913709f, 0.248567f, -0.048017f}, + {-0.568154f, -0.237707f, 0.011206f}, {-0.560206f, -0.219211f, -0.041656f}, + {-0.554298f, -0.266533f, -0.059249f}, {-0.560206f, -0.219211f, -0.041656f}, + {-0.570308f, -0.166966f, -0.034320f}, {-0.554298f, -0.266533f, -0.059249f}, + {-0.570308f, -0.166966f, -0.034320f}, {-0.553026f, -0.132014f, -0.074772f}, + {-0.531076f, -0.209118f, -0.105800f}, {-0.553026f, -0.132014f, -0.074772f}, + {-0.529673f, -0.093704f, -0.102418f}, {-0.531076f, -0.209118f, -0.105800f}, + {-0.730243f, 0.143489f, -0.120320f}, {-0.810726f, 0.143830f, -0.062953f}, + {-0.697237f, 0.190662f, -0.171178f}, {-0.529673f, -0.093704f, -0.102418f}, + {-0.498736f, -0.059239f, -0.121040f}, {-0.497145f, -0.145443f, -0.135271f}, + {-0.569195f, 0.047207f, -0.105737f}, {-0.660314f, 0.072532f, -0.096358f}, + {-0.697237f, 0.190662f, -0.171178f}, {-0.660314f, 0.072532f, -0.096358f}, + {-0.730243f, 0.143489f, -0.120320f}, {-0.697237f, 0.190662f, -0.171178f}, + {-0.498736f, -0.059239f, -0.121040f}, {-0.434308f, -0.049440f, -0.141814f}, + {-0.448058f, -0.087913f, -0.151966f}, {-0.416822f, -0.064653f, -0.153867f}, + {-0.392288f, -0.021238f, -0.122528f}, {-0.345446f, -0.043039f, -0.136387f}, + {-0.311455f, -0.045609f, -0.117366f}, {-0.287041f, -0.058157f, -0.051717f}, + {-0.281868f, -0.052914f, -0.093357f}, {-0.351919f, -0.024601f, 0.107836f}, + {-0.381471f, -0.048737f, 0.171259f}, {-0.345111f, -0.042992f, 0.158522f}, + {-0.485471f, -0.061573f, 0.150521f}, {-0.525348f, -0.098759f, 0.129554f}, + {-0.496944f, -0.145170f, 0.157557f}, {-0.525348f, -0.098759f, 0.129554f}, + {-0.556125f, -0.136236f, 0.101263f}, {-0.530825f, -0.208599f, 0.127619f}, + {-0.556125f, -0.136236f, 0.101263f}, {-0.572362f, -0.168127f, 0.063372f}, + {-0.530825f, -0.208599f, 0.127619f}, {-0.560344f, -0.218030f, 0.069971f}, + {-0.568154f, -0.237707f, 0.011206f}, {-0.561506f, -0.286111f, 0.048810f}, + {-0.572362f, -0.168127f, 0.063372f}, {-0.560344f, -0.218030f, 0.069971f}, + {-0.554011f, -0.266026f, 0.081342f}, {-0.252851f, -0.067050f, 0.043792f}, + {-0.243884f, -0.066668f, -0.027679f}, {-0.287041f, -0.058157f, -0.051717f}, + {-0.099865f, 0.138177f, -0.122074f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.176203f, 0.060074f, -0.106186f}, {-0.082858f, 0.051277f, -0.052142f}, + {-0.176203f, 0.060074f, -0.106186f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.082858f, 0.051277f, -0.052142f}, {-0.075951f, 0.167834f, 0.024523f}, + {-0.075137f, 0.034598f, 0.018860f}, {-0.075951f, 0.167834f, 0.024523f}, + {-0.082858f, 0.051277f, -0.052142f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.172313f, 0.089176f, 0.156758f}, {-0.075137f, 0.034598f, 0.018860f}, + {-0.075951f, 0.167834f, 0.024523f}, {-0.172313f, 0.089176f, 0.156758f}, + {-0.075951f, 0.167834f, 0.024523f}, {-0.201634f, 0.188471f, 0.245212f}, + {-0.201634f, 0.188471f, 0.245212f}, {-0.075951f, 0.167834f, 0.024523f}, + {-0.088767f, 0.167544f, 0.136712f}, {-0.064364f, 0.318450f, -0.106142f}, + {-0.075951f, 0.167834f, 0.024523f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.048513f, 0.268338f, 0.094717f}, {-0.075951f, 0.167834f, 0.024523f}, + {-0.064364f, 0.318450f, -0.106142f}, {-0.141987f, 0.178210f, -0.173643f}, + {-0.093481f, 0.234137f, -0.137276f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.141987f, 0.178210f, -0.173643f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.099865f, 0.138177f, -0.122074f}, {-0.176203f, 0.060074f, -0.106186f}, + {-0.141987f, 0.178210f, -0.173643f}, {-0.099865f, 0.138177f, -0.122074f}, + {-0.141987f, 0.178210f, -0.173643f}, {-0.176203f, 0.060074f, -0.106186f}, + {-0.168774f, 0.110476f, -0.156291f}, {-0.082858f, 0.051277f, -0.052142f}, + {-0.168774f, 0.110476f, -0.156291f}, {-0.176203f, 0.060074f, -0.106186f}, + {-0.176203f, 0.060074f, -0.106186f}, {-0.082858f, 0.051277f, -0.052142f}, + {-0.173409f, 0.017343f, 0.008831f}, {-0.173409f, 0.017343f, 0.008831f}, + {-0.082858f, 0.051277f, -0.052142f}, {-0.075137f, 0.034598f, 0.018860f}, + {-0.173409f, 0.017343f, 0.008831f}, {-0.075137f, 0.034598f, 0.018860f}, + {-0.172313f, 0.089176f, 0.156758f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.072768f, 0.345724f, -0.136227f}, {-0.064364f, 0.318450f, -0.106142f}, + {-0.072768f, 0.345724f, -0.136227f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.159817f, 0.308307f, -0.249994f}, {-0.093481f, 0.234137f, -0.137276f}, + {-0.159817f, 0.308307f, -0.249994f}, {-0.053491f, 0.167386f, -0.083278f}, + {-0.159817f, 0.308307f, -0.249994f}, {-0.093481f, 0.234137f, -0.137276f}, + {-0.141987f, 0.178210f, -0.173643f}, {-0.299468f, 0.184643f, -0.257095f}, + {-0.141987f, 0.178210f, -0.173643f}, {-0.168774f, 0.110476f, -0.156291f}, + {-0.168774f, 0.110476f, -0.156291f}, {-0.335566f, 0.126338f, -0.195860f}, + {-0.299468f, 0.184643f, -0.257095f}, {-0.335566f, 0.126338f, -0.195860f}, + {-0.168774f, 0.110476f, -0.156291f}, {-0.176203f, 0.060074f, -0.106186f}, + {-0.270557f, 0.066073f, -0.108951f}, {-0.335566f, 0.126338f, -0.195860f}, + {-0.176203f, 0.060074f, -0.106186f}, {-0.173409f, 0.017343f, 0.008831f}, + {-0.281354f, 0.026363f, 0.040343f}, {-0.176203f, 0.060074f, -0.106186f}, + {-0.281354f, 0.026363f, 0.040343f}, {-0.270557f, 0.066073f, -0.108951f}, + {-0.176203f, 0.060074f, -0.106186f}, {-0.350603f, 0.093083f, 0.164192f}, + {-0.173409f, 0.017343f, 0.008831f}, {-0.172313f, 0.089176f, 0.156758f}, + {-0.173409f, 0.017343f, 0.008831f}, {-0.350603f, 0.093083f, 0.164192f}, + {-0.281354f, 0.026363f, 0.040343f}, {-0.325605f, 0.144724f, 0.236982f}, + {-0.350603f, 0.093083f, 0.164192f}, {-0.172313f, 0.089176f, 0.156758f}, + {-0.201634f, 0.188471f, 0.245212f}, {-0.325605f, 0.144724f, 0.236982f}, + {-0.172313f, 0.089176f, 0.156758f}, {-0.088767f, 0.167544f, 0.136712f}, + {-0.101458f, 0.293739f, 0.179849f}, {-0.201634f, 0.188471f, 0.245212f}, + {-0.075951f, 0.167834f, 0.024523f}, {-0.101458f, 0.293739f, 0.179849f}, + {-0.088767f, 0.167544f, 0.136712f}, {-0.075951f, 0.167834f, 0.024523f}, + {-0.071366f, 0.314877f, 0.134458f}, {-0.101458f, 0.293739f, 0.179849f}, + {-0.071366f, 0.314877f, 0.134458f}, {-0.075951f, 0.167834f, 0.024523f}, + {-0.048513f, 0.268338f, 0.094717f}, {-0.033153f, 0.424027f, -0.094593f}, + {-0.048513f, 0.268338f, 0.094717f}, {-0.064364f, 0.318450f, -0.106142f}, + {-0.048513f, 0.268338f, 0.094717f}, {-0.033153f, 0.424027f, -0.094593f}, + {-0.033433f, 0.401933f, 0.129332f}, {-0.200682f, 0.272439f, -0.272401f}, + {-0.159817f, 0.308307f, -0.249994f}, {-0.141987f, 0.178210f, -0.173643f}, + {-0.217682f, 0.258313f, -0.275721f}, {-0.200682f, 0.272439f, -0.272401f}, + {-0.141987f, 0.178210f, -0.173643f}, {-0.259098f, 0.222339f, -0.274714f}, + {-0.217682f, 0.258313f, -0.275721f}, {-0.141987f, 0.178210f, -0.173643f}, + {-0.299468f, 0.184643f, -0.257095f}, {-0.259098f, 0.222339f, -0.274714f}, + {-0.141987f, 0.178210f, -0.173643f}, {-0.281354f, 0.026363f, 0.040343f}, + {-0.350603f, 0.093083f, 0.164192f}, {-0.475109f, 0.019966f, 0.128767f}, + {-0.258617f, 0.222761f, 0.292483f}, {-0.325605f, 0.144724f, 0.236982f}, + {-0.201634f, 0.188471f, 0.245212f}, {-0.201634f, 0.188471f, 0.245212f}, + {-0.218834f, 0.257368f, 0.293536f}, {-0.258617f, 0.222761f, 0.292483f}, + {-0.201634f, 0.188471f, 0.245212f}, {-0.184774f, 0.369677f, 0.309949f}, + {-0.218834f, 0.257368f, 0.293536f}, {-0.201634f, 0.188471f, 0.245212f}, + {-0.101458f, 0.293739f, 0.179849f}, {-0.184774f, 0.369677f, 0.309949f}, + {-0.071366f, 0.314877f, 0.134458f}, {-0.048513f, 0.268338f, 0.094717f}, + {-0.033433f, 0.401933f, 0.129332f}, {-0.081331f, 0.435318f, -0.215997f}, + {-0.033153f, 0.424027f, -0.094593f}, {-0.064364f, 0.318450f, -0.106142f}, + {-0.072768f, 0.345724f, -0.136227f}, {-0.081331f, 0.435318f, -0.215997f}, + {-0.064364f, 0.318450f, -0.106142f}, {-0.123359f, 0.455237f, -0.258829f}, + {-0.081331f, 0.435318f, -0.215997f}, {-0.159817f, 0.308307f, -0.249994f}, + {-0.081331f, 0.435318f, -0.215997f}, {-0.072768f, 0.345724f, -0.136227f}, + {-0.159817f, 0.308307f, -0.249994f}, {-0.159817f, 0.308307f, -0.249994f}, + {-0.166088f, 0.471620f, -0.293476f}, {-0.123359f, 0.455237f, -0.258829f}, + {-0.200682f, 0.272439f, -0.272401f}, {-0.166088f, 0.471620f, -0.293476f}, + {-0.159817f, 0.308307f, -0.249994f}, {-0.217682f, 0.258313f, -0.275721f}, + {-0.321807f, 0.267667f, -0.306258f}, {-0.200682f, 0.272439f, -0.272401f}, + {-0.259098f, 0.222339f, -0.274714f}, {-0.321807f, 0.267667f, -0.306258f}, + {-0.217682f, 0.258313f, -0.275721f}, {-0.299468f, 0.184643f, -0.257095f}, + {-0.457076f, 0.250396f, -0.276312f}, {-0.259098f, 0.222339f, -0.274714f}, + {-0.457076f, 0.250396f, -0.276312f}, {-0.299468f, 0.184643f, -0.257095f}, + {-0.452257f, 0.146554f, -0.174479f}, {-0.335566f, 0.126338f, -0.195860f}, + {-0.452257f, 0.146554f, -0.174479f}, {-0.299468f, 0.184643f, -0.257095f}, + {-0.335566f, 0.126338f, -0.195860f}, {-0.431898f, 0.109969f, -0.146768f}, + {-0.452257f, 0.146554f, -0.174479f}, {-0.431898f, 0.109969f, -0.146768f}, + {-0.270557f, 0.066073f, -0.108951f}, {-0.450839f, 0.043866f, -0.092489f}, + {-0.270557f, 0.066073f, -0.108951f}, {-0.431898f, 0.109969f, -0.146768f}, + {-0.335566f, 0.126338f, -0.195860f}, {-0.350603f, 0.093083f, 0.164192f}, + {-0.456742f, 0.135001f, 0.178754f}, {-0.426302f, 0.003976f, 0.129716f}, + {-0.325605f, 0.144724f, 0.236982f}, {-0.456742f, 0.135001f, 0.178754f}, + {-0.350603f, 0.093083f, 0.164192f}, {-0.456742f, 0.135001f, 0.178754f}, + {-0.325605f, 0.144724f, 0.236982f}, {-0.444583f, 0.245210f, 0.284110f}, + {-0.258617f, 0.222761f, 0.292483f}, {-0.444583f, 0.245210f, 0.284110f}, + {-0.325605f, 0.144724f, 0.236982f}, {-0.293541f, 0.379121f, 0.356764f}, + {-0.258617f, 0.222761f, 0.292483f}, {-0.218834f, 0.257368f, 0.293536f}, + {-0.293541f, 0.379121f, 0.356764f}, {-0.218834f, 0.257368f, 0.293536f}, + {-0.184774f, 0.369677f, 0.309949f}, {-0.101458f, 0.293739f, 0.179849f}, + {-0.143556f, 0.485021f, 0.296972f}, {-0.184774f, 0.369677f, 0.309949f}, + {-0.101458f, 0.293739f, 0.179849f}, {-0.101418f, 0.421808f, 0.251017f}, + {-0.143556f, 0.485021f, 0.296972f}, {-0.101458f, 0.293739f, 0.179849f}, + {-0.071366f, 0.314877f, 0.134458f}, {-0.045579f, 0.454792f, 0.188508f}, + {-0.101418f, 0.421808f, 0.251017f}, {-0.101458f, 0.293739f, 0.179849f}, + {-0.045579f, 0.454792f, 0.188508f}, {-0.033433f, 0.401933f, 0.129332f}, + {-0.045579f, 0.454792f, 0.188508f}, {-0.071366f, 0.314877f, 0.134458f}, + {0.014534f, 0.554231f, -0.064379f}, {-0.033433f, 0.401933f, 0.129332f}, + {-0.033153f, 0.424027f, -0.094593f}, {-0.033433f, 0.401933f, 0.129332f}, + {0.014534f, 0.554231f, -0.064379f}, {0.024689f, 0.563433f, 0.008831f}, + {-0.033153f, 0.424027f, -0.094593f}, {-0.060378f, 0.523962f, -0.203184f}, + {0.014534f, 0.554231f, -0.064379f}, {-0.060378f, 0.523962f, -0.203184f}, + {-0.033153f, 0.424027f, -0.094593f}, {-0.081331f, 0.435318f, -0.215997f}, + {-0.200682f, 0.272439f, -0.272401f}, {-0.348878f, 0.428678f, -0.347622f}, + {-0.166088f, 0.471620f, -0.293476f}, {-0.321807f, 0.267667f, -0.306258f}, + {-0.348878f, 0.428678f, -0.347622f}, {-0.200682f, 0.272439f, -0.272401f}, + {-0.376674f, 0.318942f, -0.326180f}, {-0.321807f, 0.267667f, -0.306258f}, + {-0.259098f, 0.222339f, -0.274714f}, {-0.457076f, 0.250396f, -0.276312f}, + {-0.376674f, 0.318942f, -0.326180f}, {-0.259098f, 0.222339f, -0.274714f}, + {-0.499776f, 0.133654f, -0.150582f}, {-0.452257f, 0.146554f, -0.174479f}, + {-0.431898f, 0.109969f, -0.146768f}, {-0.600774f, 0.120701f, -0.133308f}, + {-0.431898f, 0.109969f, -0.146768f}, {-0.450839f, 0.043866f, -0.092489f}, + {-0.431898f, 0.109969f, -0.146768f}, {-0.600774f, 0.120701f, -0.133308f}, + {-0.499776f, 0.133654f, -0.150582f}, {-0.543369f, 0.227401f, 0.245080f}, + {-0.590373f, 0.117014f, 0.149670f}, {-0.426302f, 0.003976f, 0.129716f}, + {-0.456742f, 0.135001f, 0.178754f}, {-0.543369f, 0.227401f, 0.245080f}, + {-0.426302f, 0.003976f, 0.129716f}, {-0.380244f, 0.268127f, 0.316402f}, + {-0.444583f, 0.245210f, 0.284110f}, {-0.258617f, 0.222761f, 0.292483f}, + {-0.293541f, 0.379121f, 0.356764f}, {-0.380244f, 0.268127f, 0.316402f}, + {-0.258617f, 0.222761f, 0.292483f}, {-0.351059f, 0.426911f, 0.365447f}, + {-0.293541f, 0.379121f, 0.356764f}, {-0.184774f, 0.369677f, 0.309949f}, + {-0.143556f, 0.485021f, 0.296972f}, {-0.351059f, 0.426911f, 0.365447f}, + {-0.184774f, 0.369677f, 0.309949f}, {-0.143556f, 0.485021f, 0.296972f}, + {-0.101418f, 0.421808f, 0.251017f}, {-0.045579f, 0.454792f, 0.188508f}, + {0.024689f, 0.563433f, 0.008831f}, {-0.060964f, 0.523669f, 0.221527f}, + {-0.033433f, 0.401933f, 0.129332f}, {-0.033433f, 0.401933f, 0.129332f}, + {-0.060964f, 0.523669f, 0.221527f}, {-0.045579f, 0.454792f, 0.188508f}, + {-0.060378f, 0.523962f, -0.203184f}, {-0.081331f, 0.435318f, -0.215997f}, + {-0.108599f, 0.580739f, -0.256673f}, {-0.123359f, 0.455237f, -0.258829f}, + {-0.108599f, 0.580739f, -0.256673f}, {-0.081331f, 0.435318f, -0.215997f}, + {-0.108599f, 0.580739f, -0.256673f}, {-0.123359f, 0.455237f, -0.258829f}, + {-0.193596f, 0.625096f, -0.307288f}, {-0.166088f, 0.471620f, -0.293476f}, + {-0.193596f, 0.625096f, -0.307288f}, {-0.123359f, 0.455237f, -0.258829f}, + {-0.166088f, 0.471620f, -0.293476f}, {-0.348878f, 0.428678f, -0.347622f}, + {-0.193596f, 0.625096f, -0.307288f}, {-0.379941f, 0.405196f, -0.348948f}, + {-0.348878f, 0.428678f, -0.347622f}, {-0.321807f, 0.267667f, -0.306258f}, + {-0.376674f, 0.318942f, -0.326180f}, {-0.379941f, 0.405196f, -0.348948f}, + {-0.321807f, 0.267667f, -0.306258f}, {-0.457076f, 0.250396f, -0.276312f}, + {-0.506311f, 0.312499f, -0.305863f}, {-0.376674f, 0.318942f, -0.326180f}, + {-0.506311f, 0.312499f, -0.305863f}, {-0.457076f, 0.250396f, -0.276312f}, + {-0.495779f, 0.239103f, -0.265777f}, {-0.495779f, 0.239103f, -0.265777f}, + {-0.499776f, 0.133654f, -0.150582f}, {-0.506311f, 0.312499f, -0.305863f}, + {-0.452257f, 0.146554f, -0.174479f}, {-0.499776f, 0.133654f, -0.150582f}, + {-0.495779f, 0.239103f, -0.265777f}, {-0.495779f, 0.239103f, -0.265777f}, + {-0.457076f, 0.250396f, -0.276312f}, {-0.452257f, 0.146554f, -0.174479f}, + {-0.533412f, 0.256306f, 0.274081f}, {-0.543369f, 0.227401f, 0.245080f}, + {-0.456742f, 0.135001f, 0.178754f}, {-0.456742f, 0.135001f, 0.178754f}, + {-0.444583f, 0.245210f, 0.284110f}, {-0.533412f, 0.256306f, 0.274081f}, + {-0.444583f, 0.245210f, 0.284110f}, {-0.490027f, 0.335189f, 0.341267f}, + {-0.533412f, 0.256306f, 0.274081f}, {-0.490027f, 0.335189f, 0.341267f}, + {-0.444583f, 0.245210f, 0.284110f}, {-0.380244f, 0.268127f, 0.316402f}, + {-0.293541f, 0.379121f, 0.356764f}, {-0.361848f, 0.507432f, 0.376099f}, + {-0.380244f, 0.268127f, 0.316402f}, {-0.293541f, 0.379121f, 0.356764f}, + {-0.351059f, 0.426911f, 0.365447f}, {-0.361848f, 0.507432f, 0.376099f}, + {-0.135558f, 0.572838f, 0.295510f}, {-0.351059f, 0.426911f, 0.365447f}, + {-0.143556f, 0.485021f, 0.296972f}, {-0.045579f, 0.454792f, 0.188508f}, + {-0.135558f, 0.572838f, 0.295510f}, {-0.143556f, 0.485021f, 0.296972f}, + {-0.135558f, 0.572838f, 0.295510f}, {-0.045579f, 0.454792f, 0.188508f}, + {-0.060964f, 0.523669f, 0.221527f}, {-0.012797f, 0.766036f, -0.073718f}, + {0.024689f, 0.563433f, 0.008831f}, {0.014534f, 0.554231f, -0.064379f}, + {0.024689f, 0.563433f, 0.008831f}, {-0.012797f, 0.766036f, -0.073718f}, + {-0.002218f, 0.774701f, 0.008831f}, {-0.096693f, 0.731137f, -0.217039f}, + {0.014534f, 0.554231f, -0.064379f}, {-0.060378f, 0.523962f, -0.203184f}, + {0.014534f, 0.554231f, -0.064379f}, {-0.096693f, 0.731137f, -0.217039f}, + {-0.012797f, 0.766036f, -0.073718f}, {-0.193596f, 0.625096f, -0.307288f}, + {-0.096693f, 0.731137f, -0.217039f}, {-0.108599f, 0.580739f, -0.256673f}, + {-0.108599f, 0.580739f, -0.256673f}, {-0.096693f, 0.731137f, -0.217039f}, + {-0.060378f, 0.523962f, -0.203184f}, {-0.348878f, 0.428678f, -0.347622f}, + {-0.296639f, 0.565833f, -0.345484f}, {-0.193596f, 0.625096f, -0.307288f}, + {-0.348878f, 0.428678f, -0.347622f}, {-0.379941f, 0.405196f, -0.348948f}, + {-0.296639f, 0.565833f, -0.345484f}, {-0.610271f, 0.513866f, -0.389491f}, + {-0.379941f, 0.405196f, -0.348948f}, {-0.376674f, 0.318942f, -0.326180f}, + {-0.610271f, 0.513866f, -0.389491f}, {-0.376674f, 0.318942f, -0.326180f}, + {-0.506311f, 0.312499f, -0.305863f}, {-0.506311f, 0.312499f, -0.305863f}, + {-0.499776f, 0.133654f, -0.150582f}, {-0.628432f, 0.268044f, -0.259038f}, + {-0.499776f, 0.133654f, -0.150582f}, {-0.697237f, 0.190662f, -0.171178f}, + {-0.628432f, 0.268044f, -0.259038f}, {-0.711124f, 0.325157f, 0.299759f}, + {-0.726777f, 0.165369f, 0.156838f}, {-0.543369f, 0.227401f, 0.245080f}, + {-0.533412f, 0.256306f, 0.274081f}, {-0.711124f, 0.325157f, 0.299759f}, + {-0.543369f, 0.227401f, 0.245080f}, {-0.711124f, 0.325157f, 0.299759f}, + {-0.533412f, 0.256306f, 0.274081f}, {-0.490027f, 0.335189f, 0.341267f}, + {-0.490027f, 0.335189f, 0.341267f}, {-0.380244f, 0.268127f, 0.316402f}, + {-0.522925f, 0.395937f, 0.372776f}, {-0.380244f, 0.268127f, 0.316402f}, + {-0.361848f, 0.507432f, 0.376099f}, {-0.522925f, 0.395937f, 0.372776f}, + {-0.298037f, 0.564787f, 0.363519f}, {-0.361848f, 0.507432f, 0.376099f}, + {-0.351059f, 0.426911f, 0.365447f}, {-0.298037f, 0.564787f, 0.363519f}, + {-0.351059f, 0.426911f, 0.365447f}, {-0.135558f, 0.572838f, 0.295510f}, + {-0.098052f, 0.653213f, 0.258196f}, {-0.135558f, 0.572838f, 0.295510f}, + {-0.060964f, 0.523669f, 0.221527f}, {-0.071181f, 0.665468f, 0.230173f}, + {-0.098052f, 0.653213f, 0.258196f}, {-0.060964f, 0.523669f, 0.221527f}, + {0.024689f, 0.563433f, 0.008831f}, {-0.071181f, 0.665468f, 0.230173f}, + {-0.060964f, 0.523669f, 0.221527f}, {0.024689f, 0.563433f, 0.008831f}, + {-0.002218f, 0.774701f, 0.008831f}, {-0.071181f, 0.665468f, 0.230173f}, + {-0.224929f, 0.755269f, -0.296463f}, {-0.158199f, 0.779210f, -0.246508f}, + {-0.193596f, 0.625096f, -0.307288f}, {-0.193596f, 0.625096f, -0.307288f}, + {-0.158199f, 0.779210f, -0.246508f}, {-0.096693f, 0.731137f, -0.217039f}, + {-0.328057f, 0.781113f, -0.328310f}, {-0.224929f, 0.755269f, -0.296463f}, + {-0.296639f, 0.565833f, -0.345484f}, {-0.296639f, 0.565833f, -0.345484f}, + {-0.224929f, 0.755269f, -0.296463f}, {-0.193596f, 0.625096f, -0.307288f}, + {-0.459669f, 0.613243f, -0.383921f}, {-0.296639f, 0.565833f, -0.345484f}, + {-0.379941f, 0.405196f, -0.348948f}, {-0.506311f, 0.312499f, -0.305863f}, + {-0.647998f, 0.489653f, -0.380638f}, {-0.610271f, 0.513866f, -0.389491f}, + {-0.506311f, 0.312499f, -0.305863f}, {-0.686582f, 0.350216f, -0.308334f}, + {-0.647998f, 0.489653f, -0.380638f}, {-0.686582f, 0.350216f, -0.308334f}, + {-0.506311f, 0.312499f, -0.305863f}, {-0.628432f, 0.268044f, -0.259038f}, + {-0.697237f, 0.190662f, -0.171178f}, {-0.832357f, 0.336963f, -0.230141f}, + {-0.628432f, 0.268044f, -0.259038f}, {-0.697237f, 0.190662f, -0.171178f}, + {-0.816246f, 0.219594f, -0.137372f}, {-0.832357f, 0.336963f, -0.230141f}, + {-0.832685f, 0.336639f, 0.247367f}, {-0.815154f, 0.196699f, 0.134399f}, + {-0.726777f, 0.165369f, 0.156838f}, {-0.711124f, 0.325157f, 0.299759f}, + {-0.832685f, 0.336639f, 0.247367f}, {-0.726777f, 0.165369f, 0.156838f}, + {-0.712499f, 0.442192f, 0.366363f}, {-0.711124f, 0.325157f, 0.299759f}, + {-0.490027f, 0.335189f, 0.341267f}, {-0.522925f, 0.395937f, 0.372776f}, + {-0.712499f, 0.442192f, 0.366363f}, {-0.490027f, 0.335189f, 0.341267f}, + {-0.529404f, 0.468138f, 0.398086f}, {-0.490027f, 0.335189f, 0.341267f}, + {-0.522925f, 0.395937f, 0.372776f}, {-0.529404f, 0.468138f, 0.398086f}, + {-0.522925f, 0.395937f, 0.372776f}, {-0.361848f, 0.507432f, 0.376099f}, + {-0.462505f, 0.516786f, 0.397493f}, {-0.529404f, 0.468138f, 0.398086f}, + {-0.361848f, 0.507432f, 0.376099f}, {-0.462074f, 0.611579f, 0.402017f}, + {-0.462505f, 0.516786f, 0.397493f}, {-0.361848f, 0.507432f, 0.376099f}, + {-0.362704f, 0.594687f, 0.380730f}, {-0.462074f, 0.611579f, 0.402017f}, + {-0.361848f, 0.507432f, 0.376099f}, {-0.298037f, 0.564787f, 0.363519f}, + {-0.362704f, 0.594687f, 0.380730f}, {-0.361848f, 0.507432f, 0.376099f}, + {-0.159492f, 0.778669f, 0.265326f}, {-0.298037f, 0.564787f, 0.363519f}, + {-0.135558f, 0.572838f, 0.295510f}, {-0.298037f, 0.564787f, 0.363519f}, + {-0.159492f, 0.778669f, 0.265326f}, {-0.258656f, 0.662749f, 0.346457f}, + {-0.159492f, 0.778669f, 0.265326f}, {-0.135558f, 0.572838f, 0.295510f}, + {-0.098052f, 0.653213f, 0.258196f}, {-0.098052f, 0.653213f, 0.258196f}, + {-0.071181f, 0.665468f, 0.230173f}, {-0.159492f, 0.778669f, 0.265326f}, + {-0.045862f, 0.829432f, -0.074246f}, {-0.002218f, 0.774701f, 0.008831f}, + {-0.012797f, 0.766036f, -0.073718f}, {-0.002218f, 0.774701f, 0.008831f}, + {-0.045862f, 0.829432f, -0.074246f}, {-0.079333f, 0.894907f, 0.008831f}, + {-0.079513f, 0.813181f, -0.150325f}, {-0.045862f, 0.829432f, -0.074246f}, + {-0.096693f, 0.731137f, -0.217039f}, {-0.096693f, 0.731137f, -0.217039f}, + {-0.045862f, 0.829432f, -0.074246f}, {-0.012797f, 0.766036f, -0.073718f}, + {-0.194396f, 0.911266f, -0.180200f}, {-0.079513f, 0.813181f, -0.150325f}, + {-0.096693f, 0.731137f, -0.217039f}, {-0.158199f, 0.779210f, -0.246508f}, + {-0.194396f, 0.911266f, -0.180200f}, {-0.096693f, 0.731137f, -0.217039f}, + {-0.296639f, 0.565833f, -0.345484f}, {-0.361853f, 0.680293f, -0.357897f}, + {-0.328057f, 0.781113f, -0.328310f}, {-0.361853f, 0.680293f, -0.357897f}, + {-0.296639f, 0.565833f, -0.345484f}, {-0.459669f, 0.613243f, -0.383921f}, + {-0.495109f, 0.589192f, -0.389346f}, {-0.459669f, 0.613243f, -0.383921f}, + {-0.379941f, 0.405196f, -0.348948f}, {-0.572922f, 0.536479f, -0.393769f}, + {-0.379941f, 0.405196f, -0.348948f}, {-0.610271f, 0.513866f, -0.389491f}, + {-0.379941f, 0.405196f, -0.348948f}, {-0.572922f, 0.536479f, -0.393769f}, + {-0.495109f, 0.589192f, -0.389346f}, {-0.686582f, 0.350216f, -0.308334f}, + {-0.826559f, 0.463864f, -0.290584f}, {-0.647998f, 0.489653f, -0.380638f}, + {-0.789021f, 0.378309f, -0.281768f}, {-0.686582f, 0.350216f, -0.308334f}, + {-0.628432f, 0.268044f, -0.259038f}, {-0.686582f, 0.350216f, -0.308334f}, + {-0.789021f, 0.378309f, -0.281768f}, {-0.826559f, 0.463864f, -0.290584f}, + {-0.628432f, 0.268044f, -0.259038f}, {-0.832357f, 0.336963f, -0.230141f}, + {-0.789021f, 0.378309f, -0.281768f}, {-0.711124f, 0.325157f, 0.299759f}, + {-0.789972f, 0.377442f, 0.298419f}, {-0.832685f, 0.336639f, 0.247367f}, + {-0.778837f, 0.501733f, 0.351168f}, {-0.789972f, 0.377442f, 0.298419f}, + {-0.711124f, 0.325157f, 0.299759f}, {-0.712499f, 0.442192f, 0.366363f}, + {-0.778837f, 0.501733f, 0.351168f}, {-0.711124f, 0.325157f, 0.299759f}, + {-0.648681f, 0.489172f, 0.398073f}, {-0.712499f, 0.442192f, 0.366363f}, + {-0.522925f, 0.395937f, 0.372776f}, {-0.529404f, 0.468138f, 0.398086f}, + {-0.648681f, 0.489172f, 0.398073f}, {-0.522925f, 0.395937f, 0.372776f}, + {-0.462505f, 0.516786f, 0.397493f}, {-0.609458f, 0.611316f, 0.410140f}, + {-0.529404f, 0.468138f, 0.398086f}, {-0.462074f, 0.611579f, 0.402017f}, + {-0.609458f, 0.611316f, 0.410140f}, {-0.462505f, 0.516786f, 0.397493f}, + {-0.427199f, 0.724323f, 0.384757f}, {-0.462074f, 0.611579f, 0.402017f}, + {-0.362704f, 0.594687f, 0.380730f}, {-0.298037f, 0.564787f, 0.363519f}, + {-0.427199f, 0.724323f, 0.384757f}, {-0.362704f, 0.594687f, 0.380730f}, + {-0.258656f, 0.662749f, 0.346457f}, {-0.427199f, 0.724323f, 0.384757f}, + {-0.298037f, 0.564787f, 0.363519f}, {-0.145167f, 0.861934f, 0.200777f}, + {-0.159492f, 0.778669f, 0.265326f}, {-0.071181f, 0.665468f, 0.230173f}, + {-0.071181f, 0.665468f, 0.230173f}, {-0.061161f, 0.822120f, 0.134128f}, + {-0.145167f, 0.861934f, 0.200777f}, {-0.079333f, 0.894907f, 0.008831f}, + {-0.071181f, 0.665468f, 0.230173f}, {-0.002218f, 0.774701f, 0.008831f}, + {-0.071181f, 0.665468f, 0.230173f}, {-0.079333f, 0.894907f, 0.008831f}, + {-0.061161f, 0.822120f, 0.134128f}, {-0.194396f, 0.911266f, -0.180200f}, + {-0.103501f, 0.881260f, -0.113156f}, {-0.079513f, 0.813181f, -0.150325f}, + {-0.079513f, 0.813181f, -0.150325f}, {-0.103501f, 0.881260f, -0.113156f}, + {-0.045862f, 0.829432f, -0.074246f}, {-0.294467f, 0.798679f, -0.311306f}, + {-0.194396f, 0.911266f, -0.180200f}, {-0.224929f, 0.755269f, -0.296463f}, + {-0.224929f, 0.755269f, -0.296463f}, {-0.194396f, 0.911266f, -0.180200f}, + {-0.158199f, 0.779210f, -0.246508f}, {-0.328057f, 0.781113f, -0.328310f}, + {-0.294467f, 0.798679f, -0.311306f}, {-0.224929f, 0.755269f, -0.296463f}, + {-0.459669f, 0.613243f, -0.383921f}, {-0.490606f, 0.683646f, -0.382547f}, + {-0.361853f, 0.680293f, -0.357897f}, {-0.490606f, 0.683646f, -0.382547f}, + {-0.459669f, 0.613243f, -0.383921f}, {-0.495109f, 0.589192f, -0.389346f}, + {-0.714978f, 0.640885f, -0.362201f}, {-0.572922f, 0.536479f, -0.393769f}, + {-0.610271f, 0.513866f, -0.389491f}, {-0.714978f, 0.640885f, -0.362201f}, + {-0.610271f, 0.513866f, -0.389491f}, {-0.647998f, 0.489653f, -0.380638f}, + {-0.647998f, 0.489653f, -0.380638f}, {-0.851767f, 0.550087f, -0.281611f}, + {-0.714978f, 0.640885f, -0.362201f}, {-0.647998f, 0.489653f, -0.380638f}, + {-0.826559f, 0.463864f, -0.290584f}, {-0.851767f, 0.550087f, -0.281611f}, + {-0.826559f, 0.463864f, -0.290584f}, {-0.789021f, 0.378309f, -0.281768f}, + {-0.832357f, 0.336963f, -0.230141f}, {-0.832357f, 0.336963f, -0.230141f}, + {-0.872584f, 0.425972f, -0.239293f}, {-0.826559f, 0.463864f, -0.290584f}, + {-0.832357f, 0.336963f, -0.230141f}, {-0.921662f, 0.499711f, -0.204303f}, + {-0.872584f, 0.425972f, -0.239293f}, {-0.832357f, 0.336963f, -0.230141f}, + {-0.935086f, 0.373720f, -0.140379f}, {-0.921662f, 0.499711f, -0.204303f}, + {-0.922564f, 0.499065f, 0.220763f}, {-0.936187f, 0.372794f, 0.155570f}, + {-0.832685f, 0.336639f, 0.247367f}, {-0.872941f, 0.425676f, 0.256514f}, + {-0.922564f, 0.499065f, 0.220763f}, {-0.832685f, 0.336639f, 0.247367f}, + {-0.778837f, 0.501733f, 0.351168f}, {-0.872941f, 0.425676f, 0.256514f}, + {-0.789972f, 0.377442f, 0.298419f}, {-0.789972f, 0.377442f, 0.298419f}, + {-0.872941f, 0.425676f, 0.256514f}, {-0.832685f, 0.336639f, 0.247367f}, + {-0.776732f, 0.602283f, 0.355783f}, {-0.778837f, 0.501733f, 0.351168f}, + {-0.712499f, 0.442192f, 0.366363f}, {-0.715654f, 0.640483f, 0.379688f}, + {-0.776732f, 0.602283f, 0.355783f}, {-0.712499f, 0.442192f, 0.366363f}, + {-0.689622f, 0.565154f, 0.398218f}, {-0.715654f, 0.640483f, 0.379688f}, + {-0.648681f, 0.489172f, 0.398073f}, {-0.648681f, 0.489172f, 0.398073f}, + {-0.715654f, 0.640483f, 0.379688f}, {-0.712499f, 0.442192f, 0.366363f}, + {-0.529404f, 0.468138f, 0.398086f}, {-0.689622f, 0.565154f, 0.398218f}, + {-0.648681f, 0.489172f, 0.398073f}, {-0.609458f, 0.611316f, 0.410140f}, + {-0.689622f, 0.565154f, 0.398218f}, {-0.529404f, 0.468138f, 0.398086f}, + {-0.462074f, 0.611579f, 0.402017f}, {-0.493066f, 0.682107f, 0.400627f}, + {-0.609458f, 0.611316f, 0.410140f}, {-0.459453f, 0.703602f, 0.393687f}, + {-0.493066f, 0.682107f, 0.400627f}, {-0.462074f, 0.611579f, 0.402017f}, + {-0.427199f, 0.724323f, 0.384757f}, {-0.459453f, 0.703602f, 0.393687f}, + {-0.462074f, 0.611579f, 0.402017f}, {-0.297408f, 0.797186f, 0.330554f}, + {-0.258656f, 0.662749f, 0.346457f}, {-0.159492f, 0.778669f, 0.265326f}, + {-0.159492f, 0.778669f, 0.265326f}, {-0.200245f, 0.837065f, 0.263018f}, + {-0.297408f, 0.797186f, 0.330554f}, {-0.159492f, 0.778669f, 0.265326f}, + {-0.145167f, 0.861934f, 0.200777f}, {-0.200245f, 0.837065f, 0.263018f}, + {-0.061161f, 0.822120f, 0.134128f}, {-0.079333f, 0.894907f, 0.008831f}, + {-0.145167f, 0.861934f, 0.200777f}, {-0.153197f, 0.929399f, -0.110639f}, + {-0.192389f, 0.980613f, 0.008831f}, {-0.045862f, 0.829432f, -0.074246f}, + {-0.045862f, 0.829432f, -0.074246f}, {-0.192389f, 0.980613f, 0.008831f}, + {-0.079333f, 0.894907f, 0.008831f}, {-0.103501f, 0.881260f, -0.113156f}, + {-0.153197f, 0.929399f, -0.110639f}, {-0.045862f, 0.829432f, -0.074246f}, + {-0.171562f, 0.920980f, -0.145760f}, {-0.153197f, 0.929399f, -0.110639f}, + {-0.194396f, 0.911266f, -0.180200f}, {-0.194396f, 0.911266f, -0.180200f}, + {-0.153197f, 0.929399f, -0.110639f}, {-0.103501f, 0.881260f, -0.113156f}, + {-0.294467f, 0.798679f, -0.311306f}, {-0.243881f, 0.888252f, -0.238363f}, + {-0.194396f, 0.911266f, -0.180200f}, {-0.486757f, 0.850333f, -0.341353f}, + {-0.294467f, 0.798679f, -0.311306f}, {-0.328057f, 0.781113f, -0.328310f}, + {-0.486757f, 0.850333f, -0.341353f}, {-0.328057f, 0.781113f, -0.328310f}, + {-0.361853f, 0.680293f, -0.357897f}, {-0.731848f, 0.719053f, -0.342454f}, + {-0.495109f, 0.589192f, -0.389346f}, {-0.572922f, 0.536479f, -0.393769f}, + {-0.495109f, 0.589192f, -0.389346f}, {-0.731848f, 0.719053f, -0.342454f}, + {-0.490606f, 0.683646f, -0.382547f}, {-0.731848f, 0.719053f, -0.342454f}, + {-0.572922f, 0.536479f, -0.393769f}, {-0.714978f, 0.640885f, -0.362201f}, + {-0.826559f, 0.463864f, -0.290584f}, {-0.876872f, 0.531976f, -0.256823f}, + {-0.851767f, 0.550087f, -0.281611f}, {-0.921662f, 0.499711f, -0.204303f}, + {-0.826559f, 0.463864f, -0.290584f}, {-0.872584f, 0.425972f, -0.239293f}, + {-0.826559f, 0.463864f, -0.290584f}, {-0.921662f, 0.499711f, -0.204303f}, + {-0.876872f, 0.531976f, -0.256823f}, {-0.993248f, 0.448807f, -0.048683f}, + {-0.935086f, 0.373720f, -0.140379f}, {-0.964325f, 0.349059f, -0.050380f}, + {-0.935086f, 0.373720f, -0.140379f}, {-0.993248f, 0.448807f, -0.048683f}, + {-0.921662f, 0.499711f, -0.204303f}, {-0.999414f, 0.444451f, 0.008831f}, + {-0.964325f, 0.349059f, -0.050380f}, {-0.970256f, 0.344040f, 0.008831f}, + {-0.964325f, 0.349059f, -0.050380f}, {-0.999414f, 0.444451f, 0.008831f}, + {-0.993248f, 0.448807f, -0.048683f}, {-0.922564f, 0.499065f, 0.220763f}, + {-0.999414f, 0.444451f, 0.008831f}, {-0.936187f, 0.372794f, 0.155570f}, + {-0.936187f, 0.372794f, 0.155570f}, {-0.999414f, 0.444451f, 0.008831f}, + {-0.970256f, 0.344040f, 0.008831f}, {-0.776732f, 0.602283f, 0.355783f}, + {-0.922564f, 0.499065f, 0.220763f}, {-0.778837f, 0.501733f, 0.351168f}, + {-0.778837f, 0.501733f, 0.351168f}, {-0.922564f, 0.499065f, 0.220763f}, + {-0.872941f, 0.425676f, 0.256514f}, {-0.732489f, 0.718709f, 0.359961f}, + {-0.715654f, 0.640483f, 0.379688f}, {-0.689622f, 0.565154f, 0.398218f}, + {-0.636801f, 0.683411f, 0.392246f}, {-0.732489f, 0.718709f, 0.359961f}, + {-0.609458f, 0.611316f, 0.410140f}, {-0.609458f, 0.611316f, 0.410140f}, + {-0.732489f, 0.718709f, 0.359961f}, {-0.689622f, 0.565154f, 0.398218f}, + {-0.493066f, 0.682107f, 0.400627f}, {-0.636801f, 0.683411f, 0.392246f}, + {-0.609458f, 0.611316f, 0.410140f}, {-0.427199f, 0.724323f, 0.384757f}, + {-0.519637f, 0.750650f, 0.388987f}, {-0.459453f, 0.703602f, 0.393687f}, + {-0.459453f, 0.703602f, 0.393687f}, {-0.519637f, 0.750650f, 0.388987f}, + {-0.493066f, 0.682107f, 0.400627f}, {-0.258656f, 0.662749f, 0.346457f}, + {-0.424831f, 0.807488f, 0.366791f}, {-0.427199f, 0.724323f, 0.384757f}, + {-0.258656f, 0.662749f, 0.346457f}, {-0.297408f, 0.797186f, 0.330554f}, + {-0.424831f, 0.807488f, 0.366791f}, {-0.245052f, 0.887736f, 0.257123f}, + {-0.297408f, 0.797186f, 0.330554f}, {-0.200245f, 0.837065f, 0.263018f}, + {-0.200245f, 0.837065f, 0.263018f}, {-0.145167f, 0.861934f, 0.200777f}, + {-0.245052f, 0.887736f, 0.257123f}, {-0.192389f, 0.980613f, 0.008831f}, + {-0.145167f, 0.861934f, 0.200777f}, {-0.079333f, 0.894907f, 0.008831f}, + {-0.145167f, 0.861934f, 0.200777f}, {-0.192389f, 0.980613f, 0.008831f}, + {-0.154234f, 0.928941f, 0.130620f}, {-0.311559f, 0.985330f, -0.161251f}, + {-0.153197f, 0.929399f, -0.110639f}, {-0.171562f, 0.920980f, -0.145760f}, + {-0.194396f, 0.911266f, -0.180200f}, {-0.311559f, 0.985330f, -0.161251f}, + {-0.171562f, 0.920980f, -0.145760f}, {-0.243881f, 0.888252f, -0.238363f}, + {-0.311559f, 0.985330f, -0.161251f}, {-0.194396f, 0.911266f, -0.180200f}, + {-0.294467f, 0.798679f, -0.311306f}, {-0.311559f, 0.985330f, -0.161251f}, + {-0.243881f, 0.888252f, -0.238363f}, {-0.353576f, 0.913907f, -0.272511f}, + {-0.311559f, 0.985330f, -0.161251f}, {-0.294467f, 0.798679f, -0.311306f}, + {-0.486757f, 0.850333f, -0.341353f}, {-0.353576f, 0.913907f, -0.272511f}, + {-0.294467f, 0.798679f, -0.311306f}, {-0.574064f, 0.880628f, -0.320614f}, + {-0.486757f, 0.850333f, -0.341353f}, {-0.361853f, 0.680293f, -0.357897f}, + {-0.574064f, 0.880628f, -0.320614f}, {-0.361853f, 0.680293f, -0.357897f}, + {-0.490606f, 0.683646f, -0.382547f}, {-0.490606f, 0.683646f, -0.382547f}, + {-0.731848f, 0.719053f, -0.342454f}, {-0.574064f, 0.880628f, -0.320614f}, + {-0.714978f, 0.640885f, -0.362201f}, {-0.815809f, 0.672171f, -0.305503f}, + {-0.731848f, 0.719053f, -0.342454f}, {-0.815809f, 0.672171f, -0.305503f}, + {-0.714978f, 0.640885f, -0.362201f}, {-0.851767f, 0.550087f, -0.281611f}, + {-0.910114f, 0.613191f, -0.222200f}, {-0.851767f, 0.550087f, -0.281611f}, + {-0.876872f, 0.531976f, -0.256823f}, {-0.910114f, 0.613191f, -0.222200f}, + {-0.876872f, 0.531976f, -0.256823f}, {-0.921662f, 0.499711f, -0.204303f}, + {-0.921662f, 0.499711f, -0.204303f}, {-0.990920f, 0.564170f, -0.089404f}, + {-0.910114f, 0.613191f, -0.222200f}, {-0.990920f, 0.564170f, -0.089404f}, + {-0.921662f, 0.499711f, -0.204303f}, {-0.993248f, 0.448807f, -0.048683f}, + {-1.009633f, 0.553243f, 0.008831f}, {-0.993248f, 0.448807f, -0.048683f}, + {-0.999414f, 0.444451f, 0.008831f}, {-0.993248f, 0.448807f, -0.048683f}, + {-1.009633f, 0.553243f, 0.008831f}, {-0.990920f, 0.564170f, -0.089404f}, + {-0.974611f, 0.573813f, 0.145808f}, {-1.009633f, 0.553243f, 0.008831f}, + {-0.922564f, 0.499065f, 0.220763f}, {-0.922564f, 0.499065f, 0.220763f}, + {-1.009633f, 0.553243f, 0.008831f}, {-0.999414f, 0.444451f, 0.008831f}, + {-0.889064f, 0.626333f, 0.262181f}, {-0.974611f, 0.573813f, 0.145808f}, + {-0.776732f, 0.602283f, 0.355783f}, {-0.776732f, 0.602283f, 0.355783f}, + {-0.974611f, 0.573813f, 0.145808f}, {-0.922564f, 0.499065f, 0.220763f}, + {-0.715654f, 0.640483f, 0.379688f}, {-0.817347f, 0.671244f, 0.322110f}, + {-0.776732f, 0.602283f, 0.355783f}, {-0.732489f, 0.718709f, 0.359961f}, + {-0.817347f, 0.671244f, 0.322110f}, {-0.715654f, 0.640483f, 0.379688f}, + {-0.493066f, 0.682107f, 0.400627f}, {-0.732489f, 0.718709f, 0.359961f}, + {-0.636801f, 0.683411f, 0.392246f}, {-0.576086f, 0.879597f, 0.338471f}, + {-0.732489f, 0.718709f, 0.359961f}, {-0.493066f, 0.682107f, 0.400627f}, + {-0.519637f, 0.750650f, 0.388987f}, {-0.576086f, 0.879597f, 0.338471f}, + {-0.493066f, 0.682107f, 0.400627f}, {-0.427199f, 0.724323f, 0.384757f}, + {-0.576086f, 0.879597f, 0.338471f}, {-0.519637f, 0.750650f, 0.388987f}, + {-0.424831f, 0.807488f, 0.366791f}, {-0.576086f, 0.879597f, 0.338471f}, + {-0.427199f, 0.724323f, 0.384757f}, {-0.297408f, 0.797186f, 0.330554f}, + {-0.352404f, 0.914374f, 0.289321f}, {-0.424831f, 0.807488f, 0.366791f}, + {-0.293374f, 0.992236f, 0.150088f}, {-0.297408f, 0.797186f, 0.330554f}, + {-0.245052f, 0.887736f, 0.257123f}, {-0.297408f, 0.797186f, 0.330554f}, + {-0.293374f, 0.992236f, 0.150088f}, {-0.352404f, 0.914374f, 0.289321f}, + {-0.293374f, 0.992236f, 0.150088f}, {-0.245052f, 0.887736f, 0.257123f}, + {-0.145167f, 0.861934f, 0.200777f}, {-0.293374f, 0.992236f, 0.150088f}, + {-0.145167f, 0.861934f, 0.200777f}, {-0.154234f, 0.928941f, 0.130620f}, + {-0.154234f, 0.928941f, 0.130620f}, {-0.192389f, 0.980613f, 0.008831f}, + {-0.293374f, 0.992236f, 0.150088f}, {-0.264987f, 1.003105f, -0.064779f}, + {-0.332119f, 1.025650f, 0.008831f}, {-0.153197f, 0.929399f, -0.110639f}, + {-0.153197f, 0.929399f, -0.110639f}, {-0.332119f, 1.025650f, 0.008831f}, + {-0.192389f, 0.980613f, 0.008831f}, {-0.311559f, 0.985330f, -0.161251f}, + {-0.264987f, 1.003105f, -0.064779f}, {-0.153197f, 0.929399f, -0.110639f}, + {-0.353576f, 0.913907f, -0.272511f}, {-0.460142f, 0.988548f, -0.212304f}, + {-0.311559f, 0.985330f, -0.161251f}, {-0.451818f, 0.937811f, -0.279528f}, + {-0.460142f, 0.988548f, -0.212304f}, {-0.486757f, 0.850333f, -0.341353f}, + {-0.486757f, 0.850333f, -0.341353f}, {-0.460142f, 0.988548f, -0.212304f}, + {-0.353576f, 0.913907f, -0.272511f}, {-0.576517f, 0.945698f, -0.268811f}, + {-0.451818f, 0.937811f, -0.279528f}, {-0.486757f, 0.850333f, -0.341353f}, + {-0.574064f, 0.880628f, -0.320614f}, {-0.576517f, 0.945698f, -0.268811f}, + {-0.486757f, 0.850333f, -0.341353f}, {-0.673981f, 0.830009f, -0.323608f}, + {-0.574064f, 0.880628f, -0.320614f}, {-0.731848f, 0.719053f, -0.342454f}, + {-0.761288f, 0.860279f, -0.263174f}, {-0.731848f, 0.719053f, -0.342454f}, + {-0.815809f, 0.672171f, -0.305503f}, {-0.731848f, 0.719053f, -0.342454f}, + {-0.761288f, 0.860279f, -0.263174f}, {-0.673981f, 0.830009f, -0.323608f}, + {-0.861645f, 0.733082f, -0.247140f}, {-0.815809f, 0.672171f, -0.305503f}, + {-0.851767f, 0.550087f, -0.281611f}, {-0.945193f, 0.686743f, -0.153102f}, + {-0.851767f, 0.550087f, -0.281611f}, {-0.910114f, 0.613191f, -0.222200f}, + {-0.851767f, 0.550087f, -0.281611f}, {-0.945193f, 0.686743f, -0.153102f}, + {-0.861645f, 0.733082f, -0.247140f}, {-0.941942f, 0.772379f, -0.070777f}, + {-0.910114f, 0.613191f, -0.222200f}, {-0.990920f, 0.564170f, -0.089404f}, + {-0.910114f, 0.613191f, -0.222200f}, {-0.941942f, 0.772379f, -0.070777f}, + {-0.945193f, 0.686743f, -0.153102f}, {-0.956689f, 0.765584f, 0.008831f}, + {-0.990920f, 0.564170f, -0.089404f}, {-1.009633f, 0.553243f, 0.008831f}, + {-0.990920f, 0.564170f, -0.089404f}, {-0.956689f, 0.765584f, 0.008831f}, + {-0.941942f, 0.772379f, -0.070777f}, {-0.926588f, 0.696818f, 0.196804f}, + {-0.956689f, 0.765584f, 0.008831f}, {-0.974611f, 0.573813f, 0.145808f}, + {-0.974611f, 0.573813f, 0.145808f}, {-0.956689f, 0.765584f, 0.008831f}, + {-1.009633f, 0.553243f, 0.008831f}, {-0.889064f, 0.626333f, 0.262181f}, + {-0.926588f, 0.696818f, 0.196804f}, {-0.974611f, 0.573813f, 0.145808f}, + {-0.817347f, 0.671244f, 0.322110f}, {-0.926588f, 0.696818f, 0.196804f}, + {-0.776732f, 0.602283f, 0.355783f}, {-0.776732f, 0.602283f, 0.355783f}, + {-0.926588f, 0.696818f, 0.196804f}, {-0.889064f, 0.626333f, 0.262181f}, + {-0.736999f, 0.870850f, 0.288701f}, {-0.782699f, 0.850967f, 0.271116f}, + {-0.732489f, 0.718709f, 0.359961f}, {-0.732489f, 0.718709f, 0.359961f}, + {-0.782699f, 0.850967f, 0.271116f}, {-0.817347f, 0.671244f, 0.322110f}, + {-0.576086f, 0.879597f, 0.338471f}, {-0.736999f, 0.870850f, 0.288701f}, + {-0.732489f, 0.718709f, 0.359961f}, {-0.424831f, 0.807488f, 0.366791f}, + {-0.577227f, 0.945386f, 0.286633f}, {-0.576086f, 0.879597f, 0.338471f}, + {-0.424831f, 0.807488f, 0.366791f}, {-0.451608f, 0.937898f, 0.297067f}, + {-0.577227f, 0.945386f, 0.286633f}, {-0.451608f, 0.937898f, 0.297067f}, + {-0.424831f, 0.807488f, 0.366791f}, {-0.352404f, 0.914374f, 0.289321f}, + {-0.352404f, 0.914374f, 0.289321f}, {-0.470619f, 1.014874f, 0.163578f}, + {-0.451608f, 0.937898f, 0.297067f}, {-0.352404f, 0.914374f, 0.289321f}, + {-0.293374f, 0.992236f, 0.150088f}, {-0.470619f, 1.014874f, 0.163578f}, + {-0.332119f, 1.025650f, 0.008831f}, {-0.293374f, 0.992236f, 0.150088f}, + {-0.192389f, 0.980613f, 0.008831f}, {-0.460142f, 0.988548f, -0.212304f}, + {-0.425596f, 1.026073f, -0.091742f}, {-0.311559f, 0.985330f, -0.161251f}, + {-0.311559f, 0.985330f, -0.161251f}, {-0.425596f, 1.026073f, -0.091742f}, + {-0.264987f, 1.003105f, -0.064779f}, {-0.504029f, 1.007214f, -0.168846f}, + {-0.460142f, 0.988548f, -0.212304f}, {-0.451818f, 0.937811f, -0.279528f}, + {-0.576517f, 0.945698f, -0.268811f}, {-0.504029f, 1.007214f, -0.168846f}, + {-0.451818f, 0.937811f, -0.279528f}, {-0.574064f, 0.880628f, -0.320614f}, + {-0.622462f, 0.924528f, -0.275492f}, {-0.576517f, 0.945698f, -0.268811f}, + {-0.574064f, 0.880628f, -0.320614f}, {-0.673981f, 0.830009f, -0.323608f}, + {-0.622462f, 0.924528f, -0.275492f}, {-0.808318f, 0.889257f, -0.171204f}, + {-0.761288f, 0.860279f, -0.263174f}, {-0.815809f, 0.672171f, -0.305503f}, + {-0.808318f, 0.889257f, -0.171204f}, {-0.815809f, 0.672171f, -0.305503f}, + {-0.861645f, 0.733082f, -0.247140f}, {-0.808318f, 0.889257f, -0.171204f}, + {-0.861645f, 0.733082f, -0.247140f}, {-0.945193f, 0.686743f, -0.153102f}, + {-0.945193f, 0.686743f, -0.153102f}, {-0.912459f, 0.786374f, -0.132209f}, + {-0.808318f, 0.889257f, -0.171204f}, {-0.945193f, 0.686743f, -0.153102f}, + {-0.941942f, 0.772379f, -0.070777f}, {-0.912459f, 0.786374f, -0.132209f}, + {-0.913197f, 0.786017f, 0.148708f}, {-0.956689f, 0.765584f, 0.008831f}, + {-0.926588f, 0.696818f, 0.196804f}, {-0.761481f, 0.910490f, 0.221616f}, + {-0.913197f, 0.786017f, 0.148708f}, {-0.926588f, 0.696818f, 0.196804f}, + {-0.817347f, 0.671244f, 0.322110f}, {-0.761481f, 0.910490f, 0.221616f}, + {-0.926588f, 0.696818f, 0.196804f}, {-0.782699f, 0.850967f, 0.271116f}, + {-0.761481f, 0.910490f, 0.221616f}, {-0.817347f, 0.671244f, 0.322110f}, + {-0.624131f, 0.923742f, 0.293310f}, {-0.736999f, 0.870850f, 0.288701f}, + {-0.576086f, 0.879597f, 0.338471f}, {-0.577227f, 0.945386f, 0.286633f}, + {-0.624131f, 0.923742f, 0.293310f}, {-0.576086f, 0.879597f, 0.338471f}, + {-0.451608f, 0.937898f, 0.297067f}, {-0.498123f, 0.976199f, 0.254142f}, + {-0.577227f, 0.945386f, 0.286633f}, {-0.451608f, 0.937898f, 0.297067f}, + {-0.470619f, 1.014874f, 0.163578f}, {-0.498123f, 0.976199f, 0.254142f}, + {-0.293374f, 0.992236f, 0.150088f}, {-0.332119f, 1.025650f, 0.008831f}, + {-0.470619f, 1.014874f, 0.163578f}, {-0.425596f, 1.026073f, -0.091742f}, + {-0.472224f, 1.033508f, 0.008831f}, {-0.264987f, 1.003105f, -0.064779f}, + {-0.264987f, 1.003105f, -0.064779f}, {-0.472224f, 1.033508f, 0.008831f}, + {-0.332119f, 1.025650f, 0.008831f}, {-0.723771f, 0.925663f, -0.219441f}, + {-0.576517f, 0.945698f, -0.268811f}, {-0.622462f, 0.924528f, -0.275492f}, + {-0.576517f, 0.945698f, -0.268811f}, {-0.723771f, 0.925663f, -0.219441f}, + {-0.504029f, 1.007214f, -0.168846f}, {-0.723771f, 0.925663f, -0.219441f}, + {-0.622462f, 0.924528f, -0.275492f}, {-0.673981f, 0.830009f, -0.323608f}, + {-0.723771f, 0.925663f, -0.219441f}, {-0.673981f, 0.830009f, -0.323608f}, + {-0.761288f, 0.860279f, -0.263174f}, {-0.761288f, 0.860279f, -0.263174f}, + {-0.808318f, 0.889257f, -0.171204f}, {-0.723771f, 0.925663f, -0.219441f}, + {-0.865650f, 0.862620f, -0.106504f}, {-0.808318f, 0.889257f, -0.171204f}, + {-0.912459f, 0.786374f, -0.132209f}, {-0.865650f, 0.862620f, -0.106504f}, + {-0.912459f, 0.786374f, -0.132209f}, {-0.941942f, 0.772379f, -0.070777f}, + {-0.941942f, 0.772379f, -0.070777f}, {-0.896793f, 0.848784f, -0.027677f}, + {-0.865650f, 0.862620f, -0.106504f}, {-0.900574f, 0.847134f, 0.008831f}, + {-0.941942f, 0.772379f, -0.070777f}, {-0.956689f, 0.765584f, 0.008831f}, + {-0.941942f, 0.772379f, -0.070777f}, {-0.900574f, 0.847134f, 0.008831f}, + {-0.896793f, 0.848784f, -0.027677f}, {-0.878808f, 0.856710f, 0.099709f}, + {-0.900574f, 0.847134f, 0.008831f}, {-0.956689f, 0.765584f, 0.008831f}, + {-0.913197f, 0.786017f, 0.148708f}, {-0.878808f, 0.856710f, 0.099709f}, + {-0.956689f, 0.765584f, 0.008831f}, {-0.761481f, 0.910490f, 0.221616f}, + {-0.878808f, 0.856710f, 0.099709f}, {-0.913197f, 0.786017f, 0.148708f}, + {-0.653617f, 0.986254f, 0.171957f}, {-0.761481f, 0.910490f, 0.221616f}, + {-0.782699f, 0.850967f, 0.271116f}, {-0.736999f, 0.870850f, 0.288701f}, + {-0.653617f, 0.986254f, 0.171957f}, {-0.782699f, 0.850967f, 0.271116f}, + {-0.624131f, 0.923742f, 0.293310f}, {-0.653617f, 0.986254f, 0.171957f}, + {-0.736999f, 0.870850f, 0.288701f}, {-0.498123f, 0.976199f, 0.254142f}, + {-0.653617f, 0.986254f, 0.171957f}, {-0.577227f, 0.945386f, 0.286633f}, + {-0.577227f, 0.945386f, 0.286633f}, {-0.653617f, 0.986254f, 0.171957f}, + {-0.624131f, 0.923742f, 0.293310f}, {-0.472224f, 1.033508f, 0.008831f}, + {-0.470619f, 1.014874f, 0.163578f}, {-0.332119f, 1.025650f, 0.008831f}, + {-0.460142f, 0.988548f, -0.212304f}, {-0.559824f, 1.014232f, -0.120742f}, + {-0.425596f, 1.026073f, -0.091742f}, {-0.504029f, 1.007214f, -0.168846f}, + {-0.559824f, 1.014232f, -0.120742f}, {-0.460142f, 0.988548f, -0.212304f}, + {-0.723771f, 0.925663f, -0.219441f}, {-0.808318f, 0.889257f, -0.171204f}, + {-0.743215f, 0.953685f, -0.130043f}, {-0.808318f, 0.889257f, -0.171204f}, + {-0.805015f, 0.929169f, -0.056431f}, {-0.743215f, 0.953685f, -0.130043f}, + {-0.865650f, 0.862620f, -0.106504f}, {-0.805015f, 0.929169f, -0.056431f}, + {-0.808318f, 0.889257f, -0.171204f}, {-0.805015f, 0.929169f, -0.056431f}, + {-0.865650f, 0.862620f, -0.106504f}, {-0.896793f, 0.848784f, -0.027677f}, + {-0.756722f, 0.960121f, 0.071069f}, {-0.896793f, 0.848784f, -0.027677f}, + {-0.900574f, 0.847134f, 0.008831f}, {-0.896793f, 0.848784f, -0.027677f}, + {-0.756722f, 0.960121f, 0.071069f}, {-0.805015f, 0.929169f, -0.056431f}, + {-0.878808f, 0.856710f, 0.099709f}, {-0.756722f, 0.960121f, 0.071069f}, + {-0.900574f, 0.847134f, 0.008831f}, {-0.761481f, 0.910490f, 0.221616f}, + {-0.756722f, 0.960121f, 0.071069f}, {-0.878808f, 0.856710f, 0.099709f}, + {-0.756722f, 0.960121f, 0.071069f}, {-0.761481f, 0.910490f, 0.221616f}, + {-0.754114f, 0.949394f, 0.139330f}, {-0.761481f, 0.910490f, 0.221616f}, + {-0.653617f, 0.986254f, 0.171957f}, {-0.754114f, 0.949394f, 0.139330f}, + {-0.470619f, 1.014874f, 0.163578f}, {-0.618183f, 1.014147f, 0.008831f}, + {-0.498123f, 0.976199f, 0.254142f}, {-0.618183f, 1.014147f, 0.008831f}, + {-0.470619f, 1.014874f, 0.163578f}, {-0.472224f, 1.033508f, 0.008831f}, + {-0.559824f, 1.014232f, -0.120742f}, {-0.472224f, 1.033508f, 0.008831f}, + {-0.425596f, 1.026073f, -0.091742f}, {-0.472224f, 1.033508f, 0.008831f}, + {-0.559824f, 1.014232f, -0.120742f}, {-0.618183f, 1.014147f, 0.008831f}, + {-0.504029f, 1.007214f, -0.168846f}, {-0.743215f, 0.953685f, -0.130043f}, + {-0.559824f, 1.014232f, -0.120742f}, {-0.743215f, 0.953685f, -0.130043f}, + {-0.504029f, 1.007214f, -0.168846f}, {-0.723771f, 0.925663f, -0.219441f}, + {-0.685379f, 0.992249f, 0.085837f}, {-0.805015f, 0.929169f, -0.056431f}, + {-0.756722f, 0.960121f, 0.071069f}, {-0.805015f, 0.929169f, -0.056431f}, + {-0.685379f, 0.992249f, 0.085837f}, {-0.743215f, 0.953685f, -0.130043f}, + {-0.685379f, 0.992249f, 0.085837f}, {-0.756722f, 0.960121f, 0.071069f}, + {-0.754114f, 0.949394f, 0.139330f}, {-0.653617f, 0.986254f, 0.171957f}, + {-0.685379f, 0.992249f, 0.085837f}, {-0.754114f, 0.949394f, 0.139330f}, + {-0.498123f, 0.976199f, 0.254142f}, {-0.685379f, 0.992249f, 0.085837f}, + {-0.653617f, 0.986254f, 0.171957f}, {-0.618183f, 1.014147f, 0.008831f}, + {-0.685379f, 0.992249f, 0.085837f}, {-0.498123f, 0.976199f, 0.254142f}, + {-0.559824f, 1.014232f, -0.120742f}, {-0.685379f, 0.992249f, 0.085837f}, + {-0.618183f, 1.014147f, 0.008831f}, {-0.685379f, 0.992249f, 0.085837f}, + {-0.559824f, 1.014232f, -0.120742f}, {-0.743215f, 0.953685f, -0.130043f}, + {-0.913709f, 0.248567f, -0.048017f}, {-0.935086f, 0.373720f, -0.140379f}, + {-0.810726f, 0.143830f, -0.062953f}, {-0.810726f, 0.143830f, -0.062953f}, + {-0.816246f, 0.219594f, -0.137372f}, {-0.697237f, 0.190662f, -0.171178f}, + {-0.697237f, 0.190662f, -0.171178f}, {-0.499776f, 0.133654f, -0.150582f}, + {-0.600774f, 0.120701f, -0.133308f}, {-0.600774f, 0.120701f, -0.133308f}, + {-0.499776f, 0.133654f, -0.150582f}, {-0.569195f, 0.047207f, -0.105737f}, + {-0.590373f, 0.117014f, 0.149670f}, {-0.543369f, 0.227401f, 0.245080f}, + {-0.726777f, 0.165369f, 0.156838f}, {-0.824779f, 0.142876f, 0.066613f}, + {-0.970256f, 0.344040f, 0.008831f}, {-0.909153f, 0.230021f, 0.038237f}, + {-0.350603f, 0.093083f, 0.164192f}, {-0.426302f, 0.003976f, 0.129716f}, + {-0.475109f, 0.019966f, 0.128767f}, {-0.450839f, 0.043866f, -0.092489f}, + {-0.569195f, 0.047207f, -0.105737f}, {-0.600774f, 0.120701f, -0.133308f}, + {-0.816246f, 0.219594f, -0.137372f}, {-0.810726f, 0.143830f, -0.062953f}, + {-0.832357f, 0.336963f, -0.230141f}, {-0.832685f, 0.336639f, 0.247367f}, + {-0.824779f, 0.142876f, 0.066613f}, {-0.815154f, 0.196699f, 0.134399f}, + {-0.832357f, 0.336963f, -0.230141f}, {-0.810726f, 0.143830f, -0.062953f}, + {-0.935086f, 0.373720f, -0.140379f}, {-0.935086f, 0.373720f, -0.140379f}, + {-0.913709f, 0.248567f, -0.048017f}, {-0.964325f, 0.349059f, -0.050380f}, + {-0.913709f, 0.248567f, -0.048017f}, {-0.970256f, 0.344040f, 0.008831f}, + {-0.964325f, 0.349059f, -0.050380f}, {-0.970256f, 0.344040f, 0.008831f}, + {-0.824779f, 0.142876f, 0.066613f}, {-0.936187f, 0.372794f, 0.155570f}, + {-0.936187f, 0.372794f, 0.155570f}, {-0.824779f, 0.142876f, 0.066613f}, + {-0.832685f, 0.336639f, 0.247367f}, {-0.909153f, 0.230021f, 0.038237f}, + {-0.970256f, 0.344040f, 0.008831f}, {-0.913709f, 0.248567f, -0.048017f}, + {-0.547332f, -0.388743f, 0.063119f}, {-0.550079f, -0.398043f, 0.011138f}, + {-0.501412f, -0.488300f, 0.011196f}, {-0.497945f, -0.471270f, 0.097842f}, + {-0.545130f, -0.381469f, 0.080591f}, {-0.547332f, -0.388743f, 0.063119f}, + {-0.501412f, -0.488300f, 0.011196f}, {-0.497945f, -0.471270f, 0.097842f}, + {-0.547332f, -0.388743f, 0.063119f}, {-0.545130f, -0.381469f, 0.080591f}, + {-0.560722f, -0.349176f, 0.011072f}, {-0.547332f, -0.388743f, 0.063119f}, + {-0.560722f, -0.349176f, 0.011072f}, {-0.545130f, -0.381469f, 0.080591f}, + {-0.555103f, -0.332963f, 0.071434f}, {-0.547332f, -0.388743f, 0.063119f}, + {-0.560722f, -0.349176f, 0.011072f}, {-0.550079f, -0.398043f, 0.011138f}, + {-0.486613f, -0.419177f, 0.182356f}, {-0.545130f, -0.381469f, 0.080591f}, + {-0.493364f, -0.449554f, 0.140799f}, {-0.545130f, -0.381469f, 0.080591f}, + {-0.486613f, -0.419177f, 0.182356f}, {-0.528754f, -0.330569f, 0.148089f}, + {-0.493364f, -0.449554f, 0.140799f}, {-0.545130f, -0.381469f, 0.080591f}, + {-0.497945f, -0.471270f, 0.097842f}, {-0.515971f, -0.296022f, 0.177163f}, + {-0.477385f, -0.383358f, 0.220877f}, {-0.499401f, -0.258668f, 0.203390f}, + {-0.477385f, -0.383358f, 0.220877f}, {-0.528754f, -0.330569f, 0.148089f}, + {-0.486613f, -0.419177f, 0.182356f}, {-0.528754f, -0.330569f, 0.148089f}, + {-0.477385f, -0.383358f, 0.220877f}, {-0.515971f, -0.296022f, 0.177163f}, + {-0.368336f, -0.254687f, 0.378404f}, {-0.360789f, -0.182434f, 0.358609f}, + {-0.389042f, -0.124913f, 0.264001f}, {-0.389042f, -0.124913f, 0.264001f}, + {-0.421948f, -0.151893f, 0.259289f}, {-0.368336f, -0.254687f, 0.378404f}, + {-0.368336f, -0.254687f, 0.378404f}, {-0.451868f, -0.184248f, 0.246310f}, + {-0.424058f, -0.259452f, 0.324576f}, {-0.451868f, -0.184248f, 0.246310f}, + {-0.368336f, -0.254687f, 0.378404f}, {-0.421948f, -0.151893f, 0.259289f}, + {-0.327785f, -0.092566f, 0.250131f}, {-0.389042f, -0.124913f, 0.264001f}, + {-0.326741f, -0.154667f, 0.355902f}, {-0.389042f, -0.124913f, 0.264001f}, + {-0.360789f, -0.182434f, 0.358609f}, {-0.326741f, -0.154667f, 0.355902f}, + {-0.147168f, -0.085620f, 0.215947f}, {-0.111865f, -0.080516f, 0.168778f}, + {-0.203782f, -0.067624f, 0.150119f}, {-0.231992f, -0.070347f, 0.181147f}, + {-0.166414f, -0.088964f, 0.238733f}, {-0.147168f, -0.085620f, 0.215947f}, + {-0.203782f, -0.067624f, 0.150119f}, {-0.231992f, -0.070347f, 0.181147f}, + {-0.147168f, -0.085620f, 0.215947f}, {-0.179432f, -0.066110f, 0.116692f}, + {-0.111865f, -0.080516f, 0.168778f}, {-0.074181f, -0.074924f, 0.103180f}, + {-0.162304f, -0.065348f, 0.084402f}, {-0.179432f, -0.066110f, 0.116692f}, + {-0.074181f, -0.074924f, 0.103180f}, {-0.179432f, -0.066110f, 0.116692f}, + {-0.203782f, -0.067624f, 0.150119f}, {-0.111865f, -0.080516f, 0.168778f}, + {-0.058041f, -0.071582f, 0.051683f}, {-0.148016f, -0.064903f, 0.011139f}, + {-0.074181f, -0.074924f, 0.103180f}, {-0.074181f, -0.074924f, 0.103180f}, + {-0.148016f, -0.064903f, 0.011139f}, {-0.162304f, -0.065348f, 0.084402f}, + {-0.070942f, -0.074729f, -0.076541f}, {-0.149523f, -0.064983f, -0.019151f}, + {-0.057529f, -0.071583f, -0.027618f}, {-0.149523f, -0.064983f, -0.019151f}, + {-0.070942f, -0.074729f, -0.076541f}, {-0.159933f, -0.065380f, -0.058577f}, + {-0.057529f, -0.071583f, -0.027618f}, {-0.148016f, -0.064903f, 0.011139f}, + {-0.058041f, -0.071582f, 0.051683f}, {-0.148016f, -0.064903f, 0.011139f}, + {-0.057529f, -0.071583f, -0.027618f}, {-0.149523f, -0.064983f, -0.019151f}, + {-0.125219f, -0.083233f, -0.170020f}, {-0.201037f, -0.067664f, -0.127122f}, + {-0.070942f, -0.074729f, -0.076541f}, {-0.159933f, -0.065380f, -0.058577f}, + {-0.070942f, -0.074729f, -0.076541f}, {-0.201037f, -0.067664f, -0.127122f}, + {-0.202742f, -0.086092f, -0.217563f}, {-0.243362f, -0.072214f, -0.171929f}, + {-0.198765f, -0.079337f, -0.188027f}, {-0.297547f, -0.174158f, -0.365961f}, + {-0.360519f, -0.184392f, -0.340340f}, {-0.388213f, -0.126167f, -0.242428f}, + {-0.388213f, -0.126167f, -0.242428f}, {-0.358086f, -0.107641f, -0.238958f}, + {-0.297547f, -0.174158f, -0.365961f}, {-0.423572f, -0.261461f, -0.305663f}, + {-0.450836f, -0.185466f, -0.224737f}, {-0.368294f, -0.257902f, -0.361736f}, + {-0.368294f, -0.257902f, -0.361736f}, {-0.450836f, -0.185466f, -0.224737f}, + {-0.421068f, -0.153229f, -0.237698f}, {-0.388213f, -0.126167f, -0.242428f}, + {-0.360519f, -0.184392f, -0.340340f}, {-0.368294f, -0.257902f, -0.361736f}, + {-0.421068f, -0.153229f, -0.237698f}, {-0.388213f, -0.126167f, -0.242428f}, + {-0.368294f, -0.257902f, -0.361736f}, {-0.485707f, -0.422426f, -0.161048f}, + {-0.537555f, -0.360128f, -0.095471f}, {-0.476087f, -0.385187f, -0.201486f}, + {-0.476087f, -0.385187f, -0.201486f}, {-0.537555f, -0.360128f, -0.095471f}, + {-0.514781f, -0.296720f, -0.156380f}, {-0.476087f, -0.385187f, -0.201486f}, + {-0.514781f, -0.296720f, -0.156380f}, {-0.497319f, -0.257788f, -0.183325f}, + {-0.497077f, -0.470775f, -0.080759f}, {-0.544261f, -0.380273f, -0.062496f}, + {-0.492253f, -0.450493f, -0.121733f}, {-0.492253f, -0.450493f, -0.121733f}, + {-0.544261f, -0.380273f, -0.062496f}, {-0.537555f, -0.360128f, -0.095471f}, + {-0.492253f, -0.450493f, -0.121733f}, {-0.537555f, -0.360128f, -0.095471f}, + {-0.485707f, -0.422426f, -0.161048f}, {-0.501412f, -0.488300f, 0.011196f}, + {-0.550079f, -0.398043f, 0.011138f}, {-0.549727f, -0.396914f, -0.007060f}, + {-0.500334f, -0.483986f, -0.035067f}, {-0.501412f, -0.488300f, 0.011196f}, + {-0.549727f, -0.396914f, -0.007060f}, {-0.550079f, -0.398043f, 0.011138f}, + {-0.560722f, -0.349176f, 0.011072f}, {-0.549727f, -0.396914f, -0.007060f}, + {-0.549727f, -0.396914f, -0.007060f}, {-0.560722f, -0.349176f, 0.011072f}, + {-0.559234f, -0.344801f, -0.020738f}, {-0.549727f, -0.396914f, -0.007060f}, + {-0.559234f, -0.344801f, -0.020738f}, {-0.544261f, -0.380273f, -0.062496f}, + {-0.500334f, -0.483986f, -0.035067f}, {-0.549727f, -0.396914f, -0.007060f}, + {-0.544261f, -0.380273f, -0.062496f}, {-0.497077f, -0.470775f, -0.080759f}, + {-0.500334f, -0.483986f, -0.035067f}, {-0.544261f, -0.380273f, -0.062496f}, + {-0.341625f, -0.613177f, 0.116191f}, {-0.497945f, -0.471270f, 0.097842f}, + {-0.501412f, -0.488300f, 0.011196f}, {-0.342783f, -0.627706f, 0.011084f}, + {-0.341625f, -0.613177f, 0.116191f}, {-0.501412f, -0.488300f, 0.011196f}, + {-0.493364f, -0.449554f, 0.140799f}, {-0.497945f, -0.471270f, 0.097842f}, + {-0.341625f, -0.613177f, 0.116191f}, {-0.335468f, -0.568181f, 0.217848f}, + {-0.486613f, -0.419177f, 0.182356f}, {-0.493364f, -0.449554f, 0.140799f}, + {-0.341625f, -0.613177f, 0.116191f}, {-0.335468f, -0.568181f, 0.217848f}, + {-0.493364f, -0.449554f, 0.140799f}, {-0.477385f, -0.383358f, 0.220877f}, + {-0.486613f, -0.419177f, 0.182356f}, {-0.335468f, -0.568181f, 0.217848f}, + {-0.335468f, -0.568181f, 0.217848f}, {-0.318029f, -0.499234f, 0.306984f}, + {-0.399403f, -0.425711f, 0.292753f}, {-0.399403f, -0.425711f, 0.292753f}, + {-0.477385f, -0.383358f, 0.220877f}, {-0.335468f, -0.568181f, 0.217848f}, + {-0.277373f, -0.411288f, 0.380856f}, {-0.361743f, -0.337329f, 0.370439f}, + {-0.301072f, -0.456809f, 0.347211f}, {-0.446964f, -0.301290f, 0.293249f}, + {-0.361743f, -0.337329f, 0.370439f}, {-0.424058f, -0.259452f, 0.324576f}, + {-0.361743f, -0.337329f, 0.370439f}, {-0.477385f, -0.383358f, 0.220877f}, + {-0.399403f, -0.425711f, 0.292753f}, {-0.477385f, -0.383358f, 0.220877f}, + {-0.361743f, -0.337329f, 0.370439f}, {-0.446964f, -0.301290f, 0.293249f}, + {-0.301072f, -0.456809f, 0.347211f}, {-0.399403f, -0.425711f, 0.292753f}, + {-0.318029f, -0.499234f, 0.306984f}, {-0.399403f, -0.425711f, 0.292753f}, + {-0.301072f, -0.456809f, 0.347211f}, {-0.361743f, -0.337329f, 0.370439f}, + {-0.332758f, -0.213138f, 0.390733f}, {-0.360789f, -0.182434f, 0.358609f}, + {-0.351462f, -0.233598f, 0.386572f}, {-0.351462f, -0.233598f, 0.386572f}, + {-0.360789f, -0.182434f, 0.358609f}, {-0.368336f, -0.254687f, 0.378404f}, + {-0.368336f, -0.254687f, 0.378404f}, {-0.332791f, -0.291448f, 0.397380f}, + {-0.351462f, -0.233598f, 0.386572f}, {-0.361743f, -0.337329f, 0.370439f}, + {-0.332791f, -0.291448f, 0.397380f}, {-0.368336f, -0.254687f, 0.378404f}, + {-0.424058f, -0.259452f, 0.324576f}, {-0.361743f, -0.337329f, 0.370439f}, + {-0.368336f, -0.254687f, 0.378404f}, {-0.246428f, -0.363260f, 0.404451f}, + {-0.332791f, -0.291448f, 0.397380f}, {-0.361743f, -0.337329f, 0.370439f}, + {-0.361743f, -0.337329f, 0.370439f}, {-0.277373f, -0.411288f, 0.380856f}, + {-0.246428f, -0.363260f, 0.404451f}, {-0.332758f, -0.213138f, 0.390733f}, + {-0.326741f, -0.154667f, 0.355902f}, {-0.360789f, -0.182434f, 0.358609f}, + {0.105245f, -0.127328f, 0.122333f}, {0.064387f, -0.109897f, 0.119940f}, + {0.080289f, -0.135971f, 0.171230f}, {0.080289f, -0.135971f, 0.171230f}, + {0.064387f, -0.109897f, 0.119940f}, {0.046433f, -0.115236f, 0.155983f}, + {-0.019773f, -0.099603f, 0.173257f}, {0.046433f, -0.115236f, 0.155983f}, + {0.064387f, -0.109897f, 0.119940f}, {0.064387f, -0.109897f, 0.119940f}, + {0.019487f, -0.095112f, 0.116059f}, {-0.019773f, -0.099603f, 0.173257f}, + {0.019487f, -0.095112f, 0.116059f}, {-0.067799f, -0.090509f, 0.181699f}, + {-0.019773f, -0.099603f, 0.173257f}, {0.019487f, -0.095112f, 0.116059f}, + {-0.074181f, -0.074924f, 0.103180f}, {-0.067799f, -0.090509f, 0.181699f}, + {-0.074181f, -0.074924f, 0.103180f}, {-0.111865f, -0.080516f, 0.168778f}, + {-0.067799f, -0.090509f, 0.181699f}, {0.080289f, -0.135971f, 0.171230f}, + {0.046433f, -0.115236f, 0.155983f}, {0.004368f, -0.124361f, 0.220649f}, + {0.045404f, -0.146120f, 0.224543f}, {0.080289f, -0.135971f, 0.171230f}, + {0.004368f, -0.124361f, 0.220649f}, {0.004368f, -0.124361f, 0.220649f}, + {0.046433f, -0.115236f, 0.155983f}, {-0.019773f, -0.099603f, 0.173257f}, + {-0.058041f, -0.071582f, 0.051683f}, {-0.074181f, -0.074924f, 0.103180f}, + {0.019487f, -0.095112f, 0.116059f}, {0.040617f, -0.088053f, 0.011084f}, + {-0.058041f, -0.071582f, 0.051683f}, {0.019487f, -0.095112f, 0.116059f}, + {0.064387f, -0.109897f, 0.119940f}, {0.105245f, -0.127328f, 0.122333f}, + {0.126617f, -0.117726f, 0.011206f}, {0.040617f, -0.088053f, 0.011084f}, + {0.019487f, -0.095112f, 0.116059f}, {0.064387f, -0.109897f, 0.119940f}, + {0.126617f, -0.117726f, 0.011206f}, {0.040617f, -0.088053f, 0.011084f}, + {0.064387f, -0.109897f, 0.119940f}, {0.040617f, -0.088053f, 0.011084f}, + {0.023791f, -0.094983f, -0.088852f}, {-0.057529f, -0.071583f, -0.027618f}, + {0.023791f, -0.094983f, -0.088852f}, {-0.070942f, -0.074729f, -0.076541f}, + {-0.057529f, -0.071583f, -0.027618f}, {-0.057529f, -0.071583f, -0.027618f}, + {-0.058041f, -0.071582f, 0.051683f}, {0.040617f, -0.088053f, 0.011084f}, + {0.040617f, -0.088053f, 0.011084f}, {0.109742f, -0.127612f, -0.093903f}, + {0.023791f, -0.094983f, -0.088852f}, {0.109742f, -0.127612f, -0.093903f}, + {0.040617f, -0.088053f, 0.011084f}, {0.126617f, -0.117726f, 0.011206f}, + {0.000189f, -0.101606f, -0.138466f}, {-0.070942f, -0.074729f, -0.076541f}, + {0.023791f, -0.094983f, -0.088852f}, {0.086466f, -0.137432f, -0.143963f}, + {0.023791f, -0.094983f, -0.088852f}, {0.109742f, -0.127612f, -0.093903f}, + {0.023791f, -0.094983f, -0.088852f}, {0.086466f, -0.137432f, -0.143963f}, + {0.000189f, -0.101606f, -0.138466f}, {-0.297547f, -0.174158f, -0.365961f}, + {-0.332583f, -0.216149f, -0.374513f}, {-0.360519f, -0.184392f, -0.340340f}, + {-0.316237f, -0.379687f, -0.358090f}, {-0.359857f, -0.341236f, -0.352227f}, + {-0.331117f, -0.295393f, -0.379450f}, {-0.316237f, -0.379687f, -0.358090f}, + {-0.331117f, -0.295393f, -0.379450f}, {-0.286552f, -0.332472f, -0.383720f}, + {-0.270431f, -0.415366f, -0.356798f}, {-0.316237f, -0.379687f, -0.358090f}, + {-0.286552f, -0.332472f, -0.383720f}, {-0.331117f, -0.295393f, -0.379450f}, + {-0.359857f, -0.341236f, -0.352227f}, {-0.423572f, -0.261461f, -0.305663f}, + {-0.368294f, -0.257902f, -0.361736f}, {-0.331117f, -0.295393f, -0.379450f}, + {-0.423572f, -0.261461f, -0.305663f}, {-0.331117f, -0.295393f, -0.379450f}, + {-0.368294f, -0.257902f, -0.361736f}, {-0.332583f, -0.216149f, -0.374513f}, + {-0.360519f, -0.184392f, -0.340340f}, {-0.332583f, -0.216149f, -0.374513f}, + {-0.368294f, -0.257902f, -0.361736f}, {-0.310779f, -0.500492f, -0.286636f}, + {-0.396413f, -0.427564f, -0.275969f}, {-0.381031f, -0.385120f, -0.316489f}, + {-0.396413f, -0.427564f, -0.275969f}, {-0.476087f, -0.385187f, -0.201486f}, + {-0.381031f, -0.385120f, -0.316489f}, {-0.381031f, -0.385120f, -0.316489f}, + {-0.476087f, -0.385187f, -0.201486f}, {-0.423572f, -0.261461f, -0.305663f}, + {-0.381031f, -0.385120f, -0.316489f}, {-0.423572f, -0.261461f, -0.305663f}, + {-0.359857f, -0.341236f, -0.352227f}, {-0.316237f, -0.379687f, -0.358090f}, + {-0.270431f, -0.415366f, -0.356798f}, {-0.310779f, -0.500492f, -0.286636f}, + {-0.381031f, -0.385120f, -0.316489f}, {-0.359857f, -0.341236f, -0.352227f}, + {-0.316237f, -0.379687f, -0.358090f}, {-0.310779f, -0.500492f, -0.286636f}, + {-0.381031f, -0.385120f, -0.316489f}, {-0.316237f, -0.379687f, -0.358090f}, + {-0.396413f, -0.427564f, -0.275969f}, {-0.310779f, -0.500492f, -0.286636f}, + {-0.330254f, -0.571802f, -0.194693f}, {-0.330254f, -0.571802f, -0.194693f}, + {-0.485707f, -0.422426f, -0.161048f}, {-0.476087f, -0.385187f, -0.201486f}, + {-0.476087f, -0.385187f, -0.201486f}, {-0.396413f, -0.427564f, -0.275969f}, + {-0.330254f, -0.571802f, -0.194693f}, {-0.492253f, -0.450493f, -0.121733f}, + {-0.485707f, -0.422426f, -0.161048f}, {-0.330254f, -0.571802f, -0.194693f}, + {-0.339017f, -0.613021f, -0.099116f}, {-0.497077f, -0.470775f, -0.080759f}, + {-0.492253f, -0.450493f, -0.121733f}, {-0.330254f, -0.571802f, -0.194693f}, + {-0.339017f, -0.613021f, -0.099116f}, {-0.492253f, -0.450493f, -0.121733f}, + {-0.500334f, -0.483986f, -0.035067f}, {-0.497077f, -0.470775f, -0.080759f}, + {-0.339017f, -0.613021f, -0.099116f}, {-0.342783f, -0.627706f, 0.011084f}, + {-0.501412f, -0.488300f, 0.011196f}, {-0.500334f, -0.483986f, -0.035067f}, + {-0.339017f, -0.613021f, -0.099116f}, {-0.342783f, -0.627706f, 0.011084f}, + {-0.500334f, -0.483986f, -0.035067f}, {-0.168862f, -0.736367f, 0.119910f}, + {-0.342783f, -0.627706f, 0.011084f}, {-0.170794f, -0.750320f, 0.011127f}, + {-0.342783f, -0.627706f, 0.011084f}, {-0.168862f, -0.736367f, 0.119910f}, + {-0.341625f, -0.613177f, 0.116191f}, {-0.157275f, -0.695104f, 0.223596f}, + {-0.341625f, -0.613177f, 0.116191f}, {-0.168862f, -0.736367f, 0.119910f}, + {-0.341625f, -0.613177f, 0.116191f}, {-0.157275f, -0.695104f, 0.223596f}, + {-0.335468f, -0.568181f, 0.217848f}, {-0.130035f, -0.631608f, 0.306778f}, + {-0.335468f, -0.568181f, 0.217848f}, {-0.157275f, -0.695104f, 0.223596f}, + {-0.335468f, -0.568181f, 0.217848f}, {-0.130035f, -0.631608f, 0.306778f}, + {-0.318029f, -0.499234f, 0.306984f}, {-0.177641f, -0.480891f, 0.368749f}, + {-0.277373f, -0.411288f, 0.380856f}, {-0.301072f, -0.456809f, 0.347211f}, + {-0.301072f, -0.456809f, 0.347211f}, {-0.318029f, -0.499234f, 0.306984f}, + {-0.130035f, -0.631608f, 0.306778f}, {-0.130035f, -0.631608f, 0.306778f}, + {-0.077398f, -0.547866f, 0.359727f}, {-0.177641f, -0.480891f, 0.368749f}, + {-0.177641f, -0.480891f, 0.368749f}, {-0.301072f, -0.456809f, 0.347211f}, + {-0.130035f, -0.631608f, 0.306778f}, {-0.004625f, -0.457333f, 0.370803f}, + {-0.105466f, -0.386213f, 0.388652f}, {-0.042697f, -0.502379f, 0.370860f}, + {-0.042697f, -0.502379f, 0.370860f}, {-0.105466f, -0.386213f, 0.388652f}, + {-0.144161f, -0.433891f, 0.384889f}, {-0.144161f, -0.433891f, 0.384889f}, + {-0.277373f, -0.411288f, 0.380856f}, {-0.177641f, -0.480891f, 0.368749f}, + {-0.277373f, -0.411288f, 0.380856f}, {-0.144161f, -0.433891f, 0.384889f}, + {-0.246428f, -0.363260f, 0.404451f}, {-0.042697f, -0.502379f, 0.370860f}, + {-0.144161f, -0.433891f, 0.384889f}, {-0.077398f, -0.547866f, 0.359727f}, + {-0.077398f, -0.547866f, 0.359727f}, {-0.144161f, -0.433891f, 0.384889f}, + {-0.177641f, -0.480891f, 0.368749f}, {0.064971f, -0.385246f, 0.344817f}, + {0.017426f, -0.346902f, 0.352166f}, {0.047139f, -0.402582f, 0.354264f}, + {0.047139f, -0.402582f, 0.354264f}, {0.017426f, -0.346902f, 0.352166f}, + {0.029571f, -0.420403f, 0.361776f}, {0.137173f, -0.322251f, 0.289443f}, + {0.090711f, -0.222883f, 0.263048f}, {0.100829f, -0.352558f, 0.320623f}, + {0.100829f, -0.352558f, 0.320623f}, {0.090711f, -0.222883f, 0.263048f}, + {-0.005216f, -0.266256f, 0.343910f}, {0.202477f, -0.273317f, 0.214283f}, + {0.126724f, -0.204070f, 0.218727f}, {0.090711f, -0.222883f, 0.263048f}, + {0.202477f, -0.273317f, 0.214283f}, {0.090711f, -0.222883f, 0.263048f}, + {0.137173f, -0.322251f, 0.289443f}, {0.250232f, -0.240956f, 0.124853f}, + {0.181153f, -0.176556f, 0.124057f}, {0.229969f, -0.254352f, 0.170133f}, + {0.229969f, -0.254352f, 0.170133f}, {0.181153f, -0.176556f, 0.124057f}, + {0.158271f, -0.188463f, 0.170843f}, {0.181153f, -0.176556f, 0.124057f}, + {0.105245f, -0.127328f, 0.122333f}, {0.080289f, -0.135971f, 0.171230f}, + {0.158271f, -0.188463f, 0.170843f}, {0.181153f, -0.176556f, 0.124057f}, + {0.080289f, -0.135971f, 0.171230f}, {0.158271f, -0.188463f, 0.170843f}, + {0.080289f, -0.135971f, 0.171230f}, {0.045404f, -0.146120f, 0.224543f}, + {0.126724f, -0.204070f, 0.218727f}, {0.158271f, -0.188463f, 0.170843f}, + {0.045404f, -0.146120f, 0.224543f}, {0.229969f, -0.254352f, 0.170133f}, + {0.158271f, -0.188463f, 0.170843f}, {0.202477f, -0.273317f, 0.214283f}, + {0.202477f, -0.273317f, 0.214283f}, {0.158271f, -0.188463f, 0.170843f}, + {0.126724f, -0.204070f, 0.218727f}, {0.126617f, -0.117726f, 0.011206f}, + {0.105245f, -0.127328f, 0.122333f}, {0.181153f, -0.176556f, 0.124057f}, + {0.181153f, -0.176556f, 0.124057f}, {0.250232f, -0.240956f, 0.124853f}, + {0.268612f, -0.229703f, 0.011213f}, {0.126617f, -0.117726f, 0.011206f}, + {0.181153f, -0.176556f, 0.124057f}, {0.268612f, -0.229703f, 0.011213f}, + {0.255319f, -0.242254f, -0.097017f}, {0.126617f, -0.117726f, 0.011206f}, + {0.268612f, -0.229703f, 0.011213f}, {0.126617f, -0.117726f, 0.011206f}, + {0.255319f, -0.242254f, -0.097017f}, {0.109742f, -0.127612f, -0.093903f}, + {0.133485f, -0.207118f, -0.193611f}, {0.051721f, -0.148377f, -0.198787f}, + {0.086466f, -0.137432f, -0.143963f}, {0.086466f, -0.137432f, -0.143963f}, + {0.109742f, -0.127612f, -0.093903f}, {0.255319f, -0.242254f, -0.097017f}, + {0.255319f, -0.242254f, -0.097017f}, {0.210673f, -0.278437f, -0.190560f}, + {0.133485f, -0.207118f, -0.193611f}, {0.133485f, -0.207118f, -0.193611f}, + {0.086466f, -0.137432f, -0.143963f}, {0.255319f, -0.242254f, -0.097017f}, + {0.149091f, -0.327626f, -0.264295f}, {0.099286f, -0.226394f, -0.236522f}, + {0.181427f, -0.301468f, -0.229379f}, {0.099286f, -0.226394f, -0.236522f}, + {0.149091f, -0.327626f, -0.264295f}, {0.051779f, -0.246869f, -0.321229f}, + {0.181427f, -0.301468f, -0.229379f}, {0.133485f, -0.207118f, -0.193611f}, + {0.210673f, -0.278437f, -0.190560f}, {0.133485f, -0.207118f, -0.193611f}, + {0.181427f, -0.301468f, -0.229379f}, {0.099286f, -0.226394f, -0.236522f}, + {0.075309f, -0.393092f, -0.322131f}, {-0.005142f, -0.356243f, -0.339157f}, + {0.093577f, -0.375942f, -0.310486f}, {0.093577f, -0.375942f, -0.310486f}, + {0.065259f, -0.319680f, -0.302512f}, {0.149091f, -0.327626f, -0.264295f}, + {-0.029094f, -0.409284f, -0.350942f}, {-0.032181f, -0.509782f, -0.348797f}, + {-0.046569f, -0.428486f, -0.354151f}, {-0.046569f, -0.428486f, -0.354151f}, + {-0.052308f, -0.329493f, -0.359209f}, {-0.029094f, -0.409284f, -0.350942f}, + {-0.052308f, -0.329493f, -0.359209f}, {-0.046569f, -0.428486f, -0.354151f}, + {-0.136648f, -0.439410f, -0.360300f}, {-0.029094f, -0.409284f, -0.350942f}, + {-0.005142f, -0.356243f, -0.339157f}, {0.039885f, -0.428334f, -0.339342f}, + {-0.066672f, -0.554861f, -0.337899f}, {-0.136648f, -0.439410f, -0.360300f}, + {-0.032181f, -0.509782f, -0.348797f}, {-0.136648f, -0.439410f, -0.360300f}, + {-0.066672f, -0.554861f, -0.337899f}, {-0.170142f, -0.485858f, -0.344920f}, + {-0.270431f, -0.415366f, -0.356798f}, {-0.286552f, -0.332472f, -0.383720f}, + {-0.187485f, -0.404612f, -0.370293f}, {-0.187485f, -0.404612f, -0.370293f}, + {-0.136648f, -0.439410f, -0.360300f}, {-0.170142f, -0.485858f, -0.344920f}, + {-0.270431f, -0.415366f, -0.356798f}, {-0.187485f, -0.404612f, -0.370293f}, + {-0.170142f, -0.485858f, -0.344920f}, {-0.168986f, -0.380329f, -0.375081f}, + {-0.136648f, -0.439410f, -0.360300f}, {-0.187485f, -0.404612f, -0.370293f}, + {-0.136648f, -0.439410f, -0.360300f}, {-0.046569f, -0.428486f, -0.354151f}, + {-0.032181f, -0.509782f, -0.348797f}, {-0.310779f, -0.500492f, -0.286636f}, + {-0.270431f, -0.415366f, -0.356798f}, {-0.170142f, -0.485858f, -0.344920f}, + {-0.170142f, -0.485858f, -0.344920f}, {-0.066672f, -0.554861f, -0.337899f}, + {-0.118406f, -0.636644f, -0.287254f}, {-0.310779f, -0.500492f, -0.286636f}, + {-0.170142f, -0.485858f, -0.344920f}, {-0.118406f, -0.636644f, -0.287254f}, + {-0.148354f, -0.702664f, -0.200996f}, {-0.330254f, -0.571802f, -0.194693f}, + {-0.118406f, -0.636644f, -0.287254f}, {-0.118406f, -0.636644f, -0.287254f}, + {-0.330254f, -0.571802f, -0.194693f}, {-0.310779f, -0.500492f, -0.286636f}, + {-0.163792f, -0.738713f, -0.103214f}, {-0.339017f, -0.613021f, -0.099116f}, + {-0.148354f, -0.702664f, -0.200996f}, {-0.148354f, -0.702664f, -0.200996f}, + {-0.339017f, -0.613021f, -0.099116f}, {-0.330254f, -0.571802f, -0.194693f}, + {-0.170794f, -0.750320f, 0.011127f}, {-0.342783f, -0.627706f, 0.011084f}, + {-0.163792f, -0.738713f, -0.103214f}, {-0.163792f, -0.738713f, -0.103214f}, + {-0.342783f, -0.627706f, 0.011084f}, {-0.339017f, -0.613021f, -0.099116f}, + {0.021871f, -0.860812f, 0.116084f}, {-0.170794f, -0.750320f, 0.011127f}, + {0.019093f, -0.873822f, 0.010949f}, {-0.170794f, -0.750320f, 0.011127f}, + {0.021871f, -0.860812f, 0.116084f}, {-0.168862f, -0.736367f, 0.119910f}, + {0.038067f, -0.821837f, 0.216278f}, {-0.168862f, -0.736367f, 0.119910f}, + {0.021871f, -0.860812f, 0.116084f}, {-0.168862f, -0.736367f, 0.119910f}, + {0.038067f, -0.821837f, 0.216278f}, {-0.157275f, -0.695104f, 0.223596f}, + {0.071696f, -0.760990f, 0.295716f}, {-0.157275f, -0.695104f, 0.223596f}, + {0.038067f, -0.821837f, 0.216278f}, {-0.157275f, -0.695104f, 0.223596f}, + {0.071696f, -0.760990f, 0.295716f}, {-0.130035f, -0.631608f, 0.306778f}, + {0.126308f, -0.679929f, 0.344803f}, {-0.130035f, -0.631608f, 0.306778f}, + {0.071696f, -0.760990f, 0.295716f}, {-0.130035f, -0.631608f, 0.306778f}, + {0.126308f, -0.679929f, 0.344803f}, {-0.077398f, -0.547866f, 0.359727f}, + {0.092958f, -0.526013f, 0.364328f}, {-0.004625f, -0.457333f, 0.370803f}, + {-0.042697f, -0.502379f, 0.370860f}, {-0.042697f, -0.502379f, 0.370860f}, + {-0.077398f, -0.547866f, 0.359727f}, {0.126308f, -0.679929f, 0.344803f}, + {0.126308f, -0.679929f, 0.344803f}, {0.193603f, -0.592279f, 0.353649f}, + {0.092958f, -0.526013f, 0.364328f}, {0.092958f, -0.526013f, 0.364328f}, + {-0.042697f, -0.502379f, 0.370860f}, {0.126308f, -0.679929f, 0.344803f}, + {0.252808f, -0.522574f, 0.328424f}, {0.124713f, -0.490457f, 0.354959f}, + {0.223172f, -0.556659f, 0.344670f}, {0.047139f, -0.402582f, 0.354264f}, + {0.029571f, -0.420403f, 0.361776f}, {0.124713f, -0.490457f, 0.354959f}, + {0.124713f, -0.490457f, 0.354959f}, {0.064971f, -0.385246f, 0.344817f}, + {0.047139f, -0.402582f, 0.354264f}, {0.124713f, -0.490457f, 0.354959f}, + {0.029571f, -0.420403f, 0.361776f}, {0.092958f, -0.526013f, 0.364328f}, + {0.092958f, -0.526013f, 0.364328f}, {0.029571f, -0.420403f, 0.361776f}, + {-0.004625f, -0.457333f, 0.370803f}, {0.223172f, -0.556659f, 0.344670f}, + {0.124713f, -0.490457f, 0.354959f}, {0.193603f, -0.592279f, 0.353649f}, + {0.193603f, -0.592279f, 0.353649f}, {0.124713f, -0.490457f, 0.354959f}, + {0.092958f, -0.526013f, 0.364328f}, {0.282066f, -0.490450f, 0.305592f}, + {0.100829f, -0.352558f, 0.320623f}, {0.124713f, -0.490457f, 0.354959f}, + {0.100829f, -0.352558f, 0.320623f}, {0.064971f, -0.385246f, 0.344817f}, + {0.124713f, -0.490457f, 0.354959f}, {0.124713f, -0.490457f, 0.354959f}, + {0.252808f, -0.522574f, 0.328424f}, {0.282066f, -0.490450f, 0.305592f}, + {0.282066f, -0.490450f, 0.305592f}, {0.137173f, -0.322251f, 0.289443f}, + {0.100829f, -0.352558f, 0.320623f}, {0.137173f, -0.322251f, 0.289443f}, + {0.282066f, -0.490450f, 0.305592f}, {0.311144f, -0.459972f, 0.276415f}, + {0.202477f, -0.273317f, 0.214283f}, {0.338082f, -0.432901f, 0.243222f}, + {0.278345f, -0.344613f, 0.212043f}, {0.338082f, -0.432901f, 0.243222f}, + {0.362755f, -0.409030f, 0.206062f}, {0.278345f, -0.344613f, 0.212043f}, + {0.202477f, -0.273317f, 0.214283f}, {0.311144f, -0.459972f, 0.276415f}, + {0.338082f, -0.432901f, 0.243222f}, {0.311144f, -0.459972f, 0.276415f}, + {0.202477f, -0.273317f, 0.214283f}, {0.137173f, -0.322251f, 0.289443f}, + {0.384681f, -0.388667f, 0.164260f}, {0.401346f, -0.373992f, 0.120819f}, + {0.320534f, -0.311006f, 0.124348f}, {0.320534f, -0.311006f, 0.124348f}, + {0.302481f, -0.324884f, 0.169041f}, {0.384681f, -0.388667f, 0.164260f}, + {0.320534f, -0.311006f, 0.124348f}, {0.250232f, -0.240956f, 0.124853f}, + {0.302481f, -0.324884f, 0.169041f}, {0.302481f, -0.324884f, 0.169041f}, + {0.250232f, -0.240956f, 0.124853f}, {0.229969f, -0.254352f, 0.170133f}, + {0.302481f, -0.324884f, 0.169041f}, {0.229969f, -0.254352f, 0.170133f}, + {0.278345f, -0.344613f, 0.212043f}, {0.278345f, -0.344613f, 0.212043f}, + {0.229969f, -0.254352f, 0.170133f}, {0.202477f, -0.273317f, 0.214283f}, + {0.384681f, -0.388667f, 0.164260f}, {0.302481f, -0.324884f, 0.169041f}, + {0.362755f, -0.409030f, 0.206062f}, {0.362755f, -0.409030f, 0.206062f}, + {0.302481f, -0.324884f, 0.169041f}, {0.278345f, -0.344613f, 0.212043f}, + {0.320534f, -0.311006f, 0.124348f}, {0.401346f, -0.373992f, 0.120819f}, + {0.417136f, -0.361486f, 0.011309f}, {0.268612f, -0.229703f, 0.011213f}, + {0.250232f, -0.240956f, 0.124853f}, {0.320534f, -0.311006f, 0.124348f}, + {0.320534f, -0.311006f, 0.124348f}, {0.417136f, -0.361486f, 0.011309f}, + {0.268612f, -0.229703f, 0.011213f}, {0.408641f, -0.376017f, -0.092199f}, + {0.268612f, -0.229703f, 0.011213f}, {0.417136f, -0.361486f, 0.011309f}, + {0.268612f, -0.229703f, 0.011213f}, {0.408641f, -0.376017f, -0.092199f}, + {0.255319f, -0.242254f, -0.097017f}, {0.255319f, -0.242254f, -0.097017f}, + {0.408641f, -0.376017f, -0.092199f}, {0.395967f, -0.393034f, -0.137406f}, + {0.210673f, -0.278437f, -0.190560f}, {0.255319f, -0.242254f, -0.097017f}, + {0.395967f, -0.393034f, -0.137406f}, {0.181427f, -0.301468f, -0.229379f}, + {0.354045f, -0.440030f, -0.216989f}, {0.235734f, -0.401509f, -0.258827f}, + {0.354045f, -0.440030f, -0.216989f}, {0.328839f, -0.467111f, -0.249364f}, + {0.235734f, -0.401509f, -0.258827f}, {0.235734f, -0.401509f, -0.258827f}, + {0.149091f, -0.327626f, -0.264295f}, {0.181427f, -0.301468f, -0.229379f}, + {0.181427f, -0.301468f, -0.229379f}, {0.210673f, -0.278437f, -0.190560f}, + {0.354045f, -0.440030f, -0.216989f}, {0.354045f, -0.440030f, -0.216989f}, + {0.210673f, -0.278437f, -0.190560f}, {0.395967f, -0.393034f, -0.137406f}, + {0.239839f, -0.567318f, -0.319538f}, {0.203163f, -0.432978f, -0.290261f}, + {0.299352f, -0.499207f, -0.279647f}, {0.203163f, -0.432978f, -0.290261f}, + {0.239839f, -0.567318f, -0.319538f}, {0.170466f, -0.466029f, -0.314782f}, + {0.093577f, -0.375942f, -0.310486f}, {0.149091f, -0.327626f, -0.264295f}, + {0.203163f, -0.432978f, -0.290261f}, {0.170466f, -0.466029f, -0.314782f}, + {0.075309f, -0.393092f, -0.322131f}, {0.093577f, -0.375942f, -0.310486f}, + {0.203163f, -0.432978f, -0.290261f}, {0.170466f, -0.466029f, -0.314782f}, + {0.093577f, -0.375942f, -0.310486f}, {0.203163f, -0.432978f, -0.290261f}, + {0.149091f, -0.327626f, -0.264295f}, {0.235734f, -0.401509f, -0.258827f}, + {0.299352f, -0.499207f, -0.279647f}, {0.235734f, -0.401509f, -0.258827f}, + {0.328839f, -0.467111f, -0.249364f}, {0.235734f, -0.401509f, -0.258827f}, + {0.299352f, -0.499207f, -0.279647f}, {0.203163f, -0.432978f, -0.290261f}, + {0.210298f, -0.603129f, -0.328548f}, {0.138377f, -0.500197f, -0.331799f}, + {0.239839f, -0.567318f, -0.319538f}, {0.138377f, -0.500197f, -0.331799f}, + {0.210298f, -0.603129f, -0.328548f}, {0.106767f, -0.535860f, -0.341259f}, + {-0.029094f, -0.409284f, -0.350942f}, {0.039885f, -0.428334f, -0.339342f}, + {0.138377f, -0.500197f, -0.331799f}, {0.106767f, -0.535860f, -0.341259f}, + {-0.032181f, -0.509782f, -0.348797f}, {-0.029094f, -0.409284f, -0.350942f}, + {0.138377f, -0.500197f, -0.331799f}, {0.106767f, -0.535860f, -0.341259f}, + {-0.029094f, -0.409284f, -0.350942f}, {0.039885f, -0.428334f, -0.339342f}, + {0.075309f, -0.393092f, -0.322131f}, {0.170466f, -0.466029f, -0.314782f}, + {0.170466f, -0.466029f, -0.314782f}, {0.138377f, -0.500197f, -0.331799f}, + {0.039885f, -0.428334f, -0.339342f}, {0.170466f, -0.466029f, -0.314782f}, + {0.239839f, -0.567318f, -0.319538f}, {0.138377f, -0.500197f, -0.331799f}, + {0.106767f, -0.535860f, -0.341259f}, {0.210298f, -0.603129f, -0.328548f}, + {0.143614f, -0.690113f, -0.319882f}, {0.143614f, -0.690113f, -0.319882f}, + {-0.066672f, -0.554861f, -0.337899f}, {-0.032181f, -0.509782f, -0.348797f}, + {-0.032181f, -0.509782f, -0.348797f}, {0.106767f, -0.535860f, -0.341259f}, + {0.143614f, -0.690113f, -0.319882f}, {0.090455f, -0.768783f, -0.273230f}, + {-0.118406f, -0.636644f, -0.287254f}, {0.143614f, -0.690113f, -0.319882f}, + {0.143614f, -0.690113f, -0.319882f}, {-0.118406f, -0.636644f, -0.287254f}, + {-0.066672f, -0.554861f, -0.337899f}, {0.053516f, -0.831094f, -0.191752f}, + {-0.148354f, -0.702664f, -0.200996f}, {0.090455f, -0.768783f, -0.273230f}, + {0.090455f, -0.768783f, -0.273230f}, {-0.148354f, -0.702664f, -0.200996f}, + {-0.118406f, -0.636644f, -0.287254f}, {0.030425f, -0.863922f, -0.098354f}, + {-0.163792f, -0.738713f, -0.103214f}, {0.053516f, -0.831094f, -0.191752f}, + {0.053516f, -0.831094f, -0.191752f}, {-0.163792f, -0.738713f, -0.103214f}, + {-0.148354f, -0.702664f, -0.200996f}, {0.019093f, -0.873822f, 0.010949f}, + {-0.163792f, -0.738713f, -0.103214f}, {0.030425f, -0.863922f, -0.098354f}, + {-0.163792f, -0.738713f, -0.103214f}, {0.019093f, -0.873822f, 0.010949f}, + {-0.170794f, -0.750320f, 0.011127f}, {0.198877f, -0.949927f, 0.108911f}, + {0.019093f, -0.873822f, 0.010949f}, {0.195592f, -0.963238f, 0.011117f}, + {0.019093f, -0.873822f, 0.010949f}, {0.198877f, -0.949927f, 0.108911f}, + {0.021871f, -0.860812f, 0.116084f}, {0.217919f, -0.911539f, 0.202049f}, + {0.021871f, -0.860812f, 0.116084f}, {0.198877f, -0.949927f, 0.108911f}, + {0.021871f, -0.860812f, 0.116084f}, {0.217919f, -0.911539f, 0.202049f}, + {0.038067f, -0.821837f, 0.216278f}, {0.255789f, -0.852713f, 0.275299f}, + {0.038067f, -0.821837f, 0.216278f}, {0.217919f, -0.911539f, 0.202049f}, + {0.038067f, -0.821837f, 0.216278f}, {0.255789f, -0.852713f, 0.275299f}, + {0.071696f, -0.760990f, 0.295716f}, {0.312412f, -0.771638f, 0.320289f}, + {0.126308f, -0.679929f, 0.344803f}, {0.255789f, -0.852713f, 0.275299f}, + {0.255789f, -0.852713f, 0.275299f}, {0.126308f, -0.679929f, 0.344803f}, + {0.071696f, -0.760990f, 0.295716f}, {0.377954f, -0.680866f, 0.328231f}, + {0.193603f, -0.592279f, 0.353649f}, {0.312412f, -0.771638f, 0.320289f}, + {0.312412f, -0.771638f, 0.320289f}, {0.193603f, -0.592279f, 0.353649f}, + {0.126308f, -0.679929f, 0.344803f}, {0.418586f, -0.517778f, 0.265251f}, + {0.311144f, -0.459972f, 0.276415f}, {0.367921f, -0.536689f, 0.293184f}, + {0.367921f, -0.536689f, 0.293184f}, {0.311144f, -0.459972f, 0.276415f}, + {0.282066f, -0.490450f, 0.305592f}, {0.367921f, -0.536689f, 0.293184f}, + {0.282066f, -0.490450f, 0.305592f}, {0.340174f, -0.570143f, 0.314960f}, + {0.340174f, -0.570143f, 0.314960f}, {0.282066f, -0.490450f, 0.305592f}, + {0.252808f, -0.522574f, 0.328424f}, {0.440027f, -0.395373f, 0.118574f}, + {0.401346f, -0.373992f, 0.120819f}, {0.464039f, -0.418657f, 0.141699f}, + {0.464039f, -0.418657f, 0.141699f}, {0.401346f, -0.373992f, 0.120819f}, + {0.384681f, -0.388667f, 0.164260f}, {0.489372f, -0.414605f, -0.087908f}, + {0.496337f, -0.400178f, 0.011387f}, {0.600226f, -0.471206f, -0.122602f}, + {0.496337f, -0.400178f, 0.011387f}, {0.578564f, -0.431239f, 0.056949f}, + {0.600226f, -0.471206f, -0.122602f}, {0.489372f, -0.414605f, -0.087908f}, + {0.417136f, -0.361486f, 0.011309f}, {0.496337f, -0.400178f, 0.011387f}, + {0.417136f, -0.361486f, 0.011309f}, {0.489372f, -0.414605f, -0.087908f}, + {0.408641f, -0.376017f, -0.092199f}, {0.460483f, -0.455762f, -0.172921f}, + {0.408641f, -0.376017f, -0.092199f}, {0.489372f, -0.414605f, -0.087908f}, + {0.408641f, -0.376017f, -0.092199f}, {0.460483f, -0.455762f, -0.172921f}, + {0.395967f, -0.393034f, -0.137406f}, {0.460483f, -0.455762f, -0.172921f}, + {0.489372f, -0.414605f, -0.087908f}, {0.600226f, -0.471206f, -0.122602f}, + {0.416254f, -0.510086f, -0.238332f}, {0.354045f, -0.440030f, -0.216989f}, + {0.478382f, -0.512709f, -0.219323f}, {0.354045f, -0.440030f, -0.216989f}, + {0.416254f, -0.510086f, -0.238332f}, {0.328839f, -0.467111f, -0.249364f}, + {0.478382f, -0.512709f, -0.219323f}, {0.395967f, -0.393034f, -0.137406f}, + {0.460483f, -0.455762f, -0.172921f}, {0.395967f, -0.393034f, -0.137406f}, + {0.478382f, -0.512709f, -0.219323f}, {0.354045f, -0.440030f, -0.216989f}, + {0.239839f, -0.567318f, -0.319538f}, {0.299352f, -0.499207f, -0.279647f}, + {0.388471f, -0.543888f, -0.267182f}, {0.388471f, -0.543888f, -0.267182f}, + {0.328839f, -0.467111f, -0.249364f}, {0.416254f, -0.510086f, -0.238332f}, + {0.328839f, -0.467111f, -0.249364f}, {0.388471f, -0.543888f, -0.267182f}, + {0.299352f, -0.499207f, -0.279647f}, {0.394032f, -0.615157f, -0.293048f}, + {0.472991f, -0.630213f, -0.286776f}, {0.401041f, -0.689464f, -0.303962f}, + {0.303234f, -0.651611f, -0.313823f}, {0.331758f, -0.614794f, -0.305214f}, + {0.394032f, -0.615157f, -0.293048f}, {0.394032f, -0.615157f, -0.293048f}, + {0.401041f, -0.689464f, -0.303962f}, {0.303234f, -0.651611f, -0.313823f}, + {0.303234f, -0.651611f, -0.313823f}, {0.239839f, -0.567318f, -0.319538f}, + {0.331758f, -0.614794f, -0.305214f}, {0.239839f, -0.567318f, -0.319538f}, + {0.303234f, -0.651611f, -0.313823f}, {0.210298f, -0.603129f, -0.328548f}, + {0.239839f, -0.567318f, -0.319538f}, {0.388471f, -0.543888f, -0.267182f}, + {0.331758f, -0.614794f, -0.305214f}, {0.388471f, -0.543888f, -0.267182f}, + {0.394032f, -0.615157f, -0.293048f}, {0.331758f, -0.614794f, -0.305214f}, + {0.303234f, -0.651611f, -0.313823f}, {0.401041f, -0.689464f, -0.303962f}, + {0.368102f, -0.735134f, -0.304811f}, {0.368102f, -0.735134f, -0.304811f}, + {0.335687f, -0.780497f, -0.296099f}, {0.143614f, -0.690113f, -0.319882f}, + {0.143614f, -0.690113f, -0.319882f}, {0.210298f, -0.603129f, -0.328548f}, + {0.303234f, -0.651611f, -0.313823f}, {0.303234f, -0.651611f, -0.313823f}, + {0.368102f, -0.735134f, -0.304811f}, {0.143614f, -0.690113f, -0.319882f}, + {0.280025f, -0.860182f, -0.253183f}, {0.143614f, -0.690113f, -0.319882f}, + {0.335687f, -0.780497f, -0.296099f}, {0.143614f, -0.690113f, -0.319882f}, + {0.280025f, -0.860182f, -0.253183f}, {0.090455f, -0.768783f, -0.273230f}, + {0.237553f, -0.921077f, -0.177884f}, {0.090455f, -0.768783f, -0.273230f}, + {0.280025f, -0.860182f, -0.253183f}, {0.090455f, -0.768783f, -0.273230f}, + {0.237553f, -0.921077f, -0.177884f}, {0.053516f, -0.831094f, -0.191752f}, + {0.209422f, -0.953038f, -0.090887f}, {0.053516f, -0.831094f, -0.191752f}, + {0.237553f, -0.921077f, -0.177884f}, {0.053516f, -0.831094f, -0.191752f}, + {0.209422f, -0.953038f, -0.090887f}, {0.030425f, -0.863922f, -0.098354f}, + {0.195592f, -0.963238f, 0.011117f}, {0.030425f, -0.863922f, -0.098354f}, + {0.209422f, -0.953038f, -0.090887f}, {0.030425f, -0.863922f, -0.098354f}, + {0.195592f, -0.963238f, 0.011117f}, {0.019093f, -0.873822f, 0.010949f}, + {0.413555f, -1.020967f, 0.099800f}, {0.195592f, -0.963238f, 0.011117f}, + {0.409885f, -1.028627f, 0.011343f}, {0.195592f, -0.963238f, 0.011117f}, + {0.413555f, -1.020967f, 0.099800f}, {0.198877f, -0.949927f, 0.108911f}, + {0.435744f, -0.995293f, 0.184588f}, {0.217919f, -0.911539f, 0.202049f}, + {0.413555f, -1.020967f, 0.099800f}, {0.413555f, -1.020967f, 0.099800f}, + {0.217919f, -0.911539f, 0.202049f}, {0.198877f, -0.949927f, 0.108911f}, + {0.478132f, -0.946687f, 0.250943f}, {0.255789f, -0.852713f, 0.275299f}, + {0.435744f, -0.995293f, 0.184588f}, {0.435744f, -0.995293f, 0.184588f}, + {0.255789f, -0.852713f, 0.275299f}, {0.217919f, -0.911539f, 0.202049f}, + {0.534351f, -0.873781f, 0.291707f}, {0.312412f, -0.771638f, 0.320289f}, + {0.478132f, -0.946687f, 0.250943f}, {0.478132f, -0.946687f, 0.250943f}, + {0.312412f, -0.771638f, 0.320289f}, {0.255789f, -0.852713f, 0.275299f}, + {0.490049f, -0.728040f, 0.317341f}, {0.377954f, -0.680866f, 0.328231f}, + {0.312412f, -0.771638f, 0.320289f}, {0.534351f, -0.873781f, 0.291707f}, + {0.592498f, -0.788204f, 0.299064f}, {0.490049f, -0.728040f, 0.317341f}, + {0.312412f, -0.771638f, 0.320289f}, {0.534351f, -0.873781f, 0.291707f}, + {0.490049f, -0.728040f, 0.317341f}, {0.534812f, -0.654828f, 0.297562f}, + {0.405685f, -0.643118f, 0.319928f}, {0.490049f, -0.728040f, 0.317341f}, + {0.490049f, -0.728040f, 0.317341f}, {0.405685f, -0.643118f, 0.319928f}, + {0.377954f, -0.680866f, 0.328231f}, {0.615209f, -0.751537f, 0.291641f}, + {0.534812f, -0.654828f, 0.297562f}, {0.592498f, -0.788204f, 0.299064f}, + {0.592498f, -0.788204f, 0.299064f}, {0.534812f, -0.654828f, 0.297562f}, + {0.490049f, -0.728040f, 0.317341f}, {0.720657f, -0.563569f, -0.126581f}, + {0.600226f, -0.471206f, -0.122602f}, {0.738879f, -0.537016f, -0.026636f}, + {0.668793f, -0.472827f, 0.054810f}, {0.600226f, -0.471206f, -0.122602f}, + {0.578564f, -0.431239f, 0.056949f}, {0.738879f, -0.537016f, -0.026636f}, + {0.600226f, -0.471206f, -0.122602f}, {0.737736f, -0.534172f, 0.053169f}, + {0.737736f, -0.534172f, 0.053169f}, {0.600226f, -0.471206f, -0.122602f}, + {0.668793f, -0.472827f, 0.054810f}, {0.613783f, -0.805559f, -0.269572f}, + {0.596126f, -0.724274f, -0.272534f}, {0.624854f, -0.787610f, -0.266611f}, + {0.624854f, -0.787610f, -0.266611f}, {0.596126f, -0.724274f, -0.272534f}, + {0.623118f, -0.726832f, -0.262889f}, {0.368102f, -0.735134f, -0.304811f}, + {0.449892f, -0.829966f, -0.285116f}, {0.335687f, -0.780497f, -0.296099f}, + {0.468667f, -0.664724f, -0.291909f}, {0.512534f, -0.739842f, -0.292882f}, + {0.449892f, -0.829966f, -0.285116f}, {0.368102f, -0.735134f, -0.304811f}, + {0.401041f, -0.689464f, -0.303962f}, {0.468667f, -0.664724f, -0.291909f}, + {0.449892f, -0.829966f, -0.285116f}, {0.368102f, -0.735134f, -0.304811f}, + {0.468667f, -0.664724f, -0.291909f}, {0.596126f, -0.724274f, -0.272534f}, + {0.613783f, -0.805559f, -0.269572f}, {0.586448f, -0.847414f, -0.270350f}, + {0.449892f, -0.829966f, -0.285116f}, {0.512534f, -0.739842f, -0.292882f}, + {0.596126f, -0.724274f, -0.272534f}, {0.586448f, -0.847414f, -0.270350f}, + {0.449892f, -0.829966f, -0.285116f}, {0.596126f, -0.724274f, -0.272534f}, + {0.449892f, -0.829966f, -0.285116f}, {0.586448f, -0.847414f, -0.270350f}, + {0.504289f, -0.956408f, -0.224492f}, {0.280025f, -0.860182f, -0.253183f}, + {0.335687f, -0.780497f, -0.296099f}, {0.449892f, -0.829966f, -0.285116f}, + {0.449892f, -0.829966f, -0.285116f}, {0.504289f, -0.956408f, -0.224492f}, + {0.280025f, -0.860182f, -0.253183f}, {0.280025f, -0.860182f, -0.253183f}, + {0.504289f, -0.956408f, -0.224492f}, {0.479698f, -0.983592f, -0.193867f}, + {0.237553f, -0.921077f, -0.177884f}, {0.280025f, -0.860182f, -0.253183f}, + {0.479698f, -0.983592f, -0.193867f}, {0.237553f, -0.921077f, -0.177884f}, + {0.479698f, -0.983592f, -0.193867f}, {0.425486f, -1.025458f, -0.079576f}, + {0.209422f, -0.953038f, -0.090887f}, {0.237553f, -0.921077f, -0.177884f}, + {0.425486f, -1.025458f, -0.079576f}, {0.409885f, -1.028627f, 0.011343f}, + {0.209422f, -0.953038f, -0.090887f}, {0.425486f, -1.025458f, -0.079576f}, + {0.209422f, -0.953038f, -0.090887f}, {0.409885f, -1.028627f, 0.011343f}, + {0.195592f, -0.963238f, 0.011117f}, {0.622828f, -1.010850f, 0.039370f}, + {0.621666f, -1.020964f, 0.103462f}, {0.413555f, -1.020967f, 0.099800f}, + {0.413555f, -1.020967f, 0.099800f}, {0.409885f, -1.028627f, 0.011343f}, + {0.622828f, -1.010850f, 0.039370f}, {0.621666f, -1.020964f, 0.103462f}, + {0.642121f, -1.011563f, 0.157687f}, {0.435744f, -0.995293f, 0.184588f}, + {0.435744f, -0.995293f, 0.184588f}, {0.413555f, -1.020967f, 0.099800f}, + {0.621666f, -1.020964f, 0.103462f}, {0.478132f, -0.946687f, 0.250943f}, + {0.435744f, -0.995293f, 0.184588f}, {0.642121f, -1.011563f, 0.157687f}, + {0.677433f, -0.978595f, 0.194888f}, {0.696335f, -0.955003f, 0.205747f}, + {0.534351f, -0.873781f, 0.291707f}, {0.478132f, -0.946687f, 0.250943f}, + {0.642121f, -1.011563f, 0.157687f}, {0.677433f, -0.978595f, 0.194888f}, + {0.534351f, -0.873781f, 0.291707f}, {0.478132f, -0.946687f, 0.250943f}, + {0.677433f, -0.978595f, 0.194888f}, {0.696335f, -0.955003f, 0.205747f}, + {0.731104f, -0.899784f, 0.210321f}, {0.592498f, -0.788204f, 0.299064f}, + {0.592498f, -0.788204f, 0.299064f}, {0.534351f, -0.873781f, 0.291707f}, + {0.696335f, -0.955003f, 0.205747f}, {0.615209f, -0.751537f, 0.291641f}, + {0.731104f, -0.899784f, 0.210321f}, {0.701557f, -0.782319f, 0.248627f}, + {0.731104f, -0.899784f, 0.210321f}, {0.754234f, -0.849776f, 0.195999f}, + {0.701557f, -0.782319f, 0.248627f}, {0.701557f, -0.782319f, 0.248627f}, + {0.636516f, -0.715392f, 0.278183f}, {0.615209f, -0.751537f, 0.291641f}, + {0.615209f, -0.751537f, 0.291641f}, {0.592498f, -0.788204f, 0.299064f}, + {0.731104f, -0.899784f, 0.210321f}, {0.716496f, -0.750669f, 0.231711f}, + {0.656324f, -0.680370f, 0.259240f}, {0.636516f, -0.715392f, 0.278183f}, + {0.701557f, -0.782319f, 0.248627f}, {0.716496f, -0.750669f, 0.231711f}, + {0.636516f, -0.715392f, 0.278183f}, {0.763638f, -0.824658f, 0.183142f}, + {0.701557f, -0.782319f, 0.248627f}, {0.754234f, -0.849776f, 0.195999f}, + {0.701557f, -0.782319f, 0.248627f}, {0.763638f, -0.824658f, 0.183142f}, + {0.716496f, -0.750669f, 0.231711f}, {0.790792f, -0.735889f, 0.101690f}, + {0.752845f, -0.664541f, 0.158286f}, {0.742165f, -0.690772f, 0.185737f}, + {0.778968f, -0.776051f, 0.147898f}, {0.790792f, -0.735889f, 0.101690f}, + {0.742165f, -0.690772f, 0.185737f}, {0.778968f, -0.776051f, 0.147898f}, + {0.716496f, -0.750669f, 0.231711f}, {0.763638f, -0.824658f, 0.183142f}, + {0.716496f, -0.750669f, 0.231711f}, {0.778968f, -0.776051f, 0.147898f}, + {0.742165f, -0.690772f, 0.185737f}, {0.799994f, -0.711662f, 0.038060f}, + {0.770297f, -0.623219f, 0.094728f}, {0.790792f, -0.735889f, 0.101690f}, + {0.770297f, -0.623219f, 0.094728f}, {0.799994f, -0.711662f, 0.038060f}, + {0.777168f, -0.609113f, 0.049431f}, {0.798869f, -0.735644f, -0.045503f}, + {0.778146f, -0.612369f, -0.021031f}, {0.800574f, -0.714476f, -0.014567f}, + {0.774117f, -0.644992f, -0.078104f}, {0.720657f, -0.563569f, -0.126581f}, + {0.738879f, -0.537016f, -0.026636f}, {0.738879f, -0.537016f, -0.026636f}, + {0.778146f, -0.612369f, -0.021031f}, {0.774117f, -0.644992f, -0.078104f}, + {0.778146f, -0.612369f, -0.021031f}, {0.738879f, -0.537016f, -0.026636f}, + {0.777168f, -0.609113f, 0.049431f}, {0.777168f, -0.609113f, 0.049431f}, + {0.738879f, -0.537016f, -0.026636f}, {0.737736f, -0.534172f, 0.053169f}, + {0.800574f, -0.714476f, -0.014567f}, {0.778146f, -0.612369f, -0.021031f}, + {0.799994f, -0.711662f, 0.038060f}, {0.799994f, -0.711662f, 0.038060f}, + {0.778146f, -0.612369f, -0.021031f}, {0.777168f, -0.609113f, 0.049431f}, + {0.796312f, -0.759138f, -0.070088f}, {0.797256f, -0.823745f, -0.069483f}, + {0.768696f, -0.671546f, -0.109799f}, {0.774117f, -0.644992f, -0.078104f}, + {0.778146f, -0.612369f, -0.021031f}, {0.798869f, -0.735644f, -0.045503f}, + {0.796312f, -0.759138f, -0.070088f}, {0.768696f, -0.671546f, -0.109799f}, + {0.774117f, -0.644992f, -0.078104f}, {0.798869f, -0.735644f, -0.045503f}, + {0.796312f, -0.759138f, -0.070088f}, {0.774117f, -0.644992f, -0.078104f}, + {0.734784f, -0.771894f, -0.194041f}, {0.756868f, -0.712629f, -0.150208f}, + {0.797256f, -0.823745f, -0.069483f}, {0.756868f, -0.712629f, -0.150208f}, + {0.768696f, -0.671546f, -0.109799f}, {0.797256f, -0.823745f, -0.069483f}, + {0.705973f, -0.834184f, -0.222231f}, {0.734784f, -0.771894f, -0.194041f}, + {0.750992f, -0.910564f, -0.159361f}, {0.780059f, -0.836025f, -0.131824f}, + {0.750992f, -0.910564f, -0.159361f}, {0.734784f, -0.771894f, -0.194041f}, + {0.734784f, -0.771894f, -0.194041f}, {0.797256f, -0.823745f, -0.069483f}, + {0.780059f, -0.836025f, -0.131824f}, {0.689263f, -0.864797f, -0.228743f}, + {0.705973f, -0.834184f, -0.222231f}, {0.750992f, -0.910564f, -0.159361f}, + {0.624854f, -0.787610f, -0.266611f}, {0.623118f, -0.726832f, -0.262889f}, + {0.705973f, -0.834184f, -0.222231f}, {0.689263f, -0.864797f, -0.228743f}, + {0.613783f, -0.805559f, -0.269572f}, {0.624854f, -0.787610f, -0.266611f}, + {0.705973f, -0.834184f, -0.222231f}, {0.689263f, -0.864797f, -0.228743f}, + {0.624854f, -0.787610f, -0.266611f}, {0.620851f, -0.963088f, -0.210127f}, + {0.667539f, -0.899978f, -0.229579f}, {0.724016f, -0.954800f, -0.154705f}, + {0.620851f, -0.963088f, -0.210127f}, {0.586448f, -0.847414f, -0.270350f}, + {0.667539f, -0.899978f, -0.229579f}, {0.667539f, -0.899978f, -0.229579f}, + {0.586448f, -0.847414f, -0.270350f}, {0.689263f, -0.864797f, -0.228743f}, + {0.689263f, -0.864797f, -0.228743f}, {0.586448f, -0.847414f, -0.270350f}, + {0.613783f, -0.805559f, -0.269572f}, {0.689263f, -0.864797f, -0.228743f}, + {0.750992f, -0.910564f, -0.159361f}, {0.724016f, -0.954800f, -0.154705f}, + {0.667539f, -0.899978f, -0.229579f}, {0.689263f, -0.864797f, -0.228743f}, + {0.724016f, -0.954800f, -0.154705f}, {0.695551f, -0.988153f, -0.133608f}, + {0.620851f, -0.963088f, -0.210127f}, {0.724016f, -0.954800f, -0.154705f}, + {0.620851f, -0.963088f, -0.210127f}, {0.695551f, -0.988153f, -0.133608f}, + {0.576126f, -1.008893f, -0.164606f}, {0.576126f, -1.008893f, -0.164606f}, + {0.504289f, -0.956408f, -0.224492f}, {0.620851f, -0.963088f, -0.210127f}, + {0.586448f, -0.847414f, -0.270350f}, {0.620851f, -0.963088f, -0.210127f}, + {0.504289f, -0.956408f, -0.224492f}, {0.504289f, -0.956408f, -0.224492f}, + {0.576126f, -1.008893f, -0.164606f}, {0.479698f, -0.983592f, -0.193867f}, + {0.666975f, -1.007574f, -0.096091f}, {0.576126f, -1.008893f, -0.164606f}, + {0.695551f, -0.988153f, -0.133608f}, {0.629602f, -1.010061f, -0.019446f}, + {0.524377f, -1.033508f, -0.066525f}, {0.666975f, -1.007574f, -0.096091f}, + {0.524377f, -1.033508f, -0.066525f}, {0.479698f, -0.983592f, -0.193867f}, + {0.576126f, -1.008893f, -0.164606f}, {0.479698f, -0.983592f, -0.193867f}, + {0.524377f, -1.033508f, -0.066525f}, {0.425486f, -1.025458f, -0.079576f}, + {0.576126f, -1.008893f, -0.164606f}, {0.666975f, -1.007574f, -0.096091f}, + {0.524377f, -1.033508f, -0.066525f}, {0.629602f, -1.010061f, -0.019446f}, + {0.622828f, -1.010850f, 0.039370f}, {0.409885f, -1.028627f, 0.011343f}, + {0.409885f, -1.028627f, 0.011343f}, {0.425486f, -1.025458f, -0.079576f}, + {0.524377f, -1.033508f, -0.066525f}, {0.524377f, -1.033508f, -0.066525f}, + {0.629602f, -1.010061f, -0.019446f}, {0.409885f, -1.028627f, 0.011343f}, + {0.722878f, -0.961497f, 0.026901f}, {0.780515f, -0.889902f, 0.033648f}, + {0.758852f, -0.938246f, 0.054834f}, {0.622828f, -1.010850f, 0.039370f}, + {0.722878f, -0.961497f, 0.026901f}, {0.621666f, -1.020964f, 0.103462f}, + {0.720834f, -0.977022f, 0.073803f}, {0.758852f, -0.938246f, 0.054834f}, + {0.722764f, -0.977602f, 0.081846f}, {0.720834f, -0.977022f, 0.073803f}, + {0.722764f, -0.977602f, 0.081846f}, {0.642121f, -1.011563f, 0.157687f}, + {0.642121f, -1.011563f, 0.157687f}, {0.621666f, -1.020964f, 0.103462f}, + {0.720834f, -0.977022f, 0.073803f}, {0.722878f, -0.961497f, 0.026901f}, + {0.720834f, -0.977022f, 0.073803f}, {0.621666f, -1.020964f, 0.103462f}, + {0.722878f, -0.961497f, 0.026901f}, {0.758852f, -0.938246f, 0.054834f}, + {0.720834f, -0.977022f, 0.073803f}, {0.780515f, -0.889902f, 0.033648f}, + {0.720834f, -0.977022f, 0.073803f}, {0.758852f, -0.938246f, 0.054834f}, + {0.780515f, -0.889902f, 0.033648f}, {0.763842f, -0.933357f, 0.124726f}, + {0.720834f, -0.977022f, 0.073803f}, {0.763842f, -0.933357f, 0.124726f}, + {0.696335f, -0.955003f, 0.205747f}, {0.720834f, -0.977022f, 0.073803f}, + {0.720834f, -0.977022f, 0.073803f}, {0.696335f, -0.955003f, 0.205747f}, + {0.677433f, -0.978595f, 0.194888f}, {0.720834f, -0.977022f, 0.073803f}, + {0.677433f, -0.978595f, 0.194888f}, {0.642121f, -1.011563f, 0.157687f}, + {0.763842f, -0.933357f, 0.124726f}, {0.731104f, -0.899784f, 0.210321f}, + {0.696335f, -0.955003f, 0.205747f}, {0.783015f, -0.889531f, 0.119378f}, + {0.754234f, -0.849776f, 0.195999f}, {0.731104f, -0.899784f, 0.210321f}, + {0.783015f, -0.889531f, 0.119378f}, {0.731104f, -0.899784f, 0.210321f}, + {0.763842f, -0.933357f, 0.124726f}, {0.780515f, -0.889902f, 0.033648f}, + {0.783015f, -0.889531f, 0.119378f}, {0.763842f, -0.933357f, 0.124726f}, + {0.754234f, -0.849776f, 0.195999f}, {0.783015f, -0.889531f, 0.119378f}, + {0.763638f, -0.824658f, 0.183142f}, {0.778968f, -0.776051f, 0.147898f}, + {0.794576f, -0.845281f, 0.094182f}, {0.790792f, -0.735889f, 0.101690f}, + {0.794576f, -0.845281f, 0.094182f}, {0.763638f, -0.824658f, 0.183142f}, + {0.783015f, -0.889531f, 0.119378f}, {0.763638f, -0.824658f, 0.183142f}, + {0.794576f, -0.845281f, 0.094182f}, {0.778968f, -0.776051f, 0.147898f}, + {0.780515f, -0.889902f, 0.033648f}, {0.794576f, -0.845281f, 0.094182f}, + {0.783015f, -0.889531f, 0.119378f}, {0.780515f, -0.889902f, 0.033648f}, + {0.800155f, -0.816098f, 0.049902f}, {0.794576f, -0.845281f, 0.094182f}, + {0.800155f, -0.816098f, 0.049902f}, {0.790792f, -0.735889f, 0.101690f}, + {0.794576f, -0.845281f, 0.094182f}, {0.790792f, -0.735889f, 0.101690f}, + {0.800155f, -0.816098f, 0.049902f}, {0.799994f, -0.711662f, 0.038060f}, + {0.780515f, -0.889902f, 0.033648f}, {0.797267f, -0.840557f, -0.029326f}, + {0.800155f, -0.816098f, 0.049902f}, {0.797267f, -0.840557f, -0.029326f}, + {0.798869f, -0.735644f, -0.045503f}, {0.800155f, -0.816098f, 0.049902f}, + {0.800155f, -0.816098f, 0.049902f}, {0.798869f, -0.735644f, -0.045503f}, + {0.800574f, -0.714476f, -0.014567f}, {0.800155f, -0.816098f, 0.049902f}, + {0.800574f, -0.714476f, -0.014567f}, {0.799994f, -0.711662f, 0.038060f}, + {0.780515f, -0.889902f, 0.033648f}, {0.789044f, -0.885143f, -0.059601f}, + {0.797267f, -0.840557f, -0.029326f}, {0.797267f, -0.840557f, -0.029326f}, + {0.789044f, -0.885143f, -0.059601f}, {0.797256f, -0.823745f, -0.069483f}, + {0.796312f, -0.759138f, -0.070088f}, {0.797267f, -0.840557f, -0.029326f}, + {0.797256f, -0.823745f, -0.069483f}, {0.797267f, -0.840557f, -0.029326f}, + {0.796312f, -0.759138f, -0.070088f}, {0.798869f, -0.735644f, -0.045503f}, + {0.797256f, -0.823745f, -0.069483f}, {0.789044f, -0.885143f, -0.059601f}, + {0.784543f, -0.880758f, -0.105733f}, {0.784543f, -0.880758f, -0.105733f}, + {0.750992f, -0.910564f, -0.159361f}, {0.780059f, -0.836025f, -0.131824f}, + {0.784543f, -0.880758f, -0.105733f}, {0.780059f, -0.836025f, -0.131824f}, + {0.797256f, -0.823745f, -0.069483f}, {0.752494f, -0.949283f, -0.111358f}, + {0.789044f, -0.885143f, -0.059601f}, {0.780515f, -0.889902f, 0.033648f}, + {0.752494f, -0.949283f, -0.111358f}, {0.750992f, -0.910564f, -0.159361f}, + {0.784543f, -0.880758f, -0.105733f}, {0.752494f, -0.949283f, -0.111358f}, + {0.784543f, -0.880758f, -0.105733f}, {0.789044f, -0.885143f, -0.059601f}, + {0.764674f, -0.938707f, -0.059184f}, {0.752494f, -0.949283f, -0.111358f}, + {0.780515f, -0.889902f, 0.033648f}, {0.750992f, -0.910564f, -0.159361f}, + {0.752494f, -0.949283f, -0.111358f}, {0.724016f, -0.954800f, -0.154705f}, + {0.724016f, -0.954800f, -0.154705f}, {0.764674f, -0.938707f, -0.059184f}, + {0.695551f, -0.988153f, -0.133608f}, {0.764674f, -0.938707f, -0.059184f}, + {0.724016f, -0.954800f, -0.154705f}, {0.752494f, -0.949283f, -0.111358f}, + {0.780515f, -0.889902f, 0.033648f}, {0.727597f, -0.957916f, -0.002770f}, + {0.764674f, -0.938707f, -0.059184f}, {0.727597f, -0.957916f, -0.002770f}, + {0.666975f, -1.007574f, -0.096091f}, {0.764674f, -0.938707f, -0.059184f}, + {0.695551f, -0.988153f, -0.133608f}, {0.764674f, -0.938707f, -0.059184f}, + {0.666975f, -1.007574f, -0.096091f}, {0.666975f, -1.007574f, -0.096091f}, + {0.727597f, -0.957916f, -0.002770f}, {0.629602f, -1.010061f, -0.019446f}, + {0.780515f, -0.889902f, 0.033648f}, {0.722878f, -0.961497f, 0.026901f}, + {0.727597f, -0.957916f, -0.002770f}, {0.722878f, -0.961497f, 0.026901f}, + {0.629602f, -1.010061f, -0.019446f}, {0.727597f, -0.957916f, -0.002770f}, + {0.629602f, -1.010061f, -0.019446f}, {0.722878f, -0.961497f, 0.026901f}, + {0.622828f, -1.010850f, 0.039370f}, {-0.568154f, -0.237707f, 0.011206f}, + {-0.554298f, -0.266533f, -0.059249f}, {-0.559234f, -0.344801f, -0.020738f}, + {-0.554298f, -0.266533f, -0.059249f}, {-0.531076f, -0.209118f, -0.105800f}, + {-0.559234f, -0.344801f, -0.020738f}, {-0.531076f, -0.209118f, -0.105800f}, + {-0.497145f, -0.145443f, -0.135271f}, {-0.497319f, -0.257788f, -0.183325f}, + {-0.497145f, -0.145443f, -0.135271f}, {-0.448058f, -0.087913f, -0.151966f}, + {-0.450836f, -0.185466f, -0.224737f}, {-0.448058f, -0.087913f, -0.151966f}, + {-0.416822f, -0.064653f, -0.153867f}, {-0.421068f, -0.153229f, -0.237698f}, + {-0.416822f, -0.064653f, -0.153867f}, {-0.345446f, -0.043039f, -0.136387f}, + {-0.358086f, -0.107641f, -0.238958f}, {-0.345446f, -0.043039f, -0.136387f}, + {-0.311455f, -0.045609f, -0.117366f}, {-0.243362f, -0.072214f, -0.171929f}, + {-0.311455f, -0.045609f, -0.117366f}, {-0.281868f, -0.052914f, -0.093357f}, + {-0.243362f, -0.072214f, -0.171929f}, {-0.281868f, -0.052914f, -0.093357f}, + {-0.287041f, -0.058157f, -0.051717f}, {-0.201037f, -0.067664f, -0.127122f}, + {-0.287041f, -0.058157f, -0.051717f}, {-0.243884f, -0.066668f, -0.027679f}, + {-0.159933f, -0.065380f, -0.058577f}, {-0.243884f, -0.066668f, -0.027679f}, + {-0.252851f, -0.067050f, 0.043792f}, {-0.149523f, -0.064983f, -0.019151f}, + {-0.252851f, -0.067050f, 0.043792f}, {-0.258619f, -0.061028f, 0.084698f}, + {-0.162304f, -0.065348f, 0.084402f}, {-0.258619f, -0.061028f, 0.084698f}, + {-0.345111f, -0.042992f, 0.158522f}, {-0.231992f, -0.070347f, 0.181147f}, + {-0.345111f, -0.042992f, 0.158522f}, {-0.381471f, -0.048737f, 0.171259f}, + {-0.327785f, -0.092566f, 0.250131f}, {-0.381471f, -0.048737f, 0.171259f}, + {-0.447572f, -0.087580f, 0.174226f}, {-0.421948f, -0.151893f, 0.259289f}, + {-0.447572f, -0.087580f, 0.174226f}, {-0.496944f, -0.145170f, 0.157557f}, + {-0.451868f, -0.184248f, 0.246310f}, {-0.496944f, -0.145170f, 0.157557f}, + {-0.530825f, -0.208599f, 0.127619f}, {-0.499401f, -0.258668f, 0.203390f}, + {-0.530825f, -0.208599f, 0.127619f}, {-0.554011f, -0.266026f, 0.081342f}, + {-0.555103f, -0.332963f, 0.071434f}, {-0.554011f, -0.266026f, 0.081342f}, + {-0.561506f, -0.286111f, 0.048810f}, {-0.555103f, -0.332963f, 0.071434f}, + {-0.561506f, -0.286111f, 0.048810f}, {-0.568154f, -0.237707f, 0.011206f}, + {-0.560722f, -0.349176f, 0.011072f}, {-0.245134f, -0.087132f, -0.227843f}, + {-0.252367f, -0.105630f, -0.289763f}, {-0.358086f, -0.107641f, -0.238958f}, + {-0.252367f, -0.105630f, -0.289763f}, {-0.292079f, -0.134864f, -0.326030f}, + {-0.297547f, -0.174158f, -0.365961f}, {-0.265985f, -0.237324f, -0.396676f}, + {-0.235057f, -0.292748f, -0.400311f}, {-0.331117f, -0.295393f, -0.379450f}, + {-0.235057f, -0.292748f, -0.400311f}, {-0.277944f, -0.320479f, -0.388053f}, + {-0.286552f, -0.332472f, -0.383720f}, {-0.122778f, -0.359717f, -0.370968f}, + {-0.052308f, -0.329493f, -0.359209f}, {-0.136648f, -0.439410f, -0.360300f}, + {-0.005142f, -0.356243f, -0.339157f}, {0.024576f, -0.327260f, -0.322519f}, + {0.093577f, -0.375942f, -0.310486f}, {0.024576f, -0.327260f, -0.322519f}, + {0.016993f, -0.279886f, -0.313177f}, {0.065259f, -0.319680f, -0.302512f}, + {0.051779f, -0.246869f, -0.321229f}, {0.051721f, -0.148377f, -0.198787f}, + {0.099286f, -0.226394f, -0.236522f}, {0.024228f, -0.180434f, -0.258813f}, + {-0.021328f, -0.129250f, -0.234450f}, {0.051721f, -0.148377f, -0.198787f}, + {-0.021328f, -0.129250f, -0.234450f}, {-0.061376f, -0.099199f, -0.188071f}, + {0.000189f, -0.101606f, -0.138466f}, {-0.061376f, -0.099199f, -0.188071f}, + {-0.099257f, -0.097014f, -0.213617f}, {-0.125219f, -0.083233f, -0.170020f}, + {-0.099257f, -0.097014f, -0.213617f}, {-0.202742f, -0.086092f, -0.217563f}, + {-0.198765f, -0.079337f, -0.188027f}, {-0.079684f, -0.340384f, 0.384449f}, + {-0.116941f, -0.334306f, 0.394759f}, {-0.105466f, -0.386213f, 0.388652f}, + {-0.116941f, -0.334306f, 0.394759f}, {-0.215595f, -0.327438f, 0.412834f}, + {-0.144161f, -0.433891f, 0.384889f}, {-0.215595f, -0.327438f, 0.412834f}, + {-0.238253f, -0.289343f, 0.423071f}, {-0.246428f, -0.363260f, 0.404451f}, + {-0.238253f, -0.289343f, 0.423071f}, {-0.332791f, -0.291448f, 0.397380f}, + {-0.246428f, -0.363260f, 0.404451f}, {-0.302821f, -0.194571f, 0.394099f}, + {-0.292608f, -0.161980f, 0.375790f}, {-0.332758f, -0.213138f, 0.390733f}, + {-0.292608f, -0.161980f, 0.375790f}, {-0.263218f, -0.116928f, 0.324979f}, + {-0.327785f, -0.092566f, 0.250131f}, {-0.263218f, -0.116928f, 0.324979f}, + {-0.241642f, -0.103722f, 0.298771f}, {-0.327785f, -0.092566f, 0.250131f}, + {-0.241642f, -0.103722f, 0.298771f}, {-0.183628f, -0.106776f, 0.311577f}, + {-0.231992f, -0.070347f, 0.181147f}, {-0.147168f, -0.085620f, 0.215947f}, + {-0.075522f, -0.108091f, 0.248564f}, {-0.111865f, -0.080516f, 0.168778f}, + {0.004368f, -0.124361f, 0.220649f}, {0.007341f, -0.138552f, 0.245721f}, + {0.045404f, -0.146120f, 0.224543f}, {0.007341f, -0.138552f, 0.245721f}, + {0.009331f, -0.168087f, 0.282574f}, {0.045404f, -0.146120f, 0.224543f}, + {0.009331f, -0.168087f, 0.282574f}, {-0.008683f, -0.203947f, 0.322526f}, + {0.090711f, -0.222883f, 0.263048f}, {-0.008683f, -0.203947f, 0.322526f}, + {-0.024666f, -0.217238f, 0.332742f}, {0.090711f, -0.222883f, 0.263048f}, + {-0.024666f, -0.217238f, 0.332742f}, {-0.005216f, -0.266256f, 0.343910f}, + {0.090711f, -0.222883f, 0.263048f}, {-0.005216f, -0.266256f, 0.343910f}, + {-0.037718f, -0.276171f, 0.358543f}, {0.017426f, -0.346902f, 0.352166f}, + {-0.037718f, -0.276171f, 0.358543f}, {-0.079684f, -0.340384f, 0.384449f}, + {0.017426f, -0.346902f, 0.352166f}, {0.503896f, -0.419118f, 0.106868f}, + {0.574343f, -0.443898f, 0.127927f}, {0.578564f, -0.431239f, 0.056949f}, + {0.574343f, -0.443898f, 0.127927f}, {0.667875f, -0.494357f, 0.117842f}, + {0.668793f, -0.472827f, 0.054810f}, {0.667875f, -0.494357f, 0.117842f}, + {0.693869f, -0.505420f, 0.099781f}, {0.668793f, -0.472827f, 0.054810f}, + {0.693869f, -0.505420f, 0.099781f}, {0.725466f, -0.549910f, 0.117326f}, + {0.737736f, -0.534172f, 0.053169f}, {0.754382f, -0.641772f, 0.143444f}, + {0.742165f, -0.690772f, 0.185737f}, {0.752845f, -0.664541f, 0.158286f}, + {0.699804f, -0.664386f, 0.222474f}, {0.656324f, -0.680370f, 0.259240f}, + {0.716496f, -0.750669f, 0.231711f}, {0.505459f, -0.646147f, 0.302026f}, + {0.435241f, -0.592881f, 0.299367f}, {0.534812f, -0.654828f, 0.297562f}, + {0.435241f, -0.592881f, 0.299367f}, {0.467798f, -0.560190f, 0.278831f}, + {0.340174f, -0.570143f, 0.314960f}, {0.467798f, -0.560190f, 0.278831f}, + {0.367921f, -0.536689f, 0.293184f}, {0.340174f, -0.570143f, 0.314960f}, + {0.419554f, -0.494469f, 0.248712f}, {0.487713f, -0.414396f, 0.194702f}, + {0.338082f, -0.432901f, 0.243222f}, {0.487713f, -0.414396f, 0.194702f}, + {0.464039f, -0.418657f, 0.141699f}, {0.362755f, -0.409030f, 0.206062f}, + {0.588326f, -0.459820f, -0.149694f}, {0.519126f, -0.484408f, -0.182053f}, + {0.600226f, -0.471206f, -0.122602f}, {0.519126f, -0.484408f, -0.182053f}, + {0.493554f, -0.502430f, -0.206613f}, {0.460483f, -0.455762f, -0.172921f}, + {0.478382f, -0.512709f, -0.219323f}, {0.462747f, -0.557010f, -0.256818f}, + {0.416254f, -0.510086f, -0.238332f}, {0.462747f, -0.557010f, -0.256818f}, + {0.478024f, -0.583510f, -0.277120f}, {0.388471f, -0.543888f, -0.267182f}, + {0.478024f, -0.583510f, -0.277120f}, {0.472991f, -0.630213f, -0.286776f}, + {0.388471f, -0.543888f, -0.267182f}, {0.543268f, -0.710829f, -0.285133f}, + {0.596126f, -0.724274f, -0.272534f}, {0.512534f, -0.739842f, -0.292882f}, + {0.671667f, -0.722656f, -0.237407f}, {0.711722f, -0.704296f, -0.201800f}, + {0.705973f, -0.834184f, -0.222231f}, {0.711722f, -0.704296f, -0.201800f}, + {0.727599f, -0.690301f, -0.181027f}, {0.734784f, -0.771894f, -0.194041f}, + {0.727599f, -0.690301f, -0.181027f}, {0.774117f, -0.644992f, -0.078104f}, + {0.768696f, -0.671546f, -0.109799f}, {0.734388f, -0.587478f, -0.118492f}, + {0.720657f, -0.563569f, -0.126581f}, {0.774117f, -0.644992f, -0.078104f}, + {-0.560722f, -0.349176f, 0.011072f}, {-0.568154f, -0.237707f, 0.011206f}, + {-0.559234f, -0.344801f, -0.020738f}, {-0.560722f, -0.349176f, 0.011072f}, + {-0.555103f, -0.332963f, 0.071434f}, {-0.561506f, -0.286111f, 0.048810f}, + {-0.545130f, -0.381469f, 0.080591f}, {-0.528754f, -0.330569f, 0.148089f}, + {-0.530825f, -0.208599f, 0.127619f}, {-0.499401f, -0.258668f, 0.203390f}, + {-0.477385f, -0.383358f, 0.220877f}, {-0.446964f, -0.301290f, 0.293249f}, + {-0.515971f, -0.296022f, 0.177163f}, {-0.499401f, -0.258668f, 0.203390f}, + {-0.530825f, -0.208599f, 0.127619f}, {-0.528754f, -0.330569f, 0.148089f}, + {-0.515971f, -0.296022f, 0.177163f}, {-0.530825f, -0.208599f, 0.127619f}, + {-0.421948f, -0.151893f, 0.259289f}, {-0.389042f, -0.124913f, 0.264001f}, + {-0.381471f, -0.048737f, 0.171259f}, {-0.451868f, -0.184248f, 0.246310f}, + {-0.421948f, -0.151893f, 0.259289f}, {-0.447572f, -0.087580f, 0.174226f}, + {-0.424058f, -0.259452f, 0.324576f}, {-0.451868f, -0.184248f, 0.246310f}, + {-0.446964f, -0.301290f, 0.293249f}, {-0.389042f, -0.124913f, 0.264001f}, + {-0.327785f, -0.092566f, 0.250131f}, {-0.381471f, -0.048737f, 0.171259f}, + {-0.327785f, -0.092566f, 0.250131f}, {-0.326741f, -0.154667f, 0.355902f}, + {-0.292608f, -0.161980f, 0.375790f}, {-0.231992f, -0.070347f, 0.181147f}, + {-0.203782f, -0.067624f, 0.150119f}, {-0.258619f, -0.061028f, 0.084698f}, + {-0.166414f, -0.088964f, 0.238733f}, {-0.231992f, -0.070347f, 0.181147f}, + {-0.183628f, -0.106776f, 0.311577f}, {-0.179432f, -0.066110f, 0.116692f}, + {-0.162304f, -0.065348f, 0.084402f}, {-0.258619f, -0.061028f, 0.084698f}, + {-0.203782f, -0.067624f, 0.150119f}, {-0.179432f, -0.066110f, 0.116692f}, + {-0.258619f, -0.061028f, 0.084698f}, {-0.162304f, -0.065348f, 0.084402f}, + {-0.148016f, -0.064903f, 0.011139f}, {-0.252851f, -0.067050f, 0.043792f}, + {-0.149523f, -0.064983f, -0.019151f}, {-0.159933f, -0.065380f, -0.058577f}, + {-0.243884f, -0.066668f, -0.027679f}, {-0.148016f, -0.064903f, 0.011139f}, + {-0.149523f, -0.064983f, -0.019151f}, {-0.252851f, -0.067050f, 0.043792f}, + {-0.201037f, -0.067664f, -0.127122f}, {-0.125219f, -0.083233f, -0.170020f}, + {-0.198765f, -0.079337f, -0.188027f}, {-0.125219f, -0.083233f, -0.170020f}, + {-0.070942f, -0.074729f, -0.076541f}, {-0.061376f, -0.099199f, -0.188071f}, + {-0.159933f, -0.065380f, -0.058577f}, {-0.201037f, -0.067664f, -0.127122f}, + {-0.287041f, -0.058157f, -0.051717f}, {-0.243362f, -0.072214f, -0.171929f}, + {-0.202742f, -0.086092f, -0.217563f}, {-0.245134f, -0.087132f, -0.227843f}, + {-0.198765f, -0.079337f, -0.188027f}, {-0.243362f, -0.072214f, -0.171929f}, + {-0.201037f, -0.067664f, -0.127122f}, {-0.358086f, -0.107641f, -0.238958f}, + {-0.388213f, -0.126167f, -0.242428f}, {-0.416822f, -0.064653f, -0.153867f}, + {-0.297547f, -0.174158f, -0.365961f}, {-0.358086f, -0.107641f, -0.238958f}, + {-0.252367f, -0.105630f, -0.289763f}, {-0.421068f, -0.153229f, -0.237698f}, + {-0.450836f, -0.185466f, -0.224737f}, {-0.448058f, -0.087913f, -0.151966f}, + {-0.388213f, -0.126167f, -0.242428f}, {-0.421068f, -0.153229f, -0.237698f}, + {-0.416822f, -0.064653f, -0.153867f}, {-0.514781f, -0.296720f, -0.156380f}, + {-0.537555f, -0.360128f, -0.095471f}, {-0.531076f, -0.209118f, -0.105800f}, + {-0.497319f, -0.257788f, -0.183325f}, {-0.514781f, -0.296720f, -0.156380f}, + {-0.531076f, -0.209118f, -0.105800f}, {-0.476087f, -0.385187f, -0.201486f}, + {-0.497319f, -0.257788f, -0.183325f}, {-0.423572f, -0.261461f, -0.305663f}, + {-0.537555f, -0.360128f, -0.095471f}, {-0.544261f, -0.380273f, -0.062496f}, + {-0.559234f, -0.344801f, -0.020738f}, {-0.351462f, -0.233598f, 0.386572f}, + {-0.332791f, -0.291448f, 0.397380f}, {-0.332758f, -0.213138f, 0.390733f}, + {-0.019773f, -0.099603f, 0.173257f}, {-0.067799f, -0.090509f, 0.181699f}, + {-0.075522f, -0.108091f, 0.248564f}, {-0.070942f, -0.074729f, -0.076541f}, + {0.000189f, -0.101606f, -0.138466f}, {-0.061376f, -0.099199f, -0.188071f}, + {0.000189f, -0.101606f, -0.138466f}, {0.086466f, -0.137432f, -0.143963f}, + {-0.021328f, -0.129250f, -0.234450f}, {-0.286552f, -0.332472f, -0.383720f}, + {-0.331117f, -0.295393f, -0.379450f}, {-0.235057f, -0.292748f, -0.400311f}, + {-0.105466f, -0.386213f, 0.388652f}, {-0.004625f, -0.457333f, 0.370803f}, + {0.017426f, -0.346902f, 0.352166f}, {-0.144161f, -0.433891f, 0.384889f}, + {-0.105466f, -0.386213f, 0.388652f}, {-0.116941f, -0.334306f, 0.394759f}, + {-0.246428f, -0.363260f, 0.404451f}, {-0.144161f, -0.433891f, 0.384889f}, + {-0.215595f, -0.327438f, 0.412834f}, {0.017426f, -0.346902f, 0.352166f}, + {0.064971f, -0.385246f, 0.344817f}, {0.100829f, -0.352558f, 0.320623f}, + {0.029571f, -0.420403f, 0.361776f}, {0.017426f, -0.346902f, 0.352166f}, + {-0.004625f, -0.457333f, 0.370803f}, {0.100829f, -0.352558f, 0.320623f}, + {-0.005216f, -0.266256f, 0.343910f}, {0.017426f, -0.346902f, 0.352166f}, + {0.090711f, -0.222883f, 0.263048f}, {0.126724f, -0.204070f, 0.218727f}, + {0.045404f, -0.146120f, 0.224543f}, {0.086466f, -0.137432f, -0.143963f}, + {0.051721f, -0.148377f, -0.198787f}, {-0.021328f, -0.129250f, -0.234450f}, + {0.051779f, -0.246869f, -0.321229f}, {0.149091f, -0.327626f, -0.264295f}, + {0.065259f, -0.319680f, -0.302512f}, {0.133485f, -0.207118f, -0.193611f}, + {0.099286f, -0.226394f, -0.236522f}, {0.051721f, -0.148377f, -0.198787f}, + {0.065259f, -0.319680f, -0.302512f}, {0.093577f, -0.375942f, -0.310486f}, + {0.024576f, -0.327260f, -0.322519f}, {-0.005142f, -0.356243f, -0.339157f}, + {-0.029094f, -0.409284f, -0.350942f}, {-0.052308f, -0.329493f, -0.359209f}, + {0.039885f, -0.428334f, -0.339342f}, {-0.005142f, -0.356243f, -0.339157f}, + {0.075309f, -0.393092f, -0.322131f}, {-0.187485f, -0.404612f, -0.370293f}, + {-0.286552f, -0.332472f, -0.383720f}, {-0.168986f, -0.380329f, -0.375081f}, + {-0.136648f, -0.439410f, -0.360300f}, {-0.168986f, -0.380329f, -0.375081f}, + {-0.122778f, -0.359717f, -0.370968f}, {0.252808f, -0.522574f, 0.328424f}, + {0.223172f, -0.556659f, 0.344670f}, {0.340174f, -0.570143f, 0.314960f}, + {0.223172f, -0.556659f, 0.344670f}, {0.193603f, -0.592279f, 0.353649f}, + {0.340174f, -0.570143f, 0.314960f}, {0.362755f, -0.409030f, 0.206062f}, + {0.338082f, -0.432901f, 0.243222f}, {0.487713f, -0.414396f, 0.194702f}, + {0.338082f, -0.432901f, 0.243222f}, {0.311144f, -0.459972f, 0.276415f}, + {0.418586f, -0.517778f, 0.265251f}, {0.384681f, -0.388667f, 0.164260f}, + {0.362755f, -0.409030f, 0.206062f}, {0.464039f, -0.418657f, 0.141699f}, + {0.417136f, -0.361486f, 0.011309f}, {0.401346f, -0.373992f, 0.120819f}, + {0.440027f, -0.395373f, 0.118574f}, {0.193603f, -0.592279f, 0.353649f}, + {0.377954f, -0.680866f, 0.328231f}, {0.340174f, -0.570143f, 0.314960f}, + {0.578564f, -0.431239f, 0.056949f}, {0.496337f, -0.400178f, 0.011387f}, + {0.503896f, -0.419118f, 0.106868f}, {0.496337f, -0.400178f, 0.011387f}, + {0.417136f, -0.361486f, 0.011309f}, {0.440027f, -0.395373f, 0.118574f}, + {0.503896f, -0.419118f, 0.106868f}, {0.496337f, -0.400178f, 0.011387f}, + {0.440027f, -0.395373f, 0.118574f}, {0.460483f, -0.455762f, -0.172921f}, + {0.600226f, -0.471206f, -0.122602f}, {0.519126f, -0.484408f, -0.182053f}, + {0.478382f, -0.512709f, -0.219323f}, {0.460483f, -0.455762f, -0.172921f}, + {0.493554f, -0.502430f, -0.206613f}, {0.394032f, -0.615157f, -0.293048f}, + {0.388471f, -0.543888f, -0.267182f}, {0.472991f, -0.630213f, -0.286776f}, + {0.388471f, -0.543888f, -0.267182f}, {0.416254f, -0.510086f, -0.238332f}, + {0.462747f, -0.557010f, -0.256818f}, {0.401041f, -0.689464f, -0.303962f}, + {0.472991f, -0.630213f, -0.286776f}, {0.468667f, -0.664724f, -0.291909f}, + {0.405685f, -0.643118f, 0.319928f}, {0.534812f, -0.654828f, 0.297562f}, + {0.435241f, -0.592881f, 0.299367f}, {0.377954f, -0.680866f, 0.328231f}, + {0.405685f, -0.643118f, 0.319928f}, {0.340174f, -0.570143f, 0.314960f}, + {0.534812f, -0.654828f, 0.297562f}, {0.615209f, -0.751537f, 0.291641f}, + {0.562744f, -0.660393f, 0.291692f}, {0.737736f, -0.534172f, 0.053169f}, + {0.668793f, -0.472827f, 0.054810f}, {0.693869f, -0.505420f, 0.099781f}, + {0.668793f, -0.472827f, 0.054810f}, {0.578564f, -0.431239f, 0.056949f}, + {0.574343f, -0.443898f, 0.127927f}, {0.512534f, -0.739842f, -0.292882f}, + {0.468667f, -0.664724f, -0.291909f}, {0.543268f, -0.710829f, -0.285133f}, + {0.615209f, -0.751537f, 0.291641f}, {0.636516f, -0.715392f, 0.278183f}, + {0.562744f, -0.660393f, 0.291692f}, {0.752845f, -0.664541f, 0.158286f}, + {0.790792f, -0.735889f, 0.101690f}, {0.770297f, -0.623219f, 0.094728f}, + {0.716496f, -0.750669f, 0.231711f}, {0.742165f, -0.690772f, 0.185737f}, + {0.699804f, -0.664386f, 0.222474f}, {0.777168f, -0.609113f, 0.049431f}, + {0.737736f, -0.534172f, 0.053169f}, {0.725466f, -0.549910f, 0.117326f}, + {0.770297f, -0.623219f, 0.094728f}, {0.777168f, -0.609113f, 0.049431f}, + {0.725466f, -0.549910f, 0.117326f}, {0.756868f, -0.712629f, -0.150208f}, + {0.734784f, -0.771894f, -0.194041f}, {0.727599f, -0.690301f, -0.181027f}, + {0.768696f, -0.671546f, -0.109799f}, {0.756868f, -0.712629f, -0.150208f}, + {0.727599f, -0.690301f, -0.181027f}, {0.734784f, -0.771894f, -0.194041f}, + {0.705973f, -0.834184f, -0.222231f}, {0.711722f, -0.704296f, -0.201800f}, + {-0.559234f, -0.344801f, -0.020738f}, {-0.531076f, -0.209118f, -0.105800f}, + {-0.537555f, -0.360128f, -0.095471f}, {-0.497319f, -0.257788f, -0.183325f}, + {-0.497145f, -0.145443f, -0.135271f}, {-0.450836f, -0.185466f, -0.224737f}, + {-0.358086f, -0.107641f, -0.238958f}, {-0.345446f, -0.043039f, -0.136387f}, + {-0.245134f, -0.087132f, -0.227843f}, {-0.345446f, -0.043039f, -0.136387f}, + {-0.243362f, -0.072214f, -0.171929f}, {-0.245134f, -0.087132f, -0.227843f}, + {-0.243362f, -0.072214f, -0.171929f}, {-0.281868f, -0.052914f, -0.093357f}, + {-0.201037f, -0.067664f, -0.127122f}, {-0.231992f, -0.070347f, 0.181147f}, + {-0.345111f, -0.042992f, 0.158522f}, {-0.327785f, -0.092566f, 0.250131f}, + {-0.451868f, -0.184248f, 0.246310f}, {-0.496944f, -0.145170f, 0.157557f}, + {-0.499401f, -0.258668f, 0.203390f}, {-0.530825f, -0.208599f, 0.127619f}, + {-0.555103f, -0.332963f, 0.071434f}, {-0.545130f, -0.381469f, 0.080591f}, + {-0.332583f, -0.216149f, -0.374513f}, {-0.265985f, -0.237324f, -0.396676f}, + {-0.331117f, -0.295393f, -0.379450f}, {0.065259f, -0.319680f, -0.302512f}, + {0.016993f, -0.279886f, -0.313177f}, {0.051779f, -0.246869f, -0.321229f}, + {-0.125219f, -0.083233f, -0.170020f}, {-0.099257f, -0.097014f, -0.213617f}, + {-0.198765f, -0.079337f, -0.188027f}, {-0.332758f, -0.213138f, 0.390733f}, + {-0.292608f, -0.161980f, 0.375790f}, {-0.326741f, -0.154667f, 0.355902f}, + {-0.327785f, -0.092566f, 0.250131f}, {-0.241642f, -0.103722f, 0.298771f}, + {-0.231992f, -0.070347f, 0.181147f}, {-0.111865f, -0.080516f, 0.168778f}, + {-0.075522f, -0.108091f, 0.248564f}, {-0.067799f, -0.090509f, 0.181699f}, + {0.045404f, -0.146120f, 0.224543f}, {0.009331f, -0.168087f, 0.282574f}, + {0.090711f, -0.222883f, 0.263048f}, {0.017426f, -0.346902f, 0.352166f}, + {-0.079684f, -0.340384f, 0.384449f}, {-0.105466f, -0.386213f, 0.388652f}, + {0.770297f, -0.623219f, 0.094728f}, {0.754382f, -0.641772f, 0.143444f}, + {0.752845f, -0.664541f, 0.158286f}, {0.405685f, -0.643118f, 0.319928f}, + {0.435241f, -0.592881f, 0.299367f}, {0.340174f, -0.570143f, 0.314960f}, + {0.418586f, -0.517778f, 0.265251f}, {0.419554f, -0.494469f, 0.248712f}, + {0.338082f, -0.432901f, 0.243222f}, {0.623118f, -0.726832f, -0.262889f}, + {0.671667f, -0.722656f, -0.237407f}, {0.705973f, -0.834184f, -0.222231f}, + {-0.499401f, -0.258668f, 0.203390f}, {-0.446964f, -0.301290f, 0.293249f}, + {-0.451868f, -0.184248f, 0.246310f}, {-0.450836f, -0.185466f, -0.224737f}, + {-0.423572f, -0.261461f, -0.305663f}, {-0.497319f, -0.257788f, -0.183325f}, + {-0.202742f, -0.086092f, -0.217563f}, {-0.252367f, -0.105630f, -0.289763f}, + {-0.245134f, -0.087132f, -0.227843f}, {-0.184861f, -0.099577f, -0.310004f}, + {-0.252367f, -0.105630f, -0.289763f}, {-0.202742f, -0.086092f, -0.217563f}, + {-0.184861f, -0.099577f, -0.310004f}, {-0.167464f, -0.101732f, -0.336713f}, + {-0.252367f, -0.105630f, -0.289763f}, {-0.134646f, -0.119311f, -0.426173f}, + {-0.167464f, -0.101732f, -0.336713f}, {-0.146428f, -0.102969f, -0.364004f}, + {-0.067899f, -0.111653f, -0.434320f}, {-0.134646f, -0.119311f, -0.426173f}, + {-0.146428f, -0.102969f, -0.364004f}, {-0.213416f, -0.140062f, -0.382713f}, + {-0.268909f, -0.179846f, -0.378474f}, {-0.167464f, -0.101732f, -0.336713f}, + {-0.167464f, -0.101732f, -0.336713f}, {-0.268909f, -0.179846f, -0.378474f}, + {-0.252367f, -0.105630f, -0.289763f}, {-0.164693f, -0.141383f, -0.430850f}, + {-0.213416f, -0.140062f, -0.382713f}, {-0.167464f, -0.101732f, -0.336713f}, + {-0.134646f, -0.119311f, -0.426173f}, {-0.164693f, -0.141383f, -0.430850f}, + {-0.167464f, -0.101732f, -0.336713f}, {-0.138511f, -0.142112f, -0.454333f}, + {-0.164693f, -0.141383f, -0.430850f}, {-0.134646f, -0.119311f, -0.426173f}, + {-0.110489f, -0.177192f, -0.490422f}, {-0.138511f, -0.142112f, -0.454333f}, + {-0.134646f, -0.119311f, -0.426173f}, {-0.164693f, -0.141383f, -0.430850f}, + {-0.241831f, -0.184946f, -0.393921f}, {-0.213416f, -0.140062f, -0.382713f}, + {-0.213416f, -0.140062f, -0.382713f}, {-0.241831f, -0.184946f, -0.393921f}, + {-0.268909f, -0.179846f, -0.378474f}, {-0.110489f, -0.177192f, -0.490422f}, + {-0.164693f, -0.141383f, -0.430850f}, {-0.138511f, -0.142112f, -0.454333f}, + {-0.241831f, -0.184946f, -0.393921f}, {-0.265985f, -0.237324f, -0.396676f}, + {-0.268909f, -0.179846f, -0.378474f}, {-0.212072f, -0.229481f, -0.420893f}, + {-0.241831f, -0.184946f, -0.393921f}, {-0.164693f, -0.141383f, -0.430850f}, + {-0.241831f, -0.184946f, -0.393921f}, {-0.212072f, -0.229481f, -0.420893f}, + {-0.265985f, -0.237324f, -0.396676f}, {-0.162885f, -0.214970f, -0.458097f}, + {-0.212072f, -0.229481f, -0.420893f}, {-0.164693f, -0.141383f, -0.430850f}, + {-0.110036f, -0.214782f, -0.494281f}, {-0.162885f, -0.214970f, -0.458097f}, + {-0.110489f, -0.177192f, -0.490422f}, {-0.110489f, -0.177192f, -0.490422f}, + {-0.162885f, -0.214970f, -0.458097f}, {-0.164693f, -0.141383f, -0.430850f}, + {-0.212072f, -0.229481f, -0.420893f}, {-0.235057f, -0.292748f, -0.400311f}, + {-0.265985f, -0.237324f, -0.396676f}, {-0.235057f, -0.292748f, -0.400311f}, + {-0.212072f, -0.229481f, -0.420893f}, {-0.189197f, -0.289148f, -0.413892f}, + {-0.155734f, -0.252472f, -0.452610f}, {-0.212072f, -0.229481f, -0.420893f}, + {-0.162885f, -0.214970f, -0.458097f}, {-0.212072f, -0.229481f, -0.420893f}, + {-0.155734f, -0.252472f, -0.452610f}, {-0.189197f, -0.289148f, -0.413892f}, + {-0.162885f, -0.214970f, -0.458097f}, {-0.110036f, -0.214782f, -0.494281f}, + {-0.155734f, -0.252472f, -0.452610f}, {-0.168986f, -0.380329f, -0.375081f}, + {-0.286552f, -0.332472f, -0.383720f}, {-0.235057f, -0.292748f, -0.400311f}, + {-0.189197f, -0.289148f, -0.413892f}, {-0.168986f, -0.380329f, -0.375081f}, + {-0.235057f, -0.292748f, -0.400311f}, {-0.120262f, -0.311237f, -0.403812f}, + {-0.189197f, -0.289148f, -0.413892f}, {-0.155734f, -0.252472f, -0.452610f}, + {-0.110036f, -0.214782f, -0.494281f}, {-0.120262f, -0.311237f, -0.403812f}, + {-0.155734f, -0.252472f, -0.452610f}, {-0.074597f, -0.288433f, -0.473379f}, + {-0.120262f, -0.311237f, -0.403812f}, {-0.110036f, -0.214782f, -0.494281f}, + {-0.122778f, -0.359717f, -0.370968f}, {-0.168986f, -0.380329f, -0.375081f}, + {-0.189197f, -0.289148f, -0.413892f}, {-0.122778f, -0.359717f, -0.370968f}, + {-0.189197f, -0.289148f, -0.413892f}, {-0.120262f, -0.311237f, -0.403812f}, + {-0.074597f, -0.288433f, -0.473379f}, {-0.068822f, -0.305460f, -0.446860f}, + {-0.120262f, -0.311237f, -0.403812f}, {-0.052308f, -0.329493f, -0.359209f}, + {-0.120262f, -0.311237f, -0.403812f}, {-0.050941f, -0.312602f, -0.352088f}, + {-0.122778f, -0.359717f, -0.370968f}, {-0.120262f, -0.311237f, -0.403812f}, + {-0.052308f, -0.329493f, -0.359209f}, {-0.050941f, -0.312602f, -0.352088f}, + {-0.120262f, -0.311237f, -0.403812f}, {-0.068822f, -0.305460f, -0.446860f}, + {-0.022763f, -0.310064f, -0.335019f}, {-0.005142f, -0.356243f, -0.339157f}, + {-0.050941f, -0.312602f, -0.352088f}, {-0.052308f, -0.329493f, -0.359209f}, + {-0.050941f, -0.312602f, -0.352088f}, {-0.005142f, -0.356243f, -0.339157f}, + {0.016993f, -0.279886f, -0.313177f}, {0.024576f, -0.327260f, -0.322519f}, + {-0.005142f, -0.356243f, -0.339157f}, {-0.022763f, -0.310064f, -0.335019f}, + {0.016993f, -0.279886f, -0.313177f}, {-0.005142f, -0.356243f, -0.339157f}, + {0.016993f, -0.279886f, -0.313177f}, {-0.022763f, -0.310064f, -0.335019f}, + {-0.050941f, -0.312602f, -0.352088f}, {0.016993f, -0.279886f, -0.313177f}, + {-0.050941f, -0.312602f, -0.352088f}, {-0.059422f, -0.267293f, -0.313983f}, + {-0.057381f, -0.200179f, -0.293350f}, {0.016993f, -0.279886f, -0.313177f}, + {-0.059422f, -0.267293f, -0.313983f}, {0.016993f, -0.279886f, -0.313177f}, + {-0.057381f, -0.200179f, -0.293350f}, {0.002521f, -0.248492f, -0.310613f}, + {0.024228f, -0.180434f, -0.258813f}, {0.002521f, -0.248492f, -0.310613f}, + {-0.010288f, -0.188253f, -0.277203f}, {0.002521f, -0.248492f, -0.310613f}, + {-0.057381f, -0.200179f, -0.293350f}, {-0.010288f, -0.188253f, -0.277203f}, + {-0.073301f, -0.143606f, -0.309418f}, {-0.010288f, -0.188253f, -0.277203f}, + {-0.057381f, -0.200179f, -0.293350f}, {-0.035937f, -0.136006f, -0.252683f}, + {-0.047893f, -0.120479f, -0.242248f}, {0.024228f, -0.180434f, -0.258813f}, + {0.024228f, -0.180434f, -0.258813f}, {-0.047893f, -0.120479f, -0.242248f}, + {-0.021328f, -0.129250f, -0.234450f}, {-0.073301f, -0.143606f, -0.309418f}, + {-0.035937f, -0.136006f, -0.252683f}, {-0.010288f, -0.188253f, -0.277203f}, + {-0.010288f, -0.188253f, -0.277203f}, {-0.035937f, -0.136006f, -0.252683f}, + {0.024228f, -0.180434f, -0.258813f}, {-0.058882f, -0.127144f, -0.263512f}, + {-0.047893f, -0.120479f, -0.242248f}, {-0.073301f, -0.143606f, -0.309418f}, + {-0.073301f, -0.143606f, -0.309418f}, {-0.047893f, -0.120479f, -0.242248f}, + {-0.035937f, -0.136006f, -0.252683f}, {-0.098048f, -0.112313f, -0.290612f}, + {-0.058882f, -0.127144f, -0.263512f}, {-0.073301f, -0.143606f, -0.309418f}, + {-0.073557f, -0.120718f, -0.343207f}, {-0.073301f, -0.143606f, -0.309418f}, + {-0.068683f, -0.132488f, -0.329037f}, {-0.073301f, -0.143606f, -0.309418f}, + {-0.073557f, -0.120718f, -0.343207f}, {-0.058882f, -0.127144f, -0.263512f}, + {-0.098048f, -0.112313f, -0.290612f}, {-0.099257f, -0.097014f, -0.213617f}, + {-0.058882f, -0.127144f, -0.263512f}, {-0.058882f, -0.127144f, -0.263512f}, + {-0.099257f, -0.097014f, -0.213617f}, {-0.047893f, -0.120479f, -0.242248f}, + {-0.146428f, -0.102969f, -0.364004f}, {-0.098048f, -0.112313f, -0.290612f}, + {-0.058882f, -0.127144f, -0.263512f}, {-0.073557f, -0.120718f, -0.343207f}, + {-0.146428f, -0.102969f, -0.364004f}, {-0.058882f, -0.127144f, -0.263512f}, + {-0.098048f, -0.112313f, -0.290612f}, {-0.202742f, -0.086092f, -0.217563f}, + {-0.099257f, -0.097014f, -0.213617f}, {-0.184861f, -0.099577f, -0.310004f}, + {-0.202742f, -0.086092f, -0.217563f}, {-0.098048f, -0.112313f, -0.290612f}, + {-0.167464f, -0.101732f, -0.336713f}, {-0.184861f, -0.099577f, -0.310004f}, + {-0.098048f, -0.112313f, -0.290612f}, {-0.146428f, -0.102969f, -0.364004f}, + {-0.167464f, -0.101732f, -0.336713f}, {-0.098048f, -0.112313f, -0.290612f}, + {-0.067899f, -0.111653f, -0.434320f}, {-0.146428f, -0.102969f, -0.364004f}, + {-0.073557f, -0.120718f, -0.343207f}, {-0.292079f, -0.134864f, -0.326030f}, + {-0.268909f, -0.179846f, -0.378474f}, {-0.297547f, -0.174158f, -0.365961f}, + {-0.297547f, -0.174158f, -0.365961f}, {-0.268909f, -0.179846f, -0.378474f}, + {-0.332583f, -0.216149f, -0.374513f}, {0.051779f, -0.246869f, -0.321229f}, + {0.024228f, -0.180434f, -0.258813f}, {0.051721f, -0.148377f, -0.198787f}, + {-0.074597f, -0.288433f, -0.473379f}, {-0.110036f, -0.214782f, -0.494281f}, + {-0.080153f, -0.196721f, -0.505826f}, {-0.080153f, -0.196721f, -0.505826f}, + {-0.110489f, -0.177192f, -0.490422f}, {-0.077027f, -0.151393f, -0.488505f}, + {-0.077027f, -0.151393f, -0.488505f}, {-0.110489f, -0.177192f, -0.490422f}, + {-0.073041f, -0.127692f, -0.464992f}, {-0.073041f, -0.127692f, -0.464992f}, + {-0.134646f, -0.119311f, -0.426173f}, {-0.067899f, -0.111653f, -0.434320f}, + {-0.134646f, -0.119311f, -0.426173f}, {-0.073041f, -0.127692f, -0.464992f}, + {-0.110489f, -0.177192f, -0.490422f}, {-0.268909f, -0.179846f, -0.378474f}, + {-0.292079f, -0.134864f, -0.326030f}, {-0.252367f, -0.105630f, -0.289763f}, + {-0.110489f, -0.177192f, -0.490422f}, {-0.080153f, -0.196721f, -0.505826f}, + {-0.110036f, -0.214782f, -0.494281f}, {-0.047893f, -0.120479f, -0.242248f}, + {-0.061376f, -0.099199f, -0.188071f}, {-0.021328f, -0.129250f, -0.234450f}, + {-0.099257f, -0.097014f, -0.213617f}, {-0.061376f, -0.099199f, -0.188071f}, + {-0.047893f, -0.120479f, -0.242248f}, {-0.268909f, -0.179846f, -0.378474f}, + {-0.265985f, -0.237324f, -0.396676f}, {-0.332583f, -0.216149f, -0.374513f}, + {0.016993f, -0.279886f, -0.313177f}, {0.002521f, -0.248492f, -0.310613f}, + {0.051779f, -0.246869f, -0.321229f}, {0.002521f, -0.248492f, -0.310613f}, + {0.024228f, -0.180434f, -0.258813f}, {0.051779f, -0.246869f, -0.321229f}, + {0.173783f, 0.019667f, 0.489404f}, {0.189265f, 0.014700f, 0.405084f}, + {0.192401f, 0.102763f, 0.450311f}, {0.170613f, -0.022366f, 0.490332f}, + {0.189265f, 0.014700f, 0.405084f}, {0.173783f, 0.019667f, 0.489404f}, + {0.189265f, 0.014700f, 0.405084f}, {0.170613f, -0.022366f, 0.490332f}, + {0.186794f, -0.028377f, 0.406230f}, {0.183692f, -0.114543f, 0.465884f}, + {0.186794f, -0.028377f, 0.406230f}, {0.170613f, -0.022366f, 0.490332f}, + {0.186794f, -0.028377f, 0.406230f}, {0.183692f, -0.114543f, 0.465884f}, + {0.189374f, -0.117511f, 0.434152f}, {0.175029f, -0.156493f, 0.466953f}, + {0.189374f, -0.117511f, 0.434152f}, {0.183692f, -0.114543f, 0.465884f}, + {0.189374f, -0.117511f, 0.434152f}, {0.175029f, -0.156493f, 0.466953f}, + {0.180354f, -0.160444f, 0.433432f}, {0.102438f, -0.258291f, 0.468472f}, + {0.180354f, -0.160444f, 0.433432f}, {0.175029f, -0.156493f, 0.466953f}, + {0.180354f, -0.160444f, 0.433432f}, {0.102438f, -0.258291f, 0.468472f}, + {0.164912f, -0.200796f, 0.432580f}, {0.164912f, -0.200796f, 0.432580f}, + {0.102438f, -0.258291f, 0.468472f}, {0.102908f, -0.259200f, 0.395727f}, + {0.102908f, -0.259200f, 0.395727f}, {0.102438f, -0.258291f, 0.468472f}, + {0.105493f, -0.264449f, 0.430840f}, {0.063529f, -0.278173f, 0.468451f}, + {0.105493f, -0.264449f, 0.430840f}, {0.102438f, -0.258291f, 0.468472f}, + {0.105493f, -0.264449f, 0.430840f}, {0.063529f, -0.278173f, 0.468451f}, + {0.065472f, -0.284820f, 0.430177f}, {0.020645f, -0.270519f, 0.504641f}, + {0.065472f, -0.284820f, 0.430177f}, {0.063529f, -0.278173f, 0.468451f}, + {0.065472f, -0.284820f, 0.430177f}, {0.020645f, -0.270519f, 0.504641f}, + {0.025294f, -0.298244f, 0.429898f}, {0.020645f, -0.270519f, 0.504641f}, + {-0.087839f, -0.276188f, 0.502768f}, {-0.062057f, -0.301063f, 0.408702f}, + {0.025294f, -0.298244f, 0.429898f}, {0.020645f, -0.270519f, 0.504641f}, + {-0.062057f, -0.301063f, 0.408702f}, {-0.111146f, -0.290201f, 0.406636f}, + {-0.062057f, -0.301063f, 0.408702f}, {-0.087839f, -0.276188f, 0.502768f}, + {-0.087839f, -0.276188f, 0.502768f}, {-0.149581f, -0.270250f, 0.465072f}, + {-0.111146f, -0.290201f, 0.406636f}, {-0.116941f, -0.334306f, 0.394759f}, + {-0.037718f, -0.276171f, 0.358543f}, {-0.111146f, -0.290201f, 0.406636f}, + {-0.037718f, -0.276171f, 0.358543f}, {-0.116941f, -0.334306f, 0.394759f}, + {-0.079684f, -0.340384f, 0.384449f}, {0.178298f, 0.106376f, 0.471320f}, + {0.173783f, 0.019667f, 0.489404f}, {0.192401f, 0.102763f, 0.450311f}, + {0.183692f, -0.114543f, 0.465884f}, {0.146396f, -0.181654f, 0.501253f}, + {0.175029f, -0.156493f, 0.466953f}, {0.175029f, -0.156493f, 0.466953f}, + {0.146396f, -0.181654f, 0.501253f}, {0.102438f, -0.258291f, 0.468472f}, + {0.102438f, -0.258291f, 0.468472f}, {0.093735f, -0.240226f, 0.504393f}, + {0.063529f, -0.278173f, 0.468451f}, {0.020645f, -0.270519f, 0.504641f}, + {0.063529f, -0.278173f, 0.468451f}, {0.093735f, -0.240226f, 0.504393f}, + {-0.177267f, -0.285820f, 0.431560f}, {-0.111146f, -0.290201f, 0.406636f}, + {-0.149581f, -0.270250f, 0.465072f}, {-0.215595f, -0.327438f, 0.412834f}, + {-0.116941f, -0.334306f, 0.394759f}, {-0.111146f, -0.290201f, 0.406636f}, + {-0.177267f, -0.285820f, 0.431560f}, {-0.215595f, -0.327438f, 0.412834f}, + {-0.111146f, -0.290201f, 0.406636f}, {0.132595f, 0.075979f, 0.502449f}, + {0.173783f, 0.019667f, 0.489404f}, {0.178298f, 0.106376f, 0.471320f}, + {0.152034f, 0.026694f, 0.506102f}, {0.173783f, 0.019667f, 0.489404f}, + {0.132595f, 0.075979f, 0.502449f}, {0.148313f, -0.014253f, 0.507090f}, + {0.173783f, 0.019667f, 0.489404f}, {0.152034f, 0.026694f, 0.506102f}, + {0.173783f, 0.019667f, 0.489404f}, {0.148313f, -0.014253f, 0.507090f}, + {0.170613f, -0.022366f, 0.490332f}, {0.141854f, -0.093459f, 0.513026f}, + {0.170613f, -0.022366f, 0.490332f}, {0.148313f, -0.014253f, 0.507090f}, + {0.170613f, -0.022366f, 0.490332f}, {0.141854f, -0.093459f, 0.513026f}, + {0.183692f, -0.114543f, 0.465884f}, {0.183692f, -0.114543f, 0.465884f}, + {0.141854f, -0.093459f, 0.513026f}, {0.146396f, -0.181654f, 0.501253f}, + {0.107195f, -0.189367f, 0.527567f}, {0.146396f, -0.181654f, 0.501253f}, + {0.141854f, -0.093459f, 0.513026f}, {0.146396f, -0.181654f, 0.501253f}, + {0.107195f, -0.189367f, 0.527567f}, {0.102438f, -0.258291f, 0.468472f}, + {0.049453f, -0.228821f, 0.528059f}, {0.102438f, -0.258291f, 0.468472f}, + {0.107195f, -0.189367f, 0.527567f}, {0.102438f, -0.258291f, 0.468472f}, + {0.049453f, -0.228821f, 0.528059f}, {0.093735f, -0.240226f, 0.504393f}, + {-0.028744f, -0.207652f, 0.534506f}, {0.093735f, -0.240226f, 0.504393f}, + {0.049453f, -0.228821f, 0.528059f}, {0.093735f, -0.240226f, 0.504393f}, + {-0.028744f, -0.207652f, 0.534506f}, {0.020645f, -0.270519f, 0.504641f}, + {-0.066299f, -0.243798f, 0.526206f}, {0.020645f, -0.270519f, 0.504641f}, + {-0.028744f, -0.207652f, 0.534506f}, {0.020645f, -0.270519f, 0.504641f}, + {-0.066299f, -0.243798f, 0.526206f}, {-0.087839f, -0.276188f, 0.502768f}, + {-0.110606f, -0.241566f, 0.518826f}, {-0.149581f, -0.270250f, 0.465072f}, + {-0.087839f, -0.276188f, 0.502768f}, {-0.110606f, -0.241566f, 0.518826f}, + {-0.087839f, -0.276188f, 0.502768f}, {-0.066299f, -0.243798f, 0.526206f}, + {-0.208803f, -0.256321f, 0.441297f}, {-0.110606f, -0.241566f, 0.518826f}, + {-0.175242f, -0.207831f, 0.486986f}, {-0.110606f, -0.241566f, 0.518826f}, + {-0.208803f, -0.256321f, 0.441297f}, {-0.177267f, -0.285820f, 0.431560f}, + {-0.177267f, -0.285820f, 0.431560f}, {-0.149581f, -0.270250f, 0.465072f}, + {-0.110606f, -0.241566f, 0.518826f}, {-0.177267f, -0.285820f, 0.431560f}, + {-0.208803f, -0.256321f, 0.441297f}, {-0.238253f, -0.289343f, 0.423071f}, + {0.107195f, -0.189367f, 0.527567f}, {0.141854f, -0.093459f, 0.513026f}, + {0.111665f, -0.109927f, 0.525720f}, {0.107195f, -0.189367f, 0.527567f}, + {0.066073f, -0.132092f, 0.522930f}, {0.049453f, -0.228821f, 0.528059f}, + {-0.110515f, -0.206986f, 0.526612f}, {-0.110606f, -0.241566f, 0.518826f}, + {-0.066299f, -0.243798f, 0.526206f}, {-0.175242f, -0.207831f, 0.486986f}, + {-0.110606f, -0.241566f, 0.518826f}, {-0.110515f, -0.206986f, 0.526612f}, + {-0.264678f, -0.250049f, 0.422652f}, {-0.238253f, -0.289343f, 0.423071f}, + {-0.208803f, -0.256321f, 0.441297f}, {0.065802f, -0.057222f, 0.491657f}, + {0.148313f, -0.014253f, 0.507090f}, {0.152034f, 0.026694f, 0.506102f}, + {0.060296f, -0.094964f, 0.495957f}, {0.148313f, -0.014253f, 0.507090f}, + {0.065802f, -0.057222f, 0.491657f}, {0.148313f, -0.014253f, 0.507090f}, + {0.060296f, -0.094964f, 0.495957f}, {0.141854f, -0.093459f, 0.513026f}, + {0.141854f, -0.093459f, 0.513026f}, {0.060296f, -0.094964f, 0.495957f}, + {0.111665f, -0.109927f, 0.525720f}, {0.111665f, -0.109927f, 0.525720f}, + {0.060296f, -0.094964f, 0.495957f}, {0.107195f, -0.189367f, 0.527567f}, + {0.066073f, -0.132092f, 0.522930f}, {0.107195f, -0.189367f, 0.527567f}, + {0.060296f, -0.094964f, 0.495957f}, {0.066073f, -0.132092f, 0.522930f}, + {0.001553f, -0.167038f, 0.522021f}, {0.049453f, -0.228821f, 0.528059f}, + {0.049453f, -0.228821f, 0.528059f}, {0.001553f, -0.167038f, 0.522021f}, + {-0.028744f, -0.207652f, 0.534506f}, {-0.085636f, -0.165849f, 0.523053f}, + {-0.028744f, -0.207652f, 0.534506f}, {0.001553f, -0.167038f, 0.522021f}, + {-0.085636f, -0.165849f, 0.523053f}, {-0.066299f, -0.243798f, 0.526206f}, + {-0.028744f, -0.207652f, 0.534506f}, {-0.085636f, -0.165849f, 0.523053f}, + {-0.146136f, -0.169646f, 0.505211f}, {-0.110236f, -0.186252f, 0.525382f}, + {-0.110236f, -0.186252f, 0.525382f}, {-0.110515f, -0.206986f, 0.526612f}, + {-0.066299f, -0.243798f, 0.526206f}, {-0.085636f, -0.165849f, 0.523053f}, + {-0.110236f, -0.186252f, 0.525382f}, {-0.066299f, -0.243798f, 0.526206f}, + {-0.210728f, -0.147052f, 0.404630f}, {-0.208803f, -0.256321f, 0.441297f}, + {-0.176935f, -0.188241f, 0.485347f}, {-0.208803f, -0.256321f, 0.441297f}, + {-0.175242f, -0.207831f, 0.486986f}, {-0.176935f, -0.188241f, 0.485347f}, + {-0.176935f, -0.188241f, 0.485347f}, {-0.175242f, -0.207831f, 0.486986f}, + {-0.110236f, -0.186252f, 0.525382f}, {-0.110236f, -0.186252f, 0.525382f}, + {-0.175242f, -0.207831f, 0.486986f}, {-0.110515f, -0.206986f, 0.526612f}, + {-0.176935f, -0.188241f, 0.485347f}, {-0.110236f, -0.186252f, 0.525382f}, + {-0.146136f, -0.169646f, 0.505211f}, {-0.255827f, -0.186573f, 0.407580f}, + {-0.208803f, -0.256321f, 0.441297f}, {-0.210728f, -0.147052f, 0.404630f}, + {-0.208803f, -0.256321f, 0.441297f}, {-0.255827f, -0.186573f, 0.407580f}, + {-0.264678f, -0.250049f, 0.422652f}, {0.083686f, 0.047976f, 0.485253f}, + {0.132595f, 0.075979f, 0.502449f}, {0.077541f, 0.090817f, 0.455719f}, + {0.132595f, 0.075979f, 0.502449f}, {0.083686f, 0.047976f, 0.485253f}, + {0.152034f, 0.026694f, 0.506102f}, {0.065802f, -0.057222f, 0.491657f}, + {0.152034f, 0.026694f, 0.506102f}, {0.083686f, 0.047976f, 0.485253f}, + {0.018047f, -0.134913f, 0.498017f}, {0.066073f, -0.132092f, 0.522930f}, + {0.060296f, -0.094964f, 0.495957f}, {0.066073f, -0.132092f, 0.522930f}, + {0.018047f, -0.134913f, 0.498017f}, {0.001553f, -0.167038f, 0.522021f}, + {-0.085906f, -0.150030f, 0.513193f}, {-0.085636f, -0.165849f, 0.523053f}, + {0.018047f, -0.134913f, 0.498017f}, {0.018047f, -0.134913f, 0.498017f}, + {-0.085636f, -0.165849f, 0.523053f}, {0.001553f, -0.167038f, 0.522021f}, + {-0.085636f, -0.165849f, 0.523053f}, {-0.085906f, -0.150030f, 0.513193f}, + {-0.146136f, -0.169646f, 0.505211f}, {0.012459f, -0.121160f, 0.465763f}, + {0.018047f, -0.134913f, 0.498017f}, {0.060296f, -0.094964f, 0.495957f}, + {-0.096133f, -0.126726f, 0.486596f}, {-0.085906f, -0.150030f, 0.513193f}, + {0.012459f, -0.121160f, 0.465763f}, {0.012459f, -0.121160f, 0.465763f}, + {-0.085906f, -0.150030f, 0.513193f}, {0.018047f, -0.134913f, 0.498017f}, + {-0.096133f, -0.126726f, 0.486596f}, {-0.127823f, -0.129616f, 0.484378f}, + {-0.146136f, -0.169646f, 0.505211f}, {-0.096133f, -0.126726f, 0.486596f}, + {-0.146136f, -0.169646f, 0.505211f}, {-0.085906f, -0.150030f, 0.513193f}, + {-0.192117f, -0.124391f, 0.375139f}, {-0.210728f, -0.147052f, 0.404630f}, + {-0.165005f, -0.123056f, 0.436698f}, {-0.210728f, -0.147052f, 0.404630f}, + {-0.176935f, -0.188241f, 0.485347f}, {-0.127823f, -0.129616f, 0.484378f}, + {-0.127823f, -0.129616f, 0.484378f}, {-0.176935f, -0.188241f, 0.485347f}, + {-0.146136f, -0.169646f, 0.505211f}, {-0.165005f, -0.123056f, 0.436698f}, + {-0.210728f, -0.147052f, 0.404630f}, {-0.127823f, -0.129616f, 0.484378f}, + {0.077541f, 0.090817f, 0.455719f}, {0.076853f, 0.159067f, 0.432497f}, + {0.078665f, 0.090483f, 0.401198f}, {0.067733f, 0.013602f, 0.402306f}, + {0.077541f, 0.090817f, 0.455719f}, {0.078665f, 0.090483f, 0.401198f}, + {0.077541f, 0.090817f, 0.455719f}, {0.067733f, 0.013602f, 0.402306f}, + {0.083686f, 0.047976f, 0.485253f}, {0.054107f, -0.017198f, 0.431411f}, + {0.083686f, 0.047976f, 0.485253f}, {0.067733f, 0.013602f, 0.402306f}, + {0.083686f, 0.047976f, 0.485253f}, {0.054107f, -0.017198f, 0.431411f}, + {0.065802f, -0.057222f, 0.491657f}, {0.051088f, -0.086941f, 0.396159f}, + {0.065802f, -0.057222f, 0.491657f}, {0.054107f, -0.017198f, 0.431411f}, + {0.065802f, -0.057222f, 0.491657f}, {0.051088f, -0.086941f, 0.396159f}, + {0.060296f, -0.094964f, 0.495957f}, {0.010694f, -0.116948f, 0.426696f}, + {0.012459f, -0.121160f, 0.465763f}, {0.051088f, -0.086941f, 0.396159f}, + {0.051088f, -0.086941f, 0.396159f}, {0.012459f, -0.121160f, 0.465763f}, + {0.060296f, -0.094964f, 0.495957f}, {-0.088441f, -0.111720f, 0.431756f}, + {-0.096133f, -0.126726f, 0.486596f}, {0.010694f, -0.116948f, 0.426696f}, + {0.010694f, -0.116948f, 0.426696f}, {-0.096133f, -0.126726f, 0.486596f}, + {0.012459f, -0.121160f, 0.465763f}, {-0.132311f, -0.112266f, 0.420061f}, + {-0.127823f, -0.129616f, 0.484378f}, {-0.088441f, -0.111720f, 0.431756f}, + {-0.096133f, -0.126726f, 0.486596f}, {-0.088441f, -0.111720f, 0.431756f}, + {-0.127823f, -0.129616f, 0.484378f}, {-0.192117f, -0.124391f, 0.375139f}, + {-0.165005f, -0.123056f, 0.436698f}, {-0.132311f, -0.112266f, 0.420061f}, + {-0.132311f, -0.112266f, 0.420061f}, {-0.165005f, -0.123056f, 0.436698f}, + {-0.127823f, -0.129616f, 0.484378f}, {-0.088973f, -0.121204f, 0.381822f}, + {0.010694f, -0.116948f, 0.426696f}, {-0.008942f, -0.126028f, 0.389332f}, + {0.010694f, -0.116948f, 0.426696f}, {-0.088973f, -0.121204f, 0.381822f}, + {-0.088441f, -0.111720f, 0.431756f}, {-0.132311f, -0.112266f, 0.420061f}, + {-0.116337f, -0.126779f, 0.356972f}, {-0.192117f, -0.124391f, 0.375139f}, + {-0.104743f, -0.111724f, 0.293694f}, {-0.183628f, -0.106776f, 0.311577f}, + {-0.116337f, -0.126779f, 0.356972f}, {-0.116337f, -0.126779f, 0.356972f}, + {-0.183628f, -0.106776f, 0.311577f}, {-0.192117f, -0.124391f, 0.375139f}, + {0.096394f, 0.003944f, 0.364084f}, {0.067733f, 0.013602f, 0.402306f}, + {0.092054f, 0.121642f, 0.384333f}, {0.092054f, 0.121642f, 0.384333f}, + {0.067733f, 0.013602f, 0.402306f}, {0.078665f, 0.090483f, 0.401198f}, + {0.066319f, -0.057457f, 0.376144f}, {0.054107f, -0.017198f, 0.431411f}, + {0.096394f, 0.003944f, 0.364084f}, {0.096394f, 0.003944f, 0.364084f}, + {0.054107f, -0.017198f, 0.431411f}, {0.067733f, 0.013602f, 0.402306f}, + {0.060765f, -0.095509f, 0.368646f}, {0.051088f, -0.086941f, 0.396159f}, + {0.066319f, -0.057457f, 0.376144f}, {0.066319f, -0.057457f, 0.376144f}, + {0.051088f, -0.086941f, 0.396159f}, {0.054107f, -0.017198f, 0.431411f}, + {0.060765f, -0.095509f, 0.368646f}, {0.010694f, -0.116948f, 0.426696f}, + {0.051088f, -0.086941f, 0.396159f}, {0.026448f, -0.157020f, 0.339667f}, + {0.010694f, -0.116948f, 0.426696f}, {0.060765f, -0.095509f, 0.368646f}, + {0.010694f, -0.116948f, 0.426696f}, {0.026448f, -0.157020f, 0.339667f}, + {-0.008942f, -0.126028f, 0.389332f}, {-0.076426f, -0.192884f, 0.325616f}, + {-0.008942f, -0.126028f, 0.389332f}, {0.026448f, -0.157020f, 0.339667f}, + {-0.008942f, -0.126028f, 0.389332f}, {-0.076426f, -0.192884f, 0.325616f}, + {-0.088973f, -0.121204f, 0.381822f}, {-0.088441f, -0.111720f, 0.431756f}, + {-0.088973f, -0.121204f, 0.381822f}, {-0.132311f, -0.112266f, 0.420061f}, + {-0.116337f, -0.126779f, 0.356972f}, {-0.132311f, -0.112266f, 0.420061f}, + {-0.088973f, -0.121204f, 0.381822f}, {0.100969f, 0.042712f, 0.363792f}, + {0.096394f, 0.003944f, 0.364084f}, {0.142891f, 0.111766f, 0.365137f}, + {0.142891f, 0.111766f, 0.365137f}, {0.096394f, 0.003944f, 0.364084f}, + {0.092054f, 0.121642f, 0.384333f}, {0.046608f, -0.145926f, 0.340170f}, + {0.026448f, -0.157020f, 0.339667f}, {0.060765f, -0.095509f, 0.368646f}, + {-0.088973f, -0.121204f, 0.381822f}, {-0.076426f, -0.192884f, 0.325616f}, + {-0.116337f, -0.126779f, 0.356972f}, {-0.104743f, -0.111724f, 0.293694f}, + {-0.116337f, -0.126779f, 0.356972f}, {-0.104228f, -0.165174f, 0.337607f}, + {-0.094904f, -0.129069f, 0.312433f}, {-0.104743f, -0.111724f, 0.293694f}, + {-0.104228f, -0.165174f, 0.337607f}, {-0.077283f, -0.175418f, 0.316832f}, + {-0.094904f, -0.129069f, 0.312433f}, {-0.104228f, -0.165174f, 0.337607f}, + {-0.104228f, -0.165174f, 0.337607f}, {-0.116337f, -0.126779f, 0.356972f}, + {-0.076426f, -0.192884f, 0.325616f}, {-0.075522f, -0.108091f, 0.248564f}, + {-0.104743f, -0.111724f, 0.293694f}, {-0.094904f, -0.129069f, 0.312433f}, + {0.112453f, -0.040719f, 0.355112f}, {0.096394f, 0.003944f, 0.364084f}, + {0.100969f, 0.042712f, 0.363792f}, {0.112453f, -0.040719f, 0.355112f}, + {0.066319f, -0.057457f, 0.376144f}, {0.096394f, 0.003944f, 0.364084f}, + {0.125007f, -0.085296f, 0.349489f}, {0.060765f, -0.095509f, 0.368646f}, + {0.112453f, -0.040719f, 0.355112f}, {0.112453f, -0.040719f, 0.355112f}, + {0.060765f, -0.095509f, 0.368646f}, {0.066319f, -0.057457f, 0.376144f}, + {0.026448f, -0.157020f, 0.339667f}, {-0.024666f, -0.217238f, 0.332742f}, + {-0.076426f, -0.192884f, 0.325616f}, {-0.075522f, -0.108091f, 0.248564f}, + {-0.032919f, -0.130421f, 0.254410f}, {0.004368f, -0.124361f, 0.220649f}, + {0.004368f, -0.124361f, 0.220649f}, {-0.032919f, -0.130421f, 0.254410f}, + {0.009331f, -0.168087f, 0.282574f}, {-0.077283f, -0.175418f, 0.316832f}, + {-0.075522f, -0.108091f, 0.248564f}, {-0.094904f, -0.129069f, 0.312433f}, + {-0.077283f, -0.175418f, 0.316832f}, {-0.032919f, -0.130421f, 0.254410f}, + {-0.075522f, -0.108091f, 0.248564f}, {-0.077283f, -0.175418f, 0.316832f}, + {0.009331f, -0.168087f, 0.282574f}, {-0.032919f, -0.130421f, 0.254410f}, + {0.132617f, -0.167078f, 0.346294f}, {0.060765f, -0.095509f, 0.368646f}, + {0.125007f, -0.085296f, 0.349489f}, {0.132617f, -0.167078f, 0.346294f}, + {0.046608f, -0.145926f, 0.340170f}, {0.060765f, -0.095509f, 0.368646f}, + {-0.024666f, -0.217238f, 0.332742f}, {0.026448f, -0.157020f, 0.339667f}, + {0.043147f, -0.207479f, 0.326207f}, {0.043147f, -0.207479f, 0.326207f}, + {0.026448f, -0.157020f, 0.339667f}, {0.046608f, -0.145926f, 0.340170f}, + {-0.066588f, -0.204002f, 0.324637f}, {-0.076426f, -0.192884f, 0.325616f}, + {-0.024666f, -0.217238f, 0.332742f}, {-0.024666f, -0.217238f, 0.332742f}, + {-0.081501f, -0.256777f, 0.360540f}, {-0.066588f, -0.204002f, 0.324637f}, + {-0.098582f, -0.220776f, 0.328576f}, {-0.076426f, -0.192884f, 0.325616f}, + {-0.081501f, -0.256777f, 0.360540f}, {-0.076426f, -0.192884f, 0.325616f}, + {-0.098582f, -0.220776f, 0.328576f}, {-0.104228f, -0.165174f, 0.337607f}, + {-0.066588f, -0.204002f, 0.324637f}, {-0.081501f, -0.256777f, 0.360540f}, + {-0.076426f, -0.192884f, 0.325616f}, {0.112983f, -0.197888f, 0.341171f}, + {0.046608f, -0.145926f, 0.340170f}, {0.132617f, -0.167078f, 0.346294f}, + {0.043147f, -0.207479f, 0.326207f}, {0.046608f, -0.145926f, 0.340170f}, + {0.112983f, -0.197888f, 0.341171f}, {-0.077283f, -0.175418f, 0.316832f}, + {-0.076426f, -0.192884f, 0.325616f}, {-0.081501f, -0.256777f, 0.360540f}, + {-0.077283f, -0.175418f, 0.316832f}, {-0.104228f, -0.165174f, 0.337607f}, + {-0.098582f, -0.220776f, 0.328576f}, {-0.076426f, -0.192884f, 0.325616f}, + {-0.077283f, -0.175418f, 0.316832f}, {-0.098582f, -0.220776f, 0.328576f}, + {-0.008683f, -0.203947f, 0.322526f}, {0.009331f, -0.168087f, 0.282574f}, + {-0.024666f, -0.217238f, 0.332742f}, {0.009331f, -0.168087f, 0.282574f}, + {-0.077283f, -0.175418f, 0.316832f}, {-0.081501f, -0.256777f, 0.360540f}, + {-0.081501f, -0.256777f, 0.360540f}, {-0.024666f, -0.217238f, 0.332742f}, + {0.009331f, -0.168087f, 0.282574f}, {0.179721f, 0.062086f, 0.381562f}, + {0.142891f, 0.111766f, 0.365137f}, {0.181134f, 0.104308f, 0.385340f}, + {0.179721f, 0.062086f, 0.381562f}, {0.100969f, 0.042712f, 0.363792f}, + {0.142891f, 0.111766f, 0.365137f}, {0.174508f, -0.023827f, 0.381969f}, + {0.112453f, -0.040719f, 0.355112f}, {0.179721f, 0.062086f, 0.381562f}, + {0.179721f, 0.062086f, 0.381562f}, {0.112453f, -0.040719f, 0.355112f}, + {0.100969f, 0.042712f, 0.363792f}, {0.170862f, -0.107936f, 0.378486f}, + {0.112453f, -0.040719f, 0.355112f}, {0.174508f, -0.023827f, 0.381969f}, + {0.170862f, -0.107936f, 0.378486f}, {0.125007f, -0.085296f, 0.349489f}, + {0.112453f, -0.040719f, 0.355112f}, {0.163224f, -0.147754f, 0.373968f}, + {0.132617f, -0.167078f, 0.346294f}, {0.170862f, -0.107936f, 0.378486f}, + {0.170862f, -0.107936f, 0.378486f}, {0.132617f, -0.167078f, 0.346294f}, + {0.125007f, -0.085296f, 0.349489f}, {-0.005216f, -0.266256f, 0.343910f}, + {-0.024666f, -0.217238f, 0.332742f}, {0.059361f, -0.263459f, 0.362001f}, + {0.059361f, -0.263459f, 0.362001f}, {-0.024666f, -0.217238f, 0.332742f}, + {0.043147f, -0.207479f, 0.326207f}, {-0.037718f, -0.276171f, 0.358543f}, + {-0.081501f, -0.256777f, 0.360540f}, {-0.024666f, -0.217238f, 0.332742f}, + {-0.024666f, -0.217238f, 0.332742f}, {-0.005216f, -0.266256f, 0.343910f}, + {-0.037718f, -0.276171f, 0.358543f}, {-0.106992f, -0.262287f, 0.349994f}, + {-0.081501f, -0.256777f, 0.360540f}, {-0.037718f, -0.276171f, 0.358543f}, + {-0.081501f, -0.256777f, 0.360540f}, {-0.106992f, -0.262287f, 0.349994f}, + {-0.098582f, -0.220776f, 0.328576f}, {0.189265f, 0.014700f, 0.405084f}, + {0.179721f, 0.062086f, 0.381562f}, {0.192401f, 0.102763f, 0.450311f}, + {0.192401f, 0.102763f, 0.450311f}, {0.179721f, 0.062086f, 0.381562f}, + {0.181134f, 0.104308f, 0.385340f}, {0.186794f, -0.028377f, 0.406230f}, + {0.174508f, -0.023827f, 0.381969f}, {0.189265f, 0.014700f, 0.405084f}, + {0.189265f, 0.014700f, 0.405084f}, {0.174508f, -0.023827f, 0.381969f}, + {0.179721f, 0.062086f, 0.381562f}, {0.189374f, -0.117511f, 0.434152f}, + {0.170862f, -0.107936f, 0.378486f}, {0.186794f, -0.028377f, 0.406230f}, + {0.186794f, -0.028377f, 0.406230f}, {0.170862f, -0.107936f, 0.378486f}, + {0.174508f, -0.023827f, 0.381969f}, {0.180354f, -0.160444f, 0.433432f}, + {0.163224f, -0.147754f, 0.373968f}, {0.189374f, -0.117511f, 0.434152f}, + {0.189374f, -0.117511f, 0.434152f}, {0.163224f, -0.147754f, 0.373968f}, + {0.170862f, -0.107936f, 0.378486f}, {0.102908f, -0.259200f, 0.395727f}, + {0.132617f, -0.167078f, 0.346294f}, {0.180354f, -0.160444f, 0.433432f}, + {0.180354f, -0.160444f, 0.433432f}, {0.132617f, -0.167078f, 0.346294f}, + {0.163224f, -0.147754f, 0.373968f}, {0.102908f, -0.259200f, 0.395727f}, + {0.112983f, -0.197888f, 0.341171f}, {0.132617f, -0.167078f, 0.346294f}, + {0.102908f, -0.259200f, 0.395727f}, {0.043147f, -0.207479f, 0.326207f}, + {0.112983f, -0.197888f, 0.341171f}, {0.065472f, -0.284820f, 0.430177f}, + {0.059361f, -0.263459f, 0.362001f}, {0.102908f, -0.259200f, 0.395727f}, + {0.102908f, -0.259200f, 0.395727f}, {0.059361f, -0.263459f, 0.362001f}, + {0.043147f, -0.207479f, 0.326207f}, {0.025294f, -0.298244f, 0.429898f}, + {-0.005216f, -0.266256f, 0.343910f}, {0.065472f, -0.284820f, 0.430177f}, + {0.065472f, -0.284820f, 0.430177f}, {-0.005216f, -0.266256f, 0.343910f}, + {0.059361f, -0.263459f, 0.362001f}, {0.025294f, -0.298244f, 0.429898f}, + {-0.062057f, -0.301063f, 0.408702f}, {-0.037718f, -0.276171f, 0.358543f}, + {-0.005216f, -0.266256f, 0.343910f}, {0.025294f, -0.298244f, 0.429898f}, + {-0.037718f, -0.276171f, 0.358543f}, {0.164912f, -0.200796f, 0.432580f}, + {0.102908f, -0.259200f, 0.395727f}, {0.180354f, -0.160444f, 0.433432f}, + {0.065472f, -0.284820f, 0.430177f}, {0.102908f, -0.259200f, 0.395727f}, + {0.105493f, -0.264449f, 0.430840f}, {-0.111146f, -0.290201f, 0.406636f}, + {-0.037718f, -0.276171f, 0.358543f}, {-0.062057f, -0.301063f, 0.408702f}, + {-0.037718f, -0.276171f, 0.358543f}, {-0.111146f, -0.290201f, 0.406636f}, + {-0.106992f, -0.262287f, 0.349994f}, {0.198832f, 0.143810f, 0.433749f}, + {0.163968f, 0.167990f, 0.461420f}, {0.178298f, 0.106376f, 0.471320f}, + {0.163968f, 0.167990f, 0.461420f}, {0.157324f, 0.149704f, 0.469691f}, + {0.132595f, 0.075979f, 0.502449f}, {0.157324f, 0.149704f, 0.469691f}, + {0.093801f, 0.154547f, 0.455308f}, {0.077541f, 0.090817f, 0.455719f}, + {0.076853f, 0.159067f, 0.432497f}, {0.097574f, 0.151120f, 0.385996f}, + {0.092054f, 0.121642f, 0.384333f}, {0.097574f, 0.151120f, 0.385996f}, + {0.137804f, 0.173277f, 0.376054f}, {0.142891f, 0.111766f, 0.365137f}, + {0.137804f, 0.173277f, 0.376054f}, {0.173451f, 0.180724f, 0.382212f}, + {0.181134f, 0.104308f, 0.385340f}, {0.173451f, 0.180724f, 0.382212f}, + {0.198832f, 0.143810f, 0.433749f}, {0.181134f, 0.104308f, 0.385340f}, + {-0.147168f, -0.085620f, 0.215947f}, {-0.166414f, -0.088964f, 0.238733f}, + {-0.104743f, -0.111724f, 0.293694f}, {-0.241642f, -0.103722f, 0.298771f}, + {-0.263218f, -0.116928f, 0.324979f}, {-0.192117f, -0.124391f, 0.375139f}, + {-0.263218f, -0.116928f, 0.324979f}, {-0.292608f, -0.161980f, 0.375790f}, + {-0.210728f, -0.147052f, 0.404630f}, {-0.292608f, -0.161980f, 0.375790f}, + {-0.302821f, -0.194571f, 0.394099f}, {-0.255827f, -0.186573f, 0.407580f}, + {-0.302821f, -0.194571f, 0.394099f}, {-0.332758f, -0.213138f, 0.390733f}, + {-0.264678f, -0.250049f, 0.422652f}, {-0.332758f, -0.213138f, 0.390733f}, + {-0.332791f, -0.291448f, 0.397380f}, {-0.264678f, -0.250049f, 0.422652f}, + {0.178298f, 0.106376f, 0.471320f}, {0.192401f, 0.102763f, 0.450311f}, + {0.198832f, 0.143810f, 0.433749f}, {0.132595f, 0.075979f, 0.502449f}, + {0.178298f, 0.106376f, 0.471320f}, {0.163968f, 0.167990f, 0.461420f}, + {-0.177267f, -0.285820f, 0.431560f}, {-0.238253f, -0.289343f, 0.423071f}, + {-0.215595f, -0.327438f, 0.412834f}, {-0.238253f, -0.289343f, 0.423071f}, + {-0.264678f, -0.250049f, 0.422652f}, {-0.332791f, -0.291448f, 0.397380f}, + {-0.264678f, -0.250049f, 0.422652f}, {-0.255827f, -0.186573f, 0.407580f}, + {-0.302821f, -0.194571f, 0.394099f}, {0.077541f, 0.090817f, 0.455719f}, + {0.132595f, 0.075979f, 0.502449f}, {0.157324f, 0.149704f, 0.469691f}, + {-0.210728f, -0.147052f, 0.404630f}, {-0.192117f, -0.124391f, 0.375139f}, + {-0.263218f, -0.116928f, 0.324979f}, {0.078665f, 0.090483f, 0.401198f}, + {0.076853f, 0.159067f, 0.432497f}, {0.092054f, 0.121642f, 0.384333f}, + {-0.183628f, -0.106776f, 0.311577f}, {-0.104743f, -0.111724f, 0.293694f}, + {-0.166414f, -0.088964f, 0.238733f}, {-0.104743f, -0.111724f, 0.293694f}, + {-0.075522f, -0.108091f, 0.248564f}, {-0.147168f, -0.085620f, 0.215947f}, + {0.142891f, 0.111766f, 0.365137f}, {0.092054f, 0.121642f, 0.384333f}, + {0.097574f, 0.151120f, 0.385996f}, {0.004368f, -0.124361f, 0.220649f}, + {-0.019773f, -0.099603f, 0.173257f}, {-0.075522f, -0.108091f, 0.248564f}, + {0.181134f, 0.104308f, 0.385340f}, {0.142891f, 0.111766f, 0.365137f}, + {0.137804f, 0.173277f, 0.376054f}, {0.192401f, 0.102763f, 0.450311f}, + {0.181134f, 0.104308f, 0.385340f}, {0.198832f, 0.143810f, 0.433749f}, + {0.077541f, 0.090817f, 0.455719f}, {0.093801f, 0.154547f, 0.455308f}, + {0.076853f, 0.159067f, 0.432497f}, {0.009331f, -0.168087f, 0.282574f}, + {0.007341f, -0.138552f, 0.245721f}, {0.004368f, -0.124361f, 0.220649f}, + {-0.183628f, -0.106776f, 0.311577f}, {-0.241642f, -0.103722f, 0.298771f}, + {-0.192117f, -0.124391f, 0.375139f}, {-0.292608f, -0.161980f, 0.375790f}, + {-0.255827f, -0.186573f, 0.407580f}, {-0.210728f, -0.147052f, 0.404630f}, + {0.100238f, 0.292530f, 0.345014f}, {0.144718f, 0.245703f, 0.360360f}, + {0.090277f, 0.241053f, 0.379391f}, {0.090277f, 0.241053f, 0.379391f}, + {0.073742f, 0.264260f, 0.366811f}, {0.100238f, 0.292530f, 0.345014f}, + {0.100238f, 0.292530f, 0.345014f}, {0.224844f, 0.321542f, 0.381851f}, + {0.144718f, 0.245703f, 0.360360f}, {0.178925f, 0.219842f, 0.374929f}, + {0.173451f, 0.180724f, 0.382212f}, {0.137804f, 0.173277f, 0.376054f}, + {0.144718f, 0.245703f, 0.360360f}, {0.178925f, 0.219842f, 0.374929f}, + {0.137804f, 0.173277f, 0.376054f}, {0.224844f, 0.321542f, 0.381851f}, + {0.178925f, 0.219842f, 0.374929f}, {0.144718f, 0.245703f, 0.360360f}, + {0.072391f, 0.309744f, 0.301789f}, {0.075226f, 0.327221f, 0.310529f}, + {0.073742f, 0.264260f, 0.366811f}, {0.178925f, 0.219842f, 0.374929f}, + {0.198832f, 0.143810f, 0.433749f}, {0.173451f, 0.180724f, 0.382212f}, + {0.218692f, 0.364927f, 0.375351f}, {0.100238f, 0.292530f, 0.345014f}, + {0.125847f, 0.372481f, 0.363354f}, {0.100238f, 0.292530f, 0.345014f}, + {0.218692f, 0.364927f, 0.375351f}, {0.224844f, 0.321542f, 0.381851f}, + {0.100238f, 0.292530f, 0.345014f}, {0.073742f, 0.264260f, 0.366811f}, + {0.125847f, 0.372481f, 0.363354f}, {0.073742f, 0.264260f, 0.366811f}, + {0.075226f, 0.327221f, 0.310529f}, {0.087033f, 0.337040f, 0.355232f}, + {0.178925f, 0.219842f, 0.374929f}, {0.213846f, 0.226346f, 0.401880f}, + {0.198832f, 0.143810f, 0.433749f}, {0.178925f, 0.219842f, 0.374929f}, + {0.224844f, 0.321542f, 0.381851f}, {0.213846f, 0.226346f, 0.401880f}, + {0.087033f, 0.337040f, 0.355232f}, {0.125847f, 0.372481f, 0.363354f}, + {0.073742f, 0.264260f, 0.366811f}, {0.203835f, 0.312668f, 0.428433f}, + {0.213846f, 0.226346f, 0.401880f}, {0.224844f, 0.321542f, 0.381851f}, + {0.087033f, 0.337040f, 0.355232f}, {0.073742f, 0.264260f, 0.366811f}, + {0.082346f, 0.349859f, 0.401974f}, {0.082346f, 0.349859f, 0.401974f}, + {0.073742f, 0.264260f, 0.366811f}, {0.071884f, 0.272774f, 0.419164f}, + {0.073742f, 0.264260f, 0.366811f}, {0.087033f, 0.337040f, 0.355232f}, + {0.031744f, 0.327872f, 0.315833f}, {0.198832f, 0.143810f, 0.433749f}, + {0.213846f, 0.226346f, 0.401880f}, {0.163968f, 0.167990f, 0.461420f}, + {0.075226f, 0.327221f, 0.310529f}, {0.031744f, 0.327872f, 0.315833f}, + {0.087033f, 0.337040f, 0.355232f}, {0.106191f, 0.232493f, 0.435024f}, + {0.163968f, 0.167990f, 0.461420f}, {0.213846f, 0.226346f, 0.401880f}, + {0.163968f, 0.167990f, 0.461420f}, {0.106191f, 0.232493f, 0.435024f}, + {0.157324f, 0.149704f, 0.469691f}, {0.100878f, 0.301270f, 0.436906f}, + {0.203835f, 0.312668f, 0.428433f}, {0.224049f, 0.364554f, 0.402736f}, + {0.105476f, 0.347881f, 0.419554f}, {0.100878f, 0.301270f, 0.436906f}, + {0.224049f, 0.364554f, 0.402736f}, {0.071884f, 0.272774f, 0.419164f}, + {0.105476f, 0.347881f, 0.419554f}, {0.082346f, 0.349859f, 0.401974f}, + {0.100878f, 0.301270f, 0.436906f}, {0.105476f, 0.347881f, 0.419554f}, + {0.071884f, 0.272774f, 0.419164f}, {0.071884f, 0.272774f, 0.419164f}, + {0.073742f, 0.264260f, 0.366811f}, {0.031744f, 0.327872f, 0.315833f}, + {0.106191f, 0.232493f, 0.435024f}, {0.213846f, 0.226346f, 0.401880f}, + {0.203835f, 0.312668f, 0.428433f}, {0.203835f, 0.312668f, 0.428433f}, + {0.100878f, 0.301270f, 0.436906f}, {0.106191f, 0.232493f, 0.435024f}, + {0.072391f, 0.309744f, 0.301789f}, {0.031744f, 0.327872f, 0.315833f}, + {0.075226f, 0.327221f, 0.310529f}, {0.157324f, 0.149704f, 0.469691f}, + {0.106191f, 0.232493f, 0.435024f}, {0.076853f, 0.159067f, 0.432497f}, + {0.071884f, 0.272774f, 0.419164f}, {0.106191f, 0.232493f, 0.435024f}, + {0.100878f, 0.301270f, 0.436906f}, {0.076853f, 0.159067f, 0.432497f}, + {0.106191f, 0.232493f, 0.435024f}, {0.086215f, 0.245936f, 0.414467f}, + {0.071884f, 0.272774f, 0.419164f}, {0.086215f, 0.245936f, 0.414467f}, + {0.106191f, 0.232493f, 0.435024f}, {0.073742f, 0.264260f, 0.366811f}, + {0.086215f, 0.245936f, 0.414467f}, {0.071884f, 0.272774f, 0.419164f}, + {0.073742f, 0.264260f, 0.366811f}, {0.090277f, 0.241053f, 0.379391f}, + {0.086215f, 0.245936f, 0.414467f}, {0.031744f, 0.327872f, 0.315833f}, + {0.072391f, 0.309744f, 0.301789f}, {0.073742f, 0.264260f, 0.366811f}, + {0.137804f, 0.173277f, 0.376054f}, {0.090277f, 0.241053f, 0.379391f}, + {0.144718f, 0.245703f, 0.360360f}, {0.090277f, 0.241053f, 0.379391f}, + {0.137804f, 0.173277f, 0.376054f}, {0.076853f, 0.159067f, 0.432497f}, + {0.086215f, 0.245936f, 0.414467f}, {0.090277f, 0.241053f, 0.379391f}, + {0.076853f, 0.159067f, 0.432497f}, {0.157324f, 0.149704f, 0.469691f}, + {0.076853f, 0.159067f, 0.432497f}, {0.093801f, 0.154547f, 0.455308f}, + {0.076853f, 0.159067f, 0.432497f}, {0.137804f, 0.173277f, 0.376054f}, + {0.097574f, 0.151120f, 0.385996f}, {0.245224f, 0.302361f, 0.397077f}, + {0.224049f, 0.364554f, 0.402736f}, {0.203835f, 0.312668f, 0.428433f}, + {0.105476f, 0.347881f, 0.419554f}, {0.125847f, 0.372481f, 0.363354f}, + {0.140576f, 0.434851f, 0.338246f}, {0.082346f, 0.349859f, 0.401974f}, + {0.105476f, 0.347881f, 0.419554f}, {0.094745f, 0.413346f, 0.374057f}, + {0.094745f, 0.413346f, 0.374057f}, {0.105476f, 0.347881f, 0.419554f}, + {0.140576f, 0.434851f, 0.338246f}, {0.094745f, 0.413346f, 0.374057f}, + {0.087033f, 0.337040f, 0.355232f}, {0.082346f, 0.349859f, 0.401974f}, + {0.111453f, 0.444682f, 0.302121f}, {0.116305f, 0.456438f, 0.325072f}, + {0.140576f, 0.434851f, 0.338246f}, {0.118966f, 0.456137f, 0.317268f}, + {0.111453f, 0.444682f, 0.302121f}, {0.116305f, 0.456438f, 0.325072f}, + {0.140576f, 0.434851f, 0.338246f}, {0.111453f, 0.444682f, 0.302121f}, + {0.094745f, 0.413346f, 0.374057f}, {0.094745f, 0.413346f, 0.374057f}, + {0.111453f, 0.444682f, 0.302121f}, {0.097266f, 0.418123f, 0.313772f}, + {0.140576f, 0.434851f, 0.338246f}, {0.111453f, 0.444682f, 0.302121f}, + {0.125847f, 0.372481f, 0.363354f}, {0.087033f, 0.337040f, 0.355232f}, + {0.140576f, 0.434851f, 0.338246f}, {0.125847f, 0.372481f, 0.363354f}, + {0.087033f, 0.337040f, 0.355232f}, {0.094745f, 0.413346f, 0.374057f}, + {0.140576f, 0.434851f, 0.338246f}, {0.171989f, 0.457261f, 0.339601f}, + {0.140576f, 0.434851f, 0.338246f}, {0.168853f, 0.455869f, 0.352221f}, + {0.218692f, 0.364927f, 0.375351f}, {0.140576f, 0.434851f, 0.338246f}, + {0.168853f, 0.455869f, 0.352221f}, {0.224049f, 0.364554f, 0.402736f}, + {0.218692f, 0.364927f, 0.375351f}, {0.168853f, 0.455869f, 0.352221f}, + {0.170697f, 0.392613f, 0.398557f}, {0.224049f, 0.364554f, 0.402736f}, + {0.168853f, 0.455869f, 0.352221f}, {0.168853f, 0.455869f, 0.352221f}, + {0.158039f, 0.395383f, 0.390222f}, {0.170697f, 0.392613f, 0.398557f}, + {0.158039f, 0.395383f, 0.390222f}, {0.168853f, 0.455869f, 0.352221f}, + {0.140576f, 0.434851f, 0.338246f}, {0.218692f, 0.364927f, 0.375351f}, + {0.125847f, 0.372481f, 0.363354f}, {0.140576f, 0.434851f, 0.338246f}, + {0.170697f, 0.392613f, 0.398557f}, {0.105476f, 0.347881f, 0.419554f}, + {0.224049f, 0.364554f, 0.402736f}, {0.158039f, 0.395383f, 0.390222f}, + {0.105476f, 0.347881f, 0.419554f}, {0.170697f, 0.392613f, 0.398557f}, + {0.105476f, 0.347881f, 0.419554f}, {0.158039f, 0.395383f, 0.390222f}, + {0.140576f, 0.434851f, 0.338246f}, {0.245224f, 0.302361f, 0.397077f}, + {0.224844f, 0.321542f, 0.381851f}, {0.218692f, 0.364927f, 0.375351f}, + {0.244755f, 0.370089f, 0.343383f}, {0.231071f, 0.356882f, 0.396296f}, + {0.224049f, 0.364554f, 0.402736f}, {0.218692f, 0.364927f, 0.375351f}, + {0.224049f, 0.364554f, 0.402736f}, {0.245224f, 0.302361f, 0.397077f}, + {0.224049f, 0.364554f, 0.402736f}, {0.218692f, 0.364927f, 0.375351f}, + {0.244755f, 0.370089f, 0.343383f}, {0.168853f, 0.455869f, 0.352221f}, + {0.236185f, 0.396084f, 0.324371f}, {0.233489f, 0.408364f, 0.361071f}, + {0.233489f, 0.408364f, 0.361071f}, {0.236185f, 0.396084f, 0.324371f}, + {0.244755f, 0.370089f, 0.343383f}, {0.233489f, 0.408364f, 0.361071f}, + {0.218692f, 0.364927f, 0.375351f}, {0.168853f, 0.455869f, 0.352221f}, + {0.218692f, 0.364927f, 0.375351f}, {0.233489f, 0.408364f, 0.361071f}, + {0.244755f, 0.370089f, 0.343383f}, {0.235468f, 0.292809f, 0.378970f}, + {0.224844f, 0.321542f, 0.381851f}, {0.244755f, 0.370089f, 0.343383f}, + {0.218692f, 0.364927f, 0.375351f}, {0.244755f, 0.370089f, 0.343383f}, + {0.224844f, 0.321542f, 0.381851f}, {0.245224f, 0.302361f, 0.397077f}, + {0.235468f, 0.292809f, 0.378970f}, {0.244755f, 0.370089f, 0.343383f}, + {0.245224f, 0.302361f, 0.397077f}, {0.244755f, 0.370089f, 0.343383f}, + {0.231071f, 0.356882f, 0.396296f}, {0.244755f, 0.370089f, 0.343383f}, + {0.218692f, 0.364927f, 0.375351f}, {0.245224f, 0.302361f, 0.397077f}, + {0.245224f, 0.302361f, 0.397077f}, {0.224844f, 0.321542f, 0.381851f}, + {0.235468f, 0.292809f, 0.378970f}, {0.224844f, 0.321542f, 0.381851f}, + {0.235468f, 0.292809f, 0.378970f}, {0.203835f, 0.312668f, 0.428433f}, + {0.245224f, 0.302361f, 0.397077f}, {0.203835f, 0.312668f, 0.428433f}, + {0.235468f, 0.292809f, 0.378970f}, {0.464039f, -0.418657f, 0.141699f}, + {0.503896f, -0.419118f, 0.106868f}, {0.440027f, -0.395373f, 0.118574f}, + {0.464039f, -0.418657f, 0.141699f}, {0.499703f, -0.416660f, 0.141487f}, + {0.503896f, -0.419118f, 0.106868f}, {0.499703f, -0.416660f, 0.141487f}, + {0.464039f, -0.418657f, 0.141699f}, {0.487713f, -0.414396f, 0.194702f}, + {0.524408f, -0.338867f, 0.161547f}, {0.499703f, -0.416660f, 0.141487f}, + {0.487713f, -0.414396f, 0.194702f}, {0.487713f, -0.414396f, 0.194702f}, + {0.512066f, -0.342428f, 0.259328f}, {0.524408f, -0.338867f, 0.161547f}, + {0.487713f, -0.414396f, 0.194702f}, {0.464039f, -0.418657f, 0.141699f}, + {0.469969f, -0.465363f, 0.224098f}, {0.487713f, -0.414396f, 0.194702f}, + {0.518994f, -0.425438f, 0.257654f}, {0.512066f, -0.342428f, 0.259328f}, + {0.469969f, -0.465363f, 0.224098f}, {0.494446f, -0.459193f, 0.242959f}, + {0.487713f, -0.414396f, 0.194702f}, {0.518994f, -0.425438f, 0.257654f}, + {0.487713f, -0.414396f, 0.194702f}, {0.494446f, -0.459193f, 0.242959f}, + {0.467798f, -0.560190f, 0.278831f}, {0.526052f, -0.543999f, 0.274603f}, + {0.469969f, -0.465363f, 0.224098f}, {0.469969f, -0.465363f, 0.224098f}, + {0.526052f, -0.543999f, 0.274603f}, {0.513155f, -0.478561f, 0.260600f}, + {0.494446f, -0.459193f, 0.242959f}, {0.469969f, -0.465363f, 0.224098f}, + {0.513155f, -0.478561f, 0.260600f}, {0.518994f, -0.425438f, 0.257654f}, + {0.494446f, -0.459193f, 0.242959f}, {0.513155f, -0.478561f, 0.260600f}, + {0.505459f, -0.646147f, 0.302026f}, {0.467798f, -0.560190f, 0.278831f}, + {0.435241f, -0.592881f, 0.299367f}, {0.505459f, -0.646147f, 0.302026f}, + {0.526052f, -0.543999f, 0.274603f}, {0.467798f, -0.560190f, 0.278831f}, + {0.545442f, -0.429782f, 0.271112f}, {0.518994f, -0.425438f, 0.257654f}, + {0.513155f, -0.478561f, 0.260600f}, {0.548194f, -0.338697f, 0.279463f}, + {0.512066f, -0.342428f, 0.259328f}, {0.518994f, -0.425438f, 0.257654f}, + {0.518994f, -0.425438f, 0.257654f}, {0.545442f, -0.429782f, 0.271112f}, + {0.548194f, -0.338697f, 0.279463f}, {0.505459f, -0.646147f, 0.302026f}, + {0.561908f, -0.545868f, 0.269837f}, {0.526052f, -0.543999f, 0.274603f}, + {0.513155f, -0.478561f, 0.260600f}, {0.526052f, -0.543999f, 0.274603f}, + {0.561908f, -0.545868f, 0.269837f}, {0.561908f, -0.545868f, 0.269837f}, + {0.606443f, -0.479804f, 0.263402f}, {0.513155f, -0.478561f, 0.260600f}, + {0.606454f, -0.420102f, 0.274100f}, {0.545442f, -0.429782f, 0.271112f}, + {0.606443f, -0.479804f, 0.263402f}, {0.606443f, -0.479804f, 0.263402f}, + {0.545442f, -0.429782f, 0.271112f}, {0.513155f, -0.478561f, 0.260600f}, + {0.597133f, -0.359606f, 0.281943f}, {0.548194f, -0.338697f, 0.279463f}, + {0.545442f, -0.429782f, 0.271112f}, {0.545442f, -0.429782f, 0.271112f}, + {0.606454f, -0.420102f, 0.274100f}, {0.597133f, -0.359606f, 0.281943f}, + {0.603536f, -0.543671f, 0.257522f}, {0.561908f, -0.545868f, 0.269837f}, + {0.601267f, -0.604461f, 0.264327f}, {0.601267f, -0.604461f, 0.264327f}, + {0.561908f, -0.545868f, 0.269837f}, {0.505459f, -0.646147f, 0.302026f}, + {0.603536f, -0.543671f, 0.257522f}, {0.606443f, -0.479804f, 0.263402f}, + {0.561908f, -0.545868f, 0.269837f}, {0.676518f, -0.536839f, 0.208727f}, + {0.603536f, -0.543671f, 0.257522f}, {0.647577f, -0.603970f, 0.242052f}, + {0.647577f, -0.603970f, 0.242052f}, {0.603536f, -0.543671f, 0.257522f}, + {0.601267f, -0.604461f, 0.264327f}, {0.638354f, -0.477243f, 0.249196f}, + {0.603536f, -0.543671f, 0.257522f}, {0.676518f, -0.536839f, 0.208727f}, + {0.603536f, -0.543671f, 0.257522f}, {0.638354f, -0.477243f, 0.249196f}, + {0.606443f, -0.479804f, 0.263402f}, {0.633233f, -0.416557f, 0.263481f}, + {0.606443f, -0.479804f, 0.263402f}, {0.638354f, -0.477243f, 0.249196f}, + {0.606443f, -0.479804f, 0.263402f}, {0.633233f, -0.416557f, 0.263481f}, + {0.606454f, -0.420102f, 0.274100f}, {0.619915f, -0.355237f, 0.273543f}, + {0.606454f, -0.420102f, 0.274100f}, {0.633233f, -0.416557f, 0.263481f}, + {0.606454f, -0.420102f, 0.274100f}, {0.619915f, -0.355237f, 0.273543f}, + {0.597133f, -0.359606f, 0.281943f}, {0.676518f, -0.536839f, 0.208727f}, + {0.647577f, -0.603970f, 0.242052f}, {0.689975f, -0.599189f, 0.204332f}, + {0.638354f, -0.477243f, 0.249196f}, {0.672723f, -0.408883f, 0.214860f}, + {0.633233f, -0.416557f, 0.263481f}, {0.641909f, -0.351023f, 0.255692f}, + {0.633233f, -0.416557f, 0.263481f}, {0.672723f, -0.408883f, 0.214860f}, + {0.633233f, -0.416557f, 0.263481f}, {0.641909f, -0.351023f, 0.255692f}, + {0.619915f, -0.355237f, 0.273543f}, {0.689975f, -0.599189f, 0.204332f}, + {0.742464f, -0.591913f, 0.129906f}, {0.700597f, -0.527910f, 0.175787f}, + {0.676518f, -0.536839f, 0.208727f}, {0.689975f, -0.599189f, 0.204332f}, + {0.700597f, -0.527910f, 0.175787f}, {0.686774f, -0.482371f, 0.152911f}, + {0.685216f, -0.467132f, 0.196870f}, {0.638354f, -0.477243f, 0.249196f}, + {0.676518f, -0.536839f, 0.208727f}, {0.700597f, -0.527910f, 0.175787f}, + {0.686774f, -0.482371f, 0.152911f}, {0.638354f, -0.477243f, 0.249196f}, + {0.676518f, -0.536839f, 0.208727f}, {0.686774f, -0.482371f, 0.152911f}, + {0.638354f, -0.477243f, 0.249196f}, {0.685216f, -0.467132f, 0.196870f}, + {0.672723f, -0.408883f, 0.214860f}, {0.675741f, -0.435348f, 0.165633f}, + {0.685216f, -0.467132f, 0.196870f}, {0.686774f, -0.482371f, 0.152911f}, + {0.685216f, -0.467132f, 0.196870f}, {0.675741f, -0.435348f, 0.165633f}, + {0.672723f, -0.408883f, 0.214860f}, {0.641909f, -0.351023f, 0.255692f}, + {0.672723f, -0.408883f, 0.214860f}, {0.644879f, -0.376380f, 0.167291f}, + {0.672723f, -0.408883f, 0.214860f}, {0.675741f, -0.435348f, 0.165633f}, + {0.644879f, -0.376380f, 0.167291f}, {0.742464f, -0.591913f, 0.129906f}, + {0.725466f, -0.549910f, 0.117326f}, {0.700597f, -0.527910f, 0.175787f}, + {0.725466f, -0.549910f, 0.117326f}, {0.742464f, -0.591913f, 0.129906f}, + {0.770297f, -0.623219f, 0.094728f}, {0.686774f, -0.482371f, 0.152911f}, + {0.700597f, -0.527910f, 0.175787f}, {0.725466f, -0.549910f, 0.117326f}, + {0.664395f, -0.486457f, 0.150271f}, {0.675741f, -0.435348f, 0.165633f}, + {0.686774f, -0.482371f, 0.152911f}, {0.633953f, -0.321082f, 0.191574f}, + {0.641909f, -0.351023f, 0.255692f}, {0.644879f, -0.376380f, 0.167291f}, + {0.641909f, -0.351023f, 0.255692f}, {0.633953f, -0.321082f, 0.191574f}, + {0.626102f, -0.289908f, 0.209634f}, {0.725466f, -0.549910f, 0.117326f}, + {0.693869f, -0.505420f, 0.099781f}, {0.664395f, -0.486457f, 0.150271f}, + {0.664395f, -0.486457f, 0.150271f}, {0.686774f, -0.482371f, 0.152911f}, + {0.725466f, -0.549910f, 0.117326f}, {0.675741f, -0.435348f, 0.165633f}, + {0.615859f, -0.345183f, 0.162910f}, {0.644879f, -0.376380f, 0.167291f}, + {0.578148f, -0.271692f, 0.158037f}, {0.633953f, -0.321082f, 0.191574f}, + {0.615859f, -0.345183f, 0.162910f}, {0.615859f, -0.345183f, 0.162910f}, + {0.633953f, -0.321082f, 0.191574f}, {0.644879f, -0.376380f, 0.167291f}, + {0.693869f, -0.505420f, 0.099781f}, {0.667875f, -0.494357f, 0.117842f}, + {0.664395f, -0.486457f, 0.150271f}, {0.595557f, -0.455054f, 0.134553f}, + {0.675741f, -0.435348f, 0.165633f}, {0.664395f, -0.486457f, 0.150271f}, + {0.615859f, -0.345183f, 0.162910f}, {0.675741f, -0.435348f, 0.165633f}, + {0.595557f, -0.455054f, 0.134553f}, {0.599688f, -0.458945f, 0.125524f}, + {0.664395f, -0.486457f, 0.150271f}, {0.667875f, -0.494357f, 0.117842f}, + {0.595557f, -0.455054f, 0.134553f}, {0.609721f, -0.456537f, 0.146889f}, + {0.599688f, -0.458945f, 0.125524f}, {0.599688f, -0.458945f, 0.125524f}, + {0.609721f, -0.456537f, 0.146889f}, {0.664395f, -0.486457f, 0.150271f}, + {0.595557f, -0.455054f, 0.134553f}, {0.664395f, -0.486457f, 0.150271f}, + {0.609721f, -0.456537f, 0.146889f}, {0.499703f, -0.416660f, 0.141487f}, + {0.595557f, -0.455054f, 0.134553f}, {0.503896f, -0.419118f, 0.106868f}, + {0.503896f, -0.419118f, 0.106868f}, {0.595557f, -0.455054f, 0.134553f}, + {0.574343f, -0.443898f, 0.127927f}, {0.574343f, -0.443898f, 0.127927f}, + {0.595557f, -0.455054f, 0.134553f}, {0.599688f, -0.458945f, 0.125524f}, + {0.595557f, -0.455054f, 0.134553f}, {0.499703f, -0.416660f, 0.141487f}, + {0.524408f, -0.338867f, 0.161547f}, {0.615859f, -0.345183f, 0.162910f}, + {0.595557f, -0.455054f, 0.134553f}, {0.524408f, -0.338867f, 0.161547f}, + {0.487713f, -0.414396f, 0.194702f}, {0.419554f, -0.494469f, 0.248712f}, + {0.469969f, -0.465363f, 0.224098f}, {0.419554f, -0.494469f, 0.248712f}, + {0.418586f, -0.517778f, 0.265251f}, {0.469969f, -0.465363f, 0.224098f}, + {0.418586f, -0.517778f, 0.265251f}, {0.367921f, -0.536689f, 0.293184f}, + {0.467798f, -0.560190f, 0.278831f}, {0.534812f, -0.654828f, 0.297562f}, + {0.562744f, -0.660393f, 0.291692f}, {0.505459f, -0.646147f, 0.302026f}, + {0.562744f, -0.660393f, 0.291692f}, {0.636516f, -0.715392f, 0.278183f}, + {0.647577f, -0.603970f, 0.242052f}, {0.636516f, -0.715392f, 0.278183f}, + {0.656324f, -0.680370f, 0.259240f}, {0.647577f, -0.603970f, 0.242052f}, + {0.656324f, -0.680370f, 0.259240f}, {0.699804f, -0.664386f, 0.222474f}, + {0.689975f, -0.599189f, 0.204332f}, {0.699804f, -0.664386f, 0.222474f}, + {0.742165f, -0.690772f, 0.185737f}, {0.742464f, -0.591913f, 0.129906f}, + {0.742165f, -0.690772f, 0.185737f}, {0.754382f, -0.641772f, 0.143444f}, + {0.742464f, -0.591913f, 0.129906f}, {0.505571f, -0.270936f, 0.157994f}, + {0.578148f, -0.271692f, 0.158037f}, {0.524408f, -0.338867f, 0.161547f}, + {0.616432f, -0.280548f, 0.244818f}, {0.601863f, -0.295910f, 0.268799f}, + {0.626102f, -0.289908f, 0.209634f}, {0.601863f, -0.295910f, 0.268799f}, + {0.513371f, -0.274058f, 0.279083f}, {0.597133f, -0.359606f, 0.281943f}, + {0.513371f, -0.274058f, 0.279083f}, {0.489709f, -0.323488f, 0.234250f}, + {0.512066f, -0.342428f, 0.259328f}, {0.489709f, -0.323488f, 0.234250f}, + {0.470683f, -0.272389f, 0.208779f}, {0.512066f, -0.342428f, 0.259328f}, + {0.489709f, -0.323488f, 0.234250f}, {0.505571f, -0.270936f, 0.157994f}, + {0.524408f, -0.338867f, 0.161547f}, {0.524408f, -0.338867f, 0.161547f}, + {0.512066f, -0.342428f, 0.259328f}, {0.489709f, -0.323488f, 0.234250f}, + {0.512066f, -0.342428f, 0.259328f}, {0.548194f, -0.338697f, 0.279463f}, + {0.513371f, -0.274058f, 0.279083f}, {0.548194f, -0.338697f, 0.279463f}, + {0.597133f, -0.359606f, 0.281943f}, {0.513371f, -0.274058f, 0.279083f}, + {0.601267f, -0.604461f, 0.264327f}, {0.505459f, -0.646147f, 0.302026f}, + {0.562744f, -0.660393f, 0.291692f}, {0.647577f, -0.603970f, 0.242052f}, + {0.601267f, -0.604461f, 0.264327f}, {0.562744f, -0.660393f, 0.291692f}, + {0.597133f, -0.359606f, 0.281943f}, {0.619915f, -0.355237f, 0.273543f}, + {0.601863f, -0.295910f, 0.268799f}, {0.689975f, -0.599189f, 0.204332f}, + {0.647577f, -0.603970f, 0.242052f}, {0.656324f, -0.680370f, 0.259240f}, + {0.619915f, -0.355237f, 0.273543f}, {0.641909f, -0.351023f, 0.255692f}, + {0.626102f, -0.289908f, 0.209634f}, {0.742464f, -0.591913f, 0.129906f}, + {0.754382f, -0.641772f, 0.143444f}, {0.770297f, -0.623219f, 0.094728f}, + {0.615859f, -0.345183f, 0.162910f}, {0.524408f, -0.338867f, 0.161547f}, + {0.578148f, -0.271692f, 0.158037f}, {0.418586f, -0.517778f, 0.265251f}, + {0.467798f, -0.560190f, 0.278831f}, {0.469969f, -0.465363f, 0.224098f}, + {0.689975f, -0.599189f, 0.204332f}, {0.699804f, -0.664386f, 0.222474f}, + {0.742464f, -0.591913f, 0.129906f}, {0.667875f, -0.494357f, 0.117842f}, + {0.574343f, -0.443898f, 0.127927f}, {0.599688f, -0.458945f, 0.125524f}, + {0.626102f, -0.289908f, 0.209634f}, {0.601863f, -0.295910f, 0.268799f}, + {0.619915f, -0.355237f, 0.273543f}, {0.610492f, -0.254762f, 0.195736f}, + {0.583479f, -0.225726f, 0.278210f}, {0.601863f, -0.295910f, 0.268799f}, + {0.601863f, -0.295910f, 0.268799f}, {0.616432f, -0.280548f, 0.244818f}, + {0.610492f, -0.254762f, 0.195736f}, {0.671734f, -0.226293f, 0.202596f}, + {0.632198f, -0.215710f, 0.271850f}, {0.610492f, -0.254762f, 0.195736f}, + {0.610492f, -0.254762f, 0.195736f}, {0.632198f, -0.215710f, 0.271850f}, + {0.583479f, -0.225726f, 0.278210f}, {0.708091f, -0.218209f, 0.253239f}, + {0.748928f, -0.198612f, 0.263357f}, {0.671734f, -0.226293f, 0.202596f}, + {0.671734f, -0.226293f, 0.202596f}, {0.748928f, -0.198612f, 0.263357f}, + {0.632198f, -0.215710f, 0.271850f}, {0.708091f, -0.218209f, 0.253239f}, + {0.754366f, -0.204877f, 0.228968f}, {0.748928f, -0.198612f, 0.263357f}, + {0.748928f, -0.198612f, 0.263357f}, {0.784538f, -0.160902f, 0.290280f}, + {0.736002f, -0.165452f, 0.290642f}, {0.800719f, -0.190499f, 0.240558f}, + {0.784538f, -0.160902f, 0.290280f}, {0.754366f, -0.204877f, 0.228968f}, + {0.754366f, -0.204877f, 0.228968f}, {0.784538f, -0.160902f, 0.290280f}, + {0.748928f, -0.198612f, 0.263357f}, {0.800719f, -0.190499f, 0.240558f}, + {0.860632f, -0.175459f, 0.225442f}, {0.845126f, -0.159761f, 0.286952f}, + {0.784538f, -0.160902f, 0.290280f}, {0.800719f, -0.190499f, 0.240558f}, + {0.845126f, -0.159761f, 0.286952f}, {0.845126f, -0.159761f, 0.286952f}, + {0.860632f, -0.175459f, 0.225442f}, {0.864732f, -0.113038f, 0.246390f}, + {0.864732f, -0.113038f, 0.246390f}, {0.844207f, -0.092998f, 0.292218f}, + {0.845126f, -0.159761f, 0.286952f}, {0.844207f, -0.092998f, 0.292218f}, + {0.833673f, -0.017866f, 0.199048f}, {0.824046f, -0.017914f, 0.292112f}, + {0.833673f, -0.017866f, 0.199048f}, {0.844207f, -0.092998f, 0.292218f}, + {0.864732f, -0.113038f, 0.246390f}, {0.821274f, 0.049230f, 0.235809f}, + {0.824046f, -0.017914f, 0.292112f}, {0.833673f, -0.017866f, 0.199048f}, + {0.824046f, -0.017914f, 0.292112f}, {0.821274f, 0.049230f, 0.235809f}, + {0.819477f, 0.017770f, 0.279878f}, {0.772347f, 0.127306f, 0.305872f}, + {0.803152f, 0.000009f, 0.309893f}, {0.819477f, 0.017770f, 0.279878f}, + {0.770118f, 0.069198f, 0.201368f}, {0.819477f, 0.017770f, 0.279878f}, + {0.821274f, 0.049230f, 0.235809f}, {0.819477f, 0.017770f, 0.279878f}, + {0.770118f, 0.069198f, 0.201368f}, {0.772347f, 0.127306f, 0.305872f}, + {0.821274f, 0.049230f, 0.235809f}, {0.814998f, 0.067310f, 0.245410f}, + {0.770118f, 0.069198f, 0.201368f}, {0.616432f, -0.280548f, 0.244818f}, + {0.626102f, -0.289908f, 0.209634f}, {0.578148f, -0.271692f, 0.158037f}, + {0.610492f, -0.254762f, 0.195736f}, {0.616432f, -0.280548f, 0.244818f}, + {0.578148f, -0.271692f, 0.158037f}, {0.578148f, -0.271692f, 0.158037f}, + {0.596911f, -0.238733f, 0.171494f}, {0.610492f, -0.254762f, 0.195736f}, + {0.639687f, -0.214237f, 0.176437f}, {0.671734f, -0.226293f, 0.202596f}, + {0.596911f, -0.238733f, 0.171494f}, {0.671734f, -0.226293f, 0.202596f}, + {0.610492f, -0.254762f, 0.195736f}, {0.596911f, -0.238733f, 0.171494f}, + {0.709188f, -0.203710f, 0.177646f}, {0.671734f, -0.226293f, 0.202596f}, + {0.639687f, -0.214237f, 0.176437f}, {0.671734f, -0.226293f, 0.202596f}, + {0.709188f, -0.203710f, 0.177646f}, {0.708091f, -0.218209f, 0.253239f}, + {0.789159f, -0.146078f, 0.174762f}, {0.708091f, -0.218209f, 0.253239f}, + {0.709188f, -0.203710f, 0.177646f}, {0.708091f, -0.218209f, 0.253239f}, + {0.789159f, -0.146078f, 0.174762f}, {0.754366f, -0.204877f, 0.228968f}, + {0.754366f, -0.204877f, 0.228968f}, {0.789159f, -0.146078f, 0.174762f}, + {0.800719f, -0.190499f, 0.240558f}, {0.827286f, -0.166450f, 0.186169f}, + {0.860632f, -0.175459f, 0.225442f}, {0.800719f, -0.190499f, 0.240558f}, + {0.800719f, -0.190499f, 0.240558f}, {0.789159f, -0.146078f, 0.174762f}, + {0.827286f, -0.166450f, 0.186169f}, {0.864732f, -0.113038f, 0.246390f}, + {0.860632f, -0.175459f, 0.225442f}, {0.827286f, -0.166450f, 0.186169f}, + {0.831026f, -0.085459f, 0.177007f}, {0.864732f, -0.113038f, 0.246390f}, + {0.827286f, -0.166450f, 0.186169f}, {0.864732f, -0.113038f, 0.246390f}, + {0.831026f, -0.085459f, 0.177007f}, {0.833673f, -0.017866f, 0.199048f}, + {0.833673f, -0.017866f, 0.199048f}, {0.831026f, -0.085459f, 0.177007f}, + {0.827299f, -0.034443f, 0.177152f}, {0.822074f, 0.023724f, 0.192644f}, + {0.821274f, 0.049230f, 0.235809f}, {0.827299f, -0.034443f, 0.177152f}, + {0.827299f, -0.034443f, 0.177152f}, {0.821274f, 0.049230f, 0.235809f}, + {0.833673f, -0.017866f, 0.199048f}, {0.696577f, -0.157530f, 0.156543f}, + {0.639687f, -0.214237f, 0.176437f}, {0.659243f, -0.191554f, 0.163081f}, + {0.639687f, -0.214237f, 0.176437f}, {0.696577f, -0.157530f, 0.156543f}, + {0.709188f, -0.203710f, 0.177646f}, {0.709188f, -0.203710f, 0.177646f}, + {0.696577f, -0.157530f, 0.156543f}, {0.789159f, -0.146078f, 0.174762f}, + {0.791499f, 0.036867f, 0.176061f}, {0.769286f, 0.049952f, 0.202471f}, + {0.822074f, 0.023724f, 0.192644f}, {0.769286f, 0.049952f, 0.202471f}, + {0.821274f, 0.049230f, 0.235809f}, {0.822074f, 0.023724f, 0.192644f}, + {0.827299f, -0.034443f, 0.177152f}, {0.791499f, 0.036867f, 0.176061f}, + {0.822074f, 0.023724f, 0.192644f}, {0.769286f, 0.049952f, 0.202471f}, + {0.770118f, 0.069198f, 0.201368f}, {0.821274f, 0.049230f, 0.235809f}, + {0.769286f, 0.049952f, 0.202471f}, {0.791499f, 0.036867f, 0.176061f}, + {0.770118f, 0.069198f, 0.201368f}, {0.791499f, 0.036867f, 0.176061f}, + {0.795889f, 0.107338f, 0.186230f}, {0.770118f, 0.069198f, 0.201368f}, + {0.505571f, -0.270936f, 0.157994f}, {0.548771f, -0.200063f, 0.146810f}, + {0.596911f, -0.238733f, 0.171494f}, {0.578148f, -0.271692f, 0.158037f}, + {0.505571f, -0.270936f, 0.157994f}, {0.596911f, -0.238733f, 0.171494f}, + {0.596911f, -0.238733f, 0.171494f}, {0.593352f, -0.140490f, 0.168059f}, + {0.639687f, -0.214237f, 0.176437f}, {0.659243f, -0.191554f, 0.163081f}, + {0.639687f, -0.214237f, 0.176437f}, {0.593352f, -0.140490f, 0.168059f}, + {0.807389f, -0.119094f, 0.170497f}, {0.831026f, -0.085459f, 0.177007f}, + {0.789159f, -0.146078f, 0.174762f}, {0.789159f, -0.146078f, 0.174762f}, + {0.831026f, -0.085459f, 0.177007f}, {0.827286f, -0.166450f, 0.186169f}, + {0.798697f, -0.058998f, 0.184047f}, {0.791499f, 0.036867f, 0.176061f}, + {0.827299f, -0.034443f, 0.177152f}, {0.548771f, -0.200063f, 0.146810f}, + {0.495267f, -0.176730f, 0.172856f}, {0.593352f, -0.140490f, 0.168059f}, + {0.593352f, -0.140490f, 0.168059f}, {0.596911f, -0.238733f, 0.171494f}, + {0.548771f, -0.200063f, 0.146810f}, {0.807389f, -0.119094f, 0.170497f}, + {0.789159f, -0.146078f, 0.174762f}, {0.696577f, -0.157530f, 0.156543f}, + {0.696577f, -0.157530f, 0.156543f}, {0.730637f, -0.113809f, 0.185622f}, + {0.807389f, -0.119094f, 0.170497f}, {0.807389f, -0.119094f, 0.170497f}, + {0.798697f, -0.058998f, 0.184047f}, {0.831026f, -0.085459f, 0.177007f}, + {0.798697f, -0.058998f, 0.184047f}, {0.827299f, -0.034443f, 0.177152f}, + {0.831026f, -0.085459f, 0.177007f}, {0.593352f, -0.140490f, 0.168059f}, + {0.628693f, -0.113428f, 0.191697f}, {0.659243f, -0.191554f, 0.163081f}, + {0.730637f, -0.113809f, 0.185622f}, {0.659243f, -0.191554f, 0.163081f}, + {0.628693f, -0.113428f, 0.191697f}, {0.659243f, -0.191554f, 0.163081f}, + {0.730637f, -0.113809f, 0.185622f}, {0.696577f, -0.157530f, 0.156543f}, + {0.479218f, -0.223300f, 0.171730f}, {0.548771f, -0.200063f, 0.146810f}, + {0.505571f, -0.270936f, 0.157994f}, {0.505571f, -0.270936f, 0.157994f}, + {0.486146f, -0.271233f, 0.173914f}, {0.479218f, -0.223300f, 0.171730f}, + {0.495267f, -0.176730f, 0.172856f}, {0.548771f, -0.200063f, 0.146810f}, + {0.479218f, -0.223300f, 0.171730f}, {0.495267f, -0.176730f, 0.172856f}, + {0.583071f, -0.127127f, 0.185267f}, {0.593352f, -0.140490f, 0.168059f}, + {0.628693f, -0.113428f, 0.191697f}, {0.593352f, -0.140490f, 0.168059f}, + {0.583071f, -0.127127f, 0.185267f}, {0.628693f, -0.113428f, 0.191697f}, + {0.621452f, -0.108239f, 0.259498f}, {0.730637f, -0.113809f, 0.185622f}, + {0.621452f, -0.108239f, 0.259498f}, {0.723237f, -0.092902f, 0.224550f}, + {0.730637f, -0.113809f, 0.185622f}, {0.730637f, -0.113809f, 0.185622f}, + {0.765094f, -0.082036f, 0.211752f}, {0.807389f, -0.119094f, 0.170497f}, + {0.730637f, -0.113809f, 0.185622f}, {0.723237f, -0.092902f, 0.224550f}, + {0.765094f, -0.082036f, 0.211752f}, {0.774932f, -0.045526f, 0.220469f}, + {0.798697f, -0.058998f, 0.184047f}, {0.807389f, -0.119094f, 0.170497f}, + {0.774932f, -0.045526f, 0.220469f}, {0.807389f, -0.119094f, 0.170497f}, + {0.765094f, -0.082036f, 0.211752f}, {0.769286f, 0.049952f, 0.202471f}, + {0.798697f, -0.058998f, 0.184047f}, {0.774932f, -0.045526f, 0.220469f}, + {0.791499f, 0.036867f, 0.176061f}, {0.798697f, -0.058998f, 0.184047f}, + {0.769286f, 0.049952f, 0.202471f}, {0.486146f, -0.271233f, 0.173914f}, + {0.470683f, -0.272389f, 0.208779f}, {0.479218f, -0.223300f, 0.171730f}, + {0.479218f, -0.223300f, 0.171730f}, {0.470683f, -0.272389f, 0.208779f}, + {0.469917f, -0.196686f, 0.225703f}, {0.485931f, -0.173853f, 0.198562f}, + {0.479218f, -0.223300f, 0.171730f}, {0.469917f, -0.196686f, 0.225703f}, + {0.479218f, -0.223300f, 0.171730f}, {0.485931f, -0.173853f, 0.198562f}, + {0.495267f, -0.176730f, 0.172856f}, {0.495267f, -0.176730f, 0.172856f}, + {0.485931f, -0.173853f, 0.198562f}, {0.525709f, -0.145946f, 0.256652f}, + {0.574634f, -0.123101f, 0.258179f}, {0.495267f, -0.176730f, 0.172856f}, + {0.525709f, -0.145946f, 0.256652f}, {0.495267f, -0.176730f, 0.172856f}, + {0.574634f, -0.123101f, 0.258179f}, {0.583071f, -0.127127f, 0.185267f}, + {0.621452f, -0.108239f, 0.259498f}, {0.583071f, -0.127127f, 0.185267f}, + {0.574634f, -0.123101f, 0.258179f}, {0.583071f, -0.127127f, 0.185267f}, + {0.621452f, -0.108239f, 0.259498f}, {0.628693f, -0.113428f, 0.191697f}, + {0.803152f, 0.000009f, 0.309893f}, {0.769286f, 0.049952f, 0.202471f}, + {0.810694f, -0.051873f, 0.307606f}, {0.774932f, -0.045526f, 0.220469f}, + {0.810694f, -0.051873f, 0.307606f}, {0.769286f, 0.049952f, 0.202471f}, + {0.625738f, -0.123910f, 0.276218f}, {0.722323f, -0.109193f, 0.274129f}, + {0.723237f, -0.092902f, 0.224550f}, {0.621452f, -0.108239f, 0.259498f}, + {0.625738f, -0.123910f, 0.276218f}, {0.723237f, -0.092902f, 0.224550f}, + {0.723237f, -0.092902f, 0.224550f}, {0.761846f, -0.086392f, 0.263489f}, + {0.765094f, -0.082036f, 0.211752f}, {0.761846f, -0.086392f, 0.263489f}, + {0.723237f, -0.092902f, 0.224550f}, {0.722323f, -0.109193f, 0.274129f}, + {0.810694f, -0.051873f, 0.307606f}, {0.774932f, -0.045526f, 0.220469f}, + {0.765094f, -0.082036f, 0.211752f}, {0.810694f, -0.051873f, 0.307606f}, + {0.765094f, -0.082036f, 0.211752f}, {0.761846f, -0.086392f, 0.263489f}, + {0.489709f, -0.323488f, 0.234250f}, {0.513371f, -0.274058f, 0.279083f}, + {0.470683f, -0.272389f, 0.208779f}, {0.470683f, -0.272389f, 0.208779f}, + {0.477604f, -0.227012f, 0.262152f}, {0.469917f, -0.196686f, 0.225703f}, + {0.477604f, -0.227012f, 0.262152f}, {0.470683f, -0.272389f, 0.208779f}, + {0.513371f, -0.274058f, 0.279083f}, {0.549948f, -0.244189f, 0.286292f}, + {0.552916f, -0.170604f, 0.287407f}, {0.477604f, -0.227012f, 0.262152f}, + {0.552916f, -0.170604f, 0.287407f}, {0.485931f, -0.173853f, 0.198562f}, + {0.477604f, -0.227012f, 0.262152f}, {0.477604f, -0.227012f, 0.262152f}, + {0.485931f, -0.173853f, 0.198562f}, {0.469917f, -0.196686f, 0.225703f}, + {0.525709f, -0.145946f, 0.256652f}, {0.485931f, -0.173853f, 0.198562f}, + {0.552916f, -0.170604f, 0.287407f}, {0.572179f, -0.187304f, 0.290519f}, + {0.574634f, -0.123101f, 0.258179f}, {0.552916f, -0.170604f, 0.287407f}, + {0.552916f, -0.170604f, 0.287407f}, {0.574634f, -0.123101f, 0.258179f}, + {0.525709f, -0.145946f, 0.256652f}, {0.625738f, -0.123910f, 0.276218f}, + {0.621452f, -0.108239f, 0.259498f}, {0.572179f, -0.187304f, 0.290519f}, + {0.572179f, -0.187304f, 0.290519f}, {0.621452f, -0.108239f, 0.259498f}, + {0.574634f, -0.123101f, 0.258179f}, {0.549948f, -0.244189f, 0.286292f}, + {0.477604f, -0.227012f, 0.262152f}, {0.513371f, -0.274058f, 0.279083f}, + {0.631887f, -0.143794f, 0.285959f}, {0.625738f, -0.123910f, 0.276218f}, + {0.572179f, -0.187304f, 0.290519f}, {0.631887f, -0.143794f, 0.285959f}, + {0.736002f, -0.165452f, 0.290642f}, {0.722323f, -0.109193f, 0.274129f}, + {0.625738f, -0.123910f, 0.276218f}, {0.631887f, -0.143794f, 0.285959f}, + {0.722323f, -0.109193f, 0.274129f}, {0.736002f, -0.165452f, 0.290642f}, + {0.784538f, -0.160902f, 0.290280f}, {0.761846f, -0.086392f, 0.263489f}, + {0.722323f, -0.109193f, 0.274129f}, {0.736002f, -0.165452f, 0.290642f}, + {0.761846f, -0.086392f, 0.263489f}, {0.572179f, -0.187304f, 0.290519f}, + {0.552916f, -0.170604f, 0.287407f}, {0.549948f, -0.244189f, 0.286292f}, + {0.844207f, -0.092998f, 0.292218f}, {0.761846f, -0.086392f, 0.263489f}, + {0.784538f, -0.160902f, 0.290280f}, {0.844207f, -0.092998f, 0.292218f}, + {0.824046f, -0.017914f, 0.292112f}, {0.810694f, -0.051873f, 0.307606f}, + {0.810694f, -0.051873f, 0.307606f}, {0.761846f, -0.086392f, 0.263489f}, + {0.844207f, -0.092998f, 0.292218f}, {0.601863f, -0.295910f, 0.268799f}, + {0.583479f, -0.225726f, 0.278210f}, {0.549948f, -0.244189f, 0.286292f}, + {0.513371f, -0.274058f, 0.279083f}, {0.601863f, -0.295910f, 0.268799f}, + {0.549948f, -0.244189f, 0.286292f}, {0.572179f, -0.187304f, 0.290519f}, + {0.549948f, -0.244189f, 0.286292f}, {0.583479f, -0.225726f, 0.278210f}, + {0.583479f, -0.225726f, 0.278210f}, {0.631887f, -0.143794f, 0.285959f}, + {0.572179f, -0.187304f, 0.290519f}, {0.844207f, -0.092998f, 0.292218f}, + {0.784538f, -0.160902f, 0.290280f}, {0.845126f, -0.159761f, 0.286952f}, + {0.810694f, -0.051873f, 0.307606f}, {0.824046f, -0.017914f, 0.292112f}, + {0.803152f, 0.000009f, 0.309893f}, {0.632198f, -0.215710f, 0.271850f}, + {0.631887f, -0.143794f, 0.285959f}, {0.583479f, -0.225726f, 0.278210f}, + {0.748928f, -0.198612f, 0.263357f}, {0.736002f, -0.165452f, 0.290642f}, + {0.632198f, -0.215710f, 0.271850f}, {0.632198f, -0.215710f, 0.271850f}, + {0.736002f, -0.165452f, 0.290642f}, {0.631887f, -0.143794f, 0.285959f}, + {0.824046f, -0.017914f, 0.292112f}, {0.819477f, 0.017770f, 0.279878f}, + {0.803152f, 0.000009f, 0.309893f}, {0.505571f, -0.270936f, 0.157994f}, + {0.489709f, -0.323488f, 0.234250f}, {0.486146f, -0.271233f, 0.173914f}, + {0.578148f, -0.271692f, 0.158037f}, {0.626102f, -0.289908f, 0.209634f}, + {0.633953f, -0.321082f, 0.191574f}, {0.470683f, -0.272389f, 0.208779f}, + {0.486146f, -0.271233f, 0.173914f}, {0.489709f, -0.323488f, 0.234250f}, + {0.770118f, 0.069198f, 0.201368f}, {0.769286f, 0.049952f, 0.202471f}, + {0.803152f, 0.000009f, 0.309893f}, {0.803152f, 0.000009f, 0.309893f}, + {0.772347f, 0.127306f, 0.305872f}, {0.770118f, 0.069198f, 0.201368f}, + {0.772347f, 0.127306f, 0.305872f}, {0.784647f, 0.133362f, 0.304053f}, + {0.792862f, 0.132402f, 0.241771f}, {0.792862f, 0.132402f, 0.241771f}, + {0.770118f, 0.069198f, 0.201368f}, {0.772347f, 0.127306f, 0.305872f}, + {0.784647f, 0.133362f, 0.304053f}, {0.770118f, 0.069198f, 0.201368f}, + {0.792862f, 0.132402f, 0.241771f}, {0.784647f, 0.133362f, 0.304053f}, + {0.772347f, 0.127306f, 0.305872f}, {0.770118f, 0.069198f, 0.201368f}, + {0.049804f, -0.300258f, -0.381494f}, {-0.022763f, -0.310064f, -0.335019f}, + {0.044711f, -0.307317f, -0.420360f}, {-0.010476f, -0.311957f, -0.431746f}, + {0.044711f, -0.307317f, -0.420360f}, {-0.022763f, -0.310064f, -0.335019f}, + {0.051779f, -0.246869f, -0.321229f}, {0.016993f, -0.279886f, -0.313177f}, + {0.049804f, -0.300258f, -0.381494f}, {-0.022763f, -0.310064f, -0.335019f}, + {0.049804f, -0.300258f, -0.381494f}, {0.016993f, -0.279886f, -0.313177f}, + {0.009293f, -0.185508f, -0.514013f}, {-0.077027f, -0.151393f, -0.488505f}, + {0.007567f, -0.128619f, -0.457644f}, {0.007567f, -0.128619f, -0.457644f}, + {-0.077027f, -0.151393f, -0.488505f}, {0.009523f, -0.123303f, -0.437621f}, + {0.019062f, -0.244133f, -0.517293f}, {-0.080153f, -0.196721f, -0.505826f}, + {0.009293f, -0.185508f, -0.514013f}, {0.009293f, -0.185508f, -0.514013f}, + {-0.080153f, -0.196721f, -0.505826f}, {-0.077027f, -0.151393f, -0.488505f}, + {0.044711f, -0.307317f, -0.420360f}, {-0.010476f, -0.311957f, -0.431746f}, + {0.023283f, -0.262212f, -0.508761f}, {0.044711f, -0.307317f, -0.420360f}, + {0.051779f, -0.246869f, -0.321229f}, {0.049804f, -0.300258f, -0.381494f}, + {0.067474f, -0.120738f, -0.483753f}, {0.009523f, -0.123303f, -0.437621f}, + {0.092933f, -0.129552f, -0.355037f}, {0.092933f, -0.129552f, -0.355037f}, + {0.009523f, -0.123303f, -0.437621f}, {0.020998f, -0.127884f, -0.374942f}, + {0.092933f, -0.129552f, -0.355037f}, {0.025781f, -0.136359f, -0.357453f}, + {0.051779f, -0.246869f, -0.321229f}, {0.025781f, -0.136359f, -0.357453f}, + {0.092933f, -0.129552f, -0.355037f}, {0.020998f, -0.127884f, -0.374942f}, + {0.041026f, -0.132330f, -0.480236f}, {0.009293f, -0.185508f, -0.514013f}, + {0.067474f, -0.120738f, -0.483753f}, {0.067474f, -0.120738f, -0.483753f}, + {0.009293f, -0.185508f, -0.514013f}, {0.007567f, -0.128619f, -0.457644f}, + {0.009523f, -0.123303f, -0.437621f}, {0.067474f, -0.120738f, -0.483753f}, + {0.007567f, -0.128619f, -0.457644f}, {0.009293f, -0.185508f, -0.514013f}, + {0.078472f, -0.157983f, -0.525924f}, {0.019062f, -0.244133f, -0.517293f}, + {0.078472f, -0.157983f, -0.525924f}, {0.009293f, -0.185508f, -0.514013f}, + {0.041026f, -0.132330f, -0.480236f}, {0.078472f, -0.157983f, -0.525924f}, + {0.109561f, -0.227561f, -0.523122f}, {0.019062f, -0.244133f, -0.517293f}, + {0.109561f, -0.227561f, -0.523122f}, {0.041026f, -0.132330f, -0.480236f}, + {0.023283f, -0.262212f, -0.508761f}, {0.023283f, -0.262212f, -0.508761f}, + {0.019062f, -0.244133f, -0.517293f}, {0.109561f, -0.227561f, -0.523122f}, + {0.041026f, -0.132330f, -0.480236f}, {0.044711f, -0.307317f, -0.420360f}, + {0.023283f, -0.262212f, -0.508761f}, {0.175604f, -0.213666f, -0.373520f}, + {0.051779f, -0.246869f, -0.321229f}, {0.044711f, -0.307317f, -0.420360f}, + {0.044711f, -0.307317f, -0.420360f}, {0.193913f, -0.187648f, -0.484504f}, + {0.175604f, -0.213666f, -0.373520f}, {0.078472f, -0.157983f, -0.525924f}, + {0.131427f, -0.090448f, -0.527039f}, {0.126882f, -0.184309f, -0.534506f}, + {0.078472f, -0.157983f, -0.525924f}, {0.041026f, -0.132330f, -0.480236f}, + {0.067474f, -0.120738f, -0.483753f}, {0.067474f, -0.120738f, -0.483753f}, + {0.131427f, -0.090448f, -0.527039f}, {0.078472f, -0.157983f, -0.525924f}, + {0.078472f, -0.157983f, -0.525924f}, {0.126882f, -0.184309f, -0.534506f}, + {0.109561f, -0.227561f, -0.523122f}, {0.193913f, -0.187648f, -0.484504f}, + {0.109561f, -0.227561f, -0.523122f}, {0.126882f, -0.184309f, -0.534506f}, + {0.109561f, -0.227561f, -0.523122f}, {0.193913f, -0.187648f, -0.484504f}, + {0.041026f, -0.132330f, -0.480236f}, {0.193913f, -0.187648f, -0.484504f}, + {0.044711f, -0.307317f, -0.420360f}, {0.041026f, -0.132330f, -0.480236f}, + {0.217588f, -0.075151f, -0.396281f}, {0.175604f, -0.213666f, -0.373520f}, + {0.193913f, -0.187648f, -0.484504f}, {0.217588f, -0.075151f, -0.396281f}, + {0.166337f, -0.045176f, -0.362721f}, {0.175604f, -0.213666f, -0.373520f}, + {0.051779f, -0.246869f, -0.321229f}, {0.175604f, -0.213666f, -0.373520f}, + {0.166337f, -0.045176f, -0.362721f}, {0.166337f, -0.045176f, -0.362721f}, + {0.092933f, -0.129552f, -0.355037f}, {0.051779f, -0.246869f, -0.321229f}, + {0.067474f, -0.120738f, -0.483753f}, {0.143345f, -0.046971f, -0.523037f}, + {0.131427f, -0.090448f, -0.527039f}, {0.131427f, -0.090448f, -0.527039f}, + {0.143345f, -0.046971f, -0.523037f}, {0.168822f, -0.060403f, -0.522480f}, + {0.126882f, -0.184309f, -0.534506f}, {0.131427f, -0.090448f, -0.527039f}, + {0.168822f, -0.060403f, -0.522480f}, {0.217588f, -0.075151f, -0.396281f}, + {0.193913f, -0.187648f, -0.484504f}, {0.126882f, -0.184309f, -0.534506f}, + {0.168822f, -0.060403f, -0.522480f}, {0.217588f, -0.075151f, -0.396281f}, + {0.126882f, -0.184309f, -0.534506f}, {0.217588f, -0.075151f, -0.396281f}, + {0.253287f, 0.059093f, -0.446568f}, {0.216205f, 0.036780f, -0.377147f}, + {0.166337f, -0.045176f, -0.362721f}, {0.217588f, -0.075151f, -0.396281f}, + {0.216205f, 0.036780f, -0.377147f}, {0.092933f, -0.129552f, -0.355037f}, + {0.166337f, -0.045176f, -0.362721f}, {0.216205f, 0.036780f, -0.377147f}, + {0.156253f, 0.067187f, -0.384105f}, {0.146703f, 0.115372f, -0.421301f}, + {0.092933f, -0.129552f, -0.355037f}, {0.092933f, -0.129552f, -0.355037f}, + {0.216205f, 0.036780f, -0.377147f}, {0.156253f, 0.067187f, -0.384105f}, + {0.067474f, -0.120738f, -0.483753f}, {0.092933f, -0.129552f, -0.355037f}, + {0.146703f, 0.115372f, -0.421301f}, {0.067474f, -0.120738f, -0.483753f}, + {0.146703f, 0.115372f, -0.421301f}, {0.129428f, 0.073931f, -0.468573f}, + {0.129428f, 0.073931f, -0.468573f}, {0.156459f, 0.055979f, -0.514490f}, + {0.067474f, -0.120738f, -0.483753f}, {0.156459f, 0.055979f, -0.514490f}, + {0.168683f, 0.049186f, -0.519843f}, {0.067474f, -0.120738f, -0.483753f}, + {0.067474f, -0.120738f, -0.483753f}, {0.168683f, 0.049186f, -0.519843f}, + {0.143345f, -0.046971f, -0.523037f}, {0.168822f, -0.060403f, -0.522480f}, + {0.143345f, -0.046971f, -0.523037f}, {0.168683f, 0.049186f, -0.519843f}, + {0.217588f, -0.075151f, -0.396281f}, {0.168822f, -0.060403f, -0.522480f}, + {0.168683f, 0.049186f, -0.519843f}, {0.168683f, 0.049186f, -0.519843f}, + {0.235551f, 0.064408f, -0.491246f}, {0.217588f, -0.075151f, -0.396281f}, + {0.235551f, 0.064408f, -0.491246f}, {0.253287f, 0.059093f, -0.446568f}, + {0.217588f, -0.075151f, -0.396281f}, {0.213802f, 0.084868f, -0.377648f}, + {0.216205f, 0.036780f, -0.377147f}, {0.236314f, 0.072263f, -0.391506f}, + {0.242245f, 0.097024f, -0.396558f}, {0.236314f, 0.072263f, -0.391506f}, + {0.216205f, 0.036780f, -0.377147f}, {0.216205f, 0.036780f, -0.377147f}, + {0.253287f, 0.059093f, -0.446568f}, {0.242245f, 0.097024f, -0.396558f}, + {0.174125f, 0.128174f, -0.392255f}, {0.168541f, 0.176016f, -0.411029f}, + {0.146703f, 0.115372f, -0.421301f}, {0.156253f, 0.067187f, -0.384105f}, + {0.213802f, 0.084868f, -0.377648f}, {0.174125f, 0.128174f, -0.392255f}, + {0.146703f, 0.115372f, -0.421301f}, {0.156253f, 0.067187f, -0.384105f}, + {0.174125f, 0.128174f, -0.392255f}, {0.213802f, 0.084868f, -0.377648f}, + {0.156253f, 0.067187f, -0.384105f}, {0.216205f, 0.036780f, -0.377147f}, + {0.159666f, 0.179724f, -0.432110f}, {0.146703f, 0.115372f, -0.421301f}, + {0.168541f, 0.176016f, -0.411029f}, {0.150557f, 0.134796f, -0.461481f}, + {0.129428f, 0.073931f, -0.468573f}, {0.159666f, 0.179724f, -0.432110f}, + {0.146703f, 0.115372f, -0.421301f}, {0.159666f, 0.179724f, -0.432110f}, + {0.129428f, 0.073931f, -0.468573f}, {0.156459f, 0.055979f, -0.514490f}, + {0.181537f, 0.090257f, -0.510970f}, {0.168683f, 0.049186f, -0.519843f}, + {0.181537f, 0.090257f, -0.510970f}, {0.156459f, 0.055979f, -0.514490f}, + {0.129428f, 0.073931f, -0.468573f}, {0.181537f, 0.090257f, -0.510970f}, + {0.258623f, 0.127712f, -0.476460f}, {0.168683f, 0.049186f, -0.519843f}, + {0.258623f, 0.127712f, -0.476460f}, {0.235551f, 0.064408f, -0.491246f}, + {0.168683f, 0.049186f, -0.519843f}, {0.235551f, 0.064408f, -0.491246f}, + {0.258623f, 0.127712f, -0.476460f}, {0.242245f, 0.097024f, -0.396558f}, + {0.253287f, 0.059093f, -0.446568f}, {0.235551f, 0.064408f, -0.491246f}, + {0.242245f, 0.097024f, -0.396558f}, {-0.067899f, -0.111653f, -0.434320f}, + {-0.073557f, -0.120718f, -0.343207f}, {0.009523f, -0.123303f, -0.437621f}, + {-0.073557f, -0.120718f, -0.343207f}, {-0.073301f, -0.143606f, -0.309418f}, + {0.025781f, -0.136359f, -0.357453f}, {-0.073301f, -0.143606f, -0.309418f}, + {-0.057381f, -0.200179f, -0.293350f}, {0.051779f, -0.246869f, -0.321229f}, + {-0.057381f, -0.200179f, -0.293350f}, {-0.059422f, -0.267293f, -0.313983f}, + {0.002521f, -0.248492f, -0.310613f}, {-0.059422f, -0.267293f, -0.313983f}, + {-0.050941f, -0.312602f, -0.352088f}, {-0.022763f, -0.310064f, -0.335019f}, + {-0.050941f, -0.312602f, -0.352088f}, {-0.068822f, -0.305460f, -0.446860f}, + {-0.010476f, -0.311957f, -0.431746f}, {-0.068822f, -0.305460f, -0.446860f}, + {-0.074597f, -0.288433f, -0.473379f}, {0.023283f, -0.262212f, -0.508761f}, + {-0.074597f, -0.288433f, -0.473379f}, {-0.080153f, -0.196721f, -0.505826f}, + {0.023283f, -0.262212f, -0.508761f}, {-0.073041f, -0.127692f, -0.464992f}, + {-0.067899f, -0.111653f, -0.434320f}, {0.009523f, -0.123303f, -0.437621f}, + {0.271516f, 0.146054f, -0.422461f}, {0.168541f, 0.176016f, -0.411029f}, + {0.213802f, 0.084868f, -0.377648f}, {0.159666f, 0.179724f, -0.432110f}, + {0.180821f, 0.155294f, -0.477739f}, {0.150557f, 0.134796f, -0.461481f}, + {0.180821f, 0.155294f, -0.477739f}, {0.247549f, 0.153196f, -0.482049f}, + {0.181537f, 0.090257f, -0.510970f}, {-0.010476f, -0.311957f, -0.431746f}, + {-0.022763f, -0.310064f, -0.335019f}, {-0.050941f, -0.312602f, -0.352088f}, + {0.016993f, -0.279886f, -0.313177f}, {0.002521f, -0.248492f, -0.310613f}, + {-0.059422f, -0.267293f, -0.313983f}, {-0.022763f, -0.310064f, -0.335019f}, + {0.016993f, -0.279886f, -0.313177f}, {-0.059422f, -0.267293f, -0.313983f}, + {0.020998f, -0.127884f, -0.374942f}, {0.009523f, -0.123303f, -0.437621f}, + {-0.073557f, -0.120718f, -0.343207f}, {0.009523f, -0.123303f, -0.437621f}, + {-0.077027f, -0.151393f, -0.488505f}, {-0.073041f, -0.127692f, -0.464992f}, + {0.019062f, -0.244133f, -0.517293f}, {0.023283f, -0.262212f, -0.508761f}, + {-0.080153f, -0.196721f, -0.505826f}, {0.023283f, -0.262212f, -0.508761f}, + {-0.010476f, -0.311957f, -0.431746f}, {-0.068822f, -0.305460f, -0.446860f}, + {0.051779f, -0.246869f, -0.321229f}, {0.025781f, -0.136359f, -0.357453f}, + {-0.073301f, -0.143606f, -0.309418f}, {0.025781f, -0.136359f, -0.357453f}, + {0.020998f, -0.127884f, -0.374942f}, {-0.073557f, -0.120718f, -0.343207f}, + {0.213802f, 0.084868f, -0.377648f}, {0.236314f, 0.072263f, -0.391506f}, + {0.242245f, 0.097024f, -0.396558f}, {0.181537f, 0.090257f, -0.510970f}, + {0.129428f, 0.073931f, -0.468573f}, {0.180821f, 0.155294f, -0.477739f}, + {0.258623f, 0.127712f, -0.476460f}, {0.181537f, 0.090257f, -0.510970f}, + {0.247549f, 0.153196f, -0.482049f}, {0.051779f, -0.246869f, -0.321229f}, + {-0.057381f, -0.200179f, -0.293350f}, {0.002521f, -0.248492f, -0.310613f}, + {0.242245f, 0.097024f, -0.396558f}, {0.271516f, 0.146054f, -0.422461f}, + {0.213802f, 0.084868f, -0.377648f}, {0.168541f, 0.176016f, -0.411029f}, + {0.174125f, 0.128174f, -0.392255f}, {0.213802f, 0.084868f, -0.377648f}, + {0.150557f, 0.134796f, -0.461481f}, {0.180821f, 0.155294f, -0.477739f}, + {0.129428f, 0.073931f, -0.468573f}, {0.210101f, 0.237839f, -0.387570f}, + {0.171718f, 0.217893f, -0.427529f}, {0.168541f, 0.176016f, -0.411029f}, + {0.232487f, 0.224679f, -0.385991f}, {0.171718f, 0.217893f, -0.427529f}, + {0.210101f, 0.237839f, -0.387570f}, {0.228778f, 0.324259f, -0.372027f}, + {0.210101f, 0.237839f, -0.387570f}, {0.232487f, 0.224679f, -0.385991f}, + {0.191521f, 0.286310f, -0.375222f}, {0.210101f, 0.237839f, -0.387570f}, + {0.228778f, 0.324259f, -0.372027f}, {0.181761f, 0.321654f, -0.317338f}, + {0.191521f, 0.286310f, -0.375222f}, {0.229646f, 0.340011f, -0.322848f}, + {0.243374f, 0.201270f, -0.391908f}, {0.210101f, 0.237839f, -0.387570f}, + {0.271516f, 0.146054f, -0.422461f}, {0.271516f, 0.146054f, -0.422461f}, + {0.210101f, 0.237839f, -0.387570f}, {0.168541f, 0.176016f, -0.411029f}, + {0.243374f, 0.201270f, -0.391908f}, {0.232487f, 0.224679f, -0.385991f}, + {0.210101f, 0.237839f, -0.387570f}, {0.228778f, 0.324259f, -0.372027f}, + {0.247163f, 0.347510f, -0.378687f}, {0.229646f, 0.340011f, -0.322848f}, + {0.191521f, 0.286310f, -0.375222f}, {0.228778f, 0.324259f, -0.372027f}, + {0.229646f, 0.340011f, -0.322848f}, {0.333949f, 0.225631f, -0.436516f}, + {0.232487f, 0.224679f, -0.385991f}, {0.243374f, 0.201270f, -0.391908f}, + {0.309896f, 0.280434f, -0.385472f}, {0.232487f, 0.224679f, -0.385991f}, + {0.333949f, 0.225631f, -0.436516f}, {0.309896f, 0.280434f, -0.385472f}, + {0.228778f, 0.324259f, -0.372027f}, {0.232487f, 0.224679f, -0.385991f}, + {0.247163f, 0.347510f, -0.378687f}, {0.228778f, 0.324259f, -0.372027f}, + {0.191521f, 0.286310f, -0.375222f}, {0.333949f, 0.225631f, -0.436516f}, + {0.243374f, 0.201270f, -0.391908f}, {0.271516f, 0.146054f, -0.422461f}, + {0.309896f, 0.280434f, -0.385472f}, {0.333949f, 0.225631f, -0.436516f}, + {0.357923f, 0.280463f, -0.436879f}, {0.337862f, 0.362983f, -0.390960f}, + {0.247163f, 0.347510f, -0.378687f}, {0.228778f, 0.324259f, -0.372027f}, + {0.228778f, 0.324259f, -0.372027f}, {0.309896f, 0.280434f, -0.385472f}, + {0.337862f, 0.362983f, -0.390960f}, {0.174043f, 0.338241f, -0.359307f}, + {0.247163f, 0.347510f, -0.378687f}, {0.191521f, 0.286310f, -0.375222f}, + {0.247163f, 0.347510f, -0.378687f}, {0.223985f, 0.337541f, -0.314411f}, + {0.229646f, 0.340011f, -0.322848f}, {0.333949f, 0.225631f, -0.436516f}, + {0.271516f, 0.146054f, -0.422461f}, {0.309951f, 0.195000f, -0.432098f}, + {0.174043f, 0.338241f, -0.359307f}, {0.228778f, 0.324259f, -0.372027f}, + {0.247163f, 0.347510f, -0.378687f}, {0.228778f, 0.324259f, -0.372027f}, + {0.174043f, 0.338241f, -0.359307f}, {0.191521f, 0.286310f, -0.375222f}, + {0.174043f, 0.338241f, -0.359307f}, {0.247163f, 0.347510f, -0.378687f}, + {0.267332f, 0.372804f, -0.425810f}, {0.204467f, 0.341703f, -0.404503f}, + {0.174043f, 0.338241f, -0.359307f}, {0.267332f, 0.372804f, -0.425810f}, + {0.223985f, 0.337541f, -0.314411f}, {0.247163f, 0.347510f, -0.378687f}, + {0.174043f, 0.338241f, -0.359307f}, {0.332668f, 0.241970f, -0.458633f}, + {0.271516f, 0.146054f, -0.422461f}, {0.247549f, 0.153196f, -0.482049f}, + {0.271516f, 0.146054f, -0.422461f}, {0.332668f, 0.241970f, -0.458633f}, + {0.333949f, 0.225631f, -0.436516f}, {0.247549f, 0.153196f, -0.482049f}, + {0.262287f, 0.212896f, -0.475284f}, {0.332668f, 0.241970f, -0.458633f}, + {0.174043f, 0.338241f, -0.359307f}, {0.204467f, 0.341703f, -0.404503f}, + {0.215665f, 0.267503f, -0.453827f}, {0.281315f, 0.304736f, -0.465868f}, + {0.332668f, 0.241970f, -0.458633f}, {0.262287f, 0.212896f, -0.475284f}, + {0.332668f, 0.241970f, -0.458633f}, {0.281315f, 0.304736f, -0.465868f}, + {0.314392f, 0.267140f, -0.468557f}, {0.295855f, 0.326401f, -0.458177f}, + {0.314392f, 0.267140f, -0.468557f}, {0.281315f, 0.304736f, -0.465868f}, + {0.281315f, 0.304736f, -0.465868f}, {0.267332f, 0.372804f, -0.425810f}, + {0.295855f, 0.326401f, -0.458177f}, {0.281315f, 0.304736f, -0.465868f}, + {0.238459f, 0.321833f, -0.455783f}, {0.267332f, 0.372804f, -0.425810f}, + {0.215665f, 0.267503f, -0.453827f}, {0.204467f, 0.341703f, -0.404503f}, + {0.238459f, 0.321833f, -0.455783f}, {0.238459f, 0.321833f, -0.455783f}, + {0.204467f, 0.341703f, -0.404503f}, {0.267332f, 0.372804f, -0.425810f}, + {0.215665f, 0.267503f, -0.453827f}, {0.191521f, 0.286310f, -0.375222f}, + {0.174043f, 0.338241f, -0.359307f}, {0.227678f, 0.308117f, -0.457078f}, + {0.238459f, 0.321833f, -0.455783f}, {0.281315f, 0.304736f, -0.465868f}, + {0.227678f, 0.308117f, -0.457078f}, {0.215665f, 0.267503f, -0.453827f}, + {0.238459f, 0.321833f, -0.455783f}, {0.180821f, 0.155294f, -0.477739f}, + {0.201362f, 0.215441f, -0.460082f}, {0.247549f, 0.153196f, -0.482049f}, + {0.262287f, 0.212896f, -0.475284f}, {0.247549f, 0.153196f, -0.482049f}, + {0.201362f, 0.215441f, -0.460082f}, {0.161299f, 0.308650f, -0.373832f}, + {0.191521f, 0.286310f, -0.375222f}, {0.215665f, 0.267503f, -0.453827f}, + {0.191521f, 0.286310f, -0.375222f}, {0.223985f, 0.337541f, -0.314411f}, + {0.174043f, 0.338241f, -0.359307f}, {0.161299f, 0.308650f, -0.373832f}, + {0.174043f, 0.338241f, -0.359307f}, {0.191521f, 0.286310f, -0.375222f}, + {0.215665f, 0.267503f, -0.453827f}, {0.262287f, 0.212896f, -0.475284f}, + {0.201362f, 0.215441f, -0.460082f}, {0.262287f, 0.212896f, -0.475284f}, + {0.215665f, 0.267503f, -0.453827f}, {0.281315f, 0.304736f, -0.465868f}, + {0.215665f, 0.267503f, -0.453827f}, {0.227678f, 0.308117f, -0.457078f}, + {0.281315f, 0.304736f, -0.465868f}, {0.201362f, 0.215441f, -0.460082f}, + {0.180821f, 0.155294f, -0.477739f}, {0.168541f, 0.176016f, -0.411029f}, + {0.201362f, 0.215441f, -0.460082f}, {0.168541f, 0.176016f, -0.411029f}, + {0.171718f, 0.217893f, -0.427529f}, {0.215665f, 0.267503f, -0.453827f}, + {0.201362f, 0.215441f, -0.460082f}, {0.171718f, 0.217893f, -0.427529f}, + {0.191521f, 0.286310f, -0.375222f}, {0.181761f, 0.321654f, -0.317338f}, + {0.223985f, 0.337541f, -0.314411f}, {0.159666f, 0.179724f, -0.432110f}, + {0.171718f, 0.217893f, -0.427529f}, {0.168541f, 0.176016f, -0.411029f}, + {0.210101f, 0.237839f, -0.387570f}, {0.191521f, 0.286310f, -0.375222f}, + {0.171718f, 0.217893f, -0.427529f}, {0.191521f, 0.286310f, -0.375222f}, + {0.215665f, 0.267503f, -0.453827f}, {0.171718f, 0.217893f, -0.427529f}, + {0.181761f, 0.321654f, -0.317338f}, {0.229646f, 0.340011f, -0.322848f}, + {0.223985f, 0.337541f, -0.314411f}, {0.242245f, 0.097024f, -0.396558f}, + {0.258623f, 0.127712f, -0.476460f}, {0.271516f, 0.146054f, -0.422461f}, + {0.180821f, 0.155294f, -0.477739f}, {0.159666f, 0.179724f, -0.432110f}, + {0.168541f, 0.176016f, -0.411029f}, {0.333768f, 0.367511f, -0.391747f}, + {0.337862f, 0.362983f, -0.390960f}, {0.309896f, 0.280434f, -0.385472f}, + {0.309896f, 0.280434f, -0.385472f}, {0.357923f, 0.280463f, -0.436879f}, + {0.333768f, 0.367511f, -0.391747f}, {0.247549f, 0.153196f, -0.482049f}, + {0.271516f, 0.146054f, -0.422461f}, {0.258623f, 0.127712f, -0.476460f}, + {0.357923f, 0.280463f, -0.436879f}, {0.314392f, 0.267140f, -0.468557f}, + {0.333768f, 0.367511f, -0.391747f}, {0.314392f, 0.267140f, -0.468557f}, + {0.295855f, 0.326401f, -0.458177f}, {0.333768f, 0.367511f, -0.391747f}, + {0.295855f, 0.326401f, -0.458177f}, {0.267332f, 0.372804f, -0.425810f}, + {0.333768f, 0.367511f, -0.391747f}, {0.333768f, 0.367511f, -0.391747f}, + {0.267332f, 0.372804f, -0.425810f}, {0.247163f, 0.347510f, -0.378687f}, + {0.333768f, 0.367511f, -0.391747f}, {0.247163f, 0.347510f, -0.378687f}, + {0.337862f, 0.362983f, -0.390960f}, {0.267332f, 0.372804f, -0.425810f}, + {0.275327f, 0.411720f, -0.369176f}, {0.260547f, 0.392466f, -0.398260f}, + {0.247163f, 0.347510f, -0.378687f}, {0.275327f, 0.411720f, -0.369176f}, + {0.267332f, 0.372804f, -0.425810f}, {0.379538f, 0.403157f, -0.376999f}, + {0.375592f, 0.334024f, -0.412810f}, {0.367003f, 0.410626f, -0.398491f}, + {0.375592f, 0.334024f, -0.412810f}, {0.379538f, 0.403157f, -0.376999f}, + {0.371817f, 0.366593f, -0.388727f}, {0.295708f, 0.392187f, -0.406384f}, + {0.379538f, 0.403157f, -0.376999f}, {0.367003f, 0.410626f, -0.398491f}, + {0.326387f, 0.435131f, -0.362228f}, {0.379538f, 0.403157f, -0.376999f}, + {0.295708f, 0.392187f, -0.406384f}, {0.326387f, 0.435131f, -0.362228f}, + {0.371817f, 0.366593f, -0.388727f}, {0.379538f, 0.403157f, -0.376999f}, + {0.295708f, 0.392187f, -0.406384f}, {0.367003f, 0.410626f, -0.398491f}, + {0.375592f, 0.334024f, -0.412810f}, {0.337862f, 0.362983f, -0.390960f}, + {0.371817f, 0.366593f, -0.388727f}, {0.326387f, 0.435131f, -0.362228f}, + {0.333768f, 0.367511f, -0.391747f}, {0.295708f, 0.392187f, -0.406384f}, + {0.375592f, 0.334024f, -0.412810f}, {0.295708f, 0.392187f, -0.406384f}, + {0.333768f, 0.367511f, -0.391747f}, {0.326387f, 0.435131f, -0.362228f}, + {0.337862f, 0.362983f, -0.390960f}, {0.326387f, 0.435131f, -0.362228f}, + {0.333768f, 0.367511f, -0.391747f}, {0.333768f, 0.367511f, -0.391747f}, + {0.371817f, 0.366593f, -0.388727f}, {0.337862f, 0.362983f, -0.390960f}, + {0.371817f, 0.366593f, -0.388727f}, {0.333768f, 0.367511f, -0.391747f}, + {0.375592f, 0.334024f, -0.412810f}, {0.337862f, 0.362983f, -0.390960f}, + {0.326387f, 0.435131f, -0.362228f}, {0.275327f, 0.411720f, -0.369176f}, + {0.260547f, 0.392466f, -0.398260f}, {0.326387f, 0.435131f, -0.362228f}, + {0.295708f, 0.392187f, -0.406384f}, {0.275327f, 0.411720f, -0.369176f}, + {0.326387f, 0.435131f, -0.362228f}, {0.260547f, 0.392466f, -0.398260f}, + {0.275327f, 0.411720f, -0.369176f}, {0.247163f, 0.347510f, -0.378687f}, + {0.337862f, 0.362983f, -0.390960f}, {0.267332f, 0.372804f, -0.425810f}, + {0.260547f, 0.392466f, -0.398260f}, {0.295708f, 0.392187f, -0.406384f}, + {0.295708f, 0.392187f, -0.406384f}, {0.333768f, 0.367511f, -0.391747f}, + {0.267332f, 0.372804f, -0.425810f}, {0.333949f, 0.225631f, -0.436516f}, + {0.362128f, 0.256153f, -0.406989f}, {0.371481f, 0.302999f, -0.439742f}, + {0.371481f, 0.302999f, -0.439742f}, {0.357923f, 0.280463f, -0.436879f}, + {0.333949f, 0.225631f, -0.436516f}, {0.332668f, 0.241970f, -0.458633f}, + {0.357923f, 0.280463f, -0.436879f}, {0.333949f, 0.225631f, -0.436516f}, + {0.332668f, 0.241970f, -0.458633f}, {0.314392f, 0.267140f, -0.468557f}, + {0.357923f, 0.280463f, -0.436879f}, {0.375592f, 0.334024f, -0.412810f}, + {0.371817f, 0.366593f, -0.388727f}, {0.371481f, 0.302999f, -0.439742f}, + {0.371481f, 0.302999f, -0.439742f}, {0.371817f, 0.366593f, -0.388727f}, + {0.381019f, 0.271362f, -0.379119f}, {0.371481f, 0.302999f, -0.439742f}, + {0.381019f, 0.271362f, -0.379119f}, {0.375592f, 0.334024f, -0.412810f}, + {0.375592f, 0.334024f, -0.412810f}, {0.381019f, 0.271362f, -0.379119f}, + {0.371817f, 0.366593f, -0.388727f}, {0.731164f, -0.482356f, -0.244570f}, + {0.720657f, -0.563569f, -0.126581f}, {0.713467f, -0.543734f, -0.142669f}, + {0.734388f, -0.587478f, -0.118492f}, {0.713467f, -0.543734f, -0.142669f}, + {0.720657f, -0.563569f, -0.126581f}, {0.734388f, -0.587478f, -0.118492f}, + {0.731095f, -0.621472f, -0.162779f}, {0.713467f, -0.543734f, -0.142669f}, + {0.702371f, -0.573362f, -0.260196f}, {0.731164f, -0.482356f, -0.244570f}, + {0.713467f, -0.543734f, -0.142669f}, {0.731095f, -0.621472f, -0.162779f}, + {0.702371f, -0.573362f, -0.260196f}, {0.713467f, -0.543734f, -0.142669f}, + {0.693914f, -0.617080f, -0.244177f}, {0.702371f, -0.573362f, -0.260196f}, + {0.731095f, -0.621472f, -0.162779f}, {0.712612f, -0.529432f, -0.270936f}, + {0.702833f, -0.481449f, -0.298941f}, {0.702371f, -0.573362f, -0.260196f}, + {0.702371f, -0.573362f, -0.260196f}, {0.702833f, -0.481449f, -0.298941f}, + {0.731164f, -0.482356f, -0.244570f}, {0.711722f, -0.704296f, -0.201800f}, + {0.693914f, -0.617080f, -0.244177f}, {0.731095f, -0.621472f, -0.162779f}, + {0.661019f, -0.524413f, -0.311967f}, {0.712612f, -0.529432f, -0.270936f}, + {0.702371f, -0.573362f, -0.260196f}, {0.633983f, -0.622554f, -0.286089f}, + {0.661019f, -0.524413f, -0.311967f}, {0.693914f, -0.617080f, -0.244177f}, + {0.693914f, -0.617080f, -0.244177f}, {0.661019f, -0.524413f, -0.311967f}, + {0.702371f, -0.573362f, -0.260196f}, {0.662332f, -0.669297f, -0.249134f}, + {0.693914f, -0.617080f, -0.244177f}, {0.711722f, -0.704296f, -0.201800f}, + {0.693914f, -0.617080f, -0.244177f}, {0.662332f, -0.669297f, -0.249134f}, + {0.633983f, -0.622554f, -0.286089f}, {0.661019f, -0.524413f, -0.311967f}, + {0.584546f, -0.493636f, -0.305000f}, {0.712612f, -0.529432f, -0.270936f}, + {0.712612f, -0.529432f, -0.270936f}, {0.584546f, -0.493636f, -0.305000f}, + {0.702833f, -0.481449f, -0.298941f}, {0.625252f, -0.672432f, -0.269750f}, + {0.633983f, -0.622554f, -0.286089f}, {0.662332f, -0.669297f, -0.249134f}, + {0.604107f, -0.616324f, -0.295926f}, {0.661019f, -0.524413f, -0.311967f}, + {0.633983f, -0.622554f, -0.286089f}, {0.590344f, -0.666837f, -0.282277f}, + {0.633983f, -0.622554f, -0.286089f}, {0.625252f, -0.672432f, -0.269750f}, + {0.633983f, -0.622554f, -0.286089f}, {0.590344f, -0.666837f, -0.282277f}, + {0.604107f, -0.616324f, -0.295926f}, {0.588446f, -0.553549f, -0.308191f}, + {0.584546f, -0.493636f, -0.305000f}, {0.661019f, -0.524413f, -0.311967f}, + {0.661019f, -0.524413f, -0.311967f}, {0.604107f, -0.616324f, -0.295926f}, + {0.588446f, -0.553549f, -0.308191f}, {0.551275f, -0.650472f, -0.289342f}, + {0.604107f, -0.616324f, -0.295926f}, {0.590344f, -0.666837f, -0.282277f}, + {0.551275f, -0.650472f, -0.289342f}, {0.588446f, -0.553549f, -0.308191f}, + {0.604107f, -0.616324f, -0.295926f}, {0.522898f, -0.568872f, -0.289301f}, + {0.584546f, -0.493636f, -0.305000f}, {0.588446f, -0.553549f, -0.308191f}, + {0.522898f, -0.568872f, -0.289301f}, {0.588446f, -0.553549f, -0.308191f}, + {0.551275f, -0.650472f, -0.289342f}, {0.538608f, -0.506152f, -0.275547f}, + {0.584546f, -0.493636f, -0.305000f}, {0.522898f, -0.568872f, -0.289301f}, + {0.472991f, -0.630213f, -0.286776f}, {0.522898f, -0.568872f, -0.289301f}, + {0.551275f, -0.650472f, -0.289342f}, {0.522898f, -0.568872f, -0.289301f}, + {0.472991f, -0.630213f, -0.286776f}, {0.478024f, -0.583510f, -0.277120f}, + {0.493554f, -0.502430f, -0.206613f}, {0.584546f, -0.493636f, -0.305000f}, + {0.538608f, -0.506152f, -0.275547f}, {0.584546f, -0.493636f, -0.305000f}, + {0.493554f, -0.502430f, -0.206613f}, {0.588326f, -0.459820f, -0.149694f}, + {0.510656f, -0.521353f, -0.256432f}, {0.538608f, -0.506152f, -0.275547f}, + {0.522898f, -0.568872f, -0.289301f}, {0.538608f, -0.506152f, -0.275547f}, + {0.510656f, -0.521353f, -0.256432f}, {0.493554f, -0.502430f, -0.206613f}, + {0.510656f, -0.521353f, -0.256432f}, {0.478024f, -0.583510f, -0.277120f}, + {0.462747f, -0.557010f, -0.256818f}, {0.522898f, -0.568872f, -0.289301f}, + {0.478024f, -0.583510f, -0.277120f}, {0.510656f, -0.521353f, -0.256432f}, + {0.510656f, -0.521353f, -0.256432f}, {0.462747f, -0.557010f, -0.256818f}, + {0.493554f, -0.502430f, -0.206613f}, {0.478382f, -0.512709f, -0.219323f}, + {0.493554f, -0.502430f, -0.206613f}, {0.462747f, -0.557010f, -0.256818f}, + {0.493554f, -0.502430f, -0.206613f}, {0.519126f, -0.484408f, -0.182053f}, + {0.588326f, -0.459820f, -0.149694f}, {0.731164f, -0.482356f, -0.244570f}, + {0.600226f, -0.471206f, -0.122602f}, {0.720657f, -0.563569f, -0.126581f}, + {0.588326f, -0.459820f, -0.149694f}, {0.600226f, -0.471206f, -0.122602f}, + {0.731164f, -0.482356f, -0.244570f}, {0.578587f, -0.390491f, -0.263057f}, + {0.588326f, -0.459820f, -0.149694f}, {0.576231f, -0.389789f, -0.247438f}, + {0.468667f, -0.664724f, -0.291909f}, {0.551275f, -0.650472f, -0.289342f}, + {0.543268f, -0.710829f, -0.285133f}, {0.543268f, -0.710829f, -0.285133f}, + {0.590344f, -0.666837f, -0.282277f}, {0.596126f, -0.724274f, -0.272534f}, + {0.596126f, -0.724274f, -0.272534f}, {0.625252f, -0.672432f, -0.269750f}, + {0.623118f, -0.726832f, -0.262889f}, {0.623118f, -0.726832f, -0.262889f}, + {0.625252f, -0.672432f, -0.269750f}, {0.671667f, -0.722656f, -0.237407f}, + {0.671667f, -0.722656f, -0.237407f}, {0.662332f, -0.669297f, -0.249134f}, + {0.711722f, -0.704296f, -0.201800f}, {0.711722f, -0.704296f, -0.201800f}, + {0.731095f, -0.621472f, -0.162779f}, {0.727599f, -0.690301f, -0.181027f}, + {0.727599f, -0.690301f, -0.181027f}, {0.731095f, -0.621472f, -0.162779f}, + {0.774117f, -0.644992f, -0.078104f}, {0.734388f, -0.587478f, -0.118492f}, + {0.774117f, -0.644992f, -0.078104f}, {0.731095f, -0.621472f, -0.162779f}, + {0.662332f, -0.669297f, -0.249134f}, {0.671667f, -0.722656f, -0.237407f}, + {0.625252f, -0.672432f, -0.269750f}, {0.625252f, -0.672432f, -0.269750f}, + {0.596126f, -0.724274f, -0.272534f}, {0.590344f, -0.666837f, -0.282277f}, + {0.590344f, -0.666837f, -0.282277f}, {0.543268f, -0.710829f, -0.285133f}, + {0.551275f, -0.650472f, -0.289342f}, {0.551275f, -0.650472f, -0.289342f}, + {0.468667f, -0.664724f, -0.291909f}, {0.472991f, -0.630213f, -0.286776f}, + {0.588326f, -0.459820f, -0.149694f}, {0.578587f, -0.390491f, -0.263057f}, + {0.584546f, -0.493636f, -0.305000f}, {0.866112f, -0.309084f, -0.121136f}, + {0.841497f, -0.318153f, -0.203204f}, {0.960513f, -0.281200f, -0.060842f}, + {0.964126f, -0.355337f, -0.131839f}, {0.960513f, -0.281200f, -0.060842f}, + {0.841497f, -0.318153f, -0.203204f}, {0.964776f, -0.218251f, -0.165152f}, + {0.957239f, -0.210717f, -0.066624f}, {0.964126f, -0.355337f, -0.131839f}, + {0.964126f, -0.355337f, -0.131839f}, {0.957239f, -0.210717f, -0.066624f}, + {0.960513f, -0.281200f, -0.060842f}, {0.957239f, -0.210717f, -0.066624f}, + {0.964776f, -0.218251f, -0.165152f}, {1.003311f, -0.085081f, -0.098274f}, + {1.009633f, -0.123172f, -0.155768f}, {1.003311f, -0.085081f, -0.098274f}, + {0.964776f, -0.218251f, -0.165152f}, {0.748921f, -0.251520f, -0.292421f}, + {0.780247f, -0.298239f, -0.173676f}, {0.725204f, -0.379108f, -0.272777f}, + {0.841497f, -0.318153f, -0.203204f}, {0.780247f, -0.298239f, -0.173676f}, + {0.748921f, -0.251520f, -0.292421f}, {0.748921f, -0.251520f, -0.292421f}, + {0.829233f, -0.236954f, -0.261700f}, {0.841497f, -0.318153f, -0.203204f}, + {0.829584f, -0.211497f, -0.251499f}, {0.841497f, -0.318153f, -0.203204f}, + {0.829233f, -0.236954f, -0.261700f}, {0.648469f, -0.235141f, -0.312228f}, + {0.725204f, -0.379108f, -0.272777f}, {0.578587f, -0.390491f, -0.263057f}, + {0.725204f, -0.379108f, -0.272777f}, {0.648469f, -0.235141f, -0.312228f}, + {0.748921f, -0.251520f, -0.292421f}, {0.748921f, -0.251520f, -0.292421f}, + {0.829584f, -0.211497f, -0.251499f}, {0.829233f, -0.236954f, -0.261700f}, + {0.829584f, -0.211497f, -0.251499f}, {0.964776f, -0.218251f, -0.165152f}, + {0.841497f, -0.318153f, -0.203204f}, {0.964776f, -0.218251f, -0.165152f}, + {0.964126f, -0.355337f, -0.131839f}, {0.841497f, -0.318153f, -0.203204f}, + {0.829584f, -0.211497f, -0.251499f}, {0.748921f, -0.251520f, -0.292421f}, + {0.738573f, -0.212239f, -0.156084f}, {0.748921f, -0.251520f, -0.292421f}, + {0.648469f, -0.235141f, -0.312228f}, {0.675594f, -0.258867f, -0.180009f}, + {0.675594f, -0.258867f, -0.180009f}, {0.738573f, -0.212239f, -0.156084f}, + {0.748921f, -0.251520f, -0.292421f}, {0.916396f, -0.228440f, -0.117147f}, + {0.957239f, -0.210717f, -0.066624f}, {0.829584f, -0.211497f, -0.251499f}, + {0.957239f, -0.210717f, -0.066624f}, {0.964776f, -0.218251f, -0.165152f}, + {0.829584f, -0.211497f, -0.251499f}, {0.675594f, -0.258867f, -0.180009f}, + {0.578587f, -0.390491f, -0.263057f}, {0.576231f, -0.389789f, -0.247438f}, + {0.578587f, -0.390491f, -0.263057f}, {0.675594f, -0.258867f, -0.180009f}, + {0.648469f, -0.235141f, -0.312228f}, {0.916396f, -0.228440f, -0.117147f}, + {0.829584f, -0.211497f, -0.251499f}, {0.738573f, -0.212239f, -0.156084f}, + {0.957239f, -0.210717f, -0.066624f}, {0.916396f, -0.228440f, -0.117147f}, + {0.866112f, -0.309084f, -0.121136f}, {0.738573f, -0.212239f, -0.156084f}, + {0.866112f, -0.309084f, -0.121136f}, {0.916396f, -0.228440f, -0.117147f}, + {0.866112f, -0.309084f, -0.121136f}, {0.960513f, -0.281200f, -0.060842f}, + {0.957239f, -0.210717f, -0.066624f}, {0.738573f, -0.212239f, -0.156084f}, + {0.675594f, -0.258867f, -0.180009f}, {0.780247f, -0.298239f, -0.173676f}, + {0.576231f, -0.389789f, -0.247438f}, {0.780247f, -0.298239f, -0.173676f}, + {0.675594f, -0.258867f, -0.180009f}, {0.841497f, -0.318153f, -0.203204f}, + {0.866112f, -0.309084f, -0.121136f}, {0.780247f, -0.298239f, -0.173676f}, + {0.780247f, -0.298239f, -0.173676f}, {0.866112f, -0.309084f, -0.121136f}, + {0.738573f, -0.212239f, -0.156084f}, {0.588326f, -0.459820f, -0.149694f}, + {0.731164f, -0.482356f, -0.244570f}, {0.576231f, -0.389789f, -0.247438f}, + {0.731164f, -0.482356f, -0.244570f}, {0.702833f, -0.481449f, -0.298941f}, + {0.725204f, -0.379108f, -0.272777f}, {0.702833f, -0.481449f, -0.298941f}, + {0.584546f, -0.493636f, -0.305000f}, {0.578587f, -0.390491f, -0.263057f}, + {0.780247f, -0.298239f, -0.173676f}, {0.576231f, -0.389789f, -0.247438f}, + {0.731164f, -0.482356f, -0.244570f}, {0.725204f, -0.379108f, -0.272777f}, + {0.780247f, -0.298239f, -0.173676f}, {0.731164f, -0.482356f, -0.244570f}, + {0.578587f, -0.390491f, -0.263057f}, {0.725204f, -0.379108f, -0.272777f}, + {0.702833f, -0.481449f, -0.298941f}}; diff --git a/libvisual-plugins/plugins/actor/nebulus/draw_gl.c b/libvisual-plugins/plugins/actor/nebulus/draw_gl.c index 9b4698129..506c97e8e 100644 --- a/libvisual-plugins/plugins/actor/nebulus/draw_gl.c +++ b/libvisual-plugins/plugins/actor/nebulus/draw_gl.c @@ -5,7 +5,7 @@ GLuint blurtexture = 0, knotbg = 0, tunnel = 0; GLuint tentacle = 0, twist = 0, twistbg = 0, texchild = 0; GLuint childbg = 0, energy = 0; -GLint *blur_data[128*128*4]; +GLint *blur_data[128 * 128 * 4]; GLUquadricObj *myquadratic; GLfloat point[37][37][3]; int create_knot, create_quadratic; @@ -14,16 +14,14 @@ GLfloat x_angle = 20.0, x_speed = 0.0; GLfloat z_angle = 0.0, z_speed = 0.0; GLfloat speed_bg = 6, old_speed_bg = 6; GLfloat elapsed_time, last_time; -GLfloat GlobalAmbient[4] = { 0.2f, 0.2f, 0.2f, 1.0f }; -GLfloat Light0Pos[4] = { 0.0f, 5.0f, 10.0f, 1.0f }; -GLfloat Light0Ambient[4] = { 0.2f, 0.2f, 0.2f, 1.0f }; -GLfloat Light0Diffuse[4] = { 0.5f, 0.5f, 0.5f, 1.0f }; -GLfloat Light0Specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f }; -GLfloat LmodelAmbient[4] = { 0.2f, 0.2f, 0.2f, 1.0f }; - -void -viewortho(void) -{ +GLfloat GlobalAmbient[4] = {0.2f, 0.2f, 0.2f, 1.0f}; +GLfloat Light0Pos[4] = {0.0f, 5.0f, 10.0f, 1.0f}; +GLfloat Light0Ambient[4] = {0.2f, 0.2f, 0.2f, 1.0f}; +GLfloat Light0Diffuse[4] = {0.5f, 0.5f, 0.5f, 1.0f}; +GLfloat Light0Specular[4] = {0.8f, 0.8f, 0.8f, 1.0f}; +GLfloat LmodelAmbient[4] = {0.2f, 0.2f, 0.2f, 1.0f}; + +void viewortho(void) { glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); @@ -33,38 +31,26 @@ viewortho(void) glLoadIdentity(); } - -void -viewperspective(void) -{ +void viewperspective(void) { glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); } - -GLfloat -reduce_vsync(GLfloat rotate) -{ +GLfloat reduce_vsync(GLfloat rotate) { if (framerate > FRAME_BASE) rotate /= (GLfloat)framerate / FRAME_BASE; return rotate; } - -GLfloat -reduce_vsync_inv(GLfloat rotate) -{ +GLfloat reduce_vsync_inv(GLfloat rotate) { if (framerate > FRAME_BASE) rotate *= (GLfloat)framerate / FRAME_BASE; return rotate; } - -void -drawblur(GLfloat times, GLfloat inc, GLfloat spost) -{ +void drawblur(GLfloat times, GLfloat inc, GLfloat spost) { GLfloat alpha = 0.2f; GLfloat alphainc; GLint i; @@ -76,7 +62,7 @@ drawblur(GLfloat times, GLfloat inc, GLfloat spost) glDisable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glEnable(GL_BLEND); - glBindTexture(GL_TEXTURE_2D,blurtexture); + glBindTexture(GL_TEXTURE_2D, blurtexture); viewortho(); alphainc = alpha / times; @@ -84,7 +70,7 @@ drawblur(GLfloat times, GLfloat inc, GLfloat spost) for (i = 0; i < times; i++) { glColor4f(1.0f, 1.0f, 1.0f, alpha); glTexCoord2f(0 + spost, 1 - spost); - glVertex2f(0,0); + glVertex2f(0, 0); glTexCoord2f(0 + spost, 0 + spost); glVertex2f(0, point_general->HEIGHT); @@ -104,10 +90,7 @@ drawblur(GLfloat times, GLfloat inc, GLfloat spost) glDisable(GL_BLEND); } - -void -draw_background(int mode) -{ +void draw_background(int mode) { int x, y; GLfloat xf, xf2, yf, yf2, angle; @@ -118,148 +101,120 @@ draw_background(int mode) if (!mode) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(135.0f, 4/3, 0.001f, 100.0f); + gluPerspective(135.0f, 4 / 3, 0.001f, 100.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); for (x = 0; x < 16; x++) { for (y = 0; y < 16; y++) { - point[x][y][0] = 0; - point[x][y][1] = 0; - point[x][y][2] = 0; + point[x][y][0] = 0; + point[x][y][1] = 0; + point[x][y][2] = 0; } } - } - else + } else recalc_perspective(); - angle = (GLfloat)(last_time + elapsed_time)/2; - angle = angle/4; + angle = (GLfloat)(last_time + elapsed_time) / 2; + angle = angle / 4; last_time = elapsed_time; if (mode) { for (x = 0; x < 16; x++) { for (y = 0; y < 16; y++) { - point[x][y][0] = x*2 - 16 + sin(angle/60 + x*10*PI/360)*2; - point[x][y][1] = y*2 - 16 + cos(angle/95 + x*10*2*PI/360)*8; - point[x][y][2] = sin(angle/180 + x*10*2*PI/360)*2; + point[x][y][0] = x * 2 - 16 + sin(angle / 60 + x * 10 * PI / 360) * 2; + point[x][y][1] = + y * 2 - 16 + cos(angle / 95 + x * 10 * 2 * PI / 360) * 8; + point[x][y][2] = sin(angle / 180 + x * 10 * 2 * PI / 360) * 2; } } } glTranslatef(0.0f, 0.0f, -6.0f); - glRotatef(-angle/5, 0.0f, 0.0f, 1.0f); + glRotatef(-angle / 5, 0.0f, 0.0f, 1.0f); glColor3f(1.0f, 1.0f, 1.0f); glBegin(GL_QUADS); for (x = 0; x < 15; x++) { - xf = (GLfloat)x/16; - xf2 = (GLfloat)(x+1)/16; + xf = (GLfloat)x / 16; + xf2 = (GLfloat)(x + 1) / 16; for (y = 0; y < 15; y++) { - yf = (GLfloat)y/16; - yf2 = (GLfloat)(y+1)/16; + yf = (GLfloat)y / 16; + yf2 = (GLfloat)(y + 1) / 16; glTexCoord2f(xf, yf); glVertex3f(point[x][y][0], point[x][y][1], point[x][y][2]); glTexCoord2f(xf, yf2); - glVertex3f(point[x][y+1][0], point[x][y+1][1], point[x][y+1][2]); + glVertex3f(point[x][y + 1][0], point[x][y + 1][1], point[x][y + 1][2]); glTexCoord2f(xf2, yf2); - glVertex3f(point[x+1][y+1][0], point[x+1][y+1][1], point[x+1][y+1][2]); + glVertex3f(point[x + 1][y + 1][0], point[x + 1][y + 1][1], + point[x + 1][y + 1][2]); glTexCoord2f(xf2, yf); - glVertex3f(point[x+1][y][0], point[x+1][y][1], point[x+1][y][2]); + glVertex3f(point[x + 1][y][0], point[x + 1][y][1], point[x + 1][y][2]); } - } + } glEnd(); if (!mode) { glTranslatef(0, 0, 5); - glRotatef(angle/1.3f, 1.0f, 0.0f, 0.0f); - glRotatef(angle/2, 0.0f, 1.0f, 0.0f); + glRotatef(angle / 1.3f, 1.0f, 0.0f, 0.0f); + glRotatef(angle / 2, 0.0f, 1.0f, 0.0f); gluSphere(myquadratic, 1.3f, 32.0f, 32.0f); } glPopMatrix(); } - -int -gen_gl_texture(GLuint texture) -{ +int gen_gl_texture(GLuint texture) { if (texture) return FALSE; glGenTextures(1, &texture); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); return TRUE; } - -void -delete_gl_texture(GLuint texture) -{ +void delete_gl_texture(GLuint texture) { if (texture) glDeleteTextures(1, &texture); texture = 0; } +void use_gl_texture(GLuint texture) { glBindTexture(GL_TEXTURE_2D, texture); } -void -use_gl_texture(GLuint texture) -{ - glBindTexture(GL_TEXTURE_2D, texture); +void upload_gl_texture(VisVideo *image) { + glTexImage2D(GL_TEXTURE_2D, 0, 3, visual_video_get_width(image), + visual_video_get_height(image), 0, GL_RGB, GL_UNSIGNED_BYTE, + visual_video_get_pixels(image)); } -void -upload_gl_texture (VisVideo *image) -{ - glTexImage2D(GL_TEXTURE_2D, 0, 3, visual_video_get_width (image), visual_video_get_height (image), - 0, GL_RGB, GL_UNSIGNED_BYTE, visual_video_get_pixels (image)); -} - -void -use_twist_texture(void) -{ +void use_twist_texture(void) { if (gen_gl_texture(twist)) upload_gl_texture(twist_image); use_gl_texture(twist); } - -void -use_child_texture(void) -{ +void use_child_texture(void) { if (gen_gl_texture(texchild)) upload_gl_texture(child_image); use_gl_texture(texchild); } - -void -use_energy_texture(void) -{ +void use_energy_texture(void) { if (gen_gl_texture(childbg)) upload_gl_texture(energy_image); use_gl_texture(childbg); } - -void -use_background_texture(void) -{ +void use_background_texture(void) { if (gen_gl_texture(twistbg)) upload_gl_texture(background_image); use_gl_texture(twistbg); } - -void -recalc_perspective(void) -{ +void recalc_perspective(void) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(45.0f, (GLfloat)640/480, 0.1f, 100.0f); + gluPerspective(45.0f, (GLfloat)640 / 480, 0.1f, 100.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); } - -static void -init_effect(void) -{ +static void init_effect(void) { viewperspective(); glClearDepth(1.0f); glDepthFunc(GL_LESS); @@ -279,7 +234,8 @@ init_effect(void) } if (gen_gl_texture(blurtexture)) - glTexImage2D(GL_TEXTURE_2D, 0, 4, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, blur_data); + glTexImage2D(GL_TEXTURE_2D, 0, 4, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, + blur_data); use_gl_texture(blurtexture); glShadeModel(GL_SMOOTH); glMateriali(GL_FRONT, GL_SHININESS, 128); @@ -320,17 +276,17 @@ init_effect(void) point_general->init = TRUE; } -void -init_gl(void) -{ +void init_gl(void) { /* Initialize bitmaps */ - child_image = visual_video_load_from_file (BITMAP_DIR "/child_texture.bmp"); - energy_image = visual_video_load_from_file (BITMAP_DIR "/energy_texture.bmp"); - tentacle_image = visual_video_load_from_file (BITMAP_DIR "/tentacle_texture.bmp"); - tunnel_image = visual_video_load_from_file (BITMAP_DIR "/tunnel_texture.bmp"); - twist_image = visual_video_load_from_file (BITMAP_DIR "/twist_texture.bmp"); - background_image = visual_video_load_from_file (BITMAP_DIR "/background_texture.bmp"); + child_image = visual_video_load_from_file(BITMAP_DIR "/child_texture.bmp"); + energy_image = visual_video_load_from_file(BITMAP_DIR "/energy_texture.bmp"); + tentacle_image = + visual_video_load_from_file(BITMAP_DIR "/tentacle_texture.bmp"); + tunnel_image = visual_video_load_from_file(BITMAP_DIR "/tunnel_texture.bmp"); + twist_image = visual_video_load_from_file(BITMAP_DIR "/twist_texture.bmp"); + background_image = + visual_video_load_from_file(BITMAP_DIR "/background_texture.bmp"); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); glEnable(GL_TEXTURE_2D); @@ -339,16 +295,14 @@ init_gl(void) glShadeModel(GL_SMOOTH); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(45.0f, (GLfloat)640/480, 0.1f, 100.0f); + gluPerspective(45.0f, (GLfloat)640 / 480, 0.1f, 100.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glEnable(GL_BLEND); } -void -draw_scene(void) -{ +void draw_scene(void) { if (point_general->changement) { recalc_perspective(); if (point_general->effect > EFFECT_NUMBER - 1) { @@ -371,7 +325,7 @@ draw_scene(void) if (gen_gl_texture(twist)) upload_gl_texture(twist_image); if (gen_gl_texture(twistbg)) - upload_gl_texture(background_image); + upload_gl_texture(background_image); use_gl_texture(twist); } if (point_general->effect == 7) { @@ -389,61 +343,61 @@ draw_scene(void) point_general->changement = FALSE; } switch (point_general->effect) { - case 0: - if (!point_general->init) - init_effect(); - glDisable(GL_LIGHTING); - draw_knot(); - break; - case 1: - if (!point_general->init) - init_effect(); - glDisable(GL_LIGHTING); - draw_spectrum(); - break; - case 2: - if (!point_general->init) - init_effect(); - glEnable(GL_LIGHTING); - draw_face(); - break; - case 3: - if (!point_general->init) - init_effect(); - glDisable(GL_LIGHTING); - draw_glthreads(); - break; - case 4: - if (!point_general->init) - init_effect(); - glDisable(GL_LIGHTING); - draw_tunnel(); - break; - case 5: - if (!point_general->init) - init_effect(); - glDisable(GL_LIGHTING); - draw_tentacles(); - break; - case 6: - if (!point_general->init) - init_effect(); - glDisable(GL_LIGHTING); - draw_twist(); - break; - case 7: - if (!point_general->init) - init_effect(); - glDisable(GL_LIGHTING); - draw_child(); - break; - case 8: - if (!point_general->init) - init_effect(); - glDisable(GL_LIGHTING); - draw_energy(); - break; - default: - break; + case 0: + if (!point_general->init) + init_effect(); + glDisable(GL_LIGHTING); + draw_knot(); + break; + case 1: + if (!point_general->init) + init_effect(); + glDisable(GL_LIGHTING); + draw_spectrum(); + break; + case 2: + if (!point_general->init) + init_effect(); + glEnable(GL_LIGHTING); + draw_face(); + break; + case 3: + if (!point_general->init) + init_effect(); + glDisable(GL_LIGHTING); + draw_glthreads(); + break; + case 4: + if (!point_general->init) + init_effect(); + glDisable(GL_LIGHTING); + draw_tunnel(); + break; + case 5: + if (!point_general->init) + init_effect(); + glDisable(GL_LIGHTING); + draw_tentacles(); + break; + case 6: + if (!point_general->init) + init_effect(); + glDisable(GL_LIGHTING); + draw_twist(); + break; + case 7: + if (!point_general->init) + init_effect(); + glDisable(GL_LIGHTING); + draw_child(); + break; + case 8: + if (!point_general->init) + init_effect(); + glDisable(GL_LIGHTING); + draw_energy(); + break; + default: + break; } } diff --git a/libvisual-plugins/plugins/actor/nebulus/energy.c b/libvisual-plugins/plugins/actor/nebulus/energy.c index 64be6b752..fb25b8646 100644 --- a/libvisual-plugins/plugins/actor/nebulus/energy.c +++ b/libvisual-plugins/plugins/actor/nebulus/energy.c @@ -2,15 +2,11 @@ GLfloat energy_time, energy_speed = 0.04f, old_energy_speed = 0.04f; -typedef struct -{ +typedef struct { GLfloat fu, fv; } ctexel; - -static void -put_quad(ctexel cuvpos) -{ +static void put_quad(ctexel cuvpos) { glTexCoord2f(0 + cuvpos.fu, 0 + cuvpos.fv); glVertex3f(-300, 300, 0); glTexCoord2f(1 + cuvpos.fu, 0 + cuvpos.fv); @@ -21,13 +17,10 @@ put_quad(ctexel cuvpos) glVertex3f(-300, -300, 0); } - -static void -drawenergy(GLfloat ftime) -{ +static void drawenergy(GLfloat ftime) { ctexel cuvpos; int i; - GLfloat fog_color[3] = { 0.0f, 0.0f, 0.0f }; + GLfloat fog_color[3] = {0.0f, 0.0f, 0.0f}; glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -38,8 +31,8 @@ drawenergy(GLfloat ftime) glBlendFunc(GL_SRC_ALPHA, GL_ONE); glTranslatef(0.0f, 0.0f, -300.0f); - glRotatef(ftime*30.0f, 1.0f, 0.0f, 0.0f); - glRotatef(30*sin(ftime/3.0f) + 10.0f, 0.0f, 0.0f, 1.0f); + glRotatef(ftime * 30.0f, 1.0f, 0.0f, 0.0f); + glRotatef(30 * sin(ftime / 3.0f) + 10.0f, 0.0f, 0.0f, 1.0f); glRotatef(180.0f, 0.0f, 1.0f, 0.0f); glFogf(GL_FOG_START, 200); @@ -50,8 +43,8 @@ drawenergy(GLfloat ftime) glEnable(GL_FOG); glPushMatrix(); - cuvpos.fu = 0.1f*sin(ftime); - cuvpos.fv = ftime/5.0f; + cuvpos.fu = 0.1f * sin(ftime); + cuvpos.fv = ftime / 5.0f; glColor3f(1.0f, 1.0f, 1.0f); glRotatef(90.0f, 0.0f, 1.0f, 0.0f); @@ -59,17 +52,14 @@ drawenergy(GLfloat ftime) glBegin(GL_QUADS); put_quad(cuvpos); glEnd(); - glRotatef(180/7.0f, 1.0f, 0.0f, 0.0f); + glRotatef(180 / 7.0f, 1.0f, 0.0f, 0.0f); } glPopMatrix(); glDisable(GL_FOG); } - -static void -render_energy(void) -{ +static void render_energy(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); @@ -79,10 +69,7 @@ render_energy(void) glEnable(GL_TEXTURE_2D); } - -void -draw_energy(void) -{ +void draw_energy(void) { energy_speed = old_energy_speed; energy_speed = reduce_vsync(energy_speed); energy_time += energy_speed; diff --git a/libvisual-plugins/plugins/actor/nebulus/face.c b/libvisual-plugins/plugins/actor/nebulus/face.c index a4c94c6ce..2ec8e0db3 100644 --- a/libvisual-plugins/plugins/actor/nebulus/face.c +++ b/libvisual-plugins/plugins/actor/nebulus/face.c @@ -7,18 +7,12 @@ GLfloat face_time, face_rotate = 27, old_face_rotate = 27; GLuint facedl = 0; int face_first = TRUE; - -static void -createvertex(GLuint face0, GLuint face1) -{ +static void createvertex(GLuint face0, GLuint face1) { glNormal3f(normals[face1][0], normals[face1][1], normals[face1][2]); glVertex3f(vertices[face0][0], vertices[face0][1], vertices[face0][2]); } - -static void -createface(void) -{ +static void createface(void) { int i; facedl = glGenLists(1); @@ -35,19 +29,16 @@ createface(void) glEndList(); } - -static void -drawface(void) -{ - GLfloat MaterialColor[4] = { 0.4f, 0.2f, 0.8f, 1.0f }; - GLfloat Specular[4] = { 1, 1, 1, 1 }; +static void drawface(void) { + GLfloat MaterialColor[4] = {0.4f, 0.2f, 0.8f, 1.0f}; + GLfloat Specular[4] = {1, 1, 1, 1}; glDisable(GL_TEXTURE_2D); glPushMatrix(); glTranslatef(0.0f, 0.0f, -3.0f); glColor3f(1.0f, 1.0f, 1.0f); - glRotatef(60*sin(face_time/600), 0, 1, 0); - glRotatef(30*sin(face_time/1100), 1, 0, 0); + glRotatef(60 * sin(face_time / 600), 0, 1, 0); + glRotatef(30 * sin(face_time / 1100), 1, 0, 0); glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, MaterialColor); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular); glScalef(2, 2, 2); @@ -57,10 +48,7 @@ drawface(void) glEnable(GL_TEXTURE_2D); } - -static void -render_face(void) -{ +static void render_face(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_BLEND); @@ -74,10 +62,7 @@ render_face(void) glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); } - -void -draw_face(void) -{ +void draw_face(void) { if (face_first) createface(); face_rotate = old_face_rotate; diff --git a/libvisual-plugins/plugins/actor/nebulus/face_data.c b/libvisual-plugins/plugins/actor/nebulus/face_data.c index a1baf0bc1..5f296ef8f 100644 --- a/libvisual-plugins/plugins/actor/nebulus/face_data.c +++ b/libvisual-plugins/plugins/actor/nebulus/face_data.c @@ -4,617 +4,1554 @@ GLuint numVertices = 473; GLuint numNormals = 537; GLuint numTriangles = 806; -GLfloat face[806][6] = { -{2,1,0 ,0,1,2 }, {3,1,2 ,3,1,0 }, {6,5,4 ,4,5,6 }, {4,7,6 ,6,7,4 }, -{8,6,7 ,8,4,7 }, {7,9,8 ,7,9,8 }, {8,9,10 ,8,9,10 }, {11,8,10 ,11,8,10 }, -{12,11,10 ,12,11,10 }, {1,12,10 ,1,12,10 }, {13,1,10 ,13,1,10 }, -{9,13,10 ,14,13,10 }, {0,1,13 ,2,1,13 }, {14,0,13 ,15,16,17 }, -{15,14,13 ,18,15,17 }, {9,16,15 ,14,19,18 }, {15,13,9 ,18,17,14 }, -{17,16,9 ,20,21,9 }, {9,7,17 ,9,7,20 }, {18,17,7 ,22,20,7 }, -{7,4,18 ,7,6,22 }, {19,14,15 ,23,15,18 }, {20,14,19 ,24,25,23 }, -{19,21,20 ,23,26,24 }, {22,20,21 ,27,24,26 }, {21,23,22 ,26,28,27 }, -{24,22,23 ,29,27,28 }, {23,25,24 ,28,30,29 }, {26,24,25 ,31,29,30 }, -{25,27,26 ,30,32,31 }, {28,26,27 ,33,31,32 }, {28,29,26 ,33,34,31 }, -{31,30,29 ,35,36,34 }, {32,29,30 ,37,34,36 }, {33,1,3 ,38,1,3 }, -{12,1,33 ,12,1,38 }, {34,33,3 ,39,38,3 }, {3,35,34 ,3,40,39 }, -{36,34,35 ,41,39,40 }, {35,32,36 ,40,37,41 }, {30,36,32 ,36,41,37 }, -{31,37,30 ,35,42,36 }, {37,38,30 ,42,43,36 }, {38,36,30 ,43,41,36 }, -{39,36,38 ,44,41,43 }, {34,36,39 ,39,41,44 }, {40,33,34 ,45,38,39 }, -{40,41,33 ,45,46,38 }, {34,39,40 ,39,44,45 }, {41,12,33 ,46,12,38 }, -{42,12,41 ,47,12,46 }, {44,43,8 ,48,49,8 }, {8,11,44 ,8,11,48 }, -{42,44,11 ,47,48,11 }, {11,12,42 ,11,12,47 }, {42,45,44 ,47,50,48 }, -{46,45,42 ,51,50,47 }, {47,45,46 ,52,50,51 }, {42,41,46 ,47,46,51 }, -{48,46,41 ,53,51,46 }, {41,49,48 ,54,55,53 }, {50,49,41 ,56,57,46 }, -{41,51,50 ,46,58,56 }, {52,51,41 ,59,58,46 }, {54,53,52 ,60,61,59 }, -{52,40,54 ,59,45,60 }, {41,40,52 ,46,45,59 }, {50,55,49 ,56,62,57 }, -{51,55,50 ,58,62,56 }, {56,49,55 ,63,57,62 }, {57,49,56 ,64,55,63 }, -{8,43,58 ,8,49,65 }, {58,6,8 ,65,4,8 }, {58,59,5 ,65,66,5 }, -{5,6,58 ,5,4,65 }, {61,60,59 ,67,68,66 }, {59,58,61 ,66,65,67 }, -{62,61,58 ,69,67,65 }, {58,43,62 ,65,49,69 }, {44,62,43 ,48,69,49 }, -{45,62,44 ,50,69,48 }, {63,62,45 ,70,69,50 }, {47,64,63 ,52,71,70 }, -{63,45,47 ,70,50,52 }, {61,62,63 ,67,69,70 }, {63,65,61 ,70,72,67 }, -{48,49,57 ,53,55,64 }, {57,66,48 ,64,73,53 }, {67,48,66 ,74,53,73 }, -{46,48,67 ,51,53,74 }, {47,67,68 ,75,74,76 }, {46,67,47 ,51,74,75 }, -{69,64,47 ,77,71,75 }, {47,68,69 ,75,76,77 }, {64,69,70 ,71,78,79 }, -{70,71,64 ,79,80,71 }, {73,72,71 ,81,82,80 }, {71,70,73 ,80,79,81 }, -{74,72,73 ,83,82,81 }, {75,56,74 ,84,63,83 }, {75,57,56 ,84,64,63 }, -{74,73,75 ,83,81,84 }, {76,60,61 ,85,68,67 }, {61,65,76 ,67,72,86 }, -{64,77,65 ,71,87,72 }, {65,63,64 ,72,70,71 }, {77,76,65 ,87,85,72 }, -{78,76,77 ,88,89,87 }, {77,71,78 ,87,80,88 }, {77,64,71 ,87,71,80 }, -{79,78,71 ,90,88,80 }, {71,72,79 ,80,82,90 }, {74,79,72 ,83,90,82 }, -{80,79,74 ,91,90,83 }, {74,81,80 ,83,92,91 }, {56,82,81 ,63,93,92 }, -{81,74,56 ,92,83,63 }, {55,82,56 ,62,93,63 }, {84,83,80 ,94,95,96 }, -{80,81,84 ,96,92,94 }, {85,84,81 ,97,94,92 }, {81,82,85 ,92,93,97 }, -{55,85,82 ,62,97,93 }, {86,85,55 ,98,97,62 }, {55,87,86 ,62,99,98 }, -{51,87,55 ,58,99,62 }, {88,87,51 ,100,99,58 }, {51,52,88 ,58,59,100 }, -{52,89,88 ,59,101,100 }, {53,89,52 ,61,101,59 }, {90,89,53 ,102,101,61 }, -{89,90,91 ,101,103,103 }, {88,89,91 ,104,101,104 }, {90,92,91 ,102,105,106 }, -{95,94,93 ,107,108,109 }, {96,93,94 ,110,109,108 }, {94,97,96 ,108,111,110 }, -{98,96,97 ,112,110,111 }, {99,96,98 ,113,110,112 }, {98,100,99 ,112,114,113 }, -{92,100,98 ,105,114,112 }, {90,100,92 ,102,114,105 }, {101,100,90 ,115,114,102 }, -{102,100,101 ,116,114,115 }, {99,100,102 ,113,114,116 }, {102,103,99 ,116,117,113 }, -{96,99,103 ,110,113,117 }, {103,104,96 ,117,118,110 }, {93,96,104 ,109,110,118 }, -{106,105,93 ,119,120,109 }, {93,104,106 ,109,118,119 }, {107,106,104 ,121,119,118 }, -{104,103,107 ,118,117,121 }, {108,107,103 ,122,121,117 }, {103,102,108 ,117,116,122 }, -{101,109,102 ,115,123,116 }, {109,108,102 ,123,122,116 }, {101,110,109 ,115,124,123 }, -{111,110,101 ,125,124,115 }, {101,53,111 ,115,61,125 }, {90,53,101 ,102,61,115 }, -{39,54,40 ,44,60,45 }, {112,54,39 ,126,60,44 }, {39,38,112 ,44,43,126 }, -{113,112,38 ,127,126,43 }, {38,37,113 ,43,42,127 }, {114,112,113 ,128,126,127 }, -{115,112,114 ,129,126,128 }, {114,116,115 ,128,130,129 }, {118,117,115 ,131,132,129 }, -{115,116,118 ,129,130,131 }, {120,119,117 ,133,134,132 }, {117,118,120 ,132,131,133 }, -{123,122,121 ,135,136,137 }, {124,122,123 ,138,136,135 }, {125,122,124 ,139,136,138 }, -{124,126,125 ,138,140,139 }, {127,121,119 ,141,137,134 }, {119,120,127 ,134,133,141 }, -{128,117,119 ,142,132,134 }, {115,117,128 ,129,132,142 }, {128,53,115 ,142,61,129 }, -{111,53,128 ,125,61,142 }, {128,110,111 ,142,124,125 }, {119,110,128 ,134,124,142 }, -{121,110,119 ,137,124,134 }, {129,110,121 ,143,124,137 }, {109,110,129 ,123,124,143 }, -{129,130,109 ,143,144,123 }, {115,53,54 ,129,61,60 }, {54,112,115 ,60,126,129 }, -{127,123,121 ,141,135,137 }, {132,131,105 ,145,146,120 }, {105,106,132 ,120,119,145 }, -{132,133,131 ,145,147,148 }, {133,134,131 ,147,149,148 }, {135,134,133 ,150,149,147 }, -{133,136,135 ,147,151,150 }, {137,136,133 ,152,151,147 }, {138,137,133 ,153,152,147 }, -{133,132,138 ,147,145,153 }, {139,138,132 ,154,153,145 }, {140,138,139 ,155,153,154 }, -{141,138,140 ,156,153,155 }, {140,130,141 ,155,144,156 }, {109,130,140 ,123,144,155 }, -{140,108,109 ,155,122,123 }, {139,108,140 ,154,122,155 }, {107,108,139 ,121,122,154 }, -{142,135,136 ,157,150,151 }, {136,143,142 ,151,158,157 }, {144,142,143 ,159,157,158 }, -{143,145,144 ,158,160,159 }, {147,146,145 ,161,162,160 }, {145,143,147 ,160,158,161 }, -{124,146,147 ,138,162,161 }, {147,126,124 ,161,140,138 }, {121,122,125 ,137,136,139 }, -{125,129,121 ,139,143,137 }, {141,130,129 ,156,144,143 }, {129,125,141 ,143,139,156 }, -{126,147,137 ,140,161,152 }, {141,125,126 ,156,139,140 }, {126,137,141 ,140,152,156 }, -{138,141,137 ,153,156,152 }, {147,143,136 ,161,158,151 }, {136,137,147 ,151,152,161 }, -{132,106,107 ,145,119,121 }, {107,139,132 ,121,154,145 }, {28,31,29 ,33,35,34 }, -{148,27,25 ,163,32,30 }, {25,149,148 ,30,164,163 }, {28,27,148 ,33,32,163 }, -{148,150,28 ,163,165,33 }, {151,150,148 ,166,165,163 }, {148,149,151 ,163,167,166 }, -{153,149,152 ,168,167,169 }, {151,149,153 ,166,167,168 }, {154,150,151 ,170,165,166 }, -{151,155,154 ,166,171,170 }, {156,154,155 ,172,170,171 }, {158,157,156 ,173,174,172 }, -{156,155,158 ,172,171,173 }, {151,158,155 ,166,173,171 }, {153,158,151 ,168,173,166 }, -{149,25,152 ,164,30,175 }, {25,23,152 ,30,28,175 }, {152,23,21 ,175,28,26 }, -{21,159,152 ,26,176,175 }, {153,152,159 ,168,169,176 }, {159,160,153 ,176,177,168 }, -{158,153,160 ,173,168,177 }, {160,161,158 ,177,178,173 }, {162,158,161 ,179,173,178 }, -{157,158,162 ,174,173,179 }, {157,162,163 ,174,179,180 }, {163,164,157 ,180,181,174 }, -{156,157,164 ,172,174,181 }, {164,165,156 ,181,182,172 }, {164,166,165 ,181,183,182 }, -{167,166,164 ,184,183,181 }, {164,163,167 ,181,180,184 }, {168,167,163 ,185,184,180 }, -{166,167,169 ,183,184,186 }, {170,169,167 ,187,186,184 }, {172,171,170 ,188,189,187 }, -{170,173,172 ,187,190,188 }, {174,171,172 ,191,189,188 }, {172,175,174 ,188,192,191 }, -{172,177,176 ,188,193,194 }, {176,175,172 ,194,192,188 }, {179,178,176 ,195,196,194 }, -{176,177,179 ,194,193,195 }, {181,180,178 ,197,198,196 }, {178,179,181 ,196,195,197 }, -{183,182,181 ,199,200,197 }, {181,179,183 ,197,195,199 }, {184,183,179 ,201,199,195 }, -{179,177,184 ,195,193,201 }, {173,184,177 ,190,201,193 }, {177,172,173 ,193,188,190 }, -{167,185,173 ,184,202,190 }, {173,170,167 ,190,187,184 }, {167,168,185 ,184,185,202 }, -{163,162,168 ,180,179,185 }, {186,168,162 ,203,185,179 }, {161,187,186 ,178,204,203 }, -{188,187,161 ,205,204,178 }, {161,160,188 ,178,177,205 }, {189,188,160 ,206,205,177 }, -{160,159,189 ,177,176,206 }, {159,19,189 ,176,23,206 }, {21,19,159 ,26,23,176 }, -{190,189,19 ,207,206,23 }, {191,189,190 ,208,206,207 }, {19,16,190 ,23,21,207 }, -{15,16,19 ,18,209,23 }, {192,190,16 ,210,207,21 }, {16,17,192 ,21,20,210 }, -{193,192,17 ,211,210,20 }, {17,18,193 ,20,22,211 }, {194,192,193 ,212,210,211 }, -{193,195,194 ,211,213,212 }, {190,192,194 ,207,210,212 }, {194,191,190 ,212,208,207 }, -{188,189,191 ,205,206,208 }, {191,196,188 ,208,214,205 }, {194,197,196 ,212,215,214 }, -{196,191,194 ,214,208,212 }, {198,197,194 ,216,215,212 }, {194,195,198 ,212,213,216 }, -{199,197,198 ,217,215,216 }, {198,200,199 ,216,218,217 }, {201,199,200 ,219,217,218 }, -{200,202,201 ,218,220,219 }, {203,201,202 ,221,219,220 }, {202,204,203 ,220,222,221 }, -{183,205,182 ,199,223,200 }, {205,206,182 ,223,224,200 }, {207,206,205 ,225,224,223 }, -{205,208,207 ,223,226,225 }, {173,185,184 ,190,202,201 }, {185,208,184 ,202,226,201 }, -{168,208,185 ,185,226,202 }, {209,208,168 ,227,226,185 }, {168,210,209 ,185,228,227 }, -{186,210,168 ,203,228,185 }, {211,210,186 ,229,228,203 }, {186,187,211 ,203,204,229 }, -{196,211,187 ,214,229,204 }, {187,188,196 ,204,205,214 }, {199,211,196 ,217,229,214 }, -{196,197,199 ,214,215,217 }, {210,211,199 ,228,229,217 }, {199,201,210 ,217,219,228 }, -{209,210,201 ,227,228,219 }, {201,203,209 ,219,221,227 }, {207,209,203 ,225,227,221 }, -{208,209,207 ,226,227,225 }, {204,206,207 ,222,224,225 }, {207,203,204 ,225,221,222 }, -{162,161,186 ,179,178,203 }, {183,184,205 ,199,201,223 }, {205,184,208 ,223,201,226 }, -{0,14,2 ,230,25,230 }, {26,29,32 ,31,34,231 }, {213,212,26 ,232,233,31 }, -{26,212,24 ,31,233,29 }, {212,214,22 ,233,234,27 }, {22,24,212 ,27,29,233 }, -{214,212,213 ,234,233,232 }, {213,215,214 ,232,235,234 }, {22,214,216 ,27,234,236 }, -{216,20,22 ,236,237,27 }, {214,215,217 ,234,235,238 }, {217,216,214 ,238,236,234 }, -{218,216,217 ,239,236,238 }, {216,218,14 ,236,239,25 }, {14,20,216 ,25,237,236 }, -{221,220,219 ,240,241,242 }, {219,220,222 ,242,241,243 }, {5,224,223 ,5,244,245 }, -{223,4,5 ,245,6,5 }, {224,226,225 ,244,246,247 }, {225,223,224 ,247,245,244 }, -{227,225,226 ,248,247,246 }, {227,226,228 ,248,246,249 }, {227,228,229 ,248,249,250 }, -{227,229,220 ,248,250,241 }, {227,220,230 ,248,241,251 }, {227,230,225 ,248,251,247 }, -{230,220,221 ,251,241,240 }, {230,221,231 ,251,252,253 }, {230,231,232 ,251,253,254 }, -{233,225,230 ,255,247,251 }, {230,232,233 ,251,254,255 }, {233,234,223 ,256,257,245 }, -{223,225,233 ,245,247,256 }, {234,18,4 ,257,22,6 }, {4,223,234 ,6,245,257 }, -{232,231,235 ,254,253,258 }, {235,231,236 ,258,259,260 }, {236,237,235 ,260,261,258 }, -{236,239,238 ,260,262,263 }, {238,237,236 ,263,261,260 }, {239,241,240 ,262,264,265 }, -{240,238,239 ,265,263,262 }, {241,243,242 ,264,266,267 }, {242,240,241 ,267,265,264 }, -{242,243,244 ,267,266,268 }, {243,245,244 ,266,269,268 }, {245,247,246 ,269,270,271 }, -{247,245,248 ,270,269,272 }, {222,220,249 ,243,241,273 }, {249,220,229 ,273,241,250 }, -{222,249,250 ,243,273,274 }, {250,251,222 ,274,275,243 }, {251,250,252 ,275,274,276 }, -{252,248,251 ,276,272,275 }, {248,252,247 ,272,276,270 }, {247,253,246 ,270,277,271 }, -{247,254,253 ,270,278,277 }, {247,252,254 ,270,276,278 }, {254,252,255 ,278,276,279 }, -{255,252,250 ,279,276,274 }, {250,249,256 ,274,273,280 }, {249,257,256 ,273,281,280 }, -{256,255,250 ,280,279,274 }, {249,229,257 ,273,250,281 }, {257,229,258 ,281,250,282 }, -{260,259,228 ,283,284,249 }, {228,226,260 ,249,246,283 }, {259,258,229 ,284,282,250 }, -{229,228,259 ,250,249,284 }, {259,261,258 ,284,285,282 }, {258,261,262 ,282,285,286 }, -{262,261,263 ,286,285,287 }, {262,257,258 ,286,281,282 }, {257,262,264 ,281,286,288 }, -{264,265,257 ,288,289,290 }, {257,265,266 ,281,291,292 }, {266,267,257 ,292,293,281 }, -{257,267,268 ,281,293,294 }, {268,270,269 ,294,295,296 }, {269,256,268 ,296,280,294 }, -{268,256,257 ,294,280,281 }, {265,271,266 ,291,297,292 }, {266,271,267 ,292,297,293 }, -{271,265,272 ,297,291,298 }, {272,265,273 ,298,289,299 }, {260,226,224 ,283,246,244 }, -{224,274,260 ,244,300,283 }, {59,274,224 ,66,300,244 }, {224,5,59 ,244,5,66 }, -{60,275,274 ,68,301,300 }, {274,59,60 ,300,66,68 }, {275,276,260 ,301,302,283 }, -{260,274,275 ,283,300,301 }, {260,276,259 ,283,302,284 }, {259,276,261 ,284,302,285 }, -{261,276,277 ,285,302,303 }, {278,263,261 ,304,287,285 }, {261,277,278 ,285,303,304 }, -{276,275,279 ,302,301,305 }, {279,277,276 ,305,303,302 }, {265,264,280 ,289,288,306 }, -{280,273,265 ,306,299,289 }, {280,264,281 ,306,288,307 }, {281,264,262 ,307,288,286 }, -{282,281,263 ,308,307,309 }, {263,281,262 ,309,307,286 }, {278,283,282 ,310,311,308 }, -{282,263,278 ,308,309,310 }, {283,278,284 ,311,310,312 }, {284,285,283 ,312,313,311 }, -{287,286,285 ,314,315,313 }, {285,284,287 ,313,312,314 }, {286,287,288 ,315,314,316 }, -{288,272,289 ,316,298,317 }, {272,273,289 ,298,299,317 }, {289,286,288 ,317,315,316 }, -{60,76,279 ,68,86,305 }, {279,275,60 ,305,301,68 }, {290,278,277 ,318,304,303 }, -{277,279,290 ,303,305,318 }, {279,76,290 ,305,86,318 }, {76,78,284 ,89,88,312 }, -{284,290,76 ,312,318,89 }, {284,278,290 ,312,310,318 }, {284,78,79 ,312,88,90 }, -{79,287,284 ,90,314,312 }, {287,79,288 ,314,90,316 }, {79,80,291 ,90,91,319 }, -{291,288,79 ,319,316,90 }, {292,272,288 ,320,298,316 }, {288,291,292 ,316,319,320 }, -{272,292,271 ,298,320,297 }, {83,293,291 ,95,321,322 }, {291,80,83 ,322,96,95 }, -{293,294,292 ,321,323,320 }, {292,291,293 ,320,322,321 }, {292,294,271 ,320,323,297 }, -{271,294,295 ,297,323,324 }, {295,296,271 ,324,325,297 }, {271,296,267 ,297,325,293 }, -{267,296,297 ,293,325,326 }, {297,268,267 ,326,294,293 }, {297,298,268 ,326,327,294 }, -{268,298,270 ,294,327,295 }, {270,298,299 ,295,327,328 }, {300,299,298 ,329,329,327 }, -{300,298,297 ,330,327,330 }, {300,301,299 ,331,332,328 }, {93,302,95 ,109,333,107 }, -{302,93,303 ,333,109,334 }, {303,304,302 ,334,335,333 }, {304,303,305 ,335,334,336 }, -{305,303,306 ,336,334,337 }, {306,307,305 ,337,338,336 }, {305,307,301 ,336,338,332 }, -{301,307,299 ,332,338,328 }, {299,307,308 ,328,338,339 }, {308,307,309 ,339,338,340 }, -{307,306,310 ,338,337,341 }, {310,309,307 ,341,340,338 }, {306,303,311 ,337,334,342 }, -{311,310,306 ,342,341,337 }, {311,303,93 ,342,334,109 }, {105,312,311 ,120,343,342 }, -{311,93,105 ,342,109,120 }, {312,313,310 ,343,344,341 }, {310,311,312 ,341,342,343 }, -{313,314,309 ,344,345,340 }, {309,310,313 ,340,341,344 }, {309,315,308 ,340,346,339 }, -{309,314,315 ,340,345,346 }, {315,316,308 ,346,347,339 }, {308,316,317 ,339,347,348 }, -{317,270,308 ,348,295,339 }, {308,270,299 ,339,295,328 }, {256,269,255 ,280,296,279 }, -{255,269,318 ,279,296,349 }, {318,254,255 ,349,278,279 }, {254,318,319 ,278,349,350 }, -{319,253,254 ,350,277,278 }, {319,318,320 ,350,349,351 }, {320,318,321 ,351,349,352 }, -{321,322,320 ,352,353,351 }, {324,323,322 ,354,355,353 }, {322,321,324 ,353,352,354 }, -{326,325,323 ,356,357,355 }, {323,324,326 ,355,354,356 }, {329,328,327 ,358,359,360 }, -{327,328,330 ,360,359,361 }, {330,328,331 ,361,359,362 }, {331,332,330 ,362,363,361 }, -{326,329,333 ,356,358,364 }, {333,325,326 ,364,357,356 }, {326,324,334 ,356,354,365 }, -{334,324,321 ,365,354,352 }, {321,270,334 ,352,295,365 }, {334,270,317 ,365,295,348 }, -{317,316,334 ,348,347,365 }, {334,316,326 ,365,347,356 }, {326,316,329 ,356,347,358 }, -{329,316,335 ,358,347,366 }, {316,315,336 ,347,346,367 }, {336,335,316 ,367,366,347 }, -{269,270,321 ,296,295,352 }, {321,318,269 ,352,349,296 }, {329,327,333 ,358,360,364 }, -{131,337,312 ,146,368,343 }, {312,105,131 ,343,120,146 }, {131,338,337 ,148,369,368 }, -{131,134,338 ,148,149,369 }, {134,135,339 ,149,150,370 }, {339,338,134 ,370,369,149 }, -{338,339,340 ,369,370,371 }, {338,340,341 ,369,371,372 }, {341,337,338 ,372,368,369 }, -{337,341,342 ,368,372,373 }, {342,341,343 ,373,372,374 }, {343,341,344 ,374,372,375 }, -{344,336,343 ,375,367,374 }, {343,336,315 ,374,367,346 }, {315,314,343 ,346,345,374 }, -{343,314,342 ,374,345,373 }, {342,314,313 ,373,345,344 }, {135,142,345 ,150,157,376 }, -{345,339,135 ,376,370,150 }, {142,144,346 ,157,159,377 }, {346,345,142 ,377,376,157 }, -{348,347,345 ,378,379,376 }, {345,346,348 ,376,377,378 }, {348,330,332 ,378,361,363 }, -{332,347,348 ,363,379,378 }, {328,329,335 ,359,358,366 }, {335,331,328 ,366,362,359 }, -{336,344,331 ,367,375,362 }, {331,335,336 ,362,366,367 }, {340,347,332 ,371,379,363 }, -{331,344,340 ,362,375,371 }, {340,332,331 ,371,363,362 }, {340,344,341 ,371,375,372 }, -{345,347,340 ,376,379,371 }, {340,339,345 ,371,370,376 }, {312,337,342 ,343,368,373 }, -{342,313,312 ,373,344,343 }, {245,246,244 ,269,271,268 }, {242,350,349 ,267,380,381 }, -{349,240,242 ,381,265,267 }, {350,242,244 ,380,267,268 }, {244,351,350 ,268,382,380 }, -{350,351,352 ,380,382,383 }, {352,349,350 ,383,381,380 }, {354,349,353 ,384,381,385 }, -{353,349,352 ,385,381,383 }, {351,356,355 ,382,386,387 }, {355,352,351 ,387,383,382 }, -{355,356,357 ,387,386,388 }, {359,358,355 ,389,390,387 }, {355,357,359 ,387,388,389 }, -{355,358,352 ,387,390,383 }, {352,358,353 ,383,390,385 }, {354,240,349 ,384,265,381 }, -{354,238,240 ,384,263,265 }, {238,354,360 ,263,384,391 }, {360,237,238 ,391,261,263 }, -{354,353,361 ,384,385,392 }, {361,360,354 ,392,391,384 }, {353,358,362 ,385,390,393 }, -{362,361,353 ,393,392,385 }, {362,358,363 ,393,390,394 }, {363,358,359 ,394,390,389 }, -{363,359,364 ,394,389,395 }, {364,365,363 ,395,396,394 }, {359,357,366 ,389,388,397 }, -{366,364,359 ,397,395,389 }, {366,367,364 ,397,398,395 }, {367,368,365 ,398,399,396 }, -{365,364,367 ,396,395,398 }, {365,368,369 ,396,399,400 }, {370,368,367 ,401,399,398 }, -{368,370,371 ,399,401,402 }, {374,373,372 ,403,404,405 }, {372,371,374 ,405,402,403 }, -{374,376,375 ,403,406,407 }, {375,373,374 ,407,404,403 }, {377,373,375 ,408,404,407 }, -{375,378,377 ,407,409,408 }, {380,379,377 ,410,411,408 }, {377,378,380 ,408,409,410 }, -{180,181,379 ,198,197,411 }, {379,380,180 ,411,410,198 }, {182,381,379 ,200,412,411 }, -{379,181,182 ,411,197,200 }, {381,382,377 ,412,413,408 }, {377,379,381 ,408,411,412 }, -{382,372,373 ,413,405,404 }, {373,377,382 ,404,408,413 }, {383,368,371 ,414,399,402 }, -{371,372,383 ,402,405,414 }, {383,369,368 ,414,400,399 }, {369,363,365 ,400,394,396 }, -{363,369,384 ,394,400,415 }, {384,385,362 ,415,416,393 }, {385,386,361 ,416,417,392 }, -{361,362,385 ,392,393,416 }, {386,387,360 ,417,418,391 }, {360,361,386 ,391,392,417 }, -{387,235,360 ,418,258,391 }, {360,235,237 ,391,258,261 }, {235,387,388 ,258,418,419 }, -{388,387,389 ,419,418,420 }, {388,233,235 ,419,256,258 }, {235,233,232 ,258,255,254 }, -{233,388,390 ,256,419,421 }, {390,234,233 ,421,257,256 }, {234,390,193 ,257,421,211 }, -{193,18,234 ,211,22,257 }, {390,391,195 ,421,422,213 }, {195,193,390 ,213,211,421 }, -{390,388,389 ,421,419,420 }, {389,391,390 ,420,422,421 }, {387,386,392 ,418,417,423 }, -{392,389,387 ,423,420,418 }, {393,391,389 ,424,422,420 }, {389,392,393 ,420,423,424 }, -{393,198,195 ,424,216,213 }, {195,391,393 ,213,422,424 }, {393,394,200 ,424,425,218 }, -{200,198,393 ,218,216,424 }, {394,395,202 ,425,426,220 }, {202,200,394 ,220,218,425 }, -{395,396,204 ,426,427,222 }, {204,202,395 ,222,220,426 }, {182,397,381 ,200,428,412 }, -{182,206,397 ,200,224,428 }, {397,206,398 ,428,224,429 }, {398,399,397 ,429,430,428 }, -{382,383,372 ,413,414,405 }, {382,399,383 ,413,430,414 }, {383,399,369 ,414,430,400 }, -{369,399,400 ,400,430,431 }, {400,401,369 ,431,432,400 }, {369,401,384 ,400,432,415 }, -{401,402,385 ,432,433,416 }, {385,384,401 ,416,415,432 }, {402,392,386 ,433,423,417 }, -{386,385,402 ,417,416,433 }, {402,394,393 ,433,425,424 }, {393,392,402 ,424,423,433 }, -{394,402,401 ,425,433,432 }, {401,395,394 ,432,426,425 }, {401,400,396 ,432,431,427 }, -{396,395,401 ,427,426,432 }, {396,400,398 ,427,431,429 }, {398,400,399 ,429,431,430 }, -{206,204,396 ,224,222,427 }, {396,398,206 ,427,429,224 }, {384,362,363 ,415,393,394 }, -{397,382,381 ,428,413,412 }, {399,382,397 ,430,413,428 }, {219,231,221 ,434,259,434 }, -{248,245,243 ,435,269,266 }, {243,404,403 ,266,436,437 }, {241,404,243 ,264,436,266 }, -{405,404,241 ,438,436,264 }, {241,239,405 ,264,262,438 }, {404,405,406 ,436,438,439 }, -{406,403,404 ,439,437,436 }, {405,239,236 ,438,262,260 }, {236,407,405 ,260,440,438 }, -{406,405,407 ,439,438,440 }, {407,408,406 ,440,441,439 }, {408,407,409 ,441,440,442 }, -{231,409,407 ,259,442,440 }, {407,236,231 ,440,260,259 } -, {412,411,410 ,443,443,443 }, {413,411,412 ,444,445,446 }, {412,414,413 ,446,447,444 }, -{415,413,414 ,448,444,447 }, {414,416,415 ,447,449,448 }, {415,416,218 ,448,449,450 }, -{417,218,416 ,451,450,449 }, {218,417,14 ,450,451,452 }, {419,219,418 ,453,454,455 }, -{420,418,219 ,456,455,454 }, {418,420,421 ,455,456,457 }, {422,421,420 ,458,457,456 }, -{420,423,422 ,456,459,458 }, {424,422,423 ,460,458,459 }, {423,425,424 ,459,461,460 }, -{426,424,425 ,462,460,462 }, {427,428,429 ,463,463,464 }, {67,428,427 ,465,463,463 }, -{430,428,67 ,466,467,465 }, {430,431,428 ,466,468,467 }, {431,432,428 ,468,469,467 }, -{432,73,428 ,469,470,467 }, {73,433,428 ,471,472,472 }, {433,429,428 ,472,473,472 }, -{434,286,285 ,474,475,476 }, {434,285,283 ,474,476,477 }, {435,434,282 ,478,479,480 }, -{434,283,282 ,474,477,480 }, {436,434,435 ,481,479,478 }, {437,434,436 ,482,479,481 }, -{434,437,438 ,483,484,483 }, {434,438,286 ,483,483,485 }, {87,440,439 ,486,487,488 }, -{441,87,439 ,489,486,488 }, {442,87,441 ,490,486,489 }, {441,443,442 ,489,491,490 }, -{444,442,443 ,492,490,491 }, {443,445,444 ,491,493,492 }, {446,444,445 ,494,492,493 }, -{445,447,446 ,493,495,494 }, {448,446,447 ,496,494,495 }, {447,449,448 ,495,497,496 }, -{450,448,449 ,498,496,497 }, {449,451,450 ,497,499,498 }, {294,450,451 ,500,498,499 }, -{451,452,294 ,499,501,500 }, {453,294,452 ,502,500,501 }, {452,454,453 ,501,503,502 }, -{455,453,454 ,504,502,503 }, {454,456,455 ,503,505,504 }, {457,455,456 ,506,504,505 }, -{457,458,455 ,506,507,504 }, {459,441,439 ,508,509,510 }, {92,459,439 ,511,508,510 }, -{459,460,443 ,508,512,513 }, {443,441,459 ,513,509,508 }, {461,460,459 ,514,512,508 }, -{459,92,461 ,508,511,514 }, {460,462,445 ,512,515,516 }, {445,443,460 ,516,513,512 }, -{462,460,461 ,515,512,514 }, {461,463,462 ,514,517,515 }, {462,464,447 ,515,518,519 }, -{447,445,462 ,519,516,515 }, {464,462,463 ,518,515,517 }, {463,94,464 ,517,520,518 }, -{464,465,449 ,518,521,522 }, {449,447,464 ,522,519,518 }, {465,464,94 ,521,518,520 }, -{94,95,465 ,520,523,521 }, {465,466,451 ,521,524,525 }, {451,449,465 ,525,522,521 }, -{466,465,95 ,524,521,523 }, {95,302,466 ,523,526,524 }, {466,467,452 ,524,527,528 }, -{452,451,466 ,528,525,524 }, {467,466,302 ,527,524,526 }, {302,468,467 ,526,529,527 }, -{467,469,454 ,527,530,531 }, {454,452,467 ,531,528,527 }, {470,469,467 ,532,530,527 }, -{467,468,470 ,527,529,532 }, {469,471,456 ,530,533,534 }, {456,454,469 ,534,531,530 }, -{469,470,472 ,530,532,535 }, {472,471,469 ,535,533,530 }, {457,456,471 ,536,534,533 }, -{457,471,472 ,536,533,535 } -}; +GLfloat face[806][6] = {{2, 1, 0, 0, 1, 2}, + {3, 1, 2, 3, 1, 0}, + {6, 5, 4, 4, 5, 6}, + {4, 7, 6, 6, 7, 4}, + {8, 6, 7, 8, 4, 7}, + {7, 9, 8, 7, 9, 8}, + {8, 9, 10, 8, 9, 10}, + {11, 8, 10, 11, 8, 10}, + {12, 11, 10, 12, 11, 10}, + {1, 12, 10, 1, 12, 10}, + {13, 1, 10, 13, 1, 10}, + {9, 13, 10, 14, 13, 10}, + {0, 1, 13, 2, 1, 13}, + {14, 0, 13, 15, 16, 17}, + {15, 14, 13, 18, 15, 17}, + {9, 16, 15, 14, 19, 18}, + {15, 13, 9, 18, 17, 14}, + {17, 16, 9, 20, 21, 9}, + {9, 7, 17, 9, 7, 20}, + {18, 17, 7, 22, 20, 7}, + {7, 4, 18, 7, 6, 22}, + {19, 14, 15, 23, 15, 18}, + {20, 14, 19, 24, 25, 23}, + {19, 21, 20, 23, 26, 24}, + {22, 20, 21, 27, 24, 26}, + {21, 23, 22, 26, 28, 27}, + {24, 22, 23, 29, 27, 28}, + {23, 25, 24, 28, 30, 29}, + {26, 24, 25, 31, 29, 30}, + {25, 27, 26, 30, 32, 31}, + {28, 26, 27, 33, 31, 32}, + {28, 29, 26, 33, 34, 31}, + {31, 30, 29, 35, 36, 34}, + {32, 29, 30, 37, 34, 36}, + {33, 1, 3, 38, 1, 3}, + {12, 1, 33, 12, 1, 38}, + {34, 33, 3, 39, 38, 3}, + {3, 35, 34, 3, 40, 39}, + {36, 34, 35, 41, 39, 40}, + {35, 32, 36, 40, 37, 41}, + {30, 36, 32, 36, 41, 37}, + {31, 37, 30, 35, 42, 36}, + {37, 38, 30, 42, 43, 36}, + {38, 36, 30, 43, 41, 36}, + {39, 36, 38, 44, 41, 43}, + {34, 36, 39, 39, 41, 44}, + {40, 33, 34, 45, 38, 39}, + {40, 41, 33, 45, 46, 38}, + {34, 39, 40, 39, 44, 45}, + {41, 12, 33, 46, 12, 38}, + {42, 12, 41, 47, 12, 46}, + {44, 43, 8, 48, 49, 8}, + {8, 11, 44, 8, 11, 48}, + {42, 44, 11, 47, 48, 11}, + {11, 12, 42, 11, 12, 47}, + {42, 45, 44, 47, 50, 48}, + {46, 45, 42, 51, 50, 47}, + {47, 45, 46, 52, 50, 51}, + {42, 41, 46, 47, 46, 51}, + {48, 46, 41, 53, 51, 46}, + {41, 49, 48, 54, 55, 53}, + {50, 49, 41, 56, 57, 46}, + {41, 51, 50, 46, 58, 56}, + {52, 51, 41, 59, 58, 46}, + {54, 53, 52, 60, 61, 59}, + {52, 40, 54, 59, 45, 60}, + {41, 40, 52, 46, 45, 59}, + {50, 55, 49, 56, 62, 57}, + {51, 55, 50, 58, 62, 56}, + {56, 49, 55, 63, 57, 62}, + {57, 49, 56, 64, 55, 63}, + {8, 43, 58, 8, 49, 65}, + {58, 6, 8, 65, 4, 8}, + {58, 59, 5, 65, 66, 5}, + {5, 6, 58, 5, 4, 65}, + {61, 60, 59, 67, 68, 66}, + {59, 58, 61, 66, 65, 67}, + {62, 61, 58, 69, 67, 65}, + {58, 43, 62, 65, 49, 69}, + {44, 62, 43, 48, 69, 49}, + {45, 62, 44, 50, 69, 48}, + {63, 62, 45, 70, 69, 50}, + {47, 64, 63, 52, 71, 70}, + {63, 45, 47, 70, 50, 52}, + {61, 62, 63, 67, 69, 70}, + {63, 65, 61, 70, 72, 67}, + {48, 49, 57, 53, 55, 64}, + {57, 66, 48, 64, 73, 53}, + {67, 48, 66, 74, 53, 73}, + {46, 48, 67, 51, 53, 74}, + {47, 67, 68, 75, 74, 76}, + {46, 67, 47, 51, 74, 75}, + {69, 64, 47, 77, 71, 75}, + {47, 68, 69, 75, 76, 77}, + {64, 69, 70, 71, 78, 79}, + {70, 71, 64, 79, 80, 71}, + {73, 72, 71, 81, 82, 80}, + {71, 70, 73, 80, 79, 81}, + {74, 72, 73, 83, 82, 81}, + {75, 56, 74, 84, 63, 83}, + {75, 57, 56, 84, 64, 63}, + {74, 73, 75, 83, 81, 84}, + {76, 60, 61, 85, 68, 67}, + {61, 65, 76, 67, 72, 86}, + {64, 77, 65, 71, 87, 72}, + {65, 63, 64, 72, 70, 71}, + {77, 76, 65, 87, 85, 72}, + {78, 76, 77, 88, 89, 87}, + {77, 71, 78, 87, 80, 88}, + {77, 64, 71, 87, 71, 80}, + {79, 78, 71, 90, 88, 80}, + {71, 72, 79, 80, 82, 90}, + {74, 79, 72, 83, 90, 82}, + {80, 79, 74, 91, 90, 83}, + {74, 81, 80, 83, 92, 91}, + {56, 82, 81, 63, 93, 92}, + {81, 74, 56, 92, 83, 63}, + {55, 82, 56, 62, 93, 63}, + {84, 83, 80, 94, 95, 96}, + {80, 81, 84, 96, 92, 94}, + {85, 84, 81, 97, 94, 92}, + {81, 82, 85, 92, 93, 97}, + {55, 85, 82, 62, 97, 93}, + {86, 85, 55, 98, 97, 62}, + {55, 87, 86, 62, 99, 98}, + {51, 87, 55, 58, 99, 62}, + {88, 87, 51, 100, 99, 58}, + {51, 52, 88, 58, 59, 100}, + {52, 89, 88, 59, 101, 100}, + {53, 89, 52, 61, 101, 59}, + {90, 89, 53, 102, 101, 61}, + {89, 90, 91, 101, 103, 103}, + {88, 89, 91, 104, 101, 104}, + {90, 92, 91, 102, 105, 106}, + {95, 94, 93, 107, 108, 109}, + {96, 93, 94, 110, 109, 108}, + {94, 97, 96, 108, 111, 110}, + {98, 96, 97, 112, 110, 111}, + {99, 96, 98, 113, 110, 112}, + {98, 100, 99, 112, 114, 113}, + {92, 100, 98, 105, 114, 112}, + {90, 100, 92, 102, 114, 105}, + {101, 100, 90, 115, 114, 102}, + {102, 100, 101, 116, 114, 115}, + {99, 100, 102, 113, 114, 116}, + {102, 103, 99, 116, 117, 113}, + {96, 99, 103, 110, 113, 117}, + {103, 104, 96, 117, 118, 110}, + {93, 96, 104, 109, 110, 118}, + {106, 105, 93, 119, 120, 109}, + {93, 104, 106, 109, 118, 119}, + {107, 106, 104, 121, 119, 118}, + {104, 103, 107, 118, 117, 121}, + {108, 107, 103, 122, 121, 117}, + {103, 102, 108, 117, 116, 122}, + {101, 109, 102, 115, 123, 116}, + {109, 108, 102, 123, 122, 116}, + {101, 110, 109, 115, 124, 123}, + {111, 110, 101, 125, 124, 115}, + {101, 53, 111, 115, 61, 125}, + {90, 53, 101, 102, 61, 115}, + {39, 54, 40, 44, 60, 45}, + {112, 54, 39, 126, 60, 44}, + {39, 38, 112, 44, 43, 126}, + {113, 112, 38, 127, 126, 43}, + {38, 37, 113, 43, 42, 127}, + {114, 112, 113, 128, 126, 127}, + {115, 112, 114, 129, 126, 128}, + {114, 116, 115, 128, 130, 129}, + {118, 117, 115, 131, 132, 129}, + {115, 116, 118, 129, 130, 131}, + {120, 119, 117, 133, 134, 132}, + {117, 118, 120, 132, 131, 133}, + {123, 122, 121, 135, 136, 137}, + {124, 122, 123, 138, 136, 135}, + {125, 122, 124, 139, 136, 138}, + {124, 126, 125, 138, 140, 139}, + {127, 121, 119, 141, 137, 134}, + {119, 120, 127, 134, 133, 141}, + {128, 117, 119, 142, 132, 134}, + {115, 117, 128, 129, 132, 142}, + {128, 53, 115, 142, 61, 129}, + {111, 53, 128, 125, 61, 142}, + {128, 110, 111, 142, 124, 125}, + {119, 110, 128, 134, 124, 142}, + {121, 110, 119, 137, 124, 134}, + {129, 110, 121, 143, 124, 137}, + {109, 110, 129, 123, 124, 143}, + {129, 130, 109, 143, 144, 123}, + {115, 53, 54, 129, 61, 60}, + {54, 112, 115, 60, 126, 129}, + {127, 123, 121, 141, 135, 137}, + {132, 131, 105, 145, 146, 120}, + {105, 106, 132, 120, 119, 145}, + {132, 133, 131, 145, 147, 148}, + {133, 134, 131, 147, 149, 148}, + {135, 134, 133, 150, 149, 147}, + {133, 136, 135, 147, 151, 150}, + {137, 136, 133, 152, 151, 147}, + {138, 137, 133, 153, 152, 147}, + {133, 132, 138, 147, 145, 153}, + {139, 138, 132, 154, 153, 145}, + {140, 138, 139, 155, 153, 154}, + {141, 138, 140, 156, 153, 155}, + {140, 130, 141, 155, 144, 156}, + {109, 130, 140, 123, 144, 155}, + {140, 108, 109, 155, 122, 123}, + {139, 108, 140, 154, 122, 155}, + {107, 108, 139, 121, 122, 154}, + {142, 135, 136, 157, 150, 151}, + {136, 143, 142, 151, 158, 157}, + {144, 142, 143, 159, 157, 158}, + {143, 145, 144, 158, 160, 159}, + {147, 146, 145, 161, 162, 160}, + {145, 143, 147, 160, 158, 161}, + {124, 146, 147, 138, 162, 161}, + {147, 126, 124, 161, 140, 138}, + {121, 122, 125, 137, 136, 139}, + {125, 129, 121, 139, 143, 137}, + {141, 130, 129, 156, 144, 143}, + {129, 125, 141, 143, 139, 156}, + {126, 147, 137, 140, 161, 152}, + {141, 125, 126, 156, 139, 140}, + {126, 137, 141, 140, 152, 156}, + {138, 141, 137, 153, 156, 152}, + {147, 143, 136, 161, 158, 151}, + {136, 137, 147, 151, 152, 161}, + {132, 106, 107, 145, 119, 121}, + {107, 139, 132, 121, 154, 145}, + {28, 31, 29, 33, 35, 34}, + {148, 27, 25, 163, 32, 30}, + {25, 149, 148, 30, 164, 163}, + {28, 27, 148, 33, 32, 163}, + {148, 150, 28, 163, 165, 33}, + {151, 150, 148, 166, 165, 163}, + {148, 149, 151, 163, 167, 166}, + {153, 149, 152, 168, 167, 169}, + {151, 149, 153, 166, 167, 168}, + {154, 150, 151, 170, 165, 166}, + {151, 155, 154, 166, 171, 170}, + {156, 154, 155, 172, 170, 171}, + {158, 157, 156, 173, 174, 172}, + {156, 155, 158, 172, 171, 173}, + {151, 158, 155, 166, 173, 171}, + {153, 158, 151, 168, 173, 166}, + {149, 25, 152, 164, 30, 175}, + {25, 23, 152, 30, 28, 175}, + {152, 23, 21, 175, 28, 26}, + {21, 159, 152, 26, 176, 175}, + {153, 152, 159, 168, 169, 176}, + {159, 160, 153, 176, 177, 168}, + {158, 153, 160, 173, 168, 177}, + {160, 161, 158, 177, 178, 173}, + {162, 158, 161, 179, 173, 178}, + {157, 158, 162, 174, 173, 179}, + {157, 162, 163, 174, 179, 180}, + {163, 164, 157, 180, 181, 174}, + {156, 157, 164, 172, 174, 181}, + {164, 165, 156, 181, 182, 172}, + {164, 166, 165, 181, 183, 182}, + {167, 166, 164, 184, 183, 181}, + {164, 163, 167, 181, 180, 184}, + {168, 167, 163, 185, 184, 180}, + {166, 167, 169, 183, 184, 186}, + {170, 169, 167, 187, 186, 184}, + {172, 171, 170, 188, 189, 187}, + {170, 173, 172, 187, 190, 188}, + {174, 171, 172, 191, 189, 188}, + {172, 175, 174, 188, 192, 191}, + {172, 177, 176, 188, 193, 194}, + {176, 175, 172, 194, 192, 188}, + {179, 178, 176, 195, 196, 194}, + {176, 177, 179, 194, 193, 195}, + {181, 180, 178, 197, 198, 196}, + {178, 179, 181, 196, 195, 197}, + {183, 182, 181, 199, 200, 197}, + {181, 179, 183, 197, 195, 199}, + {184, 183, 179, 201, 199, 195}, + {179, 177, 184, 195, 193, 201}, + {173, 184, 177, 190, 201, 193}, + {177, 172, 173, 193, 188, 190}, + {167, 185, 173, 184, 202, 190}, + {173, 170, 167, 190, 187, 184}, + {167, 168, 185, 184, 185, 202}, + {163, 162, 168, 180, 179, 185}, + {186, 168, 162, 203, 185, 179}, + {161, 187, 186, 178, 204, 203}, + {188, 187, 161, 205, 204, 178}, + {161, 160, 188, 178, 177, 205}, + {189, 188, 160, 206, 205, 177}, + {160, 159, 189, 177, 176, 206}, + {159, 19, 189, 176, 23, 206}, + {21, 19, 159, 26, 23, 176}, + {190, 189, 19, 207, 206, 23}, + {191, 189, 190, 208, 206, 207}, + {19, 16, 190, 23, 21, 207}, + {15, 16, 19, 18, 209, 23}, + {192, 190, 16, 210, 207, 21}, + {16, 17, 192, 21, 20, 210}, + {193, 192, 17, 211, 210, 20}, + {17, 18, 193, 20, 22, 211}, + {194, 192, 193, 212, 210, 211}, + {193, 195, 194, 211, 213, 212}, + {190, 192, 194, 207, 210, 212}, + {194, 191, 190, 212, 208, 207}, + {188, 189, 191, 205, 206, 208}, + {191, 196, 188, 208, 214, 205}, + {194, 197, 196, 212, 215, 214}, + {196, 191, 194, 214, 208, 212}, + {198, 197, 194, 216, 215, 212}, + {194, 195, 198, 212, 213, 216}, + {199, 197, 198, 217, 215, 216}, + {198, 200, 199, 216, 218, 217}, + {201, 199, 200, 219, 217, 218}, + {200, 202, 201, 218, 220, 219}, + {203, 201, 202, 221, 219, 220}, + {202, 204, 203, 220, 222, 221}, + {183, 205, 182, 199, 223, 200}, + {205, 206, 182, 223, 224, 200}, + {207, 206, 205, 225, 224, 223}, + {205, 208, 207, 223, 226, 225}, + {173, 185, 184, 190, 202, 201}, + {185, 208, 184, 202, 226, 201}, + {168, 208, 185, 185, 226, 202}, + {209, 208, 168, 227, 226, 185}, + {168, 210, 209, 185, 228, 227}, + {186, 210, 168, 203, 228, 185}, + {211, 210, 186, 229, 228, 203}, + {186, 187, 211, 203, 204, 229}, + {196, 211, 187, 214, 229, 204}, + {187, 188, 196, 204, 205, 214}, + {199, 211, 196, 217, 229, 214}, + {196, 197, 199, 214, 215, 217}, + {210, 211, 199, 228, 229, 217}, + {199, 201, 210, 217, 219, 228}, + {209, 210, 201, 227, 228, 219}, + {201, 203, 209, 219, 221, 227}, + {207, 209, 203, 225, 227, 221}, + {208, 209, 207, 226, 227, 225}, + {204, 206, 207, 222, 224, 225}, + {207, 203, 204, 225, 221, 222}, + {162, 161, 186, 179, 178, 203}, + {183, 184, 205, 199, 201, 223}, + {205, 184, 208, 223, 201, 226}, + {0, 14, 2, 230, 25, 230}, + {26, 29, 32, 31, 34, 231}, + {213, 212, 26, 232, 233, 31}, + {26, 212, 24, 31, 233, 29}, + {212, 214, 22, 233, 234, 27}, + {22, 24, 212, 27, 29, 233}, + {214, 212, 213, 234, 233, 232}, + {213, 215, 214, 232, 235, 234}, + {22, 214, 216, 27, 234, 236}, + {216, 20, 22, 236, 237, 27}, + {214, 215, 217, 234, 235, 238}, + {217, 216, 214, 238, 236, 234}, + {218, 216, 217, 239, 236, 238}, + {216, 218, 14, 236, 239, 25}, + {14, 20, 216, 25, 237, 236}, + {221, 220, 219, 240, 241, 242}, + {219, 220, 222, 242, 241, 243}, + {5, 224, 223, 5, 244, 245}, + {223, 4, 5, 245, 6, 5}, + {224, 226, 225, 244, 246, 247}, + {225, 223, 224, 247, 245, 244}, + {227, 225, 226, 248, 247, 246}, + {227, 226, 228, 248, 246, 249}, + {227, 228, 229, 248, 249, 250}, + {227, 229, 220, 248, 250, 241}, + {227, 220, 230, 248, 241, 251}, + {227, 230, 225, 248, 251, 247}, + {230, 220, 221, 251, 241, 240}, + {230, 221, 231, 251, 252, 253}, + {230, 231, 232, 251, 253, 254}, + {233, 225, 230, 255, 247, 251}, + {230, 232, 233, 251, 254, 255}, + {233, 234, 223, 256, 257, 245}, + {223, 225, 233, 245, 247, 256}, + {234, 18, 4, 257, 22, 6}, + {4, 223, 234, 6, 245, 257}, + {232, 231, 235, 254, 253, 258}, + {235, 231, 236, 258, 259, 260}, + {236, 237, 235, 260, 261, 258}, + {236, 239, 238, 260, 262, 263}, + {238, 237, 236, 263, 261, 260}, + {239, 241, 240, 262, 264, 265}, + {240, 238, 239, 265, 263, 262}, + {241, 243, 242, 264, 266, 267}, + {242, 240, 241, 267, 265, 264}, + {242, 243, 244, 267, 266, 268}, + {243, 245, 244, 266, 269, 268}, + {245, 247, 246, 269, 270, 271}, + {247, 245, 248, 270, 269, 272}, + {222, 220, 249, 243, 241, 273}, + {249, 220, 229, 273, 241, 250}, + {222, 249, 250, 243, 273, 274}, + {250, 251, 222, 274, 275, 243}, + {251, 250, 252, 275, 274, 276}, + {252, 248, 251, 276, 272, 275}, + {248, 252, 247, 272, 276, 270}, + {247, 253, 246, 270, 277, 271}, + {247, 254, 253, 270, 278, 277}, + {247, 252, 254, 270, 276, 278}, + {254, 252, 255, 278, 276, 279}, + {255, 252, 250, 279, 276, 274}, + {250, 249, 256, 274, 273, 280}, + {249, 257, 256, 273, 281, 280}, + {256, 255, 250, 280, 279, 274}, + {249, 229, 257, 273, 250, 281}, + {257, 229, 258, 281, 250, 282}, + {260, 259, 228, 283, 284, 249}, + {228, 226, 260, 249, 246, 283}, + {259, 258, 229, 284, 282, 250}, + {229, 228, 259, 250, 249, 284}, + {259, 261, 258, 284, 285, 282}, + {258, 261, 262, 282, 285, 286}, + {262, 261, 263, 286, 285, 287}, + {262, 257, 258, 286, 281, 282}, + {257, 262, 264, 281, 286, 288}, + {264, 265, 257, 288, 289, 290}, + {257, 265, 266, 281, 291, 292}, + {266, 267, 257, 292, 293, 281}, + {257, 267, 268, 281, 293, 294}, + {268, 270, 269, 294, 295, 296}, + {269, 256, 268, 296, 280, 294}, + {268, 256, 257, 294, 280, 281}, + {265, 271, 266, 291, 297, 292}, + {266, 271, 267, 292, 297, 293}, + {271, 265, 272, 297, 291, 298}, + {272, 265, 273, 298, 289, 299}, + {260, 226, 224, 283, 246, 244}, + {224, 274, 260, 244, 300, 283}, + {59, 274, 224, 66, 300, 244}, + {224, 5, 59, 244, 5, 66}, + {60, 275, 274, 68, 301, 300}, + {274, 59, 60, 300, 66, 68}, + {275, 276, 260, 301, 302, 283}, + {260, 274, 275, 283, 300, 301}, + {260, 276, 259, 283, 302, 284}, + {259, 276, 261, 284, 302, 285}, + {261, 276, 277, 285, 302, 303}, + {278, 263, 261, 304, 287, 285}, + {261, 277, 278, 285, 303, 304}, + {276, 275, 279, 302, 301, 305}, + {279, 277, 276, 305, 303, 302}, + {265, 264, 280, 289, 288, 306}, + {280, 273, 265, 306, 299, 289}, + {280, 264, 281, 306, 288, 307}, + {281, 264, 262, 307, 288, 286}, + {282, 281, 263, 308, 307, 309}, + {263, 281, 262, 309, 307, 286}, + {278, 283, 282, 310, 311, 308}, + {282, 263, 278, 308, 309, 310}, + {283, 278, 284, 311, 310, 312}, + {284, 285, 283, 312, 313, 311}, + {287, 286, 285, 314, 315, 313}, + {285, 284, 287, 313, 312, 314}, + {286, 287, 288, 315, 314, 316}, + {288, 272, 289, 316, 298, 317}, + {272, 273, 289, 298, 299, 317}, + {289, 286, 288, 317, 315, 316}, + {60, 76, 279, 68, 86, 305}, + {279, 275, 60, 305, 301, 68}, + {290, 278, 277, 318, 304, 303}, + {277, 279, 290, 303, 305, 318}, + {279, 76, 290, 305, 86, 318}, + {76, 78, 284, 89, 88, 312}, + {284, 290, 76, 312, 318, 89}, + {284, 278, 290, 312, 310, 318}, + {284, 78, 79, 312, 88, 90}, + {79, 287, 284, 90, 314, 312}, + {287, 79, 288, 314, 90, 316}, + {79, 80, 291, 90, 91, 319}, + {291, 288, 79, 319, 316, 90}, + {292, 272, 288, 320, 298, 316}, + {288, 291, 292, 316, 319, 320}, + {272, 292, 271, 298, 320, 297}, + {83, 293, 291, 95, 321, 322}, + {291, 80, 83, 322, 96, 95}, + {293, 294, 292, 321, 323, 320}, + {292, 291, 293, 320, 322, 321}, + {292, 294, 271, 320, 323, 297}, + {271, 294, 295, 297, 323, 324}, + {295, 296, 271, 324, 325, 297}, + {271, 296, 267, 297, 325, 293}, + {267, 296, 297, 293, 325, 326}, + {297, 268, 267, 326, 294, 293}, + {297, 298, 268, 326, 327, 294}, + {268, 298, 270, 294, 327, 295}, + {270, 298, 299, 295, 327, 328}, + {300, 299, 298, 329, 329, 327}, + {300, 298, 297, 330, 327, 330}, + {300, 301, 299, 331, 332, 328}, + {93, 302, 95, 109, 333, 107}, + {302, 93, 303, 333, 109, 334}, + {303, 304, 302, 334, 335, 333}, + {304, 303, 305, 335, 334, 336}, + {305, 303, 306, 336, 334, 337}, + {306, 307, 305, 337, 338, 336}, + {305, 307, 301, 336, 338, 332}, + {301, 307, 299, 332, 338, 328}, + {299, 307, 308, 328, 338, 339}, + {308, 307, 309, 339, 338, 340}, + {307, 306, 310, 338, 337, 341}, + {310, 309, 307, 341, 340, 338}, + {306, 303, 311, 337, 334, 342}, + {311, 310, 306, 342, 341, 337}, + {311, 303, 93, 342, 334, 109}, + {105, 312, 311, 120, 343, 342}, + {311, 93, 105, 342, 109, 120}, + {312, 313, 310, 343, 344, 341}, + {310, 311, 312, 341, 342, 343}, + {313, 314, 309, 344, 345, 340}, + {309, 310, 313, 340, 341, 344}, + {309, 315, 308, 340, 346, 339}, + {309, 314, 315, 340, 345, 346}, + {315, 316, 308, 346, 347, 339}, + {308, 316, 317, 339, 347, 348}, + {317, 270, 308, 348, 295, 339}, + {308, 270, 299, 339, 295, 328}, + {256, 269, 255, 280, 296, 279}, + {255, 269, 318, 279, 296, 349}, + {318, 254, 255, 349, 278, 279}, + {254, 318, 319, 278, 349, 350}, + {319, 253, 254, 350, 277, 278}, + {319, 318, 320, 350, 349, 351}, + {320, 318, 321, 351, 349, 352}, + {321, 322, 320, 352, 353, 351}, + {324, 323, 322, 354, 355, 353}, + {322, 321, 324, 353, 352, 354}, + {326, 325, 323, 356, 357, 355}, + {323, 324, 326, 355, 354, 356}, + {329, 328, 327, 358, 359, 360}, + {327, 328, 330, 360, 359, 361}, + {330, 328, 331, 361, 359, 362}, + {331, 332, 330, 362, 363, 361}, + {326, 329, 333, 356, 358, 364}, + {333, 325, 326, 364, 357, 356}, + {326, 324, 334, 356, 354, 365}, + {334, 324, 321, 365, 354, 352}, + {321, 270, 334, 352, 295, 365}, + {334, 270, 317, 365, 295, 348}, + {317, 316, 334, 348, 347, 365}, + {334, 316, 326, 365, 347, 356}, + {326, 316, 329, 356, 347, 358}, + {329, 316, 335, 358, 347, 366}, + {316, 315, 336, 347, 346, 367}, + {336, 335, 316, 367, 366, 347}, + {269, 270, 321, 296, 295, 352}, + {321, 318, 269, 352, 349, 296}, + {329, 327, 333, 358, 360, 364}, + {131, 337, 312, 146, 368, 343}, + {312, 105, 131, 343, 120, 146}, + {131, 338, 337, 148, 369, 368}, + {131, 134, 338, 148, 149, 369}, + {134, 135, 339, 149, 150, 370}, + {339, 338, 134, 370, 369, 149}, + {338, 339, 340, 369, 370, 371}, + {338, 340, 341, 369, 371, 372}, + {341, 337, 338, 372, 368, 369}, + {337, 341, 342, 368, 372, 373}, + {342, 341, 343, 373, 372, 374}, + {343, 341, 344, 374, 372, 375}, + {344, 336, 343, 375, 367, 374}, + {343, 336, 315, 374, 367, 346}, + {315, 314, 343, 346, 345, 374}, + {343, 314, 342, 374, 345, 373}, + {342, 314, 313, 373, 345, 344}, + {135, 142, 345, 150, 157, 376}, + {345, 339, 135, 376, 370, 150}, + {142, 144, 346, 157, 159, 377}, + {346, 345, 142, 377, 376, 157}, + {348, 347, 345, 378, 379, 376}, + {345, 346, 348, 376, 377, 378}, + {348, 330, 332, 378, 361, 363}, + {332, 347, 348, 363, 379, 378}, + {328, 329, 335, 359, 358, 366}, + {335, 331, 328, 366, 362, 359}, + {336, 344, 331, 367, 375, 362}, + {331, 335, 336, 362, 366, 367}, + {340, 347, 332, 371, 379, 363}, + {331, 344, 340, 362, 375, 371}, + {340, 332, 331, 371, 363, 362}, + {340, 344, 341, 371, 375, 372}, + {345, 347, 340, 376, 379, 371}, + {340, 339, 345, 371, 370, 376}, + {312, 337, 342, 343, 368, 373}, + {342, 313, 312, 373, 344, 343}, + {245, 246, 244, 269, 271, 268}, + {242, 350, 349, 267, 380, 381}, + {349, 240, 242, 381, 265, 267}, + {350, 242, 244, 380, 267, 268}, + {244, 351, 350, 268, 382, 380}, + {350, 351, 352, 380, 382, 383}, + {352, 349, 350, 383, 381, 380}, + {354, 349, 353, 384, 381, 385}, + {353, 349, 352, 385, 381, 383}, + {351, 356, 355, 382, 386, 387}, + {355, 352, 351, 387, 383, 382}, + {355, 356, 357, 387, 386, 388}, + {359, 358, 355, 389, 390, 387}, + {355, 357, 359, 387, 388, 389}, + {355, 358, 352, 387, 390, 383}, + {352, 358, 353, 383, 390, 385}, + {354, 240, 349, 384, 265, 381}, + {354, 238, 240, 384, 263, 265}, + {238, 354, 360, 263, 384, 391}, + {360, 237, 238, 391, 261, 263}, + {354, 353, 361, 384, 385, 392}, + {361, 360, 354, 392, 391, 384}, + {353, 358, 362, 385, 390, 393}, + {362, 361, 353, 393, 392, 385}, + {362, 358, 363, 393, 390, 394}, + {363, 358, 359, 394, 390, 389}, + {363, 359, 364, 394, 389, 395}, + {364, 365, 363, 395, 396, 394}, + {359, 357, 366, 389, 388, 397}, + {366, 364, 359, 397, 395, 389}, + {366, 367, 364, 397, 398, 395}, + {367, 368, 365, 398, 399, 396}, + {365, 364, 367, 396, 395, 398}, + {365, 368, 369, 396, 399, 400}, + {370, 368, 367, 401, 399, 398}, + {368, 370, 371, 399, 401, 402}, + {374, 373, 372, 403, 404, 405}, + {372, 371, 374, 405, 402, 403}, + {374, 376, 375, 403, 406, 407}, + {375, 373, 374, 407, 404, 403}, + {377, 373, 375, 408, 404, 407}, + {375, 378, 377, 407, 409, 408}, + {380, 379, 377, 410, 411, 408}, + {377, 378, 380, 408, 409, 410}, + {180, 181, 379, 198, 197, 411}, + {379, 380, 180, 411, 410, 198}, + {182, 381, 379, 200, 412, 411}, + {379, 181, 182, 411, 197, 200}, + {381, 382, 377, 412, 413, 408}, + {377, 379, 381, 408, 411, 412}, + {382, 372, 373, 413, 405, 404}, + {373, 377, 382, 404, 408, 413}, + {383, 368, 371, 414, 399, 402}, + {371, 372, 383, 402, 405, 414}, + {383, 369, 368, 414, 400, 399}, + {369, 363, 365, 400, 394, 396}, + {363, 369, 384, 394, 400, 415}, + {384, 385, 362, 415, 416, 393}, + {385, 386, 361, 416, 417, 392}, + {361, 362, 385, 392, 393, 416}, + {386, 387, 360, 417, 418, 391}, + {360, 361, 386, 391, 392, 417}, + {387, 235, 360, 418, 258, 391}, + {360, 235, 237, 391, 258, 261}, + {235, 387, 388, 258, 418, 419}, + {388, 387, 389, 419, 418, 420}, + {388, 233, 235, 419, 256, 258}, + {235, 233, 232, 258, 255, 254}, + {233, 388, 390, 256, 419, 421}, + {390, 234, 233, 421, 257, 256}, + {234, 390, 193, 257, 421, 211}, + {193, 18, 234, 211, 22, 257}, + {390, 391, 195, 421, 422, 213}, + {195, 193, 390, 213, 211, 421}, + {390, 388, 389, 421, 419, 420}, + {389, 391, 390, 420, 422, 421}, + {387, 386, 392, 418, 417, 423}, + {392, 389, 387, 423, 420, 418}, + {393, 391, 389, 424, 422, 420}, + {389, 392, 393, 420, 423, 424}, + {393, 198, 195, 424, 216, 213}, + {195, 391, 393, 213, 422, 424}, + {393, 394, 200, 424, 425, 218}, + {200, 198, 393, 218, 216, 424}, + {394, 395, 202, 425, 426, 220}, + {202, 200, 394, 220, 218, 425}, + {395, 396, 204, 426, 427, 222}, + {204, 202, 395, 222, 220, 426}, + {182, 397, 381, 200, 428, 412}, + {182, 206, 397, 200, 224, 428}, + {397, 206, 398, 428, 224, 429}, + {398, 399, 397, 429, 430, 428}, + {382, 383, 372, 413, 414, 405}, + {382, 399, 383, 413, 430, 414}, + {383, 399, 369, 414, 430, 400}, + {369, 399, 400, 400, 430, 431}, + {400, 401, 369, 431, 432, 400}, + {369, 401, 384, 400, 432, 415}, + {401, 402, 385, 432, 433, 416}, + {385, 384, 401, 416, 415, 432}, + {402, 392, 386, 433, 423, 417}, + {386, 385, 402, 417, 416, 433}, + {402, 394, 393, 433, 425, 424}, + {393, 392, 402, 424, 423, 433}, + {394, 402, 401, 425, 433, 432}, + {401, 395, 394, 432, 426, 425}, + {401, 400, 396, 432, 431, 427}, + {396, 395, 401, 427, 426, 432}, + {396, 400, 398, 427, 431, 429}, + {398, 400, 399, 429, 431, 430}, + {206, 204, 396, 224, 222, 427}, + {396, 398, 206, 427, 429, 224}, + {384, 362, 363, 415, 393, 394}, + {397, 382, 381, 428, 413, 412}, + {399, 382, 397, 430, 413, 428}, + {219, 231, 221, 434, 259, 434}, + {248, 245, 243, 435, 269, 266}, + {243, 404, 403, 266, 436, 437}, + {241, 404, 243, 264, 436, 266}, + {405, 404, 241, 438, 436, 264}, + {241, 239, 405, 264, 262, 438}, + {404, 405, 406, 436, 438, 439}, + {406, 403, 404, 439, 437, 436}, + {405, 239, 236, 438, 262, 260}, + {236, 407, 405, 260, 440, 438}, + {406, 405, 407, 439, 438, 440}, + {407, 408, 406, 440, 441, 439}, + {408, 407, 409, 441, 440, 442}, + {231, 409, 407, 259, 442, 440}, + {407, 236, 231, 440, 260, 259}, + {412, 411, 410, 443, 443, 443}, + {413, 411, 412, 444, 445, 446}, + {412, 414, 413, 446, 447, 444}, + {415, 413, 414, 448, 444, 447}, + {414, 416, 415, 447, 449, 448}, + {415, 416, 218, 448, 449, 450}, + {417, 218, 416, 451, 450, 449}, + {218, 417, 14, 450, 451, 452}, + {419, 219, 418, 453, 454, 455}, + {420, 418, 219, 456, 455, 454}, + {418, 420, 421, 455, 456, 457}, + {422, 421, 420, 458, 457, 456}, + {420, 423, 422, 456, 459, 458}, + {424, 422, 423, 460, 458, 459}, + {423, 425, 424, 459, 461, 460}, + {426, 424, 425, 462, 460, 462}, + {427, 428, 429, 463, 463, 464}, + {67, 428, 427, 465, 463, 463}, + {430, 428, 67, 466, 467, 465}, + {430, 431, 428, 466, 468, 467}, + {431, 432, 428, 468, 469, 467}, + {432, 73, 428, 469, 470, 467}, + {73, 433, 428, 471, 472, 472}, + {433, 429, 428, 472, 473, 472}, + {434, 286, 285, 474, 475, 476}, + {434, 285, 283, 474, 476, 477}, + {435, 434, 282, 478, 479, 480}, + {434, 283, 282, 474, 477, 480}, + {436, 434, 435, 481, 479, 478}, + {437, 434, 436, 482, 479, 481}, + {434, 437, 438, 483, 484, 483}, + {434, 438, 286, 483, 483, 485}, + {87, 440, 439, 486, 487, 488}, + {441, 87, 439, 489, 486, 488}, + {442, 87, 441, 490, 486, 489}, + {441, 443, 442, 489, 491, 490}, + {444, 442, 443, 492, 490, 491}, + {443, 445, 444, 491, 493, 492}, + {446, 444, 445, 494, 492, 493}, + {445, 447, 446, 493, 495, 494}, + {448, 446, 447, 496, 494, 495}, + {447, 449, 448, 495, 497, 496}, + {450, 448, 449, 498, 496, 497}, + {449, 451, 450, 497, 499, 498}, + {294, 450, 451, 500, 498, 499}, + {451, 452, 294, 499, 501, 500}, + {453, 294, 452, 502, 500, 501}, + {452, 454, 453, 501, 503, 502}, + {455, 453, 454, 504, 502, 503}, + {454, 456, 455, 503, 505, 504}, + {457, 455, 456, 506, 504, 505}, + {457, 458, 455, 506, 507, 504}, + {459, 441, 439, 508, 509, 510}, + {92, 459, 439, 511, 508, 510}, + {459, 460, 443, 508, 512, 513}, + {443, 441, 459, 513, 509, 508}, + {461, 460, 459, 514, 512, 508}, + {459, 92, 461, 508, 511, 514}, + {460, 462, 445, 512, 515, 516}, + {445, 443, 460, 516, 513, 512}, + {462, 460, 461, 515, 512, 514}, + {461, 463, 462, 514, 517, 515}, + {462, 464, 447, 515, 518, 519}, + {447, 445, 462, 519, 516, 515}, + {464, 462, 463, 518, 515, 517}, + {463, 94, 464, 517, 520, 518}, + {464, 465, 449, 518, 521, 522}, + {449, 447, 464, 522, 519, 518}, + {465, 464, 94, 521, 518, 520}, + {94, 95, 465, 520, 523, 521}, + {465, 466, 451, 521, 524, 525}, + {451, 449, 465, 525, 522, 521}, + {466, 465, 95, 524, 521, 523}, + {95, 302, 466, 523, 526, 524}, + {466, 467, 452, 524, 527, 528}, + {452, 451, 466, 528, 525, 524}, + {467, 466, 302, 527, 524, 526}, + {302, 468, 467, 526, 529, 527}, + {467, 469, 454, 527, 530, 531}, + {454, 452, 467, 531, 528, 527}, + {470, 469, 467, 532, 530, 527}, + {467, 468, 470, 527, 529, 532}, + {469, 471, 456, 530, 533, 534}, + {456, 454, 469, 534, 531, 530}, + {469, 470, 472, 530, 532, 535}, + {472, 471, 469, 535, 533, 530}, + {457, 456, 471, 536, 534, 533}, + {457, 471, 472, 536, 533, 535}}; -GLfloat vertices[473][3] = { -{-0.0732834, 0.0566459, 0.0922583},{-0.0781286, 0.0255884, 0.0695454},{-0.0853963, 0.059006, 0.0754652}, -{-0.11689, 0.0526324, 0.059891},{0.00181693, -0.0453446, 0.139084},{0.00181693, -0.0728231, 0.108312}, -{-0.0211977, -0.0750535, 0.106776},{-0.0272541, -0.0402094, 0.13736},{-0.043001, -0.0629288, 0.0901316}, -{-0.0454236, -0.0337256, 0.126039},{-0.0599591, -0.0254458, 0.0758283},{-0.0587478, -0.0402159, 0.059074}, -{-0.0781286, -0.0156098, 0.0319522},{-0.0648043, 0.0253291, 0.106205},{-0.0878189, 0.0508753, 0.115911}, -{-0.0805511, 0.0286488, 0.134805},{-0.0563253, -0.0187674, 0.150159},{-0.0320993, -0.025945, 0.157712}, -{0.00181693, -0.0317545, 0.164235},{-0.113256, -0.0053265, 0.185074},{-0.14475, 0.0439052, 0.139396}, -{-0.166553, 0.0191499, 0.176282},{-0.206526, 0.0594793, 0.133022},{-0.218639, 0.0540459, 0.154276}, -{-0.248921, 0.100898, 0.116826},{-0.262245, 0.102642, 0.130526},{-0.265879, 0.130322, 0.0989431}, -{-0.27557, 0.137201, 0.110919},{-0.293739, 0.183567, 0.0856318},{-0.259823, 0.135736, 0.069124}, -{-0.267091, 0.121432, 0.031641},{-0.296162, 0.175767, 0.0453933},{-0.212582, 0.085674, 0.0510795}, -{-0.119313, 0.0158562, 0.00824089},{-0.179877, 0.0403521, 0.00801397},{-0.176243, 0.0623776, 0.051475}, -{-0.21985, 0.0660669, 0.0165208},{-0.31312, 0.178963, -0.0556831},{-0.287683, 0.11301, -0.0563898}, -{-0.231963, 0.0420898, -0.0565714},{-0.183511, 0.0121021, -0.0607859},{-0.0902415, -0.0230208, -0.0632757}, -{-0.0660156, -0.0578389, -0.00700907},{-0.0393671, -0.102947, 0.0441418},{-0.0514801, -0.0779842, 0.0231861}, -{-0.0514801, -0.104244, 0.00114758},{-0.075706, -0.100217, -0.0362058},{-0.0623817, -0.134121, -0.0299618}, -{-0.0805511, -0.0877747, -0.0638139},{-0.0575365, -0.0756889, -0.0975881},{-0.0744946, -0.0613337, -0.112695}, -{-0.103566, -0.0564254, -0.138916},{-0.160497, -0.0011184, -0.149491},{-0.204103, 0.0369222, -0.219983}, -{-0.222273, 0.0407347, -0.125261},{-0.0623817, -0.0886241, -0.136102},{-0.030888, -0.10757, -0.105738}, -{-0.0478462, -0.0981034, -0.0860599},{-0.0187751, -0.1221, 0.0585748},{0.00181693, -0.125005, 0.0618361}, -{0.00181693, -0.183709, 0.00955056},{-0.0175638, -0.160037, 0.0238863},{-0.0381558, -0.124745, 0.0251766}, -{-0.0405784, -0.153573, 0.00400043},{-0.0417897, -0.169562, -0.0214875},{-0.0187751, -0.185454, -0.00414975}, -{-0.0648043, -0.10543, -0.0687416},{-0.0660156, -0.116543, -0.0592946},{-0.0526913, -0.134348, -0.0544577}, -{-0.0466349, -0.143438, -0.0594049},{-0.0369445, -0.14089, -0.0688324},{-0.0236203, -0.180059, -0.042534}, -{-0.0187751, -0.126386, -0.0937043},{-0.0272541, -0.125335, -0.0837711},{-0.0175638, -0.113062, -0.11018}, -{-0.0345219, -0.111655, -0.0940804},{0.00181693, -0.199361, -0.0183364},{-0.0199864, -0.191659, -0.0209234}, -{0.00181693, -0.18334, -0.0540038},{0.000605662, -0.11786, -0.110854},{0.000605662, -0.104386, -0.137094}, -{-0.0151412, -0.103187, -0.136925},{-0.0320993, -0.102324, -0.134358},{0.000605662, -0.118164, -0.16961}, -{-0.0175638, -0.117996, -0.17081},{-0.0442123, -0.112167, -0.168768},{-0.0720721, -0.0957303, -0.172574}, -{-0.110834, -0.0674868, -0.182059},{-0.150806, -0.0207644, -0.20118},{-0.164131, -0.00950196, -0.220392}, -{-0.139905, -0.0253225, -0.247079},{-0.135059, -0.0168676, -0.220204},{-0.108411, -0.0631621, -0.238942}, -{-0.000605662, -0.0853756, -0.289769},{-0.0211977, -0.116278, -0.24396},{0.000605662, -0.116278, -0.24396}, -{-0.0393671, -0.0841567, -0.281035},{-0.0417897, -0.11251, -0.244654},{-0.0805511, -0.0909193, -0.24162}, -{-0.0769173, -0.0764345, -0.275057},{-0.105988, -0.0616838, -0.266868},{-0.137482, -0.0225344, -0.301731}, -{-0.0926641, -0.0540588, -0.303715},{-0.0720721, -0.0662224, -0.304202},{-0.0381558, -0.0778609, -0.299721}, -{-0.000605662, -0.0938889, -0.342339},{-0.0454236, -0.0873856, -0.345095},{-0.0744946, -0.0731601, -0.341873}, -{-0.0938754, -0.0606593, -0.343785},{-0.135059, -0.0200641, -0.345419},{-0.1823, 0.0359562, -0.343662}, -{-0.187145, 0.0365786, -0.29587},{-0.28526, 0.113211, -0.118745},{-0.315542, 0.18415, -0.109998}, -{-0.311909, 0.185363, -0.17955},{-0.271936, 0.118171, -0.197556},{-0.290105, 0.181946, -0.250976}, -{-0.24771, 0.126373, -0.282027},{-0.279204, 0.179994, -0.280607},{-0.234386, 0.130192, -0.335311}, -{-0.259823, 0.174723, -0.338838},{-0.222273, 0.13523, -0.379861},{-0.193202, 0.141993, -0.419277}, -{-0.207737, 0.170087, -0.418998},{-0.148384, 0.165023, -0.461298},{-0.158074, 0.0489562, -0.427459}, -{-0.114467, 0.0516341, -0.455216},{-0.23802, 0.168965, -0.384906},{-0.222273, 0.0869579, -0.28879}, -{-0.176243, 0.0380893, -0.384951},{-0.137482, -0.0237598, -0.388751},{-0.000605662, -0.0979607, -0.400402}, -{-0.0405784, -0.0928255, -0.402127},{-0.0405784, -0.0668708, -0.438845},{-0.000605662, -0.0706379, -0.438151}, -{-0.00181693, -0.0114341, -0.46775},{-0.0417897, -0.0143388, -0.464488},{-0.0805511, -0.0170555, -0.453861}, -{-0.0732834, -0.0639271, -0.424976},{-0.0744946, -0.0786, -0.398904},{-0.0950867, -0.0643745, -0.395682}, -{-0.115679, -0.0205957, -0.428672},{-0.00181693, 0.0502076, -0.479881},{-0.0442123, 0.0519323, -0.474746}, -{-0.00181693, 0.159454, -0.5},{-0.0502688, 0.147309, -0.491921},{-0.0938754, 0.159661, -0.484069}, -{-0.0817625, 0.0521204, -0.46738},{-0.282838, 0.146648, 0.122032},{-0.274358, 0.104743, 0.150392}, -{-0.292528, 0.177913, 0.160676},{-0.270725, 0.132747, 0.186131},{-0.227118, 0.0503371, 0.180665}, -{-0.221061, 0.0673766, 0.216086},{-0.281626, 0.175293, 0.214128},{-0.268302, 0.151848, 0.224288}, -{-0.270725, 0.171792, 0.256448},{-0.216216, 0.104866, 0.280069},{-0.215005, 0.0886889, 0.247215}, -{-0.171398, 0.0168093, 0.20164},{-0.170187, 0.0268203, 0.234851},{-0.166553, 0.0417785, 0.25897}, -{-0.165342, 0.060186, 0.293361},{-0.167764, 0.0773941, 0.327582},{-0.216216, 0.118307, 0.314984}, -{-0.250133, 0.162818, 0.302892},{-0.208949, 0.150454, 0.36476},{-0.162919, 0.103038, 0.380114}, -{-0.121735, 0.047951, 0.336899},{-0.179877, 0.144366, 0.399378},{-0.148384, 0.143581, 0.431071}, -{-0.12658, 0.159233, 0.458957},{-0.103566, 0.156853, 0.467185},{-0.112045, 0.117736, 0.440893}, -{-0.11689, 0.197993, 0.479083},{-0.0890302, 0.195782, 0.486112},{-0.0575365, 0.191866, 0.49657}, -{-0.0623817, 0.146265, 0.481599},{-0.0248315, 0.188961, 0.499831},{-0.0320993, 0.140624, 0.486922}, -{0.00302825, 0.190161, 0.5},{0.00423952, 0.137888, 0.488984},{0.00423952, 0.0926051, 0.463049}, -{-0.0381558, 0.0965408, 0.461155},{-0.0720721, 0.102013, 0.457032},{-0.120524, 0.0735945, 0.389431}, -{-0.11689, 0.0324482, 0.299248},{-0.120524, 0.0135349, 0.268456},{-0.118101, 0.00286904, 0.248609}, -{-0.122947, -0.00337487, 0.214705},{-0.0720721, -0.0195325, 0.190417},{-0.0720721, -0.0194547, 0.224677}, -{-0.0381558, -0.0236368, 0.19351},{0.00181693, -0.0256792, 0.199339},{-0.0417897, -0.0223595, 0.227939}, -{0.00302825, -0.0247585, 0.227602},{-0.0732834, -0.0101375, 0.25412},{-0.043001, -0.0123679, 0.252584}, -{0.00302825, -0.0125365, 0.253783},{-0.0417897, 0.000359796, 0.275167},{0.00302825, -0.00100829, 0.276198}, -{-0.0442123, 0.0122446, 0.303748},{0.00302825, 0.010708, 0.305978},{-0.0454236, 0.0238118, 0.343292}, -{0.00302825, 0.0222751, 0.345523},{-0.0417897, 0.0664948, 0.431246},{0.00302825, 0.0445081, 0.404915}, -{-0.0417897, 0.0439829, 0.399948},{-0.0769173, 0.0530538, 0.39633},{-0.0744946, 0.0292841, 0.339169}, -{-0.0732834, 0.0184108, 0.303391},{-0.0732834, 0.00172788, 0.274136},{-0.241653, 0.0934935, 0.0998833}, -{-0.230752, 0.0850386, 0.0730078},{-0.199258, 0.0563282, 0.103222},{-0.184723, 0.0547137, 0.0711923}, -{-0.138693, 0.0433217, 0.108734},{-0.133848, 0.0446314, 0.0820074},{-0.109622, 0.0475556, 0.0873111}, -{0.0890302, 0.0591746, 0.0742657},{0.0817625, 0.025757, 0.0683459},{0.0769173, 0.0568145, 0.0910588}, -{0.119313, 0.0540005, 0.0588601},{0.0320993, -0.0402094, 0.13736},{0.0260429, -0.0750535, 0.106776}, -{0.0502688, -0.033557, 0.124839},{0.0478462, -0.0627602, 0.0889321},{0.063593, -0.0252772, 0.0746287}, -{0.0623817, -0.0400473, 0.0578745},{0.0817625, -0.0154412, 0.0307527},{0.0684382, 0.0254976, 0.105005}, -{0.0914528, 0.0510439, 0.114712},{0.0841851, 0.0288174, 0.133606},{0.0611704, -0.0185989, 0.148959}, -{0.0369445, -0.025945, 0.157712},{0.118101, -0.00395839, 0.184043},{0.148384, 0.0454419, 0.137165}, -{0.171398, 0.0206866, 0.174052},{0.222273, 0.0557512, 0.150846},{0.21016, 0.061016, 0.130792}, -{0.265879, 0.104347, 0.127096},{0.252555, 0.102603, 0.113396},{0.277992, 0.138906, 0.107489}, -{0.268302, 0.132027, 0.0955132},{0.296162, 0.185272, 0.0822019},{0.262245, 0.137441, 0.0656941}, -{0.297373, 0.177472, 0.0419633},{0.269513, 0.123138, 0.0282111},{0.215005, 0.0873793, 0.0476496}, -{0.121735, 0.0172243, 0.00720996},{0.1823, 0.0418888, 0.00578353},{0.178666, 0.0639143, 0.0492446}, -{0.222273, 0.0677722, 0.0130908},{0.31312, 0.180837, -0.0603125},{0.288894, 0.114715, -0.0598198}, -{0.233174, 0.043795, -0.0600013},{0.184723, 0.0136388, -0.0630163},{0.0926641, -0.0228522, -0.0644752}, -{0.0684382, -0.0576703, -0.00820859},{0.0551139, -0.0778156, 0.0219866},{0.043001, -0.102947, 0.0441418}, -{0.0551139, -0.104075, -5.19579e-05},{0.0781286, -0.100049, -0.0374053},{0.0660156, -0.133952, -0.0311613}, -{0.0829737, -0.0876061, -0.0650134},{0.0599591, -0.0755203, -0.0987876},{0.075706, -0.0611651, -0.113895}, -{0.104777, -0.0562568, -0.140115},{0.160497, 0.000418296, -0.151722},{0.222273, 0.0424399, -0.128691}, -{0.202892, 0.0384589, -0.222214},{0.063593, -0.0884555, -0.137302},{0.0333106, -0.10757, -0.105738}, -{0.0502688, -0.0979348, -0.0872594},{0.0236203, -0.1221, 0.0585748},{0.0211976, -0.160037, 0.0238863}, -{0.0417897, -0.124745, 0.0251766},{0.0442123, -0.153404, 0.00280092},{0.0454236, -0.169393, -0.022687}, -{0.022409, -0.185454, -0.00414975},{0.0672269, -0.105262, -0.0699411},{0.0684382, -0.116375, -0.0604942}, -{0.0551139, -0.134179, -0.0556572},{0.0490574, -0.14327, -0.0606044},{0.0272541, -0.180059, -0.042534}, -{0.0393671, -0.14089, -0.0688324},{0.0296767, -0.125335, -0.0837711},{0.0211977, -0.126386, -0.0937043}, -{0.0199864, -0.113062, -0.11018},{0.0369445, -0.111655, -0.0940804},{0.0236202, -0.191659, -0.0209234}, -{0.0163525, -0.103187, -0.136925},{0.0333106, -0.102324, -0.134358},{0.018775, -0.117996, -0.17081}, -{0.0454236, -0.111998, -0.169967},{0.0732834, -0.0955617, -0.173773},{0.112045, -0.0661187, -0.18309}, -{0.150806, -0.0192277, -0.203411},{0.164131, -0.00796527, -0.222622},{0.139905, -0.0237858, -0.24931}, -{0.135059, -0.0153309, -0.222434},{0.108411, -0.061794, -0.239973},{0.0211977, -0.116278, -0.24396}, -{0.0393671, -0.0841567, -0.281035},{0.0417897, -0.11251, -0.244654},{0.0805511, -0.0907507, -0.242819}, -{0.0769173, -0.0762659, -0.276256},{0.105988, -0.0615152, -0.268067},{0.136271, -0.0209977, -0.303962}, -{0.0914528, -0.0538902, -0.304915},{0.0708608, -0.0660538, -0.305401},{0.0369445, -0.0778609, -0.299721}, -{0.0442123, -0.087217, -0.346295},{0.0732834, -0.0729915, -0.343072},{0.0926641, -0.0604907, -0.344985}, -{0.132637, -0.0185274, -0.34765},{0.179877, 0.0374928, -0.345893},{0.185934, 0.0381153, -0.2981}, -{0.28526, 0.114916, -0.122175},{0.315542, 0.186024, -0.114627},{0.310697, 0.187237, -0.184179}, -{0.270725, 0.119876, -0.200986},{0.287683, 0.183651, -0.254406},{0.276781, 0.1817, -0.284037}, -{0.245287, 0.128078, -0.285457},{0.256189, 0.176428, -0.342268},{0.231963, 0.131897, -0.338741}, -{0.202892, 0.171624, -0.421228},{0.189568, 0.143529, -0.421507},{0.218639, 0.136935, -0.383291}, -{0.143539, 0.16656, -0.463528},{0.15444, 0.0504929, -0.42969},{0.110834, 0.0530022, -0.456247}, -{0.234386, 0.170671, -0.388336},{0.21985, 0.0886632, -0.292219},{0.173821, 0.039626, -0.387182}, -{0.135059, -0.0222231, -0.390981},{0.0381558, -0.0928255, -0.402127},{0.0381558, -0.0668708, -0.438845}, -{0.0381558, -0.0143388, -0.464488},{0.0769173, -0.016887, -0.455061},{0.0708608, -0.0637585, -0.426175}, -{0.0720721, -0.0784314, -0.400104},{0.0926641, -0.0642059, -0.396881},{0.113256, -0.0192276, -0.429702}, -{0.0405784, 0.0519324, -0.474746},{0.0454236, 0.147478, -0.493121},{0.0781286, 0.052289, -0.468579}, -{0.0890302, 0.15983, -0.485269},{0.277992, 0.106448, 0.146962},{0.286471, 0.148353, 0.118602}, -{0.296162, 0.179618, 0.157246},{0.274358, 0.134452, 0.182701},{0.225907, 0.0690819, 0.212656}, -{0.231963, 0.0520424, 0.177235},{0.273147, 0.153553, 0.220858},{0.28526, 0.176999, 0.210698}, -{0.27557, 0.173497, 0.253018},{0.21985, 0.0903942, 0.243785},{0.222273, 0.106571, 0.276639}, -{0.176243, 0.018346, 0.19941},{0.176243, 0.028357, 0.23262},{0.17261, 0.0433151, 0.25674}, -{0.171398, 0.0617227, 0.29113},{0.222273, 0.120012, 0.311554},{0.173821, 0.0789308, 0.325352}, -{0.254978, 0.164524, 0.299462},{0.215005, 0.15199, 0.36253},{0.170187, 0.104574, 0.377884}, -{0.129003, 0.0493191, 0.335868},{0.187145, 0.145902, 0.397147},{0.155651, 0.145118, 0.42884}, -{0.119313, 0.119105, 0.439863},{0.110834, 0.158221, 0.466154},{0.133848, 0.16077, 0.456727}, -{0.096298, 0.195951, 0.484912},{0.124158, 0.199361, 0.478052},{0.0708608, 0.146434, 0.480399}, -{0.0648043, 0.192034, 0.495371},{0.0405784, 0.140624, 0.486922},{0.0320993, 0.188961, 0.499831}, -{0.0466349, 0.0965408, 0.461155},{0.0805511, 0.102182, 0.455832},{0.127792, 0.0749626, 0.3884}, -{0.122946, 0.0338163, 0.298217},{0.12658, 0.014903, 0.267425},{0.124158, 0.00423714, 0.247578}, -{0.127792, -0.00200677, 0.213674},{0.0769173, -0.019364, 0.189217},{0.0781286, -0.0192862, 0.223478}, -{0.043001, -0.0236368, 0.19351},{0.0478462, -0.0221909, 0.226739},{0.0793398, -0.00996892, 0.252921}, -{0.0490575, -0.0121994, 0.251384},{0.0478462, 0.00052838, 0.273967},{0.0502688, 0.0124132, 0.302548}, -{0.0526913, 0.0239804, 0.342093},{0.0490575, 0.0666634, 0.430046},{0.0490575, 0.0441515, 0.398749}, -{0.0841851, 0.0532224, 0.395131},{0.0817625, 0.0294527, 0.337969},{0.0793398, 0.0185793, 0.302192}, -{0.0793398, 0.00189648, 0.272936},{0.233174, 0.0867438, 0.0695779},{0.245287, 0.0951987, 0.0964533}, -{0.202892, 0.0578649, 0.100992},{0.188356, 0.0562504, 0.0689619},{0.142327, 0.0448583, 0.106503}, -{0.137482, 0.0461681, 0.0797769},{0.113256, 0.0489237, 0.0862802},{-0.265879, 0.130322, 0.0989431}, -{-0.230752, 0.0850386, 0.0730078},{-0.212582, 0.085674, 0.0510795},{-0.184723, 0.0547137, 0.0711924}, -{-0.176243, 0.0623776, 0.051475},{-0.133848, 0.0446314, 0.0820074},{-0.11689, 0.0526324, 0.059891}, -{-0.0853963, 0.059006, 0.0754652},{0.113256, 0.0489237, 0.0862802},{0.0914528, 0.0510439, 0.114712}, -{0.119313, 0.0540005, 0.0588601},{0.137482, 0.0461681, 0.0797769},{0.188356, 0.0562504, 0.0689619}, -{0.178666, 0.0639143, 0.0492446},{0.233174, 0.0867438, 0.0695779},{0.215005, 0.0873793, 0.0476496}, -{0.268302, 0.132027, 0.0955132},{-0.0648043, -0.10543, -0.0687416},{-0.0345219, -0.104756, -0.0735396}, -{-0.0478462, -0.0981034, -0.0860599},{-0.0526913, -0.134348, -0.0544577},{-0.0466349, -0.143438, -0.0594049}, -{-0.0369445, -0.14089, -0.0688324},{-0.0345219, -0.111655, -0.0940804},{0.0369445, -0.104756, -0.0735396}, -{0.0684382, -0.116375, -0.0604942},{0.0672269, -0.105262, -0.0699411},{0.0502688, -0.0979348, -0.0872594}, -{0.0369445, -0.111655, -0.0940804},{-0.135059, -0.0168676, -0.220204},{-0.150806, -0.0207644, -0.20118}, -{-0.0999319, -0.0514458, -0.209162},{-0.0720721, -0.0957303, -0.172574},{-0.0660156, -0.0767846, -0.202937}, -{-0.0442123, -0.112167, -0.168768},{-0.0381558, -0.0906535, -0.199994},{-0.0175638, -0.117996, -0.17081}, -{-0.0163525, -0.0961453, -0.204435},{0.000605662, -0.118164, -0.16961},{0.000605662, -0.0939149, -0.202898}, -{0.018775, -0.117996, -0.17081},{0.0163525, -0.0961453, -0.204435},{0.0381558, -0.0906535, -0.199994}, -{0.0732834, -0.0955618, -0.173773},{0.0660156, -0.076616, -0.204137},{0.112045, -0.0661187, -0.18309}, -{0.0999319, -0.0512772, -0.210361},{0.135059, -0.0153309, -0.222434},{0.150806, -0.0192277, -0.203411}, -{-0.102355, -0.0591875, -0.223705},{-0.0769173, -0.0865881, -0.220217},{-0.0805511, -0.0909193, -0.24162}, -{-0.043001, -0.107148, -0.221883},{-0.0417897, -0.11251, -0.244654},{-0.0175638, -0.108685, -0.219652}, -{0.000605662, -0.110053, -0.218622},{0.0175638, -0.108685, -0.219652},{0.043001, -0.10698, -0.223083}, -{0.0417897, -0.11251, -0.244654},{0.0769172, -0.0864195, -0.221416},{0.0805511, -0.0907507, -0.242819}, -{0.102354, -0.0590189, -0.224904},{0.108411, -0.061794, -0.239973} -}; +GLfloat vertices[473][3] = {{-0.0732834, 0.0566459, 0.0922583}, + {-0.0781286, 0.0255884, 0.0695454}, + {-0.0853963, 0.059006, 0.0754652}, + {-0.11689, 0.0526324, 0.059891}, + {0.00181693, -0.0453446, 0.139084}, + {0.00181693, -0.0728231, 0.108312}, + {-0.0211977, -0.0750535, 0.106776}, + {-0.0272541, -0.0402094, 0.13736}, + {-0.043001, -0.0629288, 0.0901316}, + {-0.0454236, -0.0337256, 0.126039}, + {-0.0599591, -0.0254458, 0.0758283}, + {-0.0587478, -0.0402159, 0.059074}, + {-0.0781286, -0.0156098, 0.0319522}, + {-0.0648043, 0.0253291, 0.106205}, + {-0.0878189, 0.0508753, 0.115911}, + {-0.0805511, 0.0286488, 0.134805}, + {-0.0563253, -0.0187674, 0.150159}, + {-0.0320993, -0.025945, 0.157712}, + {0.00181693, -0.0317545, 0.164235}, + {-0.113256, -0.0053265, 0.185074}, + {-0.14475, 0.0439052, 0.139396}, + {-0.166553, 0.0191499, 0.176282}, + {-0.206526, 0.0594793, 0.133022}, + {-0.218639, 0.0540459, 0.154276}, + {-0.248921, 0.100898, 0.116826}, + {-0.262245, 0.102642, 0.130526}, + {-0.265879, 0.130322, 0.0989431}, + {-0.27557, 0.137201, 0.110919}, + {-0.293739, 0.183567, 0.0856318}, + {-0.259823, 0.135736, 0.069124}, + {-0.267091, 0.121432, 0.031641}, + {-0.296162, 0.175767, 0.0453933}, + {-0.212582, 0.085674, 0.0510795}, + {-0.119313, 0.0158562, 0.00824089}, + {-0.179877, 0.0403521, 0.00801397}, + {-0.176243, 0.0623776, 0.051475}, + {-0.21985, 0.0660669, 0.0165208}, + {-0.31312, 0.178963, -0.0556831}, + {-0.287683, 0.11301, -0.0563898}, + {-0.231963, 0.0420898, -0.0565714}, + {-0.183511, 0.0121021, -0.0607859}, + {-0.0902415, -0.0230208, -0.0632757}, + {-0.0660156, -0.0578389, -0.00700907}, + {-0.0393671, -0.102947, 0.0441418}, + {-0.0514801, -0.0779842, 0.0231861}, + {-0.0514801, -0.104244, 0.00114758}, + {-0.075706, -0.100217, -0.0362058}, + {-0.0623817, -0.134121, -0.0299618}, + {-0.0805511, -0.0877747, -0.0638139}, + {-0.0575365, -0.0756889, -0.0975881}, + {-0.0744946, -0.0613337, -0.112695}, + {-0.103566, -0.0564254, -0.138916}, + {-0.160497, -0.0011184, -0.149491}, + {-0.204103, 0.0369222, -0.219983}, + {-0.222273, 0.0407347, -0.125261}, + {-0.0623817, -0.0886241, -0.136102}, + {-0.030888, -0.10757, -0.105738}, + {-0.0478462, -0.0981034, -0.0860599}, + {-0.0187751, -0.1221, 0.0585748}, + {0.00181693, -0.125005, 0.0618361}, + {0.00181693, -0.183709, 0.00955056}, + {-0.0175638, -0.160037, 0.0238863}, + {-0.0381558, -0.124745, 0.0251766}, + {-0.0405784, -0.153573, 0.00400043}, + {-0.0417897, -0.169562, -0.0214875}, + {-0.0187751, -0.185454, -0.00414975}, + {-0.0648043, -0.10543, -0.0687416}, + {-0.0660156, -0.116543, -0.0592946}, + {-0.0526913, -0.134348, -0.0544577}, + {-0.0466349, -0.143438, -0.0594049}, + {-0.0369445, -0.14089, -0.0688324}, + {-0.0236203, -0.180059, -0.042534}, + {-0.0187751, -0.126386, -0.0937043}, + {-0.0272541, -0.125335, -0.0837711}, + {-0.0175638, -0.113062, -0.11018}, + {-0.0345219, -0.111655, -0.0940804}, + {0.00181693, -0.199361, -0.0183364}, + {-0.0199864, -0.191659, -0.0209234}, + {0.00181693, -0.18334, -0.0540038}, + {0.000605662, -0.11786, -0.110854}, + {0.000605662, -0.104386, -0.137094}, + {-0.0151412, -0.103187, -0.136925}, + {-0.0320993, -0.102324, -0.134358}, + {0.000605662, -0.118164, -0.16961}, + {-0.0175638, -0.117996, -0.17081}, + {-0.0442123, -0.112167, -0.168768}, + {-0.0720721, -0.0957303, -0.172574}, + {-0.110834, -0.0674868, -0.182059}, + {-0.150806, -0.0207644, -0.20118}, + {-0.164131, -0.00950196, -0.220392}, + {-0.139905, -0.0253225, -0.247079}, + {-0.135059, -0.0168676, -0.220204}, + {-0.108411, -0.0631621, -0.238942}, + {-0.000605662, -0.0853756, -0.289769}, + {-0.0211977, -0.116278, -0.24396}, + {0.000605662, -0.116278, -0.24396}, + {-0.0393671, -0.0841567, -0.281035}, + {-0.0417897, -0.11251, -0.244654}, + {-0.0805511, -0.0909193, -0.24162}, + {-0.0769173, -0.0764345, -0.275057}, + {-0.105988, -0.0616838, -0.266868}, + {-0.137482, -0.0225344, -0.301731}, + {-0.0926641, -0.0540588, -0.303715}, + {-0.0720721, -0.0662224, -0.304202}, + {-0.0381558, -0.0778609, -0.299721}, + {-0.000605662, -0.0938889, -0.342339}, + {-0.0454236, -0.0873856, -0.345095}, + {-0.0744946, -0.0731601, -0.341873}, + {-0.0938754, -0.0606593, -0.343785}, + {-0.135059, -0.0200641, -0.345419}, + {-0.1823, 0.0359562, -0.343662}, + {-0.187145, 0.0365786, -0.29587}, + {-0.28526, 0.113211, -0.118745}, + {-0.315542, 0.18415, -0.109998}, + {-0.311909, 0.185363, -0.17955}, + {-0.271936, 0.118171, -0.197556}, + {-0.290105, 0.181946, -0.250976}, + {-0.24771, 0.126373, -0.282027}, + {-0.279204, 0.179994, -0.280607}, + {-0.234386, 0.130192, -0.335311}, + {-0.259823, 0.174723, -0.338838}, + {-0.222273, 0.13523, -0.379861}, + {-0.193202, 0.141993, -0.419277}, + {-0.207737, 0.170087, -0.418998}, + {-0.148384, 0.165023, -0.461298}, + {-0.158074, 0.0489562, -0.427459}, + {-0.114467, 0.0516341, -0.455216}, + {-0.23802, 0.168965, -0.384906}, + {-0.222273, 0.0869579, -0.28879}, + {-0.176243, 0.0380893, -0.384951}, + {-0.137482, -0.0237598, -0.388751}, + {-0.000605662, -0.0979607, -0.400402}, + {-0.0405784, -0.0928255, -0.402127}, + {-0.0405784, -0.0668708, -0.438845}, + {-0.000605662, -0.0706379, -0.438151}, + {-0.00181693, -0.0114341, -0.46775}, + {-0.0417897, -0.0143388, -0.464488}, + {-0.0805511, -0.0170555, -0.453861}, + {-0.0732834, -0.0639271, -0.424976}, + {-0.0744946, -0.0786, -0.398904}, + {-0.0950867, -0.0643745, -0.395682}, + {-0.115679, -0.0205957, -0.428672}, + {-0.00181693, 0.0502076, -0.479881}, + {-0.0442123, 0.0519323, -0.474746}, + {-0.00181693, 0.159454, -0.5}, + {-0.0502688, 0.147309, -0.491921}, + {-0.0938754, 0.159661, -0.484069}, + {-0.0817625, 0.0521204, -0.46738}, + {-0.282838, 0.146648, 0.122032}, + {-0.274358, 0.104743, 0.150392}, + {-0.292528, 0.177913, 0.160676}, + {-0.270725, 0.132747, 0.186131}, + {-0.227118, 0.0503371, 0.180665}, + {-0.221061, 0.0673766, 0.216086}, + {-0.281626, 0.175293, 0.214128}, + {-0.268302, 0.151848, 0.224288}, + {-0.270725, 0.171792, 0.256448}, + {-0.216216, 0.104866, 0.280069}, + {-0.215005, 0.0886889, 0.247215}, + {-0.171398, 0.0168093, 0.20164}, + {-0.170187, 0.0268203, 0.234851}, + {-0.166553, 0.0417785, 0.25897}, + {-0.165342, 0.060186, 0.293361}, + {-0.167764, 0.0773941, 0.327582}, + {-0.216216, 0.118307, 0.314984}, + {-0.250133, 0.162818, 0.302892}, + {-0.208949, 0.150454, 0.36476}, + {-0.162919, 0.103038, 0.380114}, + {-0.121735, 0.047951, 0.336899}, + {-0.179877, 0.144366, 0.399378}, + {-0.148384, 0.143581, 0.431071}, + {-0.12658, 0.159233, 0.458957}, + {-0.103566, 0.156853, 0.467185}, + {-0.112045, 0.117736, 0.440893}, + {-0.11689, 0.197993, 0.479083}, + {-0.0890302, 0.195782, 0.486112}, + {-0.0575365, 0.191866, 0.49657}, + {-0.0623817, 0.146265, 0.481599}, + {-0.0248315, 0.188961, 0.499831}, + {-0.0320993, 0.140624, 0.486922}, + {0.00302825, 0.190161, 0.5}, + {0.00423952, 0.137888, 0.488984}, + {0.00423952, 0.0926051, 0.463049}, + {-0.0381558, 0.0965408, 0.461155}, + {-0.0720721, 0.102013, 0.457032}, + {-0.120524, 0.0735945, 0.389431}, + {-0.11689, 0.0324482, 0.299248}, + {-0.120524, 0.0135349, 0.268456}, + {-0.118101, 0.00286904, 0.248609}, + {-0.122947, -0.00337487, 0.214705}, + {-0.0720721, -0.0195325, 0.190417}, + {-0.0720721, -0.0194547, 0.224677}, + {-0.0381558, -0.0236368, 0.19351}, + {0.00181693, -0.0256792, 0.199339}, + {-0.0417897, -0.0223595, 0.227939}, + {0.00302825, -0.0247585, 0.227602}, + {-0.0732834, -0.0101375, 0.25412}, + {-0.043001, -0.0123679, 0.252584}, + {0.00302825, -0.0125365, 0.253783}, + {-0.0417897, 0.000359796, 0.275167}, + {0.00302825, -0.00100829, 0.276198}, + {-0.0442123, 0.0122446, 0.303748}, + {0.00302825, 0.010708, 0.305978}, + {-0.0454236, 0.0238118, 0.343292}, + {0.00302825, 0.0222751, 0.345523}, + {-0.0417897, 0.0664948, 0.431246}, + {0.00302825, 0.0445081, 0.404915}, + {-0.0417897, 0.0439829, 0.399948}, + {-0.0769173, 0.0530538, 0.39633}, + {-0.0744946, 0.0292841, 0.339169}, + {-0.0732834, 0.0184108, 0.303391}, + {-0.0732834, 0.00172788, 0.274136}, + {-0.241653, 0.0934935, 0.0998833}, + {-0.230752, 0.0850386, 0.0730078}, + {-0.199258, 0.0563282, 0.103222}, + {-0.184723, 0.0547137, 0.0711923}, + {-0.138693, 0.0433217, 0.108734}, + {-0.133848, 0.0446314, 0.0820074}, + {-0.109622, 0.0475556, 0.0873111}, + {0.0890302, 0.0591746, 0.0742657}, + {0.0817625, 0.025757, 0.0683459}, + {0.0769173, 0.0568145, 0.0910588}, + {0.119313, 0.0540005, 0.0588601}, + {0.0320993, -0.0402094, 0.13736}, + {0.0260429, -0.0750535, 0.106776}, + {0.0502688, -0.033557, 0.124839}, + {0.0478462, -0.0627602, 0.0889321}, + {0.063593, -0.0252772, 0.0746287}, + {0.0623817, -0.0400473, 0.0578745}, + {0.0817625, -0.0154412, 0.0307527}, + {0.0684382, 0.0254976, 0.105005}, + {0.0914528, 0.0510439, 0.114712}, + {0.0841851, 0.0288174, 0.133606}, + {0.0611704, -0.0185989, 0.148959}, + {0.0369445, -0.025945, 0.157712}, + {0.118101, -0.00395839, 0.184043}, + {0.148384, 0.0454419, 0.137165}, + {0.171398, 0.0206866, 0.174052}, + {0.222273, 0.0557512, 0.150846}, + {0.21016, 0.061016, 0.130792}, + {0.265879, 0.104347, 0.127096}, + {0.252555, 0.102603, 0.113396}, + {0.277992, 0.138906, 0.107489}, + {0.268302, 0.132027, 0.0955132}, + {0.296162, 0.185272, 0.0822019}, + {0.262245, 0.137441, 0.0656941}, + {0.297373, 0.177472, 0.0419633}, + {0.269513, 0.123138, 0.0282111}, + {0.215005, 0.0873793, 0.0476496}, + {0.121735, 0.0172243, 0.00720996}, + {0.1823, 0.0418888, 0.00578353}, + {0.178666, 0.0639143, 0.0492446}, + {0.222273, 0.0677722, 0.0130908}, + {0.31312, 0.180837, -0.0603125}, + {0.288894, 0.114715, -0.0598198}, + {0.233174, 0.043795, -0.0600013}, + {0.184723, 0.0136388, -0.0630163}, + {0.0926641, -0.0228522, -0.0644752}, + {0.0684382, -0.0576703, -0.00820859}, + {0.0551139, -0.0778156, 0.0219866}, + {0.043001, -0.102947, 0.0441418}, + {0.0551139, -0.104075, -5.19579e-05}, + {0.0781286, -0.100049, -0.0374053}, + {0.0660156, -0.133952, -0.0311613}, + {0.0829737, -0.0876061, -0.0650134}, + {0.0599591, -0.0755203, -0.0987876}, + {0.075706, -0.0611651, -0.113895}, + {0.104777, -0.0562568, -0.140115}, + {0.160497, 0.000418296, -0.151722}, + {0.222273, 0.0424399, -0.128691}, + {0.202892, 0.0384589, -0.222214}, + {0.063593, -0.0884555, -0.137302}, + {0.0333106, -0.10757, -0.105738}, + {0.0502688, -0.0979348, -0.0872594}, + {0.0236203, -0.1221, 0.0585748}, + {0.0211976, -0.160037, 0.0238863}, + {0.0417897, -0.124745, 0.0251766}, + {0.0442123, -0.153404, 0.00280092}, + {0.0454236, -0.169393, -0.022687}, + {0.022409, -0.185454, -0.00414975}, + {0.0672269, -0.105262, -0.0699411}, + {0.0684382, -0.116375, -0.0604942}, + {0.0551139, -0.134179, -0.0556572}, + {0.0490574, -0.14327, -0.0606044}, + {0.0272541, -0.180059, -0.042534}, + {0.0393671, -0.14089, -0.0688324}, + {0.0296767, -0.125335, -0.0837711}, + {0.0211977, -0.126386, -0.0937043}, + {0.0199864, -0.113062, -0.11018}, + {0.0369445, -0.111655, -0.0940804}, + {0.0236202, -0.191659, -0.0209234}, + {0.0163525, -0.103187, -0.136925}, + {0.0333106, -0.102324, -0.134358}, + {0.018775, -0.117996, -0.17081}, + {0.0454236, -0.111998, -0.169967}, + {0.0732834, -0.0955617, -0.173773}, + {0.112045, -0.0661187, -0.18309}, + {0.150806, -0.0192277, -0.203411}, + {0.164131, -0.00796527, -0.222622}, + {0.139905, -0.0237858, -0.24931}, + {0.135059, -0.0153309, -0.222434}, + {0.108411, -0.061794, -0.239973}, + {0.0211977, -0.116278, -0.24396}, + {0.0393671, -0.0841567, -0.281035}, + {0.0417897, -0.11251, -0.244654}, + {0.0805511, -0.0907507, -0.242819}, + {0.0769173, -0.0762659, -0.276256}, + {0.105988, -0.0615152, -0.268067}, + {0.136271, -0.0209977, -0.303962}, + {0.0914528, -0.0538902, -0.304915}, + {0.0708608, -0.0660538, -0.305401}, + {0.0369445, -0.0778609, -0.299721}, + {0.0442123, -0.087217, -0.346295}, + {0.0732834, -0.0729915, -0.343072}, + {0.0926641, -0.0604907, -0.344985}, + {0.132637, -0.0185274, -0.34765}, + {0.179877, 0.0374928, -0.345893}, + {0.185934, 0.0381153, -0.2981}, + {0.28526, 0.114916, -0.122175}, + {0.315542, 0.186024, -0.114627}, + {0.310697, 0.187237, -0.184179}, + {0.270725, 0.119876, -0.200986}, + {0.287683, 0.183651, -0.254406}, + {0.276781, 0.1817, -0.284037}, + {0.245287, 0.128078, -0.285457}, + {0.256189, 0.176428, -0.342268}, + {0.231963, 0.131897, -0.338741}, + {0.202892, 0.171624, -0.421228}, + {0.189568, 0.143529, -0.421507}, + {0.218639, 0.136935, -0.383291}, + {0.143539, 0.16656, -0.463528}, + {0.15444, 0.0504929, -0.42969}, + {0.110834, 0.0530022, -0.456247}, + {0.234386, 0.170671, -0.388336}, + {0.21985, 0.0886632, -0.292219}, + {0.173821, 0.039626, -0.387182}, + {0.135059, -0.0222231, -0.390981}, + {0.0381558, -0.0928255, -0.402127}, + {0.0381558, -0.0668708, -0.438845}, + {0.0381558, -0.0143388, -0.464488}, + {0.0769173, -0.016887, -0.455061}, + {0.0708608, -0.0637585, -0.426175}, + {0.0720721, -0.0784314, -0.400104}, + {0.0926641, -0.0642059, -0.396881}, + {0.113256, -0.0192276, -0.429702}, + {0.0405784, 0.0519324, -0.474746}, + {0.0454236, 0.147478, -0.493121}, + {0.0781286, 0.052289, -0.468579}, + {0.0890302, 0.15983, -0.485269}, + {0.277992, 0.106448, 0.146962}, + {0.286471, 0.148353, 0.118602}, + {0.296162, 0.179618, 0.157246}, + {0.274358, 0.134452, 0.182701}, + {0.225907, 0.0690819, 0.212656}, + {0.231963, 0.0520424, 0.177235}, + {0.273147, 0.153553, 0.220858}, + {0.28526, 0.176999, 0.210698}, + {0.27557, 0.173497, 0.253018}, + {0.21985, 0.0903942, 0.243785}, + {0.222273, 0.106571, 0.276639}, + {0.176243, 0.018346, 0.19941}, + {0.176243, 0.028357, 0.23262}, + {0.17261, 0.0433151, 0.25674}, + {0.171398, 0.0617227, 0.29113}, + {0.222273, 0.120012, 0.311554}, + {0.173821, 0.0789308, 0.325352}, + {0.254978, 0.164524, 0.299462}, + {0.215005, 0.15199, 0.36253}, + {0.170187, 0.104574, 0.377884}, + {0.129003, 0.0493191, 0.335868}, + {0.187145, 0.145902, 0.397147}, + {0.155651, 0.145118, 0.42884}, + {0.119313, 0.119105, 0.439863}, + {0.110834, 0.158221, 0.466154}, + {0.133848, 0.16077, 0.456727}, + {0.096298, 0.195951, 0.484912}, + {0.124158, 0.199361, 0.478052}, + {0.0708608, 0.146434, 0.480399}, + {0.0648043, 0.192034, 0.495371}, + {0.0405784, 0.140624, 0.486922}, + {0.0320993, 0.188961, 0.499831}, + {0.0466349, 0.0965408, 0.461155}, + {0.0805511, 0.102182, 0.455832}, + {0.127792, 0.0749626, 0.3884}, + {0.122946, 0.0338163, 0.298217}, + {0.12658, 0.014903, 0.267425}, + {0.124158, 0.00423714, 0.247578}, + {0.127792, -0.00200677, 0.213674}, + {0.0769173, -0.019364, 0.189217}, + {0.0781286, -0.0192862, 0.223478}, + {0.043001, -0.0236368, 0.19351}, + {0.0478462, -0.0221909, 0.226739}, + {0.0793398, -0.00996892, 0.252921}, + {0.0490575, -0.0121994, 0.251384}, + {0.0478462, 0.00052838, 0.273967}, + {0.0502688, 0.0124132, 0.302548}, + {0.0526913, 0.0239804, 0.342093}, + {0.0490575, 0.0666634, 0.430046}, + {0.0490575, 0.0441515, 0.398749}, + {0.0841851, 0.0532224, 0.395131}, + {0.0817625, 0.0294527, 0.337969}, + {0.0793398, 0.0185793, 0.302192}, + {0.0793398, 0.00189648, 0.272936}, + {0.233174, 0.0867438, 0.0695779}, + {0.245287, 0.0951987, 0.0964533}, + {0.202892, 0.0578649, 0.100992}, + {0.188356, 0.0562504, 0.0689619}, + {0.142327, 0.0448583, 0.106503}, + {0.137482, 0.0461681, 0.0797769}, + {0.113256, 0.0489237, 0.0862802}, + {-0.265879, 0.130322, 0.0989431}, + {-0.230752, 0.0850386, 0.0730078}, + {-0.212582, 0.085674, 0.0510795}, + {-0.184723, 0.0547137, 0.0711924}, + {-0.176243, 0.0623776, 0.051475}, + {-0.133848, 0.0446314, 0.0820074}, + {-0.11689, 0.0526324, 0.059891}, + {-0.0853963, 0.059006, 0.0754652}, + {0.113256, 0.0489237, 0.0862802}, + {0.0914528, 0.0510439, 0.114712}, + {0.119313, 0.0540005, 0.0588601}, + {0.137482, 0.0461681, 0.0797769}, + {0.188356, 0.0562504, 0.0689619}, + {0.178666, 0.0639143, 0.0492446}, + {0.233174, 0.0867438, 0.0695779}, + {0.215005, 0.0873793, 0.0476496}, + {0.268302, 0.132027, 0.0955132}, + {-0.0648043, -0.10543, -0.0687416}, + {-0.0345219, -0.104756, -0.0735396}, + {-0.0478462, -0.0981034, -0.0860599}, + {-0.0526913, -0.134348, -0.0544577}, + {-0.0466349, -0.143438, -0.0594049}, + {-0.0369445, -0.14089, -0.0688324}, + {-0.0345219, -0.111655, -0.0940804}, + {0.0369445, -0.104756, -0.0735396}, + {0.0684382, -0.116375, -0.0604942}, + {0.0672269, -0.105262, -0.0699411}, + {0.0502688, -0.0979348, -0.0872594}, + {0.0369445, -0.111655, -0.0940804}, + {-0.135059, -0.0168676, -0.220204}, + {-0.150806, -0.0207644, -0.20118}, + {-0.0999319, -0.0514458, -0.209162}, + {-0.0720721, -0.0957303, -0.172574}, + {-0.0660156, -0.0767846, -0.202937}, + {-0.0442123, -0.112167, -0.168768}, + {-0.0381558, -0.0906535, -0.199994}, + {-0.0175638, -0.117996, -0.17081}, + {-0.0163525, -0.0961453, -0.204435}, + {0.000605662, -0.118164, -0.16961}, + {0.000605662, -0.0939149, -0.202898}, + {0.018775, -0.117996, -0.17081}, + {0.0163525, -0.0961453, -0.204435}, + {0.0381558, -0.0906535, -0.199994}, + {0.0732834, -0.0955618, -0.173773}, + {0.0660156, -0.076616, -0.204137}, + {0.112045, -0.0661187, -0.18309}, + {0.0999319, -0.0512772, -0.210361}, + {0.135059, -0.0153309, -0.222434}, + {0.150806, -0.0192277, -0.203411}, + {-0.102355, -0.0591875, -0.223705}, + {-0.0769173, -0.0865881, -0.220217}, + {-0.0805511, -0.0909193, -0.24162}, + {-0.043001, -0.107148, -0.221883}, + {-0.0417897, -0.11251, -0.244654}, + {-0.0175638, -0.108685, -0.219652}, + {0.000605662, -0.110053, -0.218622}, + {0.0175638, -0.108685, -0.219652}, + {0.043001, -0.10698, -0.223083}, + {0.0417897, -0.11251, -0.244654}, + {0.0769172, -0.0864195, -0.221416}, + {0.0805511, -0.0907507, -0.242819}, + {0.102354, -0.0590189, -0.224904}, + {0.108411, -0.061794, -0.239973}}; GLfloat normals[537][3] = { -{-0.617258, -0.265442, 0.740631},{-0.78174, -0.349396, 0.516531},{-0.876403, -0.187631, 0.443523}, -{-0.392622, -0.66733, 0.632865},{-0.313203, -0.686293, 0.656434},{-0.00361883, -0.700253, 0.713886}, -{0.0420161, -0.799516, 0.599174},{-0.40127, -0.74323, 0.535342},{-0.815972, -0.462599, 0.346687}, -{-0.617717, -0.683678, 0.388601},{-0.913548, -0.308706, 0.26482},{-0.898646, -0.378167, 0.222316}, -{-0.837402, -0.470289, 0.278544},{-0.931079, -0.205564, 0.301388},{-0.917233, -0.387337, -0.0930287}, -{-0.619272, -0.570823, -0.539132},{-0.715003, -0.436717, -0.545939},{-0.769001, -0.466214, -0.437358}, -{-0.696899, -0.546775, -0.464078},{-0.87295, -0.477816, -0.0982331},{-0.28788, -0.921155, 0.261913}, -{-0.275797, -0.960154, 0.0451773},{-0.0414261, -0.928196, 0.369778},{-0.353936, -0.843672, -0.403667}, -{-0.184309, -0.751164, -0.633863},{0.0475635, -0.976025, -0.2124},{-0.351521, -0.852575, -0.386715}, -{-0.430588, -0.871166, -0.235933},{-0.509535, -0.769058, -0.385907},{-0.657016, -0.685816, -0.313028}, -{-0.704687, -0.607631, -0.366335},{-0.779863, -0.555723, -0.28807},{-0.835802, -0.476563, -0.272622}, -{-0.866963, -0.480579, -0.131978},{-0.784759, -0.614786, 0.0786812},{-0.81366, -0.540176, 0.214866}, -{-0.758468, -0.572999, 0.310481},{-0.555739, -0.691157, 0.462012},{-0.498867, -0.757042, 0.421922}, -{-0.371277, -0.825802, 0.424505},{-0.36783, -0.801439, 0.47159},{-0.574546, -0.717391, 0.394015}, -{-0.905637, -0.404294, 0.127934},{-0.852918, -0.507032, 0.124293},{-0.647028, -0.748724, 0.144109}, -{-0.441598, -0.879427, 0.177764},{-0.734821, -0.622713, 0.268824},{-0.912944, -0.281633, 0.295325}, -{-0.926242, -0.295736, 0.233702},{-0.861139, -0.388918, 0.327388},{-0.888772, -0.207712, 0.408582}, -{-0.93923, -0.249894, 0.235373},{-0.858942, -0.275798, 0.431456},{-0.817378, -0.368817, -0.44257}, -{-0.801257, -0.115027, -0.587159},{-0.732909, -0.412067, -0.541337},{-0.649453, -0.665807, 0.367302}, -{-0.730957, -0.621653, 0.281511},{-0.64689, -0.682982, 0.339218},{-0.638983, -0.762274, 0.10315}, -{-0.667779, -0.738635, -0.0921354},{-0.746946, -0.652356, -0.128463},{-0.5818, -0.762069, 0.284181}, -{-0.553142, -0.796434, -0.244393},{-0.684545, -0.488, -0.541529},{-0.508918, -0.610183, 0.60719}, -{-0.0489265, -0.676034, 0.735244},{-0.465952, -0.628122, 0.623178},{0.0472658, -0.752373, 0.65704}, -{-0.841097, -0.341672, 0.419305},{-0.792787, -0.398602, 0.46109},{-0.748569, -0.659751, -0.0661367}, -{-0.504802, -0.721122, 0.474508},{-0.639641, -0.384767, -0.665442},{-0.829025, -0.489687, -0.270043}, -{-0.836672, -0.486351, -0.251877},{-0.801163, -0.510555, -0.312203},{-0.834725, -0.461526, -0.300379}, -{-0.291522, -0.804713, -0.517158},{-0.44811, -0.67301, -0.588434},{-0.508016, -0.652204, -0.562628}, -{-0.545984, -0.586857, -0.597913},{-0.493538, -0.61943, -0.610514},{-0.390347, -0.791894, -0.46961}, -{-0.596257, -0.662142, -0.453922},{-0.466572, -0.79986, 0.377536},{0.190036, -0.838769, 0.510248}, -{-0.496608, -0.863239, -0.0905465},{-0.0583197, -0.82638, -0.560085},{0.0972804, -0.903582, -0.417223}, -{0.00449633, -0.781011, -0.624501},{-0.0830325, -0.903347, -0.420796},{-0.151122, -0.987776, 0.0382124}, -{-0.232497, -0.968684, 0.0871632},{-0.088527, -0.912191, 0.400088},{0.0222154, -0.918755, 0.394203}, -{-0.0112384, -0.918665, 0.394878},{-0.278235, -0.895706, 0.346836},{-0.562816, -0.77036, 0.299639}, -{-0.669247, -0.683012, 0.292579},{-0.74378, -0.644853, 0.17594},{-0.579577, -0.814631, -0.0216126}, -{-0.755464, -0.653803, -0.0426144},{-0.233861, -0.914594, 0.329888},{-0.225782, -0.900613, -0.371375}, -{-0.756949, -0.652254, 0.0399106},{-0.761632, -0.566077, 0.315394},{0.0, -0.829005, -0.559241}, -{-0.0941706, -0.799439, -0.593321},{-0.0209907, -0.956621, -0.290578},{-0.228631, -0.855488, -0.464615}, -{-0.281067, -0.747786, -0.601513},{-0.48714, -0.786955, -0.378677},{-0.397781, -0.837273, -0.375158}, -{-0.637666, -0.735249, -0.229764},{-0.704007, -0.698655, -0.127498},{-0.567297, -0.810598, -0.145276}, -{-0.414329, -0.905828, -0.0883625},{-0.285415, -0.958382, 0.0065404},{-0.280812, -0.94687, 0.156787}, -{0.0201945, -0.991659, 0.127301},{-0.444322, -0.88464, 0.141385},{-0.595259, -0.794994, 0.116837}, -{-0.725363, -0.688227, 0.0138487},{-0.824385, -0.547202, -0.144774},{-0.79484, -0.594072, -0.123723}, -{-0.842585, -0.530194, -0.0945766},{-0.925218, -0.378386, -0.0282201},{-0.886118, -0.435693, -0.158009}, -{-0.820206, -0.526702, -0.223266},{-0.849571, -0.4593, -0.259369},{-0.836279, -0.479526, -0.265879}, -{-0.83314, -0.488901, -0.25856},{-0.82904, -0.490977, -0.267646},{-0.841809, -0.471393, -0.262955}, -{-0.659415, -0.355956, -0.662168},{-0.675727, -0.266966, -0.687111},{-0.812794, -0.389938, -0.432798}, -{-0.495016, -0.200544, -0.845424},{-0.683747, -0.294463, -0.667669},{-0.451368, -0.223791, -0.86382}, -{-0.791228, -0.451898, -0.412003},{-0.826905, -0.524712, -0.202251},{-0.830356, -0.490117, -0.265131}, -{-0.771985, -0.610672, -0.176406},{-0.281292, -0.938959, -0.19807},{0.0528991, -0.99578, 0.0749901}, -{-0.162494, -0.628418, -0.760715},{0.00113543, -0.813339, -0.581788},{0.00874717, -0.607383, -0.794361}, -{0.0171233, -0.315803, -0.94867},{-0.148415, -0.264319, -0.952947},{-0.369791, -0.363335, -0.855127}, -{-0.457739, -0.675978, -0.57752},{-0.504461, -0.852615, -0.136258},{-0.654036, -0.733626, -0.184473}, -{-0.63544, -0.480484, -0.604442},{0.00534621, -0.183511, -0.983003},{-0.149748, -0.172462, -0.973567}, -{-0.0487523, -0.182016, -0.982086},{-0.176473, -0.181106, -0.967501},{-0.276192, -0.176149, -0.944822}, -{-0.309419, -0.179765, -0.93378},{-0.926717, -0.362956, -0.0972538},{-0.715187, -0.590702, -0.373602}, -{-0.934949, -0.344579, 0.0844686},{-0.886194, -0.377255, 0.268957},{-0.882874, -0.339461, 0.324499}, -{-0.724306, -0.556794, 0.406647},{-0.694368, -0.594899, 0.404905},{-0.89851, -0.387601, 0.206024}, -{-0.836716, -0.479611, 0.264347},{-0.813134, -0.530495, 0.239556},{-0.735221, -0.568519, 0.369102}, -{-0.721289, -0.63864, 0.268104},{-0.548249, -0.79382, -0.263196},{-0.50025, -0.860456, 0.0967749}, -{-0.566133, -0.731919, 0.379193},{-0.569417, -0.6968, 0.436158},{-0.601395, -0.724978, 0.335755}, -{-0.620227, -0.707055, 0.339693},{-0.738127, -0.58567, 0.334902},{-0.790837, -0.511147, 0.336609}, -{-0.727633, -0.511907, 0.45662},{-0.619302, -0.611804, 0.492099},{-0.462961, -0.81736, 0.342912}, -{-0.655225, -0.522961, 0.545153},{-0.500154, -0.56028, 0.660252},{-0.363982, -0.412211, 0.835224}, -{-0.331048, -0.549598, 0.767039},{-0.497904, -0.502297, 0.706958},{-0.301391, -0.353697, 0.885473}, -{-0.294971, -0.326452, 0.89801},{-0.340904, -0.357128, 0.869623},{-0.262921, -0.27268, 0.925483}, -{-0.152911, -0.365596, 0.918127},{-0.0627082, -0.23129, 0.970862},{-0.0142343, -0.361908, 0.932105}, -{0.0229022, -0.223247, 0.974493},{-0.13005, -0.573671, 0.808696},{0.0154897, -0.643634, 0.765177}, -{-0.338543, -0.580818, 0.740297},{-0.500555, -0.692847, 0.519045},{-0.406601, -0.809554, 0.423435}, -{-0.384567, -0.79993, 0.460673},{-0.40446, -0.849816, 0.337972},{-0.373225, -0.921929, 0.103685}, -{-0.211716, -0.976661, -0.0362004},{-0.233625, -0.958946, 0.160757},{-0.536151, -0.49527, -0.683556}, -{-0.128299, -0.991665, 0.0118411},{-0.00909901, -0.996933, 0.0777355},{-0.0708222, -0.977629, 0.198052}, -{0.0173543, -0.974417, 0.224075},{-0.163346, -0.895824, 0.413301},{-0.0294524, -0.900433, 0.433997}, -{-0.00885682, -0.898802, 0.438265},{-0.0623815, -0.887307, 0.456941},{0.00210282, -0.907103, 0.420902}, -{-0.124547, -0.937855, 0.323906},{0.00511924, -0.945417, 0.325822},{-0.11412, -0.946355, 0.302305}, -{0.00780987, -0.949634, 0.313265},{-0.158107, -0.750921, 0.641186},{0.0148427, -0.864096, 0.503109}, -{-0.148108, -0.891512, 0.428102},{-0.349961, -0.802187, 0.483759},{-0.272668, -0.91094, 0.309581}, -{-0.243777, -0.896929, 0.368905},{-0.19127, -0.843408, 0.502075},{0.0757574, -0.978436, -0.192154}, -{-0.747236, -0.610472, -0.262607},{-0.685706, -0.715288, -0.134801},{-0.739627, -0.668704, -0.0760731}, -{-0.422988, -0.903717, -0.0661576},{-0.374275, -0.919054, -0.123525},{-0.0416223, -0.999112, -0.00659359}, -{-0.0516061, -0.998629, 0.00881155},{-0.088891, -0.994828, -0.0491407},{0.135923, -0.990655, -0.011341}, -{0.876403, -0.187631, 0.443523},{0.787758, -0.344726, 0.510491},{0.624007, -0.265876, 0.734796}, -{0.409136, -0.662313, 0.627655},{0.445411, -0.650182, 0.615526},{0.31458, -0.765384, 0.56145}, -{0.849667, -0.433274, 0.300565},{0.816138, -0.51399, 0.264069},{0.918661, -0.300741, 0.256159}, -{0.910694, -0.35184, 0.216437},{0.853339, -0.453024, 0.258032},{0.921765, -0.376911, -0.0910378}, -{0.715003, -0.436717, -0.545938},{0.621854, -0.56999, -0.537037},{0.624665, -0.569432, -0.53436}, -{0.774832, -0.460815, -0.432764},{0.341366, -0.933137, 0.1128},{0.231637, -0.928159, 0.291316}, -{0.361349, -0.840156, -0.404432},{-0.0338424, -0.975414, -0.217767},{0.1775, -0.924191, -0.338178}, -{0.34746, -0.840154, -0.416429},{0.454658, -0.84617, -0.277996},{0.422169, -0.819544, -0.387454}, -{0.707892, -0.661494, -0.247617},{0.623741, -0.655536, -0.4257},{0.802222, -0.54216, -0.250005}, -{0.78433, -0.501428, -0.365235},{0.86367, -0.480751, -0.151499},{0.788122, -0.611174, 0.073002}, -{0.765777, -0.566054, 0.305235},{0.823679, -0.529652, 0.202539},{0.56034, -0.687978, 0.4612}, -{0.51691, -0.747974, 0.416339},{0.382841, -0.822727, 0.420182},{0.38099, -0.795981, 0.470384}, -{0.582043, -0.714302, 0.388584},{0.914053, -0.387134, 0.120975},{0.85754, -0.501725, 0.113568}, -{0.651321, -0.747094, 0.132783},{0.451688, -0.87571, 0.170619},{0.743327, -0.616865, 0.258734}, -{0.923842, -0.252524, 0.28766},{0.842955, -0.41534, 0.341936},{0.924753, -0.310324, 0.220298}, -{0.897888, -0.220893, 0.380793},{0.944496, -0.23874, 0.225679},{0.805719, -0.260089, 0.532138}, -{0.863186, -0.339809, -0.373417},{0.689858, -0.419248, -0.590192},{0.801257, -0.115027, -0.587159}, -{0.74902, -0.611687, 0.254576},{0.660063, -0.663575, 0.352115},{0.656186, -0.678964, 0.329285}, -{0.649105, -0.754651, 0.0957276},{0.751431, -0.645607, -0.136169},{0.668579, -0.736547, -0.10247}, -{0.591109, -0.75917, 0.27249},{0.614646, -0.755492, -0.226808},{0.663605, -0.544789, -0.512673}, -{0.470876, -0.620339, 0.62726},{0.609384, -0.561506, 0.559787},{0.829197, -0.361003, 0.426743}, -{0.805566, -0.438566, 0.398401},{0.828509, -0.391222, 0.400647},{0.524036, -0.688124, 0.501868}, -{0.606937, -0.475749, -0.636624},{0.828344, -0.483055, -0.283731},{0.789551, -0.537867, -0.295481}, -{0.817378, -0.510371, -0.267235},{0.766699, -0.571075, -0.293336},{0.69986, -0.567855, -0.433285}, -{0.459905, -0.705019, -0.539848},{0.567305, -0.454808, -0.686524},{0.503006, -0.560716, -0.65771}, -{0.674924, -0.471443, -0.567643},{0.388663, -0.812261, -0.43494},{0.591096, -0.666781, -0.453882}, -{0.598151, -0.797473, 0.079072},{0.13697, -0.908961, -0.393737},{0.270638, -0.960037, 0.0713018}, -{0.0735647, -0.923874, 0.37556},{0.0290081, -0.917232, 0.397295},{0.380773, -0.863632, 0.330381}, -{0.569613, -0.765046, 0.30041},{0.679429, -0.67734, 0.282112},{0.753698, -0.635435, 0.167813}, -{0.584434, -0.81106, -0.024858},{0.76412, -0.643387, -0.0466274},{0.23386, -0.914594, 0.329888}, -{0.225783, -0.900612, -0.371375},{0.767506, -0.558783, 0.314159},{0.763628, -0.642974, 0.0587918}, -{0.0926679, -0.799211, -0.593864},{0.215414, -0.846969, -0.486045},{0.274782, -0.749427, -0.602373}, -{0.487849, -0.789001, -0.373472},{0.348666, -0.857005, -0.379439},{0.624288, -0.739893, -0.250644}, -{0.709683, -0.689885, -0.142858},{0.584196, -0.809383, -0.0601197},{0.43716, -0.895401, -0.0845524}, -{0.232516, -0.969818, -0.0734126},{0.294443, -0.946238, 0.133928},{0.488417, -0.862019, 0.135543}, -{0.624279, -0.775634, 0.0931067},{0.714001, -0.699448, 0.0312114},{0.830263, -0.542886, -0.126245}, -{0.798836, -0.5863, -0.134587},{0.841905, -0.528472, -0.10915},{0.927469, -0.371869, -0.0389304}, -{0.884396, -0.43335, -0.17335},{0.816303, -0.53092, -0.227539},{0.840914, -0.465251, -0.276413}, -{0.832573, -0.483116, -0.270962},{0.83747, -0.481863, -0.257782},{0.841636, -0.468362, -0.268862}, -{0.83038, -0.474839, -0.291543},{0.801153, -0.399291, -0.445782},{0.707022, -0.27507, -0.651503}, -{0.654272, -0.336121, -0.677459},{0.52269, -0.200702, -0.828561},{0.664579, -0.310645, -0.679584}, -{0.417023, -0.197468, -0.887186},{0.785597, -0.444629, -0.430281},{0.828569, -0.519048, -0.209911}, -{0.835037, -0.402666, -0.374932},{0.777287, -0.587223, -0.225819},{0.26732, -0.912463, -0.309761}, -{0.172765, -0.654482, -0.736074},{0.110771, -0.330093, -0.937426},{0.353687, -0.327582, -0.876125}, -{0.453273, -0.674334, -0.582939},{0.492896, -0.863008, -0.110777},{0.662357, -0.723987, -0.192679}, -{0.624803, -0.514211, -0.587544},{0.156434, -0.179064, -0.971321},{0.150117, -0.189905, -0.970258}, -{0.281753, -0.178067, -0.942819},{0.256982, -0.181656, -0.94919},{0.940752, -0.33189, -0.0695256}, -{0.88295, -0.469076, -0.0191461},{0.930368, -0.350438, 0.107748},{0.888408, -0.37068, 0.270791}, -{0.664591, -0.746989, 0.0180683},{0.744024, -0.508835, 0.433031},{0.903612, -0.39329, 0.169729}, -{0.854724, -0.468037, 0.224475},{0.837051, -0.494926, 0.233225},{0.761458, -0.597303, 0.251815}, -{0.745746, -0.565203, 0.352715},{0.4608, -0.887491, 0.00483841},{0.571511, -0.728248, 0.378194}, -{0.607898, -0.648542, 0.458097},{0.620049, -0.717175, 0.318119},{0.725479, -0.602636, 0.33243}, -{0.641451, -0.672823, 0.368578},{0.803061, -0.521387, 0.288527},{0.722356, -0.545386, 0.425153}, -{0.635353, -0.613878, 0.468487},{0.479295, -0.811954, 0.333177},{0.661515, -0.522284, 0.538161}, -{0.573405, -0.534753, 0.620682},{0.39978, -0.411405, 0.819098},{0.415027, -0.362971, 0.834269}, -{0.508203, -0.506784, 0.696347},{0.265104, -0.414504, 0.870578},{0.347009, -0.310028, 0.885137}, -{0.290459, -0.332304, 0.897334},{0.245608, -0.272773, 0.9302},{0.132495, -0.254239, 0.958023}, -{0.127065, -0.358715, 0.924758},{0.179434, -0.567561, 0.803541},{0.380897, -0.575571, 0.723627}, -{0.527195, -0.66472, 0.529352},{0.446801, -0.797967, 0.404497},{0.411305, -0.781925, 0.468424}, -{0.385759, -0.862342, 0.327957},{0.362719, -0.927128, 0.0941715},{0.250393, -0.966572, -0.0551604}, -{0.186457, -0.969054, 0.161767},{0.115126, -0.99326, 0.0134715},{0.0874802, -0.975042, 0.204061}, -{0.222141, -0.906262, 0.359643},{0.0561565, -0.901977, 0.428117},{0.0787259, -0.898121, 0.432644}, -{0.1142, -0.942658, 0.313616},{0.131356, -0.942377, 0.307688},{0.167886, -0.755912, 0.632781}, -{0.173902, -0.879794, 0.442404},{0.35749, -0.800645, 0.480801},{0.294308, -0.903121, 0.312659}, -{0.253163, -0.892896, 0.372351},{0.17347, -0.857544, 0.484278},{-0.0757568, -0.978436, -0.192153}, -{0.747236, -0.610472, -0.262608},{0.718274, -0.687115, -0.109342},{0.713624, -0.692815, -0.103677}, -{0.454722, -0.888939, -0.0549079},{0.405268, -0.909355, -0.093972},{0.0393733, -0.998888, -0.0259197}, -{0.0289558, -0.998112, -0.0541624},{-0.122061, -0.992232, -0.0239979},{-0.747724, -0.221519, -0.62597}, -{-0.364423, -0.814637, -0.45118},{-0.50591, -0.741525, -0.440676},{-0.486892, -0.739799, -0.464364}, -{-0.223409, -0.87127, -0.43701},{-0.0084065, -0.939114, -0.343502},{0.129522, -0.946177, -0.296602}, -{0.277692, -0.936688, -0.213313},{0.33294, -0.919698, -0.208101},{0.354961, -0.920425, -0.163769}, -{-0.311673, -0.934987, -0.169288},{-0.295124, -0.933917, -0.201745},{-0.252945, -0.945166, -0.206589}, -{-0.0679037, -0.944385, -0.321756},{-0.0388748, -0.946409, -0.320622},{0.227365, -0.861564, -0.453885}, -{0.35972, -0.815078, -0.454146},{0.5967, -0.591085, -0.542741},{0.479351, -0.770859, -0.419522}, -{0.747723, -0.221516, -0.625973},{0.0791356, 0.788253, 0.610242},{0.0478053, 0.902264, 0.428526}, -{0.175119, 0.532711, 0.827981},{0.481044, 0.24705, 0.841168},{0.639205, 0.140618, 0.756071}, -{0.684795, 0.0511888, 0.726936},{0.765029, 0.0324948, 0.643176},{0.830765, 0.0167793, 0.55637}, -{0.912871, 0.387004, -0.129978},{0.785802, 0.586295, -0.196911},{0.611315, 0.750206, -0.251962}, -{-0.71794, 0.0382936, 0.695051},{-0.830766, 0.0167803, 0.556369},{-0.742164, 0.0374156, 0.669173}, -{-0.6528, 0.0485878, 0.75597},{-0.150987, 0.528618, 0.835324},{-0.116243, 0.681696, 0.722342}, -{-0.464006, 0.2329, 0.854667},{-0.0587127, 0.793589, 0.605615},{-0.0344926, 0.907858, 0.417856}, -{-0.793461, 0.57695, -0.193773},{-0.63088, 0.735506, -0.247026},{-0.912871, 0.387004, -0.129978}, -{-0.45388, -0.682342, -0.573063},{-0.50651, -0.66027, -0.554519},{-0.488508, -0.662074, -0.568346}, -{-0.431235, -0.701918, -0.566876},{-0.397616, -0.731501, -0.553903},{-0.374918, -0.743146, -0.55423}, -{-0.300544, -0.764968, -0.569646},{-0.279219, -0.777606, -0.563352},{-0.166736, -0.813821, -0.556681}, -{-0.0411986, -0.826303, -0.561717},{0.0516586, -0.817722, -0.57329},{-0.0145019, -0.820442, -0.571546}, -{-5.91482e-05, -0.828223, -0.560399},{0.115718, -0.81337, -0.570122},{0.285503, -0.761253, -0.582222}, -{0.320216, -0.745381, -0.584696},{0.356785, -0.74091, -0.568997},{0.382445, -0.73484, -0.56013}, -{0.457103, -0.688275, -0.563325},{0.451517, -0.684089, -0.572848},{0.493987, -0.661223, -0.56459}, -{0.507059, -0.659586, -0.554831},{-0.661296, -0.606156, 0.441885},{-0.64427, -0.62539, 0.440231}, -{-0.698814, -0.575222, 0.425181},{-0.660193, -0.619895, 0.424118},{-0.538153, -0.683186, 0.493608}, -{-0.533918, -0.611364, 0.584094},{-0.58478, -0.761404, 0.279814},{-0.27925, -0.855024, 0.436983}, -{-0.291199, -0.725103, 0.624042},{-0.246496, -0.937821, 0.244401},{-0.0854134, -0.870025, 0.485552}, -{-0.044095, -0.776621, 0.628423},{-0.090252, -0.952923, 0.28947},{-0.00305904, -0.870387, 0.492359}, -{-0.0258982, -0.723835, 0.689487},{0.0308592, -0.965536, 0.258435},{0.0841051, -0.883264, 0.461271}, -{0.0450932, -0.745049, 0.665484},{0.0962614, -0.95454, 0.282112},{0.325467, -0.851067, 0.412014}, -{0.213178, -0.762191, 0.611245},{0.331889, -0.91808, 0.216747},{0.593694, -0.671407, 0.443553}, -{0.450167, -0.642781, 0.619824},{0.554443, -0.798252, 0.235344},{0.707397, -0.577409, 0.407662}, -{0.650872, -0.570267, 0.50116},{0.70501, -0.617847, 0.348175},{0.72034, -0.562219, 0.406227} -}; + {-0.617258, -0.265442, 0.740631}, {-0.78174, -0.349396, 0.516531}, + {-0.876403, -0.187631, 0.443523}, {-0.392622, -0.66733, 0.632865}, + {-0.313203, -0.686293, 0.656434}, {-0.00361883, -0.700253, 0.713886}, + {0.0420161, -0.799516, 0.599174}, {-0.40127, -0.74323, 0.535342}, + {-0.815972, -0.462599, 0.346687}, {-0.617717, -0.683678, 0.388601}, + {-0.913548, -0.308706, 0.26482}, {-0.898646, -0.378167, 0.222316}, + {-0.837402, -0.470289, 0.278544}, {-0.931079, -0.205564, 0.301388}, + {-0.917233, -0.387337, -0.0930287}, {-0.619272, -0.570823, -0.539132}, + {-0.715003, -0.436717, -0.545939}, {-0.769001, -0.466214, -0.437358}, + {-0.696899, -0.546775, -0.464078}, {-0.87295, -0.477816, -0.0982331}, + {-0.28788, -0.921155, 0.261913}, {-0.275797, -0.960154, 0.0451773}, + {-0.0414261, -0.928196, 0.369778}, {-0.353936, -0.843672, -0.403667}, + {-0.184309, -0.751164, -0.633863}, {0.0475635, -0.976025, -0.2124}, + {-0.351521, -0.852575, -0.386715}, {-0.430588, -0.871166, -0.235933}, + {-0.509535, -0.769058, -0.385907}, {-0.657016, -0.685816, -0.313028}, + {-0.704687, -0.607631, -0.366335}, {-0.779863, -0.555723, -0.28807}, + {-0.835802, -0.476563, -0.272622}, {-0.866963, -0.480579, -0.131978}, + {-0.784759, -0.614786, 0.0786812}, {-0.81366, -0.540176, 0.214866}, + {-0.758468, -0.572999, 0.310481}, {-0.555739, -0.691157, 0.462012}, + {-0.498867, -0.757042, 0.421922}, {-0.371277, -0.825802, 0.424505}, + {-0.36783, -0.801439, 0.47159}, {-0.574546, -0.717391, 0.394015}, + {-0.905637, -0.404294, 0.127934}, {-0.852918, -0.507032, 0.124293}, + {-0.647028, -0.748724, 0.144109}, {-0.441598, -0.879427, 0.177764}, + {-0.734821, -0.622713, 0.268824}, {-0.912944, -0.281633, 0.295325}, + {-0.926242, -0.295736, 0.233702}, {-0.861139, -0.388918, 0.327388}, + {-0.888772, -0.207712, 0.408582}, {-0.93923, -0.249894, 0.235373}, + {-0.858942, -0.275798, 0.431456}, {-0.817378, -0.368817, -0.44257}, + {-0.801257, -0.115027, -0.587159}, {-0.732909, -0.412067, -0.541337}, + {-0.649453, -0.665807, 0.367302}, {-0.730957, -0.621653, 0.281511}, + {-0.64689, -0.682982, 0.339218}, {-0.638983, -0.762274, 0.10315}, + {-0.667779, -0.738635, -0.0921354}, {-0.746946, -0.652356, -0.128463}, + {-0.5818, -0.762069, 0.284181}, {-0.553142, -0.796434, -0.244393}, + {-0.684545, -0.488, -0.541529}, {-0.508918, -0.610183, 0.60719}, + {-0.0489265, -0.676034, 0.735244}, {-0.465952, -0.628122, 0.623178}, + {0.0472658, -0.752373, 0.65704}, {-0.841097, -0.341672, 0.419305}, + {-0.792787, -0.398602, 0.46109}, {-0.748569, -0.659751, -0.0661367}, + {-0.504802, -0.721122, 0.474508}, {-0.639641, -0.384767, -0.665442}, + {-0.829025, -0.489687, -0.270043}, {-0.836672, -0.486351, -0.251877}, + {-0.801163, -0.510555, -0.312203}, {-0.834725, -0.461526, -0.300379}, + {-0.291522, -0.804713, -0.517158}, {-0.44811, -0.67301, -0.588434}, + {-0.508016, -0.652204, -0.562628}, {-0.545984, -0.586857, -0.597913}, + {-0.493538, -0.61943, -0.610514}, {-0.390347, -0.791894, -0.46961}, + {-0.596257, -0.662142, -0.453922}, {-0.466572, -0.79986, 0.377536}, + {0.190036, -0.838769, 0.510248}, {-0.496608, -0.863239, -0.0905465}, + {-0.0583197, -0.82638, -0.560085}, {0.0972804, -0.903582, -0.417223}, + {0.00449633, -0.781011, -0.624501}, {-0.0830325, -0.903347, -0.420796}, + {-0.151122, -0.987776, 0.0382124}, {-0.232497, -0.968684, 0.0871632}, + {-0.088527, -0.912191, 0.400088}, {0.0222154, -0.918755, 0.394203}, + {-0.0112384, -0.918665, 0.394878}, {-0.278235, -0.895706, 0.346836}, + {-0.562816, -0.77036, 0.299639}, {-0.669247, -0.683012, 0.292579}, + {-0.74378, -0.644853, 0.17594}, {-0.579577, -0.814631, -0.0216126}, + {-0.755464, -0.653803, -0.0426144}, {-0.233861, -0.914594, 0.329888}, + {-0.225782, -0.900613, -0.371375}, {-0.756949, -0.652254, 0.0399106}, + {-0.761632, -0.566077, 0.315394}, {0.0, -0.829005, -0.559241}, + {-0.0941706, -0.799439, -0.593321}, {-0.0209907, -0.956621, -0.290578}, + {-0.228631, -0.855488, -0.464615}, {-0.281067, -0.747786, -0.601513}, + {-0.48714, -0.786955, -0.378677}, {-0.397781, -0.837273, -0.375158}, + {-0.637666, -0.735249, -0.229764}, {-0.704007, -0.698655, -0.127498}, + {-0.567297, -0.810598, -0.145276}, {-0.414329, -0.905828, -0.0883625}, + {-0.285415, -0.958382, 0.0065404}, {-0.280812, -0.94687, 0.156787}, + {0.0201945, -0.991659, 0.127301}, {-0.444322, -0.88464, 0.141385}, + {-0.595259, -0.794994, 0.116837}, {-0.725363, -0.688227, 0.0138487}, + {-0.824385, -0.547202, -0.144774}, {-0.79484, -0.594072, -0.123723}, + {-0.842585, -0.530194, -0.0945766}, {-0.925218, -0.378386, -0.0282201}, + {-0.886118, -0.435693, -0.158009}, {-0.820206, -0.526702, -0.223266}, + {-0.849571, -0.4593, -0.259369}, {-0.836279, -0.479526, -0.265879}, + {-0.83314, -0.488901, -0.25856}, {-0.82904, -0.490977, -0.267646}, + {-0.841809, -0.471393, -0.262955}, {-0.659415, -0.355956, -0.662168}, + {-0.675727, -0.266966, -0.687111}, {-0.812794, -0.389938, -0.432798}, + {-0.495016, -0.200544, -0.845424}, {-0.683747, -0.294463, -0.667669}, + {-0.451368, -0.223791, -0.86382}, {-0.791228, -0.451898, -0.412003}, + {-0.826905, -0.524712, -0.202251}, {-0.830356, -0.490117, -0.265131}, + {-0.771985, -0.610672, -0.176406}, {-0.281292, -0.938959, -0.19807}, + {0.0528991, -0.99578, 0.0749901}, {-0.162494, -0.628418, -0.760715}, + {0.00113543, -0.813339, -0.581788}, {0.00874717, -0.607383, -0.794361}, + {0.0171233, -0.315803, -0.94867}, {-0.148415, -0.264319, -0.952947}, + {-0.369791, -0.363335, -0.855127}, {-0.457739, -0.675978, -0.57752}, + {-0.504461, -0.852615, -0.136258}, {-0.654036, -0.733626, -0.184473}, + {-0.63544, -0.480484, -0.604442}, {0.00534621, -0.183511, -0.983003}, + {-0.149748, -0.172462, -0.973567}, {-0.0487523, -0.182016, -0.982086}, + {-0.176473, -0.181106, -0.967501}, {-0.276192, -0.176149, -0.944822}, + {-0.309419, -0.179765, -0.93378}, {-0.926717, -0.362956, -0.0972538}, + {-0.715187, -0.590702, -0.373602}, {-0.934949, -0.344579, 0.0844686}, + {-0.886194, -0.377255, 0.268957}, {-0.882874, -0.339461, 0.324499}, + {-0.724306, -0.556794, 0.406647}, {-0.694368, -0.594899, 0.404905}, + {-0.89851, -0.387601, 0.206024}, {-0.836716, -0.479611, 0.264347}, + {-0.813134, -0.530495, 0.239556}, {-0.735221, -0.568519, 0.369102}, + {-0.721289, -0.63864, 0.268104}, {-0.548249, -0.79382, -0.263196}, + {-0.50025, -0.860456, 0.0967749}, {-0.566133, -0.731919, 0.379193}, + {-0.569417, -0.6968, 0.436158}, {-0.601395, -0.724978, 0.335755}, + {-0.620227, -0.707055, 0.339693}, {-0.738127, -0.58567, 0.334902}, + {-0.790837, -0.511147, 0.336609}, {-0.727633, -0.511907, 0.45662}, + {-0.619302, -0.611804, 0.492099}, {-0.462961, -0.81736, 0.342912}, + {-0.655225, -0.522961, 0.545153}, {-0.500154, -0.56028, 0.660252}, + {-0.363982, -0.412211, 0.835224}, {-0.331048, -0.549598, 0.767039}, + {-0.497904, -0.502297, 0.706958}, {-0.301391, -0.353697, 0.885473}, + {-0.294971, -0.326452, 0.89801}, {-0.340904, -0.357128, 0.869623}, + {-0.262921, -0.27268, 0.925483}, {-0.152911, -0.365596, 0.918127}, + {-0.0627082, -0.23129, 0.970862}, {-0.0142343, -0.361908, 0.932105}, + {0.0229022, -0.223247, 0.974493}, {-0.13005, -0.573671, 0.808696}, + {0.0154897, -0.643634, 0.765177}, {-0.338543, -0.580818, 0.740297}, + {-0.500555, -0.692847, 0.519045}, {-0.406601, -0.809554, 0.423435}, + {-0.384567, -0.79993, 0.460673}, {-0.40446, -0.849816, 0.337972}, + {-0.373225, -0.921929, 0.103685}, {-0.211716, -0.976661, -0.0362004}, + {-0.233625, -0.958946, 0.160757}, {-0.536151, -0.49527, -0.683556}, + {-0.128299, -0.991665, 0.0118411}, {-0.00909901, -0.996933, 0.0777355}, + {-0.0708222, -0.977629, 0.198052}, {0.0173543, -0.974417, 0.224075}, + {-0.163346, -0.895824, 0.413301}, {-0.0294524, -0.900433, 0.433997}, + {-0.00885682, -0.898802, 0.438265}, {-0.0623815, -0.887307, 0.456941}, + {0.00210282, -0.907103, 0.420902}, {-0.124547, -0.937855, 0.323906}, + {0.00511924, -0.945417, 0.325822}, {-0.11412, -0.946355, 0.302305}, + {0.00780987, -0.949634, 0.313265}, {-0.158107, -0.750921, 0.641186}, + {0.0148427, -0.864096, 0.503109}, {-0.148108, -0.891512, 0.428102}, + {-0.349961, -0.802187, 0.483759}, {-0.272668, -0.91094, 0.309581}, + {-0.243777, -0.896929, 0.368905}, {-0.19127, -0.843408, 0.502075}, + {0.0757574, -0.978436, -0.192154}, {-0.747236, -0.610472, -0.262607}, + {-0.685706, -0.715288, -0.134801}, {-0.739627, -0.668704, -0.0760731}, + {-0.422988, -0.903717, -0.0661576}, {-0.374275, -0.919054, -0.123525}, + {-0.0416223, -0.999112, -0.00659359}, {-0.0516061, -0.998629, 0.00881155}, + {-0.088891, -0.994828, -0.0491407}, {0.135923, -0.990655, -0.011341}, + {0.876403, -0.187631, 0.443523}, {0.787758, -0.344726, 0.510491}, + {0.624007, -0.265876, 0.734796}, {0.409136, -0.662313, 0.627655}, + {0.445411, -0.650182, 0.615526}, {0.31458, -0.765384, 0.56145}, + {0.849667, -0.433274, 0.300565}, {0.816138, -0.51399, 0.264069}, + {0.918661, -0.300741, 0.256159}, {0.910694, -0.35184, 0.216437}, + {0.853339, -0.453024, 0.258032}, {0.921765, -0.376911, -0.0910378}, + {0.715003, -0.436717, -0.545938}, {0.621854, -0.56999, -0.537037}, + {0.624665, -0.569432, -0.53436}, {0.774832, -0.460815, -0.432764}, + {0.341366, -0.933137, 0.1128}, {0.231637, -0.928159, 0.291316}, + {0.361349, -0.840156, -0.404432}, {-0.0338424, -0.975414, -0.217767}, + {0.1775, -0.924191, -0.338178}, {0.34746, -0.840154, -0.416429}, + {0.454658, -0.84617, -0.277996}, {0.422169, -0.819544, -0.387454}, + {0.707892, -0.661494, -0.247617}, {0.623741, -0.655536, -0.4257}, + {0.802222, -0.54216, -0.250005}, {0.78433, -0.501428, -0.365235}, + {0.86367, -0.480751, -0.151499}, {0.788122, -0.611174, 0.073002}, + {0.765777, -0.566054, 0.305235}, {0.823679, -0.529652, 0.202539}, + {0.56034, -0.687978, 0.4612}, {0.51691, -0.747974, 0.416339}, + {0.382841, -0.822727, 0.420182}, {0.38099, -0.795981, 0.470384}, + {0.582043, -0.714302, 0.388584}, {0.914053, -0.387134, 0.120975}, + {0.85754, -0.501725, 0.113568}, {0.651321, -0.747094, 0.132783}, + {0.451688, -0.87571, 0.170619}, {0.743327, -0.616865, 0.258734}, + {0.923842, -0.252524, 0.28766}, {0.842955, -0.41534, 0.341936}, + {0.924753, -0.310324, 0.220298}, {0.897888, -0.220893, 0.380793}, + {0.944496, -0.23874, 0.225679}, {0.805719, -0.260089, 0.532138}, + {0.863186, -0.339809, -0.373417}, {0.689858, -0.419248, -0.590192}, + {0.801257, -0.115027, -0.587159}, {0.74902, -0.611687, 0.254576}, + {0.660063, -0.663575, 0.352115}, {0.656186, -0.678964, 0.329285}, + {0.649105, -0.754651, 0.0957276}, {0.751431, -0.645607, -0.136169}, + {0.668579, -0.736547, -0.10247}, {0.591109, -0.75917, 0.27249}, + {0.614646, -0.755492, -0.226808}, {0.663605, -0.544789, -0.512673}, + {0.470876, -0.620339, 0.62726}, {0.609384, -0.561506, 0.559787}, + {0.829197, -0.361003, 0.426743}, {0.805566, -0.438566, 0.398401}, + {0.828509, -0.391222, 0.400647}, {0.524036, -0.688124, 0.501868}, + {0.606937, -0.475749, -0.636624}, {0.828344, -0.483055, -0.283731}, + {0.789551, -0.537867, -0.295481}, {0.817378, -0.510371, -0.267235}, + {0.766699, -0.571075, -0.293336}, {0.69986, -0.567855, -0.433285}, + {0.459905, -0.705019, -0.539848}, {0.567305, -0.454808, -0.686524}, + {0.503006, -0.560716, -0.65771}, {0.674924, -0.471443, -0.567643}, + {0.388663, -0.812261, -0.43494}, {0.591096, -0.666781, -0.453882}, + {0.598151, -0.797473, 0.079072}, {0.13697, -0.908961, -0.393737}, + {0.270638, -0.960037, 0.0713018}, {0.0735647, -0.923874, 0.37556}, + {0.0290081, -0.917232, 0.397295}, {0.380773, -0.863632, 0.330381}, + {0.569613, -0.765046, 0.30041}, {0.679429, -0.67734, 0.282112}, + {0.753698, -0.635435, 0.167813}, {0.584434, -0.81106, -0.024858}, + {0.76412, -0.643387, -0.0466274}, {0.23386, -0.914594, 0.329888}, + {0.225783, -0.900612, -0.371375}, {0.767506, -0.558783, 0.314159}, + {0.763628, -0.642974, 0.0587918}, {0.0926679, -0.799211, -0.593864}, + {0.215414, -0.846969, -0.486045}, {0.274782, -0.749427, -0.602373}, + {0.487849, -0.789001, -0.373472}, {0.348666, -0.857005, -0.379439}, + {0.624288, -0.739893, -0.250644}, {0.709683, -0.689885, -0.142858}, + {0.584196, -0.809383, -0.0601197}, {0.43716, -0.895401, -0.0845524}, + {0.232516, -0.969818, -0.0734126}, {0.294443, -0.946238, 0.133928}, + {0.488417, -0.862019, 0.135543}, {0.624279, -0.775634, 0.0931067}, + {0.714001, -0.699448, 0.0312114}, {0.830263, -0.542886, -0.126245}, + {0.798836, -0.5863, -0.134587}, {0.841905, -0.528472, -0.10915}, + {0.927469, -0.371869, -0.0389304}, {0.884396, -0.43335, -0.17335}, + {0.816303, -0.53092, -0.227539}, {0.840914, -0.465251, -0.276413}, + {0.832573, -0.483116, -0.270962}, {0.83747, -0.481863, -0.257782}, + {0.841636, -0.468362, -0.268862}, {0.83038, -0.474839, -0.291543}, + {0.801153, -0.399291, -0.445782}, {0.707022, -0.27507, -0.651503}, + {0.654272, -0.336121, -0.677459}, {0.52269, -0.200702, -0.828561}, + {0.664579, -0.310645, -0.679584}, {0.417023, -0.197468, -0.887186}, + {0.785597, -0.444629, -0.430281}, {0.828569, -0.519048, -0.209911}, + {0.835037, -0.402666, -0.374932}, {0.777287, -0.587223, -0.225819}, + {0.26732, -0.912463, -0.309761}, {0.172765, -0.654482, -0.736074}, + {0.110771, -0.330093, -0.937426}, {0.353687, -0.327582, -0.876125}, + {0.453273, -0.674334, -0.582939}, {0.492896, -0.863008, -0.110777}, + {0.662357, -0.723987, -0.192679}, {0.624803, -0.514211, -0.587544}, + {0.156434, -0.179064, -0.971321}, {0.150117, -0.189905, -0.970258}, + {0.281753, -0.178067, -0.942819}, {0.256982, -0.181656, -0.94919}, + {0.940752, -0.33189, -0.0695256}, {0.88295, -0.469076, -0.0191461}, + {0.930368, -0.350438, 0.107748}, {0.888408, -0.37068, 0.270791}, + {0.664591, -0.746989, 0.0180683}, {0.744024, -0.508835, 0.433031}, + {0.903612, -0.39329, 0.169729}, {0.854724, -0.468037, 0.224475}, + {0.837051, -0.494926, 0.233225}, {0.761458, -0.597303, 0.251815}, + {0.745746, -0.565203, 0.352715}, {0.4608, -0.887491, 0.00483841}, + {0.571511, -0.728248, 0.378194}, {0.607898, -0.648542, 0.458097}, + {0.620049, -0.717175, 0.318119}, {0.725479, -0.602636, 0.33243}, + {0.641451, -0.672823, 0.368578}, {0.803061, -0.521387, 0.288527}, + {0.722356, -0.545386, 0.425153}, {0.635353, -0.613878, 0.468487}, + {0.479295, -0.811954, 0.333177}, {0.661515, -0.522284, 0.538161}, + {0.573405, -0.534753, 0.620682}, {0.39978, -0.411405, 0.819098}, + {0.415027, -0.362971, 0.834269}, {0.508203, -0.506784, 0.696347}, + {0.265104, -0.414504, 0.870578}, {0.347009, -0.310028, 0.885137}, + {0.290459, -0.332304, 0.897334}, {0.245608, -0.272773, 0.9302}, + {0.132495, -0.254239, 0.958023}, {0.127065, -0.358715, 0.924758}, + {0.179434, -0.567561, 0.803541}, {0.380897, -0.575571, 0.723627}, + {0.527195, -0.66472, 0.529352}, {0.446801, -0.797967, 0.404497}, + {0.411305, -0.781925, 0.468424}, {0.385759, -0.862342, 0.327957}, + {0.362719, -0.927128, 0.0941715}, {0.250393, -0.966572, -0.0551604}, + {0.186457, -0.969054, 0.161767}, {0.115126, -0.99326, 0.0134715}, + {0.0874802, -0.975042, 0.204061}, {0.222141, -0.906262, 0.359643}, + {0.0561565, -0.901977, 0.428117}, {0.0787259, -0.898121, 0.432644}, + {0.1142, -0.942658, 0.313616}, {0.131356, -0.942377, 0.307688}, + {0.167886, -0.755912, 0.632781}, {0.173902, -0.879794, 0.442404}, + {0.35749, -0.800645, 0.480801}, {0.294308, -0.903121, 0.312659}, + {0.253163, -0.892896, 0.372351}, {0.17347, -0.857544, 0.484278}, + {-0.0757568, -0.978436, -0.192153}, {0.747236, -0.610472, -0.262608}, + {0.718274, -0.687115, -0.109342}, {0.713624, -0.692815, -0.103677}, + {0.454722, -0.888939, -0.0549079}, {0.405268, -0.909355, -0.093972}, + {0.0393733, -0.998888, -0.0259197}, {0.0289558, -0.998112, -0.0541624}, + {-0.122061, -0.992232, -0.0239979}, {-0.747724, -0.221519, -0.62597}, + {-0.364423, -0.814637, -0.45118}, {-0.50591, -0.741525, -0.440676}, + {-0.486892, -0.739799, -0.464364}, {-0.223409, -0.87127, -0.43701}, + {-0.0084065, -0.939114, -0.343502}, {0.129522, -0.946177, -0.296602}, + {0.277692, -0.936688, -0.213313}, {0.33294, -0.919698, -0.208101}, + {0.354961, -0.920425, -0.163769}, {-0.311673, -0.934987, -0.169288}, + {-0.295124, -0.933917, -0.201745}, {-0.252945, -0.945166, -0.206589}, + {-0.0679037, -0.944385, -0.321756}, {-0.0388748, -0.946409, -0.320622}, + {0.227365, -0.861564, -0.453885}, {0.35972, -0.815078, -0.454146}, + {0.5967, -0.591085, -0.542741}, {0.479351, -0.770859, -0.419522}, + {0.747723, -0.221516, -0.625973}, {0.0791356, 0.788253, 0.610242}, + {0.0478053, 0.902264, 0.428526}, {0.175119, 0.532711, 0.827981}, + {0.481044, 0.24705, 0.841168}, {0.639205, 0.140618, 0.756071}, + {0.684795, 0.0511888, 0.726936}, {0.765029, 0.0324948, 0.643176}, + {0.830765, 0.0167793, 0.55637}, {0.912871, 0.387004, -0.129978}, + {0.785802, 0.586295, -0.196911}, {0.611315, 0.750206, -0.251962}, + {-0.71794, 0.0382936, 0.695051}, {-0.830766, 0.0167803, 0.556369}, + {-0.742164, 0.0374156, 0.669173}, {-0.6528, 0.0485878, 0.75597}, + {-0.150987, 0.528618, 0.835324}, {-0.116243, 0.681696, 0.722342}, + {-0.464006, 0.2329, 0.854667}, {-0.0587127, 0.793589, 0.605615}, + {-0.0344926, 0.907858, 0.417856}, {-0.793461, 0.57695, -0.193773}, + {-0.63088, 0.735506, -0.247026}, {-0.912871, 0.387004, -0.129978}, + {-0.45388, -0.682342, -0.573063}, {-0.50651, -0.66027, -0.554519}, + {-0.488508, -0.662074, -0.568346}, {-0.431235, -0.701918, -0.566876}, + {-0.397616, -0.731501, -0.553903}, {-0.374918, -0.743146, -0.55423}, + {-0.300544, -0.764968, -0.569646}, {-0.279219, -0.777606, -0.563352}, + {-0.166736, -0.813821, -0.556681}, {-0.0411986, -0.826303, -0.561717}, + {0.0516586, -0.817722, -0.57329}, {-0.0145019, -0.820442, -0.571546}, + {-5.91482e-05, -0.828223, -0.560399}, {0.115718, -0.81337, -0.570122}, + {0.285503, -0.761253, -0.582222}, {0.320216, -0.745381, -0.584696}, + {0.356785, -0.74091, -0.568997}, {0.382445, -0.73484, -0.56013}, + {0.457103, -0.688275, -0.563325}, {0.451517, -0.684089, -0.572848}, + {0.493987, -0.661223, -0.56459}, {0.507059, -0.659586, -0.554831}, + {-0.661296, -0.606156, 0.441885}, {-0.64427, -0.62539, 0.440231}, + {-0.698814, -0.575222, 0.425181}, {-0.660193, -0.619895, 0.424118}, + {-0.538153, -0.683186, 0.493608}, {-0.533918, -0.611364, 0.584094}, + {-0.58478, -0.761404, 0.279814}, {-0.27925, -0.855024, 0.436983}, + {-0.291199, -0.725103, 0.624042}, {-0.246496, -0.937821, 0.244401}, + {-0.0854134, -0.870025, 0.485552}, {-0.044095, -0.776621, 0.628423}, + {-0.090252, -0.952923, 0.28947}, {-0.00305904, -0.870387, 0.492359}, + {-0.0258982, -0.723835, 0.689487}, {0.0308592, -0.965536, 0.258435}, + {0.0841051, -0.883264, 0.461271}, {0.0450932, -0.745049, 0.665484}, + {0.0962614, -0.95454, 0.282112}, {0.325467, -0.851067, 0.412014}, + {0.213178, -0.762191, 0.611245}, {0.331889, -0.91808, 0.216747}, + {0.593694, -0.671407, 0.443553}, {0.450167, -0.642781, 0.619824}, + {0.554443, -0.798252, 0.235344}, {0.707397, -0.577409, 0.407662}, + {0.650872, -0.570267, 0.50116}, {0.70501, -0.617847, 0.348175}, + {0.72034, -0.562219, 0.406227}}; diff --git a/libvisual-plugins/plugins/actor/nebulus/glthreads.c b/libvisual-plugins/plugins/actor/nebulus/glthreads.c index 837ad696a..211063174 100644 --- a/libvisual-plugins/plugins/actor/nebulus/glthreads.c +++ b/libvisual-plugins/plugins/actor/nebulus/glthreads.c @@ -8,43 +8,46 @@ GLfloat xval, xabs; GLfloat speed_xval = 0.3f, old_speed_xval = 0.3f; GLfloat speed_xabs = 0.008f, old_speed_xabs = 0.008f; - -static void -createglthreads(void) -{ +static void createglthreads(void) { int i, j; glcoord p; GLfloat r, g, b; short val_pcm; val_pcm = pcm_data[0]; - if (val_pcm > 10000) val_pcm = 10000; - if (val_pcm < -10000) val_pcm = -10000; + if (val_pcm > 10000) + val_pcm = 10000; + if (val_pcm < -10000) + val_pcm = -10000; xval += speed_xval; xabs += speed_xabs; - p.x = ((GLfloat)point_general->WIDTH/2)/(GLfloat) - (point_general->WIDTH/8)-(fabs(sin(xval)*4)*2)+(sin(xabs)/1.5f); + p.x = ((GLfloat)point_general->WIDTH / 2) / + (GLfloat)(point_general->WIDTH / 8) - + (fabs(sin(xval) * 4) * 2) + (sin(xabs) / 1.5f); p.y = -2.0f; - p.z = (GLfloat)((point_general->HEIGHT/2)+((GLfloat)val_pcm - *(0.11f*point_general->HEIGHT)/1800))/(GLfloat) - (point_general->HEIGHT/6)-3.0f; + p.z = (GLfloat)((point_general->HEIGHT / 2) + + ((GLfloat)val_pcm * (0.11f * point_general->HEIGHT) / 1800)) / + (GLfloat)(point_general->HEIGHT / 6) - + 3.0f; for (i = 0; i < MAXTHREADS; i++) - threads[i][THREADLENGTH-1] = p; + threads[i][THREADLENGTH - 1] = p; for (j = 0; j < MAXTHREADS; j++) { - for (i = 0; i < THREADLENGTH-1; i++) { - threads[j][i].x = (threads[j][i+1].x*2+threads[j][i].x)/2.9f; - threads[j][i].y = (threads[j][i+1].y*(2+(GLfloat)j/1000)+threads[j][i].y)/2.9f; - threads[j][i].z = (threads[j][i+1].z*2+threads[j][i].z)/2.9f; + for (i = 0; i < THREADLENGTH - 1; i++) { + threads[j][i].x = (threads[j][i + 1].x * 2 + threads[j][i].x) / 2.9f; + threads[j][i].y = + (threads[j][i + 1].y * (2 + (GLfloat)j / 1000) + threads[j][i].y) / + 2.9f; + threads[j][i].z = (threads[j][i + 1].z * 2 + threads[j][i].z) / 2.9f; } } - for (i = 0; i < MAXTHREADS-1; i++) { + for (i = 0; i < MAXTHREADS - 1; i++) { glBegin(GL_LINE_STRIP); for (j = 0; j < THREADLENGTH; j++) { - r = 0.8f*(0.3f+sin(-i/60))*(1-(GLfloat)j/THREADLENGTH); - g = 0.8f*(0.3f+sin(-i/60))*(1-(GLfloat)j/THREADLENGTH); - b = 1.1f*(0.3f+sin(-i/60))*(1-(GLfloat)j/THREADLENGTH); - if (j > THREADLENGTH-8) + r = 0.8f * (0.3f + sin(-i / 60)) * (1 - (GLfloat)j / THREADLENGTH); + g = 0.8f * (0.3f + sin(-i / 60)) * (1 - (GLfloat)j / THREADLENGTH); + b = 1.1f * (0.3f + sin(-i / 60)) * (1 - (GLfloat)j / THREADLENGTH); + if (j > THREADLENGTH - 8) glColor3f(0.0f, 0.0f, 0.0f); else glColor3f(r, g, b); @@ -54,10 +57,7 @@ createglthreads(void) } } - -static void -drawglthreads(void) -{ +static void drawglthreads(void) { glPushMatrix(); glTranslatef(0.0f, 0.0f, -7.0f); glRotatef(90.0f, 1.0f, 0.0f, 0.0f); @@ -68,14 +68,11 @@ drawglthreads(void) glBlendFunc(GL_SRC_ALPHA, GL_ONE); } - -static void -render_glthreads(void) -{ +static void render_glthreads(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); - glLineWidth((GLfloat)point_general->WIDTH/160); + glLineWidth((GLfloat)point_general->WIDTH / 160); glDisable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); glBlendFunc(GL_ONE, GL_ONE); @@ -83,10 +80,7 @@ render_glthreads(void) glDisable(GL_NORMALIZE); } - -void -draw_glthreads(void) -{ +void draw_glthreads(void) { speed_xval = old_speed_xval; speed_xabs = old_speed_xabs; speed_xval = reduce_vsync_inv(speed_xval); diff --git a/libvisual-plugins/plugins/actor/nebulus/knot.c b/libvisual-plugins/plugins/actor/nebulus/knot.c index 03a32b582..1d745b9d6 100644 --- a/libvisual-plugins/plugins/actor/nebulus/knot.c +++ b/libvisual-plugins/plugins/actor/nebulus/knot.c @@ -2,25 +2,21 @@ GLfloat knot_time, old_knot_time; -typedef struct -{ +typedef struct { GLfloat r, g, b; } glcolors; -typedef struct -{ +typedef struct { int numfaces, numverts, numsides; - GLuint faces[16*64*4*4]; - glcoord vertices[16*64]; - glcolors colors[16*64]; + GLuint faces[16 * 64 * 4 * 4]; + glcoord vertices[16 * 64]; + glcolors colors[16 * 64]; } tknotobject; tknotobject knotobject; - -static void -initknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat radius2, GLfloat radius3) -{ +static void initknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, + GLfloat radius2, GLfloat radius3) { int count1, count2; GLfloat alpha, beta, distance, mindistance, rotation; GLfloat x, y, z, dx, dy, dz; @@ -31,7 +27,7 @@ initknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat radi knotobject.numverts = 0; alpha = 0; for (count2 = 0; count2 < scaling_factor2; count2++) { - alpha = alpha + 2*PI / scaling_factor2; + alpha = alpha + 2 * PI / scaling_factor2; x = radius2 * cos(2 * alpha) + radius1 * sin(alpha); y = radius2 * sin(2 * alpha) + radius1 * cos(alpha); z = radius2 * cos(3 * alpha); @@ -45,18 +41,28 @@ initknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat radi for (count1 = 0; count1 < scaling_factor1; count1++) { beta = beta + 2 * PI / scaling_factor1; - knotobject.vertices[knotobject.numverts].x = x - radius3 * (cos(beta) * dz - sin(beta) * dx * dy / modulus) / value; - knotobject.vertices[knotobject.numverts].y = y - radius3 * sin(beta) * value / modulus; - knotobject.vertices[knotobject.numverts].z = z + radius3 * (cos(beta) * dx + sin(beta) * dy * dz / modulus) / value; - - - dist = sqrt(knotobject.vertices[knotobject.numverts].x*knotobject.vertices[knotobject.numverts].x + - knotobject.vertices[knotobject.numverts].y*knotobject.vertices[knotobject.numverts].y + - knotobject.vertices[knotobject.numverts].z*knotobject.vertices[knotobject.numverts].z); - - knotobject.colors[knotobject.numverts].r = ((2/dist)+(0.5*sin(beta)+0.4))/2.0; - knotobject.colors[knotobject.numverts].g = ((2/dist)+(0.5*sin(beta)+0.4))/2.0; - knotobject.colors[knotobject.numverts].b = ((2/dist)+(0.5*sin(beta)+0.4))/2.0; + knotobject.vertices[knotobject.numverts].x = + x - + radius3 * (cos(beta) * dz - sin(beta) * dx * dy / modulus) / value; + knotobject.vertices[knotobject.numverts].y = + y - radius3 * sin(beta) * value / modulus; + knotobject.vertices[knotobject.numverts].z = + z + + radius3 * (cos(beta) * dx + sin(beta) * dy * dz / modulus) / value; + + dist = sqrt(knotobject.vertices[knotobject.numverts].x * + knotobject.vertices[knotobject.numverts].x + + knotobject.vertices[knotobject.numverts].y * + knotobject.vertices[knotobject.numverts].y + + knotobject.vertices[knotobject.numverts].z * + knotobject.vertices[knotobject.numverts].z); + + knotobject.colors[knotobject.numverts].r = + ((2 / dist) + (0.5 * sin(beta) + 0.4)) / 2.0; + knotobject.colors[knotobject.numverts].g = + ((2 / dist) + (0.5 * sin(beta) + 0.4)) / 2.0; + knotobject.colors[knotobject.numverts].b = + ((2 / dist) + (0.5 * sin(beta) + 0.4)) / 2.0; knotobject.numverts++; } @@ -67,16 +73,24 @@ initknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat radi index2 = index1 + scaling_factor1; index2 = index2 % knotobject.numverts; rotation = 0; - mindistance = (knotobject.vertices[index1].x - knotobject.vertices[index2].x) * (knotobject.vertices[index1].x - knotobject.vertices[index2].x) + - (knotobject.vertices[index1].y - knotobject.vertices[index2].y) * (knotobject.vertices[index1].y - knotobject.vertices[index2].y) + - (knotobject.vertices[index1].z - knotobject.vertices[index2].z) * (knotobject.vertices[index1].z - knotobject.vertices[index2].z); + mindistance = + (knotobject.vertices[index1].x - knotobject.vertices[index2].x) * + (knotobject.vertices[index1].x - knotobject.vertices[index2].x) + + (knotobject.vertices[index1].y - knotobject.vertices[index2].y) * + (knotobject.vertices[index1].y - knotobject.vertices[index2].y) + + (knotobject.vertices[index1].z - knotobject.vertices[index2].z) * + (knotobject.vertices[index1].z - knotobject.vertices[index2].z); for (count2 = 1; count2 < scaling_factor1; count2++) { index2 = count2 + index1 + scaling_factor1; if (count1 == scaling_factor2 - 1) index2 = count2; - distance = (knotobject.vertices[index1].x - knotobject.vertices[index2].x) * (knotobject.vertices[index1].x - knotobject.vertices[index2].x) + - (knotobject.vertices[index1].y - knotobject.vertices[index2].y) * (knotobject.vertices[index1].y - knotobject.vertices[index2].y) + - (knotobject.vertices[index1].z - knotobject.vertices[index2].z) * (knotobject.vertices[index1].z - knotobject.vertices[index2].z); + distance = + (knotobject.vertices[index1].x - knotobject.vertices[index2].x) * + (knotobject.vertices[index1].x - knotobject.vertices[index2].x) + + (knotobject.vertices[index1].y - knotobject.vertices[index2].y) * + (knotobject.vertices[index1].y - knotobject.vertices[index2].y) + + (knotobject.vertices[index1].z - knotobject.vertices[index2].z) * + (knotobject.vertices[index1].z - knotobject.vertices[index2].z); if (distance < mindistance) { mindistance = distance; rotation = count2; @@ -84,29 +98,29 @@ initknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat radi } for (count2 = 0; count2 < scaling_factor1; count2++) { - knotobject.faces[4*(index1+count2)+0] = index1 + count2; + knotobject.faces[4 * (index1 + count2) + 0] = index1 + count2; index2 = count2 + 1; index2 = index2 % scaling_factor1; - knotobject.faces[4*(index1+count2)+1] = index1 + index2; + knotobject.faces[4 * (index1 + count2) + 1] = index1 + index2; index2 = (count2 + rotation + 1); index2 = index2 % scaling_factor1; - knotobject.faces[4*(index1+count2)+2] = (index1 + index2 + scaling_factor1) % knotobject.numverts; + knotobject.faces[4 * (index1 + count2) + 2] = + (index1 + index2 + scaling_factor1) % knotobject.numverts; index2 = (count2 + rotation); index2 = index2 % scaling_factor1; - knotobject.faces[4*(index1+count2)+3] = (index1 + index2 + scaling_factor1) % knotobject.numverts; + knotobject.faces[4 * (index1 + count2) + 3] = + (index1 + index2 + scaling_factor1) % knotobject.numverts; knotobject.numfaces++; } } } - -static void -recalcknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat radius2, GLfloat radius3) -{ +static void recalcknot(int scaling_factor1, int scaling_factor2, + GLfloat radius1, GLfloat radius2, GLfloat radius3) { int count1, count2; GLfloat alpha, beta; GLfloat x, y, z, dx, dy, dz; @@ -117,7 +131,7 @@ recalcknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat ra knotobject.numverts = 0; alpha = 0; for (count2 = 0; count2 < scaling_factor2; count2++) { - alpha = alpha + 2*PI / scaling_factor2; + alpha = alpha + 2 * PI / scaling_factor2; x = radius2 * cos(2 * alpha) + radius1 * sin(alpha); y = radius2 * sin(2 * alpha) + radius1 * cos(alpha); z = radius2 * cos(3 * alpha); @@ -131,9 +145,14 @@ recalcknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat ra for (count1 = 0; count1 < scaling_factor1; count1++) { beta = beta + 2 * PI / scaling_factor1; - knotobject.vertices[knotobject.numverts].x = x - radius3 * (cos(beta) * dz - sin(beta) * dx*dy/modulus) / value; - knotobject.vertices[knotobject.numverts].y = y - radius3 * sin(beta) * value / modulus; - knotobject.vertices[knotobject.numverts].z = z + radius3 * (cos(beta) * dx + sin(beta) * dy*dz/modulus) / value; + knotobject.vertices[knotobject.numverts].x = + x - + radius3 * (cos(beta) * dz - sin(beta) * dx * dy / modulus) / value; + knotobject.vertices[knotobject.numverts].y = + y - radius3 * sin(beta) * value / modulus; + knotobject.vertices[knotobject.numverts].z = + z + + radius3 * (cos(beta) * dx + sin(beta) * dy * dz / modulus) / value; knotobject.numverts++; } @@ -145,16 +164,24 @@ recalcknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat ra index2 = index1 + scaling_factor1; index2 = index2 % knotobject.numverts; rotation = 0; - Mindistance = (knotobject.vertices[index1].x - knotobject.vertices[index2].x) * (knotobject.vertices[index1].x - knotobject.vertices[index2].x) + - (knotobject.vertices[index1].y - knotobject.vertices[index2].y) * (knotobject.vertices[index1].y - knotobject.vertices[index2].y) + - (knotobject.vertices[index1].z - knotobject.vertices[index2].z) * (knotobject.vertices[index1].z - knotobject.vertices[index2].z); - for (count2 = 1; count2 < scaling_factor1; count2++) { + Mindistance = + (knotobject.vertices[index1].x - knotobject.vertices[index2].x) * + (knotobject.vertices[index1].x - knotobject.vertices[index2].x) + + (knotobject.vertices[index1].y - knotobject.vertices[index2].y) * + (knotobject.vertices[index1].y - knotobject.vertices[index2].y) + + (knotobject.vertices[index1].z - knotobject.vertices[index2].z) * + (knotobject.vertices[index1].z - knotobject.vertices[index2].z); + for (count2 = 1; count2 < scaling_factor1; count2++) { index2 = count2 + index1 + scaling_factor1; if (count1 == scaling_factor2 - 1) index2 = count2; - distance = (knotobject.vertices[index1].x - knotobject.vertices[index2].x) * (knotobject.vertices[index1].x - knotobject.vertices[index2].x) + - (knotobject.vertices[index1].y - knotobject.vertices[index2].y) * (knotobject.vertices[index1].y - knotobject.vertices[index2].y) + - (knotobject.vertices[index1].z - knotobject.vertices[index2].z) * (knotobject.vertices[index1].z - knotobject.vertices[index2].z); + distance = + (knotobject.vertices[index1].x - knotobject.vertices[index2].x) * + (knotobject.vertices[index1].x - knotobject.vertices[index2].x) + + (knotobject.vertices[index1].y - knotobject.vertices[index2].y) * + (knotobject.vertices[index1].y - knotobject.vertices[index2].y) + + (knotobject.vertices[index1].z - knotobject.vertices[index2].z) * + (knotobject.vertices[index1].z - knotobject.vertices[index2].z); if (distance < Mindistance) { Mindistance = distance; rotation = count2; @@ -162,42 +189,41 @@ recalcknot(int scaling_factor1, int scaling_factor2, GLfloat radius1, GLfloat ra } for (count2 = 0; count2 < scaling_factor1; count2++) { - knotobject.faces[4*(index1+count2)+0] = index1 + count2; + knotobject.faces[4 * (index1 + count2) + 0] = index1 + count2; index2 = index2 % scaling_factor1; - knotobject.faces[4*(index1+count2)+2] = (index1 + index2 + scaling_factor1) % knotobject.numverts; + knotobject.faces[4 * (index1 + count2) + 2] = + (index1 + index2 + scaling_factor1) % knotobject.numverts; index2 = count2 + rotation; index2 = index2 % scaling_factor1; - knotobject.faces[4*(index1+count2)+3] = (index1 + index2 + scaling_factor1) % knotobject.numverts; + knotobject.faces[4 * (index1 + count2) + 3] = + (index1 + index2 + scaling_factor1) % knotobject.numverts; knotobject.numfaces++; } } } - -static void -draw_the_knot(void) -{ +static void draw_the_knot(void) { int i, j, num; glBegin(GL_QUADS); - j = knotobject.numfaces*4; + j = knotobject.numfaces * 4; for (i = 0; i < j; i++) { num = knotobject.faces[i]; - glColor3f(knotobject.colors[num].r*2.5, knotobject.colors[num].g*2, knotobject.colors[num].b*1.5); - glVertex3f(knotobject.vertices[num].x, knotobject.vertices[num].y, knotobject.vertices[num].z); + glColor3f(knotobject.colors[num].r * 2.5, knotobject.colors[num].g * 2, + knotobject.colors[num].b * 1.5); + glVertex3f(knotobject.vertices[num].x, knotobject.vertices[num].y, + knotobject.vertices[num].z); } glEnd(); } - -static void -createknot(void) -{ - recalcknot(16, 64, 3.4*sin(0.02*knot_time)-1, 4*cos(0.006*knot_time)-2, 1.1); +static void createknot(void) { + recalcknot(16, 64, 3.4 * sin(0.02 * knot_time) - 1, + 4 * cos(0.006 * knot_time) - 2, 1.1); glTranslatef(0.0f, 0.2f, -30.0f); glRotatef(x_angle, 1.0f, 0.0f, 0.0f); glRotatef(y_angle, 0.0f, 1.0f, 0.0f); @@ -205,19 +231,13 @@ createknot(void) draw_the_knot(); } - -static void -drawknot(void) -{ +static void drawknot(void) { glPushMatrix(); createknot(); glPopMatrix(); } - -static void -render_knot(void) -{ +static void render_knot(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glColor3f(0.9f, 0.9f, 0.9f); @@ -235,10 +255,7 @@ render_knot(void) glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); } - -void -draw_knot(void) -{ +void draw_knot(void) { if (!create_knot) { initknot(16, 64, 2, 2.0, 1.0); create_knot = TRUE; @@ -246,11 +263,14 @@ draw_knot(void) y_speed = y_old_speed; y_speed = reduce_vsync(y_speed); x_angle += x_speed; - if(x_angle >= 360.0) x_angle -= 360.0; + if (x_angle >= 360.0) + x_angle -= 360.0; y_angle += y_speed; - if(y_angle >= 360.0) y_angle -= 360.0; + if (y_angle >= 360.0) + y_angle -= 360.0; z_angle += z_speed; - if(z_angle >= 360.0) z_angle -= 360.0; + if (z_angle >= 360.0) + z_angle -= 360.0; old_knot_time = knot_time; speed_bg = old_speed_bg; speed_bg = reduce_vsync(speed_bg); diff --git a/libvisual-plugins/plugins/actor/nebulus/nebulus.c b/libvisual-plugins/plugins/actor/nebulus/nebulus.c index 659c1a63b..342f5ab5e 100644 --- a/libvisual-plugins/plugins/actor/nebulus/nebulus.c +++ b/libvisual-plugins/plugins/actor/nebulus/nebulus.c @@ -27,16 +27,18 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR typedef struct { - VisBuffer *pcmbuf; + VisBuffer *pcmbuf; } NebulusPrivate; -static int lv_nebulus_init (VisPluginData *plugin); -static void lv_nebulus_cleanup (VisPluginData *plugin); -static void lv_nebulus_requisition (VisPluginData *plugin, int *width, int *height); -static void lv_nebulus_resize (VisPluginData *plugin, int width, int height); -static int lv_nebulus_events (VisPluginData *plugin, VisEventQueue *events); -static void lv_nebulus_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); -static VisPalette *lv_nebulus_palette (VisPluginData *plugin); +static int lv_nebulus_init(VisPluginData *plugin); +static void lv_nebulus_cleanup(VisPluginData *plugin); +static void lv_nebulus_requisition(VisPluginData *plugin, int *width, + int *height); +static void lv_nebulus_resize(VisPluginData *plugin, int width, int height); +static int lv_nebulus_events(VisPluginData *plugin, VisEventQueue *events); +static void lv_nebulus_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); +static VisPalette *lv_nebulus_palette(VisPluginData *plugin); float framerate = 50; GLfloat scale, heights[16][16]; @@ -47,15 +49,15 @@ static int beathistory[BEAT_MAX]; static int beatbase; short pcm_data[512]; -nebulus general = { 32, 32, 0, 4, 4, 100, 100, 0, FALSE, FALSE, - TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }; +nebulus general = {32, 32, 0, 4, 4, 100, + 100, 0, FALSE, FALSE, TRUE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; nebulus *point_general = &general; -effect my_effect[EFFECT_NUMBER] = {{ "Knot", 100 }, { "Spectrum", 100 }, - { "Face blur", 100 }, { "Glthreads", 100 }, - { "Tunnel", 100 }, { "Tentacles", 100 }, - { "Twist", 100 }, { "Child", 100 }, - { "Energy", 100 }}; +effect my_effect[EFFECT_NUMBER] = { + {"Knot", 100}, {"Spectrum", 100}, {"Face blur", 100}, + {"Glthreads", 100}, {"Tunnel", 100}, {"Tentacles", 100}, + {"Twist", 100}, {"Child", 100}, {"Energy", 100}}; effect my_effect_old[EFFECT_NUMBER]; GLint maxtexsize; @@ -67,322 +69,314 @@ VisVideo *tunnel_image; VisVideo *twist_image; VisVideo *background_image; -static int nebulus_random_effect (); -static int nebulus_detect_beat (int loudness); -static int nebulus_sound (NebulusPrivate *priv, VisAudio *audio); -static int nebulus_draw (NebulusPrivate *priv, VisVideo *video); +static int nebulus_random_effect(); +static int nebulus_detect_beat(int loudness); +static int nebulus_sound(NebulusPrivate *priv, VisAudio *audio); +static int nebulus_draw(NebulusPrivate *priv, VisVideo *video); /* Main plugin stuff */ -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = lv_nebulus_requisition, - .palette = lv_nebulus_palette, - .render = lv_nebulus_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_GL - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "nebulus", - .name = "Nebulus", - .author = N_("Original by: Pascal Brochart and many others, Port and maintaince by: Dennis Smit "), - .version = "1.0", - .about = N_("Libvisual nebulus plugin"), - .help = N_("This plugin shows multiple visual effect using openGL"), - .license = VISUAL_PLUGIN_LICENSE_GPL, - - .init = lv_nebulus_init, - .cleanup = lv_nebulus_cleanup, - .events = lv_nebulus_events, - .plugin = &actor - }; - - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); - VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, 1); - - return &info; +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = lv_nebulus_requisition, + .palette = lv_nebulus_palette, + .render = lv_nebulus_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_GL}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "nebulus", + .name = "Nebulus", + .author = N_("Original by: Pascal Brochart and " + "many others, Port and maintaince by: Dennis Smit " + ""), + .version = "1.0", + .about = N_("Libvisual nebulus plugin"), + .help = N_("This plugin shows multiple visual effect using openGL"), + .license = VISUAL_PLUGIN_LICENSE_GPL, + + .init = lv_nebulus_init, + .cleanup = lv_nebulus_cleanup, + .events = lv_nebulus_events, + .plugin = &actor}; + + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_RED_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_GREEN_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_BLUE_SIZE, 5); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DEPTH_SIZE, 16); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, + VISUAL_GL_ATTRIBUTE_DOUBLEBUFFER, 1); + VISUAL_VIDEO_ATTR_OPTIONS_GL_ENTRY(actor.vidoptions, VISUAL_GL_ATTRIBUTE_RGBA, + 1); + + return &info; } -static int lv_nebulus_init (VisPluginData *plugin) -{ +static int lv_nebulus_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - NebulusPrivate *priv = visual_mem_new0 (NebulusPrivate, 1); - visual_plugin_set_private (plugin, priv); + NebulusPrivate *priv = visual_mem_new0(NebulusPrivate, 1); + visual_plugin_set_private(plugin, priv); - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxtexsize); - if (maxtexsize < 256) { - visual_log (VISUAL_LOG_CRITICAL, _("Nebulus: max texture size is lower than 256")); - return FALSE; - } + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxtexsize); + if (maxtexsize < 256) { + visual_log(VISUAL_LOG_CRITICAL, + _("Nebulus: max texture size is lower than 256")); + return FALSE; + } - if (tunnel_first) - precalculate_tunnel(); + if (tunnel_first) + precalculate_tunnel(); - priv->pcmbuf = visual_buffer_new_allocate (1024 * sizeof (float)); + priv->pcmbuf = visual_buffer_new_allocate(1024 * sizeof(float)); - child_image = NULL; - energy_image = NULL; - tentacle_image = NULL; - tunnel_image = NULL; - twist_image = NULL; - background_image = NULL; + child_image = NULL; + energy_image = NULL; + tentacle_image = NULL; + tunnel_image = NULL; + twist_image = NULL; + background_image = NULL; - init_gl(); + init_gl(); - return TRUE; + return TRUE; } -static void lv_nebulus_cleanup (VisPluginData *plugin) -{ - NebulusPrivate *priv = visual_plugin_get_private (plugin); - - if (!face_first) - glDeleteLists(facedl, 1); - if (!tentacles_first) - glDeleteLists(cubedl, 1); - if (!child_first) - glDeleteLists(childdl, 1); - - delete_gl_texture(knotbg); - delete_gl_texture(tunnel); - delete_gl_texture(tentacle); - delete_gl_texture(twist); - delete_gl_texture(twistbg); - delete_gl_texture(texchild); - delete_gl_texture(childbg); - delete_gl_texture(energy); - - visual_video_unref (child_image); - visual_video_unref (energy_image); - visual_video_unref (tentacle_image); - visual_video_unref (tunnel_image); - visual_video_unref (twist_image); - visual_video_unref (background_image); - - visual_buffer_unref (priv->pcmbuf); - - visual_mem_free (priv); +static void lv_nebulus_cleanup(VisPluginData *plugin) { + NebulusPrivate *priv = visual_plugin_get_private(plugin); + + if (!face_first) + glDeleteLists(facedl, 1); + if (!tentacles_first) + glDeleteLists(cubedl, 1); + if (!child_first) + glDeleteLists(childdl, 1); + + delete_gl_texture(knotbg); + delete_gl_texture(tunnel); + delete_gl_texture(tentacle); + delete_gl_texture(twist); + delete_gl_texture(twistbg); + delete_gl_texture(texchild); + delete_gl_texture(childbg); + delete_gl_texture(energy); + + visual_video_unref(child_image); + visual_video_unref(energy_image); + visual_video_unref(tentacle_image); + visual_video_unref(tunnel_image); + visual_video_unref(twist_image); + visual_video_unref(background_image); + + visual_buffer_unref(priv->pcmbuf); + + visual_mem_free(priv); } -static void lv_nebulus_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void lv_nebulus_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static VisPalette *lv_nebulus_palette (VisPluginData *plugin) -{ - return NULL; -} +static VisPalette *lv_nebulus_palette(VisPluginData *plugin) { return NULL; } -static void lv_nebulus_resize (VisPluginData *plugin, int width, int height) -{ - glViewport (0, 0, width, height); +static void lv_nebulus_resize(VisPluginData *plugin, int width, int height) { + glViewport(0, 0, width, height); - point_general->WIDTH = width; - point_general->HEIGHT = height; + point_general->WIDTH = width; + point_general->HEIGHT = height; } -static int lv_nebulus_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - lv_nebulus_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; - default: - break; - } - } - - return TRUE; +static int lv_nebulus_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; + + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + lv_nebulus_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; + default: + break; + } + } + + return TRUE; } -static void lv_nebulus_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - NebulusPrivate *priv = visual_plugin_get_private (plugin); +static void lv_nebulus_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + NebulusPrivate *priv = visual_plugin_get_private(plugin); - nebulus_sound (priv, audio); - nebulus_draw (priv, video); + nebulus_sound(priv, audio); + nebulus_draw(priv, video); } -static int nebulus_random_effect () -{ - int i; - int rnd_effect = 0, new_effect = 0, effect = 0; - - for (i = 0; i < EFFECT_NUMBER; i++) - rnd_effect += my_effect[i].value * 100; /* 100 pour + de precision */ - if (!rnd_effect) - return point_general->effect; - new_effect = visual_rand() % rnd_effect; - rnd_effect = 0; - for (i = 0; i < EFFECT_NUMBER; i++) { - rnd_effect += my_effect[i].value * 100; /* 100 pour + de precision */ - if (new_effect <= rnd_effect) { - effect = i; - if (!effect) - effect = EFFECT_NUMBER; - return effect; - } - } - return point_general->effect; +static int nebulus_random_effect() { + int i; + int rnd_effect = 0, new_effect = 0, effect = 0; + + for (i = 0; i < EFFECT_NUMBER; i++) + rnd_effect += my_effect[i].value * 100; /* 100 pour + de precision */ + if (!rnd_effect) + return point_general->effect; + new_effect = visual_rand() % rnd_effect; + rnd_effect = 0; + for (i = 0; i < EFFECT_NUMBER; i++) { + rnd_effect += my_effect[i].value * 100; /* 100 pour + de precision */ + if (new_effect <= rnd_effect) { + effect = i; + if (!effect) + effect = EFFECT_NUMBER; + return effect; + } + } + return point_general->effect; } -static int nebulus_detect_beat (int loudness) -{ - static int aged; - static int lowest; - static int elapsed; - static int isquiet; - static int prevbeat; - int i, j; - int total; - int sensitivity; - int detected_beat; - - aged = (aged * 7 + loudness) >> 3; - elapsed++; - - if (aged < 2000 || elapsed > BEAT_MAX) { - elapsed = 0; - lowest = aged; - visual_mem_set(beathistory, 0, sizeof beathistory); - } - else if (aged < lowest) - lowest = aged; - - j = (beatbase + elapsed) % BEAT_MAX; - beathistory[j] = loudness - aged; - detected_beat = FALSE; - if (elapsed > 15 && aged > 2000 && loudness * 4 > aged * 5) { - for (i = BEAT_MAX / elapsed, total = 0; - --i > 0; - j = (j + BEAT_MAX - elapsed) % BEAT_MAX) - { - total += beathistory[j]; - } - total = total * elapsed / BEAT_MAX; - sensitivity = 6; - i = 3 - abs(elapsed - prevbeat)/2; - if (i > 0) - sensitivity += i; - if (total * sensitivity > aged) { - prevbeat = elapsed; - beatbase = (beatbase + elapsed) % BEAT_MAX; - lowest = aged; - elapsed = 0; - detected_beat = TRUE; - } - } - if (aged < (isquiet ? 1500 : 500)) - isquiet = TRUE; - else - isquiet = FALSE; - - return detected_beat; +static int nebulus_detect_beat(int loudness) { + static int aged; + static int lowest; + static int elapsed; + static int isquiet; + static int prevbeat; + int i, j; + int total; + int sensitivity; + int detected_beat; + + aged = (aged * 7 + loudness) >> 3; + elapsed++; + + if (aged < 2000 || elapsed > BEAT_MAX) { + elapsed = 0; + lowest = aged; + visual_mem_set(beathistory, 0, sizeof beathistory); + } else if (aged < lowest) + lowest = aged; + + j = (beatbase + elapsed) % BEAT_MAX; + beathistory[j] = loudness - aged; + detected_beat = FALSE; + if (elapsed > 15 && aged > 2000 && loudness * 4 > aged * 5) { + for (i = BEAT_MAX / elapsed, total = 0; --i > 0; + j = (j + BEAT_MAX - elapsed) % BEAT_MAX) { + total += beathistory[j]; + } + total = total * elapsed / BEAT_MAX; + sensitivity = 6; + i = 3 - abs(elapsed - prevbeat) / 2; + if (i > 0) + sensitivity += i; + if (total * sensitivity > aged) { + prevbeat = elapsed; + beatbase = (beatbase + elapsed) % BEAT_MAX; + lowest = aged; + elapsed = 0; + detected_beat = TRUE; + } + } + if (aged < (isquiet ? 1500 : 500)) + isquiet = TRUE; + else + isquiet = FALSE; + + return detected_beat; } -static int nebulus_sound (NebulusPrivate *priv, VisAudio *audio) -{ - int i, c, y, tmp; - GLfloat val, energy = 0; - int xscale[] = { 0, 1, 2, 3, 5, 7, 10, 14, 20, 28, 40, 54, 74, 101, 137, 187, 255 }; - float *fbuf; - VisBuffer *buf; - float freq[256]; - - visual_audio_get_sample_mixed_simple (audio, priv->pcmbuf, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); - - buf = visual_buffer_new_wrap_data (freq, sizeof (freq), FALSE); - visual_audio_get_spectrum_for_sample (buf, priv->pcmbuf, FALSE); - visual_buffer_unref (buf); - - fbuf = visual_buffer_get_data (priv->pcmbuf); - - for (i = 0; i < 512; i++) { - pcm_data[i] = fbuf[i] * 32767; // FIXME pull the 32767 as a constant from somewhere, also in goom2.c - } - - for(y = 15; y > 0; y--) { - for(i = 0; i < 16; i++) - heights[y][i] = heights[y - 1][i]; - } - for(i = 0; i < NUM_BANDS; i++) { - for(c = xscale[i], y = 0; c < xscale[i + 1]; c++) { - if(freq[c] > y) - y = freq[c]; - } - loudness += (y / (xscale[i + 1] - xscale[i] + 1)) * - (abs (i - NUM_BANDS / 2) + NUM_BANDS / 2) * (4 + i); - y >>= 7; - if(y > 0) - val = (log(y) * scale); - else - val = 0; - heights[0][i] = val; - } - loudness /= (NUM_BANDS * 4); - beat = nebulus_detect_beat (loudness); - too_long++; - if (!point_general->freeze) { - if (too_long > 1000) { - too_long = 0; - point_general->effect = nebulus_random_effect(); - point_general->changement = TRUE; - } - if (beat) { - if (beat_compteur > point_general->beat - 1) { - point_general->effect = nebulus_random_effect(); - point_general->changement = TRUE; - beat_compteur = 0; - too_long = 0; - } - beat_compteur += beat; - } - } - for (i = 0; i < 256; i++) { - tmp = freq[i] * 0.0625; - energy += tmp * tmp; - } - energy = energy / 65536 / 256 * 256; - energy += 6.0f; - energy *= 1.2f; - if (energy > 10) - energy = 10; - point_general->energy = energy; - - return 0; +static int nebulus_sound(NebulusPrivate *priv, VisAudio *audio) { + int i, c, y, tmp; + GLfloat val, energy = 0; + int xscale[] = {0, 1, 2, 3, 5, 7, 10, 14, 20, + 28, 40, 54, 74, 101, 137, 187, 255}; + float *fbuf; + VisBuffer *buf; + float freq[256]; + + visual_audio_get_sample_mixed_simple(audio, priv->pcmbuf, 2, + VISUAL_AUDIO_CHANNEL_LEFT, + VISUAL_AUDIO_CHANNEL_RIGHT); + + buf = visual_buffer_new_wrap_data(freq, sizeof(freq), FALSE); + visual_audio_get_spectrum_for_sample(buf, priv->pcmbuf, FALSE); + visual_buffer_unref(buf); + + fbuf = visual_buffer_get_data(priv->pcmbuf); + + for (i = 0; i < 512; i++) { + pcm_data[i] = fbuf[i] * 32767; // FIXME pull the 32767 as a constant from + // somewhere, also in goom2.c + } + + for (y = 15; y > 0; y--) { + for (i = 0; i < 16; i++) + heights[y][i] = heights[y - 1][i]; + } + for (i = 0; i < NUM_BANDS; i++) { + for (c = xscale[i], y = 0; c < xscale[i + 1]; c++) { + if (freq[c] > y) + y = freq[c]; + } + loudness += (y / (xscale[i + 1] - xscale[i] + 1)) * + (abs(i - NUM_BANDS / 2) + NUM_BANDS / 2) * (4 + i); + y >>= 7; + if (y > 0) + val = (log(y) * scale); + else + val = 0; + heights[0][i] = val; + } + loudness /= (NUM_BANDS * 4); + beat = nebulus_detect_beat(loudness); + too_long++; + if (!point_general->freeze) { + if (too_long > 1000) { + too_long = 0; + point_general->effect = nebulus_random_effect(); + point_general->changement = TRUE; + } + if (beat) { + if (beat_compteur > point_general->beat - 1) { + point_general->effect = nebulus_random_effect(); + point_general->changement = TRUE; + beat_compteur = 0; + too_long = 0; + } + beat_compteur += beat; + } + } + for (i = 0; i < 256; i++) { + tmp = freq[i] * 0.0625; + energy += tmp * tmp; + } + energy = energy / 65536 / 256 * 256; + energy += 6.0f; + energy *= 1.2f; + if (energy > 10) + energy = 10; + point_general->energy = energy; + + return 0; } -static int nebulus_draw (NebulusPrivate *priv, VisVideo *video) -{ - draw_scene (); +static int nebulus_draw(NebulusPrivate *priv, VisVideo *video) { + draw_scene(); - return 0; + return 0; } - diff --git a/libvisual-plugins/plugins/actor/nebulus/nebulus.h b/libvisual-plugins/plugins/actor/nebulus/nebulus.h index e91a39338..5b961e607 100644 --- a/libvisual-plugins/plugins/actor/nebulus/nebulus.h +++ b/libvisual-plugins/plugins/actor/nebulus/nebulus.h @@ -39,28 +39,26 @@ typedef struct nebulus { int infos; } nebulus; -typedef struct -{ +typedef struct { char *name; int value; } effect; typedef struct { - unsigned int width; - unsigned int height; - unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ - unsigned char pixel_data[64 * 64 * 3 + 1]; + unsigned int width; + unsigned int height; + unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ + unsigned char pixel_data[64 * 64 * 3 + 1]; } image_s64; typedef struct { - unsigned int width; - unsigned int height; - unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ - unsigned char pixel_data[128 * 128 * 3 + 1]; + unsigned int width; + unsigned int height; + unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ + unsigned char pixel_data[128 * 128 * 3 + 1]; } image_s128; -typedef struct -{ +typedef struct { GLfloat x, y, z; } glcoord; @@ -83,7 +81,7 @@ extern int create_knot, create_quadratic; extern GLuint blurtexture, knotbg, tunnel, tentacle, twist, twistbg; extern GLuint texchild, childbg, energy; extern GLuint facedl, cubedl, childdl; -extern GLint *blur_data[128*128*4]; +extern GLint *blur_data[128 * 128 * 4]; extern GLUquadricObj *myquadratic; extern GLfloat y_angle, y_speed, y_old_speed; extern GLfloat x_angle, x_speed; diff --git a/libvisual-plugins/plugins/actor/nebulus/spectrum.c b/libvisual-plugins/plugins/actor/nebulus/spectrum.c index 366c5b87c..a4eb0fa5a 100644 --- a/libvisual-plugins/plugins/actor/nebulus/spectrum.c +++ b/libvisual-plugins/plugins/actor/nebulus/spectrum.c @@ -1,17 +1,15 @@ #include "nebulus.h" - -static void draw_rectangle(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2) -{ - if(y1 == y2) { +static void draw_rectangle(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, + GLfloat y2, GLfloat z2) { + if (y1 == y2) { glVertex3f(x1, y1, z1); glVertex3f(x2, y1, z1); glVertex3f(x2, y2, z2); glVertex3f(x2, y2, z2); glVertex3f(x1, y2, z2); glVertex3f(x1, y1, z1); - } - else { + } else { glVertex3f(x1, y1, z1); glVertex3f(x2, y1, z2); glVertex3f(x2, y2, z2); @@ -21,45 +19,41 @@ static void draw_rectangle(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLflo } } - -static void -draw_bar(GLfloat x_offset, GLfloat z_offset, GLfloat height, GLfloat red, GLfloat green, GLfloat blue ) -{ +static void draw_bar(GLfloat x_offset, GLfloat z_offset, GLfloat height, + GLfloat red, GLfloat green, GLfloat blue) { GLfloat width = 0.08f; glColor3f(red - 0.1f, 0.0f, blue); - draw_rectangle(x_offset, height, z_offset, x_offset + width, height, z_offset + 0.1); + draw_rectangle(x_offset, height, z_offset, x_offset + width, height, + z_offset + 0.1); draw_rectangle(x_offset, 0, z_offset, x_offset + width, 0, z_offset + 0.1); glColor3f(0.5 * red, 0.0f, 0.6 * blue); - draw_rectangle(x_offset, 0.0, z_offset + 0.1, x_offset + width, height, z_offset + 0.1); - draw_rectangle(x_offset, 0.0, z_offset, x_offset + width, height, z_offset ); + draw_rectangle(x_offset, 0.0, z_offset + 0.1, x_offset + width, height, + z_offset + 0.1); + draw_rectangle(x_offset, 0.0, z_offset, x_offset + width, height, z_offset); glColor3f(0.25 * red, 0.0f, 0.25 * blue); - draw_rectangle(x_offset, 0.0, z_offset , x_offset, height, z_offset + 0.1); - draw_rectangle(x_offset + width, 0.0, z_offset , x_offset + width, height, z_offset + 0.1); + draw_rectangle(x_offset, 0.0, z_offset, x_offset, height, z_offset + 0.1); + draw_rectangle(x_offset + width, 0.0, z_offset, x_offset + width, height, + z_offset + 0.1); } - -static void -createbars(void) -{ +static void createbars(void) { int x, y; GLfloat x_offset, z_offset, r_base, b_base; glBegin(GL_TRIANGLES); - for(y = 0; y < 16; y++) { + for (y = 0; y < 16; y++) { z_offset = -1.6 + ((15 - y) * 0.2); b_base = y * (1.0 / 14); r_base = 1.0 - b_base; - for(x = 0; x < 16; x++) { + for (x = 0; x < 16; x++) { x_offset = -1.6 + (x * 0.2); - draw_bar(x_offset, z_offset, heights[y][x], r_base, y * (r_base/10.0f), b_base); + draw_bar(x_offset, z_offset, heights[y][x], r_base, y * (r_base / 10.0f), + b_base); } } glEnd(); } - -static void -drawbars(void) -{ +static void drawbars(void) { glDisable(GL_TEXTURE_2D); glPushMatrix(); glTranslatef(0.0f, 0.0f, -10.4f); @@ -73,10 +67,7 @@ drawbars(void) glEnable(GL_TEXTURE_2D); } - -static void -render_spectrum(void) -{ +static void render_spectrum(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDisable(GL_BLEND); @@ -90,19 +81,19 @@ render_spectrum(void) glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); } - -void -draw_spectrum(void) -{ +void draw_spectrum(void) { scale = 1.0 / log(64.0); y_speed = y_old_speed; y_speed = reduce_vsync(y_speed); x_angle += x_speed; - if(x_angle >= 360.0) x_angle -= 360.0; + if (x_angle >= 360.0) + x_angle -= 360.0; y_angle += y_speed; - if(y_angle >= 360.0) y_angle -= 360.0; + if (y_angle >= 360.0) + y_angle -= 360.0; z_angle += z_speed; - if(z_angle >= 360.0) z_angle -= 360.0; + if (z_angle >= 360.0) + z_angle -= 360.0; render_spectrum(); drawbars(); drawblur(1, 0.01f, 0.4f); diff --git a/libvisual-plugins/plugins/actor/nebulus/tentacles.c b/libvisual-plugins/plugins/actor/nebulus/tentacles.c index 4aa223208..8c7a75178 100644 --- a/libvisual-plugins/plugins/actor/nebulus/tentacles.c +++ b/libvisual-plugins/plugins/actor/nebulus/tentacles.c @@ -4,10 +4,7 @@ GLuint cubedl = 0; GLfloat tentacles_time, speed_tentacles = 50, old_speed_tentacles = 50; int tentacles_first = TRUE; - -static void -drawtentacle(int step, GLfloat angle, GLfloat twistangle) -{ +static void drawtentacle(int step, GLfloat angle, GLfloat twistangle) { if (step == 19) return; @@ -16,94 +13,109 @@ drawtentacle(int step, GLfloat angle, GLfloat twistangle) glRotatef(twistangle, 1.0f, 0.0f, 0.0f); glCallList(cubedl); glScalef(0.9f, 0.9f, 0.9f); - drawtentacle(step+1, angle, twistangle); + drawtentacle(step + 1, angle, twistangle); } - -static void -drawobject(void) -{ +static void drawobject(void) { GLfloat angle, twistangle; glCallList(cubedl); glScalef(0.9f, 0.9f, 0.9f); - angle = 25*sin(tentacles_time/800); - twistangle = 25*sin(tentacles_time/1000); + angle = 25 * sin(tentacles_time / 800); + twistangle = 25 * sin(tentacles_time / 1000); glPushMatrix(); drawtentacle(0, angle, twistangle); glPopMatrix(); - angle = 25*cos(tentacles_time/700); - twistangle = 25*sin(tentacles_time/1000); + angle = 25 * cos(tentacles_time / 700); + twistangle = 25 * sin(tentacles_time / 1000); glRotatef(90.0f, 0.0f, 1.0f, 0.0f); glPushMatrix(); drawtentacle(0, angle, -twistangle); glPopMatrix(); - angle = 25*sin(tentacles_time/700); - twistangle = 25*cos(tentacles_time/800); + angle = 25 * sin(tentacles_time / 700); + twistangle = 25 * cos(tentacles_time / 800); glRotatef(90.0f, 0.0f, 1.0f, 0.0f); glPushMatrix(); drawtentacle(0, angle, twistangle); glPopMatrix(); - angle = 25*sin(tentacles_time/800); - twistangle = 25*sin(tentacles_time/600); + angle = 25 * sin(tentacles_time / 800); + twistangle = 25 * sin(tentacles_time / 600); glRotatef(90.0f, 0.0f, 1.0f, 0.0f); glPushMatrix(); drawtentacle(0, angle, -twistangle); glPopMatrix(); - angle = 25*sin(tentacles_time/800); - twistangle = 25*cos(tentacles_time/600); + angle = 25 * sin(tentacles_time / 800); + twistangle = 25 * cos(tentacles_time / 600); glRotatef(90.0f, 0.0f, 0.0f, 1.0f); glPushMatrix(); drawtentacle(0, angle, twistangle); glPopMatrix(); - angle = 25*sin(tentacles_time/600); - twistangle = 25*cos(tentacles_time/1000); + angle = 25 * sin(tentacles_time / 600); + twistangle = 25 * cos(tentacles_time / 1000); glRotatef(180.0f, 0.0f, 0.0f, 1.0f); glPushMatrix(); drawtentacle(0, -angle, -twistangle); glPopMatrix(); } - -static void -createtentacles(void) -{ +static void createtentacles(void) { cubedl = glGenLists(1); tentacles_first = FALSE; glNewList(cubedl, GL_COMPILE); glBegin(GL_QUADS); - glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, 1.0); - glTexCoord2f(1.0, 0.0); glVertex3f( 1.0, -1.0, 1.0); - glTexCoord2f(1.0, 1.0); glVertex3f( 1.0, 1.0, 1.0); - glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, 1.0); - glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0, -1.0); - glTexCoord2f(1.0, 1.0); glVertex3f(-1.0, 1.0, -1.0); - glTexCoord2f(0.0, 1.0); glVertex3f( 1.0, 1.0, -1.0); - glTexCoord2f(0.0, 0.0); glVertex3f( 1.0, -1.0, -1.0); - glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, -1.0); - glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, 1.0, 1.0); - glTexCoord2f(1.0, 0.0); glVertex3f( 1.0, 1.0, 1.0); - glTexCoord2f(1.0, 1.0); glVertex3f( 1.0, 1.0, -1.0); - glTexCoord2f(1.0, 1.0); glVertex3f(-1.0, -1.0, -1.0); - glTexCoord2f(0.0, 1.0); glVertex3f( 1.0, -1.0, -1.0); - glTexCoord2f(0.0, 0.0); glVertex3f( 1.0, -1.0, 1.0); - glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0, 1.0); - glTexCoord2f(1.0, 0.0); glVertex3f( 1.0, -1.0, -1.0); - glTexCoord2f(1.0, 1.0); glVertex3f( 1.0, 1.0, -1.0); - glTexCoord2f(0.0, 1.0); glVertex3f( 1.0, 1.0, 1.0); - glTexCoord2f(0.0, 0.0); glVertex3f( 1.0, -1.0, 1.0); - glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, -1.0); - glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0, 1.0); - glTexCoord2f(1.0, 1.0); glVertex3f(-1.0, 1.0, 1.0); - glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, -1.0); + glTexCoord2f(0.0, 0.0); + glVertex3f(-1.0, -1.0, 1.0); + glTexCoord2f(1.0, 0.0); + glVertex3f(1.0, -1.0, 1.0); + glTexCoord2f(1.0, 1.0); + glVertex3f(1.0, 1.0, 1.0); + glTexCoord2f(0.0, 1.0); + glVertex3f(-1.0, 1.0, 1.0); + glTexCoord2f(1.0, 0.0); + glVertex3f(-1.0, -1.0, -1.0); + glTexCoord2f(1.0, 1.0); + glVertex3f(-1.0, 1.0, -1.0); + glTexCoord2f(0.0, 1.0); + glVertex3f(1.0, 1.0, -1.0); + glTexCoord2f(0.0, 0.0); + glVertex3f(1.0, -1.0, -1.0); + glTexCoord2f(0.0, 1.0); + glVertex3f(-1.0, 1.0, -1.0); + glTexCoord2f(0.0, 0.0); + glVertex3f(-1.0, 1.0, 1.0); + glTexCoord2f(1.0, 0.0); + glVertex3f(1.0, 1.0, 1.0); + glTexCoord2f(1.0, 1.0); + glVertex3f(1.0, 1.0, -1.0); + glTexCoord2f(1.0, 1.0); + glVertex3f(-1.0, -1.0, -1.0); + glTexCoord2f(0.0, 1.0); + glVertex3f(1.0, -1.0, -1.0); + glTexCoord2f(0.0, 0.0); + glVertex3f(1.0, -1.0, 1.0); + glTexCoord2f(1.0, 0.0); + glVertex3f(-1.0, -1.0, 1.0); + glTexCoord2f(1.0, 0.0); + glVertex3f(1.0, -1.0, -1.0); + glTexCoord2f(1.0, 1.0); + glVertex3f(1.0, 1.0, -1.0); + glTexCoord2f(0.0, 1.0); + glVertex3f(1.0, 1.0, 1.0); + glTexCoord2f(0.0, 0.0); + glVertex3f(1.0, -1.0, 1.0); + glTexCoord2f(0.0, 0.0); + glVertex3f(-1.0, -1.0, -1.0); + glTexCoord2f(1.0, 0.0); + glVertex3f(-1.0, -1.0, 1.0); + glTexCoord2f(1.0, 1.0); + glVertex3f(-1.0, 1.0, 1.0); + glTexCoord2f(0.0, 1.0); + glVertex3f(-1.0, 1.0, -1.0); glEnd(); glEndList(); } - -static void -drawtentacles(void) -{ +static void drawtentacles(void) { /* GLfloat angle, twistangle; */ glDisable(GL_DEPTH_TEST); @@ -113,9 +125,9 @@ drawtentacles(void) glColor3f(1.0f, 1.0f, 1.0f); glBegin(GL_QUADS); glVertex3f(-1.0, -1.0, 0.0); - glVertex3f( 1.0, -1.0, 0.0); - glVertex3f( 1.0, 1.0, 0.0); - glVertex3f(-1.0, 1.0, 0.0); + glVertex3f(1.0, -1.0, 0.0); + glVertex3f(1.0, 1.0, 0.0); + glVertex3f(-1.0, 1.0, 0.0); glEnd(); glPopMatrix(); @@ -124,8 +136,8 @@ drawtentacles(void) glPushMatrix(); glDisable(GL_TEXTURE_2D); glTranslatef(0.0f, 0.0f, -18.0f); - glRotatef(tentacles_time/20, 1.0f, 0.0f, 0.0f); - glRotatef(tentacles_time/30, 0.0f, 1.0f, 0.0f); + glRotatef(tentacles_time / 20, 1.0f, 0.0f, 0.0f); + glRotatef(tentacles_time / 30, 0.0f, 1.0f, 0.0f); glColor3f(0.6f, 0.6f, 0.6f); drawobject(); glColor3f(1.0f, 1.0f, 1.0f); @@ -136,12 +148,12 @@ drawtentacles(void) glTranslatef(0.0f, 0.0f, -1.0f); glBegin(GL_QUADS); glVertex3f(-1.0, 0.19, 0.0); - glVertex3f( 1.0, 0.19, 0.0); - glVertex3f( 1.0, 0.5, 0.0); + glVertex3f(1.0, 0.19, 0.0); + glVertex3f(1.0, 0.5, 0.0); glVertex3f(-1.0, 0.5, 0.0); glVertex3f(-1.0, -0.2, 0.0); - glVertex3f( 1.0, -0.2, 0.0); - glVertex3f( 1.0, -0.5, 0.0); + glVertex3f(1.0, -0.2, 0.0); + glVertex3f(1.0, -0.5, 0.0); glVertex3f(-1.0, -0.5, 0.0); glEnd(); glColor3f(1.0f, 1.0f, 1.0f); @@ -149,8 +161,8 @@ drawtentacles(void) glPushMatrix(); glTranslatef(0.0f, 0.0f, -33.0f); - glRotatef(tentacles_time/20, 1.0f, 0.0f, 0.0f); - glRotatef(tentacles_time/30, 0.0f, 1.0f, 0.0f); + glRotatef(tentacles_time / 20, 1.0f, 0.0f, 0.0f); + glRotatef(tentacles_time / 30, 0.0f, 1.0f, 0.0f); glEnable(GL_TEXTURE_2D); glEnable(GL_DEPTH_TEST); glColor3f(1.0f, 1.0f, 1.0f); @@ -159,10 +171,7 @@ drawtentacles(void) glPopMatrix(); } - -static void -render_tentacles(void) -{ +static void render_tentacles(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); @@ -172,10 +181,7 @@ render_tentacles(void) glEnable(GL_TEXTURE_2D); } - -void -draw_tentacles(void) -{ +void draw_tentacles(void) { if (tentacles_first) createtentacles(); speed_tentacles = old_speed_tentacles; diff --git a/libvisual-plugins/plugins/actor/nebulus/tunnel.c b/libvisual-plugins/plugins/actor/nebulus/tunnel.c index cae60da50..2aae05764 100644 --- a/libvisual-plugins/plugins/actor/nebulus/tunnel.c +++ b/libvisual-plugins/plugins/actor/nebulus/tunnel.c @@ -5,8 +5,7 @@ GLfloat tunnel_time, tunnel_speed = 1.8f, old_tunnel_speed = 1.8f; -typedef struct -{ +typedef struct { GLfloat radius[COUNT]; } ring_type; @@ -16,15 +15,12 @@ GLfloat tex_rad = 1.0f, tex_len = 1.0f, len_fact = 0.50f, kot; int start_ring = 0; int tunnel_first = TRUE; - -void -precalculate_tunnel(void) -{ +void precalculate_tunnel(void) { int i, j, k, uring; GLfloat ckot0; GLfloat x, y, r; GLfloat rx, ry; - glcoord normal = { 0.0f, 0.0f, 0.0f }; + glcoord normal = {0.0f, 0.0f, 0.0f}; tunnel_time = 0.6f; for (k = 0; k < DEPTH; k++) { @@ -34,9 +30,9 @@ precalculate_tunnel(void) itime -= 1.0f; for (i = 0; i < COUNT; i++) { kot = (GLfloat)i / COUNT * PI2; - ring[start_ring].radius[i] = 100 + 20 * sinf(kot*3 + total_time) - + 20 * sinf(kot*2 + total_time*2 + 50) - + 15 * sinf(kot*4 - total_time*3 + 60); + ring[start_ring].radius[i] = 100 + 20 * sinf(kot * 3 + total_time) + + 20 * sinf(kot * 2 + total_time * 2 + 50) + + 15 * sinf(kot * 4 - total_time * 3 + 60); ring[start_ring].radius[i] *= 0.01f; } start_ring = (start_ring + 1) % DEPTH; @@ -54,11 +50,11 @@ precalculate_tunnel(void) normal.x = -x; normal.y = -y; normal.z = 1.0f - r; - normal.x = normal.x * sqrt(normal.x * normal.x + normal.y*normal.y + + normal.x = normal.x * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - normal.y = normal.y * sqrt(normal.x * normal.x + normal.y*normal.y + + normal.y = normal.y * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - normal.z = normal.z * sqrt(normal.x * normal.x + normal.y*normal.y + + normal.z = normal.z * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); ckot0 += 0.1f; rx = 0.3f * cosf(ckot0 + total_time * 3); @@ -69,11 +65,11 @@ precalculate_tunnel(void) normal.x = -x; normal.y = -y; normal.z = 1.0f - r; - normal.x = normal.x * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.x = normal.x * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - normal.y = normal.y * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.y = normal.y * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - normal.z = normal.z * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.z = normal.z * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); } uring = (uring + 1) % DEPTH; @@ -82,10 +78,7 @@ precalculate_tunnel(void) tunnel_first = FALSE; } - -static void -updatetunnel(void) -{ +static void updatetunnel(void) { int i; tunnel_time = 0.06f; @@ -95,26 +88,23 @@ updatetunnel(void) itime -= 1.0f; for (i = 0; i < COUNT; i++) { kot = (GLfloat)i / COUNT * PI2; - ring[start_ring].radius[i] = 100 + 20 * sinf(kot*3 + total_time) - + 20 * sinf(kot*2 + total_time*2 + 50) - + 15 * sinf(kot*4 - total_time*3 + 60); + ring[start_ring].radius[i] = 100 + 20 * sinf(kot * 3 + total_time) + + 20 * sinf(kot * 2 + total_time * 2 + 50) + + 15 * sinf(kot * 4 - total_time * 3 + 60); ring[start_ring].radius[i] *= 0.01f; } start_ring = (start_ring + 1) % DEPTH; } } - -static void -drawtunnel(void) -{ +static void drawtunnel(void) { int i, j, uring; GLfloat ckot0; GLfloat x, y, z, r; GLfloat rx, ry; GLfloat u, v; - GLfloat fog_color[3] = { 0.0f, 0.0f, 0.0f }; - glcoord normal = { 0.0f, 0.0f, 0.0f }; + GLfloat fog_color[3] = {0.0f, 0.0f, 0.0f}; + glcoord normal = {0.0f, 0.0f, 0.0f}; glPushMatrix(); glTranslatef(0.0f, 0.0f, 0.0f); @@ -141,11 +131,11 @@ drawtunnel(void) normal.x = -x; normal.y = -y; normal.z = 1.0f - r; - normal.x = normal.x * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.x = normal.x * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - normal.y = normal.y * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.y = normal.y * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - normal.z = normal.z * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.z = normal.z * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); glTexCoord2f(u, v); glVertex3f(x, y, z); @@ -160,11 +150,11 @@ drawtunnel(void) normal.x = -x; normal.y = -y; normal.z = 1.0f - r; - normal.x = normal.x * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.x = normal.x * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - normal.y = normal.y * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.y = normal.y * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); - normal.z = normal.z * sqrt(normal.x * normal.x + normal.y * normal.y + + normal.z = normal.z * sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); glTexCoord2f(u, v); glVertex3f(x, y, z); @@ -176,10 +166,7 @@ drawtunnel(void) glPopMatrix(); } - -static void -render_tunnel(void) -{ +static void render_tunnel(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); @@ -189,10 +176,7 @@ render_tunnel(void) glEnable(GL_TEXTURE_2D); } - -void -draw_tunnel(void) -{ +void draw_tunnel(void) { tunnel_speed = old_tunnel_speed; tunnel_speed = reduce_vsync(tunnel_speed); render_tunnel(); diff --git a/libvisual-plugins/plugins/actor/nebulus/twist.c b/libvisual-plugins/plugins/actor/nebulus/twist.c index f01a82824..98fee06f9 100644 --- a/libvisual-plugins/plugins/actor/nebulus/twist.c +++ b/libvisual-plugins/plugins/actor/nebulus/twist.c @@ -6,70 +6,59 @@ double rad[NR_SEGS], sinpos[NR_SEGS], xpos[NR_SEGS]; GLfloat twist_time, twist_speed = 0.04f, old_twist_speed = 0.04f; - -static void setvertex(int i, int j) -{ +static void setvertex(int i, int j) { GLfloat col; - col = (GLfloat)(1.2*rad[i]*sin(j*PI*2.0/(double)NR_DIVS)); + col = (GLfloat)(1.2 * rad[i] * sin(j * PI * 2.0 / (double)NR_DIVS)); glColor3f(col, col, col); - glTexCoord2f((GLfloat)(sinpos[i]+j*(3.0/(double)NR_DIVS)), - (GLfloat)(i*(3.0/(double)NR_SEGS))); + glTexCoord2f((GLfloat)(sinpos[i] + j * (3.0 / (double)NR_DIVS)), + (GLfloat)(i * (3.0 / (double)NR_SEGS))); j = j % NR_DIVS; - glVertex3f((GLfloat)(xpos[i]+rad[i]*cos(j*PI*2.0/(double)NR_DIVS)), - (GLfloat)(i*(5.5/(double)NR_SEGS)), - (GLfloat)(rad[i]*sin(j*PI*2.0/(double)NR_DIVS))); + glVertex3f((GLfloat)(xpos[i] + rad[i] * cos(j * PI * 2.0 / (double)NR_DIVS)), + (GLfloat)(i * (5.5 / (double)NR_SEGS)), + (GLfloat)(rad[i] * sin(j * PI * 2.0 / (double)NR_DIVS))); } - -static void -createtwist(void) -{ +static void createtwist(void) { int i, j; glBegin(GL_QUADS); - for( i = 0; i < (NR_SEGS-1); i++) { - for(j = 0; j < NR_DIVS; j++) { + for (i = 0; i < (NR_SEGS - 1); i++) { + for (j = 0; j < NR_DIVS; j++) { setvertex(i, j); - setvertex(i+1, j); - setvertex(i+1, j+1); - setvertex(i, j+1); + setvertex(i + 1, j); + setvertex(i + 1, j + 1); + setvertex(i, j + 1); } } glEnd(); } - -static void -drawtwist(void) -{ +static void drawtwist(void) { int i; glPushMatrix(); - glRotatef(twist_time*20, 0, 0, 1.0f); + glRotatef(twist_time * 20, 0, 0, 1.0f); glTranslatef(0.0f, -2.75f, -3.15f); - for(i = 0; i < NR_SEGS; i++) { - sinpos[i] = 0.53f*sin(twist_time*0.78f+(GLfloat)i/12.0f)+ - 0.45f*sin(twist_time*-1.23f+(GLfloat)i/18.0f); - rad[i] = 0.8f+0.3f*sin(twist_time+(GLfloat)i/8.0f)+ - 0.15f*sin(twist_time*-0.8f+(GLfloat)i/3.0f); - xpos[i] = 0.25f*sin(twist_time*1.23f+(GLfloat)i/5.0f)+ - 0.3f*sin(twist_time*0.9+(GLfloat)i/6.0); + for (i = 0; i < NR_SEGS; i++) { + sinpos[i] = 0.53f * sin(twist_time * 0.78f + (GLfloat)i / 12.0f) + + 0.45f * sin(twist_time * -1.23f + (GLfloat)i / 18.0f); + rad[i] = 0.8f + 0.3f * sin(twist_time + (GLfloat)i / 8.0f) + + 0.15f * sin(twist_time * -0.8f + (GLfloat)i / 3.0f); + xpos[i] = 0.25f * sin(twist_time * 1.23f + (GLfloat)i / 5.0f) + + 0.3f * sin(twist_time * 0.9 + (GLfloat)i / 6.0); } createtwist(); glPopMatrix(); } - -static void -render_twist(void) -{ +static void render_twist(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glViewport(0, 0, point_general->WIDTH, point_general->HEIGHT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(55.0f, (GLfloat)640/480, 1.0f, 20.0f); + gluPerspective(55.0f, (GLfloat)640 / 480, 1.0f, 20.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDisable(GL_BLEND); @@ -78,10 +67,7 @@ render_twist(void) glEnable(GL_TEXTURE_2D); } - -void -draw_twist(void) -{ +void draw_twist(void) { twist_speed = old_twist_speed; twist_speed = reduce_vsync(twist_speed); twist_time += twist_speed; diff --git a/libvisual-plugins/plugins/actor/oinksie/actor_oinksie.c b/libvisual-plugins/plugins/actor/oinksie/actor_oinksie.c index a28d15117..efedd6955 100644 --- a/libvisual-plugins/plugins/actor/oinksie/actor_oinksie.c +++ b/libvisual-plugins/plugins/actor/oinksie/actor_oinksie.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -26,406 +27,414 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR typedef struct { - OinksiePrivate priv1; - OinksiePrivate priv2; + OinksiePrivate priv1; + OinksiePrivate priv2; - int color_mode; + int color_mode; - VisVideoComposeFunc currentcomp; + VisVideoComposeFunc currentcomp; } OinksiePrivContainer; -static int act_oinksie_init (VisPluginData *plugin); -static void act_oinksie_cleanup (VisPluginData *plugin); -static void act_oinksie_requisition (VisPluginData *plugin, int *width, int *height); -static void act_oinksie_resize (VisPluginData *plugin, int width, int height); -static int act_oinksie_events (VisPluginData *plugin, VisEventQueue *events); -static VisPalette *act_oinksie_palette (VisPluginData *plugin); -static void act_oinksie_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); - -static void act_oinksie_set_color_mode (OinksiePrivContainer *self, int mode); -static void act_oinksie_set_acid_palette (OinksiePrivContainer *self, int palette); - -static void compose_blend1_32_c (VisVideo *dest, VisVideo *src); -static void compose_blend2_32_c (VisVideo *dest, VisVideo *src); -static void compose_blend3_32_c (VisVideo *dest, VisVideo *src); -static void compose_blend4_32_c (VisVideo *dest, VisVideo *src); -static void compose_blend5_32_c (VisVideo *dest, VisVideo *src); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = act_oinksie_requisition, - .palette = act_oinksie_palette, - .render = act_oinksie_render, - .vidoptions.depth = - VISUAL_VIDEO_DEPTH_8BIT | - VISUAL_VIDEO_DEPTH_32BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "oinksie", - .name = "oinksie plugin", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("Libvisual Oinksie visual plugin"), - .help = N_("This is the libvisual plugin for the Oinksie visual"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = act_oinksie_init, - .cleanup = act_oinksie_cleanup, - .events = act_oinksie_events, - .plugin = &actor - }; - - return &info; +static int act_oinksie_init(VisPluginData *plugin); +static void act_oinksie_cleanup(VisPluginData *plugin); +static void act_oinksie_requisition(VisPluginData *plugin, int *width, + int *height); +static void act_oinksie_resize(VisPluginData *plugin, int width, int height); +static int act_oinksie_events(VisPluginData *plugin, VisEventQueue *events); +static VisPalette *act_oinksie_palette(VisPluginData *plugin); +static void act_oinksie_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); + +static void act_oinksie_set_color_mode(OinksiePrivContainer *self, int mode); +static void act_oinksie_set_acid_palette(OinksiePrivContainer *self, + int palette); + +static void compose_blend1_32_c(VisVideo *dest, VisVideo *src); +static void compose_blend2_32_c(VisVideo *dest, VisVideo *src); +static void compose_blend3_32_c(VisVideo *dest, VisVideo *src); +static void compose_blend4_32_c(VisVideo *dest, VisVideo *src); +static void compose_blend5_32_c(VisVideo *dest, VisVideo *src); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = act_oinksie_requisition, + .palette = act_oinksie_palette, + .render = act_oinksie_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT | + VISUAL_VIDEO_DEPTH_32BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "oinksie", + .name = "oinksie plugin", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("Libvisual Oinksie visual plugin"), + .help = N_("This is the libvisual plugin for the Oinksie visual"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = act_oinksie_init, + .cleanup = act_oinksie_cleanup, + .events = act_oinksie_events, + .plugin = &actor}; + + return &info; } -static int act_oinksie_init (VisPluginData *plugin) -{ +static int act_oinksie_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_integer ("color_mode", N_("Color mode"), - 1, - NULL), - visual_param_new_integer ("acid_palette", N_("Acid palette"), - 0, - NULL), - NULL); - -/* - static VisParamEntry cmodeparamchoices[] = { - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Fair blended", 0), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Turbelent temperature", 1), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Acid summer", 2), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Perfect match", 3), - VISUAL_PARAM_LIST_ENTRY_INTEGER ("Sanity edge", 4), - VISUAL_PARAM_LIST_END - }; -*/ - - OinksiePrivContainer *priv = visual_mem_new0 (OinksiePrivContainer, 1); - visual_plugin_set_private (plugin, priv); - - priv->priv1.pal_cur = visual_palette_new (256); - priv->priv1.pal_old = visual_palette_new (256); - - priv->priv2.pal_cur = visual_palette_new (256); - priv->priv2.pal_old = visual_palette_new (256); - - VisRandomContext *rcontext = visual_plugin_get_random_context (plugin); - priv->priv1.rcontext = rcontext; - priv->priv2.rcontext = rcontext; - - oinksie_init (&priv->priv1, 64, 64); - oinksie_init (&priv->priv2, 64, 64); - - act_oinksie_set_color_mode (priv, 1); - act_oinksie_set_acid_palette (priv, 0); - - return TRUE; -} - -static void act_oinksie_cleanup (VisPluginData *plugin) -{ - OinksiePrivContainer *priv = visual_plugin_get_private (plugin); + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, visual_param_new_integer("color_mode", N_("Color mode"), 1, NULL), + visual_param_new_integer("acid_palette", N_("Acid palette"), 0, NULL), + NULL); - oinksie_quit (&priv->priv1); - oinksie_quit (&priv->priv2); + /* + static VisParamEntry cmodeparamchoices[] = { + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Fair blended", 0), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Turbelent temperature", 1), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Acid summer", 2), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Perfect match", 3), + VISUAL_PARAM_LIST_ENTRY_INTEGER ("Sanity edge", 4), + VISUAL_PARAM_LIST_END + }; + */ - visual_palette_free (priv->priv1.pal_cur); - visual_palette_free (priv->priv1.pal_old); + OinksiePrivContainer *priv = visual_mem_new0(OinksiePrivContainer, 1); + visual_plugin_set_private(plugin, priv); - visual_palette_free (priv->priv2.pal_cur); - visual_palette_free (priv->priv2.pal_old); + priv->priv1.pal_cur = visual_palette_new(256); + priv->priv1.pal_old = visual_palette_new(256); - visual_mem_free (priv); -} + priv->priv2.pal_cur = visual_palette_new(256); + priv->priv2.pal_old = visual_palette_new(256); -static void act_oinksie_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; + VisRandomContext *rcontext = visual_plugin_get_random_context(plugin); + priv->priv1.rcontext = rcontext; + priv->priv2.rcontext = rcontext; - reqw = *width; - reqh = *height; + oinksie_init(&priv->priv1, 64, 64); + oinksie_init(&priv->priv2, 64, 64); - while (reqw % 4) - reqw--; + act_oinksie_set_color_mode(priv, 1); + act_oinksie_set_acid_palette(priv, 0); - while (reqh % 4) - reqh--; + return TRUE; +} - if (reqw < 32) - reqw = 32; +static void act_oinksie_cleanup(VisPluginData *plugin) { + OinksiePrivContainer *priv = visual_plugin_get_private(plugin); - if (reqh < 32) - reqh = 32; + oinksie_quit(&priv->priv1); + oinksie_quit(&priv->priv2); - *width = reqw; - *height = reqh; -} + visual_palette_free(priv->priv1.pal_cur); + visual_palette_free(priv->priv1.pal_old); -static void act_oinksie_resize (VisPluginData *plugin, int width, int height) -{ - OinksiePrivContainer *priv = visual_plugin_get_private (plugin); + visual_palette_free(priv->priv2.pal_cur); + visual_palette_free(priv->priv2.pal_old); - oinksie_size_set (&priv->priv1, width, height); - oinksie_size_set (&priv->priv2, width, height); + visual_mem_free(priv); } -static int act_oinksie_events (VisPluginData *plugin, VisEventQueue *events) -{ - OinksiePrivContainer *priv = visual_plugin_get_private (plugin); - VisEvent ev; - VisParam *param; +static void act_oinksie_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - act_oinksie_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + reqw = *width; + reqh = *height; - case VISUAL_EVENT_PARAM: - param = ev.event.param.param; + while (reqw % 4) + reqw--; - if (visual_param_has_name (param, "color mode")) { - act_oinksie_set_color_mode (priv, visual_param_get_value_integer (param)); - } else if (visual_param_has_name (param, "acid palette")) { - act_oinksie_set_acid_palette (priv, visual_param_get_value_integer (param)); - } + while (reqh % 4) + reqh--; - break; + if (reqw < 32) + reqw = 32; - default: /* to avoid warnings */ - break; - } - } + if (reqh < 32) + reqh = 32; - return TRUE; + *width = reqw; + *height = reqh; } -static VisPalette *act_oinksie_palette (VisPluginData *plugin) -{ - OinksiePrivContainer *priv = visual_plugin_get_private (plugin); - VisPalette *pal; +static void act_oinksie_resize(VisPluginData *plugin, int width, int height) { + OinksiePrivContainer *priv = visual_plugin_get_private(plugin); - pal = oinksie_palette_get (&priv->priv1); - - return pal; + oinksie_size_set(&priv->priv1, width, height); + oinksie_size_set(&priv->priv2, width, height); } -static void act_oinksie_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - OinksiePrivContainer *priv = visual_plugin_get_private (plugin); - - /* Left audio */ - VisBuffer *pcmbuf1 = visual_buffer_new_wrap_data (priv->priv1.audio.pcm[0], sizeof (priv->priv1.audio.pcm[0]), FALSE); - visual_audio_get_sample (audio, pcmbuf1, VISUAL_AUDIO_CHANNEL_LEFT); - - VisBuffer *spmbuf1 = visual_buffer_new_wrap_data (priv->priv1.audio.freq[0], sizeof (priv->priv1.audio.freq[0]), FALSE); - visual_audio_get_spectrum_for_sample (spmbuf1, pcmbuf1, FALSE); - visual_buffer_unref(pcmbuf1); - visual_buffer_unref(spmbuf1); - - /* Right audio */ - VisBuffer *pcmbuf2 = visual_buffer_new_wrap_data (priv->priv1.audio.pcm[1], sizeof (priv->priv1.audio.pcm[1]), FALSE); - visual_audio_get_sample (audio, pcmbuf2, VISUAL_AUDIO_CHANNEL_RIGHT); +static int act_oinksie_events(VisPluginData *plugin, VisEventQueue *events) { + OinksiePrivContainer *priv = visual_plugin_get_private(plugin); + VisEvent ev; + VisParam *param; - VisBuffer *spmbuf2 = visual_buffer_new_wrap_data (priv->priv1.audio.freq[1], sizeof (priv->priv1.audio.freq[1]), FALSE); - visual_audio_get_spectrum_for_sample (spmbuf2, pcmbuf2, FALSE); - visual_buffer_unref (pcmbuf2); - visual_buffer_unref (spmbuf2); + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + act_oinksie_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; - /* Mix channels */ - VisBuffer *pcmmix = visual_buffer_new_wrap_data (priv->priv1.audio.pcm[2], sizeof (priv->priv1.audio.pcm[2]), FALSE); - visual_audio_get_sample_mixed_simple (audio, pcmmix, 2, VISUAL_AUDIO_CHANNEL_LEFT, VISUAL_AUDIO_CHANNEL_RIGHT); + case VISUAL_EVENT_PARAM: + param = ev.event.param.param; - VisBuffer *spmmix = visual_buffer_new_wrap_data (priv->priv1.audio.freqsmall, sizeof (priv->priv1.audio.freqsmall), FALSE); - visual_audio_get_spectrum_for_sample (spmmix, pcmmix, FALSE); - visual_buffer_unref (pcmmix); - visual_buffer_unref (spmmix); + if (visual_param_has_name(param, "color mode")) { + act_oinksie_set_color_mode(priv, visual_param_get_value_integer(param)); + } else if (visual_param_has_name(param, "acid palette")) { + act_oinksie_set_acid_palette(priv, + visual_param_get_value_integer(param)); + } - /* Duplicate for second oinksie instance */ - visual_mem_copy (priv->priv2.audio.pcm, priv->priv1.audio.pcm, sizeof (priv->priv1.audio.pcm)); - visual_mem_copy (priv->priv2.audio.freq, priv->priv1.audio.freq, sizeof (priv->priv1.audio.freq)); - visual_mem_copy (priv->priv2.audio.freqsmall, priv->priv1.audio.freqsmall, sizeof (priv->priv1.audio.freqsmall)); + break; - /* Audio energy */ - priv->priv1.audio.energy = 0 /*audio->energy*/; - priv->priv2.audio.energy = 0 /*audio->energy*/; + default: /* to avoid warnings */ + break; + } + } - /* Let's get rendering */ - - VisVideoDepth video_depth = visual_video_get_depth (video); - - if (video_depth == VISUAL_VIDEO_DEPTH_8BIT) { - oinksie_sample (&priv->priv1); - - /* FIXME this is not pitch safe, will screw up region buffers. - * pass on the VisVideo to the plugin, and be pitch safe. - */ - priv->priv1.drawbuf = visual_video_get_pixels (video); - oinksie_render (&priv->priv1); - } else { - int width = visual_video_get_width (video); - int height = visual_video_get_height (video); - - VisVideo *vid1 = visual_video_new_with_buffer (width, height, VISUAL_VIDEO_DEPTH_8BIT); - visual_video_set_palette (vid1, oinksie_palette_get (&priv->priv1)); - - VisVideo *vid2 = visual_video_new_with_buffer (width, height, VISUAL_VIDEO_DEPTH_8BIT); - visual_video_set_palette (vid2, oinksie_palette_get (&priv->priv2)); - - priv->priv1.drawbuf = visual_video_get_pixels (vid1); - priv->priv2.drawbuf = visual_video_get_pixels (vid2); - - oinksie_sample (&priv->priv1); - oinksie_sample (&priv->priv2); + return TRUE; +} - oinksie_render (&priv->priv1); - oinksie_render (&priv->priv2); +static VisPalette *act_oinksie_palette(VisPluginData *plugin) { + OinksiePrivContainer *priv = visual_plugin_get_private(plugin); + VisPalette *pal; - visual_video_blit (video, vid1, 0, 0, FALSE); + pal = oinksie_palette_get(&priv->priv1); - visual_video_set_compose_type (vid2, VISUAL_VIDEO_COMPOSE_TYPE_CUSTOM); - visual_video_set_compose_function (vid2, priv->currentcomp); - visual_video_blit (video, vid2, 0, 0, TRUE); + return pal; +} - visual_video_unref (vid1); - visual_video_unref (vid2); - } +static void act_oinksie_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + OinksiePrivContainer *priv = visual_plugin_get_private(plugin); + + /* Left audio */ + VisBuffer *pcmbuf1 = visual_buffer_new_wrap_data( + priv->priv1.audio.pcm[0], sizeof(priv->priv1.audio.pcm[0]), FALSE); + visual_audio_get_sample(audio, pcmbuf1, VISUAL_AUDIO_CHANNEL_LEFT); + + VisBuffer *spmbuf1 = visual_buffer_new_wrap_data( + priv->priv1.audio.freq[0], sizeof(priv->priv1.audio.freq[0]), FALSE); + visual_audio_get_spectrum_for_sample(spmbuf1, pcmbuf1, FALSE); + visual_buffer_unref(pcmbuf1); + visual_buffer_unref(spmbuf1); + + /* Right audio */ + VisBuffer *pcmbuf2 = visual_buffer_new_wrap_data( + priv->priv1.audio.pcm[1], sizeof(priv->priv1.audio.pcm[1]), FALSE); + visual_audio_get_sample(audio, pcmbuf2, VISUAL_AUDIO_CHANNEL_RIGHT); + + VisBuffer *spmbuf2 = visual_buffer_new_wrap_data( + priv->priv1.audio.freq[1], sizeof(priv->priv1.audio.freq[1]), FALSE); + visual_audio_get_spectrum_for_sample(spmbuf2, pcmbuf2, FALSE); + visual_buffer_unref(pcmbuf2); + visual_buffer_unref(spmbuf2); + + /* Mix channels */ + VisBuffer *pcmmix = visual_buffer_new_wrap_data( + priv->priv1.audio.pcm[2], sizeof(priv->priv1.audio.pcm[2]), FALSE); + visual_audio_get_sample_mixed_simple( + audio, pcmmix, 2, VISUAL_AUDIO_CHANNEL_LEFT, VISUAL_AUDIO_CHANNEL_RIGHT); + + VisBuffer *spmmix = visual_buffer_new_wrap_data( + priv->priv1.audio.freqsmall, sizeof(priv->priv1.audio.freqsmall), FALSE); + visual_audio_get_spectrum_for_sample(spmmix, pcmmix, FALSE); + visual_buffer_unref(pcmmix); + visual_buffer_unref(spmmix); + + /* Duplicate for second oinksie instance */ + visual_mem_copy(priv->priv2.audio.pcm, priv->priv1.audio.pcm, + sizeof(priv->priv1.audio.pcm)); + visual_mem_copy(priv->priv2.audio.freq, priv->priv1.audio.freq, + sizeof(priv->priv1.audio.freq)); + visual_mem_copy(priv->priv2.audio.freqsmall, priv->priv1.audio.freqsmall, + sizeof(priv->priv1.audio.freqsmall)); + + /* Audio energy */ + priv->priv1.audio.energy = 0 /*audio->energy*/; + priv->priv2.audio.energy = 0 /*audio->energy*/; + + /* Let's get rendering */ + + VisVideoDepth video_depth = visual_video_get_depth(video); + + if (video_depth == VISUAL_VIDEO_DEPTH_8BIT) { + oinksie_sample(&priv->priv1); + + /* FIXME this is not pitch safe, will screw up region buffers. + * pass on the VisVideo to the plugin, and be pitch safe. + */ + priv->priv1.drawbuf = visual_video_get_pixels(video); + oinksie_render(&priv->priv1); + } else { + int width = visual_video_get_width(video); + int height = visual_video_get_height(video); + + VisVideo *vid1 = + visual_video_new_with_buffer(width, height, VISUAL_VIDEO_DEPTH_8BIT); + visual_video_set_palette(vid1, oinksie_palette_get(&priv->priv1)); + + VisVideo *vid2 = + visual_video_new_with_buffer(width, height, VISUAL_VIDEO_DEPTH_8BIT); + visual_video_set_palette(vid2, oinksie_palette_get(&priv->priv2)); + + priv->priv1.drawbuf = visual_video_get_pixels(vid1); + priv->priv2.drawbuf = visual_video_get_pixels(vid2); + + oinksie_sample(&priv->priv1); + oinksie_sample(&priv->priv2); + + oinksie_render(&priv->priv1); + oinksie_render(&priv->priv2); + + visual_video_blit(video, vid1, 0, 0, FALSE); + + visual_video_set_compose_type(vid2, VISUAL_VIDEO_COMPOSE_TYPE_CUSTOM); + visual_video_set_compose_function(vid2, priv->currentcomp); + visual_video_blit(video, vid2, 0, 0, TRUE); + + visual_video_unref(vid1); + visual_video_unref(vid2); + } } -static void act_oinksie_set_color_mode (OinksiePrivContainer *self, int mode) -{ - self->color_mode = mode; - - switch (self->color_mode) { - case 0: self->currentcomp = compose_blend1_32_c; break; - case 1: self->currentcomp = compose_blend2_32_c; break; - case 2: self->currentcomp = compose_blend3_32_c; break; - case 3: self->currentcomp = compose_blend4_32_c; break; - case 4: self->currentcomp = compose_blend5_32_c; break; - default: self->currentcomp = compose_blend2_32_c; break; - } +static void act_oinksie_set_color_mode(OinksiePrivContainer *self, int mode) { + self->color_mode = mode; + + switch (self->color_mode) { + case 0: + self->currentcomp = compose_blend1_32_c; + break; + case 1: + self->currentcomp = compose_blend2_32_c; + break; + case 2: + self->currentcomp = compose_blend3_32_c; + break; + case 3: + self->currentcomp = compose_blend4_32_c; + break; + case 4: + self->currentcomp = compose_blend5_32_c; + break; + default: + self->currentcomp = compose_blend2_32_c; + break; + } } -static void act_oinksie_set_acid_palette (OinksiePrivContainer *self, int palette) -{ - self->priv1.config.acidpalette = palette; +static void act_oinksie_set_acid_palette(OinksiePrivContainer *self, + int palette) { + self->priv1.config.acidpalette = palette; } -static void compose_blend1_32_c (VisVideo *dest, VisVideo *src) -{ - int i, j; - uint8_t *destbuf = visual_video_get_pixels (dest); - uint8_t *srcbuf = visual_video_get_pixels (src); - uint8_t alpha = 128; - - int src_width = visual_video_get_width (src); - int src_height = visual_video_get_height (src); - - for (i = 0; i < src_height; i++) { - for (j = 0; j < src_width; j++) { - destbuf[0] = (alpha * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; - destbuf[1] = (alpha * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; - destbuf[2] = (alpha * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; - - destbuf += 4; - srcbuf += 4; - } - } +static void compose_blend1_32_c(VisVideo *dest, VisVideo *src) { + int i, j; + uint8_t *destbuf = visual_video_get_pixels(dest); + uint8_t *srcbuf = visual_video_get_pixels(src); + uint8_t alpha = 128; + + int src_width = visual_video_get_width(src); + int src_height = visual_video_get_height(src); + + for (i = 0; i < src_height; i++) { + for (j = 0; j < src_width; j++) { + destbuf[0] = (alpha * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; + destbuf[1] = (alpha * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; + destbuf[2] = (alpha * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; + + destbuf += 4; + srcbuf += 4; + } + } } -static void compose_blend2_32_c (VisVideo *dest, VisVideo *src) -{ - int i, j; - uint8_t *destbuf = visual_video_get_pixels (dest); - uint8_t *srcbuf = visual_video_get_pixels (src); - uint8_t alpha = 128; - - int src_width = visual_video_get_width (src); - int src_height = visual_video_get_height (src); - - for (i = 0; i < src_height; i++) { - for (j = 0; j < src_width; j++) { - destbuf[0] = (destbuf[0] * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; - destbuf[1] = (alpha * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; - destbuf[2] = (0 * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; - - destbuf += 4; - srcbuf += 4; - } - } +static void compose_blend2_32_c(VisVideo *dest, VisVideo *src) { + int i, j; + uint8_t *destbuf = visual_video_get_pixels(dest); + uint8_t *srcbuf = visual_video_get_pixels(src); + uint8_t alpha = 128; + + int src_width = visual_video_get_width(src); + int src_height = visual_video_get_height(src); + + for (i = 0; i < src_height; i++) { + for (j = 0; j < src_width; j++) { + destbuf[0] = (destbuf[0] * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; + destbuf[1] = (alpha * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; + destbuf[2] = (0 * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; + + destbuf += 4; + srcbuf += 4; + } + } } -static void compose_blend3_32_c (VisVideo *dest, VisVideo *src) -{ - int i, j; - uint8_t *destbuf = visual_video_get_pixels (dest); - uint8_t *srcbuf = visual_video_get_pixels (src); - uint8_t alpha = 128; - - int src_width = visual_video_get_width (src); - int src_height = visual_video_get_height (src); - - for (i = 0; i < src_height; i++) { - for (j = 0; j < src_width; j++) { - destbuf[0] = (0 * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; - destbuf[1] = (alpha * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; - destbuf[2] = (destbuf[0] * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; - - destbuf += 4; - srcbuf += 4; - } - } +static void compose_blend3_32_c(VisVideo *dest, VisVideo *src) { + int i, j; + uint8_t *destbuf = visual_video_get_pixels(dest); + uint8_t *srcbuf = visual_video_get_pixels(src); + uint8_t alpha = 128; + + int src_width = visual_video_get_width(src); + int src_height = visual_video_get_height(src); + + for (i = 0; i < src_height; i++) { + for (j = 0; j < src_width; j++) { + destbuf[0] = (0 * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; + destbuf[1] = (alpha * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; + destbuf[2] = (destbuf[0] * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; + + destbuf += 4; + srcbuf += 4; + } + } } -static void compose_blend4_32_c (VisVideo *dest, VisVideo *src) -{ - int i, j; - uint8_t *destbuf = visual_video_get_pixels (dest); - uint8_t *srcbuf = visual_video_get_pixels (src); - uint8_t alpha = 128; - - int src_width = visual_video_get_width (src); - int src_height = visual_video_get_height (src); - - for (i = 0; i < src_height; i++) { - for (j = 0; j < src_width; j++) { - destbuf[0] = (destbuf[0] * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; - destbuf[1] = (alpha * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; - destbuf[2] = (srcbuf[0] * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; - - destbuf += 4; - srcbuf += 4; - } - } +static void compose_blend4_32_c(VisVideo *dest, VisVideo *src) { + int i, j; + uint8_t *destbuf = visual_video_get_pixels(dest); + uint8_t *srcbuf = visual_video_get_pixels(src); + uint8_t alpha = 128; + + int src_width = visual_video_get_width(src); + int src_height = visual_video_get_height(src); + + for (i = 0; i < src_height; i++) { + for (j = 0; j < src_width; j++) { + destbuf[0] = (destbuf[0] * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; + destbuf[1] = (alpha * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; + destbuf[2] = (srcbuf[0] * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; + + destbuf += 4; + srcbuf += 4; + } + } } -static void compose_blend5_32_c (VisVideo *dest, VisVideo *src) -{ - int i, j; +static void compose_blend5_32_c(VisVideo *dest, VisVideo *src) { + int i, j; - uint8_t *destbuf = visual_video_get_pixels (dest); - uint8_t *srcbuf = visual_video_get_pixels (src); + uint8_t *destbuf = visual_video_get_pixels(dest); + uint8_t *srcbuf = visual_video_get_pixels(src); - int src_width = visual_video_get_width (src); - int src_height = visual_video_get_height (src); + int src_width = visual_video_get_width(src); + int src_height = visual_video_get_height(src); - for (i = 0; i < src_height; i++) { - for (j = 0; j < src_width; j++) { - destbuf[0] = (destbuf[0] * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; - destbuf[1] = (srcbuf[0] * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; - destbuf[2] = (destbuf[0] * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; + for (i = 0; i < src_height; i++) { + for (j = 0; j < src_width; j++) { + destbuf[0] = (destbuf[0] * (destbuf[0] - srcbuf[0]) >> 8) + srcbuf[0]; + destbuf[1] = (srcbuf[0] * (destbuf[1] - srcbuf[1]) >> 8) + srcbuf[1]; + destbuf[2] = (destbuf[0] * (destbuf[2] - srcbuf[2]) >> 8) + srcbuf[2]; - destbuf += 4; - srcbuf += 4; - } - } + destbuf += 4; + srcbuf += 4; + } + } } diff --git a/libvisual-plugins/plugins/actor/oinksie/audio.c b/libvisual-plugins/plugins/actor/oinksie/audio.c index 80dc01a4b..89cad5bf6 100644 --- a/libvisual-plugins/plugins/actor/oinksie/audio.c +++ b/libvisual-plugins/plugins/actor/oinksie/audio.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -30,26 +31,24 @@ #include "config.h" #include "audio.h" - /* audio priv->audio.freq analyze */ -void _oink_audio_analyse (OinksiePrivate *priv) -{ - priv->audio.bass = (priv->audio.freqsmall[0] + priv->audio.freqsmall[1]) * 20; - priv->audio.tripple = (priv->audio.freqsmall[2] + priv->audio.freqsmall[3]) * 100; - priv->audio.highest = MAX (priv->audio.bass, priv->audio.tripple); - - if (priv->audio.bass >= 0 && priv->audio.bass <= 2) - priv->audio.musicmood = 0; - else if (priv->audio.bass >= 3 && priv->audio.bass <= 6) - priv->audio.musicmood = 1; - else if (priv->audio.bass >= 7 && priv->audio.bass <= 10) - priv->audio.musicmood = 2; - else - priv->audio.musicmood = 0; - - priv->audio.beat = FALSE; - - if (priv->audio.bass >= 9) - priv->audio.beat = TRUE; +void _oink_audio_analyse(OinksiePrivate *priv) { + priv->audio.bass = (priv->audio.freqsmall[0] + priv->audio.freqsmall[1]) * 20; + priv->audio.tripple = + (priv->audio.freqsmall[2] + priv->audio.freqsmall[3]) * 100; + priv->audio.highest = MAX(priv->audio.bass, priv->audio.tripple); + + if (priv->audio.bass >= 0 && priv->audio.bass <= 2) + priv->audio.musicmood = 0; + else if (priv->audio.bass >= 3 && priv->audio.bass <= 6) + priv->audio.musicmood = 1; + else if (priv->audio.bass >= 7 && priv->audio.bass <= 10) + priv->audio.musicmood = 2; + else + priv->audio.musicmood = 0; + + priv->audio.beat = FALSE; + + if (priv->audio.bass >= 9) + priv->audio.beat = TRUE; } - diff --git a/libvisual-plugins/plugins/actor/oinksie/audio.h b/libvisual-plugins/plugins/actor/oinksie/audio.h index c10a1a170..6814a0d35 100644 --- a/libvisual-plugins/plugins/actor/oinksie/audio.h +++ b/libvisual-plugins/plugins/actor/oinksie/audio.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -26,6 +27,6 @@ #include "oinksie.h" -void _oink_audio_analyse (OinksiePrivate *priv); +void _oink_audio_analyse(OinksiePrivate *priv); #endif /* _OINK_AUDIO_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/common.h b/libvisual-plugins/plugins/actor/oinksie/common.h index aa934c3e1..e361befd3 100644 --- a/libvisual-plugins/plugins/actor/oinksie/common.h +++ b/libvisual-plugins/plugins/actor/oinksie/common.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -27,10 +28,10 @@ #include #include -#define PI 3.14159265358979323846 +#define PI 3.14159265358979323846 #define MAX(a, b) (a > b ? a : b) -#define MIN(a ,b) (a > b ? b : a) +#define MIN(a, b) (a > b ? b : a) #define BYTETRUNC(a) ((a) > 255 ? 255 : (a)) diff --git a/libvisual-plugins/plugins/actor/oinksie/config-defines.h b/libvisual-plugins/plugins/actor/oinksie/config-defines.h index b83ecf6b0..60444de39 100644 --- a/libvisual-plugins/plugins/actor/oinksie/config-defines.h +++ b/libvisual-plugins/plugins/actor/oinksie/config-defines.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -24,9 +25,9 @@ #ifndef _OINK_CONFIG_DEFINES_H #define _OINK_CONFIG_DEFINES_H -#define CONFIG_BLURMODES 2 -#define CONFIG_MUSICMOODS 3 -#define CONFIG_SCOPEMODES 8 -#define CONFIG_BACKGROUNDMODES 6 +#define CONFIG_BLURMODES 2 +#define CONFIG_MUSICMOODS 3 +#define CONFIG_SCOPEMODES 8 +#define CONFIG_BACKGROUNDMODES 6 #endif /* _OINK_CONFIG_DEFINES_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/config.c b/libvisual-plugins/plugins/actor/oinksie/config.c index 13d9c43bb..a53b41742 100644 --- a/libvisual-plugins/plugins/actor/oinksie/config.c +++ b/libvisual-plugins/plugins/actor/oinksie/config.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -30,23 +31,21 @@ #include "oink-config.h" /* random configs */ -void _oink_config_random_blurmode (OinksiePrivate *priv) -{ - priv->config.blurmode = visual_random_context_int_range (priv->rcontext, 0, CONFIG_BLURMODES); +void _oink_config_random_blurmode(OinksiePrivate *priv) { + priv->config.blurmode = + visual_random_context_int_range(priv->rcontext, 0, CONFIG_BLURMODES); } -void _oink_config_random_scopemode (OinksiePrivate *priv) -{ - priv->config.scopemode = visual_random_context_int_range (priv->rcontext, 0, CONFIG_SCOPEMODES); +void _oink_config_random_scopemode(OinksiePrivate *priv) { + priv->config.scopemode = + visual_random_context_int_range(priv->rcontext, 0, CONFIG_SCOPEMODES); } -void _oink_config_random_backgroundmode (OinksiePrivate *priv) -{ - priv->config.backgroundmode = visual_random_context_int_range (priv->rcontext, 0, CONFIG_BACKGROUNDMODES); +void _oink_config_random_backgroundmode(OinksiePrivate *priv) { + priv->config.backgroundmode = visual_random_context_int_range( + priv->rcontext, 0, CONFIG_BACKGROUNDMODES); } -void _oink_config_random_palfunky (OinksiePrivate *priv) -{ - priv->config.palfunky = visual_random_context_int_range (priv->rcontext, 0, 1); +void _oink_config_random_palfunky(OinksiePrivate *priv) { + priv->config.palfunky = visual_random_context_int_range(priv->rcontext, 0, 1); } - diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-analyzer.c b/libvisual-plugins/plugins/actor/oinksie/gfx-analyzer.c index d1232766b..745392902 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-analyzer.c +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-analyzer.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -28,53 +29,54 @@ #include "gfx-misc.h" #include "gfx-analyzer.h" -#define ANALYZER_BANDS 32 +#define ANALYZER_BANDS 32 -void _oink_gfx_analyzer_stereo (OinksiePrivate *priv, uint8_t *buf, int color, int y) -{ - int adder = (priv->screen_width - ((priv->screen_halfwidth / ANALYZER_BANDS) * ANALYZER_BANDS * 2)) / 2; +void _oink_gfx_analyzer_stereo(OinksiePrivate *priv, uint8_t *buf, int color, + int y) { + int adder = (priv->screen_width - ((priv->screen_halfwidth / ANALYZER_BANDS) * + ANALYZER_BANDS * 2)) / + 2; - int i; + int i; - int y1; - int x1; + int y1; + int x1; - int y2; - int x2; + int y2; + int x2; - int real_x = 0; - int real_x_add = (priv->screen_halfwidth / ANALYZER_BANDS); + int real_x = 0; + int real_x_add = (priv->screen_halfwidth / ANALYZER_BANDS); - y2 = y; - x2 = 0; + y2 = y; + x2 = 0; - for (i = ANALYZER_BANDS; i >= 0; i--) - { - y1 = (-(priv->audio.freq[0][i] * priv->screen_height) * 2) + y; - x1 = real_x += real_x_add; + for (i = ANALYZER_BANDS; i >= 0; i--) { + y1 = (-(priv->audio.freq[0][i] * priv->screen_height) * 2) + y; + x1 = real_x += real_x_add; - if (y1 < 0) y1 = 0; + if (y1 < 0) + y1 = 0; - _oink_gfx_line (priv, buf, color, x1 + adder, y1, x2 + adder, y2); + _oink_gfx_line(priv, buf, color, x1 + adder, y1, x2 + adder, y2); - y2 = y1; - x2 = x1; - } + y2 = y1; + x2 = x1; + } - for (i = 1; i < ANALYZER_BANDS; i++) - { - y1 = (-(priv->audio.freq[1][i] * priv->screen_height) * 2) + y; - if (y1 == ANALYZER_BANDS - 1) - y1 = y; + for (i = 1; i < ANALYZER_BANDS; i++) { + y1 = (-(priv->audio.freq[1][i] * priv->screen_height) * 2) + y; + if (y1 == ANALYZER_BANDS - 1) + y1 = y; - x1 = real_x += real_x_add; + x1 = real_x += real_x_add; - if (y1 < 0) y1 = 0; + if (y1 < 0) + y1 = 0; - _oink_gfx_line (priv, buf, color, x1 + adder, y1, x2 + adder, y2); + _oink_gfx_line(priv, buf, color, x1 + adder, y1, x2 + adder, y2); - y2 = y1; - x2 = x1; - } + y2 = y1; + x2 = x1; + } } - diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-analyzer.h b/libvisual-plugins/plugins/actor/oinksie/gfx-analyzer.h index 1ac8b58db..1bca55fac 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-analyzer.h +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-analyzer.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -24,6 +25,7 @@ #ifndef _OINK_GFX_ANALYZER_H #define _OINK_GFX_ANALYZER_H -void _oink_gfx_analyzer_stereo (OinksiePrivate *priv, uint8_t *buf, int color, int y); +void _oink_gfx_analyzer_stereo(OinksiePrivate *priv, uint8_t *buf, int color, + int y); #endif /* _OINK_GFX_ANALYZER_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-background.c b/libvisual-plugins/plugins/actor/oinksie/gfx-background.c index 8c56638ae..e115ae432 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-background.c +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-background.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -32,167 +33,166 @@ #include "misc.h" #include "gfx-background.h" -void _oink_gfx_background_circles_sine (OinksiePrivate *priv, - uint8_t *buf, int color, int rotate, int scroll, int stretch, int size) -{ - int i; - int y; - int y1; - int x; - int x1; - int tab; - int sadd = priv->screen_xysmallest / 2; - float sden; - - rotate = abs (rotate); - scroll = abs (scroll); - stretch = abs (stretch); - - tab = scroll; - - for (i = 0; i < priv->screen_width; i+= 20) - { - sden = _oink_table_sin[abs (tab % OINK_TABLE_NORMAL_SIZE)]; - y = (sden * size) + sadd; - - sden = _oink_table_sin[abs ((tab + OINK_TABLE_NORMAL_SIZE / 2) % OINK_TABLE_NORMAL_SIZE)]; - y1 = (sden * size) + sadd; - - x = i - priv->screen_halfwidth; - x1 = x; - - y = y - priv->screen_halfheight; - y1 = y1 - priv->screen_halfheight; - - _oink_pixel_rotate (&x, &y, rotate); - _oink_pixel_rotate (&x1, &y1, rotate); - - _oink_gfx_circle_filled (priv, buf, color - fabs (sden * 20), 15 - fabs (sden * 10), - x + priv->screen_halfwidth, y + priv->screen_halfheight); - _oink_gfx_circle_filled (priv, buf, color - fabs (sden * 20), 15 - fabs (sden * 10), - x1 + priv->screen_halfwidth, y1 + priv->screen_halfheight); - - tab += stretch; - } +void _oink_gfx_background_circles_sine(OinksiePrivate *priv, uint8_t *buf, + int color, int rotate, int scroll, + int stretch, int size) { + int i; + int y; + int y1; + int x; + int x1; + int tab; + int sadd = priv->screen_xysmallest / 2; + float sden; + + rotate = abs(rotate); + scroll = abs(scroll); + stretch = abs(stretch); + + tab = scroll; + + for (i = 0; i < priv->screen_width; i += 20) { + sden = _oink_table_sin[abs(tab % OINK_TABLE_NORMAL_SIZE)]; + y = (sden * size) + sadd; + + sden = _oink_table_sin[abs((tab + OINK_TABLE_NORMAL_SIZE / 2) % + OINK_TABLE_NORMAL_SIZE)]; + y1 = (sden * size) + sadd; + + x = i - priv->screen_halfwidth; + x1 = x; + + y = y - priv->screen_halfheight; + y1 = y1 - priv->screen_halfheight; + + _oink_pixel_rotate(&x, &y, rotate); + _oink_pixel_rotate(&x1, &y1, rotate); + + _oink_gfx_circle_filled(priv, buf, color - fabs(sden * 20), + 15 - fabs(sden * 10), x + priv->screen_halfwidth, + y + priv->screen_halfheight); + _oink_gfx_circle_filled(priv, buf, color - fabs(sden * 20), + 15 - fabs(sden * 10), x1 + priv->screen_halfwidth, + y1 + priv->screen_halfheight); + + tab += stretch; + } } -void _oink_gfx_background_circles_filled (OinksiePrivate *priv, - uint8_t *buf, int color, int size, int number, int distance, int turn, int x, int y) -{ - int i; - int xi; - int yi; - int adder = OINK_TABLE_NORMAL_SIZE / number; - int tab = turn % OINK_TABLE_NORMAL_SIZE; - - if (tab < 0) - { - tab = OINK_TABLE_NORMAL_SIZE - +tab; - tab = tab % OINK_TABLE_NORMAL_SIZE; - } - - for (i = 0; i < number; i++) - { - xi = (_oink_table_sin[tab % OINK_TABLE_NORMAL_SIZE] * distance) + x; - yi = (_oink_table_cos[tab % OINK_TABLE_NORMAL_SIZE] * distance) + y; - - tab += adder; - - _oink_gfx_circle_filled (priv, buf, color, size, xi, yi); - } +void _oink_gfx_background_circles_filled(OinksiePrivate *priv, uint8_t *buf, + int color, int size, int number, + int distance, int turn, int x, int y) { + int i; + int xi; + int yi; + int adder = OINK_TABLE_NORMAL_SIZE / number; + int tab = turn % OINK_TABLE_NORMAL_SIZE; + + if (tab < 0) { + tab = OINK_TABLE_NORMAL_SIZE - +tab; + tab = tab % OINK_TABLE_NORMAL_SIZE; + } + + for (i = 0; i < number; i++) { + xi = (_oink_table_sin[tab % OINK_TABLE_NORMAL_SIZE] * distance) + x; + yi = (_oink_table_cos[tab % OINK_TABLE_NORMAL_SIZE] * distance) + y; + + tab += adder; + + _oink_gfx_circle_filled(priv, buf, color, size, xi, yi); + } } -// In C, `-8 % 5` yields -3 (and `-8 % 5u` yields +3) rather than 2. This wrapper corrects for it. +// In C, `-8 % 5` yields -3 (and `-8 % 5u` yields +3) rather than 2. This +// wrapper corrects for it. static int mod(int a, int n) { - const int original = a % n; - return (original >= 0) ? original : (original + n); + const int original = a % n; + return (original >= 0) ? original : (original + n); } -void _oink_gfx_background_floaters (OinksiePrivate *priv, - uint8_t *buf, int color, int size, int number, int xturn, int yturn, int x, int badd1, int badd2) -{ - int i; - int xi; - int yi; - int xb; - int yb; - int add1 = 0; - int add2 = 0; - - int mul = ((priv->screen_width - 20) / number); - - for (i = 0; i < number; i++) - { - xi = (_oink_table_sin[mod(xturn + add1, OINK_TABLE_NORMAL_SIZE)] * (float) (priv->screen_width / (number + 1))); - yi = (_oink_table_cos[mod(yturn + add2, OINK_TABLE_NORMAL_SIZE)] * (float) (priv->screen_height / 5)); - - xb = xi + (i * mul) + 20; - yb = yi + x; - - if (xb > 0 + size || xb < priv->screen_width - size || yb > 0 + size || yb < priv->screen_height - size) - _oink_gfx_circle_filled (priv, buf, color, size, xb, yb); - - add1 += badd1; - add2 += badd2; - } +void _oink_gfx_background_floaters(OinksiePrivate *priv, uint8_t *buf, + int color, int size, int number, int xturn, + int yturn, int x, int badd1, int badd2) { + int i; + int xi; + int yi; + int xb; + int yb; + int add1 = 0; + int add2 = 0; + + int mul = ((priv->screen_width - 20) / number); + + for (i = 0; i < number; i++) { + xi = (_oink_table_sin[mod(xturn + add1, OINK_TABLE_NORMAL_SIZE)] * + (float)(priv->screen_width / (number + 1))); + yi = (_oink_table_cos[mod(yturn + add2, OINK_TABLE_NORMAL_SIZE)] * + (float)(priv->screen_height / 5)); + + xb = xi + (i * mul) + 20; + yb = yi + x; + + if (xb > 0 + size || xb < priv->screen_width - size || yb > 0 + size || + yb < priv->screen_height - size) + _oink_gfx_circle_filled(priv, buf, color, size, xb, yb); + + add1 += badd1; + add2 += badd2; + } } -void _oink_gfx_background_ball_shooting (OinksiePrivate *priv, - uint8_t *buf, int color, int distance, int xb, int yb, int x, int y) -{ - int xi = _oink_line_xory_next_xy (0, distance, x, y, xb, yb); - int yi = _oink_line_xory_next_xy (1, distance, x, y, xb, yb); +void _oink_gfx_background_ball_shooting(OinksiePrivate *priv, uint8_t *buf, + int color, int distance, int xb, int yb, + int x, int y) { + int xi = _oink_line_xory_next_xy(0, distance, x, y, xb, yb); + int yi = _oink_line_xory_next_xy(1, distance, x, y, xb, yb); - _oink_gfx_circle_filled (priv, buf, color, distance >> 1, xi, yi); + _oink_gfx_circle_filled(priv, buf, color, distance >> 1, xi, yi); } -void _oink_gfx_background_ball_whirling (OinksiePrivate *priv, - uint8_t *buf, int color, int size, int dia, int rot, int x, int y) -{ - int xd; - int yd; +void _oink_gfx_background_ball_whirling(OinksiePrivate *priv, uint8_t *buf, + int color, int size, int dia, int rot, + int x, int y) { + int xd; + int yd; - xd = (_oink_table_sin[rot % OINK_TABLE_NORMAL_SIZE] * dia) + x; - yd = (_oink_table_cos[rot % OINK_TABLE_NORMAL_SIZE] * dia) + y; + xd = (_oink_table_sin[rot % OINK_TABLE_NORMAL_SIZE] * dia) + x; + yd = (_oink_table_cos[rot % OINK_TABLE_NORMAL_SIZE] * dia) + y; - _oink_gfx_circle_filled (priv, buf, color, size, xd, yd); + _oink_gfx_circle_filled(priv, buf, color, size, xd, yd); } -void _oink_gfx_background_fill (OinksiePrivate *priv, - uint8_t *buf, int color) -{ - visual_mem_set (buf, color, priv->screen_size); +void _oink_gfx_background_fill(OinksiePrivate *priv, uint8_t *buf, int color) { + visual_mem_set(buf, color, priv->screen_size); } -void _oink_gfx_background_circles_star (OinksiePrivate *priv, - uint8_t *buf, int color, int size, int tentnr, int ballnr, int badd, int turn, int x, int y) -{ - int i; - int i2; - int sizedef = 0; - int sizedefadd = size / ballnr; - int sinadd = OINK_TABLE_NORMAL_SIZE / tentnr; - int sindef = turn; - int bdef = 0; - int xd; - int yd; - - for (i = 0; i < tentnr; i++) - { - sizedef = 0; - - bdef = 0; - for (i2 = 0; i2 < ballnr; i2++) - { - xd = (_oink_table_sin[sindef % OINK_TABLE_NORMAL_SIZE] * bdef) + x; - yd = (_oink_table_cos[sindef % OINK_TABLE_NORMAL_SIZE] * bdef) + y; - - _oink_gfx_circle_filled (priv, buf, color, size - sizedef, xd, yd); - - bdef += badd; - sizedef += sizedefadd; - } - sindef += sinadd; - } +void _oink_gfx_background_circles_star(OinksiePrivate *priv, uint8_t *buf, + int color, int size, int tentnr, + int ballnr, int badd, int turn, int x, + int y) { + int i; + int i2; + int sizedef = 0; + int sizedefadd = size / ballnr; + int sinadd = OINK_TABLE_NORMAL_SIZE / tentnr; + int sindef = turn; + int bdef = 0; + int xd; + int yd; + + for (i = 0; i < tentnr; i++) { + sizedef = 0; + + bdef = 0; + for (i2 = 0; i2 < ballnr; i2++) { + xd = (_oink_table_sin[sindef % OINK_TABLE_NORMAL_SIZE] * bdef) + x; + yd = (_oink_table_cos[sindef % OINK_TABLE_NORMAL_SIZE] * bdef) + y; + + _oink_gfx_circle_filled(priv, buf, color, size - sizedef, xd, yd); + + bdef += badd; + sizedef += sizedefadd; + } + sindef += sinadd; + } } - diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-background.h b/libvisual-plugins/plugins/actor/oinksie/gfx-background.h index 588935d57..4f34e4ac1 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-background.h +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-background.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -24,19 +25,25 @@ #ifndef _OINK_GFX_BACKGROUND_H #define _OINK_GFX_BACKGROUND_H -void _oink_gfx_background_circles_sine (OinksiePrivate *priv, - uint8_t *buf, int color, int rotate, int scroll, int stretch, int size); -void _oink_gfx_background_circles_filled (OinksiePrivate *priv, - uint8_t *buf, int color, int size, int number, int distance, int turn, int x, int y); -void _oink_gfx_background_floaters (OinksiePrivate *priv, - uint8_t *buf, int color, int size, int number, int xturn, int yturn, int x, int badd1, int badd2); -void _oink_gfx_background_ball_shooting (OinksiePrivate *priv, - uint8_t *buf, int color, int distance, int xb, int yb, int x, int y); -void _oink_gfx_background_ball_whirling (OinksiePrivate *priv, - uint8_t *buf, int color, int size, int dia, int rot, int x, int y); -void _oink_gfx_background_fill (OinksiePrivate *priv, - uint8_t *buf, int color); -void _oink_gfx_background_circles_star (OinksiePrivate *priv, - uint8_t *buf, int color, int size, int tentnr, int ballnr, int badd, int turn, int x, int y); +void _oink_gfx_background_circles_sine(OinksiePrivate *priv, uint8_t *buf, + int color, int rotate, int scroll, + int stretch, int size); +void _oink_gfx_background_circles_filled(OinksiePrivate *priv, uint8_t *buf, + int color, int size, int number, + int distance, int turn, int x, int y); +void _oink_gfx_background_floaters(OinksiePrivate *priv, uint8_t *buf, + int color, int size, int number, int xturn, + int yturn, int x, int badd1, int badd2); +void _oink_gfx_background_ball_shooting(OinksiePrivate *priv, uint8_t *buf, + int color, int distance, int xb, int yb, + int x, int y); +void _oink_gfx_background_ball_whirling(OinksiePrivate *priv, uint8_t *buf, + int color, int size, int dia, int rot, + int x, int y); +void _oink_gfx_background_fill(OinksiePrivate *priv, uint8_t *buf, int color); +void _oink_gfx_background_circles_star(OinksiePrivate *priv, uint8_t *buf, + int color, int size, int tentnr, + int ballnr, int badd, int turn, int x, + int y); #endif /* _OINK_GFX_BACKGROUND_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-blur.c b/libvisual-plugins/plugins/actor/oinksie/gfx-blur.c index 879078497..f55036342 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-blur.c +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-blur.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -27,215 +28,186 @@ #include "gfx-misc.h" #include "screen.h" -void _oink_gfx_blur_fade (OinksiePrivate *priv, uint8_t *buf, int fade) -{ - int i; - uint8_t valuetab[256]; +void _oink_gfx_blur_fade(OinksiePrivate *priv, uint8_t *buf, int fade) { + int i; + uint8_t valuetab[256]; - if (visual_cpu_has_mmx ()) { + if (visual_cpu_has_mmx()) { #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) - int fadeflag = fade | fade << 8 | fade << 16 | fade << 24; - - /* Prepare substraction register */ - __asm __volatile - ("\n\t movd %[fade], %%mm3" - "\n\t movd %[fade], %%mm4" - "\n\t psllq $32, %%mm3" - "\n\t por %%mm4, %%mm3" - :: [fade] "m" (fadeflag)); - - - for (i = 0; i < priv->screen_size; i += 8) { - __asm __volatile - ("\n\t movq %[buf], %%mm0" - "\n\t psubsb %%mm3, %%mm0" - "\n\t movq %%mm0, %[buf]" - :: [buf] "m" (*buf)); - } - - __asm __volatile - ("\n\t emms"); + int fadeflag = fade | fade << 8 | fade << 16 | fade << 24; + + /* Prepare substraction register */ + __asm __volatile("\n\t movd %[fade], %%mm3" + "\n\t movd %[fade], %%mm4" + "\n\t psllq $32, %%mm3" + "\n\t por %%mm4, %%mm3" ::[fade] "m"(fadeflag)); + + for (i = 0; i < priv->screen_size; i += 8) { + __asm __volatile("\n\t movq %[buf], %%mm0" + "\n\t psubsb %%mm3, %%mm0" + "\n\t movq %%mm0, %[buf]" ::[buf] "m"(*buf)); + } + + __asm __volatile("\n\t emms"); #endif - } else { - for (i = 0; i < 256; i++) - valuetab[i] = (i - fade) > 0 ? i - fade : 0; - - for (i = 0; i < priv->screen_size; i++) - { - *buf = valuetab[*buf]; buf++; - } - } + } else { + for (i = 0; i < 256; i++) + valuetab[i] = (i - fade) > 0 ? i - fade : 0; + + for (i = 0; i < priv->screen_size; i++) { + *buf = valuetab[*buf]; + buf++; + } + } } /* FIXME also make mmx versions for these, let's rock this babe! */ -void _oink_gfx_blur_simple (OinksiePrivate *priv, uint8_t *buf) -{ - int i; - - for (i = 0; i < (priv->screen_size - priv->screen_width - 1); i++) - { - buf[i] = (buf[i + 1] + buf[i + 2] + buf[i + priv->screen_width] - + buf[i + 1 + (priv->screen_width)]) >> 2; - } - - for (i = (priv->screen_size - priv->screen_width - 1); i < priv->screen_size - 2; i++) - { - buf[i] = (buf[i + 1] + buf[i + 2]) >> 1; - } +void _oink_gfx_blur_simple(OinksiePrivate *priv, uint8_t *buf) { + int i; + + for (i = 0; i < (priv->screen_size - priv->screen_width - 1); i++) { + buf[i] = (buf[i + 1] + buf[i + 2] + buf[i + priv->screen_width] + + buf[i + 1 + (priv->screen_width)]) >> + 2; + } + + for (i = (priv->screen_size - priv->screen_width - 1); + i < priv->screen_size - 2; i++) { + buf[i] = (buf[i + 1] + buf[i + 2]) >> 1; + } } -void _oink_gfx_blur_middle (OinksiePrivate *priv, uint8_t *buf) -{ - int i; - int scrsh = priv->screen_size / 2; +void _oink_gfx_blur_middle(OinksiePrivate *priv, uint8_t *buf) { + int i; + int scrsh = priv->screen_size / 2; - if (visual_cpu_has_mmx ()) { + if (visual_cpu_has_mmx()) { #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) - __asm __volatile - ("\n\t pxor %%mm6, %%mm6" - ::); - - for (i = 0; i < scrsh; i += 4) { - __asm __volatile - ("\n\t movd %[buf], %%mm0" - "\n\t movd %[add1], %%mm1" - "\n\t punpcklbw %%mm6, %%mm0" - "\n\t movd %[add2], %%mm2" - "\n\t punpcklbw %%mm6, %%mm1" - "\n\t movd %[add3], %%mm3" - "\n\t punpcklbw %%mm6, %%mm2" - "\n\t paddw %%mm1, %%mm0" - "\n\t punpcklbw %%mm6, %%mm3" - "\n\t paddw %%mm2, %%mm0" - "\n\t paddw %%mm3, %%mm0" - "\n\t psrlw $2, %%mm0" - "\n\t packuswb %%mm6, %%mm0" - "\n\t movd %%mm0, %[buf]" - :: [buf] "m" (*(buf + i)) - , [add1] "m" (*(buf + i + priv->screen_width)) - , [add2] "m" (*(buf + i + priv->screen_width + 1)) - , [add3] "m" (*(buf + i + priv->screen_width - 1))); - } - - for (i = priv->screen_size - 1; i > scrsh; i -= 4) { - __asm __volatile - ("\n\t movd %[buf], %%mm0" - "\n\t movd %[add1], %%mm1" - "\n\t punpcklbw %%mm6, %%mm0" - "\n\t movd %[add2], %%mm2" - "\n\t punpcklbw %%mm6, %%mm1" - "\n\t movd %[add3], %%mm3" - "\n\t punpcklbw %%mm6, %%mm2" - "\n\t paddw %%mm1, %%mm0" - "\n\t punpcklbw %%mm6, %%mm3" - "\n\t paddw %%mm2, %%mm0" - "\n\t paddw %%mm3, %%mm0" - "\n\t psrlw $2, %%mm0" - "\n\t packuswb %%mm6, %%mm0" - "\n\t movd %%mm0, %[buf]" - :: [buf] "m" (*(buf + i)) - , [add1] "m" (*(buf + i - priv->screen_width)) - , [add2] "m" (*(buf + i - priv->screen_width + 1)) - , [add3] "m" (*(buf + i - priv->screen_width - 1))); - } - - __asm __volatile - ("\n\t emms"); + __asm __volatile("\n\t pxor %%mm6, %%mm6" ::); + + for (i = 0; i < scrsh; i += 4) { + __asm __volatile("\n\t movd %[buf], %%mm0" + "\n\t movd %[add1], %%mm1" + "\n\t punpcklbw %%mm6, %%mm0" + "\n\t movd %[add2], %%mm2" + "\n\t punpcklbw %%mm6, %%mm1" + "\n\t movd %[add3], %%mm3" + "\n\t punpcklbw %%mm6, %%mm2" + "\n\t paddw %%mm1, %%mm0" + "\n\t punpcklbw %%mm6, %%mm3" + "\n\t paddw %%mm2, %%mm0" + "\n\t paddw %%mm3, %%mm0" + "\n\t psrlw $2, %%mm0" + "\n\t packuswb %%mm6, %%mm0" + "\n\t movd %%mm0, %[buf]" ::[buf] "m"(*(buf + i)), + [add1] "m"(*(buf + i + priv->screen_width)), + [add2] "m"(*(buf + i + priv->screen_width + 1)), + [add3] "m"(*(buf + i + priv->screen_width - 1))); + } + + for (i = priv->screen_size - 1; i > scrsh; i -= 4) { + __asm __volatile("\n\t movd %[buf], %%mm0" + "\n\t movd %[add1], %%mm1" + "\n\t punpcklbw %%mm6, %%mm0" + "\n\t movd %[add2], %%mm2" + "\n\t punpcklbw %%mm6, %%mm1" + "\n\t movd %[add3], %%mm3" + "\n\t punpcklbw %%mm6, %%mm2" + "\n\t paddw %%mm1, %%mm0" + "\n\t punpcklbw %%mm6, %%mm3" + "\n\t paddw %%mm2, %%mm0" + "\n\t paddw %%mm3, %%mm0" + "\n\t psrlw $2, %%mm0" + "\n\t packuswb %%mm6, %%mm0" + "\n\t movd %%mm0, %[buf]" ::[buf] "m"(*(buf + i)), + [add1] "m"(*(buf + i - priv->screen_width)), + [add2] "m"(*(buf + i - priv->screen_width + 1)), + [add3] "m"(*(buf + i - priv->screen_width - 1))); + } + + __asm __volatile("\n\t emms"); #endif - } else { - for (i = 0; i < scrsh; i++) - { - *(buf + i) = (*(buf + i) - + *(buf + i + priv->screen_width) - + *(buf + i + priv->screen_width + 1) - + *(buf + i + priv->screen_width - 1)) >> 2; - } - - for (i = priv->screen_size - 1; i > scrsh; i--) - { - *(buf + i) = (*(buf + i) - + *(buf + i - priv->screen_width) - + *(buf + i - priv->screen_width + 1) - + *(buf + i - priv->screen_width - 1)) >> 2; - } - } + } else { + for (i = 0; i < scrsh; i++) { + *(buf + i) = (*(buf + i) + *(buf + i + priv->screen_width) + + *(buf + i + priv->screen_width + 1) + + *(buf + i + priv->screen_width - 1)) >> + 2; + } + + for (i = priv->screen_size - 1; i > scrsh; i--) { + *(buf + i) = (*(buf + i) + *(buf + i - priv->screen_width) + + *(buf + i - priv->screen_width + 1) + + *(buf + i - priv->screen_width - 1)) >> + 2; + } + } } -void _oink_gfx_blur_midstrange (OinksiePrivate *priv, uint8_t *buf) -{ - int i; - int scrsh = priv->screen_size / 2; +void _oink_gfx_blur_midstrange(OinksiePrivate *priv, uint8_t *buf) { + int i; + int scrsh = priv->screen_size / 2; - if (visual_cpu_has_mmx ()) { + if (visual_cpu_has_mmx()) { #if defined(VISUAL_ARCH_X86) || defined(VISUAL_ARCH_X86_64) - __asm __volatile - ("\n\t pxor %%mm6, %%mm6" - ::); - - for (i = scrsh; i > 0; i -= 4) { - __asm __volatile - ("\n\t movd %[buf], %%mm0" - "\n\t movd %[add1], %%mm1" - "\n\t punpcklbw %%mm6, %%mm0" - "\n\t movd %[add2], %%mm2" - "\n\t punpcklbw %%mm6, %%mm1" - "\n\t movd %[add3], %%mm3" - "\n\t punpcklbw %%mm6, %%mm2" - "\n\t paddw %%mm1, %%mm0" - "\n\t punpcklbw %%mm6, %%mm3" - "\n\t paddw %%mm2, %%mm0" - "\n\t paddw %%mm3, %%mm0" - "\n\t psrlw $2, %%mm0" - "\n\t packuswb %%mm6, %%mm0" - "\n\t movd %%mm0, %[buf]" - :: [buf] "m" (*(buf + i)) - , [add1] "m" (*(buf + i + priv->screen_width)) - , [add2] "m" (*(buf + i + priv->screen_width + 1)) - , [add3] "m" (*(buf + i + priv->screen_width - 1))); - } - - for (i = scrsh; i < priv->screen_size - 2; i += 4) { - __asm __volatile - ("\n\t movd %[buf], %%mm0" - "\n\t movd %[add1], %%mm1" - "\n\t punpcklbw %%mm6, %%mm0" - "\n\t movd %[add2], %%mm2" - "\n\t punpcklbw %%mm6, %%mm1" - "\n\t movd %[add3], %%mm3" - "\n\t punpcklbw %%mm6, %%mm2" - "\n\t paddw %%mm1, %%mm0" - "\n\t punpcklbw %%mm6, %%mm3" - "\n\t paddw %%mm2, %%mm0" - "\n\t paddw %%mm3, %%mm0" - "\n\t psrlw $2, %%mm0" - "\n\t packuswb %%mm6, %%mm0" - "\n\t movd %%mm0, %[buf]" - :: [buf] "m" (*(buf + i)) - , [add1] "m" (*(buf + i - priv->screen_width)) - , [add2] "m" (*(buf + i - priv->screen_width + 1)) - , [add3] "m" (*(buf + i - priv->screen_width - 1))); - } - - __asm __volatile - ("\n\t emms"); + __asm __volatile("\n\t pxor %%mm6, %%mm6" ::); + + for (i = scrsh; i > 0; i -= 4) { + __asm __volatile("\n\t movd %[buf], %%mm0" + "\n\t movd %[add1], %%mm1" + "\n\t punpcklbw %%mm6, %%mm0" + "\n\t movd %[add2], %%mm2" + "\n\t punpcklbw %%mm6, %%mm1" + "\n\t movd %[add3], %%mm3" + "\n\t punpcklbw %%mm6, %%mm2" + "\n\t paddw %%mm1, %%mm0" + "\n\t punpcklbw %%mm6, %%mm3" + "\n\t paddw %%mm2, %%mm0" + "\n\t paddw %%mm3, %%mm0" + "\n\t psrlw $2, %%mm0" + "\n\t packuswb %%mm6, %%mm0" + "\n\t movd %%mm0, %[buf]" ::[buf] "m"(*(buf + i)), + [add1] "m"(*(buf + i + priv->screen_width)), + [add2] "m"(*(buf + i + priv->screen_width + 1)), + [add3] "m"(*(buf + i + priv->screen_width - 1))); + } + + for (i = scrsh; i < priv->screen_size - 2; i += 4) { + __asm __volatile("\n\t movd %[buf], %%mm0" + "\n\t movd %[add1], %%mm1" + "\n\t punpcklbw %%mm6, %%mm0" + "\n\t movd %[add2], %%mm2" + "\n\t punpcklbw %%mm6, %%mm1" + "\n\t movd %[add3], %%mm3" + "\n\t punpcklbw %%mm6, %%mm2" + "\n\t paddw %%mm1, %%mm0" + "\n\t punpcklbw %%mm6, %%mm3" + "\n\t paddw %%mm2, %%mm0" + "\n\t paddw %%mm3, %%mm0" + "\n\t psrlw $2, %%mm0" + "\n\t packuswb %%mm6, %%mm0" + "\n\t movd %%mm0, %[buf]" ::[buf] "m"(*(buf + i)), + [add1] "m"(*(buf + i - priv->screen_width)), + [add2] "m"(*(buf + i - priv->screen_width + 1)), + [add3] "m"(*(buf + i - priv->screen_width - 1))); + } + + __asm __volatile("\n\t emms"); #endif - } else { - - for (i = scrsh; i > 0; i--) - { - buf[i] = (buf[i] - + buf[i + priv->screen_width] - + buf[i + priv->screen_width + 1] - + buf[i + priv->screen_width - 1]) >> 2; - } - - for (i = scrsh; i < priv->screen_size - 2; i++) - { - buf[i] = (buf[i] - + buf[i - priv->screen_width] - + buf[i - priv->screen_width + 1] - + buf[i - priv->screen_width - 1]) >> 2; - } - } + } else { + + for (i = scrsh; i > 0; i--) { + buf[i] = + (buf[i] + buf[i + priv->screen_width] + + buf[i + priv->screen_width + 1] + buf[i + priv->screen_width - 1]) >> + 2; + } + + for (i = scrsh; i < priv->screen_size - 2; i++) { + buf[i] = + (buf[i] + buf[i - priv->screen_width] + + buf[i - priv->screen_width + 1] + buf[i - priv->screen_width - 1]) >> + 2; + } + } } - diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-blur.h b/libvisual-plugins/plugins/actor/oinksie/gfx-blur.h index 6eef41084..9dd6ef07b 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-blur.h +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-blur.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -26,9 +27,9 @@ #include "oinksie.h" -void _oink_gfx_blur_fade (OinksiePrivate *priv, uint8_t *buf, int fade); -void _oink_gfx_blur_simple (OinksiePrivate *priv, uint8_t *buf); -void _oink_gfx_blur_middle (OinksiePrivate *priv, uint8_t *buf); -void _oink_gfx_blur_midstrange (OinksiePrivate *priv, uint8_t *buf); +void _oink_gfx_blur_fade(OinksiePrivate *priv, uint8_t *buf, int fade); +void _oink_gfx_blur_simple(OinksiePrivate *priv, uint8_t *buf); +void _oink_gfx_blur_middle(OinksiePrivate *priv, uint8_t *buf); +void _oink_gfx_blur_midstrange(OinksiePrivate *priv, uint8_t *buf); #endif /* _OINK_GFX_BLUR_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-misc.c b/libvisual-plugins/plugins/actor/oinksie/gfx-misc.c index 9715d2ce4..220a1a1fc 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-misc.c +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-misc.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -32,209 +33,186 @@ #include "screen.h" #include "gfx-misc.h" -int _oink_gfx_pixel_get (OinksiePrivate *priv, uint8_t *buf, int x, int y) -{ - int pos = (y * priv->screen_width) + x; +int _oink_gfx_pixel_get(OinksiePrivate *priv, uint8_t *buf, int x, int y) { + int pos = (y * priv->screen_width) + x; - if (pos < priv->screen_size && pos > 0) - return buf[pos]; + if (pos < priv->screen_size && pos > 0) + return buf[pos]; - return 0; + return 0; } -void _oink_gfx_pixel_set (OinksiePrivate *priv, uint8_t *buf, int color, int x, int y) -{ - int pos = (y * priv->screen_width) + x; - - if (pos < priv->screen_size && pos > 0) - buf[pos] = color; +void _oink_gfx_pixel_set(OinksiePrivate *priv, uint8_t *buf, int color, int x, + int y) { + int pos = (y * priv->screen_width) + x; + if (pos < priv->screen_size && pos > 0) + buf[pos] = color; } /* FIXME this routine shows errors */ -void _oink_gfx_line (OinksiePrivate *priv, uint8_t *buf, int color, int x0, int y0, int x1, int y1) -{ - register int dy = y1 - y0; - register int dx = x1 - x0; - register int stepx, stepy, stepy_; - register int fraction; - register int bp; - - if (x0 < 0 || x0 > priv->screen_width - 1 || x1 < 0 || x1 > priv->screen_width - 1|| - y0 < 0 || y0 > priv->screen_height - 1 || y1 < 0 || y1 > priv->screen_height - 1) - { - if (x0 < 0) - x0 = 0; - else if (x0 > priv->screen_width - 1) - x0 = priv->screen_width - 1; - - if (x1 < 0) - x1 = 0; - else if (x1 > priv->screen_width - 1) - x1 = priv->screen_width - 1; - - if (y0 < 0) - y0 = 0; - else if (y0 > priv->screen_height - 1) - y0 = priv->screen_height - 1; - - if (y1 < 0) - y1 = 0; - else if (y1 > priv->screen_height - 1) - y1 = priv->screen_height - 1; - - return; /* FIXME */ - } - - if (dy < 0) - { - dy = -dy; - stepy_ = -priv->screen_width; - stepy = -1; - } - else - { - stepy = 1; - stepy_ = priv->screen_width; - } - - if (dx < 0) - { - dx = -dx; - stepx = -1; - } - else - { - stepx = 1; - } - - dy <<= 1; - dx <<= 1; - - bp = x0 + y0 * priv->screen_width; - - _oink_gfx_pixel_set (priv, buf, color, x0, y0); - - if (dx > dy) - { - fraction = dy - (dx >> 1); - while (x0 != x1) - { - if (fraction >= 0) - { - bp += stepy_; - fraction -= dx; - } - x0 += stepx; - bp += stepx; - fraction += dy; - - buf[bp] = color; - } - } - else - { - fraction = dx - (dy >> 1); - while (y0 != y1) - { - if (fraction >= 0) - { - bp += stepx; - x0 += stepx; - fraction -= dy; - } - y0 += stepy; - bp += stepy_; - fraction += dx; - - buf[bp] = color; - } - } +void _oink_gfx_line(OinksiePrivate *priv, uint8_t *buf, int color, int x0, + int y0, int x1, int y1) { + register int dy = y1 - y0; + register int dx = x1 - x0; + register int stepx, stepy, stepy_; + register int fraction; + register int bp; + + if (x0 < 0 || x0 > priv->screen_width - 1 || x1 < 0 || + x1 > priv->screen_width - 1 || y0 < 0 || y0 > priv->screen_height - 1 || + y1 < 0 || y1 > priv->screen_height - 1) { + if (x0 < 0) + x0 = 0; + else if (x0 > priv->screen_width - 1) + x0 = priv->screen_width - 1; + + if (x1 < 0) + x1 = 0; + else if (x1 > priv->screen_width - 1) + x1 = priv->screen_width - 1; + + if (y0 < 0) + y0 = 0; + else if (y0 > priv->screen_height - 1) + y0 = priv->screen_height - 1; + + if (y1 < 0) + y1 = 0; + else if (y1 > priv->screen_height - 1) + y1 = priv->screen_height - 1; + + return; /* FIXME */ + } + + if (dy < 0) { + dy = -dy; + stepy_ = -priv->screen_width; + stepy = -1; + } else { + stepy = 1; + stepy_ = priv->screen_width; + } + + if (dx < 0) { + dx = -dx; + stepx = -1; + } else { + stepx = 1; + } + + dy <<= 1; + dx <<= 1; + + bp = x0 + y0 * priv->screen_width; + + _oink_gfx_pixel_set(priv, buf, color, x0, y0); + + if (dx > dy) { + fraction = dy - (dx >> 1); + while (x0 != x1) { + if (fraction >= 0) { + bp += stepy_; + fraction -= dx; + } + x0 += stepx; + bp += stepx; + fraction += dy; + + buf[bp] = color; + } + } else { + fraction = dx - (dy >> 1); + while (y0 != y1) { + if (fraction >= 0) { + bp += stepx; + x0 += stepx; + fraction -= dy; + } + y0 += stepy; + bp += stepy_; + fraction += dx; + + buf[bp] = color; + } + } } -void _oink_gfx_hline (OinksiePrivate *priv, uint8_t *buf, int color, int y, int x1, int x2) -{ - int firstx = x1 < x2 ? x1 : x2; - int endx = x1 > x2 ? x1 : x2; - int begin; - - if (firstx > priv->screen_width - 1) - firstx = priv->screen_width - 1; - else if (firstx < 0) - firstx = 0; - - if (endx > priv->screen_width - 1) - endx = priv->screen_width - 1; - else if (endx < 0) - endx = 0; - - if (y < 0 || y > priv->screen_height - 1) - return; - - if (firstx == endx) - { - _oink_gfx_pixel_set (priv, buf, color, firstx, y); - return; - } - - begin = (y * priv->screen_width) + firstx; - visual_mem_set (buf + begin, color, endx - firstx); -} +void _oink_gfx_hline(OinksiePrivate *priv, uint8_t *buf, int color, int y, + int x1, int x2) { + int firstx = x1 < x2 ? x1 : x2; + int endx = x1 > x2 ? x1 : x2; + int begin; + + if (firstx > priv->screen_width - 1) + firstx = priv->screen_width - 1; + else if (firstx < 0) + firstx = 0; + + if (endx > priv->screen_width - 1) + endx = priv->screen_width - 1; + else if (endx < 0) + endx = 0; + + if (y < 0 || y > priv->screen_height - 1) + return; -void _oink_gfx_vline (OinksiePrivate *priv, uint8_t *buf, int color, int x, int y1, int y2) -{ - int y; - - if (y1 < y2) - { - for (y = y1; y <= y2; y++) - _oink_gfx_pixel_set (priv, buf, color, x, y); - } - else if (y2 < y1) - { - for (y = y2; y <= y1; y++) - _oink_gfx_pixel_set (priv, buf, color, x, y); - } - else - { - _oink_gfx_pixel_set (priv, buf, color, x, y1); - } + if (firstx == endx) { + _oink_gfx_pixel_set(priv, buf, color, firstx, y); + return; + } + + begin = (y * priv->screen_width) + firstx; + visual_mem_set(buf + begin, color, endx - firstx); } -void _oink_gfx_circle_filled (OinksiePrivate *priv, uint8_t *buf, int color, int size, int x, int y) -{ - int i; - int sizei = (size * PI) > 0 ? (size * PI) : 1; - int sini; - int cosi; - - float adder = (float) ((float) OINK_TABLE_LARGE_SIZE / (float) sizei) / 4.00000; - float tab = 0; - - for (i = 0; i < sizei; i++) - { - cosi = _oink_table_sinlarge[(int) tab] * size; - sini = _oink_table_coslarge[(int) tab] * size; - - _oink_gfx_hline (priv, buf, color, cosi + y, -sini + x, sini + x); - _oink_gfx_hline (priv, buf, color, -cosi + y, -sini + x, sini + x); - - tab += adder; - } +void _oink_gfx_vline(OinksiePrivate *priv, uint8_t *buf, int color, int x, + int y1, int y2) { + int y; + + if (y1 < y2) { + for (y = y1; y <= y2; y++) + _oink_gfx_pixel_set(priv, buf, color, x, y); + } else if (y2 < y1) { + for (y = y2; y <= y1; y++) + _oink_gfx_pixel_set(priv, buf, color, x, y); + } else { + _oink_gfx_pixel_set(priv, buf, color, x, y1); + } } -void _oink_gfx_circle (OinksiePrivate *priv, uint8_t *buf, int color, int xsize, int ysize, int x, int y) -{ - int i; - int size = 300; +void _oink_gfx_circle_filled(OinksiePrivate *priv, uint8_t *buf, int color, + int size, int x, int y) { + int i; + int sizei = (size * PI) > 0 ? (size * PI) : 1; + int sini; + int cosi; + + float adder = (float)((float)OINK_TABLE_LARGE_SIZE / (float)sizei) / 4.00000; + float tab = 0; + + for (i = 0; i < sizei; i++) { + cosi = _oink_table_sinlarge[(int)tab] * size; + sini = _oink_table_coslarge[(int)tab] * size; - int tabx = OINK_TABLE_NORMAL_SIZE / size; - int taby = OINK_TABLE_NORMAL_SIZE / size; + _oink_gfx_hline(priv, buf, color, cosi + y, -sini + x, sini + x); + _oink_gfx_hline(priv, buf, color, -cosi + y, -sini + x, sini + x); - for (i = 0; i < size; i++) - { - _oink_gfx_pixel_set (priv, buf, color, (int) (_oink_table_sin[i * tabx] * xsize) + x, - (int) (_oink_table_cos[i * taby] * ysize) + y); - } + tab += adder; + } } +void _oink_gfx_circle(OinksiePrivate *priv, uint8_t *buf, int color, int xsize, + int ysize, int x, int y) { + int i; + int size = 300; + + int tabx = OINK_TABLE_NORMAL_SIZE / size; + int taby = OINK_TABLE_NORMAL_SIZE / size; + + for (i = 0; i < size; i++) { + _oink_gfx_pixel_set(priv, buf, color, + (int)(_oink_table_sin[i * tabx] * xsize) + x, + (int)(_oink_table_cos[i * taby] * ysize) + y); + } +} diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-misc.h b/libvisual-plugins/plugins/actor/oinksie/gfx-misc.h index 3dc2aeb20..9062f597a 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-misc.h +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-misc.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -26,14 +27,22 @@ #include "oinksie.h" -void _oink_gfx_something_set (OinksiePrivate *priv, uint8_t *buf, int color, int x, int y, int type, int pixmap); -void _oink_gfx_pixmap_set (OinksiePrivate *priv, uint8_t *buf, int color, int x, int y, int type); -int _oink_gfx_pixel_get (OinksiePrivate *priv, uint8_t *buf, int x, int y); -void _oink_gfx_pixel_set (OinksiePrivate *priv, uint8_t *buf, int color, int x, int y); -void _oink_gfx_line (OinksiePrivate *priv, uint8_t *buf, int color, int x0, int y0, int x1, int y1); -void _oink_gfx_hline (OinksiePrivate *priv, uint8_t *buf, int color, int x, int y1, int y2); -void _oink_gfx_vline (OinksiePrivate *priv, uint8_t *buf, int color, int x, int y1, int y2); -void _oink_gfx_circle_filled (OinksiePrivate *priv, uint8_t *buf, int color, int size, int x, int y); -void _oink_gfx_circle (OinksiePrivate *priv, uint8_t *buf, int color, int xsize, int ysize, int x, int y); +void _oink_gfx_something_set(OinksiePrivate *priv, uint8_t *buf, int color, + int x, int y, int type, int pixmap); +void _oink_gfx_pixmap_set(OinksiePrivate *priv, uint8_t *buf, int color, int x, + int y, int type); +int _oink_gfx_pixel_get(OinksiePrivate *priv, uint8_t *buf, int x, int y); +void _oink_gfx_pixel_set(OinksiePrivate *priv, uint8_t *buf, int color, int x, + int y); +void _oink_gfx_line(OinksiePrivate *priv, uint8_t *buf, int color, int x0, + int y0, int x1, int y1); +void _oink_gfx_hline(OinksiePrivate *priv, uint8_t *buf, int color, int x, + int y1, int y2); +void _oink_gfx_vline(OinksiePrivate *priv, uint8_t *buf, int color, int x, + int y1, int y2); +void _oink_gfx_circle_filled(OinksiePrivate *priv, uint8_t *buf, int color, + int size, int x, int y); +void _oink_gfx_circle(OinksiePrivate *priv, uint8_t *buf, int color, int xsize, + int ysize, int x, int y); #endif /* _OINK_GFX_MISC_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-palette.c b/libvisual-plugins/plugins/actor/oinksie/gfx-palette.c index 17ffaef6b..003c6ec6a 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-palette.c +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-palette.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -31,179 +32,176 @@ #include "screen.h" #include "gfx-palette.h" -void _oink_gfx_palette_init (OinksiePrivate *priv) -{ - priv->pal_startup = 1; - - priv->pal_data.fade_start = 1; - priv->pal_data.fade_steps = 100; - priv->pal_data.fade_poststeps = priv->pal_data.fade_steps; - priv->pal_data.fade_poststop = 1; +void _oink_gfx_palette_init(OinksiePrivate *priv) { + priv->pal_startup = 1; + + priv->pal_data.fade_start = 1; + priv->pal_data.fade_steps = 100; + priv->pal_data.fade_poststeps = priv->pal_data.fade_steps; + priv->pal_data.fade_poststop = 1; } -void _oink_gfx_palette_save_old (OinksiePrivate *priv) -{ - /* If we haven't set up an fade yet, don't save the next old. - * this protects us from more event handles per screen draw - */ - if (priv->pal_data.pal_new == 1 && priv->pal_data.fade_stepsdone == priv->pal_data.fade_steps) - visual_palette_copy (priv->pal_old, priv->pal_cur); +void _oink_gfx_palette_save_old(OinksiePrivate *priv) { + /* If we haven't set up an fade yet, don't save the next old. + * this protects us from more event handles per screen draw + */ + if (priv->pal_data.pal_new == 1 && + priv->pal_data.fade_stepsdone == priv->pal_data.fade_steps) + visual_palette_copy(priv->pal_old, priv->pal_cur); - priv->pal_data.fade_start = 1; + priv->pal_data.fade_start = 1; } -void _oink_gfx_palette_transform (OinksiePrivate *priv) -{ - VisColor *pal_cur_colors = visual_palette_get_colors (priv->pal_cur); - VisColor *pal_old_colors = visual_palette_get_colors (priv->pal_old); - - int i; - - if (priv->pal_data.fade_start == 1) - { - priv->pal_data.fade_stepsdone = 0; - - for (i = 0; i < 256; i++) - { - priv->pal_fades[i].r = (float) (pal_cur_colors[i].r - pal_old_colors[i].r) / (float) priv->pal_data.fade_steps; - priv->pal_fades[i].g = (float) (pal_cur_colors[i].g - pal_old_colors[i].g) / (float) priv->pal_data.fade_steps; - priv->pal_fades[i].b = (float) (pal_cur_colors[i].b - pal_old_colors[i].b) / (float) priv->pal_data.fade_steps; - - priv->pal_fades[i].r_cur = pal_old_colors[i].r; - priv->pal_fades[i].g_cur = pal_old_colors[i].g; - priv->pal_fades[i].b_cur = pal_old_colors[i].b; - } - - priv->pal_data.fade_start = 0; - } - - for (i = 0; i < 256; i++) - { - priv->pal_fades[i].r_cur += priv->pal_fades[i].r; - priv->pal_fades[i].g_cur += priv->pal_fades[i].g; - priv->pal_fades[i].b_cur += priv->pal_fades[i].b; - - pal_old_colors[i].r = priv->pal_fades[i].r_cur; - pal_old_colors[i].g = priv->pal_fades[i].g_cur; - pal_old_colors[i].b = priv->pal_fades[i].b_cur; - } - - priv->pal_data.fade_stepsdone++; - - if (priv->pal_data.fade_stepsdone >= priv->pal_data.fade_poststeps) - { - visual_palette_copy (priv->pal_cur, priv->pal_old); - - priv->pal_data.pal_new = 0; - priv->pal_data.fade_start = 1; - priv->pal_startup = 0; - } +void _oink_gfx_palette_transform(OinksiePrivate *priv) { + VisColor *pal_cur_colors = visual_palette_get_colors(priv->pal_cur); + VisColor *pal_old_colors = visual_palette_get_colors(priv->pal_old); + + int i; + + if (priv->pal_data.fade_start == 1) { + priv->pal_data.fade_stepsdone = 0; + + for (i = 0; i < 256; i++) { + priv->pal_fades[i].r = + (float)(pal_cur_colors[i].r - pal_old_colors[i].r) / + (float)priv->pal_data.fade_steps; + priv->pal_fades[i].g = + (float)(pal_cur_colors[i].g - pal_old_colors[i].g) / + (float)priv->pal_data.fade_steps; + priv->pal_fades[i].b = + (float)(pal_cur_colors[i].b - pal_old_colors[i].b) / + (float)priv->pal_data.fade_steps; + + priv->pal_fades[i].r_cur = pal_old_colors[i].r; + priv->pal_fades[i].g_cur = pal_old_colors[i].g; + priv->pal_fades[i].b_cur = pal_old_colors[i].b; + } + + priv->pal_data.fade_start = 0; + } + + for (i = 0; i < 256; i++) { + priv->pal_fades[i].r_cur += priv->pal_fades[i].r; + priv->pal_fades[i].g_cur += priv->pal_fades[i].g; + priv->pal_fades[i].b_cur += priv->pal_fades[i].b; + + pal_old_colors[i].r = priv->pal_fades[i].r_cur; + pal_old_colors[i].g = priv->pal_fades[i].g_cur; + pal_old_colors[i].b = priv->pal_fades[i].b_cur; + } + + priv->pal_data.fade_stepsdone++; + + if (priv->pal_data.fade_stepsdone >= priv->pal_data.fade_poststeps) { + visual_palette_copy(priv->pal_cur, priv->pal_old); + + priv->pal_data.pal_new = 0; + priv->pal_data.fade_start = 1; + priv->pal_startup = 0; + } } -void _oink_gfx_palette_build (OinksiePrivate *priv, uint8_t funky) -{ - /* save old palette for transistion */ - _oink_gfx_palette_save_old (priv); - _oink_gfx_palette_build_gradient (priv, funky); - - /* FIXME, changing fadesteps can fuck this up */ - if (priv->pal_data.fade_poststop == 1 && priv->pal_startup == 0) { - switch (visual_random_context_int_range (priv->rcontext, 0, 5)) { - case 0: - case 1: - priv->pal_data.fade_poststeps = visual_random_context_int_range (priv->rcontext, 60, priv->pal_data.fade_steps); - break; - - case 2: - priv->pal_data.fade_poststeps = visual_random_context_int_range (priv->rcontext, 40, priv->pal_data.fade_steps / 2); - break; - - case 3: - priv->pal_data.fade_poststeps = visual_random_context_int_range (priv->rcontext, 20, priv->pal_data.fade_steps / 3); - break; - case 4: - priv->pal_data.fade_poststeps = visual_random_context_int_range (priv->rcontext, 80, priv->pal_data.fade_steps); - break; - - default: - priv->pal_data.fade_poststeps = priv->pal_data.fade_steps; - break; - } - - } - - priv->pal_data.pal_new = 1; +void _oink_gfx_palette_build(OinksiePrivate *priv, uint8_t funky) { + /* save old palette for transistion */ + _oink_gfx_palette_save_old(priv); + _oink_gfx_palette_build_gradient(priv, funky); + + /* FIXME, changing fadesteps can fuck this up */ + if (priv->pal_data.fade_poststop == 1 && priv->pal_startup == 0) { + switch (visual_random_context_int_range(priv->rcontext, 0, 5)) { + case 0: + case 1: + priv->pal_data.fade_poststeps = visual_random_context_int_range( + priv->rcontext, 60, priv->pal_data.fade_steps); + break; + + case 2: + priv->pal_data.fade_poststeps = visual_random_context_int_range( + priv->rcontext, 40, priv->pal_data.fade_steps / 2); + break; + + case 3: + priv->pal_data.fade_poststeps = visual_random_context_int_range( + priv->rcontext, 20, priv->pal_data.fade_steps / 3); + break; + case 4: + priv->pal_data.fade_poststeps = visual_random_context_int_range( + priv->rcontext, 80, priv->pal_data.fade_steps); + break; + + default: + priv->pal_data.fade_poststeps = priv->pal_data.fade_steps; + break; + } + } + + priv->pal_data.pal_new = 1; } -void _oink_gfx_palette_color (OinksiePrivate *priv, int color, int red, int green, int blue) -{ - VisColor *pal_cur_colors = visual_palette_get_colors (priv->pal_cur); +void _oink_gfx_palette_color(OinksiePrivate *priv, int color, int red, + int green, int blue) { + VisColor *pal_cur_colors = visual_palette_get_colors(priv->pal_cur); - pal_cur_colors[color].r = red << 2; - pal_cur_colors[color].g = green << 2; - pal_cur_colors[color].b = blue << 2; -} + pal_cur_colors[color].r = red << 2; + pal_cur_colors[color].g = green << 2; + pal_cur_colors[color].b = blue << 2; +} -uint8_t _oink_gfx_palette_gradient_gen (OinksiePrivate *priv, uint8_t i, int mode) -{ - static const float __magic = 2.0 * PI/256; +uint8_t _oink_gfx_palette_gradient_gen(OinksiePrivate *priv, uint8_t i, + int mode) { + static const float __magic = 2.0 * PI / 256; - switch (mode) - { - case 0: - return (i * i * i) >> 16; - break; + switch (mode) { + case 0: + return (i * i * i) >> 16; + break; - case 1: - return (i * i) >> 8; - break; + case 1: + return (i * i) >> 8; + break; - case 2: - return (uint8_t) i; - break; + case 2: + return (uint8_t)i; + break; - case 3: - return (uint8_t) (128 * fabs (sin ( __magic * i ))); - break; + case 3: + return (uint8_t)(128 * fabs(sin(__magic * i))); + break; - case 4: - return 0; - break; + case 4: + return 0; + break; - default: - break; - } + default: + break; + } - return 0; + return 0; } -void _oink_gfx_palette_build_gradient (OinksiePrivate *priv, uint8_t funky) -{ - VisColor *pal_cur_colors = visual_palette_get_colors (priv->pal_cur); - - int i = 0; - int j = 0; - int k = 0; - int l = 0; - - if (funky == TRUE) - i = 5; - else - i = 3; - - do - { - j = visual_random_context_int_range (priv->rcontext, 0, i - 1); - k = visual_random_context_int_range (priv->rcontext, 0, i - 1); - l = visual_random_context_int_range (priv->rcontext, 0, i - 1); - - } while (j == k || j == l || l == k); - - for( i = 0; i <= 255; i++) - { - pal_cur_colors[i].r = _oink_gfx_palette_gradient_gen (priv, i, j); - pal_cur_colors[i].g = _oink_gfx_palette_gradient_gen (priv, i, k); - pal_cur_colors[i].b = _oink_gfx_palette_gradient_gen (priv, i, l); - } -} +void _oink_gfx_palette_build_gradient(OinksiePrivate *priv, uint8_t funky) { + VisColor *pal_cur_colors = visual_palette_get_colors(priv->pal_cur); + + int i = 0; + int j = 0; + int k = 0; + int l = 0; + if (funky == TRUE) + i = 5; + else + i = 3; + + do { + j = visual_random_context_int_range(priv->rcontext, 0, i - 1); + k = visual_random_context_int_range(priv->rcontext, 0, i - 1); + l = visual_random_context_int_range(priv->rcontext, 0, i - 1); + + } while (j == k || j == l || l == k); + + for (i = 0; i <= 255; i++) { + pal_cur_colors[i].r = _oink_gfx_palette_gradient_gen(priv, i, j); + pal_cur_colors[i].g = _oink_gfx_palette_gradient_gen(priv, i, k); + pal_cur_colors[i].b = _oink_gfx_palette_gradient_gen(priv, i, l); + } +} diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-palette.h b/libvisual-plugins/plugins/actor/oinksie/gfx-palette.h index 3d713b2d3..012e15def 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-palette.h +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-palette.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -26,12 +27,14 @@ #include "oinksie.h" -void _oink_gfx_palette_init (OinksiePrivate *priv); -void _oink_gfx_palette_save_old (OinksiePrivate *priv); -void _oink_gfx_palette_transform (OinksiePrivate *priv); -void _oink_gfx_palette_build (OinksiePrivate *priv, uint8_t funky); -void _oink_gfx_palette_color (OinksiePrivate *priv, int color, int red, int green, int blue); -uint8_t _oink_gfx_palette_gradient_gen (OinksiePrivate *priv, uint8_t i, int mode); -void _oink_gfx_palette_build_gradient (OinksiePrivate *priv, uint8_t funky); +void _oink_gfx_palette_init(OinksiePrivate *priv); +void _oink_gfx_palette_save_old(OinksiePrivate *priv); +void _oink_gfx_palette_transform(OinksiePrivate *priv); +void _oink_gfx_palette_build(OinksiePrivate *priv, uint8_t funky); +void _oink_gfx_palette_color(OinksiePrivate *priv, int color, int red, + int green, int blue); +uint8_t _oink_gfx_palette_gradient_gen(OinksiePrivate *priv, uint8_t i, + int mode); +void _oink_gfx_palette_build_gradient(OinksiePrivate *priv, uint8_t funky); #endif /* _OINK_GFX_PALETTE_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-scope.c b/libvisual-plugins/plugins/actor/oinksie/gfx-scope.c index abf7cc9aa..8d32728d6 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-scope.c +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-scope.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -30,207 +31,209 @@ #include "gfx-misc.h" #include "gfx-scope.h" +void _oink_gfx_scope_stereo(OinksiePrivate *priv, uint8_t *buf, int color1, + int color2, int height, int space, int rotate) { + int adder = priv->screen_width > 512 ? (priv->screen_width - 512) / 2 : 0; -void _oink_gfx_scope_stereo (OinksiePrivate *priv, uint8_t *buf, int color1, int color2, int height, int space, int rotate) -{ - int adder = priv->screen_width > 512 ? (priv->screen_width - 512) / 2 : 0; - - int x = 0; + int x = 0; - int xc = 0; + int xc = 0; - int xc1r = 0; - int xc2r = 0; + int xc1r = 0; + int xc2r = 0; - int xc_old = 0; + int xc_old = 0; - int xc1_oldr = 0; - int xc2_oldr = 0; + int xc1_oldr = 0; + int xc2_oldr = 0; - int y1; - int y2; + int y1; + int y2; - int y1r; - int y2r; + int y1r; + int y2r; - int y1_old; - int y2_old; + int y1_old; + int y2_old; - int y1_oldr; - int y2_oldr; + int y1_oldr; + int y2_oldr; - int base = priv->screen_halfheight - (space / 2); - int base2 = priv->screen_halfheight + (space / 2); + int base = priv->screen_halfheight - (space / 2); + int base2 = priv->screen_halfheight + (space / 2); - y1_old = ((base) + (priv->audio.pcm[0][0]) * height); - y2_old = ((base2) + (priv->audio.pcm[1][0]) * height); + y1_old = ((base) + (priv->audio.pcm[0][0]) * height); + y2_old = ((base2) + (priv->audio.pcm[1][0]) * height); - if (rotate != 0) - { - y1_oldr = y1_old - priv->screen_halfheight; - y2_oldr = y2_old - priv->screen_halfheight; + if (rotate != 0) { + y1_oldr = y1_old - priv->screen_halfheight; + y2_oldr = y2_old - priv->screen_halfheight; - _oink_pixel_rotate (&xc1_oldr, &y1_oldr, rotate); - _oink_pixel_rotate (&xc2_oldr, &y2_oldr, rotate); - } + _oink_pixel_rotate(&xc1_oldr, &y1_oldr, rotate); + _oink_pixel_rotate(&xc2_oldr, &y2_oldr, rotate); + } - for (x = 1; x < priv->screen_width && x < 512; x++) - { - y1 = ((base) + (priv->audio.pcm[0][x >> 1]) * height); - y2 = ((base2) + (priv->audio.pcm[1][x >> 1]) * height); + for (x = 1; x < priv->screen_width && x < 512; x++) { + y1 = ((base) + (priv->audio.pcm[0][x >> 1]) * height); + y2 = ((base2) + (priv->audio.pcm[1][x >> 1]) * height); - if (y1 < 0) - y1 = 0; - else if (y1 > priv->screen_height) - y1 = priv->screen_height - 1; + if (y1 < 0) + y1 = 0; + else if (y1 > priv->screen_height) + y1 = priv->screen_height - 1; - if (y2 < 0) - y2 = 0; - else if (y2 > priv->screen_height) - y2= priv->screen_height - 1; + if (y2 < 0) + y2 = 0; + else if (y2 > priv->screen_height) + y2 = priv->screen_height - 1; - xc = x + adder; + xc = x + adder; - if (rotate != 0) - { - xc1r = xc - priv->screen_halfwidth; - xc2r = xc - priv->screen_halfwidth; + if (rotate != 0) { + xc1r = xc - priv->screen_halfwidth; + xc2r = xc - priv->screen_halfwidth; - xc1_oldr = xc_old - priv->screen_halfwidth; - xc2_oldr = xc_old - priv->screen_halfwidth; + xc1_oldr = xc_old - priv->screen_halfwidth; + xc2_oldr = xc_old - priv->screen_halfwidth; - y1r = y1 - priv->screen_halfheight; - y2r = y2 - priv->screen_halfheight; + y1r = y1 - priv->screen_halfheight; + y2r = y2 - priv->screen_halfheight; - y1_oldr = y1_old - priv->screen_halfheight; - y2_oldr = y2_old - priv->screen_halfheight; + y1_oldr = y1_old - priv->screen_halfheight; + y2_oldr = y2_old - priv->screen_halfheight; - _oink_pixel_rotate (&xc1r, &y1r, rotate); - _oink_pixel_rotate (&xc2r, &y2r, rotate); + _oink_pixel_rotate(&xc1r, &y1r, rotate); + _oink_pixel_rotate(&xc2r, &y2r, rotate); - _oink_pixel_rotate (&xc1_oldr, &y1_oldr, rotate); - _oink_pixel_rotate (&xc2_oldr, &y2_oldr, rotate); + _oink_pixel_rotate(&xc1_oldr, &y1_oldr, rotate); + _oink_pixel_rotate(&xc2_oldr, &y2_oldr, rotate); - _oink_gfx_line (priv, buf, color1, xc1r + priv->screen_halfwidth, - y1r + priv->screen_halfheight, xc1_oldr + priv->screen_halfwidth, - y1_oldr + priv->screen_halfheight); - _oink_gfx_line (priv, buf, color2, xc2r + priv->screen_halfwidth, - y2r + priv->screen_halfheight, xc2_oldr + priv->screen_halfwidth, - y2_oldr + priv->screen_halfheight); - } - else - { - _oink_gfx_vline (priv, buf, color1, xc, y1, y1_old); - _oink_gfx_vline (priv, buf, color2, xc, y2, y2_old); - } + _oink_gfx_line(priv, buf, color1, xc1r + priv->screen_halfwidth, + y1r + priv->screen_halfheight, + xc1_oldr + priv->screen_halfwidth, + y1_oldr + priv->screen_halfheight); + _oink_gfx_line(priv, buf, color2, xc2r + priv->screen_halfwidth, + y2r + priv->screen_halfheight, + xc2_oldr + priv->screen_halfwidth, + y2_oldr + priv->screen_halfheight); + } else { + _oink_gfx_vline(priv, buf, color1, xc, y1, y1_old); + _oink_gfx_vline(priv, buf, color2, xc, y2, y2_old); + } - y1_old = y1; - y2_old = y2; + y1_old = y1; + y2_old = y2; - xc_old = xc; - } + xc_old = xc; + } } -void _oink_gfx_scope_bulbous (OinksiePrivate *priv, uint8_t *buf, int color, int height) -{ - int adder = priv->screen_width > 512 ? (priv->screen_width - 512) / 2 : 0; - float tabadd = priv->screen_width > 512 ? ((float) OINK_TABLE_NORMAL_SIZE / 512.00) / 2.00 : - ((float) OINK_TABLE_NORMAL_SIZE / priv->screen_width) / 2.00; - float tab = 0; - int x; - int y; - int y2; - int y_old; - - y = ((priv->screen_halfheight) + (((priv->audio.pcm[2][0]) * height) * _oink_table_sin[(int) tab])); - - y_old = y; - - for (x = 0; x < priv->screen_width && x < 512; x++) - { - tab += tabadd; - - y = ((priv->screen_halfheight) + (((priv->audio.pcm[2][x >> 1]) * height) * _oink_table_sin[(int) tab])); - y2 = ((priv->screen_halfheight) + ((((priv->audio.pcm[2][x >> 1]) * height) * _oink_table_sin[(int) tab]) * 1.4)); - - if (y < 0) - y = 0; - else if (y > priv->screen_height) - y = priv->screen_height - 1; - - if (y2 < 0) - y2 = 0; - else if (y2 > priv->screen_height) - y2 = priv->screen_height - 1; - - _oink_gfx_vline (priv, buf, color, x + adder, y, y2); - _oink_gfx_vline (priv, buf, color, x + adder, y, y_old); - - y_old = y; - } +void _oink_gfx_scope_bulbous(OinksiePrivate *priv, uint8_t *buf, int color, + int height) { + int adder = priv->screen_width > 512 ? (priv->screen_width - 512) / 2 : 0; + float tabadd = + priv->screen_width > 512 + ? ((float)OINK_TABLE_NORMAL_SIZE / 512.00) / 2.00 + : ((float)OINK_TABLE_NORMAL_SIZE / priv->screen_width) / 2.00; + float tab = 0; + int x; + int y; + int y2; + int y_old; + + y = ((priv->screen_halfheight) + + (((priv->audio.pcm[2][0]) * height) * _oink_table_sin[(int)tab])); + + y_old = y; + + for (x = 0; x < priv->screen_width && x < 512; x++) { + tab += tabadd; + + y = ((priv->screen_halfheight) + + (((priv->audio.pcm[2][x >> 1]) * height) * _oink_table_sin[(int)tab])); + y2 = + ((priv->screen_halfheight) + ((((priv->audio.pcm[2][x >> 1]) * height) * + _oink_table_sin[(int)tab]) * + 1.4)); + + if (y < 0) + y = 0; + else if (y > priv->screen_height) + y = priv->screen_height - 1; + + if (y2 < 0) + y2 = 0; + else if (y2 > priv->screen_height) + y2 = priv->screen_height - 1; + + _oink_gfx_vline(priv, buf, color, x + adder, y, y2); + _oink_gfx_vline(priv, buf, color, x + adder, y, y_old); + + y_old = y; + } } -void _oink_gfx_scope_normal (OinksiePrivate *priv, uint8_t *buf, int color, int height) -{ - VisRectangle *rect = NULL; - int i; - float fx[512]; - float fy[512]; - int x[512]; - int y[512]; - int yold = priv->screen_halfheight; - - for (i = 0; i < 512; i++) { - fx[i] = (1.0 / 512.0) * i; - fy[i] = (1 + sin(i)) * 0.5; - fy[i] = 0.5 + ((priv->audio.pcm[2][i]) * 0.2); - } - - rect = visual_rectangle_new (0, 0, priv->screen_width, priv->screen_height); - visual_rectangle_denormalize_points (rect, fx, fy, x, y, 512); - visual_rectangle_free (rect); - - for (i = 0; i < 512; i++) { - _oink_gfx_vline (priv, buf, color, x[i], y[i], yold); - yold = y[i]; - } +void _oink_gfx_scope_normal(OinksiePrivate *priv, uint8_t *buf, int color, + int height) { + VisRectangle *rect = NULL; + int i; + float fx[512]; + float fy[512]; + int x[512]; + int y[512]; + int yold = priv->screen_halfheight; + + for (i = 0; i < 512; i++) { + fx[i] = (1.0 / 512.0) * i; + fy[i] = (1 + sin(i)) * 0.5; + fy[i] = 0.5 + ((priv->audio.pcm[2][i]) * 0.2); + } + + rect = visual_rectangle_new(0, 0, priv->screen_width, priv->screen_height); + visual_rectangle_denormalize_points(rect, fx, fy, x, y, 512); + visual_rectangle_free(rect); + + for (i = 0; i < 512; i++) { + _oink_gfx_vline(priv, buf, color, x[i], y[i], yold); + yold = y[i]; + } } -void _oink_gfx_scope_circle (OinksiePrivate *priv, uint8_t *buf, int color, int size, int x, int y) -{ - int i; +void _oink_gfx_scope_circle(OinksiePrivate *priv, uint8_t *buf, int color, + int size, int x, int y) { + int i; - int xs1; - int ys1; + int xs1; + int ys1; - int xs2; - int ys2; + int xs2; + int ys2; - int xcon; - int ycon; + int xcon; + int ycon; - int adder = (OINK_TABLE_NORMAL_SIZE - 1) / 50; - int tab = 0; + int adder = (OINK_TABLE_NORMAL_SIZE - 1) / 50; + int tab = 0; - xs2 = (_oink_table_sin[tab] * ((priv->audio.pcm[2][0]) + size)) + x; - ys2 = (_oink_table_cos[tab] * ((priv->audio.pcm[2][0]) + size)) + y; + xs2 = (_oink_table_sin[tab] * ((priv->audio.pcm[2][0]) + size)) + x; + ys2 = (_oink_table_cos[tab] * ((priv->audio.pcm[2][0]) + size)) + y; - xcon = xs2; - ycon = ys2; + xcon = xs2; + ycon = ys2; - for (i = 0; i < 50; i++) - { - xs1 = (_oink_table_sin[tab] * ((priv->audio.pcm[2][i >> 1] * 50) + size)) + x; - ys1 = (_oink_table_cos[tab] * ((priv->audio.pcm[2][i >> 1] * 50) + size)) + y; + for (i = 0; i < 50; i++) { + xs1 = + (_oink_table_sin[tab] * ((priv->audio.pcm[2][i >> 1] * 50) + size)) + x; + ys1 = + (_oink_table_cos[tab] * ((priv->audio.pcm[2][i >> 1] * 50) + size)) + y; - tab += adder; + tab += adder; - _oink_gfx_line (priv, buf, color, xs1, ys1, xs2, ys2); + _oink_gfx_line(priv, buf, color, xs1, ys1, xs2, ys2); - xs2 = xs1; - ys2 = ys1; - } + xs2 = xs1; + ys2 = ys1; + } - _oink_gfx_line (priv, buf, color, xcon, ycon, xs1, ys1); + _oink_gfx_line(priv, buf, color, xcon, ycon, xs1, ys1); } - diff --git a/libvisual-plugins/plugins/actor/oinksie/gfx-scope.h b/libvisual-plugins/plugins/actor/oinksie/gfx-scope.h index 083c1f8e3..7d9e0ec3b 100644 --- a/libvisual-plugins/plugins/actor/oinksie/gfx-scope.h +++ b/libvisual-plugins/plugins/actor/oinksie/gfx-scope.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -26,9 +27,13 @@ #include "oinksie.h" -void _oink_gfx_scope_stereo (OinksiePrivate *priv, uint8_t *buf, int color1, int color2, int height, int space, int rotate); -void _oink_gfx_scope_bulbous (OinksiePrivate *priv, uint8_t *buf, int color, int height); -void _oink_gfx_scope_normal (OinksiePrivate *priv, uint8_t *buf, int color, int height); -void _oink_gfx_scope_circle (OinksiePrivate *priv, uint8_t *buf, int color, int size, int x, int y); +void _oink_gfx_scope_stereo(OinksiePrivate *priv, uint8_t *buf, int color1, + int color2, int height, int space, int rotate); +void _oink_gfx_scope_bulbous(OinksiePrivate *priv, uint8_t *buf, int color, + int height); +void _oink_gfx_scope_normal(OinksiePrivate *priv, uint8_t *buf, int color, + int height); +void _oink_gfx_scope_circle(OinksiePrivate *priv, uint8_t *buf, int color, + int size, int x, int y); #endif /* _OINK_GFX_SCOPE_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/misc.c b/libvisual-plugins/plugins/actor/oinksie/misc.c index fdf8f9c00..ca6e6a321 100644 --- a/libvisual-plugins/plugins/actor/oinksie/misc.c +++ b/libvisual-plugins/plugins/actor/oinksie/misc.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -33,122 +34,107 @@ #include /* FIXME when using tables check radian sanity (!>= 2 PI | % TAB SIZE DUS ?); */ -int _oink_line_x_next_rad (int x, int length, float rad) -{ -/* return (_oink_table_sinlarge[(int) (rad * (OINK_TABLE_LARGE_SIZE / (PI * 2)))] * length) + x; */ - return (sin (rad) * length) + x; +int _oink_line_x_next_rad(int x, int length, float rad) { + /* return (_oink_table_sinlarge[(int) (rad * (OINK_TABLE_LARGE_SIZE / (PI * + * 2)))] * length) + x; */ + return (sin(rad) * length) + x; } -int _oink_line_y_next_rad (int y, int length, float rad) -{ -/* return (_oink_table_coslarge[(int) (rad * (OINK_TABLE_LARGE_SIZE / (PI * 2)))] * length) + y; */ - return (cos (rad + PI) * length) + y; +int _oink_line_y_next_rad(int y, int length, float rad) { + /* return (_oink_table_coslarge[(int) (rad * (OINK_TABLE_LARGE_SIZE / (PI * + * 2)))] * length) + y; */ + return (cos(rad + PI) * length) + y; } -int _oink_line_length (int x0, int y0, int x1, int y1) -{ - return sqrt (pow (y0 - y1, 2) + pow (x0 - x1, 2)); +int _oink_line_length(int x0, int y0, int x1, int y1) { + return sqrt(pow(y0 - y1, 2) + pow(x0 - x1, 2)); } -/* FIXME .. this.. could.. be.. a.. smaller.. and especially.. faster.. function :) */ -int _oink_line_xory_next_xy (int xory, int length, int x0, int y0, int x1, int y1) -{ - int dy = y1 - y0; - int dx = x1 - x0; - int stepx, stepy; - int fraction; - int pixdrawn = 0; - - if(dy < 0) - { - dy = -dy; - stepy = -1; - } - else - { - stepy = 1; - } - - if (dx < 0) - { - dx = -dx; - stepx = -1; - } - else - { - stepx = 1; - } - - dy <<= 1; - dx <<= 1; - - if (length == 0 && xory == 0) - return x0; - - if (length == 0 && xory == 1) - return y0; - - if (dx > dy) - { - fraction = dy - (dx >> 1); - - while (x0 != x1) - { - if (fraction >= 0) - { - y0 += stepy; - fraction -= dx; - } - x0 += stepx; - fraction += dy; - - pixdrawn++; - - if (pixdrawn >= length) - { - if (xory == 0) - return x0; - else - return y0; - } - } - } - else - { - fraction = dx - (dy >> 1); - while (y0 != y1) - { - if (fraction >= 0) - { - x0 += stepx; - fraction -= dy; - } - y0 += stepy; - fraction += dx; - - pixdrawn++; - - if (pixdrawn >= length) - { - if (xory == 0) - return x0; - else - return y0; - } - } - } - - if (xory == 0) - return x0; - else - return y0; +/* FIXME .. this.. could.. be.. a.. smaller.. and especially.. faster.. function + * :) */ +int _oink_line_xory_next_xy(int xory, int length, int x0, int y0, int x1, + int y1) { + int dy = y1 - y0; + int dx = x1 - x0; + int stepx, stepy; + int fraction; + int pixdrawn = 0; + + if (dy < 0) { + dy = -dy; + stepy = -1; + } else { + stepy = 1; + } + + if (dx < 0) { + dx = -dx; + stepx = -1; + } else { + stepx = 1; + } + + dy <<= 1; + dx <<= 1; + + if (length == 0 && xory == 0) + return x0; + + if (length == 0 && xory == 1) + return y0; + + if (dx > dy) { + fraction = dy - (dx >> 1); + + while (x0 != x1) { + if (fraction >= 0) { + y0 += stepy; + fraction -= dx; + } + x0 += stepx; + fraction += dy; + + pixdrawn++; + + if (pixdrawn >= length) { + if (xory == 0) + return x0; + else + return y0; + } + } + } else { + fraction = dx - (dy >> 1); + while (y0 != y1) { + if (fraction >= 0) { + x0 += stepx; + fraction -= dy; + } + y0 += stepy; + fraction += dx; + + pixdrawn++; + + if (pixdrawn >= length) { + if (xory == 0) + return x0; + else + return y0; + } + } + } + + if (xory == 0) + return x0; + else + return y0; } -void _oink_pixel_rotate (int *x, int *y, int rot) -{ - int tx = *x; +void _oink_pixel_rotate(int *x, int *y, int rot) { + int tx = *x; - *x = (tx * _oink_table_cos[rot % OINK_TABLE_NORMAL_SIZE]) + (*y * _oink_table_sin[rot % OINK_TABLE_NORMAL_SIZE]); - *y = (tx * _oink_table_sin[rot % OINK_TABLE_NORMAL_SIZE]) - (*y * _oink_table_cos[rot % OINK_TABLE_NORMAL_SIZE]); + *x = (tx * _oink_table_cos[rot % OINK_TABLE_NORMAL_SIZE]) + + (*y * _oink_table_sin[rot % OINK_TABLE_NORMAL_SIZE]); + *y = (tx * _oink_table_sin[rot % OINK_TABLE_NORMAL_SIZE]) - + (*y * _oink_table_cos[rot % OINK_TABLE_NORMAL_SIZE]); } - diff --git a/libvisual-plugins/plugins/actor/oinksie/misc.h b/libvisual-plugins/plugins/actor/oinksie/misc.h index c9b17d8c5..12bae8978 100644 --- a/libvisual-plugins/plugins/actor/oinksie/misc.h +++ b/libvisual-plugins/plugins/actor/oinksie/misc.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -24,11 +25,12 @@ #ifndef _OINK_MISC_H #define _OINK_MISC_H -int _oink_line_x_next_rad (int x, int length, float rad); -int _oink_line_y_next_rad (int y, int length, float rad); -int _oink_line_length (int x0, int y0, int x1, int y1); -int _oink_line_xory_next_xy (int xory, int length, int x0, int y0, int x1, int y1); +int _oink_line_x_next_rad(int x, int length, float rad); +int _oink_line_y_next_rad(int y, int length, float rad); +int _oink_line_length(int x0, int y0, int x1, int y1); +int _oink_line_xory_next_xy(int xory, int length, int x0, int y0, int x1, + int y1); -void _oink_pixel_rotate (int *x, int *y, int rot); +void _oink_pixel_rotate(int *x, int *y, int rot); #endif /* _OINK_MISC_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/oink-config.h b/libvisual-plugins/plugins/actor/oinksie/oink-config.h index 8d30c057e..46c4efb4b 100644 --- a/libvisual-plugins/plugins/actor/oinksie/oink-config.h +++ b/libvisual-plugins/plugins/actor/oinksie/oink-config.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -27,11 +28,11 @@ #include "oinksie.h" /* random config sets */ -void _oink_config_random_blurmode (OinksiePrivate *priv); -void _oink_config_random_scopemode (OinksiePrivate *priv); -void _oink_config_random_backgroundmode (OinksiePrivate *priv); -void _oink_config_random_beatdots (OinksiePrivate *priv); -void _oink_config_random_scopestereo (OinksiePrivate *priv); -void _oink_config_random_palfunky (OinksiePrivate *priv); +void _oink_config_random_blurmode(OinksiePrivate *priv); +void _oink_config_random_scopemode(OinksiePrivate *priv); +void _oink_config_random_backgroundmode(OinksiePrivate *priv); +void _oink_config_random_beatdots(OinksiePrivate *priv); +void _oink_config_random_scopestereo(OinksiePrivate *priv); +void _oink_config_random_palfunky(OinksiePrivate *priv); #endif /* _OINK_CONFIG_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/oinksie.c b/libvisual-plugins/plugins/actor/oinksie/oinksie.c index aa0ef9b74..ca3390755 100644 --- a/libvisual-plugins/plugins/actor/oinksie/oinksie.c +++ b/libvisual-plugins/plugins/actor/oinksie/oinksie.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -34,53 +35,36 @@ #include "scene.h" #include "oinksie.h" -void oinksie_init (OinksiePrivate *priv, int width, int height) -{ - _oink_screen_init (priv, width, height); - _oink_table_init (); - _oink_gfx_palette_init (priv); - _oink_scene_randomize (priv); +void oinksie_init(OinksiePrivate *priv, int width, int height) { + _oink_screen_init(priv, width, height); + _oink_table_init(); + _oink_gfx_palette_init(priv); + _oink_scene_randomize(priv); } -void oinksie_quit (OinksiePrivate *priv) -{ - -} +void oinksie_quit(OinksiePrivate *priv) {} -void oinksie_sample (OinksiePrivate *priv) -{ - _oink_audio_analyse (priv); -} +void oinksie_sample(OinksiePrivate *priv) { _oink_audio_analyse(priv); } -void oinksie_render (OinksiePrivate *priv) -{ - _oink_scene_render (priv); -} +void oinksie_render(OinksiePrivate *priv) { _oink_scene_render(priv); } -void oinksie_palette_change (OinksiePrivate *priv, uint8_t funky) -{ - _oink_gfx_palette_build (priv, funky); +void oinksie_palette_change(OinksiePrivate *priv, uint8_t funky) { + _oink_gfx_palette_build(priv, funky); } -int oinksie_size_set (OinksiePrivate *priv, int width, int height) -{ - _oink_screen_size_set (priv, width, height); +int oinksie_size_set(OinksiePrivate *priv, int width, int height) { + _oink_screen_size_set(priv, width, height); - return 0; + return 0; } -VisPalette *oinksie_palette_get (OinksiePrivate *priv) -{ - /* return values for transformation */ - if (priv->pal_data.pal_new == 1) - { - _oink_gfx_palette_transform (priv); +VisPalette *oinksie_palette_get(OinksiePrivate *priv) { + /* return values for transformation */ + if (priv->pal_data.pal_new == 1) { + _oink_gfx_palette_transform(priv); - return priv->pal_old; - } - else - { - return priv->pal_cur; - } + return priv->pal_old; + } else { + return priv->pal_cur; + } } - diff --git a/libvisual-plugins/plugins/actor/oinksie/oinksie.h b/libvisual-plugins/plugins/actor/oinksie/oinksie.h index 764b64c49..5c8872042 100644 --- a/libvisual-plugins/plugins/actor/oinksie/oinksie.h +++ b/libvisual-plugins/plugins/actor/oinksie/oinksie.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -30,132 +31,132 @@ /* FIXME indent all likewise eventually */ typedef struct { - float r; - float g; - float b; - float r_cur; - float g_cur; - float b_cur; + float r; + float g; + float b; + float r_cur; + float g_cur; + float b_cur; } OinksiePalFade; typedef struct { - int pal_new; + int pal_new; - int fade_start; - int fade_steps; - int fade_stepsdone; - int fade_poststeps; - int fade_poststop; + int fade_start; + int fade_steps; + int fade_stepsdone; + int fade_poststeps; + int fade_poststop; } OinksiePalData; typedef struct { - int blurmode; - int scopemode; - int backgroundmode; + int blurmode; + int scopemode; + int backgroundmode; - int audiodebug; + int audiodebug; - int palfunky; + int palfunky; - int scenenew; + int scenenew; - int acidpalette; + int acidpalette; } OinksieConfig; typedef struct { - int bass; + int bass; - int tripple; + int tripple; - int highest; + int highest; - float pcm[3][512]; - float freq[2][256]; - float freqsmall[4]; + float pcm[3][512]; + float freq[2][256]; + float freqsmall[4]; - int musicmood; - char beat; - int energy; + int musicmood; + char beat; + int energy; - int volume; + int volume; } OinksieAudio; typedef struct { - int scopestereo_enabled; - int scopestereo_start; - int scopestereo_space; - float scopestereo_adder; - - /* shooting balls vars */ - int ball_enabled; - int ball_xstart; - int ball_ystart; - int ball_distance; - int ball_adder; - int ball_spread; - - /* turning circles vars */ - int circles_enabled; - int circles_direction; - int circles_nr; - int circles_turn; - - /* ball sine */ - int ballsine_enabled; - int ballsine_scroll; - int ballsine_rotate; - int ballsine_infade; - int ballsine_direction; - - /* floaters vars */ - int floaters_direction; - int floaters_turn; - - int rotate; + int scopestereo_enabled; + int scopestereo_start; + int scopestereo_space; + float scopestereo_adder; + + /* shooting balls vars */ + int ball_enabled; + int ball_xstart; + int ball_ystart; + int ball_distance; + int ball_adder; + int ball_spread; + + /* turning circles vars */ + int circles_enabled; + int circles_direction; + int circles_nr; + int circles_turn; + + /* ball sine */ + int ballsine_enabled; + int ballsine_scroll; + int ballsine_rotate; + int ballsine_infade; + int ballsine_direction; + + /* floaters vars */ + int floaters_direction; + int floaters_turn; + + int rotate; } OinksieScene; typedef struct { - /* Major vars */ - uint8_t *drawbuf; - - /* Palette vars */ - OinksiePalFade pal_fades[256]; - OinksiePalData pal_data; - VisPalette *pal_cur; - VisPalette *pal_old; - int pal_startup; - - /* Screen vars */ - int screen_size; - int screen_width; - int screen_height; - int screen_halfwidth; - int screen_halfheight; - int screen_xybiggest; - int screen_xysmallest; - - time_t timing; - time_t timing_prev; - - /* Config vars */ - OinksieConfig config; - OinksieAudio audio; - OinksieScene scene; - - /* Random context */ - VisRandomContext *rcontext; + /* Major vars */ + uint8_t *drawbuf; + + /* Palette vars */ + OinksiePalFade pal_fades[256]; + OinksiePalData pal_data; + VisPalette *pal_cur; + VisPalette *pal_old; + int pal_startup; + + /* Screen vars */ + int screen_size; + int screen_width; + int screen_height; + int screen_halfwidth; + int screen_halfheight; + int screen_xybiggest; + int screen_xysmallest; + + time_t timing; + time_t timing_prev; + + /* Config vars */ + OinksieConfig config; + OinksieAudio audio; + OinksieScene scene; + + /* Random context */ + VisRandomContext *rcontext; } OinksiePrivate; -void oinksie_init (OinksiePrivate *priv, int width, int height); -void oinksie_quit (OinksiePrivate *priv); +void oinksie_init(OinksiePrivate *priv, int width, int height); +void oinksie_quit(OinksiePrivate *priv); -void oinksie_sample (OinksiePrivate *priv); +void oinksie_sample(OinksiePrivate *priv); -void oinksie_palette_change (OinksiePrivate *priv, uint8_t funky); +void oinksie_palette_change(OinksiePrivate *priv, uint8_t funky); -void oinksie_render (OinksiePrivate *priv); -int oinksie_size_set (OinksiePrivate *priv, int width, int height); +void oinksie_render(OinksiePrivate *priv); +int oinksie_size_set(OinksiePrivate *priv, int width, int height); -VisPalette *oinksie_palette_get (OinksiePrivate *priv); +VisPalette *oinksie_palette_get(OinksiePrivate *priv); #endif /* _OINK_OINKSIE_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/scene.c b/libvisual-plugins/plugins/actor/oinksie/scene.c index f2df8d450..48350a0b7 100644 --- a/libvisual-plugins/plugins/actor/oinksie/scene.c +++ b/libvisual-plugins/plugins/actor/oinksie/scene.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -35,307 +36,300 @@ #include "misc.h" #include "scene.h" -static void _oink_scene_scope_special (OinksiePrivate *priv, uint8_t *buf) -{ - if (visual_random_context_int_range (priv->rcontext, 0, 500) == 42) - { - priv->scene.scopestereo_adder = priv->screen_halfheight / 100; - priv->scene.scopestereo_start = 1 - priv->scene.scopestereo_start; - priv->scene.scopestereo_space = priv->screen_halfheight + 10; - - if (priv->scene.scopestereo_start == TRUE) - priv->scene.scopestereo_enabled = TRUE; - } - - if (priv->scene.scopestereo_enabled && priv->config.scopemode != 2 && priv->config.scopemode != 6) - { - if (priv->scene.scopestereo_start == TRUE) - { - priv->scene.scopestereo_space -= priv->scene.scopestereo_adder; - _oink_gfx_scope_stereo (priv, buf, 235, 235 - (priv->audio.bass * 2), priv->screen_height / 6, priv->scene.scopestereo_space, 0); - - if (priv->scene.scopestereo_space < priv->screen_halfheight) - priv->scene.scopestereo_start = FALSE; - } - else - { - _oink_gfx_scope_stereo (priv, buf, 235, 235 - (priv->audio.bass * 2), priv->screen_height / 6, priv->screen_halfheight, 0); - } - } +static void _oink_scene_scope_special(OinksiePrivate *priv, uint8_t *buf) { + if (visual_random_context_int_range(priv->rcontext, 0, 500) == 42) { + priv->scene.scopestereo_adder = priv->screen_halfheight / 100; + priv->scene.scopestereo_start = 1 - priv->scene.scopestereo_start; + priv->scene.scopestereo_space = priv->screen_halfheight + 10; + + if (priv->scene.scopestereo_start == TRUE) + priv->scene.scopestereo_enabled = TRUE; + } + + if (priv->scene.scopestereo_enabled && priv->config.scopemode != 2 && + priv->config.scopemode != 6) { + if (priv->scene.scopestereo_start == TRUE) { + priv->scene.scopestereo_space -= priv->scene.scopestereo_adder; + _oink_gfx_scope_stereo(priv, buf, 235, 235 - (priv->audio.bass * 2), + priv->screen_height / 6, + priv->scene.scopestereo_space, 0); + + if (priv->scene.scopestereo_space < priv->screen_halfheight) + priv->scene.scopestereo_start = FALSE; + } else { + _oink_gfx_scope_stereo(priv, buf, 235, 235 - (priv->audio.bass * 2), + priv->screen_height / 6, priv->screen_halfheight, + 0); + } + } } -void _oink_scene_background_special (OinksiePrivate *priv, uint8_t *buf) -{ - if (priv->audio.beat == TRUE) - { - if (visual_random_context_int_range (priv->rcontext, 0, 140) == 42 && priv->scene.ball_enabled == FALSE) - { - priv->scene.ball_enabled = TRUE; - - priv->scene.ball_xstart = visual_random_context_int_range (priv->rcontext, 0, priv->screen_width - 1); - priv->scene.ball_ystart = priv->screen_height; - - priv->scene.ball_distance = _oink_line_length (priv->screen_halfheight, priv->scene.ball_ystart, - priv->screen_halfwidth, priv->scene.ball_xstart); - - /* FIXME use fps data instead of '25' here */ - priv->scene.ball_adder = (priv->scene.ball_distance / (25 + 1)) + 1; - } - - if (visual_random_context_int_range (priv->rcontext, 0, 5) == 4) - priv->scene.circles_direction = 1 - priv->scene.circles_direction; - } - - if (priv->scene.circles_direction == 0) - priv->scene.circles_turn += priv->audio.bass * 4; - else - priv->scene.circles_turn -= priv->audio.bass * 4; - - if (visual_random_context_int_range (priv->rcontext, 0, 450) == 42) - { - priv->scene.ballsine_enabled = 1 - priv->scene.ballsine_enabled; - priv->scene.ballsine_infade = 0; - } - - if (visual_random_context_int_range (priv->rcontext, 0, 160) == 42) - priv->scene.ballsine_direction = 1 - priv->scene.ballsine_direction; - - if (priv->scene.ball_enabled == TRUE) - { - _oink_gfx_background_ball_shooting (priv, buf, 250, priv->scene.ball_distance, - priv->scene.ball_xstart, priv->scene.ball_ystart, - priv->screen_halfwidth, priv->screen_halfheight); - - priv->scene.ball_distance -= priv->scene.ball_adder; - - if (priv->scene.ball_distance < 0) - { - priv->scene.ball_enabled = FALSE; - } - } - - if (priv->scene.circles_enabled == TRUE) - { - if (priv->audio.energy > ((priv->screen_xysmallest / 10) + 2) / 2) - { - if (priv->audio.energy > (priv->screen_xysmallest / 2) - ((priv->screen_xysmallest / 10) + 2)) - { - priv->scene.ball_spread = (priv->screen_xysmallest / 2) - ((priv->screen_xysmallest / 10) + 2); - } - else - { - if (priv->screen_xysmallest / 2 > 100) - { - priv->scene.ball_spread = (int) ((float) ((priv->audio.energy * (float) - (priv->screen_xysmallest / 100.00)) / 2)) - - ((priv->screen_xysmallest / 10) + 2); - } - else - { - priv->scene.ball_spread = priv->audio.energy; - } - } - } - else - { - priv->scene.ball_spread = (priv->screen_xysmallest / 10) + 2; - } - - _oink_gfx_background_circles_filled (priv, buf, 250, priv->screen_xysmallest / 10, 5, priv->scene.ball_spread, - priv->scene.circles_turn, priv->screen_halfwidth, priv->screen_halfheight); - - } -/* - if (priv->scene.ballsine_enabled == TRUE) - { - if (priv->audio.beat == 1 && visual_random_context_int_range (priv->rcontext, 0, 42) == 0) - priv->scene.ballsine_infade = 0; - - if (priv->scene.ballsine_infade < 240) - priv->scene.ballsine_infade += 10; - - _oink_gfx_background_circles_sine (priv, priv->drawbuf, priv->scene.ballsine_infade, - priv->scene.ballsine_rotate, priv->scene.ballsine_scroll, 80, 50); - - if (priv->scene.ballsine_direction == 0) - { - priv->scene.ballsine_scroll += ((priv->audio.energy >> 3) + 1); - priv->scene.ballsine_rotate += ((priv->audio.energy >> 3) + 1); - } - else - { - priv->scene.ballsine_scroll -= ((priv->audio.energy >> 3) + 1); - priv->scene.ballsine_rotate -= ((priv->audio.energy >> 3) + 1); - } - } - */ +void _oink_scene_background_special(OinksiePrivate *priv, uint8_t *buf) { + if (priv->audio.beat == TRUE) { + if (visual_random_context_int_range(priv->rcontext, 0, 140) == 42 && + priv->scene.ball_enabled == FALSE) { + priv->scene.ball_enabled = TRUE; + + priv->scene.ball_xstart = visual_random_context_int_range( + priv->rcontext, 0, priv->screen_width - 1); + priv->scene.ball_ystart = priv->screen_height; + + priv->scene.ball_distance = + _oink_line_length(priv->screen_halfheight, priv->scene.ball_ystart, + priv->screen_halfwidth, priv->scene.ball_xstart); + + /* FIXME use fps data instead of '25' here */ + priv->scene.ball_adder = (priv->scene.ball_distance / (25 + 1)) + 1; + } + + if (visual_random_context_int_range(priv->rcontext, 0, 5) == 4) + priv->scene.circles_direction = 1 - priv->scene.circles_direction; + } + + if (priv->scene.circles_direction == 0) + priv->scene.circles_turn += priv->audio.bass * 4; + else + priv->scene.circles_turn -= priv->audio.bass * 4; + + if (visual_random_context_int_range(priv->rcontext, 0, 450) == 42) { + priv->scene.ballsine_enabled = 1 - priv->scene.ballsine_enabled; + priv->scene.ballsine_infade = 0; + } + + if (visual_random_context_int_range(priv->rcontext, 0, 160) == 42) + priv->scene.ballsine_direction = 1 - priv->scene.ballsine_direction; + + if (priv->scene.ball_enabled == TRUE) { + _oink_gfx_background_ball_shooting( + priv, buf, 250, priv->scene.ball_distance, priv->scene.ball_xstart, + priv->scene.ball_ystart, priv->screen_halfwidth, + priv->screen_halfheight); + + priv->scene.ball_distance -= priv->scene.ball_adder; + + if (priv->scene.ball_distance < 0) { + priv->scene.ball_enabled = FALSE; + } + } + + if (priv->scene.circles_enabled == TRUE) { + if (priv->audio.energy > ((priv->screen_xysmallest / 10) + 2) / 2) { + if (priv->audio.energy > (priv->screen_xysmallest / 2) - + ((priv->screen_xysmallest / 10) + 2)) { + priv->scene.ball_spread = (priv->screen_xysmallest / 2) - + ((priv->screen_xysmallest / 10) + 2); + } else { + if (priv->screen_xysmallest / 2 > 100) { + priv->scene.ball_spread = + (int)((float)((priv->audio.energy * + (float)(priv->screen_xysmallest / 100.00)) / + 2)) - + ((priv->screen_xysmallest / 10) + 2); + } else { + priv->scene.ball_spread = priv->audio.energy; + } + } + } else { + priv->scene.ball_spread = (priv->screen_xysmallest / 10) + 2; + } + + _oink_gfx_background_circles_filled( + priv, buf, 250, priv->screen_xysmallest / 10, 5, + priv->scene.ball_spread, priv->scene.circles_turn, + priv->screen_halfwidth, priv->screen_halfheight); + } + /* + if (priv->scene.ballsine_enabled == TRUE) + { + if (priv->audio.beat == 1 && visual_random_context_int_range + (priv->rcontext, 0, 42) == 0) priv->scene.ballsine_infade = 0; + + if (priv->scene.ballsine_infade < 240) + priv->scene.ballsine_infade += 10; + + _oink_gfx_background_circles_sine (priv, priv->drawbuf, + priv->scene.ballsine_infade, priv->scene.ballsine_rotate, + priv->scene.ballsine_scroll, 80, 50); + + if (priv->scene.ballsine_direction == 0) + { + priv->scene.ballsine_scroll += ((priv->audio.energy >> + 3) + 1); priv->scene.ballsine_rotate += ((priv->audio.energy >> 3) + 1); + } + else + { + priv->scene.ballsine_scroll -= ((priv->audio.energy >> + 3) + 1); priv->scene.ballsine_rotate -= ((priv->audio.energy >> 3) + 1); + } + } + */ } -void _oink_scene_background_select (OinksiePrivate *priv, uint8_t *buf) -{ - if (visual_random_context_int_range (priv->rcontext, 0, 5) == 4 && priv->audio.beat == TRUE) - priv->scene.floaters_direction = 1 - priv->scene.floaters_direction; - - if (priv->scene.floaters_direction == 0) - priv->scene.floaters_turn += priv->audio.bass * 4; - else - priv->scene.floaters_turn -= priv->audio.bass * 4; - - - switch (priv->config.backgroundmode) - { - case 0: - _oink_gfx_background_floaters (priv, buf, 245, 5, 6, 0, priv->scene.floaters_turn, - priv->screen_height - (priv->screen_height / 4), 0, priv->audio.energy); - break; - - case 1: - _oink_gfx_background_floaters (priv, buf, 245, 10, 4, 0, priv->scene.floaters_turn * 2, - priv->screen_halfheight, 0, priv->audio.energy); - - _oink_gfx_background_floaters (priv, buf, 245, 5, 6, 0, priv->scene.floaters_turn, - priv->screen_height - (priv->screen_height / 4), 0, priv->audio.energy); - break; - -/* case 2: - _oink_gfx_background_circles_star (priv, priv->drawbuf, 242, - priv->screen_xysmallest / 4, - 5, 6, priv->audio.bass * 3, priv->audio.tripple * 30, - priv->screen_halfwidth, priv->screen_halfheight); - break; -*/ - default: - break; - } - +void _oink_scene_background_select(OinksiePrivate *priv, uint8_t *buf) { + if (visual_random_context_int_range(priv->rcontext, 0, 5) == 4 && + priv->audio.beat == TRUE) + priv->scene.floaters_direction = 1 - priv->scene.floaters_direction; + + if (priv->scene.floaters_direction == 0) + priv->scene.floaters_turn += priv->audio.bass * 4; + else + priv->scene.floaters_turn -= priv->audio.bass * 4; + + switch (priv->config.backgroundmode) { + case 0: + _oink_gfx_background_floaters( + priv, buf, 245, 5, 6, 0, priv->scene.floaters_turn, + priv->screen_height - (priv->screen_height / 4), 0, priv->audio.energy); + break; + + case 1: + _oink_gfx_background_floaters( + priv, buf, 245, 10, 4, 0, priv->scene.floaters_turn * 2, + priv->screen_halfheight, 0, priv->audio.energy); + + _oink_gfx_background_floaters( + priv, buf, 245, 5, 6, 0, priv->scene.floaters_turn, + priv->screen_height - (priv->screen_height / 4), 0, priv->audio.energy); + break; + + /* case 2: + _oink_gfx_background_circles_star (priv, + priv->drawbuf, 242, priv->screen_xysmallest / 4, 5, 6, priv->audio.bass * + 3, priv->audio.tripple * 30, priv->screen_halfwidth, + priv->screen_halfheight); break; + */ + default: + break; + } } -void _oink_scene_blur_select (OinksiePrivate *priv, uint8_t *buf) -{ - switch (priv->config.blurmode) - { - case 0: - _oink_gfx_blur_midstrange (priv, buf); - break; - - case 1: - _oink_gfx_blur_middle (priv, buf); - break; - - case 2: - _oink_gfx_blur_midstrange (priv, buf); - break; - - default: - _oink_gfx_blur_midstrange (priv, buf); - break; - } +void _oink_scene_blur_select(OinksiePrivate *priv, uint8_t *buf) { + switch (priv->config.blurmode) { + case 0: + _oink_gfx_blur_midstrange(priv, buf); + break; + + case 1: + _oink_gfx_blur_middle(priv, buf); + break; + + case 2: + _oink_gfx_blur_midstrange(priv, buf); + break; + + default: + _oink_gfx_blur_midstrange(priv, buf); + break; + } } -void _oink_scene_scope_select (OinksiePrivate *priv, uint8_t *buf, int color, int height) -{ - switch (priv->config.scopemode) - { - case 0: - case 1: - _oink_gfx_scope_normal (priv, buf, color, height); - break; - - case 2: - _oink_gfx_analyzer_stereo (priv, priv->drawbuf, color, priv->screen_height - 20); - break; - - case 3: - case 4: - _oink_gfx_scope_bulbous (priv, buf, color, height); - break; - - case 5: - _oink_gfx_scope_circle (priv, buf, 250, MIN (priv->screen_width, priv->screen_height) / 4, - priv->screen_halfwidth, priv->screen_halfheight); - break; - - case 6: - priv->scene.rotate += 10; - _oink_gfx_scope_stereo (priv, buf, 250, 250, - priv->screen_height / 6, priv->screen_halfheight + (priv->screen_halfheight / 2), - priv->scene.rotate); - break; - - case 7: - priv->scene.rotate += 2; - _oink_gfx_scope_stereo (priv, buf, 250, 250, priv->screen_height / 6, priv->screen_halfheight + (priv->screen_halfheight / 2), - (int) (_oink_table_sin[priv->scene.rotate % OINK_TABLE_NORMAL_SIZE] * 150) + 600); - break; - - default: - _oink_gfx_scope_bulbous (priv, buf, color, height); - break; - } +void _oink_scene_scope_select(OinksiePrivate *priv, uint8_t *buf, int color, + int height) { + switch (priv->config.scopemode) { + case 0: + case 1: + _oink_gfx_scope_normal(priv, buf, color, height); + break; + + case 2: + _oink_gfx_analyzer_stereo(priv, priv->drawbuf, color, + priv->screen_height - 20); + break; + + case 3: + case 4: + _oink_gfx_scope_bulbous(priv, buf, color, height); + break; + + case 5: + _oink_gfx_scope_circle(priv, buf, 250, + MIN(priv->screen_width, priv->screen_height) / 4, + priv->screen_halfwidth, priv->screen_halfheight); + break; + + case 6: + priv->scene.rotate += 10; + _oink_gfx_scope_stereo(priv, buf, 250, 250, priv->screen_height / 6, + priv->screen_halfheight + + (priv->screen_halfheight / 2), + priv->scene.rotate); + break; + + case 7: + priv->scene.rotate += 2; + _oink_gfx_scope_stereo( + priv, buf, 250, 250, priv->screen_height / 6, + priv->screen_halfheight + (priv->screen_halfheight / 2), + (int)(_oink_table_sin[priv->scene.rotate % OINK_TABLE_NORMAL_SIZE] * + 150) + + 600); + break; + + default: + _oink_gfx_scope_bulbous(priv, buf, color, height); + break; + } } -void _oink_scene_randomize (OinksiePrivate *priv) -{ - _oink_config_random_scopemode (priv); - _oink_config_random_blurmode (priv); - _oink_config_random_backgroundmode (priv); +void _oink_scene_randomize(OinksiePrivate *priv) { + _oink_config_random_scopemode(priv); + _oink_config_random_blurmode(priv); + _oink_config_random_backgroundmode(priv); - _oink_gfx_palette_build (priv, priv->config.acidpalette); + _oink_gfx_palette_build(priv, priv->config.acidpalette); } -void _oink_scene_render (OinksiePrivate *priv) -{ - time (&priv->timing); +void _oink_scene_render(OinksiePrivate *priv) { + time(&priv->timing); - if (priv->drawbuf == NULL) - return; + if (priv->drawbuf == NULL) + return; - if (priv->config.scenenew == TRUE) - _oink_scene_randomize (priv); + if (priv->config.scenenew == TRUE) + _oink_scene_randomize(priv); - priv->config.scenenew = FALSE; + priv->config.scenenew = FALSE; - if (priv->audio.beat == TRUE) - { - if (visual_random_context_int_range (priv->rcontext, 0, 50) == 0) - _oink_config_random_scopemode (priv); + if (priv->audio.beat == TRUE) { + if (visual_random_context_int_range(priv->rcontext, 0, 50) == 0) + _oink_config_random_scopemode(priv); - if (visual_random_context_int_range (priv->rcontext, 0, 40) == 0) - _oink_config_random_blurmode (priv); + if (visual_random_context_int_range(priv->rcontext, 0, 40) == 0) + _oink_config_random_blurmode(priv); - if (visual_random_context_int_range (priv->rcontext, 0, 20) == 0) - _oink_gfx_palette_build (priv, priv->config.acidpalette); - } + if (visual_random_context_int_range(priv->rcontext, 0, 20) == 0) + _oink_gfx_palette_build(priv, priv->config.acidpalette); + } - _oink_gfx_blur_fade (priv, priv->drawbuf, priv->audio.bass / 2); + _oink_gfx_blur_fade(priv, priv->drawbuf, priv->audio.bass / 2); - _oink_scene_background_select (priv, priv->drawbuf); + _oink_scene_background_select(priv, priv->drawbuf); - if (visual_random_context_int_range (priv->rcontext, 0, 500) == 42) - _oink_scene_randomize (priv); + if (visual_random_context_int_range(priv->rcontext, 0, 500) == 42) + _oink_scene_randomize(priv); - switch (priv->audio.musicmood) - { - case 0: - _oink_scene_scope_select (priv, priv->drawbuf, 245, priv->screen_height / 4); - break; + switch (priv->audio.musicmood) { + case 0: + _oink_scene_scope_select(priv, priv->drawbuf, 245, priv->screen_height / 4); + break; - case 1: - _oink_scene_scope_select (priv, priv->drawbuf, priv->audio.bass * 21, priv->screen_height / 4); - break; + case 1: + _oink_scene_scope_select(priv, priv->drawbuf, priv->audio.bass * 21, + priv->screen_height / 4); + break; - case 2: - _oink_scene_scope_select (priv, priv->drawbuf, priv->audio.bass * 14, priv->screen_height / 4); - break; + case 2: + _oink_scene_scope_select(priv, priv->drawbuf, priv->audio.bass * 14, + priv->screen_height / 4); + break; - default: - break; - } + default: + break; + } - _oink_scene_scope_special (priv, priv->drawbuf); - _oink_scene_background_special (priv, priv->drawbuf); - _oink_scene_blur_select (priv, priv->drawbuf); + _oink_scene_scope_special(priv, priv->drawbuf); + _oink_scene_background_special(priv, priv->drawbuf); + _oink_scene_blur_select(priv, priv->drawbuf); - priv->timing_prev = priv->timing; + priv->timing_prev = priv->timing; } - diff --git a/libvisual-plugins/plugins/actor/oinksie/scene.h b/libvisual-plugins/plugins/actor/oinksie/scene.h index ffe58f358..53292afef 100644 --- a/libvisual-plugins/plugins/actor/oinksie/scene.h +++ b/libvisual-plugins/plugins/actor/oinksie/scene.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -25,11 +26,12 @@ #define _OINK_SCENE_H /* FIXME, uint8_t *buf should be removed everywhere */ -void _oink_scene_background_special (OinksiePrivate *priv, uint8_t *buf); -void _oink_scene_background_select (OinksiePrivate *priv, uint8_t *buf); -void _oink_scene_blur_select (OinksiePrivate *priv, uint8_t *buf); -void _oink_scene_scope_select (OinksiePrivate *priv, uint8_t *buf, int color, int height); -void _oink_scene_randomize (OinksiePrivate *priv); -void _oink_scene_render (OinksiePrivate *priv); +void _oink_scene_background_special(OinksiePrivate *priv, uint8_t *buf); +void _oink_scene_background_select(OinksiePrivate *priv, uint8_t *buf); +void _oink_scene_blur_select(OinksiePrivate *priv, uint8_t *buf); +void _oink_scene_scope_select(OinksiePrivate *priv, uint8_t *buf, int color, + int height); +void _oink_scene_randomize(OinksiePrivate *priv); +void _oink_scene_render(OinksiePrivate *priv); #endif /* _OINK_SCENE_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/screen.c b/libvisual-plugins/plugins/actor/oinksie/screen.c index 62c376286..e90b71aff 100644 --- a/libvisual-plugins/plugins/actor/oinksie/screen.c +++ b/libvisual-plugins/plugins/actor/oinksie/screen.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -30,22 +31,23 @@ #include "gfx-palette.h" #include "screen.h" -void _oink_screen_init (OinksiePrivate *priv, int width, int height) -{ - _oink_screen_size_set (priv, width, height); +void _oink_screen_init(OinksiePrivate *priv, int width, int height) { + _oink_screen_size_set(priv, width, height); } -void _oink_screen_size_set (OinksiePrivate *priv, int width, int height) -{ - priv->screen_width = width; - priv->screen_height = height; +void _oink_screen_size_set(OinksiePrivate *priv, int width, int height) { + priv->screen_width = width; + priv->screen_height = height; - priv->screen_size = priv->screen_width * priv->screen_height; + priv->screen_size = priv->screen_width * priv->screen_height; - priv->screen_halfwidth = priv->screen_width / 2; - priv->screen_halfheight = priv->screen_height / 2; + priv->screen_halfwidth = priv->screen_width / 2; + priv->screen_halfheight = priv->screen_height / 2; - priv->screen_xybiggest = priv->screen_width > priv->screen_height ? priv->screen_width : priv->screen_height; - priv->screen_xysmallest = priv->screen_width < priv->screen_height ? priv->screen_width : priv->screen_height; + priv->screen_xybiggest = priv->screen_width > priv->screen_height + ? priv->screen_width + : priv->screen_height; + priv->screen_xysmallest = priv->screen_width < priv->screen_height + ? priv->screen_width + : priv->screen_height; } - diff --git a/libvisual-plugins/plugins/actor/oinksie/screen.h b/libvisual-plugins/plugins/actor/oinksie/screen.h index 49d4d937b..bd2aca10d 100644 --- a/libvisual-plugins/plugins/actor/oinksie/screen.h +++ b/libvisual-plugins/plugins/actor/oinksie/screen.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -26,7 +27,7 @@ #include "oinksie.h" -void _oink_screen_init (OinksiePrivate *priv, int width, int height); -void _oink_screen_size_set (OinksiePrivate *priv, int width, int height); +void _oink_screen_init(OinksiePrivate *priv, int width, int height); +void _oink_screen_size_set(OinksiePrivate *priv, int width, int height); #endif /* _OINK_SCREEN_H */ diff --git a/libvisual-plugins/plugins/actor/oinksie/table.c b/libvisual-plugins/plugins/actor/oinksie/table.c index 9513a24ea..2234293b0 100644 --- a/libvisual-plugins/plugins/actor/oinksie/table.c +++ b/libvisual-plugins/plugins/actor/oinksie/table.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -31,27 +32,23 @@ float _oink_table_cos[OINK_TABLE_NORMAL_SIZE]; float _oink_table_sinlarge[OINK_TABLE_LARGE_SIZE]; float _oink_table_coslarge[OINK_TABLE_LARGE_SIZE]; -void _oink_table_init (void) -{ - float adder; - int i; - - adder = 0; - for (i = 0; i < OINK_TABLE_NORMAL_SIZE; i++) - { - _oink_table_sin[i] = sin (adder); - _oink_table_cos[i] = cos (adder); - - adder += ((PI * 2) / OINK_TABLE_NORMAL_SIZE); - } - - adder = 0; - for (i = 0; i < OINK_TABLE_LARGE_SIZE; i++) - { - _oink_table_sinlarge[i] = sin (adder); - _oink_table_coslarge[i] = cos (adder); - - adder += ((PI * 2) / OINK_TABLE_LARGE_SIZE); - } -} +void _oink_table_init(void) { + float adder; + int i; + + adder = 0; + for (i = 0; i < OINK_TABLE_NORMAL_SIZE; i++) { + _oink_table_sin[i] = sin(adder); + _oink_table_cos[i] = cos(adder); + adder += ((PI * 2) / OINK_TABLE_NORMAL_SIZE); + } + + adder = 0; + for (i = 0; i < OINK_TABLE_LARGE_SIZE; i++) { + _oink_table_sinlarge[i] = sin(adder); + _oink_table_coslarge[i] = cos(adder); + + adder += ((PI * 2) / OINK_TABLE_LARGE_SIZE); + } +} diff --git a/libvisual-plugins/plugins/actor/oinksie/table.h b/libvisual-plugins/plugins/actor/oinksie/table.h index 857b3da2b..a9a25af4a 100644 --- a/libvisual-plugins/plugins/actor/oinksie/table.h +++ b/libvisual-plugins/plugins/actor/oinksie/table.h @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual - * - * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Dennis Smit + * * * Authors: Dennis Smit * @@ -24,14 +25,14 @@ #ifndef _OINK_TABLE_H #define _OINK_TABLE_H -#define OINK_TABLE_NORMAL_SIZE 1200 -#define OINK_TABLE_LARGE_SIZE 12000 +#define OINK_TABLE_NORMAL_SIZE 1200 +#define OINK_TABLE_LARGE_SIZE 12000 extern float _oink_table_sin[OINK_TABLE_NORMAL_SIZE]; extern float _oink_table_cos[OINK_TABLE_NORMAL_SIZE]; extern float _oink_table_sinlarge[OINK_TABLE_LARGE_SIZE]; extern float _oink_table_coslarge[OINK_TABLE_LARGE_SIZE]; -void _oink_table_init (void); +void _oink_table_init(void); #endif /* _OINK_TABLE_H */ diff --git a/libvisual-plugins/plugins/actor/plazma/actor_plazma.c b/libvisual-plugins/plugins/actor/plazma/actor_plazma.c index b32cb996c..0d5396b95 100644 --- a/libvisual-plugins/plugins/actor/plazma/actor_plazma.c +++ b/libvisual-plugins/plugins/actor/plazma/actor_plazma.c @@ -28,234 +28,209 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int act_plazma_init (VisPluginData *plugin); -static void act_plazma_cleanup (VisPluginData *plugin); -static void act_plazma_requisition (VisPluginData *plugin, int *width, int *height); -static void act_plazma_resize (VisPluginData *plugin, int width, int height); -static int act_plazma_events (VisPluginData *plugin, VisEventQueue *events); -static VisPalette *act_plazma_palette (VisPluginData *plugin); -static void act_plazma_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisActorPlugin actor = { - .requisition = act_plazma_requisition, - .palette = act_plazma_palette, - .render = act_plazma_render, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_ACTOR, - - .plugname = "plazma", - .name = "Plazma plugin", - .author = N_("Original by: Pascal Brochart , Port by: Dennis Smit "), - .version = "0.0.1", - .about = N_("Libvisual Plazma visual plugin"), - .help = N_("This is the libvisual port of the xmms Plazma plugin"), - .license = VISUAL_PLUGIN_LICENSE_GPL, - - .init = act_plazma_init, - .cleanup = act_plazma_cleanup, - .events = act_plazma_events, - .plugin = &actor - }; - - return &info; +static int act_plazma_init(VisPluginData *plugin); +static void act_plazma_cleanup(VisPluginData *plugin); +static void act_plazma_requisition(VisPluginData *plugin, int *width, + int *height); +static void act_plazma_resize(VisPluginData *plugin, int width, int height); +static int act_plazma_events(VisPluginData *plugin, VisEventQueue *events); +static VisPalette *act_plazma_palette(VisPluginData *plugin); +static void act_plazma_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio); + +const VisPluginInfo *get_plugin_info(void) { + static VisActorPlugin actor = {.requisition = act_plazma_requisition, + .palette = act_plazma_palette, + .render = act_plazma_render, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_ACTOR, + + .plugname = "plazma", + .name = "Plazma plugin", + .author = N_("Original by: Pascal Brochart , " + "Port by: Dennis Smit "), + .version = "0.0.1", + .about = N_("Libvisual Plazma visual plugin"), + .help = N_("This is the libvisual port of the xmms Plazma plugin"), + .license = VISUAL_PLUGIN_LICENSE_GPL, + + .init = act_plazma_init, + .cleanup = act_plazma_cleanup, + .events = act_plazma_events, + .plugin = &actor}; + + return &info; } -static int act_plazma_init (VisPluginData *plugin) -{ +static int act_plazma_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - PlazmaPrivate *priv = visual_mem_new0 (PlazmaPrivate, 1); - visual_plugin_set_private (plugin, priv); - - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_integer ("bass_sensitivity", - N_("Bass sensitivity"), - 0, - visual_param_in_range_integer (0, INT_MAX)), - visual_param_new_bool ("plasma_effect", - N_("Plasma effect"), - TRUE, - NULL), - visual_param_new_bool ("3d_effect_option", - N_("3D effect option"), - FALSE, - NULL), - visual_param_new_bool ("lines", - N_("Lines"), - TRUE, - NULL), - visual_param_new_bool ("spectrum", - N_("Spectrum"), - TRUE, - NULL), - visual_param_new_bool ("3d_effect", - N_("3D effect"), - TRUE, - NULL), - visual_param_new_float ("rotation_speed", - N_("Rotation speed"), - 0.4, - NULL), - NULL); - - priv->colors = visual_palette_new (256); - - priv->val_maxi = 127; - priv->chcol0 = 36; - priv->state = 1368; - priv->old_state = 1368; - - return TRUE; + PlazmaPrivate *priv = visual_mem_new0(PlazmaPrivate, 1); + visual_plugin_set_private(plugin, priv); + + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, + visual_param_new_integer("bass_sensitivity", N_("Bass sensitivity"), 0, + visual_param_in_range_integer(0, INT_MAX)), + visual_param_new_bool("plasma_effect", N_("Plasma effect"), TRUE, NULL), + visual_param_new_bool("3d_effect_option", N_("3D effect option"), FALSE, + NULL), + visual_param_new_bool("lines", N_("Lines"), TRUE, NULL), + visual_param_new_bool("spectrum", N_("Spectrum"), TRUE, NULL), + visual_param_new_bool("3d_effect", N_("3D effect"), TRUE, NULL), + visual_param_new_float("rotation_speed", N_("Rotation speed"), 0.4, NULL), + NULL); + + priv->colors = visual_palette_new(256); + + priv->val_maxi = 127; + priv->chcol0 = 36; + priv->state = 1368; + priv->old_state = 1368; + + return TRUE; } -static void act_plazma_cleanup (VisPluginData *plugin) -{ - PlazmaPrivate *priv = visual_plugin_get_private (plugin); +static void act_plazma_cleanup(VisPluginData *plugin) { + PlazmaPrivate *priv = visual_plugin_get_private(plugin); - _plazma_cleanup (priv); + _plazma_cleanup(priv); - visual_palette_free (priv->colors); + visual_palette_free(priv->colors); - visual_mem_free (priv); + visual_mem_free(priv); } -static void act_plazma_requisition (VisPluginData *plugin, int *width, int *height) -{ - int reqw, reqh; +static void act_plazma_requisition(VisPluginData *plugin, int *width, + int *height) { + int reqw, reqh; - reqw = *width; - reqh = *height; + reqw = *width; + reqh = *height; - while (reqw % 4) - reqw--; + while (reqw % 4) + reqw--; - while (reqh % 4) - reqh--; + while (reqh % 4) + reqh--; - if (reqw < 32) - reqw = 32; + if (reqw < 32) + reqw = 32; - if (reqh < 32) - reqh = 32; + if (reqh < 32) + reqh = 32; - *width = reqw; - *height = reqh; + *width = reqw; + *height = reqh; } -static void act_plazma_resize (VisPluginData *plugin, int width, int height) -{ - PlazmaPrivate *priv = visual_plugin_get_private (plugin); +static void act_plazma_resize(VisPluginData *plugin, int width, int height) { + PlazmaPrivate *priv = visual_plugin_get_private(plugin); - priv->width = width; - priv->height = height; + priv->width = width; + priv->height = height; - priv->tablex = width * 2; - priv->tabley = height * 2; + priv->tablex = width * 2; + priv->tabley = height * 2; - _plazma_cleanup (priv); - _plazma_init (priv); + _plazma_cleanup(priv); + _plazma_init(priv); } -static int act_plazma_events (VisPluginData *plugin, VisEventQueue *events) -{ - PlazmaPrivate *priv = visual_plugin_get_private (plugin); - VisEvent ev; - VisParam *param; +static int act_plazma_events(VisPluginData *plugin, VisEventQueue *events) { + PlazmaPrivate *priv = visual_plugin_get_private(plugin); + VisEvent ev; + VisParam *param; - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_RESIZE: - act_plazma_resize (plugin, ev.event.resize.width, ev.event.resize.height); - break; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_RESIZE: + act_plazma_resize(plugin, ev.event.resize.width, ev.event.resize.height); + break; - case VISUAL_EVENT_PARAM: - param = ev.event.param.param; + case VISUAL_EVENT_PARAM: + param = ev.event.param.param; - if (visual_param_has_name (param, "bass_sensitivity")) { - priv->bass_sensibility = visual_param_get_value_integer (param); + if (visual_param_has_name(param, "bass_sensitivity")) { + priv->bass_sensibility = visual_param_get_value_integer(param); - } else if (visual_param_has_name (param, "plasma_effect")) { - priv->effect = visual_param_get_value_bool (param); - _plazma_change_effect (priv); + } else if (visual_param_has_name(param, "plasma_effect")) { + priv->effect = visual_param_get_value_bool(param); + _plazma_change_effect(priv); - } else if (visual_param_has_name (param, "3d_effect_option")) { - priv->options = visual_param_get_value_bool (param); + } else if (visual_param_has_name(param, "3d_effect_option")) { + priv->options = visual_param_get_value_bool(param); - } else if (visual_param_has_name (param, "lines")) { - priv->lines = visual_param_get_value_bool (param); + } else if (visual_param_has_name(param, "lines")) { + priv->lines = visual_param_get_value_bool(param); - } else if (visual_param_has_name (param, "spectrum")) { - priv->spectrum = visual_param_get_value_bool (param); + } else if (visual_param_has_name(param, "spectrum")) { + priv->spectrum = visual_param_get_value_bool(param); - } else if (visual_param_has_name (param, "3d_effect")) { - priv->use_3d = visual_param_get_value_bool (param); + } else if (visual_param_has_name(param, "3d_effect")) { + priv->use_3d = visual_param_get_value_bool(param); - } else if (visual_param_has_name (param, "rotation_speed")) { - priv->rot_tourni = visual_param_get_value_float (param); - } + } else if (visual_param_has_name(param, "rotation_speed")) { + priv->rot_tourni = visual_param_get_value_float(param); + } - break; + break; - default: /* to avoid warnings */ - break; - } - } + default: /* to avoid warnings */ + break; + } + } - return TRUE; + return TRUE; } -static VisPalette *act_plazma_palette (VisPluginData *plugin) -{ - PlazmaPrivate *priv = visual_plugin_get_private (plugin); +static VisPalette *act_plazma_palette(VisPluginData *plugin) { + PlazmaPrivate *priv = visual_plugin_get_private(plugin); - return priv->colors; + return priv->colors; } -static void act_plazma_render (VisPluginData *plugin, VisVideo *video, VisAudio *audio) -{ - PlazmaPrivate *priv = visual_plugin_get_private (plugin); - VisBuffer *pcmback; - VisBuffer *fbuf; - int i; +static void act_plazma_render(VisPluginData *plugin, VisVideo *video, + VisAudio *audio) { + PlazmaPrivate *priv = visual_plugin_get_private(plugin); + VisBuffer *pcmback; + VisBuffer *fbuf; + int i; - pcmback = visual_buffer_new_wrap_data (priv->pcm_buffer, sizeof (float) * 1024, FALSE); - visual_audio_get_sample_mixed_simple (audio, pcmback, 2, - VISUAL_AUDIO_CHANNEL_LEFT, - VISUAL_AUDIO_CHANNEL_RIGHT); + pcmback = visual_buffer_new_wrap_data(priv->pcm_buffer, sizeof(float) * 1024, + FALSE); + visual_audio_get_sample_mixed_simple( + audio, pcmback, 2, VISUAL_AUDIO_CHANNEL_LEFT, VISUAL_AUDIO_CHANNEL_RIGHT); + fbuf = visual_buffer_new_wrap_data(priv->render_buffer, sizeof(float) * 256, + FALSE); + visual_audio_get_spectrum_for_sample(fbuf, pcmback, TRUE); - fbuf = visual_buffer_new_wrap_data (priv->render_buffer, sizeof (float) * 256, FALSE); - visual_audio_get_spectrum_for_sample (fbuf, pcmback, TRUE); + visual_buffer_unref(pcmback); + visual_buffer_unref(fbuf); - visual_buffer_unref (pcmback); - visual_buffer_unref (fbuf); + /* Analyse spectrum data */ + priv->bass = 0; + for (i = 0; i < 6; i++) + priv->bass += (priv->render_buffer[i]); - /* Analyse spectrum data */ - priv->bass = 0; - for (i = 0; i < 6; i++) - priv->bass += (priv->render_buffer[i]); + priv->old_state = priv->state; - priv->old_state = priv->state; + if (priv->bass_sensibility >= 0) + priv->state += (priv->bass) + 1 + (priv->bass_sensibility / 2); + if (priv->bass_sensibility < 0) { + priv->state += (priv->bass) + 1 - (abs(priv->bass_sensibility / 2)); + if (priv->state < (priv->old_state + 1)) + priv->state = priv->old_state + 1; + } - if (priv->bass_sensibility >= 0) - priv->state += (priv->bass) + 1 + (priv->bass_sensibility / 2); - if (priv->bass_sensibility < 0) { - priv->state += (priv->bass) + 1 - (abs (priv->bass_sensibility / 2)); - if (priv->state < (priv->old_state + 1)) - priv->state = priv->old_state + 1; - } + priv->video = video; + priv->pixel = visual_video_get_pixels(video); - priv->video = video; - priv->pixel = visual_video_get_pixels (video); - - _plazma_run (priv); + _plazma_run(priv); } - diff --git a/libvisual-plugins/plugins/actor/plazma/actor_plazma.h b/libvisual-plugins/plugins/actor/plazma/actor_plazma.h index 338233450..f7373d544 100644 --- a/libvisual-plugins/plugins/actor/plazma/actor_plazma.h +++ b/libvisual-plugins/plugins/actor/plazma/actor_plazma.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2004, 2005, 2006 Dennis Smit * * Authors: Dennis Smit @@ -27,53 +27,53 @@ #include typedef struct { - int i; - float *f; + int i; + float *f; } SinCos; typedef struct { - float pcm_buffer[1024]; - float render_buffer[512]; + float pcm_buffer[1024]; + float render_buffer[512]; - int bass; - int state; - int old_state; + int bass; + int state; + int old_state; - int width; - int height; + int width; + int height; - int tablex; - int tabley; + int tablex; + int tabley; - /* General */ - int bass_sensibility; - int effect; - int options; - int lines; - int spectrum; - int use_3d; + /* General */ + int bass_sensibility; + int effect; + int options; + int lines; + int spectrum; + int use_3d; - /* Data */ - float k_put; - float rot_tourni; - uint16_t val_maxi; - int chcol0; - double R[4]; - float compt_grille_3d; - float compt_cercle_3d; + /* Data */ + float k_put; + float rot_tourni; + uint16_t val_maxi; + int chcol0; + double R[4]; + float compt_grille_3d; + float compt_cercle_3d; - /* Plazma tables */ - uint8_t *tmem; - uint8_t *tmem1; + /* Plazma tables */ + uint8_t *tmem; + uint8_t *tmem1; - /* Sin tables */ - SinCos cosw; - SinCos sinw; + /* Sin tables */ + SinCos cosw; + SinCos sinw; - /* Libvisual data */ - VisVideo *video; - uint8_t *pixel; - VisPalette *colors; + /* Libvisual data */ + VisVideo *video; + uint8_t *pixel; + VisPalette *colors; } PlazmaPrivate; diff --git a/libvisual-plugins/plugins/actor/plazma/plazma.c b/libvisual-plugins/plugins/actor/plazma/plazma.c index 65129d409..d2a09721c 100644 --- a/libvisual-plugins/plugins/actor/plazma/plazma.c +++ b/libvisual-plugins/plugins/actor/plazma/plazma.c @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Pascal Brochart * * Authors: Pascal Brochart @@ -30,21 +30,27 @@ #include "plazma.h" #ifndef PI -#define PI 3.14159265358979323846 +#define PI 3.14159265358979323846 #endif -#define RESFACTXF(par1) ( (float) priv->width*(par1)/video_width ) -#define RESFACTYF(par1) ( (float) priv->height*(par1)/video_height ) +#define RESFACTXF(par1) ((float)priv->width * (par1) / video_width) +#define RESFACTYF(par1) ((float)priv->height * (par1) / video_height) /* New prototypes */ -static void do_plasma(PlazmaPrivate *priv, double x1, double y1, double x2, double y2, unsigned char *t); +static void do_plasma(PlazmaPrivate *priv, double x1, double y1, double x2, + double y2, unsigned char *t); static void what_display(PlazmaPrivate *priv); static void plazma_create(PlazmaPrivate *priv); static void aff_pixel(PlazmaPrivate *priv, int x, int y, int colpix); -static void cercle (PlazmaPrivate *priv, int h, int k, int y, uint8_t colcer); -static void droite (PlazmaPrivate *priv, int x1, int y1, int x2, int y2, uint8_t color); -static void grille_3d (PlazmaPrivate *priv, float alpha, float beta, float gamma, int persp, int dist_cam, int col_grille_3d, int cx, int cy); -static void cercle_3d (PlazmaPrivate *priv, float alpha, float beta, float gamma, int persp, int dist_cam, int col_grille_3d, int cx, int cy); +static void cercle(PlazmaPrivate *priv, int h, int k, int y, uint8_t colcer); +static void droite(PlazmaPrivate *priv, int x1, int y1, int x2, int y2, + uint8_t color); +static void grille_3d(PlazmaPrivate *priv, float alpha, float beta, float gamma, + int persp, int dist_cam, int col_grille_3d, int cx, + int cy); +static void cercle_3d(PlazmaPrivate *priv, float alpha, float beta, float gamma, + int persp, int dist_cam, int col_grille_3d, int cx, + int cy); static void do_radial_wave(PlazmaPrivate *priv); static void do_tourni_spec(PlazmaPrivate *priv); static void do_lines(PlazmaPrivate *priv); @@ -52,482 +58,461 @@ static void do_grille_3d(PlazmaPrivate *priv); static void do_spectrum(PlazmaPrivate *priv); static void do_cercle_3d(PlazmaPrivate *priv); -void _plazma_run (PlazmaPrivate *priv) -{ - if (priv->state == priv->old_state) - priv->state++; - priv->old_state = priv->state; - - switch (priv->effect) { - case 0: - do_plasma(priv, - (sin(((double)priv->state)*priv->R[0])+1)/2, - (sin(((double)priv->state)*priv->R[1])+1)/2, - (cos(((double)priv->state)*priv->R[2])+1)/2, - (cos(((double)priv->state)*priv->R[3])+1)/2, priv->tmem); - break; - case 1: - do_plasma(priv, - (sin(((double)priv->state)*priv->R[0])+1)/2, - (sin(((double)priv->state)*priv->R[1])+1)/2, - (cos(((double)priv->state)*priv->R[2])+1)/2, - (cos(((double)priv->state)*priv->R[3])+1)/2, priv->tmem1); - break; - } - - what_display(priv); +void _plazma_run(PlazmaPrivate *priv) { + if (priv->state == priv->old_state) + priv->state++; + priv->old_state = priv->state; + + switch (priv->effect) { + case 0: + do_plasma(priv, (sin(((double)priv->state) * priv->R[0]) + 1) / 2, + (sin(((double)priv->state) * priv->R[1]) + 1) / 2, + (cos(((double)priv->state) * priv->R[2]) + 1) / 2, + (cos(((double)priv->state) * priv->R[3]) + 1) / 2, priv->tmem); + break; + case 1: + do_plasma(priv, (sin(((double)priv->state) * priv->R[0]) + 1) / 2, + (sin(((double)priv->state) * priv->R[1]) + 1) / 2, + (cos(((double)priv->state) * priv->R[2]) + 1) / 2, + (cos(((double)priv->state) * priv->R[3]) + 1) / 2, priv->tmem1); + break; + } + + what_display(priv); } -void _plazma_init(PlazmaPrivate *priv) -{ - int c, i; - float halfPI = (float)PI/2; - - for (c=0; c<4; c++) - priv->R[c]=((double)(cos(c)*120))/5000; - - priv->tmem = visual_mem_malloc0 (priv->tabley*priv->tablex); - priv->tmem1 = visual_mem_malloc0 (priv->tabley*priv->tablex); - - priv->cosw.i = priv->width; - priv->cosw.f = visual_mem_malloc0(sizeof(float)*priv->width); - - for (i=0; iwidth;i++) - priv->cosw.f[i] = cos((float)i/priv->width*PI+halfPI); - - priv->sinw.i = priv->width; - priv->sinw.f = visual_mem_malloc0(sizeof(float)*priv->width); - - for (i=0; iwidth;i++) - priv->sinw.f[i] = sin((float)i/priv->width*PI+halfPI); - - plazma_create(priv); - _plazma_change_effect(priv); -} +void _plazma_init(PlazmaPrivate *priv) { + int c, i; + float halfPI = (float)PI / 2; + + for (c = 0; c < 4; c++) + priv->R[c] = ((double)(cos(c) * 120)) / 5000; + + priv->tmem = visual_mem_malloc0(priv->tabley * priv->tablex); + priv->tmem1 = visual_mem_malloc0(priv->tabley * priv->tablex); + + priv->cosw.i = priv->width; + priv->cosw.f = visual_mem_malloc0(sizeof(float) * priv->width); -void _plazma_cleanup(PlazmaPrivate *priv) -{ - if (priv->tmem != NULL) - visual_mem_free (priv->tmem); + for (i = 0; i < priv->width; i++) + priv->cosw.f[i] = cos((float)i / priv->width * PI + halfPI); - if (priv->tmem1 != NULL) - visual_mem_free (priv->tmem1); + priv->sinw.i = priv->width; + priv->sinw.f = visual_mem_malloc0(sizeof(float) * priv->width); - if (priv->cosw.f != NULL) - visual_mem_free (priv->cosw.f); + for (i = 0; i < priv->width; i++) + priv->sinw.f[i] = sin((float)i / priv->width * PI + halfPI); - if (priv->sinw.f != NULL) - visual_mem_free (priv->sinw.f); + plazma_create(priv); + _plazma_change_effect(priv); } -void _plazma_change_effect(PlazmaPrivate *priv) -{ - int c; - VisColor *colors = visual_palette_get_colors (priv->colors); - - switch (priv->effect) { - case 0: - for (c=0 ; c<256; c++) { - colors[c].r = (sin(((double)c)/256*6*PI+(sin(445)))+1)*127; - colors[c].g = (sin(((double)c)/256*6*PI+(sin(561)))+1)*127; - colors[c].b = (cos(((double)c)/256*6*PI+(sin(278)))+1)*127; - } - break; - case 1: - for (c=0 ; c<256; c++) { - colors[c].r = (sin(((double)c)/256*6*PI+(sin(c/4)))+1)*127; - colors[c].g = (sin(((double)c)/256*6*PI+(sin(561)))+1)*127; - colors[c].b = (cos(((double)c)/256*6*PI+(sin(278)))+1)*127; - } - break; - } +void _plazma_cleanup(PlazmaPrivate *priv) { + if (priv->tmem != NULL) + visual_mem_free(priv->tmem); + + if (priv->tmem1 != NULL) + visual_mem_free(priv->tmem1); + + if (priv->cosw.f != NULL) + visual_mem_free(priv->cosw.f); + + if (priv->sinw.f != NULL) + visual_mem_free(priv->sinw.f); } -static void do_plasma(PlazmaPrivate *priv, double x1, double y1, - double x2, double y2, - unsigned char *t) -{ - unsigned int X1=x1*(priv->tablex/2), Y1=y1*(priv->tabley/2), - X2=x2*(priv->tablex/2), Y2=y2*(priv->tabley/2), y; - unsigned char *t1=t+X1+Y1*priv->tablex, *t2=t+X2+Y2*priv->tablex; - - int pitch = visual_video_get_pitch (priv->video); - - for (y=0; yheight; y++) { - unsigned char*tmp = priv->pixel + y * pitch; - unsigned int t = y*priv->tablex, tmax=t+priv->width; - for (; tcolors); + + switch (priv->effect) { + case 0: + for (c = 0; c < 256; c++) { + colors[c].r = (sin(((double)c) / 256 * 6 * PI + (sin(445))) + 1) * 127; + colors[c].g = (sin(((double)c) / 256 * 6 * PI + (sin(561))) + 1) * 127; + colors[c].b = (cos(((double)c) / 256 * 6 * PI + (sin(278))) + 1) * 127; + } + break; + case 1: + for (c = 0; c < 256; c++) { + colors[c].r = (sin(((double)c) / 256 * 6 * PI + (sin(c / 4))) + 1) * 127; + colors[c].g = (sin(((double)c) / 256 * 6 * PI + (sin(561))) + 1) * 127; + colors[c].b = (cos(((double)c) / 256 * 6 * PI + (sin(278))) + 1) * 127; + } + break; + } } -static void plazma_create(PlazmaPrivate *priv) -{ - int y; - for (y=0 ; ytabley ; y++) { - int x; - for (x=0 ; xtablex ; x++) { - double tmp = (((double)((x-(priv->tablex/2))*(x-(priv->tablex/2))+(y-(priv->tablex/2))*(y-(priv->tablex/2))))*(PI/(priv->tablex*priv->tablex+priv->tabley*priv->tabley))); - priv->tmem[y*priv->tablex+x] = tan(tan(tmp*1500))+(tan(tmp)*40)+sqrt(exp(tmp)*10)+sin(tmp*10); - priv->tmem1[y*priv->tablex+x] = sin(exp(tmp*35)*120)+sqrt(tmp*14)+log(exp(tmp*8)+cos(tmp*tmp))+tan(exp(tmp*40)*150)/6; - } - } +static void do_plasma(PlazmaPrivate *priv, double x1, double y1, double x2, + double y2, unsigned char *t) { + unsigned int X1 = x1 * (priv->tablex / 2), Y1 = y1 * (priv->tabley / 2), + X2 = x2 * (priv->tablex / 2), Y2 = y2 * (priv->tabley / 2), y; + unsigned char *t1 = t + X1 + Y1 * priv->tablex, + *t2 = t + X2 + Y2 * priv->tablex; + + int pitch = visual_video_get_pitch(priv->video); + + for (y = 0; y < priv->height; y++) { + unsigned char *tmp = priv->pixel + y * pitch; + unsigned int t = y * priv->tablex, tmax = t + priv->width; + for (; t < tmax; t++, tmp++) + tmp[0] = t1[t] + t2[t]; + } } -static void aff_pixel(PlazmaPrivate *priv, int x, int y, int colpix) -{ - unsigned char*point, *old_point; - int pitch = visual_video_get_pitch (priv->video); - - if (x<0 || x>(priv->width-1) || y<0 || y>(priv->height-1)) - return; - point = priv->pixel+y*pitch; - old_point = point; - point[x] = old_point[x] | colpix; - if (!priv->use_3d) - point[x] = colpix; +static void plazma_create(PlazmaPrivate *priv) { + int y; + for (y = 0; y < priv->tabley; y++) { + int x; + for (x = 0; x < priv->tablex; x++) { + double tmp = + (((double)((x - (priv->tablex / 2)) * (x - (priv->tablex / 2)) + + (y - (priv->tablex / 2)) * (y - (priv->tablex / 2)))) * + (PI / (priv->tablex * priv->tablex + priv->tabley * priv->tabley))); + priv->tmem[y * priv->tablex + x] = tan(tan(tmp * 1500)) + + (tan(tmp) * 40) + sqrt(exp(tmp) * 10) + + sin(tmp * 10); + priv->tmem1[y * priv->tablex + x] = + sin(exp(tmp * 35) * 120) + sqrt(tmp * 14) + + log(exp(tmp * 8) + cos(tmp * tmp)) + tan(exp(tmp * 40) * 150) / 6; + } + } } -static void cercle (PlazmaPrivate *priv, int h, int k, int y, uint8_t colcer) -{ - int x = -1, d = 3 - 2 * y; - while (x <= y) - { - if (d < 0) - { - d += 4 * x + 6; - x++; - } - else - { - d += 4 * (x - y) + 10; - x++; - y--; - } - aff_pixel (priv, h + x, y + k, colcer); - aff_pixel (priv, h + y, x + k, colcer); - aff_pixel (priv, h - y, x + k, colcer); - aff_pixel (priv, h - x, y + k, colcer); - aff_pixel (priv, h - x, -y + k, colcer); - aff_pixel (priv, h - y, -x + k, colcer); - aff_pixel (priv, h + y, -x + k, colcer); - aff_pixel (priv, h + x, -y + k, colcer); - } +static void aff_pixel(PlazmaPrivate *priv, int x, int y, int colpix) { + unsigned char *point, *old_point; + int pitch = visual_video_get_pitch(priv->video); + + if (x < 0 || x > (priv->width - 1) || y < 0 || y > (priv->height - 1)) + return; + point = priv->pixel + y * pitch; + old_point = point; + point[x] = old_point[x] | colpix; + if (!priv->use_3d) + point[x] = colpix; } -static void droite (PlazmaPrivate *priv, int x1, int y1, int x2, int y2, uint8_t color) -{ - int lx, ly, dx, dy; - int i, j, k; - lx = abs(x1-x2); - ly = abs(y1-y2); - dx = (x1>x2) ? -1 : 1; - dy = (y1>y2) ? -1 : 1; - - if (lx>ly) - { - for (i=x1,j=y1,k=0;i!=x2;i+=dx,k+=ly) - { - if (k>=lx) - { - k -= lx; - j += dy; - } - aff_pixel (priv, i, j, color); - } - } - else - { - for (i=y1,j=x1,k=0;i!=y2;i+=dy,k+=lx) - { - if (k>=ly) - { - k -= ly; - j += dx; - } - aff_pixel (priv, j, i, color); - } - } +static void cercle(PlazmaPrivate *priv, int h, int k, int y, uint8_t colcer) { + int x = -1, d = 3 - 2 * y; + while (x <= y) { + if (d < 0) { + d += 4 * x + 6; + x++; + } else { + d += 4 * (x - y) + 10; + x++; + y--; + } + aff_pixel(priv, h + x, y + k, colcer); + aff_pixel(priv, h + y, x + k, colcer); + aff_pixel(priv, h - y, x + k, colcer); + aff_pixel(priv, h - x, y + k, colcer); + aff_pixel(priv, h - x, -y + k, colcer); + aff_pixel(priv, h - y, -x + k, colcer); + aff_pixel(priv, h + y, -x + k, colcer); + aff_pixel(priv, h + x, -y + k, colcer); + } } -static void rotation_3d (float *x, float *y, float *z, float alpha, float beta, float gamma) -{ - float nx, ny; - float cosga = cos (gamma), singa=sin (gamma), cosal=cos (alpha), sinal=sin (alpha); - nx = cosga * *x - singa * *y; - ny = cosal * (singa * *x + cosga * *y) - sinal * *z; - *z = sinal * (singa * *x + cosga * *y) + cosal * *z; - *x = nx; - *y = ny; +static void droite(PlazmaPrivate *priv, int x1, int y1, int x2, int y2, + uint8_t color) { + int lx, ly, dx, dy; + int i, j, k; + lx = abs(x1 - x2); + ly = abs(y1 - y2); + dx = (x1 > x2) ? -1 : 1; + dy = (y1 > y2) ? -1 : 1; + + if (lx > ly) { + for (i = x1, j = y1, k = 0; i != x2; i += dx, k += ly) { + if (k >= lx) { + k -= lx; + j += dy; + } + aff_pixel(priv, i, j, color); + } + } else { + for (i = y1, j = x1, k = 0; i != y2; i += dy, k += lx) { + if (k >= ly) { + k -= ly; + j += dx; + } + aff_pixel(priv, j, i, color); + } + } } -static void perspective (float *x, float *y, float *z, int persp, int dist_cam) -{ - float foc_cam = 100; - *x = *x * (foc_cam + persp) / (dist_cam + persp - *z); - *y = *y * (foc_cam + persp) / (dist_cam + persp - *z); +static void rotation_3d(float *x, float *y, float *z, float alpha, float beta, + float gamma) { + float nx, ny; + float cosga = cos(gamma), singa = sin(gamma), cosal = cos(alpha), + sinal = sin(alpha); + nx = cosga * *x - singa * *y; + ny = cosal * (singa * *x + cosga * *y) - sinal * *z; + *z = sinal * (singa * *x + cosga * *y) + cosal * *z; + *x = nx; + *y = ny; } -static void grille_3d (PlazmaPrivate *priv, float alpha, float beta, float gamma, int persp, int dist_cam, int col_grille_3d, int cx, int cy) -{ - float x, y, z; - int16_t ax = 0, ay = 0, ix, iy, i, j, nb_x, nb_y; - float ampli_grille = 20; - - int video_width = visual_video_get_width (priv->video); - int video_height = visual_video_get_height (priv->video); - - nb_x = 32; - nb_y = 32; - - if (priv->spectrum == 0 && priv->lines == 1) - ampli_grille = 30; - - for (i = 0; i < nb_x; i++) - { - for (j = 0; j < nb_y; j++) - { - x = RESFACTXF ((i - ((float) nb_x) / 2) * 10); - y = RESFACTYF ((j - ((float) nb_y) / 2) * 10); - z = RESFACTXF ((float) (priv->pcm_buffer[(i + (nb_x/3)*j) % 1024]) * (priv->height / ampli_grille)); - rotation_3d (&x, &y, &z, alpha, beta, gamma); - perspective (&x, &y, &z, persp, dist_cam); - ix = (int) x; - iy = (int) y; - if (j != 0) { - droite (priv, ix+cx, iy+cy, ax+cx, ay+cy, col_grille_3d); - } - ax = ix; - ay = iy; - } - } +static void perspective(float *x, float *y, float *z, int persp, int dist_cam) { + float foc_cam = 100; + *x = *x * (foc_cam + persp) / (dist_cam + persp - *z); + *y = *y * (foc_cam + persp) / (dist_cam + persp - *z); } -static void cercle_3d (PlazmaPrivate *priv, float alpha, float beta, float gamma, int persp, int dist_cam, int col_grille_3d, int cx, int cy) -{ - float x, y, z; - int16_t ax = 0, ay = 0, ix, iy, i, j, nb_x, nb_y; - - int video_width = visual_video_get_width (priv->video); - int video_height = visual_video_get_height (priv->video); - - nb_x = 16; - nb_y = 16; - - for (i = 0; i < nb_x; i++) - { - for (j = 0; j < nb_y; j++) - { - x = RESFACTXF ((i - ((float) nb_x) / 2) * 30); - y = RESFACTYF ((j - ((float) nb_y) / 2) * 30); - z = RESFACTXF (-((float) (priv->render_buffer[i + (nb_x/32)*j])*32000)); - - rotation_3d (&x, &y, &z, alpha, beta, gamma); - perspective (&x, &y, &z, persp, dist_cam); - ix = (int) x; - iy = (int) y; - if (j != 0) { - cercle (priv, ix+cx, iy+cy, 3, col_grille_3d); - cercle (priv, ax+cx, ay+cy, 3, col_grille_3d); - } - ax = ix; - ay = iy; - } - } +static void grille_3d(PlazmaPrivate *priv, float alpha, float beta, float gamma, + int persp, int dist_cam, int col_grille_3d, int cx, + int cy) { + float x, y, z; + int16_t ax = 0, ay = 0, ix, iy, i, j, nb_x, nb_y; + float ampli_grille = 20; + + int video_width = visual_video_get_width(priv->video); + int video_height = visual_video_get_height(priv->video); + + nb_x = 32; + nb_y = 32; + + if (priv->spectrum == 0 && priv->lines == 1) + ampli_grille = 30; + + for (i = 0; i < nb_x; i++) { + for (j = 0; j < nb_y; j++) { + x = RESFACTXF((i - ((float)nb_x) / 2) * 10); + y = RESFACTYF((j - ((float)nb_y) / 2) * 10); + z = RESFACTXF((float)(priv->pcm_buffer[(i + (nb_x / 3) * j) % 1024]) * + (priv->height / ampli_grille)); + rotation_3d(&x, &y, &z, alpha, beta, gamma); + perspective(&x, &y, &z, persp, dist_cam); + ix = (int)x; + iy = (int)y; + if (j != 0) { + droite(priv, ix + cx, iy + cy, ax + cx, ay + cy, col_grille_3d); + } + ax = ix; + ay = iy; + } + } } -static void do_radial_wave(PlazmaPrivate *priv) -{ - int i, halfheight, halfwidth, shift, col_fleur; - float y1, old_y1, k, opt, opt_old; - - y1 = priv->pcm_buffer[0]*82; - col_fleur = 74; - shift = priv->height/3.1; - - if (priv->effect) - col_fleur = 72; - - halfheight = priv->height >> 1; - halfwidth = priv->width >> 1; - for (i=1 ; iwidth ; i++) { - old_y1 = y1; - y1 = priv->pcm_buffer[i % 1024]*82; - if (y1<-50) - y1 = y1/2; - for (k=1 ; k<2.6 ; k+=0.4) { - opt = shift+(y1/k); - opt_old = shift+(old_y1/k); - droite (priv, - halfwidth + priv->cosw.f[i-1] * opt_old, - halfheight + priv->sinw.f[i-1] * opt_old, - halfwidth + priv->cosw.f[i] * opt, - halfheight + priv->sinw.f[i] * opt, - col_fleur); - droite (priv, - halfwidth - priv->cosw.f[i-1] * opt_old, - halfheight + priv->sinw.f[i-1] * opt_old, - halfwidth - priv->cosw.f[i] * opt, - halfheight + priv->sinw.f[i] * opt, - col_fleur); - } - } - for (k=1 ; k<2.6 ; k+=0.4) { - opt = shift+(y1/k); - droite (priv, - halfwidth + priv->cosw.f[1] * opt, - halfheight - priv->sinw.f[1] * opt, - halfwidth - priv->cosw.f[1] * opt, - halfheight - priv->sinw.f[1] * opt, - col_fleur); - droite (priv, - halfwidth - priv->cosw.f[1] * opt, - halfheight - priv->sinw.f[1] * opt, - halfwidth + priv->cosw.f[1] * opt, - halfheight - priv->sinw.f[1] * opt, - col_fleur); - } +static void cercle_3d(PlazmaPrivate *priv, float alpha, float beta, float gamma, + int persp, int dist_cam, int col_grille_3d, int cx, + int cy) { + float x, y, z; + int16_t ax = 0, ay = 0, ix, iy, i, j, nb_x, nb_y; + + int video_width = visual_video_get_width(priv->video); + int video_height = visual_video_get_height(priv->video); + + nb_x = 16; + nb_y = 16; + + for (i = 0; i < nb_x; i++) { + for (j = 0; j < nb_y; j++) { + x = RESFACTXF((i - ((float)nb_x) / 2) * 30); + y = RESFACTYF((j - ((float)nb_y) / 2) * 30); + z = RESFACTXF( + -((float)(priv->render_buffer[i + (nb_x / 32) * j]) * 32000)); + + rotation_3d(&x, &y, &z, alpha, beta, gamma); + perspective(&x, &y, &z, persp, dist_cam); + ix = (int)x; + iy = (int)y; + if (j != 0) { + cercle(priv, ix + cx, iy + cy, 3, col_grille_3d); + cercle(priv, ax + cx, ay + cy, 3, col_grille_3d); + } + ax = ix; + ay = iy; + } + } } -static void do_tourni_spec(PlazmaPrivate *priv) -{ - int i, j, k, l, halfheight, halfwidth, col_tourni, amplitude; - float v, vr, x, y; - v = 0.1; - vr = 0.00001; - col_tourni = 52; - amplitude = 44; - j = 20; - k = priv->k_put; - l = 1000; - halfheight = priv->height >> 1; - halfwidth = priv->width >> 1; - if (priv->effect) - col_tourni = 99; - if (priv->lines == 0 && priv->spectrum == 1) { - j = 4; - l = 2500; - amplitude = 88; - } - for (i=0 ; irot_tourni))*amplitude+(priv->render_buffer[i>>2]/j); - y = sin(k/(v*0.6))*amplitude+(priv->render_buffer[i>>2]); - aff_pixel (priv, x*cos(k*vr)+y*sin(k*vr)+halfwidth, x*sin(k*vr)-y*cos(k*vr)+halfheight, col_tourni); - } - priv->k_put = k; +static void do_radial_wave(PlazmaPrivate *priv) { + int i, halfheight, halfwidth, shift, col_fleur; + float y1, old_y1, k, opt, opt_old; + + y1 = priv->pcm_buffer[0] * 82; + col_fleur = 74; + shift = priv->height / 3.1; + + if (priv->effect) + col_fleur = 72; + + halfheight = priv->height >> 1; + halfwidth = priv->width >> 1; + for (i = 1; i < priv->width; i++) { + old_y1 = y1; + y1 = priv->pcm_buffer[i % 1024] * 82; + if (y1 < -50) + y1 = y1 / 2; + for (k = 1; k < 2.6; k += 0.4) { + opt = shift + (y1 / k); + opt_old = shift + (old_y1 / k); + droite(priv, halfwidth + priv->cosw.f[i - 1] * opt_old, + halfheight + priv->sinw.f[i - 1] * opt_old, + halfwidth + priv->cosw.f[i] * opt, + halfheight + priv->sinw.f[i] * opt, col_fleur); + droite(priv, halfwidth - priv->cosw.f[i - 1] * opt_old, + halfheight + priv->sinw.f[i - 1] * opt_old, + halfwidth - priv->cosw.f[i] * opt, + halfheight + priv->sinw.f[i] * opt, col_fleur); + } + } + for (k = 1; k < 2.6; k += 0.4) { + opt = shift + (y1 / k); + droite(priv, halfwidth + priv->cosw.f[1] * opt, + halfheight - priv->sinw.f[1] * opt, + halfwidth - priv->cosw.f[1] * opt, + halfheight - priv->sinw.f[1] * opt, col_fleur); + droite(priv, halfwidth - priv->cosw.f[1] * opt, + halfheight - priv->sinw.f[1] * opt, + halfwidth + priv->cosw.f[1] * opt, + halfheight - priv->sinw.f[1] * opt, col_fleur); + } } -static void do_lines(PlazmaPrivate *priv) -{ - int lc, lc2lc, reg_lines; - float larg_lines; - float pluseffect, coul_lines; - if (priv->lines == 1 && priv->spectrum == 0) { - reg_lines = (priv->height/2)-3; - larg_lines = 154; - } - else { - reg_lines = 77; - larg_lines = 88; - } - for (lc=0 ; lcwidth ; lc++) { - for (lc2lc=0 ; lc2lc<7 ; lc2lc++) { - coul_lines = 55; - pluseffect = 0; - if (priv->effect) { - coul_lines = 227.4; - pluseffect = 0.5; - } - if (lc2lc==0 || lc2lc==1 || lc2lc==4 || lc2lc==5 || lc2lc==6) - coul_lines = 400/(3.4+pluseffect); - aff_pixel(priv, lc, reg_lines+(priv->pcm_buffer[lc % 1024]*larg_lines)+lc2lc, coul_lines); - } - } +static void do_tourni_spec(PlazmaPrivate *priv) { + int i, j, k, l, halfheight, halfwidth, col_tourni, amplitude; + float v, vr, x, y; + v = 0.1; + vr = 0.00001; + col_tourni = 52; + amplitude = 44; + j = 20; + k = priv->k_put; + l = 1000; + halfheight = priv->height >> 1; + halfwidth = priv->width >> 1; + if (priv->effect) + col_tourni = 99; + if (priv->lines == 0 && priv->spectrum == 1) { + j = 4; + l = 2500; + amplitude = 88; + } + for (i = 0; i < l; i++, k++) { + x = cos(k / (v * priv->rot_tourni)) * amplitude + + (priv->render_buffer[i >> 2] / j); + y = sin(k / (v * 0.6)) * amplitude + (priv->render_buffer[i >> 2]); + aff_pixel(priv, x * cos(k * vr) + y * sin(k * vr) + halfwidth, + x * sin(k * vr) - y * cos(k * vr) + halfheight, col_tourni); + } + priv->k_put = k; } -static void do_spectrum(PlazmaPrivate *priv) -{ - int lc, lc2lc, lc2lc2lc, l_spect, toujours=0, coul_lines; - int i=0, too_hard=64, first_decr=FALSE; - float precision = 71; - if (priv->lines == 0 && priv->spectrum == 1) { - priv->val_maxi = priv->height - 150; - l_spect = 14; - } - else { - priv->val_maxi = priv->height - 280; - l_spect = 32; - } - for (lc=1 ; lcwidth ; lc+=10 , toujours++, too_hard-=i) { - for (lc2lc=0; lc2lc<7 ; lc2lc++, precision+=0.08) { - for (lc2lc2lc=0 ; lc2lc2lc<7 ; lc2lc2lc++) { - coul_lines=7.4+priv->chcol0+precision+(lc2lc*2); - if (lc2lc2lc==0 || lc2lc2lc==1 || lc2lc2lc==5 || lc2lc2lc==6) - coul_lines = priv->chcol0+(lc2lc*2); - aff_pixel(priv, lc+lc2lc, (priv->height - 10) -((int)(((priv->render_buffer[toujours] * 32000)/(l_spect+too_hard)))&priv->val_maxi)+lc2lc2lc, coul_lines); - } - } - if (!too_hard) - too_hard = 2; - if (lc<33) { - i = 6; - first_decr = TRUE; - } - else { - if (first_decr) { - first_decr = FALSE; - too_hard -= 10; - } - i = 2; - } - } +static void do_lines(PlazmaPrivate *priv) { + int lc, lc2lc, reg_lines; + float larg_lines; + float pluseffect, coul_lines; + if (priv->lines == 1 && priv->spectrum == 0) { + reg_lines = (priv->height / 2) - 3; + larg_lines = 154; + } else { + reg_lines = 77; + larg_lines = 88; + } + for (lc = 0; lc < priv->width; lc++) { + for (lc2lc = 0; lc2lc < 7; lc2lc++) { + coul_lines = 55; + pluseffect = 0; + if (priv->effect) { + coul_lines = 227.4; + pluseffect = 0.5; + } + if (lc2lc == 0 || lc2lc == 1 || lc2lc == 4 || lc2lc == 5 || lc2lc == 6) + coul_lines = 400 / (3.4 + pluseffect); + aff_pixel(priv, lc, + reg_lines + (priv->pcm_buffer[lc % 1024] * larg_lines) + lc2lc, + coul_lines); + } + } } -static void do_grille_3d(PlazmaPrivate *priv) -{ - int dis_col = 322; - if (priv->effect) - dis_col = 72; - if (priv->spectrum) - grille_3d (priv, 1.45, 0, priv->compt_grille_3d/30, 200, 110, dis_col, priv->width / 2, priv->height / 10); - else - grille_3d (priv, 1.1, 0, priv->compt_grille_3d/30, 200, 20, dis_col, priv->width / 2, priv->height / 5); - priv->compt_grille_3d += 0.1; +static void do_spectrum(PlazmaPrivate *priv) { + int lc, lc2lc, lc2lc2lc, l_spect, toujours = 0, coul_lines; + int i = 0, too_hard = 64, first_decr = FALSE; + float precision = 71; + if (priv->lines == 0 && priv->spectrum == 1) { + priv->val_maxi = priv->height - 150; + l_spect = 14; + } else { + priv->val_maxi = priv->height - 280; + l_spect = 32; + } + for (lc = 1; lc < priv->width; lc += 10, toujours++, too_hard -= i) { + for (lc2lc = 0; lc2lc < 7; lc2lc++, precision += 0.08) { + for (lc2lc2lc = 0; lc2lc2lc < 7; lc2lc2lc++) { + coul_lines = 7.4 + priv->chcol0 + precision + (lc2lc * 2); + if (lc2lc2lc == 0 || lc2lc2lc == 1 || lc2lc2lc == 5 || lc2lc2lc == 6) + coul_lines = priv->chcol0 + (lc2lc * 2); + aff_pixel(priv, lc + lc2lc, + (priv->height - 10) - + ((int)(((priv->render_buffer[toujours] * 32000) / + (l_spect + too_hard))) & + priv->val_maxi) + + lc2lc2lc, + coul_lines); + } + } + if (!too_hard) + too_hard = 2; + if (lc < 33) { + i = 6; + first_decr = TRUE; + } else { + if (first_decr) { + first_decr = FALSE; + too_hard -= 10; + } + i = 2; + } + } } -static void do_cercle_3d(PlazmaPrivate *priv) -{ - int dis_col = 382; - if (priv->effect) - dis_col = 99; - if (priv->lines) - cercle_3d (priv, 3.6, 0, priv->compt_cercle_3d/30, 200, 80, dis_col, priv->width / 2, priv->height); - else - cercle_3d (priv, 3.2, 0, priv->compt_cercle_3d/30, 200, 80, dis_col, priv->width / 2, priv->height / 2); - priv->compt_cercle_3d -= 0.1; +static void do_grille_3d(PlazmaPrivate *priv) { + int dis_col = 322; + if (priv->effect) + dis_col = 72; + if (priv->spectrum) + grille_3d(priv, 1.45, 0, priv->compt_grille_3d / 30, 200, 110, dis_col, + priv->width / 2, priv->height / 10); + else + grille_3d(priv, 1.1, 0, priv->compt_grille_3d / 30, 200, 20, dis_col, + priv->width / 2, priv->height / 5); + priv->compt_grille_3d += 0.1; } -static void what_display(PlazmaPrivate *priv) -{ - if (priv->use_3d) { - if (priv->options) { - if (priv->lines) - do_radial_wave(priv); - if (priv->spectrum) - do_tourni_spec(priv); - } - else { - if (priv->lines) - do_grille_3d(priv); - if (priv->spectrum) - do_cercle_3d(priv); - } - } - else { - if (priv->lines) - do_lines(priv); - if (priv->spectrum) - do_spectrum(priv); - } +static void do_cercle_3d(PlazmaPrivate *priv) { + int dis_col = 382; + if (priv->effect) + dis_col = 99; + if (priv->lines) + cercle_3d(priv, 3.6, 0, priv->compt_cercle_3d / 30, 200, 80, dis_col, + priv->width / 2, priv->height); + else + cercle_3d(priv, 3.2, 0, priv->compt_cercle_3d / 30, 200, 80, dis_col, + priv->width / 2, priv->height / 2); + priv->compt_cercle_3d -= 0.1; } +static void what_display(PlazmaPrivate *priv) { + if (priv->use_3d) { + if (priv->options) { + if (priv->lines) + do_radial_wave(priv); + if (priv->spectrum) + do_tourni_spec(priv); + } else { + if (priv->lines) + do_grille_3d(priv); + if (priv->spectrum) + do_cercle_3d(priv); + } + } else { + if (priv->lines) + do_lines(priv); + if (priv->spectrum) + do_spectrum(priv); + } +} diff --git a/libvisual-plugins/plugins/actor/plazma/plazma.h b/libvisual-plugins/plugins/actor/plazma/plazma.h index a3dce5e4c..9b020edda 100644 --- a/libvisual-plugins/plugins/actor/plazma/plazma.h +++ b/libvisual-plugins/plugins/actor/plazma/plazma.h @@ -1,5 +1,5 @@ /* Libvisual-plugins - Standard plugins for libvisual - * + * * Copyright (C) 2000, 2001 Pascal Brochart * * Authors: Pascal Brochart @@ -27,9 +27,9 @@ #include "actor_plazma.h" -void _plazma_init (PlazmaPrivate *priv); -void _plazma_run (PlazmaPrivate *priv); -void _plazma_cleanup (PlazmaPrivate *priv); -void _plazma_change_effect (PlazmaPrivate *priv); +void _plazma_init(PlazmaPrivate *priv); +void _plazma_run(PlazmaPrivate *priv); +void _plazma_cleanup(PlazmaPrivate *priv); +void _plazma_change_effect(PlazmaPrivate *priv); #endif /* _PLAZMA_H */ diff --git a/libvisual-plugins/plugins/input/alsa/input_alsa.c b/libvisual-plugins/plugins/input/alsa/input_alsa.c index ab1be6698..f2720920c 100644 --- a/libvisual-plugins/plugins/input/alsa/input_alsa.c +++ b/libvisual-plugins/plugins/input/alsa/input_alsa.c @@ -44,198 +44,196 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #define PCM_BUF_SIZE 1024 typedef struct { - snd_pcm_t *chandle; - int loaded; + snd_pcm_t *chandle; + int loaded; } alsaPrivate; -static int inp_alsa_init (VisPluginData *plugin); -static void inp_alsa_cleanup (VisPluginData *plugin); -static int inp_alsa_upload (VisPluginData *plugin, VisAudio *audio); - -static const char *inp_alsa_var_cdevice = "default"; -static const int inp_alsa_var_samplerate = 44100; -static const int inp_alsa_var_frames_target = 256; -static const int inp_alsa_var_channels = 2; - -const VisPluginInfo *get_plugin_info (void) -{ - static VisInputPlugin input = { - .upload = inp_alsa_upload - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_INPUT, - - .plugname = "alsa", - .name = "alsa", - .author = "Vitaly V. Bursov ", - .version = "0.1", - .about = N_("ALSA capture plugin"), - .help = N_("Use this plugin to capture PCM data from the ALSA record device"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = inp_alsa_init, - .cleanup = inp_alsa_cleanup, - .plugin = &input - }; - - return &info; +static int inp_alsa_init(VisPluginData *plugin); +static void inp_alsa_cleanup(VisPluginData *plugin); +static int inp_alsa_upload(VisPluginData *plugin, VisAudio *audio); + +static const char *inp_alsa_var_cdevice = "default"; +static const int inp_alsa_var_samplerate = 44100; +static const int inp_alsa_var_frames_target = 256; +static const int inp_alsa_var_channels = 2; + +const VisPluginInfo *get_plugin_info(void) { + static VisInputPlugin input = {.upload = inp_alsa_upload}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_INPUT, + + .plugname = "alsa", + .name = "alsa", + .author = "Vitaly V. Bursov ", + .version = "0.1", + .about = N_("ALSA capture plugin"), + .help = + N_("Use this plugin to capture PCM data from the ALSA record device"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = inp_alsa_init, + .cleanup = inp_alsa_cleanup, + .plugin = &input}; + + return &info; } -int inp_alsa_init (VisPluginData *plugin) -{ - snd_pcm_hw_params_t *hwparams = NULL; - alsaPrivate *priv; - unsigned int rate = inp_alsa_var_samplerate; - unsigned int exact_rate; - unsigned int tmp; - int dir = 0; - int err; +int inp_alsa_init(VisPluginData *plugin) { + snd_pcm_hw_params_t *hwparams = NULL; + alsaPrivate *priv; + unsigned int rate = inp_alsa_var_samplerate; + unsigned int exact_rate; + unsigned int tmp; + int dir = 0; + int err; #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - priv = visual_mem_new0 (alsaPrivate, 1); - visual_plugin_set_private (plugin, priv); - - if ((err = snd_pcm_open(&priv->chandle, inp_alsa_var_cdevice, - SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)) < 0) { - visual_log(VISUAL_LOG_ERROR, - "Record open error: %s", snd_strerror(err)); - return FALSE; - } - - snd_pcm_hw_params_malloc(&hwparams); - visual_return_val_if_fail(hwparams != NULL, FALSE); - - if (snd_pcm_hw_params_any(priv->chandle, hwparams) < 0) { - visual_log(VISUAL_LOG_ERROR, - "Cannot configure this PCM device"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } - - if (snd_pcm_hw_params_set_access(priv->chandle, hwparams, - SND_PCM_ACCESS_RW_INTERLEAVED) < 0) { - visual_log(VISUAL_LOG_ERROR, "Error setting access"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } + priv = visual_mem_new0(alsaPrivate, 1); + visual_plugin_set_private(plugin, priv); + + if ((err = snd_pcm_open(&priv->chandle, inp_alsa_var_cdevice, + SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)) < 0) { + visual_log(VISUAL_LOG_ERROR, "Record open error: %s", snd_strerror(err)); + return FALSE; + } + + snd_pcm_hw_params_malloc(&hwparams); + visual_return_val_if_fail(hwparams != NULL, FALSE); + + if (snd_pcm_hw_params_any(priv->chandle, hwparams) < 0) { + visual_log(VISUAL_LOG_ERROR, "Cannot configure this PCM device"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } + + if (snd_pcm_hw_params_set_access(priv->chandle, hwparams, + SND_PCM_ACCESS_RW_INTERLEAVED) < 0) { + visual_log(VISUAL_LOG_ERROR, "Error setting access"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } #if VISUAL_LITTLE_ENDIAN == 1 - if (snd_pcm_hw_params_set_format(priv->chandle, hwparams, - SND_PCM_FORMAT_S16_LE) < 0) { + if (snd_pcm_hw_params_set_format(priv->chandle, hwparams, + SND_PCM_FORMAT_S16_LE) < 0) { #else - if (snd_pcm_hw_params_set_format(priv->chandle, hwparams, - SND_PCM_FORMAT_S16_BE) < 0) { + if (snd_pcm_hw_params_set_format(priv->chandle, hwparams, + SND_PCM_FORMAT_S16_BE) < 0) { #endif - visual_log(VISUAL_LOG_ERROR, "Error setting format"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } - - exact_rate = rate; - - if (snd_pcm_hw_params_set_rate_near(priv->chandle, hwparams, - &exact_rate, &dir) < 0) { - visual_log(VISUAL_LOG_ERROR, "Error setting rate"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } - if (exact_rate != rate) { - visual_log(VISUAL_LOG_INFO, - "The rate %d Hz is not supported by your " \ - "hardware.\n" \ - "==> Using %d Hz instead", rate, exact_rate); - } - - if (snd_pcm_hw_params_set_channels(priv->chandle, hwparams, - inp_alsa_var_channels) < 0) { - visual_log(VISUAL_LOG_ERROR, "Error setting channels"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } - - tmp = (int)ceil((1000.0 * 1000.0 * inp_alsa_var_frames_target) / inp_alsa_var_samplerate); // in micro seconds - if (snd_pcm_hw_params_set_period_time_near(priv->chandle, hwparams, &tmp, &dir) < 0){ - visual_log(VISUAL_LOG_ERROR, "Error setting period time"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } - - tmp = (int)ceil((1000.0 * 1000.0 * inp_alsa_var_frames_target) / inp_alsa_var_samplerate); // in micro seconds - if (snd_pcm_hw_params_set_buffer_time_near(priv->chandle, hwparams, &tmp, &dir) < 0){ - visual_log(VISUAL_LOG_ERROR, "Error setting buffer time"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } - - - if (snd_pcm_hw_params(priv->chandle, hwparams) < 0) { - visual_log(VISUAL_LOG_ERROR, "Error setting HW params"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } - - if (snd_pcm_prepare(priv->chandle) < 0) { - visual_log(VISUAL_LOG_ERROR, "Failed to prepare interface"); - snd_pcm_hw_params_free(hwparams); - return FALSE; - } - - snd_pcm_hw_params_free(hwparams); - - priv->loaded = TRUE; - - return TRUE; + visual_log(VISUAL_LOG_ERROR, "Error setting format"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } + + exact_rate = rate; + + if (snd_pcm_hw_params_set_rate_near(priv->chandle, hwparams, &exact_rate, + &dir) < 0) { + visual_log(VISUAL_LOG_ERROR, "Error setting rate"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } + if (exact_rate != rate) { + visual_log(VISUAL_LOG_INFO, + "The rate %d Hz is not supported by your " + "hardware.\n" + "==> Using %d Hz instead", + rate, exact_rate); + } + + if (snd_pcm_hw_params_set_channels(priv->chandle, hwparams, + inp_alsa_var_channels) < 0) { + visual_log(VISUAL_LOG_ERROR, "Error setting channels"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } + + tmp = (int)ceil((1000.0 * 1000.0 * inp_alsa_var_frames_target) / + inp_alsa_var_samplerate); // in micro seconds + if (snd_pcm_hw_params_set_period_time_near(priv->chandle, hwparams, &tmp, + &dir) < 0) { + visual_log(VISUAL_LOG_ERROR, "Error setting period time"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } + + tmp = (int)ceil((1000.0 * 1000.0 * inp_alsa_var_frames_target) / + inp_alsa_var_samplerate); // in micro seconds + if (snd_pcm_hw_params_set_buffer_time_near(priv->chandle, hwparams, &tmp, + &dir) < 0) { + visual_log(VISUAL_LOG_ERROR, "Error setting buffer time"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } + + if (snd_pcm_hw_params(priv->chandle, hwparams) < 0) { + visual_log(VISUAL_LOG_ERROR, "Error setting HW params"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } + + if (snd_pcm_prepare(priv->chandle) < 0) { + visual_log(VISUAL_LOG_ERROR, "Failed to prepare interface"); + snd_pcm_hw_params_free(hwparams); + return FALSE; + } + + snd_pcm_hw_params_free(hwparams); + + priv->loaded = TRUE; + + return TRUE; } -void inp_alsa_cleanup (VisPluginData *plugin) -{ - alsaPrivate *priv = visual_plugin_get_private (plugin); +void inp_alsa_cleanup(VisPluginData *plugin) { + alsaPrivate *priv = visual_plugin_get_private(plugin); - if (priv->loaded) { - snd_pcm_close(priv->chandle); - } + if (priv->loaded) { + snd_pcm_close(priv->chandle); + } - visual_mem_free (priv); + visual_mem_free(priv); } -int inp_alsa_upload (VisPluginData *plugin, VisAudio *audio) -{ - alsaPrivate *priv = visual_plugin_get_private (plugin); +int inp_alsa_upload(VisPluginData *plugin, VisAudio *audio) { + alsaPrivate *priv = visual_plugin_get_private(plugin); - int16_t data[PCM_BUF_SIZE]; - const snd_pcm_uframes_t frames_wanted = sizeof(data) / sizeof(data[0]) / inp_alsa_var_channels; - snd_pcm_sframes_t rcnt; + int16_t data[PCM_BUF_SIZE]; + const snd_pcm_uframes_t frames_wanted = + sizeof(data) / sizeof(data[0]) / inp_alsa_var_channels; + snd_pcm_sframes_t rcnt; - do { - rcnt = snd_pcm_readi(priv->chandle, data, frames_wanted); + do { + rcnt = snd_pcm_readi(priv->chandle, data, frames_wanted); - if (rcnt > 0) { - VisBuffer *buffer; + if (rcnt > 0) { + VisBuffer *buffer; - buffer = visual_buffer_new_wrap_data (data, rcnt * sizeof(data[0]) * inp_alsa_var_channels, FALSE); + buffer = visual_buffer_new_wrap_data( + data, rcnt * sizeof(data[0]) * inp_alsa_var_channels, FALSE); - visual_audio_input (audio, buffer, VISUAL_AUDIO_SAMPLE_RATE_44100, - VISUAL_AUDIO_SAMPLE_FORMAT_S16, VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); + visual_audio_input(audio, buffer, VISUAL_AUDIO_SAMPLE_RATE_44100, + VISUAL_AUDIO_SAMPLE_FORMAT_S16, + VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); - visual_buffer_unref (buffer); - } + visual_buffer_unref(buffer); + } - if (rcnt < 0) { - if (rcnt == -EPIPE) { - visual_log(VISUAL_LOG_WARNING, "ALSA: Buffer Overrun"); + if (rcnt < 0) { + if (rcnt == -EPIPE) { + visual_log(VISUAL_LOG_WARNING, "ALSA: Buffer Overrun"); - if (snd_pcm_prepare(priv->chandle) < 0) { - visual_log(VISUAL_LOG_ERROR, - "Failed to prepare interface"); - return FALSE; - } - } - } - } while (rcnt > 0); + if (snd_pcm_prepare(priv->chandle) < 0) { + visual_log(VISUAL_LOG_ERROR, "Failed to prepare interface"); + return FALSE; + } + } + } + } while (rcnt > 0); - return TRUE; + return TRUE; } diff --git a/libvisual-plugins/plugins/input/debug/input_debug.c b/libvisual-plugins/plugins/input/debug/input_debug.c index 45686f992..5f26c6444 100644 --- a/libvisual-plugins/plugins/input/debug/input_debug.c +++ b/libvisual-plugins/plugins/input/debug/input_debug.c @@ -26,175 +26,165 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -#define OUTPUT_RATE 44100 -#define OUTPUT_SAMPLES 1024 +#define OUTPUT_RATE 44100 +#define OUTPUT_SAMPLES 1024 #define DEFAULT_FREQUENCY (OUTPUT_RATE / 500.0) #define DEFAULT_AMPLITUDE 1.0 -#define UPLOAD_PERIOD_USECS (((uint64_t) OUTPUT_SAMPLES * VISUAL_USECS_PER_SEC) / OUTPUT_RATE) +#define UPLOAD_PERIOD_USECS \ + (((uint64_t)OUTPUT_SAMPLES * VISUAL_USECS_PER_SEC) / OUTPUT_RATE) typedef struct { - float frequency; - float ampltitude; + float frequency; + float ampltitude; - float angle; - float angle_step; + float angle; + float angle_step; - VisTime *last_upload_time; + VisTime *last_upload_time; } DebugPriv; -static int inp_debug_init (VisPluginData *plugin); -static void inp_debug_cleanup (VisPluginData *plugin); -static int inp_debug_events (VisPluginData *plugin, VisEventQueue *events); -static int inp_debug_upload (VisPluginData *plugin, VisAudio *audio); - -static void change_param (VisPluginData *plugin, VisParam *param); -static void setup_wave (DebugPriv *priv); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisInputPlugin input = { - .upload = inp_debug_upload - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_INPUT, - .plugname = "debug", - .name = "debug", - .author = "Vitaly V. Bursov ", - .version = "0.2", - .url = "http://libvisual.org/", - .about = N_("debug input plugin"), - .help = N_("this will generate a sine wave for debugging purposes"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = inp_debug_init, - .cleanup = inp_debug_cleanup, - .events = inp_debug_events, - .plugin = &input - }; - - return &info; +static int inp_debug_init(VisPluginData *plugin); +static void inp_debug_cleanup(VisPluginData *plugin); +static int inp_debug_events(VisPluginData *plugin, VisEventQueue *events); +static int inp_debug_upload(VisPluginData *plugin, VisAudio *audio); + +static void change_param(VisPluginData *plugin, VisParam *param); +static void setup_wave(DebugPriv *priv); + +const VisPluginInfo *get_plugin_info(void) { + static VisInputPlugin input = {.upload = inp_debug_upload}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_INPUT, + .plugname = "debug", + .name = "debug", + .author = "Vitaly V. Bursov ", + .version = "0.2", + .url = "http://libvisual.org/", + .about = N_("debug input plugin"), + .help = N_("this will generate a sine wave for debugging purposes"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = inp_debug_init, + .cleanup = inp_debug_cleanup, + .events = inp_debug_events, + .plugin = &input}; + + return &info; } -static int inp_debug_init (VisPluginData *plugin) -{ +static int inp_debug_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - DebugPriv *priv = visual_mem_new0 (DebugPriv, 1); - visual_plugin_set_private (plugin, priv); + DebugPriv *priv = visual_mem_new0(DebugPriv, 1); + visual_plugin_set_private(plugin, priv); - VisParamList *params = visual_plugin_get_params (plugin); - visual_param_list_add_many (params, - visual_param_new_float ("frequency", - N_("Frequency of sine wave"), - DEFAULT_FREQUENCY, - visual_param_in_range_float (0.0f, 22000.0f)), - visual_param_new_float ("ampltitude", - N_("Ampltitude of sine wave"), - DEFAULT_AMPLITUDE, - visual_param_in_range_float (0.0f, 1.0f)), - NULL); + VisParamList *params = visual_plugin_get_params(plugin); + visual_param_list_add_many( + params, + visual_param_new_float("frequency", N_("Frequency of sine wave"), + DEFAULT_FREQUENCY, + visual_param_in_range_float(0.0f, 22000.0f)), + visual_param_new_float("ampltitude", N_("Ampltitude of sine wave"), + DEFAULT_AMPLITUDE, + visual_param_in_range_float(0.0f, 1.0f)), + NULL); - priv->frequency = DEFAULT_FREQUENCY; - priv->ampltitude = DEFAULT_AMPLITUDE; + priv->frequency = DEFAULT_FREQUENCY; + priv->ampltitude = DEFAULT_AMPLITUDE; - priv->last_upload_time = NULL; + priv->last_upload_time = NULL; - setup_wave (priv); + setup_wave(priv); - return TRUE; + return TRUE; } -static void inp_debug_cleanup (VisPluginData *plugin) -{ - DebugPriv *priv = visual_plugin_get_private (plugin); +static void inp_debug_cleanup(VisPluginData *plugin) { + DebugPriv *priv = visual_plugin_get_private(plugin); - visual_time_free (priv->last_upload_time); - visual_mem_free (priv); + visual_time_free(priv->last_upload_time); + visual_mem_free(priv); } -static void setup_wave (DebugPriv *priv) -{ - priv->angle = 0.0; - priv->angle_step = (2.0 * VISUAL_MATH_PI * priv->frequency) / OUTPUT_RATE; +static void setup_wave(DebugPriv *priv) { + priv->angle = 0.0; + priv->angle_step = (2.0 * VISUAL_MATH_PI * priv->frequency) / OUTPUT_RATE; } -static void change_param (VisPluginData *plugin, VisParam *param) -{ - /* FIXME: Implement */ +static void change_param(VisPluginData *plugin, VisParam *param) { + /* FIXME: Implement */ } -static int inp_debug_events (VisPluginData *plugin, VisEventQueue *events) -{ - VisEvent ev; - - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - case VISUAL_EVENT_PARAM: { - VisParam *param = ev.event.param.param; - change_param (plugin, param); - } - default:; /* discard */ - } - } - - return TRUE; +static int inp_debug_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; + + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + case VISUAL_EVENT_PARAM: { + VisParam *param = ev.event.param.param; + change_param(plugin, param); + } + default:; /* discard */ + } + } + + return TRUE; } -static int inp_debug_upload (VisPluginData *plugin, VisAudio *audio) -{ - /* FIXME: Wave is incrementally calculated and will very gradually - increase/decrease in frequency due to error accumulation */ +static int inp_debug_upload(VisPluginData *plugin, VisAudio *audio) { + /* FIXME: Wave is incrementally calculated and will very gradually + increase/decrease in frequency due to error accumulation */ - DebugPriv *priv = visual_plugin_get_private (plugin); + DebugPriv *priv = visual_plugin_get_private(plugin); - /* Sleep for the appropriate amount of time to simulate blocking - * due to buffer underruns */ + /* Sleep for the appropriate amount of time to simulate blocking + * due to buffer underruns */ - VisTime *current_time = visual_time_new_now (); + VisTime *current_time = visual_time_new_now(); - if (!priv->last_upload_time) { - priv->last_upload_time = visual_time_clone (current_time); - } + if (!priv->last_upload_time) { + priv->last_upload_time = visual_time_clone(current_time); + } - VisTime *diff_time = visual_time_new (); - visual_time_diff (diff_time, current_time, priv->last_upload_time); + VisTime *diff_time = visual_time_new(); + visual_time_diff(diff_time, current_time, priv->last_upload_time); - int64_t sleep_time = (int64_t) UPLOAD_PERIOD_USECS - (int64_t) visual_time_to_usecs (diff_time); - if (sleep_time > 0) { - visual_usleep (sleep_time); - } + int64_t sleep_time = + (int64_t)UPLOAD_PERIOD_USECS - (int64_t)visual_time_to_usecs(diff_time); + if (sleep_time > 0) { + visual_usleep(sleep_time); + } - visual_time_free (diff_time); - visual_time_free (priv->last_upload_time); + visual_time_free(diff_time); + visual_time_free(priv->last_upload_time); - priv->last_upload_time = current_time; + priv->last_upload_time = current_time; - /* Generate and upload samples */ + /* Generate and upload samples */ - float data[OUTPUT_SAMPLES*2]; - int i; + float data[OUTPUT_SAMPLES * 2]; + int i; - for(i = 0; i < OUTPUT_SAMPLES*2; i += 2) { - data[i] = data[i+1] = priv->ampltitude * sin (priv->angle); + for (i = 0; i < OUTPUT_SAMPLES * 2; i += 2) { + data[i] = data[i + 1] = priv->ampltitude * sin(priv->angle); - priv->angle += priv->angle_step; - while (priv->angle >= 2 * VISUAL_MATH_PI) { - priv->angle -= 2 * VISUAL_MATH_PI; - } - } + priv->angle += priv->angle_step; + while (priv->angle >= 2 * VISUAL_MATH_PI) { + priv->angle -= 2 * VISUAL_MATH_PI; + } + } - VisBuffer *buffer = visual_buffer_new_wrap_data (data, sizeof (data), FALSE); + VisBuffer *buffer = visual_buffer_new_wrap_data(data, sizeof(data), FALSE); - visual_audio_input (audio, buffer, - VISUAL_AUDIO_SAMPLE_RATE_44100, - VISUAL_AUDIO_SAMPLE_FORMAT_FLOAT, - VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); + visual_audio_input(audio, buffer, VISUAL_AUDIO_SAMPLE_RATE_44100, + VISUAL_AUDIO_SAMPLE_FORMAT_FLOAT, + VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); - visual_buffer_unref (buffer); + visual_buffer_unref(buffer); - return TRUE; + return TRUE; } diff --git a/libvisual-plugins/plugins/input/jack/input_jack.cpp b/libvisual-plugins/plugins/input/jack/input_jack.cpp index d536419de..56698d9b2 100644 --- a/libvisual-plugins/plugins/input/jack/input_jack.cpp +++ b/libvisual-plugins/plugins/input/jack/input_jack.cpp @@ -32,205 +32,201 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR namespace { - typedef std::vector Buffer; - - struct JackPrivate { - jack_client_t* client; - jack_port_t* input_port; - bool shutdown; - jack_nframes_t buffer_size; - jack_nframes_t sample_rate; - Buffer buffer; - }; - - int process_callback (jack_nframes_t nframes, void* arg); - void shutdown_callback (void* arg); - int buffer_size_callback (jack_nframes_t nframes, void* arg); - int sample_rate_callback (jack_nframes_t nframes, void* arg); - - int inp_jack_init (VisPluginData* plugin); - void inp_jack_cleanup (VisPluginData* plugin); - int inp_jack_upload (VisPluginData* plugin, VisAudio* audio); - +typedef std::vector Buffer; + +struct JackPrivate { + jack_client_t *client; + jack_port_t *input_port; + bool shutdown; + jack_nframes_t buffer_size; + jack_nframes_t sample_rate; + Buffer buffer; +}; + +int process_callback(jack_nframes_t nframes, void *arg); +void shutdown_callback(void *arg); +int buffer_size_callback(jack_nframes_t nframes, void *arg); +int sample_rate_callback(jack_nframes_t nframes, void *arg); + +int inp_jack_init(VisPluginData *plugin); +void inp_jack_cleanup(VisPluginData *plugin); +int inp_jack_upload(VisPluginData *plugin, VisAudio *audio); + +} // namespace + +VisPluginInfo const *get_plugin_info() { + static VisInputPlugin input = {inp_jack_upload}; + + static VisPluginInfo info; + + info.type = VISUAL_PLUGIN_TYPE_INPUT; + info.plugname = "jack"; + info.name = "JACK input"; + info.author = "Dennis Smit "; + info.version = "0.1"; + info.about = N_("Jackit capture plugin"); + info.help = N_("Use this plugin to capture PCM data from jackd"); + info.license = VISUAL_PLUGIN_LICENSE_LGPL; + + info.init = inp_jack_init; + info.cleanup = inp_jack_cleanup; + info.plugin = &input; + + return &info; } -VisPluginInfo const* get_plugin_info () -{ - static VisInputPlugin input = { - inp_jack_upload - }; +namespace { - static VisPluginInfo info; +int inp_jack_init(VisPluginData *plugin) { +#if ENABLE_NLS + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); +#endif - info.type = VISUAL_PLUGIN_TYPE_INPUT; - info.plugname = "jack"; - info.name = "JACK input"; - info.author = "Dennis Smit "; - info.version = "0.1"; - info.about = N_("Jackit capture plugin"); - info.help = N_("Use this plugin to capture PCM data from jackd"); - info.license = VISUAL_PLUGIN_LICENSE_LGPL; + JackPrivate *priv = new JackPrivate; + visual_plugin_set_private(plugin, priv); - info.init = inp_jack_init; - info.cleanup = inp_jack_cleanup; - info.plugin = &input; + jack_options_t options = JackNullOption; + jack_status_t status; - return &info; -} + // Open client connection to JACK, automatically starting the + // server if needed + priv->client = + jack_client_open("Libvisual", options, &status, JACK_SERVER_NAME); + if (!priv->client) { + visual_log(VISUAL_LOG_ERROR, + "Cannot connect to JACK server: status = 0x%2.0x", status); + return FALSE; + } -namespace { + // Check if server was started + if (status & JackServerStarted) { + visual_log(VISUAL_LOG_INFO, "JACK server started"); + } - int inp_jack_init (VisPluginData* plugin) - { -#if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); -#endif + // Initialize audio settings + priv->buffer_size = jack_get_buffer_size(priv->client); + priv->sample_rate = jack_get_sample_rate(priv->client); + priv->buffer.resize(priv->buffer_size * 2); + priv->shutdown = false; + + // Setup callbacks + jack_set_process_callback(priv->client, process_callback, priv); + jack_on_shutdown(priv->client, shutdown_callback, priv); + jack_set_sample_rate_callback(priv->client, sample_rate_callback, priv); + jack_set_buffer_size_callback(priv->client, buffer_size_callback, priv); + + // Create an input port to receive data on + priv->input_port = jack_port_register( + priv->client, "input", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); + if (!priv->input_port) { + visual_log(VISUAL_LOG_ERROR, "No more JACK input port available"); + return FALSE; + } - JackPrivate* priv = new JackPrivate; - visual_plugin_set_private (plugin, priv); - - jack_options_t options = JackNullOption; - jack_status_t status; - - // Open client connection to JACK, automatically starting the - // server if needed - priv->client = jack_client_open ("Libvisual", options, &status, JACK_SERVER_NAME); - if (!priv->client) { - visual_log (VISUAL_LOG_ERROR, "Cannot connect to JACK server: status = 0x%2.0x", status); - return FALSE; - } - - // Check if server was started - if (status & JackServerStarted) { - visual_log (VISUAL_LOG_INFO, "JACK server started"); - } - - // Initialize audio settings - priv->buffer_size = jack_get_buffer_size (priv->client); - priv->sample_rate = jack_get_sample_rate (priv->client); - priv->buffer.resize (priv->buffer_size * 2); - priv->shutdown = false; - - // Setup callbacks - jack_set_process_callback (priv->client, process_callback, priv); - jack_on_shutdown (priv->client, shutdown_callback, priv); - jack_set_sample_rate_callback (priv->client, sample_rate_callback, priv); - jack_set_buffer_size_callback (priv->client, buffer_size_callback, priv); - - // Create an input port to receive data on - priv->input_port = jack_port_register (priv->client, "input", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); - if (!priv->input_port) { - visual_log (VISUAL_LOG_ERROR, "No more JACK input port available"); - return FALSE; - } - - // Activate this client. From here on JACK will start invoking - // our callbacks - if (jack_activate (priv->client) == 1) { - visual_log (VISUAL_LOG_ERROR, "Cannot activate client"); - return FALSE; - } - - // Look for physical capture ports we can try and connect to - const char **ports = jack_get_ports (priv->client, NULL, NULL, JackPortIsPhysical | JackPortIsOutput); - if (!ports) { - visual_log (VISUAL_LOG_ERROR, "Cannot find any physical capture ports"); - return FALSE; - } - - visual_log (VISUAL_LOG_INFO, "Available ports:"); - for (char const** port = ports; *port; port++) { - visual_log (VISUAL_LOG_INFO, "%s", *port); - } - - // Receive our input from the first capture port - if (jack_connect (priv->client, ports[0], jack_port_name (priv->input_port))) { - visual_log (VISUAL_LOG_ERROR, "Cannot connect input port"); - free (ports); - return FALSE; - } - - free (ports); - - return TRUE; + // Activate this client. From here on JACK will start invoking + // our callbacks + if (jack_activate(priv->client) == 1) { + visual_log(VISUAL_LOG_ERROR, "Cannot activate client"); + return FALSE; } - void inp_jack_cleanup (VisPluginData* plugin) - { - JackPrivate* priv = static_cast (visual_plugin_get_private (plugin)); + // Look for physical capture ports we can try and connect to + const char **ports = jack_get_ports(priv->client, NULL, NULL, + JackPortIsPhysical | JackPortIsOutput); + if (!ports) { + visual_log(VISUAL_LOG_ERROR, "Cannot find any physical capture ports"); + return FALSE; + } - if (priv->client) { - jack_client_close (priv->client); - } + visual_log(VISUAL_LOG_INFO, "Available ports:"); + for (char const **port = ports; *port; port++) { + visual_log(VISUAL_LOG_INFO, "%s", *port); + } - delete priv; + // Receive our input from the first capture port + if (jack_connect(priv->client, ports[0], jack_port_name(priv->input_port))) { + visual_log(VISUAL_LOG_ERROR, "Cannot connect input port"); + free(ports); + return FALSE; } - int inp_jack_upload (VisPluginData* plugin, VisAudio* audio) - { - JackPrivate* priv = static_cast (visual_plugin_get_private (plugin)); + free(ports); - if (priv->shutdown) { - visual_log (VISUAL_LOG_ERROR, "JACK server seems to have shutdown"); - return FALSE; - } + return TRUE; +} - LV::BufferPtr buffer = LV::Buffer::wrap (priv->buffer.data(), priv->buffer.size() * sizeof(int16_t), false); - audio->input (buffer, - VISUAL_AUDIO_SAMPLE_RATE_44100, - VISUAL_AUDIO_SAMPLE_FORMAT_S16, - VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); +void inp_jack_cleanup(VisPluginData *plugin) { + JackPrivate *priv = + static_cast(visual_plugin_get_private(plugin)); - return TRUE; + if (priv->client) { + jack_client_close(priv->client); } - int buffer_size_callback (jack_nframes_t nframes, void* arg) - { - JackPrivate* priv = static_cast (arg); + delete priv; +} - // Buffer size changed, adjust buffer accordingly - priv->buffer_size = nframes; - priv->buffer.resize (priv->buffer_size * 2); +int inp_jack_upload(VisPluginData *plugin, VisAudio *audio) { + JackPrivate *priv = + static_cast(visual_plugin_get_private(plugin)); - return 0; + if (priv->shutdown) { + visual_log(VISUAL_LOG_ERROR, "JACK server seems to have shutdown"); + return FALSE; } - int sample_rate_callback (jack_nframes_t nframes, void* arg) - { - JackPrivate* priv = static_cast (arg); + LV::BufferPtr buffer = LV::Buffer::wrap( + priv->buffer.data(), priv->buffer.size() * sizeof(int16_t), false); + audio->input(buffer, VISUAL_AUDIO_SAMPLE_RATE_44100, + VISUAL_AUDIO_SAMPLE_FORMAT_S16, + VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); - // FIXME: Update sample rate setting in inp_jack_upload() - priv->sample_rate = nframes; + return TRUE; +} - return 0; - } +int buffer_size_callback(jack_nframes_t nframes, void *arg) { + JackPrivate *priv = static_cast(arg); - int process_callback (jack_nframes_t nframes, void* arg) - { - JackPrivate* priv = static_cast (arg); + // Buffer size changed, adjust buffer accordingly + priv->buffer_size = nframes; + priv->buffer.resize(priv->buffer_size * 2); - jack_default_audio_sample_t* in = - static_cast (jack_port_get_buffer (priv->input_port, nframes)); + return 0; +} - // FIXME: As we're only receiving audio data from a single input - // port, we need to duplicate it across both left and right - // channels. VisAudio does not accept mono inputs yet. +int sample_rate_callback(jack_nframes_t nframes, void *arg) { + JackPrivate *priv = static_cast(arg); - // FIXME: Float inputs do not appear to work at the moment - // either, so we convert the data to signed 16-bit here as well. + // FIXME: Update sample rate setting in inp_jack_upload() + priv->sample_rate = nframes; - for (unsigned int i = 0; i < nframes; i++) { - priv->buffer[i << 1] = priv->buffer[(i << 1) + 1] = int16_t (in[i] * 32767); - } + return 0; +} - return 0; - } +int process_callback(jack_nframes_t nframes, void *arg) { + JackPrivate *priv = static_cast(arg); - void shutdown_callback (void* arg) - { - JackPrivate* priv = static_cast (arg); + jack_default_audio_sample_t *in = static_cast( + jack_port_get_buffer(priv->input_port, nframes)); - priv->shutdown = true; + // FIXME: As we're only receiving audio data from a single input + // port, we need to duplicate it across both left and right + // channels. VisAudio does not accept mono inputs yet. + + // FIXME: Float inputs do not appear to work at the moment + // either, so we convert the data to signed 16-bit here as well. + + for (unsigned int i = 0; i < nframes; i++) { + priv->buffer[i << 1] = priv->buffer[(i << 1) + 1] = int16_t(in[i] * 32767); } + return 0; +} + +void shutdown_callback(void *arg) { + JackPrivate *priv = static_cast(arg); + + priv->shutdown = true; } + +} // namespace diff --git a/libvisual-plugins/plugins/input/mplayer/input_mplayer.c b/libvisual-plugins/plugins/input/mplayer/input_mplayer.c index e6c06ddce..8b436b03f 100644 --- a/libvisual-plugins/plugins/input/mplayer/input_mplayer.c +++ b/libvisual-plugins/plugins/input/mplayer/input_mplayer.c @@ -1,6 +1,7 @@ /* Libvisual-plugins - Standard plugins for libvisual * - * Copyright (C) 2004, 2005, 2006 Gustavo Sverzut Barbieri + * Copyright (C) 2004, 2005, 2006 Gustavo Sverzut Barbieri + * * * Authors: Gustavo Sverzut Barbieri * Dennis Smit @@ -40,187 +41,164 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #ifndef SHARED_FILE -#define SHARED_FILE ".mplayer/mplayer-af_export" /**< default file name, relative to $HOME */ -#endif /* SHARED_FILE */ +#define SHARED_FILE \ + ".mplayer/mplayer-af_export" /**< default file name, relative to $HOME */ +#endif /* SHARED_FILE */ typedef struct { - int nch; /**< number of channels */ - int bs; /**< buffer size */ - unsigned long long count; /**< sample counter */ + int nch; /**< number of channels */ + int bs; /**< buffer size */ + unsigned long long count; /**< sample counter */ } mplayer_data_t; typedef struct { - int fd; /**< file descriptor to mmaped area */ - char *sharedfile; /**< shared file name */ - mplayer_data_t *mmap_area; /**< mmap()'ed area */ - unsigned long long prev_count; /**< to detect duplicates */ + int fd; /**< file descriptor to mmaped area */ + char *sharedfile; /**< shared file name */ + mplayer_data_t *mmap_area; /**< mmap()'ed area */ + unsigned long long prev_count; /**< to detect duplicates */ - int loaded; /**< plugin state */ + int loaded; /**< plugin state */ } mplayer_priv_t; -static int inp_mplayer_init (VisPluginData *plugin); -static void inp_mplayer_cleanup (VisPluginData *plugin); -static int inp_mplayer_upload (VisPluginData *plugin, VisAudio *audio); - -const VisPluginInfo *get_plugin_info( void ) -{ - static VisInputPlugin input = { - .upload = inp_mplayer_upload - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_INPUT, - - .plugname = "mplayer", - .name = "mplayer", - .author = "Gustavo Sverzut Barbieri ", - .version = "1.19", - .about = N_("Use data exported from MPlayer"), - .help = N_("This plugin uses data exported from 'mplayer -af export'"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = inp_mplayer_init, - .cleanup = inp_mplayer_cleanup, - .plugin = &input - }; - - return &info; +static int inp_mplayer_init(VisPluginData *plugin); +static void inp_mplayer_cleanup(VisPluginData *plugin); +static int inp_mplayer_upload(VisPluginData *plugin, VisAudio *audio); + +const VisPluginInfo *get_plugin_info(void) { + static VisInputPlugin input = {.upload = inp_mplayer_upload}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_INPUT, + + .plugname = "mplayer", + .name = "mplayer", + .author = "Gustavo Sverzut Barbieri ", + .version = "1.19", + .about = N_("Use data exported from MPlayer"), + .help = N_("This plugin uses data exported from 'mplayer -af export'"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = inp_mplayer_init, + .cleanup = inp_mplayer_cleanup, + .plugin = &input}; + + return &info; } -static int inp_mplayer_init( VisPluginData *plugin ) -{ - mplayer_priv_t *priv = NULL; +static int inp_mplayer_init(VisPluginData *plugin) { + mplayer_priv_t *priv = NULL; #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - priv = visual_mem_new0(mplayer_priv_t, 1); - visual_plugin_set_private (plugin, priv); - - priv->sharedfile = visual_mem_malloc0( sizeof( char ) * - ( strlen( SHARED_FILE ) + - strlen( getenv( "HOME" ) ) + 2 ) ); - - strcpy( priv->sharedfile, getenv( "HOME" ) ); - strcat( priv->sharedfile, "/" ); - strcat( priv->sharedfile, SHARED_FILE ); - - visual_return_val_if_fail( priv->sharedfile != NULL, FALSE ); - - priv->fd = open( priv->sharedfile, O_RDONLY ); - - if ( priv->fd < 0 ) - { - /* - * FIXME this will cause the application to abort, - * may be we must print a warning and clean all - * before to return the error value. - */ - visual_log( VISUAL_LOG_CRITICAL, - "Could not open file '%s': %s", - priv->sharedfile, strerror( errno ) ); - return FALSE; - } - - priv->mmap_area = mmap( 0, sizeof( mplayer_data_t ), - PROT_READ, MAP_SHARED, priv->fd, 0 ); - visual_return_val_if_fail( (intptr_t)priv->mmap_area != -1, FALSE ); - - if ( priv->mmap_area->nch == 0 ) - { - visual_log( VISUAL_LOG_CRITICAL, "No audio channel available" ); - return FALSE; - } - - if ( ( priv->mmap_area->nch != 2 ) || - ( priv->mmap_area->bs != 2048 ) ) - { - visual_log( VISUAL_LOG_CRITICAL, - "Data in wrong format. It should be 2 channels" \ - " with 512 16bit samples. There are %d channels %d 16bit " \ - "samples in it (buffer is %d bytes)", - priv->mmap_area->nch, - priv->mmap_area->bs / 2 / priv->mmap_area->nch, - priv->mmap_area->bs ); - return FALSE; - } - - priv->mmap_area = mremap( priv->mmap_area, sizeof( mplayer_data_t ), - sizeof( mplayer_data_t ) + priv->mmap_area->bs, - 0 ); - if ( (intptr_t)priv->mmap_area == -1 ) - { - visual_log( VISUAL_LOG_CRITICAL, - "Could not mremap() area from file '%s' " \ - " (%p from %" VISUAL_SIZE_T_FORMAT " to %" VISUAL_SIZE_T_FORMAT " bytes): %s", - priv->sharedfile, - (void *) priv->mmap_area, sizeof( mplayer_data_t ), - sizeof( mplayer_data_t ) + priv->mmap_area->bs, - strerror( errno ) ); - return FALSE; - } - priv->prev_count = ULLONG_MAX; - - priv->loaded = TRUE; - - return TRUE; + priv = visual_mem_new0(mplayer_priv_t, 1); + visual_plugin_set_private(plugin, priv); + + priv->sharedfile = visual_mem_malloc0( + sizeof(char) * (strlen(SHARED_FILE) + strlen(getenv("HOME")) + 2)); + + strcpy(priv->sharedfile, getenv("HOME")); + strcat(priv->sharedfile, "/"); + strcat(priv->sharedfile, SHARED_FILE); + + visual_return_val_if_fail(priv->sharedfile != NULL, FALSE); + + priv->fd = open(priv->sharedfile, O_RDONLY); + + if (priv->fd < 0) { + /* + * FIXME this will cause the application to abort, + * may be we must print a warning and clean all + * before to return the error value. + */ + visual_log(VISUAL_LOG_CRITICAL, "Could not open file '%s': %s", + priv->sharedfile, strerror(errno)); + return FALSE; + } + + priv->mmap_area = + mmap(0, sizeof(mplayer_data_t), PROT_READ, MAP_SHARED, priv->fd, 0); + visual_return_val_if_fail((intptr_t)priv->mmap_area != -1, FALSE); + + if (priv->mmap_area->nch == 0) { + visual_log(VISUAL_LOG_CRITICAL, "No audio channel available"); + return FALSE; + } + + if ((priv->mmap_area->nch != 2) || (priv->mmap_area->bs != 2048)) { + visual_log(VISUAL_LOG_CRITICAL, + "Data in wrong format. It should be 2 channels" + " with 512 16bit samples. There are %d channels %d 16bit " + "samples in it (buffer is %d bytes)", + priv->mmap_area->nch, + priv->mmap_area->bs / 2 / priv->mmap_area->nch, + priv->mmap_area->bs); + return FALSE; + } + + priv->mmap_area = mremap(priv->mmap_area, sizeof(mplayer_data_t), + sizeof(mplayer_data_t) + priv->mmap_area->bs, 0); + if ((intptr_t)priv->mmap_area == -1) { + visual_log(VISUAL_LOG_CRITICAL, + "Could not mremap() area from file '%s' " + " (%p from %" VISUAL_SIZE_T_FORMAT " to %" VISUAL_SIZE_T_FORMAT + " bytes): %s", + priv->sharedfile, (void *)priv->mmap_area, + sizeof(mplayer_data_t), + sizeof(mplayer_data_t) + priv->mmap_area->bs, strerror(errno)); + return FALSE; + } + priv->prev_count = ULLONG_MAX; + + priv->loaded = TRUE; + + return TRUE; } -static void inp_mplayer_cleanup( VisPluginData *plugin ) -{ - mplayer_priv_t *priv = visual_plugin_get_private (plugin); - - if ( priv->loaded == 1 ) - { - void *mmap_area = (void*)priv->mmap_area; - int mmap_count = priv->mmap_area->bs + sizeof( mplayer_data_t ); - - if ( priv->fd > 0 ) - { - if ( close( priv->fd ) != 0 ) - { - visual_log( VISUAL_LOG_CRITICAL, - "Could not close file descriptor %d: %s", - priv->fd, strerror( errno ) ); - } - priv->fd = -1; - } - else - { - visual_log( VISUAL_LOG_CRITICAL, "Wrong file descriptor %d", - priv->fd ); - } - - if ( munmap( mmap_area, mmap_count ) != 0 ) - { - visual_log( VISUAL_LOG_CRITICAL, - "Could not munmap() area %p+%d. %s", - mmap_area, mmap_count, - strerror( errno ) ); - } - } - - visual_mem_free( priv->sharedfile ); - visual_mem_free( priv ); +static void inp_mplayer_cleanup(VisPluginData *plugin) { + mplayer_priv_t *priv = visual_plugin_get_private(plugin); + + if (priv->loaded == 1) { + void *mmap_area = (void *)priv->mmap_area; + int mmap_count = priv->mmap_area->bs + sizeof(mplayer_data_t); + + if (priv->fd > 0) { + if (close(priv->fd) != 0) { + visual_log(VISUAL_LOG_CRITICAL, + "Could not close file descriptor %d: %s", priv->fd, + strerror(errno)); + } + priv->fd = -1; + } else { + visual_log(VISUAL_LOG_CRITICAL, "Wrong file descriptor %d", priv->fd); + } + + if (munmap(mmap_area, mmap_count) != 0) { + visual_log(VISUAL_LOG_CRITICAL, "Could not munmap() area %p+%d. %s", + mmap_area, mmap_count, strerror(errno)); + } + } + + visual_mem_free(priv->sharedfile); + visual_mem_free(priv); } -static int inp_mplayer_upload( VisPluginData *plugin, VisAudio *audio ) -{ - mplayer_priv_t *priv = visual_plugin_get_private (plugin); +static int inp_mplayer_upload(VisPluginData *plugin, VisAudio *audio) { + mplayer_priv_t *priv = visual_plugin_get_private(plugin); - // NOTE: This avoids accounting for the same samples multiple times - if (priv->mmap_area->count == priv->prev_count) { - return 0; - } - priv->prev_count = priv->mmap_area->count; + // NOTE: This avoids accounting for the same samples multiple times + if (priv->mmap_area->count == priv->prev_count) { + return 0; + } + priv->prev_count = priv->mmap_area->count; - VisBuffer *buffer = visual_buffer_new_wrap_data ( (uint8_t *)priv->mmap_area + sizeof( mplayer_data_t ), 2048, FALSE ); - visual_audio_input (audio, buffer, - VISUAL_AUDIO_SAMPLE_RATE_44100, - VISUAL_AUDIO_SAMPLE_FORMAT_S16, - VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); - visual_buffer_unref (buffer); + VisBuffer *buffer = visual_buffer_new_wrap_data( + (uint8_t *)priv->mmap_area + sizeof(mplayer_data_t), 2048, FALSE); + visual_audio_input(audio, buffer, VISUAL_AUDIO_SAMPLE_RATE_44100, + VISUAL_AUDIO_SAMPLE_FORMAT_S16, + VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); + visual_buffer_unref(buffer); - return TRUE; + return TRUE; } diff --git a/libvisual-plugins/plugins/input/portaudio/input_portaudio.c b/libvisual-plugins/plugins/input/portaudio/input_portaudio.c index 56f3f1b44..e4e557d46 100644 --- a/libvisual-plugins/plugins/input/portaudio/input_portaudio.c +++ b/libvisual-plugins/plugins/input/portaudio/input_portaudio.c @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include // malloc +#include // malloc #include #include "gettext.h" @@ -38,134 +38,134 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #define FRAMES 1024 typedef struct { - PaStream *stream; - void * buffer; + PaStream *stream; + void *buffer; } PortAudioPrivate; -static int inp_portaudio_init (VisPluginData *plugin); -static void inp_portaudio_cleanup (VisPluginData *plugin); -static int inp_portaudio_upload (VisPluginData *plugin, VisAudio *audio); +static int inp_portaudio_init(VisPluginData *plugin); +static void inp_portaudio_cleanup(VisPluginData *plugin); +static int inp_portaudio_upload(VisPluginData *plugin, VisAudio *audio); -const VisPluginInfo *get_plugin_info (void) -{ - static VisInputPlugin input = { - .upload = inp_portaudio_upload - }; +const VisPluginInfo *get_plugin_info(void) { + static VisInputPlugin input = {.upload = inp_portaudio_upload}; - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_INPUT, + static VisPluginInfo info = {.type = VISUAL_PLUGIN_TYPE_INPUT, - .plugname = "portaudio", - .name = "portaudio", - .author = "Sebastian Pipping ", - .version = "1.0", - .about = N_("PortAudio capture plugin"), - .help = N_("Use this plugin to capture PCM data from the PortAudio record device"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, + .plugname = "portaudio", + .name = "portaudio", + .author = + "Sebastian Pipping ", + .version = "1.0", + .about = N_("PortAudio capture plugin"), + .help = N_("Use this plugin to capture PCM data " + "from the PortAudio record device"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, - .init = inp_portaudio_init, - .cleanup = inp_portaudio_cleanup, + .init = inp_portaudio_init, + .cleanup = inp_portaudio_cleanup, - .plugin = &input - }; + .plugin = &input}; - return &info; + return &info; } -int inp_portaudio_init (VisPluginData *plugin) -{ +int inp_portaudio_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); #endif - PortAudioPrivate * const priv = visual_mem_new0 (PortAudioPrivate, 1); - visual_return_val_if_fail (priv != NULL, FALSE); - visual_plugin_set_private (plugin, priv); - - // Init PortAudio - const PaError init_error = Pa_Initialize(); - visual_return_val_if_fail (init_error == paNoError, FALSE); - - // Select input device - const PaDeviceIndex input_device = Pa_GetDefaultInputDevice (); - visual_return_val_if_fail (input_device != paNoDevice, FALSE); - - // Open stream - const double latency_seconds = 1.0 / SAMPLE_RATE * FRAMES; - const PaStreamParameters input_parameters = { - .device = input_device, - .channelCount = CHANNELS, - .sampleFormat = SAMPLE_FORMAT_PA, - .suggestedLatency = latency_seconds, - .hostApiSpecificStreamInfo = NULL}; - const PaError open_error = - Pa_OpenStream (&priv->stream, &input_parameters, NULL, - SAMPLE_RATE, FRAMES, paClipOff, NULL, NULL); - visual_return_val_if_fail (open_error == paNoError, FALSE); - - // Allocate buffer - const visual_size_t buffer_size_bytes = FRAMES * CHANNELS * (SAMPLE_FORMAT_BITS / 8); - priv->buffer = malloc (buffer_size_bytes); - visual_return_val_if_fail (priv->buffer != NULL, FALSE); - - // Start stream - const PaError input_start_error = Pa_StartStream (priv->stream); - visual_return_val_if_fail (input_start_error == paNoError, FALSE); - - return TRUE; + PortAudioPrivate *const priv = visual_mem_new0(PortAudioPrivate, 1); + visual_return_val_if_fail(priv != NULL, FALSE); + visual_plugin_set_private(plugin, priv); + + // Init PortAudio + const PaError init_error = Pa_Initialize(); + visual_return_val_if_fail(init_error == paNoError, FALSE); + + // Select input device + const PaDeviceIndex input_device = Pa_GetDefaultInputDevice(); + visual_return_val_if_fail(input_device != paNoDevice, FALSE); + + // Open stream + const double latency_seconds = 1.0 / SAMPLE_RATE * FRAMES; + const PaStreamParameters input_parameters = { + .device = input_device, + .channelCount = CHANNELS, + .sampleFormat = SAMPLE_FORMAT_PA, + .suggestedLatency = latency_seconds, + .hostApiSpecificStreamInfo = NULL}; + const PaError open_error = + Pa_OpenStream(&priv->stream, &input_parameters, NULL, SAMPLE_RATE, FRAMES, + paClipOff, NULL, NULL); + visual_return_val_if_fail(open_error == paNoError, FALSE); + + // Allocate buffer + const visual_size_t buffer_size_bytes = + FRAMES * CHANNELS * (SAMPLE_FORMAT_BITS / 8); + priv->buffer = malloc(buffer_size_bytes); + visual_return_val_if_fail(priv->buffer != NULL, FALSE); + + // Start stream + const PaError input_start_error = Pa_StartStream(priv->stream); + visual_return_val_if_fail(input_start_error == paNoError, FALSE); + + return TRUE; } -void inp_portaudio_cleanup (VisPluginData *plugin) -{ - visual_return_if_fail (plugin != NULL); +void inp_portaudio_cleanup(VisPluginData *plugin) { + visual_return_if_fail(plugin != NULL); - PortAudioPrivate * const priv = visual_plugin_get_private (plugin); - visual_return_if_fail (priv != NULL); + PortAudioPrivate *const priv = visual_plugin_get_private(plugin); + visual_return_if_fail(priv != NULL); - free (priv->buffer); - priv->buffer = NULL; + free(priv->buffer); + priv->buffer = NULL; - Pa_StopStream (priv->stream); - Pa_CloseStream (priv->stream); - priv->stream = NULL; + Pa_StopStream(priv->stream); + Pa_CloseStream(priv->stream); + priv->stream = NULL; - Pa_Terminate (); + Pa_Terminate(); - visual_mem_free (priv); + visual_mem_free(priv); } -int inp_portaudio_upload (VisPluginData *plugin, VisAudio *audio) -{ - visual_return_val_if_fail (plugin != NULL, FALSE); - visual_return_val_if_fail (audio != NULL, FALSE); +int inp_portaudio_upload(VisPluginData *plugin, VisAudio *audio) { + visual_return_val_if_fail(plugin != NULL, FALSE); + visual_return_val_if_fail(audio != NULL, FALSE); - PortAudioPrivate * const priv = visual_plugin_get_private (plugin); - visual_return_val_if_fail (priv != NULL, FALSE); - visual_return_val_if_fail (priv->stream != NULL, FALSE); + PortAudioPrivate *const priv = visual_plugin_get_private(plugin); + visual_return_val_if_fail(priv != NULL, FALSE); + visual_return_val_if_fail(priv->stream != NULL, FALSE); - for (;;) { - long frames_to_read = Pa_GetStreamReadAvailable (priv->stream); - if (frames_to_read < 1) { - return TRUE; - } - if (frames_to_read > FRAMES) { - frames_to_read = FRAMES; // because that's all that priv->buffer has space for - } + for (;;) { + long frames_to_read = Pa_GetStreamReadAvailable(priv->stream); + if (frames_to_read < 1) { + return TRUE; + } + if (frames_to_read > FRAMES) { + frames_to_read = + FRAMES; // because that's all that priv->buffer has space for + } - const PaError read_error = Pa_ReadStream(priv->stream, priv->buffer, frames_to_read); - if (read_error != paNoError) { - return TRUE; - } + const PaError read_error = + Pa_ReadStream(priv->stream, priv->buffer, frames_to_read); + if (read_error != paNoError) { + return TRUE; + } - const visual_size_t bytes_to_write = frames_to_read * CHANNELS * (SAMPLE_FORMAT_BITS / 8); + const visual_size_t bytes_to_write = + frames_to_read * CHANNELS * (SAMPLE_FORMAT_BITS / 8); - VisBuffer * const buffer = visual_buffer_new_wrap_data (priv->buffer, bytes_to_write, FALSE); - visual_return_val_if_fail (priv != NULL, FALSE); + VisBuffer *const buffer = + visual_buffer_new_wrap_data(priv->buffer, bytes_to_write, FALSE); + visual_return_val_if_fail(priv != NULL, FALSE); - visual_audio_input(audio, buffer, SAMPLE_RATE_TYPE_LV, SAMPLE_FORMAT_LV, CHANNELS_TYPE); + visual_audio_input(audio, buffer, SAMPLE_RATE_TYPE_LV, SAMPLE_FORMAT_LV, + CHANNELS_TYPE); - visual_buffer_unref (buffer); - } + visual_buffer_unref(buffer); + } - // we never get here + // we never get here } diff --git a/libvisual-plugins/plugins/input/pulseaudio/input_pulseaudio.c b/libvisual-plugins/plugins/input/pulseaudio/input_pulseaudio.c index 4d704a564..2cbebb8c7 100644 --- a/libvisual-plugins/plugins/input/pulseaudio/input_pulseaudio.c +++ b/libvisual-plugins/plugins/input/pulseaudio/input_pulseaudio.c @@ -33,197 +33,197 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #define FRAMES 512 #define CHUNK_SIZE_BYTES (FRAMES * CHANNELS * sizeof(SAMPLE_TYPE)) -#define CHUNKS (2 * SAMPLE_RATE / FRAMES + 1) // i.e. 2+ seconds of audio +#define CHUNKS (2 * SAMPLE_RATE / FRAMES + 1) // i.e. 2+ seconds of audio pa_sample_spec sample_spec = { - .format = SAMPLE_FORMAT_PA, - .rate = SAMPLE_RATE, - .channels = CHANNELS -}; + .format = SAMPLE_FORMAT_PA, .rate = SAMPLE_RATE, .channels = CHANNELS}; typedef struct { - pa_threaded_mainloop * mainloop; - pa_context * context; - pa_stream * input_stream; - - SAMPLE_TYPE pcm_data[CHUNKS][FRAMES * CHANNELS]; // ringbuffer of chunks - atomic_uint_fast64_t chunks_written; - uint64_t chunk_write_offset_bytes; - uint64_t chunks_read; + pa_threaded_mainloop *mainloop; + pa_context *context; + pa_stream *input_stream; + + SAMPLE_TYPE pcm_data[CHUNKS][FRAMES * CHANNELS]; // ringbuffer of chunks + atomic_uint_fast64_t chunks_written; + uint64_t chunk_write_offset_bytes; + uint64_t chunks_read; } pulseaudio_priv_t; -static int inp_pulseaudio_init (VisPluginData *plugin); -static void inp_pulseaudio_cleanup (VisPluginData *plugin); -static int inp_pulseaudio_upload (VisPluginData *plugin, VisAudio *audio); -static void on_input_stream_data (pa_stream *p, size_t nbytes, void *userdata); - -const VisPluginInfo *get_plugin_info( void ) { - static VisInputPlugin input = { - .upload = inp_pulseaudio_upload - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_INPUT, - - .plugname = "pulseaudio", - .name = "Pulseaudio input plugin", - .author = "Scott Sibley " - ", " - "Sebastian Pipping ", - .version = "2.0", - .about = "Use input data from pulseaudio", - .help = "", - .license = VISUAL_PLUGIN_LICENSE_GPL, // v3 or later, see header - - .init = inp_pulseaudio_init, - .cleanup = inp_pulseaudio_cleanup, - .plugin = &input - }; - - return &info; -} - -static int inp_pulseaudio_init( VisPluginData *plugin ) { - pulseaudio_priv_t *priv = visual_mem_new0(pulseaudio_priv_t, 1); - visual_plugin_set_private(plugin, priv); - - priv->mainloop = pa_threaded_mainloop_new(); - visual_return_val_if_fail(priv->mainloop != NULL, FALSE); - - pa_mainloop_api *const mainloop_api = pa_threaded_mainloop_get_api(priv->mainloop); - visual_return_val_if_fail(mainloop_api != NULL, FALSE); - - priv->context = pa_context_new(mainloop_api, "lv-pulseaudio"); - visual_return_val_if_fail(priv->context != NULL, FALSE); - - const int connect_res = - pa_context_connect(priv->context, NULL, PA_CONTEXT_NOFLAGS, NULL); - visual_return_val_if_fail(connect_res == 0, FALSE); - - // NOTE: Starting the main loop prior to pa_context_connect would get us into - // this situation: - // Assertion 'c->callback' failed at - // ../pulseaudio-16.1/src/pulsecore/socket-client.c:126, function - // do_call(). Aborting. - // https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/991 - const int mainloop_start_ret = pa_threaded_mainloop_start(priv->mainloop); - visual_return_val_if_fail(mainloop_start_ret == 0, FALSE); - while (pa_context_get_state(priv->context) < PA_CONTEXT_READY) { - visual_usleep(1000); - } +static int inp_pulseaudio_init(VisPluginData *plugin); +static void inp_pulseaudio_cleanup(VisPluginData *plugin); +static int inp_pulseaudio_upload(VisPluginData *plugin, VisAudio *audio); +static void on_input_stream_data(pa_stream *p, size_t nbytes, void *userdata); - priv->input_stream = pa_stream_new(priv->context, "Recording", &sample_spec, NULL); - visual_return_val_if_fail(priv->input_stream != NULL, FALSE); - pa_stream_set_read_callback(priv->input_stream, on_input_stream_data, priv); +const VisPluginInfo *get_plugin_info(void) { + static VisInputPlugin input = {.upload = inp_pulseaudio_upload}; - const pa_buffer_attr input_buffer_attr = { - .fragsize = CHUNK_SIZE_BYTES, - .maxlength = CHUNK_SIZE_BYTES, - }; - const int input_connect_res = pa_stream_connect_record( - priv->input_stream, NULL, &input_buffer_attr, PA_STREAM_ADJUST_LATENCY); - visual_return_val_if_fail(input_connect_res == 0, FALSE); + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_INPUT, - return TRUE; -} + .plugname = "pulseaudio", + .name = "Pulseaudio input plugin", + .author = "Scott Sibley " + ", " + "Sebastian Pipping ", + .version = "2.0", + .about = "Use input data from pulseaudio", + .help = "", + .license = VISUAL_PLUGIN_LICENSE_GPL, // v3 or later, see header -static void inp_pulseaudio_cleanup( VisPluginData *plugin ) -{ - pulseaudio_priv_t *priv = visual_plugin_get_private(plugin); - visual_return_if_fail(priv != NULL); + .init = inp_pulseaudio_init, + .cleanup = inp_pulseaudio_cleanup, + .plugin = &input}; - pa_stream_disconnect(priv->input_stream); - pa_stream_unref(priv->input_stream); - pa_context_disconnect(priv->context); - pa_context_unref(priv->context); - pa_threaded_mainloop_stop(priv->mainloop); - pa_threaded_mainloop_free(priv->mainloop); + return &info; +} - visual_mem_free (priv); +static int inp_pulseaudio_init(VisPluginData *plugin) { + pulseaudio_priv_t *priv = visual_mem_new0(pulseaudio_priv_t, 1); + visual_plugin_set_private(plugin, priv); + + priv->mainloop = pa_threaded_mainloop_new(); + visual_return_val_if_fail(priv->mainloop != NULL, FALSE); + + pa_mainloop_api *const mainloop_api = + pa_threaded_mainloop_get_api(priv->mainloop); + visual_return_val_if_fail(mainloop_api != NULL, FALSE); + + priv->context = pa_context_new(mainloop_api, "lv-pulseaudio"); + visual_return_val_if_fail(priv->context != NULL, FALSE); + + const int connect_res = + pa_context_connect(priv->context, NULL, PA_CONTEXT_NOFLAGS, NULL); + visual_return_val_if_fail(connect_res == 0, FALSE); + + // NOTE: Starting the main loop prior to pa_context_connect would get us into + // this situation: + // Assertion 'c->callback' failed at + // ../pulseaudio-16.1/src/pulsecore/socket-client.c:126, function + // do_call(). Aborting. + // https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/991 + const int mainloop_start_ret = pa_threaded_mainloop_start(priv->mainloop); + visual_return_val_if_fail(mainloop_start_ret == 0, FALSE); + while (pa_context_get_state(priv->context) < PA_CONTEXT_READY) { + visual_usleep(1000); + } + + priv->input_stream = + pa_stream_new(priv->context, "Recording", &sample_spec, NULL); + visual_return_val_if_fail(priv->input_stream != NULL, FALSE); + pa_stream_set_read_callback(priv->input_stream, on_input_stream_data, priv); + + const pa_buffer_attr input_buffer_attr = { + .fragsize = CHUNK_SIZE_BYTES, + .maxlength = CHUNK_SIZE_BYTES, + }; + const int input_connect_res = pa_stream_connect_record( + priv->input_stream, NULL, &input_buffer_attr, PA_STREAM_ADJUST_LATENCY); + visual_return_val_if_fail(input_connect_res == 0, FALSE); + + return TRUE; } -static int inp_pulseaudio_upload( VisPluginData *plugin, VisAudio *audio ) -{ - pulseaudio_priv_t *priv = visual_plugin_get_private(plugin); - visual_return_val_if_fail(priv != NULL, FALSE); +static void inp_pulseaudio_cleanup(VisPluginData *plugin) { + pulseaudio_priv_t *priv = visual_plugin_get_private(plugin); + visual_return_if_fail(priv != NULL); - // `priv->chunks_written` is monotonically increasing in another thread in parallel, - // so we make a snapshot to work with a single consistent value below. - // Also, plain reads to 64bit are not atomic on 32bit platforms, so we add protection. - // This is attomic `priv->chunks_written = frozen_chunks_written`. - uint64_t frozen_chunks_written = atomic_load_explicit(&priv->chunks_written, memory_order_acquire); + pa_stream_disconnect(priv->input_stream); + pa_stream_unref(priv->input_stream); + pa_context_disconnect(priv->context); + pa_context_unref(priv->context); + pa_threaded_mainloop_stop(priv->mainloop); + pa_threaded_mainloop_free(priv->mainloop); - assert(priv->chunks_read <= frozen_chunks_written); - if (priv->chunks_read == frozen_chunks_written) { - return TRUE; - } + visual_mem_free(priv); +} - // The writing head keeps moving "in parallel" in another thread - // and without locking. So if the reader get too far behind, the writer - // overtakes the reader, in theory. It is not likely to happen because - // (1) the reader drains all available bytes at once, (2) the buffer - // is large enough to protect against temporary jittering, and (3) - // because `.upload` is guaranteed to be called at least at rendering - // FPS frequency. - const uint64_t tolerable_behind_by = CHUNKS / 2; - uint64_t behind_by = frozen_chunks_written - priv->chunks_read; - if (behind_by > tolerable_behind_by) { - priv->chunks_read = frozen_chunks_written - tolerable_behind_by; - behind_by = tolerable_behind_by; - } - const uint64_t target_chunks_read = priv->chunks_read + behind_by; - - while (priv->chunks_read < target_chunks_read) { - void *const data = priv->pcm_data[priv->chunks_read % CHUNKS]; - VisBuffer * const visbuffer = visual_buffer_new_wrap_data (data, CHUNK_SIZE_BYTES, FALSE); - visual_return_val_if_fail(visbuffer != NULL, FALSE); - visual_audio_input(audio, visbuffer, SAMPLE_RATE_TYPE_LV, - SAMPLE_FORMAT_LV, CHANNELS_TYPE_LV); - priv->chunks_read++; - visual_buffer_unref(visbuffer); - } +static int inp_pulseaudio_upload(VisPluginData *plugin, VisAudio *audio) { + pulseaudio_priv_t *priv = visual_plugin_get_private(plugin); + visual_return_val_if_fail(priv != NULL, FALSE); + // `priv->chunks_written` is monotonically increasing in another thread in + // parallel, so we make a snapshot to work with a single consistent value + // below. Also, plain reads to 64bit are not atomic on 32bit platforms, so we + // add protection. This is attomic `priv->chunks_written = + // frozen_chunks_written`. + uint64_t frozen_chunks_written = + atomic_load_explicit(&priv->chunks_written, memory_order_acquire); + + assert(priv->chunks_read <= frozen_chunks_written); + if (priv->chunks_read == frozen_chunks_written) { return TRUE; + } + + // The writing head keeps moving "in parallel" in another thread + // and without locking. So if the reader get too far behind, the writer + // overtakes the reader, in theory. It is not likely to happen because + // (1) the reader drains all available bytes at once, (2) the buffer + // is large enough to protect against temporary jittering, and (3) + // because `.upload` is guaranteed to be called at least at rendering + // FPS frequency. + const uint64_t tolerable_behind_by = CHUNKS / 2; + uint64_t behind_by = frozen_chunks_written - priv->chunks_read; + if (behind_by > tolerable_behind_by) { + priv->chunks_read = frozen_chunks_written - tolerable_behind_by; + behind_by = tolerable_behind_by; + } + const uint64_t target_chunks_read = priv->chunks_read + behind_by; + + while (priv->chunks_read < target_chunks_read) { + void *const data = priv->pcm_data[priv->chunks_read % CHUNKS]; + VisBuffer *const visbuffer = + visual_buffer_new_wrap_data(data, CHUNK_SIZE_BYTES, FALSE); + visual_return_val_if_fail(visbuffer != NULL, FALSE); + visual_audio_input(audio, visbuffer, SAMPLE_RATE_TYPE_LV, SAMPLE_FORMAT_LV, + CHANNELS_TYPE_LV); + priv->chunks_read++; + visual_buffer_unref(visbuffer); + } + + return TRUE; } static void on_input_stream_data(pa_stream *p, size_t nbytes, void *userdata) { - pulseaudio_priv_t * const priv = (pulseaudio_priv_t *)userdata; - visual_return_if_fail(priv != NULL); - - const void *source = NULL; - const int peek_res = pa_stream_peek(p, &source, &nbytes); - visual_return_if_fail(peek_res == 0); - visual_return_if_fail(source != 0); - - const int drop_res = pa_stream_drop(p); - visual_return_if_fail(drop_res == 0); - - // Copy all readable bytes from `source` to the right place in `priv->pcm_data`. - while (nbytes > 0) { - void *const target = (void *)priv->pcm_data[priv->chunks_written % CHUNKS] + priv->chunk_write_offset_bytes; - size_t round_nbytes = nbytes; - - // Would a full write overflow the current chunk? - if (priv->chunk_write_offset_bytes + round_nbytes > CHUNK_SIZE_BYTES) { - // Cut down to fit the chunk - round_nbytes = CHUNK_SIZE_BYTES - priv->chunk_write_offset_bytes; - } - - visual_mem_copy(target, source, round_nbytes); - - // Figure out write offset location for the next round - if (priv->chunk_write_offset_bytes + round_nbytes < CHUNK_SIZE_BYTES) { - // Same chunk but further behind - priv->chunk_write_offset_bytes += round_nbytes; - } else { - // Start of the next chunk - priv->chunk_write_offset_bytes = 0; - - // This is atomic `priv->chunks_written++` - uint64_t new_chunks_written = priv->chunks_written + 1; - atomic_store_explicit(&priv->chunks_written, new_chunks_written, memory_order_release); - } - - nbytes -= round_nbytes; + pulseaudio_priv_t *const priv = (pulseaudio_priv_t *)userdata; + visual_return_if_fail(priv != NULL); + + const void *source = NULL; + const int peek_res = pa_stream_peek(p, &source, &nbytes); + visual_return_if_fail(peek_res == 0); + visual_return_if_fail(source != 0); + + const int drop_res = pa_stream_drop(p); + visual_return_if_fail(drop_res == 0); + + // Copy all readable bytes from `source` to the right place in + // `priv->pcm_data`. + while (nbytes > 0) { + void *const target = (void *)priv->pcm_data[priv->chunks_written % CHUNKS] + + priv->chunk_write_offset_bytes; + size_t round_nbytes = nbytes; + + // Would a full write overflow the current chunk? + if (priv->chunk_write_offset_bytes + round_nbytes > CHUNK_SIZE_BYTES) { + // Cut down to fit the chunk + round_nbytes = CHUNK_SIZE_BYTES - priv->chunk_write_offset_bytes; + } + + visual_mem_copy(target, source, round_nbytes); + + // Figure out write offset location for the next round + if (priv->chunk_write_offset_bytes + round_nbytes < CHUNK_SIZE_BYTES) { + // Same chunk but further behind + priv->chunk_write_offset_bytes += round_nbytes; + } else { + // Start of the next chunk + priv->chunk_write_offset_bytes = 0; + + // This is atomic `priv->chunks_written++` + uint64_t new_chunks_written = priv->chunks_written + 1; + atomic_store_explicit(&priv->chunks_written, new_chunks_written, + memory_order_release); } + + nbytes -= round_nbytes; + } } diff --git a/libvisual-plugins/plugins/input/wavein/input_wavein.cpp b/libvisual-plugins/plugins/input/wavein/input_wavein.cpp index aa44904cc..961c49dfd 100644 --- a/libvisual-plugins/plugins/input/wavein/input_wavein.cpp +++ b/libvisual-plugins/plugins/input/wavein/input_wavein.cpp @@ -28,298 +28,300 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR #define PCM_BUFFER_SIZE 1024 struct WaveInPrivate { - HWAVEIN device_handle; - bool loaded; + HWAVEIN device_handle; + bool loaded; - WAVEHDR buffer_header; - int16_t buffers[2][PCM_BUFFER_SIZE]; + WAVEHDR buffer_header; + int16_t buffers[2][PCM_BUFFER_SIZE]; - bool buffer_ready[2]; - int active_buffer; - HANDLE mutex; + bool buffer_ready[2]; + int active_buffer; + HANDLE mutex; }; namespace { - int inp_wavein_init (VisPluginData *plugin); - void inp_wavein_cleanup (VisPluginData *plugin); - int inp_wavein_events (VisPluginData *plugin, VisEventQueue* events); - int inp_wavein_upload (VisPluginData *plugin, VisAudio* audio); +int inp_wavein_init(VisPluginData *plugin); +void inp_wavein_cleanup(VisPluginData *plugin); +int inp_wavein_events(VisPluginData *plugin, VisEventQueue *events); +int inp_wavein_upload(VisPluginData *plugin, VisAudio *audio); } // anonymous namespace -VisPluginInfo const* get_plugin_info () -{ - static VisInputPlugin input = { - inp_wavein_upload - }; - - static VisPluginInfo info = { - { 0 }, - VISUAL_PLUGIN_TYPE_INPUT, - - "wavein", - "Wave/In input", - "Chong Kai Xiong ", - "0.1", - N_("Wave/In capture plugin"), - N_("Use this plugin to capture PCM data on Windows through the Wave/In API"), - VISUAL_PLUGIN_LICENSE_LGPL, - - inp_wavein_init, - inp_wavein_cleanup, - inp_wavein_events, - - 0, - &input - }; - - return &info; +VisPluginInfo const *get_plugin_info() { + static VisInputPlugin input = {inp_wavein_upload}; + + static VisPluginInfo info = {{0}, + VISUAL_PLUGIN_TYPE_INPUT, + + "wavein", + "Wave/In input", + "Chong Kai Xiong ", + "0.1", + N_("Wave/In capture plugin"), + N_("Use this plugin to capture PCM data on " + "Windows through the Wave/In API"), + VISUAL_PLUGIN_LICENSE_LGPL, + + inp_wavein_init, + inp_wavein_cleanup, + inp_wavein_events, + + 0, + &input}; + + return &info; } namespace { - void log_wavein_error (std::string const& message, MMRESULT error) - { - char error_text[MAXERRORLENGTH]; - waveInGetErrorText (error, error_text, MAXERRORLENGTH); +void log_wavein_error(std::string const &message, MMRESULT error) { + char error_text[MAXERRORLENGTH]; + waveInGetErrorText(error, error_text, MAXERRORLENGTH); - visual_log (VISUAL_LOG_ERROR, "%s: %s", message.c_str (), error_text); - } + visual_log(VISUAL_LOG_ERROR, "%s: %s", message.c_str(), error_text); +} - void prepare_buffer (WaveInPrivate* priv, unsigned int buffer_id) - { - priv->buffer_ready[buffer_id] = false; +void prepare_buffer(WaveInPrivate *priv, unsigned int buffer_id) { + priv->buffer_ready[buffer_id] = false; - priv->buffer_header.lpData = reinterpret_cast (priv->buffers[buffer_id]); - priv->buffer_header.dwBufferLength = PCM_BUFFER_SIZE * sizeof (int16_t); + priv->buffer_header.lpData = + reinterpret_cast(priv->buffers[buffer_id]); + priv->buffer_header.dwBufferLength = PCM_BUFFER_SIZE * sizeof(int16_t); - waveInPrepareHeader (priv->device_handle, &priv->buffer_header, sizeof (WAVEHDR)); - waveInAddBuffer (priv->device_handle, &priv->buffer_header, sizeof (WAVEHDR)); - } + waveInPrepareHeader(priv->device_handle, &priv->buffer_header, + sizeof(WAVEHDR)); + waveInAddBuffer(priv->device_handle, &priv->buffer_header, sizeof(WAVEHDR)); +} - void CALLBACK handle_wavein_message (HWAVEIN device, UINT msg, DWORD_PTR instance, DWORD_PTR param1, DWORD_PTR param2) - { - DWORD thread_id = DWORD (instance); +void CALLBACK handle_wavein_message(HWAVEIN device, UINT msg, + DWORD_PTR instance, DWORD_PTR param1, + DWORD_PTR param2) { + DWORD thread_id = DWORD(instance); - // Forward the message to our processing thread - PostThreadMessage (thread_id, msg, WPARAM (device), LPARAM (param1)); - } - - DWORD WINAPI process_buffers (LPVOID param) - { - WaveInPrivate* priv = reinterpret_cast (param); + // Forward the message to our processing thread + PostThreadMessage(thread_id, msg, WPARAM(device), LPARAM(param1)); +} - MSG message; +DWORD WINAPI process_buffers(LPVOID param) { + WaveInPrivate *priv = reinterpret_cast(param); - while (true) { - if (PeekMessage (&message, HWND (-1), 0, 0, PM_REMOVE)) { - switch (message.message) { - case WIM_OPEN: - // Nothing to do - break; + MSG message; - case WIM_CLOSE: - // Exit if device is closed. We use return instead of ExitThread() so - // that C++ destructors can run - return 0; + while (true) { + if (PeekMessage(&message, HWND(-1), 0, 0, PM_REMOVE)) { + switch (message.message) { + case WIM_OPEN: + // Nothing to do + break; - case WIM_DATA: - WaitForSingleObject (priv->mutex, INFINITE); + case WIM_CLOSE: + // Exit if device is closed. We use return instead of ExitThread() so + // that C++ destructors can run + return 0; - waveInUnprepareHeader (priv->device_handle, &priv->buffer_header, sizeof (WAVEHDR)); - priv->buffer_ready[priv->active_buffer] = true; + case WIM_DATA: + WaitForSingleObject(priv->mutex, INFINITE); - priv->active_buffer ^= 0x1; - prepare_buffer (priv, priv->active_buffer); + waveInUnprepareHeader(priv->device_handle, &priv->buffer_header, + sizeof(WAVEHDR)); + priv->buffer_ready[priv->active_buffer] = true; - ReleaseMutex (priv->mutex); + priv->active_buffer ^= 0x1; + prepare_buffer(priv, priv->active_buffer); - break; - } - } + ReleaseMutex(priv->mutex); - SwitchToThread (); + break; } + } + + SwitchToThread(); } +} - bool check_available_devices () - { - visual_log (VISUAL_LOG_DEBUG, "Checking the number of input devices available"); +bool check_available_devices() { + visual_log(VISUAL_LOG_DEBUG, + "Checking the number of input devices available"); - UINT num_devices = waveInGetNumDevs (); - if (num_devices == 0) { - return false; - } - - WAVEINCAPS device_caps; + UINT num_devices = waveInGetNumDevs(); + if (num_devices == 0) { + return false; + } - for (unsigned int device_id = 0; device_id < num_devices; device_id++) { - visual_log (VISUAL_LOG_DEBUG, "Querying device #%u", device_id); + WAVEINCAPS device_caps; - MMRESULT result = waveInGetDevCaps (UINT_PTR (device_id), &device_caps, sizeof (WAVEINCAPS)); - if (result != MMSYSERR_NOERROR) { - log_wavein_error ("Failed to query device capabilities", result); - continue; - } + for (unsigned int device_id = 0; device_id < num_devices; device_id++) { + visual_log(VISUAL_LOG_DEBUG, "Querying device #%u", device_id); - visual_log (VISUAL_LOG_DEBUG, "Name: %s", device_caps.szPname); - visual_log (VISUAL_LOG_DEBUG, "Supported format flags: 0x%08x", (unsigned int) device_caps.dwFormats); - visual_log (VISUAL_LOG_DEBUG, "Number of channels: %d", device_caps.wChannels); - } + MMRESULT result = + waveInGetDevCaps(UINT_PTR(device_id), &device_caps, sizeof(WAVEINCAPS)); + if (result != MMSYSERR_NOERROR) { + log_wavein_error("Failed to query device capabilities", result); + continue; + } - return true; + visual_log(VISUAL_LOG_DEBUG, "Name: %s", device_caps.szPname); + visual_log(VISUAL_LOG_DEBUG, "Supported format flags: 0x%08x", + (unsigned int)device_caps.dwFormats); + visual_log(VISUAL_LOG_DEBUG, "Number of channels: %d", + device_caps.wChannels); } - int inp_wavein_init (VisPluginData* plugin) - { + return true; +} + +int inp_wavein_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - if (!check_available_devices ()) { - visual_log (VISUAL_LOG_ERROR, "No input device can be found!"); - return FALSE; - } - - auto priv = visual_mem_new0 (WaveInPrivate, 1); - visual_plugin_set_private (plugin, priv); + if (!check_available_devices()) { + visual_log(VISUAL_LOG_ERROR, "No input device can be found!"); + return FALSE; + } - visual_log (VISUAL_LOG_DEBUG, "Querying audio formats supported by input device"); + auto priv = visual_mem_new0(WaveInPrivate, 1); + visual_plugin_set_private(plugin, priv); - WAVEFORMATEX format = { - WAVE_FORMAT_PCM, // Audio format - 2, // Number of channels - 44100, // Samples per second - 44100*2*2, // Bytes per second (samples per second * block alignment - 2*2, // Block alignment (channels * bits per sample / 8) - 16, // Bits per sample - 0 // Size of extra format information - }; + visual_log(VISUAL_LOG_DEBUG, + "Querying audio formats supported by input device"); - // Check if the input device supports our audio format + WAVEFORMATEX format = { + WAVE_FORMAT_PCM, // Audio format + 2, // Number of channels + 44100, // Samples per second + 44100 * 2 * 2, // Bytes per second (samples per second * block alignment + 2 * 2, // Block alignment (channels * bits per sample / 8) + 16, // Bits per sample + 0 // Size of extra format information + }; - MMRESULT result = waveInOpen (&priv->device_handle, WAVE_MAPPER, &format, 0, 0, WAVE_FORMAT_QUERY); + // Check if the input device supports our audio format - if (result == WAVERR_BADFORMAT) { - log_wavein_error ("Required audio format is not supported by device", result); - return FALSE; - } + MMRESULT result = waveInOpen(&priv->device_handle, WAVE_MAPPER, &format, 0, 0, + WAVE_FORMAT_QUERY); - // Create background processing thread + if (result == WAVERR_BADFORMAT) { + log_wavein_error("Required audio format is not supported by device", + result); + return FALSE; + } - visual_log (VISUAL_LOG_DEBUG, "Creating processing thread"); + // Create background processing thread - DWORD thread_id; - HANDLE thread = CreateThread (0, 0, process_buffers, priv, CREATE_SUSPENDED, &thread_id); + visual_log(VISUAL_LOG_DEBUG, "Creating processing thread"); - // Open the input device + DWORD thread_id; + HANDLE thread = + CreateThread(0, 0, process_buffers, priv, CREATE_SUSPENDED, &thread_id); - visual_log (VISUAL_LOG_DEBUG, "Opening input device"); + // Open the input device - result = waveInOpen (&priv->device_handle, WAVE_MAPPER, &format, DWORD_PTR (&handle_wavein_message), - DWORD_PTR (thread_id), CALLBACK_FUNCTION); + visual_log(VISUAL_LOG_DEBUG, "Opening input device"); - if (result != MMSYSERR_NOERROR) { - // FIXME: Do we need to destroy the thread? - log_wavein_error ("Failed to open capture device", result); - return FALSE; - } + result = waveInOpen(&priv->device_handle, WAVE_MAPPER, &format, + DWORD_PTR(&handle_wavein_message), DWORD_PTR(thread_id), + CALLBACK_FUNCTION); - priv->loaded = true; + if (result != MMSYSERR_NOERROR) { + // FIXME: Do we need to destroy the thread? + log_wavein_error("Failed to open capture device", result); + return FALSE; + } - priv->mutex = CreateMutex (NULL, FALSE, NULL); + priv->loaded = true; - // Initialize buffer statuses + priv->mutex = CreateMutex(NULL, FALSE, NULL); - priv->buffer_ready[0] = false; - priv->buffer_ready[1] = false; + // Initialize buffer statuses - // Register the first buffer with the API for capture + priv->buffer_ready[0] = false; + priv->buffer_ready[1] = false; - priv->active_buffer = 0; - prepare_buffer (priv, priv->active_buffer); + // Register the first buffer with the API for capture - // Start capturing samples + priv->active_buffer = 0; + prepare_buffer(priv, priv->active_buffer); - visual_log (VISUAL_LOG_DEBUG, "Starting audio capture"); + // Start capturing samples - ResumeThread (thread); + visual_log(VISUAL_LOG_DEBUG, "Starting audio capture"); - waveInStart (priv->device_handle); + ResumeThread(thread); - return TRUE; - } + waveInStart(priv->device_handle); - void inp_wavein_cleanup (VisPluginData* plugin) - { - auto priv = static_cast (visual_plugin_get_private (plugin)); + return TRUE; +} - if (priv->loaded) { - visual_log (VISUAL_LOG_DEBUG, "Stopping audio capturing and clearing all pending buffers"); +void inp_wavein_cleanup(VisPluginData *plugin) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - MMRESULT result = waveInReset (priv->device_handle); - if (result != MMSYSERR_NOERROR) { - log_wavein_error ("Failed to clear pending buffers", result); - } + if (priv->loaded) { + visual_log(VISUAL_LOG_DEBUG, + "Stopping audio capturing and clearing all pending buffers"); - visual_log (VISUAL_LOG_DEBUG, "Closing capture device"); + MMRESULT result = waveInReset(priv->device_handle); + if (result != MMSYSERR_NOERROR) { + log_wavein_error("Failed to clear pending buffers", result); + } - result = waveInClose (priv->device_handle); - if (result != MMSYSERR_NOERROR) { - log_wavein_error ("Failed to close capture device", result); - } + visual_log(VISUAL_LOG_DEBUG, "Closing capture device"); - CloseHandle (priv->mutex); - } + result = waveInClose(priv->device_handle); + if (result != MMSYSERR_NOERROR) { + log_wavein_error("Failed to close capture device", result); + } - visual_mem_free (priv); + CloseHandle(priv->mutex); } - int inp_wavein_events (VisPluginData* plugin, VisEventQueue* events) - { - VisEvent ev; + visual_mem_free(priv); +} - while (visual_event_queue_poll (events, &ev)) { - switch (ev.type) { - default:; // discard - } - } +int inp_wavein_events(VisPluginData *plugin, VisEventQueue *events) { + VisEvent ev; - return TRUE; + while (visual_event_queue_poll(events, &ev)) { + switch (ev.type) { + default:; // discard + } } - int inp_wavein_upload (VisPluginData* plugin, VisAudio* audio) - { - auto priv = static_cast (visual_plugin_get_private (plugin)); + return TRUE; +} - int buffer_to_read; +int inp_wavein_upload(VisPluginData *plugin, VisAudio *audio) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - while (true) { - WaitForSingleObject (priv->mutex, INFINITE); + int buffer_to_read; - buffer_to_read = priv->active_buffer ^ 0x1; + while (true) { + WaitForSingleObject(priv->mutex, INFINITE); - if (priv->buffer_ready[buffer_to_read]) { - LV::BufferPtr buffer = LV::Buffer::wrap (priv->buffers[buffer_to_read], PCM_BUFFER_SIZE*2*sizeof(int16_t), false); + buffer_to_read = priv->active_buffer ^ 0x1; - audio->input (buffer, - VISUAL_AUDIO_SAMPLE_RATE_44100, - VISUAL_AUDIO_SAMPLE_FORMAT_S16, - VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); + if (priv->buffer_ready[buffer_to_read]) { + LV::BufferPtr buffer = + LV::Buffer::wrap(priv->buffers[buffer_to_read], + PCM_BUFFER_SIZE * 2 * sizeof(int16_t), false); - priv->buffer_ready[buffer_to_read] = false; + audio->input(buffer, VISUAL_AUDIO_SAMPLE_RATE_44100, + VISUAL_AUDIO_SAMPLE_FORMAT_S16, + VISUAL_AUDIO_SAMPLE_CHANNEL_STEREO); - ReleaseMutex (priv->mutex); + priv->buffer_ready[buffer_to_read] = false; - break; - } + ReleaseMutex(priv->mutex); - ReleaseMutex (priv->mutex); - } + break; + } - return TRUE; + ReleaseMutex(priv->mutex); } -} // anonymous namespace + return TRUE; +} +} // anonymous namespace diff --git a/libvisual-plugins/plugins/morph/alphablend/morph_alphablend.c b/libvisual-plugins/plugins/morph/alphablend/morph_alphablend.c index f32ff26a0..84db5f4cb 100644 --- a/libvisual-plugins/plugins/morph/alphablend/morph_alphablend.c +++ b/libvisual-plugins/plugins/morph/alphablend/morph_alphablend.c @@ -27,86 +27,83 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int lv_morph_alpha_init (VisPluginData *plugin); -static void lv_morph_alpha_cleanup (VisPluginData *plugin); -static void lv_morph_alpha_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2); - -static inline void alpha_blend_buffer (uint8_t *dest, uint8_t *src1, uint8_t *src2, int size, int depth, float alpha); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisMorphPlugin morph = { - .apply = lv_morph_alpha_apply, - .vidoptions.depth = - VISUAL_VIDEO_DEPTH_8BIT | - VISUAL_VIDEO_DEPTH_16BIT | - VISUAL_VIDEO_DEPTH_24BIT | - VISUAL_VIDEO_DEPTH_32BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_MORPH, - - .plugname = "alphablend", - .name = "alphablend morph", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("An alphablend morph plugin"), - .help = N_("This morph plugin morphs between two video sources using the alphablend method"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_morph_alpha_init, - .cleanup = lv_morph_alpha_cleanup, - - .plugin = &morph - }; - - return &info; +static int lv_morph_alpha_init(VisPluginData *plugin); +static void lv_morph_alpha_cleanup(VisPluginData *plugin); +static void lv_morph_alpha_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, + VisVideo *src1, VisVideo *src2); + +static inline void alpha_blend_buffer(uint8_t *dest, uint8_t *src1, + uint8_t *src2, int size, int depth, + float alpha); + +const VisPluginInfo *get_plugin_info(void) { + static VisMorphPlugin morph = { + .apply = lv_morph_alpha_apply, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT | VISUAL_VIDEO_DEPTH_16BIT | + VISUAL_VIDEO_DEPTH_24BIT | VISUAL_VIDEO_DEPTH_32BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_MORPH, + + .plugname = "alphablend", + .name = "alphablend morph", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("An alphablend morph plugin"), + .help = N_("This morph plugin morphs between two video sources using the " + "alphablend method"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_morph_alpha_init, + .cleanup = lv_morph_alpha_cleanup, + + .plugin = &morph}; + + return &info; } -static int lv_morph_alpha_init (VisPluginData *plugin) -{ +static int lv_morph_alpha_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - return TRUE; + return TRUE; } -static void lv_morph_alpha_cleanup (VisPluginData *plugin) -{ - /* nothing to do */ +static void lv_morph_alpha_cleanup(VisPluginData *plugin) { + /* nothing to do */ } -static void lv_morph_alpha_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2) -{ - alpha_blend_buffer (visual_video_get_pixels (dest), - visual_video_get_pixels (src1), - visual_video_get_pixels (src2), - visual_video_get_size (dest), - visual_video_get_depth (dest), - progress); +static void lv_morph_alpha_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, + VisVideo *src1, VisVideo *src2) { + alpha_blend_buffer(visual_video_get_pixels(dest), + visual_video_get_pixels(src1), + visual_video_get_pixels(src2), visual_video_get_size(dest), + visual_video_get_depth(dest), progress); } -static inline void alpha_blend_buffer (uint8_t *dest, uint8_t *src1, uint8_t *src2, int size, int depth, float alpha) -{ - uint8_t a = alpha * (1/255.0); +static inline void alpha_blend_buffer(uint8_t *dest, uint8_t *src1, + uint8_t *src2, int size, int depth, + float alpha) { + uint8_t a = alpha * (1 / 255.0); - switch (depth) { - case VISUAL_VIDEO_DEPTH_8BIT: - visual_alpha_blend_8 (dest, src1, src2, size, a); - break; + switch (depth) { + case VISUAL_VIDEO_DEPTH_8BIT: + visual_alpha_blend_8(dest, src1, src2, size, a); + break; - case VISUAL_VIDEO_DEPTH_16BIT: - visual_alpha_blend_16 (dest, src1, src2, size, a); - break; + case VISUAL_VIDEO_DEPTH_16BIT: + visual_alpha_blend_16(dest, src1, src2, size, a); + break; - case VISUAL_VIDEO_DEPTH_24BIT: - visual_alpha_blend_24 (dest, src1, src2, size, a); - break; + case VISUAL_VIDEO_DEPTH_24BIT: + visual_alpha_blend_24(dest, src1, src2, size, a); + break; - case VISUAL_VIDEO_DEPTH_32BIT: - visual_alpha_blend_32 (dest, src1, src2, size, a); - break; - } + case VISUAL_VIDEO_DEPTH_32BIT: + visual_alpha_blend_32(dest, src1, src2, size, a); + break; + } } diff --git a/libvisual-plugins/plugins/morph/checkers/morph_checkers.cpp b/libvisual-plugins/plugins/morph/checkers/morph_checkers.cpp index e46e1dfb2..9a4e48d13 100644 --- a/libvisual-plugins/plugins/morph/checkers/morph_checkers.cpp +++ b/libvisual-plugins/plugins/morph/checkers/morph_checkers.cpp @@ -27,102 +27,99 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR namespace { - struct CheckerPrivate - { - LV::Timer timer; - bool flip; - }; +struct CheckerPrivate { + LV::Timer timer; + bool flip; +}; - int lv_morph_checkers_init (VisPluginData *plugin); - void lv_morph_checkers_cleanup (VisPluginData *plugin); - void lv_morph_checkers_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2); +int lv_morph_checkers_init(VisPluginData *plugin); +void lv_morph_checkers_cleanup(VisPluginData *plugin); +void lv_morph_checkers_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, VisVideo *src1, + VisVideo *src2); - unsigned int const n_tile_rows = 4; - unsigned int const n_tile_cols = 4; +unsigned int const n_tile_rows = 4; +unsigned int const n_tile_cols = 4; } // anonymous namespace -const VisPluginInfo *get_plugin_info () -{ - static VisMorphPlugin morph; - morph.apply = lv_morph_checkers_apply; - morph.vidoptions.depth = - VisVideoDepth (VISUAL_VIDEO_DEPTH_8BIT | - VISUAL_VIDEO_DEPTH_16BIT | - VISUAL_VIDEO_DEPTH_24BIT | - VISUAL_VIDEO_DEPTH_32BIT); - - static VisPluginInfo info; - - info.type = VISUAL_PLUGIN_TYPE_MORPH; - info.plugname = "checkers"; - info.name = "Checkerboard morph"; - info.author = "Scott Sibley "; - info.version = "0.1"; - info.about = N_("A checkers in/out morph plugin"); - info.help = N_("This morph plugin adds a checkerboard effect.."); - info.license = VISUAL_PLUGIN_LICENSE_LGPL; - - info.init = lv_morph_checkers_init; - info.cleanup = lv_morph_checkers_cleanup; - info.plugin = &morph; - - return &info; +const VisPluginInfo *get_plugin_info() { + static VisMorphPlugin morph; + morph.apply = lv_morph_checkers_apply; + morph.vidoptions.depth = + VisVideoDepth(VISUAL_VIDEO_DEPTH_8BIT | VISUAL_VIDEO_DEPTH_16BIT | + VISUAL_VIDEO_DEPTH_24BIT | VISUAL_VIDEO_DEPTH_32BIT); + + static VisPluginInfo info; + + info.type = VISUAL_PLUGIN_TYPE_MORPH; + info.plugname = "checkers"; + info.name = "Checkerboard morph"; + info.author = "Scott Sibley "; + info.version = "0.1"; + info.about = N_("A checkers in/out morph plugin"); + info.help = N_("This morph plugin adds a checkerboard effect.."); + info.license = VISUAL_PLUGIN_LICENSE_LGPL; + + info.init = lv_morph_checkers_init; + info.cleanup = lv_morph_checkers_cleanup; + info.plugin = &morph; + + return &info; } namespace { - int lv_morph_checkers_init (VisPluginData *plugin) - { - #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); - #endif +int lv_morph_checkers_init(VisPluginData *plugin) { +#if ENABLE_NLS + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); +#endif - auto priv = new CheckerPrivate; - visual_plugin_set_private (plugin, priv); + auto priv = new CheckerPrivate; + visual_plugin_set_private(plugin, priv); - priv->timer.start (); + priv->timer.start(); - priv->flip = true; + priv->flip = true; - return TRUE; - } + return TRUE; +} - void lv_morph_checkers_cleanup (VisPluginData *plugin) - { - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_morph_checkers_cleanup(VisPluginData *plugin) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - delete priv; - } + delete priv; +} - void lv_morph_checkers_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2) - { - auto priv = static_cast (visual_plugin_get_private (plugin)); +void lv_morph_checkers_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, VisVideo *src1, + VisVideo *src2) { + auto priv = static_cast(visual_plugin_get_private(plugin)); - if (priv->timer.elapsed ().to_msecs () > 300) { - priv->flip = !priv->flip; - priv->timer.reset (); - priv->timer.start (); - } + if (priv->timer.elapsed().to_msecs() > 300) { + priv->flip = !priv->flip; + priv->timer.reset(); + priv->timer.start(); + } - dest->fill_color (LV::Color::black ()); + dest->fill_color(LV::Color::black()); - int dest_width = visual_video_get_width (dest); - int dest_height = visual_video_get_height (dest); + int dest_width = visual_video_get_width(dest); + int dest_height = visual_video_get_height(dest); - int tile_width = dest_width / n_tile_cols; - int tile_height = dest_height / n_tile_rows; + int tile_width = dest_width / n_tile_cols; + int tile_height = dest_height / n_tile_rows; - for (int row = 0, y = 0; y < dest_height; row++, y += tile_height) { - for (int col = 0, x = 0; x < dest_width; col++, x += tile_width) { - LV::Rect region {x, y, tile_width, tile_height}; + for (int row = 0, y = 0; y < dest_height; row++, y += tile_height) { + for (int col = 0, x = 0; x < dest_width; col++, x += tile_width) { + LV::Rect region{x, y, tile_width, tile_height}; - auto src = (row + col + priv->flip) & 1 ? src1 : src2; - auto tile = LV::Video::create_sub (src, region); + auto src = (row + col + priv->flip) & 1 ? src1 : src2; + auto tile = LV::Video::create_sub(src, region); - dest->blit (tile, x, y, false); - } - } + dest->blit(tile, x, y, false); + } } +} } // anonymous namespace diff --git a/libvisual-plugins/plugins/morph/flash/morph_flash.c b/libvisual-plugins/plugins/morph/flash/morph_flash.c index e8d360f86..4b79c8d41 100644 --- a/libvisual-plugins/plugins/morph/flash/morph_flash.c +++ b/libvisual-plugins/plugins/morph/flash/morph_flash.c @@ -28,169 +28,171 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR typedef struct { - uint16_t b:5, g:6, r:5; + uint16_t b : 5, g : 6, r : 5; } _color16; typedef struct { - VisPalette *whitepal; - uint8_t replacetable[256]; + VisPalette *whitepal; + uint8_t replacetable[256]; } FlashPrivate; -static int lv_morph_flash_init (VisPluginData *plugin); -static void lv_morph_flash_cleanup (VisPluginData *plugin); -static void lv_morph_flash_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2); -static void lv_morph_flash_palette (VisPluginData *plugin, float progress, VisAudio *audio, VisPalette *pal, VisVideo *src1, VisVideo *src2); - -static void replacetable_generate_24 (FlashPrivate *priv, float progress); -static void flash_8 (FlashPrivate *priv, float progress, VisVideo *dest, VisVideo *src1, VisVideo *src2); -static void flash_24 (FlashPrivate *priv, float progress, VisVideo *dest, VisVideo *src1, VisVideo *src2); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisMorphPlugin morph = { - .palette = lv_morph_flash_palette, - .apply = lv_morph_flash_apply, - .vidoptions.depth = - VISUAL_VIDEO_DEPTH_8BIT | - VISUAL_VIDEO_DEPTH_16BIT | - VISUAL_VIDEO_DEPTH_24BIT | - VISUAL_VIDEO_DEPTH_32BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_MORPH, - - .plugname = "flash", - .name = "flash morph", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("An flash in and out morph plugin"), - .help = N_("This morph plugin morphs between two video sources using a bright flash"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_morph_flash_init, - .cleanup = lv_morph_flash_cleanup, - .plugin = &morph - }; - - return &info; +static int lv_morph_flash_init(VisPluginData *plugin); +static void lv_morph_flash_cleanup(VisPluginData *plugin); +static void lv_morph_flash_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, + VisVideo *src1, VisVideo *src2); +static void lv_morph_flash_palette(VisPluginData *plugin, float progress, + VisAudio *audio, VisPalette *pal, + VisVideo *src1, VisVideo *src2); + +static void replacetable_generate_24(FlashPrivate *priv, float progress); +static void flash_8(FlashPrivate *priv, float progress, VisVideo *dest, + VisVideo *src1, VisVideo *src2); +static void flash_24(FlashPrivate *priv, float progress, VisVideo *dest, + VisVideo *src1, VisVideo *src2); + +const VisPluginInfo *get_plugin_info(void) { + static VisMorphPlugin morph = { + .palette = lv_morph_flash_palette, + .apply = lv_morph_flash_apply, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT | VISUAL_VIDEO_DEPTH_16BIT | + VISUAL_VIDEO_DEPTH_24BIT | VISUAL_VIDEO_DEPTH_32BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_MORPH, + + .plugname = "flash", + .name = "flash morph", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("An flash in and out morph plugin"), + .help = N_("This morph plugin morphs between two video sources using a " + "bright flash"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_morph_flash_init, + .cleanup = lv_morph_flash_cleanup, + .plugin = &morph}; + + return &info; } -static int lv_morph_flash_init (VisPluginData *plugin) -{ - int i; - FlashPrivate *priv; - VisColor *whitepal_colors; +static int lv_morph_flash_init(VisPluginData *plugin) { + int i; + FlashPrivate *priv; + VisColor *whitepal_colors; #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - priv = visual_mem_new0 (FlashPrivate, 1); - visual_plugin_set_private (plugin, priv); + priv = visual_mem_new0(FlashPrivate, 1); + visual_plugin_set_private(plugin, priv); - priv->whitepal = visual_palette_new (256); - whitepal_colors = visual_palette_get_colors (priv->whitepal); + priv->whitepal = visual_palette_new(256); + whitepal_colors = visual_palette_get_colors(priv->whitepal); - for (i = 0; i < 256; i++) { - whitepal_colors[i].r = 0xff; - whitepal_colors[i].g = 0xff; - whitepal_colors[i].b = 0xff; - } + for (i = 0; i < 256; i++) { + whitepal_colors[i].r = 0xff; + whitepal_colors[i].g = 0xff; + whitepal_colors[i].b = 0xff; + } - return TRUE; + return TRUE; } -static void lv_morph_flash_cleanup (VisPluginData *plugin) -{ - FlashPrivate *priv = visual_plugin_get_private (plugin); +static void lv_morph_flash_cleanup(VisPluginData *plugin) { + FlashPrivate *priv = visual_plugin_get_private(plugin); - visual_palette_free (priv->whitepal); + visual_palette_free(priv->whitepal); - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_morph_flash_palette (VisPluginData *plugin, float progress, VisAudio *audio, VisPalette *pal, VisVideo *src1, VisVideo *src2) -{ - FlashPrivate *priv = visual_plugin_get_private (plugin); +static void lv_morph_flash_palette(VisPluginData *plugin, float progress, + VisAudio *audio, VisPalette *pal, + VisVideo *src1, VisVideo *src2) { + FlashPrivate *priv = visual_plugin_get_private(plugin); - VisPalette *src1_pal = visual_video_get_palette (src1); - VisPalette *src2_pal = visual_video_get_palette (src2); + VisPalette *src1_pal = visual_video_get_palette(src1); + VisPalette *src2_pal = visual_video_get_palette(src2); - if (!src1_pal || !src2_pal) - return; + if (!src1_pal || !src2_pal) + return; - if (progress < 0.5) - visual_palette_blend (pal, src1_pal, priv->whitepal, progress * 2); - else - visual_palette_blend (pal, priv->whitepal, src2_pal, (progress - 0.5) * 2); + if (progress < 0.5) + visual_palette_blend(pal, src1_pal, priv->whitepal, progress * 2); + else + visual_palette_blend(pal, priv->whitepal, src2_pal, (progress - 0.5) * 2); } -static void lv_morph_flash_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2) -{ - FlashPrivate *priv = visual_plugin_get_private (plugin); +static void lv_morph_flash_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, + VisVideo *src1, VisVideo *src2) { + FlashPrivate *priv = visual_plugin_get_private(plugin); - switch (visual_video_get_depth (dest)) { - case VISUAL_VIDEO_DEPTH_8BIT: - flash_8 (priv, progress, dest, src1, src2); - break; + switch (visual_video_get_depth(dest)) { + case VISUAL_VIDEO_DEPTH_8BIT: + flash_8(priv, progress, dest, src1, src2); + break; - case VISUAL_VIDEO_DEPTH_16BIT: + case VISUAL_VIDEO_DEPTH_16BIT: - break; + break; - case VISUAL_VIDEO_DEPTH_24BIT: - replacetable_generate_24 (priv, progress); - flash_24 (priv, progress, dest, src1, src2); - break; + case VISUAL_VIDEO_DEPTH_24BIT: + replacetable_generate_24(priv, progress); + flash_24(priv, progress, dest, src1, src2); + break; - case VISUAL_VIDEO_DEPTH_32BIT: - replacetable_generate_24 (priv, progress); - flash_24 (priv, progress, dest, src1, src2); - break; + case VISUAL_VIDEO_DEPTH_32BIT: + replacetable_generate_24(priv, progress); + flash_24(priv, progress, dest, src1, src2); + break; - default: - break; - } + default: + break; + } } -static void replacetable_generate_24 (FlashPrivate *priv, float progress) -{ - int i; - - for (i = 0; i < 256; i++) { - if (progress < 0.5) - priv->replacetable[i] = i + (((255.00 - i) / 100.00) * ((progress * 2) * 100)); - else - priv->replacetable[i] = i + (((255.00 - i) / 100.00) * ((1.0 - ((progress - 0.5) * 2)) * 100)); - } - +static void replacetable_generate_24(FlashPrivate *priv, float progress) { + int i; + + for (i = 0; i < 256; i++) { + if (progress < 0.5) + priv->replacetable[i] = + i + (((255.00 - i) / 100.00) * ((progress * 2) * 100)); + else + priv->replacetable[i] = i + (((255.00 - i) / 100.00) * + ((1.0 - ((progress - 0.5) * 2)) * 100)); + } } -static void flash_8 (FlashPrivate *priv, float progress, VisVideo *dest, VisVideo *src1, VisVideo *src2) -{ - if (progress < 0.5) - visual_mem_copy (visual_video_get_pixels (dest), visual_video_get_pixels (src1), visual_video_get_size (src1)); - else - visual_mem_copy (visual_video_get_pixels (dest), visual_video_get_pixels (src2), visual_video_get_size (src2)); +static void flash_8(FlashPrivate *priv, float progress, VisVideo *dest, + VisVideo *src1, VisVideo *src2) { + if (progress < 0.5) + visual_mem_copy(visual_video_get_pixels(dest), + visual_video_get_pixels(src1), visual_video_get_size(src1)); + else + visual_mem_copy(visual_video_get_pixels(dest), + visual_video_get_pixels(src2), visual_video_get_size(src2)); } -static void flash_24 (FlashPrivate *priv, float progress, VisVideo *dest, VisVideo *src1, VisVideo *src2) -{ - uint8_t *scrbuf; - uint8_t *destbuf = visual_video_get_pixels (dest); - int size; - int i; - - if (progress < 0.5) { - scrbuf = visual_video_get_pixels (src1); - size = visual_video_get_size (src1); - } else { - scrbuf = visual_video_get_pixels (src2); - size = visual_video_get_size (src2); - } - - for (i = 0; i < size; i++) - destbuf[i] = priv->replacetable[scrbuf[i]]; +static void flash_24(FlashPrivate *priv, float progress, VisVideo *dest, + VisVideo *src1, VisVideo *src2) { + uint8_t *scrbuf; + uint8_t *destbuf = visual_video_get_pixels(dest); + int size; + int i; + + if (progress < 0.5) { + scrbuf = visual_video_get_pixels(src1); + size = visual_video_get_size(src1); + } else { + scrbuf = visual_video_get_pixels(src2); + size = visual_video_get_size(src2); + } + + for (i = 0; i < size; i++) + destbuf[i] = priv->replacetable[scrbuf[i]]; } - diff --git a/libvisual-plugins/plugins/morph/slide/common.c b/libvisual-plugins/plugins/morph/slide/common.c index 1fbeeb974..c90ddb4f1 100644 --- a/libvisual-plugins/plugins/morph/slide/common.c +++ b/libvisual-plugins/plugins/morph/slide/common.c @@ -2,97 +2,102 @@ #include VisMorphPlugin morph = { - .apply = lv_morph_slide_apply, - .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT - | VISUAL_VIDEO_DEPTH_16BIT - | VISUAL_VIDEO_DEPTH_24BIT - | VISUAL_VIDEO_DEPTH_32BIT -}; - -int lv_morph_slide_init (VisPluginData *plugin, SlideType type) -{ + .apply = lv_morph_slide_apply, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT | VISUAL_VIDEO_DEPTH_16BIT | + VISUAL_VIDEO_DEPTH_24BIT | VISUAL_VIDEO_DEPTH_32BIT}; + +int lv_morph_slide_init(VisPluginData *plugin, SlideType type) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - SlidePrivate *priv = visual_mem_new0 (SlidePrivate, 1); - visual_plugin_set_private (plugin, priv); + SlidePrivate *priv = visual_mem_new0(SlidePrivate, 1); + visual_plugin_set_private(plugin, priv); - priv->slide_type = type; + priv->slide_type = type; - return TRUE; + return TRUE; } -void lv_morph_slide_cleanup (VisPluginData *plugin) -{ - SlidePrivate *priv = visual_plugin_get_private (plugin); +void lv_morph_slide_cleanup(VisPluginData *plugin) { + SlidePrivate *priv = visual_plugin_get_private(plugin); - visual_mem_free (priv); + visual_mem_free(priv); } -void lv_morph_slide_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2) -{ - SlidePrivate *priv = visual_plugin_get_private (plugin); - uint8_t *destbuf = visual_video_get_pixels (dest); - uint8_t *srcbuf1 = visual_video_get_pixels (src1); - uint8_t *srcbuf2 = visual_video_get_pixels (src2); +void lv_morph_slide_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, VisVideo *src1, + VisVideo *src2) { + SlidePrivate *priv = visual_plugin_get_private(plugin); + uint8_t *destbuf = visual_video_get_pixels(dest); + uint8_t *srcbuf1 = visual_video_get_pixels(src1); + uint8_t *srcbuf2 = visual_video_get_pixels(src2); - int dest_height = visual_video_get_height (dest); - int dest_pitch = visual_video_get_pitch (dest); + int dest_height = visual_video_get_height(dest); + int dest_pitch = visual_video_get_pitch(dest); - int i; - int diff1; - int diff2; - int hadd; + int i; + int diff1; + int diff2; + int hadd; - visual_mem_set (destbuf, 0, visual_video_get_size (dest)); + visual_mem_set(destbuf, 0, visual_video_get_size(dest)); - if (priv->slide_type == SLIDE_RIGHT || priv->slide_type == SLIDE_UP) - progress = 1.0 - progress; + if (priv->slide_type == SLIDE_RIGHT || priv->slide_type == SLIDE_UP) + progress = 1.0 - progress; - diff1 = dest_pitch * progress; - diff1 -= diff1 % visual_video_get_bpp (dest); + diff1 = dest_pitch * progress; + diff1 -= diff1 % visual_video_get_bpp(dest); - if (diff1 > dest_pitch) - diff1 = dest_pitch; + if (diff1 > dest_pitch) + diff1 = dest_pitch; - diff2 = dest_pitch - diff1; + diff2 = dest_pitch - diff1; - hadd = dest_height * progress; + hadd = dest_height * progress; - switch (priv->slide_type) { - case SLIDE_LEFT: - for (i = 0; i < dest_height; i++) { - visual_mem_copy (destbuf + (i * dest_pitch), srcbuf2 + (i * dest_pitch) + diff2, diff1); - visual_mem_copy (destbuf + (i * dest_pitch) + (diff1), srcbuf1 + (i * dest_pitch), diff2); - } + switch (priv->slide_type) { + case SLIDE_LEFT: + for (i = 0; i < dest_height; i++) { + visual_mem_copy(destbuf + (i * dest_pitch), + srcbuf2 + (i * dest_pitch) + diff2, diff1); + visual_mem_copy(destbuf + (i * dest_pitch) + (diff1), + srcbuf1 + (i * dest_pitch), diff2); + } - break; + break; - case SLIDE_RIGHT: - for (i = 0; i < dest_height; i++) { - visual_mem_copy (destbuf + (i * dest_pitch), srcbuf1 + (i * dest_pitch) + diff2, diff1); - visual_mem_copy (destbuf + (i * dest_pitch) + (diff1), srcbuf2 + (i * dest_pitch), diff2); - } + case SLIDE_RIGHT: + for (i = 0; i < dest_height; i++) { + visual_mem_copy(destbuf + (i * dest_pitch), + srcbuf1 + (i * dest_pitch) + diff2, diff1); + visual_mem_copy(destbuf + (i * dest_pitch) + (diff1), + srcbuf2 + (i * dest_pitch), diff2); + } - break; + break; - case SLIDE_DOWN: - visual_mem_copy (destbuf, srcbuf1 + (hadd * dest_pitch), (dest_height - hadd) * dest_pitch); - visual_mem_copy (destbuf + ((dest_height - hadd) * dest_pitch), srcbuf2, hadd * dest_pitch); + case SLIDE_DOWN: + visual_mem_copy(destbuf, srcbuf1 + (hadd * dest_pitch), + (dest_height - hadd) * dest_pitch); + visual_mem_copy(destbuf + ((dest_height - hadd) * dest_pitch), srcbuf2, + hadd * dest_pitch); - break; + break; - case SLIDE_UP: - visual_mem_copy (destbuf, srcbuf2 + (hadd * dest_pitch), (dest_height - hadd) * dest_pitch); - visual_mem_copy (destbuf + ((dest_height - hadd) * dest_pitch), srcbuf1, hadd * dest_pitch); + case SLIDE_UP: + visual_mem_copy(destbuf, srcbuf2 + (hadd * dest_pitch), + (dest_height - hadd) * dest_pitch); + visual_mem_copy(destbuf + ((dest_height - hadd) * dest_pitch), srcbuf1, + hadd * dest_pitch); - break; + break; - default: - visual_log (VISUAL_LOG_WARNING, - "Slide plugin is initialized with an impossible slide direction, this should never happen"); + default: + visual_log(VISUAL_LOG_WARNING, + "Slide plugin is initialized with an impossible slide " + "direction, this should never happen"); - break; - } + break; + } } diff --git a/libvisual-plugins/plugins/morph/slide/common.h b/libvisual-plugins/plugins/morph/slide/common.h index 6f918d2dd..1cd59c3d7 100644 --- a/libvisual-plugins/plugins/morph/slide/common.h +++ b/libvisual-plugins/plugins/morph/slide/common.h @@ -5,20 +5,17 @@ #include "gettext.h" #include -typedef enum { - SLIDE_LEFT, - SLIDE_RIGHT, - SLIDE_DOWN, - SLIDE_UP -} SlideType; +typedef enum { SLIDE_LEFT, SLIDE_RIGHT, SLIDE_DOWN, SLIDE_UP } SlideType; typedef struct { - SlideType slide_type; + SlideType slide_type; } SlidePrivate; -int lv_morph_slide_init (VisPluginData *plugin, SlideType type); -void lv_morph_slide_cleanup (VisPluginData *plugin); -void lv_morph_slide_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2); +int lv_morph_slide_init(VisPluginData *plugin, SlideType type); +void lv_morph_slide_cleanup(VisPluginData *plugin); +void lv_morph_slide_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, VisVideo *src1, + VisVideo *src2); extern VisMorphPlugin morph; diff --git a/libvisual-plugins/plugins/morph/slide/morph_slide_down.c b/libvisual-plugins/plugins/morph/slide/morph_slide_down.c index 371ea5eb6..429b09aeb 100644 --- a/libvisual-plugins/plugins/morph/slide/morph_slide_down.c +++ b/libvisual-plugins/plugins/morph/slide/morph_slide_down.c @@ -26,30 +26,28 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int lv_morph_slide_init_down (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_MORPH, - - .plugname = "slide_down", - .name = "Slide up morph", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("A slide in/out morph plugin"), - .help = N_("This morph plugin morphs between two video sources by sliding one in and the other out"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_morph_slide_init_down, - .cleanup = lv_morph_slide_cleanup, - .plugin = &morph - }; - - return &info; +static int lv_morph_slide_init_down(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_MORPH, + + .plugname = "slide_down", + .name = "Slide up morph", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("A slide in/out morph plugin"), + .help = N_("This morph plugin morphs between two video sources by " + "sliding one in and the other out"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_morph_slide_init_down, + .cleanup = lv_morph_slide_cleanup, + .plugin = &morph}; + + return &info; } -static int lv_morph_slide_init_down (VisPluginData *plugin) -{ - return lv_morph_slide_init (plugin, SLIDE_DOWN); +static int lv_morph_slide_init_down(VisPluginData *plugin) { + return lv_morph_slide_init(plugin, SLIDE_DOWN); } diff --git a/libvisual-plugins/plugins/morph/slide/morph_slide_left.c b/libvisual-plugins/plugins/morph/slide/morph_slide_left.c index 23bc82501..1d8e1f1bf 100644 --- a/libvisual-plugins/plugins/morph/slide/morph_slide_left.c +++ b/libvisual-plugins/plugins/morph/slide/morph_slide_left.c @@ -25,30 +25,28 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int lv_morph_slide_init_left (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_MORPH, - - .plugname = "slide_left", - .name = "Slide left morph", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("A slide in/out morph plugin"), - .help = N_("This morph plugin morphs between two video sources by sliding one in and the other out"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_morph_slide_init_left, - .cleanup = lv_morph_slide_cleanup, - .plugin = &morph - }; - - return &info; +static int lv_morph_slide_init_left(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_MORPH, + + .plugname = "slide_left", + .name = "Slide left morph", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("A slide in/out morph plugin"), + .help = N_("This morph plugin morphs between two video sources by " + "sliding one in and the other out"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_morph_slide_init_left, + .cleanup = lv_morph_slide_cleanup, + .plugin = &morph}; + + return &info; } -static int lv_morph_slide_init_left (VisPluginData *plugin) -{ - return lv_morph_slide_init (plugin, SLIDE_LEFT); +static int lv_morph_slide_init_left(VisPluginData *plugin) { + return lv_morph_slide_init(plugin, SLIDE_LEFT); } diff --git a/libvisual-plugins/plugins/morph/slide/morph_slide_right.c b/libvisual-plugins/plugins/morph/slide/morph_slide_right.c index a864c7b41..98b16fe3f 100644 --- a/libvisual-plugins/plugins/morph/slide/morph_slide_right.c +++ b/libvisual-plugins/plugins/morph/slide/morph_slide_right.c @@ -25,31 +25,28 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int lv_morph_slide_init_right (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_MORPH, - - .plugname = "slide_right", - .name = "Slide right morph", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("A slide in/out morph plugin"), - .help = N_("This morph plugin morphs between two video sources by sliding one in and the other out"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_morph_slide_init_right, - .cleanup = lv_morph_slide_cleanup, - .plugin = &morph - }; - - return &info; +static int lv_morph_slide_init_right(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_MORPH, + + .plugname = "slide_right", + .name = "Slide right morph", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("A slide in/out morph plugin"), + .help = N_("This morph plugin morphs between two video sources by " + "sliding one in and the other out"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_morph_slide_init_right, + .cleanup = lv_morph_slide_cleanup, + .plugin = &morph}; + + return &info; } -static int lv_morph_slide_init_right (VisPluginData *plugin) -{ - return lv_morph_slide_init (plugin, SLIDE_RIGHT); +static int lv_morph_slide_init_right(VisPluginData *plugin) { + return lv_morph_slide_init(plugin, SLIDE_RIGHT); } - diff --git a/libvisual-plugins/plugins/morph/slide/morph_slide_up.c b/libvisual-plugins/plugins/morph/slide/morph_slide_up.c index 5a506c557..0e3abcaf1 100644 --- a/libvisual-plugins/plugins/morph/slide/morph_slide_up.c +++ b/libvisual-plugins/plugins/morph/slide/morph_slide_up.c @@ -25,30 +25,28 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR -static int lv_morph_slide_init_up (VisPluginData *plugin); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_MORPH, - - .plugname = "slide_up", - .name = "Slide up morph", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("A slide in/out morph plugin"), - .help = N_("This morph plugin morphs between two video sources by sliding one in and the other out"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_morph_slide_init_up, - .cleanup = lv_morph_slide_cleanup, - .plugin = &morph - }; - - return &info; +static int lv_morph_slide_init_up(VisPluginData *plugin); + +const VisPluginInfo *get_plugin_info(void) { + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_MORPH, + + .plugname = "slide_up", + .name = "Slide up morph", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("A slide in/out morph plugin"), + .help = N_("This morph plugin morphs between two video sources by " + "sliding one in and the other out"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_morph_slide_init_up, + .cleanup = lv_morph_slide_cleanup, + .plugin = &morph}; + + return &info; } -static int lv_morph_slide_init_up (VisPluginData *plugin) -{ - return lv_morph_slide_init (plugin, SLIDE_UP); +static int lv_morph_slide_init_up(VisPluginData *plugin) { + return lv_morph_slide_init(plugin, SLIDE_UP); } diff --git a/libvisual-plugins/plugins/morph/tentacle/morph_tentacle.c b/libvisual-plugins/plugins/morph/tentacle/morph_tentacle.c index a90a5a9be..d1b36d39b 100644 --- a/libvisual-plugins/plugins/morph/tentacle/morph_tentacle.c +++ b/libvisual-plugins/plugins/morph/tentacle/morph_tentacle.c @@ -29,247 +29,246 @@ VISUAL_PLUGIN_API_VERSION_VALIDATOR typedef struct { - uint16_t b:5, g:6, r:5; + uint16_t b : 5, g : 6, r : 5; } _color16; typedef struct { - float move; + float move; } TentaclePrivate; -static int lv_morph_tentacle_init (VisPluginData *plugin); -static void lv_morph_tentacle_cleanup (VisPluginData *plugin); -static void lv_morph_tentacle_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2); - -static void sane_coords (VisVideo *dest, int *x, int *y1, int *y2); - -static void vline_from_video_8 (VisVideo *dest, VisVideo *src, int x, int y1, int y2); -static void vline_from_video_16 (VisVideo *dest, VisVideo *src, int x, int y1, int y2); -static void vline_from_video_24 (VisVideo *dest, VisVideo *src, int x, int y1, int y2); -static void vline_from_video_32 (VisVideo *dest, VisVideo *src, int x, int y1, int y2); - -const VisPluginInfo *get_plugin_info (void) -{ - static VisMorphPlugin morph = { - .apply = lv_morph_tentacle_apply, - .vidoptions.depth = - VISUAL_VIDEO_DEPTH_8BIT | - VISUAL_VIDEO_DEPTH_16BIT | - VISUAL_VIDEO_DEPTH_24BIT | - VISUAL_VIDEO_DEPTH_32BIT - }; - - static VisPluginInfo info = { - .type = VISUAL_PLUGIN_TYPE_MORPH, - - .plugname = "tentacle", - .name = "tentacle morph", - .author = "Dennis Smit ", - .version = "0.1", - .about = N_("An sine wave morph plugin"), - .help = N_("This morph plugin morphs between two video sources using some sort of wave that grows in size"), - .license = VISUAL_PLUGIN_LICENSE_LGPL, - - .init = lv_morph_tentacle_init, - .cleanup = lv_morph_tentacle_cleanup, - .plugin = &morph - }; - - return &info; +static int lv_morph_tentacle_init(VisPluginData *plugin); +static void lv_morph_tentacle_cleanup(VisPluginData *plugin); +static void lv_morph_tentacle_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, + VisVideo *src1, VisVideo *src2); + +static void sane_coords(VisVideo *dest, int *x, int *y1, int *y2); + +static void vline_from_video_8(VisVideo *dest, VisVideo *src, int x, int y1, + int y2); +static void vline_from_video_16(VisVideo *dest, VisVideo *src, int x, int y1, + int y2); +static void vline_from_video_24(VisVideo *dest, VisVideo *src, int x, int y1, + int y2); +static void vline_from_video_32(VisVideo *dest, VisVideo *src, int x, int y1, + int y2); + +const VisPluginInfo *get_plugin_info(void) { + static VisMorphPlugin morph = { + .apply = lv_morph_tentacle_apply, + .vidoptions.depth = VISUAL_VIDEO_DEPTH_8BIT | VISUAL_VIDEO_DEPTH_16BIT | + VISUAL_VIDEO_DEPTH_24BIT | VISUAL_VIDEO_DEPTH_32BIT}; + + static VisPluginInfo info = { + .type = VISUAL_PLUGIN_TYPE_MORPH, + + .plugname = "tentacle", + .name = "tentacle morph", + .author = "Dennis Smit ", + .version = "0.1", + .about = N_("An sine wave morph plugin"), + .help = N_("This morph plugin morphs between two video sources using " + "some sort of wave that grows in size"), + .license = VISUAL_PLUGIN_LICENSE_LGPL, + + .init = lv_morph_tentacle_init, + .cleanup = lv_morph_tentacle_cleanup, + .plugin = &morph}; + + return &info; } -static int lv_morph_tentacle_init (VisPluginData *plugin) -{ +static int lv_morph_tentacle_init(VisPluginData *plugin) { #if ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR); + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); #endif - TentaclePrivate *priv = visual_mem_new0 (TentaclePrivate, 1); - visual_plugin_set_private (plugin, priv); + TentaclePrivate *priv = visual_mem_new0(TentaclePrivate, 1); + visual_plugin_set_private(plugin, priv); - return TRUE; + return TRUE; } -static void lv_morph_tentacle_cleanup (VisPluginData *plugin) -{ - TentaclePrivate *priv = visual_plugin_get_private (plugin); +static void lv_morph_tentacle_cleanup(VisPluginData *plugin) { + TentaclePrivate *priv = visual_plugin_get_private(plugin); - visual_mem_free (priv); + visual_mem_free(priv); } -static void lv_morph_tentacle_apply (VisPluginData *plugin, float progress, VisAudio *audio, VisVideo *dest, VisVideo *src1, VisVideo *src2) -{ - TentaclePrivate *priv = visual_plugin_get_private (plugin); +static void lv_morph_tentacle_apply(VisPluginData *plugin, float progress, + VisAudio *audio, VisVideo *dest, + VisVideo *src1, VisVideo *src2) { + TentaclePrivate *priv = visual_plugin_get_private(plugin); - uint8_t *destbuf = visual_video_get_pixels (dest); - uint8_t *src1buf = visual_video_get_pixels (src1); + uint8_t *destbuf = visual_video_get_pixels(dest); + uint8_t *src1buf = visual_video_get_pixels(src1); - int dest_width = visual_video_get_width (dest); - int dest_height = visual_video_get_height (dest); + int dest_width = visual_video_get_width(dest); + int dest_height = visual_video_get_height(dest); - VisVideoDepth dest_depth = visual_video_get_depth (dest); + VisVideoDepth dest_depth = visual_video_get_depth(dest); - int height1; - int height2; - int add1; - int add2; + int height1; + int height2; + int add1; + int add2; - float sinrate = priv->move; - float multiplier = 0; - float multiadd = 1.000 / dest_width; + float sinrate = priv->move; + float multiplier = 0; + float multiadd = 1.000 / dest_width; - int i; + int i; - visual_mem_copy (destbuf, src1buf, visual_video_get_size (src1)); + visual_mem_copy(destbuf, src1buf, visual_video_get_size(src1)); - for (i = 0; i < dest_width; i++) { - add1 = (dest_height / 2) - ((dest_height / 2) * (progress * 1.5)); - add2 = (dest_height / 2) + ((dest_height / 2) * (progress * 1.5)); + for (i = 0; i < dest_width; i++) { + add1 = (dest_height / 2) - ((dest_height / 2) * (progress * 1.5)); + add2 = (dest_height / 2) + ((dest_height / 2) * (progress * 1.5)); - height1 = (sin (sinrate) * ((dest_height / 4) * multiplier)) + add1; - height2 = (sin (sinrate) * ((dest_height / 4) * multiplier)) + add2; - multiplier += multiadd; + height1 = (sin(sinrate) * ((dest_height / 4) * multiplier)) + add1; + height2 = (sin(sinrate) * ((dest_height / 4) * multiplier)) + add2; + multiplier += multiadd; - switch (dest_depth) { - case VISUAL_VIDEO_DEPTH_8BIT: - vline_from_video_8 (dest, src2, i, height1, height2); - break; + switch (dest_depth) { + case VISUAL_VIDEO_DEPTH_8BIT: + vline_from_video_8(dest, src2, i, height1, height2); + break; - case VISUAL_VIDEO_DEPTH_16BIT: - vline_from_video_16 (dest, src2, i, height1, height2); - break; + case VISUAL_VIDEO_DEPTH_16BIT: + vline_from_video_16(dest, src2, i, height1, height2); + break; - case VISUAL_VIDEO_DEPTH_24BIT: - vline_from_video_24 (dest, src2, i, height1, height2); - break; + case VISUAL_VIDEO_DEPTH_24BIT: + vline_from_video_24(dest, src2, i, height1, height2); + break; - case VISUAL_VIDEO_DEPTH_32BIT: - vline_from_video_32 (dest, src2, i, height1, height2); - break; + case VISUAL_VIDEO_DEPTH_32BIT: + vline_from_video_32(dest, src2, i, height1, height2); + break; - default: - break; - } + default: + break; + } - sinrate += 0.02; - priv->move += 0.0002; - } + sinrate += 0.02; + priv->move += 0.0002; + } } -static void sane_coords (VisVideo *dest, int *x, int *y1, int *y2) -{ - int width = visual_video_get_width (dest); - int height = visual_video_get_height (dest); - - if (*x > width) - *x = width; - else if (*x < 0) - *x = 0; - - if (*y1 > height) - *y1 = height; - else if (*y1 < 0) - *y1 = 0; - - if (*y2 > height) - *y2 = height; - else if (*y2 < 0) - *y2 = 0; +static void sane_coords(VisVideo *dest, int *x, int *y1, int *y2) { + int width = visual_video_get_width(dest); + int height = visual_video_get_height(dest); + + if (*x > width) + *x = width; + else if (*x < 0) + *x = 0; + + if (*y1 > height) + *y1 = height; + else if (*y1 < 0) + *y1 = 0; + + if (*y2 > height) + *y2 = height; + else if (*y2 < 0) + *y2 = 0; } -static void vline_from_video_8 (VisVideo *dest, VisVideo *src, int x, int y1, int y2) -{ - uint8_t *destbuf; - uint8_t *srcbuf; - int dest_step; - int src_step; - int i; +static void vline_from_video_8(VisVideo *dest, VisVideo *src, int x, int y1, + int y2) { + uint8_t *destbuf; + uint8_t *srcbuf; + int dest_step; + int src_step; + int i; - sane_coords (dest, &x, &y1, &y2); + sane_coords(dest, &x, &y1, &y2); - destbuf = visual_video_get_pixel_ptr (dest, x, y1); - srcbuf = visual_video_get_pixel_ptr (src, x, y1); + destbuf = visual_video_get_pixel_ptr(dest, x, y1); + srcbuf = visual_video_get_pixel_ptr(src, x, y1); - dest_step = visual_video_get_width (dest); - src_step = visual_video_get_width (src); + dest_step = visual_video_get_width(dest); + src_step = visual_video_get_width(src); - for (i = y1; i < y2; i++) { - *destbuf = *srcbuf; + for (i = y1; i < y2; i++) { + *destbuf = *srcbuf; - destbuf += dest_step; - srcbuf += src_step; - } + destbuf += dest_step; + srcbuf += src_step; + } } -static void vline_from_video_16 (VisVideo *dest, VisVideo *src, int x, int y1, int y2) -{ - uint16_t *destbuf; - uint16_t *srcbuf; - int dest_step; - int src_step; - int i; +static void vline_from_video_16(VisVideo *dest, VisVideo *src, int x, int y1, + int y2) { + uint16_t *destbuf; + uint16_t *srcbuf; + int dest_step; + int src_step; + int i; - sane_coords (dest, &x, &y1, &y2); + sane_coords(dest, &x, &y1, &y2); - destbuf = visual_video_get_pixel_ptr (dest, x, y1); - srcbuf = visual_video_get_pixel_ptr (src, x, y1); + destbuf = visual_video_get_pixel_ptr(dest, x, y1); + srcbuf = visual_video_get_pixel_ptr(src, x, y1); - dest_step = visual_video_get_width (dest); - src_step = visual_video_get_width (src); + dest_step = visual_video_get_width(dest); + src_step = visual_video_get_width(src); - for (i = y1; i < y2; i++) { - *destbuf = *srcbuf; + for (i = y1; i < y2; i++) { + *destbuf = *srcbuf; - destbuf += dest_step; - srcbuf += src_step; - } + destbuf += dest_step; + srcbuf += src_step; + } } -static void vline_from_video_24 (VisVideo *dest, VisVideo *src, int x, int y1, int y2) -{ - uint8_t *destbuf; - uint8_t *srcbuf; - int dest_step; - int src_step; - int i; +static void vline_from_video_24(VisVideo *dest, VisVideo *src, int x, int y1, + int y2) { + uint8_t *destbuf; + uint8_t *srcbuf; + int dest_step; + int src_step; + int i; - sane_coords (dest, &x, &y1, &y2); + sane_coords(dest, &x, &y1, &y2); - destbuf = visual_video_get_pixel_ptr (dest, x, y1); - srcbuf = visual_video_get_pixel_ptr (src, x, y1); + destbuf = visual_video_get_pixel_ptr(dest, x, y1); + srcbuf = visual_video_get_pixel_ptr(src, x, y1); - dest_step = visual_video_get_pitch (dest); - src_step = visual_video_get_pitch (src); + dest_step = visual_video_get_pitch(dest); + src_step = visual_video_get_pitch(src); - for (i = y1; i < y2; i++) { - destbuf[0] = srcbuf[0]; - destbuf[1] = srcbuf[1]; - destbuf[2] = srcbuf[2]; + for (i = y1; i < y2; i++) { + destbuf[0] = srcbuf[0]; + destbuf[1] = srcbuf[1]; + destbuf[2] = srcbuf[2]; - destbuf += dest_step; - srcbuf += src_step; - } + destbuf += dest_step; + srcbuf += src_step; + } } -static void vline_from_video_32 (VisVideo *dest, VisVideo *src, int x, int y1, int y2) -{ - uint32_t *destbuf; - uint32_t *srcbuf; - int dest_step; - int src_step; - int i; +static void vline_from_video_32(VisVideo *dest, VisVideo *src, int x, int y1, + int y2) { + uint32_t *destbuf; + uint32_t *srcbuf; + int dest_step; + int src_step; + int i; - sane_coords (dest, &x, &y1, &y2); + sane_coords(dest, &x, &y1, &y2); - destbuf = visual_video_get_pixel_ptr (dest, x, y1); - srcbuf = visual_video_get_pixel_ptr (src, x, y1); + destbuf = visual_video_get_pixel_ptr(dest, x, y1); + srcbuf = visual_video_get_pixel_ptr(src, x, y1); - dest_step = visual_video_get_width (dest); - src_step = visual_video_get_width (src); + dest_step = visual_video_get_width(dest); + src_step = visual_video_get_width(src); - for (i = y1; i < y2; i++) { - *destbuf = *srcbuf; + for (i = y1; i < y2; i++) { + *destbuf = *srcbuf; - destbuf += dest_step; - srcbuf += src_step; - } + destbuf += dest_step; + srcbuf += src_step; + } } diff --git a/libvisual/examples/simple/main.cpp b/libvisual/examples/simple/main.cpp index 4de2a9296..ab24d6e21 100644 --- a/libvisual/examples/simple/main.cpp +++ b/libvisual/examples/simple/main.cpp @@ -27,32 +27,30 @@ #include #include -int main (int argc, char** argv) -{ - LV::System::init (argc, argv); - visual_log_set_verbosity (VISUAL_LOG_ERROR); +int main(int argc, char **argv) { + LV::System::init(argc, argv); + visual_log_set_verbosity(VISUAL_LOG_ERROR); - int exit_code = EXIT_SUCCESS; + int exit_code = EXIT_SUCCESS; - try { - if (SDL_Init (SDL_INIT_VIDEO)) { - throw std::runtime_error { std::string {"Failed to initialize SDL: "} + SDL_GetError () }; - } - std::atexit (SDL_Quit); - - SimpleExample example; - example.run (); - } - catch (std::exception& error) { - std::cerr << "Error! " << error.what () << std::endl; - exit_code = EXIT_FAILURE; - } - catch (...) { - std::cerr << "Unknown error occurred\n"; - exit_code = EXIT_FAILURE; + try { + if (SDL_Init(SDL_INIT_VIDEO)) { + throw std::runtime_error{std::string{"Failed to initialize SDL: "} + + SDL_GetError()}; } + std::atexit(SDL_Quit); + + SimpleExample example; + example.run(); + } catch (std::exception &error) { + std::cerr << "Error! " << error.what() << std::endl; + exit_code = EXIT_FAILURE; + } catch (...) { + std::cerr << "Unknown error occurred\n"; + exit_code = EXIT_FAILURE; + } - LV::System::destroy (); + LV::System::destroy(); - return exit_code; + return exit_code; } diff --git a/libvisual/examples/simple/simple_example.cpp b/libvisual/examples/simple/simple_example.cpp index 45e0e23b5..ca5631a9b 100644 --- a/libvisual/examples/simple/simple_example.cpp +++ b/libvisual/examples/simple/simple_example.cpp @@ -25,210 +25,198 @@ #include #include -#define DISPLAY_WIDTH 640 -#define DISPLAY_HEIGHT 480 +#define DISPLAY_WIDTH 640 +#define DISPLAY_HEIGHT 480 #define ACTOR_PLUGIN_NAME "lv_analyzer" #define INPUT_PLUGIN_NAME "debug" #define MORPH_PLUGIN_NAME "slide_left" namespace { - enum CycleDirection { - CYCLE_DIR_PREV, - CYCLE_DIR_NEXT - }; - - std::string cycle_actor (std::string const& actor, CycleDirection dir) - { - std::function func; - - switch (dir) { - case CYCLE_DIR_PREV: { - func = visual_actor_get_prev_by_name; - break; - } - case CYCLE_DIR_NEXT: { - func = visual_actor_get_next_by_name; - break; - } - } +enum CycleDirection { CYCLE_DIR_PREV, CYCLE_DIR_NEXT }; - auto new_actor = func (actor.c_str ()); +std::string cycle_actor(std::string const &actor, CycleDirection dir) { + std::function func; - if (!new_actor) { - new_actor = func (nullptr); - } + switch (dir) { + case CYCLE_DIR_PREV: { + func = visual_actor_get_prev_by_name; + break; + } + case CYCLE_DIR_NEXT: { + func = visual_actor_get_next_by_name; + break; + } + } + + auto new_actor = func(actor.c_str()); - return new_actor; + if (!new_actor) { + new_actor = func(nullptr); } + return new_actor; } -SimpleExample::SimpleExample () - : m_actor_name (ACTOR_PLUGIN_NAME) - , m_input_name (INPUT_PLUGIN_NAME) - , m_morph_name (MORPH_PLUGIN_NAME) -{ - m_bin.set_supported_depth (VISUAL_VIDEO_DEPTH_ALL); - m_bin.connect (m_actor_name, m_input_name); +} // namespace - create_display (DISPLAY_WIDTH, DISPLAY_HEIGHT, m_bin.get_depth ()); - m_bin.set_video (m_screen); +SimpleExample::SimpleExample() + : m_actor_name(ACTOR_PLUGIN_NAME), m_input_name(INPUT_PLUGIN_NAME), + m_morph_name(MORPH_PLUGIN_NAME) { + m_bin.set_supported_depth(VISUAL_VIDEO_DEPTH_ALL); + m_bin.connect(m_actor_name, m_input_name); - SDL_WM_SetCaption (m_actor_name.c_str (), 0); + create_display(DISPLAY_WIDTH, DISPLAY_HEIGHT, m_bin.get_depth()); + m_bin.set_video(m_screen); - m_bin.depth_changed (); + SDL_WM_SetCaption(m_actor_name.c_str(), 0); - m_bin.realize (); - m_bin.sync (false); + m_bin.depth_changed(); - m_bin.use_morph (true); - m_bin.set_morph (m_morph_name); + m_bin.realize(); + m_bin.sync(false); + + m_bin.use_morph(true); + m_bin.set_morph(m_morph_name); } -SimpleExample::~SimpleExample () -{ - // nothing +SimpleExample::~SimpleExample() { + // nothing } -LV::VideoPtr SimpleExample::create_display (int width, int height, VisVideoDepth depth) -{ - m_screen.reset (); - m_sdl_screen = nullptr; +LV::VideoPtr SimpleExample::create_display(int width, int height, + VisVideoDepth depth) { + m_screen.reset(); + m_sdl_screen = nullptr; - if (depth == VISUAL_VIDEO_DEPTH_GL) { - int flags = SDL_OPENGL | SDL_RESIZABLE; + if (depth == VISUAL_VIDEO_DEPTH_GL) { + int flags = SDL_OPENGL | SDL_RESIZABLE; - SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 8); - SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 8); - SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 8); - SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); - SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16); + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); - m_sdl_screen = SDL_SetVideoMode (width, height, 24, flags); - } else { - int flags = SDL_RESIZABLE | SDL_HWPALETTE; + m_sdl_screen = SDL_SetVideoMode(width, height, 24, flags); + } else { + int flags = SDL_RESIZABLE | SDL_HWPALETTE; - m_sdl_screen = SDL_SetVideoMode (width, height, visual_video_depth_from_bpp (depth), flags); - } + m_sdl_screen = SDL_SetVideoMode(width, height, + visual_video_depth_from_bpp(depth), flags); + } - if (!m_sdl_screen) { - return nullptr; - } + if (!m_sdl_screen) { + return nullptr; + } - m_screen = LV::Video::wrap (m_sdl_screen->pixels, false, width, height, depth); + m_screen = LV::Video::wrap(m_sdl_screen->pixels, false, width, height, depth); - return m_screen; + return m_screen; } -void SimpleExample::resize_display (int width, int height) -{ - create_display (width, height, m_bin.get_depth ()); +void SimpleExample::resize_display(int width, int height) { + create_display(width, height, m_bin.get_depth()); - m_bin.set_video (m_screen); - m_bin.sync (false); + m_bin.set_video(m_screen); + m_bin.sync(false); } -void SimpleExample::set_palette (LV::Palette const& pal) -{ - if (pal.empty ()) { - return; - } +void SimpleExample::set_palette(LV::Palette const &pal) { + if (pal.empty()) { + return; + } - std::array colors; - visual_mem_set (colors.data (), 0, sizeof (colors)); + std::array colors; + visual_mem_set(colors.data(), 0, sizeof(colors)); - for (unsigned int i = 0; i < pal.size(); i++) { - colors[i].r = pal.colors[i].r; - colors[i].g = pal.colors[i].g; - colors[i].b = pal.colors[i].b; - } + for (unsigned int i = 0; i < pal.size(); i++) { + colors[i].r = pal.colors[i].r; + colors[i].g = pal.colors[i].g; + colors[i].b = pal.colors[i].b; + } - SDL_SetColors (m_sdl_screen, colors.data (), 0, 256); + SDL_SetColors(m_sdl_screen, colors.data(), 0, 256); } -bool SimpleExample::handle_events () -{ - SDL_Event event; - - while (SDL_PollEvent (&event)) { - switch (event.type) { - case SDL_KEYDOWN: { - switch (event.key.keysym.sym) { - case SDLK_ESCAPE: - return false; - - case SDLK_LEFT: - morph_to_actor (cycle_actor (m_actor_name, CYCLE_DIR_PREV), m_morph_name); - break; - - case SDLK_RIGHT: - morph_to_actor (cycle_actor (m_actor_name, CYCLE_DIR_NEXT), m_morph_name); - break; - - default:; - } - - break; - } - case SDL_VIDEORESIZE: { - resize_display (event.resize.w, event.resize.h); - break; - } - default:; - } +bool SimpleExample::handle_events() { + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_KEYDOWN: { + switch (event.key.keysym.sym) { + case SDLK_ESCAPE: + return false; + + case SDLK_LEFT: + morph_to_actor(cycle_actor(m_actor_name, CYCLE_DIR_PREV), m_morph_name); + break; + + case SDLK_RIGHT: + morph_to_actor(cycle_actor(m_actor_name, CYCLE_DIR_NEXT), m_morph_name); + break; + + default:; + } + + break; + } + case SDL_VIDEORESIZE: { + resize_display(event.resize.w, event.resize.h); + break; } + default:; + } + } - return true; + return true; } -void SimpleExample::morph_to_actor (std::string const& actor_name, std::string const& morph_name) -{ - (void)morph_name; //m_bin.set_morph (morph_name); - m_bin.switch_actor (actor_name); +void SimpleExample::morph_to_actor(std::string const &actor_name, + std::string const &morph_name) { + (void)morph_name; // m_bin.set_morph (morph_name); + m_bin.switch_actor(actor_name); - m_actor_name = actor_name; - SDL_WM_SetCaption (m_actor_name.c_str (), 0); + m_actor_name = actor_name; + SDL_WM_SetCaption(m_actor_name.c_str(), 0); } -void SimpleExample::render () -{ - auto screen_depth = m_screen->get_depth (); +void SimpleExample::render() { + auto screen_depth = m_screen->get_depth(); - if (screen_depth == VISUAL_VIDEO_DEPTH_GL) { - m_bin.run (); - SDL_GL_SwapBuffers (); - } else { - SDL_LockSurface (m_sdl_screen); - m_bin.run (); - SDL_UnlockSurface (m_sdl_screen); + if (screen_depth == VISUAL_VIDEO_DEPTH_GL) { + m_bin.run(); + SDL_GL_SwapBuffers(); + } else { + SDL_LockSurface(m_sdl_screen); + m_bin.run(); + SDL_UnlockSurface(m_sdl_screen); - if (screen_depth == VISUAL_VIDEO_DEPTH_8BIT) { - set_palette (m_screen->get_palette ()); - } - - SDL_Flip (m_sdl_screen); + if (screen_depth == VISUAL_VIDEO_DEPTH_8BIT) { + set_palette(m_screen->get_palette()); } + + SDL_Flip(m_sdl_screen); + } } -void SimpleExample::run () -{ - while (true) { - render (); +void SimpleExample::run() { + while (true) { + render(); - if (!handle_events ()) { - break; - } + if (!handle_events()) { + break; + } - if (m_bin.depth_changed ()) - { - int depthflag = m_bin.get_depth (); - VisVideoDepth depth = visual_video_depth_get_highest (depthflag); + if (m_bin.depth_changed()) { + int depthflag = m_bin.get_depth(); + VisVideoDepth depth = visual_video_depth_get_highest(depthflag); - create_display (m_screen->get_width (), m_screen->get_height (), depth); - m_bin.set_video (m_screen); + create_display(m_screen->get_width(), m_screen->get_height(), depth); + m_bin.set_video(m_screen); - m_bin.sync (true); - } + m_bin.sync(true); } + } } diff --git a/libvisual/examples/simple/simple_example.hpp b/libvisual/examples/simple/simple_example.hpp index 5e858364e..9ecbef606 100644 --- a/libvisual/examples/simple/simple_example.hpp +++ b/libvisual/examples/simple/simple_example.hpp @@ -26,34 +26,31 @@ #include #include -class SimpleExample -{ +class SimpleExample { public: + SimpleExample(); - SimpleExample (); + ~SimpleExample(); - ~SimpleExample (); - - void run (); + void run(); private: - - LV::VideoPtr m_screen; - SDL_Surface* m_sdl_screen; - LV::Palette m_palette; - - LV::Bin m_bin; - - std::string m_actor_name; - std::string m_input_name; - std::string m_morph_name; - - LV::VideoPtr create_display (int width, int height, VisVideoDepth depth); - void resize_display (int width, int height); - void set_palette (LV::Palette const& palette); - void morph_to_actor (std::string const& actor, std::string const& morph); - bool handle_events (); - void render (); + LV::VideoPtr m_screen; + SDL_Surface *m_sdl_screen; + LV::Palette m_palette; + + LV::Bin m_bin; + + std::string m_actor_name; + std::string m_input_name; + std::string m_morph_name; + + LV::VideoPtr create_display(int width, int height, VisVideoDepth depth); + void resize_display(int width, int height); + void set_palette(LV::Palette const &palette); + void morph_to_actor(std::string const &actor, std::string const &morph); + bool handle_events(); + void render(); }; #endif // _LV_EXAMPLES_SIMPLE_EXAMPLE diff --git a/libvisual/gettext.h b/libvisual/gettext.h index df2abbe61..724f3dd27 100644 --- a/libvisual/gettext.h +++ b/libvisual/gettext.h @@ -1,5 +1,6 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 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 @@ -23,19 +24,18 @@ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ -# include +#include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ -# ifdef DEFAULT_TEXT_DOMAIN -# undef gettext -# define gettext(Msgid) \ - dgettext (DEFAULT_TEXT_DOMAIN, Msgid) -# undef ngettext -# define ngettext(Msgid1, Msgid2, N) \ - dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) -# endif +#ifdef DEFAULT_TEXT_DOMAIN +#undef gettext +#define gettext(Msgid) dgettext(DEFAULT_TEXT_DOMAIN, Msgid) +#undef ngettext +#define ngettext(Msgid1, Msgid2, N) \ + dngettext(DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +#endif #else @@ -46,17 +46,17 @@ and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) -# include +#include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) -# include -# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H -# include -# endif +#include +#if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +#include +#endif #endif /* Disabled NLS. @@ -64,32 +64,31 @@ for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ -# undef gettext -# define gettext(Msgid) ((const char *) (Msgid)) -# undef dgettext -# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) -# undef dcgettext -# define dcgettext(Domainname, Msgid, Category) \ - ((void) (Category), dgettext (Domainname, Msgid)) -# undef ngettext -# define ngettext(Msgid1, Msgid2, N) \ - ((N) == 1 \ - ? ((void) (Msgid2), (const char *) (Msgid1)) \ - : ((void) (Msgid1), (const char *) (Msgid2))) -# undef dngettext -# define dngettext(Domainname, Msgid1, Msgid2, N) \ - ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) -# undef dcngettext -# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) -# undef textdomain -# define textdomain(Domainname) ((const char *) (Domainname)) -# undef bindtextdomain -# define bindtextdomain(Domainname, Dirname) \ - ((void) (Domainname), (const char *) (Dirname)) -# undef bind_textdomain_codeset -# define bind_textdomain_codeset(Domainname, Codeset) \ - ((void) (Domainname), (const char *) (Codeset)) +#undef gettext +#define gettext(Msgid) ((const char *)(Msgid)) +#undef dgettext +#define dgettext(Domainname, Msgid) ((void)(Domainname), gettext(Msgid)) +#undef dcgettext +#define dcgettext(Domainname, Msgid, Category) \ + ((void)(Category), dgettext(Domainname, Msgid)) +#undef ngettext +#define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 ? ((void)(Msgid2), (const char *)(Msgid1)) \ + : ((void)(Msgid1), (const char *)(Msgid2))) +#undef dngettext +#define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void)(Domainname), ngettext(Msgid1, Msgid2, N)) +#undef dcngettext +#define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void)(Category), dngettext(Domainname, Msgid1, Msgid2, N)) +#undef textdomain +#define textdomain(Domainname) ((const char *)(Domainname)) +#undef bindtextdomain +#define bindtextdomain(Domainname, Dirname) \ + ((void)(Domainname), (const char *)(Dirname)) +#undef bind_textdomain_codeset +#define bind_textdomain_codeset(Domainname, Codeset) \ + ((void)(Domainname), (const char *)(Codeset)) #endif @@ -110,27 +109,33 @@ short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN -# define pgettext(Msgctxt, Msgid) \ - pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define pgettext(Msgctxt, Msgid) \ + pgettext_aux(DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + LC_MESSAGES) #else -# define pgettext(Msgctxt, Msgid) \ - pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define pgettext(Msgctxt, Msgid) \ + pgettext_aux(NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif -#define dpgettext(Domainname, Msgctxt, Msgid) \ - pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) -#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ - pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux(Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux(Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN -# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux(DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, \ + Msgid, MsgidPlural, N, LC_MESSAGES) #else -# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux(NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, \ + N, LC_MESSAGES) #endif -#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ - npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) -#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ - npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux(Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux(Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, \ + MsgidPlural, N, Category) #ifdef __GNUC__ __inline @@ -139,12 +144,10 @@ __inline inline #endif #endif -static const char * -pgettext_aux (const char *domain, - const char *msg_ctxt_id, const char *msgid, - int category) -{ - const char *translation = dcgettext (domain, msg_ctxt_id, category); + static const char * + pgettext_aux(const char *domain, const char *msg_ctxt_id, const char *msgid, + int category) { + const char *translation = dcgettext(domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else @@ -158,14 +161,12 @@ __inline inline #endif #endif -static const char * -npgettext_aux (const char *domain, - const char *msg_ctxt_id, const char *msgid, - const char *msgid_plural, unsigned long int n, - int category) -{ + static const char * + npgettext_aux(const char *domain, const char *msg_ctxt_id, + const char *msgid, const char *msgid_plural, + unsigned long int n, int category) { const char *translation = - dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + dcngettext(domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else @@ -178,18 +179,18 @@ npgettext_aux (const char *domain, #include -#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ - (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ - /* || __STDC_VERSION__ >= 199901L */ ) +#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ + (((__GNUC__ >= 3 || __GNUG__ >= 2) && \ + !__STRICT_ANSI__) /* || __STDC_VERSION__ >= 199901L */) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif -#define pgettext_expr(Msgctxt, Msgid) \ - dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) -#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ - dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr(NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr(Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline @@ -198,43 +199,40 @@ __inline inline #endif #endif -static const char * -dcpgettext_expr (const char *domain, - const char *msgctxt, const char *msgid, - int category) -{ - size_t msgctxt_len = strlen (msgctxt) + 1; - size_t msgid_len = strlen (msgid) + 1; + static const char * + dcpgettext_expr(const char *domain, const char *msgctxt, const char *msgid, + int category) { + size_t msgctxt_len = strlen(msgctxt) + 1; + size_t msgid_len = strlen(msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; - char *msg_ctxt_id = - (msgctxt_len + msgid_len <= sizeof (buf) - ? buf - : (char *) malloc (msgctxt_len + msgid_len)); + char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof(buf) + ? buf + : (char *)malloc(msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif - { - memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); - msg_ctxt_id[msgctxt_len - 1] = '\004'; - memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); - translation = dcgettext (domain, msg_ctxt_id, category); + { + memcpy(msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy(msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext(domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS - if (msg_ctxt_id != buf) - free (msg_ctxt_id); + if (msg_ctxt_id != buf) + free(msg_ctxt_id); #endif - if (translation != msg_ctxt_id) - return translation; - } + if (translation != msg_ctxt_id) + return translation; + } return msgid; } -#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ - dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) -#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ - dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr(NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline @@ -243,42 +241,39 @@ __inline inline #endif #endif -static const char * -dcnpgettext_expr (const char *domain, - const char *msgctxt, const char *msgid, - const char *msgid_plural, unsigned long int n, - int category) -{ - size_t msgctxt_len = strlen (msgctxt) + 1; - size_t msgid_len = strlen (msgid) + 1; + static const char * + dcnpgettext_expr(const char *domain, const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) { + size_t msgctxt_len = strlen(msgctxt) + 1; + size_t msgid_len = strlen(msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; - char *msg_ctxt_id = - (msgctxt_len + msgid_len <= sizeof (buf) - ? buf - : (char *) malloc (msgctxt_len + msgid_len)); + char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof(buf) + ? buf + : (char *)malloc(msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif - { - memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); - msg_ctxt_id[msgctxt_len - 1] = '\004'; - memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); - translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + { + memcpy(msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy(msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext(domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS - if (msg_ctxt_id != buf) - free (msg_ctxt_id); + if (msg_ctxt_id != buf) + free(msg_ctxt_id); #endif - if (!(translation == msg_ctxt_id || translation == msgid_plural)) - return translation; - } + if (!(translation == msg_ctxt_id || translation == msgid_plural)) + return translation; + } return (n == 1 ? msgid : msgid_plural); } /* Added for Libvisual */ -#define _(String) gettext(String) +#define _(String) gettext(String) #define N_(String) gettext_noop(String) #endif /* _LIBGETTEXT_H */ diff --git a/libvisual/libvisual/lv_actor.cpp b/libvisual/libvisual/lv_actor.cpp index 2988fb02f..27e0319e3 100644 --- a/libvisual/libvisual/lv_actor.cpp +++ b/libvisual/libvisual/lv_actor.cpp @@ -28,276 +28,258 @@ namespace LV { - class Actor::Impl - { - public: - - VisPluginData* plugin; - VideoPtr video; - VideoPtr to_scale; - VideoPtr to_convert; - SongInfo songcompare; - VisVideoDepth run_depth; - - Impl (); - ~Impl (); - - VisActorPlugin* get_actor_plugin () const; - - VisVideoDepth get_supported_depths (); - }; - - Actor::Impl::Impl () - : plugin (nullptr) - , songcompare {SONG_INFO_TYPE_NULL} - { - // nothing +class Actor::Impl { +public: + VisPluginData *plugin; + VideoPtr video; + VideoPtr to_scale; + VideoPtr to_convert; + SongInfo songcompare; + VisVideoDepth run_depth; + + Impl(); + ~Impl(); + + VisActorPlugin *get_actor_plugin() const; + + VisVideoDepth get_supported_depths(); +}; + +Actor::Impl::Impl() : plugin(nullptr), songcompare{SONG_INFO_TYPE_NULL} { + // nothing +} + +Actor::Impl::~Impl() { + if (plugin) { + delete get_actor_plugin()->songinfo; + visual_plugin_unload(plugin); } +} + +VisActorPlugin *Actor::Impl::get_actor_plugin() const { + return static_cast(visual_plugin_get_info(plugin)->plugin); +} + +VisVideoDepth Actor::Impl::get_supported_depths() { + auto actor_plugin = get_actor_plugin(); + + return actor_plugin ? actor_plugin->vidoptions.depth + : VISUAL_VIDEO_DEPTH_NONE; +} + +bool Actor::available(std::string const &name) { + return LV::PluginRegistry::instance()->has_plugin(VISUAL_PLUGIN_TYPE_ACTOR, + name); +} + +ActorPtr Actor::load(std::string const &name) { + try { + return {new Actor(name), false}; + } catch (std::exception &error) { + visual_log(VISUAL_LOG_ERROR, "%s", error.what()); + return nullptr; + } +} - Actor::Impl::~Impl () - { - if (plugin) { - delete get_actor_plugin ()->songinfo; - visual_plugin_unload (plugin); - } +Actor::Actor(std::string const &name) : m_impl{new Impl}, m_ref_count{1} { + if (!available(name)) { + throw std::runtime_error{"Actor plugin not found"}; } - VisActorPlugin* Actor::Impl::get_actor_plugin () const - { - return static_cast (visual_plugin_get_info (plugin)->plugin); + m_impl->plugin = visual_plugin_load(VISUAL_PLUGIN_TYPE_ACTOR, name.c_str()); + if (!m_impl->plugin) { + throw std::runtime_error{"Failed to load actor plugin"}; } - VisVideoDepth Actor::Impl::get_supported_depths () - { - auto actor_plugin = get_actor_plugin (); + // FIXME: Hack to initialize songinfo + m_impl->get_actor_plugin()->songinfo = new SongInfo{SONG_INFO_TYPE_NULL}; +} - return actor_plugin ? actor_plugin->vidoptions.depth : VISUAL_VIDEO_DEPTH_NONE; - } +Actor::~Actor() { + // nothing +} - bool Actor::available(std::string const& name) { - return LV::PluginRegistry::instance()->has_plugin (VISUAL_PLUGIN_TYPE_ACTOR, name); - } +VisPluginData *Actor::get_plugin() { return m_impl->plugin; } - ActorPtr Actor::load (std::string const& name) - { - try { - return {new Actor (name), false}; - } - catch (std::exception& error) { - visual_log (VISUAL_LOG_ERROR, "%s", error.what ()); - return nullptr; - } - } +bool Actor::realize() { return visual_plugin_realize(m_impl->plugin); } - Actor::Actor (std::string const& name) - : m_impl {new Impl} - , m_ref_count {1} - { - if (!available (name)) { - throw std::runtime_error {"Actor plugin not found"}; - } +VideoPtr const &Actor::get_video() { return m_impl->video; } - m_impl->plugin = visual_plugin_load (VISUAL_PLUGIN_TYPE_ACTOR, name.c_str ()); - if (!m_impl->plugin) { - throw std::runtime_error {"Failed to load actor plugin"}; - } +SongInfo const *Actor::get_songinfo() { + return m_impl->get_actor_plugin()->songinfo; +} - // FIXME: Hack to initialize songinfo - m_impl->get_actor_plugin ()->songinfo = new SongInfo {SONG_INFO_TYPE_NULL}; - } +Palette const *Actor::get_palette() { + auto actor_plugin = m_impl->get_actor_plugin(); - Actor::~Actor () - { - // nothing + if (m_impl->run_depth == VISUAL_VIDEO_DEPTH_8BIT) { + return actor_plugin->palette(m_impl->plugin); + } else { + return nullptr; } +} - VisPluginData* Actor::get_plugin () - { - return m_impl->plugin; - } +bool Actor::video_negotiate(VisVideoDepth run_depth, bool noevent, + bool forced) { + auto output_width = m_impl->video->get_width(); + auto output_height = m_impl->video->get_height(); + auto output_depth = m_impl->video->get_depth(); - bool Actor::realize () - { - return visual_plugin_realize (m_impl->plugin); - } + // Ask actor for preferred rendering dimensions - VideoPtr const& Actor::get_video () - { - return m_impl->video; - } + int run_width = output_width; + int run_height = output_height; - SongInfo const* Actor::get_songinfo () - { - return m_impl->get_actor_plugin ()->songinfo; - } + m_impl->get_actor_plugin()->requisition(m_impl->plugin, &run_width, + &run_height); - Palette const* Actor::get_palette () - { - auto actor_plugin = m_impl->get_actor_plugin (); + // Check to make sure requested run depth is supported. If not, pick the + // highest. - if (m_impl->run_depth == VISUAL_VIDEO_DEPTH_8BIT) { - return actor_plugin->palette (m_impl->plugin); - } else { - return nullptr; - } + auto supported_depths = get_supported_depths(); + m_impl->run_depth = + forced ? run_depth + : visual_video_depth_get_highest_nogl(supported_depths); + + if (!visual_video_depth_is_supported(supported_depths, m_impl->run_depth)) { + m_impl->run_depth = visual_video_depth_get_highest_nogl(supported_depths); } - bool Actor::video_negotiate (VisVideoDepth run_depth, bool noevent, bool forced) - { - auto output_width = m_impl->video->get_width (); - auto output_height = m_impl->video->get_height (); - auto output_depth = m_impl->video->get_depth (); + // Configure proxy videos to convert rendering - // Ask actor for preferred rendering dimensions + m_impl->to_scale.reset(); + m_impl->to_convert.reset(); - int run_width = output_width; - int run_height = output_height; + visual_log(VISUAL_LOG_DEBUG, "Setting up any necessary video conversions.."); - m_impl->get_actor_plugin ()->requisition (m_impl->plugin, &run_width, &run_height); + if (output_depth != VISUAL_VIDEO_DEPTH_GL) { + // Configure any necessary depth conversion + if (m_impl->run_depth != output_depth) { + visual_log(VISUAL_LOG_DEBUG, "Setting up depth conversion: %s -> %s", + visual_video_depth_name(m_impl->run_depth), + visual_video_depth_name(output_depth)); - // Check to make sure requested run depth is supported. If not, pick the highest. + m_impl->to_convert = + Video::create(run_width, run_height, m_impl->run_depth); + } - auto supported_depths = get_supported_depths (); - m_impl->run_depth = forced ? run_depth : visual_video_depth_get_highest_nogl (supported_depths); + // Configure any necessary scaling + if (run_width != output_width || run_height != output_height) { + visual_log(VISUAL_LOG_DEBUG, "Setting up scaling: (%dx%d) -> (%dx%d)", + run_width, run_height, output_width, output_height); - if (!visual_video_depth_is_supported (supported_depths, m_impl->run_depth)) { - m_impl->run_depth = visual_video_depth_get_highest_nogl (supported_depths); - } + m_impl->to_scale = Video::create(run_width, run_height, output_depth); + } + } else { + visual_log(VISUAL_LOG_DEBUG, + "Conversions skipped in OpenGL rendering mode"); + } - // Configure proxy videos to convert rendering + // FIXME: This should be moved into the if block above. It's out + // here because plugins depend on this to receive information + // about initial dimensions + if (!noevent) { + visual_event_queue_add(visual_plugin_get_event_queue(m_impl->plugin), + visual_event_new_resize(run_width, run_height)); + } - m_impl->to_scale.reset (); - m_impl->to_convert.reset (); + return true; +} - visual_log (VISUAL_LOG_DEBUG, "Setting up any necessary video conversions.."); +VisVideoDepth Actor::get_supported_depths() { + return m_impl->get_supported_depths(); +} - if (output_depth != VISUAL_VIDEO_DEPTH_GL) { - // Configure any necessary depth conversion - if (m_impl->run_depth != output_depth) { - visual_log (VISUAL_LOG_DEBUG, "Setting up depth conversion: %s -> %s", - visual_video_depth_name (m_impl->run_depth), - visual_video_depth_name (output_depth)); +VisVideoAttrOptions const *Actor::get_video_attribute_options() { + return &m_impl->get_actor_plugin()->vidoptions; +} - m_impl->to_convert = Video::create (run_width, run_height, m_impl->run_depth); - } +void Actor::set_video(VideoPtr const &video) { m_impl->video = video; } - // Configure any necessary scaling - if (run_width != output_width || run_height != output_height) { - visual_log (VISUAL_LOG_DEBUG, "Setting up scaling: (%dx%d) -> (%dx%d)", - run_width, run_height, output_width, output_height); +void Actor::run(Audio const &audio) { + visual_return_if_fail(m_impl->video); - m_impl->to_scale = Video::create (run_width, run_height, output_depth); - } - } else { - visual_log (VISUAL_LOG_DEBUG, "Conversions skipped in OpenGL rendering mode"); - } + auto actor_plugin = m_impl->get_actor_plugin(); + if (!actor_plugin) { + visual_log(VISUAL_LOG_ERROR, + "The given actor does not reference any actor plugin"); + return; + } - // FIXME: This should be moved into the if block above. It's out - // here because plugins depend on this to receive information - // about initial dimensions - if (!noevent) { - visual_event_queue_add (visual_plugin_get_event_queue (m_impl->plugin), - visual_event_new_resize (run_width, run_height)); - } + auto plugin = get_plugin(); - return true; - } + /* Songinfo handling */ + if (!visual_songinfo_compare(&m_impl->songcompare, actor_plugin->songinfo) || + m_impl->songcompare.get_elapsed() != + actor_plugin->songinfo->get_elapsed()) { - VisVideoDepth Actor::get_supported_depths () - { - return m_impl->get_supported_depths (); - } + actor_plugin->songinfo->mark(); - VisVideoAttrOptions const* Actor::get_video_attribute_options () - { - return &m_impl->get_actor_plugin ()->vidoptions; - } + visual_event_queue_add(visual_plugin_get_event_queue(plugin), + visual_event_new_newsong(actor_plugin->songinfo)); - void Actor::set_video (VideoPtr const& video) - { - m_impl->video = video; + visual_songinfo_copy(&m_impl->songcompare, actor_plugin->songinfo); } - void Actor::run (Audio const& audio) - { - visual_return_if_fail (m_impl->video); + // Get plugin to process all events + visual_plugin_events_pump(m_impl->plugin); - auto actor_plugin = m_impl->get_actor_plugin (); - if (!actor_plugin) { - visual_log (VISUAL_LOG_ERROR, "The given actor does not reference any actor plugin"); - return; - } + auto const &video = m_impl->video; + auto const &to_convert = m_impl->to_convert; + auto const &to_scale = m_impl->to_scale; - auto plugin = get_plugin (); + if (video->get_depth() != VISUAL_VIDEO_DEPTH_GL) { + auto palette = get_palette(); - /* Songinfo handling */ - if (!visual_songinfo_compare (&m_impl->songcompare, actor_plugin->songinfo) || - m_impl->songcompare.get_elapsed () != actor_plugin->songinfo->get_elapsed ()) { + if (to_convert) { + // Have depth conversion - actor_plugin->songinfo->mark (); + // Setup any palette + if (palette) { + to_convert->set_palette(*palette); + } - visual_event_queue_add (visual_plugin_get_event_queue (plugin), - visual_event_new_newsong (actor_plugin->songinfo)); + // Render first + actor_plugin->render(m_impl->plugin, to_convert.get(), + const_cast