Compare commits
87 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44a80184b3 | ||
|
|
061fc1e564 | ||
|
|
796a47ad38 | ||
|
|
f6110fa3a3 | ||
|
|
0120bc857d | ||
|
|
78fcebd1fc | ||
|
|
706d16f9c3 | ||
|
|
111cc7cd01 | ||
|
|
8817712cc3 | ||
|
|
522a926965 | ||
|
|
f5d42a3b92 | ||
|
|
6f7fbdae2f | ||
|
|
943ce9a5eb | ||
|
|
6bfbc4a97e | ||
|
|
f5b31d8e99 | ||
|
|
4336140b90 | ||
|
|
cb6eb4653d | ||
|
|
43327b8974 | ||
|
|
8e48115d37 | ||
|
|
d2bdd4e124 | ||
|
|
c1431c8dff | ||
|
|
cc0c195c0b | ||
|
|
3c415e7297 | ||
|
|
5d96985667 | ||
|
|
03ab7122c3 | ||
|
|
a75f7bf381 | ||
|
|
00b165c208 | ||
|
|
2a17185cc0 | ||
|
|
b7f2b8f5a7 | ||
|
|
fd3679fb6b | ||
|
|
e37ad4879e | ||
|
|
20bf032f1e | ||
|
|
eb2766304a | ||
|
|
e914126c87 | ||
|
|
48f3455b53 | ||
|
|
0b8847cd8e | ||
|
|
4ec70e6ee7 | ||
|
|
c6699b5112 | ||
|
|
48b90b1a93 | ||
|
|
c70d39fb25 | ||
|
|
1b34573b06 | ||
|
|
649a1aaa06 | ||
|
|
6b8ca28060 | ||
|
|
dc7f7f3cc5 | ||
|
|
575f5dab46 | ||
|
|
efbc832321 | ||
|
|
2471abb8dd | ||
|
|
57db5511bd | ||
|
|
0ac516618a | ||
|
|
8916797e55 | ||
|
|
2dc7f3e667 | ||
|
|
d32b0ea4e4 | ||
|
|
af5c31d5d0 | ||
|
|
9df862f72e | ||
|
|
d269b360ce | ||
|
|
d2dd05b620 | ||
|
|
9d62380df9 | ||
|
|
8f3d12c516 | ||
|
|
d2f3e718a7 | ||
|
|
adade066cc | ||
|
|
7e9f34e1ac | ||
|
|
5e74564956 | ||
|
|
04823f5911 | ||
|
|
e62d3ab49c | ||
|
|
fb5d6495dc | ||
|
|
5078b849b0 | ||
|
|
20e772f932 | ||
|
|
00e61d4f17 | ||
|
|
fe55127129 | ||
|
|
e8dbf50df9 | ||
|
|
6ee7d76859 | ||
|
|
8a2b7f6308 | ||
|
|
415ea71664 | ||
|
|
eefb981993 | ||
|
|
9f741e0df7 | ||
|
|
e2d75ae4d4 | ||
|
|
52c2f114a5 | ||
|
|
7f8cdc0f33 | ||
|
|
36153c293b | ||
|
|
a63aa52108 | ||
|
|
d25f4a6ba2 | ||
|
|
b7ed5bd832 | ||
|
|
7a89ddd94e | ||
|
|
c1118489e3 | ||
|
|
71fda54338 | ||
|
|
a456ee6196 | ||
|
|
30ea19c5b0 |
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* text=false
|
||||||
4
.gitignore
vendored
@@ -39,6 +39,8 @@
|
|||||||
*.res
|
*.res
|
||||||
*.ilk
|
*.ilk
|
||||||
*.dep
|
*.dep
|
||||||
|
*.bin
|
||||||
|
*.7z
|
||||||
|
|
||||||
# ResEditor files
|
# ResEditor files
|
||||||
*.aps
|
*.aps
|
||||||
@@ -58,3 +60,5 @@ desktop.ini
|
|||||||
#Redist
|
#Redist
|
||||||
!Installer/Redist/*
|
!Installer/Redist/*
|
||||||
UpgradeLog.htm
|
UpgradeLog.htm
|
||||||
|
click_output.JPEG
|
||||||
|
click_output.PNG
|
||||||
|
|||||||
37
Blocks3D VS2003.sln
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Blocks3D", "Blocks3D VS2003.vcproj", "{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfiguration) = preSolution
|
||||||
|
Debug = Debug
|
||||||
|
Release = Release
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectDependencies) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfiguration) = postSolution
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug.ActiveCfg = Debug|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug.Build.0 = Debug|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release.ActiveCfg = Release|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Win32 = Debug|Win32
|
||||||
|
Release|Win32 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
20
Blocks3D VS2003.sln.old
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 7.10
|
||||||
|
# Visual C++ Express 2005
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Blocks3D", "Blocks3D VS2003.vcproj", "{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Win32 = Debug|Win32
|
||||||
|
Release|Win32 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
717
Blocks3D VS2003.vcproj
Normal file
@@ -0,0 +1,717 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="7.10"
|
||||||
|
Name="Blocks3D"
|
||||||
|
ProjectGUID="{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}"
|
||||||
|
RootNamespace="Blocks3D">
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"/>
|
||||||
|
</Platforms>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory=".\Release"
|
||||||
|
IntermediateDirectory=".\Release"
|
||||||
|
ConfigurationType="1"
|
||||||
|
UseOfMFC="0"
|
||||||
|
UseOfATL="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="3"
|
||||||
|
InlineFunctionExpansion="2"
|
||||||
|
EnableIntrinsicFunctions="TRUE"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
OmitFramePointers="TRUE"
|
||||||
|
WholeProgramOptimization="TRUE"
|
||||||
|
AdditionalIncludeDirectories="".\src\include""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;NO_SDL_MAIN;_ATL_STATIC_REGISTRY"
|
||||||
|
StringPooling="TRUE"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
EnableFunctionLevelLinking="TRUE"
|
||||||
|
RuntimeTypeInfo="TRUE"
|
||||||
|
PrecompiledHeaderFile=".\Release/Blocks3D.pch"
|
||||||
|
AssemblerListingLocation=".\Release/"
|
||||||
|
ObjectFile=".\Release/"
|
||||||
|
ProgramDataBaseFileName=".\Release/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies="Advapi32.lib Comctl32.lib Comdlg32.lib Shell32.lib ode.lib Ole32.lib"
|
||||||
|
OutputFile="./Blocks3D.exe"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
ProgramDatabaseFile=".\Release/Blocks3D.pdb"
|
||||||
|
SubSystem="2"
|
||||||
|
StackReserveSize="16777216"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
OptimizeForWindows98="2"
|
||||||
|
LinkTimeCodeGeneration="TRUE"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\Release/Blocks3D.tlb"
|
||||||
|
HeaderFileName=""/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="4105"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory=".\Debug"
|
||||||
|
IntermediateDirectory=".\Debug"
|
||||||
|
ConfigurationType="1"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2"
|
||||||
|
ManagedExtensions="FALSE">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=".\src\include"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_ATL_STATIC_REGISTRY;NO_SDL_MAIN"
|
||||||
|
MinimalRebuild="FALSE"
|
||||||
|
BasicRuntimeChecks="0"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
EnableFunctionLevelLinking="FALSE"
|
||||||
|
EnableEnhancedInstructionSet="0"
|
||||||
|
RuntimeTypeInfo="TRUE"
|
||||||
|
PrecompiledHeaderFile=".\Debug/Blocks3D.pch"
|
||||||
|
AssemblerListingLocation=".\Debug/"
|
||||||
|
ObjectFile=".\Debug/"
|
||||||
|
ProgramDataBaseFileName=".\Debug/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
DebugInformationFormat="3"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib Comdlg32.lib Shell32.lib Urlmon.lib ole32.lib oleaut32.lib uuid.lib oded.lib"
|
||||||
|
OutputFile="./Blocks3D-Debug.exe"
|
||||||
|
LinkIncremental="2"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories=""
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
ProgramDatabaseFile=".\Debug/Blocks3D.pdb"
|
||||||
|
SubSystem="1"
|
||||||
|
StackReserveSize="16777216"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\Debug/Blocks3D.tlb"
|
||||||
|
HeaderFileName=""/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="4105"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
<AssemblyReference
|
||||||
|
RelativePath="System.dll"/>
|
||||||
|
<AssemblyReference
|
||||||
|
RelativePath="System.Data.dll"/>
|
||||||
|
<AssemblyReference
|
||||||
|
RelativePath="System.Drawing.dll"/>
|
||||||
|
<AssemblyReference
|
||||||
|
RelativePath="System.Windows.Forms.dll"/>
|
||||||
|
<AssemblyReference
|
||||||
|
RelativePath="System.XML.dll"/>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Application.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\AudioPlayer.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\ax.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\BrowserCallHandler.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\CameraController.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\ErrorFunctions.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Globals.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\IEBrowser.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\IEDispatcher.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\main.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Mouse.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\propertyGrid.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\PropertyWindow.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Renderer.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\StringFunctions.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\TextureHandler.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\WindowFunctions.cpp">
|
||||||
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="Tool">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Tool\ArrowTool.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Tool\DraggerTool.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Tool\SurfaceTool.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Tool\Tool.cpp">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Listener">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Listener\ButtonListener.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Listener\CameraButtonListener.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Listener\DeleteListener.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Listener\GUDButtonListener.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Listener\MenuButtonListener.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Listener\ModeSelectionListener.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Listener\RotateButtonListener.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Listener\ToolbarListener.cpp">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="DataModelV2">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\DataModelInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\GroupInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\Instance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\LevelInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\LightingInstance.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\PartInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\PVInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\SelectionService.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\SoundInstance.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\SoundService.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ThumbnailGeneratorInstance.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\WorkspaceInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="Gui">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\BaseButtonInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\BaseGuiInstance.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\GuiRootInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\ImageButtonInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\TextButtonInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\ToggleImageButtonInstance.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
ObjectFile="$(IntDir)\$(InputName)1.obj"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="XplicitNgine">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\XplicitNgine\XplicitNgine.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Helpers">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\base64.cpp">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Application.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\AudioPlayer.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\ax.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\BrowserCallHandler.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\CameraController.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Enum.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\ErrorFunctions.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Faces.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Globals.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\IEBrowser.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\IEDispatcher.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Mouse.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\propertyGrid.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\PropertyWindow.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Renderer.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\resource.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\StringFunctions.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\TextureHandler.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\ToolEnum.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\versioning.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\VS2005CompatShim.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\win32Defines.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\WindowFunctions.h">
|
||||||
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="RapidXML">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\rapidxml\rapidxml.hpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\rapidxml\rapidxml_iterators.hpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\rapidxml\rapidxml_print.hpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\rapidxml\rapidxml_utils.hpp">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Listener">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Listener\ButtonListener.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Listener\CameraButtonListener.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Listener\DeleteListener.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Listener\GUDButtonListener.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Listener\MenuButtonListener.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Listener\ModeSelectionListener.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Listener\RotateButtonListener.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Listener\ToolbarListener.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModel\WorkspaceInstance.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Tool">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Tool\ArrowTool.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Tool\DraggerTool.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Tool\SurfaceTool.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Tool\Tool.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="DataModelV2">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\DataModelInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\GroupInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\Instance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\LevelInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\LightingInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\PartInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\PVInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\SelectionService.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\SoundInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\SoundService.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\ThumbnailGeneratorInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\WorkspaceInstance.h">
|
||||||
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="Gui">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\BaseButtonInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\BaseGuiInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\GuiRootInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\ImageButtonInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\TextButtonInstance.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\ToggleImageButtonInstance.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="XplicitNgine">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\XplicitNgine\XplicitNgine.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Helpers">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\base64.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resource Files"
|
||||||
|
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||||
|
<File
|
||||||
|
RelativePath=".\Dialogs.rc">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\icon1.ico">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Parts.bmp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\roblox_RN1_icon.ico">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
<Global
|
||||||
|
Name="RESOURCE_FILE"
|
||||||
|
Value="Dialogs.rc"/>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@@ -5,4 +5,9 @@
|
|||||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
|
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.6195" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
</assembly>
|
</assembly>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
OmitFramePointers="true"
|
OmitFramePointers="true"
|
||||||
WholeProgramOptimization="true"
|
WholeProgramOptimization="true"
|
||||||
AdditionalIncludeDirectories="".\src\include""
|
AdditionalIncludeDirectories="".\src\include""
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_ATL_STATIC_REGISTRY;NO_SDL_MAIN"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
EnableFunctionLevelLinking="true"
|
EnableFunctionLevelLinking="true"
|
||||||
@@ -154,8 +154,8 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories=""C:\libraries\ode-0.5\include\drawstuff";.\src\include"
|
AdditionalIncludeDirectories=".\src\include"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_ATL_STATIC_REGISTRY;NO_SDL_MAIN"
|
||||||
MinimalRebuild="false"
|
MinimalRebuild="false"
|
||||||
BasicRuntimeChecks="0"
|
BasicRuntimeChecks="0"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
@@ -185,6 +185,7 @@
|
|||||||
OutputFile="./Blocks3D-Debug.exe"
|
OutputFile="./Blocks3D-Debug.exe"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
|
AdditionalLibraryDirectories=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
ProgramDatabaseFile=".\Debug/Blocks3D.pdb"
|
ProgramDatabaseFile=".\Debug/Blocks3D.pdb"
|
||||||
SubSystem="1"
|
SubSystem="1"
|
||||||
@@ -321,6 +322,10 @@
|
|||||||
RelativePath=".\src\source\Tool\ArrowTool.cpp"
|
RelativePath=".\src\source\Tool\ArrowTool.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\Tool\DraggerTool.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\source\Tool\SurfaceTool.cpp"
|
RelativePath=".\src\source\Tool\SurfaceTool.cpp"
|
||||||
>
|
>
|
||||||
@@ -457,6 +462,10 @@
|
|||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\LightingInstance.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\source\DataModelV2\PartInstance.cpp"
|
RelativePath=".\src\source\DataModelV2\PartInstance.cpp"
|
||||||
>
|
>
|
||||||
@@ -502,7 +511,19 @@
|
|||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\source\DataModel\SelectionService.cpp"
|
RelativePath=".\src\source\DataModelV2\SelectionService.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\SoundInstance.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\source\DataModelV2\SoundService.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ThumbnailGeneratorInstance.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
@@ -655,14 +676,10 @@
|
|||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Properties"
|
Name="Helpers"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\source\Properties\BoolProperty.cpp"
|
RelativePath=".\src\source\base64.cpp"
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\source\Properties\Property.cpp"
|
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
@@ -747,6 +764,10 @@
|
|||||||
RelativePath=".\src\include\ToolEnum.h"
|
RelativePath=".\src\include\ToolEnum.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\versioning.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\include\VS2005CompatShim.h"
|
RelativePath=".\src\include\VS2005CompatShim.h"
|
||||||
>
|
>
|
||||||
@@ -826,6 +847,10 @@
|
|||||||
RelativePath=".\src\include\Tool\ArrowTool.h"
|
RelativePath=".\src\include\Tool\ArrowTool.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\Tool\DraggerTool.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\include\Tool\SurfaceTool.h"
|
RelativePath=".\src\include\Tool\SurfaceTool.h"
|
||||||
>
|
>
|
||||||
@@ -854,6 +879,10 @@
|
|||||||
RelativePath=".\src\include\DataModelV2\LevelInstance.h"
|
RelativePath=".\src\include\DataModelV2\LevelInstance.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\LightingInstance.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\include\DataModelV2\PartInstance.h"
|
RelativePath=".\src\include\DataModelV2\PartInstance.h"
|
||||||
>
|
>
|
||||||
@@ -866,6 +895,18 @@
|
|||||||
RelativePath=".\src\include\DataModelV2\SelectionService.h"
|
RelativePath=".\src\include\DataModelV2\SelectionService.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\SoundInstance.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\SoundService.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\include\DataModelV2\ThumbnailGeneratorInstance.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\include\DataModelV2\WorkspaceInstance.h"
|
RelativePath=".\src\include\DataModelV2\WorkspaceInstance.h"
|
||||||
>
|
>
|
||||||
@@ -908,14 +949,10 @@
|
|||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Properties"
|
Name="Helpers"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\include\Properties\BoolProperty.h"
|
RelativePath=".\src\include\base64.h"
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\include\Properties\Property.h"
|
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|||||||
VALUE "FileDescription", "Blocks 3D"
|
VALUE "FileDescription", "Blocks 3D"
|
||||||
VALUE "FileVersion", VER_STR(APP_VER_STRING)
|
VALUE "FileVersion", VER_STR(APP_VER_STRING)
|
||||||
VALUE "InternalName", "Blocks3D"
|
VALUE "InternalName", "Blocks3D"
|
||||||
VALUE "LegalCopyright", "Blocks3D Team - 2022"
|
VALUE "LegalCopyright", "Blocks3D Team 2018-2023"
|
||||||
VALUE "LegalTrademarks", ""
|
VALUE "LegalTrademarks", ""
|
||||||
VALUE "OriginalFilename", "Blocks3D.exe"
|
VALUE "OriginalFilename", "Blocks3D.exe"
|
||||||
VALUE "PrivateBuild", ""
|
VALUE "PrivateBuild", ""
|
||||||
|
|||||||
BIN
Installer/Redist/msvcp71.dll
Normal file
BIN
Installer/Redist/msvcr71.dll
Normal file
@@ -1,4 +1,5 @@
|
|||||||
;InnoSetupVersion=5.4.3
|
;InnoSetupVersion=5.4.3
|
||||||
|
;ONLY USE THIS IF YOU COMPILED WITH VISUAL STUDIO 2005!!!
|
||||||
#define AppVer GetFileVersion('..\Blocks3D.exe')
|
#define AppVer GetFileVersion('..\Blocks3D.exe')
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
@@ -21,9 +22,9 @@ Type: filesandordirs; Name: "{app}"
|
|||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "Redist\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion
|
Source: "Redist\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion
|
||||||
Source: "Redist\vcredist_x64.exe"; DestDir: "{tmp}"; Check: "IsWin64"; Flags: ignoreversion
|
;Source: "Redist\vcredist_x64.exe"; DestDir: "{tmp}"; Check: "IsWin64"; Flags: ignoreversion
|
||||||
Source: "..\content\*"; DestDir: "{app}\content"; Flags: ignoreversion recursesubdirs
|
Source: "..\content\*"; DestDir: "{app}\content"; Flags: ignoreversion recursesubdirs
|
||||||
Source: "..\SDL.DLL"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
;Source: "..\SDL.DLL"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
||||||
Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
||||||
|
|
||||||
[Registry]
|
[Registry]
|
||||||
@@ -31,7 +32,7 @@ Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
|||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{tmp}\vcredist_x86.exe"; Parameters: "/q"; Tasks: instvc;
|
Filename: "{tmp}\vcredist_x86.exe"; Parameters: "/q"; Tasks: instvc;
|
||||||
Filename: "{tmp}\vcredist_x64.exe"; Parameters: "/q"; Tasks: instvc; Check: "IsWin64";
|
;Filename: "{tmp}\vcredist_x64.exe"; Parameters: "/q"; Tasks: instvc; Check: "IsWin64";
|
||||||
Filename: "iexplore.exe"; Parameters: "http://www.blocks3d.com/FirstInstall"; Description: Start playing Blocks3D; Flags: shellexec postinstall nowait skipifsilent
|
Filename: "iexplore.exe"; Parameters: "http://www.blocks3d.com/FirstInstall"; Description: Start playing Blocks3D; Flags: shellexec postinstall nowait skipifsilent
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
|
|||||||
52
Installer/install_script_floppy.iss
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
;InnoSetupVersion=5.4.3
|
||||||
|
;ONLY USE THIS IF YOU COMPILED WITH VISUAL STUDIO 2005!!!
|
||||||
|
#define AppVer GetFileVersion('..\Blocks3D.exe')
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
AppName=Blocks3D
|
||||||
|
AppVersion=v{#AppVer}
|
||||||
|
AppId={{4C5DF268-0208-4CDE-A7F0-65F7E2CB5067}
|
||||||
|
AppPublisherURL=http://blocks3d.com/
|
||||||
|
AppSupportURL=http://blocks3d.com/
|
||||||
|
AppUpdatesURL=http://blocks3d.com/
|
||||||
|
DefaultDirName={%localappdata}\Blocks3D
|
||||||
|
OutputBaseFilename=B3DSTP
|
||||||
|
Compression=lzma2
|
||||||
|
PrivilegesRequired=lowest
|
||||||
|
WizardImageFile=setup.bmp
|
||||||
|
DefaultGroupName=Blocks3D
|
||||||
|
DiskSpanning=yes
|
||||||
|
SlicesPerDisk=1
|
||||||
|
DiskSliceSize=1457664
|
||||||
|
|
||||||
|
|
||||||
|
[UninstallDelete]
|
||||||
|
Type: filesandordirs; Name: "{app}"
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "Redist\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion
|
||||||
|
;Source: "Redist\vcredist_x64.exe"; DestDir: "{tmp}"; Check: "IsWin64"; Flags: ignoreversion
|
||||||
|
Source: "..\content\*"; DestDir: "{app}\content"; Flags: ignoreversion recursesubdirs
|
||||||
|
;Source: "..\SDL.DLL"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
||||||
|
Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
||||||
|
|
||||||
|
[Registry]
|
||||||
|
|
||||||
|
|
||||||
|
[Run]
|
||||||
|
Filename: "{tmp}\vcredist_x86.exe"; Parameters: "/q"; Tasks: instvc;
|
||||||
|
;Filename: "{tmp}\vcredist_x64.exe"; Parameters: "/q"; Tasks: instvc; Check: "IsWin64";
|
||||||
|
Filename: "iexplore.exe"; Parameters: "http://www.blocks3d.com/FirstInstall"; Description: Start playing Blocks3D; Flags: shellexec postinstall nowait skipifsilent
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: "{group}\Play Blocks3D"; Filename: "{%programfiles}\Internet Explorer\iexplore.exe"; Parameters: "http://www.blocks3d.com/Games"; IconFilename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
Name: "{group}\Blocks3D Editor"; Filename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
|
||||||
|
Name: "{userdesktop}\Play Blocks3D"; Filename: "{%programfiles}\Internet Explorer\iexplore.exe"; Parameters: "http://www.blocks3d.com/Games"; IconFilename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
Name: "{userdesktop}\Blocks3D Editor"; Filename: "{app}\Blocks3D.exe"; Tasks: desktopicon
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "instvc"; Description: "Install Visual C++ Redistributable 2005 SP1 (Requires elevated permissions)";
|
||||||
|
Name: "desktopicon"; Description: "Create Desktop Icons";
|
||||||
|
Name: "startscut"; Description: "Create Start Menu Icons";
|
||||||
|
|
||||||
48
Installer/install_script_floppy_vs2003.iss
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
;InnoSetupVersion=5.4.3
|
||||||
|
;ONLY USE THIS IF YOU COMPILED WITH VISUAL STUDIO 2003!!!
|
||||||
|
#define AppVer GetFileVersion('..\Blocks3D.exe')
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
AppName=Blocks3D
|
||||||
|
AppVersion=v{#AppVer}
|
||||||
|
AppId={{4C5DF268-0208-4CDE-A7F0-65F7E2CB5067}
|
||||||
|
AppPublisherURL=http://blocks3d.com/
|
||||||
|
AppSupportURL=http://blocks3d.com/
|
||||||
|
AppUpdatesURL=http://blocks3d.com/
|
||||||
|
DefaultDirName={%localappdata}\Blocks3D
|
||||||
|
OutputBaseFilename=B3DSTP
|
||||||
|
Compression=lzma2
|
||||||
|
PrivilegesRequired=lowest
|
||||||
|
WizardImageFile=setup.bmp
|
||||||
|
DefaultGroupName=Blocks3D
|
||||||
|
DiskSpanning=yes
|
||||||
|
SlicesPerDisk=1
|
||||||
|
DiskSliceSize=1457664
|
||||||
|
|
||||||
|
|
||||||
|
[UninstallDelete]
|
||||||
|
Type: filesandordirs; Name: "{app}"
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "Redist\msvcr71.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "Redist\msvcp71.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "..\content\*"; DestDir: "{app}\content"; Flags: ignoreversion recursesubdirs
|
||||||
|
Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
||||||
|
|
||||||
|
[Registry]
|
||||||
|
|
||||||
|
|
||||||
|
[Run]
|
||||||
|
Filename: "iexplore.exe"; Parameters: "http://www.blocks3d.com/FirstInstall"; Description: Start playing Blocks3D; Flags: shellexec postinstall nowait skipifsilent
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: "{group}\Play Blocks3D"; Filename: "{%programfiles}\Internet Explorer\iexplore.exe"; Parameters: "http://www.blocks3d.com/Games"; IconFilename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
Name: "{group}\Blocks3D Editor"; Filename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
|
||||||
|
Name: "{userdesktop}\Play Blocks3D"; Filename: "{%programfiles}\Internet Explorer\iexplore.exe"; Parameters: "http://www.blocks3d.com/Games"; IconFilename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
Name: "{userdesktop}\Blocks3D Editor"; Filename: "{app}\Blocks3D.exe"; Tasks: desktopicon
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "desktopicon"; Description: "Create Desktop Icons";
|
||||||
|
Name: "startscut"; Description: "Create Start Menu Icons";
|
||||||
|
|
||||||
45
Installer/install_script_vs2003.iss
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
;InnoSetupVersion=5.4.3
|
||||||
|
;ONLY USE THIS IF YOU COMPILED WITH VISUAL STUDIO 2003!!!
|
||||||
|
#define AppVer GetFileVersion('..\Blocks3D.exe')
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
AppName=Blocks3D
|
||||||
|
AppVersion=v{#AppVer}
|
||||||
|
AppId={{4C5DF268-0208-4CDE-A7F0-65F7E2CB5067}
|
||||||
|
AppPublisherURL=http://blocks3d.com/
|
||||||
|
AppSupportURL=http://blocks3d.com/
|
||||||
|
AppUpdatesURL=http://blocks3d.com/
|
||||||
|
DefaultDirName={%localappdata}\Blocks3D
|
||||||
|
OutputBaseFilename=Blocks3D_Setup_v{#AppVer}
|
||||||
|
Compression=lzma2
|
||||||
|
PrivilegesRequired=lowest
|
||||||
|
WizardImageFile=setup.bmp
|
||||||
|
DefaultGroupName=Blocks3D
|
||||||
|
|
||||||
|
|
||||||
|
[UninstallDelete]
|
||||||
|
Type: filesandordirs; Name: "{app}"
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "Redist\msvcp71.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "Redist\msvcr71.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "..\content\*"; DestDir: "{app}\content"; Flags: ignoreversion recursesubdirs
|
||||||
|
Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
|
||||||
|
|
||||||
|
[Registry]
|
||||||
|
|
||||||
|
|
||||||
|
[Run]
|
||||||
|
Filename: "iexplore.exe"; Parameters: "http://www.blocks3d.com/FirstInstall"; Description: Start playing Blocks3D; Flags: shellexec postinstall nowait skipifsilent
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: "{group}\Play Blocks3D"; Filename: "{%programfiles}\Internet Explorer\iexplore.exe"; Parameters: "http://www.blocks3d.com/Games"; IconFilename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
Name: "{group}\Blocks3D Editor"; Filename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
|
||||||
|
Name: "{userdesktop}\Play Blocks3D"; Filename: "{%programfiles}\Internet Explorer\iexplore.exe"; Parameters: "http://www.blocks3d.com/Games"; IconFilename: "{app}\Blocks3D.exe"; Tasks: startscut;
|
||||||
|
Name: "{userdesktop}\Blocks3D Editor"; Filename: "{app}\Blocks3D.exe"; Tasks: desktopicon
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "desktopicon"; Description: "Create Desktop Icons";
|
||||||
|
Name: "startscut"; Description: "Create Start Menu Icons";
|
||||||
|
|
||||||
BIN
Parts.bmp
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
BIN
PartsOld.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
@@ -1,3 +1,6 @@
|
|||||||
|
# IMPORTANT -- READ BEFORE CONTRIBUTING
|
||||||
|
Work on DataModel V3 will be starting November 3rd at 3PM PDT! This will mean **many PRs involving DataModel V2 may be immediately rejected until completion!** Progress on DataModelV3 can be tracked/contributed to on the feature/datamodel_v3 branch during this time.
|
||||||
|
|
||||||
# ROBLOX 2005 Recreation Project
|
# ROBLOX 2005 Recreation Project
|
||||||
## Why are we doing this?
|
## Why are we doing this?
|
||||||
ROBLOX in 2005 was a different game, based around minigames with win and lose conditions rather than a 3D building game. Since this build of the client is presumed lost despite having around 100 users, we have to recreate it. We are using era-appropriate tools for this as well (Visual Studio 2005 and 2005-era compilers), as well as G3D 6.10, the era-appropriate version of the Graphics3D graphics library used by ROBLOX to this day.
|
ROBLOX in 2005 was a different game, based around minigames with win and lose conditions rather than a 3D building game. Since this build of the client is presumed lost despite having around 100 users, we have to recreate it. We are using era-appropriate tools for this as well (Visual Studio 2005 and 2005-era compilers), as well as G3D 6.10, the era-appropriate version of the Graphics3D graphics library used by ROBLOX to this day.
|
||||||
@@ -7,4 +10,4 @@ Equivalent to known features of 05 as it stood in October 2005 with the 'Morgan
|
|||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
- Morgan McGuire, creator of G3D - his old pre-2006 website for the only existing colour pictures of 2005 era roblox on the internet, as well as a couple of helpful emails. He assisted roblox development in the 2004-2006 timeframe.
|
- Morgan McGuire, creator of G3D - his old pre-2006 website for the only existing colour pictures of 2005 era roblox on the internet, as well as a couple of helpful emails. He assisted roblox development in the 2004-2006 timeframe.
|
||||||
- David Baszucki and Erik Cassel (1967-2013, RIP) - for creating roblox
|
- David Baszucki and Erik Cassel - for creating roblox
|
||||||
|
|||||||
56
ThumbnailGeneratorInstance.cpp
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
#include "DataModelV2/ThumbnailGeneratorInstance.h"
|
||||||
|
#include "Application.h"
|
||||||
|
#include "Globals.h"
|
||||||
|
#include "base64.h"
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
ThumbnailGeneratorInstance::ThumbnailGeneratorInstance(void)
|
||||||
|
{
|
||||||
|
Instance::Instance();
|
||||||
|
name = "ThumbnailGenerator";
|
||||||
|
className = "ThumbnailGenerator";
|
||||||
|
canDelete = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ThumbnailGeneratorInstance::~ThumbnailGeneratorInstance(void) {}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO:
|
||||||
|
* Move functions like toggleSky into their own "Lighting" instance
|
||||||
|
* Make this headless, and allow for resolutions greater than the screen resolution
|
||||||
|
*/
|
||||||
|
std::string ThumbnailGeneratorInstance::click(std::string fileType, int cx, int cy, bool hideSky)
|
||||||
|
{
|
||||||
|
if(!G3D::GImage::supportedFormat(fileType)) {
|
||||||
|
printf("%s is not a valid fileType.", fileType);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
RenderDevice* rd = g_usableApp->getRenderDevice();
|
||||||
|
GuiRootInstance* guiRoot = g_dataModel->getGuiRoot();
|
||||||
|
const G3D::GImage::Format format = G3D::GImage::stringToFormat(fileType);
|
||||||
|
|
||||||
|
int prevWidth = rd->width();
|
||||||
|
int prevHeight = rd->height();
|
||||||
|
G3D::GImage imgBuffer(cx, cy, 4);
|
||||||
|
G3D::BinaryOutput binOut;
|
||||||
|
|
||||||
|
guiRoot->hideGui(true);
|
||||||
|
g_usableApp->resize3DView(cx, cy);
|
||||||
|
|
||||||
|
if(hideSky)
|
||||||
|
g_dataModel->getLighting()->suppressSky(true);
|
||||||
|
|
||||||
|
g_usableApp->onGraphics(rd);
|
||||||
|
rd->screenshotPic(imgBuffer, true, hideSky);
|
||||||
|
imgBuffer.encode(format, binOut);
|
||||||
|
|
||||||
|
// Convert to Base64 string
|
||||||
|
std::string base64ImgStr = base64_encode(reinterpret_cast<const unsigned char*>(binOut.getCArray()), binOut.length(), false);
|
||||||
|
|
||||||
|
guiRoot->hideGui(false);
|
||||||
|
g_usableApp->resize3DView(prevWidth, prevHeight);
|
||||||
|
|
||||||
|
return base64ImgStr;
|
||||||
|
}
|
||||||
|
|
||||||
BIN
content/sounds/bass.wav
Normal file
BIN
content/sounds/clickfast.wav
Normal file
BIN
content/sounds/collide.wav
Normal file
BIN
content/sounds/flashbulb.wav
Normal file
BIN
content/sounds/glassbreak.wav
Normal file
BIN
content/sounds/snap.wav
Normal file
BIN
content/sounds/splat.wav
Normal file
BIN
content/sounds/swoosh.wav
Normal file
BIN
content/sounds/victory.wav
Normal file
|
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 576 B |
|
Before Width: | Height: | Size: 637 B After Width: | Height: | Size: 637 B |
BIN
oldcontent/font/lighttrek.fnt
Normal file
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 433 B After Width: | Height: | Size: 433 B |
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 628 B |
|
Before Width: | Height: | Size: 595 B After Width: | Height: | Size: 595 B |
|
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 665 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 627 B After Width: | Height: | Size: 627 B |
|
Before Width: | Height: | Size: 788 B After Width: | Height: | Size: 788 B |
|
Before Width: | Height: | Size: 660 B After Width: | Height: | Size: 660 B |
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 798 B |
|
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 522 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -7,7 +7,6 @@
|
|||||||
#include "IEBrowser.h"
|
#include "IEBrowser.h"
|
||||||
#include "Mouse.h"
|
#include "Mouse.h"
|
||||||
#include "Tool/Tool.h"
|
#include "Tool/Tool.h"
|
||||||
//#include "GuiRoot.h"
|
|
||||||
|
|
||||||
class TextButtonInstance;
|
class TextButtonInstance;
|
||||||
class ImageButtonInstance;
|
class ImageButtonInstance;
|
||||||
@@ -48,14 +47,16 @@ class Application { // : public GApp {
|
|||||||
void setFocus(bool isFocused);
|
void setFocus(bool isFocused);
|
||||||
int getMode();
|
int getMode();
|
||||||
void unSetMode();
|
void unSetMode();
|
||||||
|
|
||||||
CameraController cameraController;
|
CameraController cameraController;
|
||||||
UserInput* userInput;
|
UserInput* userInput;
|
||||||
PropertyWindow* _propWindow;
|
PropertyWindow* _propWindow;
|
||||||
void generateShadowMap(const CoordinateFrame& lightViewMatrix) const;
|
void generateShadowMap(const CoordinateFrame& lightViewMatrix) const;
|
||||||
RenderDevice* getRenderDevice();
|
RenderDevice* getRenderDevice();
|
||||||
void selectInstance(Instance* selectedInstance,PropertyWindow* propWindow);
|
void selectInstance(Instance* selectedInstance,PropertyWindow* propWindow);
|
||||||
void setMode(int mode);
|
void setMode(int mode);
|
||||||
|
void resize3DView(int w, int h);
|
||||||
|
|
||||||
Tool * tool;
|
Tool * tool;
|
||||||
void changeTool(Tool *);
|
void changeTool(Tool *);
|
||||||
Mouse mouse;
|
Mouse mouse;
|
||||||
@@ -65,7 +66,6 @@ class Application { // : public GApp {
|
|||||||
RenderDevice* renderDevice;
|
RenderDevice* renderDevice;
|
||||||
//void initGUI();
|
//void initGUI();
|
||||||
HWND _hWndMain;
|
HWND _hWndMain;
|
||||||
SkyRef sky;
|
|
||||||
bool quit;
|
bool quit;
|
||||||
bool mouseOnScreen;
|
bool mouseOnScreen;
|
||||||
bool rightButtonHolding;
|
bool rightButtonHolding;
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
#include <G3DAll.h>
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <iostream>
|
||||||
|
#include <string.h>
|
||||||
class AudioPlayer
|
class AudioPlayer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AudioPlayer(void);
|
AudioPlayer(void);
|
||||||
~AudioPlayer(void);
|
~AudioPlayer(void);
|
||||||
static void playSound(std::string);
|
|
||||||
static void init();
|
static void init();
|
||||||
|
static void playSound(std::string);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,6 +43,14 @@ public:
|
|||||||
virtual bool mouseHovered(float, float, RenderDevice* rd);
|
virtual bool mouseHovered(float, float, RenderDevice* rd);
|
||||||
UDim2 position;
|
UDim2 position;
|
||||||
UDim2 size;
|
UDim2 size;
|
||||||
|
static G3D::Color4 translucentBackdrop()
|
||||||
|
{
|
||||||
|
return G3D::Color4(0.60000002F, 0.60000002F, 0.60000002F, 0.60000002F);
|
||||||
|
}
|
||||||
|
static G3D::Color4 disabledFill()
|
||||||
|
{
|
||||||
|
return G3D::Color4(0.69999999F, 0.69999999F, 0.69999999F, 0.5F);
|
||||||
|
}
|
||||||
protected:
|
protected:
|
||||||
bool mouseInArea(float, float, float, float, float, float);
|
bool mouseInArea(float, float, float, float, float, float);
|
||||||
class ButtonListener* listener;
|
class ButtonListener* listener;
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// Instances
|
||||||
#include "WorkspaceInstance.h"
|
#include "WorkspaceInstance.h"
|
||||||
#include "LevelInstance.h"
|
#include "LevelInstance.h"
|
||||||
#include "PartInstance.h"
|
#include "PartInstance.h"
|
||||||
#include "SelectionService.h"
|
#include "SelectionService.h"
|
||||||
#include "rapidxml/rapidxml.hpp"
|
|
||||||
#include "GuiRootInstance.h"
|
#include "GuiRootInstance.h"
|
||||||
|
#include "ThumbnailGeneratorInstance.h"
|
||||||
#include "XplicitNgine/XplicitNgine.h"
|
#include "XplicitNgine/XplicitNgine.h"
|
||||||
|
#include "SoundService.h"
|
||||||
|
#include "LightingInstance.h"
|
||||||
|
|
||||||
|
// Libraries
|
||||||
|
#include "rapidxml/rapidxml.hpp"
|
||||||
|
|
||||||
class GuiRootInstance;
|
class GuiRootInstance;
|
||||||
|
|
||||||
@@ -20,12 +27,20 @@ public:
|
|||||||
void clearMessage();
|
void clearMessage();
|
||||||
bool debugGetOpen();
|
bool debugGetOpen();
|
||||||
bool getOpen();
|
bool getOpen();
|
||||||
|
bool getOpenModel();
|
||||||
bool load(const char* filename,bool clearObjects);
|
bool load(const char* filename,bool clearObjects);
|
||||||
|
bool loadModel(const char* filename);
|
||||||
bool readXMLFileStream(std::ifstream* file);
|
bool readXMLFileStream(std::ifstream* file);
|
||||||
void drawMessage(RenderDevice*);
|
void drawMessage(RenderDevice*);
|
||||||
WorkspaceInstance* getWorkspace();
|
|
||||||
LevelInstance * getLevel();
|
// Instance getters
|
||||||
XplicitNgine * getEngine();
|
WorkspaceInstance* getWorkspace();
|
||||||
|
LevelInstance* getLevel();
|
||||||
|
XplicitNgine* getEngine();
|
||||||
|
ThumbnailGeneratorInstance* getThumbnailGenerator();
|
||||||
|
SoundService* getSoundService();
|
||||||
|
LightingInstance* getLighting();
|
||||||
|
|
||||||
std::string message;
|
std::string message;
|
||||||
std::string _loadedFileName;
|
std::string _loadedFileName;
|
||||||
bool showMessage;
|
bool showMessage;
|
||||||
@@ -49,10 +64,16 @@ private:
|
|||||||
std::string _errMsg;
|
std::string _errMsg;
|
||||||
bool _legacyLoad;
|
bool _legacyLoad;
|
||||||
float _modY;
|
float _modY;
|
||||||
|
|
||||||
|
// Instances
|
||||||
WorkspaceInstance* workspace;
|
WorkspaceInstance* workspace;
|
||||||
LevelInstance * level;
|
LevelInstance* level;
|
||||||
GuiRootInstance* guiRoot;
|
GuiRootInstance* guiRoot;
|
||||||
SelectionService* selectionService;
|
SelectionService* selectionService;
|
||||||
|
ThumbnailGeneratorInstance* thumbnailGenerator;
|
||||||
|
XplicitNgine* xplicitNgine;
|
||||||
|
SoundService* soundService;
|
||||||
|
LightingInstance* lightingInstance;
|
||||||
bool running;
|
bool running;
|
||||||
XplicitNgine * xplicitNgine;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ public:
|
|||||||
void update();
|
void update();
|
||||||
bool mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y);
|
bool mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y);
|
||||||
void onMouseLeftUp(G3D::RenderDevice* renderDevice, int x,int y);
|
void onMouseLeftUp(G3D::RenderDevice* renderDevice, int x,int y);
|
||||||
|
void hideGui(bool doHide);
|
||||||
private:
|
private:
|
||||||
std::string _message;
|
std::string _message;
|
||||||
G3D::RealTime _messageTime;
|
G3D::RealTime _messageTime;
|
||||||
|
bool _hideGui;
|
||||||
};
|
};
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
#include <G3DAll.h>
|
#include <G3DAll.h>
|
||||||
#include "propertyGrid.h"
|
#include "propertyGrid.h"
|
||||||
#include "map"
|
#include "map"
|
||||||
//#include "Properties/BoolProperty.h"
|
|
||||||
|
|
||||||
class Instance
|
class Instance
|
||||||
{
|
{
|
||||||
@@ -13,6 +12,7 @@ public:
|
|||||||
virtual ~Instance(void);
|
virtual ~Instance(void);
|
||||||
std::string name;
|
std::string name;
|
||||||
virtual void render(RenderDevice*);
|
virtual void render(RenderDevice*);
|
||||||
|
virtual void renderName(RenderDevice*);
|
||||||
virtual void update();
|
virtual void update();
|
||||||
std::vector<Instance*> children; // All children.
|
std::vector<Instance*> children; // All children.
|
||||||
std::string getClassName();
|
std::string getClassName();
|
||||||
|
|||||||
43
src/include/DataModelV2/LightingInstance.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Instance.h"
|
||||||
|
|
||||||
|
class LightingInstance :
|
||||||
|
public Instance
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LightingInstance(void);
|
||||||
|
~LightingInstance(void);
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
G3D::Color3 getTopAmbient();
|
||||||
|
G3D::Color3 getBottomAmbient();
|
||||||
|
G3D::Color3 getSpotLight();
|
||||||
|
G3D::Color4 getClearColor();
|
||||||
|
G3D::SkyRef getSky();
|
||||||
|
G3D::LightingParameters getLightingParameters();
|
||||||
|
|
||||||
|
// Setters
|
||||||
|
void setTopAmbient(G3D::Color3 newValue);
|
||||||
|
void setBottomAmbient(G3D::Color3 newValue);
|
||||||
|
void setSpotLight(G3D::Color3 newValue);
|
||||||
|
void setClearColor(G3D::Color4 clearColor);
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
void drawSky();
|
||||||
|
void suppressSky(bool doSuppress);
|
||||||
|
void update();
|
||||||
|
void drawEffects();
|
||||||
|
|
||||||
|
// Properties
|
||||||
|
void PropUpdate(LPPROPGRIDITEM &pItem);
|
||||||
|
std::vector<PROPGRIDITEM> getProperties();
|
||||||
|
|
||||||
|
private:
|
||||||
|
G3D::Color3 topAmbient;
|
||||||
|
G3D::Color3 bottomAmbient;
|
||||||
|
G3D::Color3 spotLight;
|
||||||
|
G3D::Color4 clearColor;
|
||||||
|
G3D::SkyRef sky;
|
||||||
|
G3D::LightingParameters lighting;
|
||||||
|
bool _hideSky;
|
||||||
|
};
|
||||||
@@ -16,7 +16,8 @@ public:
|
|||||||
//Rendering
|
//Rendering
|
||||||
virtual void PartInstance::postRender(RenderDevice* rd);
|
virtual void PartInstance::postRender(RenderDevice* rd);
|
||||||
virtual void render(RenderDevice*);
|
virtual void render(RenderDevice*);
|
||||||
|
virtual void renderName(RenderDevice*);
|
||||||
|
|
||||||
//Surfaces
|
//Surfaces
|
||||||
Enum::SurfaceType::Value top;
|
Enum::SurfaceType::Value top;
|
||||||
Enum::SurfaceType::Value front;
|
Enum::SurfaceType::Value front;
|
||||||
@@ -24,8 +25,14 @@ public:
|
|||||||
Enum::SurfaceType::Value back;
|
Enum::SurfaceType::Value back;
|
||||||
Enum::SurfaceType::Value left;
|
Enum::SurfaceType::Value left;
|
||||||
Enum::SurfaceType::Value bottom;
|
Enum::SurfaceType::Value bottom;
|
||||||
|
|
||||||
|
//Shapes
|
||||||
Enum::Shape::Value shape;
|
Enum::Shape::Value shape;
|
||||||
|
|
||||||
|
//OnTocuh
|
||||||
|
Enum::ActionType::Value OnTouchAction;
|
||||||
|
Enum::Sound::Value OnTouchSound;
|
||||||
|
|
||||||
//Variables
|
//Variables
|
||||||
Color3 color;
|
Color3 color;
|
||||||
bool canCollide;
|
bool canCollide;
|
||||||
@@ -42,6 +49,13 @@ public:
|
|||||||
Box getScaledBox();
|
Box getScaledBox();
|
||||||
CoordinateFrame getCFrame();
|
CoordinateFrame getCFrame();
|
||||||
|
|
||||||
|
//OnTouch Getters
|
||||||
|
bool isSingleShot();
|
||||||
|
int getTouchesToTrigger();
|
||||||
|
int getUniqueObjectsToTrigger();
|
||||||
|
int getChangeScore();
|
||||||
|
float getChangeTimer();
|
||||||
|
|
||||||
//Setters
|
//Setters
|
||||||
void setParent(Instance* parent);
|
void setParent(Instance* parent);
|
||||||
void setPosition(Vector3);
|
void setPosition(Vector3);
|
||||||
@@ -63,6 +77,9 @@ public:
|
|||||||
bool collides(PartInstance * part);
|
bool collides(PartInstance * part);
|
||||||
bool collides(Box);
|
bool collides(Box);
|
||||||
|
|
||||||
|
// onTouch
|
||||||
|
void onTouch();
|
||||||
|
|
||||||
//Properties
|
//Properties
|
||||||
virtual std::vector<PROPGRIDITEM> getProperties();
|
virtual std::vector<PROPGRIDITEM> getProperties();
|
||||||
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
|
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
|
||||||
@@ -76,4 +93,12 @@ private:
|
|||||||
bool dragging;
|
bool dragging;
|
||||||
Box itemBox;
|
Box itemBox;
|
||||||
GLuint glList;
|
GLuint glList;
|
||||||
|
|
||||||
|
// OnTouch
|
||||||
|
bool singleShot;
|
||||||
|
int touchesToTrigger;
|
||||||
|
int uniqueObjectsToTrigger;
|
||||||
|
int changeScore;
|
||||||
|
float changeTimer;
|
||||||
|
bool _touchedOnce;
|
||||||
};
|
};
|
||||||
@@ -15,6 +15,7 @@ public:
|
|||||||
void removeSelected(Instance * instance);
|
void removeSelected(Instance * instance);
|
||||||
void addSelected(const std::vector<Instance *> &instances);
|
void addSelected(const std::vector<Instance *> &instances);
|
||||||
void setPropertyWindow(PropertyWindow * propertyWindow);
|
void setPropertyWindow(PropertyWindow * propertyWindow);
|
||||||
|
void render(RenderDevice * rd);
|
||||||
private:
|
private:
|
||||||
std::vector<Instance *> selection;
|
std::vector<Instance *> selection;
|
||||||
PropertyWindow * propertyWindow;
|
PropertyWindow * propertyWindow;
|
||||||
|
|||||||
30
src/include/DataModelV2/SoundInstance.h
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Instance.h"
|
||||||
|
|
||||||
|
class SoundInstance :
|
||||||
|
public Instance
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SoundInstance(void);
|
||||||
|
~SoundInstance(void);
|
||||||
|
|
||||||
|
// Getters
|
||||||
|
float getSoundVolume();
|
||||||
|
std::string getSoundId();
|
||||||
|
bool isPlayedOnRemove();
|
||||||
|
bool isLooped();
|
||||||
|
|
||||||
|
// Setters
|
||||||
|
void setSoundVolume(float newVolume);
|
||||||
|
void setSoundId(std::string newSoundId);
|
||||||
|
void setIsPlayedOnRemove(bool isPlayed);
|
||||||
|
void setIsLooped(bool isLooped);
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
void play();
|
||||||
|
private:
|
||||||
|
float soundVolume;
|
||||||
|
std::string soundId;
|
||||||
|
bool playOnRemove;
|
||||||
|
bool looped;
|
||||||
|
};
|
||||||
16
src/include/DataModelV2/SoundService.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Instance.h"
|
||||||
|
#include "SoundInstance.h"
|
||||||
|
|
||||||
|
class SoundService :
|
||||||
|
public Instance
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SoundService(void);
|
||||||
|
~SoundService(void);
|
||||||
|
|
||||||
|
float getMusicVolume();
|
||||||
|
void playSound(Instance* sound);
|
||||||
|
private:
|
||||||
|
float musicVolume;
|
||||||
|
};
|
||||||
14
src/include/DataModelV2/ThumbnailGeneratorInstance.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "instance.h"
|
||||||
|
|
||||||
|
class ThumbnailGeneratorInstance :
|
||||||
|
public Instance
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// Constructor / Destructor
|
||||||
|
ThumbnailGeneratorInstance(void);
|
||||||
|
~ThumbnailGeneratorInstance(void);
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
std::string click(std::string fileType, int cx, int cy, bool hideSky);
|
||||||
|
};
|
||||||
@@ -32,4 +32,12 @@ namespace Enum
|
|||||||
NoChange = 0, Increase = 1, Decrease = 2
|
NoChange = 0, Increase = 1, Decrease = 2
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
namespace Sound
|
||||||
|
{
|
||||||
|
enum Value {
|
||||||
|
NoSound = 0, Victory = 1, Boing = 2, Bomb = 3,
|
||||||
|
Ping = 4, Break = 5, Splat = 6, Swoosh = 7,
|
||||||
|
Snap = 8, Page = 9, Click = 10, Clock = 11, Step = 12, StepOn = 13,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -17,8 +17,6 @@ public:
|
|||||||
static const int major;
|
static const int major;
|
||||||
static const int minor;
|
static const int minor;
|
||||||
static const int patch;
|
static const int patch;
|
||||||
static G3D::TextureRef surface;
|
|
||||||
static int surfaceId;
|
|
||||||
static const std::string g_appName;
|
static const std::string g_appName;
|
||||||
static COLORREF g_acrCustClr[16]; //Will be dynamic later
|
static COLORREF g_acrCustClr[16]; //Will be dynamic later
|
||||||
static HWND mainHwnd;
|
static HWND mainHwnd;
|
||||||
@@ -29,6 +27,8 @@ extern bool running;
|
|||||||
extern DataModelInstance* g_dataModel;
|
extern DataModelInstance* g_dataModel;
|
||||||
extern XplicitNgine* g_xplicitNgine;
|
extern XplicitNgine* g_xplicitNgine;
|
||||||
extern Application* g_usableApp;
|
extern Application* g_usableApp;
|
||||||
|
extern SkyRef g_sky;
|
||||||
|
extern RenderDevice g_renderDevice;
|
||||||
|
|
||||||
extern GFontRef g_fntdominant;
|
extern GFontRef g_fntdominant;
|
||||||
extern GFontRef g_fntlighttrek;
|
extern GFontRef g_fntlighttrek;
|
||||||
|
|||||||
@@ -27,8 +27,10 @@ public:
|
|||||||
bool isMouseOnScreen();
|
bool isMouseOnScreen();
|
||||||
bool isMouseDown();
|
bool isMouseDown();
|
||||||
void setMouseDown(bool mouseDown);
|
void setMouseDown(bool mouseDown);
|
||||||
G3D::Ray * getRay();
|
G3D::Ray getRay();
|
||||||
G3D::Ray getLastRay();
|
G3D::Ray getLastRay();
|
||||||
|
G3D::Plane getPlane();
|
||||||
|
G3D::Plane getInversePlane();
|
||||||
private:
|
private:
|
||||||
bool mouseDown;
|
bool mouseDown;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "Property.h"
|
|
||||||
class BoolProperty : public Property<bool>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BoolProperty(std::string name, bool& value, Instance& owner)
|
|
||||||
{
|
|
||||||
Property<bool>(name, value, owner);
|
|
||||||
}
|
|
||||||
~BoolProperty(void);
|
|
||||||
PROPGRIDITEM getPropGridItem();
|
|
||||||
};
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "DataModelV2/Instance.h"
|
|
||||||
#include <string>
|
|
||||||
class Instance;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class Property
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Property(std::string name, T& value, Instance& owner)
|
|
||||||
{
|
|
||||||
_value = value;
|
|
||||||
_owner = owner;
|
|
||||||
}
|
|
||||||
~Property(void);
|
|
||||||
const T getValue()
|
|
||||||
{
|
|
||||||
return _value;
|
|
||||||
}
|
|
||||||
const void setValue(T val)
|
|
||||||
{
|
|
||||||
_value = val;
|
|
||||||
}
|
|
||||||
virtual PROPGRIDITEM getPropGridItem();
|
|
||||||
void setProperty(LPPROPGRIDITEM item);
|
|
||||||
protected:
|
|
||||||
Instance* _owner;
|
|
||||||
std::string _name;
|
|
||||||
T* _value;
|
|
||||||
};
|
|
||||||
25
src/include/Tool/DraggerTool.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "ArrowTool.h"
|
||||||
|
|
||||||
|
class DraggerTool :
|
||||||
|
public ArrowTool
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DraggerTool(void);
|
||||||
|
~DraggerTool(void);
|
||||||
|
void onButton1MouseDown(Mouse);
|
||||||
|
void onButton1MouseUp(Mouse);
|
||||||
|
void onMouseMoved(Mouse mouse);
|
||||||
|
void onSelect(Mouse mouse);
|
||||||
|
void onKeyDown(int key);
|
||||||
|
void onKeyUp(int key);
|
||||||
|
void render(RenderDevice * rd, Mouse mouse);
|
||||||
|
private:
|
||||||
|
void createHandles();
|
||||||
|
void grabHandle(Mouse mouse);
|
||||||
|
bool hasHandles;
|
||||||
|
int handleGrabbed;
|
||||||
|
Vector3 center;
|
||||||
|
Vector3 centerOffset;
|
||||||
|
Sphere handles[6];
|
||||||
|
};
|
||||||
@@ -26,6 +26,7 @@ public:
|
|||||||
virtual void onMouseScroll(Mouse);//Kinda
|
virtual void onMouseScroll(Mouse);//Kinda
|
||||||
virtual void onKeyDown(int);//yes
|
virtual void onKeyDown(int);//yes
|
||||||
virtual void onKeyUp(int);//yes
|
virtual void onKeyUp(int);//yes
|
||||||
|
virtual void render(RenderDevice * rd, Mouse mouse);//yes
|
||||||
//virtual int getCursorId();//yes
|
//virtual int getCursorId();//yes
|
||||||
protected:
|
protected:
|
||||||
//virtual void setCursor(std::string);
|
//virtual void setCursor(std::string);
|
||||||
|
|||||||
35
src/include/base64.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
//
|
||||||
|
// base64 encoding and decoding with C++.
|
||||||
|
// Version: 2.rc.08 (release candidate)
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A
|
||||||
|
#define BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#if __cplusplus >= 201703L
|
||||||
|
#include <string_view>
|
||||||
|
#endif // __cplusplus >= 201703L
|
||||||
|
|
||||||
|
std::string base64_encode (std::string const& s, bool url = false);
|
||||||
|
std::string base64_encode_pem (std::string const& s);
|
||||||
|
std::string base64_encode_mime(std::string const& s);
|
||||||
|
|
||||||
|
std::string base64_decode(std::string const& s, bool remove_linebreaks = false);
|
||||||
|
std::string base64_encode(unsigned char const*, size_t len, bool url = false);
|
||||||
|
|
||||||
|
#if __cplusplus >= 201703L
|
||||||
|
//
|
||||||
|
// Interface with std::string_view rather than const std::string&
|
||||||
|
// Requires C++17
|
||||||
|
// Provided by Yannic Bonenberger (https://github.com/Yannic)
|
||||||
|
//
|
||||||
|
std::string base64_encode (std::string_view s, bool url = false);
|
||||||
|
std::string base64_encode_pem (std::string_view s);
|
||||||
|
std::string base64_encode_mime(std::string_view s);
|
||||||
|
|
||||||
|
std::string base64_decode(std::string_view s, bool remove_linebreaks = false);
|
||||||
|
#endif // __cplusplus >= 201703L
|
||||||
|
|
||||||
|
#endif /* BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A */
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
#ifndef APP_GENER
|
#ifndef APP_GENER
|
||||||
|
|
||||||
//#define SNAPSHOT_VERSION
|
#define SNAPSHOT_VERSION
|
||||||
|
|
||||||
#define APP_GENER 0
|
#define APP_GENER 0
|
||||||
#define APP_MAJOR 0
|
#define APP_MAJOR 0
|
||||||
#define APP_MINOR 107
|
#define APP_MINOR 108
|
||||||
#define APP_PATCH 1
|
#define APP_PATCH 0
|
||||||
#define APP_VER_STRING APP_GENER.APP_MAJOR.APP_MINOR.APP_PATCH
|
#define APP_VER_STRING APP_GENER.APP_MAJOR.APP_MINOR.APP_PATCH
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "DataModelV2/ImageButtonInstance.h"
|
#include "DataModelV2/ImageButtonInstance.h"
|
||||||
#include "DataModelV2/DataModelInstance.h"
|
#include "DataModelV2/DataModelInstance.h"
|
||||||
#include "DataModelV2/GuiRootInstance.h"
|
#include "DataModelV2/GuiRootInstance.h"
|
||||||
|
#include "DataModelV2/SoundService.h"
|
||||||
#include "XplicitNgine/XplicitNgine.h"
|
#include "XplicitNgine/XplicitNgine.h"
|
||||||
#include "CameraController.h"
|
#include "CameraController.h"
|
||||||
#include "AudioPlayer.h"
|
#include "AudioPlayer.h"
|
||||||
@@ -33,14 +34,12 @@
|
|||||||
#include "Listener/RotateButtonListener.h"
|
#include "Listener/RotateButtonListener.h"
|
||||||
#include "Faces.h"
|
#include "Faces.h"
|
||||||
#define LEGACY_LOAD_G3DFUN_LEVEL
|
#define LEGACY_LOAD_G3DFUN_LEVEL
|
||||||
//Ray testRay;
|
|
||||||
//static int cursorid = 0;
|
|
||||||
//static int cursorOvrid = 0;
|
|
||||||
//static int currentcursorid = 0;
|
|
||||||
static bool mouseMovedBeginMotion = false;
|
static bool mouseMovedBeginMotion = false;
|
||||||
static POINT oldGlobalMouse;
|
static POINT oldGlobalMouse;
|
||||||
Vector2 oldMouse = Vector2(0,0);
|
Vector2 oldMouse = Vector2(0,0);
|
||||||
float moveRate = 0.5;
|
float moveRate = 0.5;
|
||||||
|
float wasPropShown = 0;
|
||||||
|
|
||||||
void Application::clearInstances()
|
void Application::clearInstances()
|
||||||
{
|
{
|
||||||
@@ -58,7 +57,7 @@ void Application::setFocus(bool focus)
|
|||||||
if(_propWindow != NULL)
|
if(_propWindow != NULL)
|
||||||
if(focus)
|
if(focus)
|
||||||
{
|
{
|
||||||
ShowWindow(_propWindow->_hwndProp, SW_SHOW);
|
//ShowWindow(_propWindow->_hwndProp, SW_SHOW);
|
||||||
SetWindowPos(_propWindow->_hwndProp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
SetWindowPos(_propWindow->_hwndProp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -110,6 +109,10 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
|
|||||||
_settings.writeLicenseFile = false;
|
_settings.writeLicenseFile = false;
|
||||||
_settings.logFilename = tempPath + "/g3dlog.txt";
|
_settings.logFilename = tempPath + "/g3dlog.txt";
|
||||||
_settings.window.center = true;
|
_settings.window.center = true;
|
||||||
|
|
||||||
|
// Needs to be enabled if "B3DCCService" (still need to finalize that name)
|
||||||
|
//_settings.window.fsaaSamples = 8;
|
||||||
|
|
||||||
Win32Window* window = Win32Window::create(_settings.window,_hwndRenderer);
|
Win32Window* window = Win32Window::create(_settings.window,_hwndRenderer);
|
||||||
ShowWindow(_hwndRenderer, SW_SHOW);
|
ShowWindow(_hwndRenderer, SW_SHOW);
|
||||||
ShowWindow(_hWndMain, SW_SHOW);
|
ShowWindow(_hWndMain, SW_SHOW);
|
||||||
@@ -128,6 +131,8 @@ Application::Application(HWND parentWindow) : _propWindow(NULL) { //: GApp(setti
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AudioPlayer::init();
|
||||||
|
|
||||||
_window = renderDevice->window();
|
_window = renderDevice->window();
|
||||||
_window->makeCurrent();
|
_window->makeCurrent();
|
||||||
|
|
||||||
@@ -288,21 +293,10 @@ void Application::onInit() {
|
|||||||
|
|
||||||
_dataModel->getSelectionService()->clearSelection();
|
_dataModel->getSelectionService()->clearSelection();
|
||||||
_dataModel->getSelectionService()->addSelected(_dataModel);
|
_dataModel->getSelectionService()->addSelected(_dataModel);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//setDesiredFrameRate(60);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//GApplet::onInit();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::onCleanup() {
|
void Application::onCleanup() {
|
||||||
clearInstances();
|
clearInstances();
|
||||||
sky->~Sky();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::onLogic() {
|
void Application::onLogic() {
|
||||||
@@ -313,12 +307,6 @@ void Application::onNetwork() {
|
|||||||
// Poll net messages here
|
// Poll net messages here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//double getVectorDistance(Vector3 vector1, Vector3 vector2)
|
|
||||||
//{
|
|
||||||
// return pow(pow((double)vector1.x - (double)vector2.x, 2) + pow((double)vector1.y - (double)vector2.y, 2) + pow((double)vector1.z - (double)vector2.z, 2), 0.5);
|
|
||||||
//}
|
|
||||||
|
|
||||||
void Application::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
|
void Application::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
|
||||||
|
|
||||||
if(_dataModel->isRunning())
|
if(_dataModel->isRunning())
|
||||||
@@ -421,92 +409,10 @@ int Application::getMode()
|
|||||||
return _mode;
|
return _mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, LightingParameters lighting, Vector3 size, Vector3 pos, CoordinateFrame c)
|
|
||||||
{
|
|
||||||
rd->disableLighting();
|
|
||||||
Color3 outline = Color3::cyan();//Color3(0.098F,0.6F,1.0F);
|
|
||||||
float offsetSize = 0.05F;
|
|
||||||
//X
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, from.y + offsetSize, from.z + offsetSize), Vector3(to.x + offsetSize, from.y - offsetSize, from.z - offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, to.y + offsetSize, from.z + offsetSize), Vector3(to.x + offsetSize, to.y - offsetSize, from.z - offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, to.y + offsetSize, to.z + offsetSize), Vector3(to.x + offsetSize, to.y - offsetSize, to.z - offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, from.y + offsetSize, to.z + offsetSize), Vector3(to.x + offsetSize, from.y - offsetSize, to.z - offsetSize))), rd, outline, Color4::clear());
|
|
||||||
//Y
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y - offsetSize + 0.1, from.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.1, from.z - offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.1, from.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize - 0.1, from.z - offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.1, to.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize-0.1, to.z - offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y - offsetSize + 0.1, to.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.1, to.z - offsetSize))), rd, outline, Color4::clear());
|
|
||||||
|
|
||||||
//Z
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y + offsetSize, from.z - offsetSize), Vector3(from.x - offsetSize, from.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, to.y + offsetSize, from.z - offsetSize), Vector3(from.x - offsetSize, to.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y + offsetSize, from.z - offsetSize), Vector3(to.x - offsetSize, from.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
|
|
||||||
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, to.y + offsetSize, from.z - offsetSize), Vector3(to.x - offsetSize, to.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
|
|
||||||
|
|
||||||
if(_mode == ARROWS)
|
|
||||||
{
|
|
||||||
|
|
||||||
AABox box;
|
|
||||||
c.toWorldSpace(Box(from, to)).getBounds(box);
|
|
||||||
float max = box.high().y - pos.y;
|
|
||||||
|
|
||||||
Draw::arrow(pos, Vector3(0, 1.5+max, 0), rd);
|
|
||||||
Draw::arrow(pos, Vector3(0, (-1.5)-max, 0), rd);
|
|
||||||
|
|
||||||
max = box.high().x - pos.x;
|
|
||||||
|
|
||||||
Draw::arrow(pos, Vector3(1.5+max, 0, 0), rd);
|
|
||||||
Draw::arrow(pos, Vector3((-1.5)-max, 0, 0), rd);
|
|
||||||
|
|
||||||
max = box.high().z - pos.z;
|
|
||||||
|
|
||||||
Draw::arrow(pos, Vector3(0, 0, 1.5+max), rd);
|
|
||||||
Draw::arrow(pos, Vector3(0, 0, (-1.5)-max), rd);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(_mode == RESIZE)
|
|
||||||
{
|
|
||||||
Color3 sphereColor = outline;
|
|
||||||
Vector3 gamepoint = pos;
|
|
||||||
Vector3 camerapoint = rd->getCameraToWorldMatrix().translation;
|
|
||||||
float distance = pow(pow((double)gamepoint.x - (double)camerapoint.x, 2) + pow((double)gamepoint.y - (double)camerapoint.y, 2) + pow((double)gamepoint.z - (double)camerapoint.z, 2), 0.5);
|
|
||||||
if(distance < 200)
|
|
||||||
{
|
|
||||||
|
|
||||||
float multiplier = distance * 0.025F/2;
|
|
||||||
if(multiplier < 0.25F)
|
|
||||||
multiplier = 0.25F;
|
|
||||||
Vector3 position = pos + (c.lookVector()*((size.z)+1));
|
|
||||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
|
||||||
position = pos - (c.lookVector()*((size.z)+1));
|
|
||||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
|
||||||
|
|
||||||
position = pos + (c.rightVector()*((size.x)+1));
|
|
||||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
|
||||||
position = pos - (c.rightVector()*((size.x)+1));
|
|
||||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
|
||||||
|
|
||||||
position = pos + (c.upVector()*((size.y)+1));
|
|
||||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
|
||||||
position = pos - (c.upVector()*((size.y)+1));
|
|
||||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rd->enableLighting();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::exitApplication()
|
void Application::exitApplication()
|
||||||
{
|
{
|
||||||
//endApplet = true;
|
|
||||||
//endProgram = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Application::onGraphics(RenderDevice* rd) {
|
void Application::onGraphics(RenderDevice* rd) {
|
||||||
|
|
||||||
G3D::uint8 num = 0;
|
G3D::uint8 num = 0;
|
||||||
@@ -515,27 +421,18 @@ void Application::onGraphics(RenderDevice* rd) {
|
|||||||
if (GetCursorPos(&mousepos))
|
if (GetCursorPos(&mousepos))
|
||||||
{
|
{
|
||||||
POINT pointm = mousepos;
|
POINT pointm = mousepos;
|
||||||
if (ScreenToClient(_hWndMain, &mousepos))
|
if (ScreenToClient(_hWndMain, &mousepos))
|
||||||
{
|
|
||||||
//mouseOnScreen = true;
|
|
||||||
//POINT pointm;
|
|
||||||
///GetCursorPos(&pointm);
|
|
||||||
if(_hwndRenderer != WindowFromPoint(pointm)) //OLD: mousepos.x < 1 || mousepos.y < 1 || mousepos.x >= rd->getViewport().width()-1 || mousepos.y >= rd->getViewport().height()-1
|
|
||||||
{
|
{
|
||||||
mouseOnScreen = false;
|
if(_hwndRenderer != WindowFromPoint(pointm))
|
||||||
//ShowCursor(true);
|
{
|
||||||
//_window->setMouseVisible(true);
|
mouseOnScreen = false;
|
||||||
//rd->window()->setInputCaptureCount(0);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mouseOnScreen = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mouseOnScreen = true;
|
|
||||||
//SetCursor(NULL);
|
|
||||||
//_window->setMouseVisible(false);
|
|
||||||
//rd->window()->setInputCaptureCount(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Globals::useMousePoint)
|
if(Globals::useMousePoint)
|
||||||
@@ -544,136 +441,13 @@ void Application::onGraphics(RenderDevice* rd) {
|
|||||||
ScreenToClient(_hWndMain, &mousepos);
|
ScreenToClient(_hWndMain, &mousepos);
|
||||||
}
|
}
|
||||||
|
|
||||||
LightingParameters lighting(G3D::toSeconds(2, 00, 00, PM));
|
renderDevice->setProjectionAndCameraMatrix(*cameraController.getCamera());
|
||||||
lighting.ambient = Color3(0.6F,0.6F,0.6F);
|
|
||||||
renderDevice->setProjectionAndCameraMatrix(*cameraController.getCamera());
|
|
||||||
|
|
||||||
// Cyan background
|
// Moved a lot of code to lighting
|
||||||
//renderDevice->setColorClearValue(Color3(0.0f, 0.5f, 1.0f));
|
g_dataModel->getLighting()->update();
|
||||||
|
|
||||||
renderDevice->clear(sky.isNull(), true, true);
|
|
||||||
if (sky.notNull()) {
|
|
||||||
sky->render(renderDevice, lighting);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup lighting
|
|
||||||
renderDevice->enableLighting();
|
|
||||||
|
|
||||||
renderDevice->setShadeMode(RenderDevice::SHADE_SMOOTH);
|
|
||||||
renderDevice->setAmbientLightColor(Color3(1,1,1));
|
|
||||||
|
|
||||||
renderDevice->setLight(0, GLight::directional(lighting.lightDirection, lighting.lightColor, true, true));
|
|
||||||
renderDevice->setAmbientLightColor(lighting.ambient);
|
|
||||||
|
|
||||||
//renderDevice->setBlendFunc(RenderDevice::BLEND_ONE, RenderDevice::BLEND_ONE);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//renderDevice->setShininess(70);
|
|
||||||
//renderDevice->setSpecularCoefficient(Color3(0.1F, 0.1F, 0.1F));
|
|
||||||
|
|
||||||
//float lightAmbient[] = { 0.5F, 0.5F, 0.5F, 1.0F };
|
|
||||||
//float lightDiffuse[] = { 0.6F, 0.6F, 0.6F, 1.0F };
|
|
||||||
//float lightSpecular[] = { 0.8F, 0.8F, 0.8F, 1.0F };
|
|
||||||
|
|
||||||
//glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, lightAmbient);
|
|
||||||
//glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, lightDiffuse);
|
|
||||||
//glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, lightSpecular);
|
|
||||||
//glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 70);
|
|
||||||
|
|
||||||
|
|
||||||
rd->beforePrimitive();
|
|
||||||
CoordinateFrame forDraw = rd->getObjectToWorldMatrix();
|
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
|
||||||
glEnableClientState(GL_NORMAL_ARRAY);
|
|
||||||
//if(_dataModel->getWorkspace() != NULL)
|
|
||||||
|
|
||||||
_dataModel->getWorkspace()->render(rd);
|
|
||||||
//else throw std::exception("Workspace not found");
|
|
||||||
glDisableClientState(GL_VERTEX_ARRAY);
|
|
||||||
glDisableClientState(GL_COLOR_ARRAY);
|
|
||||||
glDisableClientState(GL_NORMAL_ARRAY);
|
|
||||||
rd->setObjectToWorldMatrix(forDraw);
|
|
||||||
rd->afterPrimitive();
|
|
||||||
|
|
||||||
|
|
||||||
//Draw::box(G3D::Box(mouse.getPosition()-Vector3(2,0.5F,1),mouse.getPosition()+Vector3(2,0.5F,1)), rd, Color3::cyan(), Color4::clear());
|
|
||||||
|
|
||||||
for(size_t i = 0; i < _dataModel->getSelectionService()->getSelection().size(); i++)
|
|
||||||
{
|
|
||||||
if(PartInstance* part = dynamic_cast<PartInstance*>(g_dataModel->getSelectionService()->getSelection()[i]))
|
|
||||||
{
|
|
||||||
Vector3 size = part->getSize();
|
|
||||||
Vector3 pos = part->getPosition();
|
|
||||||
drawOutline(Vector3(0+size.x/2, 0+size.y/2, 0+size.z/2) ,Vector3(0-size.x/2,0-size.y/2,0-size.z/2), rd, lighting, Vector3(size.x/2, size.y/2, size.z/2), Vector3(pos.x, pos.y, pos.z), part->getCFrame());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Vector3 gamepoint = Vector3(0, 5, 0);
|
|
||||||
//Vector3 camerapoint = rd->getCameraToWorldMatrix().translation;
|
|
||||||
//float distance = pow(pow((double)gamepoint.x - (double)camerapoint.x, 2) + pow((double)gamepoint.y - (double)camerapoint.y, 2) + pow((double)gamepoint.z - (double)camerapoint.z, 2), 0.5);
|
|
||||||
//if(distance < 50 && distance > -50)
|
|
||||||
|
|
||||||
//{
|
|
||||||
// if(distance < 0)
|
|
||||||
// distance = distance*-1;
|
|
||||||
// fntdominant->draw3D(rd, "Testing", CoordinateFrame(rd->getCameraToWorldMatrix().rotation, gamepoint), 0.04*distance, Color3::yellow(), Color3::black(), G3D::GFont::XALIGN_CENTER, G3D::GFont::YALIGN_CENTER);
|
|
||||||
//}
|
|
||||||
|
|
||||||
renderDevice->disableLighting();
|
|
||||||
|
|
||||||
if (sky.notNull()) {
|
|
||||||
sky->renderLensFlare(renderDevice, lighting);
|
|
||||||
}
|
|
||||||
renderDevice->push2D();
|
renderDevice->push2D();
|
||||||
_dataModel->getGuiRoot()->renderGUI(renderDevice, m_graphicsWatch.FPS());
|
_dataModel->getGuiRoot()->renderGUI(renderDevice, m_graphicsWatch.FPS());
|
||||||
/*rd->pushState();
|
|
||||||
rd->beforePrimitive();
|
|
||||||
|
|
||||||
if(Globals::showMouse && mouseOnScreen)
|
|
||||||
{
|
|
||||||
glEnable( GL_TEXTURE_2D );
|
|
||||||
glEnable(GL_BLEND);// you enable blending function
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
/*
|
|
||||||
std::vector<Instance*> instances = _dataModel->getWorkspace()->getAllChildren();
|
|
||||||
currentcursorid = cursorid;
|
|
||||||
for(size_t i = 0; i < instances.size(); i++)
|
|
||||||
{
|
|
||||||
if(PartInstance* test = dynamic_cast<PartInstance*>(instances.at(i)))
|
|
||||||
{
|
|
||||||
float time = cameraController.getCamera()->worldRay(_dataModel->mousex, _dataModel->mousey, renderDevice->getViewport()).intersectionTime(test->getBox());
|
|
||||||
//float time = testRay.intersectionTime(test->getBox());
|
|
||||||
if (time != inf())
|
|
||||||
{
|
|
||||||
currentcursorid = cursorOvrid;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/*glBindTexture( GL_TEXTURE_2D, tool->getCursorId());
|
|
||||||
|
|
||||||
|
|
||||||
glBegin( GL_QUADS );
|
|
||||||
glTexCoord2d(0.0,0.0);
|
|
||||||
glVertex2f(mousepos.x-64, mousepos.y-64);
|
|
||||||
glTexCoord2d( 1.0,0.0 );
|
|
||||||
glVertex2f(mousepos.x+64, mousepos.y-64);
|
|
||||||
glTexCoord2d(1.0,1.0 );
|
|
||||||
glVertex2f(mousepos.x+64, mousepos.y+64 );
|
|
||||||
glTexCoord2d( 0.0,1.0 );
|
|
||||||
glVertex2f( mousepos.x-64, mousepos.y+64 );
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
glDisable( GL_TEXTURE_2D );*/
|
|
||||||
//}
|
|
||||||
|
|
||||||
/*rd->afterPrimitive();
|
|
||||||
rd->popState();*/
|
|
||||||
renderDevice->pop2D();
|
renderDevice->pop2D();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -732,7 +506,6 @@ void Application::onMouseMoved(int x,int y)
|
|||||||
mouse.oldy = mouse.y;
|
mouse.oldy = mouse.y;
|
||||||
mouse.x = x;
|
mouse.x = x;
|
||||||
mouse.y = y;
|
mouse.y = y;
|
||||||
//tool->onMouseMoved(mouse);
|
|
||||||
mouseMoveState = true;
|
mouseMoveState = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -741,39 +514,19 @@ void Application::onMouseWheel(int x,int y,short delta)
|
|||||||
if (mouseOnScreen==true)
|
if (mouseOnScreen==true)
|
||||||
if (cameraController.onMouseWheel(x, y, delta))
|
if (cameraController.onMouseWheel(x, y, delta))
|
||||||
{
|
{
|
||||||
AudioPlayer::playSound(cameraSound);
|
_dataModel->getSoundService()->playSound(_dataModel->getSoundService()->findFirstChild("Step"));
|
||||||
}
|
}
|
||||||
tool->onMouseScroll(mouse);
|
tool->onMouseScroll(mouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::run() {
|
void Application::run() {
|
||||||
g_usableApp = this;
|
g_usableApp = this;
|
||||||
//setDebugMode(false);
|
|
||||||
//debugController.setActive(false);
|
|
||||||
/*
|
|
||||||
if (!createWindowClass("ToolWindowClass",ToolProc,GetModuleHandle(0)))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
HWND propertyHWnd = CreateWindowEx(
|
|
||||||
WS_EX_TOOLWINDOW,"ToolWindowClass", "ToolWindow",
|
|
||||||
WS_SYSMENU | WS_VISIBLE | WS_CHILD,
|
|
||||||
0, 0, 800, 64,
|
|
||||||
hWndMain, NULL, GetModuleHandle(0), NULL);
|
|
||||||
|
|
||||||
ShowWindow(propertyHWnd,SW_SHOW);
|
|
||||||
*/
|
|
||||||
UpdateWindow(_hWndMain);
|
UpdateWindow(_hWndMain);
|
||||||
|
|
||||||
// Load objects here=
|
// Load objects here
|
||||||
|
|
||||||
Globals::surface = Texture::fromFile(GetFileInPath("/content/images/surfacebr.png"));
|
|
||||||
Globals::surfaceId = Globals::surface->getOpenGLID();
|
|
||||||
cameraSound = GetFileInPath("/content/sounds/SWITCH3.wav");
|
cameraSound = GetFileInPath("/content/sounds/SWITCH3.wav");
|
||||||
clickSound = GetFileInPath("/content/sounds/switch.wav");
|
clickSound = GetFileInPath("/content/sounds/switch.wav");
|
||||||
dingSound = GetFileInPath("/content/sounds/electronicpingshort.wav");
|
dingSound = GetFileInPath("/content/sounds/electronicpingshort.wav");
|
||||||
sky = Sky::create(NULL, ExePath() + "/content/sky/");
|
|
||||||
RealTime now=0, lastTime=0;
|
RealTime now=0, lastTime=0;
|
||||||
double simTimeRate = 1.0f;
|
double simTimeRate = 1.0f;
|
||||||
float fps=30.0f;
|
float fps=30.0f;
|
||||||
@@ -783,12 +536,7 @@ void Application::run() {
|
|||||||
RealTime lastWaitTime=0;
|
RealTime lastWaitTime=0;
|
||||||
|
|
||||||
MSG messages;
|
MSG messages;
|
||||||
//RECT cRect;
|
|
||||||
//GetClientRect(_hWndMain,&cRect);
|
|
||||||
//renderDevice->notifyResize(cRect.right,cRect.bottom);
|
|
||||||
//Rect2D viewportRect = Rect2D::xywh(0,0,cRect.right,cRect.bottom);
|
|
||||||
//renderDevice->setViewport(viewportRect);
|
|
||||||
//window()->setInputCaptureCount(1);
|
|
||||||
resizeWithParent(_hWndMain);
|
resizeWithParent(_hWndMain);
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
while (!quit)
|
while (!quit)
|
||||||
@@ -800,21 +548,15 @@ void Application::run() {
|
|||||||
|
|
||||||
m_userInputWatch.tick();
|
m_userInputWatch.tick();
|
||||||
onUserInput(userInput);
|
onUserInput(userInput);
|
||||||
//m_moduleManager->onUserInput(_userInput);
|
|
||||||
m_userInputWatch.tock();
|
m_userInputWatch.tock();
|
||||||
|
|
||||||
m_simulationWatch.tick();
|
m_simulationWatch.tick();
|
||||||
//debugController.doSimulation(clamp(timeStep, 0.0, 0.1));
|
|
||||||
//g3dCamera.setCoordinateFrame
|
|
||||||
//(debugController.getCoordinateFrame());
|
|
||||||
|
|
||||||
double rate = simTimeRate;
|
double rate = simTimeRate;
|
||||||
RealTime rdt = timeStep;
|
RealTime rdt = timeStep;
|
||||||
SimTime sdt = timeStep * rate;
|
SimTime sdt = timeStep * rate;
|
||||||
SimTime idt = desiredFrameDuration * rate;
|
SimTime idt = desiredFrameDuration * rate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
onSimulation(rdt,sdt,idt);
|
onSimulation(rdt,sdt,idt);
|
||||||
m_simulationWatch.tock();
|
m_simulationWatch.tock();
|
||||||
|
|
||||||
@@ -863,6 +605,13 @@ void Application::resizeWithParent(HWND parentWindow)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::resize3DView(int w, int h)
|
||||||
|
{
|
||||||
|
Rect2D newViewport = Rect2D::xywh(0, 0, w, h);
|
||||||
|
renderDevice->notifyResize(w, h);
|
||||||
|
renderDevice->setViewport(newViewport);
|
||||||
|
}
|
||||||
|
|
||||||
void Application::QuitApp()
|
void Application::QuitApp()
|
||||||
{
|
{
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
@@ -871,7 +620,4 @@ void Application::QuitApp()
|
|||||||
|
|
||||||
void Application::onCreate(HWND parentWindow)
|
void Application::onCreate(HWND parentWindow)
|
||||||
{
|
{
|
||||||
//SetWindowLongPtr(hwndRenderer,GWL_USERDATA,(LONG)this);
|
}
|
||||||
//SetWindowLongPtr(hwndToolbox,GWL_USERDATA,(LONG)this);
|
|
||||||
//SetWindowLongPtr(hwndMain,GWL_USERDATA,(LONG)&app);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
#include "AudioPlayer.h"
|
#include "AudioPlayer.h"
|
||||||
#include "SDL.h"
|
#include <Windows.h>
|
||||||
#include "SDL_audio.h"
|
#include <Mmsystem.h>
|
||||||
#include <stdlib.h>
|
#define NUM_SOUNDS 32
|
||||||
#include <malloc.h>
|
|
||||||
#include <string.h>
|
|
||||||
#define NUM_SOUNDS 10
|
|
||||||
static SDL_AudioSpec fmt;
|
|
||||||
static bool initiated = false;
|
static bool initiated = false;
|
||||||
|
|
||||||
AudioPlayer::AudioPlayer(void)
|
AudioPlayer::AudioPlayer(void)
|
||||||
@@ -15,98 +11,15 @@ AudioPlayer::AudioPlayer(void)
|
|||||||
|
|
||||||
AudioPlayer::~AudioPlayer(void)
|
AudioPlayer::~AudioPlayer(void)
|
||||||
{
|
{
|
||||||
SDL_CloseAudio();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioPlayer::init()
|
void AudioPlayer::init()
|
||||||
{
|
{
|
||||||
initiated = true;
|
initiated = true;
|
||||||
extern void mixaudio(void *unused, Uint8 *stream, int len);
|
|
||||||
fmt.freq = 22050;
|
|
||||||
fmt.format = AUDIO_S16;
|
|
||||||
fmt.channels = 2;
|
|
||||||
fmt.samples = 1024; /* A good value for games */
|
|
||||||
fmt.callback = mixaudio;
|
|
||||||
fmt.userdata = NULL;
|
|
||||||
|
|
||||||
/* Open the audio device and start playing sound! */
|
|
||||||
if ( SDL_OpenAudio(&fmt, NULL) < 0 ) {
|
|
||||||
fprintf(stderr, "Unable to open audio: %s\n", SDL_GetError());
|
|
||||||
}
|
|
||||||
SDL_PauseAudio(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct sample {
|
|
||||||
Uint8 *data;
|
|
||||||
Uint32 dpos;
|
|
||||||
Uint32 dlen;
|
|
||||||
} sounds[NUM_SOUNDS];
|
|
||||||
|
|
||||||
void mixaudio(void *unused, Uint8 *stream, int len)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
Uint32 amount;
|
|
||||||
|
|
||||||
for ( i=0; i<NUM_SOUNDS; ++i ) {
|
|
||||||
amount = (sounds[i].dlen-sounds[i].dpos);
|
|
||||||
if ( amount > (Uint32)len ) {
|
|
||||||
amount = len;
|
|
||||||
}
|
|
||||||
SDL_MixAudio(stream, &sounds[i].data[sounds[i].dpos], amount, SDL_MIX_MAXVOLUME);
|
|
||||||
sounds[i].dpos += amount;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioPlayer::playSound(std::string fileString)
|
void AudioPlayer::playSound(std::string fileString)
|
||||||
{
|
{
|
||||||
|
//TODO probably use something a bit better
|
||||||
if(initiated)
|
PlaySound(fileString.c_str(), NULL, SND_FILENAME | SND_ASYNC);
|
||||||
{
|
|
||||||
char *file = new char[fileString.length() + 1];
|
|
||||||
strcpy(file, fileString.c_str());
|
|
||||||
|
|
||||||
|
|
||||||
int index;
|
|
||||||
SDL_AudioSpec wave;
|
|
||||||
Uint8 *data;
|
|
||||||
Uint32 dlen;
|
|
||||||
SDL_AudioCVT cvt;
|
|
||||||
|
|
||||||
/* Look for an empty (or finished) sound slot */
|
|
||||||
for ( index=0; index<NUM_SOUNDS; ++index ) {
|
|
||||||
if ( sounds[index].dpos == sounds[index].dlen ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( index == NUM_SOUNDS )
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Load the sound file and convert it to 16-bit stereo at 22kHz */
|
|
||||||
if ( SDL_LoadWAV(file, &wave, &data, &dlen) == NULL ) {
|
|
||||||
fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SDL_BuildAudioCVT(&cvt, wave.format, wave.channels, wave.freq,
|
|
||||||
AUDIO_S16, 2, fmt.freq);
|
|
||||||
cvt.buf = (Uint8*)malloc(dlen*cvt.len_mult);
|
|
||||||
memcpy(cvt.buf, data, dlen);
|
|
||||||
cvt.len = dlen;
|
|
||||||
SDL_ConvertAudio(&cvt);
|
|
||||||
SDL_FreeWAV(data);
|
|
||||||
|
|
||||||
/* Put the sound data in the slot (it starts playing immediately) */
|
|
||||||
if ( sounds[index].data ) {
|
|
||||||
free(sounds[index].data);
|
|
||||||
}
|
|
||||||
SDL_LockAudio();
|
|
||||||
sounds[index].data = cvt.buf;
|
|
||||||
sounds[index].dlen = cvt.len_cvt;
|
|
||||||
sounds[index].dpos = 0;
|
|
||||||
SDL_UnlockAudio();
|
|
||||||
delete [] file;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OutputDebugString("Audio player not initialized, sound will not play\r\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
#include "DataModel/BaseButtonInstance.h"
|
|
||||||
#include "Globals.h"
|
|
||||||
#include "Application.h"
|
|
||||||
|
|
||||||
|
|
||||||
ButtonListener* listener = NULL;
|
|
||||||
|
|
||||||
BaseButtonInstance::BaseButtonInstance(void)
|
|
||||||
{
|
|
||||||
Instance::Instance();
|
|
||||||
listener = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseButtonInstance::render(RenderDevice* rd)
|
|
||||||
{
|
|
||||||
DataModelInstance* dataModel = g_dataModel;
|
|
||||||
Vector2 pos = Vector2(g_usableApp->mouse.x,g_usableApp->mouse.y);
|
|
||||||
drawObj(rd, pos, g_usableApp->mouse.isMouseDown());
|
|
||||||
Instance::render(rd);
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseButtonInstance::~BaseButtonInstance(void)
|
|
||||||
{
|
|
||||||
if(listener != NULL && listener->doDelete)
|
|
||||||
{
|
|
||||||
delete listener;
|
|
||||||
listener = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseButtonInstance::setButtonListener(ButtonListener& buttonListener)
|
|
||||||
{
|
|
||||||
listener = buttonListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown){}
|
|
||||||
|
|
||||||
bool BaseButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd){return false;}
|
|
||||||
|
|
||||||
void BaseButtonInstance::onMouseClick()
|
|
||||||
{
|
|
||||||
if(listener != NULL)
|
|
||||||
{
|
|
||||||
listener->onButton1MouseClick(this);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool BaseButtonInstance::mouseInArea(float point1x, float point1y, float point2x, float point2y, float mousex, float mousey)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(mousex >= point1x && mousey >= point1y)
|
|
||||||
{
|
|
||||||
if(mousex < point2x && mousey < point2y)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -1,613 +0,0 @@
|
|||||||
#include <string>
|
|
||||||
#include "DataModel/GuiRootInstance.h"
|
|
||||||
#include "DataModel/DataModelInstance.h"
|
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <sstream>
|
|
||||||
#include <commdlg.h>
|
|
||||||
#include "ErrorFunctions.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace rapidxml;
|
|
||||||
|
|
||||||
|
|
||||||
DataModelInstance::DataModelInstance(void)
|
|
||||||
{
|
|
||||||
Instance::Instance();
|
|
||||||
workspace = new WorkspaceInstance();
|
|
||||||
guiRoot = new GuiRootInstance();
|
|
||||||
level = new LevelInstance();
|
|
||||||
//children.push_back(workspace);
|
|
||||||
//children.push_back(level);
|
|
||||||
className = "dataModel";
|
|
||||||
//mousex = 0;
|
|
||||||
//mousey = 0;
|
|
||||||
//mouseButton1Down = false;
|
|
||||||
showMessage = false;
|
|
||||||
canDelete = false;
|
|
||||||
_modY=0;
|
|
||||||
workspace->setParent(this);
|
|
||||||
level->setParent(this);
|
|
||||||
_loadedFileName="..//skooter.rbxm";
|
|
||||||
listicon = 5;
|
|
||||||
running = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DataModelInstance::toggleRun()
|
|
||||||
{
|
|
||||||
running = !running;
|
|
||||||
}
|
|
||||||
bool DataModelInstance::isRunning()
|
|
||||||
{
|
|
||||||
return running;
|
|
||||||
}
|
|
||||||
|
|
||||||
DataModelInstance::~DataModelInstance(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
void DataModelInstance::modXMLLevel(float modY)
|
|
||||||
{
|
|
||||||
_modY += modY;
|
|
||||||
clearLevel();
|
|
||||||
debugGetOpen();
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void DataModelInstance::clearLevel()
|
|
||||||
{
|
|
||||||
workspace->clearChildren();
|
|
||||||
}
|
|
||||||
PartInstance* DataModelInstance::makePart()
|
|
||||||
{
|
|
||||||
PartInstance* part = new PartInstance();
|
|
||||||
return part;
|
|
||||||
}
|
|
||||||
|
|
||||||
rapidxml::xml_node<>* DataModelInstance::getNode(xml_node<> * node,const char* name)
|
|
||||||
{
|
|
||||||
xml_node<> * tempNode = node->first_node(name);
|
|
||||||
if (!tempNode)
|
|
||||||
{
|
|
||||||
_errMsg = "Expected <";
|
|
||||||
_errMsg += name;
|
|
||||||
_errMsg+="> tag.";
|
|
||||||
_successfulLoad=false;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return tempNode;
|
|
||||||
}
|
|
||||||
float DataModelInstance::getFloatValue(xml_node<> * node,const char* name)
|
|
||||||
{
|
|
||||||
xml_node<> * tempNode = node->first_node(name);
|
|
||||||
if (!tempNode)
|
|
||||||
{
|
|
||||||
_errMsg = "Expected <";
|
|
||||||
_errMsg += name;
|
|
||||||
_errMsg+="> tag.";
|
|
||||||
_successfulLoad=false;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
float newFloat;
|
|
||||||
stringstream converter;
|
|
||||||
converter << tempNode->value();
|
|
||||||
converter >> newFloat;
|
|
||||||
return newFloat;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Color3 bcToRGB(short bc)
|
|
||||||
{
|
|
||||||
switch(bc)
|
|
||||||
{
|
|
||||||
case 1: return Color3(0.94901967048645F,0.95294123888016F,0.95294123888016F);
|
|
||||||
case 2: return Color3(0.63137257099152F,0.64705884456635F,0.63529413938522F);
|
|
||||||
case 3: return Color3(0.9764706492424F,0.91372555494308F,0.60000002384186F);
|
|
||||||
case 5: return Color3(0.84313732385635F,0.77254909276962F,0.60392159223557F);
|
|
||||||
case 6: return Color3(0.7607843875885F,0.85490202903748F,0.72156864404678F);
|
|
||||||
case 9: return Color3(0.90980398654938F,0.7294117808342F,0.78431379795074F);
|
|
||||||
case 11: return Color3(0.50196081399918F,0.73333334922791F,0.85882359743118F);
|
|
||||||
case 12: return Color3(0.79607850313187F,0.51764708757401F,0.258823543787F);
|
|
||||||
case 18: return Color3(0.80000007152557F,0.55686277151108F,0.41176474094391F);
|
|
||||||
case 21: return Color3(0.76862752437592F,0.15686275064945F,0.10980392992496F);
|
|
||||||
case 22: return Color3(0.76862752437592F,0.43921571969986F,0.62745100259781F);
|
|
||||||
case 23: return Color3(0.050980396568775F,0.41176474094391F,0.6745098233223F);
|
|
||||||
case 24: return Color3(0.96078437566757F,0.80392163991928F,0.18823531270027F);
|
|
||||||
case 25: return Color3(0.38431376218796F,0.27843138575554F,0.19607844948769F);
|
|
||||||
case 26: return Color3(0.10588236153126F,0.16470588743687F,0.20784315466881F);
|
|
||||||
case 27: return Color3(0.42745101451874F,0.43137258291245F,0.42352944612503F);
|
|
||||||
case 28: return Color3(0.15686275064945F,0.49803924560547F,0.27843138575554F);
|
|
||||||
case 29: return Color3(0.63137257099152F,0.76862752437592F,0.54901963472366F);
|
|
||||||
case 36: return Color3(0.95294123888016F,0.8117647767067F,0.60784316062927F);
|
|
||||||
case 37: return Color3(0.29411765933037F,0.59215688705444F,0.29411765933037F);
|
|
||||||
case 38: return Color3(0.62745100259781F,0.37254902720451F,0.20784315466881F);
|
|
||||||
case 39: return Color3(0.75686281919479F,0.79215693473816F,0.8705883026123F);
|
|
||||||
case 40: return Color3(0.92549026012421F,0.92549026012421F,0.92549026012421F);
|
|
||||||
case 41: return Color3(0.80392163991928F,0.32941177487373F,0.29411765933037F);
|
|
||||||
case 42: return Color3(0.75686281919479F,0.87450987100601F,0.94117653369904F);
|
|
||||||
case 43: return Color3(0.48235297203064F,0.71372550725937F,0.90980398654938F);
|
|
||||||
case 44: return Color3(0.96862751245499F,0.94509810209274F,0.55294120311737F);
|
|
||||||
case 45: return Color3(0.70588237047195F,0.82352948188782F,0.89411771297455F);
|
|
||||||
case 47: return Color3(0.85098046064377F,0.52156865596771F,0.42352944612503F);
|
|
||||||
case 48: return Color3(0.51764708757401F,0.71372550725937F,0.55294120311737F);
|
|
||||||
case 49: return Color3(0.97254908084869F,0.94509810209274F,0.51764708757401F);
|
|
||||||
case 50: return Color3(0.92549026012421F,0.90980398654938F,0.8705883026123F);
|
|
||||||
case 100: return Color3(0.93333339691162F,0.76862752437592F,0.71372550725937F);
|
|
||||||
case 101: return Color3(0.85490202903748F,0.52549022436142F,0.47843140363693F);
|
|
||||||
case 102: return Color3(0.43137258291245F,0.60000002384186F,0.79215693473816F);
|
|
||||||
case 103: return Color3(0.78039222955704F,0.75686281919479F,0.71764707565308F);
|
|
||||||
case 104: return Color3(0.41960787773132F,0.19607844948769F,0.48627454042435F);
|
|
||||||
case 105: return Color3(0.88627457618713F,0.60784316062927F,0.25098040699959F);
|
|
||||||
case 106: return Color3(0.85490202903748F,0.52156865596771F,0.2549019753933F);
|
|
||||||
case 107: return Color3(0,0.56078433990479F,0.61176472902298F);
|
|
||||||
case 108: return Color3(0.4078431725502F,0.36078432202339F,0.26274511218071F);
|
|
||||||
case 110: return Color3(0.26274511218071F,0.32941177487373F,0.57647061347961F);
|
|
||||||
case 111: return Color3(0.74901962280273F,0.71764707565308F,0.69411766529083F);
|
|
||||||
case 112: return Color3(0.4078431725502F,0.45490199327469F,0.6745098233223F);
|
|
||||||
case 113: return Color3(0.89411771297455F,0.678431391716F,0.78431379795074F);
|
|
||||||
case 115: return Color3(0.78039222955704F,0.82352948188782F,0.23529413342476F);
|
|
||||||
case 116: return Color3(0.33333334326744F,0.64705884456635F,0.68627452850342F);
|
|
||||||
case 118: return Color3(0.71764707565308F,0.84313732385635F,0.83529418706894F);
|
|
||||||
case 119: return Color3(0.64313727617264F,0.74117648601532F,0.27843138575554F);
|
|
||||||
case 120: return Color3(0.85098046064377F,0.89411771297455F,0.65490198135376F);
|
|
||||||
case 121: return Color3(0.90588241815567F,0.6745098233223F,0.34509804844856F);
|
|
||||||
case 123: return Color3(0.82745105028152F,0.43529415130615F,0.29803922772408F);
|
|
||||||
case 124: return Color3(0.57254904508591F,0.22352942824364F,0.47058826684952F);
|
|
||||||
case 125: return Color3(0.91764712333679F,0.72156864404678F,0.57254904508591F);
|
|
||||||
case 126: return Color3(0.64705884456635F,0.64705884456635F,0.79607850313187F);
|
|
||||||
case 127: return Color3(0.86274516582489F,0.73725491762161F,0.50588238239288F);
|
|
||||||
case 128: return Color3(0.68235296010971F,0.47843140363693F,0.34901961684227F);
|
|
||||||
case 131: return Color3(0.61176472902298F,0.63921570777893F,0.65882354974747F);
|
|
||||||
case 133: return Color3(0.83529418706894F,0.45098042488098F,0.23921570181847F);
|
|
||||||
case 134: return Color3(0.84705889225006F,0.8666667342186F,0.33725491166115F);
|
|
||||||
case 135: return Color3(0.45490199327469F,0.52549022436142F,0.61568629741669F);
|
|
||||||
case 136: return Color3(0.52941179275513F,0.48627454042435F,0.56470590829849F);
|
|
||||||
case 137: return Color3(0.87843143939972F,0.59607845544815F,0.39215689897537F);
|
|
||||||
case 138: return Color3(0.58431375026703F,0.54117649793625F,0.45098042488098F);
|
|
||||||
case 140: return Color3(0.12549020349979F,0.22745099663734F,0.33725491166115F);
|
|
||||||
case 141: return Color3(0.15294118225574F,0.27450981736183F,0.17647059261799F);
|
|
||||||
case 143: return Color3(0.8117647767067F,0.88627457618713F,0.96862751245499F);
|
|
||||||
case 145: return Color3(0.47450983524323F,0.53333336114883F,0.63137257099152F);
|
|
||||||
case 146: return Color3(0.58431375026703F,0.55686277151108F,0.63921570777893F);
|
|
||||||
case 147: return Color3(0.57647061347961F,0.52941179275513F,0.40392160415649F);
|
|
||||||
case 148: return Color3(0.34117648005486F,0.34509804844856F,0.34117648005486F);
|
|
||||||
case 149: return Color3(0.086274512112141F,0.11372549831867F,0.19607844948769F);
|
|
||||||
case 150: return Color3(0.67058825492859F,0.678431391716F,0.6745098233223F);
|
|
||||||
case 151: return Color3(0.47058826684952F,0.56470590829849F,0.50980395078659F);
|
|
||||||
case 153: return Color3(0.58431375026703F,0.47450983524323F,0.46666669845581F);
|
|
||||||
case 154: return Color3(0.48235297203064F,0.1803921610117F,0.1843137294054F);
|
|
||||||
case 157: return Color3(1,0.96470594406128F,0.48235297203064F);
|
|
||||||
case 158: return Color3(0.88235300779343F,0.64313727617264F,0.7607843875885F);
|
|
||||||
case 168: return Color3(0.4588235616684F,0.42352944612503F,0.38431376218796F);
|
|
||||||
case 176: return Color3(0.59215688705444F,0.41176474094391F,0.35686275362968F);
|
|
||||||
case 178: return Color3(0.70588237047195F,0.51764708757401F,0.33333334326744F);
|
|
||||||
case 179: return Color3(0.53725492954254F,0.52941179275513F,0.53333336114883F);
|
|
||||||
case 180: return Color3(0.84313732385635F,0.66274511814117F,0.29411765933037F);
|
|
||||||
case 190: return Color3(0.9764706492424F,0.83921575546265F,0.1803921610117F);
|
|
||||||
case 191: return Color3(0.90980398654938F,0.67058825492859F,0.17647059261799F);
|
|
||||||
case 192: return Color3(0.41176474094391F,0.25098040699959F,0.15686275064945F);
|
|
||||||
case 193: return Color3(0.8117647767067F,0.37647062540054F,0.14117647707462F);
|
|
||||||
case 195: return Color3(0.27450981736183F,0.40392160415649F,0.64313727617264F);
|
|
||||||
case 196: return Color3(0.13725490868092F,0.27843138575554F,0.54509806632996F);
|
|
||||||
case 198: return Color3(0.55686277151108F,0.258823543787F,0.52156865596771F);
|
|
||||||
case 199: return Color3(0.38823533058167F,0.37254902720451F,0.38431376218796F);
|
|
||||||
case 200: return Color3(0.50980395078659F,0.54117649793625F,0.3647058904171F);
|
|
||||||
case 208: return Color3(0.89803928136826F,0.89411771297455F,0.87450987100601F);
|
|
||||||
case 209: return Color3(0.69019609689713F,0.55686277151108F,0.26666668057442F);
|
|
||||||
case 210: return Color3(0.43921571969986F,0.58431375026703F,0.47058826684952F);
|
|
||||||
case 211: return Color3(0.47450983524323F,0.70980393886566F,0.70980393886566F);
|
|
||||||
case 212: return Color3(0.6235294342041F,0.76470595598221F,0.91372555494308F);
|
|
||||||
case 213: return Color3(0.42352944612503F,0.50588238239288F,0.71764707565308F);
|
|
||||||
case 216: return Color3(0.56078433990479F,0.29803922772408F,0.16470588743687F);
|
|
||||||
case 217: return Color3(0.48627454042435F,0.36078432202339F,0.27450981736183F);
|
|
||||||
case 218: return Color3(0.58823531866074F,0.43921571969986F,0.6235294342041F);
|
|
||||||
case 219: return Color3(0.41960787773132F,0.38431376218796F,0.60784316062927F);
|
|
||||||
case 220: return Color3(0.65490198135376F,0.66274511814117F,0.80784320831299F);
|
|
||||||
case 221: return Color3(0.80392163991928F,0.38431376218796F,0.59607845544815F);
|
|
||||||
case 222: return Color3(0.89411771297455F,0.678431391716F,0.78431379795074F);
|
|
||||||
case 223: return Color3(0.86274516582489F,0.56470590829849F,0.58431375026703F);
|
|
||||||
case 224: return Color3(0.94117653369904F,0.83529418706894F,0.62745100259781F);
|
|
||||||
case 225: return Color3(0.9215686917305F,0.72156864404678F,0.49803924560547F);
|
|
||||||
case 226: return Color3(0.99215692281723F,0.91764712333679F,0.55294120311737F);
|
|
||||||
case 232: return Color3(0.49019610881805F,0.73333334922791F,0.8666667342186F);
|
|
||||||
case 268: return Color3(0.2039215862751F,0.16862745583057F,0.4588235616684F);
|
|
||||||
case 1001: return Color3(0.97254908084869F,0.97254908084869F,0.97254908084869F);
|
|
||||||
case 1002: return Color3(0.80392163991928F,0.80392163991928F,0.80392163991928F);
|
|
||||||
case 1003: return Color3(0.066666670143604F,0.066666670143604F,0.066666670143604F);
|
|
||||||
case 1004: return Color3(1,0,0);
|
|
||||||
case 1005: return Color3(1,0.68627452850342F,0);
|
|
||||||
case 1006: return Color3(0.70588237047195F,0.50196081399918F,1);
|
|
||||||
case 1007: return Color3(0.63921570777893F,0.29411765933037F,0.29411765933037F);
|
|
||||||
case 1008: return Color3(0.75686281919479F,0.74509805440903F,0.258823543787F);
|
|
||||||
case 1009: return Color3(1,1,0);
|
|
||||||
case 1010: return Color3(0,0,1);
|
|
||||||
case 1011: return Color3(0,0.12549020349979F,0.37647062540054F);
|
|
||||||
case 1012: return Color3(0.1294117718935F,0.32941177487373F,0.72549021244049F);
|
|
||||||
case 1013: return Color3(0.015686275437474F,0.68627452850342F,0.92549026012421F);
|
|
||||||
case 1014: return Color3(0.66666668653488F,0.33333334326744F,0);
|
|
||||||
case 1015: return Color3(0.66666668653488F,0,0.66666668653488F);
|
|
||||||
case 1016: return Color3(1,0.40000003576279F,0.80000007152557F);
|
|
||||||
case 1017: return Color3(1,0.68627452850342F,0);
|
|
||||||
case 1018: return Color3(0.070588238537312F,0.93333339691162F,0.83137261867523F);
|
|
||||||
case 1019: return Color3(0,1,1);
|
|
||||||
case 1020: return Color3(0,1,0);
|
|
||||||
case 1021: return Color3(0.22745099663734F,0.49019610881805F,0.082352943718433F);
|
|
||||||
case 1022: return Color3(0.49803924560547F,0.55686277151108F,0.39215689897537F);
|
|
||||||
case 1023: return Color3(0.54901963472366F,0.35686275362968F,0.6235294342041F);
|
|
||||||
case 1024: return Color3(0.68627452850342F,0.8666667342186F,1);
|
|
||||||
case 1025: return Color3(1,0.78823536634445F,0.78823536634445F);
|
|
||||||
case 1026: return Color3(0.69411766529083F,0.65490198135376F,1);
|
|
||||||
case 1027: return Color3(0.6235294342041F,0.95294123888016F,0.91372555494308F);
|
|
||||||
case 1028: return Color3(0.80000007152557F,1,0.80000007152557F);
|
|
||||||
case 1029: return Color3(1,1,0.80000007152557F);
|
|
||||||
case 1030: return Color3(1,0.80000007152557F,0.60000002384186F);
|
|
||||||
case 1031: return Color3(0.38431376218796F,0.14509804546833F,0.81960791349411F);
|
|
||||||
case 1032: return Color3(1,0,0.74901962280273F);
|
|
||||||
default: return Color3::gray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool DataModelInstance::scanXMLObject(xml_node<> * scanNode)
|
|
||||||
{
|
|
||||||
xml_node<> * watchFirstNode = scanNode->first_node();
|
|
||||||
|
|
||||||
for (xml_node<> *node = scanNode->first_node();node; node = node->next_sibling())
|
|
||||||
{
|
|
||||||
|
|
||||||
if (strncmp(node->name(),"Item",4)==0)
|
|
||||||
{
|
|
||||||
xml_attribute<> *classAttr = node->first_attribute("class");
|
|
||||||
std::string className = classAttr->value();
|
|
||||||
if (className=="Part") {
|
|
||||||
xml_node<> *propNode = node->first_node();
|
|
||||||
xml_node<> *cFrameNode=0;
|
|
||||||
xml_node<> *sizeNode=0;
|
|
||||||
xml_node<> *shapeNode=0;
|
|
||||||
xml_node<> *colorNode=0;
|
|
||||||
xml_node<> *brickColorNode=0;
|
|
||||||
xml_node<> *nameNode=0;
|
|
||||||
|
|
||||||
for (xml_node<> *partPropNode = propNode->first_node();partPropNode; partPropNode = partPropNode->next_sibling())
|
|
||||||
{
|
|
||||||
for (xml_attribute<> *attr = partPropNode->first_attribute();attr; attr = attr->next_attribute())
|
|
||||||
{
|
|
||||||
std::string xmlName = attr->name();
|
|
||||||
std::string xmlValue = attr->value();
|
|
||||||
|
|
||||||
if (xmlValue=="CFrame" | xmlValue=="CoordinateFrame")
|
|
||||||
{
|
|
||||||
cFrameNode = partPropNode;
|
|
||||||
}
|
|
||||||
if (xmlValue=="Name")
|
|
||||||
{
|
|
||||||
nameNode = partPropNode;
|
|
||||||
}
|
|
||||||
if (xmlValue=="shape")
|
|
||||||
{
|
|
||||||
shapeNode = partPropNode;
|
|
||||||
_legacyLoad=false;
|
|
||||||
}
|
|
||||||
if (xmlValue=="Color")
|
|
||||||
{
|
|
||||||
colorNode=partPropNode;
|
|
||||||
}
|
|
||||||
if (xmlValue=="BrickColor")
|
|
||||||
{
|
|
||||||
brickColorNode=partPropNode;
|
|
||||||
}
|
|
||||||
if (xmlValue=="size")
|
|
||||||
{
|
|
||||||
sizeNode = partPropNode;
|
|
||||||
_legacyLoad=false;
|
|
||||||
}
|
|
||||||
if (xmlValue=="Part")
|
|
||||||
{
|
|
||||||
for (xml_node<> *featureNode = partPropNode->first_node();featureNode; featureNode = featureNode->next_sibling())
|
|
||||||
{
|
|
||||||
for (xml_attribute<> *attr = featureNode->first_attribute();attr; attr = attr->next_attribute())
|
|
||||||
{
|
|
||||||
std::string xmlName = attr->name();
|
|
||||||
std::string xmlValue = attr->value();
|
|
||||||
if (xmlValue=="shape")
|
|
||||||
{
|
|
||||||
shapeNode = featureNode;
|
|
||||||
_legacyLoad=true;
|
|
||||||
}
|
|
||||||
if (xmlValue=="size")
|
|
||||||
{
|
|
||||||
sizeNode=featureNode;
|
|
||||||
_legacyLoad=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cFrameNode) {
|
|
||||||
_errMsg="CFrame is missing in Part";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!sizeNode) {
|
|
||||||
_errMsg="Size is missing in Part";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
float R=1;
|
|
||||||
float G=1;
|
|
||||||
float B=1;
|
|
||||||
|
|
||||||
if (colorNode)
|
|
||||||
{
|
|
||||||
R = getFloatValue(colorNode,"R");
|
|
||||||
G = getFloatValue(colorNode,"G");
|
|
||||||
B = getFloatValue(colorNode,"B");
|
|
||||||
}
|
|
||||||
|
|
||||||
Enum::Shape::Value partshape = Enum::Shape::Block;
|
|
||||||
std::string pshape = shapeNode->value();
|
|
||||||
if (shapeNode)
|
|
||||||
{
|
|
||||||
if(pshape == "0" || pshape == "Ball"){
|
|
||||||
partshape = Enum::Shape::Ball;
|
|
||||||
}
|
|
||||||
if(pshape == "1" || pshape == "Block"){
|
|
||||||
partshape = Enum::Shape::Block;
|
|
||||||
}
|
|
||||||
if(pshape == "2" || pshape == "Cylinder"){
|
|
||||||
partshape = Enum::Shape::Cylinder;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string newName = nameNode->value();
|
|
||||||
float X = getFloatValue(cFrameNode,"X");
|
|
||||||
float Y = getFloatValue(cFrameNode,"Y");
|
|
||||||
float Z = getFloatValue(cFrameNode,"Z");
|
|
||||||
float R00 = getFloatValue(cFrameNode,"R00");
|
|
||||||
float R01 = getFloatValue(cFrameNode,"R01");
|
|
||||||
float R02 = getFloatValue(cFrameNode,"R02");
|
|
||||||
float R10 = getFloatValue(cFrameNode,"R10");
|
|
||||||
float R11 = getFloatValue(cFrameNode,"R11");
|
|
||||||
float R12 = getFloatValue(cFrameNode,"R12");
|
|
||||||
float R20 = getFloatValue(cFrameNode,"R20");
|
|
||||||
float R21 = getFloatValue(cFrameNode,"R21");
|
|
||||||
float R22 = getFloatValue(cFrameNode,"R22");
|
|
||||||
|
|
||||||
float sizeX = getFloatValue(sizeNode,"X");
|
|
||||||
float sizeY = getFloatValue(sizeNode,"Y");
|
|
||||||
float sizeZ = getFloatValue(sizeNode,"Z");
|
|
||||||
//sizeX=1;
|
|
||||||
//sizeY=1;
|
|
||||||
//sizeZ=1;
|
|
||||||
if (_successfulLoad) {
|
|
||||||
PartInstance* test = makePart();
|
|
||||||
test->setParent(getWorkspace());
|
|
||||||
test->color = Color3(R,G,B);
|
|
||||||
test->shape = partshape;
|
|
||||||
if(brickColorNode)
|
|
||||||
{
|
|
||||||
test->color = bcToRGB(atoi(brickColorNode->value()));
|
|
||||||
}
|
|
||||||
test->setSize(Vector3(sizeX,sizeY+_modY,sizeZ));
|
|
||||||
test->setName(newName);
|
|
||||||
CoordinateFrame cf;
|
|
||||||
|
|
||||||
if (_legacyLoad)
|
|
||||||
{
|
|
||||||
|
|
||||||
cf = CoordinateFrame(Vector3(-X,Y,Z))*CoordinateFrame(Vector3(-sizeX/2,(sizeY+_modY)/2,sizeZ/2)*Matrix3(R00,R01,R02,R10,R11,R12,R20,R21,R22));
|
|
||||||
cf.rotation = Matrix3(R00,R01,R02,R10,R11,R12,R20,R21,R22);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cf.translation = Vector3(X,Y,Z);
|
|
||||||
cf.rotation = Matrix3(R00,R01,R02,R10,R11,R12,R20,R21,R22);
|
|
||||||
}
|
|
||||||
|
|
||||||
test->setCFrame(cf);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
for (xml_attribute<> *attr = node->first_attribute();attr; attr = attr->next_attribute())
|
|
||||||
{
|
|
||||||
std::string xmlName = attr->name();
|
|
||||||
std::string xmlValue = attr->value();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
scanXMLObject(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DataModelInstance::load(const char* filename, bool clearObjects)
|
|
||||||
{
|
|
||||||
ifstream levelFile(filename,ios::binary);
|
|
||||||
if (levelFile)
|
|
||||||
{
|
|
||||||
if (clearObjects)
|
|
||||||
clearLevel();
|
|
||||||
readXMLFileStream(&levelFile);
|
|
||||||
std::string sfilename = std::string(filename);
|
|
||||||
std::size_t begin = sfilename.rfind('\\') + 1;
|
|
||||||
std::size_t end = sfilename.find(".rbx");
|
|
||||||
std::string hname = sfilename.substr(begin);
|
|
||||||
std::string tname = hname.substr(0, hname.length() - 5);
|
|
||||||
name = tname;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::stringstream msg;
|
|
||||||
msg << "Failed to load file:" << std::endl << filename << std::endl << strerror(errno);
|
|
||||||
MessageBoxStr(msg.str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DataModelInstance::readXMLFileStream(std::ifstream* file)
|
|
||||||
{
|
|
||||||
file->seekg(0,file->end);
|
|
||||||
int length = file->tellg();
|
|
||||||
if (length<0)
|
|
||||||
{
|
|
||||||
MessageBoxStr("File is empty");
|
|
||||||
file->close();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
file->seekg(0,file->beg);
|
|
||||||
char * buffer = new char[length+1];
|
|
||||||
buffer[length]=0;
|
|
||||||
|
|
||||||
file->read(buffer,length);
|
|
||||||
file->close();
|
|
||||||
|
|
||||||
if (!file)
|
|
||||||
{
|
|
||||||
stringstream msg;
|
|
||||||
msg << "Something went wrong." << endl << strerror(errno);
|
|
||||||
MessageBoxStr(msg.str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
_successfulLoad = true;
|
|
||||||
xml_document<> doc;
|
|
||||||
doc.parse<0>(buffer);
|
|
||||||
xml_node<> *mainNode = doc.first_node();
|
|
||||||
_legacyLoad=false;
|
|
||||||
//std::string xmlName = mainNode->name();
|
|
||||||
//node = node->first_node();
|
|
||||||
//xmlName = node->name();
|
|
||||||
scanXMLObject(mainNode);
|
|
||||||
delete[] buffer;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DataModelInstance::debugGetOpen()
|
|
||||||
{
|
|
||||||
ifstream levelFile(_loadedFileName.c_str(),ios::binary);
|
|
||||||
if (levelFile)
|
|
||||||
readXMLFileStream(&levelFile);
|
|
||||||
else
|
|
||||||
getOpen();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool DataModelInstance::getOpen()
|
|
||||||
{
|
|
||||||
_modY=0;
|
|
||||||
OPENFILENAME of;
|
|
||||||
ZeroMemory( &of , sizeof( of));
|
|
||||||
of.lStructSize = sizeof(OPENFILENAME);
|
|
||||||
of.lpstrFilter = "Roblox Files\0*.rbxm;*.rbxl\0\0";
|
|
||||||
char szFile[512];
|
|
||||||
of.lpstrFile = szFile ;
|
|
||||||
of.lpstrFile[0]='\0';
|
|
||||||
of.nMaxFile=500;
|
|
||||||
of.lpstrTitle="Hello";
|
|
||||||
of.Flags = OFN_FILEMUSTEXIST;
|
|
||||||
ShowCursor(TRUE);
|
|
||||||
BOOL file = GetOpenFileName(&of);
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
_loadedFileName = of.lpstrFile;
|
|
||||||
load(of.lpstrFile,true);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
void DataModelInstance::setMessage(std::string msg)
|
|
||||||
{
|
|
||||||
message = msg;
|
|
||||||
isBrickCount = false;
|
|
||||||
showMessage = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DataModelInstance::clearMessage()
|
|
||||||
{
|
|
||||||
showMessage = false;
|
|
||||||
isBrickCount = false;
|
|
||||||
message = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
void DataModelInstance::setMessageBrickCount()
|
|
||||||
{
|
|
||||||
isBrickCount = true;
|
|
||||||
showMessage = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DataModelInstance::drawMessage(RenderDevice* rd)
|
|
||||||
{
|
|
||||||
if(isBrickCount)
|
|
||||||
{
|
|
||||||
int brickCount = 0;
|
|
||||||
int instCount = 0;
|
|
||||||
std::vector<Instance*> inst = getAllChildren();
|
|
||||||
for(size_t i = 0; i < inst.size(); i++)
|
|
||||||
{
|
|
||||||
if(PartInstance* moveTo = dynamic_cast<PartInstance*>(inst.at(i)))
|
|
||||||
{
|
|
||||||
brickCount++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
instCount++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
char brkc[12];
|
|
||||||
sprintf_s(brkc, "%d", brickCount);
|
|
||||||
char instc[12];
|
|
||||||
sprintf_s(instc, "%d", instCount);
|
|
||||||
message = "Bricks: ";
|
|
||||||
message += brkc;
|
|
||||||
message += " Snaps: ";
|
|
||||||
message += instc;
|
|
||||||
}
|
|
||||||
if(showMessage && !font.isNull())
|
|
||||||
{
|
|
||||||
int x = rd->getWidth()/2;
|
|
||||||
int y = rd->getHeight()/2;
|
|
||||||
int width = rd->getWidth()/2 + 100;
|
|
||||||
int height = width / 3;
|
|
||||||
Draw::box(Box(Vector3(x-(width/2), y-(height/2), 0), Vector3(x+(width/2), y+(height/2), 0)), rd, Color4::fromARGB(0x55B2B2B2), Color3::fromARGB(0xB2B2B2));
|
|
||||||
font->draw2D(rd, message, Vector2(x,y), height/8, Color3::white(), Color4::clear(), GFont::XALIGN_CENTER, GFont::YALIGN_CENTER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WorkspaceInstance* DataModelInstance::getWorkspace()
|
|
||||||
{
|
|
||||||
return workspace;
|
|
||||||
}
|
|
||||||
/*Vector2 DataModelInstance::getMousePos()
|
|
||||||
{
|
|
||||||
return Vector2(mousex,mousey);
|
|
||||||
}
|
|
||||||
void DataModelInstance::setMousePos(int x,int y)
|
|
||||||
{
|
|
||||||
mousex=x;
|
|
||||||
mousey=y;
|
|
||||||
}
|
|
||||||
void DataModelInstance::setMousePos(Vector2 pos)
|
|
||||||
{
|
|
||||||
mousex=pos.x;
|
|
||||||
mousey=pos.y;
|
|
||||||
}*/
|
|
||||||
GuiRootInstance* DataModelInstance::getGuiRoot()
|
|
||||||
{
|
|
||||||
return guiRoot;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LevelInstance* DataModelInstance::getLevel()
|
|
||||||
{
|
|
||||||
return level;
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
#include "DataModel/GroupInstance.h"
|
|
||||||
|
|
||||||
GroupInstance::GroupInstance(void)
|
|
||||||
{
|
|
||||||
PVInstance::PVInstance();
|
|
||||||
name = "Model";
|
|
||||||
className = "GroupInstance";
|
|
||||||
listicon = 12;
|
|
||||||
primaryPart = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupInstance::GroupInstance(const GroupInstance &oinst)
|
|
||||||
{
|
|
||||||
PVInstance::PVInstance(oinst);
|
|
||||||
name = "Model";
|
|
||||||
className = "GroupInstance";
|
|
||||||
listicon = 12;
|
|
||||||
primaryPart = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupInstance::~GroupInstance(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<PROPGRIDITEM> GroupInstance::getProperties()
|
|
||||||
{
|
|
||||||
std::vector<PROPGRIDITEM> properties = PVInstance::getProperties();
|
|
||||||
return properties;
|
|
||||||
}
|
|
||||||
void GroupInstance::PropUpdate(LPPROPGRIDITEM &pItem)
|
|
||||||
{
|
|
||||||
PVInstance::PropUpdate(pItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<Instance *> GroupInstance::unGroup()
|
|
||||||
{
|
|
||||||
std::vector<Instance *> child;
|
|
||||||
while(children.size() > 0)
|
|
||||||
{
|
|
||||||
child.push_back(children[0]);
|
|
||||||
children[0]->setParent(parent);
|
|
||||||
}
|
|
||||||
return child;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GroupInstance::render(RenderDevice * rd)
|
|
||||||
{
|
|
||||||
Instance::render(rd);
|
|
||||||
if(primaryPart != NULL && controllerFlagShown && getControllerColor(controller) != Color3::gray())
|
|
||||||
{
|
|
||||||
rd->disableLighting();
|
|
||||||
Vector3 vec = Vector3(0,0,0);
|
|
||||||
Vector3 up = Vector3(0,8,0);
|
|
||||||
rd->setColor(getControllerColor(controller));
|
|
||||||
rd->setObjectToWorldMatrix(primaryPart->cFrame);
|
|
||||||
rd->beforePrimitive();
|
|
||||||
|
|
||||||
glBegin(GL_LINES);
|
|
||||||
glVertex3f(vec.x, vec.y, vec.z);
|
|
||||||
glVertex3f(up.x, up.y, up.z);
|
|
||||||
glEnd();
|
|
||||||
|
|
||||||
glBegin( GL_TRIANGLES );
|
|
||||||
glVertex3f(up.x, up.y-2, up.z);
|
|
||||||
glVertex3f(up.x, up.y-1, up.z-2);
|
|
||||||
glVertex3f(up.x, up.y, up.z);
|
|
||||||
|
|
||||||
glVertex3f(up.x, up.y, up.z);
|
|
||||||
glVertex3f(up.x, up.y-1, up.z-2);
|
|
||||||
glVertex3f(up.x, up.y-2, up.z);
|
|
||||||
|
|
||||||
glEnd();
|
|
||||||
rd->afterPrimitive();
|
|
||||||
rd->setColor(Color3::white());
|
|
||||||
rd->enableLighting();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,538 +0,0 @@
|
|||||||
#include <iomanip>
|
|
||||||
#include <sstream>
|
|
||||||
#include "G3DAll.h"
|
|
||||||
#include "DataModel/BaseButtonInstance.h"
|
|
||||||
#include "DataModel/TextButtonInstance.h"
|
|
||||||
#include "DataModel/ImageButtonInstance.h"
|
|
||||||
#include "DataModel/ToggleImageButtonInstance.h"
|
|
||||||
#include "DataModel/GuiRootInstance.h"
|
|
||||||
#include "DataModel/ImageButtonInstance.h"
|
|
||||||
#include "Globals.h"
|
|
||||||
#include "StringFunctions.h"
|
|
||||||
|
|
||||||
#include "Listener/GUDButtonListener.h"
|
|
||||||
#include "Listener/ModeSelectionListener.h"
|
|
||||||
#include "Listener/MenuButtonListener.h"
|
|
||||||
#include "Listener/RotateButtonListener.h"
|
|
||||||
#include "Listener/CameraButtonListener.h"
|
|
||||||
#include "Listener/DeleteListener.h"
|
|
||||||
#include "Listener/ToolbarListener.h"
|
|
||||||
|
|
||||||
|
|
||||||
ImageButtonInstance* GuiRootInstance::makeImageButton(G3D::TextureRef newImage = NULL, G3D::TextureRef overImage = NULL, G3D::TextureRef downImage = NULL, G3D::TextureRef disableImage = NULL)
|
|
||||||
{
|
|
||||||
ImageButtonInstance* part = new ImageButtonInstance(newImage,overImage, downImage, disableImage);
|
|
||||||
// instances.push_back(part);
|
|
||||||
// instances_2D.push_back(part);
|
|
||||||
return part;
|
|
||||||
}
|
|
||||||
|
|
||||||
TextButtonInstance* GuiRootInstance::makeTextButton()
|
|
||||||
{
|
|
||||||
TextButtonInstance* part = new TextButtonInstance();
|
|
||||||
return part;
|
|
||||||
}
|
|
||||||
ToolbarListener * toolbar;
|
|
||||||
GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
|
|
||||||
{
|
|
||||||
toolbar = new ToolbarListener();
|
|
||||||
toolbar->doDelete = false;
|
|
||||||
g_fntdominant = GFont::fromFile(GetFileInPath("/content/font/dominant.fnt"));
|
|
||||||
g_fntlighttrek = GFont::fromFile(GetFileInPath("/content/font/lighttrek.fnt"));
|
|
||||||
|
|
||||||
//Bottom Left
|
|
||||||
TextButtonInstance* button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0, -24);
|
|
||||||
button->boxEnd = Vector2(80, 0);
|
|
||||||
button->floatBottom = true;
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3(0,255,255);
|
|
||||||
button->textOutlineColor = Color4::clear();
|
|
||||||
button->title = "Hopper";
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 3);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxOutlineColorOvr = Color3(0,255,255);
|
|
||||||
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
|
|
||||||
button->setButtonListener(toolbar);
|
|
||||||
toolbar->addButtonRef(button);
|
|
||||||
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0, -48);
|
|
||||||
button->boxEnd = Vector2(80, -24);
|
|
||||||
button->floatBottom = true;
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3(0,255,255);
|
|
||||||
button->textOutlineColor = Color4::clear();
|
|
||||||
button->title = "Controller";
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 3);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxOutlineColorOvr = Color3(0,255,255);
|
|
||||||
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
|
|
||||||
button->setButtonListener(toolbar);
|
|
||||||
toolbar->addButtonRef(button);
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0, -72);
|
|
||||||
button->boxEnd = Vector2(80, -48);
|
|
||||||
button->floatBottom = true;
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3(0,255,255);
|
|
||||||
button->textOutlineColor = Color4::clear();
|
|
||||||
button->title = "Color";
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 3);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxOutlineColorOvr = Color3(0,255,255);
|
|
||||||
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
|
|
||||||
button->setButtonListener(toolbar);
|
|
||||||
toolbar->addButtonRef(button);
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0, -96);
|
|
||||||
button->boxEnd = Vector2(80, -72);
|
|
||||||
button->floatBottom = true;
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3(0,255,255);
|
|
||||||
button->textOutlineColor = Color4::clear();
|
|
||||||
button->title = "Surface";
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 3);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxOutlineColorOvr = Color3(0,255,255);
|
|
||||||
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
|
|
||||||
button->setButtonListener(toolbar);
|
|
||||||
toolbar->addButtonRef(button);
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0, -120);
|
|
||||||
button->boxEnd = Vector2(80, -96);
|
|
||||||
button->floatBottom = true;
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3(0,255,255);
|
|
||||||
button->title = "Model";
|
|
||||||
button->selected = true;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 3);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxOutlineColorOvr = Color3(0,255,255);
|
|
||||||
button->boxColorDn = Color4(button->boxColor.r,button->boxColor.g,button->boxColor.b, 0.2F);
|
|
||||||
button->setButtonListener(toolbar);
|
|
||||||
toolbar->addButtonRef(button);
|
|
||||||
|
|
||||||
//Top bar
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0, 0);
|
|
||||||
button->boxEnd = Vector2(125, 25);
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3::white();
|
|
||||||
button->boxColor = Color4::clear();
|
|
||||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
|
||||||
button->title = "File";
|
|
||||||
button->textSize = 16;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 0);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
|
|
||||||
button->name = "file";
|
|
||||||
button->setButtonListener(new MenuButtonListener());
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(125, 0);
|
|
||||||
button->boxEnd = Vector2(250, 25);
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3::white();
|
|
||||||
button->boxColor = Color4::clear();
|
|
||||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
|
||||||
button->title = "Edit";
|
|
||||||
button->textSize = 16;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 0);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(250, 0);
|
|
||||||
button->boxEnd = Vector2(375, 25);
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3::white();
|
|
||||||
button->boxColor = Color4::clear();
|
|
||||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
|
||||||
button->title = "View";
|
|
||||||
button->textSize = 16;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 0);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(375, 0);
|
|
||||||
button->boxEnd = Vector2(500, 25);
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3::white();
|
|
||||||
button->boxColor = Color4::clear();
|
|
||||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
|
||||||
button->title = "Insert";
|
|
||||||
button->textSize = 16;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 0);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(500, 0);
|
|
||||||
button->boxEnd = Vector2(625, 25);
|
|
||||||
button->setParent(this);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->textColor = Color3::white();
|
|
||||||
button->boxColor = Color4::clear();
|
|
||||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
|
||||||
button->title = "Format";
|
|
||||||
button->textSize = 16;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 0);
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
|
|
||||||
|
|
||||||
|
|
||||||
//Menu
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0,215);
|
|
||||||
button->boxEnd = Vector2(80,235);
|
|
||||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
|
||||||
button->textColor = Color3::white();
|
|
||||||
button->boxColor = Color4::clear();
|
|
||||||
button->textSize = 12;
|
|
||||||
button->title = "Group";
|
|
||||||
button->name = "Group";
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->textColorDis = Color3(0.8F,0.8F,0.8F);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 0);
|
|
||||||
button->setParent(this);
|
|
||||||
button->setButtonListener(new GUDButtonListener());
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0,240);
|
|
||||||
button->boxEnd = Vector2(80,260);
|
|
||||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
|
||||||
button->textColor = Color3::white();
|
|
||||||
button->boxColor = Color4::clear();
|
|
||||||
button->textSize = 12;
|
|
||||||
button->title = "UnGroup";
|
|
||||||
button->name = "UnGroup";
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->textColorDis = Color3(0.8F,0.8F,0.8F);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 0);
|
|
||||||
button->setParent(this);
|
|
||||||
button->setButtonListener(new GUDButtonListener());
|
|
||||||
|
|
||||||
button = makeTextButton();
|
|
||||||
button->boxBegin = Vector2(0,265);
|
|
||||||
button->boxEnd = Vector2(80,285);
|
|
||||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
|
||||||
button->textColor = Color3::white();
|
|
||||||
button->boxColor = Color4::clear();
|
|
||||||
button->textSize = 12;
|
|
||||||
button->title = "Duplicate";
|
|
||||||
button->setAllColorsSame();
|
|
||||||
button->textColorDis = Color3(0.8F,0.8F,0.8F);
|
|
||||||
button->font = g_fntlighttrek;
|
|
||||||
button->fontLocationRelativeTo = Vector2(10, 0);
|
|
||||||
button->setParent(this);
|
|
||||||
button->name = "Duplicate";
|
|
||||||
button->setButtonListener(new GUDButtonListener());
|
|
||||||
|
|
||||||
ImageButtonInstance* instance = new ToggleImageButtonInstance(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Run.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Run_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Run_dn.png")),
|
|
||||||
NULL,
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Stop.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Stop_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Stop_dn.png"))
|
|
||||||
);
|
|
||||||
instance->setButtonListener(new MenuButtonListener());
|
|
||||||
instance->name = "go";
|
|
||||||
instance->size = Vector2(65,65);
|
|
||||||
instance->position = Vector2(6.5, 25);
|
|
||||||
instance->setParent(this);
|
|
||||||
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/ArrowTool.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/ArrowTool_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/ArrowTool_dn.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/ArrowTool_ds.png")));
|
|
||||||
instance->size = Vector2(50,50);
|
|
||||||
instance->position = Vector2(15, 90);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "Cursor";
|
|
||||||
instance->setButtonListener(new ModeSelectionListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(Texture::fromFile(GetFileInPath("/content/images/ScaleTool.png")),Texture::fromFile(GetFileInPath("/content/images/ScaleTool_ovr.png")),Texture::fromFile(GetFileInPath("/content/images/ScaleTool_dn.png")),Texture::fromFile(GetFileInPath("/content/images/ScaleTool_ds.png")));
|
|
||||||
instance->size = Vector2(40,40);
|
|
||||||
instance->position = Vector2(0, 140);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "Resize";
|
|
||||||
instance->setButtonListener(new ModeSelectionListener());
|
|
||||||
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/MoveTool.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/MoveTool_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/MoveTool_dn.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/MoveTool_ds.png")));
|
|
||||||
instance->size = Vector2(40,40);
|
|
||||||
instance->position = Vector2(40, 140);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "Arrows";
|
|
||||||
instance->setButtonListener(new ModeSelectionListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate_ovr.png")),
|
|
||||||
NULL,
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate_ds.png")));
|
|
||||||
instance->size = Vector2(30,30);
|
|
||||||
instance->position = Vector2(10, 175);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "Rotate";
|
|
||||||
instance->setButtonListener(new RotateButtonListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt_ovr.png")),
|
|
||||||
NULL,
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt_ds.png")));
|
|
||||||
instance->size = Vector2(30,30);
|
|
||||||
instance->position = Vector2(40, 175);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "Tilt";
|
|
||||||
instance->setButtonListener(new RotateButtonListener());
|
|
||||||
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Delete.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Delete_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Delete_dn.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/Delete_ds.png")));
|
|
||||||
instance->size = Vector2(40,46);
|
|
||||||
instance->position = Vector2(20, 284);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "Delete";
|
|
||||||
instance->setButtonListener(new DeleteListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraZoomIn.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraZoomIn_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraZoomIn_dn.png")));
|
|
||||||
instance->size = Vector2(34,25);
|
|
||||||
instance->floatBottom = true;
|
|
||||||
instance->floatRight = true;
|
|
||||||
instance->position = Vector2(-77, -90);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "ZoomIn";
|
|
||||||
instance->setButtonListener(new CameraButtonListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraZoomOut.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraZoomOut_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraZoomOut_dn.png")));
|
|
||||||
instance->size = Vector2(34,26);
|
|
||||||
instance->floatBottom = true;
|
|
||||||
instance->floatRight = true;
|
|
||||||
instance->position = Vector2(-77, -31);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "ZoomOut";
|
|
||||||
instance->setButtonListener(new CameraButtonListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraPanLeft.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraPanLeft_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraPanLeft_dn.png")));
|
|
||||||
instance->size = Vector2(34,34);
|
|
||||||
instance->floatBottom = true;
|
|
||||||
instance->floatRight = true;
|
|
||||||
instance->position = Vector2(-110, -50);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "PanLeft";
|
|
||||||
instance->setButtonListener(new CameraButtonListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraPanRight.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraPanRight_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraPanRight_dn.png")));
|
|
||||||
instance->size = Vector2(34,34);
|
|
||||||
instance->floatBottom = true;
|
|
||||||
instance->floatRight = true;
|
|
||||||
instance->position = Vector2(-45, -50);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "PanRight";
|
|
||||||
instance->setButtonListener(new CameraButtonListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraCenter.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraCenter_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraCenter_dn.png")));
|
|
||||||
instance->size = Vector2(34,20);
|
|
||||||
instance->floatBottom = true;
|
|
||||||
instance->floatRight = true;
|
|
||||||
instance->position = Vector2(-77, -60);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "CenterCam";
|
|
||||||
instance->setButtonListener(new CameraButtonListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraTiltUp.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraTiltUp_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraTiltUp_dn.png")));
|
|
||||||
instance->size = Vector2(24,24);
|
|
||||||
instance->floatBottom = true;
|
|
||||||
instance->floatRight = true;
|
|
||||||
instance->position = Vector2(-105, -75);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "TiltUp";
|
|
||||||
instance->setButtonListener(new CameraButtonListener());
|
|
||||||
|
|
||||||
instance = makeImageButton(
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraTiltDown.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraTiltDown_ovr.png")),
|
|
||||||
Texture::fromFile(GetFileInPath("/content/images/CameraTiltDown_dn.png")));
|
|
||||||
instance->size = Vector2(24,24);
|
|
||||||
instance->floatBottom = true;
|
|
||||||
instance->floatRight = true;
|
|
||||||
instance->position = Vector2(-40, -75);
|
|
||||||
instance->setParent(this);
|
|
||||||
instance->name = "TiltDown";
|
|
||||||
instance->setButtonListener(new CameraButtonListener());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GuiRootInstance::drawButtons(RenderDevice* rd)
|
|
||||||
{
|
|
||||||
rd->pushState();
|
|
||||||
rd->beforePrimitive();
|
|
||||||
//this->render(rd);
|
|
||||||
rd->afterPrimitive();
|
|
||||||
rd->popState();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GuiRootInstance::setDebugMessage(std::string msg, G3D::RealTime msgTime)
|
|
||||||
{
|
|
||||||
_messageTime = msgTime;
|
|
||||||
_message = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
//void GuiRootInstance::render(G3D::RenderDevice* renderDevice) {}
|
|
||||||
|
|
||||||
void GuiRootInstance::renderGUI(G3D::RenderDevice* rd, double fps)
|
|
||||||
{
|
|
||||||
//TODO--Move these to their own instance
|
|
||||||
|
|
||||||
std::stringstream stream;
|
|
||||||
stream << std::fixed << std::setprecision(1) << g_dataModel->getLevel()->timer;
|
|
||||||
g_fntdominant->draw2D(rd, "Timer: " + stream.str(), Vector2(rd->getWidth() - 120, 25), 20, Color3::fromARGB(0x81C518), Color3::black());
|
|
||||||
g_fntdominant->draw2D(rd, "Score: " + Convert(g_dataModel->getLevel()->score), Vector2(rd->getWidth() - 120, 50), 20, Color3::fromARGB(0x81C518), Color3::black());
|
|
||||||
//FPS
|
|
||||||
#ifdef _DEBUG
|
|
||||||
stream.str("");
|
|
||||||
stream.clear();
|
|
||||||
stream << std::fixed << std::setprecision(3) << fps;
|
|
||||||
g_fntdominant->draw2D(rd, "FPS: " + stream.str(), Vector2(120, 25), 10, Color3::fromARGB(0xFFFF00), Color3::black());
|
|
||||||
#endif
|
|
||||||
//GUI Boxes
|
|
||||||
Draw::box(G3D::Box(Vector3(0,25,0),Vector3(80,355,0)),rd,Color4(0.6F,0.6F,0.6F,0.4F), Color4(0,0,0,0));
|
|
||||||
Draw::box(G3D::Box(Vector3(rd->getWidth() - 120,rd->getHeight() - 117,0),Vector3(rd->getWidth(),rd->getHeight(),0)),rd,Color4(0.6F,0.6F,0.6F,0.4F), Color4(0,0,0,0));
|
|
||||||
|
|
||||||
//Camera menu title
|
|
||||||
g_fntlighttrek->draw2D(rd, "CameraMenu", Vector2(rd->getWidth()-(g_fntlighttrek->get2DStringBounds("CameraMenu", 14).x+1),rd->getHeight() - 120), 14, Color3::white(), Color4(0.5F,0.5F,0.5F,0.5F));
|
|
||||||
|
|
||||||
//Tools menu
|
|
||||||
Draw::box(G3D::Box(Vector3(5, 210,0),Vector3(75, 210,0)),rd,Color4(0.6F,0.6F,0.6F,0.4F), Color4(0.6F,0.6F,0.6F,0.4F));
|
|
||||||
g_fntlighttrek->draw2D(rd,"MENU", Vector2(10,332), 14, Color3::white(), Color4(0.5F,0.5F,0.5F,0.5F));
|
|
||||||
|
|
||||||
|
|
||||||
//drawButtons(rd);
|
|
||||||
if(System::time() - 3 < _messageTime)
|
|
||||||
{
|
|
||||||
g_fntdominant->draw2D(rd, _message, Vector2((rd->getWidth()/2)-(g_fntdominant->get2DStringBounds(_message, 20).x/2),(rd->getHeight()/2)-(g_fntdominant->get2DStringBounds(_message, 20).y/2)), 20, Color3::yellow(), Color3::black());
|
|
||||||
}
|
|
||||||
|
|
||||||
g_dataModel->drawMessage(rd);
|
|
||||||
render(rd);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GuiRootInstance::mouseInGUI(G3D::RenderDevice* renderDevice,int x,int y)
|
|
||||||
{
|
|
||||||
std::vector<Instance*> instances_2D = g_dataModel->getGuiRoot()->getAllChildren();
|
|
||||||
for(size_t i = 0; i < instances_2D.size(); i++)
|
|
||||||
{
|
|
||||||
if(BaseButtonInstance* button = dynamic_cast<BaseButtonInstance*>(instances_2D.at(i)))
|
|
||||||
{
|
|
||||||
if(button->mouseInButton(x,y, renderDevice))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GuiRootInstance::update()
|
|
||||||
{
|
|
||||||
Instance * obj6 = this->findFirstChild("Delete");
|
|
||||||
Instance * obj = this->findFirstChild("Duplicate");
|
|
||||||
Instance * obj2 = this->findFirstChild("Group");
|
|
||||||
Instance * obj3 = this->findFirstChild("UnGroup");
|
|
||||||
Instance * obj4 = this->findFirstChild("Rotate");
|
|
||||||
Instance * obj5 = this->findFirstChild("Tilt");
|
|
||||||
if(obj != NULL && obj2 != NULL && obj3 != NULL && obj4 !=NULL && obj5 != NULL && obj6 != NULL)
|
|
||||||
{
|
|
||||||
BaseButtonInstance* button = (BaseButtonInstance*)obj;
|
|
||||||
BaseButtonInstance* button2 = (BaseButtonInstance*)obj2;
|
|
||||||
BaseButtonInstance* button3 = (BaseButtonInstance*)obj3;
|
|
||||||
BaseButtonInstance* button4 = (BaseButtonInstance*)obj4;
|
|
||||||
BaseButtonInstance* button5 = (BaseButtonInstance*)obj5;
|
|
||||||
BaseButtonInstance* button6 = (BaseButtonInstance*)obj6;
|
|
||||||
button->disabled = true;
|
|
||||||
button2->disabled = true;
|
|
||||||
button3->disabled = true;
|
|
||||||
button4->disabled = true;
|
|
||||||
button5->disabled = true;
|
|
||||||
button6->disabled = true;
|
|
||||||
for(size_t i = 0; i < g_selectedInstances.size(); i++)
|
|
||||||
if(g_selectedInstances.at(i)->canDelete)
|
|
||||||
{
|
|
||||||
button->disabled = false;
|
|
||||||
button2->disabled = false;
|
|
||||||
button3->disabled = false;
|
|
||||||
button4->disabled = false;
|
|
||||||
button5->disabled = false;
|
|
||||||
button6->disabled = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GuiRootInstance::~GuiRootInstance()
|
|
||||||
{
|
|
||||||
delete toolbar;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GuiRootInstance::onMouseLeftUp(G3D::RenderDevice* renderDevice, int x,int y)
|
|
||||||
{
|
|
||||||
std::vector<Instance*> instances_2D = this->getAllChildren();
|
|
||||||
for(size_t i = 0; i < instances_2D.size(); i++)
|
|
||||||
{
|
|
||||||
if(BaseButtonInstance* button = dynamic_cast<BaseButtonInstance*>(instances_2D[i]))
|
|
||||||
{
|
|
||||||
if(button->mouseInButton(x, y, renderDevice))
|
|
||||||
{
|
|
||||||
button->onMouseClick();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
#include "DataModel/ImageButtonInstance.h"
|
|
||||||
|
|
||||||
ImageButtonInstance::ImageButtonInstance(G3D::TextureRef newImage, G3D::TextureRef overImage = NULL, G3D::TextureRef downImage = NULL, G3D::TextureRef disableImage = NULL)
|
|
||||||
{
|
|
||||||
BaseButtonInstance::BaseButtonInstance();
|
|
||||||
image = newImage;
|
|
||||||
openGLID = image->getOpenGLID();
|
|
||||||
image_ovr = overImage;
|
|
||||||
if(!image_ovr.isNull())
|
|
||||||
openGLID_ovr = image_ovr->getOpenGLID();
|
|
||||||
image_dn = downImage;
|
|
||||||
if(!image_dn.isNull())
|
|
||||||
openGLID_dn = image_dn->getOpenGLID();
|
|
||||||
image_ds = disableImage;
|
|
||||||
if(!image_ds.isNull())
|
|
||||||
openGLID_ds = image_ds->getOpenGLID();
|
|
||||||
Vector2 size = Vector2(0,0);
|
|
||||||
Vector2 position = Vector2(0,0);
|
|
||||||
floatCenter = false;
|
|
||||||
floatBottom = false;
|
|
||||||
floatRight = false;
|
|
||||||
disabled = false;
|
|
||||||
className = "ImageButton";
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageButtonInstance::~ImageButtonInstance(void)
|
|
||||||
{
|
|
||||||
//Delete everything on destruction
|
|
||||||
image.~ReferenceCountedPointer();
|
|
||||||
delete image.getPointer();
|
|
||||||
image_ovr.~ReferenceCountedPointer();
|
|
||||||
delete image_ovr.getPointer();
|
|
||||||
image_ds.~ReferenceCountedPointer();
|
|
||||||
delete image_ds.getPointer();
|
|
||||||
image_dn.~ReferenceCountedPointer();
|
|
||||||
delete image_dn.getPointer();
|
|
||||||
image = NULL;
|
|
||||||
image_ovr = NULL;
|
|
||||||
image_ds = NULL;
|
|
||||||
image_dn = NULL;
|
|
||||||
delete listener;
|
|
||||||
listener = NULL;
|
|
||||||
selected = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ImageButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd)
|
|
||||||
{
|
|
||||||
Vector2 positionRelative = position;
|
|
||||||
if(floatRight && floatBottom)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(rd->getWidth() + position.x, rd->getHeight() + position.y);
|
|
||||||
}
|
|
||||||
else if(floatBottom)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(position.x, rd->getHeight() + position.y);
|
|
||||||
}
|
|
||||||
else if(floatRight)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(rd->getWidth() + position.x, position.y);
|
|
||||||
}
|
|
||||||
if(mousex >= positionRelative.x && mousey >= positionRelative.y)
|
|
||||||
{
|
|
||||||
if(mousex < positionRelative.x + size.x && mousey < positionRelative.y + size.y)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImageButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown)
|
|
||||||
{
|
|
||||||
bool drawDisabledBox = false;
|
|
||||||
Vector2 positionRelative = position;
|
|
||||||
if(floatRight && floatBottom)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(rd->getWidth() + position.x, rd->getHeight() + position.y);
|
|
||||||
}
|
|
||||||
else if(floatBottom)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(position.x, rd->getHeight() + position.y);
|
|
||||||
}
|
|
||||||
else if(floatRight)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(rd->getWidth() + position.x, position.y);
|
|
||||||
}
|
|
||||||
int renderimage = openGLID;
|
|
||||||
if(selected == true && !image_dn.isNull() && !disabled)
|
|
||||||
{
|
|
||||||
renderimage = openGLID_dn;
|
|
||||||
}
|
|
||||||
else if(disabled)
|
|
||||||
{
|
|
||||||
if(!image_ds.isNull())
|
|
||||||
renderimage = openGLID_ds;
|
|
||||||
else
|
|
||||||
drawDisabledBox = true;
|
|
||||||
}
|
|
||||||
else if(mouseInArea(positionRelative.x, positionRelative.y, positionRelative.x + size.x, positionRelative.y + size.y, mousePos.x, mousePos.y))
|
|
||||||
{
|
|
||||||
if(mouseDown && !image_dn.isNull())
|
|
||||||
{
|
|
||||||
renderimage = openGLID_dn;
|
|
||||||
}
|
|
||||||
else if(!image_ovr.isNull())
|
|
||||||
{
|
|
||||||
renderimage = openGLID_ovr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
glEnable( GL_TEXTURE_2D );
|
|
||||||
glEnable(GL_BLEND);// you enable blending function
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
glBindTexture( GL_TEXTURE_2D, renderimage);
|
|
||||||
glBegin( GL_QUADS );
|
|
||||||
glTexCoord2d(0.0,0.0);
|
|
||||||
glVertex2f( positionRelative.x, positionRelative.y );
|
|
||||||
glTexCoord2d( 1.0,0.0 );
|
|
||||||
glVertex2f( positionRelative.x + size.x, positionRelative.y );
|
|
||||||
glTexCoord2d( 1.0,1.0 );
|
|
||||||
glVertex2f( positionRelative.x + size.x, positionRelative.y + size.y );
|
|
||||||
glTexCoord2d( 0.0,1.0 );
|
|
||||||
glVertex2f( positionRelative.x, positionRelative.y + size.y );
|
|
||||||
glEnd();
|
|
||||||
glDisable( GL_TEXTURE_2D );
|
|
||||||
|
|
||||||
if(drawDisabledBox)
|
|
||||||
{
|
|
||||||
Draw::box(Box(Vector3(positionRelative.x, positionRelative.y, 0), Vector3(positionRelative.x+size.x, positionRelative.y+size.y, 0)), rd, Color4(0.7F,0.7F,0.7F,0.3F), Color4::clear());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
#define WINVER 0x0400
|
|
||||||
#include <G3DAll.h>
|
|
||||||
#include "DataModel/Instance.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Instance::Instance(void)
|
|
||||||
{
|
|
||||||
parent = NULL;
|
|
||||||
name = "Default Game Instance";
|
|
||||||
className = "BaseInstance";
|
|
||||||
listicon = 1;
|
|
||||||
canDelete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Instance::Instance(const Instance &oinst)
|
|
||||||
{
|
|
||||||
|
|
||||||
name = oinst.name;
|
|
||||||
className = oinst.className;
|
|
||||||
canDelete = oinst.canDelete;
|
|
||||||
listicon = oinst.listicon;
|
|
||||||
//setParent(oinst.parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Instance::render(RenderDevice* rd)
|
|
||||||
{
|
|
||||||
for(size_t i = 0; i < children.size(); i++)
|
|
||||||
{
|
|
||||||
children[i]->render(rd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::update()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
PROPGRIDITEM Instance::createPGI(LPSTR catalog, LPSTR propName, LPSTR propDesc, LPARAM curVal, INT type, TCHAR choices[])
|
|
||||||
{
|
|
||||||
PROPGRIDITEM pItem;
|
|
||||||
PropGrid_ItemInit(pItem);
|
|
||||||
pItem.lpszCatalog=catalog;
|
|
||||||
pItem.lpszPropName=propName;
|
|
||||||
pItem.lpszPropDesc=propDesc;
|
|
||||||
pItem.lpCurValue=curVal;
|
|
||||||
pItem.iItemType=type;
|
|
||||||
if(choices != NULL)
|
|
||||||
pItem.lpszzCmbItems = choices;
|
|
||||||
return pItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::PropUpdate(LPPROPGRIDITEM &item)
|
|
||||||
{
|
|
||||||
if(strcmp(item->lpszPropName, "Name") == 0)
|
|
||||||
{
|
|
||||||
name = (LPSTR)item->lpCurValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<PROPGRIDITEM> Instance::getProperties()
|
|
||||||
{
|
|
||||||
std::vector<PROPGRIDITEM> properties;
|
|
||||||
|
|
||||||
|
|
||||||
properties.push_back(createPGI(
|
|
||||||
"Properties",
|
|
||||||
"Name",
|
|
||||||
"The name of this instance",
|
|
||||||
(LPARAM)name.c_str(),
|
|
||||||
PIT_EDIT
|
|
||||||
));
|
|
||||||
return properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Instance::~Instance(void)
|
|
||||||
{
|
|
||||||
for(size_t i = 0; i < children.size(); i++)
|
|
||||||
{
|
|
||||||
delete children.at(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::setName(std::string newName)
|
|
||||||
{
|
|
||||||
name = newName;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Instance::getClassName()
|
|
||||||
{
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<Instance* > Instance::getChildren()
|
|
||||||
{
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<Instance* > Instance::getAllChildren()
|
|
||||||
{
|
|
||||||
if(!children.empty())
|
|
||||||
{
|
|
||||||
std::vector<Instance* > totalchildren = children;
|
|
||||||
for(size_t i = 0; i < children.size(); i++)
|
|
||||||
{
|
|
||||||
std::vector<Instance* > subchildren = children.at(i)->getAllChildren();
|
|
||||||
if(!subchildren.empty())
|
|
||||||
totalchildren.insert(totalchildren.end(), subchildren.begin(), subchildren.end());
|
|
||||||
}
|
|
||||||
return totalchildren;
|
|
||||||
}
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::setParent(Instance* newParent)
|
|
||||||
{
|
|
||||||
if(parent != NULL)
|
|
||||||
{
|
|
||||||
parent->removeChild(this);
|
|
||||||
}
|
|
||||||
parent = newParent;
|
|
||||||
if(newParent != NULL)
|
|
||||||
{
|
|
||||||
newParent->addChild(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Instance* Instance::getParent()
|
|
||||||
{
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::addChild(Instance* newChild)
|
|
||||||
{
|
|
||||||
children.push_back(newChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::clearChildren()
|
|
||||||
{
|
|
||||||
children.clear();
|
|
||||||
}
|
|
||||||
void Instance::removeChild(Instance* oldChild)
|
|
||||||
{
|
|
||||||
for(size_t i = 0; i < children.size(); i++)
|
|
||||||
{
|
|
||||||
if(children.at(i) == oldChild)
|
|
||||||
{
|
|
||||||
children.erase(children.begin() + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Instance* Instance::findFirstChild(std::string name)
|
|
||||||
{
|
|
||||||
for(size_t i = 0; i < children.size(); i++)
|
|
||||||
{
|
|
||||||
if(children.at(i)->name.compare(name) == 0)
|
|
||||||
{
|
|
||||||
return children.at(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
#include "DataModel/LevelInstance.h"
|
|
||||||
|
|
||||||
LevelInstance::LevelInstance(void)
|
|
||||||
{
|
|
||||||
Instance::Instance();
|
|
||||||
name = "Level";
|
|
||||||
winMessage = "You Won!";
|
|
||||||
loseMessage = "You Lost. Try Again";
|
|
||||||
timer = 60.0F;
|
|
||||||
score = 0;
|
|
||||||
canDelete = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
LevelInstance::~LevelInstance(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char timerTxt[12];
|
|
||||||
char scoreTxt[12];
|
|
||||||
std::vector<PROPGRIDITEM> LevelInstance::getProperties()
|
|
||||||
{
|
|
||||||
std::vector<PROPGRIDITEM> properties = Instance::getProperties();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
properties.push_back(createPGI("Messages",
|
|
||||||
"WinMessage",
|
|
||||||
"The message that shows when the player wins.",
|
|
||||||
(LPARAM)winMessage.c_str(),
|
|
||||||
PIT_EDIT));
|
|
||||||
properties.push_back(createPGI("Messages",
|
|
||||||
"LoseMessage",
|
|
||||||
"The message that shows when the player loses.",
|
|
||||||
(LPARAM)loseMessage.c_str(),
|
|
||||||
PIT_EDIT));
|
|
||||||
|
|
||||||
|
|
||||||
sprintf_s(timerTxt, "%g", timer);
|
|
||||||
sprintf_s(scoreTxt, "%d", score);
|
|
||||||
properties.push_back(createPGI("Gameplay",
|
|
||||||
"InitialTimerValue",
|
|
||||||
"The ammount of time in seconds the player has to complete this level.\r\n\r\nPut 0 if time is limitless.",
|
|
||||||
(LPARAM)timerTxt,
|
|
||||||
PIT_EDIT));
|
|
||||||
properties.push_back(createPGI("Gameplay",
|
|
||||||
"InitialScoreValue",
|
|
||||||
"The ammount of points the player starts with.",
|
|
||||||
(LPARAM)scoreTxt,
|
|
||||||
PIT_EDIT));
|
|
||||||
return properties;
|
|
||||||
}
|
|
||||||
void LevelInstance::PropUpdate(LPPROPGRIDITEM &pItem)
|
|
||||||
{
|
|
||||||
if(strcmp(pItem->lpszPropName, "InitialTimerValue") == 0)
|
|
||||||
{
|
|
||||||
timer = atoi((LPSTR)pItem->lpCurValue);
|
|
||||||
}
|
|
||||||
if(strcmp(pItem->lpszPropName, "InitialScoreValue") == 0)
|
|
||||||
{
|
|
||||||
score = atof((LPSTR)pItem->lpCurValue);
|
|
||||||
}
|
|
||||||
if(strcmp(pItem->lpszPropName, "LoseMessage") == 0)
|
|
||||||
{
|
|
||||||
loseMessage = (LPSTR)pItem->lpCurValue;
|
|
||||||
}
|
|
||||||
if(strcmp(pItem->lpszPropName, "WinMessage") == 0)
|
|
||||||
{
|
|
||||||
winMessage = (LPSTR)pItem->lpCurValue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Instance::PropUpdate(pItem);
|
|
||||||
}
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
#include "DataModel/PVInstance.h"
|
|
||||||
|
|
||||||
PVInstance::PVInstance(void)
|
|
||||||
{
|
|
||||||
Instance::Instance();
|
|
||||||
nameShown = false;
|
|
||||||
controllerFlagShown = true;
|
|
||||||
className = "PVInstance";
|
|
||||||
listicon = 0;
|
|
||||||
controller = (Enum::Controller::Value)0;
|
|
||||||
}
|
|
||||||
|
|
||||||
PVInstance::PVInstance(const PVInstance &oinst)
|
|
||||||
{
|
|
||||||
Instance::Instance(oinst);
|
|
||||||
}
|
|
||||||
|
|
||||||
PVInstance::~PVInstance(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void PVInstance::postRender(RenderDevice* rd)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static TCHAR* enumStr(int controller)
|
|
||||||
{
|
|
||||||
switch(controller)
|
|
||||||
{
|
|
||||||
case Enum::Controller::None:
|
|
||||||
return "None";
|
|
||||||
case Enum::Controller::KeyboardLeft:
|
|
||||||
return "KeyboardLeft";
|
|
||||||
case Enum::Controller::KeyboardRight:
|
|
||||||
return "KeyboardRight";
|
|
||||||
case Enum::Controller::Joypad1:
|
|
||||||
return "Joypad1";
|
|
||||||
case Enum::Controller::Joypad2:
|
|
||||||
return "Joypad2";
|
|
||||||
case Enum::Controller::Chase:
|
|
||||||
return "Joypad1";
|
|
||||||
case Enum::Controller::Flee:
|
|
||||||
return "Joypad2";
|
|
||||||
}
|
|
||||||
return "None";
|
|
||||||
}
|
|
||||||
|
|
||||||
static Enum::Controller::Value strEnum(TCHAR * tval)
|
|
||||||
{
|
|
||||||
if(strcmp(tval, "KeyboardLeft") == 0)
|
|
||||||
return Enum::Controller::KeyboardLeft;
|
|
||||||
if(strcmp(tval, "KeyboardRight") == 0)
|
|
||||||
return Enum::Controller::KeyboardRight;
|
|
||||||
if(strcmp(tval, "Joypad1") == 0)
|
|
||||||
return Enum::Controller::Joypad1;
|
|
||||||
if(strcmp(tval, "Joypad2") == 0)
|
|
||||||
return Enum::Controller::Joypad2;
|
|
||||||
if(strcmp(tval, "Chase") == 0)
|
|
||||||
return Enum::Controller::Chase;
|
|
||||||
if(strcmp(tval, "Flee") == 0)
|
|
||||||
return Enum::Controller::Flee;
|
|
||||||
return Enum::Controller::None;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<PROPGRIDITEM> PVInstance::getProperties()
|
|
||||||
{
|
|
||||||
std::vector<PROPGRIDITEM> properties = Instance::getProperties();
|
|
||||||
properties.push_back(createPGI(
|
|
||||||
"Item",
|
|
||||||
"NameShown",
|
|
||||||
"This chooses whether the item name is shown",
|
|
||||||
nameShown,
|
|
||||||
PIT_CHECK));
|
|
||||||
properties.push_back(createPGI(
|
|
||||||
"Item",
|
|
||||||
"ControllerFlagShown",
|
|
||||||
"This chooses whether the item's ControllerFlag is shown",
|
|
||||||
controllerFlagShown,
|
|
||||||
PIT_CHECK));
|
|
||||||
properties.push_back(createPGI(
|
|
||||||
"Behaviour",
|
|
||||||
"Controller",
|
|
||||||
"This chooses what type of controller is used",
|
|
||||||
(LPARAM)enumStr(controller),
|
|
||||||
PIT_COMBO,
|
|
||||||
TEXT("None\0KeyboardRight\0KeyboardLeft\0Joypad1\0Joypad2\0Chase\0Flee")
|
|
||||||
));
|
|
||||||
|
|
||||||
return properties;
|
|
||||||
}
|
|
||||||
void PVInstance::PropUpdate(LPPROPGRIDITEM &pItem)
|
|
||||||
{
|
|
||||||
if(strcmp(pItem->lpszPropName, "NameShown") == 0)
|
|
||||||
{
|
|
||||||
nameShown = pItem->lpCurValue == TRUE;
|
|
||||||
}
|
|
||||||
if(strcmp(pItem->lpszPropName, "ControllerFlagShown") == 0)
|
|
||||||
{
|
|
||||||
controllerFlagShown = pItem->lpCurValue == TRUE;
|
|
||||||
}
|
|
||||||
if(strcmp(pItem->lpszPropName, "Controller") == 0)
|
|
||||||
{
|
|
||||||
controller = strEnum((TCHAR *)pItem->lpCurValue);
|
|
||||||
}
|
|
||||||
else Instance::PropUpdate(pItem);
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
#include "DataModelV2/SelectionService.h"
|
|
||||||
|
|
||||||
SelectionService::SelectionService(void){
|
|
||||||
Instance::Instance();
|
|
||||||
propertyWindow = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
SelectionService::~SelectionService(void){
|
|
||||||
}
|
|
||||||
|
|
||||||
SelectionService::SelectionService(const SelectionService &oinst){
|
|
||||||
Instance::Instance(oinst);
|
|
||||||
propertyWindow = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<Instance *> SelectionService::getSelection(){
|
|
||||||
return this->selection;
|
|
||||||
}
|
|
||||||
void SelectionService::clearSelection(){
|
|
||||||
this->selection.clear();
|
|
||||||
if(propertyWindow != NULL)
|
|
||||||
propertyWindow->ClearProperties();
|
|
||||||
printf("selectionSize: %d\n", selection.size());
|
|
||||||
}
|
|
||||||
bool SelectionService::isSelected(Instance * instance){
|
|
||||||
return std::find(selection.begin(), selection.end(), instance) != selection.end();
|
|
||||||
}
|
|
||||||
void SelectionService::addSelected(Instance * instance){
|
|
||||||
if(!isSelected(instance))
|
|
||||||
this->selection.push_back(instance);
|
|
||||||
if(propertyWindow != NULL)
|
|
||||||
propertyWindow->UpdateSelected(selection);
|
|
||||||
printf("selectionSize: %d\n", selection.size());
|
|
||||||
}
|
|
||||||
void SelectionService::removeSelected(Instance * instance){
|
|
||||||
selection.erase(std::remove(selection.begin(), selection.end(), instance), selection.end());
|
|
||||||
if(propertyWindow != NULL)
|
|
||||||
propertyWindow->UpdateSelected(selection);
|
|
||||||
printf("selectionSize: %d\n", selection.size());
|
|
||||||
}
|
|
||||||
void SelectionService::addSelected(const std::vector<Instance *> &instances){
|
|
||||||
for(size_t i = 0; i < instances.size(); i++)
|
|
||||||
{
|
|
||||||
if(!isSelected(instances[i]))
|
|
||||||
this->selection.push_back(instances[i]);
|
|
||||||
}
|
|
||||||
if(propertyWindow != NULL)
|
|
||||||
propertyWindow->UpdateSelected(selection);
|
|
||||||
printf("selectionSize: %d\n", selection.size());
|
|
||||||
}
|
|
||||||
void SelectionService::setPropertyWindow(PropertyWindow * propertyWindow)
|
|
||||||
{
|
|
||||||
this->propertyWindow = propertyWindow;
|
|
||||||
if(propertyWindow != NULL)
|
|
||||||
propertyWindow->ClearProperties();
|
|
||||||
printf("selectionSize: %d\n", selection.size());
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
#include "DataModel/TextButtonInstance.h"
|
|
||||||
|
|
||||||
|
|
||||||
TextButtonInstance::TextButtonInstance(void)
|
|
||||||
{
|
|
||||||
BaseButtonInstance::BaseButtonInstance();
|
|
||||||
boxBegin = Vector2(0,0);
|
|
||||||
boxEnd = Vector2(0,0);
|
|
||||||
fontLocationRelativeTo = Vector2(0,0);
|
|
||||||
centeredWithinBox = false;
|
|
||||||
title = "TextBox";
|
|
||||||
textColor = Color4(1, 1, 1, 1);
|
|
||||||
textOutlineColor = Color4(0, 0, 0, 0);
|
|
||||||
boxColor = Color4(0.6F,0.6F,0.6F,0.4F);
|
|
||||||
boxOutlineColor = Color4(0, 0, 0, 0);
|
|
||||||
setAllColorsSame();
|
|
||||||
textSize = 12;
|
|
||||||
floatBottom = false;
|
|
||||||
floatRight = false;
|
|
||||||
floatCenter = false;
|
|
||||||
visible = true;
|
|
||||||
className = "TextButton";
|
|
||||||
disabled = false;
|
|
||||||
selected = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TextButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd)
|
|
||||||
{
|
|
||||||
Vector3 point1;
|
|
||||||
Vector3 point2;
|
|
||||||
if(floatBottom)
|
|
||||||
{
|
|
||||||
point1 = Vector3(boxBegin.x, rd->getHeight() + boxBegin.y,0);
|
|
||||||
point2 = Vector3(boxEnd.x, rd->getHeight() + boxEnd.y,0);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
point1 = Vector3(boxBegin.x, boxBegin.y,0);
|
|
||||||
point2 = Vector3(boxEnd.x, boxEnd.y,0);
|
|
||||||
}
|
|
||||||
if(mousex >= point1.x && mousey >= point1.y)
|
|
||||||
{
|
|
||||||
if(mousex < point2.x && mousey < point2.y)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TextButtonInstance::setAllColorsSame()
|
|
||||||
{
|
|
||||||
textColorOvr = textColor;
|
|
||||||
textOutlineColorOvr = textOutlineColor;
|
|
||||||
boxColorOvr = boxColor;
|
|
||||||
boxOutlineColorOvr = boxOutlineColor;
|
|
||||||
textColorDn = textColor;
|
|
||||||
textOutlineColorDn = textOutlineColor;
|
|
||||||
boxColorDn = boxColor;
|
|
||||||
boxOutlineColorDn = boxOutlineColor;
|
|
||||||
textColorDis = textColor;
|
|
||||||
textOutlineColorDis = textOutlineColor;
|
|
||||||
boxColorDis = boxColor;
|
|
||||||
boxOutlineColorDis = boxOutlineColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
TextButtonInstance::~TextButtonInstance(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void TextButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown)
|
|
||||||
{
|
|
||||||
Vector3 point1;
|
|
||||||
Vector3 point2;
|
|
||||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
|
||||||
glDisableClientState(GL_COLOR_ARRAY);
|
|
||||||
|
|
||||||
if(floatBottom)
|
|
||||||
{
|
|
||||||
point1 = Vector3(boxBegin.x, rd->getHeight() + boxBegin.y,0);
|
|
||||||
point2 = Vector3(boxEnd.x, rd->getHeight() + boxEnd.y,0);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
point1 = Vector3(boxBegin.x, boxBegin.y,0);
|
|
||||||
point2 = Vector3(boxEnd.x, boxEnd.y,0);
|
|
||||||
}
|
|
||||||
Vector2 RelativeTo = Vector2(point1.x + fontLocationRelativeTo.x, point1.y + fontLocationRelativeTo.y);
|
|
||||||
if(disabled)
|
|
||||||
{
|
|
||||||
Draw::box(Box(point1, point2), rd, boxColorDis, boxOutlineColorDis);
|
|
||||||
font->draw2D(rd, title, RelativeTo, textSize, textColorDis, textOutlineColorDis);
|
|
||||||
}
|
|
||||||
else if(mouseInArea(point1.x, point1.y, point2.x, point2.y, mousePos.x, mousePos.y) && mouseDown)
|
|
||||||
{
|
|
||||||
Draw::box(Box(point1, point2), rd, boxColorDn, boxOutlineColorDn);
|
|
||||||
font->draw2D(rd, title, RelativeTo, textSize, textColorDn, textOutlineColorDn);
|
|
||||||
}
|
|
||||||
else if(selected || mouseInArea(point1.x, point1.y, point2.x, point2.y, mousePos.x, mousePos.y))
|
|
||||||
{
|
|
||||||
Draw::box(Box(point1, point2), rd, boxColorOvr, boxOutlineColorOvr);
|
|
||||||
font->draw2D(rd, title, RelativeTo, textSize, textColorOvr, textOutlineColorOvr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Draw::box(Box(point1, point2), rd, boxColor, boxOutlineColor);
|
|
||||||
font->draw2D(rd, title, RelativeTo, textSize, textColor, textOutlineColor);
|
|
||||||
}
|
|
||||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
void doNullCheck()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
#include "DataModel/ToggleImageButtonInstance.h"
|
|
||||||
|
|
||||||
ToggleImageButtonInstance::ToggleImageButtonInstance(G3D::TextureRef newImage,
|
|
||||||
G3D::TextureRef overImage,
|
|
||||||
G3D::TextureRef downImage,
|
|
||||||
G3D::TextureRef disableImage,
|
|
||||||
G3D::TextureRef newImage2,
|
|
||||||
G3D::TextureRef overImage2,
|
|
||||||
G3D::TextureRef downImage2,
|
|
||||||
G3D::TextureRef disableImage2) : ImageButtonInstance(newImage, overImage, downImage, disableImage)
|
|
||||||
{
|
|
||||||
image2 = newImage2;
|
|
||||||
openGLID2 = image2->getOpenGLID();
|
|
||||||
image_ovr2 = overImage2;
|
|
||||||
if(!image_ovr2.isNull())
|
|
||||||
openGLID2_ovr = image_ovr2->getOpenGLID();
|
|
||||||
image_dn2 = downImage2;
|
|
||||||
if(!image_dn2.isNull())
|
|
||||||
openGLID2_dn = image_dn2->getOpenGLID();
|
|
||||||
image_ds2 = disableImage2;
|
|
||||||
if(!image_ds2.isNull())
|
|
||||||
openGLID2_ds = image_ds2->getOpenGLID();
|
|
||||||
checked = false;
|
|
||||||
className = "ToggleImageButton";
|
|
||||||
}
|
|
||||||
|
|
||||||
ToggleImageButtonInstance::~ToggleImageButtonInstance(void)
|
|
||||||
{
|
|
||||||
//Delete everything on destruction
|
|
||||||
image2.~ReferenceCountedPointer();
|
|
||||||
delete image2.getPointer();
|
|
||||||
image_ovr2.~ReferenceCountedPointer();
|
|
||||||
delete image_ovr2.getPointer();
|
|
||||||
image_ds2.~ReferenceCountedPointer();
|
|
||||||
delete image_ds2.getPointer();
|
|
||||||
image_dn2.~ReferenceCountedPointer();
|
|
||||||
delete image_dn2.getPointer();
|
|
||||||
image = NULL;
|
|
||||||
image_ovr = NULL;
|
|
||||||
image_ds = NULL;
|
|
||||||
image_dn = NULL;
|
|
||||||
delete listener;
|
|
||||||
listener = NULL;
|
|
||||||
selected = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ToggleImageButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseDown)
|
|
||||||
{
|
|
||||||
bool drawDisabledBox = false;
|
|
||||||
Vector2 positionRelative = position;
|
|
||||||
if(floatRight && floatBottom)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(rd->getWidth() + position.x, rd->getHeight() + position.y);
|
|
||||||
}
|
|
||||||
else if(floatBottom)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(position.x, rd->getHeight() + position.y);
|
|
||||||
}
|
|
||||||
else if(floatRight)
|
|
||||||
{
|
|
||||||
positionRelative = Vector2(rd->getWidth() + position.x, position.y);
|
|
||||||
}
|
|
||||||
int renderimage = openGLID;
|
|
||||||
if(checked)
|
|
||||||
{
|
|
||||||
renderimage = openGLID2;
|
|
||||||
if(selected == true && !image_dn2.isNull() && !disabled)
|
|
||||||
{
|
|
||||||
renderimage = openGLID2_dn;
|
|
||||||
}
|
|
||||||
else if(disabled)
|
|
||||||
{
|
|
||||||
if(!image_ds2.isNull())
|
|
||||||
renderimage = openGLID2_ds;
|
|
||||||
else
|
|
||||||
drawDisabledBox = true;
|
|
||||||
}
|
|
||||||
else if(mouseInArea(positionRelative.x, positionRelative.y, positionRelative.x + size.x, positionRelative.y + size.y, mousePos.x, mousePos.y))
|
|
||||||
{
|
|
||||||
if(mouseDown && !image_dn2.isNull())
|
|
||||||
{
|
|
||||||
renderimage = openGLID2_dn;
|
|
||||||
}
|
|
||||||
else if(!image_ovr2.isNull())
|
|
||||||
{
|
|
||||||
renderimage = openGLID2_ovr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(selected == true && !image_dn.isNull() && !disabled)
|
|
||||||
{
|
|
||||||
renderimage = openGLID_dn;
|
|
||||||
}
|
|
||||||
else if(disabled)
|
|
||||||
{
|
|
||||||
if(!image_ds.isNull())
|
|
||||||
renderimage = openGLID_ds;
|
|
||||||
else
|
|
||||||
drawDisabledBox = true;
|
|
||||||
}
|
|
||||||
else if(mouseInArea(positionRelative.x, positionRelative.y, positionRelative.x + size.x, positionRelative.y + size.y, mousePos.x, mousePos.y))
|
|
||||||
{
|
|
||||||
if(mouseDown && !image_dn.isNull())
|
|
||||||
{
|
|
||||||
renderimage = openGLID_dn;
|
|
||||||
}
|
|
||||||
else if(!image_ovr.isNull())
|
|
||||||
{
|
|
||||||
renderimage = openGLID_ovr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
glEnable( GL_TEXTURE_2D );
|
|
||||||
glEnable(GL_BLEND);// you enable blending function
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
glBindTexture( GL_TEXTURE_2D, renderimage);
|
|
||||||
glBegin( GL_QUADS );
|
|
||||||
glTexCoord2d(0.0,0.0);
|
|
||||||
glVertex2f( positionRelative.x, positionRelative.y );
|
|
||||||
glTexCoord2d( 1.0,0.0 );
|
|
||||||
glVertex2f( positionRelative.x + size.x, positionRelative.y );
|
|
||||||
glTexCoord2d( 1.0,1.0 );
|
|
||||||
glVertex2f( positionRelative.x + size.x, positionRelative.y + size.y );
|
|
||||||
glTexCoord2d( 0.0,1.0 );
|
|
||||||
glVertex2f( positionRelative.x, positionRelative.y + size.y );
|
|
||||||
glEnd();
|
|
||||||
glDisable( GL_TEXTURE_2D );
|
|
||||||
|
|
||||||
if(drawDisabledBox)
|
|
||||||
{
|
|
||||||
Draw::box(Box(Vector3(positionRelative.x, positionRelative.y, 0), Vector3(positionRelative.x+size.x, positionRelative.y+size.y, 0)), rd, Color4(0.7F,0.7F,0.7F,0.3F), Color4::clear());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#include "DataModel/WorkspaceInstance.h"
|
|
||||||
|
|
||||||
|
|
||||||
WorkspaceInstance::WorkspaceInstance(void)
|
|
||||||
{
|
|
||||||
GroupInstance::GroupInstance();
|
|
||||||
name = "Workspace";
|
|
||||||
className = "Workspace";
|
|
||||||
canDelete = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
WorkspaceInstance::~WorkspaceInstance(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||