35 Commits

Author SHA1 Message Date
Vulpovile
44a80184b3 Remove inapproproate parenthesis from readme 2025-04-12 10:12:21 -07:00
Vulpovile
061fc1e564 Merge pull request #136 from Vulpovile/bugfix/debug_assertion_failure
Added macro to disable VS2003 workaround when not required
2023-11-03 19:41:39 -08:00
Vulpovile
796a47ad38 Added macro to disable VS2003 workaround when not required 2023-11-03 19:57:11 -07:00
Vulpovile
f6110fa3a3 Merge pull request #135 from Vulpovile/bugfix/vs2003_stack_obliteration
Visual Studio 2003 stack clobbering workaround
2023-11-03 16:20:35 -08:00
Vulpovile
0120bc857d Merge branch 'develop' of github.com:Vulpovile/Blocks3D into bugfix/vs2003_stack_obliteration 2023-11-03 17:15:30 -07:00
Vulpovile
78fcebd1fc Merge pull request #133 from Vulpovile/bugfix/no_eol_conversions
Bugfix/no eol conversions
2023-11-03 16:15:10 -08:00
Vulpovile
706d16f9c3 Added redists and install script builds for VS2003 2023-11-03 17:09:50 -07:00
Vulpovile
111cc7cd01 Update copyright 2023-11-03 16:48:05 -07:00
Vulpovile
8817712cc3 Fixed stack clobbering in VS2003 compiler 2023-11-03 16:36:27 -07:00
Vulpovile
522a926965 Merge branch 'develop' into bugfix/no_eol_conversions 2023-11-03 12:26:02 -08:00
starfrost
f5d42a3b92 Merge pull request #134 from Vulpovile/feature/cleanup-projects
Remove absolute path in include directories
2023-11-03 19:44:26 +00:00
starfrost013
6f7fbdae2f Remove absolute path in include directories 2023-11-03 19:39:56 +00:00
Vulpovile
943ce9a5eb Merge branch 'develop' of github.com:Vulpovile/Blocks3D into bugfix/no_eol_conversions 2023-11-02 19:43:28 -07:00
Vulpovile
6bfbc4a97e Merge pull request #132 from KeyboardCombination/develop
move tool
2023-11-02 18:43:08 -08:00
Vulpovile
f5b31d8e99 Disable line ending conversions 2023-11-02 19:40:56 -07:00
KeyboardCombination
4336140b90 move tool 2023-11-02 22:18:35 -04:00
MusicalProgrammer
cb6eb4653d Merge pull request #129 from Vulpovile/feature/readme_update_dmv3
Update README.md to *reflect* DataModel V3
2023-11-02 19:45:22 -04:00
Vulpovile
43327b8974 Update README.md to *reflect* DataModel V3 2023-11-02 13:17:49 -07:00
Vulpovile
8e48115d37 Merge pull request #128 from Vulpovile/feature/property_grid_toggle
Made MENU toggle property grid
2023-11-02 10:27:44 -08:00
Vulpovile
d2bdd4e124 Made MENU toggle property grid 2023-11-02 11:17:53 -07:00
Vulpovile
c1431c8dff VS 2003 build files, made physics more stable, fix Win98/WINE IE 2023-11-02 01:16:05 -07:00
Vulpovile
cc0c195c0b Removed SDL from installer 2023-11-02 00:08:42 -07:00
Vulpovile
3c415e7297 Updated instance icon, no more SDL 2023-11-02 00:07:10 -07:00
MusicalProgrammer
5d96985667 Merge pull request #127 from Vulpovile/bugfix/use_consistent_crt
Fixed issues with Windows XP/2000 using different CRT DLLs
2023-11-01 22:23:24 -04:00
Vulpovile
03ab7122c3 Fixed issues with Windows XP/2000 using different CRT DLLs on build time causing a completely broken EXE 2023-11-01 18:10:56 -07:00
starfrost
a75f7bf381 Merge pull request #123 from KeyboardCombination/develop
GUD improvements (nobody merged this despite approval?)
2023-08-15 22:58:48 +01:00
KeyboardCombination
00b165c208 Update GUDButtonListener.cpp 2023-06-11 18:16:36 -04:00
KeyboardCombination
2a17185cc0 Fixed name inconsistencies 2023-05-21 17:29:11 -04:00
KeyboardCombination
b7f2b8f5a7 dynamic casting, extra sounds, fixes 2023-04-30 15:58:10 -04:00
KeyboardCombination
fd3679fb6b Removing useless check 2023-04-09 19:30:23 -04:00
KeyboardCombination
e37ad4879e duplicate improvements, prototype model insertion 2023-04-07 18:46:19 -04:00
KeyboardCombination
20bf032f1e Merge branch 'develop' of https://github.com/KeyboardCombination/Blocks3D into develop 2023-04-07 15:04:06 -04:00
KeyboardCombination
eb2766304a bigger selectionbox 2023-04-07 15:04:01 -04:00
KeyboardCombination
e914126c87 remove ode stuff 2023-04-06 23:07:27 -04:00
KeyboardCombination
48f3455b53 GUD improvements 2023-04-06 22:57:56 -04:00
45 changed files with 1413 additions and 418 deletions

1
.gitattributes vendored Normal file
View File

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

37
Blocks3D VS2003.sln Normal file
View 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
View 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
View 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="&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=".\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,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>

View File

@@ -55,7 +55,7 @@
OmitFramePointers="true" OmitFramePointers="true"
WholeProgramOptimization="true" WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;.\src\include&quot;" AdditionalIncludeDirectories="&quot;.\src\include&quot;"
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="&quot;C:\libraries\ode-0.5\include\drawstuff&quot;;.\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"
@@ -674,18 +675,6 @@
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter
Name="Properties"
>
<File
RelativePath=".\src\source\Properties\BoolProperty.cpp"
>
</File>
<File
RelativePath=".\src\source\Properties\Property.cpp"
>
</File>
</Filter>
<Filter <Filter
Name="Helpers" Name="Helpers"
> >
@@ -959,18 +948,6 @@
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter
Name="Properties"
>
<File
RelativePath=".\src\include\Properties\BoolProperty.h"
>
</File>
<File
RelativePath=".\src\include\Properties\Property.h"
>
</File>
</Filter>
<Filter <Filter
Name="Helpers" Name="Helpers"
> >

View File

@@ -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", ""

Binary file not shown.

Binary file not shown.

View 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]
@@ -23,7 +24,7 @@ Type: filesandordirs; Name: "{app}"
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]

View 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]
@@ -26,7 +27,7 @@ Type: filesandordirs; Name: "{app}"
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]

View 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";

View 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
Parts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
PartsOld.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -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

BIN
SDL.dll

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

@@ -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;

View File

@@ -27,7 +27,9 @@ 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*);

View File

@@ -37,7 +37,7 @@ namespace Enum
enum Value { enum Value {
NoSound = 0, Victory = 1, Boing = 2, Bomb = 3, NoSound = 0, Victory = 1, Boing = 2, Bomb = 3,
Ping = 4, Break = 5, Splat = 6, Swoosh = 7, Ping = 4, Break = 5, Splat = 6, Swoosh = 7,
Snap = 8, Page = 9 Snap = 8, Page = 9, Click = 10, Clock = 11, Step = 12, StepOn = 13,
}; };
} }
} }

View File

@@ -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();
};

View File

@@ -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;
};

View File

@@ -7,12 +7,12 @@ class DraggerTool :
public: public:
DraggerTool(void); DraggerTool(void);
~DraggerTool(void); ~DraggerTool(void);
void onButton1MouseDown(Mouse); void onButton1MouseDown(Mouse);
void onButton1MouseUp(Mouse); void onButton1MouseUp(Mouse);
void onMouseMoved(Mouse mouse); void onMouseMoved(Mouse mouse);
void onSelect(Mouse mouse); void onSelect(Mouse mouse);
void onKeyDown(int key); void onKeyDown(int key);
void onKeyUp(int key); void onKeyUp(int key);
void render(RenderDevice * rd, Mouse mouse); void render(RenderDevice * rd, Mouse mouse);
private: private:
void createHandles(); void createHandles();
@@ -20,5 +20,6 @@ private:
bool hasHandles; bool hasHandles;
int handleGrabbed; int handleGrabbed;
Vector3 center; Vector3 center;
Vector3 centerOffset;
Sphere handles[6]; Sphere handles[6];
}; };

View File

@@ -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"
@@ -38,6 +39,7 @@ 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()
{ {
@@ -55,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
@@ -512,7 +514,7 @@ 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);
} }

View File

@@ -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>
#include <malloc.h>
#include <string.h>
#define NUM_SOUNDS 32 #define NUM_SOUNDS 32
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_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) 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");
}
} }

View File

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

View File

@@ -6,6 +6,7 @@
#include "DataModelV2/ImageButtonInstance.h" #include "DataModelV2/ImageButtonInstance.h"
#include "DataModelV2/ToggleImageButtonInstance.h" #include "DataModelV2/ToggleImageButtonInstance.h"
#include "DataModelV2/GuiRootInstance.h" #include "DataModelV2/GuiRootInstance.h"
#include "DataModelV2/SelectionService.h"
#include "DataModelV2/ImageButtonInstance.h" #include "DataModelV2/ImageButtonInstance.h"
#include "Globals.h" #include "Globals.h"
#include "StringFunctions.h" #include "StringFunctions.h"
@@ -18,6 +19,16 @@
#include "Listener/DeleteListener.h" #include "Listener/DeleteListener.h"
#include "Listener/ToolbarListener.h" #include "Listener/ToolbarListener.h"
#ifndef _DEBUG
#if _MSC_VER== 1310
#define VS03_WORKAROUND &
#else
#define VS03_WORKAROUND
#endif
#else
#define VS03_WORKAROUND
#endif
MenuButtonListener menuListener = MenuButtonListener(); MenuButtonListener menuListener = MenuButtonListener();
ToolbarListener toolbar = ToolbarListener(); ToolbarListener toolbar = ToolbarListener();
GUDButtonListener gud = GUDButtonListener(); GUDButtonListener gud = GUDButtonListener();
@@ -213,13 +224,14 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
button->boxBegin = Vector2(0,215); button->boxBegin = Vector2(0,215);
button->boxEnd = Vector2(80,235); button->boxEnd = Vector2(80,235);
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F); button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
button->textColor = Color3::white(); button->textColor = Color3(0,1,1);
button->boxColor = Color4::clear(); button->boxColor = Color4::clear();
button->textSize = 12; button->textSize = 12;
button->title = "Group"; button->title = "Group";
button->name = "Group"; button->name = "Group";
button->setAllColorsSame(); button->setAllColorsSame();
button->textColorDis = Color3(0.8F,0.8F,0.8F); 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->font = g_fntlighttrek;
button->fontLocationRelativeTo = Vector2(10, 0); button->fontLocationRelativeTo = Vector2(10, 0);
button->setParent(this); button->setParent(this);
@@ -229,13 +241,14 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
button->boxBegin = Vector2(0,240); button->boxBegin = Vector2(0,240);
button->boxEnd = Vector2(80,260); button->boxEnd = Vector2(80,260);
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F); button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
button->textColor = Color3::white(); button->textColor = Color3(0,1,1);
button->boxColor = Color4::clear(); button->boxColor = Color4::clear();
button->textSize = 12; button->textSize = 12;
button->title = "UnGroup"; button->title = "UnGroup";
button->name = "UnGroup"; button->name = "UnGroup";
button->setAllColorsSame(); button->setAllColorsSame();
button->textColorDis = Color3(0.8F,0.8F,0.8F); 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->font = g_fntlighttrek;
button->fontLocationRelativeTo = Vector2(10, 0); button->fontLocationRelativeTo = Vector2(10, 0);
button->setParent(this); button->setParent(this);
@@ -245,26 +258,45 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
button->boxBegin = Vector2(0,265); button->boxBegin = Vector2(0,265);
button->boxEnd = Vector2(80,285); button->boxEnd = Vector2(80,285);
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F); button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
button->textColor = Color3::white(); button->textColor = Color3(0,1,1);
button->boxColor = Color4::clear(); button->boxColor = Color4::clear();
button->textSize = 12; button->textSize = 12;
button->title = "Duplicate"; button->title = "Duplicate";
button->setAllColorsSame(); button->setAllColorsSame();
button->textColorDis = Color3(0.8F,0.8F,0.8F); 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->font = g_fntlighttrek;
button->fontLocationRelativeTo = Vector2(10, 0); button->fontLocationRelativeTo = Vector2(10, 0);
button->setParent(this); button->setParent(this);
button->name = "Duplicate"; button->name = "Duplicate";
button->setButtonListener(gud); 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( ImageButtonInstance* instance = new ToggleImageButtonInstance(
Texture::fromFile(GetFileInPath("/content/images/Run.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Run.png")),
Texture::fromFile(GetFileInPath("/content/images/Run_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Run_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/Run_dn.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Run_dn.png")),
NULL, NULL,
Texture::fromFile(GetFileInPath("/content/images/Stop.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Stop.png")),
Texture::fromFile(GetFileInPath("/content/images/Stop_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Stop_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/Stop_dn.png")) Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Stop_dn.png"))
); );
instance->setButtonListener(menuListener); instance->setButtonListener(menuListener);
instance->name = "go"; instance->name = "go";
@@ -274,17 +306,17 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/ArrowTool.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/ArrowTool.png")),
Texture::fromFile(GetFileInPath("/content/images/ArrowTool_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/ArrowTool_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/ArrowTool_dn.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/ArrowTool_dn.png")),
Texture::fromFile(GetFileInPath("/content/images/ArrowTool_ds.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/ArrowTool_ds.png")));
instance->size = Vector2(50,50); instance->size = Vector2(50,50);
instance->position = Vector2(15, 90); instance->position = Vector2(15, 90);
instance->setParent(this); instance->setParent(this);
instance->name = "Cursor"; instance->name = "Cursor";
instance->setButtonListener(msl); 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(VS03_WORKAROUND GetFileInPath("/content/images/ScaleTool.png")),Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/ScaleTool_ovr.png")),Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/ScaleTool_dn.png")),Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/ScaleTool_ds.png")));
instance->size = Vector2(40,40); instance->size = Vector2(40,40);
instance->position = Vector2(0, 140); instance->position = Vector2(0, 140);
instance->setParent(this); instance->setParent(this);
@@ -293,10 +325,10 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/MoveTool.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/MoveTool.png")),
Texture::fromFile(GetFileInPath("/content/images/MoveTool_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/MoveTool_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/MoveTool_dn.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/MoveTool_dn.png")),
Texture::fromFile(GetFileInPath("/content/images/MoveTool_ds.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/MoveTool_ds.png")));
instance->size = Vector2(40,40); instance->size = Vector2(40,40);
instance->position = Vector2(40, 140); instance->position = Vector2(40, 140);
instance->setParent(this); instance->setParent(this);
@@ -304,10 +336,10 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(msl); instance->setButtonListener(msl);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/SelectionRotate.png")),
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/SelectionRotate_ovr.png")),
NULL, NULL,
Texture::fromFile(GetFileInPath("/content/images/SelectionRotate_ds.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/SelectionRotate_ds.png")));
instance->size = Vector2(30,30); instance->size = Vector2(30,30);
instance->position = Vector2(10, 175); instance->position = Vector2(10, 175);
instance->setParent(this); instance->setParent(this);
@@ -315,10 +347,10 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(rbl); instance->setButtonListener(rbl);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/SelectionTilt.png")),
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/SelectionTilt_ovr.png")),
NULL, NULL,
Texture::fromFile(GetFileInPath("/content/images/SelectionTilt_ds.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/SelectionTilt_ds.png")));
instance->size = Vector2(30,30); instance->size = Vector2(30,30);
instance->position = Vector2(40, 175); instance->position = Vector2(40, 175);
instance->setParent(this); instance->setParent(this);
@@ -327,10 +359,10 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/Delete.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Delete.png")),
Texture::fromFile(GetFileInPath("/content/images/Delete_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Delete_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/Delete_dn.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Delete_dn.png")),
Texture::fromFile(GetFileInPath("/content/images/Delete_ds.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/Delete_ds.png")));
instance->size = Vector2(40,46); instance->size = Vector2(40,46);
instance->position = Vector2(20, 284); instance->position = Vector2(20, 284);
instance->setParent(this); instance->setParent(this);
@@ -338,9 +370,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(delet); instance->setButtonListener(delet);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/CameraZoomIn.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraZoomIn.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraZoomIn_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraZoomIn_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraZoomIn_dn.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraZoomIn_dn.png")));
instance->size = Vector2(34,25); instance->size = Vector2(34,25);
instance->floatBottom = true; instance->floatBottom = true;
instance->floatRight = true; instance->floatRight = true;
@@ -350,9 +382,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam); instance->setButtonListener(cam);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/CameraZoomOut.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraZoomOut.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraZoomOut_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraZoomOut_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraZoomOut_dn.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraZoomOut_dn.png")));
instance->size = Vector2(34,26); instance->size = Vector2(34,26);
instance->floatBottom = true; instance->floatBottom = true;
instance->floatRight = true; instance->floatRight = true;
@@ -362,9 +394,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam); instance->setButtonListener(cam);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/CameraPanLeft.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraPanLeft.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraPanLeft_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraPanLeft_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraPanLeft_dn.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraPanLeft_dn.png")));
instance->size = Vector2(34,34); instance->size = Vector2(34,34);
instance->floatBottom = true; instance->floatBottom = true;
instance->floatRight = true; instance->floatRight = true;
@@ -374,9 +406,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam); instance->setButtonListener(cam);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/CameraPanRight.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraPanRight.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraPanRight_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraPanRight_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraPanRight_dn.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraPanRight_dn.png")));
instance->size = Vector2(34,34); instance->size = Vector2(34,34);
instance->floatBottom = true; instance->floatBottom = true;
instance->floatRight = true; instance->floatRight = true;
@@ -386,9 +418,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam); instance->setButtonListener(cam);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/CameraCenter.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraCenter.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraCenter_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraCenter_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraCenter_dn.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraCenter_dn.png")));
instance->size = Vector2(34,20); instance->size = Vector2(34,20);
instance->floatBottom = true; instance->floatBottom = true;
instance->floatRight = true; instance->floatRight = true;
@@ -398,9 +430,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam); instance->setButtonListener(cam);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/CameraTiltUp.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraTiltUp.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraTiltUp_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraTiltUp_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraTiltUp_dn.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraTiltUp_dn.png")));
instance->size = Vector2(24,24); instance->size = Vector2(24,24);
instance->floatBottom = true; instance->floatBottom = true;
instance->floatRight = true; instance->floatRight = true;
@@ -410,9 +442,9 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
instance->setButtonListener(cam); instance->setButtonListener(cam);
instance = makeImageButton( instance = makeImageButton(
Texture::fromFile(GetFileInPath("/content/images/CameraTiltDown.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraTiltDown.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraTiltDown_ovr.png")), Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraTiltDown_ovr.png")),
Texture::fromFile(GetFileInPath("/content/images/CameraTiltDown_dn.png"))); Texture::fromFile(VS03_WORKAROUND GetFileInPath("/content/images/CameraTiltDown_dn.png")));
instance->size = Vector2(24,24); instance->size = Vector2(24,24);
instance->floatBottom = true; instance->floatBottom = true;
instance->floatRight = true; instance->floatRight = true;
@@ -465,7 +497,7 @@ void GuiRootInstance::renderGUI(G3D::RenderDevice* rd, double fps)
//Tools menu //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)); 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); //drawButtons(rd);
@@ -502,6 +534,9 @@ void GuiRootInstance::update()
Instance * obj3 = this->findFirstChild("UnGroup"); Instance * obj3 = this->findFirstChild("UnGroup");
Instance * obj4 = this->findFirstChild("Rotate"); Instance * obj4 = this->findFirstChild("Rotate");
Instance * obj5 = this->findFirstChild("Tilt"); Instance * obj5 = this->findFirstChild("Tilt");
SelectionService* getSelectionService = g_dataModel->getSelectionService();
if(obj != NULL && obj2 != NULL && obj3 != NULL && obj4 !=NULL && obj5 != NULL && obj6 != NULL) if(obj != NULL && obj2 != NULL && obj3 != NULL && obj4 !=NULL && obj5 != NULL && obj6 != NULL)
{ {
BaseButtonInstance* button = (BaseButtonInstance*)obj; BaseButtonInstance* button = (BaseButtonInstance*)obj;
@@ -516,15 +551,23 @@ void GuiRootInstance::update()
button4->disabled = true; button4->disabled = true;
button5->disabled = true; button5->disabled = true;
button6->disabled = true; button6->disabled = true;
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++) for(size_t i = 0; i < getSelectionService->getSelection().size(); i++)
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete) if(getSelectionService->getSelection()[i]->canDelete)
{ {
button->disabled = false; button->disabled = false;
button2->disabled = false;
button3->disabled = false;
button4->disabled = false; button4->disabled = false;
button5->disabled = false; button5->disabled = false;
button6->disabled = false; button6->disabled = false;
if (getSelectionService->getSelection().size() > 1){
button2->disabled = false;
}
if (dynamic_cast<GroupInstance*>(getSelectionService->getSelection()[i])){
button3->disabled = false;
}
break; break;
} }
} }

View File

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

View File

@@ -495,6 +495,14 @@ static TCHAR* strSoundType(int option)
return "Swoosh"; return "Swoosh";
case Enum::Sound::Page: case Enum::Sound::Page:
return "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"; return "NoSound";
} }
@@ -521,6 +529,14 @@ static Enum::Sound::Value EnumOnTouchSoundType(TCHAR* option)
return Enum::Sound::Ping; return Enum::Sound::Ping;
if(strcmp("Snap", option) == 0) if(strcmp("Snap", option) == 0)
return Enum::Sound::Snap; 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; return Enum::Sound::NoSound;
} }
@@ -585,6 +601,18 @@ void PartInstance::onTouch()
case Enum::Sound::Swoosh: case Enum::Sound::Swoosh:
sndService->playSound(sndService->findFirstChild("Swoosh")); sndService->playSound(sndService->findFirstChild("Swoosh"));
break; 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;
} }
} }
@@ -695,14 +723,14 @@ std::vector<PROPGRIDITEM> PartInstance::getProperties()
(LPARAM)anchored, (LPARAM)anchored,
PIT_CHECK PIT_CHECK
)); ));
sprintf_s(pto, "%g, %g, %g", position.x, position.y, position.z); _snprintf(pto, 512, "%g, %g, %g", position.x, position.y, position.z);
properties.push_back(createPGI("Item", properties.push_back(createPGI("Item",
"Offset", "Offset",
"The position of the object in the workspace", "The position of the object in the workspace",
(LPARAM)pto, (LPARAM)pto,
PIT_EDIT PIT_EDIT
)); ));
sprintf_s(pto2, "%g, %g, %g", size.x, size.y, size.z); _snprintf(pto2, 512, "%g, %g, %g", size.x, size.y, size.z);
properties.push_back(createPGI("Item", properties.push_back(createPGI("Item",
"Size", "Size",
"The size of the object in the workspace", "The size of the object in the workspace",
@@ -728,11 +756,11 @@ std::vector<PROPGRIDITEM> PartInstance::getProperties()
"What sound plays when touched", "What sound plays when touched",
(LPARAM)strSoundType(OnTouchSound), (LPARAM)strSoundType(OnTouchSound),
PIT_COMBO, PIT_COMBO,
TEXT("NoSound\0Victory\0Boing\0Break\0Snap\0Bomb\0Splat\0Page\0Ping\0Swoosh\0") TEXT("NoSound\0Victory\0Boing\0Break\0Snap\0Bomb\0Splat\0Page\0Ping\0Swoosh\0Click\0Clock\0Step\0StepOn")
)); ));
sprintf_s(changeScoreTxt, "%d", changeScore); _snprintf(changeScoreTxt, 12, "%d", changeScore);
sprintf_s(changeTimerTxt, "%g", changeTimer); _snprintf(changeTimerTxt, 12, "%g", changeTimer);
properties.push_back(createPGI("OnTouch", properties.push_back(createPGI("OnTouch",
"ChangeScore", "ChangeScore",
"How the score is affected when touched", "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) 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); Color3 outline = Color3::cyan();//Color3(0.098F,0.6F,1.0F);
float offsetSize = 0.05F; float offsetSize = 0.1F;
//X //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, 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, 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, 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()); 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 //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(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.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.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.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(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.1, to.z + offsetSize), Vector3(from.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());
//Z //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, from.y + offsetSize, from.z - offsetSize), Vector3(from.x - offsetSize, from.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());

View File

@@ -67,6 +67,30 @@ SoundService::SoundService()
stockSound->setName("Page"); stockSound->setName("Page");
stockSound->setSoundId("/content/sounds/pageturn.wav"); stockSound->setSoundId("/content/sounds/pageturn.wav");
stockSound->setParent(this); 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) SoundService::~SoundService(void)

View File

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

View File

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

View File

@@ -2,6 +2,9 @@
#include "DataModelV2/ToggleImageButtonInstance.h" #include "DataModelV2/ToggleImageButtonInstance.h"
#include "Application.h" #include "Application.h"
#include "Globals.h" #include "Globals.h"
bool menuOpen = false;
void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button) void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button)
{ {
if(button->name == "go") if(button->name == "go")
@@ -49,4 +52,36 @@ void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button)
break; 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

@@ -1,5 +0,0 @@
//#include "Properties/BoolProperty.h"
//PROPGRIDITEM BoolProperty::getPropGridItem()
//{
//return PROPGRIDITEM();
//}

View File

@@ -1,7 +0,0 @@
#include "Properties/Property.h"
template <typename T>
void Property<T>::setProperty(LPPROPGRIDITEM item)
{
_owner->propertiesChanged();
}

View File

@@ -244,7 +244,7 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc
WS_EX_TOOLWINDOW, WS_EX_TOOLWINDOW,
"propHWND", "propHWND",
"PropertyGrid", "PropertyGrid",
WS_VISIBLE | WS_POPUPWINDOW | WS_THICKFRAME | WS_CAPTION, WS_POPUPWINDOW | WS_THICKFRAME | WS_CAPTION,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
300, 300,

View File

@@ -1,5 +1,5 @@
#include "Tool/DraggerTool.h" #include "Tool/DraggerTool.h"
#include "Application.h" #include "Application.h"
#include "DataModelV2/SelectionService.h" #include "DataModelV2/SelectionService.h"
DraggerTool::DraggerTool(void) DraggerTool::DraggerTool(void)
@@ -11,123 +11,199 @@ DraggerTool::~DraggerTool(void)
{ {
} }
void DraggerTool::onButton1MouseDown(Mouse mouse) void DraggerTool::onButton1MouseDown(Mouse mouse)
{ {
grabHandle(mouse); grabHandle(mouse);
if(handleGrabbed == -1) if(handleGrabbed == -1)
{ {
ArrowTool::onButton1MouseDown(mouse); ArrowTool::onButton1MouseDown(mouse);
createHandles(); createHandles();
} else } else
{ {
printf("GRABBED HANDLE!"); printf("GRABBED HANDLE!");
} }
} }
void DraggerTool::onButton1MouseUp(Mouse mouse) void DraggerTool::onButton1MouseUp(Mouse mouse)
{ {
ArrowTool::onButton1MouseUp(mouse); ArrowTool::onButton1MouseUp(mouse);
createHandles(); createHandles();
} }
void DraggerTool::onMouseMoved(Mouse mouse) void DraggerTool::onMouseMoved(Mouse mouse)
{ {
if(handleGrabbed != -1) if(handleGrabbed != -1)
{ {
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
}
else ArrowTool::onMouseMoved(mouse); if(selection.size() == 1)
} {
PartInstance* part = dynamic_cast<PartInstance*>(selection[0]);
void DraggerTool::onSelect(Mouse mouse) if(part)
{ {
ArrowTool::onSelect(mouse); Ray ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().lookVector()*100);
createHandles();
} switch(handleGrabbed){
case 0:
void DraggerTool::onKeyDown(int key) case 1:
{ ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().upVector()*100);
ArrowTool::onKeyDown(key); break;
} case 2:
case 3:
void DraggerTool::onKeyUp(int key) ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().lookVector()*100);
{ break;
ArrowTool::onKeyUp(key); case 4:
} case 5:
ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().leftVector()*100);
void DraggerTool::grabHandle(Mouse mouse) break;
{ }
handleGrabbed = -1;
if(hasHandles) centerOffset = handles[handleGrabbed].center;
{
G3D::Ray ray = mouse.getRay(); Vector3 intersection1 = ray.intersection(mouse.getPlane());
float distance = G3D::inf(); Vector3 intersection2 = ray.intersection(mouse.getInversePlane());
for(int i = 0; i < 6; i++)
{
float newDistance = ray.intersectionTime(handles[i]); if(intersection1.isFinite())
if(isFinite(newDistance) && newDistance < distance) {
{ intersection1.x = (ceil(intersection1.x / 1) * 1);
distance = newDistance; intersection1.y = (ceil(intersection1.y / 1) * 1);
handleGrabbed = i; 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;
void DraggerTool::createHandles()
{ if ( ((int)part->getSize().z)%2 == 1 )
handleGrabbed = -1; intersection1.z += 0.5;
hasHandles = false;
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection(); part->setPosition(intersection1 + (part->getPosition() - centerOffset));
if(selection.size() == 1) }
{ else if(intersection2.isFinite())
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[0])) {
{ intersection2.x = (ceil(intersection2.x / 1) * 1);
hasHandles = true; intersection2.y = (ceil(intersection2.y / 1) * 1);
intersection2.z = (ceil(intersection2.z / 1) * 1);
float offset = 2;
if ( ((int)part->getSize().x)%2 == 1)
center = part->getPosition(); intersection2.x += 0.5;
Vector3 size = part->getSize();
//intersection2.y = mouse.getInversePlane() + part->getSize().y/2 - 0.5;
CoordinateFrame cFrame = part->getCFrame();
part->setPosition(intersection2 + (part->getPosition() - centerOffset));
handles[0] = Sphere(center + cFrame.upVector()*(size.y/2+offset), 1); }
handles[1] = Sphere(center - cFrame.upVector()*(size.y/2+offset), 1);
float offset = 2;
handles[2] = Sphere(center + cFrame.lookVector()*(size.z/2+offset), 1);
handles[3] = Sphere(center - cFrame.lookVector()*(size.z/2+offset), 1); center = part->getPosition();
Vector3 size = part->getSize();
handles[4] = Sphere(center + cFrame.leftVector()*(size.x/2+offset), 1); CoordinateFrame cFrame = part->getCFrame();
handles[5] = Sphere(center - cFrame.leftVector()*(size.x/2+offset), 1);
} 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);
void DraggerTool::render(RenderDevice * rd, Mouse mouse) handles[3].center = center - cFrame.lookVector()*(size.z/2+offset);
{
if(hasHandles) handles[4].center = center + cFrame.leftVector()*(size.x/2+offset);
{ handles[5].center = center - cFrame.leftVector()*(size.x/2+offset);
for(int i = 0; i < 6; i++) }
{ }
G3D::Draw::arrow(center, handles[i].center-center, rd, Color3::orange(), 2); }
} else ArrowTool::onMouseMoved(mouse);
} }
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
for(size_t i = 0; i < selection.size(); i++) void DraggerTool::onSelect(Mouse mouse)
{ {
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[i])) ArrowTool::onSelect(mouse);
{ createHandles();
Ray ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().lookVector()*100); }
Vector3 intersection1 = ray.intersection(mouse.getPlane());
Vector3 intersection2 = ray.intersection(mouse.getInversePlane()); void DraggerTool::onKeyDown(int key)
if(intersection1.isFinite()) {
{ ArrowTool::onKeyDown(key);
Draw::sphere(Sphere(intersection1, 2), rd); }
}
else if(intersection2.isFinite()) void DraggerTool::onKeyUp(int key)
{ {
Draw::sphere(Sphere(intersection2, 2), rd); 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; contact[i].surface.mode = dContactBounce | dContactSlip1 | dContactSlip2 | dContactSoftERP | dContactSoftCFM | dContactApprox1;
// Define contact surface properties // Define contact surface properties
contact[i].surface.bounce = 0.5; //Elasticity contact[i].surface.bounce = 0.5F; //Elasticity
contact[i].surface.mu = 0.4F; //Friction contact[i].surface.mu = 0.4F; //Friction
contact[i].surface.slip1 = 0.0; contact[i].surface.slip1 = 0.0;
contact[i].surface.slip2 = 0.0; contact[i].surface.slip2 = 0.0;
contact[i].surface.soft_erp = 0.8F; contact[i].surface.soft_erp = 0.8F;
contact[i].surface.soft_cfm = 0.01F; contact[i].surface.soft_cfm = 0.005F;
// Create joints // Create joints
dJointID c = dJointCreateContact( dJointID c = dJointCreateContact(

View File

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