[libgdx] Updated to Java 16 with libgdx's Eclipse null analysis settings.

This commit is contained in:
Nathan Sweet 2025-03-29 17:56:45 -04:00
parent 073f4d3ec4
commit a68a509076
27 changed files with 459 additions and 593 deletions

View File

@ -1,18 +1,22 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.annotationPath.allLocations=enabled
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=com.badlogic.gdx.annotation.Null.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull=com.badlogic.gdx.utils.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.badlogic.gdx.annotation.Null.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.badlogic.gdx.utils.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=com.badlogic.gdx.annotation.Null
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=com.esotericsoftware.spine.launcher.utils.Null,com.esotericsoftware.spine.server.utils.Null,com.esotericsoftware.spine.editor.utils.Null
org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning
org.eclipse.jdt.core.compiler.annotation.nullable=com.badlogic.gdx.utils.Null
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning
org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=16
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=16
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -21,14 +25,15 @@ org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
@ -40,8 +45,10 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
@ -52,12 +59,13 @@ org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=info
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
@ -81,9 +89,9 @@ org.eclipse.jdt.core.compiler.problem.potentialNullReference=info
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=info
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=info
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
@ -98,7 +106,7 @@ org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=info
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
@ -113,22 +121,22 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExcepti
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLambdaParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=info
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=16
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@ -136,20 +144,17 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@ -235,12 +240,11 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@ -271,8 +275,6 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@ -297,17 +299,13 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@ -355,8 +353,6 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@ -393,12 +389,9 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@ -424,10 +417,6 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=3
org.eclipse.jdt.core.formatter.use_on_off_tags=true
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true

View File

@ -1,18 +1,22 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.annotationPath.allLocations=enabled
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=com.badlogic.gdx.annotation.Null.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull=com.badlogic.gdx.utils.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.badlogic.gdx.annotation.Null.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.badlogic.gdx.utils.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=com.badlogic.gdx.annotation.Null
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=com.esotericsoftware.spine.launcher.utils.Null,com.esotericsoftware.spine.server.utils.Null,com.esotericsoftware.spine.editor.utils.Null
org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning
org.eclipse.jdt.core.compiler.annotation.nullable=com.badlogic.gdx.utils.Null
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning
org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=16
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=16
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -21,14 +25,15 @@ org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
@ -40,8 +45,10 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
@ -52,12 +59,13 @@ org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=info
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
@ -81,9 +89,9 @@ org.eclipse.jdt.core.compiler.problem.potentialNullReference=info
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=info
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=info
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
@ -98,7 +106,7 @@ org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=info
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
@ -113,22 +121,22 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExcepti
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLambdaParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=info
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=16
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@ -136,20 +144,17 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@ -235,12 +240,11 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@ -271,8 +275,6 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@ -297,17 +299,13 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@ -355,8 +353,6 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@ -393,12 +389,9 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@ -424,10 +417,6 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=3
org.eclipse.jdt.core.formatter.use_on_off_tags=true
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true

View File

@ -186,7 +186,7 @@ public class Animation {
}
/** The base class for all timelines. */
static public abstract class Timeline {
static abstract public class Timeline {
private final String[] propertyIds;
final float[] frames;
@ -277,7 +277,7 @@ public class Animation {
}
/** The base class for timelines that interpolate between frame values using stepped, linear, or a Bezier curve. */
static public abstract class CurveTimeline extends Timeline {
static abstract public class CurveTimeline extends Timeline {
static public final int LINEAR = 0, STEPPED = 1, BEZIER = 2, BEZIER_SIZE = 18;
float[] curves;
@ -314,7 +314,7 @@ public class Animation {
public void shrink (int bezierCount) {
int size = getFrameCount() + bezierCount * BEZIER_SIZE;
if (curves.length > size) {
float[] newCurves = new float[size];
var newCurves = new float[size];
arraycopy(curves, 0, newCurves, 0, size);
curves = newCurves;
}
@ -380,7 +380,7 @@ public class Animation {
}
/** The base class for a {@link CurveTimeline} that sets one property. */
static public abstract class CurveTimeline1 extends CurveTimeline {
static abstract public class CurveTimeline1 extends CurveTimeline {
static public final int ENTRIES = 2;
static final int VALUE = 1;
@ -517,7 +517,7 @@ public class Animation {
}
/** The base class for a {@link CurveTimeline} which sets two properties. */
static public abstract class CurveTimeline2 extends CurveTimeline {
static abstract public class CurveTimeline2 extends CurveTimeline {
static public final int ENTRIES = 3;
static final int VALUE1 = 1, VALUE2 = 2;
@ -1639,10 +1639,8 @@ public class Animation {
MixDirection direction) {
Slot slot = skeleton.slots.get(slotIndex);
if (!slot.bone.active) return;
Attachment slotAttachment = slot.attachment;
if (!(slotAttachment instanceof VertexAttachment)
|| ((VertexAttachment)slotAttachment).getTimelineAttachment() != attachment) return;
if (!slot.bone.active || !(slot.attachment instanceof VertexAttachment vertexAttachment)
|| vertexAttachment.getTimelineAttachment() != attachment) return;
FloatArray deformArray = slot.deform;
if (deformArray.size == 0) blend = setup;
@ -1662,7 +1660,6 @@ public class Animation {
return;
}
float[] deform = deformArray.setSize(vertexCount);
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
if (vertexAttachment.getBones() == null) {
// Unweighted vertex positions.
float[] setupVertices = vertexAttachment.getVertices();
@ -1684,7 +1681,6 @@ public class Animation {
float[] lastVertices = vertices[frames.length - 1];
if (alpha == 1) {
if (blend == add) {
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
if (vertexAttachment.getBones() == null) {
// Unweighted vertex positions, no alpha.
float[] setupVertices = vertexAttachment.getVertices();
@ -1702,7 +1698,6 @@ public class Animation {
} else {
switch (blend) {
case setup: {
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
if (vertexAttachment.getBones() == null) {
// Unweighted vertex positions, with alpha.
float[] setupVertices = vertexAttachment.getVertices();
@ -1724,7 +1719,6 @@ public class Animation {
deform[i] += (lastVertices[i] - deform[i]) * alpha;
break;
case add:
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
if (vertexAttachment.getBones() == null) {
// Unweighted vertex positions, no alpha.
float[] setupVertices = vertexAttachment.getVertices();
@ -1747,7 +1741,6 @@ public class Animation {
if (alpha == 1) {
if (blend == add) {
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
if (vertexAttachment.getBones() == null) {
// Unweighted vertex positions, no alpha.
float[] setupVertices = vertexAttachment.getVertices();
@ -1772,7 +1765,6 @@ public class Animation {
} else {
switch (blend) {
case setup: {
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
if (vertexAttachment.getBones() == null) {
// Unweighted vertex positions, with alpha.
float[] setupVertices = vertexAttachment.getVertices();
@ -1798,7 +1790,6 @@ public class Animation {
}
break;
case add:
VertexAttachment vertexAttachment = (VertexAttachment)slotAttachment;
if (vertexAttachment.getBones() == null) {
// Unweighted vertex positions, with alpha.
float[] setupVertices = vertexAttachment.getVertices();
@ -2307,7 +2298,7 @@ public class Animation {
}
/** The base class for most {@link PhysicsConstraint} timelines. */
static public abstract class PhysicsConstraintTimeline extends CurveTimeline1 {
static abstract public class PhysicsConstraintTimeline extends CurveTimeline1 {
final int constraintIndex;
/** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */
@ -2616,8 +2607,8 @@ public class Animation {
if (!slot.bone.active) return;
Attachment slotAttachment = slot.attachment;
if (slotAttachment != attachment) {
if (!(slotAttachment instanceof VertexAttachment)
|| ((VertexAttachment)slotAttachment).getTimelineAttachment() != attachment) return;
if (!(slotAttachment instanceof VertexAttachment vertexAttachment)
|| vertexAttachment.getTimelineAttachment() != attachment) return;
}
Sequence sequence = ((HasTextureRegion)slotAttachment).getSequence();
if (sequence == null) return;

View File

@ -116,7 +116,7 @@ public class AnimationState {
delta *= timeScale;
Object[] tracks = this.tracks.items;
for (int i = 0, n = this.tracks.size; i < n; i++) {
TrackEntry current = (TrackEntry)tracks[i];
var current = (TrackEntry)tracks[i];
if (current == null) continue;
current.animationLast = current.nextAnimationLast;
@ -208,7 +208,7 @@ public class AnimationState {
boolean applied = false;
Object[] tracks = this.tracks.items;
for (int i = 0, n = this.tracks.size; i < n; i++) {
TrackEntry current = (TrackEntry)tracks[i];
var current = (TrackEntry)tracks[i];
if (current == null || current.delay > 0) continue;
applied = true;
@ -236,8 +236,8 @@ public class AnimationState {
if (i == 0) attachments = true;
for (int ii = 0; ii < timelineCount; ii++) {
Object timeline = timelines[ii];
if (timeline instanceof AttachmentTimeline)
applyAttachmentTimeline((AttachmentTimeline)timeline, skeleton, applyTime, blend, attachments);
if (timeline instanceof AttachmentTimeline attachmentTimeline)
applyAttachmentTimeline(attachmentTimeline, skeleton, applyTime, blend, attachments);
else
((Timeline)timeline).apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection.in);
}
@ -250,13 +250,13 @@ public class AnimationState {
float[] timelinesRotation = current.timelinesRotation.items;
for (int ii = 0; ii < timelineCount; ii++) {
Timeline timeline = (Timeline)timelines[ii];
var timeline = (Timeline)timelines[ii];
MixBlend timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;
if (!shortestRotation && timeline instanceof RotateTimeline) {
applyRotateTimeline((RotateTimeline)timeline, skeleton, applyTime, alpha, timelineBlend, timelinesRotation,
ii << 1, firstFrame);
} else if (timeline instanceof AttachmentTimeline)
applyAttachmentTimeline((AttachmentTimeline)timeline, skeleton, applyTime, blend, attachments);
if (!shortestRotation && timeline instanceof RotateTimeline rotateTimeline) {
applyRotateTimeline(rotateTimeline, skeleton, applyTime, alpha, timelineBlend, timelinesRotation, ii << 1,
firstFrame);
} else if (timeline instanceof AttachmentTimeline attachmentTimeline)
applyAttachmentTimeline(attachmentTimeline, skeleton, applyTime, blend, attachments);
else
timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, MixDirection.in);
}
@ -273,7 +273,7 @@ public class AnimationState {
int setupState = unkeyedState + SETUP;
Object[] slots = skeleton.slots.items;
for (int i = 0, n = skeleton.slots.size; i < n; i++) {
Slot slot = (Slot)slots[i];
var slot = (Slot)slots[i];
if (slot.attachmentState == setupState) {
String attachmentName = slot.data.attachmentName;
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
@ -325,7 +325,7 @@ public class AnimationState {
from.totalAlpha = 0;
for (int i = 0; i < timelineCount; i++) {
Timeline timeline = (Timeline)timelines[i];
var timeline = (Timeline)timelines[i];
MixDirection direction = MixDirection.out;
MixBlend timelineBlend;
float alpha;
@ -349,16 +349,16 @@ public class AnimationState {
break;
default: // HOLD_MIX
timelineBlend = MixBlend.setup;
TrackEntry holdMix = (TrackEntry)timelineHoldMix[i];
var holdMix = (TrackEntry)timelineHoldMix[i];
alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);
break;
}
from.totalAlpha += alpha;
if (!shortestRotation && timeline instanceof RotateTimeline) {
applyRotateTimeline((RotateTimeline)timeline, skeleton, applyTime, alpha, timelineBlend, timelinesRotation, i << 1,
if (!shortestRotation && timeline instanceof RotateTimeline rotateTimeline) {
applyRotateTimeline(rotateTimeline, skeleton, applyTime, alpha, timelineBlend, timelinesRotation, i << 1,
firstFrame);
} else if (timeline instanceof AttachmentTimeline)
applyAttachmentTimeline((AttachmentTimeline)timeline, skeleton, applyTime, timelineBlend,
} else if (timeline instanceof AttachmentTimeline attachmentTimeline)
applyAttachmentTimeline(attachmentTimeline, skeleton, applyTime, timelineBlend,
attachments && alpha >= from.alphaAttachmentThreshold);
else {
if (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == MixBlend.setup)
@ -475,7 +475,7 @@ public class AnimationState {
Object[] events = this.events.items;
int i = 0, n = this.events.size;
for (; i < n; i++) {
Event event = (Event)events[i];
var event = (Event)events[i];
if (event.time < trackLastWrapped) break;
if (event.time > animationEnd) continue; // Discard events outside animation start/end.
queue.event(entry, event);
@ -496,7 +496,7 @@ public class AnimationState {
// Queue events after complete.
for (; i < n; i++) {
Event event = (Event)events[i];
var event = (Event)events[i];
if (event.time < animationStart) continue; // Discard events outside animation start/end.
queue.event(entry, event);
}
@ -694,7 +694,7 @@ public class AnimationState {
queue.drainDisabled = true;
Object[] tracks = this.tracks.items;
for (int i = 0, n = this.tracks.size; i < n; i++) {
TrackEntry current = (TrackEntry)tracks[i];
var current = (TrackEntry)tracks[i];
if (current != null) setEmptyAnimation(current.trackIndex, mixDuration);
}
queue.drainDisabled = oldDrainDisabled;
@ -762,7 +762,7 @@ public class AnimationState {
int n = tracks.size;
Object[] tracks = this.tracks.items;
for (int i = 0; i < n; i++) {
TrackEntry entry = (TrackEntry)tracks[i];
var entry = (TrackEntry)tracks[i];
if (entry == null) continue;
while (entry.mixingFrom != null) // Move to last entry, then iterate in reverse.
entry = entry.mixingFrom;
@ -790,7 +790,7 @@ public class AnimationState {
outer:
for (int i = 0; i < timelinesCount; i++) {
Timeline timeline = (Timeline)timelines[i];
var timeline = (Timeline)timelines[i];
String[] ids = timeline.getPropertyIds();
if (!propertyIds.addAll(ids))
timelineMode[i] = SUBSEQUENT;
@ -870,10 +870,10 @@ public class AnimationState {
}
public String toString () {
StringBuilder buffer = new StringBuilder(64);
var buffer = new StringBuilder(64);
Object[] tracks = this.tracks.items;
for (int i = 0, n = this.tracks.size; i < n; i++) {
TrackEntry entry = (TrackEntry)tracks[i];
var entry = (TrackEntry)tracks[i];
if (entry == null) continue;
if (buffer.length() > 0) buffer.append(", ");
buffer.append(entry.toString());
@ -1348,8 +1348,8 @@ public class AnimationState {
SnapshotArray<AnimationStateListener> listenersArray = AnimationState.this.listeners;
for (int i = 0; i < this.objects.size; i += 2) {
EventType type = (EventType)objects.get(i);
TrackEntry entry = (TrackEntry)objects.get(i + 1);
var type = (EventType)objects.get(i);
var entry = (TrackEntry)objects.get(i + 1);
int listenersCount = listenersArray.size;
Object[] listeners = listenersArray.begin();
switch (type) {
@ -1380,7 +1380,7 @@ public class AnimationState {
((AnimationStateListener)listeners[ii]).complete(entry);
break;
case event:
Event event = (Event)objects.get(i++ + 2);
var event = (Event)objects.get(i++ + 2);
if (entry.listener != null) entry.listener.event(entry, event);
for (int ii = 0; ii < listenersCount; ii++)
((AnimationStateListener)listeners[ii]).event(entry, event);
@ -1448,7 +1448,7 @@ public class AnimationState {
public void event (TrackEntry entry, Event event);
}
static public abstract class AnimationStateAdapter implements AnimationStateListener {
static abstract public class AnimationStateAdapter implements AnimationStateListener {
public void start (TrackEntry entry) {
}

View File

@ -67,7 +67,7 @@ public class AnimationStateData {
public void setMix (Animation from, Animation to, float duration) {
if (from == null) throw new IllegalArgumentException("from cannot be null.");
if (to == null) throw new IllegalArgumentException("to cannot be null.");
Key key = new Key();
var key = new Key();
key.a1 = from;
key.a2 = to;
animationToMixTime.put(key, duration);
@ -102,7 +102,7 @@ public class AnimationStateData {
public boolean equals (Object obj) {
if (this == obj) return true;
if (obj == null) return false;
Key other = (Key)obj;
var other = (Key)obj;
if (a1 == null) {
if (other.a1 != null) return false;
} else if (!a1.equals(other.a1)) return false;

View File

@ -130,7 +130,7 @@ public class Bone implements Updatable {
worldY = pc * x + pd * y + parent.worldY;
switch (inherit) {
case normal: {
case normal -> {
float rx = (rotation + shearX) * degRad;
float ry = (rotation + 90 + shearY) * degRad;
float la = cos(rx) * scaleX;
@ -143,16 +143,15 @@ public class Bone implements Updatable {
d = pc * lb + pd * ld;
return;
}
case onlyTranslation: {
case onlyTranslation -> {
float rx = (rotation + shearX) * degRad;
float ry = (rotation + 90 + shearY) * degRad;
a = cos(rx) * scaleX;
b = cos(ry) * scaleY;
c = sin(rx) * scaleX;
d = sin(ry) * scaleY;
break;
}
case noRotationOrReflection: {
case noRotationOrReflection -> {
float sx = 1 / skeleton.scaleX, sy = 1 / skeleton.scaleY;
pa *= sx;
pc *= sy;
@ -177,10 +176,8 @@ public class Bone implements Updatable {
b = pa * lb - pb * ld;
c = pc * la + pd * lc;
d = pc * lb + pd * ld;
break;
}
case noScale:
case noScaleOrReflection:
case noScale, noScaleOrReflection -> {
rotation *= degRad;
float cos = cos(rotation), sin = sin(rotation);
float za = (pa * cos + pb * sin) / skeleton.scaleX;
@ -205,6 +202,7 @@ public class Bone implements Updatable {
c = zc * la + zd * lc;
d = zc * lb + zd * ld;
}
}
a *= skeleton.scaleX;
b *= skeleton.scaleX;
c *= skeleton.scaleY;
@ -440,17 +438,15 @@ public class Bone implements Updatable {
rd = d;
} else {
switch (inherit) {
case noRotationOrReflection: {
case noRotationOrReflection -> {
float s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);
pb = -pc * skeleton.scaleX * s / skeleton.scaleY;
pd = pa * skeleton.scaleY * s / skeleton.scaleX;
pid = 1 / (pa * pd - pb * pc);
ia = pd * pid;
ib = pb * pid;
break;
}
case noScale:
case noScaleOrReflection:
case noScale, noScaleOrReflection -> {
float r = rotation * degRad, cos = cos(r), sin = sin(r);
pa = (pa * cos + pb * sin) / skeleton.scaleX;
pc = (pc * cos + pd * sin) / skeleton.scaleY;
@ -469,6 +465,7 @@ public class Bone implements Updatable {
ic = pc * pid;
id = pa * pid;
}
}
ra = ia * a - ib * c;
rb = ia * b - ib * d;
rc = id * c - ic * a;

View File

@ -94,12 +94,9 @@ public class IkConstraint implements Updatable {
Bone target = this.target;
Object[] bones = this.bones.items;
switch (this.bones.size) {
case 1:
apply((Bone)bones[0], target.worldX, target.worldY, compress, stretch, data.uniform, mix);
break;
case 2:
case 1 -> apply((Bone)bones[0], target.worldX, target.worldY, compress, stretch, data.uniform, mix);
case 2 -> //
apply((Bone)bones[0], (Bone)bones[1], target.worldX, target.worldY, bendDirection, stretch, data.uniform, softness, mix);
break;
}
}
@ -222,11 +219,11 @@ public class IkConstraint implements Updatable {
float sx = bone.ascaleX, sy = bone.ascaleY;
if (compress || stretch) {
switch (bone.inherit) {
case noScale:
case noScaleOrReflection:
case noScale, noScaleOrReflection -> {
tx = targetX - bone.worldX;
ty = targetY - bone.worldY;
}
}
float b = bone.data.length * sx;
if (b > 0.0001f) {
float dd = tx * tx + ty * ty;

View File

@ -40,7 +40,6 @@ import com.esotericsoftware.spine.PathConstraintData.PositionMode;
import com.esotericsoftware.spine.PathConstraintData.RotateMode;
import com.esotericsoftware.spine.PathConstraintData.SpacingMode;
import com.esotericsoftware.spine.Skeleton.Physics;
import com.esotericsoftware.spine.attachments.Attachment;
import com.esotericsoftware.spine.attachments.PathAttachment;
/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the
@ -102,8 +101,7 @@ public class PathConstraint implements Updatable {
/** Applies the constraint to the constrained bones. */
public void update (Physics physics) {
Attachment attachment = target.attachment;
if (!(attachment instanceof PathAttachment)) return;
if (!(target.attachment instanceof PathAttachment pathAttachment)) return;
float mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY;
if (mixRotate == 0 && mixX == 0 && mixY == 0) return;
@ -116,21 +114,21 @@ public class PathConstraint implements Updatable {
float spacing = this.spacing;
switch (data.spacingMode) {
case percent:
case percent -> {
if (scale) {
for (int i = 0, n = spacesCount - 1; i < n; i++) {
Bone bone = (Bone)bones[i];
var bone = (Bone)bones[i];
float setupLength = bone.data.length;
float x = setupLength * bone.a, y = setupLength * bone.c;
lengths[i] = (float)Math.sqrt(x * x + y * y);
}
}
Arrays.fill(spaces, 1, spacesCount, spacing);
break;
case proportional:
}
case proportional -> {
float sum = 0;
for (int i = 0, n = spacesCount - 1; i < n;) {
Bone bone = (Bone)bones[i];
var bone = (Bone)bones[i];
float setupLength = bone.data.length;
if (setupLength < epsilon) {
if (scale) lengths[i] = 0;
@ -148,11 +146,11 @@ public class PathConstraint implements Updatable {
for (int i = 1; i < spacesCount; i++)
spaces[i] *= sum;
}
break;
default:
}
default -> {
boolean lengthSpacing = data.spacingMode == SpacingMode.length;
for (int i = 0, n = spacesCount - 1; i < n;) {
Bone bone = (Bone)bones[i];
var bone = (Bone)bones[i];
float setupLength = bone.data.length;
if (setupLength < epsilon) {
if (scale) lengths[i] = 0;
@ -165,8 +163,9 @@ public class PathConstraint implements Updatable {
}
}
}
}
float[] positions = computeWorldPositions((PathAttachment)attachment, spacesCount, tangents);
float[] positions = computeWorldPositions(pathAttachment, spacesCount, tangents);
float boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;
boolean tip;
if (offsetRotation == 0)
@ -177,7 +176,7 @@ public class PathConstraint implements Updatable {
offsetRotation *= p.a * p.d - p.b * p.c > 0 ? degRad : -degRad;
}
for (int i = 0, p = 3; i < boneCount; i++, p += 3) {
Bone bone = (Bone)bones[i];
var bone = (Bone)bones[i];
bone.worldX += (boneX - bone.worldX) * mixX;
bone.worldY += (boneY - bone.worldY) * mixY;
float x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;
@ -238,17 +237,11 @@ public class PathConstraint implements Updatable {
if (data.positionMode == PositionMode.percent) position *= pathLength;
float multiplier;
switch (data.spacingMode) {
case percent:
multiplier = pathLength;
break;
case proportional:
multiplier = pathLength / spacesCount;
break;
default:
multiplier = 1;
}
float multiplier = switch (data.spacingMode) {
case percent -> pathLength;
case proportional -> pathLength / spacesCount;
default -> 1;
};
world = this.world.setSize(8);
for (int i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {
@ -356,17 +349,11 @@ public class PathConstraint implements Updatable {
if (data.positionMode == PositionMode.percent) position *= pathLength;
float multiplier;
switch (data.spacingMode) {
case percent:
multiplier = pathLength;
break;
case proportional:
multiplier = pathLength / spacesCount;
break;
default:
multiplier = 1;
}
float multiplier = switch (data.spacingMode) {
case percent -> pathLength;
case proportional -> pathLength / spacesCount;
default -> 1;
};
float[] segments = this.segments;
float curveLength = 0;

View File

@ -38,7 +38,11 @@ import com.badlogic.gdx.utils.FloatArray;
import com.badlogic.gdx.utils.Null;
import com.esotericsoftware.spine.Skin.SkinEntry;
import com.esotericsoftware.spine.attachments.*;
import com.esotericsoftware.spine.attachments.Attachment;
import com.esotericsoftware.spine.attachments.ClippingAttachment;
import com.esotericsoftware.spine.attachments.MeshAttachment;
import com.esotericsoftware.spine.attachments.PathAttachment;
import com.esotericsoftware.spine.attachments.RegionAttachment;
import com.esotericsoftware.spine.utils.SkeletonClipping;
/** Stores the current pose for a skeleton.
@ -71,7 +75,7 @@ public class Skeleton {
if (boneData.parent == null)
bone = new Bone(boneData, this, null);
else {
Bone parent = (Bone)bones[boneData.parent.index];
var parent = (Bone)bones[boneData.parent.index];
bone = new Bone(boneData, this, parent);
parent.children.add(bone);
}
@ -81,8 +85,8 @@ public class Skeleton {
slots = new Array(data.slots.size);
drawOrder = new Array(data.slots.size);
for (SlotData slotData : data.slots) {
Bone bone = (Bone)bones[slotData.boneData.index];
Slot slot = new Slot(slotData, bone);
var bone = (Bone)bones[slotData.boneData.index];
var slot = new Slot(slotData, bone);
slots.add(slot);
drawOrder.add(slot);
}
@ -172,14 +176,14 @@ public class Skeleton {
int boneCount = bones.size;
Object[] bones = this.bones.items;
for (int i = 0; i < boneCount; i++) {
Bone bone = (Bone)bones[i];
var bone = (Bone)bones[i];
bone.sorted = bone.data.skinRequired;
bone.active = !bone.sorted;
}
if (skin != null) {
Object[] skinBones = skin.bones.items;
for (int i = 0, n = skin.bones.size; i < n; i++) {
Bone bone = (Bone)bones[((BoneData)skinBones[i]).index];
var bone = (Bone)bones[((BoneData)skinBones[i]).index];
do {
bone.sorted = false;
bone.active = true;
@ -196,28 +200,28 @@ public class Skeleton {
outer:
for (int i = 0; i < constraintCount; i++) {
for (int ii = 0; ii < ikCount; ii++) {
IkConstraint constraint = (IkConstraint)ikConstraints[ii];
var constraint = (IkConstraint)ikConstraints[ii];
if (constraint.data.order == i) {
sortIkConstraint(constraint);
continue outer;
}
}
for (int ii = 0; ii < transformCount; ii++) {
TransformConstraint constraint = (TransformConstraint)transformConstraints[ii];
var constraint = (TransformConstraint)transformConstraints[ii];
if (constraint.data.order == i) {
sortTransformConstraint(constraint);
continue outer;
}
}
for (int ii = 0; ii < pathCount; ii++) {
PathConstraint constraint = (PathConstraint)pathConstraints[ii];
var constraint = (PathConstraint)pathConstraints[ii];
if (constraint.data.order == i) {
sortPathConstraint(constraint);
continue outer;
}
}
for (int ii = 0; ii < physicsCount; ii++) {
PhysicsConstraint constraint = (PhysicsConstraint)physicsConstraints[ii];
var constraint = (PhysicsConstraint)physicsConstraints[ii];
if (constraint.data.order == i) {
sortPhysicsConstraint(constraint);
continue outer;
@ -265,7 +269,7 @@ public class Skeleton {
int boneCount = constraint.bones.size;
if (constraint.data.local) {
for (int i = 0; i < boneCount; i++) {
Bone child = (Bone)constrained[i];
var child = (Bone)constrained[i];
sortBone(child.parent);
sortBone(child);
}
@ -294,8 +298,7 @@ public class Skeleton {
if (data.defaultSkin != null && data.defaultSkin != skin)
sortPathConstraintAttachment(data.defaultSkin, slotIndex, slotBone);
Attachment attachment = slot.attachment;
if (attachment instanceof PathAttachment) sortPathConstraintAttachment(attachment, slotBone);
sortPathConstraintAttachment(slot.attachment, slotBone);
Object[] constrained = constraint.bones.items;
int boneCount = constraint.bones.size;
@ -313,14 +316,14 @@ public class Skeleton {
private void sortPathConstraintAttachment (Skin skin, int slotIndex, Bone slotBone) {
Object[] entries = skin.attachments.orderedItems().items;
for (int i = 0, n = skin.attachments.size; i < n; i++) {
SkinEntry entry = (SkinEntry)entries[i];
var entry = (SkinEntry)entries[i];
if (entry.slotIndex == slotIndex) sortPathConstraintAttachment(entry.attachment, slotBone);
}
}
private void sortPathConstraintAttachment (Attachment attachment, Bone slotBone) {
if (!(attachment instanceof PathAttachment)) return;
int[] pathBones = ((PathAttachment)attachment).getBones();
if (!(attachment instanceof PathAttachment pathAttachment)) return;
int[] pathBones = pathAttachment.getBones();
if (pathBones == null)
sortBone(slotBone);
else {
@ -359,7 +362,7 @@ public class Skeleton {
private void sortReset (Array<Bone> bones) {
Object[] items = bones.items;
for (int i = 0, n = bones.size; i < n; i++) {
Bone bone = (Bone)items[i];
var bone = (Bone)items[i];
if (!bone.active) continue;
if (bone.sorted) sortReset(bone.children);
bone.sorted = false;
@ -373,7 +376,7 @@ public class Skeleton {
public void updateWorldTransform (Physics physics) {
Object[] bones = this.bones.items;
for (int i = 0, n = this.bones.size; i < n; i++) {
Bone bone = (Bone)bones[i];
var bone = (Bone)bones[i];
bone.ax = bone.x;
bone.ay = bone.y;
bone.arotation = bone.rotation;
@ -398,7 +401,7 @@ public class Skeleton {
Object[] bones = this.bones.items;
for (int i = 1, n = this.bones.size; i < n; i++) { // Skip root bone.
Bone bone = (Bone)bones[i];
var bone = (Bone)bones[i];
bone.ax = bone.x;
bone.ay = bone.y;
bone.arotation = bone.rotation;
@ -428,7 +431,7 @@ public class Skeleton {
// Update everything except root bone.
Object[] updateCache = this.updateCache.items;
for (int i = 0, n = this.updateCache.size; i < n; i++) {
Updatable updatable = (Updatable)updateCache[i];
var updatable = (Updatable)updateCache[i];
if (updatable != rootBone) updatable.update(physics);
}
}
@ -497,7 +500,7 @@ public class Skeleton {
if (boneName == null) throw new IllegalArgumentException("boneName cannot be null.");
Object[] bones = this.bones.items;
for (int i = 0, n = this.bones.size; i < n; i++) {
Bone bone = (Bone)bones[i];
var bone = (Bone)bones[i];
if (bone.data.name.equals(boneName)) return bone;
}
return null;
@ -514,7 +517,7 @@ public class Skeleton {
if (slotName == null) throw new IllegalArgumentException("slotName cannot be null.");
Object[] slots = this.slots.items;
for (int i = 0, n = this.slots.size; i < n; i++) {
Slot slot = (Slot)slots[i];
var slot = (Slot)slots[i];
if (slot.data.name.equals(slotName)) return slot;
}
return null;
@ -562,7 +565,7 @@ public class Skeleton {
else {
Object[] slots = this.slots.items;
for (int i = 0, n = this.slots.size; i < n; i++) {
Slot slot = (Slot)slots[i];
var slot = (Slot)slots[i];
String name = slot.data.attachmentName;
if (name != null) {
Attachment attachment = newSkin.getAttachment(i, name);
@ -626,7 +629,7 @@ public class Skeleton {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Object[] ikConstraints = this.ikConstraints.items;
for (int i = 0, n = this.ikConstraints.size; i < n; i++) {
IkConstraint ikConstraint = (IkConstraint)ikConstraints[i];
var ikConstraint = (IkConstraint)ikConstraints[i];
if (ikConstraint.data.name.equals(constraintName)) return ikConstraint;
}
return null;
@ -643,7 +646,7 @@ public class Skeleton {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Object[] transformConstraints = this.transformConstraints.items;
for (int i = 0, n = this.transformConstraints.size; i < n; i++) {
TransformConstraint constraint = (TransformConstraint)transformConstraints[i];
var constraint = (TransformConstraint)transformConstraints[i];
if (constraint.data.name.equals(constraintName)) return constraint;
}
return null;
@ -660,7 +663,7 @@ public class Skeleton {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Object[] pathConstraints = this.pathConstraints.items;
for (int i = 0, n = this.pathConstraints.size; i < n; i++) {
PathConstraint constraint = (PathConstraint)pathConstraints[i];
var constraint = (PathConstraint)pathConstraints[i];
if (constraint.data.name.equals(constraintName)) return constraint;
}
return null;
@ -677,7 +680,7 @@ public class Skeleton {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Object[] physicsConstraints = this.physicsConstraints.items;
for (int i = 0, n = this.physicsConstraints.size; i < n; i++) {
PhysicsConstraint constraint = (PhysicsConstraint)physicsConstraints[i];
var constraint = (PhysicsConstraint)physicsConstraints[i];
if (constraint.data.name.equals(constraintName)) return constraint;
}
return null;
@ -704,26 +707,23 @@ public class Skeleton {
Object[] drawOrder = this.drawOrder.items;
float minX = Integer.MAX_VALUE, minY = Integer.MAX_VALUE, maxX = Integer.MIN_VALUE, maxY = Integer.MIN_VALUE;
for (int i = 0, n = this.drawOrder.size; i < n; i++) {
Slot slot = (Slot)drawOrder[i];
var slot = (Slot)drawOrder[i];
if (!slot.bone.active) continue;
int verticesLength = 0;
float[] vertices = null;
short[] triangles = null;
Attachment attachment = slot.attachment;
if (attachment instanceof RegionAttachment) {
RegionAttachment region = (RegionAttachment)attachment;
if (attachment instanceof RegionAttachment region) {
verticesLength = 8;
vertices = temp.setSize(8);
region.computeWorldVertices(slot, vertices, 0, 2);
triangles = quadTriangles;
} else if (attachment instanceof MeshAttachment) {
MeshAttachment mesh = (MeshAttachment)attachment;
} else if (attachment instanceof MeshAttachment mesh) {
verticesLength = mesh.getWorldVerticesLength();
vertices = temp.setSize(verticesLength);
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
triangles = mesh.getTriangles();
} else if (attachment instanceof ClippingAttachment && clipper != null) {
ClippingAttachment clip = (ClippingAttachment)attachment;
} else if (attachment instanceof ClippingAttachment clip && clipper != null) {
clipper.clipStart(slot, clip);
continue;
}

View File

@ -165,8 +165,8 @@ public class SkeletonBinary extends SkeletonLoader {
float scale = this.scale;
SkeletonInput input = new SkeletonInput(dataInput);
SkeletonData skeletonData = new SkeletonData();
var input = new SkeletonInput(dataInput);
var skeletonData = new SkeletonData();
try {
long hash = input.readLong();
skeletonData.hash = hash == 0 ? null : Long.toString(hash);
@ -202,7 +202,7 @@ public class SkeletonBinary extends SkeletonLoader {
for (int i = 0; i < n; i++) {
String name = input.readString();
BoneData parent = i == 0 ? null : (BoneData)bones[input.readInt(true)];
BoneData data = new BoneData(i, name, parent);
var data = new BoneData(i, name, parent);
data.rotation = input.readFloat();
data.x = input.readFloat() * scale;
data.y = input.readFloat() * scale;
@ -225,8 +225,8 @@ public class SkeletonBinary extends SkeletonLoader {
Object[] slots = skeletonData.slots.setSize(n = input.readInt(true));
for (int i = 0; i < n; i++) {
String slotName = input.readString();
BoneData boneData = (BoneData)bones[input.readInt(true)];
SlotData data = new SlotData(i, slotName, boneData);
var boneData = (BoneData)bones[input.readInt(true)];
var data = new SlotData(i, slotName, boneData);
Color.rgba8888ToColor(data.color, input.readInt());
int darkColor = input.readInt();
@ -241,7 +241,7 @@ public class SkeletonBinary extends SkeletonLoader {
// IK constraints.
o = skeletonData.ikConstraints.setSize(n = input.readInt(true));
for (int i = 0, nn; i < n; i++) {
IkConstraintData data = new IkConstraintData(input.readString());
var data = new IkConstraintData(input.readString());
data.order = input.readInt(true);
Object[] constraintBones = data.bones.setSize(nn = input.readInt(true));
for (int ii = 0; ii < nn; ii++)
@ -261,7 +261,7 @@ public class SkeletonBinary extends SkeletonLoader {
// Transform constraints.
o = skeletonData.transformConstraints.setSize(n = input.readInt(true));
for (int i = 0, nn; i < n; i++) {
TransformConstraintData data = new TransformConstraintData(input.readString());
var data = new TransformConstraintData(input.readString());
data.order = input.readInt(true);
Object[] constraintBones = data.bones.setSize(nn = input.readInt(true));
for (int ii = 0; ii < nn; ii++)
@ -290,7 +290,7 @@ public class SkeletonBinary extends SkeletonLoader {
// Path constraints.
o = skeletonData.pathConstraints.setSize(n = input.readInt(true));
for (int i = 0, nn; i < n; i++) {
PathConstraintData data = new PathConstraintData(input.readString());
var data = new PathConstraintData(input.readString());
data.order = input.readInt(true);
data.skinRequired = input.readBoolean();
Object[] constraintBones = data.bones.setSize(nn = input.readInt(true));
@ -315,7 +315,7 @@ public class SkeletonBinary extends SkeletonLoader {
// Physics constraints.
o = skeletonData.physicsConstraints.setSize(n = input.readInt(true));
for (int i = 0; i < n; i++) {
PhysicsConstraintData data = new PhysicsConstraintData(input.readString());
var data = new PhysicsConstraintData(input.readString());
data.order = input.readInt(true);
data.bone = (BoneData)bones[input.readInt(true)];
int flags = input.read();
@ -364,7 +364,7 @@ public class SkeletonBinary extends SkeletonLoader {
n = linkedMeshes.size;
Object[] items = linkedMeshes.items;
for (int i = 0; i < n; i++) {
LinkedMesh linkedMesh = (LinkedMesh)items[i];
var linkedMesh = (LinkedMesh)items[i];
Skin skin = skeletonData.skins.get(linkedMesh.skinIndex);
Attachment parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
if (parent == null) throw new SerializationException("Parent mesh not found: " + linkedMesh.parent);
@ -377,7 +377,7 @@ public class SkeletonBinary extends SkeletonLoader {
// Events.
o = skeletonData.events.setSize(n = input.readInt(true));
for (int i = 0; i < n; i++) {
EventData data = new EventData(input.readString());
var data = new EventData(input.readString());
data.intValue = input.readInt(false);
data.floatValue = input.readFloat();
data.stringValue = input.readString();
@ -563,7 +563,7 @@ public class SkeletonBinary extends SkeletonLoader {
boolean closed = (flags & 16) != 0;
boolean constantSpeed = (flags & 32) != 0;
Vertices vertices = readVertices(input, (flags & 64) != 0);
float[] lengths = new float[vertices.length / 6];
var lengths = new float[vertices.length / 6];
for (int i = 0, n = lengths.length; i < n; i++)
lengths[i] = input.readFloat() * scale;
int color = nonessential ? input.readInt() : 0;
@ -611,7 +611,7 @@ public class SkeletonBinary extends SkeletonLoader {
}
private Sequence readSequence (SkeletonInput input) throws IOException {
Sequence sequence = new Sequence(input.readInt(true));
var sequence = new Sequence(input.readInt(true));
sequence.setStart(input.readInt(true));
sequence.setDigits(input.readInt(true));
sequence.setSetupIndex(input.readInt(true));
@ -621,14 +621,14 @@ public class SkeletonBinary extends SkeletonLoader {
private Vertices readVertices (SkeletonInput input, boolean weighted) throws IOException {
float scale = this.scale;
int vertexCount = input.readInt(true);
Vertices vertices = new Vertices();
var vertices = new Vertices();
vertices.length = vertexCount << 1;
if (!weighted) {
vertices.vertices = readFloatArray(input, vertices.length, scale);
return vertices;
}
FloatArray weights = new FloatArray(vertices.length * 3 * 3);
IntArray bonesArray = new IntArray(vertices.length * 3);
var weights = new FloatArray(vertices.length * 3 * 3);
var bonesArray = new IntArray(vertices.length * 3);
for (int i = 0; i < vertexCount; i++) {
int boneCount = input.readInt(true);
bonesArray.add(boneCount);
@ -645,7 +645,7 @@ public class SkeletonBinary extends SkeletonLoader {
}
private float[] readFloatArray (SkeletonInput input, int n, float scale) throws IOException {
float[] array = new float[n];
var array = new float[n];
if (scale == 1) {
for (int i = 0; i < n; i++)
array[i] = input.readFloat();
@ -657,14 +657,14 @@ public class SkeletonBinary extends SkeletonLoader {
}
private short[] readShortArray (SkeletonInput input, int n) throws IOException {
short[] array = new short[n];
var array = new short[n];
for (int i = 0; i < n; i++)
array[i] = (short)input.readInt(true);
return array;
}
private Animation readAnimation (SkeletonInput input, String name, SkeletonData skeletonData) throws IOException {
Array<Timeline> timelines = new Array(input.readInt(true));
var timelines = new Array<Timeline>(input.readInt(true));
float scale = this.scale;
// Slot timelines.
@ -673,15 +673,14 @@ public class SkeletonBinary extends SkeletonLoader {
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++) {
int timelineType = input.readByte(), frameCount = input.readInt(true), frameLast = frameCount - 1;
switch (timelineType) {
case SLOT_ATTACHMENT: {
AttachmentTimeline timeline = new AttachmentTimeline(frameCount, slotIndex);
case SLOT_ATTACHMENT -> {
var timeline = new AttachmentTimeline(frameCount, slotIndex);
for (int frame = 0; frame < frameCount; frame++)
timeline.setFrame(frame, input.readFloat(), input.readStringRef());
timelines.add(timeline);
break;
}
case SLOT_RGBA: {
RGBATimeline timeline = new RGBATimeline(frameCount, input.readInt(true), slotIndex);
case SLOT_RGBA -> {
var timeline = new RGBATimeline(frameCount, input.readInt(true), slotIndex);
float time = input.readFloat();
float r = input.read() / 255f, g = input.read() / 255f;
float b = input.read() / 255f, a = input.read() / 255f;
@ -692,15 +691,14 @@ public class SkeletonBinary extends SkeletonLoader {
float r2 = input.read() / 255f, g2 = input.read() / 255f;
float b2 = input.read() / 255f, a2 = input.read() / 255f;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> {
setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);
setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);
setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);
setBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);
}
}
time = time2;
r = r2;
g = g2;
@ -708,10 +706,9 @@ public class SkeletonBinary extends SkeletonLoader {
a = a2;
}
timelines.add(timeline);
break;
}
case SLOT_RGB: {
RGBTimeline timeline = new RGBTimeline(frameCount, input.readInt(true), slotIndex);
case SLOT_RGB -> {
var timeline = new RGBTimeline(frameCount, input.readInt(true), slotIndex);
float time = input.readFloat();
float r = input.read() / 255f, g = input.read() / 255f, b = input.read() / 255f;
for (int frame = 0, bezier = 0;; frame++) {
@ -720,24 +717,22 @@ public class SkeletonBinary extends SkeletonLoader {
float time2 = input.readFloat();
float r2 = input.read() / 255f, g2 = input.read() / 255f, b2 = input.read() / 255f;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> {
setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);
setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);
setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);
}
}
time = time2;
r = r2;
g = g2;
b = b2;
}
timelines.add(timeline);
break;
}
case SLOT_RGBA2: {
RGBA2Timeline timeline = new RGBA2Timeline(frameCount, input.readInt(true), slotIndex);
case SLOT_RGBA2 -> {
var timeline = new RGBA2Timeline(frameCount, input.readInt(true), slotIndex);
float time = input.readFloat();
float r = input.read() / 255f, g = input.read() / 255f;
float b = input.read() / 255f, a = input.read() / 255f;
@ -750,10 +745,8 @@ public class SkeletonBinary extends SkeletonLoader {
float nb = input.read() / 255f, na = input.read() / 255f;
float nr2 = input.read() / 255f, ng2 = input.read() / 255f, nb2 = input.read() / 255f;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> {
setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);
setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);
setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);
@ -762,6 +755,7 @@ public class SkeletonBinary extends SkeletonLoader {
setBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);
setBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);
}
}
time = time2;
r = nr;
g = ng;
@ -772,10 +766,9 @@ public class SkeletonBinary extends SkeletonLoader {
b2 = nb2;
}
timelines.add(timeline);
break;
}
case SLOT_RGB2: {
RGB2Timeline timeline = new RGB2Timeline(frameCount, input.readInt(true), slotIndex);
case SLOT_RGB2 -> {
var timeline = new RGB2Timeline(frameCount, input.readInt(true), slotIndex);
float time = input.readFloat();
float r = input.read() / 255f, g = input.read() / 255f, b = input.read() / 255f;
float r2 = input.read() / 255f, g2 = input.read() / 255f, b2 = input.read() / 255f;
@ -786,10 +779,8 @@ public class SkeletonBinary extends SkeletonLoader {
float nr = input.read() / 255f, ng = input.read() / 255f, nb = input.read() / 255f;
float nr2 = input.read() / 255f, ng2 = input.read() / 255f, nb2 = input.read() / 255f;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> {
setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);
setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);
setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);
@ -797,6 +788,7 @@ public class SkeletonBinary extends SkeletonLoader {
setBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);
setBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);
}
}
time = time2;
r = nr;
g = ng;
@ -806,10 +798,9 @@ public class SkeletonBinary extends SkeletonLoader {
b2 = nb2;
}
timelines.add(timeline);
break;
}
case SLOT_ALPHA:
AlphaTimeline timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex);
case SLOT_ALPHA -> {
var timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex);
float time = input.readFloat(), a = input.read() / 255f;
for (int frame = 0, bezier = 0;; frame++) {
timeline.setFrame(frame, time, a);
@ -817,17 +808,15 @@ public class SkeletonBinary extends SkeletonLoader {
float time2 = input.readFloat();
float a2 = input.read() / 255f;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
setBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> setBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);
}
time = time2;
a = a2;
}
timelines.add(timeline);
}
}
}
}
@ -837,7 +826,7 @@ public class SkeletonBinary extends SkeletonLoader {
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++) {
int type = input.readByte(), frameCount = input.readInt(true);
if (type == BONE_INHERIT) {
InheritTimeline timeline = new InheritTimeline(frameCount, boneIndex);
var timeline = new InheritTimeline(frameCount, boneIndex);
for (int frame = 0; frame < frameCount; frame++)
timeline.setFrame(frame, input.readFloat(), Inherit.values[input.readByte()]);
timelines.add(timeline);
@ -845,35 +834,19 @@ public class SkeletonBinary extends SkeletonLoader {
}
int bezierCount = input.readInt(true);
switch (type) {
case BONE_ROTATE:
readTimeline(input, timelines, new RotateTimeline(frameCount, bezierCount, boneIndex), 1);
break;
case BONE_TRANSLATE:
case BONE_ROTATE -> readTimeline(input, timelines, new RotateTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_TRANSLATE -> //
readTimeline(input, timelines, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale);
break;
case BONE_TRANSLATEX:
case BONE_TRANSLATEX -> //
readTimeline(input, timelines, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale);
break;
case BONE_TRANSLATEY:
case BONE_TRANSLATEY -> //
readTimeline(input, timelines, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale);
break;
case BONE_SCALE:
readTimeline(input, timelines, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1);
break;
case BONE_SCALEX:
readTimeline(input, timelines, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1);
break;
case BONE_SCALEY:
readTimeline(input, timelines, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1);
break;
case BONE_SHEAR:
readTimeline(input, timelines, new ShearTimeline(frameCount, bezierCount, boneIndex), 1);
break;
case BONE_SHEARX:
readTimeline(input, timelines, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1);
break;
case BONE_SHEARY:
readTimeline(input, timelines, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SCALE -> readTimeline(input, timelines, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SCALEX -> readTimeline(input, timelines, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SCALEY -> readTimeline(input, timelines, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SHEAR -> readTimeline(input, timelines, new ShearTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SHEARX -> readTimeline(input, timelines, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SHEARY -> readTimeline(input, timelines, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1);
}
}
}
@ -881,7 +854,7 @@ public class SkeletonBinary extends SkeletonLoader {
// IK constraint timelines.
for (int i = 0, n = input.readInt(true); i < n; i++) {
int index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;
IkConstraintTimeline timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);
var timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);
int flags = input.read();
float time = input.readFloat(), mix = (flags & 1) != 0 ? ((flags & 2) != 0 ? input.readFloat() : 1) : 0;
float softness = (flags & 4) != 0 ? input.readFloat() * scale : 0;
@ -907,7 +880,7 @@ public class SkeletonBinary extends SkeletonLoader {
// Transform constraint timelines.
for (int i = 0, n = input.readInt(true); i < n; i++) {
int index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;
TransformConstraintTimeline timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index);
var timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index);
float time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(),
mixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat();
for (int frame = 0, bezier = 0;; frame++) {
@ -916,10 +889,8 @@ public class SkeletonBinary extends SkeletonLoader {
float time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(),
mixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat();
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> {
setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);
setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);
setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);
@ -927,6 +898,7 @@ public class SkeletonBinary extends SkeletonLoader {
setBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);
setBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);
}
}
time = time2;
mixRotate = mixRotate2;
mixX = mixX2;
@ -945,16 +917,16 @@ public class SkeletonBinary extends SkeletonLoader {
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++) {
int type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);
switch (type) {
case PATH_POSITION:
case PATH_POSITION -> {
readTimeline(input, timelines, new PathConstraintPositionTimeline(frameCount, bezierCount, index),
data.positionMode == PositionMode.fixed ? scale : 1);
break;
case PATH_SPACING:
}
case PATH_SPACING -> {
readTimeline(input, timelines, new PathConstraintSpacingTimeline(frameCount, bezierCount, index),
data.spacingMode == SpacingMode.length || data.spacingMode == SpacingMode.fixed ? scale : 1);
break;
case PATH_MIX:
PathConstraintMixTimeline timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index);
}
case PATH_MIX -> {
var timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index);
float time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat();
for (int frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1;; frame++) {
timeline.setFrame(frame, time, mixRotate, mixX, mixY);
@ -962,14 +934,13 @@ public class SkeletonBinary extends SkeletonLoader {
float time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(),
mixY2 = input.readFloat();
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> {
setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);
setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);
setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);
}
}
time = time2;
mixRotate = mixRotate2;
mixX = mixX2;
@ -977,6 +948,7 @@ public class SkeletonBinary extends SkeletonLoader {
}
timelines.add(timeline);
}
}
}
}
@ -986,35 +958,23 @@ public class SkeletonBinary extends SkeletonLoader {
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++) {
int type = input.readByte(), frameCount = input.readInt(true);
if (type == PHYSICS_RESET) {
PhysicsConstraintResetTimeline timeline = new PhysicsConstraintResetTimeline(frameCount, index);
var timeline = new PhysicsConstraintResetTimeline(frameCount, index);
for (int frame = 0; frame < frameCount; frame++)
timeline.setFrame(frame, input.readFloat());
timelines.add(timeline);
continue;
}
int bezierCount = input.readInt(true);
switch (type) {
case PHYSICS_INERTIA:
readTimeline(input, timelines, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index), 1);
break;
case PHYSICS_STRENGTH:
readTimeline(input, timelines, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index), 1);
break;
case PHYSICS_DAMPING:
readTimeline(input, timelines, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index), 1);
break;
case PHYSICS_MASS:
readTimeline(input, timelines, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1);
break;
case PHYSICS_WIND:
readTimeline(input, timelines, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1);
break;
case PHYSICS_GRAVITY:
readTimeline(input, timelines, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1);
break;
case PHYSICS_MIX:
readTimeline(input, timelines, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1);
}
readTimeline(input, timelines, switch (type) {
case PHYSICS_INERTIA -> new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index);
case PHYSICS_STRENGTH -> new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index);
case PHYSICS_DAMPING -> new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index);
case PHYSICS_MASS -> new PhysicsConstraintMassTimeline(frameCount, bezierCount, index);
case PHYSICS_WIND -> new PhysicsConstraintWindTimeline(frameCount, bezierCount, index);
case PHYSICS_GRAVITY -> new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index);
case PHYSICS_MIX -> new PhysicsConstraintMixTimeline(frameCount, bezierCount, index);
default -> throw new SerializationException();
}, 1);
}
}
@ -1030,13 +990,13 @@ public class SkeletonBinary extends SkeletonLoader {
int timelineType = input.readByte(), frameCount = input.readInt(true), frameLast = frameCount - 1;
switch (timelineType) {
case ATTACHMENT_DEFORM: {
VertexAttachment vertexAttachment = (VertexAttachment)attachment;
case ATTACHMENT_DEFORM -> {
var vertexAttachment = (VertexAttachment)attachment;
boolean weighted = vertexAttachment.getBones() != null;
float[] vertices = vertexAttachment.getVertices();
int deformLength = weighted ? (vertices.length / 3) << 1 : vertices.length;
DeformTimeline timeline = new DeformTimeline(frameCount, input.readInt(true), slotIndex, vertexAttachment);
var timeline = new DeformTimeline(frameCount, input.readInt(true), slotIndex, vertexAttachment);
float time = input.readFloat();
for (int frame = 0, bezier = 0;; frame++) {
@ -1064,19 +1024,15 @@ public class SkeletonBinary extends SkeletonLoader {
if (frame == frameLast) break;
float time2 = input.readFloat();
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);
}
time = time2;
}
timelines.add(timeline);
break;
}
case ATTACHMENT_SEQUENCE:
SequenceTimeline timeline = new SequenceTimeline(frameCount, slotIndex, attachment);
case ATTACHMENT_SEQUENCE -> {
var timeline = new SequenceTimeline(frameCount, slotIndex, attachment);
for (int frame = 0; frame < frameCount; frame++) {
float time = input.readFloat();
int modeAndIndex = input.readInt();
@ -1085,6 +1041,7 @@ public class SkeletonBinary extends SkeletonLoader {
}
timelines.add(timeline);
}
}
}
}
}
@ -1092,15 +1049,15 @@ public class SkeletonBinary extends SkeletonLoader {
// Draw order timeline.
int drawOrderCount = input.readInt(true);
if (drawOrderCount > 0) {
DrawOrderTimeline timeline = new DrawOrderTimeline(drawOrderCount);
var timeline = new DrawOrderTimeline(drawOrderCount);
int slotCount = skeletonData.slots.size;
for (int i = 0; i < drawOrderCount; i++) {
float time = input.readFloat();
int offsetCount = input.readInt(true);
int[] drawOrder = new int[slotCount];
var drawOrder = new int[slotCount];
for (int ii = slotCount - 1; ii >= 0; ii--)
drawOrder[ii] = -1;
int[] unchanged = new int[slotCount - offsetCount];
var unchanged = new int[slotCount - offsetCount];
int originalIndex = 0, unchangedIndex = 0;
for (int ii = 0; ii < offsetCount; ii++) {
int slotIndex = input.readInt(true);
@ -1124,11 +1081,11 @@ public class SkeletonBinary extends SkeletonLoader {
// Event timeline.
int eventCount = input.readInt(true);
if (eventCount > 0) {
EventTimeline timeline = new EventTimeline(eventCount);
var timeline = new EventTimeline(eventCount);
for (int i = 0; i < eventCount; i++) {
float time = input.readFloat();
EventData eventData = skeletonData.events.get(input.readInt(true));
Event event = new Event(time, eventData);
var event = new Event(time, eventData);
event.intValue = input.readInt(false);
event.floatValue = input.readFloat();
event.stringValue = input.readString();
@ -1157,11 +1114,8 @@ public class SkeletonBinary extends SkeletonLoader {
if (frame == frameLast) break;
float time2 = input.readFloat(), value2 = input.readFloat() * scale;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);
}
time = time2;
value = value2;
@ -1177,13 +1131,12 @@ public class SkeletonBinary extends SkeletonLoader {
if (frame == frameLast) break;
float time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
break;
case CURVE_BEZIER:
case CURVE_STEPPED -> timeline.setStepped(frame);
case CURVE_BEZIER -> {
setBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);
setBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);
}
}
time = time2;
value1 = nvalue1;
value2 = nvalue2;
@ -1235,21 +1188,20 @@ public class SkeletonBinary extends SkeletonLoader {
for (int i = 0; i < byteCount;) {
int b = read();
switch (b >> 4) {
case -1:
throw new EOFException();
case 12:
case 13:
case -1 -> throw new EOFException();
case 12, 13 -> {
chars[charCount++] = (char)((b & 0x1F) << 6 | read() & 0x3F);
i += 2;
break;
case 14:
}
case 14 -> {
chars[charCount++] = (char)((b & 0x0F) << 12 | (read() & 0x3F) << 6 | read() & 0x3F);
i += 3;
break;
default:
}
default -> {
chars[charCount++] = (char)b;
i++;
}
}
}
return new String(chars, 0, charCount);
}

View File

@ -65,11 +65,10 @@ public class SkeletonBounds {
polygons.clear();
for (int i = 0; i < slotCount; i++) {
Slot slot = (Slot)slots[i];
var slot = (Slot)slots[i];
if (!slot.bone.active) continue;
Attachment attachment = slot.attachment;
if (attachment instanceof BoundingBoxAttachment) {
BoundingBoxAttachment boundingBox = (BoundingBoxAttachment)attachment;
if (attachment instanceof BoundingBoxAttachment boundingBox) {
boundingBoxes.add(boundingBox);
FloatArray polygon = polygonPool.obtain();
@ -93,7 +92,7 @@ public class SkeletonBounds {
float minX = Integer.MAX_VALUE, minY = Integer.MAX_VALUE, maxX = Integer.MIN_VALUE, maxY = Integer.MIN_VALUE;
Object[] polygons = this.polygons.items;
for (int i = 0, n = this.polygons.size; i < n; i++) {
FloatArray polygon = (FloatArray)polygons[i];
var polygon = (FloatArray)polygons[i];
float[] vertices = polygon.items;
for (int ii = 0, nn = polygon.size; ii < nn; ii += 2) {
float x = vertices[ii];

View File

@ -72,7 +72,7 @@ public class SkeletonData {
if (boneName == null) throw new IllegalArgumentException("boneName cannot be null.");
Object[] bones = this.bones.items;
for (int i = 0, n = this.bones.size; i < n; i++) {
BoneData bone = (BoneData)bones[i];
var bone = (BoneData)bones[i];
if (bone.name.equals(boneName)) return bone;
}
return null;
@ -91,7 +91,7 @@ public class SkeletonData {
if (slotName == null) throw new IllegalArgumentException("slotName cannot be null.");
Object[] slots = this.slots.items;
for (int i = 0, n = this.slots.size; i < n; i++) {
SlotData slot = (SlotData)slots[i];
var slot = (SlotData)slots[i];
if (slot.name.equals(slotName)) return slot;
}
return null;
@ -153,7 +153,7 @@ public class SkeletonData {
if (animationName == null) throw new IllegalArgumentException("animationName cannot be null.");
Object[] animations = this.animations.items;
for (int i = 0, n = this.animations.size; i < n; i++) {
Animation animation = (Animation)animations[i];
var animation = (Animation)animations[i];
if (animation.name.equals(animationName)) return animation;
}
return null;
@ -172,7 +172,7 @@ public class SkeletonData {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Object[] ikConstraints = this.ikConstraints.items;
for (int i = 0, n = this.ikConstraints.size; i < n; i++) {
IkConstraintData constraint = (IkConstraintData)ikConstraints[i];
var constraint = (IkConstraintData)ikConstraints[i];
if (constraint.name.equals(constraintName)) return constraint;
}
return null;
@ -191,7 +191,7 @@ public class SkeletonData {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Object[] transformConstraints = this.transformConstraints.items;
for (int i = 0, n = this.transformConstraints.size; i < n; i++) {
TransformConstraintData constraint = (TransformConstraintData)transformConstraints[i];
var constraint = (TransformConstraintData)transformConstraints[i];
if (constraint.name.equals(constraintName)) return constraint;
}
return null;
@ -210,7 +210,7 @@ public class SkeletonData {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Object[] pathConstraints = this.pathConstraints.items;
for (int i = 0, n = this.pathConstraints.size; i < n; i++) {
PathConstraintData constraint = (PathConstraintData)pathConstraints[i];
var constraint = (PathConstraintData)pathConstraints[i];
if (constraint.name.equals(constraintName)) return constraint;
}
return null;
@ -229,7 +229,7 @@ public class SkeletonData {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Object[] physicsConstraints = this.physicsConstraints.items;
for (int i = 0, n = this.physicsConstraints.size; i < n; i++) {
PhysicsConstraintData constraint = (PhysicsConstraintData)physicsConstraints[i];
var constraint = (PhysicsConstraintData)physicsConstraints[i];
if (constraint.name.equals(constraintName)) return constraint;
}
return null;

View File

@ -135,7 +135,7 @@ public class SkeletonJson extends SkeletonLoader {
float scale = this.scale;
// Skeleton.
SkeletonData skeletonData = new SkeletonData();
var skeletonData = new SkeletonData();
JsonValue skeletonMap = root.get("skeleton");
if (skeletonMap != null) {
skeletonData.hash = skeletonMap.getString("hash", null);
@ -158,7 +158,7 @@ public class SkeletonJson extends SkeletonLoader {
parent = skeletonData.findBone(parentName);
if (parent == null) throw new SerializationException("Parent bone not found: " + parentName);
}
BoneData data = new BoneData(skeletonData.bones.size, boneMap.getString("name"), parent);
var data = new BoneData(skeletonData.bones.size, boneMap.getString("name"), parent);
data.length = boneMap.getFloat("length", 0) * scale;
data.x = boneMap.getFloat("x", 0) * scale;
data.y = boneMap.getFloat("y", 0) * scale;
@ -186,7 +186,7 @@ public class SkeletonJson extends SkeletonLoader {
BoneData boneData = skeletonData.findBone(boneName);
if (boneData == null) throw new SerializationException("Slot bone not found: " + boneName);
SlotData data = new SlotData(skeletonData.slots.size, slotName, boneData);
var data = new SlotData(skeletonData.slots.size, slotName, boneData);
String color = slotMap.getString("color", null);
if (color != null) Color.valueOf(color, data.getColor());
@ -202,7 +202,7 @@ public class SkeletonJson extends SkeletonLoader {
// IK constraints.
for (JsonValue constraintMap = root.getChild("ik"); constraintMap != null; constraintMap = constraintMap.next) {
IkConstraintData data = new IkConstraintData(constraintMap.getString("name"));
var data = new IkConstraintData(constraintMap.getString("name"));
data.order = constraintMap.getInt("order", 0);
data.skinRequired = constraintMap.getBoolean("skin", false);
@ -228,7 +228,7 @@ public class SkeletonJson extends SkeletonLoader {
// Transform constraints.
for (JsonValue constraintMap = root.getChild("transform"); constraintMap != null; constraintMap = constraintMap.next) {
TransformConstraintData data = new TransformConstraintData(constraintMap.getString("name"));
var data = new TransformConstraintData(constraintMap.getString("name"));
data.order = constraintMap.getInt("order", 0);
data.skinRequired = constraintMap.getBoolean("skin", false);
@ -264,7 +264,7 @@ public class SkeletonJson extends SkeletonLoader {
// Path constraints.
for (JsonValue constraintMap = root.getChild("path"); constraintMap != null; constraintMap = constraintMap.next) {
PathConstraintData data = new PathConstraintData(constraintMap.getString("name"));
var data = new PathConstraintData(constraintMap.getString("name"));
data.order = constraintMap.getInt("order", 0);
data.skinRequired = constraintMap.getBoolean("skin", false);
@ -295,7 +295,7 @@ public class SkeletonJson extends SkeletonLoader {
// Physics constraints.
for (JsonValue constraintMap = root.getChild("physics"); constraintMap != null; constraintMap = constraintMap.next) {
PhysicsConstraintData data = new PhysicsConstraintData(constraintMap.getString("name"));
var data = new PhysicsConstraintData(constraintMap.getString("name"));
data.order = constraintMap.getInt("order", 0);
data.skinRequired = constraintMap.getBoolean("skin", false);
@ -330,7 +330,7 @@ public class SkeletonJson extends SkeletonLoader {
// Skins.
for (JsonValue skinMap = root.getChild("skins"); skinMap != null; skinMap = skinMap.next) {
Skin skin = new Skin(skinMap.getString("name"));
var skin = new Skin(skinMap.getString("name"));
for (JsonValue entry = skinMap.getChild("bones"); entry != null; entry = entry.next) {
BoneData bone = skeletonData.findBone(entry.asString());
if (bone == null) throw new SerializationException("Skin bone not found: " + entry);
@ -381,7 +381,7 @@ public class SkeletonJson extends SkeletonLoader {
// Linked meshes.
Object[] items = linkedMeshes.items;
for (int i = 0, n = linkedMeshes.size; i < n; i++) {
LinkedMesh linkedMesh = (LinkedMesh)items[i];
var linkedMesh = (LinkedMesh)items[i];
Skin skin = linkedMesh.skin == null ? skeletonData.getDefaultSkin() : skeletonData.findSkin(linkedMesh.skin);
if (skin == null) throw new SerializationException("Skin not found: " + linkedMesh.skin);
Attachment parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
@ -394,7 +394,7 @@ public class SkeletonJson extends SkeletonLoader {
// Events.
for (JsonValue eventMap = root.getChild("events"); eventMap != null; eventMap = eventMap.next) {
EventData data = new EventData(eventMap.name);
var data = new EventData(eventMap.name);
data.intValue = eventMap.getInt("int", 0);
data.floatValue = eventMap.getFloat("float", 0f);
data.stringValue = eventMap.getString("string", "");
@ -500,7 +500,7 @@ public class SkeletonJson extends SkeletonLoader {
int vertexCount = map.getInt("vertexCount");
readVertices(map, path, vertexCount << 1);
float[] lengths = new float[vertexCount / 3];
var lengths = new float[vertexCount / 3];
int i = 0;
for (JsonValue curves = map.require("lengths").child; curves != null; curves = curves.next)
lengths[i++] = curves.asFloat() * scale;
@ -543,7 +543,7 @@ public class SkeletonJson extends SkeletonLoader {
private Sequence readSequence (@Null JsonValue map) {
if (map == null) return null;
Sequence sequence = new Sequence(map.getInt("count"));
var sequence = new Sequence(map.getInt("count"));
sequence.setStart(map.getInt("start", 1));
sequence.setDigits(map.getInt("digits", 0));
sequence.setSetupIndex(map.getInt("setup", 0));
@ -561,8 +561,8 @@ public class SkeletonJson extends SkeletonLoader {
attachment.setVertices(vertices);
return;
}
FloatArray weights = new FloatArray(verticesLength * 3 * 3);
IntArray bones = new IntArray(verticesLength * 3);
var weights = new FloatArray(verticesLength * 3 * 3);
var bones = new IntArray(verticesLength * 3);
for (int i = 0, n = vertices.length; i < n;) {
int boneCount = (int)vertices[i++];
bones.add(boneCount);
@ -579,7 +579,7 @@ public class SkeletonJson extends SkeletonLoader {
private void readAnimation (JsonValue map, String name, SkeletonData skeletonData) {
float scale = this.scale;
Array<Timeline> timelines = new Array();
var timelines = new Array<Timeline>();
// Slot timelines.
for (JsonValue slotMap = map.getChild("slots"); slotMap != null; slotMap = slotMap.next) {
@ -590,15 +590,15 @@ public class SkeletonJson extends SkeletonLoader {
if (keyMap == null) continue;
int frames = timelineMap.size;
String timelineName = timelineMap.name;
if (timelineName.equals("attachment")) {
AttachmentTimeline timeline = new AttachmentTimeline(frames, slot.index);
switch (timelineMap.name) {
case "attachment" -> {
var timeline = new AttachmentTimeline(frames, slot.index);
for (int frame = 0; keyMap != null; keyMap = keyMap.next, frame++)
timeline.setFrame(frame, keyMap.getFloat("time", 0), keyMap.getString("name", null));
timelines.add(timeline);
} else if (timelineName.equals("rgba")) {
RGBATimeline timeline = new RGBATimeline(frames, frames << 2, slot.index);
}
case "rgba" -> {
var timeline = new RGBATimeline(frames, frames << 2, slot.index);
float time = keyMap.getFloat("time", 0);
String color = keyMap.getString("color");
float r = Integer.parseInt(color.substring(0, 2), 16) / 255f;
@ -633,9 +633,9 @@ public class SkeletonJson extends SkeletonLoader {
keyMap = nextMap;
}
timelines.add(timeline);
} else if (timelineName.equals("rgb")) {
RGBTimeline timeline = new RGBTimeline(frames, frames * 3, slot.index);
}
case "rgb" -> {
var timeline = new RGBTimeline(frames, frames * 3, slot.index);
float time = keyMap.getFloat("time", 0);
String color = keyMap.getString("color");
float r = Integer.parseInt(color.substring(0, 2), 16) / 255f;
@ -666,12 +666,10 @@ public class SkeletonJson extends SkeletonLoader {
keyMap = nextMap;
}
timelines.add(timeline);
} else if (timelineName.equals("alpha")) {
timelines.add(readTimeline(keyMap, new AlphaTimeline(frames, frames, slot.index), 0, 1));
} else if (timelineName.equals("rgba2")) {
RGBA2Timeline timeline = new RGBA2Timeline(frames, frames * 7, slot.index);
}
case "alpha" -> timelines.add(readTimeline(keyMap, new AlphaTimeline(frames, frames, slot.index), 0, 1));
case "rgba2" -> {
var timeline = new RGBA2Timeline(frames, frames * 7, slot.index);
float time = keyMap.getFloat("time", 0);
String color = keyMap.getString("light");
float r = Integer.parseInt(color.substring(0, 2), 16) / 255f;
@ -720,9 +718,9 @@ public class SkeletonJson extends SkeletonLoader {
keyMap = nextMap;
}
timelines.add(timeline);
} else if (timelineName.equals("rgb2")) {
RGB2Timeline timeline = new RGB2Timeline(frames, frames * 6, slot.index);
}
case "rgb2" -> {
var timeline = new RGB2Timeline(frames, frames * 6, slot.index);
float time = keyMap.getFloat("time", 0);
String color = keyMap.getString("light");
float r = Integer.parseInt(color.substring(0, 2), 16) / 255f;
@ -767,9 +765,10 @@ public class SkeletonJson extends SkeletonLoader {
keyMap = nextMap;
}
timelines.add(timeline);
} else
throw new RuntimeException("Invalid timeline type for a slot: " + timelineName + " (" + slotMap.name + ")");
}
default -> throw new RuntimeException(
"Invalid timeline type for a slot: " + timelineMap.name + " (" + slotMap.name + ")");
}
}
}
@ -782,39 +781,33 @@ public class SkeletonJson extends SkeletonLoader {
if (keyMap == null) continue;
int frames = timelineMap.size;
String timelineName = timelineMap.name;
if (timelineName.equals("rotate"))
timelines.add(readTimeline(keyMap, new RotateTimeline(frames, frames, bone.index), 0, 1));
else if (timelineName.equals("translate")) {
TranslateTimeline timeline = new TranslateTimeline(frames, frames << 1, bone.index);
timelines.add(readTimeline(keyMap, timeline, "x", "y", 0, scale));
} else if (timelineName.equals("translatex")) {
switch (timelineMap.name) {
case "rotate" -> timelines.add(readTimeline(keyMap, new RotateTimeline(frames, frames, bone.index), 0, 1));
case "translate" -> //
timelines.add(readTimeline(keyMap, new TranslateTimeline(frames, frames << 1, bone.index), "x", "y", 0, scale));
case "translatex" -> //
timelines.add(readTimeline(keyMap, new TranslateXTimeline(frames, frames, bone.index), 0, scale));
} else if (timelineName.equals("translatey")) {
case "translatey" -> //
timelines.add(readTimeline(keyMap, new TranslateYTimeline(frames, frames, bone.index), 0, scale));
} else if (timelineName.equals("scale")) {
ScaleTimeline timeline = new ScaleTimeline(frames, frames << 1, bone.index);
timelines.add(readTimeline(keyMap, timeline, "x", "y", 1, 1));
} else if (timelineName.equals("scalex"))
timelines.add(readTimeline(keyMap, new ScaleXTimeline(frames, frames, bone.index), 1, 1));
else if (timelineName.equals("scaley"))
timelines.add(readTimeline(keyMap, new ScaleYTimeline(frames, frames, bone.index), 1, 1));
else if (timelineName.equals("shear")) {
ShearTimeline timeline = new ShearTimeline(frames, frames << 1, bone.index);
timelines.add(readTimeline(keyMap, timeline, "x", "y", 0, 1));
} else if (timelineName.equals("shearx"))
timelines.add(readTimeline(keyMap, new ShearXTimeline(frames, frames, bone.index), 0, 1));
else if (timelineName.equals("sheary"))
timelines.add(readTimeline(keyMap, new ShearYTimeline(frames, frames, bone.index), 0, 1));
else if (timelineName.equals("inherit")) {
InheritTimeline timeline = new InheritTimeline(frames, bone.index);
case "scale" -> timelines
.add(readTimeline(keyMap, new ScaleTimeline(frames, frames << 1, bone.index), "x", "y", 1, 1));
case "scalex" -> timelines.add(readTimeline(keyMap, new ScaleXTimeline(frames, frames, bone.index), 1, 1));
case "scaley" -> timelines.add(readTimeline(keyMap, new ScaleYTimeline(frames, frames, bone.index), 1, 1));
case "shear" -> //
timelines.add(readTimeline(keyMap, new ShearTimeline(frames, frames << 1, bone.index), "x", "y", 0, 1));
case "shearx" -> timelines.add(readTimeline(keyMap, new ShearXTimeline(frames, frames, bone.index), 0, 1));
case "sheary" -> timelines.add(readTimeline(keyMap, new ShearYTimeline(frames, frames, bone.index), 0, 1));
case "inherit" -> {
var timeline = new InheritTimeline(frames, bone.index);
for (int frame = 0; keyMap != null; keyMap = keyMap.next, frame++) {
float time = keyMap.getFloat("time", 0);
timeline.setFrame(frame, time, Inherit.valueOf(keyMap.getString("inherit", Inherit.normal.name())));
}
timelines.add(timeline);
} else
throw new RuntimeException("Invalid timeline type for a bone: " + timelineName + " (" + boneMap.name + ")");
}
default -> //
throw new RuntimeException("Invalid timeline type for a bone: " + timelineMap.name + " (" + boneMap.name + ")");
}
}
}
@ -823,7 +816,7 @@ public class SkeletonJson extends SkeletonLoader {
JsonValue keyMap = timelineMap.child;
if (keyMap == null) continue;
IkConstraintData constraint = skeletonData.findIkConstraint(timelineMap.name);
IkConstraintTimeline timeline = new IkConstraintTimeline(timelineMap.size, timelineMap.size << 1,
var timeline = new IkConstraintTimeline(timelineMap.size, timelineMap.size << 1,
skeletonData.getIkConstraints().indexOf(constraint, true));
float time = keyMap.getFloat("time", 0);
float mix = keyMap.getFloat("mix", 1), softness = keyMap.getFloat("softness", 0) * scale;
@ -855,7 +848,7 @@ public class SkeletonJson extends SkeletonLoader {
JsonValue keyMap = timelineMap.child;
if (keyMap == null) continue;
TransformConstraintData constraint = skeletonData.findTransformConstraint(timelineMap.name);
TransformConstraintTimeline timeline = new TransformConstraintTimeline(timelineMap.size, timelineMap.size * 6,
var timeline = new TransformConstraintTimeline(timelineMap.size, timelineMap.size * 6,
skeletonData.getTransformConstraints().indexOf(constraint, true));
float time = keyMap.getFloat("time", 0);
float mixRotate = keyMap.getFloat("mixRotate", 1);
@ -905,16 +898,18 @@ public class SkeletonJson extends SkeletonLoader {
if (keyMap == null) continue;
int frames = timelineMap.size;
String timelineName = timelineMap.name;
if (timelineName.equals("position")) {
CurveTimeline1 timeline = new PathConstraintPositionTimeline(frames, frames, index);
switch (timelineMap.name) {
case "position" -> {
var timeline = new PathConstraintPositionTimeline(frames, frames, index);
timelines.add(readTimeline(keyMap, timeline, 0, constraint.positionMode == PositionMode.fixed ? scale : 1));
} else if (timelineName.equals("spacing")) {
CurveTimeline1 timeline = new PathConstraintSpacingTimeline(frames, frames, index);
}
case "spacing" -> {
var timeline = new PathConstraintSpacingTimeline(frames, frames, index);
timelines.add(readTimeline(keyMap, timeline, 0,
constraint.spacingMode == SpacingMode.length || constraint.spacingMode == SpacingMode.fixed ? scale : 1));
} else if (timelineName.equals("mix")) {
PathConstraintMixTimeline timeline = new PathConstraintMixTimeline(frames, frames * 3, index);
}
case "mix" -> {
var timeline = new PathConstraintMixTimeline(frames, frames * 3, index);
float time = keyMap.getFloat("time", 0);
float mixRotate = keyMap.getFloat("mixRotate", 1);
float mixX = keyMap.getFloat("mixX", 1), mixY = keyMap.getFloat("mixY", mixX);
@ -942,6 +937,7 @@ public class SkeletonJson extends SkeletonLoader {
}
timelines.add(timeline);
}
}
}
}
@ -958,32 +954,26 @@ public class SkeletonJson extends SkeletonLoader {
if (keyMap == null) continue;
int frames = timelineMap.size;
String timelineName = timelineMap.name;
if (timelineName.equals("reset")) {
PhysicsConstraintResetTimeline timeline = new PhysicsConstraintResetTimeline(frames, index);
CurveTimeline1 timeline;
switch (timelineMap.name) {
case "reset" -> {
var resetTimeline = new PhysicsConstraintResetTimeline(frames, index);
for (int frame = 0; keyMap != null; keyMap = keyMap.next, frame++)
timeline.setFrame(frame, keyMap.getFloat("time", 0));
timelines.add(timeline);
resetTimeline.setFrame(frame, keyMap.getFloat("time", 0));
timelines.add(resetTimeline);
continue;
}
CurveTimeline1 timeline;
if (timelineName.equals("inertia"))
timeline = new PhysicsConstraintInertiaTimeline(frames, frames, index);
else if (timelineName.equals("strength"))
timeline = new PhysicsConstraintStrengthTimeline(frames, frames, index);
else if (timelineName.equals("damping"))
timeline = new PhysicsConstraintDampingTimeline(frames, frames, index);
else if (timelineName.equals("mass"))
timeline = new PhysicsConstraintMassTimeline(frames, frames, index);
else if (timelineName.equals("wind"))
timeline = new PhysicsConstraintWindTimeline(frames, frames, index);
else if (timelineName.equals("gravity"))
timeline = new PhysicsConstraintGravityTimeline(frames, frames, index);
else if (timelineName.equals("mix"))
timeline = new PhysicsConstraintMixTimeline(frames, frames, index);
else
case "inertia" -> timeline = new PhysicsConstraintInertiaTimeline(frames, frames, index);
case "strength" -> timeline = new PhysicsConstraintStrengthTimeline(frames, frames, index);
case "damping" -> timeline = new PhysicsConstraintDampingTimeline(frames, frames, index);
case "mass" -> timeline = new PhysicsConstraintMassTimeline(frames, frames, index);
case "wind" -> timeline = new PhysicsConstraintWindTimeline(frames, frames, index);
case "gravity" -> timeline = new PhysicsConstraintGravityTimeline(frames, frames, index);
case "mix" -> timeline = new PhysicsConstraintMixTimeline(frames, frames, index);
default -> {
continue;
}
}
timelines.add(readTimeline(keyMap, timeline, 0, 1));
}
}
@ -1001,14 +991,14 @@ public class SkeletonJson extends SkeletonLoader {
for (JsonValue timelineMap = attachmentMap.child; timelineMap != null; timelineMap = timelineMap.next) {
JsonValue keyMap = timelineMap.child;
int frames = timelineMap.size;
String timelineName = timelineMap.name;
if (timelineName.equals("deform")) {
VertexAttachment vertexAttachment = (VertexAttachment)attachment;
switch (timelineMap.name) {
case "deform" -> {
var vertexAttachment = (VertexAttachment)attachment;
boolean weighted = vertexAttachment.getBones() != null;
float[] vertices = vertexAttachment.getVertices();
int deformLength = weighted ? (vertices.length / 3) << 1 : vertices.length;
DeformTimeline timeline = new DeformTimeline(frames, frames, slot.index, vertexAttachment);
var timeline = new DeformTimeline(frames, frames, slot.index, vertexAttachment);
float time = keyMap.getFloat("time", 0);
for (int frame = 0, bezier = 0;; frame++) {
float[] deform;
@ -1042,8 +1032,9 @@ public class SkeletonJson extends SkeletonLoader {
keyMap = nextMap;
}
timelines.add(timeline);
} else if (timelineName.equals("sequence")) {
SequenceTimeline timeline = new SequenceTimeline(frames, slot.index, attachment);
}
case "sequence" -> {
var timeline = new SequenceTimeline(frames, slot.index, attachment);
float lastDelay = 0;
for (int frame = 0; keyMap != null; keyMap = keyMap.next, frame++) {
float delay = keyMap.getFloat("delay", lastDelay);
@ -1053,6 +1044,7 @@ public class SkeletonJson extends SkeletonLoader {
}
timelines.add(timeline);
}
}
}
}
}
@ -1061,7 +1053,7 @@ public class SkeletonJson extends SkeletonLoader {
// Draw order timeline.
JsonValue drawOrderMap = map.get("drawOrder");
if (drawOrderMap != null) {
DrawOrderTimeline timeline = new DrawOrderTimeline(drawOrderMap.size);
var timeline = new DrawOrderTimeline(drawOrderMap.size);
int slotCount = skeletonData.slots.size;
int frame = 0;
for (JsonValue keyMap = drawOrderMap.child; keyMap != null; keyMap = keyMap.next, frame++) {
@ -1071,7 +1063,7 @@ public class SkeletonJson extends SkeletonLoader {
drawOrder = new int[slotCount];
for (int i = slotCount - 1; i >= 0; i--)
drawOrder[i] = -1;
int[] unchanged = new int[slotCount - offsets.size];
var unchanged = new int[slotCount - offsets.size];
int originalIndex = 0, unchangedIndex = 0;
for (JsonValue offsetMap = offsets.child; offsetMap != null; offsetMap = offsetMap.next) {
SlotData slot = skeletonData.findSlot(offsetMap.getString("slot"));
@ -1097,12 +1089,12 @@ public class SkeletonJson extends SkeletonLoader {
// Event timeline.
JsonValue eventsMap = map.get("events");
if (eventsMap != null) {
EventTimeline timeline = new EventTimeline(eventsMap.size);
var timeline = new EventTimeline(eventsMap.size);
int frame = 0;
for (JsonValue keyMap = eventsMap.child; keyMap != null; keyMap = keyMap.next, frame++) {
EventData eventData = skeletonData.findEvent(keyMap.getString("name"));
if (eventData == null) throw new SerializationException("Event not found: " + keyMap.getString("name"));
Event event = new Event(keyMap.getFloat("time", 0), eventData);
var event = new Event(keyMap.getFloat("time", 0), eventData);
event.intValue = keyMap.getInt("int", eventData.intValue);
event.floatValue = keyMap.getFloat("float", eventData.floatValue);
event.stringValue = keyMap.getString("string", eventData.stringValue);

View File

@ -60,12 +60,12 @@ public class SkeletonRenderer {
* previous blend function is not restored, since that could result in unnecessary flushes, depending on what is rendered
* next. */
public void draw (Batch batch, Skeleton skeleton) {
if (batch instanceof TwoColorPolygonBatch) {
draw((TwoColorPolygonBatch)batch, skeleton);
if (batch instanceof TwoColorPolygonBatch twoColorBatch) {
draw(twoColorBatch, skeleton);
return;
}
if (batch instanceof PolygonSpriteBatch) {
draw((PolygonSpriteBatch)batch, skeleton);
if (batch instanceof PolygonSpriteBatch polygonBatch) {
draw(polygonBatch, skeleton);
return;
}
if (batch == null) throw new IllegalArgumentException("batch cannot be null.");
@ -78,11 +78,10 @@ public class SkeletonRenderer {
float r = skeletonColor.r, g = skeletonColor.g, b = skeletonColor.b, a = skeletonColor.a;
Object[] drawOrder = skeleton.drawOrder.items;
for (int i = 0, n = skeleton.drawOrder.size; i < n; i++) {
Slot slot = (Slot)drawOrder[i];
var slot = (Slot)drawOrder[i];
if (!slot.bone.active) continue;
Attachment attachment = slot.attachment;
if (attachment instanceof RegionAttachment) {
RegionAttachment region = (RegionAttachment)attachment;
if (attachment instanceof RegionAttachment region) {
region.computeWorldVertices(slot, vertices, 0, 5);
Color color = region.getColor(), slotColor = slot.getColor();
float alpha = a * slotColor.a * color.a * 255;
@ -119,8 +118,8 @@ public class SkeletonRenderer {
throw new RuntimeException(batch.getClass().getSimpleName()
+ " cannot render meshes, PolygonSpriteBatch or TwoColorPolygonBatch is required.");
} else if (attachment instanceof SkeletonAttachment) {
Skeleton attachmentSkeleton = ((SkeletonAttachment)attachment).getSkeleton();
} else if (attachment instanceof SkeletonAttachment skeletonAttachment) {
Skeleton attachmentSkeleton = skeletonAttachment.getSkeleton();
if (attachmentSkeleton != null) draw(batch, attachmentSkeleton);
}
}
@ -144,15 +143,14 @@ public class SkeletonRenderer {
float r = skeletonColor.r, g = skeletonColor.g, b = skeletonColor.b, a = skeletonColor.a;
Object[] drawOrder = skeleton.drawOrder.items;
for (int i = 0, n = skeleton.drawOrder.size; i < n; i++) {
Slot slot = (Slot)drawOrder[i];
var slot = (Slot)drawOrder[i];
if (!slot.bone.active) {
clipper.clipEnd(slot);
continue;
}
Texture texture = null;
Attachment attachment = slot.attachment;
if (attachment instanceof RegionAttachment) {
RegionAttachment region = (RegionAttachment)attachment;
if (attachment instanceof RegionAttachment region) {
verticesLength = 20;
vertices = this.vertices.items;
region.computeWorldVertices(slot, vertices, 0, 5);
@ -161,8 +159,7 @@ public class SkeletonRenderer {
uvs = region.getUVs();
color = region.getColor();
} else if (attachment instanceof MeshAttachment) {
MeshAttachment mesh = (MeshAttachment)attachment;
} else if (attachment instanceof MeshAttachment mesh) {
int count = mesh.getWorldVerticesLength();
verticesLength = (count >> 1) * 5;
vertices = this.vertices.setSize(verticesLength);
@ -172,13 +169,12 @@ public class SkeletonRenderer {
uvs = mesh.getUVs();
color = mesh.getColor();
} else if (attachment instanceof ClippingAttachment) {
ClippingAttachment clip = (ClippingAttachment)attachment;
} else if (attachment instanceof ClippingAttachment clip) {
clipper.clipStart(slot, clip);
continue;
} else if (attachment instanceof SkeletonAttachment) {
Skeleton attachmentSkeleton = ((SkeletonAttachment)attachment).getSkeleton();
} else if (attachment instanceof SkeletonAttachment skeletonAttachment) {
Skeleton attachmentSkeleton = skeletonAttachment.getSkeleton();
if (attachmentSkeleton != null) draw(batch, attachmentSkeleton);
}
@ -241,15 +237,14 @@ public class SkeletonRenderer {
float r = skeletonColor.r, g = skeletonColor.g, b = skeletonColor.b, a = skeletonColor.a;
Object[] drawOrder = skeleton.drawOrder.items;
for (int i = 0, n = skeleton.drawOrder.size; i < n; i++) {
Slot slot = (Slot)drawOrder[i];
var slot = (Slot)drawOrder[i];
if (!slot.bone.active) {
clipper.clipEnd(slot);
continue;
}
Texture texture = null;
Attachment attachment = slot.attachment;
if (attachment instanceof RegionAttachment) {
RegionAttachment region = (RegionAttachment)attachment;
if (attachment instanceof RegionAttachment region) {
verticesLength = 24;
vertices = this.vertices.items;
region.computeWorldVertices(slot, vertices, 0, 6);
@ -258,8 +253,7 @@ public class SkeletonRenderer {
uvs = region.getUVs();
color = region.getColor();
} else if (attachment instanceof MeshAttachment) {
MeshAttachment mesh = (MeshAttachment)attachment;
} else if (attachment instanceof MeshAttachment mesh) {
int count = mesh.getWorldVerticesLength();
verticesLength = count * 3;
vertices = this.vertices.setSize(verticesLength);
@ -269,13 +263,12 @@ public class SkeletonRenderer {
uvs = mesh.getUVs();
color = mesh.getColor();
} else if (attachment instanceof ClippingAttachment) {
ClippingAttachment clip = (ClippingAttachment)attachment;
} else if (attachment instanceof ClippingAttachment clip) {
clipper.clipStart(slot, clip);
continue;
} else if (attachment instanceof SkeletonAttachment) {
Skeleton attachmentSkeleton = ((SkeletonAttachment)attachment).getSkeleton();
} else if (attachment instanceof SkeletonAttachment skeletonAttachment) {
Skeleton attachmentSkeleton = skeletonAttachment.getSkeleton();
if (attachmentSkeleton != null) draw(batch, attachmentSkeleton);
}

View File

@ -109,8 +109,7 @@ public class SkeletonRendererDebug {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
Attachment attachment = slot.attachment;
if (!(attachment instanceof PointAttachment)) continue;
PointAttachment point = (PointAttachment)attachment;
if (!(attachment instanceof PointAttachment point)) continue;
point.computeWorldPosition(slot.getBone(), temp1);
temp2.set(8, 0).rotate(point.computeWorldRotation(slot.getBone()));
shapes.rectLine(temp1, temp2, boneWidth / 2 * scale);
@ -126,8 +125,7 @@ public class SkeletonRendererDebug {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
Attachment attachment = slot.attachment;
if (attachment instanceof RegionAttachment) {
RegionAttachment region = (RegionAttachment)attachment;
if (attachment instanceof RegionAttachment region) {
float[] vertices = this.vertices.items;
region.computeWorldVertices(slot, vertices, 0, 2);
shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);
@ -143,8 +141,7 @@ public class SkeletonRendererDebug {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
Attachment attachment = slot.attachment;
if (!(attachment instanceof MeshAttachment)) continue;
MeshAttachment mesh = (MeshAttachment)attachment;
if (!(attachment instanceof MeshAttachment mesh)) continue;
float[] vertices = this.vertices.setSize(mesh.getWorldVerticesLength());
mesh.computeWorldVertices(slot, 0, mesh.getWorldVerticesLength(), vertices, 0, 2);
short[] triangles = mesh.getTriangles();
@ -191,8 +188,7 @@ public class SkeletonRendererDebug {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
Attachment attachment = slot.attachment;
if (!(attachment instanceof ClippingAttachment)) continue;
ClippingAttachment clip = (ClippingAttachment)attachment;
if (!(attachment instanceof ClippingAttachment clip)) continue;
int nn = clip.getWorldVerticesLength();
float[] vertices = this.vertices.setSize(nn);
clip.computeWorldVertices(slot, 0, nn, vertices, 0, 2);
@ -208,8 +204,7 @@ public class SkeletonRendererDebug {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
Attachment attachment = slot.attachment;
if (!(attachment instanceof PathAttachment)) continue;
PathAttachment path = (PathAttachment)attachment;
if (!(attachment instanceof PathAttachment path)) continue;
int nn = path.getWorldVerticesLength();
float[] vertices = this.vertices.setSize(nn);
path.computeWorldVertices(slot, 0, nn, vertices, 0, 2);
@ -259,8 +254,7 @@ public class SkeletonRendererDebug {
Slot slot = slots.get(i);
if (!slot.bone.active) continue;
Attachment attachment = slot.attachment;
if (!(attachment instanceof PointAttachment)) continue;
PointAttachment point = (PointAttachment)attachment;
if (!(attachment instanceof PointAttachment point)) continue;
point.computeWorldPosition(slot.getBone(), temp1);
shapes.circle(temp1.x, temp1.y, 3 * scale, 8);
}

View File

@ -60,7 +60,7 @@ public class Skin {
/** Adds an attachment to the skin for the specified slot index and name. */
public void setAttachment (int slotIndex, String name, Attachment attachment) {
if (attachment == null) throw new IllegalArgumentException("attachment cannot be null.");
SkinEntry entry = new SkinEntry(slotIndex, name, attachment);
var entry = new SkinEntry(slotIndex, name, attachment);
if (!attachments.add(entry)) attachments.get(entry).attachment = attachment;
}
@ -90,8 +90,8 @@ public class Skin {
if (!constraints.contains(data, true)) constraints.add(data);
for (SkinEntry entry : skin.attachments.orderedItems()) {
if (entry.attachment instanceof MeshAttachment)
setAttachment(entry.slotIndex, entry.name, ((MeshAttachment)entry.attachment).newLinkedMesh());
if (entry.attachment instanceof MeshAttachment mesh)
setAttachment(entry.slotIndex, entry.name, mesh.newLinkedMesh());
else
setAttachment(entry.slotIndex, entry.name, entry.attachment != null ? entry.attachment.copy() : null);
}
@ -157,7 +157,7 @@ public class Skin {
Object[] slots = skeleton.slots.items;
for (SkinEntry entry : oldSkin.attachments.orderedItems()) {
int slotIndex = entry.slotIndex;
Slot slot = (Slot)slots[slotIndex];
var slot = (Slot)slots[slotIndex];
if (slot.attachment == entry.attachment) {
Attachment attachment = getAttachment(slotIndex, entry.name);
if (attachment != null) slot.setAttachment(attachment);
@ -204,7 +204,7 @@ public class Skin {
public boolean equals (Object object) {
if (object == null) return false;
SkinEntry other = (SkinEntry)object;
var other = (SkinEntry)object;
if (slotIndex != other.slotIndex) return false;
return name.equals(other.name);
}

View File

@ -115,9 +115,8 @@ public class Slot {
* specified attachment. */
public void setAttachment (@Null Attachment attachment) {
if (this.attachment == attachment) return;
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)
|| ((VertexAttachment)attachment).getTimelineAttachment() != ((VertexAttachment)this.attachment)
.getTimelineAttachment()) {
if (!(attachment instanceof VertexAttachment newAttachment) || !(this.attachment instanceof VertexAttachment oldAttachment)
|| newAttachment.getTimelineAttachment() != oldAttachment.getTimelineAttachment()) {
deform.clear();
}
this.attachment = attachment;

View File

@ -59,7 +59,7 @@ public class AtlasAttachmentLoader implements AttachmentLoader {
}
public RegionAttachment newRegionAttachment (Skin skin, String name, String path, @Null Sequence sequence) {
RegionAttachment attachment = new RegionAttachment(name);
var attachment = new RegionAttachment(name);
if (sequence != null)
loadSequence(name, path, sequence);
else {
@ -72,7 +72,7 @@ public class AtlasAttachmentLoader implements AttachmentLoader {
}
public MeshAttachment newMeshAttachment (Skin skin, String name, String path, @Null Sequence sequence) {
MeshAttachment attachment = new MeshAttachment(name);
var attachment = new MeshAttachment(name);
if (sequence != null)
loadSequence(name, path, sequence);
else {

View File

@ -108,10 +108,9 @@ public class MeshAttachment extends VertexAttachment implements HasTextureRegion
float[] uvs = this.uvs;
int n = uvs.length;
float u, v, width, height;
if (region instanceof AtlasRegion) {
if (region instanceof AtlasRegion region) {
u = region.getU();
v = region.getV();
AtlasRegion region = (AtlasRegion)this.region;
float textureWidth = region.getTexture().getWidth(), textureHeight = region.getTexture().getHeight();
switch (region.degrees) {
case 90:
@ -281,7 +280,7 @@ public class MeshAttachment extends VertexAttachment implements HasTextureRegion
/** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. */
public MeshAttachment newLinkedMesh () {
MeshAttachment mesh = new MeshAttachment(name);
var mesh = new MeshAttachment(name);
mesh.timelineAttachment = timelineAttachment;
mesh.region = region;
mesh.path = path;

View File

@ -99,8 +99,7 @@ public class RegionAttachment extends Attachment implements HasTextureRegion {
float localX = -localX2;
float localY = -localY2;
boolean rotated = false;
if (region instanceof AtlasRegion) {
AtlasRegion region = (AtlasRegion)this.region;
if (region instanceof AtlasRegion region) {
localX += region.offsetX / region.originalWidth * width;
localY += region.offsetY / region.originalHeight * height;
if (region.degrees == 90) {

View File

@ -68,7 +68,7 @@ public class Sequence {
}
public String getPath (String basePath, int index) {
StringBuilder buffer = new StringBuilder(basePath.length() + digits);
var buffer = new StringBuilder(basePath.length() + digits);
buffer.append(basePath);
String frame = Integer.toString(start + index);
for (int i = digits - frame.length(); i > 0; i--)

View File

@ -114,7 +114,7 @@ abstract public class VertexAttachment extends Attachment {
int n = bones[v++];
n += v;
for (; v < n; v++, b += 3) {
Bone bone = (Bone)skeletonBones[bones[v]];
var bone = (Bone)skeletonBones[bones[v]];
float vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];
wx += (vx * bone.getA() + vy * bone.getB() + bone.getWorldX()) * weight;
wy += (vx * bone.getC() + vy * bone.getD() + bone.getWorldY()) * weight;
@ -129,7 +129,7 @@ abstract public class VertexAttachment extends Attachment {
int n = bones[v++];
n += v;
for (; v < n; v++, b += 3, f += 2) {
Bone bone = (Bone)skeletonBones[bones[v]];
var bone = (Bone)skeletonBones[bones[v]];
float vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];
wx += (vx * bone.getA() + vy * bone.getB() + bone.getWorldX()) * weight;
wy += (vx * bone.getC() + vy * bone.getD() + bone.getWorldY()) * weight;

View File

@ -94,7 +94,7 @@ public class SkeletonActorPool extends Pool<SkeletonActor> {
Object[] obtained = this.obtained.items;
outer:
for (int i = this.obtained.size - 1; i >= 0; i--) {
SkeletonActor actor = (SkeletonActor)obtained[i];
var actor = (SkeletonActor)obtained[i];
Array<TrackEntry> tracks = actor.state.getTracks();
for (int ii = 0, nn = tracks.size; ii < nn; ii++)
if (tracks.get(ii) != null) continue outer;
@ -103,7 +103,7 @@ public class SkeletonActorPool extends Pool<SkeletonActor> {
}
protected SkeletonActor newObject () {
SkeletonActor actor = new SkeletonActor();
var actor = new SkeletonActor();
actor.setRenderer(renderer);
return actor;
}

View File

@ -82,11 +82,11 @@ public class SkeletonDataLoader extends AsynchronousAssetLoader<SkeletonData, Sk
attachmentLoader = new AtlasAttachmentLoader(manager.get(file.pathWithoutExtension() + ".atlas", TextureAtlas.class));
if (file.extension().equalsIgnoreCase("skel")) {
SkeletonBinary skeletonBinary = new SkeletonBinary(attachmentLoader);
var skeletonBinary = new SkeletonBinary(attachmentLoader);
skeletonBinary.setScale(scale);
skeletonData = skeletonBinary.readSkeletonData(file);
} else {
SkeletonJson skeletonJson = new SkeletonJson(attachmentLoader);
var skeletonJson = new SkeletonJson(attachmentLoader);
skeletonJson.setScale(scale);
skeletonData = skeletonJson.readSkeletonData(file);
}
@ -101,7 +101,7 @@ public class SkeletonDataLoader extends AsynchronousAssetLoader<SkeletonData, Sk
public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, @Null SkeletonDataParameter parameter) {
if (parameter == null) return null;
if (parameter.attachmentLoader != null) return null;
Array<AssetDescriptor> dependencies = new Array();
var dependencies = new Array<AssetDescriptor>();
dependencies.add(new AssetDescriptor(parameter.atlasName, TextureAtlas.class));
return dependencies;
}

View File

@ -222,13 +222,13 @@ class Triangulator {
for (int ii = 0; ii < n; ii++) {
if (ii == i) continue;
ShortArray otherIndices = (ShortArray)convexPolygonsIndicesItems[ii];
var otherIndices = (ShortArray)convexPolygonsIndicesItems[ii];
if (otherIndices.size != 3) continue;
int otherFirstIndex = otherIndices.first();
int otherSecondIndex = otherIndices.get(1);
int otherLastIndex = otherIndices.get(2);
FloatArray otherPoly = (FloatArray)convexPolygonsItems[ii];
var otherPoly = (FloatArray)convexPolygonsItems[ii];
float x3 = otherPoly.get(otherPoly.size - 2), y3 = otherPoly.get(otherPoly.size - 1);
if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) continue;

View File

@ -826,7 +826,7 @@ public class TwoColorPolygonBatch implements PolygonBatch {
final int vertexIndex = this.vertexIndex;
int triangleIndex = this.triangleIndex;
short vertex = (short)(vertexIndex / VERTEX_SIZE);
var vertex = (short)(vertexIndex / VERTEX_SIZE);
for (int n = triangleIndex + triangleCount; triangleIndex < n; triangleIndex += 6, vertex += 4) {
triangles[triangleIndex] = vertex;
triangles[triangleIndex + 1] = (short)(vertex + 1);
@ -859,7 +859,7 @@ public class TwoColorPolygonBatch implements PolygonBatch {
final int vertexIndex = this.vertexIndex;
int triangleIndex = this.triangleIndex;
short vertex = (short)(vertexIndex / VERTEX_SIZE);
var vertex = (short)(vertexIndex / VERTEX_SIZE);
for (int n = triangleIndex + triangleCount; triangleIndex < n; triangleIndex += 6, vertex += 4) {
triangles[triangleIndex] = vertex;
triangles[triangleIndex + 1] = (short)(vertex + 1);
@ -1527,7 +1527,7 @@ public class TwoColorPolygonBatch implements PolygonBatch {
+ " gl_FragColor.rgb = ((texColor.a - 1.0) * u_pma + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n" //
+ "}";
ShaderProgram shader = new ShaderProgram(vertexShader, fragmentShader);
var shader = new ShaderProgram(vertexShader, fragmentShader);
if (shader.isCompiled() == false) throw new IllegalArgumentException("Error compiling shader: " + shader.getLog());
return shader;
}

View File

@ -1,18 +1,22 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.annotationPath.allLocations=enabled
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=com.badlogic.gdx.annotation.Null.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull=com.badlogic.gdx.utils.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.badlogic.gdx.annotation.Null.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.badlogic.gdx.utils.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=com.badlogic.gdx.annotation.Null
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=com.esotericsoftware.spine.launcher.utils.Null,com.esotericsoftware.spine.server.utils.Null,com.esotericsoftware.spine.editor.utils.Null
org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning
org.eclipse.jdt.core.compiler.annotation.nullable=com.badlogic.gdx.utils.Null
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning
org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=16
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=16
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -21,14 +25,15 @@ org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
@ -40,8 +45,10 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
@ -52,12 +59,13 @@ org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=info
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
@ -81,9 +89,9 @@ org.eclipse.jdt.core.compiler.problem.potentialNullReference=info
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=info
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=info
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
@ -98,7 +106,7 @@ org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=info
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
@ -113,22 +121,22 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExcepti
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLambdaParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=info
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=16
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@ -136,20 +144,17 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
@ -235,12 +240,11 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@ -271,8 +275,6 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@ -297,17 +299,13 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@ -355,8 +353,6 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@ -393,12 +389,9 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@ -424,10 +417,6 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=3
org.eclipse.jdt.core.formatter.use_on_off_tags=true
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true