forked from metin2/client
Solution refactoring and restructuring, removed Boost dependency, removed unused tools
This commit is contained in:
474
src/EterPythonLib/EterPythonLib.vcxproj
Normal file
474
src/EterPythonLib/EterPythonLib.vcxproj
Normal file
@ -0,0 +1,474 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Distribute|Win32">
|
||||
<Configuration>Distribute</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="MfcDebug|Win32">
|
||||
<Configuration>MfcDebug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="MfcRelease|Win32">
|
||||
<Configuration>MfcRelease</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="VTune|Win32">
|
||||
<Configuration>VTune</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<ProjectName>EterPythonLib</ProjectName>
|
||||
<ProjectGuid>{24516A87-8544-46A9-A0C8-0A01269642D9}</ProjectGuid>
|
||||
<RootNamespace>EterPythonLib</RootNamespace>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseOfMfc>Static</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseOfMfc>Static</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>17.0.32203.90</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">
|
||||
<OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">
|
||||
<OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">
|
||||
<OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">
|
||||
<OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<VcpkgUseStatic>true</VcpkgUseStatic>
|
||||
<VcpkgConfiguration>$(Configuration)</VcpkgConfiguration>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">
|
||||
<VcpkgUseStatic>true</VcpkgUseStatic>
|
||||
<VcpkgConfiguration>$(Configuration)</VcpkgConfiguration>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<VcpkgUseStatic>true</VcpkgUseStatic>
|
||||
<VcpkgConfiguration>$(Configuration)</VcpkgConfiguration>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)extern\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\Distribute/eterPythonLib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerOutput>All</AssemblerOutput>
|
||||
<AssemblerListingLocation>.\Distribute/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Distribute/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Distribute/</ProgramDataBaseFileName>
|
||||
<BrowseInformation />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0412</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>.;../../extern/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\eterPythonLib___Win32_MfcRelease/eterPythonLib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerOutput>All</AssemblerOutput>
|
||||
<AssemblerListingLocation>.\eterPythonLib___Win32_MfcRelease/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\eterPythonLib___Win32_MfcRelease/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\eterPythonLib___Win32_MfcRelease/</ProgramDataBaseFileName>
|
||||
<BrowseInformation />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0412</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\eterPythonLib___Win32_MfcRelease\eterPythonLib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)extern\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\Release/eterPythonLib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Release/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
|
||||
<BrowseInformation />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0412</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Gs %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<OmitFramePointers>true</OmitFramePointers>
|
||||
<AdditionalIncludeDirectories>.;../../extern/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;__VTUNE__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\VTune/eterPythonLib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerOutput>All</AssemblerOutput>
|
||||
<AssemblerListingLocation>.\VTune/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\VTune/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\VTune/</ProgramDataBaseFileName>
|
||||
<BrowseInformation />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0412</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\VTune\eterPythonLib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;../../extern/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\eterPythonLib___Win32_MfcDebug/eterPythonLib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\eterPythonLib___Win32_MfcDebug/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\eterPythonLib___Win32_MfcDebug/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\eterPythonLib___Win32_MfcDebug/</ProgramDataBaseFileName>
|
||||
<BrowseInformation />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0412</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<OutputFile>.\eterPythonLib___Win32_MfcDebug\eterPythonLib.lib</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)extern\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>.\Debug/eterPythonLib.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
|
||||
<ObjectFileName>.\Debug/</ObjectFileName>
|
||||
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
|
||||
<BrowseInformation />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0412</Culture>
|
||||
</ResourceCompile>
|
||||
<Lib>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="PythonGraphic.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Disabled</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphicImageModule.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphicModule.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphicTextModule.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphicThingModule.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGridSlotWindow.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonSlotWindow.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonWindow.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonWindowManager.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonWindowManagerModule.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StdAfx.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">MaxSpeed</Optimization>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Distribute|Win32'">Create</PrecompiledHeader>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Disabled</Optimization>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">Create</PrecompiledHeader>
|
||||
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='MfcDebug|Win32'">true</BrowseInformation>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">MaxSpeed</Optimization>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='MfcRelease|Win32'">Create</PrecompiledHeader>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<FavorSizeOrSpeed Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Size</FavorSizeOrSpeed>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='VTune|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="PythonGraphic.h" />
|
||||
<ClInclude Include="PythonGridSlotWindow.h" />
|
||||
<ClInclude Include="PythonSlotWindow.h" />
|
||||
<ClInclude Include="PythonWindow.h" />
|
||||
<ClInclude Include="PythonWindowManager.h" />
|
||||
<ClInclude Include="StdAfx.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
64
src/EterPythonLib/EterPythonLib.vcxproj.filters
Normal file
64
src/EterPythonLib/EterPythonLib.vcxproj.filters
Normal file
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Interface">
|
||||
<UniqueIdentifier>{f3367289-6c84-4748-a111-4000fcc538b1}</UniqueIdentifier>
|
||||
<Extensions>*.cpp;*.h;</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Graphic Files">
|
||||
<UniqueIdentifier>{0da2d0eb-cdc9-49d5-9b0b-e2be3a25fb47}</UniqueIdentifier>
|
||||
<Extensions>*.cpp; *.h;</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="PythonGridSlotWindow.cpp">
|
||||
<Filter>Interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonSlotWindow.cpp">
|
||||
<Filter>Interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonWindow.cpp">
|
||||
<Filter>Interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonWindowManager.cpp">
|
||||
<Filter>Interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonWindowManagerModule.cpp">
|
||||
<Filter>Interface</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphic.cpp">
|
||||
<Filter>Graphic Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphicImageModule.cpp">
|
||||
<Filter>Graphic Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphicModule.cpp">
|
||||
<Filter>Graphic Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphicTextModule.cpp">
|
||||
<Filter>Graphic Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PythonGraphicThingModule.cpp">
|
||||
<Filter>Graphic Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StdAfx.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="PythonGridSlotWindow.h">
|
||||
<Filter>Interface</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PythonSlotWindow.h">
|
||||
<Filter>Interface</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PythonWindow.h">
|
||||
<Filter>Interface</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PythonWindowManager.h">
|
||||
<Filter>Interface</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PythonGraphic.h">
|
||||
<Filter>Graphic Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StdAfx.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
624
src/EterPythonLib/PythonGraphic.cpp
Normal file
624
src/EterPythonLib/PythonGraphic.cpp
Normal file
@ -0,0 +1,624 @@
|
||||
#include "StdAfx.h"
|
||||
#include "../eterLib/StateManager.h"
|
||||
#include "../eterLib/JpegFile.h"
|
||||
#include "PythonGraphic.h"
|
||||
|
||||
bool g_isScreenShotKey = false;
|
||||
|
||||
void CPythonGraphic::Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
LPDIRECT3D8 CPythonGraphic::GetD3D()
|
||||
{
|
||||
return ms_lpd3d;
|
||||
}
|
||||
|
||||
float CPythonGraphic::GetOrthoDepth()
|
||||
{
|
||||
return m_fOrthoDepth;
|
||||
}
|
||||
|
||||
void CPythonGraphic::SetInterfaceRenderState()
|
||||
{
|
||||
STATEMANAGER.SetTransform(D3DTS_PROJECTION, &ms_matIdentity);
|
||||
STATEMANAGER.SetTransform(D3DTS_VIEW, &ms_matIdentity);
|
||||
STATEMANAGER.SetTransform(D3DTS_WORLD, &ms_matIdentity);
|
||||
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_NONE);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MIPFILTER, D3DTEXF_NONE);
|
||||
|
||||
STATEMANAGER.SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
|
||||
STATEMANAGER.SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
|
||||
STATEMANAGER.SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
|
||||
|
||||
CPythonGraphic::Instance().SetBlendOperation();
|
||||
CPythonGraphic::Instance().SetOrtho2D(ms_iWidth, ms_iHeight, GetOrthoDepth());
|
||||
|
||||
STATEMANAGER.SetRenderState(D3DRS_LIGHTING, FALSE);
|
||||
}
|
||||
|
||||
void CPythonGraphic::SetGameRenderState()
|
||||
{
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
|
||||
STATEMANAGER.SetTextureStageState(0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR);
|
||||
|
||||
STATEMANAGER.SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
|
||||
STATEMANAGER.SetRenderState(D3DRS_LIGHTING, TRUE);
|
||||
}
|
||||
|
||||
void CPythonGraphic::SetCursorPosition(int x, int y)
|
||||
{
|
||||
CScreen::SetCursorPosition(x, y, ms_iWidth, ms_iHeight);
|
||||
}
|
||||
|
||||
void CPythonGraphic::SetOmniLight()
|
||||
{
|
||||
// Set up a material
|
||||
D3DMATERIAL8 Material;
|
||||
Material.Ambient = D3DXCOLOR(0.3f, 0.3f, 0.3f, 1.0f);
|
||||
Material.Diffuse = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
Material.Emissive = D3DXCOLOR(0.1f, 0.1f, 0.1f, 1.0f);
|
||||
STATEMANAGER.SetMaterial(&Material);
|
||||
|
||||
D3DLIGHT8 Light;
|
||||
Light.Type = D3DLIGHT_SPOT;
|
||||
Light.Position = D3DXVECTOR3(50.0f, 150.0f, 350.0f);
|
||||
Light.Direction = D3DXVECTOR3(-0.15f, -0.3f, -0.9f);
|
||||
Light.Theta = D3DXToRadian(30.0f);
|
||||
Light.Phi = D3DXToRadian(45.0f);
|
||||
Light.Falloff = 1.0f;
|
||||
Light.Attenuation0 = 0.0f;
|
||||
Light.Attenuation1 = 0.005f;
|
||||
Light.Attenuation2 = 0.0f;
|
||||
Light.Diffuse.r = 1.0f;
|
||||
Light.Diffuse.g = 1.0f;
|
||||
Light.Diffuse.b = 1.0f;
|
||||
Light.Diffuse.a = 1.0f;
|
||||
Light.Ambient.r = 1.0f;
|
||||
Light.Ambient.g = 1.0f;
|
||||
Light.Ambient.b = 1.0f;
|
||||
Light.Ambient.a = 1.0f;
|
||||
Light.Range = 500.0f;
|
||||
ms_lpd3dDevice->SetLight(0, &Light);
|
||||
ms_lpd3dDevice->LightEnable(0, TRUE);
|
||||
|
||||
Light.Type = D3DLIGHT_POINT;
|
||||
Light.Position = D3DXVECTOR3(0.0f, 200.0f, 200.0f);
|
||||
Light.Attenuation0 = 0.1f;
|
||||
Light.Attenuation1 = 0.01f;
|
||||
Light.Attenuation2 = 0.0f;
|
||||
ms_lpd3dDevice->SetLight(1, &Light);
|
||||
ms_lpd3dDevice->LightEnable(1, TRUE);
|
||||
}
|
||||
|
||||
void CPythonGraphic::SetViewport(float fx, float fy, float fWidth, float fHeight)
|
||||
{
|
||||
ms_lpd3dDevice->GetViewport(&m_backupViewport);
|
||||
|
||||
D3DVIEWPORT8 ViewPort;
|
||||
ViewPort.X = fx;
|
||||
ViewPort.Y = fy;
|
||||
ViewPort.Width = fWidth;
|
||||
ViewPort.Height = fHeight;
|
||||
ViewPort.MinZ = 0.0f;
|
||||
ViewPort.MaxZ = 1.0f;
|
||||
if (FAILED(
|
||||
ms_lpd3dDevice->SetViewport(&ViewPort)
|
||||
))
|
||||
{
|
||||
Tracef("CPythonGraphic::SetViewport(%d, %d, %d, %d) - Error",
|
||||
ViewPort.X, ViewPort.Y,
|
||||
ViewPort.Width, ViewPort.Height
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void CPythonGraphic::RestoreViewport()
|
||||
{
|
||||
ms_lpd3dDevice->SetViewport(&m_backupViewport);
|
||||
}
|
||||
|
||||
void CPythonGraphic::SetGamma(float fGammaFactor)
|
||||
{
|
||||
D3DCAPS8 d3dCaps;
|
||||
D3DGAMMARAMP NewRamp;
|
||||
int ui, val;
|
||||
|
||||
ms_lpd3dDevice->GetDeviceCaps(&d3dCaps);
|
||||
|
||||
if (D3DCAPS2_FULLSCREENGAMMA != (d3dCaps.Caps2 & D3DCAPS2_FULLSCREENGAMMA))
|
||||
return;
|
||||
|
||||
for (int i = 0; i < 256; ++i)
|
||||
{
|
||||
val = (int) (i * fGammaFactor * 255.0f);
|
||||
ui = 0;
|
||||
|
||||
if (val > 32767)
|
||||
{
|
||||
val = val - 32767;
|
||||
ui = 1;
|
||||
}
|
||||
|
||||
if (val > 32767)
|
||||
val = 32767;
|
||||
|
||||
NewRamp.red[i] = (WORD) (val | (32768 * ui));
|
||||
NewRamp.green[i] = (WORD) (val | (32768 * ui));
|
||||
NewRamp.blue[i] = (WORD) (val | (32768 * ui));
|
||||
}
|
||||
|
||||
ms_lpd3dDevice->SetGammaRamp(D3DSGR_NO_CALIBRATION, &NewRamp);
|
||||
}
|
||||
|
||||
void GenScreenShotTag(const char* src, DWORD crc32, char* leaf, size_t leafLen)
|
||||
{
|
||||
const char* p = src;
|
||||
const char* n = p;
|
||||
while (n = strchr(p, '\\'))
|
||||
p = n + 1;
|
||||
|
||||
_snprintf(leaf, leafLen, "YMIR_METIN2:%s:0x%.8x", p, crc32);
|
||||
}
|
||||
|
||||
bool CPythonGraphic::SaveJPEG(const char * pszFileName, LPBYTE pbyBuffer, UINT uWidth, UINT uHeight)
|
||||
{
|
||||
return jpeg_save(pbyBuffer, uWidth, uHeight, 85, pszFileName) != 0;
|
||||
}
|
||||
|
||||
bool CPythonGraphic::SaveScreenShot(const char * c_pszFileName)
|
||||
{
|
||||
HRESULT hr;
|
||||
LPDIRECT3DSURFACE8 lpSurface;
|
||||
D3DSURFACE_DESC stSurfaceDesc;
|
||||
|
||||
if (FAILED(hr = ms_lpd3dDevice->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &lpSurface)))
|
||||
{
|
||||
TraceError("Failed to get back buffer (0x%08x)", hr);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (FAILED(hr = lpSurface->GetDesc(&stSurfaceDesc)))
|
||||
{
|
||||
TraceError("Failed to get surface desc (0x%08x)", hr);
|
||||
SAFE_RELEASE(lpSurface);
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT uWidth = stSurfaceDesc.Width;
|
||||
UINT uHeight = stSurfaceDesc.Height;
|
||||
|
||||
switch( stSurfaceDesc.Format ) {
|
||||
case D3DFMT_R8G8B8 :
|
||||
case D3DFMT_A8R8G8B8 :
|
||||
case D3DFMT_X8R8G8B8 :
|
||||
case D3DFMT_R5G6B5 :
|
||||
case D3DFMT_X1R5G5B5 :
|
||||
case D3DFMT_A1R5G5B5 :
|
||||
break;
|
||||
case D3DFMT_A4R4G4B4 :
|
||||
case D3DFMT_R3G3B2 :
|
||||
case D3DFMT_A8R3G3B2 :
|
||||
case D3DFMT_X4R4G4B4 :
|
||||
case D3DFMT_A2B10G10R10 :
|
||||
TraceError("Unsupported BackBuffer Format(%d). Please contact Metin 2 Administrator.", stSurfaceDesc.Format);
|
||||
SAFE_RELEASE(lpSurface);
|
||||
return false;
|
||||
}
|
||||
|
||||
D3DLOCKED_RECT lockRect;
|
||||
if (FAILED(hr = lpSurface->LockRect(&lockRect, NULL, D3DLOCK_NO_DIRTY_UPDATE | D3DLOCK_READONLY | D3DLOCK_NOSYSLOCK)))
|
||||
{
|
||||
TraceError("Failed to lock the surface (0x%08x)", hr);
|
||||
SAFE_RELEASE(lpSurface);
|
||||
return false;
|
||||
}
|
||||
|
||||
BYTE* pbyBuffer = new BYTE[uWidth * uHeight * 3];
|
||||
if (pbyBuffer == NULL) {
|
||||
lpSurface->UnlockRect();
|
||||
lpSurface->Release();
|
||||
lpSurface = NULL;
|
||||
TraceError("Failed to allocate screenshot buffer");
|
||||
return false;
|
||||
}
|
||||
BYTE* pbySource = (BYTE*) lockRect.pBits;
|
||||
BYTE* pbyDestination = (BYTE*) pbyBuffer;
|
||||
for(UINT y = 0; y < uHeight; ++y) {
|
||||
BYTE *pRow = pbySource;
|
||||
|
||||
switch( stSurfaceDesc.Format ) {
|
||||
case D3DFMT_R8G8B8 :
|
||||
for(UINT x = 0; x < uWidth; ++x) {
|
||||
*pbyDestination++ = pRow[2]; // Blue
|
||||
*pbyDestination++ = pRow[1]; // Green
|
||||
*pbyDestination++ = pRow[0]; // Red
|
||||
pRow += 3;
|
||||
}
|
||||
break;
|
||||
case D3DFMT_A8R8G8B8 :
|
||||
case D3DFMT_X8R8G8B8 :
|
||||
for(UINT x = 0; x < uWidth; ++x) {
|
||||
*pbyDestination++ = pRow[2]; // Blue
|
||||
*pbyDestination++ = pRow[1]; // Green
|
||||
*pbyDestination++ = pRow[0]; // Red
|
||||
pRow += 4;
|
||||
}
|
||||
break;
|
||||
case D3DFMT_R5G6B5 :
|
||||
{
|
||||
for(UINT x = 0; x < uWidth; ++x) {
|
||||
UINT uColor = *((UINT *) pRow);
|
||||
BYTE byBlue = (uColor >> 11) & 0x1F;
|
||||
BYTE byGreen = (uColor >> 5) & 0x3F;
|
||||
BYTE byRed = uColor & 0x1F;
|
||||
|
||||
*pbyDestination++ = (byBlue << 3) | (byBlue >> 2); // Blue
|
||||
*pbyDestination++ = (byGreen << 2) | (byGreen >> 2); // Green
|
||||
*pbyDestination++ = (byRed << 3) | (byRed >> 2); // Red
|
||||
pRow += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case D3DFMT_X1R5G5B5 :
|
||||
case D3DFMT_A1R5G5B5 :
|
||||
{
|
||||
for(UINT x = 0; x < uWidth; ++x) {
|
||||
UINT uColor = *((UINT *) pRow);
|
||||
BYTE byBlue = (uColor >> 10) & 0x1F;
|
||||
BYTE byGreen = (uColor >> 5) & 0x1F;
|
||||
BYTE byRed = uColor & 0x1F;
|
||||
|
||||
*pbyDestination++ = (byBlue << 3) | (byBlue >> 2); // Blue
|
||||
*pbyDestination++ = (byGreen << 3) | (byGreen >> 2); // Green
|
||||
*pbyDestination++ = (byRed << 3) | (byRed >> 2); // Red
|
||||
pRow += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// increase by one line
|
||||
pbySource += lockRect.Pitch;
|
||||
}
|
||||
|
||||
if(lpSurface) {
|
||||
lpSurface->UnlockRect();
|
||||
lpSurface->Release();
|
||||
lpSurface = NULL;
|
||||
}
|
||||
|
||||
bool bSaved = SaveJPEG(c_pszFileName, pbyBuffer, uWidth, uHeight);
|
||||
|
||||
if(pbyBuffer) {
|
||||
delete [] pbyBuffer;
|
||||
pbyBuffer = NULL;
|
||||
}
|
||||
|
||||
if(bSaved == false) {
|
||||
TraceError("Failed to save JPEG file. (%s, %d, %d)", c_pszFileName, uWidth, uHeight);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (g_isScreenShotKey)
|
||||
{
|
||||
FILE* srcFilePtr = fopen(c_pszFileName, "rb");
|
||||
if (srcFilePtr)
|
||||
{
|
||||
fseek(srcFilePtr, 0, SEEK_END);
|
||||
size_t fileSize = ftell(srcFilePtr);
|
||||
fseek(srcFilePtr, 0, SEEK_SET);
|
||||
|
||||
char head[21];
|
||||
size_t tailSize = fileSize - sizeof(head);
|
||||
char* tail = (char*)malloc(tailSize);
|
||||
|
||||
fread(head, sizeof(head), 1, srcFilePtr);
|
||||
fread(tail, tailSize, 1, srcFilePtr);
|
||||
fclose(srcFilePtr);
|
||||
|
||||
char imgDesc[64];
|
||||
GenScreenShotTag(c_pszFileName, GetCRC32(tail, tailSize), imgDesc, sizeof(imgDesc));
|
||||
|
||||
int imgDescLen = strlen(imgDesc) + 1;
|
||||
|
||||
unsigned char exifHeader[] = {
|
||||
0xe1,
|
||||
0, // blockLen[1],
|
||||
0, // blockLen[0],
|
||||
0x45,
|
||||
0x78,
|
||||
0x69,
|
||||
0x66,
|
||||
0x0,
|
||||
0x0,
|
||||
0x49,
|
||||
0x49,
|
||||
0x2a,
|
||||
0x0,
|
||||
0x8,
|
||||
0x0,
|
||||
0x0,
|
||||
0x0,
|
||||
0x1,
|
||||
0x0,
|
||||
0xe,
|
||||
0x1,
|
||||
0x2,
|
||||
0x0,
|
||||
imgDescLen, // textLen[0],
|
||||
0, // textLen[1],
|
||||
0, // textLen[2],
|
||||
0, // textLen[3],
|
||||
0x1a,
|
||||
0x0,
|
||||
0x0,
|
||||
0x0,
|
||||
0x0,
|
||||
0x0,
|
||||
0x0,
|
||||
0x0,
|
||||
};
|
||||
|
||||
exifHeader[2] = sizeof(exifHeader) + imgDescLen;
|
||||
|
||||
FILE* dstFilePtr = fopen(c_pszFileName, "wb");
|
||||
//FILE* dstFilePtr = fopen("temp.jpg", "wb");
|
||||
if (dstFilePtr)
|
||||
{
|
||||
fwrite(head, sizeof(head), 1, dstFilePtr);
|
||||
fwrite(exifHeader, sizeof(exifHeader), 1, dstFilePtr);
|
||||
fwrite(imgDesc, imgDescLen, 1, dstFilePtr);
|
||||
fputc(0x00, dstFilePtr);
|
||||
fputc(0xff, dstFilePtr);
|
||||
fwrite(tail, tailSize, 1, dstFilePtr);
|
||||
fclose(dstFilePtr);
|
||||
}
|
||||
|
||||
free(tail);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPythonGraphic::PushState()
|
||||
{
|
||||
TState curState;
|
||||
|
||||
curState.matProj = ms_matProj;
|
||||
curState.matView = ms_matView;
|
||||
//STATEMANAGER.SaveTransform(D3DTS_WORLD, &m_SaveWorldMatrix);
|
||||
|
||||
m_stateStack.push(curState);
|
||||
//CCamera::Instance().PushParams();
|
||||
}
|
||||
|
||||
void CPythonGraphic::PopState()
|
||||
{
|
||||
if (m_stateStack.empty())
|
||||
{
|
||||
assert(!"PythonGraphic::PopState StateStack is EMPTY");
|
||||
return;
|
||||
}
|
||||
|
||||
TState & rState = m_stateStack.top();
|
||||
|
||||
//STATEMANAGER.RestoreTransform(D3DTS_WORLD);
|
||||
ms_matProj = rState.matProj;
|
||||
ms_matView = rState.matView;
|
||||
|
||||
UpdatePipeLineMatrix();
|
||||
|
||||
m_stateStack.pop();
|
||||
//CCamera::Instance().PopParams();
|
||||
}
|
||||
|
||||
void CPythonGraphic::RenderImage(CGraphicImageInstance* pImageInstance, float x, float y)
|
||||
{
|
||||
assert(pImageInstance != NULL);
|
||||
|
||||
//SetColorRenderState();
|
||||
const CGraphicTexture * c_pTexture = pImageInstance->GetTexturePointer();
|
||||
|
||||
float width = (float) pImageInstance->GetWidth();
|
||||
float height = (float) pImageInstance->GetHeight();
|
||||
|
||||
c_pTexture->SetTextureStage(0);
|
||||
|
||||
RenderTextureBox(x,
|
||||
y,
|
||||
x + width,
|
||||
y + height,
|
||||
0.0f,
|
||||
0.5f / width,
|
||||
0.5f / height,
|
||||
(width + 0.5f) / width,
|
||||
(height + 0.5f) / height);
|
||||
}
|
||||
|
||||
void CPythonGraphic::RenderAlphaImage(CGraphicImageInstance* pImageInstance, float x, float y, float aLeft, float aRight)
|
||||
{
|
||||
assert(pImageInstance != NULL);
|
||||
|
||||
D3DXCOLOR DiffuseColor1 = D3DXCOLOR(1.0f, 1.0f, 1.0f, aLeft);
|
||||
D3DXCOLOR DiffuseColor2 = D3DXCOLOR(1.0f, 1.0f, 1.0f, aRight);
|
||||
|
||||
const CGraphicTexture * c_pTexture = pImageInstance->GetTexturePointer();
|
||||
|
||||
float width = (float) pImageInstance->GetWidth();
|
||||
float height = (float) pImageInstance->GetHeight();
|
||||
|
||||
c_pTexture->SetTextureStage(0);
|
||||
|
||||
float sx = x;
|
||||
float sy = y;
|
||||
float ex = x + width;
|
||||
float ey = y + height;
|
||||
float z = 0.0f;
|
||||
|
||||
float su = 0.0f;
|
||||
float sv = 0.0f;
|
||||
float eu = 1.0f;
|
||||
float ev = 1.0f;
|
||||
|
||||
TPDTVertex vertices[4];
|
||||
vertices[0].position = TPosition(sx, sy, z);
|
||||
vertices[0].diffuse = DiffuseColor1;
|
||||
vertices[0].texCoord = TTextureCoordinate(su, sv);
|
||||
|
||||
vertices[1].position = TPosition(ex, sy, z);
|
||||
vertices[1].diffuse = DiffuseColor2;
|
||||
vertices[1].texCoord = TTextureCoordinate(eu, sv);
|
||||
|
||||
vertices[2].position = TPosition(sx, ey, z);
|
||||
vertices[2].diffuse = DiffuseColor1;
|
||||
vertices[2].texCoord = TTextureCoordinate(su, ev);
|
||||
|
||||
vertices[3].position = TPosition(ex, ey, z);
|
||||
vertices[3].diffuse = DiffuseColor2;
|
||||
vertices[3].texCoord = TTextureCoordinate(eu, ev);
|
||||
|
||||
STATEMANAGER.SetVertexShader(ms_pntVS);
|
||||
// 2004.11.18.myevan.DrawIndexPrimitiveUP -> DynamicVertexBuffer
|
||||
CGraphicBase::SetDefaultIndexBuffer(DEFAULT_IB_FILL_RECT);
|
||||
if (CGraphicBase::SetPDTStream(vertices, 4))
|
||||
STATEMANAGER.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 4, 0, 2);
|
||||
}
|
||||
|
||||
void CPythonGraphic::RenderCoolTimeBox(float fxCenter, float fyCenter, float fRadius, float fTime)
|
||||
{
|
||||
if (fTime >= 1.0f)
|
||||
return;
|
||||
|
||||
fTime = max(0.0f, fTime);
|
||||
|
||||
static D3DXCOLOR color = D3DXCOLOR(0.0f, 0.0f, 0.0f, 0.5f);
|
||||
static WORD s_wBoxIndicies[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
static D3DXVECTOR2 s_v2BoxPos[8] =
|
||||
{
|
||||
D3DXVECTOR2( -1.0f, -1.0f ),
|
||||
D3DXVECTOR2( -1.0f, 0.0f ),
|
||||
D3DXVECTOR2( -1.0f, +1.0f ),
|
||||
D3DXVECTOR2( 0.0f, +1.0f ),
|
||||
D3DXVECTOR2( +1.0f, +1.0f ),
|
||||
D3DXVECTOR2( +1.0f, 0.0f ),
|
||||
D3DXVECTOR2( +1.0f, -1.0f ),
|
||||
D3DXVECTOR2( 0.0f, -1.0f ),
|
||||
};
|
||||
|
||||
int iTriCount = int(8 - 8.0f * fTime);
|
||||
float fLastPercentage = (8 - 8.0f * fTime) - iTriCount;
|
||||
|
||||
std::vector<TPDTVertex> vertices;
|
||||
TPDTVertex vertex;
|
||||
vertex.position.x = fxCenter;
|
||||
vertex.position.y = fyCenter;
|
||||
vertex.position.z = 0.0f;
|
||||
vertex.diffuse = color;
|
||||
vertex.texCoord.x = 0.0f;
|
||||
vertex.texCoord.x = 0.0f;
|
||||
vertices.push_back(vertex);
|
||||
vertex.position.x = fxCenter;
|
||||
vertex.position.y = fyCenter - fRadius;
|
||||
vertex.position.z = 0.0f;
|
||||
vertex.diffuse = color;
|
||||
vertex.texCoord.x = 0.0f;
|
||||
vertex.texCoord.x = 0.0f;
|
||||
vertices.push_back(vertex);
|
||||
|
||||
for (int j = 0; j < iTriCount; ++j)
|
||||
{
|
||||
vertex.position.x = fxCenter + s_v2BoxPos[j].x * fRadius;
|
||||
vertex.position.y = fyCenter + s_v2BoxPos[j].y * fRadius;
|
||||
vertices.push_back(vertex);
|
||||
}
|
||||
|
||||
if (fLastPercentage > 0.0f)
|
||||
{
|
||||
D3DXVECTOR2 * pv2Pos;
|
||||
D3DXVECTOR2 * pv2LastPos;
|
||||
|
||||
assert((iTriCount-1+8)%8 >= 0 && (iTriCount-1+8)%8 < 8);
|
||||
assert((iTriCount+8)%8 >= 0 && (iTriCount+8)%8 < 8);
|
||||
pv2LastPos = &s_v2BoxPos[(iTriCount-1+8)%8];
|
||||
pv2Pos = &s_v2BoxPos[(iTriCount+8)%8];
|
||||
|
||||
vertex.position.x = fxCenter + ((pv2Pos->x-pv2LastPos->x) * fLastPercentage + pv2LastPos->x) * fRadius;
|
||||
vertex.position.y = fyCenter + ((pv2Pos->y-pv2LastPos->y) * fLastPercentage + pv2LastPos->y) * fRadius;
|
||||
vertices.push_back(vertex);
|
||||
++iTriCount;
|
||||
}
|
||||
|
||||
if (vertices.empty())
|
||||
return;
|
||||
|
||||
if (SetPDTStream(&vertices[0], vertices.size()))
|
||||
{
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
|
||||
STATEMANAGER.SaveTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
STATEMANAGER.SetTexture(0, NULL);
|
||||
STATEMANAGER.SetTexture(1, NULL);
|
||||
STATEMANAGER.SetVertexShader(D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||
STATEMANAGER.DrawPrimitive(D3DPT_TRIANGLEFAN, 0, iTriCount);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_COLORARG1);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_COLOROP);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ALPHAARG1);
|
||||
STATEMANAGER.RestoreTextureStageState(0, D3DTSS_ALPHAOP);
|
||||
}
|
||||
}
|
||||
|
||||
long CPythonGraphic::GenerateColor(float r, float g, float b, float a)
|
||||
{
|
||||
return GetColor(r, g, b, a);
|
||||
}
|
||||
|
||||
void CPythonGraphic::RenderDownButton(float sx, float sy, float ex, float ey)
|
||||
{
|
||||
RenderBox2d(sx, sy, ex, ey);
|
||||
|
||||
SetDiffuseColor(m_darkColor);
|
||||
RenderLine2d(sx, sy, ex, sy);
|
||||
RenderLine2d(sx, sy, sx, ey);
|
||||
|
||||
SetDiffuseColor(m_lightColor);
|
||||
RenderLine2d(sx, ey, ex, ey);
|
||||
RenderLine2d(ex, sy, ex, ey);
|
||||
}
|
||||
|
||||
void CPythonGraphic::RenderUpButton(float sx, float sy, float ex, float ey)
|
||||
{
|
||||
RenderBox2d(sx, sy, ex, ey);
|
||||
|
||||
SetDiffuseColor(m_lightColor);
|
||||
RenderLine2d(sx, sy, ex, sy);
|
||||
RenderLine2d(sx, sy, sx, ey);
|
||||
|
||||
SetDiffuseColor(m_darkColor);
|
||||
RenderLine2d(sx, ey, ex, ey);
|
||||
RenderLine2d(ex, sy, ex, ey);
|
||||
}
|
||||
|
||||
DWORD CPythonGraphic::GetAvailableMemory()
|
||||
{
|
||||
return ms_lpd3dDevice->GetAvailableTextureMem();
|
||||
}
|
||||
|
||||
CPythonGraphic::CPythonGraphic()
|
||||
{
|
||||
m_lightColor = GetColor(1.0f, 1.0f, 1.0f);
|
||||
m_darkColor = GetColor(0.0f, 0.0f, 0.0f);
|
||||
|
||||
memset(&m_backupViewport, 0, sizeof(D3DVIEWPORT8));
|
||||
|
||||
m_fOrthoDepth = 1000.0f;
|
||||
}
|
||||
|
||||
CPythonGraphic::~CPythonGraphic()
|
||||
{
|
||||
Tracef("Python Graphic Clear\n");
|
||||
}
|
68
src/EterPythonLib/PythonGraphic.h
Normal file
68
src/EterPythonLib/PythonGraphic.h
Normal file
@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
|
||||
#include "../eterlib/GrpTextInstance.h"
|
||||
#include "../eterlib/GrpMarkInstance.h"
|
||||
#include "../eterlib/GrpImageInstance.h"
|
||||
#include "../eterlib/GrpExpandedImageInstance.h"
|
||||
|
||||
#include "../eterGrnLib/ThingInstance.h"
|
||||
|
||||
class CPythonGraphic : public CScreen, public CSingleton<CPythonGraphic>
|
||||
{
|
||||
public:
|
||||
CPythonGraphic();
|
||||
virtual ~CPythonGraphic();
|
||||
|
||||
void Destroy();
|
||||
|
||||
void PushState();
|
||||
void PopState();
|
||||
|
||||
LPDIRECT3D8 GetD3D();
|
||||
|
||||
float GetOrthoDepth();
|
||||
void SetInterfaceRenderState();
|
||||
void SetGameRenderState();
|
||||
|
||||
void SetCursorPosition(int x, int y);
|
||||
|
||||
void SetOmniLight();
|
||||
|
||||
void SetViewport(float fx, float fy, float fWidth, float fHeight);
|
||||
void RestoreViewport();
|
||||
|
||||
long GenerateColor(float r, float g, float b, float a);
|
||||
void RenderDownButton(float sx, float sy, float ex, float ey);
|
||||
void RenderUpButton(float sx, float sy, float ex, float ey);
|
||||
|
||||
void RenderImage(CGraphicImageInstance* pImageInstance, float x, float y);
|
||||
void RenderAlphaImage(CGraphicImageInstance* pImageInstance, float x, float y, float aLeft, float aRight);
|
||||
void RenderCoolTimeBox(float fxCenter, float fyCenter, float fRadius, float fTime);
|
||||
|
||||
bool SaveJPEG(const char * pszFileName, LPBYTE pbyBuffer, UINT uWidth, UINT uHeight);
|
||||
bool SaveScreenShot(const char *szFileName);
|
||||
|
||||
DWORD GetAvailableMemory();
|
||||
void SetGamma(float fGammaFactor = 1.0f);
|
||||
|
||||
protected:
|
||||
typedef struct SState
|
||||
{
|
||||
D3DXMATRIX matView;
|
||||
D3DXMATRIX matProj;
|
||||
} TState;
|
||||
|
||||
DWORD m_lightColor;
|
||||
DWORD m_darkColor;
|
||||
|
||||
protected:
|
||||
std::stack<TState> m_stateStack;
|
||||
|
||||
D3DXMATRIX m_SaveWorldMatrix;
|
||||
|
||||
CCullingManager m_CullingManager;
|
||||
|
||||
D3DVIEWPORT8 m_backupViewport;
|
||||
|
||||
float m_fOrthoDepth;
|
||||
};
|
310
src/EterPythonLib/PythonGraphicImageModule.cpp
Normal file
310
src/EterPythonLib/PythonGraphicImageModule.cpp
Normal file
@ -0,0 +1,310 @@
|
||||
#include "StdAfx.h"
|
||||
|
||||
bool PyTuple_GetImageInstance(PyObject* poArgs, int pos, CGraphicImageInstance** ppRetImageInstance)
|
||||
{
|
||||
int handle;
|
||||
|
||||
if (!PyTuple_GetInteger(poArgs, pos, &handle))
|
||||
return false;
|
||||
|
||||
if (!handle)
|
||||
return false;
|
||||
|
||||
*ppRetImageInstance = (CGraphicImageInstance*)handle;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PyTuple_GetExpandedImageInstance(PyObject* poArgs, int pos, CGraphicExpandedImageInstance ** ppRetImageInstance)
|
||||
{
|
||||
int handle;
|
||||
|
||||
if (!PyTuple_GetInteger(poArgs, pos, &handle))
|
||||
return false;
|
||||
|
||||
if (!handle)
|
||||
return false;
|
||||
|
||||
if (!((CGraphicImageInstance*)handle)->IsType(CGraphicExpandedImageInstance::Type()))
|
||||
return false;
|
||||
|
||||
*ppRetImageInstance = (CGraphicExpandedImageInstance*)handle;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
PyObject* grpImageGenerate(PyObject * poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szFileName;
|
||||
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (!*szFileName)
|
||||
return Py_BuildValue("i", 0);
|
||||
|
||||
CResource * pResource = CResourceManager::Instance().GetResourcePointer(szFileName);
|
||||
|
||||
if (!pResource->IsType(CGraphicImage::Type()))
|
||||
return Py_BuildException("Resource is not an image (filename: %s)", szFileName);
|
||||
|
||||
CGraphicImageInstance * pImageInstance = CGraphicImageInstance::New();
|
||||
pImageInstance->SetImagePointer(static_cast<CGraphicImage*>(pResource));
|
||||
|
||||
if (pImageInstance->IsEmpty())
|
||||
return Py_BuildException("Cannot load image (filename: %s)", szFileName);
|
||||
|
||||
return Py_BuildValue("i", pImageInstance);
|
||||
}
|
||||
|
||||
PyObject* grpImageGenerateExpanded(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szFileName;
|
||||
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (strlen(szFileName) <= 0)
|
||||
return Py_BuildValue("i", 0);
|
||||
|
||||
CResource* pResource = CResourceManager::Instance().GetResourcePointer(szFileName);
|
||||
|
||||
if (!pResource->IsType(CGraphicImage::Type()))
|
||||
return Py_BuildException("Resource is not an image (filename: %s)", szFileName);
|
||||
|
||||
CGraphicExpandedImageInstance * pImageInstance = CGraphicExpandedImageInstance::New();
|
||||
pImageInstance->SetImagePointer(static_cast<CGraphicImage*>(pResource));
|
||||
|
||||
if (pImageInstance->IsEmpty())
|
||||
return Py_BuildException("Cannot load image (filename: %s)", szFileName);
|
||||
|
||||
return Py_BuildValue("i", pImageInstance);
|
||||
}
|
||||
|
||||
PyObject* grpImageGenerateFromHandle(PyObject * poSelf, PyObject* poArgs)
|
||||
{
|
||||
int iHandle;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &iHandle))
|
||||
return Py_BadArgument();
|
||||
|
||||
CGraphicImageInstance * pImageInstance = CGraphicImageInstance::New();
|
||||
pImageInstance->SetImagePointer((CGraphicImage *)iHandle);
|
||||
|
||||
return Py_BuildValue("i", pImageInstance);
|
||||
}
|
||||
|
||||
PyObject* grpImageDelete(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicImageInstance * pImageInstance;
|
||||
|
||||
if (!PyTuple_GetImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (!pImageInstance)
|
||||
return Py_BuildNone();
|
||||
|
||||
CGraphicImageInstance::Delete(pImageInstance);
|
||||
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpImageDeleteExpanded(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicExpandedImageInstance * pExpandedImageInstance;
|
||||
if (!PyTuple_GetExpandedImageInstance(poArgs, 0, &pExpandedImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
CGraphicExpandedImageInstance::Delete(pExpandedImageInstance);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpImageSetFileName(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicImageInstance * pImageInstance;
|
||||
if (!PyTuple_GetImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
char * szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 1, &szFileName))
|
||||
return Py_BadArgument();
|
||||
|
||||
CResource * pResource = CResourceManager::Instance().GetResourcePointer(szFileName);
|
||||
|
||||
if (!pResource->IsType(CGraphicImage::Type()))
|
||||
return Py_BuildException("Resource is not an image (filename: %s)", szFileName);
|
||||
|
||||
pImageInstance->SetImagePointer(static_cast<CGraphicImage*>(pResource));
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpImageRender(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicImageInstance* pImageInstance;
|
||||
if (!PyTuple_GetImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
pImageInstance->Render();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetImagePosition(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicImageInstance* pImageInstance;
|
||||
if (!PyTuple_GetImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
float x;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &x))
|
||||
return Py_BadArgument();
|
||||
|
||||
float y;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &y))
|
||||
return Py_BadArgument();
|
||||
|
||||
pImageInstance->SetPosition(x, y);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetImageOrigin(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicExpandedImageInstance * pImageInstance;
|
||||
if (!PyTuple_GetExpandedImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
float x;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &x))
|
||||
return Py_BadArgument();
|
||||
float y;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &y))
|
||||
return Py_BadArgument();
|
||||
|
||||
pImageInstance->SetOrigin(x, y);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetImageRotation(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicExpandedImageInstance * pImageInstance;
|
||||
if (!PyTuple_GetExpandedImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
float Degree;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &Degree))
|
||||
return Py_BadArgument();
|
||||
|
||||
pImageInstance->SetRotation(Degree);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetImageScale(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicExpandedImageInstance * pImageInstance;
|
||||
if (!PyTuple_GetExpandedImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
float x;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &x))
|
||||
return Py_BadArgument();
|
||||
float y;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &y))
|
||||
return Py_BadArgument();
|
||||
|
||||
pImageInstance->SetScale(x, y);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetRenderingRect(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicExpandedImageInstance * pImageInstance;
|
||||
if (!PyTuple_GetExpandedImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
float fLeft;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &fLeft))
|
||||
return Py_BadArgument();
|
||||
float fTop;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &fTop))
|
||||
return Py_BadArgument();
|
||||
float fRight;
|
||||
if (!PyTuple_GetFloat(poArgs, 3, &fRight))
|
||||
return Py_BadArgument();
|
||||
float fBottom;
|
||||
if (!PyTuple_GetFloat(poArgs, 4, &fBottom))
|
||||
return Py_BadArgument();
|
||||
|
||||
pImageInstance->SetRenderingRect(fLeft, fTop, fRight, fBottom);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetImageDiffuseColor(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicImageInstance* pImageInstance;
|
||||
if (!PyTuple_GetImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
float r;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &r))
|
||||
return Py_BadArgument();
|
||||
float g;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &g))
|
||||
return Py_BadArgument();
|
||||
float b;
|
||||
if (!PyTuple_GetFloat(poArgs, 3, &b))
|
||||
return Py_BadArgument();
|
||||
float a;
|
||||
if (!PyTuple_GetFloat(poArgs, 4, &a))
|
||||
return Py_BadArgument();
|
||||
|
||||
pImageInstance->SetDiffuseColor(r, g, b, a);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpGetWidth(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicImageInstance * pImageInstance;
|
||||
|
||||
if (!PyTuple_GetImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (pImageInstance->IsEmpty())
|
||||
return Py_BuildException("Image is empty");
|
||||
|
||||
return Py_BuildValue("i", pImageInstance->GetWidth());
|
||||
}
|
||||
|
||||
PyObject * grpGetHeight(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicImageInstance * pImageInstance;
|
||||
|
||||
if (!PyTuple_GetImageInstance(poArgs, 0, &pImageInstance))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (pImageInstance->IsEmpty())
|
||||
return Py_BuildException("Image is empty");
|
||||
|
||||
return Py_BuildValue("i", pImageInstance->GetHeight());
|
||||
}
|
||||
|
||||
void initgrpImage()
|
||||
{
|
||||
static PyMethodDef s_methods[] =
|
||||
{
|
||||
{ "Render", grpImageRender, METH_VARARGS },
|
||||
{ "SetPosition", grpSetImagePosition, METH_VARARGS },
|
||||
{ "Generate", grpImageGenerate, METH_VARARGS },
|
||||
{ "GenerateExpanded", grpImageGenerateExpanded, METH_VARARGS },
|
||||
{ "GenerateFromHandle", grpImageGenerateFromHandle, METH_VARARGS },
|
||||
{ "Delete", grpImageDelete, METH_VARARGS },
|
||||
{ "DeleteExpanded", grpImageDeleteExpanded, METH_VARARGS },
|
||||
{ "SetFileName", grpImageSetFileName, METH_VARARGS },
|
||||
{ "SetOrigin", grpSetImageOrigin, METH_VARARGS },
|
||||
{ "SetRotation", grpSetImageRotation, METH_VARARGS },
|
||||
{ "SetScale", grpSetImageScale, METH_VARARGS },
|
||||
{ "SetRenderingRect", grpSetRenderingRect, METH_VARARGS },
|
||||
{ "SetDiffuseColor", grpSetImageDiffuseColor, METH_VARARGS },
|
||||
{ "GetWidth", grpGetWidth, METH_VARARGS },
|
||||
{ "GetHeight", grpGetHeight, METH_VARARGS },
|
||||
{ NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
Py_InitModule("grpImage", s_methods);
|
||||
}
|
1005
src/EterPythonLib/PythonGraphicModule.cpp
Normal file
1005
src/EterPythonLib/PythonGraphicModule.cpp
Normal file
File diff suppressed because it is too large
Load Diff
426
src/EterPythonLib/PythonGraphicTextModule.cpp
Normal file
426
src/EterPythonLib/PythonGraphicTextModule.cpp
Normal file
@ -0,0 +1,426 @@
|
||||
#include "StdAfx.h"
|
||||
|
||||
bool PyTuple_GetTextInstance(PyObject* poArgs, int pos, CGraphicTextInstance** ppTextInstance)
|
||||
{
|
||||
int handle;
|
||||
if (!PyTuple_GetInteger(poArgs, pos, &handle))
|
||||
return false;
|
||||
|
||||
if (!handle)
|
||||
return false;
|
||||
|
||||
*ppTextInstance=(CGraphicTextInstance*)handle;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
PyObject* grpTextGenerate(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance * pTextInstance = CGraphicTextInstance::New();
|
||||
return Py_BuildValue("i", pTextInstance);
|
||||
}
|
||||
|
||||
PyObject* grpTextDestroy(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
CGraphicTextInstance::Delete(pTextInstance);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextGetSize(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
int width, height;
|
||||
pTextInstance->GetTextSize(&width, &height);
|
||||
return Py_BuildValue("(i, i)", width, height);
|
||||
}
|
||||
|
||||
PyObject* grpTextSetPosition(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
int ix;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &ix))
|
||||
return Py_BuildException();
|
||||
int iy;
|
||||
if (!PyTuple_GetInteger(poArgs, 2, &iy))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->SetPosition((float) ix, (float) iy);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextSetText(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
char* szText;
|
||||
if (!PyTuple_GetString(poArgs, 1, &szText))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->SetValue(szText);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextSetSecret(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
bool bValue;
|
||||
if (!PyTuple_GetBoolean(poArgs, 1, &bValue))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->SetSecret(bValue);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextOutline(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
bool bValue;
|
||||
if (!PyTuple_GetBoolean(poArgs, 1, &bValue))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->SetOutline(bValue);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextGetText(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
return Py_BuildValue("s", pTextInstance->GetValueStringReference().c_str());
|
||||
}
|
||||
|
||||
PyObject* grpTextSetFontName(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
char* szFontName;
|
||||
if (!PyTuple_GetString(poArgs, 1, &szFontName))
|
||||
return Py_BuildException();
|
||||
|
||||
std::string stFontName = szFontName;
|
||||
stFontName += ".fnt";
|
||||
|
||||
CResource* pResource = CResourceManager::Instance().GetResourcePointer(stFontName.c_str());
|
||||
pTextInstance->SetTextPointer(static_cast<CGraphicText*>(pResource));
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextSetFontColor(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
if (2 == PyTuple_Size(poArgs))
|
||||
{
|
||||
int iColor;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iColor))
|
||||
return Py_BuildException();
|
||||
pTextInstance->SetColor(DWORD(iColor));
|
||||
}
|
||||
else if (4 == PyTuple_Size(poArgs))
|
||||
{
|
||||
float fRed;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &fRed))
|
||||
return Py_BuildException();
|
||||
float fGreen;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &fGreen))
|
||||
return Py_BuildException();
|
||||
float fBlue;
|
||||
if (!PyTuple_GetFloat(poArgs, 3, &fBlue))
|
||||
return Py_BuildException();
|
||||
pTextInstance->SetColor(fRed, fGreen, fBlue);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Py_BuildException();
|
||||
}
|
||||
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextSetOutLineColor(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
float fRed;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &fRed))
|
||||
return Py_BuildException();
|
||||
float fGreen;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &fGreen))
|
||||
return Py_BuildException();
|
||||
float fBlue;
|
||||
if (!PyTuple_GetFloat(poArgs, 3, &fBlue))
|
||||
return Py_BuildException();
|
||||
|
||||
float fAlpha;
|
||||
if (!PyTuple_GetFloat(poArgs, 4, &fAlpha))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->SetOutLineColor(fRed, fGreen, fBlue, fAlpha);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
|
||||
PyObject* grpTextRender(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->Render();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextUpdate(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->Update();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextShowCursor(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->ShowCursor();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpTextHideCursor(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->HideCursor();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpSetHorizontalAlign(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
int iAlign;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iAlign))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->SetHorizonalAlign(iAlign);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpSetVerticalAlign(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
int iAlign;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iAlign))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->SetVerticalAlign(iAlign);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpSetMax(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance* pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
int iValue;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iValue))
|
||||
return Py_BuildException();
|
||||
|
||||
pTextInstance->SetMax(iValue);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpGetSplitingTextLineCount(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szText;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szText))
|
||||
return Py_BuildException();
|
||||
|
||||
int iLineLimitation;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iLineLimitation))
|
||||
return Py_BuildException();
|
||||
|
||||
int iPosition = 0;
|
||||
int iLineCount = 0;
|
||||
|
||||
for (DWORD i = 0; i < strlen(szText);)
|
||||
{
|
||||
if ('|' == szText[i])
|
||||
{
|
||||
i += 1;
|
||||
|
||||
// <20>ڵ<EFBFBD> <20><> <20>ٲǰ<DEB5> <20>ٷ<EFBFBD> | <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if (iPosition>0)
|
||||
++iLineCount;
|
||||
|
||||
iPosition = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (szText[i] & 0x80)
|
||||
{
|
||||
i += 2;
|
||||
iPosition += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
i += 1;
|
||||
iPosition += 1;
|
||||
}
|
||||
|
||||
if (iPosition >= iLineLimitation)
|
||||
{
|
||||
++iLineCount;
|
||||
iPosition = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (iPosition > 0)
|
||||
++iLineCount;
|
||||
|
||||
return Py_BuildValue("i", iLineCount);
|
||||
}
|
||||
|
||||
PyObject* grpGetSplitingTextLine(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szText;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szText))
|
||||
return Py_BuildException();
|
||||
|
||||
int iLineLimitation;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iLineLimitation))
|
||||
return Py_BuildException();
|
||||
|
||||
int iGettingLine;
|
||||
if (!PyTuple_GetInteger(poArgs, 2, &iGettingLine))
|
||||
return Py_BuildException();
|
||||
|
||||
std::string strLine = "";
|
||||
int iPosition = 0;
|
||||
int iLineCount = 0;
|
||||
|
||||
// 1<><31> : <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> <20>ȵɱ<C8B5> -_-a
|
||||
// 2<><32> : <20><>.. <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> +_+
|
||||
for (DWORD i = 0; i < strlen(szText);)
|
||||
{
|
||||
if ('|' == szText[i])
|
||||
{
|
||||
i += 1;
|
||||
|
||||
// <20>ڵ<EFBFBD> <20><> <20>ٲǰ<DEB5> <20>ٷ<EFBFBD> | <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
if (iPosition>0)
|
||||
++iLineCount;
|
||||
iPosition = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (szText[i] & 0x80)
|
||||
{
|
||||
if (iLineCount == iGettingLine)
|
||||
strLine.append(szText+i, 2);
|
||||
|
||||
i += 2;
|
||||
iPosition += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iLineCount == iGettingLine)
|
||||
strLine += szText[i];
|
||||
|
||||
i += 1;
|
||||
iPosition += 1;
|
||||
}
|
||||
|
||||
if (iPosition >= iLineLimitation)
|
||||
{
|
||||
++iLineCount;
|
||||
iPosition = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return Py_BuildValue("s", strLine.c_str());
|
||||
}
|
||||
|
||||
PyObject* grpTextPixelPositionToCharacterPosition(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicTextInstance * pTextInstance;
|
||||
if (!PyTuple_GetTextInstance(poArgs, 0, &pTextInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
int iPixelPosition;
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iPixelPosition))
|
||||
return Py_BuildException();
|
||||
|
||||
int iCharacterPosition = pTextInstance->PixelPositionToCharacterPosition(iPixelPosition);
|
||||
|
||||
return Py_BuildValue("i", iCharacterPosition);
|
||||
}
|
||||
|
||||
void initgrpText()
|
||||
{
|
||||
static PyMethodDef s_methods[] =
|
||||
{
|
||||
{ "Update", grpTextUpdate, METH_VARARGS },
|
||||
{ "Render", grpTextRender, METH_VARARGS },
|
||||
{ "Generate", grpTextGenerate, METH_VARARGS },
|
||||
{ "Destroy", grpTextDestroy, METH_VARARGS },
|
||||
{ "SetFontName", grpTextSetFontName, METH_VARARGS },
|
||||
{ "SetFontColor", grpTextSetFontColor, METH_VARARGS },
|
||||
{ "SetOutLineColor", grpTextSetOutLineColor, METH_VARARGS },
|
||||
{ "SetSecret", grpTextSetSecret, METH_VARARGS },
|
||||
{ "SetOutline", grpTextOutline, METH_VARARGS },
|
||||
{ "SetText", grpTextSetText, METH_VARARGS },
|
||||
{ "GetText", grpTextGetText, METH_VARARGS },
|
||||
{ "GetSize", grpTextGetSize, METH_VARARGS },
|
||||
{ "SetPosition", grpTextSetPosition, METH_VARARGS },
|
||||
{ "ShowCursor", grpTextShowCursor, METH_VARARGS },
|
||||
{ "HideCursor", grpTextHideCursor, METH_VARARGS },
|
||||
{ "SetHorizontalAlign", grpSetHorizontalAlign, METH_VARARGS },
|
||||
{ "SetVerticalAlign", grpSetVerticalAlign, METH_VARARGS },
|
||||
{ "SetMax", grpSetMax, METH_VARARGS },
|
||||
{ "GetSplitingTextLineCount", grpGetSplitingTextLineCount, METH_VARARGS },
|
||||
{ "GetSplitingTextLine", grpGetSplitingTextLine, METH_VARARGS },
|
||||
{ "PixelPositionToCharacterPosition", grpTextPixelPositionToCharacterPosition, METH_VARARGS },
|
||||
{ NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
Py_InitModule("grpText", s_methods);
|
||||
}
|
164
src/EterPythonLib/PythonGraphicThingModule.cpp
Normal file
164
src/EterPythonLib/PythonGraphicThingModule.cpp
Normal file
@ -0,0 +1,164 @@
|
||||
#include "StdAfx.h"
|
||||
|
||||
bool PyTuple_GetThingInstance(PyObject* poArgs, int pos, CGraphicThingInstance** ppRetThingInstance)
|
||||
{
|
||||
int handle;
|
||||
if (!PyTuple_GetInteger(poArgs, pos, &handle))
|
||||
return false;
|
||||
|
||||
if (!handle)
|
||||
return false;
|
||||
|
||||
*ppRetThingInstance = (CGraphicThingInstance*)handle;
|
||||
return true;
|
||||
}
|
||||
|
||||
PyObject* grpThingGenerate(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
if (strlen(szFileName) <= 0)
|
||||
return Py_BuildValue("i", 0);
|
||||
|
||||
CResource* pResource = CResourceManager::Instance().GetResourcePointer(szFileName);
|
||||
|
||||
if (!pResource->IsType(CGraphicThing::Type()))
|
||||
return Py_BuildException();
|
||||
|
||||
CGraphicThingInstance * pThingInstance = CGraphicThingInstance::New();
|
||||
pThingInstance->ReserveModelThing(1);
|
||||
pThingInstance->ReserveModelInstance(1);
|
||||
pThingInstance->RegisterModelThing(0, static_cast<CGraphicThing*>(pResource));
|
||||
pThingInstance->SetModelInstance(0, 0, 0);
|
||||
return Py_BuildValue("i", pThingInstance);
|
||||
}
|
||||
|
||||
PyObject* grpThingDelete(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicThingInstance * pThingInstance;
|
||||
if (!PyTuple_GetThingInstance(poArgs, 0, &pThingInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
CGraphicThingInstance::Delete(pThingInstance);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpThingSetFileName(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicThingInstance * pThingInstance;
|
||||
if (!PyTuple_GetThingInstance(poArgs, 0, &pThingInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
char* szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 1, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
CResource* pResource = CResourceManager::Instance().GetResourcePointer(szFileName);
|
||||
|
||||
if (!pResource->IsType(CGraphicThing::Type()))
|
||||
return Py_BuildException();
|
||||
|
||||
pThingInstance->Clear();
|
||||
pThingInstance->ReserveModelThing(1);
|
||||
pThingInstance->ReserveModelInstance(1);
|
||||
pThingInstance->RegisterModelThing(0, static_cast<CGraphicThing*>(pResource));
|
||||
pThingInstance->SetModelInstance(0, 0, 0);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpThingRender(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicThingInstance* pThingInstance;
|
||||
if (!PyTuple_GetThingInstance(poArgs, 0, &pThingInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
pThingInstance->Render();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject* grpThingUpdate(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CGraphicThingInstance* pThingInstance;
|
||||
if (!PyTuple_GetThingInstance(poArgs, 0, &pThingInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
pThingInstance->Update();
|
||||
pThingInstance->Deform();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetThingPosition(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicThingInstance* pThingInstance;
|
||||
if (!PyTuple_GetThingInstance(poArgs, 0, &pThingInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
float x;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &x))
|
||||
return Py_BuildException();
|
||||
|
||||
float y;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &y))
|
||||
return Py_BuildException();
|
||||
|
||||
float z;
|
||||
if (!PyTuple_GetFloat(poArgs, 3, &z))
|
||||
return Py_BuildException();
|
||||
|
||||
pThingInstance->SetPosition(x, y, z);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetThingRotation(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicThingInstance* pThingInstance;
|
||||
if (!PyTuple_GetThingInstance(poArgs, 0, &pThingInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
float fDegree;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &fDegree))
|
||||
return Py_BuildException();
|
||||
|
||||
pThingInstance->SetRotation(fDegree);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * grpSetThingScale(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
CGraphicThingInstance* pThingInstance;
|
||||
if (!PyTuple_GetThingInstance(poArgs, 0, &pThingInstance))
|
||||
return Py_BuildException();
|
||||
|
||||
float x;
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &x))
|
||||
return Py_BuildException();
|
||||
float y;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &y))
|
||||
return Py_BuildException();
|
||||
float z;
|
||||
if (!PyTuple_GetFloat(poArgs, 3, &z))
|
||||
return Py_BuildException();
|
||||
|
||||
pThingInstance->SetScale(x, y, z);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
void initgrpThing()
|
||||
{
|
||||
static PyMethodDef s_methods[] =
|
||||
{
|
||||
{ "Update", grpThingUpdate, METH_VARARGS },
|
||||
{ "Render", grpThingRender, METH_VARARGS },
|
||||
{ "SetPosition", grpSetThingPosition, METH_VARARGS },
|
||||
{ "Generate", grpThingGenerate, METH_VARARGS },
|
||||
{ "Delete", grpThingDelete, METH_VARARGS },
|
||||
{ "SetFileName", grpThingSetFileName, METH_VARARGS },
|
||||
{ "SetRotation", grpSetThingRotation, METH_VARARGS },
|
||||
{ "SetScale", grpSetThingScale, METH_VARARGS },
|
||||
{ NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
Py_InitModule("grpThing", s_methods);
|
||||
}
|
400
src/EterPythonLib/PythonGridSlotWindow.cpp
Normal file
400
src/EterPythonLib/PythonGridSlotWindow.cpp
Normal file
@ -0,0 +1,400 @@
|
||||
#include "StdAfx.h"
|
||||
#include "../eterBase/CRC32.h"
|
||||
#include "PythonGridSlotWindow.h"
|
||||
|
||||
using namespace UI;
|
||||
|
||||
void CGridSlotWindow::OnRenderPickingSlot()
|
||||
{
|
||||
if (!UI::CWindowManager::Instance().IsAttaching())
|
||||
return;
|
||||
|
||||
BYTE byWidth, byHeight;
|
||||
UI::CWindowManager::Instance().GetAttachingIconSize(&byWidth, &byHeight);
|
||||
|
||||
std::list<TSlot*> SlotList;
|
||||
if (GetPickedSlotList(byWidth, byHeight, &SlotList))
|
||||
{
|
||||
DWORD dwSlotNumber = UI::CWindowManager::Instance().GetAttachingSlotNumber();
|
||||
DWORD dwItemIndex = UI::CWindowManager::Instance().GetAttachingIndex();
|
||||
|
||||
// UseMode <20>̰<EFBFBD>..
|
||||
if (m_isUseMode)
|
||||
{
|
||||
// Pick <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..
|
||||
TSlot * pSlot = *SlotList.begin();
|
||||
TSlot * pCenterSlot;
|
||||
if (GetSlotPointer(pSlot->dwCenterSlotNumber, &pCenterSlot))
|
||||
if (pCenterSlot->isItem)
|
||||
{
|
||||
if (m_isUsableItem)
|
||||
CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 0.0f, 0.5f);
|
||||
else
|
||||
CPythonGraphic::Instance().SetDiffuseColor(1.0f, 0.0f, 0.0f, 0.5f);
|
||||
|
||||
CPythonGraphic::Instance().RenderBar2d( m_rect.left + pCenterSlot->ixPosition,
|
||||
m_rect.top + pCenterSlot->iyPosition,
|
||||
m_rect.left + pCenterSlot->ixPosition + pCenterSlot->byxPlacedItemSize * ITEM_WIDTH,
|
||||
m_rect.top + pCenterSlot->iyPosition + pCenterSlot->byyPlacedItemSize * ITEM_HEIGHT);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// <20>ƴϸ<C6B4> <20>׳<EFBFBD> <20>ű<EFBFBD><C5B1><EFBFBD>
|
||||
if (CheckMoving(dwSlotNumber, dwItemIndex, SlotList))
|
||||
CPythonGraphic::Instance().SetDiffuseColor(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
else
|
||||
CPythonGraphic::Instance().SetDiffuseColor(1.0f, 0.0f, 0.0f, 0.5f);
|
||||
|
||||
RECT Rect;
|
||||
Rect.left = m_rect.right;
|
||||
Rect.top = m_rect.bottom;
|
||||
Rect.right = 0;
|
||||
Rect.bottom = 0;
|
||||
|
||||
for (std::list<TSlot*>::iterator itor = SlotList.begin(); itor != SlotList.end(); ++itor)
|
||||
{
|
||||
TSlot * pSlot = *itor;
|
||||
Rect.left = min(Rect.left, m_rect.left + pSlot->ixPosition);
|
||||
Rect.top = min(Rect.top, m_rect.top + pSlot->iyPosition);
|
||||
Rect.right = max(Rect.right, m_rect.left + pSlot->ixPosition + pSlot->byxPlacedItemSize*ITEM_WIDTH);
|
||||
Rect.bottom = max(Rect.bottom, m_rect.top + pSlot->iyPosition + pSlot->byxPlacedItemSize*ITEM_HEIGHT);
|
||||
}
|
||||
|
||||
CPythonGraphic::Instance().RenderBar2d(Rect.left, Rect.top, Rect.right, Rect.bottom);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CGridSlotWindow::GetPickedSlotPointer(TSlot ** ppSlot)
|
||||
{
|
||||
if (!UI::CWindowManager::Instance().IsAttaching())
|
||||
return CSlotWindow::GetPickedSlotPointer(ppSlot);
|
||||
|
||||
BYTE byWidth, byHeight;
|
||||
UI::CWindowManager::Instance().GetAttachingIconSize(&byWidth, &byHeight);
|
||||
|
||||
std::list<TSlot*> SlotList;
|
||||
if (!GetPickedSlotList(byWidth, byHeight, &SlotList))
|
||||
return FALSE;
|
||||
|
||||
TSlot * pMinSlot = NULL;
|
||||
//DWORD dwSlotNumber = UI::CWindowManager::Instance().GetAttachingSlotNumber();
|
||||
//DWORD dwAttachingItemIndex = UI::CWindowManager::Instance().GetAttachingIndex();
|
||||
|
||||
for (std::list<TSlot*>::iterator itor = SlotList.begin(); itor != SlotList.end(); ++itor)
|
||||
{
|
||||
TSlot * pSlot = *itor;
|
||||
|
||||
// NOTE : <20><> <20><><EFBFBD><EFBFBD> <20>̻<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ڵ<EFBFBD>.. <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>°<EFBFBD>? - [levites]
|
||||
if (!pMinSlot)
|
||||
{
|
||||
pMinSlot = pSlot;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pSlot->dwSlotNumber < pMinSlot->dwSlotNumber)
|
||||
{
|
||||
pMinSlot = pSlot;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!pMinSlot->isItem && pSlot->isItem)
|
||||
{
|
||||
pMinSlot = pSlot;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!pMinSlot)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
TSlot * pCenterSlot;
|
||||
if (!GetSlotPointer(pMinSlot->dwCenterSlotNumber, &pCenterSlot))
|
||||
return FALSE;
|
||||
|
||||
*ppSlot = pCenterSlot;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD>̰<EFBFBD>..
|
||||
if (UI::CWindowManager::Instance().IsAttaching())
|
||||
{
|
||||
DWORD dwSlotNumber = UI::CWindowManager::Instance().GetAttachingSlotNumber();
|
||||
|
||||
if (dwSlotNumber == pCenterSlot->dwSlotNumber)
|
||||
{
|
||||
*ppSlot = pMinSlot;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CGridSlotWindow::GetPickedSlotList(int iWidth, int iHeight, std::list<TSlot*> * pSlotPointerList)
|
||||
{
|
||||
long lx, ly;
|
||||
GetMouseLocalPosition(lx, ly);
|
||||
|
||||
if (lx < 0)
|
||||
return FALSE;
|
||||
if (ly < 0)
|
||||
return FALSE;
|
||||
if (lx >= GetWidth())
|
||||
return FALSE;
|
||||
if (ly >= GetHeight())
|
||||
return FALSE;
|
||||
|
||||
pSlotPointerList->clear();
|
||||
|
||||
int ix, iy;
|
||||
if (GetPickedGridSlotPosition(lx, ly, &ix, &iy))
|
||||
{
|
||||
int ixHalfStep = (iWidth / 2);
|
||||
//int iyHalfStep = (iHeight / 2);
|
||||
|
||||
int ixStart = int(ix) - int(ixHalfStep - (ixHalfStep % 2));
|
||||
int ixEnd = int(ix) + int(ixHalfStep);
|
||||
|
||||
// FIXME : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ã<><C3A3> - [levites]
|
||||
int iyStart = 0, iyEnd = 0;
|
||||
|
||||
if (1 == iHeight)
|
||||
{
|
||||
iyStart = iy;
|
||||
iyEnd = iy;
|
||||
}
|
||||
else if (2 == iHeight)
|
||||
{
|
||||
iyStart = iy;
|
||||
iyEnd = iy + 1;
|
||||
}
|
||||
else if (3 == iHeight)
|
||||
{
|
||||
iyStart = iy - 1;
|
||||
iyEnd = iy + 1;
|
||||
}
|
||||
|
||||
if (ixStart < 0)
|
||||
{
|
||||
ixEnd += -ixStart;
|
||||
ixStart = 0;
|
||||
}
|
||||
|
||||
if (iyStart < 0)
|
||||
{
|
||||
iyEnd += -iyStart;
|
||||
iyStart = 0;
|
||||
}
|
||||
|
||||
if (DWORD(ixEnd) >= m_dwxCount)
|
||||
{
|
||||
int ixTemporary = DWORD(ixEnd) - m_dwxCount + 1;
|
||||
ixStart -= ixTemporary;
|
||||
ixEnd -= ixTemporary;
|
||||
}
|
||||
|
||||
if (DWORD(iyEnd) >= m_dwyCount)
|
||||
{
|
||||
int iyTemporary = DWORD(iyEnd) - m_dwyCount + 1;
|
||||
iyStart -= iyTemporary;
|
||||
iyEnd -= iyTemporary;
|
||||
}
|
||||
|
||||
for (int i = ixStart; i <= ixEnd; ++i)
|
||||
for (int j = iyStart; j <= iyEnd; ++j)
|
||||
{
|
||||
TSlot * pSlot;
|
||||
if (GetGridSlotPointer(DWORD(i), DWORD(j), &pSlot))
|
||||
{
|
||||
pSlotPointerList->push_back(pSlot);
|
||||
}
|
||||
}
|
||||
|
||||
// Refine Scroll <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3>
|
||||
if (m_isUseMode && 1 == pSlotPointerList->size())
|
||||
{
|
||||
TSlot * pMainSlot = *pSlotPointerList->begin();
|
||||
|
||||
std::vector<TSlot *>::iterator itor = m_SlotVector.begin();
|
||||
for (; itor != m_SlotVector.end(); ++itor)
|
||||
{
|
||||
TSlot * pSlot = *itor;
|
||||
if (pSlot->dwCenterSlotNumber == pMainSlot->dwCenterSlotNumber)
|
||||
if (pSlotPointerList->end() == std::find(pSlotPointerList->begin(), pSlotPointerList->end(), pSlot))
|
||||
{
|
||||
pSlotPointerList->push_back(pSlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!pSlotPointerList->empty())
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CGridSlotWindow::GetGridSlotPointer(int ix, int iy, TSlot ** ppSlot)
|
||||
{
|
||||
DWORD dwSlotIndex = ix + iy*m_dwxCount;
|
||||
if (dwSlotIndex >= m_SlotVector.size())
|
||||
return FALSE;
|
||||
|
||||
*ppSlot = m_SlotVector[dwSlotIndex];
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CGridSlotWindow::GetPickedGridSlotPosition(int ixLocal, int iyLocal, int * pix, int * piy)
|
||||
{
|
||||
for (DWORD x = 0; x < m_dwxCount; ++x)
|
||||
for (DWORD y = 0; y < m_dwyCount; ++y)
|
||||
{
|
||||
TSlot * pSlot;
|
||||
if (!GetGridSlotPointer(x, y, &pSlot))
|
||||
continue;
|
||||
|
||||
if (ixLocal >= pSlot->ixPosition)
|
||||
if (iyLocal >= pSlot->iyPosition)
|
||||
if (ixLocal <= pSlot->ixPosition + pSlot->ixCellSize)
|
||||
if (iyLocal <= pSlot->iyPosition + pSlot->iyCellSize)
|
||||
{
|
||||
*pix = x;
|
||||
*piy = y;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CGridSlotWindow::ArrangeGridSlot(DWORD dwStartIndex, DWORD dwxCount, DWORD dwyCount, int ixSlotSize, int iySlotSize, int ixTemporarySize, int iyTemporarySize)
|
||||
{
|
||||
Destroy();
|
||||
|
||||
m_dwxCount = dwxCount;
|
||||
m_dwyCount = dwyCount;
|
||||
|
||||
m_SlotVector.clear();
|
||||
m_SlotVector.resize(dwxCount*dwyCount);
|
||||
|
||||
for (DWORD x = 0; x < dwxCount; ++x)
|
||||
for (DWORD y = 0; y < dwyCount; ++y)
|
||||
{
|
||||
DWORD dwIndex = dwStartIndex + x + y * dwxCount;
|
||||
int ixPosition = x * (ixSlotSize + ixTemporarySize);
|
||||
int iyPosition = y * (iySlotSize + iyTemporarySize);
|
||||
|
||||
AppendSlot(dwIndex, ixPosition, iyPosition, ixSlotSize, iySlotSize);
|
||||
|
||||
m_SlotVector[x+y*dwxCount] = &(*m_SlotList.rbegin());
|
||||
}
|
||||
|
||||
int iWidth = dwxCount * (ixSlotSize + ixTemporarySize);
|
||||
int iHeight = dwyCount * (iySlotSize + iyTemporarySize);
|
||||
SetSize(iWidth, iHeight);
|
||||
}
|
||||
|
||||
void CGridSlotWindow::OnRefreshSlot()
|
||||
{
|
||||
DWORD x, y;
|
||||
|
||||
for (x = 0; x < m_dwxCount; ++x)
|
||||
for (y = 0; y < m_dwyCount; ++y)
|
||||
{
|
||||
TSlot * pSlot;
|
||||
if (!GetGridSlotPointer(x, y, &pSlot))
|
||||
continue;
|
||||
|
||||
pSlot->dwCenterSlotNumber = pSlot->dwSlotNumber;
|
||||
}
|
||||
|
||||
for (x = 0; x < m_dwxCount; ++x)
|
||||
for (y = 0; y < m_dwyCount; ++y)
|
||||
{
|
||||
TSlot * pSlot;
|
||||
if (!GetGridSlotPointer(x, y, &pSlot))
|
||||
continue;
|
||||
|
||||
if (pSlot->isItem)
|
||||
{
|
||||
for (DWORD xSub = 0; xSub < pSlot->byxPlacedItemSize; ++xSub)
|
||||
for (DWORD ySub = 0; ySub < pSlot->byyPlacedItemSize; ++ySub)
|
||||
{
|
||||
TSlot * pSubSlot;
|
||||
if (!GetGridSlotPointer(x+xSub, y+ySub, &pSubSlot))
|
||||
continue;
|
||||
|
||||
pSubSlot->dwCenterSlotNumber = pSlot->dwSlotNumber;
|
||||
pSubSlot->dwItemIndex = pSlot->dwItemIndex;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pSlot->dwItemIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CGridSlotWindow::CheckMoving(DWORD dwSlotNumber, DWORD dwItemIndex, const std::list<TSlot*> & c_rSlotList)
|
||||
{
|
||||
if (m_dwSlotStyle != SLOT_STYLE_PICK_UP)
|
||||
return TRUE;
|
||||
|
||||
for (std::list<TSlot*>::const_iterator itor = c_rSlotList.begin(); itor != c_rSlotList.end(); ++itor)
|
||||
{
|
||||
TSlot * pSlot = *itor;
|
||||
|
||||
if (dwSlotNumber != pSlot->dwCenterSlotNumber) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڸ<EFBFBD><DAB8><EFBFBD> <20>ƴ<EFBFBD> <20><><EFBFBD>쿡
|
||||
{
|
||||
if (0 != pSlot->dwItemIndex || pSlot->dwCenterSlotNumber != pSlot->dwSlotNumber) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ְ<EFBFBD>
|
||||
{
|
||||
if (dwItemIndex != pSlot->dwItemIndex) // <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD> <20><> <20>ű<EFBFBD>
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CGridSlotWindow::Destroy()
|
||||
{
|
||||
CSlotWindow::Destroy();
|
||||
|
||||
m_SlotVector.clear();
|
||||
|
||||
__Initialize();
|
||||
}
|
||||
|
||||
void CGridSlotWindow::__Initialize()
|
||||
{
|
||||
m_dwxCount = 0;
|
||||
m_dwyCount = 0;
|
||||
}
|
||||
|
||||
DWORD CGridSlotWindow::Type()
|
||||
{
|
||||
static int s_Type = GetCRC32("CGridSlotWindow", strlen("CGridSlotWindow"));
|
||||
return s_Type;
|
||||
}
|
||||
|
||||
BOOL CGridSlotWindow::OnIsType(DWORD dwType)
|
||||
{
|
||||
if (CGridSlotWindow::Type() == dwType)
|
||||
return TRUE;
|
||||
|
||||
return CSlotWindow::OnIsType(dwType);
|
||||
}
|
||||
|
||||
CGridSlotWindow::CGridSlotWindow(PyObject * ppyObject) : CSlotWindow(ppyObject)
|
||||
{
|
||||
}
|
||||
|
||||
CGridSlotWindow::~CGridSlotWindow()
|
||||
{
|
||||
}
|
40
src/EterPythonLib/PythonGridSlotWindow.h
Normal file
40
src/EterPythonLib/PythonGridSlotWindow.h
Normal file
@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include "PythonSlotWindow.h"
|
||||
|
||||
namespace UI
|
||||
{
|
||||
class CGridSlotWindow : public CSlotWindow
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
|
||||
public:
|
||||
CGridSlotWindow(PyObject * ppyObject);
|
||||
virtual ~CGridSlotWindow();
|
||||
|
||||
void Destroy();
|
||||
|
||||
void ArrangeGridSlot(DWORD dwStartIndex, DWORD dwxCount, DWORD dwyCount, int ixSlotSize, int iySlotSize, int ixTemporarySize, int iyTemporarySize);
|
||||
|
||||
protected:
|
||||
void __Initialize();
|
||||
|
||||
BOOL GetPickedSlotPointer(TSlot ** ppSlot);
|
||||
BOOL GetPickedSlotList(int iWidth, int iHeight, std::list<TSlot*> * pSlotPointerList);
|
||||
BOOL GetGridSlotPointer(int ix, int iy, TSlot ** ppSlot);
|
||||
BOOL GetPickedGridSlotPosition(int ixLocal, int iyLocal, int * pix, int * piy);
|
||||
BOOL CheckMoving(DWORD dwSlotNumber, DWORD dwItemIndex, const std::list<TSlot*> & c_rSlotList);
|
||||
|
||||
BOOL OnIsType(DWORD dwType);
|
||||
|
||||
void OnRefreshSlot();
|
||||
void OnRenderPickingSlot();
|
||||
|
||||
protected:
|
||||
DWORD m_dwxCount;
|
||||
DWORD m_dwyCount;
|
||||
|
||||
std::vector<TSlot *> m_SlotVector;
|
||||
};
|
||||
};
|
1442
src/EterPythonLib/PythonSlotWindow.cpp
Normal file
1442
src/EterPythonLib/PythonSlotWindow.cpp
Normal file
File diff suppressed because it is too large
Load Diff
211
src/EterPythonLib/PythonSlotWindow.h
Normal file
211
src/EterPythonLib/PythonSlotWindow.h
Normal file
@ -0,0 +1,211 @@
|
||||
#pragma once
|
||||
|
||||
#include "PythonWindow.h"
|
||||
|
||||
namespace UI
|
||||
{
|
||||
enum
|
||||
{
|
||||
ITEM_WIDTH = 32,
|
||||
ITEM_HEIGHT = 32,
|
||||
|
||||
SLOT_NUMBER_NONE = 0xffffffff,
|
||||
};
|
||||
|
||||
enum ESlotStyle
|
||||
{
|
||||
SLOT_STYLE_NONE,
|
||||
SLOT_STYLE_PICK_UP,
|
||||
SLOT_STYLE_SELECT,
|
||||
};
|
||||
|
||||
enum ESlotState
|
||||
{
|
||||
SLOT_STATE_LOCK = (1 << 0),
|
||||
SLOT_STATE_CANT_USE = (1 << 1),
|
||||
SLOT_STATE_DISABLE = (1 << 2),
|
||||
SLOT_STATE_ALWAYS_RENDER_COVER = (1 << 3), // <20><><EFBFBD><EFBFBD> Cover <20><>ư<EFBFBD><C6B0> <20><><EFBFBD>Կ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ϴµ<CFB4>, <20><> flag<61><67> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>̾ Ŀ<><C4BF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
};
|
||||
|
||||
class CSlotWindow : public CWindow
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
|
||||
public:
|
||||
class CSlotButton;
|
||||
class CCoverButton;
|
||||
class CCoolTimeFinishEffect;
|
||||
|
||||
friend class CSlotButton;
|
||||
friend class CCoverButton;
|
||||
|
||||
typedef struct SSlot
|
||||
{
|
||||
DWORD dwState;
|
||||
DWORD dwSlotNumber;
|
||||
DWORD dwCenterSlotNumber; // NOTE : <20><><EFBFBD><EFBFBD><EFBFBD> ū <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ġ <20><>ȣ
|
||||
DWORD dwItemIndex; // NOTE : <20><><EFBFBD>⼭ <20><><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD> Item<65>̶<EFBFBD><CCB6><EFBFBD> <20>ܾ<EFBFBD><DCBE><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ƴ<EFBFBD>,
|
||||
BOOL isItem; // "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>빰"<22>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>? - [levites]
|
||||
|
||||
// CoolTime
|
||||
float fCoolTime;
|
||||
float fStartCoolTime;
|
||||
|
||||
// Toggle
|
||||
BOOL bActive;
|
||||
|
||||
int ixPosition;
|
||||
int iyPosition;
|
||||
|
||||
int ixCellSize;
|
||||
int iyCellSize;
|
||||
|
||||
BYTE byxPlacedItemSize;
|
||||
BYTE byyPlacedItemSize;
|
||||
|
||||
CGraphicImageInstance * pInstance;
|
||||
CNumberLine * pNumberLine;
|
||||
|
||||
bool bRenderBaseSlotImage;
|
||||
CCoverButton * pCoverButton;
|
||||
CSlotButton * pSlotButton;
|
||||
CImageBox * pSignImage;
|
||||
CAniImageBox * pFinishCoolTimeEffect;
|
||||
} TSlot;
|
||||
typedef std::list<TSlot> TSlotList;
|
||||
typedef TSlotList::iterator TSlotListIterator;
|
||||
|
||||
public:
|
||||
CSlotWindow(PyObject * ppyObject);
|
||||
virtual ~CSlotWindow();
|
||||
|
||||
void Destroy();
|
||||
|
||||
// Manage Slot
|
||||
void SetSlotType(DWORD dwType);
|
||||
void SetSlotStyle(DWORD dwStyle);
|
||||
|
||||
void AppendSlot(DWORD dwIndex, int ixPosition, int iyPosition, int ixCellSize, int iyCellSize);
|
||||
void SetCoverButton(DWORD dwIndex, const char * c_szUpImageName, const char * c_szOverImageName, const char * c_szDownImageName, const char * c_szDisableImageName, BOOL bLeftButtonEnable, BOOL bRightButtonEnable);
|
||||
void SetSlotBaseImage(const char * c_szFileName, float fr, float fg, float fb, float fa);
|
||||
void AppendSlotButton(const char * c_szUpImageName, const char * c_szOverImageName, const char * c_szDownImageName);
|
||||
void AppendRequirementSignImage(const char * c_szImageName);
|
||||
|
||||
void EnableCoverButton(DWORD dwIndex);
|
||||
void DisableCoverButton(DWORD dwIndex);
|
||||
void SetAlwaysRenderCoverButton(DWORD dwIndex, bool bAlwaysRender = false);
|
||||
|
||||
void ShowSlotBaseImage(DWORD dwIndex);
|
||||
void HideSlotBaseImage(DWORD dwIndex);
|
||||
BOOL IsDisableCoverButton(DWORD dwIndex);
|
||||
BOOL HasSlot(DWORD dwIndex);
|
||||
|
||||
void ClearAllSlot();
|
||||
void ClearSlot(DWORD dwIndex);
|
||||
void SetSlot(DWORD dwIndex, DWORD dwVirtualNumber, BYTE byWidth, BYTE byHeight, CGraphicImage * pImage, D3DXCOLOR& diffuseColor);
|
||||
void SetSlotCount(DWORD dwIndex, DWORD dwCount);
|
||||
void SetSlotCountNew(DWORD dwIndex, DWORD dwGrade, DWORD dwCount);
|
||||
void SetSlotCoolTime(DWORD dwIndex, float fCoolTime, float fElapsedTime = 0.0f);
|
||||
void ActivateSlot(DWORD dwIndex);
|
||||
void DeactivateSlot(DWORD dwIndex);
|
||||
void RefreshSlot();
|
||||
|
||||
DWORD GetSlotCount();
|
||||
|
||||
void LockSlot(DWORD dwIndex);
|
||||
void UnlockSlot(DWORD dwIndex);
|
||||
BOOL IsLockSlot(DWORD dwIndex);
|
||||
void SetCantUseSlot(DWORD dwIndex);
|
||||
void SetUseSlot(DWORD dwIndex);
|
||||
BOOL IsCantUseSlot(DWORD dwIndex);
|
||||
void EnableSlot(DWORD dwIndex);
|
||||
void DisableSlot(DWORD dwIndex);
|
||||
BOOL IsEnableSlot(DWORD dwIndex);
|
||||
|
||||
// Select
|
||||
void ClearSelected();
|
||||
void SelectSlot(DWORD dwSelectingIndex);
|
||||
BOOL isSelectedSlot(DWORD dwIndex);
|
||||
DWORD GetSelectedSlotCount();
|
||||
DWORD GetSelectedSlotNumber(DWORD dwIndex);
|
||||
|
||||
// Slot Button
|
||||
void ShowSlotButton(DWORD dwSlotNumber);
|
||||
void HideAllSlotButton();
|
||||
void OnPressedSlotButton(DWORD dwType, DWORD dwSlotNumber, BOOL isLeft = TRUE);
|
||||
|
||||
// Requirement Sign
|
||||
void ShowRequirementSign(DWORD dwSlotNumber);
|
||||
void HideRequirementSign(DWORD dwSlotNumber);
|
||||
|
||||
// ToolTip
|
||||
BOOL OnOverInItem(DWORD dwSlotNumber);
|
||||
void OnOverOutItem();
|
||||
|
||||
// For Usable Item
|
||||
void SetUseMode(BOOL bFlag);
|
||||
void SetUsableItem(BOOL bFlag);
|
||||
|
||||
// CallBack
|
||||
void ReserveDestroyCoolTimeFinishEffect(DWORD dwSlotIndex);
|
||||
|
||||
protected:
|
||||
void __Initialize();
|
||||
void __CreateToggleSlotImage();
|
||||
void __CreateSlotEnableEffect();
|
||||
void __CreateFinishCoolTimeEffect(TSlot * pSlot);
|
||||
void __CreateBaseImage(const char * c_szFileName, float fr, float fg, float fb, float fa);
|
||||
|
||||
void __DestroyToggleSlotImage();
|
||||
void __DestroySlotEnableEffect();
|
||||
void __DestroyFinishCoolTimeEffect(TSlot * pSlot);
|
||||
void __DestroyBaseImage();
|
||||
|
||||
// Event
|
||||
void OnUpdate();
|
||||
void OnRender();
|
||||
BOOL OnMouseLeftButtonDown();
|
||||
BOOL OnMouseLeftButtonUp();
|
||||
BOOL OnMouseRightButtonDown();
|
||||
BOOL OnMouseLeftButtonDoubleClick();
|
||||
void OnMouseOverOut();
|
||||
void OnMouseOver();
|
||||
void RenderSlotBaseImage();
|
||||
void RenderLockedSlot();
|
||||
virtual void OnRenderPickingSlot();
|
||||
virtual void OnRenderSelectedSlot();
|
||||
|
||||
// Select
|
||||
void OnSelectEmptySlot(int iSlotNumber);
|
||||
void OnSelectItemSlot(int iSlotNumber);
|
||||
void OnUnselectEmptySlot(int iSlotNumber);
|
||||
void OnUnselectItemSlot(int iSlotNumber);
|
||||
void OnUseSlot();
|
||||
|
||||
// Manage Slot
|
||||
BOOL GetSlotPointer(DWORD dwIndex, TSlot ** ppSlot);
|
||||
BOOL GetSelectedSlotPointer(TSlot ** ppSlot);
|
||||
virtual BOOL GetPickedSlotPointer(TSlot ** ppSlot);
|
||||
void ClearSlot(TSlot * pSlot);
|
||||
virtual void OnRefreshSlot();
|
||||
|
||||
// ETC
|
||||
BOOL OnIsType(DWORD dwType);
|
||||
|
||||
protected:
|
||||
DWORD m_dwSlotType;
|
||||
DWORD m_dwSlotStyle;
|
||||
std::list<DWORD> m_dwSelectedSlotIndexList;
|
||||
TSlotList m_SlotList;
|
||||
DWORD m_dwToolTipSlotNumber;
|
||||
|
||||
BOOL m_isUseMode;
|
||||
BOOL m_isUsableItem;
|
||||
|
||||
CGraphicImageInstance * m_pBaseImageInstance;
|
||||
CImageBox * m_pToggleSlotImage;
|
||||
CAniImageBox * m_pSlotActiveEffect;
|
||||
std::deque<DWORD> m_ReserveDestroyEffectDeque;
|
||||
};
|
||||
};
|
2024
src/EterPythonLib/PythonWindow.cpp
Normal file
2024
src/EterPythonLib/PythonWindow.cpp
Normal file
File diff suppressed because it is too large
Load Diff
525
src/EterPythonLib/PythonWindow.h
Normal file
525
src/EterPythonLib/PythonWindow.h
Normal file
@ -0,0 +1,525 @@
|
||||
#pragma once
|
||||
|
||||
#include "../eterBase/Utils.h"
|
||||
|
||||
namespace UI
|
||||
{
|
||||
class CWindow
|
||||
{
|
||||
public:
|
||||
typedef std::list<CWindow *> TWindowContainer;
|
||||
|
||||
static DWORD Type();
|
||||
BOOL IsType(DWORD dwType);
|
||||
|
||||
enum EHorizontalAlign
|
||||
{
|
||||
HORIZONTAL_ALIGN_LEFT = 0,
|
||||
HORIZONTAL_ALIGN_CENTER = 1,
|
||||
HORIZONTAL_ALIGN_RIGHT = 2,
|
||||
};
|
||||
|
||||
enum EVerticalAlign
|
||||
{
|
||||
VERTICAL_ALIGN_TOP = 0,
|
||||
VERTICAL_ALIGN_CENTER = 1,
|
||||
VERTICAL_ALIGN_BOTTOM = 2,
|
||||
};
|
||||
|
||||
enum EFlags
|
||||
{
|
||||
FLAG_MOVABLE = (1 << 0), // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ִ<EFBFBD> â
|
||||
FLAG_LIMIT = (1 << 1), // â<><C3A2> ȭ<><C8AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EEB3AA> <20><><EFBFBD><EFBFBD>
|
||||
FLAG_SNAP = (1 << 2), // <20><><EFBFBD><EFBFBD> <20><> <20><> <20>ִ<EFBFBD> â
|
||||
FLAG_DRAGABLE = (1 << 3),
|
||||
FLAG_ATTACH = (1 << 4), // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>θ<EFBFBD><CEB8><EFBFBD> <20>پ<EFBFBD> <20>ִ<EFBFBD> â (For Drag / ex. ScriptWindow)
|
||||
FLAG_RESTRICT_X = (1 << 5), // <20>¿<EFBFBD> <20>̵<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
FLAG_RESTRICT_Y = (1 << 6), // <20><><EFBFBD><EFBFBD> <20>̵<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
FLAG_NOT_CAPTURE = (1 << 7),
|
||||
FLAG_FLOAT = (1 << 8), // <20><><EFBFBD>߿<EFBFBD> <20><><EFBFBD>־ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ġ<EFBFBD><C4A1> <20>Ǵ<EFBFBD> â
|
||||
FLAG_NOT_PICK = (1 << 9), // <20><><EFBFBD>콺<EFBFBD><ECBDBA> <20><><EFBFBD><EFBFBD> Pick<63><6B><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> â
|
||||
FLAG_IGNORE_SIZE = (1 << 10),
|
||||
FLAG_RTL = (1 << 11), // Right-to-left
|
||||
};
|
||||
|
||||
public:
|
||||
CWindow(PyObject * ppyObject);
|
||||
virtual ~CWindow();
|
||||
|
||||
void AddChild(CWindow * pWin);
|
||||
|
||||
void Clear();
|
||||
void DestroyHandle();
|
||||
void Update();
|
||||
void Render();
|
||||
|
||||
void SetName(const char * c_szName);
|
||||
const char * GetName() { return m_strName.c_str(); }
|
||||
void SetSize(long width, long height);
|
||||
long GetWidth() { return m_lWidth; }
|
||||
long GetHeight() { return m_lHeight; }
|
||||
|
||||
void SetHorizontalAlign(DWORD dwAlign);
|
||||
void SetVerticalAlign(DWORD dwAlign);
|
||||
void SetPosition(long x, long y);
|
||||
void GetPosition(long * plx, long * ply);
|
||||
long GetPositionX( void ) const { return m_x; }
|
||||
long GetPositionY( void ) const { return m_y; }
|
||||
RECT & GetRect() { return m_rect; }
|
||||
void GetLocalPosition(long & rlx, long & rly);
|
||||
void GetMouseLocalPosition(long & rlx, long & rly);
|
||||
long UpdateRect();
|
||||
|
||||
RECT & GetLimitBias() { return m_limitBiasRect; }
|
||||
void SetLimitBias(long l, long r, long t, long b) { m_limitBiasRect.left = l, m_limitBiasRect.right = r, m_limitBiasRect.top = t, m_limitBiasRect.bottom = b; }
|
||||
|
||||
void Show();
|
||||
void Hide();
|
||||
bool IsShow() { return m_bShow; }
|
||||
bool IsRendering();
|
||||
|
||||
bool HasParent() { return m_pParent ? true : false; }
|
||||
bool HasChild() { return m_pChildList.empty() ? false : true; }
|
||||
int GetChildCount() { return m_pChildList.size(); }
|
||||
|
||||
CWindow * GetRoot();
|
||||
CWindow * GetParent();
|
||||
bool IsChild(CWindow * pWin);
|
||||
void DeleteChild(CWindow * pWin);
|
||||
void SetTop(CWindow * pWin);
|
||||
|
||||
bool IsIn(long x, long y);
|
||||
bool IsIn();
|
||||
CWindow * PickWindow(long x, long y);
|
||||
CWindow * PickTopWindow(long x, long y); // NOTE : Children<65><6E><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// üũ <20>ϴ<EFBFBD> Ưȭ<C6AF><C8AD> <20>Լ<EFBFBD>
|
||||
|
||||
void __RemoveReserveChildren();
|
||||
|
||||
void AddFlag(DWORD flag) { SET_BIT(m_dwFlag, flag); }
|
||||
void RemoveFlag(DWORD flag) { REMOVE_BIT(m_dwFlag, flag); }
|
||||
bool IsFlag(DWORD flag) { return (m_dwFlag & flag) ? true : false; }
|
||||
/////////////////////////////////////
|
||||
|
||||
virtual void OnRender();
|
||||
virtual void OnUpdate();
|
||||
virtual void OnChangePosition(){}
|
||||
|
||||
virtual void OnSetFocus();
|
||||
virtual void OnKillFocus();
|
||||
|
||||
virtual void OnMouseDrag(long lx, long ly);
|
||||
virtual void OnMouseOverIn();
|
||||
virtual void OnMouseOverOut();
|
||||
virtual void OnMouseOver();
|
||||
virtual void OnDrop();
|
||||
virtual void OnTop();
|
||||
virtual void OnIMEUpdate();
|
||||
|
||||
virtual void OnMoveWindow(long x, long y);
|
||||
|
||||
///////////////////////////////////////
|
||||
|
||||
BOOL RunIMETabEvent();
|
||||
BOOL RunIMEReturnEvent();
|
||||
BOOL RunIMEKeyDownEvent(int ikey);
|
||||
|
||||
CWindow * RunKeyDownEvent(int ikey);
|
||||
BOOL RunKeyUpEvent(int ikey);
|
||||
BOOL RunPressEscapeKeyEvent();
|
||||
BOOL RunPressExitKeyEvent();
|
||||
|
||||
virtual BOOL OnIMETabEvent();
|
||||
virtual BOOL OnIMEReturnEvent();
|
||||
virtual BOOL OnIMEKeyDownEvent(int ikey);
|
||||
|
||||
virtual BOOL OnIMEChangeCodePage();
|
||||
virtual BOOL OnIMEOpenCandidateListEvent();
|
||||
virtual BOOL OnIMECloseCandidateListEvent();
|
||||
virtual BOOL OnIMEOpenReadingWndEvent();
|
||||
virtual BOOL OnIMECloseReadingWndEvent();
|
||||
|
||||
virtual BOOL OnMouseLeftButtonDown();
|
||||
virtual BOOL OnMouseLeftButtonUp();
|
||||
virtual BOOL OnMouseLeftButtonDoubleClick();
|
||||
virtual BOOL OnMouseRightButtonDown();
|
||||
virtual BOOL OnMouseRightButtonUp();
|
||||
virtual BOOL OnMouseRightButtonDoubleClick();
|
||||
virtual BOOL OnMouseMiddleButtonDown();
|
||||
virtual BOOL OnMouseMiddleButtonUp();
|
||||
|
||||
virtual BOOL OnKeyDown(int ikey);
|
||||
virtual BOOL OnKeyUp(int ikey);
|
||||
virtual BOOL OnPressEscapeKey();
|
||||
virtual BOOL OnPressExitKey();
|
||||
///////////////////////////////////////
|
||||
|
||||
virtual void SetColor(DWORD dwColor){}
|
||||
virtual BOOL OnIsType(DWORD dwType);
|
||||
/////////////////////////////////////
|
||||
|
||||
virtual BOOL IsWindow() { return TRUE; }
|
||||
/////////////////////////////////////
|
||||
|
||||
protected:
|
||||
std::string m_strName;
|
||||
|
||||
EHorizontalAlign m_HorizontalAlign;
|
||||
EVerticalAlign m_VerticalAlign;
|
||||
long m_x, m_y; // X,Y <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ
|
||||
long m_lWidth, m_lHeight; // ũ<><C5A9>
|
||||
RECT m_rect; // Global <20><>ǥ
|
||||
RECT m_limitBiasRect; // limit bias <20><>
|
||||
|
||||
bool m_bMovable;
|
||||
bool m_bShow;
|
||||
|
||||
DWORD m_dwFlag;
|
||||
|
||||
PyObject * m_poHandler;
|
||||
|
||||
CWindow * m_pParent;
|
||||
TWindowContainer m_pChildList;
|
||||
|
||||
BOOL m_isUpdatingChildren;
|
||||
TWindowContainer m_pReserveChildList;
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
DWORD DEBUG_dwCounter;
|
||||
#endif
|
||||
};
|
||||
|
||||
class CLayer : public CWindow
|
||||
{
|
||||
public:
|
||||
CLayer(PyObject * ppyObject) : CWindow(ppyObject) {}
|
||||
virtual ~CLayer() {}
|
||||
|
||||
BOOL IsWindow() { return FALSE; }
|
||||
};
|
||||
|
||||
class CBox : public CWindow
|
||||
{
|
||||
public:
|
||||
CBox(PyObject * ppyObject);
|
||||
virtual ~CBox();
|
||||
|
||||
void SetColor(DWORD dwColor);
|
||||
|
||||
protected:
|
||||
void OnRender();
|
||||
|
||||
protected:
|
||||
DWORD m_dwColor;
|
||||
};
|
||||
|
||||
class CBar : public CWindow
|
||||
{
|
||||
public:
|
||||
CBar(PyObject * ppyObject);
|
||||
virtual ~CBar();
|
||||
|
||||
void SetColor(DWORD dwColor);
|
||||
|
||||
protected:
|
||||
void OnRender();
|
||||
|
||||
protected:
|
||||
DWORD m_dwColor;
|
||||
};
|
||||
|
||||
class CLine : public CWindow
|
||||
{
|
||||
public:
|
||||
CLine(PyObject * ppyObject);
|
||||
virtual ~CLine();
|
||||
|
||||
void SetColor(DWORD dwColor);
|
||||
|
||||
protected:
|
||||
void OnRender();
|
||||
|
||||
protected:
|
||||
DWORD m_dwColor;
|
||||
};
|
||||
|
||||
class CBar3D : public CWindow
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
|
||||
public:
|
||||
CBar3D(PyObject * ppyObject);
|
||||
virtual ~CBar3D();
|
||||
|
||||
void SetColor(DWORD dwLeft, DWORD dwRight, DWORD dwCenter);
|
||||
|
||||
protected:
|
||||
void OnRender();
|
||||
|
||||
protected:
|
||||
DWORD m_dwLeftColor;
|
||||
DWORD m_dwRightColor;
|
||||
DWORD m_dwCenterColor;
|
||||
};
|
||||
|
||||
// Text
|
||||
class CTextLine : public CWindow
|
||||
{
|
||||
public:
|
||||
CTextLine(PyObject * ppyObject);
|
||||
virtual ~CTextLine();
|
||||
|
||||
void SetMax(int iMax);
|
||||
void SetHorizontalAlign(int iType);
|
||||
void SetVerticalAlign(int iType);
|
||||
void SetSecret(BOOL bFlag);
|
||||
void SetOutline(BOOL bFlag);
|
||||
void SetFeather(BOOL bFlag);
|
||||
void SetMultiLine(BOOL bFlag);
|
||||
void SetFontName(const char * c_szFontName);
|
||||
void SetFontColor(DWORD dwColor);
|
||||
void SetLimitWidth(float fWidth);
|
||||
|
||||
void ShowCursor();
|
||||
void HideCursor();
|
||||
int GetCursorPosition();
|
||||
|
||||
void SetText(const char * c_szText);
|
||||
const char * GetText();
|
||||
|
||||
void GetTextSize(int* pnWidth, int* pnHeight);
|
||||
|
||||
protected:
|
||||
void OnUpdate();
|
||||
void OnRender();
|
||||
void OnChangePosition();
|
||||
|
||||
virtual void OnSetText(const char * c_szText);
|
||||
|
||||
protected:
|
||||
CGraphicTextInstance m_TextInstance;
|
||||
};
|
||||
|
||||
class CNumberLine : public CWindow
|
||||
{
|
||||
public:
|
||||
CNumberLine(PyObject * ppyObject);
|
||||
CNumberLine(CWindow * pParent);
|
||||
virtual ~CNumberLine();
|
||||
|
||||
void SetPath(const char * c_szPath);
|
||||
void SetHorizontalAlign(int iType);
|
||||
void SetNumber(const char * c_szNumber);
|
||||
|
||||
protected:
|
||||
void ClearNumber();
|
||||
void OnRender();
|
||||
void OnChangePosition();
|
||||
|
||||
protected:
|
||||
std::string m_strPath;
|
||||
std::string m_strNumber;
|
||||
std::vector<CGraphicImageInstance *> m_ImageInstanceVector;
|
||||
|
||||
int m_iHorizontalAlign;
|
||||
DWORD m_dwWidthSummary;
|
||||
};
|
||||
|
||||
// Image
|
||||
class CImageBox : public CWindow
|
||||
{
|
||||
public:
|
||||
CImageBox(PyObject * ppyObject);
|
||||
virtual ~CImageBox();
|
||||
|
||||
BOOL LoadImage(const char * c_szFileName);
|
||||
void SetDiffuseColor(float fr, float fg, float fb, float fa);
|
||||
|
||||
int GetWidth();
|
||||
int GetHeight();
|
||||
|
||||
protected:
|
||||
virtual void OnCreateInstance();
|
||||
virtual void OnDestroyInstance();
|
||||
|
||||
virtual void OnUpdate();
|
||||
virtual void OnRender();
|
||||
void OnChangePosition();
|
||||
|
||||
protected:
|
||||
CGraphicImageInstance * m_pImageInstance;
|
||||
};
|
||||
class CMarkBox : public CWindow
|
||||
{
|
||||
public:
|
||||
CMarkBox(PyObject * ppyObject);
|
||||
virtual ~CMarkBox();
|
||||
|
||||
void LoadImage(const char * c_szFilename);
|
||||
void SetDiffuseColor(float fr, float fg, float fb, float fa);
|
||||
void SetIndex(UINT uIndex);
|
||||
void SetScale(FLOAT fScale);
|
||||
|
||||
protected:
|
||||
virtual void OnCreateInstance();
|
||||
virtual void OnDestroyInstance();
|
||||
|
||||
virtual void OnUpdate();
|
||||
virtual void OnRender();
|
||||
void OnChangePosition();
|
||||
protected:
|
||||
CGraphicMarkInstance * m_pMarkInstance;
|
||||
};
|
||||
class CExpandedImageBox : public CImageBox
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
|
||||
public:
|
||||
CExpandedImageBox(PyObject * ppyObject);
|
||||
virtual ~CExpandedImageBox();
|
||||
|
||||
void SetScale(float fx, float fy);
|
||||
void SetOrigin(float fx, float fy);
|
||||
void SetRotation(float fRotation);
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom);
|
||||
void SetRenderingMode(int iMode);
|
||||
|
||||
protected:
|
||||
void OnCreateInstance();
|
||||
void OnDestroyInstance();
|
||||
|
||||
virtual void OnUpdate();
|
||||
virtual void OnRender();
|
||||
|
||||
BOOL OnIsType(DWORD dwType);
|
||||
};
|
||||
class CAniImageBox : public CWindow
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
|
||||
public:
|
||||
CAniImageBox(PyObject * ppyObject);
|
||||
virtual ~CAniImageBox();
|
||||
|
||||
void SetDelay(int iDelay);
|
||||
void AppendImage(const char * c_szFileName);
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom);
|
||||
void SetRenderingMode(int iMode);
|
||||
|
||||
void ResetFrame();
|
||||
|
||||
protected:
|
||||
void OnUpdate();
|
||||
void OnRender();
|
||||
void OnChangePosition();
|
||||
virtual void OnEndFrame();
|
||||
|
||||
BOOL OnIsType(DWORD dwType);
|
||||
|
||||
protected:
|
||||
BYTE m_bycurDelay;
|
||||
BYTE m_byDelay;
|
||||
BYTE m_bycurIndex;
|
||||
std::vector<CGraphicExpandedImageInstance*> m_ImageVector;
|
||||
};
|
||||
|
||||
// Button
|
||||
class CButton : public CWindow
|
||||
{
|
||||
public:
|
||||
CButton(PyObject * ppyObject);
|
||||
virtual ~CButton();
|
||||
|
||||
BOOL SetUpVisual(const char * c_szFileName);
|
||||
BOOL SetOverVisual(const char * c_szFileName);
|
||||
BOOL SetDownVisual(const char * c_szFileName);
|
||||
BOOL SetDisableVisual(const char * c_szFileName);
|
||||
|
||||
const char * GetUpVisualFileName();
|
||||
const char * GetOverVisualFileName();
|
||||
const char * GetDownVisualFileName();
|
||||
|
||||
void Flash();
|
||||
void Enable();
|
||||
void Disable();
|
||||
|
||||
void SetUp();
|
||||
void Up();
|
||||
void Over();
|
||||
void Down();
|
||||
|
||||
BOOL IsDisable();
|
||||
BOOL IsPressed();
|
||||
|
||||
protected:
|
||||
void OnUpdate();
|
||||
void OnRender();
|
||||
void OnChangePosition();
|
||||
|
||||
BOOL OnMouseLeftButtonDown();
|
||||
BOOL OnMouseLeftButtonDoubleClick();
|
||||
BOOL OnMouseLeftButtonUp();
|
||||
void OnMouseOverIn();
|
||||
void OnMouseOverOut();
|
||||
|
||||
BOOL IsEnable();
|
||||
|
||||
void SetCurrentVisual(CGraphicImageInstance * pVisual);
|
||||
|
||||
protected:
|
||||
BOOL m_bEnable;
|
||||
BOOL m_isPressed;
|
||||
BOOL m_isFlash;
|
||||
CGraphicImageInstance * m_pcurVisual;
|
||||
CGraphicImageInstance m_upVisual;
|
||||
CGraphicImageInstance m_overVisual;
|
||||
CGraphicImageInstance m_downVisual;
|
||||
CGraphicImageInstance m_disableVisual;
|
||||
};
|
||||
class CRadioButton : public CButton
|
||||
{
|
||||
public:
|
||||
CRadioButton(PyObject * ppyObject);
|
||||
virtual ~CRadioButton();
|
||||
|
||||
protected:
|
||||
BOOL OnMouseLeftButtonDown();
|
||||
BOOL OnMouseLeftButtonUp();
|
||||
void OnMouseOverIn();
|
||||
void OnMouseOverOut();
|
||||
};
|
||||
class CToggleButton : public CButton
|
||||
{
|
||||
public:
|
||||
CToggleButton(PyObject * ppyObject);
|
||||
virtual ~CToggleButton();
|
||||
|
||||
protected:
|
||||
BOOL OnMouseLeftButtonDown();
|
||||
BOOL OnMouseLeftButtonUp();
|
||||
void OnMouseOverIn();
|
||||
void OnMouseOverOut();
|
||||
};
|
||||
class CDragButton : public CButton
|
||||
{
|
||||
public:
|
||||
CDragButton(PyObject * ppyObject);
|
||||
virtual ~CDragButton();
|
||||
|
||||
void SetRestrictMovementArea(int ix, int iy, int iwidth, int iheight);
|
||||
|
||||
protected:
|
||||
void OnChangePosition();
|
||||
void OnMouseOverIn();
|
||||
void OnMouseOverOut();
|
||||
|
||||
protected:
|
||||
RECT m_restrictArea;
|
||||
};
|
||||
};
|
||||
|
||||
extern BOOL g_bOutlineBoxEnable;
|
1255
src/EterPythonLib/PythonWindowManager.cpp
Normal file
1255
src/EterPythonLib/PythonWindowManager.cpp
Normal file
File diff suppressed because it is too large
Load Diff
187
src/EterPythonLib/PythonWindowManager.h
Normal file
187
src/EterPythonLib/PythonWindowManager.h
Normal file
@ -0,0 +1,187 @@
|
||||
#pragma once
|
||||
|
||||
namespace UI
|
||||
{
|
||||
class CWindow;
|
||||
|
||||
class CWindowManager : public CSingleton<CWindowManager>
|
||||
{
|
||||
public:
|
||||
typedef std::map<std::string, CWindow *> TLayerContainer;
|
||||
typedef std::list<CWindow *> TWindowContainer;
|
||||
typedef std::map<int, CWindow *> TKeyCaptureWindowMap;
|
||||
|
||||
public:
|
||||
CWindowManager();
|
||||
virtual ~CWindowManager();
|
||||
|
||||
void Destroy();
|
||||
|
||||
float GetAspect();
|
||||
void SetScreenSize(long lWidth, long lHeight);
|
||||
void SetResolution(int hres, int vres);
|
||||
|
||||
void GetResolution(long & rx, long & ry)
|
||||
{
|
||||
rx=m_iHres;
|
||||
ry=m_iVres;
|
||||
}
|
||||
|
||||
void SetMouseHandler(PyObject * poMouseHandler);
|
||||
long GetScreenWidth() { return m_lWidth; }
|
||||
long GetScreenHeight() { return m_lHeight; }
|
||||
void GetMousePosition(long & rx, long & ry);
|
||||
BOOL IsDragging();
|
||||
|
||||
CWindow * GetLockWindow() { return m_pLockWindow; }
|
||||
CWindow * GetPointWindow() { return m_pPointWindow; }
|
||||
bool IsFocus() { return (m_pActiveWindow || m_pLockWindow); }
|
||||
bool IsFocusWindow(CWindow * pWindow) { return pWindow == m_pActiveWindow; }
|
||||
|
||||
void SetParent(CWindow * pWindow, CWindow * pParentWindow);
|
||||
void SetPickAlways(CWindow * pWindow);
|
||||
|
||||
enum
|
||||
{
|
||||
WT_NORMAL,
|
||||
WT_SLOT,
|
||||
WT_GRIDSLOT,
|
||||
WT_TEXTLINE,
|
||||
WT_MARKBOX,
|
||||
WT_IMAGEBOX,
|
||||
WT_EXP_IMAGEBOX,
|
||||
WT_ANI_IMAGEBOX,
|
||||
WT_BUTTON,
|
||||
WT_RATIOBUTTON,
|
||||
WT_TOGGLEBUTTON,
|
||||
WT_DRAGBUTTON,
|
||||
WT_BOX,
|
||||
WT_BAR,
|
||||
WT_LINE,
|
||||
WT_BAR3D,
|
||||
WT_NUMLINE,
|
||||
};
|
||||
|
||||
CWindow * RegisterWindow(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterTypeWindow(PyObject * po, DWORD dwWndType, const char * c_szLayer);
|
||||
|
||||
CWindow * RegisterSlotWindow(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterGridSlotWindow(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterTextLine(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterMarkBox(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterImageBox(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterExpandedImageBox(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterAniImageBox(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterButton(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterRadioButton(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterToggleButton(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterDragButton(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterBox(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterBar(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterLine(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterBar3D(PyObject * po, const char * c_szLayer);
|
||||
CWindow * RegisterNumberLine(PyObject * po, const char * c_szLayer);
|
||||
|
||||
void DestroyWindow(CWindow * pWin);
|
||||
void NotifyDestroyWindow(CWindow * pWindow);
|
||||
|
||||
// Attaching Icon
|
||||
BOOL IsAttaching();
|
||||
DWORD GetAttachingType();
|
||||
DWORD GetAttachingIndex();
|
||||
DWORD GetAttachingSlotNumber();
|
||||
void GetAttachingIconSize(BYTE * pbyWidth, BYTE * pbyHeight);
|
||||
void AttachIcon(DWORD dwType, DWORD dwIndex, DWORD dwSlotNumber, BYTE byWidth, BYTE byHeight);
|
||||
void DeattachIcon();
|
||||
void SetAttachingFlag(BOOL bFlag);
|
||||
// Attaching Icon
|
||||
|
||||
void OnceIgnoreMouseLeftButtonUpEvent();
|
||||
void LockWindow(CWindow * pWin);
|
||||
void UnlockWindow();
|
||||
|
||||
void ActivateWindow(CWindow * pWin);
|
||||
void DeactivateWindow();
|
||||
CWindow * GetActivateWindow();
|
||||
void SetTop(CWindow * pWin);
|
||||
void SetTopUIWindow();
|
||||
void ResetCapture();
|
||||
|
||||
void Update();
|
||||
void Render();
|
||||
|
||||
void RunMouseMove(long x, long y);
|
||||
void RunMouseLeftButtonDown(long x, long y);
|
||||
void RunMouseLeftButtonUp(long x, long y);
|
||||
void RunMouseLeftButtonDoubleClick(long x, long y);
|
||||
void RunMouseRightButtonDown(long x, long y);
|
||||
void RunMouseRightButtonUp(long x, long y);
|
||||
void RunMouseRightButtonDoubleClick(long x, long y);
|
||||
void RunMouseMiddleButtonDown(long x, long y);
|
||||
void RunMouseMiddleButtonUp(long x, long y);
|
||||
|
||||
void RunIMEUpdate();
|
||||
void RunIMETabEvent();
|
||||
void RunIMEReturnEvent();
|
||||
void RunIMEKeyDown(int vkey);
|
||||
void RunChangeCodePage();
|
||||
void RunOpenCandidate();
|
||||
void RunCloseCandidate();
|
||||
void RunOpenReading();
|
||||
void RunCloseReading();
|
||||
|
||||
void RunKeyDown(int vkey);
|
||||
void RunKeyUp(int vkey);
|
||||
void RunPressEscapeKey();
|
||||
void RunPressExitKey();
|
||||
|
||||
private:
|
||||
void SetMousePosition(long x, long y);
|
||||
CWindow * __PickWindow(long x, long y);
|
||||
|
||||
CWindow * __NewWindow(PyObject * po, DWORD dwWndType);
|
||||
void __ClearReserveDeleteWindowList();
|
||||
|
||||
private:
|
||||
long m_lWidth;
|
||||
long m_lHeight;
|
||||
|
||||
int m_iVres;
|
||||
int m_iHres;
|
||||
|
||||
long m_lMouseX, m_lMouseY;
|
||||
long m_lDragX, m_lDragY;
|
||||
long m_lPickedX, m_lPickedY;
|
||||
|
||||
BOOL m_bOnceIgnoreMouseLeftButtonUpEventFlag;
|
||||
int m_iIgnoreEndTime;
|
||||
|
||||
// Attaching Icon
|
||||
PyObject * m_poMouseHandler;
|
||||
BOOL m_bAttachingFlag;
|
||||
DWORD m_dwAttachingType;
|
||||
DWORD m_dwAttachingIndex;
|
||||
DWORD m_dwAttachingSlotNumber;
|
||||
BYTE m_byAttachingIconWidth;
|
||||
BYTE m_byAttachingIconHeight;
|
||||
// Attaching Icon
|
||||
|
||||
CWindow * m_pActiveWindow;
|
||||
TWindowContainer m_ActiveWindowList;
|
||||
CWindow * m_pLockWindow;
|
||||
TWindowContainer m_LockWindowList;
|
||||
CWindow * m_pPointWindow;
|
||||
CWindow * m_pLeftCaptureWindow;
|
||||
CWindow * m_pRightCaptureWindow;
|
||||
CWindow * m_pMiddleCaptureWindow;
|
||||
TKeyCaptureWindowMap m_KeyCaptureWindowMap;
|
||||
TWindowContainer m_ReserveDeleteWindowList;
|
||||
TWindowContainer m_PickAlwaysWindowList;
|
||||
|
||||
CWindow * m_pRootWindow;
|
||||
TWindowContainer m_LayerWindowList;
|
||||
TLayerContainer m_LayerWindowMap;
|
||||
};
|
||||
|
||||
PyObject * BuildEmptyTuple();
|
||||
};
|
2522
src/EterPythonLib/PythonWindowManagerModule.cpp
Normal file
2522
src/EterPythonLib/PythonWindowManagerModule.cpp
Normal file
File diff suppressed because it is too large
Load Diff
6
src/EterPythonLib/StdAfx.cpp
Normal file
6
src/EterPythonLib/StdAfx.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// eterPythonLib.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
17
src/EterPythonLib/StdAfx.h
Normal file
17
src/EterPythonLib/StdAfx.h
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#include "../EterLib/StdAfx.h"
|
||||
#include "../ScriptLib/StdAfx.h"
|
||||
|
||||
#include "PythonGraphic.h"
|
||||
#include "PythonWindowManager.h"
|
||||
|
||||
void initgrp();
|
||||
void initgrpImage();
|
||||
void initgrpText();
|
||||
void initgrpThing();
|
||||
void initscriptWindow();
|
||||
void initwndMgr();
|
Reference in New Issue
Block a user