Compare commits

5 Commits

Author SHA1 Message Date
Vulpovile
71b75d583c enums 2022-12-24 11:05:56 -08:00
Vulpovile
fc9e953554 Fix Vector3 Property, enum work 2022-10-25 07:25:58 -07:00
Vulpovile
78f135732e Made properties work 2022-10-22 21:26:41 -07:00
Vulpovile
793e85a57f Added properties 2022-10-22 08:47:14 -07:00
Vulpovile
ec0ae415f7 Added properties 2022-10-22 08:47:07 -07:00
94 changed files with 820 additions and 1408 deletions

1
.gitattributes vendored
View File

@@ -1 +0,0 @@
* text=false

View File

@@ -1,37 +0,0 @@

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

View File

@@ -1,20 +0,0 @@

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

View File

@@ -1,717 +0,0 @@
<?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="&quot;.\src\include&quot;"
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=".\src\source\DataModelV2\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>

View File

@@ -5,9 +5,4 @@
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.6195" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>

View File

@@ -55,7 +55,7 @@
OmitFramePointers="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;.\src\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_ATL_STATIC_REGISTRY;NO_SDL_MAIN"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
@@ -154,8 +154,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\src\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_ATL_STATIC_REGISTRY;NO_SDL_MAIN"
AdditionalIncludeDirectories="&quot;C:\libraries\ode-0.5\include\drawstuff&quot;;.\src\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="false"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
@@ -185,7 +185,6 @@
OutputFile="./Blocks3D-Debug.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/Blocks3D.pdb"
SubSystem="1"
@@ -523,7 +522,7 @@
>
</File>
<File
RelativePath=".\src\source\DataModelV2\ThumbnailGeneratorInstance.cpp"
RelativePath=".\ThumbnailGeneratorInstance.cpp"
>
</File>
<File
@@ -675,6 +674,30 @@
</File>
</Filter>
</Filter>
<Filter
Name="PropertiesV2"
>
<File
RelativePath=".\src\source\PropertiesV2\BoolProperty.cpp"
>
</File>
<File
RelativePath=".\src\source\PropertiesV2\Color3Property.cpp"
>
</File>
<File
RelativePath=".\src\source\PropertiesV2\Property.cpp"
>
</File>
<File
RelativePath=".\src\source\PropertiesV2\StringProperty.cpp"
>
</File>
<File
RelativePath=".\src\source\PropertiesV2\Vector3Property.cpp"
>
</File>
</Filter>
<Filter
Name="Helpers"
>
@@ -948,6 +971,30 @@
</File>
</Filter>
</Filter>
<Filter
Name="PropertiesV2"
>
<File
RelativePath=".\src\include\PropertiesV2\BoolProperty.h"
>
</File>
<File
RelativePath=".\src\include\PropertiesV2\Color3Property.h"
>
</File>
<File
RelativePath=".\src\include\PropertiesV2\Property.h"
>
</File>
<File
RelativePath=".\src\include\PropertiesV2\StringProperty.h"
>
</File>
<File
RelativePath=".\src\include\PropertiesV2\Vector3Property.h"
>
</File>
</Filter>
<Filter
Name="Helpers"
>
@@ -956,6 +1003,14 @@
>
</File>
</Filter>
<Filter
Name="B3DEnum"
>
<File
RelativePath=".\src\include\Enum\B3DEnum.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Resource Files"

View File

@@ -36,7 +36,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
VALUE "FileDescription", "Blocks 3D"
VALUE "FileVersion", VER_STR(APP_VER_STRING)
VALUE "InternalName", "Blocks3D"
VALUE "LegalCopyright", "Blocks3D Team 2018-2023"
VALUE "LegalCopyright", "Blocks3D Team - 2022"
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "Blocks3D.exe"
VALUE "PrivateBuild", ""

13
Documentation/index.html Normal file
View File

@@ -0,0 +1,13 @@
<html>
<head>
<title> RBX05R Documentation </title>
<meta charset="utf-8">
</head>
<body>
<div class="content" style="text-align:center;">
<h1> ROBLOX 2005 Recreation documentation </h1>
<br>
<h4> Current for: r360 </h4>
</div>
</body>
</html>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,4 @@
;InnoSetupVersion=5.4.3
;ONLY USE THIS IF YOU COMPILED WITH VISUAL STUDIO 2005!!!
#define AppVer GetFileVersion('..\Blocks3D.exe')
[Setup]
@@ -24,7 +23,7 @@ Type: filesandordirs; Name: "{app}"
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: "..\SDL.DLL"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
[Registry]

View File

@@ -1,5 +1,4 @@
;InnoSetupVersion=5.4.3
;ONLY USE THIS IF YOU COMPILED WITH VISUAL STUDIO 2005!!!
#define AppVer GetFileVersion('..\Blocks3D.exe')
[Setup]
@@ -27,7 +26,7 @@ Type: filesandordirs; Name: "{app}"
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: "..\SDL.DLL"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
[Registry]

View File

@@ -1,48 +0,0 @@
;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";

View File

@@ -1,45 +0,0 @@
;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
Installer/setup.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
Parts.bmp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,6 +1,3 @@
# 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
## 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.

BIN
SDL.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
oldcontent/cursor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
oldcontent/cursor2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

BIN
oldcontent/font/arial.fnt Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 798 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
roblox_RN1_icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -1,6 +1,6 @@
#include <G3DAll.h>
#pragma once
#include <iostream>
#include <string.h>
class AudioPlayer
{
public:

View File

@@ -43,14 +43,6 @@ public:
virtual bool mouseHovered(float, float, RenderDevice* rd);
UDim2 position;
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:
bool mouseInArea(float, float, float, float, float, float);
class ButtonListener* listener;

View File

@@ -27,9 +27,7 @@ public:
void clearMessage();
bool debugGetOpen();
bool getOpen();
bool getOpenModel();
bool load(const char* filename,bool clearObjects);
bool loadModel(const char* filename);
bool readXMLFileStream(std::ifstream* file);
void drawMessage(RenderDevice*);

View File

@@ -1,6 +1,8 @@
#pragma once
#include <G3DAll.h>
#include "propertyGrid.h"
#include "PropertiesV2/StringProperty.h"
#include "PropertiesV2/BoolProperty.h"
#include "map"
class Instance
@@ -26,12 +28,18 @@ public:
void clearChildren();
Instance* getParent();
virtual Instance* clone() const { return new Instance(*this); }
//Deprecated
virtual std::vector<PROPGRIDITEM> getProperties();
//Deprecated
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
virtual std::vector<Property *> collectProperties();
int listicon;
protected:
std::string className;
Instance* parent; // Another pointer.
//Deprecated
PROPGRIDITEM createPGI(LPSTR catalog, LPSTR propName, LPSTR propDesc, LPARAM curVal, INT type, TCHAR choices[] = NULL);
private:
static const std::map<std::string, Instance> g_logLevelsDescriptions;

View File

@@ -13,9 +13,13 @@ public:
virtual void postRender(RenderDevice* rd);
virtual std::vector<PROPGRIDITEM> getProperties();
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
virtual std::vector<Property*> collectProperties();
bool nameShown;
bool controllerFlagShown;
Enum::Controller::Value controller;
virtual void makeJoints();
virtual void setNameShown(bool nameShown);
virtual void setControllerFlagShown(bool controllerFlagShown);
protected:
CoordinateFrame cFrame;
static G3D::Color3 getControllerColor(int controller)

View File

@@ -1,6 +1,8 @@
#pragma once
#include "PVInstance.h"
#include "Enum.h"
#include "PropertiesV2/Color3Property.h"
#include "PropertiesV2/Vector3Property.h"
#define _USE_MATH_DEFINES
#include <cmath>
@@ -59,6 +61,7 @@ public:
//Setters
void setParent(Instance* parent);
void setPosition(Vector3);
void setColor(Color3 color);
void setVelocity(Vector3);
void setRotVelocity(Vector3);
void setCFrame(CoordinateFrame);
@@ -83,6 +86,7 @@ public:
//Properties
virtual std::vector<PROPGRIDITEM> getProperties();
virtual void PropUpdate(LPPROPGRIDITEM &pItem);
virtual std::vector<Property *> collectProperties();
private:
bool anchored;
Vector3 position;

View File

@@ -1,4 +1,6 @@
#pragma once
#include <string>
#include <map>
namespace Enum
{
@@ -7,6 +9,30 @@ namespace Enum
enum Value {
Smooth = 0, Bumps = 1, Hinge = 2, Motor = 3, StepperMotor = 4, Spawn = 5
};
static std::pair<std::string, Value> map_data[] = {
std::make_pair("Smooth", Smooth),
std::make_pair("Bumps", Bumps),
std::make_pair("Hinge", Hinge),
std::make_pair("Motor", Motor),
std::make_pair("StepperMotor", StepperMotor),
std::make_pair("Spawn", Spawn)
};
static std::map<std::string, Value> nameMap(map_data,
map_data + sizeof map_data / sizeof map_data[0]);
static Value getByName(std::string name) {
if(nameMap.find(name) != nameMap.end()){
return nameMap[name];
}
return Smooth;
}
static std::string getName(Value value) {
for (std::map<std::string, Value>::iterator it = nameMap.begin(); it != nameMap.end(); ++it)
if (it->second == value)
return it->first;
return "";
}
}
namespace Shape
{
@@ -37,7 +63,7 @@ namespace Enum
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,
Snap = 8, Page = 9
};
}
}

View File

@@ -0,0 +1,24 @@
#pragma once
namespace Enum
{
class B3DEnum {
public:
B3DEnum(int id, std::string name)
{
this->id = id;
this->name = name;
}
const int getId() {
return id;
}
const std::string getName() {
return name;
}
virtual B3DEnum getByName(std::string name);
virtual B3DEnum getById(int id);
private:
int id;
std::string name;
}
}

View File

@@ -0,0 +1,23 @@
#pragma once
#include "Property.h"
class BoolProperty : public Property
{
public:
typedef void (Instance::*instanceSetter)(bool);
//Win32 why
~BoolProperty(void);
BoolProperty(LPSTR name, LPSTR desc, LPSTR catalog, bool value, Instance * owner, instanceSetter setterFunc)
:Property(name, desc, catalog, (void*)value, owner)
{
this->setterFunc = setterFunc;
}
const void setValue(bool val){
(_owner->*setterFunc)(val);
_value = (void *)val;
}
PROPGRIDITEM getPropGridItem();
void setProperty(LPPROPGRIDITEM &pItem);
private:
instanceSetter setterFunc;
};

View File

@@ -0,0 +1,24 @@
#pragma once
#include "Property.h"
class Color3Property : public Property
{
public:
typedef void (Instance::*instanceSetter)(Color3);
~Color3Property(void){};
Color3Property(LPSTR name, LPSTR desc, LPSTR catalog, Color3 value, Instance * owner, instanceSetter setterFunc)
:Property(name, desc, catalog, &_value, owner)
{
this->_value = value;
this->setterFunc = setterFunc;
}
const void setValue(Color3 val){
(_owner->*setterFunc)(val);
_value = val;
}
PROPGRIDITEM getPropGridItem();
void setProperty(LPPROPGRIDITEM &pItem);
private:
Color3 _value;
instanceSetter setterFunc;
};

View File

@@ -0,0 +1,38 @@
#pragma once
#include <G3DAll.h>
#include "propertyGrid.h"
class Instance;
class Property
{
public:
Property(LPSTR name, LPSTR desc, LPSTR catalog, Instance * owner){
_name = name;
_desc = desc;
_catalog = catalog;
_owner = owner;
}
Property(LPSTR name, LPSTR desc, LPSTR catalog, void* value, Instance * owner){
_name = name;
_desc = desc;
_catalog = catalog;
_owner = owner;
_value = value;
}
~Property(void){}
const void* getValue() {
return _value;
}
const LPSTR getName() {
return _name;
}
virtual PROPGRIDITEM getPropGridItem();
virtual void setProperty(LPPROPGRIDITEM &pItem);
protected:
Instance* _owner;
LPSTR _name;
LPSTR _desc;
LPSTR _catalog;
void* _value;
};

View File

@@ -0,0 +1,24 @@
#pragma once
#include "Property.h"
class StringProperty : public Property
{
public:
typedef void (Instance::*instanceSetter)(std::string);
~StringProperty(void){};
StringProperty(LPSTR name, LPSTR desc, LPSTR catalog, std::string value, Instance * owner, instanceSetter setterFunc)
:Property(name, desc, catalog, &_value, owner)
{
this->_value = value;
this->setterFunc = setterFunc;
}
const void setValue(std::string val){
(_owner->*setterFunc)(val);
_value = val;
}
PROPGRIDITEM getPropGridItem();
void setProperty(LPPROPGRIDITEM &pItem);
private:
std::string _value;
instanceSetter setterFunc;
};

View File

@@ -0,0 +1,26 @@
#pragma once
#include "Property.h"
#include <sstream>
class Vector3Property : public Property
{
public:
typedef void (Instance::*instanceSetter)(Vector3);
~Vector3Property(void){};
Vector3Property(LPSTR name, LPSTR desc, LPSTR catalog, Vector3 value, Instance * owner, instanceSetter setterFunc)
:Property(name, desc, catalog, &_value, owner)
{
this->_value = value;
this->setterFunc = setterFunc;
}
const void setValue(Vector3 val){
(_owner->*setterFunc)(val);
_value = val;
}
PROPGRIDITEM getPropGridItem();
void setProperty(LPPROPGRIDITEM &pItem);
private:
Vector3 _value;
std::string stringRep;
instanceSetter setterFunc;
};

View File

@@ -15,4 +15,5 @@ private:
HWND _explorerComboBox;
void _resize();
void clearExplorer();
void deleteProperties();
};

View File

@@ -7,12 +7,12 @@ class DraggerTool :
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 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();
@@ -20,6 +20,5 @@ private:
bool hasHandles;
int handleGrabbed;
Vector3 center;
Vector3 CenterOffset;
Sphere handles[6];
};

View File

@@ -8,7 +8,6 @@
#include "DataModelV2/ImageButtonInstance.h"
#include "DataModelV2/DataModelInstance.h"
#include "DataModelV2/GuiRootInstance.h"
#include "DataModelV2/SoundService.h"
#include "XplicitNgine/XplicitNgine.h"
#include "CameraController.h"
#include "AudioPlayer.h"
@@ -39,7 +38,6 @@ static bool mouseMovedBeginMotion = false;
static POINT oldGlobalMouse;
Vector2 oldMouse = Vector2(0,0);
float moveRate = 0.5;
float wasPropShown = 0;
void Application::clearInstances()
{
@@ -57,7 +55,7 @@ void Application::setFocus(bool focus)
if(_propWindow != NULL)
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);
}
else
@@ -514,7 +512,7 @@ void Application::onMouseWheel(int x,int y,short delta)
if (mouseOnScreen==true)
if (cameraController.onMouseWheel(x, y, delta))
{
_dataModel->getSoundService()->playSound(_dataModel->getSoundService()->findFirstChild("Step"));
AudioPlayer::playSound(cameraSound);
}
tool->onMouseScroll(mouse);
}

View File

@@ -1,7 +1,11 @@
#include "AudioPlayer.h"
#include <Windows.h>
#include <Mmsystem.h>
#include "SDL.h"
#include "SDL_audio.h"
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#define NUM_SOUNDS 32
static SDL_AudioSpec fmt;
static bool initiated = false;
AudioPlayer::AudioPlayer(void)
@@ -11,15 +15,98 @@ AudioPlayer::AudioPlayer(void)
AudioPlayer::~AudioPlayer(void)
{
SDL_CloseAudio();
}
void AudioPlayer::init()
{
initiated = true;
extern void mixaudio(void *unused, Uint8 *stream, int len);
fmt.freq = 22050;
fmt.format = AUDIO_S16LSB;
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)
{
//TODO probably use something a bit better
PlaySound(fileString.c_str(), NULL, SND_FILENAME | SND_ASYNC);
if(initiated)
{
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");
}
}

View File

@@ -471,6 +471,7 @@ bool DataModelInstance::scanXMLObject(xml_node<> * scanNode)
{
return false;
}
}
}
/*
@@ -514,27 +515,6 @@ bool DataModelInstance::load(const char* filename, bool clearObjects)
}
}
bool DataModelInstance::loadModel(const char* filename)
{
ifstream levelFile(filename,ios::binary);
if (levelFile)
{
readXMLFileStream(&levelFile);
//resetEngine();
selectionService->clearSelection();
selectionService->addSelected(this);
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);
@@ -593,7 +573,7 @@ bool DataModelInstance::getOpen()
of.lpstrFile = szFile ;
of.lpstrFile[0]='\0';
of.nMaxFile=500;
of.lpstrTitle="Open";
of.lpstrTitle="Hello";
of.Flags = OFN_FILEMUSTEXIST;
ShowCursor(TRUE);
BOOL file = GetOpenFileName(&of);
@@ -604,30 +584,6 @@ bool DataModelInstance::getOpen()
}
return true;
}
bool DataModelInstance::getOpenModel()
{
_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="Open";
of.Flags = OFN_FILEMUSTEXIST;
ShowCursor(TRUE);
BOOL file = GetOpenFileName(&of);
if (file)
{
_loadedFileName = of.lpstrFile;
loadModel(of.lpstrFile);
}
return true;
}
void DataModelInstance::setMessage(std::string msg)
{
message = msg;
@@ -667,9 +623,9 @@ void DataModelInstance::drawMessage(RenderDevice* rd)
}
}
char brkc[12];
_snprintf(brkc, 12, "%d", brickCount);
sprintf_s(brkc, "%d", brickCount);
char instc[12];
_snprintf(instc, 12, "%d", instCount);
sprintf_s(instc, "%d", instCount);
message = "Bricks: ";
message += brkc;
message += " Snaps: ";

View File

@@ -6,7 +6,6 @@
#include "DataModelV2/ImageButtonInstance.h"
#include "DataModelV2/ToggleImageButtonInstance.h"
#include "DataModelV2/GuiRootInstance.h"
#include "DataModelV2/SelectionService.h"
#include "DataModelV2/ImageButtonInstance.h"
#include "Globals.h"
#include "StringFunctions.h"
@@ -214,14 +213,13 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
button->boxBegin = Vector2(0,215);
button->boxEnd = Vector2(80,235);
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
button->textColor = Color3(0,1,1);
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->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button->font = g_fntlighttrek;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setParent(this);
@@ -231,14 +229,13 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
button->boxBegin = Vector2(0,240);
button->boxEnd = Vector2(80,260);
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
button->textColor = Color3(0,1,1);
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->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button->font = g_fntlighttrek;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setParent(this);
@@ -248,45 +245,26 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
button->boxBegin = Vector2(0,265);
button->boxEnd = Vector2(80,285);
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
button->textColor = Color3(0,1,1);
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->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button->font = g_fntlighttrek;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setParent(this);
button->name = "Duplicate";
button->setButtonListener(gud);
//g_fntlighttrek->draw2D(rd,"MENU", Vector2(10,332), 14, Color3::white(), Color4(0.5F,0.5F,0.5F,0.5F));
button = makeTextButton();
button->boxBegin = Vector2(0,332);
button->boxEnd = Vector2(80,352);
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
button->textColor = Color3::white();
button->boxColor = Color4::clear();
button->textSize = 14;
button->title = "MENU";
button->setAllColorsSame();
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button->font = g_fntlighttrek;
button->fontLocationRelativeTo = Vector2(10, 0);
button->setParent(this);
button->name = "MENU";
button->setButtonListener(menuListener);
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")),
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"))
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(menuListener);
instance->name = "go";
@@ -296,17 +274,17 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
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")));
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(msl);
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 = 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);
@@ -315,10 +293,10 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
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")));
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);
@@ -326,10 +304,10 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(msl);
instance = makeImageButton(
Texture::fromFile(&GetFileInPath("/content/images/SelectionRotate.png")),
Texture::fromFile(&GetFileInPath("/content/images/SelectionRotate_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate.png")),
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate_ovr.png")),
NULL,
Texture::fromFile(&GetFileInPath("/content/images/SelectionRotate_ds.png")));
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate_ds.png")));
instance->size = Vector2(30,30);
instance->position = Vector2(10, 175);
instance->setParent(this);
@@ -337,10 +315,10 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(rbl);
instance = makeImageButton(
Texture::fromFile(&GetFileInPath("/content/images/SelectionTilt.png")),
Texture::fromFile(&GetFileInPath("/content/images/SelectionTilt_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt.png")),
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt_ovr.png")),
NULL,
Texture::fromFile(&GetFileInPath("/content/images/SelectionTilt_ds.png")));
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt_ds.png")));
instance->size = Vector2(30,30);
instance->position = Vector2(40, 175);
instance->setParent(this);
@@ -349,10 +327,10 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
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")));
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);
@@ -360,9 +338,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(delet);
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")));
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;
@@ -372,9 +350,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam);
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")));
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;
@@ -384,9 +362,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam);
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")));
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;
@@ -396,9 +374,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam);
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")));
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;
@@ -408,9 +386,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam);
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")));
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;
@@ -420,9 +398,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam);
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")));
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;
@@ -432,9 +410,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam);
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")));
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;
@@ -487,7 +465,7 @@ void GuiRootInstance::renderGUI(G3D::RenderDevice* rd, double fps)
//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);
@@ -524,9 +502,6 @@ void GuiRootInstance::update()
Instance * obj3 = this->findFirstChild("UnGroup");
Instance * obj4 = this->findFirstChild("Rotate");
Instance * obj5 = this->findFirstChild("Tilt");
SelectionService* getSelectionService = g_dataModel->getSelectionService();
if(obj != NULL && obj2 != NULL && obj3 != NULL && obj4 !=NULL && obj5 != NULL && obj6 != NULL)
{
BaseButtonInstance* button = (BaseButtonInstance*)obj;
@@ -541,23 +516,15 @@ void GuiRootInstance::update()
button4->disabled = true;
button5->disabled = true;
button6->disabled = true;
for(size_t i = 0; i < getSelectionService->getSelection().size(); i++)
if(getSelectionService->getSelection()[i]->canDelete)
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
{
button->disabled = false;
button2->disabled = false;
button3->disabled = false;
button4->disabled = false;
button5->disabled = false;
button6->disabled = false;
if (getSelectionService->getSelection().size() > 1){
button2->disabled = false;
}
if (dynamic_cast<GroupInstance*>(getSelectionService->getSelection()[i])){
button3->disabled = false;
}
break;
}
}

View File

@@ -80,6 +80,13 @@ std::vector<PROPGRIDITEM> Instance::getProperties()
}
std::vector<Property *> Instance::collectProperties()
{
std::vector<Property *> properties;
properties.push_back(new StringProperty("Name", "The name of this instance", "Properties", name, this, &Instance::setName));
return properties;
}
Instance::~Instance(void)
{

View File

@@ -109,8 +109,8 @@ std::vector<PROPGRIDITEM> LevelInstance::getProperties()
PIT_CHECK
));
_snprintf(timerTxt, 12, "%g", timer);
_snprintf(scoreTxt, 12, "%d", score);
sprintf_s(timerTxt, "%g", timer);
sprintf_s(scoreTxt, "%d", score);
properties.push_back(createPGI("Gameplay",
"InitialTimerValue",
"The amount of time in seconds the player has to complete this level.\r\n\r\nPut 0 if time is limitless.",

View File

@@ -63,6 +63,33 @@ static Enum::Controller::Value strEnum(TCHAR * tval)
}
std::vector<Property *> PVInstance::collectProperties()
{
std::vector<Property *> properties = Instance::collectProperties();
properties.push_back(new BoolProperty(
"NameShown",
"This chooses whether the item name is shown",
"Item",
nameShown,
this,
(BoolProperty::instanceSetter)&PVInstance::setNameShown));
properties.push_back(new BoolProperty(
"ControllerFlagShown",
"This chooses whether the item's ControllerFlag is shown",
"Item",
controllerFlagShown,
this,
(BoolProperty::instanceSetter)&PVInstance::setControllerFlagShown));
return properties;
}
void PVInstance::setNameShown(bool nameShown){
this->nameShown = nameShown;
}
void PVInstance::setControllerFlagShown(bool controllerFlagShown){
this->controllerFlagShown = controllerFlagShown;
}
std::vector<PROPGRIDITEM> PVInstance::getProperties()
{
@@ -90,6 +117,15 @@ std::vector<PROPGRIDITEM> PVInstance::getProperties()
return properties;
}
void PVInstance::makeJoints()
{
for(size_t i = 0; i < children.size(); i++)
{
}
}
void PVInstance::PropUpdate(LPPROPGRIDITEM &pItem)
{
if(strcmp(pItem->lpszPropName, "NameShown") == 0)

View File

@@ -495,14 +495,6 @@ static TCHAR* strSoundType(int option)
return "Swoosh";
case Enum::Sound::Page:
return "Page";
case Enum::Sound::Click:
return "Click";
case Enum::Sound::Clock:
return "Clock";
case Enum::Sound::Step:
return "Step";
case Enum::Sound::StepOn:
return "StepOn";
}
return "NoSound";
}
@@ -529,14 +521,6 @@ static Enum::Sound::Value EnumOnTouchSoundType(TCHAR* option)
return Enum::Sound::Ping;
if(strcmp("Snap", option) == 0)
return Enum::Sound::Snap;
if(strcmp("Click", option) == 0)
return Enum::Sound::Click;
if(strcmp("Clock", option) == 0)
return Enum::Sound::Clock;
if(strcmp("Step", option) == 0)
return Enum::Sound::Step;
if(strcmp("StepOn", option) == 0)
return Enum::Sound::StepOn;
return Enum::Sound::NoSound;
}
@@ -601,18 +585,6 @@ void PartInstance::onTouch()
case Enum::Sound::Swoosh:
sndService->playSound(sndService->findFirstChild("Swoosh"));
break;
case Enum::Sound::Click:
sndService->playSound(sndService->findFirstChild("Click"));
break;
case Enum::Sound::Clock:
sndService->playSound(sndService->findFirstChild("Clock"));
break;
case Enum::Sound::Step:
sndService->playSound(sndService->findFirstChild("Step"));
break;
case Enum::Sound::StepOn:
sndService->playSound(sndService->findFirstChild("StepOn"));
break;
}
}
@@ -702,6 +674,49 @@ void PartInstance::PropUpdate(LPPROPGRIDITEM &item)
else PVInstance::PropUpdate(item);
}
void PartInstance::setColor(Color3 color)
{
this->color = color;
changed = true;
}
std::vector<Property *> PartInstance::collectProperties()
{
std::vector<Property *> properties = PVInstance::collectProperties();
properties.push_back(new Color3Property(
"Color3",
"The color of the selected part",
"Properties",
color,
this,
(Color3Property::instanceSetter)&PartInstance::setColor));
properties.push_back(new BoolProperty(
"Anchored",
"Whether the block can move or not",
"Item",
anchored,
this,
(BoolProperty::instanceSetter)&PartInstance::setAnchored));
properties.push_back(new Vector3Property(
"Offset",
"The position of the object in the workspace",
"Item",
position,
this,
(Vector3Property::instanceSetter)&PartInstance::setPosition));
properties.push_back(new Vector3Property(
"Size",
"The size of the object in the workspace",
"Item",
size,
this,
(Vector3Property::instanceSetter)&PartInstance::setSize));
return properties;
}
// This needs to be changed, buffer size of 12 is way too small
// Crash occurs if you put a huge number in
char changeTimerTxt[12];
@@ -723,14 +738,14 @@ std::vector<PROPGRIDITEM> PartInstance::getProperties()
(LPARAM)anchored,
PIT_CHECK
));
_snprintf(pto, 512, "%g, %g, %g", position.x, position.y, position.z);
sprintf_s(pto, "%g, %g, %g", position.x, position.y, position.z);
properties.push_back(createPGI("Item",
"Offset",
"The position of the object in the workspace",
(LPARAM)pto,
PIT_EDIT
));
_snprintf(pto2, 512, "%g, %g, %g", size.x, size.y, size.z);
sprintf_s(pto2, "%g, %g, %g", size.x, size.y, size.z);
properties.push_back(createPGI("Item",
"Size",
"The size of the object in the workspace",
@@ -756,11 +771,11 @@ std::vector<PROPGRIDITEM> PartInstance::getProperties()
"What sound plays when touched",
(LPARAM)strSoundType(OnTouchSound),
PIT_COMBO,
TEXT("NoSound\0Victory\0Boing\0Break\0Snap\0Bomb\0Splat\0Page\0Ping\0Swoosh\0Click\0Clock\0Step\0StepOn")
TEXT("NoSound\0Victory\0Boing\0Break\0Snap\0Bomb\0Splat\0Page\0Ping\0Swoosh\0")
));
_snprintf(changeScoreTxt, 12, "%d", changeScore);
_snprintf(changeTimerTxt, 12, "%g", changeTimer);
sprintf_s(changeScoreTxt, "%d", changeScore);
sprintf_s(changeTimerTxt, "%g", changeTimer);
properties.push_back(createPGI("OnTouch",
"ChangeScore",
"How the score is affected when touched",

View File

@@ -86,17 +86,17 @@ void SelectionService::render(RenderDevice * rd)
void drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Vector3 size, Vector3 pos, CoordinateFrame c)
{
Color3 outline = Color3::cyan();//Color3(0.098F,0.6F,1.0F);
float offsetSize = 0.1F;
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.2, from.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.2, from.z - offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.2, from.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize - 0.2, from.z - offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.2, 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.2, to.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.2, to.z - offsetSize))), rd, outline, Color4::clear());
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());

View File

@@ -67,30 +67,6 @@ SoundService::SoundService()
stockSound->setName("Page");
stockSound->setSoundId("/content/sounds/pageturn.wav");
stockSound->setParent(this);
// Click
stockSound = new SoundInstance();
stockSound->setName("Click");
stockSound->setSoundId("/content/sounds/switch.wav");
stockSound->setParent(this);
// Clock
stockSound = new SoundInstance();
stockSound->setName("Clock");
stockSound->setSoundId("/content/sounds/clickfast.wav");
stockSound->setParent(this);
// Step
stockSound = new SoundInstance();
stockSound->setName("Step");
stockSound->setSoundId("/content/sounds/SWITCH3.wav");
stockSound->setParent(this);
// StepOn
stockSound = new SoundInstance();
stockSound->setName("StepOn");
stockSound->setSoundId("/content/sounds/flashbulb.wav");
stockSound->setParent(this);
}
SoundService::~SoundService(void)

View File

@@ -1,5 +1,5 @@
#include "DataModelV2/TextButtonInstance.h"
#include "DataModelV2/BaseGuiInstance.h"
TextButtonInstance::TextButtonInstance(void)
{
@@ -11,7 +11,7 @@ TextButtonInstance::TextButtonInstance(void)
title = "TextBox";
textColor = Color4(1, 1, 1, 1);
textOutlineColor = Color4(0, 0, 0, 0);
boxColor = BaseGuiInstance::translucentBackdrop();
boxColor = Color4(0.6F,0.6F,0.6F,0.4F);
boxOutlineColor = Color4(0, 0, 0, 0);
setAllColorsSame();
textSize = 12;

View File

@@ -1,88 +1,75 @@
#include <G3DAll.h>
#include "Application.h"
#include "Globals.h"
#include "AudioPlayer.h"
#include "DataModelV2/SelectionService.h"
#include "Listener/GUDButtonListener.h"
#include "DataModelV2/SoundService.h"
void GUDButtonListener::onButton1MouseClick(BaseButtonInstance* button)
{
SelectionService* selectionService = g_dataModel->getSelectionService();
SoundService* soundService = g_dataModel->getSoundService();
bool cont = false;
for(size_t i = 0; i < selectionService->getSelection().size(); i++)
if(selectionService->getSelection()[i]->canDelete)
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
{
cont = true;
break;
}
if (cont)
if(cont)
{
if(button->disabled == false){
soundService->playSound(soundService->findFirstChild("Ping"));
}
AudioPlayer::playSound(dingSound);
if(button->name == "Duplicate")
{
std::vector<Instance*> newinst;
for(size_t i = 0; i < selectionService->getSelection().size(); i++)
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
{
if(selectionService->getSelection()[i]->canDelete)
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
{
Instance* tempinst = selectionService->getSelection()[i];
Instance* tempinst = g_dataModel->getSelectionService()->getSelection()[i];
Instance* clonedInstance = selectionService->getSelection()[i]->clone();
Instance* clonedInstance = g_dataModel->getSelectionService()->getSelection()[i]->clone();
if (clonedInstance->getClassName() == "PVInstance"){
PartInstance* Part = dynamic_cast<PartInstance*>(clonedInstance);
Part->setPosition(Part->getPosition() + G3D::Vector3(0, Part->getSize().y, 0));
}
newinst.push_back(clonedInstance);
newinst.push_back(tempinst);
}
}
selectionService->clearSelection();
selectionService->addSelected(newinst);
g_dataModel->getSelectionService()->clearSelection();
g_dataModel->getSelectionService()->addSelected(newinst);
}
else if(button->name == "Group")
{
if (selectionService->getSelection().size() > 1){
GroupInstance * inst = new GroupInstance();
inst->setParent(g_dataModel->getWorkspace());
for(size_t i = 0; i < selectionService->getSelection().size(); i++)
GroupInstance * inst = new GroupInstance();
inst->setParent(g_dataModel->getWorkspace());
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
{
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
{
if(selectionService->getSelection()[i]->canDelete)
g_dataModel->getSelectionService()->getSelection()[i]->setParent(inst);
if(PartInstance* part = dynamic_cast<PartInstance*>(g_dataModel->getSelectionService()->getSelection()[i]))
{
selectionService->getSelection()[i]->setParent(inst);
if(PartInstance* part = dynamic_cast<PartInstance*>(selectionService->getSelection()[i]))
{
inst->primaryPart = part;
}
inst->primaryPart = part;
}
}
selectionService->clearSelection();
selectionService->addSelected(inst);
}
}
g_dataModel->getSelectionService()->clearSelection();
g_dataModel->getSelectionService()->addSelected(inst);
}
else if(button->name == "UnGroup")
{
std::vector<Instance*> newinst;
for(size_t i = 0; i < selectionService->getSelection().size(); i++)
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
{
Instance* selection = selectionService->getSelection()[i];
if(GroupInstance* model = dynamic_cast<GroupInstance*>(selection))
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
{
newinst = model->unGroup();
model->setParent(NULL);
delete model;
model = NULL;
if(GroupInstance* model = dynamic_cast<GroupInstance*>(g_dataModel->getSelectionService()->getSelection()[i]))
{
newinst = model->unGroup();
model->setParent(NULL);
delete model;
model = NULL;
}
}
}
selectionService->clearSelection();
selectionService->addSelected(newinst);
g_dataModel->getSelectionService()->clearSelection();
g_dataModel->getSelectionService()->addSelected(newinst);
}
}
}

View File

@@ -2,9 +2,6 @@
#include "DataModelV2/ToggleImageButtonInstance.h"
#include "Application.h"
#include "Globals.h"
bool menuOpen = false;
void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button)
{
if(button->name == "go")
@@ -52,36 +49,4 @@ void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button)
break;
}
}
else if (button->name == "insert"){
HMENU mainmenu = CreatePopupMenu();
AppendMenu(mainmenu, MF_STRING, 104, "Model...");
POINT p;
GetCursorPos(&p);
int menuClick = TrackPopupMenu(mainmenu, TPM_LEFTBUTTON | TPM_RETURNCMD, p.x, p.y, 0, Globals::mainHwnd, 0);
switch (menuClick)
{
case 104:
g_dataModel->getOpenModel();
break;
}
}
else if (button->name == "MENU")
{
menuOpen = !menuOpen;
ShowWindow(g_usableApp->_propWindow->_hwndProp, menuOpen);
if(TextButtonInstance* textButton = dynamic_cast<TextButtonInstance*>(button))
{
if(menuOpen)
{
textButton->textColor = Color3(0,1,1);
textButton->textColorOvr = Color3(0,1,1);
}
else
{
textButton->textColor = Color3::white();
textButton->textColorOvr = Color3::white();
}
}
}
}

View File

@@ -0,0 +1,16 @@
#include "PropertiesV2/BoolProperty.h"
PROPGRIDITEM BoolProperty::getPropGridItem(){
PROPGRIDITEM pItem;
PropGrid_ItemInit(pItem);
pItem.lpszCatalog=_catalog;
pItem.lpszPropName=_name;
pItem.lpszPropDesc=_desc;
pItem.lpCurValue=_value > 0;
pItem.iItemType=PIT_CHECK;
return pItem;
}
void BoolProperty::setProperty(LPPROPGRIDITEM &pItem){
setValue(pItem->lpCurValue == TRUE);
}

View File

@@ -0,0 +1,21 @@
#include "PropertiesV2/Color3Property.h"
PROPGRIDITEM Color3Property::getPropGridItem(){
PROPGRIDITEM pItem;
PropGrid_ItemInit(pItem);
pItem.lpszCatalog=_catalog;
pItem.lpszPropName=_name;
pItem.lpszPropDesc=_desc;
pItem.lpCurValue=RGB((_value.r*255),(_value.g*255),(_value.b*255));
pItem.iItemType=PIT_COLOR;
return pItem;
}
void Color3Property::setProperty(LPPROPGRIDITEM &pItem){
setValue(Color3(
GetRValue(pItem->lpCurValue)/255.0F,
GetGValue(pItem->lpCurValue)/255.0F,
GetBValue(pItem->lpCurValue)/255.0F
));
}

View File

@@ -0,0 +1,14 @@
#include "PropertiesV2/Property.h"
PROPGRIDITEM Property::getPropGridItem(){
PROPGRIDITEM pItem;
PropGrid_ItemInit(pItem);
pItem.lpszCatalog=_catalog;
pItem.lpszPropName=_name;
pItem.lpszPropDesc=_desc;
pItem.iItemType=PIT_EDIT;
return pItem;
}
void Property::setProperty(LPPROPGRIDITEM &pItem){
}

View File

@@ -0,0 +1,16 @@
#include "PropertiesV2/StringProperty.h"
PROPGRIDITEM StringProperty::getPropGridItem(){
PROPGRIDITEM pItem;
PropGrid_ItemInit(pItem);
pItem.lpszCatalog=_catalog;
pItem.lpszPropName=_name;
pItem.lpszPropDesc=_desc;
pItem.lpCurValue=(LPARAM)_value.c_str();
pItem.iItemType=PIT_EDIT;
return pItem;
}
void StringProperty::setProperty(LPPROPGRIDITEM &pItem){
setValue((LPSTR)pItem->lpCurValue);
}

View File

@@ -0,0 +1,33 @@
#include "PropertiesV2/Vector3Property.h"
PROPGRIDITEM Vector3Property::getPropGridItem(){
std::stringstream s;
s << _value.x << ", " << _value.y << ", " << _value.z;
stringRep = s.str();
PROPGRIDITEM pItem;
PropGrid_ItemInit(pItem);
pItem.lpszCatalog=_catalog;
pItem.lpszPropName=_name;
pItem.lpszPropDesc=_desc;
pItem.lpCurValue=(LPARAM)stringRep.c_str();
pItem.iItemType=PIT_EDIT;
return pItem;
}
void Vector3Property::setProperty(LPPROPGRIDITEM &pItem){
std::string str = (LPTSTR)pItem->lpCurValue;
std::vector<float> vect;
std::stringstream ss(str);
float i;
while (ss >> i)
{
vect.push_back(i);
if (ss.peek() == ',')
ss.ignore();
}
if(vect.size() == 3)
{
setValue(Vector3(vect.at(0),vect.at(1),vect.at(2)));
}
}

View File

@@ -6,7 +6,7 @@
#include "strsafe.h"
#include "Application.h"
std::vector<PROPGRIDITEM> prop;
std::vector<Property*> prop;
std::vector<Instance*> children;
Instance * selectedInstance;
Instance * parent = NULL;
@@ -186,8 +186,15 @@ LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LPNMHDR pnm = (LPNMHDR)lParam;
LPNMPROPGRID lpnmp = (LPNMPROPGRID)pnm;
LPPROPGRIDITEM item = PropGrid_GetItemData(pnm->hwndFrom,lpnmp->iIndex);
selectedInstance->PropUpdate(item);
//propWind->UpdateSelected(selectedInstance);
for(size_t i = 0; i < prop.size(); i++)
{
if(strcmp(item->lpszPropName, prop[i]->getName()) == 0)
{
prop[i]->setProperty(item);
}
}
//selectedInstance->PropUpdate(item);
propWind->UpdateSelected(g_dataModel->getSelectionService()->getSelection());
}
}
break;
@@ -244,7 +251,7 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc
WS_EX_TOOLWINDOW,
"propHWND",
"PropertyGrid",
WS_POPUPWINDOW | WS_THICKFRAME | WS_CAPTION,
WS_VISIBLE | WS_POPUPWINDOW | WS_THICKFRAME | WS_CAPTION,
CW_USEDEFAULT,
CW_USEDEFAULT,
300,
@@ -342,6 +349,7 @@ void PropertyWindow::_resize()
void PropertyWindow::UpdateSelected(std::vector<Instance *> instances)
{
deleteProperties();
if(instances.size() <= 0)
{
ClearProperties();
@@ -349,13 +357,13 @@ void PropertyWindow::UpdateSelected(std::vector<Instance *> instances)
}
Instance * instance = instances[0];
PropGrid_ResetContent(_propGrid);
prop = instance->getProperties();
prop = instance->collectProperties();
//if (selectedInstance != instance)
{
selectedInstance = instance;
for(size_t i = 0; i < prop.size(); i++)
{
::PROPGRIDITEM item = prop.at(i);
::PROPGRIDITEM item = prop.at(i)->getPropGridItem();
PropGrid_AddItem(_propGrid, &item);
//PRGP propgp;
//propgp.instance = instance;
@@ -371,6 +379,16 @@ void PropertyWindow::UpdateSelected(std::vector<Instance *> instances)
void PropertyWindow::ClearProperties()
{
deleteProperties();
clearExplorer();
PropGrid_ResetContent(_propGrid);
}
void PropertyWindow::deleteProperties()
{
while(prop.size() > 0) {
Property * toDelete = prop.back();
prop.pop_back();
delete toDelete;
}
}

View File

@@ -1,5 +1,5 @@
#include "Tool/DraggerTool.h"
#include "Application.h"
#include "Tool/DraggerTool.h"
#include "Application.h"
#include "DataModelV2/SelectionService.h"
DraggerTool::DraggerTool(void)
@@ -11,199 +11,123 @@ DraggerTool::~DraggerTool(void)
{
}
void DraggerTool::onButton1MouseDown(Mouse mouse)
{
grabHandle(mouse);
if(handleGrabbed == -1)
{
ArrowTool::onButton1MouseDown(mouse);
createHandles();
} else
{
printf("GRABBED HANDLE!");
}
}
void DraggerTool::onButton1MouseUp(Mouse mouse)
{
ArrowTool::onButton1MouseUp(mouse);
createHandles();
}
void DraggerTool::onMouseMoved(Mouse mouse)
{
if(handleGrabbed != -1)
{
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
if(selection.size() == 1)
{
PartInstance* part = dynamic_cast<PartInstance*>(selection[0]);
if(part)
{
Ray ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().lookVector()*100);
switch(handleGrabbed){
case 0:
case 1:
ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().upVector()*100);
break;
case 2:
case 3:
ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().lookVector()*100);
break;
case 4:
case 5:
ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().leftVector()*100);
break;
}
CenterOffset = handles[handleGrabbed].center;
Vector3 intersection1 = ray.intersection(mouse.getPlane());
Vector3 intersection2 = ray.intersection(mouse.getInversePlane());
if(intersection1.isFinite())
{
intersection1.x = (ceil(intersection1.x / 1) * 1);
intersection1.y = (ceil(intersection1.y / 1) * 1);
intersection1.z = (ceil(intersection1.z / 1) * 1);
if ( ((int)part->getSize().x)%2 == 1 )
intersection1.x += 0.5;
//intersection1.y = mouse.getPlane() + part->getSize().y/2 - 0.5;
if ( ((int)part->getSize().z)%2 == 1 )
intersection1.z += 0.5;
part->setPosition(intersection1 + (part->getPosition() - CenterOffset));
}
else if(intersection2.isFinite())
{
intersection2.x = (ceil(intersection2.x / 1) * 1);
intersection2.y = (ceil(intersection2.y / 1) * 1);
intersection2.z = (ceil(intersection2.z / 1) * 1);
if ( ((int)part->getSize().x)%2 == 1)
intersection2.x += 0.5;
//intersection2.y = mouse.getInversePlane() + part->getSize().y/2 - 0.5;
part->setPosition(intersection2 + (part->getPosition() - CenterOffset));
}
float offset = 2;
center = part->getPosition();
Vector3 size = part->getSize();
CoordinateFrame cFrame = part->getCFrame();
handles[0].center = center + cFrame.upVector()*(size.y/2+offset);
handles[1].center = center - cFrame.upVector()*(size.y/2+offset);
handles[2].center = center + cFrame.lookVector()*(size.z/2+offset);
handles[3].center = center - cFrame.lookVector()*(size.z/2+offset);
handles[4].center = center + cFrame.leftVector()*(size.x/2+offset);
handles[5].center = center - cFrame.leftVector()*(size.x/2+offset);
}
}
}
else ArrowTool::onMouseMoved(mouse);
}
void DraggerTool::onSelect(Mouse mouse)
{
ArrowTool::onSelect(mouse);
createHandles();
}
void DraggerTool::onKeyDown(int key)
{
ArrowTool::onKeyDown(key);
}
void DraggerTool::onKeyUp(int key)
{
ArrowTool::onKeyUp(key);
}
void DraggerTool::grabHandle(Mouse mouse)
{
handleGrabbed = -1;
if(hasHandles)
{
G3D::Ray ray = mouse.getRay();
float distance = G3D::inf();
for(int i = 0; i < 6; i++)
{
float newDistance = ray.intersectionTime(handles[i]);
if(isFinite(newDistance) && newDistance < distance)
{
distance = newDistance;
handleGrabbed = i;
}
}
}
}
void DraggerTool::createHandles()
{
handleGrabbed = -1;
hasHandles = false;
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
if(selection.size() == 1)
{
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[0]))
{
hasHandles = true;
float offset = 2;
center = part->getPosition();
Vector3 size = part->getSize();
CoordinateFrame cFrame = part->getCFrame();
handles[0] = Sphere(center + cFrame.upVector()*(size.y/2+offset), 1);
handles[1] = Sphere(center - cFrame.upVector()*(size.y/2+offset), 1);
handles[2] = Sphere(center + cFrame.lookVector()*(size.z/2+offset), 1);
handles[3] = Sphere(center - cFrame.lookVector()*(size.z/2+offset), 1);
handles[4] = Sphere(center + cFrame.leftVector()*(size.x/2+offset), 1);
handles[5] = Sphere(center - cFrame.leftVector()*(size.x/2+offset), 1);
}
}
}
void DraggerTool::render(RenderDevice * rd, Mouse mouse)
{
if(hasHandles)
{
for(int i = 0; i < 6; i++)
{
G3D::Draw::arrow(center, handles[i].center-center, rd, Color3::orange(), 2);
}
}
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
for(size_t i = 0; i < selection.size(); i++)
{
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[i]))
{
//Ray ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().lookVector()*100);
//Vector3 intersection1 = ray.intersection(mouse.getPlane());
//Vector3 intersection2 = ray.intersection(mouse.getInversePlane());
//if(intersection1.isFinite())
//{
// Draw::sphere(Sphere(intersection1, 2), rd);
//}
//else if(intersection2.isFinite())
//{
// Draw::sphere(Sphere(intersection2, 2), rd);
//}
}
}
void DraggerTool::onButton1MouseDown(Mouse mouse)
{
grabHandle(mouse);
if(handleGrabbed == -1)
{
ArrowTool::onButton1MouseDown(mouse);
createHandles();
} else
{
printf("GRABBED HANDLE!");
}
}
void DraggerTool::onButton1MouseUp(Mouse mouse)
{
ArrowTool::onButton1MouseUp(mouse);
createHandles();
}
void DraggerTool::onMouseMoved(Mouse mouse)
{
if(handleGrabbed != -1)
{
}
else ArrowTool::onMouseMoved(mouse);
}
void DraggerTool::onSelect(Mouse mouse)
{
ArrowTool::onSelect(mouse);
createHandles();
}
void DraggerTool::onKeyDown(int key)
{
ArrowTool::onKeyDown(key);
}
void DraggerTool::onKeyUp(int key)
{
ArrowTool::onKeyUp(key);
}
void DraggerTool::grabHandle(Mouse mouse)
{
handleGrabbed = -1;
if(hasHandles)
{
G3D::Ray ray = mouse.getRay();
float distance = G3D::inf();
for(int i = 0; i < 6; i++)
{
float newDistance = ray.intersectionTime(handles[i]);
if(isFinite(newDistance) && newDistance < distance)
{
distance = newDistance;
handleGrabbed = i;
}
}
}
}
void DraggerTool::createHandles()
{
handleGrabbed = -1;
hasHandles = false;
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
if(selection.size() == 1)
{
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[0]))
{
hasHandles = true;
float offset = 2;
center = part->getPosition();
Vector3 size = part->getSize();
CoordinateFrame cFrame = part->getCFrame();
handles[0] = Sphere(center + cFrame.upVector()*(size.y/2+offset), 1);
handles[1] = Sphere(center - cFrame.upVector()*(size.y/2+offset), 1);
handles[2] = Sphere(center + cFrame.lookVector()*(size.z/2+offset), 1);
handles[3] = Sphere(center - cFrame.lookVector()*(size.z/2+offset), 1);
handles[4] = Sphere(center + cFrame.leftVector()*(size.x/2+offset), 1);
handles[5] = Sphere(center - cFrame.leftVector()*(size.x/2+offset), 1);
}
}
}
void DraggerTool::render(RenderDevice * rd, Mouse mouse)
{
if(hasHandles)
{
for(int i = 0; i < 6; i++)
{
G3D::Draw::arrow(center, handles[i].center-center, rd, Color3::orange(), 2);
}
}
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
for(size_t i = 0; i < selection.size(); i++)
{
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[i]))
{
Ray ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().lookVector()*100);
Vector3 intersection1 = ray.intersection(mouse.getPlane());
Vector3 intersection2 = ray.intersection(mouse.getInversePlane());
if(intersection1.isFinite())
{
Draw::sphere(Sphere(intersection1, 2), rd);
}
else if(intersection2.isFinite())
{
Draw::sphere(Sphere(intersection2, 2), rd);
}
}
}
}

View File

@@ -51,12 +51,12 @@ void collisionCallback(void *data, dGeomID o1, dGeomID o2)
contact[i].surface.mode = dContactBounce | dContactSlip1 | dContactSlip2 | dContactSoftERP | dContactSoftCFM | dContactApprox1;
// Define contact surface properties
contact[i].surface.bounce = 0.5F; //Elasticity
contact[i].surface.bounce = 0.5; //Elasticity
contact[i].surface.mu = 0.4F; //Friction
contact[i].surface.slip1 = 0.0;
contact[i].surface.slip2 = 0.0;
contact[i].surface.soft_erp = 0.8F;
contact[i].surface.soft_cfm = 0.005F;
contact[i].surface.soft_cfm = 0.01F;
// Create joints
dJointID c = dJointCreateContact(

View File

@@ -142,12 +142,6 @@ LRESULT CALLBACK G3DProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int main(int argc, char** argv) {
HINSTANCE hThisInstance = GetModuleHandle(NULL);
return WinMain(hThisInstance, NULL, NULL, 1);
}
int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int cmdShow)
{
#ifndef _DEBUG
try{
#endif
@@ -164,6 +158,7 @@ int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpCmd
icc.dwICC = ICC_WIN95_CLASSES/*|ICC_COOL_CLASSES|ICC_DATE_CLASSES|
ICC_PAGESCROLLER_CLASS|ICC_USEREX_CLASSES*/;
InitCommonControlsEx(&icc);
HMODULE hThisInstance = GetModuleHandle(NULL);
if (!createWindowClass("mainHWND",WndProc,hThisInstance))
return false;