Merge branch 'develop' of github.com:Flamefire/Vocaluxe into develop
This commit is contained in:
commit
ed89a91ae5
28 files changed
+468
-340
No files matched your search
+3
-2
@@ -20,6 +20,7 @@ Output/Songs
|
||||
*.log
|
||||
/Output/Playlists/*.xml
|
||||
/Output/x64/gstreamer/GstreamerHelper.dll
|
||||
/Output/x86/gstreamer/GstreamerHelper.dll
|
||||
*.tlog
|
||||
*.suo
|
||||
*.obj
|
||||
@@ -35,6 +36,6 @@ Output/Songs
|
||||
*.nativecodeanalysis*
|
||||
*.lastcodeanalysissucceeded
|
||||
/PartyModes/*/*/*.dll
|
||||
|
||||
*.Cache
|
||||
/Output/x86/gstreamer/GstreamerHelper.dll
|
||||
/GstreamerHelper/bin/*
|
||||
/VocaluxeLib/bin
|
||||
@@ -39,14 +39,14 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWin|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWin|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<PlatformToolset>v110_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
@@ -67,29 +67,35 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugWin|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\Output\x86\gstreamer\</OutDir>
|
||||
<LinkIncremental>
|
||||
</LinkIncremental>
|
||||
<OutDir>bin\$(Configuration).$(Platform)\</OutDir>
|
||||
<IncludePath>$(MSBuildProjectDirectory)\x86\lib\glib-2.0\include;$(MSBuildProjectDirectory)\x86\include\gstreamer-1.0;$(MSBuildProjectDirectory)\x86\include\glib-2.0;$(MSBuildProjectDirectory)\x86\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(MSBuildProjectDirectory)\x86\lib;$(LibraryPath)</LibraryPath>
|
||||
<GenerateManifest>true</GenerateManifest>
|
||||
<IntDir>obj\$(Configuration).$(Platform)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugWin|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>..\Output\x64\gstreamer\</OutDir>
|
||||
<OutDir>bin\$(Configuration).$(Platform)\</OutDir>
|
||||
<IncludePath>$(MSBuildProjectDirectory)\x64\lib\glib-2.0\include;$(MSBuildProjectDirectory)\x64\include\gstreamer-1.0;$(MSBuildProjectDirectory)\x64\include\glib-2.0;$(MSBuildProjectDirectory)\x64\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(MSBuildProjectDirectory)\x64\lib;$(LibraryPath)</LibraryPath>
|
||||
<CodeAnalysisRuleSet>..\CheckingRules.ruleset</CodeAnalysisRuleSet>
|
||||
<IntDir>obj\$(Configuration).$(Platform)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWin|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\Output\x86\gstreamer\</OutDir>
|
||||
<OutDir>bin\$(Configuration).$(Platform)\</OutDir>
|
||||
<IncludePath>$(MSBuildProjectDirectory)\x86\lib\glib-2.0\include;$(MSBuildProjectDirectory)\x86\include\gstreamer-1.0;$(MSBuildProjectDirectory)\x86\include\glib-2.0;$(MSBuildProjectDirectory)\x86\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(MSBuildProjectDirectory)\x86\lib;$(LibraryPath)</LibraryPath>
|
||||
<IntDir>obj\$(Configuration).$(Platform)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWin|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>..\Output\x64\gstreamer\</OutDir>
|
||||
<OutDir>bin\$(Configuration).$(Platform)\</OutDir>
|
||||
<IncludePath>$(MSBuildProjectDirectory)\x64\lib\glib-2.0\include;$(MSBuildProjectDirectory)\x64\include\gstreamer-1.0;$(MSBuildProjectDirectory)\x64\include\glib-2.0;$(MSBuildProjectDirectory)\x64\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(MSBuildProjectDirectory)\x64\lib;$(LibraryPath)</LibraryPath>
|
||||
<IntDir>obj\$(Configuration).$(Platform)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>..\Output\x86</OutDir>
|
||||
@@ -111,6 +117,12 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>gstreamer-1.0.lib;gstcontroller-1.0.lib;gobject-2.0.lib;glib-2.0.lib;gstapp-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(OutDir)*.dll" "$(SolutionDir)Output\x86\gstreamer\" /I /Y</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copying binary</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugWin|x64'">
|
||||
<ClCompile>
|
||||
@@ -125,6 +137,9 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>gstreamer-1.0.lib;gstcontroller-1.0.lib;gobject-2.0.lib;glib-2.0.lib;gstapp-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(OutDir)*.dll" "$(SolutionDir)Output\x64\gstreamer\" /I /Y</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWin|Win32'">
|
||||
<ClCompile>
|
||||
@@ -138,12 +153,18 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>gstreamer-1.0.lib;gstcontroller-1.0.lib;gobject-2.0.lib;glib-2.0.lib;gstapp-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(OutDir)*.dll" "$(SolutionDir)Output\x86\gstreamer\" /I /Y</Command>
|
||||
</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
<Message>Copying binary</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWin|x64'">
|
||||
<ClCompile>
|
||||
@@ -159,11 +180,14 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>gstreamer-1.0.lib;gstcontroller-1.0.lib;gobject-2.0.lib;glib-2.0.lib;gstapp-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(OutDir)*.dll" "$(SolutionDir)Output\x64\gstreamer\" /I /Y</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GstreamerAudio.h" />
|
||||
|
||||
@@ -130,7 +130,8 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>cd $(SolutionDir)Partymodes\
|
||||
<PostBuildEvent>if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
|
||||
cd $(SolutionDir)Partymodes\
|
||||
xcopy "$(ProjectDir)*.cs" "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\" /EXCLUDE:Excludes.txt /I /Y</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
@@ -504,7 +505,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
List<int> ids = new List<int>();
|
||||
|
||||
var visibleSongs = CBase.Songs.GetVisibleSongs();
|
||||
ReadOnlyCollection<CSong> visibleSongs = CBase.Songs.GetVisibleSongs();
|
||||
if (visibleSongs.Count == 0)
|
||||
{
|
||||
CBase.Log.LogError("CPartyChallengeMedleyMode Error: There are no songs!");
|
||||
|
||||
@@ -130,7 +130,8 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>cd $(SolutionDir)Partymodes\
|
||||
<PostBuildEvent>if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
|
||||
cd $(SolutionDir)Partymodes\
|
||||
xcopy "$(ProjectDir)*.cs" "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\" /EXCLUDE:Excludes.txt /I /Y</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -129,7 +129,8 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>cd $(SolutionDir)Partymodes\
|
||||
<PostBuildEvent>if exist "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" rd "$(SolutionDir)Output\PartyModes\$(TargetName)\Code" /S /Q
|
||||
cd $(SolutionDir)Partymodes\
|
||||
xcopy "$(ProjectDir)*.cs" "$(SolutionDir)Output\PartyModes\$(TargetName)\Code\" /EXCLUDE:Excludes.txt /I /Y</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SpecifyACultureInStringConversionExplicitly/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestUseVarKeywordEverywhere/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestUseVarKeywordEvident/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Cleanup/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="Cleanup"><CSArrangeThisQualifier>True</CSArrangeThisQualifier><CSRemoveCodeRedundancies>True</CSRemoveCodeRedundancies><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSUseVar><BehavourStyle>CAN_CHANGE_TO_EXPLICIT</BehavourStyle><LocalVariableStyle>ALWAYS_EXPLICIT</LocalVariableStyle><ForeachVariableStyle>ALWAYS_EXPLICIT</ForeachVariableStyle></CSUseVar><CSOptimizeUsings><OptimizeUsings>False</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSShortenReferences>True</CSShortenReferences><StyleCop.Documentation><SA1600ElementsMustBeDocumented>False</SA1600ElementsMustBeDocumented><SA1604ElementDocumentationMustHaveSummary>False</SA1604ElementDocumentationMustHaveSummary><SA1609PropertyDocumentationMustHaveValueDocumented>False</SA1609PropertyDocumentationMustHaveValueDocumented><SA1611ElementParametersMustBeDocumented>False</SA1611ElementParametersMustBeDocumented><SA1615ElementReturnValueMustBeDocumented>False</SA1615ElementReturnValueMustBeDocumented><SA1617VoidReturnValueMustNotBeDocumented>False</SA1617VoidReturnValueMustNotBeDocumented><SA1618GenericTypeParametersMustBeDocumented>False</SA1618GenericTypeParametersMustBeDocumented><SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes>False</SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes><SA1628DocumentationTextMustBeginWithACapitalLetter>False</SA1628DocumentationTextMustBeginWithACapitalLetter><SA1629DocumentationTextMustEndWithAPeriod>False</SA1629DocumentationTextMustEndWithAPeriod><SA1633SA1641UpdateFileHeader>Ignore</SA1633SA1641UpdateFileHeader><SA1639FileHeaderMustHaveSummary>False</SA1639FileHeaderMustHaveSummary><SA1642ConstructorSummaryDocumentationMustBeginWithStandardText>False</SA1642ConstructorSummaryDocumentationMustBeginWithStandardText><SA1643DestructorSummaryDocumentationMustBeginWithStandardText>False</SA1643DestructorSummaryDocumentationMustBeginWithStandardText><SA1644DocumentationHeadersMustNotContainBlankLines>False</SA1644DocumentationHeadersMustNotContainBlankLines></StyleCop.Documentation><StyleCop.Layout><SA1500CurlyBracketsForMultiLineStatementsMustNotShareLine>False</SA1500CurlyBracketsForMultiLineStatementsMustNotShareLine><SA1509OpeningCurlyBracketsMustNotBePrecededByBlankLine>True</SA1509OpeningCurlyBracketsMustNotBePrecededByBlankLine><SA1510ChainedStatementBlocksMustNotBePrecededByBlankLine>True</SA1510ChainedStatementBlocksMustNotBePrecededByBlankLine><SA1511WhileDoFooterMustNotBePrecededByBlankLine>True</SA1511WhileDoFooterMustNotBePrecededByBlankLine><SA1512SingleLineCommentsMustNotBeFollowedByBlankLine>True</SA1512SingleLineCommentsMustNotBeFollowedByBlankLine><SA1513ClosingCurlyBracketMustBeFollowedByBlankLine>False</SA1513ClosingCurlyBracketMustBeFollowedByBlankLine><SA1514ElementDocumentationHeaderMustBePrecededByBlankLine>False</SA1514ElementDocumentationHeaderMustBePrecededByBlankLine><SA1515SingleLineCommentMustBeProceededByBlankLine>False</SA1515SingleLineCommentMustBeProceededByBlankLine></StyleCop.Layout><StyleCop.Readability><SA1100DoNotPrefixCallsWithBaseUnlessLocalImplementationExists>True</SA1100DoNotPrefixCallsWithBaseUnlessLocalImplementationExists><SA1106CodeMustNotContainEmptyStatements>True</SA1106CodeMustNotContainEmptyStatements><SA1108BlockStatementsMustNotContainEmbeddedComments>True</SA1108BlockStatementsMustNotContainEmbeddedComments><SA1109BlockStatementsMustNotContainEmbeddedRegions>True</SA1109BlockStatementsMustNotContainEmbeddedRegions><SA1120CommentsMustContainText>False</SA1120CommentsMustContainText><SA1121UseBuiltInTypeAlias>False</SA1121UseBuiltInTypeAlias><SA1122UseStringEmptyForEmptyStrings>False</SA1122UseStringEmptyForEmptyStrings><SA1123DoNotPlaceRegionsWithinElements>False</SA1123DoNotPlaceRegionsWithinElements><SA1124CodeMustNotContainEmptyRegions>True</SA1124CodeMustNotContainEmptyRegions></StyleCop.Readability><StyleCop.Spacing><SA1001CommasMustBeSpacedCorrectly>False</SA1001CommasMustBeSpacedCorrectly><SA1005SingleLineCommentsMustBeginWithSingleSpace>False</SA1005SingleLineCommentsMustBeginWithSingleSpace><SA1006PreprocessorKeywordsMustNotBePrecededBySpaLine truncated
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Cleanup/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="Cleanup"><CSArrangeThisQualifier>True</CSArrangeThisQualifier><CSRemoveCodeRedundancies>True</CSRemoveCodeRedundancies><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSUseVar><BehavourStyle>CAN_CHANGE_TO_EXPLICIT</BehavourStyle><LocalVariableStyle>ALWAYS_EXPLICIT</LocalVariableStyle><ForeachVariableStyle>ALWAYS_EXPLICIT</ForeachVariableStyle></CSUseVar><CSOptimizeUsings><OptimizeUsings>False</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSShortenReferences>True</CSShortenReferences><StyleCop.Documentation><SA1600ElementsMustBeDocumented>False</SA1600ElementsMustBeDocumented><SA1604ElementDocumentationMustHaveSummary>False</SA1604ElementDocumentationMustHaveSummary><SA1609PropertyDocumentationMustHaveValueDocumented>False</SA1609PropertyDocumentationMustHaveValueDocumented><SA1611ElementParametersMustBeDocumented>False</SA1611ElementParametersMustBeDocumented><SA1615ElementReturnValueMustBeDocumented>False</SA1615ElementReturnValueMustBeDocumented><SA1617VoidReturnValueMustNotBeDocumented>False</SA1617VoidReturnValueMustNotBeDocumented><SA1618GenericTypeParametersMustBeDocumented>False</SA1618GenericTypeParametersMustBeDocumented><SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes>False</SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes><SA1628DocumentationTextMustBeginWithACapitalLetter>False</SA1628DocumentationTextMustBeginWithACapitalLetter><SA1629DocumentationTextMustEndWithAPeriod>False</SA1629DocumentationTextMustEndWithAPeriod><SA1633SA1641UpdateFileHeader>Ignore</SA1633SA1641UpdateFileHeader><SA1639FileHeaderMustHaveSummary>False</SA1639FileHeaderMustHaveSummary><SA1642ConstructorSummaryDocumentationMustBeginWithStandardText>False</SA1642ConstructorSummaryDocumentationMustBeginWithStandardText><SA1643DestructorSummaryDocumentationMustBeginWithStandardText>False</SA1643DestructorSummaryDocumentationMustBeginWithStandardText><SA1644DocumentationHeadersMustNotContainBlankLines>False</SA1644DocumentationHeadersMustNotContainBlankLines></StyleCop.Documentation><StyleCop.Layout><SA1500CurlyBracketsForMultiLineStatementsMustNotShareLine>False</SA1500CurlyBracketsForMultiLineStatementsMustNotShareLine><SA1509OpeningCurlyBracketsMustNotBePrecededByBlankLine>True</SA1509OpeningCurlyBracketsMustNotBePrecededByBlankLine><SA1510ChainedStatementBlocksMustNotBePrecededByBlankLine>True</SA1510ChainedStatementBlocksMustNotBePrecededByBlankLine><SA1511WhileDoFooterMustNotBePrecededByBlankLine>True</SA1511WhileDoFooterMustNotBePrecededByBlankLine><SA1512SingleLineCommentsMustNotBeFollowedByBlankLine>True</SA1512SingleLineCommentsMustNotBeFollowedByBlankLine><SA1513ClosingCurlyBracketMustBeFollowedByBlankLine>False</SA1513ClosingCurlyBracketMustBeFollowedByBlankLine><SA1514ElementDocumentationHeaderMustBePrecededByBlankLine>False</SA1514ElementDocumentationHeaderMustBePrecededByBlankLine><SA1515SingleLineCommentMustBeProceededByBlankLine>False</SA1515SingleLineCommentMustBeProceededByBlankLine></StyleCop.Layout><StyleCop.Readability><SA1100DoNotPrefixCallsWithBaseUnlessLocalImplementationExists>True</SA1100DoNotPrefixCallsWithBaseUnlessLocalImplementationExists><SA1106CodeMustNotContainEmptyStatements>True</SA1106CodeMustNotContainEmptyStatements><SA1108BlockStatementsMustNotContainEmbeddedComments>True</SA1108BlockStatementsMustNotContainEmbeddedComments><SA1109BlockStatementsMustNotContainEmbeddedRegions>True</SA1109BlockStatementsMustNotContainEmbeddedRegions><SA1120CommentsMustContainText>False</SA1120CommentsMustContainText><SA1121UseBuiltInTypeAlias>False</SA1121UseBuiltInTypeAlias><SA1122UseStringEmptyForEmptyStrings>False</SA1122UseStringEmptyForEmptyStrings><SA1123DoNotPlaceRegionsWithinElements>False</SA1123DoNotPlaceRegionsWithinElements><SA1124CodeMustNotContainEmptyRegions>True</SA1124CodeMustNotContainEmptyRegions></StyleCop.Readability><StyleCop.Spacing><SA1001CommasMustBeSpacedCorrectly>False</SA1001CommasMustBeSpacedCorrectly><SA1005SingleLineCommentsMustBeginWithSingleSpace>False</SA1005SingleLineCommentsMustBeginWithSingleSpace><SA1006PreprocessorKeywordsMustNotBePrecededBySpaLine truncated
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=Simple_0020Reformat/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="Simple Reformat"><CSOptimizeUsings><OptimizeUsings>False</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><StyleCop.Documentation><SA1600ElementsMustBeDocumented>False</SA1600ElementsMustBeDocumented><SA1604ElementDocumentationMustHaveSummary>False</SA1604ElementDocumentationMustHaveSummary><SA1609PropertyDocumentationMustHaveValueDocumented>False</SA1609PropertyDocumentationMustHaveValueDocumented><SA1611ElementParametersMustBeDocumented>False</SA1611ElementParametersMustBeDocumented><SA1615ElementReturnValueMustBeDocumented>False</SA1615ElementReturnValueMustBeDocumented><SA1617VoidReturnValueMustNotBeDocumented>False</SA1617VoidReturnValueMustNotBeDocumented><SA1618GenericTypeParametersMustBeDocumented>False</SA1618GenericTypeParametersMustBeDocumented><SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes>False</SA1626SingleLineCommentsMustNotUseDocumentationStyleSlashes><SA1628DocumentationTextMustBeginWithACapitalLetter>False</SA1628DocumentationTextMustBeginWithACapitalLetter><SA1629DocumentationTextMustEndWithAPeriod>False</SA1629DocumentationTextMustEndWithAPeriod><SA1633SA1641UpdateFileHeader>Ignore</SA1633SA1641UpdateFileHeader><SA1639FileHeaderMustHaveSummary>False</SA1639FileHeaderMustHaveSummary><SA1642ConstructorSummaryDocumentationMustBeginWithStandardText>False</SA1642ConstructorSummaryDocumentationMustBeginWithStandardText><SA1643DestructorSummaryDocumentationMustBeginWithStandardText>False</SA1643DestructorSummaryDocumentationMustBeginWithStandardText><SA1644DocumentationHeadersMustNotContainBlankLines>False</SA1644DocumentationHeadersMustNotContainBlankLines></StyleCop.Documentation><StyleCop.Spacing><SA1001CommasMustBeSpacedCorrectly>False</SA1001CommasMustBeSpacedCorrectly><SA1005SingleLineCommentsMustBeginWithSingleSpace>False</SA1005SingleLineCommentsMustBeginWithSingleSpace><SA1006PreprocessorKeywordsMustNotBePrecededBySpace>True</SA1006PreprocessorKeywordsMustNotBePrecededBySpace><SA1021NegativeSignsMustBeSpacedCorrectly>True</SA1021NegativeSignsMustBeSpacedCorrectly><SA1022PositiveSignsMustBeSpacedCorrectly>True</SA1022PositiveSignsMustBeSpacedCorrectly><SA1025CodeMustNotContainMultipleWhitespaceInARow>True</SA1025CodeMustNotContainMultipleWhitespaceInARow></StyleCop.Spacing><StyleCop.Readability><SA1100DoNotPrefixCallsWithBaseUnlessLocalImplementationExists>True</SA1100DoNotPrefixCallsWithBaseUnlessLocalImplementationExists><SA1106CodeMustNotContainEmptyStatements>True</SA1106CodeMustNotContainEmptyStatements><SA1108BlockStatementsMustNotContainEmbeddedComments>True</SA1108BlockStatementsMustNotContainEmbeddedComments><SA1109BlockStatementsMustNotContainEmbeddedRegions>True</SA1109BlockStatementsMustNotContainEmbeddedRegions><SA1120CommentsMustContainText>False</SA1120CommentsMustContainText><SA1121UseBuiltInTypeAlias>False</SA1121UseBuiltInTypeAlias><SA1122UseStringEmptyForEmptyStrings>False</SA1122UseStringEmptyForEmptyStrings><SA1123DoNotPlaceRegionsWithinElements>False</SA1123DoNotPlaceRegionsWithinElements><SA1124CodeMustNotContainEmptyRegions>True</SA1124CodeMustNotContainEmptyRegions></StyleCop.Readability><StyleCop.Layout><SA1500CurlyBracketsForMultiLineStatementsMustNotShareLine>False</SA1500CurlyBracketsForMultiLineStatementsMustNotShareLine><SA1509OpeningCurlyBracketsMustNotBePrecededByBlankLine>True</SA1509OpeningCurlyBracketsMustNotBePrecededByBlankLine><SA1510ChainedStatementBlocksMustNotBePrecededByBlankLine>True</SA1510ChainedStatementBlocksMustNotBePrecededByBlankLine><SA1511WhileDoFooterMustNotBePrecededByBlankLine>True</SA1511WhileDoFooterMustNotBePrecededByBlankLine><SA1512SingleLineCommentsMustNotBeFollowedByBlankLine>True</SA1512SingleLineCommentsMustNotBeFollowedByBlankLine><SA1513ClosingCurlyBracketMustBeFollowedByBlankLine>False</SA1513ClosingCurlyBracketMustBeFollowedByBlankLine><SA1514ElementDocumentationHeaderMustBePrecededByBlankLine>False</SA1514ElementDocumentationHeaderMustBePrecededByBlankLine><SA1515SingleLineCommentMustBeProceededByBlankLine>False</SA1515SingleLineCommentMustBeProceededByBlankLine></StyleCop.Layout><StyleCop.Ordering><AlphabeticalUsingDirectives>Ignore</AlphabeticalUsingDirectives><ExpandUsingDirectiLine truncated
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue">Cleanup</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/SilentCleanupProfile/@EntryValue">Simple Reformat</s:String>
|
||||
@@ -25,6 +25,7 @@
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_USING_BRACES_STYLE/@EntryValue">ONLY_FOR_MULTILINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_WHILE_BRACES_STYLE/@EntryValue">ONLY_FOR_MULTILINE</s:String>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_USER_LINEBREAKS/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_COMPLEX_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_EMBEDDED_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
|
||||
@@ -36,7 +37,9 @@
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">180</s:Int64>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_MULTIPLE_DECLARATION_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_TERNARY_EXPR_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AllowAlias/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/QualifiedUsingAtNestedScope/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderRegionName/@EntryValue">license</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">/*
|
||||
This file is part of $SOLUTION$.
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace Vocaluxe.Base
|
||||
public static int ScreenH = 576;
|
||||
|
||||
public static EAntiAliasingModes AAMode = EAntiAliasingModes.X0;
|
||||
public static EColorDepth ColorDepth = EColorDepth.Bit32;
|
||||
|
||||
public static EOffOn VSync = EOffOn.TR_CONFIG_ON;
|
||||
public static EOffOn FullScreen = EOffOn.TR_CONFIG_ON;
|
||||
@@ -166,7 +165,6 @@ namespace Vocaluxe.Base
|
||||
xmlReader.TryGetIntValue("//root/Graphics/ScreenW", ref ScreenW);
|
||||
xmlReader.TryGetIntValue("//root/Graphics/ScreenH", ref ScreenH);
|
||||
xmlReader.TryGetEnumValue("//root/Graphics/AAMode", ref AAMode);
|
||||
xmlReader.TryGetEnumValue("//root/Graphics/Colors", ref ColorDepth);
|
||||
xmlReader.TryGetFloatValue("//root/Graphics/MaxFPS", ref MaxFPS);
|
||||
xmlReader.TryGetEnumValue("//root/Graphics/VSync", ref VSync);
|
||||
xmlReader.TryGetEnumValue("//root/Graphics/FullScreen", ref FullScreen);
|
||||
@@ -330,9 +328,6 @@ namespace Vocaluxe.Base
|
||||
writer.WriteComment("AAMode: " + CHelper.ListStrings(Enum.GetNames(typeof(EAntiAliasingModes))));
|
||||
writer.WriteElementString("AAMode", Enum.GetName(typeof(EAntiAliasingModes), AAMode));
|
||||
|
||||
writer.WriteComment("Colors: " + CHelper.ListStrings(Enum.GetNames(typeof(EColorDepth))));
|
||||
writer.WriteElementString("Colors", Enum.GetName(typeof(EColorDepth), ColorDepth));
|
||||
|
||||
writer.WriteComment("MaxFPS should be between 1..200");
|
||||
writer.WriteElementString("MaxFPS", MaxFPS.ToString("#"));
|
||||
|
||||
|
||||
@@ -584,6 +584,11 @@ namespace Vocaluxe.Base
|
||||
return CSongs.NumSongsInCategory(categoryIndex);
|
||||
}
|
||||
|
||||
public bool IsInCategory()
|
||||
{
|
||||
return CSongs.IsInCategory;
|
||||
}
|
||||
|
||||
public int GetCurrentCategoryIndex()
|
||||
{
|
||||
return CSongs.Category;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Vocaluxe.Lib.Playlist;
|
||||
@@ -223,7 +224,7 @@ namespace Vocaluxe.Base
|
||||
private static CPlaylistFile _ConvertUSDXPlaylist(string file)
|
||||
{
|
||||
CPlaylistFile pl = new CPlaylistFile();
|
||||
var allSongs = CSongs.AllSongs;
|
||||
ReadOnlyCollection<CSong> allSongs = CSongs.AllSongs;
|
||||
|
||||
if (!File.Exists(file))
|
||||
return null;
|
||||
|
||||
@@ -52,6 +52,8 @@ namespace Vocaluxe.Base
|
||||
if (value == _Tabs)
|
||||
return;
|
||||
_Tabs = value;
|
||||
if (_Tabs == EOffOn.TR_CONFIG_ON)
|
||||
CSongs.Category = -1;
|
||||
_SetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
+14
-10
@@ -76,20 +76,25 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static int Category
|
||||
{
|
||||
get { return _CatIndex; }
|
||||
get
|
||||
{
|
||||
if (_CatIndex >= Categories.Count)
|
||||
_CatIndex = -1;
|
||||
return _CatIndex;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == -1 || IsCatIndexValid(value))
|
||||
if (value == -1 || _IsCatIndexValid(value))
|
||||
_CatIndex = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsInCategory
|
||||
{
|
||||
get { return _CatIndex >= 0; }
|
||||
get { return _IsCatIndexValid(_CatIndex); }
|
||||
}
|
||||
|
||||
private static bool IsCatIndexValid(int catIndex)
|
||||
private static bool _IsCatIndexValid(int catIndex)
|
||||
{
|
||||
return catIndex >= 0 && catIndex < Categories.Count;
|
||||
}
|
||||
@@ -101,7 +106,7 @@ namespace Vocaluxe.Base
|
||||
/// <returns></returns>
|
||||
public static int NumSongsInCategory(int catIndex)
|
||||
{
|
||||
return IsCatIndexValid(catIndex) ? Categories[catIndex].Songs.Count(sp => !sp.IsSung) : 0;
|
||||
return _IsCatIndexValid(catIndex) ? Categories[catIndex].Songs.Count(sp => !sp.IsSung) : 0;
|
||||
}
|
||||
|
||||
public static void NextCategory()
|
||||
@@ -139,7 +144,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static string GetCurrentCategoryName()
|
||||
{
|
||||
return IsCatIndexValid(_CatIndex) ? Categories[_CatIndex].Name : "";
|
||||
return _IsCatIndexValid(_CatIndex) ? Categories[_CatIndex].Name : "";
|
||||
}
|
||||
|
||||
public static CSong GetSong(int songID)
|
||||
@@ -170,7 +175,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static void ResetPartySongSung(int catIndex)
|
||||
{
|
||||
if (IsCatIndexValid(catIndex))
|
||||
if (_IsCatIndexValid(catIndex))
|
||||
{
|
||||
foreach (CSongPointer song in Categories[catIndex].Songs)
|
||||
song.IsSung = false;
|
||||
@@ -247,7 +252,7 @@ namespace Vocaluxe.Base
|
||||
get
|
||||
{
|
||||
List<CSong> songs = new List<CSong>();
|
||||
if (IsCatIndexValid(_CatIndex))
|
||||
if (_IsCatIndexValid(_CatIndex))
|
||||
{
|
||||
foreach (CSongPointer sp in Categories[_CatIndex].Songs)
|
||||
{
|
||||
@@ -268,14 +273,13 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (index < 0)
|
||||
return null;
|
||||
var visSongs = VisibleSongs;
|
||||
ReadOnlyCollection<CSong> visSongs = VisibleSongs;
|
||||
return (index < visSongs.Count) ? visSongs[index] : null;
|
||||
}
|
||||
|
||||
private static void _HandleCategoriesChanged(object sender, EventArgs args)
|
||||
{
|
||||
_CategoriesForRandom.Clear();
|
||||
Category = _CatIndex;
|
||||
}
|
||||
|
||||
public static void Sort(ESongSorting sorting, EOffOn tabs, EOffOn ignoreArticles, String searchString, EDuetOptions duetOptions)
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
using System;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using VocaluxeLib.Menu.SongMenu;
|
||||
|
||||
namespace Vocaluxe.GameModes
|
||||
{
|
||||
|
||||
+235
-257
@@ -18,6 +18,7 @@
|
||||
#endregion
|
||||
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Threading;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
@@ -25,13 +26,33 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using Vocaluxe.Base;
|
||||
using Vocaluxe.Base.Font;
|
||||
using VocaluxeLib.Menu;
|
||||
using BeginMode = OpenTK.Graphics.OpenGL.BeginMode;
|
||||
using BlendingFactorDest = OpenTK.Graphics.OpenGL.BlendingFactorDest;
|
||||
using BlendingFactorSrc = OpenTK.Graphics.OpenGL.BlendingFactorSrc;
|
||||
using BufferAccess = OpenTK.Graphics.OpenGL.BufferAccess;
|
||||
using BufferTarget = OpenTK.Graphics.OpenGL.BufferTarget;
|
||||
using BufferUsageHint = OpenTK.Graphics.OpenGL.BufferUsageHint;
|
||||
using ClearBufferMask = OpenTK.Graphics.OpenGL.ClearBufferMask;
|
||||
using DepthFunction = OpenTK.Graphics.OpenGL.DepthFunction;
|
||||
using EnableCap = OpenTK.Graphics.OpenGL.EnableCap;
|
||||
using GL = OpenTK.Graphics.OpenGL.GL;
|
||||
using GenerateMipmapTarget = OpenTK.Graphics.OpenGL.GenerateMipmapTarget;
|
||||
using KeyPressEventArgs = System.Windows.Forms.KeyPressEventArgs;
|
||||
using MatrixMode = OpenTK.Graphics.OpenGL.MatrixMode;
|
||||
using PixelFormat = OpenTK.Graphics.OpenGL.PixelFormat;
|
||||
using PixelInternalFormat = OpenTK.Graphics.OpenGL.PixelInternalFormat;
|
||||
using PixelStoreParameter = OpenTK.Graphics.OpenGL.PixelStoreParameter;
|
||||
using PixelType = OpenTK.Graphics.OpenGL.PixelType;
|
||||
using TextureMagFilter = OpenTK.Graphics.OpenGL.TextureMagFilter;
|
||||
using TextureMinFilter = OpenTK.Graphics.OpenGL.TextureMinFilter;
|
||||
using TextureParameterName = OpenTK.Graphics.OpenGL.TextureParameterName;
|
||||
using TextureTarget = OpenTK.Graphics.OpenGL.TextureTarget;
|
||||
|
||||
namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
@@ -89,12 +110,11 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
//Check AA Mode
|
||||
CConfig.AAMode = (EAntiAliasingModes)_CheckAntiAliasingMode((int)CConfig.AAMode);
|
||||
CConfig.ColorDepth = (EColorDepth)_CheckColorDepth((int)CConfig.ColorDepth);
|
||||
|
||||
bool ok = false;
|
||||
try
|
||||
{
|
||||
GraphicsMode gm = new GraphicsMode((int)CConfig.ColorDepth, 24, 0, (int)CConfig.AAMode);
|
||||
GraphicsMode gm = new GraphicsMode(32, 24, 0, (int)CConfig.AAMode);
|
||||
_Control = new GLControl(gm, 2, 1, GraphicsContextFlags.Default);
|
||||
if (_Control.GraphicsMode != null)
|
||||
ok = true;
|
||||
@@ -221,8 +241,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
screenNr = i;
|
||||
}
|
||||
|
||||
DesktopBounds = new Rectangle(Screen.AllScreens[screenNr].Bounds.Location,
|
||||
new Size(Screen.AllScreens[screenNr].Bounds.Width, Screen.AllScreens[screenNr].Bounds.Height));
|
||||
DesktopBounds = new Rectangle(Screen.AllScreens[screenNr].Bounds.Location, new Size(Screen.AllScreens[screenNr].Bounds.Width, Screen.AllScreens[screenNr].Bounds.Height));
|
||||
|
||||
if (WindowState == FormWindowState.Maximized)
|
||||
{
|
||||
@@ -260,7 +279,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.ClearColor(Color.Black);
|
||||
GL.ClearColor(Color.Black);
|
||||
}
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
@@ -338,7 +357,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
_Keys.KeyDown(e);
|
||||
}
|
||||
|
||||
private void _OnKeyPressEvent(object sender, System.Windows.Forms.KeyPressEventArgs e)
|
||||
private void _OnKeyPressEvent(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
_Keys.KeyPress(e);
|
||||
}
|
||||
@@ -368,10 +387,10 @@ namespace Vocaluxe.Lib.Draw
|
||||
_Y = (_Control.Height - _H) / 2;
|
||||
}
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.MatrixMode(OpenTK.Graphics.OpenGL.MatrixMode.Projection);
|
||||
OpenTK.Graphics.OpenGL.GL.LoadIdentity();
|
||||
OpenTK.Graphics.OpenGL.GL.Ortho(0, CSettings.RenderW, CSettings.RenderH, 0, CSettings.ZNear, CSettings.ZFar);
|
||||
OpenTK.Graphics.OpenGL.GL.Viewport(_X, _Y, _W, _H);
|
||||
GL.MatrixMode(MatrixMode.Projection);
|
||||
GL.LoadIdentity();
|
||||
GL.Ortho(0, CSettings.RenderW, CSettings.RenderH, 0, CSettings.ZNear, CSettings.ZFar);
|
||||
GL.Viewport(_X, _Y, _W, _H);
|
||||
}
|
||||
|
||||
#region implementation
|
||||
@@ -382,14 +401,14 @@ namespace Vocaluxe.Lib.Draw
|
||||
Text = CSettings.GetFullVersionText();
|
||||
|
||||
// Init Texturing
|
||||
OpenTK.Graphics.OpenGL.GL.Enable(OpenTK.Graphics.OpenGL.EnableCap.Texture2D);
|
||||
GL.Enable(EnableCap.Texture2D);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BlendFunc(OpenTK.Graphics.OpenGL.BlendingFactorSrc.SrcAlpha, OpenTK.Graphics.OpenGL.BlendingFactorDest.OneMinusSrcAlpha);
|
||||
OpenTK.Graphics.OpenGL.GL.PixelStore(OpenTK.Graphics.OpenGL.PixelStoreParameter.UnpackAlignment, 1);
|
||||
GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
|
||||
GL.PixelStore(PixelStoreParameter.UnpackAlignment, 1);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.DepthRange(CSettings.ZFar, CSettings.ZNear);
|
||||
OpenTK.Graphics.OpenGL.GL.DepthFunc(OpenTK.Graphics.OpenGL.DepthFunction.Lequal);
|
||||
OpenTK.Graphics.OpenGL.GL.Enable(OpenTK.Graphics.OpenGL.EnableCap.DepthTest);
|
||||
GL.DepthRange(CSettings.ZFar, CSettings.ZNear);
|
||||
GL.DepthFunc(DepthFunction.Lequal);
|
||||
GL.Enable(EnableCap.DepthTest);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -480,15 +499,15 @@ namespace Vocaluxe.Lib.Draw
|
||||
#region Basic Draw Methods
|
||||
public void ClearScreen()
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit | OpenTK.Graphics.OpenGL.ClearBufferMask.DepthBufferBit);
|
||||
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||
}
|
||||
|
||||
public STexture CopyScreen()
|
||||
{
|
||||
STexture texture = new STexture(-1);
|
||||
|
||||
int id = OpenTK.Graphics.OpenGL.GL.GenTexture();
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, id);
|
||||
int id = GL.GenTexture();
|
||||
GL.BindTexture(TextureTarget.Texture2D, id);
|
||||
texture.ID = id;
|
||||
|
||||
texture.Width = _W;
|
||||
@@ -499,19 +518,14 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.WidthRatio = texture.Width / texture.W2;
|
||||
texture.HeightRatio = texture.Height / texture.H2;
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelInternalFormat.Rgba, (int)texture.W2,
|
||||
(int)texture.H2, 0,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.CopyTexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, _X, _Y,
|
||||
(int)texture.Width, (int)texture.Height);
|
||||
GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, _X, _Y, (int)texture.Width, (int)texture.Height);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMagFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMagFilter.Linear);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
|
||||
// Add to Texture List
|
||||
texture.Color = new SColorF(1f, 1f, 1f, 1f);
|
||||
@@ -535,12 +549,11 @@ namespace Vocaluxe.Lib.Draw
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, texture.ID);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.CopyTexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, 0, 0,
|
||||
(int)texture.Width, (int)texture.Height);
|
||||
GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, 0, 0, (int)texture.Width, (int)texture.Height);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,7 +573,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
BitmapData bmpData = screen.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.ReadPixels(0, 0, width, height, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, bmpData.Scan0);
|
||||
GL.ReadPixels(0, 0, width, height, PixelFormat.Bgra, PixelType.UnsignedByte, bmpData.Scan0);
|
||||
screen.UnlockBits(bmpData);
|
||||
|
||||
screen.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
@@ -578,17 +591,17 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
public void DrawColor(SColorF color, SRectF rect)
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.Enable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
GL.Enable(EnableCap.Blend);
|
||||
GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Begin(OpenTK.Graphics.OpenGL.BeginMode.Quads);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rect.X, rect.Y, rect.Z + CGraphics.ZOffset);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rect.X, rect.Y + rect.H, rect.Z + CGraphics.ZOffset);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rect.X + rect.W, rect.Y + rect.H, rect.Z + CGraphics.ZOffset);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rect.X + rect.W, rect.Y, rect.Z + CGraphics.ZOffset);
|
||||
OpenTK.Graphics.OpenGL.GL.End();
|
||||
GL.Begin(BeginMode.Quads);
|
||||
GL.Vertex3(rect.X, rect.Y, rect.Z + CGraphics.ZOffset);
|
||||
GL.Vertex3(rect.X, rect.Y + rect.H, rect.Z + CGraphics.ZOffset);
|
||||
GL.Vertex3(rect.X + rect.W, rect.Y + rect.H, rect.Z + CGraphics.ZOffset);
|
||||
GL.Vertex3(rect.X + rect.W, rect.Y, rect.Z + CGraphics.ZOffset);
|
||||
GL.End();
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Disable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
GL.Disable(EnableCap.Blend);
|
||||
}
|
||||
|
||||
public void DrawColorReflection(SColorF color, SRectF rect, float space, float height)
|
||||
@@ -614,32 +627,32 @@ namespace Vocaluxe.Lib.Draw
|
||||
ry2 = rect.Y + rect.H + space + height;
|
||||
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Enable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
GL.Enable(EnableCap.Blend);
|
||||
|
||||
if (Math.Abs(rect.Rotation) > 0.001)
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.Translate(0.5f, 0.5f, 0);
|
||||
OpenTK.Graphics.OpenGL.GL.Rotate(-rect.Rotation, 0f, 0f, 1f);
|
||||
OpenTK.Graphics.OpenGL.GL.Translate(-0.5f, -0.5f, 0);
|
||||
GL.Translate(0.5f, 0.5f, 0);
|
||||
GL.Rotate(-rect.Rotation, 0f, 0f, 1f);
|
||||
GL.Translate(-0.5f, -0.5f, 0);
|
||||
}
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Begin(OpenTK.Graphics.OpenGL.BeginMode.Quads);
|
||||
GL.Begin(BeginMode.Quads);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset);
|
||||
GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, 0f);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset);
|
||||
GL.Color4(color.R, color.G, color.B, 0f);
|
||||
GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, 0f);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset);
|
||||
GL.Color4(color.R, color.G, color.B, 0f);
|
||||
GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset);
|
||||
GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.End();
|
||||
GL.End();
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Disable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
GL.Disable(EnableCap.Blend);
|
||||
}
|
||||
#endregion Basic Draw Methods
|
||||
|
||||
@@ -718,8 +731,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
h = maxSize;
|
||||
}
|
||||
|
||||
int id = OpenTK.Graphics.OpenGL.GL.GenTexture();
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, id);
|
||||
int id = GL.GenTexture();
|
||||
GL.BindTexture(TextureTarget.Texture2D, id);
|
||||
texture.ID = id;
|
||||
|
||||
texture.Width = w;
|
||||
@@ -727,45 +740,41 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
texture.W2 = MathHelper.NextPowerOfTwo(w);
|
||||
texture.H2 = MathHelper.NextPowerOfTwo(h);
|
||||
|
||||
using (Bitmap bmp2 = new Bitmap((int)texture.W2, (int)texture.H2))
|
||||
try
|
||||
{
|
||||
Graphics g = Graphics.FromImage(bmp2);
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||
g.DrawImage(bmp, new Rectangle(0, 0, bmp2.Width, bmp2.Height));
|
||||
g.Dispose();
|
||||
using (Bitmap bmp2 = new Bitmap((int)texture.W2, (int)texture.H2))
|
||||
{
|
||||
Graphics g = Graphics.FromImage(bmp2);
|
||||
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||
g.DrawImage(bmp, new Rectangle(0, 0, bmp2.Width, bmp2.Height));
|
||||
g.Dispose();
|
||||
|
||||
texture.WidthRatio = 1f;
|
||||
texture.HeightRatio = 1f;
|
||||
texture.WidthRatio = 1f;
|
||||
texture.HeightRatio = 1f;
|
||||
|
||||
BitmapData bmpData = bmp2.LockBits(new Rectangle(0, 0, bmp2.Width, bmp2.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
BitmapData bmpData = bmp2.LockBits(new Rectangle(0, 0, bmp2.Width, bmp2.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelInternalFormat.Rgba, (int)texture.W2,
|
||||
(int)texture.H2, 0,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, bmpData.Width, bmpData.Height, PixelFormat.Bgra, PixelType.UnsignedByte, bmpData.Scan0);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, bmpData.Width, bmpData.Height,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, bmpData.Scan0);
|
||||
|
||||
bmp2.UnlockBits(bmpData);
|
||||
bmp2.UnlockBits(bmpData);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
CLog.LogError(w + " " + h + " " + (int)texture.W2 + " " + (int)texture.H2);
|
||||
throw;
|
||||
}
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureWrapS,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureParameterName.ClampToEdge);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureWrapT,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureParameterName.ClampToEdge);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMagFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMagFilter.Linear);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.Linear);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.LinearMipmapLinear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
|
||||
//GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
OpenTK.Graphics.OpenGL.GL.Ext.GenerateMipmap(OpenTK.Graphics.OpenGL.GenerateMipmapTarget.Texture2D);
|
||||
GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
|
||||
|
||||
// Add to Texture List
|
||||
@@ -790,11 +799,10 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
try
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.GenBuffers(1, out texture.PBO);
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
OpenTK.Graphics.OpenGL.GL.BufferData(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, (IntPtr)(w * h * 4), IntPtr.Zero,
|
||||
OpenTK.Graphics.OpenGL.BufferUsageHint.StreamDraw);
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, 0);
|
||||
GL.GenBuffers(1, out texture.PBO);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
GL.BufferData(BufferTarget.PixelUnpackBuffer, (IntPtr)(w * h * 4), IntPtr.Zero, BufferUsageHint.StreamDraw);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -802,8 +810,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
}
|
||||
}
|
||||
|
||||
int id = OpenTK.Graphics.OpenGL.GL.GenTexture();
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, id);
|
||||
int id = GL.GenTexture();
|
||||
GL.BindTexture(TextureTarget.Texture2D, id);
|
||||
texture.ID = id;
|
||||
|
||||
texture.Width = w;
|
||||
@@ -814,25 +822,20 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.WidthRatio = texture.Width / texture.W2;
|
||||
texture.HeightRatio = texture.Height / texture.H2;
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelInternalFormat.Rgba, (int)texture.W2,
|
||||
(int)texture.H2, 0,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, w, h,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, data);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, w, h, PixelFormat.Bgra, PixelType.UnsignedByte, data);
|
||||
|
||||
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMagFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMagFilter.Linear);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
|
||||
//GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
//GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
|
||||
// Add to Texture List
|
||||
texture.Color = new SColorF(1f, 1f, 1f, 1f);
|
||||
@@ -856,11 +859,10 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
try
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.GenBuffers(1, out texture.PBO);
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
OpenTK.Graphics.OpenGL.GL.BufferData(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, (IntPtr)data.Length, IntPtr.Zero,
|
||||
OpenTK.Graphics.OpenGL.BufferUsageHint.StreamDraw);
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, 0);
|
||||
GL.GenBuffers(1, out texture.PBO);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
GL.BufferData(BufferTarget.PixelUnpackBuffer, (IntPtr)data.Length, IntPtr.Zero, BufferUsageHint.StreamDraw);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -869,8 +871,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
}
|
||||
}
|
||||
|
||||
int id = OpenTK.Graphics.OpenGL.GL.GenTexture();
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, id);
|
||||
int id = GL.GenTexture();
|
||||
GL.BindTexture(TextureTarget.Texture2D, id);
|
||||
texture.ID = id;
|
||||
|
||||
texture.Width = w;
|
||||
@@ -881,25 +883,20 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.WidthRatio = texture.Width / texture.W2;
|
||||
texture.HeightRatio = texture.Height / texture.H2;
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelInternalFormat.Rgba, (int)texture.W2,
|
||||
(int)texture.H2, 0,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, w, h,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, data);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, w, h, PixelFormat.Bgra, PixelType.UnsignedByte, data);
|
||||
|
||||
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMagFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMagFilter.Linear);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
|
||||
//GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
//GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
|
||||
// Add to Texture List
|
||||
texture.Color = new SColorF(1f, 1f, 1f, 1f);
|
||||
@@ -944,22 +941,21 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
try
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
|
||||
IntPtr buffer = OpenTK.Graphics.OpenGL.GL.MapBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, OpenTK.Graphics.OpenGL.BufferAccess.WriteOnly);
|
||||
IntPtr buffer = GL.MapBuffer(BufferTarget.PixelUnpackBuffer, BufferAccess.WriteOnly);
|
||||
byte[] d = new byte[(int)texture.Height * (int)texture.Width * 4];
|
||||
|
||||
Marshal.Copy(data, d, 0, (int)texture.Height * (int)texture.Width * 4);
|
||||
Marshal.Copy(d, 0, buffer, (int)texture.Height * (int)texture.Width * 4);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.UnmapBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer);
|
||||
GL.UnmapBuffer(BufferTarget.PixelUnpackBuffer);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, texture.ID);
|
||||
OpenTK.Graphics.OpenGL.GL.TexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -969,26 +965,21 @@ namespace Vocaluxe.Lib.Draw
|
||||
}
|
||||
}
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, texture.ID);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, data);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, data);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureWrapS,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureParameterName.ClampToEdge);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureWrapT,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureParameterName.ClampToEdge);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.LinearMipmapLinear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
|
||||
//GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
OpenTK.Graphics.OpenGL.GL.Ext.GenerateMipmap(OpenTK.Graphics.OpenGL.GenerateMipmapTarget.Texture2D);
|
||||
GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1001,39 +992,35 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
if (_UsePBO)
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
|
||||
IntPtr buffer = OpenTK.Graphics.OpenGL.GL.MapBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, OpenTK.Graphics.OpenGL.BufferAccess.WriteOnly);
|
||||
IntPtr buffer = GL.MapBuffer(BufferTarget.PixelUnpackBuffer, BufferAccess.WriteOnly);
|
||||
Marshal.Copy(data, 0, buffer, data.Length);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.UnmapBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer);
|
||||
GL.UnmapBuffer(BufferTarget.PixelUnpackBuffer);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, texture.ID);
|
||||
OpenTK.Graphics.OpenGL.GL.TexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, texture.ID);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, data);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, (int)texture.Width, (int)texture.Height, PixelFormat.Bgra, PixelType.UnsignedByte, data);
|
||||
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMagFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMagFilter.Linear);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
|
||||
//GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
|
||||
//GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
//GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1048,9 +1035,9 @@ namespace Vocaluxe.Lib.Draw
|
||||
lock (_MutexTexture)
|
||||
{
|
||||
_IDs.Enqueue(texture.Index);
|
||||
OpenTK.Graphics.OpenGL.GL.DeleteTexture(texture.ID);
|
||||
GL.DeleteTexture(texture.ID);
|
||||
if (texture.PBO > 0)
|
||||
OpenTK.Graphics.OpenGL.GL.DeleteBuffers(1, ref texture.PBO);
|
||||
GL.DeleteBuffers(1, ref texture.PBO);
|
||||
_Textures.Remove(texture.Index);
|
||||
texture.Index = -1;
|
||||
texture.ID = -1;
|
||||
@@ -1114,7 +1101,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
if (_TextureExists(ref texture))
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, texture.ID);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
|
||||
float x1 = (bounds.X - rect.X) / rect.W * texture.WidthRatio;
|
||||
float x2 = (bounds.X + bounds.W - rect.X) / rect.W * texture.WidthRatio;
|
||||
@@ -1151,60 +1138,60 @@ namespace Vocaluxe.Lib.Draw
|
||||
if (ry2 > bounds.Y + bounds.H)
|
||||
ry2 = bounds.Y + bounds.H;
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Enable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
GL.Enable(EnableCap.Blend);
|
||||
GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.MatrixMode(OpenTK.Graphics.OpenGL.MatrixMode.Texture);
|
||||
OpenTK.Graphics.OpenGL.GL.PushMatrix();
|
||||
GL.MatrixMode(MatrixMode.Texture);
|
||||
GL.PushMatrix();
|
||||
|
||||
if (Math.Abs(rect.Rotation) > float.Epsilon)
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.Translate(0.5f, 0.5f, 0);
|
||||
OpenTK.Graphics.OpenGL.GL.Rotate(-rect.Rotation, 0f, 0f, 1f);
|
||||
OpenTK.Graphics.OpenGL.GL.Translate(-0.5f, -0.5f, 0);
|
||||
GL.Translate(0.5f, 0.5f, 0);
|
||||
GL.Rotate(-rect.Rotation, 0f, 0f, 1f);
|
||||
GL.Translate(-0.5f, -0.5f, 0);
|
||||
}
|
||||
|
||||
if (!mirrored)
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.Begin(OpenTK.Graphics.OpenGL.BeginMode.Quads);
|
||||
GL.Begin(BeginMode.Quads);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x1, y1);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(x1, y1);
|
||||
GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x1, y2);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(x1, y2);
|
||||
GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x2, y2);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(x2, y2);
|
||||
GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x2, y1);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(x2, y1);
|
||||
GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.End();
|
||||
GL.End();
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.Begin(OpenTK.Graphics.OpenGL.BeginMode.Quads);
|
||||
GL.Begin(BeginMode.Quads);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x2, y2);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(x2, y2);
|
||||
GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x2, y1);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(x2, y1);
|
||||
GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x1, y1);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(x1, y1);
|
||||
GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x1, y2);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(x1, y2);
|
||||
GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.End();
|
||||
GL.End();
|
||||
}
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.PopMatrix();
|
||||
GL.PopMatrix();
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Disable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.Disable(EnableCap.Blend);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1212,31 +1199,31 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
if (_TextureExists(ref texture))
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, texture.ID);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Enable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
GL.Enable(EnableCap.Blend);
|
||||
GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Begin(OpenTK.Graphics.OpenGL.BeginMode.Quads);
|
||||
GL.Begin(BeginMode.Quads);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(0f + begin * texture.WidthRatio, 0f);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rect.X + begin * rect.W, rect.Y, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(0f + begin * texture.WidthRatio, 0f);
|
||||
GL.Vertex3(rect.X + begin * rect.W, rect.Y, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(0f + begin * texture.WidthRatio, texture.HeightRatio);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rect.X + begin * rect.W, rect.Y + rect.H, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(0f + begin * texture.WidthRatio, texture.HeightRatio);
|
||||
GL.Vertex3(rect.X + begin * rect.W, rect.Y + rect.H, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(texture.WidthRatio * end, texture.HeightRatio);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rect.X + end * rect.W, rect.Y + rect.H, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(texture.WidthRatio * end, texture.HeightRatio);
|
||||
GL.Vertex3(rect.X + end * rect.W, rect.Y + rect.H, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(texture.WidthRatio * end, 0f);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rect.X + end * rect.W, rect.Y, rect.Z + CGraphics.ZOffset);
|
||||
GL.TexCoord2(texture.WidthRatio * end, 0f);
|
||||
GL.Vertex3(rect.X + end * rect.W, rect.Y, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.End();
|
||||
GL.End();
|
||||
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Disable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.Disable(EnableCap.Blend);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1257,7 +1244,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
if (_TextureExists(ref texture))
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, texture.ID);
|
||||
GL.BindTexture(TextureTarget.Texture2D, texture.ID);
|
||||
|
||||
float x1 = (bounds.X - rect.X) / rect.W * texture.WidthRatio;
|
||||
float x2 = (bounds.X + bounds.W - rect.X) / rect.W * texture.WidthRatio;
|
||||
@@ -1294,44 +1281,44 @@ namespace Vocaluxe.Lib.Draw
|
||||
if (ry2 > bounds.Y + bounds.H + space + height)
|
||||
ry2 = bounds.Y + bounds.H + space + height;
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Enable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
GL.Enable(EnableCap.Blend);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.MatrixMode(OpenTK.Graphics.OpenGL.MatrixMode.Texture);
|
||||
OpenTK.Graphics.OpenGL.GL.PushMatrix();
|
||||
GL.MatrixMode(MatrixMode.Texture);
|
||||
GL.PushMatrix();
|
||||
|
||||
if (Math.Abs(rect.Rotation) > float.Epsilon)
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.Translate(0.5f, 0.5f, 0);
|
||||
OpenTK.Graphics.OpenGL.GL.Rotate(-rect.Rotation, 0f, 0f, 1f);
|
||||
OpenTK.Graphics.OpenGL.GL.Translate(-0.5f, -0.5f, 0);
|
||||
GL.Translate(0.5f, 0.5f, 0);
|
||||
GL.Rotate(-rect.Rotation, 0f, 0f, 1f);
|
||||
GL.Translate(-0.5f, -0.5f, 0);
|
||||
}
|
||||
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Begin(OpenTK.Graphics.OpenGL.BeginMode.Quads);
|
||||
GL.Begin(BeginMode.Quads);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x2, y2);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset);
|
||||
GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
GL.TexCoord2(x2, y2);
|
||||
GL.Vertex3(rx2, ry1, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, 0f);
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x2, y1);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset);
|
||||
GL.Color4(color.R, color.G, color.B, 0f);
|
||||
GL.TexCoord2(x2, y1);
|
||||
GL.Vertex3(rx2, ry2, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, 0f);
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x1, y1);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset);
|
||||
GL.Color4(color.R, color.G, color.B, 0f);
|
||||
GL.TexCoord2(x1, y1);
|
||||
GL.Vertex3(rx1, ry2, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
OpenTK.Graphics.OpenGL.GL.TexCoord2(x1, y2);
|
||||
OpenTK.Graphics.OpenGL.GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset);
|
||||
GL.Color4(color.R, color.G, color.B, color.A * CGraphics.GlobalAlpha);
|
||||
GL.TexCoord2(x1, y2);
|
||||
GL.Vertex3(rx1, ry1, rect.Z + CGraphics.ZOffset);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.End();
|
||||
GL.End();
|
||||
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.PopMatrix();
|
||||
GL.PopMatrix();
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.Disable(OpenTK.Graphics.OpenGL.EnableCap.Blend);
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.Disable(EnableCap.Blend);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
}
|
||||
}
|
||||
#endregion drawing
|
||||
@@ -1360,11 +1347,10 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
try
|
||||
{
|
||||
OpenTK.Graphics.OpenGL.GL.GenBuffers(1, out texture.PBO);
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
OpenTK.Graphics.OpenGL.GL.BufferData(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, (IntPtr)q.Data.Length, IntPtr.Zero,
|
||||
OpenTK.Graphics.OpenGL.BufferUsageHint.StreamDraw);
|
||||
OpenTK.Graphics.OpenGL.GL.BindBuffer(OpenTK.Graphics.OpenGL.BufferTarget.PixelUnpackBuffer, 0);
|
||||
GL.GenBuffers(1, out texture.PBO);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, texture.PBO);
|
||||
GL.BufferData(BufferTarget.PixelUnpackBuffer, (IntPtr)q.Data.Length, IntPtr.Zero, BufferUsageHint.StreamDraw);
|
||||
GL.BindBuffer(BufferTarget.PixelUnpackBuffer, 0);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -1373,8 +1359,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
}
|
||||
}
|
||||
|
||||
int id = OpenTK.Graphics.OpenGL.GL.GenTexture();
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, id);
|
||||
int id = GL.GenTexture();
|
||||
GL.BindTexture(TextureTarget.Texture2D, id);
|
||||
texture.ID = id;
|
||||
|
||||
texture.Width = q.Width;
|
||||
@@ -1385,28 +1371,20 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.WidthRatio = texture.Width / texture.W2;
|
||||
texture.HeightRatio = texture.Height / texture.H2;
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, OpenTK.Graphics.OpenGL.PixelInternalFormat.Rgba, (int)texture.W2,
|
||||
(int)texture.H2, 0,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, IntPtr.Zero);
|
||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, (int)texture.W2, (int)texture.H2, 0, PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexSubImage2D(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0, 0, 0, q.Width, q.Height,
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, OpenTK.Graphics.OpenGL.PixelType.UnsignedByte, q.Data);
|
||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, q.Width, q.Height, PixelFormat.Bgra, PixelType.UnsignedByte, q.Data);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureWrapS,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureParameterName.ClampToEdge);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureWrapT,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureParameterName.ClampToEdge);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMagFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMagFilter.Linear);
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.TexParameter(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, OpenTK.Graphics.OpenGL.TextureParameterName.TextureMinFilter,
|
||||
(int)OpenTK.Graphics.OpenGL.TextureMinFilter.LinearMipmapLinear);
|
||||
OpenTK.Graphics.OpenGL.GL.Ext.GenerateMipmap(OpenTK.Graphics.OpenGL.GenerateMipmapTarget.Texture2D);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
|
||||
GL.Ext.GenerateMipmap(GenerateMipmapTarget.Texture2D);
|
||||
|
||||
OpenTK.Graphics.OpenGL.GL.BindTexture(OpenTK.Graphics.OpenGL.TextureTarget.Texture2D, 0);
|
||||
GL.BindTexture(TextureTarget.Texture2D, 0);
|
||||
|
||||
// Add to Texture List
|
||||
texture.Color = new SColorF(1f, 1f, 1f, 1f);
|
||||
|
||||
@@ -26,10 +26,10 @@ namespace Vocaluxe.Lib.Sound
|
||||
class CGstreamerAudio : IPlayback
|
||||
{
|
||||
//static float LastPosition;
|
||||
private CGstreamerAudioWrapper.LogCallback _LogCallback;
|
||||
private readonly CGstreamerAudioWrapper.LogCallback _LogCallback;
|
||||
|
||||
#region log
|
||||
private void _LogHandler(string text)
|
||||
private static void _LogHandler(string text)
|
||||
{
|
||||
CLog.LogError(text);
|
||||
}
|
||||
|
||||
@@ -26,13 +26,13 @@ namespace Vocaluxe.Lib.Sound.Gstreamer
|
||||
#region arch
|
||||
#if ARCH_X86
|
||||
#if WIN
|
||||
private const string _Dll = "x86\\gstreamer\\gstreamerhelper.dll";
|
||||
private const string _Dll = "x86\\gstreamer\\GstreamerHelper.dll";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ARCH_X64
|
||||
#if WIN
|
||||
private const string _Dll = "x64\\gstreamer\\gstreamerhelper.dll";
|
||||
private const string _Dll = "x64\\gstreamer\\GstreamerHelper.dll";
|
||||
#endif
|
||||
#endif
|
||||
#endregion arch
|
||||
|
||||
+4
-2
@@ -202,9 +202,9 @@ namespace Vocaluxe
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Error on start up: " + e.Message + e.StackTrace);
|
||||
CLog.LogError("Error on start up: " + e.Message + e.StackTrace);
|
||||
CLog.LogError("Error on start up: " + e);
|
||||
_SplashScreen.Close();
|
||||
_CloseProgram();
|
||||
Environment.Exit(Environment.ExitCode);
|
||||
}
|
||||
Application.DoEvents();
|
||||
|
||||
@@ -229,6 +229,7 @@ namespace Vocaluxe
|
||||
CWebcam.Close();
|
||||
}
|
||||
catch (Exception) {}
|
||||
Environment.Exit(Environment.ExitCode);
|
||||
}
|
||||
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
@@ -243,6 +244,7 @@ namespace Vocaluxe
|
||||
catch {}
|
||||
MessageBox.Show("Unhandled exception: " + e.Message + stackTrace);
|
||||
CLog.LogError("Unhandled exception: " + e.Message + stackTrace);
|
||||
_CloseProgram();
|
||||
}
|
||||
|
||||
private static Assembly _AssemblyResolver(Object sender, ResolveEventArgs args)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Forms;
|
||||
using Vocaluxe.Base;
|
||||
using VocaluxeLib.Menu;
|
||||
@@ -1007,7 +1008,7 @@ namespace Vocaluxe.Screens
|
||||
if (CSongs.IsInCategory)
|
||||
{
|
||||
//TODO: Check and use sorting method
|
||||
var songs = CSongs.VisibleSongs;
|
||||
ReadOnlyCollection<CSong> songs = CSongs.VisibleSongs;
|
||||
int ct = songs.Count;
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
@@ -1017,7 +1018,7 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
else
|
||||
{
|
||||
var categories = CSongs.Categories;
|
||||
ReadOnlyCollection<CCategory> categories = CSongs.Categories;
|
||||
int ct = categories.Count;
|
||||
if (curSelected >= 0 && curSelected < ct - 1 && categories[curSelected].Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase))
|
||||
start = curSelected + 1;
|
||||
|
||||
@@ -93,16 +93,6 @@ namespace VocaluxeLib.Menu
|
||||
X32 = 32
|
||||
}
|
||||
|
||||
public enum EColorDepth
|
||||
{
|
||||
// ReSharper disable UnusedMember.Global
|
||||
Bit8 = 8,
|
||||
Bit16 = 16,
|
||||
Bit24 = 24,
|
||||
Bit32 = 32
|
||||
// ReSharper restore UnusedMember.Global
|
||||
}
|
||||
|
||||
public enum ETextureQuality
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
@@ -244,6 +244,7 @@ namespace VocaluxeLib.Menu
|
||||
int GetNumSongsVisible();
|
||||
int GetNumCategories();
|
||||
int NumSongsInCategory(int categoryIndex);
|
||||
bool IsInCategory();
|
||||
|
||||
int GetCurrentCategoryIndex();
|
||||
EOffOn GetTabs();
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
using System.Collections.Generic;
|
||||
#region license
|
||||
// /*
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Vocaluxe is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||
// */
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
|
||||
@@ -559,7 +559,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
{
|
||||
if (!_Initialized)
|
||||
return false;
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 || _PreviewSelected < 0 || _PreviewSelected >= CBase.Songs.GetNumCategories())
|
||||
if (CBase.Songs.IsInCategory() || _PreviewSelected < 0 || _PreviewSelected >= CBase.Songs.GetNumCategories())
|
||||
return false;
|
||||
_EnterCategory(_PreviewSelected);
|
||||
return true;
|
||||
@@ -582,7 +582,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (!_Initialized)
|
||||
return;
|
||||
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() == -1)
|
||||
if (!CBase.Songs.IsInCategory())
|
||||
return;
|
||||
|
||||
_Reset();
|
||||
@@ -596,7 +596,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
protected void _SelectSong(int nr)
|
||||
{
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 && (CBase.Songs.GetNumSongsVisible() > 0) && (nr >= 0) && ((_Actsong != nr) || (_Streams.Count == 0)))
|
||||
if (CBase.Songs.IsInCategory() && (CBase.Songs.GetNumSongsVisible() > 0) && (nr >= 0) && ((_Actsong != nr) || (_Streams.Count == 0)))
|
||||
{
|
||||
_Streams.ForEach(soundStream => CBase.Sound.FadeAndStop(soundStream, 0f, 1f));
|
||||
_Streams.Clear();
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
public override void OnShow()
|
||||
{
|
||||
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && CBase.Songs.GetNumCategories() > 0 && CBase.Songs.GetCurrentCategoryIndex() == -1)
|
||||
if (CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_OFF && CBase.Songs.GetNumCategories() > 0 && !CBase.Songs.IsInCategory())
|
||||
_EnterCategory(0);
|
||||
_ActualSelection = -1;
|
||||
_Locked = -1;
|
||||
@@ -201,7 +201,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
switch (keyEvent.Key)
|
||||
{
|
||||
case Keys.Enter:
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0)
|
||||
if (!CBase.Songs.IsInCategory())
|
||||
{
|
||||
_EnterCategory(_PreviewSelected);
|
||||
keyEvent.Handled = true;
|
||||
@@ -212,7 +212,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
case Keys.Escape:
|
||||
case Keys.Back:
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() > -1 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
||||
if (CBase.Songs.IsInCategory() && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
_ShowCategories();
|
||||
keyEvent.Handled = true;
|
||||
@@ -234,7 +234,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
break;
|
||||
|
||||
case Keys.Left:
|
||||
if (_Locked > 0 && (!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
|
||||
if (_Locked > 0 && (!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && !CBase.Songs.IsInCategory()))
|
||||
{
|
||||
_Locked--;
|
||||
_UpdateList();
|
||||
@@ -242,7 +242,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
break;
|
||||
|
||||
case Keys.Right:
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
||||
if (!CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
if (_Locked < CBase.Songs.GetNumCategories() - 1)
|
||||
{
|
||||
@@ -252,7 +252,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() != -1 && _Locked < CBase.Songs.GetNumSongsVisible() - 1 && !songOptions.Selection.RandomOnly)
|
||||
if (CBase.Songs.IsInCategory() && _Locked < CBase.Songs.GetNumSongsVisible() - 1 && !songOptions.Selection.RandomOnly)
|
||||
{
|
||||
_Locked++;
|
||||
_UpdateList();
|
||||
@@ -268,7 +268,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
if (_Locked > _NumW - 1 &&
|
||||
(!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && CBase.Songs.GetCurrentCategoryIndex() < 0))
|
||||
(!songOptions.Selection.RandomOnly || songOptions.Selection.CategoryChangeAllowed && !CBase.Songs.IsInCategory()))
|
||||
{
|
||||
_Locked -= _NumW;
|
||||
_UpdateList();
|
||||
@@ -282,7 +282,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
break;
|
||||
}
|
||||
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
||||
if (!CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
if (_Locked < CBase.Songs.GetNumCategories() - _NumW)
|
||||
{
|
||||
@@ -318,13 +318,13 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
bool sel = false;
|
||||
int lastselection = _ActualSelection;
|
||||
|
||||
if (!songOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed)
|
||||
if (!songOptions.Selection.RandomOnly || !CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
foreach (CStatic tile in _Tiles)
|
||||
{
|
||||
if ((tile.Texture.Index != _CoverTexture.Index) && CHelper.IsInBounds(tile.Rect, mouseEvent) && !sel)
|
||||
{
|
||||
if (mouseEvent.LB || CBase.Songs.GetCurrentCategoryIndex() == -1)
|
||||
if (mouseEvent.LB || !CBase.Songs.IsInCategory())
|
||||
{
|
||||
if (_PreviewSelected == i + _Offset)
|
||||
_Locked = _PreviewSelected;
|
||||
@@ -352,7 +352,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (!sel)
|
||||
_ActualSelection = -1;
|
||||
|
||||
if (mouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.GetCurrentCategoryIndex() >= 0 && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON &&
|
||||
if (mouseEvent.RB && (CBase.Songs.GetNumCategories() > 0) && CBase.Songs.IsInCategory() && CBase.Songs.GetTabs() == EOffOn.TR_CONFIG_ON &&
|
||||
songOptions.Selection.CategoryChangeAllowed)
|
||||
{
|
||||
_ShowCategories();
|
||||
@@ -366,7 +366,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
if (CHelper.IsInBounds(_CoverBig.Rect, mouseEvent) || CHelper.IsInBounds(_TextBG.Rect, mouseEvent))
|
||||
_Locked = _PreviewSelected;
|
||||
}
|
||||
else if (mouseEvent.LB && (CBase.Songs.GetCurrentCategoryIndex() == -1))
|
||||
else if (mouseEvent.LB && (!CBase.Songs.IsInCategory()))
|
||||
{
|
||||
foreach (CStatic tile in _Tiles)
|
||||
{
|
||||
@@ -380,7 +380,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
}
|
||||
|
||||
if (mouseEvent.Wheel != 0 && CHelper.IsInBounds(_ScrollRect, mouseEvent) &&
|
||||
(!songOptions.Selection.RandomOnly || CBase.Songs.GetCurrentCategoryIndex() < 0 && songOptions.Selection.CategoryChangeAllowed))
|
||||
(!songOptions.Selection.RandomOnly || !CBase.Songs.IsInCategory() && songOptions.Selection.CategoryChangeAllowed))
|
||||
_UpdateList(_Offset + _NumW * mouseEvent.Wheel);
|
||||
}
|
||||
|
||||
@@ -389,17 +389,17 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
foreach (CStatic tile in _Tiles)
|
||||
{
|
||||
if (tile.Selected && _Active)
|
||||
tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop, false);
|
||||
tile.Draw(1.2f, tile.Rect.Z - 0.1f, EAspect.Crop);
|
||||
else
|
||||
{
|
||||
if (tile.Texture.Index != _CoverTexture.Index)
|
||||
tile.Draw(1f, tile.Rect.Z, EAspect.Crop, false);
|
||||
tile.Draw(1f, tile.Rect.Z, EAspect.Crop);
|
||||
else
|
||||
tile.Draw(1f, tile.Rect.Z, EAspect.Stretch, false);
|
||||
tile.Draw(1f, tile.Rect.Z, EAspect.Stretch);
|
||||
}
|
||||
}
|
||||
|
||||
if (CBase.Songs.GetCurrentCategoryIndex() >= 0)
|
||||
if (CBase.Songs.IsInCategory())
|
||||
{
|
||||
int actsong = _PreviewSelected;
|
||||
if ((CBase.Songs.GetNumSongsVisible() > actsong) && (actsong >= 0))
|
||||
@@ -490,7 +490,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
return new CStatic(_PartyModeID);
|
||||
}
|
||||
|
||||
protected void _SetSelectedTile(int itemNr)
|
||||
private void _SetSelectedTile(int itemNr)
|
||||
{
|
||||
bool sel = _Tiles.Any(tile => tile.Selected);
|
||||
|
||||
@@ -607,7 +607,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
||||
|
||||
private void _UpdateList(int offset, bool force = false)
|
||||
{
|
||||
bool isInCategory = CBase.Songs.GetCurrentCategoryIndex() >= 0;
|
||||
bool isInCategory = CBase.Songs.IsInCategory();
|
||||
int itemCount = isInCategory ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories();
|
||||
|
||||
if (offset >= (itemCount / _NumW) * _NumW - (_NumW * (_NumH - 1)))
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\Output\</OutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;WIN</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@@ -29,7 +29,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\Output\</OutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
@@ -41,7 +41,7 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\Output\</OutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;WIN</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@@ -52,7 +52,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\Output\</OutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
@@ -64,7 +64,7 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\Output\</OutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;LINUX</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@@ -74,7 +74,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\Output\</OutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
@@ -86,7 +86,7 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\Output\</OutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;LINUX</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@@ -96,7 +96,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\Output\</OutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
@@ -154,6 +154,9 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)Output\" /I /Y</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
Reference in new issue
Block a user