Add rayman2 source files
335
Rayman_X/cpa/tempgrp/Edt/EDT.dsp
Normal file
@@ -0,0 +1,335 @@
|
||||
# Microsoft Developer Studio Project File - Name="EDT" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=EDT - Win32 Debug Glide with Editors
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "EDT.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "EDT.mak" CFG="EDT - Win32 Debug Glide with Editors"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "EDT - Win32 Debug Glide with Editors" (based on\
|
||||
"Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""$/CPA/TempGrp/Edt", OKGAAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug Glide with Editors"
|
||||
# PROP BASE Intermediate_Dir "Debug Glide with Editors"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 2
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "x:\CPA\EXE\main\EDT_Data"
|
||||
# PROP Intermediate_Dir "tmp\edtdfevd"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /Z7 /Od /I "X:\CPA\Public" /I "inc" /I "res" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /Fp"tmp\edtdfevd/New_EDT.pch" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x40c /d "_DEBUG"
|
||||
# ADD RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"x:\CPA\EXE\main\EDT_Data\EDTDFEvd.dll" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "EDT - Win32 Debug Glide with Editors"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\_object.def
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\DLLCom.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtbase.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtdedit.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtdflag.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtdmove.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtdsel.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtdupdt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtdvect.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtmodif.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtparse.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtrot.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtsobj.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edtspec.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\edttemp.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\stdafx.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Include Files"
|
||||
|
||||
# PROP Default_Filter "h,hpp"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtbase.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtdedit.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtdflag.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtdmove.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtdsel.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtdupdt.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtdvect.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtenum.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtmodif.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtparse.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtrot.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtsobj.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edtspec.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\inc\edttemp.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\src\stdafx.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edt_dlgb.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTCam.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtccall.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtccalone.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtcchoice.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtcmoveto.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTcOrient.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtcparent.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtcpfather.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtcppos.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTcSelectTo.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTcVOrient.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTedit.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTGeom.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTIpo.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTLum.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTnoed.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTNone.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTpedit.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTPerso.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTPhys.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTpnoed.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtres.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\edtres.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTSect.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTWaypt.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTWhat.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\EDTZone.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "others"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Exe\Main\EDT_Data\Hierarchy\Default.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Exe\Main\EDT_Data\Hierarchy\Editor.cnt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Exe\Main\EDT_Data\Hierarchy\EDITOR.HLP
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Exe\Main\EDT_Data\Hierarchy\EDTKeys.ini
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "libs debug"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Exe\Main\MaiDFEvd.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
421
Rayman_X/cpa/tempgrp/Edt/EDT.vcproj
Normal file
@@ -0,0 +1,421 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="EDT"
|
||||
ProjectGUID="{928BFB5B-A963-4E76-9A5D-C50FFC90975A}"
|
||||
SccProjectName=""$/CPA/TempGrp/Edt", OKGAAAAA"
|
||||
SccAuxPath=""
|
||||
SccLocalPath="."
|
||||
SccProvider="MSSCCI:NXN alienbrain"
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug Glide with Editors|Win32"
|
||||
OutputDirectory="x:\CPA\EXE\main\EDT_Data"
|
||||
IntermediateDirectory=".\tmp\edtdfevd"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="2"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="X:\CPA\Public,inc,res"
|
||||
PreprocessorDefinitions="CPA_WANTS_IMPORT;ACTIVE_EDITOR;WIN32;_DEBUG;_WINDOWS;CPA_VISUAL;CPA_DEBUG"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile="tmp\edtdfevd/New_EDT.pch"
|
||||
AssemblerListingLocation=".\tmp\edtdfevd/"
|
||||
ObjectFile=".\tmp\edtdfevd/"
|
||||
ProgramDataBaseFileName=".\tmp\edtdfevd/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
IgnoreImportLibrary="TRUE"
|
||||
AdditionalDependencies="maidfevd.lib"
|
||||
OutputFile="x:\CPA\EXE\main\EDT_Data\EDTDFEvd.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="x:\Cpa\Libd;x:\cpa\exe\main"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="x:\CPA\EXE\main\EDT_Data/EDTDFEvd.pdb"
|
||||
SubSystem="2"
|
||||
ImportLibrary="x:\CPA\EXE\main\EDT_Data/EDTDFEvd.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName="x:\CPA\EXE\main\EDT_Data/EDT.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1036"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp">
|
||||
<File
|
||||
RelativePath="src\DLLCom.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtbase.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtdedit.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtdflag.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtdmove.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtdsel.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtdupdt.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtdvect.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtmodif.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtparse.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtrot.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtsobj.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edtspec.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\edttemp.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\stdafx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Include Files"
|
||||
Filter="h,hpp">
|
||||
<File
|
||||
RelativePath="inc\edtbase.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtdedit.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtdflag.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtdmove.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtdsel.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtdupdt.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtdvect.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtenum.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtmodif.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtparse.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtrot.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtsobj.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edtspec.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="inc\edttemp.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\stdafx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="res\edt_dlgb.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTCam.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtccall.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtccalone.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtcchoice.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtcmoveto.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTcOrient.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtcparent.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtcpfather.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtcppos.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTcSelectTo.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTcVOrient.cur">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTedit.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTGeom.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTIpo.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTLum.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTnoed.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTNone.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTpedit.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTPerso.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTPhys.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTpnoed.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtres.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\edtres.rc">
|
||||
<FileConfiguration
|
||||
Name="Debug Glide with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
AdditionalIncludeDirectories="res"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTSect.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTWaypt.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTWhat.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\EDTZone.ico">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="others"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\Exe\Main\EDT_Data\Hierarchy\Default.bmp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Exe\Main\EDT_Data\Hierarchy\Editor.cnt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Exe\Main\EDT_Data\Hierarchy\EDITOR.HLP">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Exe\Main\EDT_Data\Hierarchy\EDTKeys.ini">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
570
Rayman_X/cpa/tempgrp/Edt/inc/edtbase.hpp
Normal file
@@ -0,0 +1,570 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTbase.hpp
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
#ifndef __EDTBASE_HPP__
|
||||
#define __EDTBASE_HPP__
|
||||
|
||||
#include "itf/CPAHieEd.hpp"
|
||||
#include "ITF.h"
|
||||
|
||||
class EDT_DialogEdit;
|
||||
class EDT_DialogUpdate;
|
||||
class EDT_DialogMove;
|
||||
class EDT_DialogFlag;
|
||||
class EDT_ModifMove;
|
||||
class EDT_DialogSelect;
|
||||
class EDT_SpecificEditor;
|
||||
class EDT_TempList;
|
||||
|
||||
#include "EDTEnum.hpp"
|
||||
#include "EDTSObj.hpp"
|
||||
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
|
||||
#define NB_MAX_MODES 15
|
||||
|
||||
#define C_szHierarchyIniFile "Hierarchy\\EDTKeys.ini"
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Class EDT_HierarchyEditor
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_HierarchyEditor : public CPA_HierarchyEditor
|
||||
{
|
||||
protected:
|
||||
|
||||
//== Links ==
|
||||
BOOL m_bHasCurrentWorld;
|
||||
|
||||
//== Tools ==
|
||||
CPA_KeyActionConfiguration * m_p_oDevKeyboard;
|
||||
EDT_SpecificEditor * m_pSpecificEditor;
|
||||
long m_lNbSpecificActions;
|
||||
|
||||
//== Frames ==
|
||||
CSplitFrame * m_pLeftFrame;
|
||||
CSplitFrame * m_pBottomFrame;
|
||||
|
||||
//== Dialogs ==
|
||||
EDT_DialogEdit * m_pDialogEdit;
|
||||
CPA_DialogList * m_pDialogList;
|
||||
EDT_DialogUpdate * m_pDialogUpdate;
|
||||
EDT_DialogMove * m_pDialogMove;
|
||||
EDT_DialogFlag * m_pDialogFlag;
|
||||
EDT_DialogSelect * m_pDialogSelect;
|
||||
|
||||
//== Moves ==
|
||||
EDT_ModifMove * m_pMouseMove;
|
||||
EDT_ModifMove * m_pKeyMove;
|
||||
tdeMouseMoveMode m_eMouseMoveMode;
|
||||
BOOL m_bAvoidKeyRepeat;
|
||||
BOOL m_bMovedObjectStaysOnScreen;
|
||||
|
||||
//== Orientation ==
|
||||
EDT_SuperObject * m_pOrientedObject;
|
||||
EDT_ModifMove * m_pOrientMove;
|
||||
BOOL m_bKeepOrientMode;
|
||||
|
||||
//== Register Selection ==
|
||||
//CPA2 Corneliu Babiuc (multiple registration) 06-07-98
|
||||
// EDT_SuperObject * m_pRegisteredObject;
|
||||
//END CPA2 Corneliu Babiuc (multiple registration) 06-07-98
|
||||
|
||||
//== Modifs ==
|
||||
CPA_List<EDT_SaveParents> m_stListOfModifParent;
|
||||
CPA_List<CPA_BaseObject> m_stListToEdit;
|
||||
CPA_List<EDT_SaveParents> m_stListToCopy;
|
||||
long m_lNbCopy;
|
||||
|
||||
//== Modes ==
|
||||
tdeEditorMode m_eEditorMode;
|
||||
HCURSOR m_a_hCursors[NB_MAX_MODES];
|
||||
BOOL m_bMultiSelectMode;
|
||||
|
||||
//== Cancels ==
|
||||
tdeCancelMode m_eModifCanceled;
|
||||
CString m_csMessage;
|
||||
|
||||
//== Hierarchy ==
|
||||
CPA_List<CPA_SuperObject> m_stListHierarchy;
|
||||
long m_lNbUnknown;
|
||||
|
||||
//== Super-Object Save ==
|
||||
CString m_csSOReferencePath;
|
||||
|
||||
//== Temporary Modifs ==
|
||||
EDT_TempList * m_pListOfTempModifs;
|
||||
|
||||
// Load Message
|
||||
CString m_csLoadingMessage;
|
||||
int m_iLoadingStatus;
|
||||
|
||||
// icons for dialog list
|
||||
CImageList m_oMainIconList;
|
||||
CImageList m_oTreeIconList;
|
||||
|
||||
// mouse
|
||||
BOOL m_bCanDisplayPopup;
|
||||
BOOL m_bDoDialogSelect;
|
||||
BOOL m_bDisableFirstMove;
|
||||
|
||||
//CPA2 Corneliu Babiuc (multiple registration) 06-07-98
|
||||
// BOOL m_bIsASelection;
|
||||
//END CPA2 Corneliu Babiuc (multiple registration) 06-07-98
|
||||
|
||||
BOOL m_bSelectSector;
|
||||
BOOL m_bSelectSectorWithMouse;
|
||||
tdstMousePos m_stLBDownMousePos;
|
||||
|
||||
// Begin Silviu Simen 18 August 1998 Cut/Paste Mechanism
|
||||
EDT_SuperObject * m_pRegisteredCuttedObject;
|
||||
BOOL m_bSpecialObject;
|
||||
// End Silviu Simen 18 August 1998 Cut/Paste Mechanism
|
||||
|
||||
public:
|
||||
|
||||
/*===========================================================================
|
||||
Contructor
|
||||
=========================================================================*/
|
||||
EDT_HierarchyEditor();
|
||||
~EDT_HierarchyEditor();
|
||||
|
||||
void Create (void);
|
||||
|
||||
//#################################################################################
|
||||
// EDITOR BASE
|
||||
//#################################################################################
|
||||
|
||||
/*===========================================================================
|
||||
Messages
|
||||
=========================================================================*/
|
||||
// construction
|
||||
void fn_vJustAfterRegistered (void);
|
||||
void fn_vConstruct (void);
|
||||
// focus
|
||||
void fn_vBeforeEngine (void);
|
||||
void fn_vBeforeEditor (void);
|
||||
//engine
|
||||
BOOL fn_bAcceptToRunEngine(void);
|
||||
BOOL fn_bAcceptToRunTimerEngine(void) { return TRUE; };
|
||||
// end appli
|
||||
void fn_vJustBeforeClosing(void);
|
||||
BOOL fn_bAcceptToExit(void);
|
||||
// keys
|
||||
BOOL _OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
BOOL _OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
// mouse
|
||||
BOOL _OnMouseMove (UINT nFlags, tdstMousePos *p_stPos, MTH3D_tdstVector *p_stVect);
|
||||
BOOL _OnLButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
|
||||
BOOL _OnRButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
|
||||
BOOL _OnLButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
|
||||
BOOL _OnRButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
|
||||
BOOL _OnLButtonUp (UINT nFlags, tdstMousePos *p_stPos);
|
||||
BOOL _OnRButtonUp (UINT nFlags, tdstMousePos *p_stPos);
|
||||
// command
|
||||
BOOL _OnCommand (UINT IDCmdMsg);
|
||||
BOOL _OnUpdateCommandUI (UINT IDCmdMsg, CCmdUI *pCmdUI);
|
||||
// dragdrop
|
||||
BOOL _OnDragDropEnd(WPARAM wParam, LPARAM lParam);
|
||||
BOOL _OnDragDropMove(WPARAM wParam, LPARAM lParam);
|
||||
BOOL _OnDragDropLooseFocus(WPARAM wParam, LPARAM lParam);
|
||||
BOOL _OnDragDropGainFocus(WPARAM wParam, LPARAM lParam);
|
||||
// add objects to draw
|
||||
virtual void fn_vAddObjectsToDraw(GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2, DEV_ViewPort* p3);
|
||||
void fn_vAddObjectsToDraw2(GLD_tdstViewportAttributes *p1, GLI_tdxHandleToLight p2);
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
Reinit
|
||||
=========================================================================*/
|
||||
|
||||
void fn_vOnChangeRoot (void);
|
||||
void fn_vOnChangeWorld (void);
|
||||
void fn_vOnChangeDevice (void);
|
||||
|
||||
/*===========================================================================
|
||||
for Dialog List
|
||||
=========================================================================*/
|
||||
|
||||
void GetListsForDialog (CPA_DialogList *pDialog);
|
||||
void fn_vInitDefaultParameters (CPA_DialogList *pDialog);
|
||||
|
||||
BOOL fn_bOnSelChangeHierarchyTree (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pSelectedObject, CPA_BaseObject *pSelectedParent);
|
||||
BOOL fn_bOnDblClkHierarchyTree (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pSelectedObject, CPA_BaseObject *pSelectedParent);
|
||||
BOOL fn_bOnSelChangeListObjects (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pSelectedObject, BOOL bUnselect);
|
||||
BOOL fn_bOnDblClkListObjects (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pSelectedObject);
|
||||
BOOL fn_bCanDragItemInHierarchyTree (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObjectToDrag);
|
||||
BOOL fn_bCanDropItemInHierarchyTree (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObjectToDrop, CPA_BaseObject *pTarget);
|
||||
BOOL fn_bOnDragDropInHierarchyTree (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject, CPA_BaseObject *pTarget);
|
||||
BOOL fn_bOnSelChangeComboList (CPA_DialogList *pDialog, CString csListName);
|
||||
BOOL fn_bOnButtonTest (CPA_DialogList *pDialog, CString csListName, tdeListDrawMode eDraw);
|
||||
|
||||
BOOL fn_bOnKeyDownInDialog (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw,
|
||||
CPA_BaseObject *pSelectedObject, UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
BOOL fn_bOnKeyUpInDialog (CPA_DialogList *pDialog, CString csTypeName, tdeListDrawMode eDraw,
|
||||
CPA_BaseObject *pSelectedObject, UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
|
||||
CPA_BaseObject * GetDialogSelection (CPA_DialogList *pDialog, CString csListName, tdeListDrawMode eDrawMode);
|
||||
|
||||
CPA_BaseObject * GetTreeNodeNextChild (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pParent, CPA_BaseObject *pCurrentChild);
|
||||
int GetIconForTreeItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
|
||||
int GetStateForTreeItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
|
||||
|
||||
CString GetInfoForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
|
||||
int GetIconForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
|
||||
int GetStateForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
|
||||
|
||||
void fn_vSetANewTest (CPA_DialogList *pDialog, CString csCurrentList);
|
||||
BOOL fn_bTestFunction (CString csListName, CString csTestName, CPA_BaseObject *pEdObj);
|
||||
|
||||
int GetNumIconFromObjectType (CString csType);
|
||||
|
||||
BOOL fn_bAddEntriesToTreePopup (CPA_DialogList *pDialog, CString csListName, CMenu *pMenu, UINT uiCustomEntriesStart);
|
||||
BOOL fn_bAddEntriesToListPopup (CPA_DialogList *pDialog, CString csListName, CMenu *pMenu, UINT uiCustomEntriesStart);
|
||||
void fn_vOnCommandInTreePopup (CPA_DialogList *pDialog, CString csListName, UINT uiCustomEntry);
|
||||
void fn_vOnCommandInListPopup (CPA_DialogList *pDialog, CString csListName, UINT uiCustomEntry);
|
||||
|
||||
/*===========================================================================
|
||||
Editor
|
||||
=========================================================================*/
|
||||
|
||||
BOOL fn_bHasGainedFocus (void);
|
||||
void fn_vOnActivateEditor (CPA_List<CPA_BaseObject> *pParams, BOOL bBackActivated=FALSE);
|
||||
void fn_vOnCloseEditor (void);
|
||||
|
||||
/*===========================================================================
|
||||
Dialog Bar - Mircea Dunka 31 Aug. 1998
|
||||
=========================================================================*/
|
||||
void fn_vDefineDlgBarBtnIcon (tde_DlgBarCategory wCategory, tds_DlgBarBtn *_pDlgBarBtn);
|
||||
|
||||
/*===========================================================================
|
||||
SubMenus and PopupMenu
|
||||
=========================================================================*/
|
||||
|
||||
BOOL fn_bDefineSubMenu (EDT_SubMenu *_p_oEDTSubMenu);
|
||||
void _OnSubMenuCommand (EDT_SubMenu *_p_oEDTSubMenu,UINT uiMsgID);
|
||||
|
||||
BOOL fn_bDefinePopupMenu (EDT_PopUpMenu *pPopup, CPA_List<CPA_SuperObject> *pSelection, BOOL bAsCurrentEditor);
|
||||
void _OnPopUpMenuCommand (UINT m_IDCmdMsg);
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
SPO flags management
|
||||
=========================================================================*/
|
||||
|
||||
BOOL fn_bAcceptModifFlag (CPA_SuperObject *pEdObj, unsigned long ulFlag);
|
||||
|
||||
/*===========================================================================
|
||||
Save
|
||||
=========================================================================*/
|
||||
|
||||
void fn_vBeforeSaveAll (void);
|
||||
void fn_vAfterSaveAll (void);
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// FOR INTERFACE
|
||||
//#################################################################################
|
||||
|
||||
/*===========================================================================
|
||||
Dialog List
|
||||
=========================================================================*/
|
||||
|
||||
void fn_vUpdateLink (CString csCurrentMode);
|
||||
void fn_vUpdateModel (void);
|
||||
|
||||
/*===========================================================================
|
||||
Update
|
||||
=========================================================================*/
|
||||
|
||||
void fn_vUpdateEditor (tdeModeChange eMode);
|
||||
void fn_vCancelAllModes (void);
|
||||
|
||||
/*===========================================================================
|
||||
Hierarchy
|
||||
=========================================================================*/
|
||||
|
||||
BOOL fn_bInsertObjectInHierarchy (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, BOOL bUseEditManager = TRUE, BOOL bUpdateModif = TRUE, BOOL bSelect = TRUE, BOOL pBlock = FALSE);
|
||||
BOOL fn_bInsertAsPreviousBrother (CPA_SuperObject *pEdObj, CPA_SuperObject *pBrother, BOOL bUseEditManager = TRUE, BOOL bUpdateModif = TRUE, BOOL bSelect = TRUE, BOOL pBlock = FALSE);
|
||||
BOOL fn_bDeleteObjectInHierarchy (CPA_SuperObject *pEdObj, BOOL bUseEditManager = TRUE, BOOL bUpdateModif = TRUE, BOOL bDestroySuperObject = FALSE, BOOL bSelect = TRUE, BOOL pBlock = FALSE);
|
||||
|
||||
BOOL fn_bCanBeParent (CPA_SuperObject *pParent, tdstPosition *p_stPosition, tdeTypeSO eTypeSO, tdeSaveStatus eStatus);
|
||||
BOOL fn_bCanBeParentForAll (CPA_SuperObject *pEdObj);
|
||||
BOOL fn_bCanPasteAllObjects (tdePasteMode eMode, CPA_SuperObject *pNewParent = NULL, MTH3D_tdstVector *pNewPosition = NULL);
|
||||
|
||||
CPA_SuperObject * GetEditorObject (HIE_tdxHandleToSuperObject hSupObj);
|
||||
|
||||
CPA_SuperObject * GetNewSuperObject (HIE_tdxHandleToSuperObject hEngineSO,
|
||||
tdeSaveStatus eStatus, tdeTypeSO eTypeSO = C_NoType,
|
||||
CString csName = "", CString csEngineFileName = "");
|
||||
|
||||
CPA_SuperObject * GetNewSuperObject (tdeSaveStatus eStatus, tdeTypeSO eTypeSO = C_NoType,
|
||||
CString csName = "", CString csEngineFileName = "");
|
||||
|
||||
CPA_SuperObject * GetCopyOfSuperObject (CPA_SuperObject *pModel);
|
||||
|
||||
/*===========================================================================
|
||||
Selection Mode
|
||||
=========================================================================*/
|
||||
|
||||
BOOL fn_bIsPyramidModeEnabled (void) { return m_eEditorMode == E_em_PyramidMode; }
|
||||
BOOL fn_bIsMoveToModeEnabled (void) { return m_eEditorMode == E_em_MoveToMode; }
|
||||
BOOL fn_bIsMultiSelectModeEnabled (void) { return m_bMultiSelectMode; }
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// FOR SUPER-OBJECTS
|
||||
//#################################################################################
|
||||
|
||||
EDT_SuperObject * GetOrLoadSuperObject (CString csSectionName);
|
||||
CString GetEngineSectionName (HIE_tdxHandleToSuperObject hEngineSO);
|
||||
CString GetSOReferencePath (void) { return m_csSOReferencePath; }
|
||||
|
||||
EDT_TempList * GetListOfTempModifs (void) { return m_pListOfTempModifs; }
|
||||
void SetListOfTempModifs (EDT_TempList *pTempList) { m_pListOfTempModifs = pTempList; }
|
||||
|
||||
void fn_vAddTemporaryModif (EDT_SuperObject *pSupObj);
|
||||
void fn_vRemoveTemporaryModif (EDT_SuperObject *pSupObj);
|
||||
void fn_vChangeTemporaryModif (EDT_SuperObject *pSupObj);
|
||||
|
||||
CString GetTempListSectionName (void);
|
||||
|
||||
void fn_vDoDialogFlags (EDT_SuperObject *pSuperObject);
|
||||
|
||||
//#################################################################################
|
||||
// FOR DIALOGS & MODIFS & SPECIFIC EDITOR
|
||||
//#################################################################################
|
||||
|
||||
// members
|
||||
EDT_DialogEdit * GetDialogEdit (void) { return m_pDialogEdit; }
|
||||
EDT_DialogSelect * GetDialogSelect (void) { return m_pDialogSelect; }
|
||||
CPA_DialogList * GetDialogList (void) { return m_pDialogList; }
|
||||
CPA_List<EDT_SaveParents> * GetListOfModifParent (void) { return &m_stListOfModifParent; }
|
||||
EDT_SpecificEditor * GetSpecificEditor (void) { return m_pSpecificEditor; }
|
||||
BOOL fn_bHasCurrentWorld (void) { return m_bHasCurrentWorld; }
|
||||
|
||||
// functions
|
||||
void fn_vBuildEditorHierarchy (CPA_SuperObject *pEdObj, HIE_tdxHandleToSuperObject hSupObj);
|
||||
// Begin Silviu Simen september 1998 List of Objects in Sectors
|
||||
void fn_vBuildListOfSectors (void);
|
||||
void fn_vDoBuildListOfSectors (CPA_SuperObject *pEdObj, HIE_tdxHandleToSuperObject hSupObj);
|
||||
void fn_vSelectBySectorAndType (void);
|
||||
void fn_vDoSelectBySectorAndType(CString csSector, unsigned long ulType);
|
||||
// End Silviu Simen september 1998 List of Objects in Sectors
|
||||
void fn_vDestroySuperObject (CPA_SuperObject *pEdObj, BOOL bDestroyEngine = TRUE, BOOL bUpdateLists = TRUE);
|
||||
BOOL fn_bDoOrCancelMove (EDT_ModifMove *pModifMove);
|
||||
|
||||
EDT_SuperObject * GetACopy (EDT_SuperObject *pEdObj, BOOL bInstanceAlone, BOOL bFirstCopy);
|
||||
|
||||
CString GetLoadingMessage (void) { return m_csLoadingMessage; }
|
||||
int GetLoadingStatus (void) { return m_iLoadingStatus; }
|
||||
//CPA2 Corneliu Babiuc (teleportation bug) 25-06-98
|
||||
void fn_vAddObjectRecursiveToList(CPA_SuperObject * pSuperObject, CPA_List<EDT_ListByDLL> * p_lstListByDLL, BOOL bSelected);
|
||||
//CPA2 Corneliu Babiuc (teleportation bug) 25-06-98
|
||||
|
||||
//#################################################################################
|
||||
// PROTECTED FUNCTIONS
|
||||
//#################################################################################
|
||||
|
||||
protected:
|
||||
|
||||
/*===========================================================================
|
||||
Get Functions
|
||||
=========================================================================*/
|
||||
|
||||
EDT_SuperObject * GetRecursiveCopy (EDT_SuperObject *pEdObj, EDT_SuperObject *pNewOwner, BOOL bInstanceAlone, BOOL bFirstCopy);
|
||||
EDT_SuperObject * GetSuperObjectFromLinkTable (HIE_tdxHandleToSuperObject hEngineSO, EDT_SuperObject *pParent = NULL);
|
||||
|
||||
/*===========================================================================
|
||||
Set Functions
|
||||
=========================================================================*/
|
||||
|
||||
void SetEditorMode (tdeEditorMode eNewMode);
|
||||
void SetCurrentCursor (int iNumCursor, BOOL bSaveCurrentCursor = TRUE);
|
||||
|
||||
/*===========================================================================
|
||||
Permissions
|
||||
=========================================================================*/
|
||||
|
||||
BOOL fn_bCanTranslateAllObjects (tdeList eList = E_lst_SelectedList/*void CPA2 Corneliu Babiuc (multiple teleportation) 03-07-98 */);
|
||||
BOOL fn_bCanRotateAllObjects (void);
|
||||
BOOL fn_bCanCopyAllObjects (void);
|
||||
BOOL fn_bCanDeleteAllObjects (void);
|
||||
BOOL fn_bCanChangeAllParents (void);
|
||||
BOOL fn_bCanEnterMultiMode (void);
|
||||
|
||||
/*===========================================================================
|
||||
Messages
|
||||
=========================================================================*/
|
||||
|
||||
public:
|
||||
void fn_vSendMessageMoving (void);
|
||||
void fn_vSendMessageBeginMove (void);
|
||||
protected:
|
||||
void fn_vSendMessageChangeLevel (void);
|
||||
void fn_vSendMessageLevelChanged (void);
|
||||
|
||||
/*===========================================================================
|
||||
Rebuild Hierarchy
|
||||
=========================================================================*/
|
||||
|
||||
BOOL fn_bLoadEditorMap (void);
|
||||
void fn_vReinitEditorMap (BOOL bReinitLoad = TRUE);
|
||||
void fn_vUpdateHierarchyList (CPA_SuperObject *pEdObj);
|
||||
void fn_vDoDialogUpdate (void);
|
||||
|
||||
/*===========================================================================
|
||||
Insertion
|
||||
=========================================================================*/
|
||||
|
||||
EDT_SuperObject * GetParentForInsertion (CPA_ObjectDLLBase *p_oDLL, CString csTypeName, CString csModelName,
|
||||
tdstPosition *p_stPosition, tdeTypeSO eTypeInsert, tdeSaveStatus eStatus);
|
||||
|
||||
BOOL fn_bCanInsert (EDT_SuperObject *pEdObj, EDT_SuperObject *pParent);
|
||||
BOOL fn_bCanDelete (EDT_SuperObject *pEdObj);
|
||||
|
||||
BOOL fn_bFindPickingPosition (tdstPosition *p_stPosition);
|
||||
void fn_vGetNormalFromPicking (HIE_aDEF_stTabOfPickInfo a_stPickInfo, MTH3D_tdstVector *pNormal);
|
||||
void fn_vGetMinMaxPointsOfInstance (EDT_SuperObject *pEdObj, POS_tdxHandleToPosition hMatrix, MTH3D_tdstVector *p_stMinPoint, MTH3D_tdstVector *p_stMaxPoint,
|
||||
/*CPA2 Corneliu Babiuc (TMS_0598) 13-06-98*/ BOOL bGlobal = FALSE);
|
||||
void fn_vGetPositionFromBoundingVolume (EDT_SuperObject *pSupObj, MTH3D_tdstVector *pNormal, MTH3D_tdstVector *pVector);
|
||||
|
||||
/*===========================================================================
|
||||
Moves
|
||||
=========================================================================*/
|
||||
|
||||
CPA_SuperObject * fn_pstIsMouseOnObject (ACP_tdxIndex Index, HIE_tdstPickInfo *p_stObject);
|
||||
void fn_vTranslateObjects (int iAxe, int iDirection);
|
||||
void fn_vRotateObjects (int iAxe
|
||||
/*CPA2 Corneliu Babiuc 18-05-98 */ , int iDirection = 0);
|
||||
private:
|
||||
//Rotation and translation step and their access members
|
||||
GLI_tdxValue m_xRotationStep;
|
||||
GLI_tdxValue m_xTranslationStep;
|
||||
public:
|
||||
GLI_tdxValue fn_xGetRotationStep(void) {return m_xRotationStep;};
|
||||
void fn_vSetRotationStep(GLI_tdxValue xNewValue) {m_xRotationStep = xNewValue;};
|
||||
GLI_tdxValue fn_xGetTranslationStep(void) {return m_xTranslationStep;};
|
||||
void fn_vSetTranslationStep(GLI_tdxValue xNewValue) {m_xTranslationStep = xNewValue;};
|
||||
protected:
|
||||
//END CPA2 Corneliu Babiuc 20-05-98
|
||||
void fn_vMoveToNewPosition (tdstPosition *p_stPosition);
|
||||
void fn_vMoveToNewPosition (MTH3D_tdstVector* p_stPosition);
|
||||
void fn_vPutOnGround (void);
|
||||
//CPA2 Corneliu Babiuc (TMS_0598) 26-05-98
|
||||
void fn_vMoveObjectFromMultipleSelection (
|
||||
EDT_SuperObject * pSuperObject,
|
||||
CPA_List<EDT_SuperObject> * p_oList,
|
||||
long lIndex,
|
||||
MTH3D_tdstVector * pSelectedPoint,
|
||||
MTH3D_tdstVector * pNormal);
|
||||
//END CPA2 Corneliu (TMS_0598) 10-06-98
|
||||
//CPA2 Corneliu Babiuc (specific teleportation) 15-06-98
|
||||
//function to teleport selected instance to a reference instance
|
||||
void fn_vMoveToInstancePosition(EDT_SuperObject * pReferenceInstance);
|
||||
//function to teleport selected instance to editor's camera position
|
||||
void fn_vMoveToCameraPosition();
|
||||
//function to translate all selected objects
|
||||
void fn_vTranslateObjects(MTH3D_tdstVector * pTranslation);
|
||||
// camera teleportation functions
|
||||
void fn_vMoveCameraOrientedToInstance(EDT_SuperObject * p_oReference);
|
||||
void fn_vMoveCameraToInstanceCenterOnInstance(EDT_SuperObject * p_oReference, CPA_SuperObject * p_oCenterObject);
|
||||
//END CPA2 Corneliu Babiuc (specific teleportation) 18-06-98
|
||||
BOOL fn_bMouseRotatesObjects (void) { return (m_eMouseMoveMode == E_mmm_MouseRotateXY || m_eMouseMoveMode == E_mmm_MouseRotateXZ); };
|
||||
BOOL fn_bMouseChangesObjects (void) { return (m_eMouseMoveMode != E_mmm_NoMouseMove); };
|
||||
|
||||
/*===========================================================================
|
||||
Copy / Paste
|
||||
=========================================================================*/
|
||||
|
||||
void fn_vInitModifCopy (BOOL bInstanceAlone);
|
||||
void fn_vInitModifPaste (tdePasteMode eMode, EDT_SuperObject *pNewParent = NULL, MTH3D_tdstVector *pNewPosition = NULL);
|
||||
|
||||
void fn_vInitListToCopy (CPA_List<CPA_SuperObject> *pListObjects, BOOL bInstanceAlone);
|
||||
BOOL fn_bInitParentAndPos (tdePasteMode eMode, EDT_SuperObject *pNewParent = NULL, MTH3D_tdstVector *pNewPosition = NULL);
|
||||
|
||||
void UnSaveAllElement (EDT_SuperObject *pSupObj);
|
||||
|
||||
/*===========================================================================
|
||||
Modifs
|
||||
=========================================================================*/
|
||||
|
||||
static SCR_tde_Anl_ReturnValue CallBackLoadListModif (SCR_tdst_File_Description *p_fFile, char *szName, char *szParams[], SCR_tde_Anl_Action eAction);
|
||||
|
||||
/*===========================================================================
|
||||
Others
|
||||
=========================================================================*/
|
||||
|
||||
void fn_vSaveDialogsPreferences (void);
|
||||
void fn_vDisplayCancelMessage (tdeCancelMode eModif);
|
||||
void fn_vRestoreDialogs (void);
|
||||
|
||||
BOOL fn_bIsHierarchyTree (CString csCurrentType);
|
||||
void fn_vUpdateDialogList (CString csMode);
|
||||
|
||||
void fn_vApplyGravityToInstance (EDT_SuperObject *pSupObj, MTH3D_tdstVector *p_stMove, MTH3D_tdstVector *p_stVertical);
|
||||
|
||||
BOOL fn_bCanChangeSelectedObjects (void);
|
||||
|
||||
/*===========================================================================
|
||||
Moves
|
||||
=========================================================================*/
|
||||
|
||||
void fn_vRotateX (POS_tdstCompletePosition *p_stMatrix, GLI_tdxValue xXAngle);
|
||||
void fn_vRotateY (POS_tdstCompletePosition *p_stMatrix, GLI_tdxValue xYAngle);
|
||||
void fn_vRotateZ (POS_tdstCompletePosition *p_stMatrix, GLI_tdxValue xZAngle);
|
||||
|
||||
/*===========================================================================
|
||||
Orientation
|
||||
=========================================================================*/
|
||||
|
||||
BOOL fn_bCanOrientSelection (void);
|
||||
|
||||
void fn_vOrientToPosition (EDT_SuperObject *pEdObj, MTH3D_tdstVector *pOrientPosition);
|
||||
void fn_vOrientWithVertical (EDT_SuperObject *pEdObj, MTH3D_tdstVector *pOrientPosition);
|
||||
void fn_vOrientWithSelectedAxis (EDT_SuperObject *pEdObj, MTH3D_tdstVector *pOrientPosition, MTH3D_tdstVector *pAxis);
|
||||
|
||||
// Begin Silviu Simen 18 August 1998 Cut/Paste Mechanism
|
||||
public:
|
||||
BOOL fn_bObjectIsSpecial();
|
||||
|
||||
void SetRegisteredCuttedObject (EDT_SuperObject * pSupObj) { m_pRegisteredCuttedObject = pSupObj;}
|
||||
void SetSpecialObject (BOOL bSpecial) { m_bSpecialObject = bSpecial;}
|
||||
// End Silviu Simen 18 August 1998 Cut/Paste Mechanism
|
||||
};
|
||||
|
||||
|
||||
|
||||
// macros
|
||||
#define M_GetListOfModifParent() GetParentEditor()->GetListOfModifParent()
|
||||
#define M_HasCurrentWorld() GetParentEditor()->fn_bHasCurrentWorld()
|
||||
|
||||
extern tdstDLLIdentity g_stHierarchyIdentity;
|
||||
|
||||
#endif // __EDTBASE_HPP__
|
||||
#endif // ACTIVE_EDITOR
|
210
Rayman_X/cpa/tempgrp/Edt/inc/edtdedit.hpp
Normal file
@@ -0,0 +1,210 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTdEdit.h : class EDT_DialogEdit
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
#ifndef __DIALOGEDIT_HPP__
|
||||
#define __DIALOGEDIT_HPP__
|
||||
|
||||
#include "EDTRes.h"
|
||||
#include "EDTModif.hpp"
|
||||
|
||||
|
||||
#define C_AxeX 0
|
||||
#define C_AxeY 1
|
||||
#define C_AxeZ 2
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class EDT_SuperObject;
|
||||
class CPA_Interface;
|
||||
|
||||
/*===========================================================================
|
||||
* Description: EDT_DialogEdit dialog
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
class EDT_DialogEdit : public CFormView
|
||||
{
|
||||
protected:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
|
||||
// super object
|
||||
EDT_SuperObject *m_pEditedObject;
|
||||
|
||||
// move
|
||||
EDT_ModifMove *m_pEditMove;
|
||||
|
||||
// position
|
||||
MTH3D_tdstVector m_stTranslation;
|
||||
MTH3D_tdstVector m_stAngles;
|
||||
MTH3D_tdstVector m_stScales;
|
||||
|
||||
// flags for update
|
||||
BOOL m_bUpdatingPos;
|
||||
BOOL m_bUpdatingRot;
|
||||
BOOL m_bUpdatingScale;
|
||||
|
||||
// flag for move
|
||||
BOOL m_bGlobalMove;
|
||||
|
||||
BOOL m_bInitialised;
|
||||
|
||||
private:
|
||||
// moves
|
||||
void fn_vSetNewPosition (char cAxe);
|
||||
void fn_vSetNewRotation (char cAxe);
|
||||
void fn_vSetNewScale (char cAxe);
|
||||
void fn_vRotateX (POS_tdstCompletePosition * pMatrix, GLI_tdxValue Angle);
|
||||
void fn_vRotateY (POS_tdstCompletePosition * pMatrix, GLI_tdxValue Angle);
|
||||
void fn_vRotateZ (POS_tdstCompletePosition * pMatrix, GLI_tdxValue Angle);
|
||||
void fn_vConvertAnglesToRotateMatrix (POS_tdstCompletePosition * pMatrix, MTH3D_tdstVector * pAngles);
|
||||
void fn_vConvertRotateMatrixToAngles (MTH3D_tdstVector * pAngles, POS_tdstCompletePosition * pMatrix);
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
EDT_SuperObject * GetEditedSupObj (void) { return m_pEditedObject; }
|
||||
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// standard constructor
|
||||
EDT_DialogEdit (CWnd* pParent = NULL);
|
||||
|
||||
// dialog
|
||||
void fn_vInitDialog (EDT_HierarchyEditor *pEditor, FRMBase *pFrame);
|
||||
void fn_vUpdateDialog (void);
|
||||
|
||||
void fn_vUpdatePosition (void);
|
||||
void fn_vUpdateRotation (void);
|
||||
void fn_vUpdateScale (void);
|
||||
|
||||
void fn_vUpdateSuperObject (void);
|
||||
void fn_vUpdateObject (void);
|
||||
void fn_vUpdateParent (void);
|
||||
|
||||
void fn_vSendMessageMove (void);
|
||||
|
||||
BOOL fn_bCanTranslate (void);
|
||||
BOOL fn_bCanRotate (void);
|
||||
BOOL fn_bCanScale (void);
|
||||
//ANNECY Shaitan SPOFlags 17/02/98
|
||||
BOOL fn_bZoomForScale (void);
|
||||
//ENDANNECY Shaitan SPOFlags
|
||||
BOOL fn_bCanRenameObject (void);
|
||||
BOOL fn_bCanRenameSuperObject (void);
|
||||
|
||||
|
||||
//ROMTEAM StickObjects (Nicolae Suparatu 10/02/98)
|
||||
void fn_vSetNewPositionAndRotation (EDT_SuperObject *obj, POS_tdstCompletePosition matrix);
|
||||
//ENDROMTEAM StickObjects (Nicolae Suparatu)
|
||||
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(EDT_DialogEdit)
|
||||
enum { IDD = EDT_IDD_DIALOGEDIT };
|
||||
// super-object
|
||||
CEdit m_cSupObjName;
|
||||
CButton m_cSupObjGo;
|
||||
CStatic m_cSupObjOwner;
|
||||
CStatic m_cSupObjLevel;
|
||||
//ANNECY CO SPOFLAG 03/02/98
|
||||
CButton m_cSupObjFlags;
|
||||
//ENDANNECY CO SPOFLAG
|
||||
//ANNECY Shaitan Transparency 26/03/98 {
|
||||
CEdit m_cEditTransparency;
|
||||
CSliderCtrl m_cSliderTransparency;
|
||||
//ENDANNECY Shaitan Transparency }
|
||||
CButton m_cTemp;
|
||||
// object
|
||||
CEdit m_cObjectName;
|
||||
CStatic m_cObjectType, m_cObjectOwner;
|
||||
CStatic m_cObjectDesc;
|
||||
// parent
|
||||
CStatic m_cParentName;
|
||||
CStatic m_cParentObject;
|
||||
CStatic m_cParentType, m_cParentOwner;
|
||||
CButton m_cParentGo;
|
||||
// position
|
||||
CEdit m_cPosX, m_cPosY, m_cPosZ;
|
||||
CEdit m_cScaleX, m_cScaleY, m_cScaleZ;
|
||||
CEdit m_cRotX, m_cRotY, m_cRotZ;
|
||||
CSliderCtrl m_cSliderX, m_cSliderY, m_cSliderZ;
|
||||
CButton m_cGlobalMode, m_cApply;
|
||||
// default button
|
||||
CButton m_cDefault;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(EDT_DialogEdit)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(EDT_DialogEdit)
|
||||
afx_msg void OnChangeSupObjName();
|
||||
afx_msg void OnObjectGo();
|
||||
//ANNECY CO SPOFLAG 03/02/98
|
||||
afx_msg void OnFlags();
|
||||
//ENDANNECY CO SPOFLAG
|
||||
//ANNECY Shaitan Transparency 26/03/98 {
|
||||
afx_msg void OnChangeTransparency();
|
||||
afx_msg void OnHScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
//ENDANNECY Shaitan Transparency }
|
||||
|
||||
afx_msg void OnChangeEditName();
|
||||
afx_msg void OnLink();
|
||||
|
||||
afx_msg void OnParentGo();
|
||||
|
||||
afx_msg void OnChangePosx();
|
||||
afx_msg void OnChangePosy();
|
||||
afx_msg void OnChangePosz();
|
||||
afx_msg void OnChangeScalex();
|
||||
afx_msg void OnChangeScaley();
|
||||
afx_msg void OnChangeScalez();
|
||||
afx_msg void OnChangeRotx();
|
||||
afx_msg void OnChangeRoty();
|
||||
afx_msg void OnChangeRotz();
|
||||
afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
|
||||
afx_msg void OnGlobalMode();
|
||||
afx_msg void OnApply();
|
||||
|
||||
afx_msg void OnDefaultButton();
|
||||
afx_msg void OnSize(UINT, int, int);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif //__DIALOGEDIT_HPP__
|
||||
#endif // ACTIVE_EDITOR
|
103
Rayman_X/cpa/tempgrp/Edt/inc/edtdflag.hpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/*=========================================================================
|
||||
* //ANNECY CO SPOFLAG 03/02/98
|
||||
*
|
||||
* EDTdFlag.h : class EDT_DialogFlag
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
|
||||
#ifndef __DIALOGFLAG_H__
|
||||
#define __DIALOGFLAG_H__
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
#include "EDTRes.h"
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class EDT_SuperObject;
|
||||
class CPA_Interface;
|
||||
|
||||
/*===========================================================================
|
||||
* Description: EDT_DialogFlag dialog
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
class EDT_DialogFlag : public CDialog
|
||||
{
|
||||
protected:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
EDT_SuperObject *m_pSuperObject;
|
||||
unsigned long m_ulInitialFlags;
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// standard constructor
|
||||
EDT_DialogFlag (CWnd* pParent = NULL);
|
||||
// dialog
|
||||
void fn_vDoDialog (EDT_HierarchyEditor *pEditor, EDT_SuperObject *pSupObj);
|
||||
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(EDT_DialogFlag)
|
||||
enum { IDD = EDT_IDD_DIALOGFLAGS };
|
||||
CButton m_cCheckPicking;
|
||||
CButton m_cCheckHidden;
|
||||
//ANNECY Shaitan SPOFlags 17/02/98
|
||||
CButton m_cCheckTransformMatrix;
|
||||
CButton m_cCheckZoomForScale;
|
||||
//ANNECY TQ 27/02/98{
|
||||
CButton m_cCheckBoundingBox;
|
||||
CButton m_cCheckImpose;
|
||||
CButton m_cCheckNoRayTrace;
|
||||
CButton m_cCheckChildren;
|
||||
CButton m_cCheckNoShadowOnMe;
|
||||
//ENDANNECY TQ}
|
||||
|
||||
//ENDANNECY Shaitan SPOFlags
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(EDT_DialogFlag)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(EDT_DialogFlag)
|
||||
virtual void OnOK();
|
||||
virtual void OnCancel();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif //__DIALOGMOVE_H__
|
||||
#endif // ACTIVE_EDITOR
|
89
Rayman_X/cpa/tempgrp/Edt/inc/edtdmove.hpp
Normal file
@@ -0,0 +1,89 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTdMove.h : class EDT_DialogMove
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
|
||||
#ifndef __DIALOGMOVE_H__
|
||||
#define __DIALOGMOVE_H__
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
#include "EDTRes.h"
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class CPA_Interface;
|
||||
|
||||
/*===========================================================================
|
||||
* Description: EDT_DialogMove dialog
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
class EDT_DialogMove : public CDialog
|
||||
{
|
||||
protected:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bAcceptModif;
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// standard constructor
|
||||
EDT_DialogMove (CWnd* pParent = NULL);
|
||||
// dialog
|
||||
BOOL fn_bDoDialog (EDT_HierarchyEditor *pEditor);
|
||||
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(EDT_DialogMove)
|
||||
enum { IDD = EDT_IDD_DIALOGMOVE };
|
||||
CListBox m_cListObject;
|
||||
CListBox m_cListParent;
|
||||
CListBox m_cListSector;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(EDT_DialogMove)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(EDT_DialogMove)
|
||||
virtual void OnOK();
|
||||
virtual void OnCancel();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif //__DIALOGMOVE_H__
|
||||
#endif // ACTIVE_EDITOR
|
179
Rayman_X/cpa/tempgrp/Edt/inc/edtdsel.hpp
Normal file
@@ -0,0 +1,179 @@
|
||||
//ROMTEAM StickObjects (Gabi Dumitrascu 02/02/98)
|
||||
|
||||
/*=========================================================================
|
||||
* edtdsel.hpp : class EDT_DialogSelect
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* CPA2 Gabi Dumitrascu 98-02-02
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
#ifndef __DIALOGSEL_HPP__
|
||||
#define __DIALOGSEL_HPP__
|
||||
|
||||
#include "EDTRes.h"
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class EDT_SuperObject;
|
||||
class CPA_Interface;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// EDT_DialogSelect form view
|
||||
|
||||
class EDT_DialogSelect : public CFormView
|
||||
{
|
||||
protected:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
// super object
|
||||
CPA_SuperObject *m_pDstObject, *m_pSrcObject;
|
||||
|
||||
int m_iCrtDstPoint, m_iCrtSrcPoint;
|
||||
MTH3D_tdstVector m_stDstPoints[3], m_stSrcPoints[3];
|
||||
|
||||
BOOL m_bWrongObject;
|
||||
|
||||
public:
|
||||
// standard constructor
|
||||
EDT_DialogSelect (CWnd* pParent = NULL);
|
||||
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
//CPA2 Nicolae Suparatu 98-02-10
|
||||
EDT_DialogEdit *m_edit;
|
||||
//End CPA2 Nicolae Suparatu 98-02-10
|
||||
|
||||
// dialog
|
||||
void fn_vInitDialog (EDT_HierarchyEditor *pEditor, FRMBase *pFrame);
|
||||
void fn_vUpdateDialog (void);
|
||||
BOOL fn_bIsSelecting ();
|
||||
void fn_vSetPoint (tdstMousePos *p_stPos, HIE_tdstPickInfo *p_stPickInfo);
|
||||
|
||||
protected:
|
||||
// Form Data
|
||||
//{{AFX_DATA(EDT_DialogSelect)
|
||||
enum { IDD = EDT_IDD_DIALOGSELECT };
|
||||
CButton m_ckSelectSrc;
|
||||
CButton m_ckSelectDst;
|
||||
CEdit m_PosZ33;
|
||||
CEdit m_PosZ3;
|
||||
CEdit m_PosZ22;
|
||||
CEdit m_PosZ2;
|
||||
CEdit m_PosZ11;
|
||||
CEdit m_PosZ1;
|
||||
CEdit m_PosY33;
|
||||
CEdit m_PosY3;
|
||||
CEdit m_PosY22;
|
||||
CEdit m_PosY2;
|
||||
CEdit m_PosY11;
|
||||
CEdit m_PosY1;
|
||||
CEdit m_PosX33;
|
||||
CEdit m_PosX3;
|
||||
CEdit m_PosX22;
|
||||
CEdit m_PosX2;
|
||||
CEdit m_PosX11;
|
||||
CEdit m_PosX1;
|
||||
CButton m_bMove;
|
||||
//}}AFX_DATA
|
||||
|
||||
void fn_vUpdateDstDialog(void);
|
||||
void fn_vUpdateSrcDialog(void);
|
||||
|
||||
BOOL fn_bIsSelectingDst () { return m_ckSelectDst.GetCheck(); }
|
||||
BOOL fn_bIsSelectingSrc () { return m_ckSelectSrc.GetCheck(); }
|
||||
|
||||
void fn_vSetDstPoint (tdstMousePos *p_stPos, HIE_tdstPickInfo *p_stPickInfo);
|
||||
void fn_vSetSrcPoint (tdstMousePos *p_stPos, HIE_tdstPickInfo *p_stPickInfo);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(EDT_DialogSelect)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
protected:
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(EDT_DialogSelect)
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnMove();
|
||||
afx_msg void OnSelectDst();
|
||||
afx_msg void OnSelectSrc();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// interface for the EDT_DialogSelectType class.
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/*=========================================================================
|
||||
* Version 1.0
|
||||
* Creation date 9 september 1998
|
||||
* Revision date 9 september 1998
|
||||
* Author : Silviu Simen
|
||||
*=======================================================================*/
|
||||
|
||||
class EDT_DialogSelectType : public CDialog
|
||||
{
|
||||
private:
|
||||
CPA_Interface* m_p_oInterface;
|
||||
|
||||
public:
|
||||
BOOL m_bWasOK;
|
||||
CString m_csSelSector;
|
||||
unsigned long m_ulSelType;
|
||||
|
||||
EDT_DialogSelectType (CPA_Interface *p_oInterface, CWnd* pParent = NULL);
|
||||
virtual ~EDT_DialogSelectType();
|
||||
|
||||
CPA_Interface* GetInterface (void) { return m_p_oInterface; }
|
||||
|
||||
void Init (void);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(EDT_DialogSelectType)
|
||||
enum { IDD = EDT_IDD_DIALOGSELECTTYPES };
|
||||
CListBox m_cSectors;
|
||||
CListBox m_cTypes;
|
||||
//}}AFX_DATA
|
||||
|
||||
protected:
|
||||
|
||||
//{{AFX_VIRTUAL(EDT_DialogSelectType)
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnOK( ) ;
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //__DIALOGSEL_HPP__
|
||||
#endif // ACTIVE_EDITOR
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//ENDROMTEAM StickObjects (Gabi Dumitrascu)
|
||||
|
||||
|
||||
|
103
Rayman_X/cpa/tempgrp/Edt/inc/edtdupdt.hpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTdUpdt.h : class EDT_DialogList
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
#ifndef __DIALOGUPDATE_H__
|
||||
#define __DIALOGUPDATE_H__
|
||||
|
||||
#include "EDTRes.h"
|
||||
|
||||
#include "ITF.h"
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class EDT_SuperObject;
|
||||
class CPA_Interface;
|
||||
|
||||
/*===========================================================================
|
||||
* Description: EDT_DialogUpdate dialog
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
class EDT_DialogUpdate : public CDialog
|
||||
{
|
||||
protected:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
|
||||
public:
|
||||
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// Construction
|
||||
EDT_DialogUpdate (CWnd* pParent = NULL);
|
||||
|
||||
void fn_vInitDialog (EDT_HierarchyEditor *pEditor);
|
||||
|
||||
// function
|
||||
BOOL fn_bIsInHierarchy (EDT_SuperObject *pEdObj);
|
||||
|
||||
// lists
|
||||
CPA_List<EDT_SuperObject> m_stListDestroy;
|
||||
CPA_List<EDT_SuperObject> m_stListInsert;
|
||||
// position
|
||||
POS_tdstCompletePosition m_stRefMatrix;
|
||||
|
||||
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(EDT_Update)
|
||||
enum { IDD = EDT_IDD_DIALOGUPDATE };
|
||||
CListBox m_cListInsert1;
|
||||
CListBox m_cListDestroy1;
|
||||
CListBox m_cListInsert;
|
||||
CListBox m_cListDestroy;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(EDT_Update)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(EDT_Update)
|
||||
afx_msg void OnSelchangeListDestroy();
|
||||
afx_msg void OnSelchangeListReinsert();
|
||||
virtual void OnOK();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif //__DIALOGUPDATE_H__
|
||||
#endif // ACTIVE_EDITOR
|
75
Rayman_X/cpa/tempgrp/Edt/inc/edtdvect.hpp
Normal file
@@ -0,0 +1,75 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTdVect.hpp : class EDT_DialogVector
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date 17-06-98
|
||||
* Author Corneliu Babiuc
|
||||
* Revision date
|
||||
*
|
||||
**=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
|
||||
#ifndef __DIALOGVECTOR_H__
|
||||
#define __DIALOGVECTOR_H__
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
#include "EDTRes.h"
|
||||
#include "mth.h"
|
||||
|
||||
/*===========================================================================
|
||||
* Description: EDT_DialogVector dialog
|
||||
* Creation date:
|
||||
* Author: Corneliu Babiuc
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
class EDT_DialogVector : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
EDT_DialogVector(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(EDT_DialogVector)
|
||||
enum { IDD = EDT_IDD_DIALOGVECTOR };
|
||||
MTH_tdxReal m_xComponentX;
|
||||
MTH_tdxReal m_xComponentY;
|
||||
MTH_tdxReal m_xComponentZ;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(EDT_DialogVector)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(EDT_DialogVector)
|
||||
virtual void OnOK();
|
||||
virtual void OnCancel();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif // __DIALOGVECTOR_H__
|
||||
#endif // ACTIVE_EDITOR
|
93
Rayman_X/cpa/tempgrp/Edt/inc/edtenum.hpp
Normal file
@@ -0,0 +1,93 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTEnum.hpp
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
#ifndef __EDTENUM_HPP__
|
||||
#define __EDTENUM_HPP__
|
||||
|
||||
|
||||
// mousemove mode
|
||||
typedef enum tdeMouseMoveMode_
|
||||
{
|
||||
E_mmm_NoMouseMove,
|
||||
E_mmm_MouseMove,
|
||||
E_mmm_MouseRotateXY,
|
||||
E_mmm_MouseRotateXZ
|
||||
}
|
||||
tdeMouseMoveMode;
|
||||
|
||||
// modif canceled for message
|
||||
typedef enum tdeCancelMode_
|
||||
{
|
||||
E_cm_CancelParent,
|
||||
E_cm_CancelCopy,
|
||||
E_cm_CancelInsert,
|
||||
E_cm_CancelDelete,
|
||||
E_cm_CancelMove,
|
||||
E_cm_CancelPaste,
|
||||
E_cm_NoCancel
|
||||
}
|
||||
tdeCancelMode;
|
||||
|
||||
// editor mode
|
||||
typedef enum tdeEditorMode_
|
||||
{
|
||||
E_em_PyramidMode,
|
||||
E_em_HierarchyMode,
|
||||
E_em_ChoiceMode,
|
||||
E_em_ParentMode,
|
||||
E_em_PositionMode,
|
||||
E_em_CopyAllMode,
|
||||
E_em_CopyAloneMode,
|
||||
E_em_MoveToMode,
|
||||
//CPA2 Corneliu Babiuc (multiple registration) 07-07-98
|
||||
E_em_RegisterSelection,
|
||||
E_em_ClearRegistration,
|
||||
//CPA2 Corneliu Babiuc (multiple registration) 07-07-98
|
||||
//CPA2 Corneliu Babiuc 14-06-98
|
||||
E_em_MoveToInstance,
|
||||
E_em_MoveCameraToInstance,
|
||||
E_em_MoveCameraCentered,
|
||||
//CPA2 Corneliu Babiuc 17-06-98
|
||||
E_em_OrientMode,
|
||||
E_em_VOrientMode,
|
||||
// Begin Silviu Simen 18 August 1998 Cut/Paste Mechanism
|
||||
E_em_CutPasteMode,
|
||||
// End Silviu Simen 18 August 1998 Cut/Paste Mechanism
|
||||
E_em_NoMode
|
||||
}
|
||||
tdeEditorMode;
|
||||
|
||||
//CPA2 Corneliu Babiuc (multiple registration) 03-07-98
|
||||
// selection of list
|
||||
typedef enum tdeList_
|
||||
{
|
||||
E_lst_SelectedList,
|
||||
E_lst_RegisteredList
|
||||
}
|
||||
tdeList;
|
||||
//END CPA2 Corneliu Babiuc (multiple registration) 03-07-98
|
||||
|
||||
#endif // __EDTENUM_HPP__
|
||||
#endif // ACTIVE_EDITOR
|
517
Rayman_X/cpa/tempgrp/Edt/inc/edtmodif.hpp
Normal file
@@ -0,0 +1,517 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTModif.hpp : Class Modif*
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
|
||||
#ifndef __EDTMODIF_HPP__
|
||||
#define __EDTMODIF_HPP__
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
|
||||
#define TYPE_DELETE 1
|
||||
#define TYPE_INSERT 2
|
||||
#define TYPE_MOVE 3
|
||||
#define TYPE_NAME 4
|
||||
#define TYPE_PARENT 5
|
||||
#define TYPE_PASTE 6
|
||||
#define TYPE_RENAME 7
|
||||
#define TYPE_STATE 8
|
||||
#define TYPE_VALIDATE 9
|
||||
|
||||
|
||||
#include "itf/CPAMdf.hpp"
|
||||
#include "itf/CPASObj.hpp"
|
||||
#include "itf/objdllb.hpp"
|
||||
#include "itf/CPALists.hpp"
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class EDT_SuperObject;
|
||||
class EDT_TempModif;
|
||||
class CPA_Interface;
|
||||
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
static char szStaticExt [] = {".SPO"};
|
||||
static char szModifExt [] = {".MDT"};
|
||||
static char szFinalModifExt [] = {".MDF"};
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
//#################################################################################
|
||||
// TO SAVE PARENT MODIFICATION
|
||||
//#################################################################################
|
||||
/*===========================================================================
|
||||
List For DLLs
|
||||
=========================================================================*/
|
||||
class EDT_ParentByType : public CObject
|
||||
{
|
||||
public:
|
||||
CPA_ObjectDLLBase *m_poDLL;
|
||||
CPA_List<EDT_SaveParents> m_stListObjects;
|
||||
CPA_List<EDT_SaveParents> m_stListProtected;
|
||||
|
||||
EDT_ParentByType (CPA_ObjectDLLBase *p_oDLL)
|
||||
{
|
||||
m_poDLL = p_oDLL;
|
||||
m_stListObjects.RemoveAll();
|
||||
m_stListProtected.RemoveAll();
|
||||
}
|
||||
|
||||
~EDT_ParentByType (void)
|
||||
{
|
||||
while (m_stListObjects.GetCount() > 0)
|
||||
delete m_stListObjects.RemoveTail();
|
||||
while (m_stListProtected.GetCount() > 0)
|
||||
delete m_stListProtected.RemoveTail();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// TO SAVE POSITION MODIFICATION
|
||||
//#################################################################################
|
||||
|
||||
/*===========================================================================
|
||||
List For DLLs
|
||||
=========================================================================*/
|
||||
class EDT_PosByType : public CObject
|
||||
{
|
||||
public:
|
||||
CPA_ObjectDLLBase *m_poDLL;
|
||||
// moved objects
|
||||
CPA_List<EDT_SavePos> m_stListObjects;
|
||||
CPA_List<EDT_SaveGlobalPos> m_stListConcerned;
|
||||
// protected objects
|
||||
CPA_List<EDT_SavePos> m_stListProtected;
|
||||
CPA_List<EDT_SaveGlobalPos> m_stListProtectConcerned;
|
||||
|
||||
EDT_PosByType (void)
|
||||
{
|
||||
m_stListObjects.RemoveAll();
|
||||
m_stListConcerned.RemoveAll();
|
||||
m_stListProtected.RemoveAll();
|
||||
m_stListProtectConcerned.RemoveAll();
|
||||
}
|
||||
|
||||
EDT_PosByType (CPA_ObjectDLLBase *p_oDLL)
|
||||
{
|
||||
m_poDLL = p_oDLL;
|
||||
m_stListObjects.RemoveAll();
|
||||
m_stListConcerned.RemoveAll();
|
||||
m_stListProtected.RemoveAll();
|
||||
m_stListProtectConcerned.RemoveAll();
|
||||
}
|
||||
|
||||
~EDT_PosByType (void)
|
||||
{
|
||||
while (!(m_stListObjects.IsEmpty()))
|
||||
delete m_stListObjects.RemoveTail();
|
||||
while (!(m_stListConcerned.IsEmpty()))
|
||||
delete m_stListConcerned.RemoveTail();
|
||||
while (!(m_stListObjects.IsEmpty()))
|
||||
delete m_stListObjects.RemoveTail();
|
||||
while (!(m_stListProtectConcerned.IsEmpty()))
|
||||
delete m_stListProtectConcerned.RemoveTail();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// CLASS MODIF*
|
||||
//#################################################################################
|
||||
|
||||
/*===========================================================================
|
||||
* Description: ModifInsert
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_ModifInsert : public CPA_Modif
|
||||
{
|
||||
private:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bFirstTime;
|
||||
BOOL m_bSelect;
|
||||
BOOL m_bUpdate;
|
||||
|
||||
CPA_List<EDT_SaveParents> m_stListInsert;
|
||||
EDT_SuperObject *m_pInsertedObject;
|
||||
EDT_SuperObject *m_pParent;
|
||||
EDT_SuperObject *m_pBrother;
|
||||
CString m_csType;
|
||||
|
||||
tdstPosition m_stPosition;
|
||||
// Cut Paste
|
||||
MTH3D_tdstVector m_stTranslation, m_stLocale;
|
||||
BOOL m_bUpdatePosition;
|
||||
BOOL m_bCutSpecial;
|
||||
// Cut Paste
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// creation
|
||||
EDT_ModifInsert(EDT_HierarchyEditor *pEditor, EDT_SuperObject *pEdObj,
|
||||
EDT_SuperObject *pParent, tdstPosition *p_stPosition,
|
||||
EDT_SuperObject *pBrother = NULL, BOOL bUpdateDrawing = TRUE,
|
||||
BOOL bSelectOnInsertion = TRUE, BOOL pBlock = FALSE,
|
||||
BOOL bUpdatePosition=FALSE,
|
||||
BOOL bCutSpecial=FALSE); // Silviu Simen 18 August 1998 Cut/Paste of Special Obj
|
||||
|
||||
~EDT_ModifInsert (void);
|
||||
|
||||
// actions
|
||||
BOOL Do (void);
|
||||
BOOL Undo (void);
|
||||
|
||||
// functions
|
||||
void fn_vFillListForInsertion (EDT_SuperObject *pEdObj, EDT_SuperObject *pParent);
|
||||
void fn_vSendMessageInsert (tdeTypeModif eType, tdstPosition *p_stPosition);
|
||||
};
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: ModifDelete
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_ModifDelete : public CPA_Modif
|
||||
{
|
||||
private:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bFirstTime;
|
||||
BOOL m_bUpdate;
|
||||
BOOL m_bDestroy;
|
||||
BOOL m_bSelect;
|
||||
|
||||
CPA_List<EDT_ParentByType> m_lstModifByType;
|
||||
CPA_List<EDT_SaveParents> m_stListObjects;
|
||||
CPA_List<EDT_SaveParents> m_stListForTools;
|
||||
BOOL m_bDeleted;
|
||||
CString m_csType;
|
||||
// Begin Silviu Simen 18 August 1998 Cut/Paste of Special Obj.
|
||||
BOOL m_bCutSpecial;
|
||||
// End Silviu Simen 18 August 1998 Cut/Paste of Special Obj.
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// creation
|
||||
EDT_ModifDelete (EDT_HierarchyEditor *pEditor, CPA_List<EDT_ListByDLL> *pSelectByDLL,
|
||||
CString csType, BOOL bUpdateDrawing = TRUE, BOOL bDestroy = TRUE,
|
||||
BOOL bSelectOnUndo = TRUE, BOOL pBlock = FALSE,
|
||||
BOOL bCutSpecial = FALSE); // Silviu Simen Cut/Paste of Special Objs.
|
||||
|
||||
EDT_ModifDelete (EDT_HierarchyEditor *pEditor, EDT_SuperObject *pObjectToDelete,
|
||||
CString csType, BOOL bUpdateDrawing = TRUE, BOOL bDestroy = TRUE,
|
||||
BOOL bSelectOnUndo = TRUE, BOOL pBlock = FALSE,
|
||||
BOOL bCutSpecial = FALSE); // Silviu Simen Cut/Paste of Special Objs.
|
||||
|
||||
~EDT_ModifDelete (void);
|
||||
|
||||
// actions
|
||||
BOOL Do (void);
|
||||
BOOL Undo (void);
|
||||
|
||||
// functions
|
||||
EDT_ParentByType * fn_pstFindParentListFromObj (EDT_SuperObject *pEdObj);
|
||||
void fn_vFillListForDLLs (EDT_SuperObject *pEdObj);
|
||||
// message
|
||||
void fn_vSendMessageDelete (tdeTypeModif eType);
|
||||
};
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: ModifPaste
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_ModifPaste : public CPA_Modif
|
||||
{
|
||||
private:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bFirstTime;
|
||||
BOOL m_bUpdate;
|
||||
|
||||
CPA_List<EDT_ParentByType> m_lstModifByType;
|
||||
CPA_List<EDT_SaveParents> m_stListObjects;
|
||||
CPA_List<EDT_SaveParents> m_stListForTools;
|
||||
BOOL m_bDone;
|
||||
CString m_csType;
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// creation
|
||||
EDT_ModifPaste(EDT_HierarchyEditor *pEditor, CPA_List<EDT_SaveParents> *pListObj,
|
||||
CString csType, long lNbCopy, BOOL bUpdateDrawing = TRUE);
|
||||
|
||||
~EDT_ModifPaste (void);
|
||||
|
||||
// actions
|
||||
BOOL Do (void);
|
||||
BOOL Undo (void);
|
||||
|
||||
// functions
|
||||
EDT_ParentByType * fn_pstFindParentListFromObj (EDT_SuperObject *pEdObj);
|
||||
void fn_vFillListForDLLs (EDT_SuperObject *pEdObj);
|
||||
|
||||
void fn_vSendMessageCopy (tdeTypeModif eType);
|
||||
};
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: ModifParent
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_ModifParent : public CPA_Modif
|
||||
{
|
||||
private:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bFirstTime;
|
||||
BOOL m_bUpdate;
|
||||
|
||||
CPA_List<EDT_ParentByType> m_lstModifByType;
|
||||
CPA_List<EDT_SaveParents> m_stListForTools;
|
||||
CString m_csType;
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// creation
|
||||
EDT_ModifParent(EDT_HierarchyEditor *pEditor, CPA_List<EDT_ListByDLL> *pSelectByDLL,
|
||||
EDT_SuperObject *pParent, CString csType, BOOL bUpdateDrawing = TRUE);
|
||||
|
||||
EDT_ModifParent(EDT_HierarchyEditor *pEditor, CPA_List<EDT_SaveParents> *pListModif, CString csType);
|
||||
|
||||
~EDT_ModifParent (void);
|
||||
|
||||
// actions
|
||||
BOOL Do (void);
|
||||
BOOL Undo (void);
|
||||
|
||||
// functions
|
||||
void fn_vSendMessageParent (tdeTypeModif eType);
|
||||
EDT_ParentByType * GetOrCreateListByDLL (CPA_ObjectDLLBase *p_oDLL);
|
||||
};
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: ModifMove
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_ModifMove : public CPA_Modif
|
||||
{
|
||||
private:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bFirstTime;
|
||||
BOOL m_bUpdate;
|
||||
|
||||
CPA_List<EDT_PosByType> m_lstModifByType;
|
||||
EDT_PosByType m_stListForTools;
|
||||
EDT_ModifParent *m_pModifParent;
|
||||
CString m_csType;
|
||||
|
||||
public:
|
||||
// paent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// creation
|
||||
EDT_ModifMove(EDT_HierarchyEditor *pEditor, CPA_List<EDT_ListByDLL> *pSelectByDLL,
|
||||
CString csType, BOOL bUpdateDrawing = TRUE);
|
||||
|
||||
~EDT_ModifMove (void);
|
||||
|
||||
// actions
|
||||
BOOL Do (void);
|
||||
BOOL Undo (void);
|
||||
BOOL Cancel (void);
|
||||
|
||||
// functions
|
||||
void fn_vSendMessageMove (tdeTypeModif eType);
|
||||
void fn_vInitListModif (CPA_List<EDT_SaveParents> *pListModif);
|
||||
void fn_vRegisterPositions (void);
|
||||
};
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: ModifName
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_ModifName : public CPA_Modif
|
||||
{
|
||||
private:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bFirstTime;
|
||||
|
||||
CPA_ObjectDLLBase *m_poDLL;
|
||||
EDT_SuperObject *m_pModifiedObject;
|
||||
CString m_csInitialName;
|
||||
CString m_csFinalName;
|
||||
CString m_csType;
|
||||
BOOL m_bRenameObject;
|
||||
BOOL m_bHasObjectName;
|
||||
|
||||
public:
|
||||
// paent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
|
||||
// creation
|
||||
EDT_ModifName(EDT_HierarchyEditor *pEditor, EDT_SuperObject *pModifiedObject, CString csFinalName, BOOL bRenameObject = TRUE);
|
||||
~EDT_ModifName (void);
|
||||
|
||||
// actions
|
||||
BOOL Do (void);
|
||||
BOOL Undo (void);
|
||||
|
||||
// functions
|
||||
void fn_vSendMessageName (tdeTypeModif eType);
|
||||
};
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: ModifState
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_ModifState : public CPA_Modif
|
||||
{
|
||||
private:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bFirstTime;
|
||||
|
||||
EDT_SuperObject *m_pModifiedObject;
|
||||
CString m_csTypeModif;
|
||||
BOOL m_bInitialState;
|
||||
|
||||
GEO_tdxHandleToMatrix m_hInitialMatrix;
|
||||
GEO_tdxHandleToMatrix m_hFinalMatrix;
|
||||
EDT_SuperObject *m_pInitialParent;
|
||||
EDT_SuperObject *m_pFinalParent;
|
||||
CString m_csInitialName;
|
||||
CString m_csFinalName;
|
||||
|
||||
CPA_List<EDT_ParentByType> m_lstParentByType;
|
||||
CPA_List<EDT_SaveParents> m_stParentForTools;
|
||||
|
||||
CPA_List<EDT_PosByType> m_lstPosByType;
|
||||
EDT_PosByType m_stPosForTools;
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
// creation
|
||||
EDT_ModifState(EDT_HierarchyEditor *pEditor, EDT_SuperObject *pModifiedObject,
|
||||
CString csTypeModif, BOOL bInitialState);
|
||||
~EDT_ModifState (void);
|
||||
|
||||
// actions
|
||||
BOOL Do (void);
|
||||
BOOL Undo (void);
|
||||
|
||||
// functions
|
||||
void fn_vInsertInHierarchy (void);
|
||||
void fn_vRemoveFromHierarchy (void);
|
||||
|
||||
EDT_ParentByType * fn_pstFindParentListFromObj (EDT_SuperObject *pEdObj);
|
||||
void fn_vFillListForDelete (EDT_SuperObject *pEdObj, EDT_SuperObject *pInitialFather, EDT_SuperObject *pFinalFather);
|
||||
|
||||
EDT_PosByType * fn_pstFindPosListFromObj (EDT_SuperObject *pEdObj);
|
||||
void fn_vFillListForMove (EDT_SuperObject *pEdObj);
|
||||
void fn_vRegisterPositions (void);
|
||||
|
||||
void fn_vSendMessageCreate (tdeTypeModif eType);
|
||||
void fn_vSendMessageDelete (tdeTypeModif eType);
|
||||
void fn_vSendMessageParent (tdeTypeModif eType);
|
||||
void fn_vSendMessageMove (tdeTypeModif eType);
|
||||
void fn_vSendMessageName (tdeTypeModif eType);
|
||||
};
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: ModifState
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_ModifValidate : public CPA_Modif
|
||||
{
|
||||
private:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bFirstTime;
|
||||
|
||||
EDT_ModifState *m_pModifState;
|
||||
EDT_SuperObject *m_pModifiedObject;
|
||||
EDT_TempModif *m_pTempModif;
|
||||
CString m_csTypeModif;
|
||||
BOOL m_bInitialState;
|
||||
|
||||
BOOL m_bCreated;
|
||||
BOOL m_bDeleted;
|
||||
CString m_csOriginalName;
|
||||
EDT_SuperObject * m_pOriginalFather;
|
||||
GEO_tdxHandleToMatrix m_hOriginalPosition;
|
||||
|
||||
public:
|
||||
// parent editor
|
||||
EDT_HierarchyEditor * GetParentEditor (void) { return m_pEditor; }
|
||||
CPA_Interface * GetInterface (void);
|
||||
// creation
|
||||
EDT_ModifValidate (EDT_HierarchyEditor *pEditor, EDT_SuperObject *pModifiedObject,
|
||||
CString csTypeModif, BOOL bInitialState);
|
||||
~EDT_ModifValidate (void);
|
||||
|
||||
// actions
|
||||
BOOL Do (void);
|
||||
BOOL Undo (void);
|
||||
};
|
||||
|
||||
#endif // __EDTMODIF_HPP__
|
||||
#endif // ACTIVE_EDITOR
|
||||
|
54
Rayman_X/cpa/tempgrp/Edt/inc/edtparse.hpp
Normal file
@@ -0,0 +1,54 @@
|
||||
//ParseSection.hpp
|
||||
|
||||
#ifndef _PARSESECTION
|
||||
#define _PARSESECTION
|
||||
|
||||
const char cBeginBracket = '{';
|
||||
const char cEndBracket = '}';
|
||||
const char cExternalReferencesIndicator = '^';
|
||||
const char cThisFileReference = '*';
|
||||
const char cStringDelimitator = '"';
|
||||
const char cBackslash = '\\';
|
||||
const char cParameterBeginIndicator = '(';
|
||||
const char cParameterEndIndicator = ')';
|
||||
const static char szEditModificationsKW [] = {"Edit-Modifications:"};
|
||||
const static char szEditGeometricModificationsKW [] = {"Edit-Geometric-Modifications:"};
|
||||
|
||||
class CParseSection
|
||||
{
|
||||
private:
|
||||
CString m_csFinalMDFFileName;
|
||||
CStringList m_lstOfRoots;
|
||||
CStringList m_lstOfInitialMDFSections;
|
||||
CStringList m_lstOfInitialUnchangeableMDFSections;
|
||||
CStringList m_lstOfIncludedExternalReferences;
|
||||
|
||||
protected:
|
||||
int CopySection (CString csFileName, CString csSectionName, BOOL bCopyAsItIs = FALSE);
|
||||
int CopySectionWithAnalyze (CString csFileName, CString csSectionName)
|
||||
{
|
||||
return CopySection (csFileName, csSectionName, FALSE);
|
||||
}
|
||||
int CopySectionAsItIs (CString csFileName, CString csSectionName)
|
||||
{
|
||||
return CopySection (csFileName, csSectionName, TRUE);
|
||||
}
|
||||
int ReadSection (CString csFileName, CString csSectionName, CStringList &rSection);
|
||||
int AnalyseSection (CString csFileName, CStringList &rSection);
|
||||
int WriteSection (CStringList &rSection);
|
||||
int FillListOfInitialMDFSections (CString csInitialMDFFileName);
|
||||
CString ComputeAbsoluteFileName (CString csFileName);
|
||||
int IsFileNameAbsolute (CString csFileName);
|
||||
int CreateTheFinalMDFFile ();
|
||||
int IsSectionIncluded (CString csSectionName);
|
||||
CString RemoveParameters (CString csRedSectionName);
|
||||
|
||||
|
||||
public:
|
||||
CParseSection (CString csFinalMDFFileName = "");
|
||||
int ParseFile (CString csInitialMDFFileName, CString csFinalMDFFileName = "");
|
||||
void AddRoot (CString csRoot);
|
||||
|
||||
};
|
||||
|
||||
#endif //_PARSESECTION
|
23
Rayman_X/cpa/tempgrp/Edt/inc/edtrot.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
//ROMTEAM StickObjects (Nicolae Suparatu 10/02/98)
|
||||
|
||||
// Get the transform parameters (rotation + translation) in order to move one
|
||||
// triangle over another one, if they are congruent
|
||||
// Author: Nicolae Suparatu
|
||||
|
||||
|
||||
#define eps 1e-4
|
||||
typedef float Matrix[3][3];
|
||||
typedef float Vector[3];
|
||||
|
||||
|
||||
// dst = destination triangle (on lines)
|
||||
// src = source triangle (on lines)
|
||||
// r = resulting rotation matrix
|
||||
// t = resulting translation matrix
|
||||
int GetTransform(Matrix &dst, Matrix &src, Matrix &r, Vector &t);
|
||||
|
||||
void Convert(Matrix &r, Vector &t, Matrix &mo, Vector &vo);
|
||||
|
||||
float sqr(float f);
|
||||
|
||||
//ENDROMTEAM StickObjects (Nicolae Suparatu)
|
229
Rayman_X/cpa/tempgrp/Edt/inc/edtsobj.hpp
Normal file
@@ -0,0 +1,229 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTsobj.hpp
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
#ifndef __EDTSOBJ_HPP__
|
||||
#define __EDTSOBJ_HPP__
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <afxtempl.h>
|
||||
|
||||
#pragma warning(disable:4786)
|
||||
|
||||
#define HieFriend
|
||||
#include "incSPO.h"
|
||||
#undef HieFriend
|
||||
|
||||
#include "itf/CPASObj.hpp"
|
||||
|
||||
#include "SCR.h"
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class EDT_TempModif;
|
||||
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
|
||||
//=====================================================================
|
||||
// type name for super objects (constant)
|
||||
#define C_szSuperObjectTypeName "SuperObject"
|
||||
//=====================================================================
|
||||
|
||||
/*===========================================================================
|
||||
* Description: class EDT_SuperObject
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_SuperObject : public CPA_SuperObject
|
||||
{
|
||||
|
||||
private:
|
||||
// matrix
|
||||
CPA_SectionObject *m_pMatrixSection;
|
||||
// temporary modification
|
||||
EDT_TempModif *m_pTempModif;
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
CString m_csModifSectionName;
|
||||
CString m_csInitialSPOName;
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
public:
|
||||
|
||||
//================ Constructors ===========================
|
||||
|
||||
EDT_SuperObject (EDT_HierarchyEditor *pEditor,
|
||||
HIE_tdxHandleToSuperObject hEngineSO,
|
||||
tdeSaveStatus eStatus,
|
||||
tdeTypeSO eTypeSO = C_NoType,
|
||||
CString csName = "",
|
||||
CString csFileName = ""
|
||||
);
|
||||
|
||||
EDT_SuperObject (EDT_HierarchyEditor *pEditor,
|
||||
tdeSaveStatus eStatus,
|
||||
tdeTypeSO eTypeSO ,
|
||||
CString csName = "",
|
||||
CString csFileName = ""
|
||||
);
|
||||
|
||||
EDT_SuperObject (EDT_SuperObject &r_oSource);
|
||||
|
||||
~EDT_SuperObject (void);
|
||||
|
||||
|
||||
//ANNECY CO SPOFLAG 03/02/98
|
||||
//================ Flag ===========================
|
||||
|
||||
unsigned long GetFlags (void);
|
||||
void SetFlags (unsigned long ulFlags);
|
||||
//ANNECY CO SPOFLAG
|
||||
|
||||
//ANNECY CO SPOFLAG 05/02/98
|
||||
BOOL fn_bIsEditProtected (void);
|
||||
//ENDANNECY CO SPOFLAG
|
||||
|
||||
//ANNECY Shaitan Transparency 26/03/98 {
|
||||
//================ Transparency ===========================
|
||||
float fn_fGetTransparencyLevel (void);
|
||||
void fn_vSetTransparencyLevel (float fNewLevel);
|
||||
//ENDANNECY Shaitan Transparency }
|
||||
|
||||
|
||||
//================ Engine Struct ===========================
|
||||
|
||||
void SetEngineStruct (HIE_tdxHandleToSuperObject hEngineSO);
|
||||
|
||||
HIE_tdxHandleToSuperObject GetEngineStruct (void) { return GetStruct(); }
|
||||
|
||||
//================ Editor ===========================
|
||||
|
||||
EDT_HierarchyEditor * GetSuperObjectEditor (void) { return (EDT_HierarchyEditor *) CPA_SuperObject::GetEditor(); }
|
||||
|
||||
//================ Section Object ===========================
|
||||
|
||||
void fn_vInitSectionName (const CString csEngineFileName);
|
||||
void fn_vUpdateSectionName (void);
|
||||
|
||||
//================ Matrix Section ===========================
|
||||
|
||||
CPA_SectionObject * GetMatrixSection (void) { return m_pMatrixSection; }
|
||||
CString GetMatrixSectionName (void);
|
||||
|
||||
//================ Dialogs ===========================
|
||||
|
||||
CString GetNameToDraw (void);
|
||||
CString GetTypeToDraw (void);
|
||||
CString GetOwnerToDraw (void);
|
||||
|
||||
//================ Object & DLL ===========================
|
||||
|
||||
void MyObjectIsAlsoACopy (EDT_SuperObject *p_oSource);
|
||||
|
||||
|
||||
//================ Name & Name to draw ===========================
|
||||
|
||||
void SetNameForCopy (EDT_SuperObject *pDesc);
|
||||
void SetNameForPaste (EDT_SuperObject *pDesc);
|
||||
|
||||
CString GetOwnerName (void);
|
||||
CString GetLevelName (void);
|
||||
|
||||
//================ Modifications ===========================
|
||||
|
||||
// moves
|
||||
void fn_vTranslate (MTH3D_tdstVector *p_stVector, BOOL bAbsolute);
|
||||
void fn_vRotate (POS_tdstCompletePosition *p_stMatrix);
|
||||
void fn_vSetPosition (POS_tdstCompletePosition *pRefMatrix);
|
||||
|
||||
// parent
|
||||
void fn_vInsertUnderParent (EDT_SuperObject *pEdParent, EDT_SuperObject *pBrother = NULL, BOOL bUpdatePos = FALSE, POS_tdstCompletePosition *pRefMatrix = NULL);
|
||||
BOOL fn_bAcceptAsParent (EDT_SuperObject *pEdObj);
|
||||
BOOL fn_bAcceptAsChild (EDT_SuperObject *pEdObj);
|
||||
|
||||
// protected childs
|
||||
void fn_vRemoveNonProtectedChilds (void);
|
||||
|
||||
//================ Temporary Modifications ===========================
|
||||
|
||||
EDT_TempModif * GetTemporaryModif (void) { return m_pTempModif; }
|
||||
CString GetTempModifSectionName (void);
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
void mfn_vSetTempModifSectionName (CString csModifSectionName) { m_csModifSectionName = csModifSectionName;}
|
||||
void mfn_vSetInitialSPOName (CString csInitialSPOName) { m_csInitialSPOName = csInitialSPOName;}
|
||||
CString mfn_csGetInitialSPOName () { return m_csInitialSPOName;}
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
BOOL fn_bIsTemporary (void) { return (m_pTempModif != NULL); }
|
||||
|
||||
void SetTemporaryModif (EDT_TempModif *pTempSO);
|
||||
BOOL fn_bInitTemporarySO (void);
|
||||
void fn_vUpdateTemporaryModif (CString csTypeModif, BOOL bAddModif);
|
||||
|
||||
void fn_vSetOnState (const CString csModificationType, BOOL bOnInitialState);
|
||||
void fn_vValidateState (const CString csModificationType, BOOL bInitialState);
|
||||
BOOL fn_bCanBeValidated (void);
|
||||
|
||||
//================ Notify ===========================
|
||||
|
||||
void fn_vNotifySave (void);
|
||||
void fn_vNotifyUnSave (void);
|
||||
void fn_vNotifyRestore (void);
|
||||
void fn_vNotifyRename (void);
|
||||
|
||||
BOOL fn_bCanBeNotified (void);
|
||||
|
||||
tdeMissingCriteria fn_eCheckValidity (const CString csNewName);
|
||||
|
||||
void fn_vUpdateReference (CPA_SaveObject *pReferencedObject);
|
||||
|
||||
CString fn_csComputeReferencedSectionName (const CString csNewName) ;
|
||||
|
||||
//================ Scripts ===========================
|
||||
|
||||
void fn_vSaveMatrix (SCR_tdst_File_Description *p_stFile, GEO_tdxHandleToMatrix hMatrix, CString csMatrixName);
|
||||
|
||||
static void CallBackSave (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
|
||||
static void CallBackSaveMatrix (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
|
||||
|
||||
// load
|
||||
static SCR_tde_Anl_ReturnValue CallBackLoadModif (SCR_tdst_File_Description *p_fFile, char *szName, char *szParams[], SCR_tde_Anl_Action eAction);
|
||||
|
||||
//================ Display ===========================
|
||||
|
||||
void SetDrawingFlag (tdeDrawingFlag eNewFlag);
|
||||
|
||||
//================ Matrix ===========================
|
||||
|
||||
BOOL fn_bHasSamePosition (GEO_tdxHandleToMatrix hInitialMatrix, GEO_tdxHandleToMatrix hFinalMatrix);
|
||||
|
||||
// Begin Silviu Simen 18 August 1998 Cut/Paste Mechanism
|
||||
void fn_vSetOnlyPosition (MTH3D_tdstVector *pTransMatrix);
|
||||
// End Silviu Simen 18 August 1998 Cut/Paste Mechanism
|
||||
};
|
||||
|
||||
|
||||
#endif //__EDTSOBJ_HPP__
|
||||
|
||||
#endif //ACTIVE_EDITOR
|
121
Rayman_X/cpa/tempgrp/Edt/inc/edtspec.hpp
Normal file
@@ -0,0 +1,121 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTSpec.hpp
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
#ifndef __EDTSPEC_HPP__
|
||||
#define __EDTSPEC_HPP__
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
#include "itf/CPAEnum.hpp"
|
||||
#include "itf/CPAListB.hpp"
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class EDT_SuperObject;
|
||||
class EDT_SubMenu;
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Class EDT_Specific
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_SpecificEditor
|
||||
{
|
||||
protected:
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
BOOL m_bIsLoadingWorld;
|
||||
CString m_csStaticFileName;
|
||||
CString m_csDynamicFileName;
|
||||
|
||||
public:
|
||||
EDT_SpecificEditor (EDT_HierarchyEditor *pEditor);
|
||||
~EDT_SpecificEditor (void);
|
||||
|
||||
EDT_HierarchyEditor * GetEditor (void) { return m_pEditor; }
|
||||
|
||||
CString GetStaticFileName (void) { return m_csStaticFileName; }
|
||||
CString GetDynamicFileName (void) { return m_csDynamicFileName; }
|
||||
|
||||
CString GetModifSectionName (void);
|
||||
|
||||
void fn_vSpecificInit (void);
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
General
|
||||
=========================================================================*/
|
||||
|
||||
public:
|
||||
|
||||
// submenu
|
||||
long fn_lDefineSubmenu (EDT_SubMenu *p_oSubMenu, UINT uiStartID);
|
||||
void fn_vOnSubmenuCommand (UINT uiCmdMsg);
|
||||
|
||||
// parent
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
// EDT_SuperObject * GetDefaultParentFromPos (tdstPosition *p_stPosition, tdeTypeSO eTypeInsert);
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
EDT_SuperObject * GetDefaultParentForPaste (EDT_SuperObject *pEdObj);
|
||||
|
||||
// permissions
|
||||
BOOL fn_bCanBeParent (EDT_SuperObject *pNewParent, CPA_List<CPA_SuperObject> *pChilds);
|
||||
BOOL fn_bCanBeParent (EDT_SuperObject *pNewParent, EDT_SuperObject *pChild);
|
||||
long fn_lCanMoveObjects (CPA_List<CPA_SuperObject> *pObjectsToMove);
|
||||
|
||||
// type SO
|
||||
BOOL fn_bCanChangeTypeSO (EDT_SuperObject *pEdObj, tdeTypeSO eType);
|
||||
void fn_vInitTypeSO (EDT_SuperObject *pEdObj, EDT_SuperObject *pParent);
|
||||
|
||||
// load
|
||||
EDT_SuperObject * fn_pInitEditorMap (HIE_tdxHandleToSuperObject hRoot);
|
||||
|
||||
/*===========================================================================
|
||||
Specific
|
||||
=========================================================================*/
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
// void fn_vInitSectorsParameters (EDT_SuperObject *pSRoot);
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
|
||||
// permissions
|
||||
BOOL fn_bCheckParentAndType (EDT_SuperObject *pEdObj, EDT_SuperObject *pParent);
|
||||
BOOL fn_bCheckSectorMove (EDT_SuperObject *pEdObj, long *p_lNbBreak, BOOL bSelected);
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
BOOL fn_bCheckSaveStatus (tdeSaveStatus eStatus, EDT_SuperObject *pParent);
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
|
||||
|
||||
// super-object type
|
||||
tdeTypeSO GetTypeFromFile (CString csFileName);
|
||||
BOOL fn_bIsValidType (tdeTypeSO eTypeSO);
|
||||
};
|
||||
|
||||
|
||||
#endif // __EDTSPEC_HPP__
|
||||
#endif // ACTIVE_EDITOR
|
||||
|
204
Rayman_X/cpa/tempgrp/Edt/inc/edttemp.hpp
Normal file
@@ -0,0 +1,204 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTTemp.hpp - List of Temporary Modifs - definition
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
#ifndef __EDT_TEMP_HPP__
|
||||
#define __EDT_TEMP_HPP__
|
||||
|
||||
//**************************************
|
||||
#ifndef CPA_EXPORT
|
||||
#if defined(CPA_WANTS_IMPORT)
|
||||
#define CPA_EXPORT __declspec(dllimport)
|
||||
#elif defined(CPA_WANTS_EXPORT)
|
||||
#define CPA_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define CPA_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
//**************************************
|
||||
|
||||
|
||||
|
||||
#include "itf/CPASectO.hpp"
|
||||
|
||||
#include "incPOS.h"
|
||||
#include "SCR.h"
|
||||
|
||||
class EDT_HierarchyEditor;
|
||||
class EDT_SuperObject;
|
||||
|
||||
// modifications
|
||||
#define C_szCreation "Creation"
|
||||
#define C_szSuppression "Suppression"
|
||||
#define C_szChangeFather "Father"
|
||||
#define C_szChangePosition "Position"
|
||||
#define C_szChangeName "Name"
|
||||
|
||||
#define C_lNbTypeModifs 5
|
||||
|
||||
static CString g_a_csTypeModifs [] =
|
||||
{
|
||||
C_szCreation,
|
||||
C_szSuppression,
|
||||
C_szChangeFather,
|
||||
C_szChangePosition,
|
||||
C_szChangeName
|
||||
};
|
||||
|
||||
typedef enum tdeTempModif_
|
||||
{
|
||||
E_tm_SaveTemp,
|
||||
E_tm_DeleteTemp
|
||||
}
|
||||
tdeTempModif;
|
||||
|
||||
/*===========================================================================
|
||||
* Description: class EDT_TemporarySO
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_TempModif : public CPA_SectionObject
|
||||
{
|
||||
private:
|
||||
// original super-object
|
||||
EDT_SuperObject * m_pOriginalSO;
|
||||
// matrix
|
||||
CPA_SectionObject * m_pMatrixSection;
|
||||
// changes
|
||||
BOOL m_bCreated;
|
||||
BOOL m_bDeleted;
|
||||
// name
|
||||
CString m_csFinalName;
|
||||
// father
|
||||
EDT_SuperObject * m_pFinalFather;
|
||||
// position
|
||||
GEO_tdxHandleToMatrix m_hFinalPosition;
|
||||
// loaded modification
|
||||
BOOL m_bLoaded;
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
CString m_csOriginalSOName,
|
||||
m_csInitialSPOName;
|
||||
BOOL m_bNameChanged,
|
||||
m_bFatherChanged,
|
||||
m_bPositionChanged;
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
public:
|
||||
// constructors
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
EDT_TempModif (EDT_SuperObject *pOriginalSO, BOOL bLoaded, CString csModifSectionName = "", CString csOriginalSOName = "");
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
~EDT_TempModif (void);
|
||||
|
||||
// original object
|
||||
EDT_SuperObject * GetOriginalSO (void) { return m_pOriginalSO; }
|
||||
|
||||
// matrix
|
||||
CString GetMatrixSectionName (void);
|
||||
|
||||
CPA_SectionObject * GetMatrixSection (void) { return m_pMatrixSection; }
|
||||
|
||||
// load
|
||||
BOOL fn_bWasLoaded (void) { return m_bLoaded; }
|
||||
|
||||
// get functions
|
||||
BOOL fn_bWasCreated (void) { return m_bCreated; }
|
||||
BOOL fn_bWasDeleted (void) { return m_bDeleted; }
|
||||
CString GetFinalName (void) { return m_csFinalName; }
|
||||
EDT_SuperObject * GetFinalFather (void) { return m_pFinalFather; }
|
||||
GEO_tdxHandleToMatrix GetFinalPosition (void) { return m_hFinalPosition; }
|
||||
|
||||
// set functions
|
||||
void SetCreated (BOOL bCreated);
|
||||
void SetDeleted (BOOL bDeleted);
|
||||
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
void SetFinalPosition (GEO_tdxHandleToMatrix hNewPosition);
|
||||
void SetFinalFather (EDT_SuperObject *pNewFather);
|
||||
void SetFinalName (CString csNewName);
|
||||
CString mfn_csGetOriginalSOName () { return m_csOriginalSOName;}
|
||||
void mfn_vSetOriginalSOName (CString csOriginalSOName) { m_csOriginalSOName = csOriginalSOName;}
|
||||
BOOL mfn_bValidModif ()
|
||||
{
|
||||
BOOL bRet = FALSE;
|
||||
if (m_bLoaded || //modif from a previous session
|
||||
(!m_bLoaded && m_bCreated)) //inserted
|
||||
bRet = TRUE;
|
||||
|
||||
return bRet;
|
||||
}
|
||||
CString mfn_csGetInitialSPOName ()
|
||||
{
|
||||
return m_csInitialSPOName;
|
||||
/* CString csInitialSPOName;
|
||||
if (m_pOriginalSO)
|
||||
csInitialSPOName = m_pOriginalSO->mfn_csGetInitialSPOName ();
|
||||
|
||||
return csInitialSPOName;
|
||||
*/ }
|
||||
|
||||
void mfn_vSetInitialSPOName (CString csInitialSPOName)
|
||||
{
|
||||
m_csInitialSPOName = csInitialSPOName;
|
||||
}
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
// modification functions
|
||||
void fn_vUpdateModification (CString csTypeModif, BOOL bAddModif = TRUE);
|
||||
void fn_vCancelModification (CString csTypeModif);
|
||||
BOOL fn_bIsModified (CString csTypeModif);
|
||||
|
||||
// save
|
||||
void fn_vNotifySave (void);
|
||||
void fn_vNotifyUnsave (void);
|
||||
void fn_vNotifyRename (void);
|
||||
|
||||
static void CallBackSaveModif (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
|
||||
static void CallBackSaveMatrix (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
|
||||
|
||||
};
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Class EDT_TempList
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
class EDT_TempList : public CPA_SectionObject
|
||||
{
|
||||
private:
|
||||
CPA_List<EDT_TempModif> m_oListOfTempModif;
|
||||
EDT_HierarchyEditor *m_pEditor;
|
||||
|
||||
public:
|
||||
|
||||
EDT_TempList (EDT_HierarchyEditor *pEditor, BOOL bLoaded);
|
||||
~EDT_TempList (void);
|
||||
|
||||
CPA_List<EDT_TempModif> * GetListOfTemporaryModifs (void) { return &m_oListOfTempModif; }
|
||||
EDT_HierarchyEditor * GetEditor (void) { return m_pEditor; }
|
||||
|
||||
void fn_vAddTemporaryModif (EDT_TempModif *pModif, BOOL bNotify = TRUE);
|
||||
void fn_vRemoveTemporaryModif (EDT_TempModif *pModif);
|
||||
void fn_vChangeTemporaryModif (EDT_TempModif *pModif);
|
||||
void fn_vRemoveAllTemporaryModifs (void);
|
||||
|
||||
static void CallBackSaveListModif (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
|
||||
};
|
||||
|
||||
|
||||
#endif // __EDT_TEMP_HPP__
|
||||
#endif // ACTIVE_EDITOR
|
54
Rayman_X/cpa/tempgrp/Edt/inc/parsesection.hpp
Normal file
@@ -0,0 +1,54 @@
|
||||
//ParseSection.hpp
|
||||
|
||||
#ifndef _PARSESECTION
|
||||
#define _PARSESECTION
|
||||
|
||||
const char cBeginBracket = '{';
|
||||
const char cEndBracket = '}';
|
||||
const char cExternalReferencesIndicator = '^';
|
||||
const char cThisFileReference = '*';
|
||||
const char cStringDelimitator = '"';
|
||||
const char cBackslash = '\\';
|
||||
const char cParameterBeginIndicator = '(';
|
||||
const char cParameterEndIndicator = ')';
|
||||
const static char szEditModificationsKW [] = {"Edit-Modifications:"};
|
||||
const static char szEditGeometricModificationsKW [] = {"Edit-Geometric-Modifications:"};
|
||||
|
||||
class CParseSection
|
||||
{
|
||||
private:
|
||||
CString m_csFinalMDFFileName;
|
||||
CStringList m_lstOfRoots;
|
||||
CStringList m_lstOfInitialMDFSections;
|
||||
CStringList m_lstOfInitialUnchangeableMDFSections;
|
||||
CStringList m_lstOfIncludedExternalReferences;
|
||||
|
||||
protected:
|
||||
int CopySection (CString csFileName, CString csSectionName, BOOL bCopyAsItIs = FALSE);
|
||||
int CopySectionWithAnalyze (CString csFileName, CString csSectionName)
|
||||
{
|
||||
return CopySection (csFileName, csSectionName, FALSE);
|
||||
}
|
||||
int CopySectionAsItIs (CString csFileName, CString csSectionName)
|
||||
{
|
||||
return CopySection (csFileName, csSectionName, TRUE);
|
||||
}
|
||||
int ReadSection (CString csFileName, CString csSectionName, CStringList &rSection);
|
||||
int AnalyseSection (CString csFileName, CStringList &rSection);
|
||||
int WriteSection (CStringList &rSection);
|
||||
int FillListOfInitialMDFSections (CString csInitialMDFFileName);
|
||||
CString ComputeAbsoluteFileName (CString csFileName);
|
||||
int IsFileNameAbsolute (CString csFileName);
|
||||
int CreateTheFinalMDFFile ();
|
||||
int IsSectionIncluded (CString csSectionName);
|
||||
CString RemoveParameters (CString csRedSectionName);
|
||||
|
||||
|
||||
public:
|
||||
CParseSection (CString csFinalMDFFileName = "");
|
||||
int ParseFile (CString csInitialMDFFileName, CString csFinalMDFFileName = "");
|
||||
void AddRoot (CString csRoot);
|
||||
|
||||
};
|
||||
|
||||
#endif //_PARSESECTION
|
5
Rayman_X/cpa/tempgrp/Edt/mssccprj.scc
Normal file
@@ -0,0 +1,5 @@
|
||||
SCC = This is a source code control file
|
||||
|
||||
[EDT.vcproj]
|
||||
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
|
||||
SCC_Project_Name = Perforce Project
|
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTCam.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTGeom.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTIpo.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTLum.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTNone.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTPerso.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTPhys.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTSect.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTWaypt.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTWhat.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTZone.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTcOrient.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTcSelectTo.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTcVOrient.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTedit.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTnoed.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTpedit.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/EDTpnoed.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Rayman_X/cpa/tempgrp/Edt/res/edt_dlgb.ico
Normal file
After Width: | Height: | Size: 766 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/edtccall.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/edtccalone.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/edtcchoice.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/edtcmoveto.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/edtcparent.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/edtcpfather.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
Rayman_X/cpa/tempgrp/Edt/res/edtcppos.cur
Normal file
After Width: | Height: | Size: 326 B |
153
Rayman_X/cpa/tempgrp/Edt/res/edtres.h
Normal file
@@ -0,0 +1,153 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by edtres.rc
|
||||
//
|
||||
#define EDT_IDD_DIALOGEDIT 157
|
||||
#define EDT_IDD_DIALOGSELECTTYPES 158
|
||||
#define EDT_IDI_EDIT_NOOBJECT 169
|
||||
#define EDT_IDI_EDIT 169
|
||||
#define EDT_IDI_EDIT_SUPOBJ 170
|
||||
#define EDT_IDI_NOEDIT_NOOBJECT 171
|
||||
#define EDT_IDI_NOEDIT 171
|
||||
#define EDT_IDI_NOEDIT_SUPOBJ 172
|
||||
#define EDT_IDI_PEDIT_NOOBJECT 173
|
||||
#define EDT_IDI_PEDIT 173
|
||||
#define EDT_IDI_PEDIT_SUPOBJ 174
|
||||
#define EDT_IDI_PNOEDIT_NOOBJECT 175
|
||||
#define EDT_IDI_PNOEDIT 175
|
||||
#define EDT_IDI_PNOEDIT_SUPOBJ 176
|
||||
#define EDT_IDI_CAMERA 181
|
||||
#define EDT_IDI_ACTOR 182
|
||||
#define EDT_IDD_DIALOGFLAGS 182
|
||||
#define EDT_IDI_IPO 183
|
||||
#define EDT_IDD_DIALOGVECTOR 183
|
||||
#define EDT_IDD_DIALOGSELECT 184
|
||||
#define IDI_EDT_DLGBAR_ICON 184
|
||||
#define EDT_IDI_WAYPOINT 185
|
||||
#define EDT_IDI_LIGHT 187
|
||||
#define EDT_IDI_SECTOR 188
|
||||
#define EDT_IDI_GEOM 189
|
||||
#define EDT_IDI_UNKNOWN 190
|
||||
#define EDT_IDI_SUPOBJ 191
|
||||
#define EDT_IDI_PHYSICAL 192
|
||||
#define EDT_IDI_ZONE 193
|
||||
#define EDT_IDD_DIALOGUPDATE 312
|
||||
#define EDT_IDD_DIALOGMOVE 314
|
||||
#define EDT_IDC_CHOICEMODE 316
|
||||
#define EDT_IDC_SECTORLIST 317
|
||||
#define EDT_IDC_SELECTMODE 318
|
||||
#define EDT_IDC_COPYMODE 319
|
||||
#define EDT_IDC_COPYALLMODE 319
|
||||
#define EDT_IDC_PARENTMODE 320
|
||||
#define EDT_IDC_PASTEFATHER 321
|
||||
#define EDT_IDC_PASTEPOS 322
|
||||
#define EDT_IDC_COPYALONEMODE 323
|
||||
#define EDT_IDC_MOVETOMODE 324
|
||||
#define EDT_IDC_MOVETOSELECT 325
|
||||
#define EDT_IDC_ORIENTMODE 326
|
||||
#define EDT_IDC_VORIENTMODE 327
|
||||
#define EDT_IDC_TYPESLIST 328
|
||||
#define EDT_IDC_OBJECTGO 1037
|
||||
#define EDT_IDC_PARENTGO 1038
|
||||
#define EDT_IDC_APPLY 1039
|
||||
#define EDT_IDC_OBJECTRECT 1071
|
||||
#define EDT_IDC_PARENTRECT 1072
|
||||
#define EDT_IDC_POSITIONRECT 1073
|
||||
#define EDT_IDC_TRANSL 1074
|
||||
#define EDT_IDC_ROT 1075
|
||||
#define EDT_IDC_SCALE 1076
|
||||
#define EDT_IDC_SUPOBJRECT 1077
|
||||
#define EDT_IDC_LISTSECTORS 1082
|
||||
#define EDT_IDC_LISTPARENTS 1085
|
||||
#define EDT_IDC_TEMP 1089
|
||||
#define EDT_IDC_DEFAULT 1111
|
||||
#define EDT_IDC_GLOBALMODE 1112
|
||||
#define EDT_IDC_SLIDERX 1118
|
||||
#define EDT_IDC_SLIDERY 1119
|
||||
#define EDT_IDC_CHECKPICKING 1119
|
||||
#define EDT_IDC_SLIDERZ 1120
|
||||
#define EDT_IDC_CHECKHIDDEN 1121
|
||||
#define EDT_IDC_SUPOBJFLAGS 1121
|
||||
#define EDT_IDC_SELECTPCT 1122
|
||||
#define EDT_IDC_CHECKTRANSFORMMATRIX 1122
|
||||
#define EDT_IDC_EDITTRANSP 1122
|
||||
#define EDT_IDC_PCT1 1123
|
||||
#define EDT_IDC_CHECKZOOMFORSCALE 1123
|
||||
#define EDT_IDC_SLIDERTRANS 1123
|
||||
#define EDT_IDC_CHECKBOUNDINGBOX 1124
|
||||
#define EDT_IDC_X1 1124
|
||||
#define EDT_IDC_COMPONENTX 1124
|
||||
#define EDT_IDC_CHECKIMPOSE 1125
|
||||
#define EDT_IDC_Y1 1125
|
||||
#define EDT_IDC_COMPONENTY 1125
|
||||
#define EDT_IDC_CHECKHANGABLE 1126
|
||||
#define EDT_IDC_Z1 1126
|
||||
#define EDT_IDC_COMPONENTZ 1126
|
||||
#define EDT_IDC_CHECKNORAYTRACE 1126
|
||||
#define EDT_IDC_CHECKCHILDREN 1127
|
||||
#define EDT_IDC_PCT2 1127
|
||||
#define EDT_IDC_PCT3 1128
|
||||
#define EDT_IDC_CHECKNOSHADOW 1128
|
||||
#define EDT_IDC_PCT11 1129
|
||||
#define EDT_IDC_PCT22 1130
|
||||
#define EDT_IDC_PCT33 1131
|
||||
#define EDT_IDC_X2 1132
|
||||
#define EDT_IDC_X3 1133
|
||||
#define EDT_IDC_X11 1134
|
||||
#define EDT_IDC_X22 1135
|
||||
#define EDT_IDC_X33 1136
|
||||
#define EDT_IDC_Y2 1137
|
||||
#define EDT_IDC_Y3 1138
|
||||
#define EDT_IDC_Y11 1139
|
||||
#define EDT_IDC_Y22 1140
|
||||
#define EDT_IDC_Y33 1141
|
||||
#define EDT_IDC_Z2 1142
|
||||
#define EDT_IDC_Z3 1143
|
||||
#define EDT_IDC_MOVE 1144
|
||||
#define EDT_IDC_Z11 1145
|
||||
#define EDT_IDC_Z22 1146
|
||||
#define EDT_IDC_Z33 1147
|
||||
#define EDT_IDC_SELECTDST 1148
|
||||
#define EDT_IDC_SELECTSRC 1149
|
||||
#define EDT_IDC_LISTOBJECTS 2002
|
||||
#define EDT_IDC_EDITDESC 2006
|
||||
#define EDT_IDC_EDITTYPE 2013
|
||||
#define EDT_IDC_EDITNAME 2014
|
||||
#define EDT_IDC_LISTREINSERT1 2014
|
||||
#define EDT_IDC_POSX 2015
|
||||
#define EDT_IDC_LISTREINSERT 2015
|
||||
#define EDT_IDC_POSZ 2016
|
||||
#define EDT_IDC_LISTDESTROY1 2016
|
||||
#define EDT_IDC_PARENTNAME 2017
|
||||
#define EDT_IDC_LISTDESTROY 2017
|
||||
#define EDT_IDC_PARENTTYPE 2018
|
||||
#define EDT_IDC_ROTY 2019
|
||||
#define EDT_IDC_ROTZ 2020
|
||||
#define EDT_IDC_SCALEY 2021
|
||||
#define EDT_IDC_LISTCREATED1 2022
|
||||
#define EDT_IDC_SCALEZ 2022
|
||||
#define EDT_IDC_LISTCREATED 2023
|
||||
#define EDT_IDC_FILENAME 2023
|
||||
#define EDT_IDC_PARENT 2024
|
||||
#define EDT_IDC_SUPOBJNAME 2024
|
||||
#define EDT_IDC_SUPOBJLEVEL 2025
|
||||
#define EDT_IDC_SUPOBJOWNER 2026
|
||||
#define EDT_IDC_PARENTOBJ 2027
|
||||
#define EDT_IDC_PARENTOWNER 2028
|
||||
#define EDT_IDC_EDITOWNER 2029
|
||||
#define EDT_IDC_POSY 2030
|
||||
#define EDT_IDC_REINSERT 2031
|
||||
#define EDT_IDC_ROTX 2031
|
||||
#define EDT_IDC_DESTROY 2032
|
||||
#define EDT_IDC_SCALEX 2032
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 185
|
||||
#define _APS_NEXT_COMMAND_VALUE 32880
|
||||
#define _APS_NEXT_CONTROL_VALUE 1129
|
||||
#define _APS_NEXT_SYMED_VALUE 119
|
||||
#endif
|
||||
#endif
|
479
Rayman_X/cpa/tempgrp/Edt/res/edtres.rc
Normal file
@@ -0,0 +1,479 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "EDTRes.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
EDT_IDD_DIALOGSELECT DIALOGEX 0, 0, 110, 145
|
||||
STYLE WS_CHILD
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT " Pct 1",EDT_IDC_PCT1,1,25,21,8
|
||||
EDITTEXT EDT_IDC_X1,24,22,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Y1,53,22,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Z1,82,22,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT " Pct 2",EDT_IDC_PCT2,1,38,21,8
|
||||
LTEXT " Pct 3",EDT_IDC_PCT3,1,51,21,8
|
||||
LTEXT " Pct 1",EDT_IDC_PCT11,1,86,21,8
|
||||
LTEXT " Pct 2",EDT_IDC_PCT22,1,100,21,8
|
||||
LTEXT " Pct 3",EDT_IDC_PCT33,1,115,21,8
|
||||
EDITTEXT EDT_IDC_X2,24,36,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_X3,24,50,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_X11,24,84,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_X22,24,99,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_X33,24,114,26,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Y2,53,36,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Y3,53,50,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Y11,53,84,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Y22,53,99,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Y33,53,114,26,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Z2,82,36,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Z3,82,50,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Z11,82,84,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Z22,82,99,26,12,ES_CENTER | ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_Z33,82,114,26,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "Move",EDT_IDC_MOVE,46,130,41,12
|
||||
CONTROL "Select destination points",EDT_IDC_SELECTDST,"Button",
|
||||
BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,24,5,85,12
|
||||
CONTROL "Select source points",EDT_IDC_SELECTSRC,"Button",
|
||||
BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,24,67,85,12
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGVECTOR DIALOG DISCARDABLE 0, 0, 128, 112
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Specify a translation vector"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT EDT_IDC_COMPONENTX,68,13,48,14,ES_AUTOHSCROLL
|
||||
EDITTEXT EDT_IDC_COMPONENTY,67,35,50,14,ES_AUTOHSCROLL
|
||||
EDITTEXT EDT_IDC_COMPONENTZ,67,60,50,14,ES_AUTOHSCROLL
|
||||
DEFPUSHBUTTON "OK",IDOK,13,87,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,69,86,50,14
|
||||
LTEXT "&X Component",IDC_STATIC,17,14,50,14
|
||||
LTEXT "&Y Component",IDC_STATIC,17,36,50,14
|
||||
LTEXT "&Z Component",IDC_STATIC,17,61,50,14
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
EDT_IDD_DIALOGSELECT, DIALOG
|
||||
BEGIN
|
||||
BOTTOMMARGIN, 143
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGVECTOR, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 121
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 105
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// French (France) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
EDT_IDD_DIALOGMOVE DIALOG DISCARDABLE 0, 0, 201, 126
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
||||
CAPTION "Sector Changes"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "ACCEPT MODIF",IDOK,29,109,64,14
|
||||
PUSHBUTTON "CANCEL MOVE",IDCANCEL,105,109,66,14
|
||||
LTEXT "If this move is not canceled, the following links will be modified in Static Hierarchy :",
|
||||
IDC_STATIC,3,13,195,18
|
||||
LTEXT "Static Objects were moved in a new Sector.",IDC_STATIC,
|
||||
3,3,139,9
|
||||
LISTBOX EDT_IDC_LISTSECTORS,133,43,65,63,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX EDT_IDC_LISTOBJECTS,3,43,65,63,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX EDT_IDC_LISTPARENTS,68,43,65,63,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CTEXT "Object",IDC_STATIC,3,33,64,9,WS_BORDER
|
||||
CTEXT "Previous Parent",IDC_STATIC,69,33,64,9,WS_BORDER
|
||||
CTEXT "New Parent",IDC_STATIC,134,33,64,9,WS_BORDER
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGUPDATE DIALOG DISCARDABLE 0, 0, 228, 135
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
||||
CAPTION " OBJECTS DESTROYED BY ENGINE"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,106,113,15,19
|
||||
CTEXT "These objects were lost during Engine Loop. Select the \nobjects you want to re-insert. Other objects will be destroyed.",
|
||||
IDC_STATIC,3,3,222,20,SS_SUNKEN | WS_BORDER
|
||||
LISTBOX EDT_IDC_LISTREINSERT1,174,31,51,101,LBS_NOINTEGRALHEIGHT |
|
||||
WS_DISABLED | WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX EDT_IDC_LISTREINSERT,122,31,51,101,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX EDT_IDC_LISTDESTROY1,54,31,51,101,LBS_NOINTEGRALHEIGHT |
|
||||
WS_DISABLED | WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX EDT_IDC_LISTDESTROY,3,30,51,102,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME,113,24,1,88
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGEDIT DIALOGEX 0, 0, 131, 285
|
||||
STYLE WS_CHILD
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "Linked object",EDT_IDC_OBJECTRECT,5,78,108,49,BS_CENTER
|
||||
PUSHBUTTON "Go",EDT_IDC_OBJECTGO,98,9,14,10
|
||||
EDITTEXT EDT_IDC_EDITNAME,10,87,85,12,ES_CENTER | ES_MULTILINE |
|
||||
ES_AUTOHSCROLL
|
||||
CONTROL "Temp",EDT_IDC_TEMP,"Button",BS_AUTOCHECKBOX |
|
||||
WS_DISABLED,70,45,32,10
|
||||
GROUPBOX "Parent of object",EDT_IDC_PARENTRECT,5,133,108,55,
|
||||
BS_CENTER
|
||||
PUSHBUTTON "Go",EDT_IDC_PARENTGO,99,138,14,10
|
||||
GROUPBOX "Position of object",EDT_IDC_POSITIONRECT,3,192,120,85,
|
||||
BS_CENTER
|
||||
LTEXT "Trans",EDT_IDC_TRANSL,10,206,21,12
|
||||
EDITTEXT EDT_IDC_POSX,34,204,26,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_POSY,63,204,25,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_POSZ,92,204,26,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "Rotat",EDT_IDC_ROT,10,238,21,11
|
||||
EDITTEXT EDT_IDC_ROTX,34,235,21,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_ROTY,65,235,21,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_ROTZ,95,235,22,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
LTEXT "Scale",EDT_IDC_SCALE,10,220,21,11
|
||||
EDITTEXT EDT_IDC_SCALEX,34,217,26,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_SCALEY,63,217,25,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT EDT_IDC_SCALEZ,92,217,26,12,ES_CENTER | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
LTEXT "",EDT_IDC_PARENTNAME,9,144,86,11,WS_BORDER
|
||||
LTEXT "",EDT_IDC_PARENTTYPE,10,173,40,11,WS_BORDER
|
||||
LTEXT "",EDT_IDC_EDITTYPE,11,100,46,11,WS_BORDER
|
||||
LTEXT "",EDT_IDC_EDITDESC,61,100,46,11,WS_BORDER
|
||||
DEFPUSHBUTTON "",EDT_IDC_DEFAULT,101,89,6,7,NOT WS_VISIBLE
|
||||
GROUPBOX "Selection",EDT_IDC_SUPOBJRECT,5,5,108,71,BS_CENTER
|
||||
EDITTEXT EDT_IDC_SUPOBJNAME,10,14,85,12,ES_CENTER | ES_MULTILINE |
|
||||
ES_AUTOHSCROLL
|
||||
LTEXT "",EDT_IDC_SUPOBJLEVEL,10,45,55,11,WS_BORDER
|
||||
LTEXT "",EDT_IDC_SUPOBJOWNER,10,30,69,11,WS_BORDER
|
||||
LTEXT "",EDT_IDC_PARENTOBJ,10,158,85,11,WS_BORDER
|
||||
LTEXT "",EDT_IDC_PARENTOWNER,55,173,40,11,WS_BORDER
|
||||
LTEXT "",EDT_IDC_EDITOWNER,11,113,96,11,WS_BORDER
|
||||
PUSHBUTTON "Apply",EDT_IDC_APPLY,70,258,34,10
|
||||
CONTROL "Global",EDT_IDC_GLOBALMODE,"Button",BS_AUTOCHECKBOX |
|
||||
BS_PUSHLIKE | WS_TABSTOP,25,258,36,10
|
||||
CONTROL "Slider1",EDT_IDC_SLIDERX,"msctls_trackbar32",TBS_VERT |
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,56,230,10,27
|
||||
CONTROL "Slider1",EDT_IDC_SLIDERY,"msctls_trackbar32",TBS_VERT |
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,86,230,10,27
|
||||
CONTROL "Slider1",EDT_IDC_SLIDERZ,"msctls_trackbar32",TBS_VERT |
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,116,217,10,27
|
||||
PUSHBUTTON "Flags",EDT_IDC_SUPOBJFLAGS,87,31,22,9
|
||||
EDITTEXT EDT_IDC_EDITTRANSP,69,62,33,11,ES_AUTOHSCROLL
|
||||
CONTROL "Slider1",EDT_IDC_SLIDERTRANS,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,63,53,11
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGFLAGS DIALOGEX 0, 0, 111, 163
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
||||
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE
|
||||
CAPTION "Flags"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,4,145,40,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,59,145,40,14
|
||||
CONTROL "No Collision",EDT_IDC_CHECKPICKING,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,4,95,15
|
||||
CONTROL "Not Visible",EDT_IDC_CHECKHIDDEN,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,18,95,15
|
||||
CONTROL "No Transformation Matrix",EDT_IDC_CHECKTRANSFORMMATRIX,
|
||||
"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,32,
|
||||
95,15
|
||||
CONTROL "Zoom instead of Scale",EDT_IDC_CHECKZOOMFORSCALE,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,46,95,15
|
||||
CONTROL "Bounding Volume is a Box",EDT_IDC_CHECKBOUNDINGBOX,
|
||||
"Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,60,
|
||||
95,15
|
||||
CONTROL "Is Superimposed",EDT_IDC_CHECKIMPOSE,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,73,95,15
|
||||
CONTROL "No Raytrace Hit",EDT_IDC_CHECKNORAYTRACE,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,88,95,15
|
||||
CONTROL "Check Children",EDT_IDC_CHECKCHILDREN,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,102,95,15
|
||||
CONTROL "No Shadow On Me",EDT_IDC_CHECKNOSHADOW,"Button",
|
||||
BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,4,116,95,15
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGSELECTTYPES DIALOG DISCARDABLE 0, 0, 284, 141
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Select sector and type"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,80,115,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,150,115,50,14
|
||||
LISTBOX EDT_IDC_SECTORLIST,20,25,105,75,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX EDT_IDC_TYPESLIST,155,25,105,75,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
CTEXT "Sector",IDC_STATIC,45,10,40,10
|
||||
LTEXT "Type",IDC_STATIC,190,10,20,10
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
EDT_IDD_DIALOGMOVE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 3
|
||||
RIGHTMARGIN, 198
|
||||
TOPMARGIN, 3
|
||||
BOTTOMMARGIN, 123
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGUPDATE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 3
|
||||
RIGHTMARGIN, 225
|
||||
TOPMARGIN, 3
|
||||
BOTTOMMARGIN, 132
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGEDIT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 3
|
||||
RIGHTMARGIN, 128
|
||||
BOTTOMMARGIN, 283
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGFLAGS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 4
|
||||
RIGHTMARGIN, 106
|
||||
TOPMARGIN, 4
|
||||
BOTTOMMARGIN, 159
|
||||
END
|
||||
|
||||
EDT_IDD_DIALOGSELECTTYPES, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 277
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 134
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "CPAPROJ MFC Application\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "CPAPROJ\0"
|
||||
VALUE "LegalCopyright", "Copyright <20> 1996\0"
|
||||
VALUE "OriginalFilename", "CPAPROJ.EXE\0"
|
||||
VALUE "ProductName", "CPAPROJ Application\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"EDTRes.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Cursor
|
||||
//
|
||||
|
||||
EDT_IDC_COPYALLMODE CURSOR DISCARDABLE "EDTcCAll.cur"
|
||||
EDT_IDC_CHOICEMODE CURSOR DISCARDABLE "EDTcChoice.cur"
|
||||
EDT_IDC_PARENTMODE CURSOR DISCARDABLE "EDTcParent.cur"
|
||||
EDT_IDC_PASTEFATHER CURSOR DISCARDABLE "EDTcPFather.cur"
|
||||
EDT_IDC_PASTEPOS CURSOR DISCARDABLE "EDTcPPos.cur"
|
||||
EDT_IDC_COPYALONEMODE CURSOR DISCARDABLE "EDTcCAlone.cur"
|
||||
EDT_IDC_MOVETOMODE CURSOR DISCARDABLE "EDTcMoveTo.cur"
|
||||
EDT_IDC_MOVETOSELECT CURSOR DISCARDABLE "EDTcSelectTo.cur"
|
||||
EDT_IDC_ORIENTMODE CURSOR DISCARDABLE "EDTcOrient.cur"
|
||||
EDT_IDC_VORIENTMODE CURSOR DISCARDABLE "EDTcVOrient.cur"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
EDT_IDI_CAMERA ICON DISCARDABLE "EDTCam.ico"
|
||||
EDT_IDI_ACTOR ICON DISCARDABLE "EDTPerso.ico"
|
||||
EDT_IDI_IPO ICON DISCARDABLE "EDTIpo.ico"
|
||||
EDT_IDI_WAYPOINT ICON DISCARDABLE "EDTWaypt.ico"
|
||||
EDT_IDI_LIGHT ICON DISCARDABLE "EDTLum.ico"
|
||||
EDT_IDI_SECTOR ICON DISCARDABLE "EDTSect.ico"
|
||||
EDT_IDI_GEOM ICON DISCARDABLE "EDTGeom.ico"
|
||||
EDT_IDI_UNKNOWN ICON DISCARDABLE "EDTWhat.ico"
|
||||
EDT_IDI_SUPOBJ ICON DISCARDABLE "EDTNone.ico"
|
||||
EDT_IDI_EDIT ICON DISCARDABLE "EDTedit.ico"
|
||||
EDT_IDI_NOEDIT ICON DISCARDABLE "EDTnoed.ico"
|
||||
EDT_IDI_PEDIT ICON DISCARDABLE "EDTpedit.ico"
|
||||
EDT_IDI_PNOEDIT ICON DISCARDABLE "EDTpnoed.ico"
|
||||
EDT_IDI_PHYSICAL ICON DISCARDABLE "EDTPhys.ico"
|
||||
EDT_IDI_ZONE ICON DISCARDABLE "EDTZone.ico"
|
||||
IDI_EDT_DLGBAR_ICON ICON DISCARDABLE "edt_dlgb.ico"
|
||||
#endif // French (France) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
122
Rayman_X/cpa/tempgrp/Edt/src/DLLCom.cpp
Normal file
@@ -0,0 +1,122 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* dllcom.cpp : DLL definition
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "acp_base.h"
|
||||
#include "itf.h"
|
||||
#include "afxdllx.h"
|
||||
#include "edtbase.hpp"
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Global vars
|
||||
static char *gs_p_szCPAVersion = C_szCPAVersion;
|
||||
static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };
|
||||
|
||||
#ifdef DLL_ONLY_ONE_INSTANCE
|
||||
static EDT_HierarchyEditor *gs_p_oEDTInterface = NULL;
|
||||
#endif
|
||||
|
||||
// list of instances
|
||||
static CList<CPA_DLLBase*,CPA_DLLBase*> g_oListOfInstances; //private internal
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// functions that are present in all DLL :
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
//========================================================================
|
||||
// Get current CPA version
|
||||
//========================================================================
|
||||
extern "C" char __declspec(dllexport) *fn_p_szGetCPAVersion(void)
|
||||
{
|
||||
return gs_p_szCPAVersion;
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// Get type of this DLL
|
||||
//========================================================================
|
||||
extern "C" tdstDLLIdentity __declspec(dllexport) *fn_p_stGetDLLIdentity(void)
|
||||
{
|
||||
g_stHierarchyIdentity.eType = HIERARCHY_DLL;
|
||||
g_stHierarchyIdentity.csName = C_szDLLHierarchyName;
|
||||
g_stHierarchyIdentity.hModule = NULL;
|
||||
g_stHierarchyIdentity.p_oListOfInstances = &g_oListOfInstances;
|
||||
|
||||
return &g_stHierarchyIdentity;
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// DLL int function
|
||||
//========================================================================
|
||||
extern "C" void __declspec(dllexport) fn_vInitDll(void)
|
||||
{
|
||||
new CDynLinkLibrary(extensionDLL);
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// DLL entry point
|
||||
//========================================================================
|
||||
extern "C" int __stdcall DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
if (!AfxInitExtensionModule(extensionDLL, hInstance))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
// Get the DLL
|
||||
//========================================================================
|
||||
extern "C" CPA_DLLBase __declspec(dllexport) *fn_p_oGetDLL(long lKey)
|
||||
{
|
||||
#ifdef DLL_ONLY_ONE_INSTANCE
|
||||
|
||||
switch(lKey)
|
||||
{
|
||||
case 0: // the game world
|
||||
if (gs_p_oEDTInterface == NULL)
|
||||
{
|
||||
gs_p_oEDTInterface = new EDT_HierarchyEditor();
|
||||
ASSERT(gs_p_oEDTInterface != NULL);
|
||||
}
|
||||
return gs_p_oEDTInterface;
|
||||
break;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#else //DLL_ONLY_ONE_INSTANCE
|
||||
|
||||
switch(lKey)
|
||||
{
|
||||
case 0: // the game world
|
||||
return new EDT_HierarchyEditor();
|
||||
break;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif //DLL_ONLY_ONE_INSTANCE
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// functions that are present in this type of DLL only :
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
#undef DLL_ONLY_ONE_INSTANCE
|
10
Rayman_X/cpa/tempgrp/Edt/src/_object.def
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
LIBRARY
|
||||
EXPORTS
|
||||
fn_p_szGetCPAVersion
|
||||
fn_p_stGetDLLIdentity
|
||||
fn_p_oGetDLL
|
||||
fn_vInitDll
|
||||
SECTIONS
|
||||
.data READ WRITE
|
7462
Rayman_X/cpa/tempgrp/Edt/src/edtbase.cpp
Normal file
2009
Rayman_X/cpa/tempgrp/Edt/src/edtdedit.cpp
Normal file
198
Rayman_X/cpa/tempgrp/Edt/src/edtdflag.cpp
Normal file
@@ -0,0 +1,198 @@
|
||||
/*=========================================================================
|
||||
* //ANNECY CO SPOFLAG 03/02/98
|
||||
*
|
||||
* EDTdFlag.cpp : Flags Dialog - Implementation file
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#ifdef ACTIVE_EDITOR
|
||||
#include "acp_base.h"
|
||||
|
||||
#include "EDTdFlag.hpp"
|
||||
#include "EDTBase.hpp"
|
||||
#include "EDTSObj.hpp"
|
||||
#include "EDTdEdit.hpp"
|
||||
|
||||
#include "ITF.h"
|
||||
|
||||
//#################################################################################
|
||||
// EDT_DialogFlag dialog
|
||||
//#################################################################################
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
CPA_Interface * EDT_DialogFlag::GetInterface (void)
|
||||
{
|
||||
return m_pEditor->GetInterface();
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
EDT_DialogFlag::EDT_DialogFlag(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(EDT_DialogFlag::IDD, &g_oBaseFrame)
|
||||
{
|
||||
//{{AFX_DATA_INIT(EDT_DialogFlag)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogFlag::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(EDT_DialogFlag)
|
||||
DDX_Control(pDX, EDT_IDC_CHECKPICKING, m_cCheckPicking);
|
||||
DDX_Control(pDX, EDT_IDC_CHECKHIDDEN, m_cCheckHidden);
|
||||
//ANNECY Shaitan SPOFlags 17/02/98
|
||||
DDX_Control(pDX, EDT_IDC_CHECKTRANSFORMMATRIX, m_cCheckTransformMatrix);
|
||||
DDX_Control(pDX, EDT_IDC_CHECKZOOMFORSCALE, m_cCheckZoomForScale);
|
||||
//ANNECY TQ 27/02/98{
|
||||
DDX_Control(pDX, EDT_IDC_CHECKBOUNDINGBOX, m_cCheckBoundingBox);
|
||||
DDX_Control(pDX, EDT_IDC_CHECKIMPOSE, m_cCheckImpose);
|
||||
DDX_Control(pDX, EDT_IDC_CHECKNORAYTRACE, m_cCheckNoRayTrace);
|
||||
DDX_Control(pDX, EDT_IDC_CHECKCHILDREN, m_cCheckChildren);
|
||||
DDX_Control(pDX, EDT_IDC_CHECKNOSHADOW, m_cCheckNoShadowOnMe);
|
||||
//ENDANNECY TQ}
|
||||
|
||||
//ENDANNECY Shaitan SPOFlags
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
BEGIN_MESSAGE_MAP(EDT_DialogFlag, CDialog)
|
||||
//{{AFX_MSG_MAP(EDT_DialogFlag)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// EDT_DialogFlag message handlers
|
||||
//#################################################################################
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogFlag::fn_vDoDialog (EDT_HierarchyEditor *pEditor, EDT_SuperObject *pSupObj)
|
||||
{
|
||||
// init parameters
|
||||
m_pEditor = pEditor;
|
||||
m_pSuperObject = pSupObj;
|
||||
// this dialog is modal
|
||||
DoModal();
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
BOOL EDT_DialogFlag::OnInitDialog ()
|
||||
{
|
||||
CPA_DLLBase *pObjectDLL;
|
||||
|
||||
// Create the dialog
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// get flags
|
||||
m_ulInitialFlags = m_pSuperObject->GetFlags();
|
||||
|
||||
//ANNECY Shaitan SPOFlags 19/02/98
|
||||
// ask permission for each flag
|
||||
pObjectDLL = m_pSuperObject->GetObjectDLL();
|
||||
m_cCheckPicking.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulNotPickable) : TRUE);
|
||||
m_cCheckHidden.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulHidden) : TRUE);
|
||||
m_cCheckTransformMatrix.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulNoTransformationMatrix) : TRUE);
|
||||
m_cCheckZoomForScale.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulZoomInsteadOfScale) : TRUE);
|
||||
//ANNECY TQ 27/02/98{
|
||||
m_cCheckBoundingBox.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulTypeOfBoundingVolume) : TRUE);
|
||||
m_cCheckImpose.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulSuperimposed) : TRUE);
|
||||
m_cCheckNoRayTrace.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulNotHitByRayTrace) : TRUE);
|
||||
m_cCheckNoShadowOnMe.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulNoShadowOnMe) : TRUE);
|
||||
m_cCheckChildren.EnableWindow(pObjectDLL ? pObjectDLL->fn_bAcceptModifFlag(m_pSuperObject, HIE_C_Flag_ulCheckChildren) : TRUE);
|
||||
//ENDANNECY TQ}
|
||||
//ENDANNECY Shaitan SPOFlags
|
||||
|
||||
// update check boxes
|
||||
m_cCheckPicking.SetCheck(HIE_fn_SO_bIsNotPickable(m_pSuperObject->GetStruct()));
|
||||
m_cCheckHidden.SetCheck(HIE_fn_SO_bIsHidden(m_pSuperObject->GetStruct()));
|
||||
//ANNECY Shaitan SPOFlags 17/02/98
|
||||
m_cCheckTransformMatrix.SetCheck(HIE_fn_SO_bHasNoTransformationMatrix(m_pSuperObject->GetStruct()));
|
||||
m_cCheckZoomForScale.SetCheck(HIE_fn_SO_bHasZoomInsteadOfScale(m_pSuperObject->GetStruct()));
|
||||
//ANNECY TQ 27/02/98{
|
||||
m_cCheckBoundingBox.SetCheck(HIE_fn_SO_bHasABoxBoundingVolume(m_pSuperObject->GetStruct()));
|
||||
m_cCheckNoRayTrace.SetCheck(m_ulInitialFlags & HIE_C_Flag_ulNotHitByRayTrace);
|
||||
m_cCheckNoShadowOnMe.SetCheck(m_ulInitialFlags & HIE_C_Flag_ulNoShadowOnMe);
|
||||
m_cCheckImpose.SetCheck(HIE_fn_SO_bIsSuperimposed(m_pSuperObject->GetStruct()));
|
||||
m_cCheckChildren.SetCheck(HIE_fn_SO_bCheckChildren(m_pSuperObject->GetStruct()));
|
||||
//ENDANNECY TQ}
|
||||
|
||||
//ENDANNECY Shaitan SPOFlags
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogFlag::OnOK()
|
||||
{
|
||||
unsigned long ulFlags = 0;
|
||||
|
||||
// update super-object flags
|
||||
if (m_cCheckPicking.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulNotPickable;
|
||||
if (m_cCheckHidden.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulHidden;
|
||||
//ANNECY Shaitan SPOFlags 17/02/98
|
||||
if (m_cCheckTransformMatrix.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulNoTransformationMatrix;
|
||||
if (m_cCheckZoomForScale.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulZoomInsteadOfScale;
|
||||
//ENDANNECY Shaitan SPOFlags
|
||||
//ANNECY TQ 02/03/98{
|
||||
if (m_cCheckBoundingBox.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulTypeOfBoundingVolume;
|
||||
if (m_cCheckImpose.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulSuperimposed;
|
||||
if (m_cCheckNoRayTrace.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulNotHitByRayTrace;
|
||||
if (m_cCheckNoShadowOnMe.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulNoShadowOnMe;
|
||||
//ANNECY TQ 19/05/98{
|
||||
if(m_cCheckChildren.GetCheck())
|
||||
ulFlags |= HIE_C_Flag_ulCheckChildren;
|
||||
//ENDANNECY TQ}
|
||||
|
||||
//ENDANNECY TQ}
|
||||
|
||||
if (ulFlags != m_ulInitialFlags)
|
||||
{
|
||||
m_pSuperObject->SetFlags(ulFlags);
|
||||
//ANNECY Shaitan SPOFlags 19/02/98
|
||||
m_pSuperObject->GetObjectDLL()->fn_vOnModifFlag(m_pSuperObject, m_ulInitialFlags, ulFlags);
|
||||
//ENDANNECY Shaitan SPOFlags
|
||||
}
|
||||
|
||||
m_pEditor->GetDialogEdit()->fn_vUpdateDialog();
|
||||
|
||||
// close dialog
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogFlag::OnCancel()
|
||||
{
|
||||
// close dialog
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // ACTIVE_EDITOR
|
128
Rayman_X/cpa/tempgrp/Edt/src/edtdmove.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTdMove.cpp : Move Dialog - Implementation file
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#ifdef ACTIVE_EDITOR
|
||||
#include "acp_base.h"
|
||||
|
||||
#include "EDTdMove.hpp"
|
||||
#include "EDTBase.hpp"
|
||||
#include "EDTSObj.hpp"
|
||||
|
||||
#include "ITF.h"
|
||||
|
||||
//#################################################################################
|
||||
// EDT_DialogMove dialog
|
||||
//#################################################################################
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
CPA_Interface * EDT_DialogMove::GetInterface (void)
|
||||
{
|
||||
return m_pEditor->GetInterface();
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
EDT_DialogMove::EDT_DialogMove(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(EDT_DialogMove::IDD, &g_oBaseFrame)
|
||||
{
|
||||
//{{AFX_DATA_INIT(EDT_DialogMove)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogMove::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(EDT_DialogMove)
|
||||
DDX_Control(pDX, EDT_IDC_LISTOBJECTS, m_cListObject);
|
||||
DDX_Control(pDX, EDT_IDC_LISTPARENTS, m_cListParent);
|
||||
DDX_Control(pDX, EDT_IDC_LISTSECTORS, m_cListSector);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
BEGIN_MESSAGE_MAP(EDT_DialogMove, CDialog)
|
||||
//{{AFX_MSG_MAP(EDT_DialogMove)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// EDT_DialogMove message handlers
|
||||
//#################################################################################
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
BOOL EDT_DialogMove::fn_bDoDialog (EDT_HierarchyEditor *pEditor)
|
||||
{
|
||||
// init parameters
|
||||
m_pEditor = pEditor;
|
||||
m_bAcceptModif = TRUE;
|
||||
// this dialog is modal
|
||||
DoModal();
|
||||
// return user's answer
|
||||
return m_bAcceptModif;
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
BOOL EDT_DialogMove::OnInitDialog ()
|
||||
{
|
||||
EDT_SaveParents *pElem;
|
||||
POSITION pos;
|
||||
|
||||
// Create the dialog
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// init list moved
|
||||
for (pElem = M_GetListOfModifParent()->GetHeadElement(pos); pElem;
|
||||
pElem = M_GetListOfModifParent()->GetNextElement(pos))
|
||||
{
|
||||
// selected objects need no authorisation
|
||||
if (!M_GetListSelected()->Find(pElem->m_pChild))
|
||||
{
|
||||
m_cListObject.AddString(pElem->m_pChild->GetNameToDraw());
|
||||
m_cListParent.AddString(pElem->m_pInitialParent->GetNameToDraw());
|
||||
m_cListSector.AddString(pElem->m_pFinalParent->GetNameToDraw());
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogMove::OnOK()
|
||||
{
|
||||
m_bAcceptModif = TRUE;
|
||||
// close dialog
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogMove::OnCancel()
|
||||
{
|
||||
m_bAcceptModif = FALSE;
|
||||
// close dialog
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // ACTIVE_EDITOR
|
663
Rayman_X/cpa/tempgrp/Edt/src/edtdsel.cpp
Normal file
@@ -0,0 +1,663 @@
|
||||
//ROMTEAM StickObjects (Gabi Dumitrascu 02/02/98)
|
||||
|
||||
/*=========================================================================
|
||||
* edtdsel.cpp : Implementation file
|
||||
* we will select three points from the destination object,three points
|
||||
from the source object and stick them together.
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* CPA2 Gabi Dumitrascu 98-02-02
|
||||
*=======================================================================*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
#include "acp_base.h"
|
||||
|
||||
#include "ITF.h"
|
||||
|
||||
#include "edtdedit.hpp"
|
||||
#include "edtdsel.hpp"
|
||||
#include "EDTBase.hpp"
|
||||
#include "EDTSObj.hpp"
|
||||
|
||||
#include "incMTH.h"
|
||||
|
||||
#include "..\Main\Inc\_EditID.h"
|
||||
#include "TUT.h"
|
||||
|
||||
#include "EDTrot.hpp"
|
||||
|
||||
#define M_GetToolDLLs() m_pEditor->GetMainWorld()->GetToolDLLReceivingEvtEditorMsg()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// EDT_DialogSelect
|
||||
|
||||
|
||||
EDT_DialogSelect::EDT_DialogSelect(CWnd *pParent)
|
||||
: CFormView(EDT_DialogSelect::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(EDT_DialogSelect)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void EDT_DialogSelect::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CFormView::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(EDT_DialogSelect)
|
||||
DDX_Control(pDX, EDT_IDC_SELECTSRC, m_ckSelectSrc);
|
||||
DDX_Control(pDX, EDT_IDC_SELECTDST, m_ckSelectDst);
|
||||
DDX_Control(pDX, EDT_IDC_Z33, m_PosZ33);
|
||||
DDX_Control(pDX, EDT_IDC_Z3, m_PosZ3);
|
||||
DDX_Control(pDX, EDT_IDC_Z22, m_PosZ22);
|
||||
DDX_Control(pDX, EDT_IDC_Z2, m_PosZ2);
|
||||
DDX_Control(pDX, EDT_IDC_Z11, m_PosZ11);
|
||||
DDX_Control(pDX, EDT_IDC_Z1, m_PosZ1);
|
||||
DDX_Control(pDX, EDT_IDC_Y33, m_PosY33);
|
||||
DDX_Control(pDX, EDT_IDC_Y3, m_PosY3);
|
||||
DDX_Control(pDX, EDT_IDC_Y22, m_PosY22);
|
||||
DDX_Control(pDX, EDT_IDC_Y2, m_PosY2);
|
||||
DDX_Control(pDX, EDT_IDC_Y11, m_PosY11);
|
||||
DDX_Control(pDX, EDT_IDC_Y1, m_PosY1);
|
||||
DDX_Control(pDX, EDT_IDC_X33, m_PosX33);
|
||||
DDX_Control(pDX, EDT_IDC_X3, m_PosX3);
|
||||
DDX_Control(pDX, EDT_IDC_X22, m_PosX22);
|
||||
DDX_Control(pDX, EDT_IDC_X2, m_PosX2);
|
||||
DDX_Control(pDX, EDT_IDC_X11, m_PosX11);
|
||||
DDX_Control(pDX, EDT_IDC_X1, m_PosX1);
|
||||
DDX_Control(pDX, EDT_IDC_MOVE, m_bMove);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(EDT_DialogSelect, CFormView)
|
||||
//{{AFX_MSG_MAP(EDT_DialogSelect)
|
||||
ON_WM_DESTROY()
|
||||
ON_BN_CLICKED(EDT_IDC_MOVE, OnMove)
|
||||
ON_BN_CLICKED(EDT_IDC_SELECTDST, OnSelectDst)
|
||||
ON_BN_CLICKED(EDT_IDC_SELECTSRC, OnSelectSrc)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/*===========================================================================
|
||||
* Description:
|
||||
* Creation date:
|
||||
* Author:
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
CPA_Interface * EDT_DialogSelect::GetInterface (void)
|
||||
{
|
||||
return m_pEditor->GetInterface();
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Init Dialog
|
||||
* Creation date: 98-02-02
|
||||
* Author: CPA2 Gabi Dumitrascu
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date:
|
||||
* Author:
|
||||
*=========================================================================*/
|
||||
void EDT_DialogSelect::fn_vInitDialog (EDT_HierarchyEditor *pEditor, FRMBase *pFrame)
|
||||
{
|
||||
// create the dialog
|
||||
m_pEditor = pEditor;
|
||||
CFormView::Create(NULL, "", WS_VISIBLE|WS_CHILD, CRect(0,0,0,0), pFrame, AFX_IDW_PANE_FIRST, NULL);
|
||||
|
||||
m_bWrongObject = FALSE;
|
||||
m_iCrtDstPoint = -1;
|
||||
m_iCrtSrcPoint = -1;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
MTH3D_M_vNullVector(m_stDstPoints + i);
|
||||
MTH3D_M_vNullVector(m_stSrcPoints + i);
|
||||
}
|
||||
// init data for dialog
|
||||
CFormView::UpdateData(FALSE);
|
||||
|
||||
// FOR TUTORIAL
|
||||
TUT_M_vGetTutDll();
|
||||
// button Select points
|
||||
TUT_M_vRegisterControl(m_ckSelectDst.m_hWnd, "EDT_DEDIT_BUTTON_SELECTDST", TUT_e_Button);
|
||||
TUT_M_vRegisterControl(m_ckSelectSrc.m_hWnd, "EDT_DEDIT_BUTTON_SELECTSRC", TUT_e_Button);
|
||||
// position
|
||||
TUT_M_vRegisterControl(m_PosX1.m_hWnd, "EDT_DEDIT_EDIT_POSX1", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosY1.m_hWnd, "EDT_DEDIT_EDIT_POSY1", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosZ1.m_hWnd, "EDT_DEDIT_EDIT_POSZ1", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosX2.m_hWnd, "EDT_DEDIT_EDIT_POSX2", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosY2.m_hWnd, "EDT_DEDIT_EDIT_POSY2", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosZ2.m_hWnd, "EDT_DEDIT_EDIT_POSZ2", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosX3.m_hWnd, "EDT_DEDIT_EDIT_POSX3", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosY3.m_hWnd, "EDT_DEDIT_EDIT_POSY3", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosZ3.m_hWnd, "EDT_DEDIT_EDIT_POSZ3", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosX11.m_hWnd, "EDT_DEDIT_EDIT_POSX11", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosY11.m_hWnd, "EDT_DEDIT_EDIT_POSY11", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosZ11.m_hWnd, "EDT_DEDIT_EDIT_POSZ11", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosX22.m_hWnd, "EDT_DEDIT_EDIT_POSX22", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosY22.m_hWnd, "EDT_DEDIT_EDIT_POSY22", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosZ22.m_hWnd, "EDT_DEDIT_EDIT_POSZ22", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosX33.m_hWnd, "EDT_DEDIT_EDIT_POSX33", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosY33.m_hWnd, "EDT_DEDIT_EDIT_POSY33", TUT_e_TextEdit);
|
||||
TUT_M_vRegisterControl(m_PosZ33.m_hWnd, "EDT_DEDIT_EDIT_POSZ33", TUT_e_TextEdit);
|
||||
// button move
|
||||
TUT_M_vRegisterControl(m_bMove.m_hWnd, "EDT_DEDIT_BUTTON_MOVE", TUT_e_Button);
|
||||
// END TUTORIAL
|
||||
|
||||
|
||||
m_ckSelectDst.SetCheck(FALSE);
|
||||
m_ckSelectSrc.SetCheck(FALSE);
|
||||
// update data
|
||||
fn_vUpdateDialog();
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: update dialog when object changes
|
||||
* Creation date: 98-02-02
|
||||
* Author: CPA2 Gabi Dumitrascu
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date:
|
||||
* Author:
|
||||
*=========================================================================*/
|
||||
void EDT_DialogSelect::fn_vUpdateDialog (void)
|
||||
{
|
||||
CPA_SuperObject* pSelectedObject = m_pEditor->M_GetSingleSelection();
|
||||
m_ckSelectDst.EnableWindow(!fn_bIsSelectingDst() && !m_bWrongObject );
|
||||
m_ckSelectSrc.EnableWindow(m_iCrtDstPoint == 3 && pSelectedObject && pSelectedObject != m_pDstObject );
|
||||
|
||||
m_ckSelectDst.EnableWindow((pSelectedObject != NULL));
|
||||
|
||||
m_bMove.EnableWindow(m_iCrtDstPoint == 3 && m_iCrtSrcPoint == 3);// && m_bWrongObject);
|
||||
|
||||
fn_vUpdateDstDialog ();
|
||||
fn_vUpdateSrcDialog ();
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: update the destination dialog
|
||||
* Creation date: 98-02-02
|
||||
* Author: CPA2 Gabi Dumitrascu
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
|
||||
void EDT_DialogSelect::fn_vUpdateDstDialog (void)
|
||||
{
|
||||
char szPosX[3][10],szPosY[3][10],szPosZ[3][10];
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
*szPosX[i] = *szPosY[i] = *szPosZ[i] = 0;
|
||||
|
||||
for (i = 0; i < m_iCrtDstPoint; i++)
|
||||
{
|
||||
sprintf(szPosX[i], "%7.4f", MTH3D_M_xGetXofVector(&m_stDstPoints[i]));
|
||||
sprintf(szPosY[i], "%7.4f", MTH3D_M_xGetYofVector(&m_stDstPoints[i]));
|
||||
sprintf(szPosZ[i], "%7.4f", MTH3D_M_xGetZofVector(&m_stDstPoints[i]));
|
||||
}
|
||||
|
||||
m_PosX1.SetWindowText(szPosX[0]);
|
||||
m_PosY1.SetWindowText(szPosY[0]);
|
||||
m_PosZ1.SetWindowText(szPosZ[0]);
|
||||
|
||||
m_PosX2.SetWindowText(szPosX[1]);
|
||||
m_PosY2.SetWindowText(szPosY[1]);
|
||||
m_PosZ2.SetWindowText(szPosZ[1]);
|
||||
|
||||
m_PosX3.SetWindowText(szPosX[2]);
|
||||
m_PosY3.SetWindowText(szPosY[2]);
|
||||
m_PosZ3.SetWindowText(szPosZ[2]);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: update the source dialog
|
||||
* Creation date: 98-02-02
|
||||
* Author: CPA2 Gabi Dumitrascu
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
void EDT_DialogSelect::fn_vUpdateSrcDialog (void)
|
||||
{
|
||||
char szPosX[3][10],szPosY[3][10],szPosZ[3][10];
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
*szPosX[i] = *szPosY[i] = *szPosZ[i] = 0;
|
||||
|
||||
for (i = 0; i < m_iCrtSrcPoint; i++)
|
||||
{
|
||||
sprintf(szPosX[i], "%7.4f", MTH3D_M_xGetXofVector(&m_stSrcPoints[i]));
|
||||
sprintf(szPosY[i], "%7.4f", MTH3D_M_xGetYofVector(&m_stSrcPoints[i]));
|
||||
sprintf(szPosZ[i], "%7.4f", MTH3D_M_xGetZofVector(&m_stSrcPoints[i]));
|
||||
}
|
||||
|
||||
m_PosX11.SetWindowText(szPosX[0]);
|
||||
m_PosY11.SetWindowText(szPosY[0]);
|
||||
m_PosZ11.SetWindowText(szPosZ[0]);
|
||||
|
||||
m_PosX22.SetWindowText(szPosX[1]);
|
||||
m_PosY22.SetWindowText(szPosY[1]);
|
||||
m_PosZ22.SetWindowText(szPosZ[1]);
|
||||
|
||||
m_PosX33.SetWindowText(szPosX[2]);
|
||||
m_PosY33.SetWindowText(szPosY[2]);
|
||||
m_PosZ33.SetWindowText(szPosZ[2]);
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: These two functions are called in the function OnLButtonDown
|
||||
from edtbase.cpp
|
||||
* Creation date: 98-02-02
|
||||
* Author: CPA2 Gabi Dumitrascu
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
BOOL EDT_DialogSelect::fn_bIsSelecting()
|
||||
{
|
||||
return fn_bIsSelectingDst() || fn_bIsSelectingSrc();
|
||||
}
|
||||
|
||||
|
||||
void EDT_DialogSelect::fn_vSetPoint(tdstMousePos *p_stPos, HIE_tdstPickInfo *p_stPickInfo)
|
||||
{
|
||||
if (fn_bIsSelectingDst())
|
||||
fn_vSetDstPoint(p_stPos, p_stPickInfo);
|
||||
if (fn_bIsSelectingSrc())
|
||||
fn_vSetSrcPoint(p_stPos, p_stPickInfo);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Set the points of the destination object
|
||||
* Creation date: 98-02-02
|
||||
* Author: CPA2 Gabi Dumitrascu
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
|
||||
void EDT_DialogSelect::fn_vSetDstPoint(tdstMousePos *p_stPos, HIE_tdstPickInfo *p_stPickInfo)
|
||||
{
|
||||
CPA_SuperObject* pSelectedObject = m_pEditor->M_GetSingleSelection();
|
||||
|
||||
if (m_iCrtDstPoint == 0)
|
||||
m_pDstObject = pSelectedObject;
|
||||
|
||||
// If no selected object or the selected obj was changed, then cancel the selection
|
||||
if (!pSelectedObject || m_pDstObject != pSelectedObject || m_pDstObject == m_pSrcObject)
|
||||
{
|
||||
m_bWrongObject = TRUE;
|
||||
M_GetMainWnd()->UpdateStatus("No object selected or the object was changed. Cancel the selection.", C_STATUSPANE_INFOS, C_STATUS_ERROR);
|
||||
fn_vUpdateDialog();
|
||||
return;
|
||||
}
|
||||
if (m_bWrongObject)
|
||||
{
|
||||
m_bWrongObject = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
HIE_aDEF_stTabOfPickInfo xPickInfo;
|
||||
DEV_ViewPort3D *pCurViewport = ((DEV_ViewPort3D *)m_pEditor->GetInterface()->GetMultiDevice()->GetFocusDevice()->GetViewPort());
|
||||
|
||||
if(HIE_xIsSuperObjectPick(GLI_C_ModePickingPoint, pCurViewport->m_hDisplayDevice, pCurViewport->m_hDisplayViewport,
|
||||
&p_stPos->stPos2D, p_stPickInfo[0].hSprObject, xPickInfo ))
|
||||
{
|
||||
// Get the object relative point's coord
|
||||
ACP_tdxIndex xSelectedPointIndex = ((HIE_tdstPickInfo*)xPickInfo)->stPickedObject.aDEF_stDataOfElement[0].xIndexOfPoint;
|
||||
MTH3D_tdstVector x3DPoint = ((HIE_tdstPickInfo*)xPickInfo)->hGeoObject->d_stListOfPoints[xSelectedPointIndex];
|
||||
// Get the absolute point's coord
|
||||
POS_tdstCompletePosition * pObjectMatrix = HIE_fn_hGetSuperObjectMatrix(m_pDstObject->GetStruct());
|
||||
POS_fn_vMulMatrixVertex(&x3DPoint, pObjectMatrix, &x3DPoint);
|
||||
// Save the absolute point's coord
|
||||
m_stDstPoints[m_iCrtDstPoint++] = x3DPoint;
|
||||
|
||||
if (m_iCrtDstPoint == 3)
|
||||
{
|
||||
m_bWrongObject = TRUE;
|
||||
m_ckSelectDst.SetCheck(FALSE);
|
||||
}
|
||||
// Update the dialog's fields
|
||||
fn_vUpdateDialog();
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Set the points of the source object
|
||||
* Creation date: 98-02-02
|
||||
* Author: CPA2 Gabi Dumitrascu
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
void EDT_DialogSelect::fn_vSetSrcPoint(tdstMousePos *p_stPos, HIE_tdstPickInfo *p_stPickInfo)
|
||||
{
|
||||
|
||||
CPA_SuperObject* pSelectedObject = m_pEditor->M_GetSingleSelection();
|
||||
|
||||
if (m_iCrtSrcPoint == 0)
|
||||
m_pSrcObject = pSelectedObject;
|
||||
// If no selected object or the selected obj was changed, then cancel the selection.
|
||||
if (!pSelectedObject || m_pSrcObject != pSelectedObject || m_pDstObject == m_pSrcObject)
|
||||
{
|
||||
m_bWrongObject = TRUE;
|
||||
M_GetMainWnd()->UpdateStatus("No object selected or the object was changed. Cancel the selection.", C_STATUSPANE_INFOS, C_STATUS_ERROR);
|
||||
fn_vUpdateDialog();
|
||||
return;
|
||||
}
|
||||
if (m_bWrongObject)
|
||||
{
|
||||
m_bWrongObject = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
HIE_aDEF_stTabOfPickInfo xPickInfo;
|
||||
DEV_ViewPort3D *pCurViewport = ((DEV_ViewPort3D *)m_pEditor->GetInterface()->GetMultiDevice()->GetFocusDevice()->GetViewPort());
|
||||
|
||||
if(HIE_xIsSuperObjectPick(GLI_C_ModePickingPoint, pCurViewport->m_hDisplayDevice, pCurViewport->m_hDisplayViewport,
|
||||
&p_stPos->stPos2D, p_stPickInfo[0].hSprObject, xPickInfo ))
|
||||
{
|
||||
// Get the object relative point's coord
|
||||
ACP_tdxIndex xSelectedPointIndex = ((HIE_tdstPickInfo*)xPickInfo)->stPickedObject.aDEF_stDataOfElement[0].xIndexOfPoint;
|
||||
MTH3D_tdstVector x3DPoint = ((HIE_tdstPickInfo*)xPickInfo)->hGeoObject->d_stListOfPoints[xSelectedPointIndex];
|
||||
// Get the absolute point's coord
|
||||
POS_tdstCompletePosition * pObjectMatrix = HIE_fn_hGetSuperObjectMatrix(m_pSrcObject->GetStruct());
|
||||
POS_fn_vMulMatrixVertex(&x3DPoint, pObjectMatrix, &x3DPoint);
|
||||
// Save the absolute point's coord
|
||||
m_stSrcPoints[m_iCrtSrcPoint++] = x3DPoint;
|
||||
// Update the dialog's fields
|
||||
if (m_iCrtSrcPoint == 3)
|
||||
{
|
||||
m_bWrongObject = TRUE;
|
||||
m_ckSelectSrc.SetCheck(FALSE);
|
||||
}
|
||||
// Update the dialog's fields
|
||||
fn_vUpdateDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* EDT_DialogSelect message handlers
|
||||
* Creation date: 98-02-02
|
||||
* Author: CPA2 Gabi Dumitrascu
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
|
||||
void EDT_DialogSelect::OnSelectDst()
|
||||
{
|
||||
m_iCrtDstPoint = 0;
|
||||
m_bWrongObject = FALSE;
|
||||
fn_vUpdateDialog();
|
||||
}
|
||||
|
||||
|
||||
void EDT_DialogSelect::OnSelectSrc()
|
||||
{
|
||||
m_iCrtSrcPoint = 0;
|
||||
m_bWrongObject = FALSE;
|
||||
fn_vUpdateDialog();
|
||||
}
|
||||
|
||||
void EDT_DialogSelect::OnMove()
|
||||
{
|
||||
if (m_pSrcObject != m_pEditor->M_GetSingleSelection())
|
||||
{
|
||||
GetInterface ()->fn_vCancelCurrentSelection(FALSE);
|
||||
GetInterface ()->fn_vAddSelectedObject(m_pSrcObject , TRUE);
|
||||
}
|
||||
|
||||
if (m_iCrtDstPoint == 3 && m_iCrtSrcPoint == 3)
|
||||
{
|
||||
// Compute the rotation matrix and the translation vector.
|
||||
Matrix src, dst, resM;
|
||||
Vector vect;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
dst[i][0] = m_stDstPoints[i].xX;
|
||||
dst[i][1] = m_stDstPoints[i].xY;
|
||||
dst[i][2] = m_stDstPoints[i].xZ;
|
||||
}
|
||||
for (i=0; i < 3; i++)
|
||||
{
|
||||
src[i][0] = m_stSrcPoints[i].xX;
|
||||
src[i][1] = m_stSrcPoints[i].xY;
|
||||
src[i][2] = m_stSrcPoints[i].xZ;
|
||||
}
|
||||
if (!GetTransform(dst, src, resM, vect))
|
||||
{
|
||||
// display message box
|
||||
M_GetMainWnd()->UpdateStatus("The selected triangles are invalid. Cancel the move.", C_STATUSPANE_INFOS, C_STATUS_ERROR);
|
||||
m_ckSelectSrc.EnableWindow(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// CPA2 Nicolae Suparatu 98-02-10
|
||||
// STM - 18-8-98 - use stTransformMatrix instead of stRotationMatrix
|
||||
POS_tdstCompletePosition m, *stMatrix = HIE_fn_hGetSuperObjectGlobalMatrix(m_pSrcObject->GetStruct());
|
||||
CopyMemory(&m.stTransformMatrix, &stMatrix->stTransformMatrix, sizeof(Matrix));
|
||||
CopyMemory(&m.stTranslationVector, &stMatrix->stTranslationVector, sizeof(Vector));
|
||||
// Translate and rotate the last selected object.
|
||||
Convert(resM, vect, (Matrix&)m.stTransformMatrix, (Vector&)m.stTranslationVector);
|
||||
m_edit->fn_vSetNewPositionAndRotation((EDT_SuperObject *)m_pSrcObject, m);
|
||||
|
||||
// End CPA2 Nicolae Suparatu 98-02-10
|
||||
|
||||
}
|
||||
|
||||
m_iCrtDstPoint = -1;
|
||||
m_iCrtSrcPoint = -1;
|
||||
fn_vUpdateDialog();
|
||||
m_pDstObject = m_pSrcObject = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EDT_DialogSelect::OnDestroy()
|
||||
{
|
||||
// FOR TUTORIAL
|
||||
TUT_M_vGetTutDll();
|
||||
// button select
|
||||
TUT_M_vUnregisterControl(m_ckSelectDst.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_ckSelectSrc.m_hWnd);
|
||||
// position
|
||||
TUT_M_vUnregisterControl(m_PosX1.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosY1.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosZ1.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosX2.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosY2.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosZ2.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosX3.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosY3.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosZ3.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosX11.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosY11.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosZ11.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosX22.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosY22.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosZ22.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosX33.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosY33.m_hWnd);
|
||||
TUT_M_vUnregisterControl(m_PosZ33.m_hWnd);
|
||||
// button move
|
||||
TUT_M_vUnregisterControl(m_bMove.m_hWnd);
|
||||
// END TUTORIAL
|
||||
|
||||
CFormView::OnDestroy();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// Begin Silviu Simen september 1998 List of Objects in Sectors
|
||||
/*=========================================================================
|
||||
* Version 1.0
|
||||
* Creation date 9 september 1998
|
||||
* Revision date 9 september 1998
|
||||
*
|
||||
* Author : Silviu Simen
|
||||
*=======================================================================*/
|
||||
|
||||
static int s_iDefSect = 0;
|
||||
static int s_iDefType = 0;
|
||||
|
||||
struct stTypeNames_
|
||||
{
|
||||
unsigned long ulType;
|
||||
char * szTypeName;
|
||||
BOOL bActive;
|
||||
}
|
||||
stTypeNames[] =
|
||||
{
|
||||
HIE_C_ulSuperObject, "SuperObject", 0,
|
||||
HIE_C_ulActor, "Actor", 1,
|
||||
HIE_C_ulSector, "Sector", 0,
|
||||
HIE_C_ulPO, "PhysicalObject", 0,
|
||||
HIE_C_ulPO_Mirror, "PO Mirror", 0,
|
||||
HIE_C_ulIPO, "IPO", 1,
|
||||
HIE_C_ulIPO_Mirror, "IPO Mirror", 1,
|
||||
HIE_C_ulSpecialEffect, "SpecialEffect", 0,
|
||||
HIE_C_ulNoAction, "OOPS", 0,
|
||||
HIE_C_ulMirror, "Mirror", 0,
|
||||
HIE_C_ulEDT_Geometric, "Geometric", 0,
|
||||
HIE_C_ulEDT_Light, "Light", 1,
|
||||
HIE_C_ulEDT_Waypoint, "WayPoint", 1
|
||||
//#define HIE_C_ulEDT_ZdD 0x00002000 // ZdD object (Editor)
|
||||
//#define HIE_C_ulEDT_ZdE 0x00004000 // ZdE object (Editor)
|
||||
//#define HIE_C_ulEDT_ZdM 0x00008000 // ZdM object (Editor)
|
||||
//#define HIE_C_ulEDT_ZdR 0x00010000 // ZdR object (Editor)
|
||||
//#define HIE_C_ulEDT_BdV 0x00020000 // Bounding Volume object (Editor)
|
||||
//#define HIE_C_ulEDT_TestPoint 0x00040000 // TestPoint object (Editor)
|
||||
};
|
||||
|
||||
#define NUMBEROFNAMES (sizeof(stTypeNames)/sizeof(stTypeNames_))
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// implementation of the EDT_DialogSelectType class.
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
EDT_DialogSelectType::EDT_DialogSelectType (CPA_Interface *p_oInterface, CWnd* pParent)
|
||||
: CDialog(EDT_DialogSelectType::IDD)
|
||||
{
|
||||
m_p_oInterface = p_oInterface;
|
||||
//{{AFX_DATA_INIT(EDT_DialogSelectType)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
EDT_DialogSelectType::~EDT_DialogSelectType()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void EDT_DialogSelectType::Init(void)
|
||||
{
|
||||
POSITION pos;
|
||||
int i;
|
||||
for (i=0;i<NUMBEROFNAMES;i++)
|
||||
{
|
||||
if (stTypeNames[i].bActive)
|
||||
m_cTypes.AddString(stTypeNames[i].szTypeName);
|
||||
}
|
||||
|
||||
CPA_List<CPA_SuperObject>* poList = GetInterface()->GetObjectListByType (C_szSectorTypeName);
|
||||
CPA_SuperObject * p_sector;
|
||||
|
||||
// Sectors
|
||||
for (p_sector = poList -> GetHeadElement(pos); p_sector;
|
||||
p_sector = poList -> GetNextElement(pos) ) {
|
||||
m_cSectors.AddString (p_sector -> GetName());
|
||||
}
|
||||
|
||||
if (s_iDefSect >= m_cSectors.GetCount() )
|
||||
s_iDefSect = 0;
|
||||
if (s_iDefType >= m_cTypes.GetCount() )
|
||||
s_iDefType = 0;
|
||||
|
||||
m_cSectors.SetCurSel(s_iDefSect);
|
||||
m_cTypes.SetCurSel(s_iDefType);
|
||||
|
||||
}
|
||||
|
||||
void EDT_DialogSelectType::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(EDT_DialogSelectType)
|
||||
DDX_Control(pDX, EDT_IDC_SECTORLIST, m_cSectors);
|
||||
DDX_Control(pDX, EDT_IDC_TYPESLIST, m_cTypes);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
void EDT_DialogSelectType::OnOK (void)
|
||||
{
|
||||
// check sectors !
|
||||
if (m_cSectors.GetCount() == 0)
|
||||
{
|
||||
m_bWasOK = FALSE;
|
||||
CDialog::OnCancel();
|
||||
return;
|
||||
}
|
||||
|
||||
// for sector we need the string
|
||||
m_cSectors.GetText(m_cSectors.GetCurSel(),m_csSelSector);
|
||||
// combo m_cSectors.GetLBText(m_cSectors.GetCurSel(), m_csSelSector);
|
||||
|
||||
|
||||
// for Type we need the type
|
||||
CString csTypeSelected;
|
||||
int i;
|
||||
// combo m_cTypes.GetLBText(m_cTypes.GetCurSel(), typeSelected);
|
||||
m_cTypes.GetText(m_cTypes.GetCurSel(), csTypeSelected);
|
||||
for (i=0;i<NUMBEROFNAMES;i++)
|
||||
{
|
||||
if ((stTypeNames[i].bActive) && (strcmp(stTypeNames[i].szTypeName, csTypeSelected)==0))
|
||||
{
|
||||
m_ulSelType = stTypeNames[i].ulType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
s_iDefSect = m_cSectors.GetCurSel();
|
||||
s_iDefType = m_cTypes.GetCurSel();
|
||||
|
||||
m_bWasOK = TRUE;
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
BOOL EDT_DialogSelectType::OnInitDialog (void)
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
m_bWasOK = FALSE;
|
||||
Init();
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(EDT_DialogSelectType, CDialog)
|
||||
//{{AFX_MSG_MAP(EDT_DialogSelectType)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
//// End Silviu Simen september 1998 List of Objects in Sectors
|
||||
|
||||
#endif // ACTIVE_EDITOR
|
||||
|
||||
|
||||
//ENDROMTEAM StickObjects (Gabi Dumitrascu)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
241
Rayman_X/cpa/tempgrp/Edt/src/edtdupdt.cpp
Normal file
@@ -0,0 +1,241 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTdUpdt.cpp : Hierarchy update - Implementation file
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#ifdef ACTIVE_EDITOR
|
||||
#include "acp_base.h"
|
||||
|
||||
#include "EDTdUpdt.hpp"
|
||||
#include "EDTBase.Hpp"
|
||||
#include "EDTSObj.hpp"
|
||||
#include "EDTSpec.hpp"
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// EDT_DialogUpdate dialog
|
||||
//#################################################################################
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
EDT_DialogUpdate::EDT_DialogUpdate(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(EDT_DialogUpdate::IDD, &g_oBaseFrame)
|
||||
{
|
||||
//{{AFX_DATA_INIT(EDT_DialogUpdate)
|
||||
//}}AFX_DATA_INIT
|
||||
POS_fn_vSetIdentityMatrix(&m_stRefMatrix);
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogUpdate::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(EDT_DialogUpdate)
|
||||
DDX_Control(pDX, EDT_IDC_LISTREINSERT1, m_cListInsert1);
|
||||
DDX_Control(pDX, EDT_IDC_LISTDESTROY1, m_cListDestroy1);
|
||||
DDX_Control(pDX, EDT_IDC_LISTREINSERT, m_cListInsert);
|
||||
DDX_Control(pDX, EDT_IDC_LISTDESTROY, m_cListDestroy);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(EDT_DialogUpdate, CDialog)
|
||||
//{{AFX_MSG_MAP(EDT_DialogUpdate)
|
||||
ON_LBN_SELCHANGE(EDT_IDC_LISTDESTROY, OnSelchangeListDestroy)
|
||||
ON_LBN_SELCHANGE(EDT_IDC_LISTREINSERT, OnSelchangeListReinsert)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
//#################################################################################
|
||||
// EDT_DialogUpdate message handler
|
||||
//#################################################################################
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
CPA_Interface * EDT_DialogUpdate::GetInterface (void)
|
||||
{
|
||||
return m_pEditor->GetInterface();
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogUpdate::OnSelchangeListDestroy()
|
||||
{
|
||||
EDT_SuperObject *pObjectToInsert;
|
||||
POSITION pos;
|
||||
char szName[30];
|
||||
char szType[30];
|
||||
int iObjectToInsert = -1;
|
||||
|
||||
// get object to insert
|
||||
iObjectToInsert = m_cListDestroy.GetCurSel();
|
||||
if (iObjectToInsert != -1)
|
||||
pObjectToInsert = m_stListDestroy.FindElementFromIndex(iObjectToInsert);
|
||||
// reinsert object
|
||||
if (pObjectToInsert)
|
||||
{
|
||||
// update the lists
|
||||
pos = m_stListDestroy.Find(pObjectToInsert, NULL);
|
||||
if (pos)
|
||||
m_stListDestroy.RemoveAt(pos);
|
||||
m_stListInsert.AddTail(pObjectToInsert);
|
||||
// update the dialog
|
||||
m_cListDestroy.GetText(iObjectToInsert, szName);
|
||||
m_cListDestroy1.GetText(iObjectToInsert, szType);
|
||||
m_cListDestroy.DeleteString(iObjectToInsert);
|
||||
m_cListDestroy1.DeleteString(iObjectToInsert);
|
||||
m_cListInsert.AddString(szName);
|
||||
m_cListInsert1.AddString(szType);
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogUpdate::OnSelchangeListReinsert()
|
||||
{
|
||||
EDT_SuperObject *pObjectToDestroy;
|
||||
POSITION pos;
|
||||
char szName[30];
|
||||
char szType[30];
|
||||
int iObjectToDestroy = -1;
|
||||
|
||||
// get object to insert
|
||||
iObjectToDestroy = m_cListInsert.GetCurSel();
|
||||
if (iObjectToDestroy != -1)
|
||||
pObjectToDestroy = m_stListInsert.FindElementFromIndex(iObjectToDestroy);
|
||||
// destroy object
|
||||
if (pObjectToDestroy)
|
||||
{
|
||||
// update the lists
|
||||
pos = m_stListInsert.Find(pObjectToDestroy, NULL);
|
||||
if (pos)
|
||||
m_stListInsert.RemoveAt(pos);
|
||||
m_stListDestroy.AddTail(pObjectToDestroy);
|
||||
// update the dialog
|
||||
m_cListInsert.GetText(iObjectToDestroy, szName);
|
||||
m_cListInsert1.GetText(iObjectToDestroy, szType);
|
||||
m_cListInsert.DeleteString(iObjectToDestroy);
|
||||
m_cListInsert1.DeleteString(iObjectToDestroy);
|
||||
m_cListDestroy.AddString(szName);
|
||||
m_cListDestroy1.AddString(szType);
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogUpdate::OnOK()
|
||||
{
|
||||
EDT_SuperObject *pParent;
|
||||
EDT_SuperObject *pElem;
|
||||
POSITION pos;
|
||||
|
||||
// re-insert all the selected objects
|
||||
for (pElem = m_stListInsert.GetHeadElement(pos); pElem;
|
||||
pElem = m_stListInsert.GetNextElement(pos))
|
||||
{
|
||||
pParent = (EDT_SuperObject *) pElem->GetSuperObjectFather();
|
||||
if (!fn_bIsInHierarchy(pParent))
|
||||
pParent = m_pEditor->GetSpecificEditor()->GetDefaultParentForPaste(pElem);
|
||||
if (pParent)
|
||||
{
|
||||
pElem->SetList(NULL, FALSE);
|
||||
pElem->fn_vInsertUnderParent(pParent, NULL, TRUE);
|
||||
}
|
||||
else
|
||||
m_pEditor->fn_vDestroySuperObject(pElem, FALSE);
|
||||
}
|
||||
|
||||
// remove all the elements in the lists
|
||||
m_stListInsert.RemoveAll();
|
||||
|
||||
// destroy all removed elements
|
||||
while (m_stListDestroy.GetCount() > 0)
|
||||
{
|
||||
pElem = m_stListDestroy.RemoveTail();
|
||||
m_pEditor->fn_vDestroySuperObject(pElem, FALSE);
|
||||
}
|
||||
|
||||
// destroy the dialog
|
||||
EndDialog(0);
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
void EDT_DialogUpdate::fn_vInitDialog (EDT_HierarchyEditor *pEditor)
|
||||
{
|
||||
// init parent editor
|
||||
m_pEditor = pEditor;
|
||||
// this dialog is modal
|
||||
DoModal();
|
||||
}
|
||||
|
||||
/*----------------------------------------
|
||||
----------------------------------------*/
|
||||
BOOL EDT_DialogUpdate::OnInitDialog ()
|
||||
{
|
||||
CPA_SuperObject *pElem;
|
||||
POSITION pos;
|
||||
char szName[30];
|
||||
char szType[30];
|
||||
|
||||
// Create the dialog
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// init list destroy
|
||||
for (pElem = m_stListDestroy.GetHeadElement(pos); pElem; pElem = m_stListDestroy.GetNextElement(pos))
|
||||
{
|
||||
sprintf(szName, "%s", pElem->GetNameToDraw());
|
||||
sprintf(szType, " %1s-%s", pElem->GetRealTypeName(), pElem->GetModelName());
|
||||
m_cListDestroy.AddString(szName);
|
||||
m_cListDestroy1.AddString(szType);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Check if an object is still in the hierarchy
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
BOOL EDT_DialogUpdate::fn_bIsInHierarchy (EDT_SuperObject *pParent)
|
||||
{
|
||||
EDT_SuperObject *pElem;
|
||||
POSITION pos, pos1;
|
||||
|
||||
if (!pParent)
|
||||
return FALSE;
|
||||
|
||||
// check if pParent was destroyed
|
||||
pos1 = M_GetListAllObjects()->Find(pParent);
|
||||
if (pos1)
|
||||
{
|
||||
// check if pParent is reinserted
|
||||
for (pElem = m_stListInsert.GetHeadElement(pos); pElem;
|
||||
pElem = m_stListInsert.GetNextElement(pos))
|
||||
{
|
||||
if (pParent->fn_bIsUnderObject(pElem))
|
||||
return TRUE;
|
||||
}
|
||||
// pParent is destroyed
|
||||
return FALSE;
|
||||
}
|
||||
// pParent was not destroyed
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif // ACTIVE_EDITOR
|
67
Rayman_X/cpa/tempgrp/Edt/src/edtdvect.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTdVect.cpp : Vector Dialog - Implementation file
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Corneliu Babiuc
|
||||
*=======================================================================*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#ifdef ACTIVE_EDITOR
|
||||
#include "edtres.h"
|
||||
#include "edtdvect.hpp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// EDT_DialogVector dialog
|
||||
|
||||
|
||||
EDT_DialogVector::EDT_DialogVector(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(EDT_DialogVector::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(EDT_DialogVector)
|
||||
m_xComponentX = 0.0f;
|
||||
m_xComponentY = 0.0f;
|
||||
m_xComponentZ = 0.0f;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void EDT_DialogVector::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(EDT_DialogVector)
|
||||
DDX_Text(pDX, EDT_IDC_COMPONENTX, m_xComponentX);
|
||||
DDX_Text(pDX, EDT_IDC_COMPONENTY, m_xComponentY);
|
||||
DDX_Text(pDX, EDT_IDC_COMPONENTZ, m_xComponentZ);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(EDT_DialogVector, CDialog)
|
||||
//{{AFX_MSG_MAP(EDT_DialogVector)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// EDT_DialogVector message handlers
|
||||
|
||||
void EDT_DialogVector::OnOK()
|
||||
{
|
||||
// TODO: Add extra validation here
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void EDT_DialogVector::OnCancel()
|
||||
{
|
||||
// TODO: Add extra cleanup here
|
||||
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
|
||||
#endif // ACTIVE_EDITOR
|
2776
Rayman_X/cpa/tempgrp/Edt/src/edtmodif.cpp
Normal file
558
Rayman_X/cpa/tempgrp/Edt/src/edtparse.cpp
Normal file
@@ -0,0 +1,558 @@
|
||||
//ParseSection.cpp
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "edtparse.hpp"
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : CParseSection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CParseSection::CParseSection (CString csFinalMDFFileName/* = ""*/)
|
||||
{
|
||||
m_csFinalMDFFileName = csFinalMDFFileName;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : ParseFile
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::ParseFile (CString csInitialMDFFileName, CString csFinalMDFFileName/* = ""*/)
|
||||
{
|
||||
//the final MDF file name can be passed in constructor or here
|
||||
if (!csFinalMDFFileName.IsEmpty ())
|
||||
m_csFinalMDFFileName = csFinalMDFFileName;
|
||||
|
||||
CFileStatus status;
|
||||
|
||||
BOOL bInitialMDFFileExists = CFile::GetStatus (csInitialMDFFileName, status);
|
||||
|
||||
if (!bInitialMDFFileExists) //the file exists
|
||||
{
|
||||
AfxMessageBox ("Error, can't open the initial MDF file");
|
||||
return 0;
|
||||
}
|
||||
else //normal behavior
|
||||
{
|
||||
if (FillListOfInitialMDFSections (csInitialMDFFileName))
|
||||
{
|
||||
CreateTheFinalMDFFile ();
|
||||
//copy the unchanged sections
|
||||
while (!m_lstOfInitialUnchangeableMDFSections.IsEmpty ())
|
||||
{
|
||||
CString csSectionName = m_lstOfInitialUnchangeableMDFSections.RemoveHead ();
|
||||
CopySectionAsItIs (csInitialMDFFileName, csSectionName);
|
||||
}
|
||||
//copy the normal sections
|
||||
while (!m_lstOfInitialMDFSections.IsEmpty ())
|
||||
{
|
||||
CString csSectionName = m_lstOfInitialMDFSections.RemoveHead ();
|
||||
CopySectionWithAnalyze (csInitialMDFFileName, csSectionName);
|
||||
}
|
||||
}
|
||||
else
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : CopySection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::CopySection (CString csFileName, CString csSectionName, BOOL bCopyAsItIs/* = FALSE*/)
|
||||
{
|
||||
//if section is already included skip it
|
||||
if (IsSectionIncluded (csSectionName))
|
||||
return 1;
|
||||
|
||||
if (!IsFileNameAbsolute (csFileName))
|
||||
//the absolute path is computed using different roots
|
||||
//we assume here that the relative path fit only one root(we can't compute two or more valid paths
|
||||
//using the same relative path and different roots)
|
||||
csFileName = ComputeAbsoluteFileName (csFileName);
|
||||
|
||||
if (csFileName.IsEmpty ())
|
||||
return 0;
|
||||
|
||||
CStringList lstSection;
|
||||
|
||||
if (!ReadSection (csFileName, csSectionName, lstSection))
|
||||
return 0;
|
||||
|
||||
if (!bCopyAsItIs)
|
||||
AnalyseSection (csFileName, lstSection);
|
||||
|
||||
WriteSection (lstSection);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : ReadSection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::ReadSection (CString csFileName, CString csSectionName, CStringList &rSection)
|
||||
{
|
||||
ASSERT (!csFileName.IsEmpty ());
|
||||
UINT uOpenFlags = CFile::modeRead | CFile::typeText;
|
||||
CStdioFile file;
|
||||
|
||||
if (!file.Open (csFileName, uOpenFlags))
|
||||
return 0;
|
||||
|
||||
BOOL bReadOK = 0;
|
||||
//read every line and when you find the section copy it in the rSection
|
||||
CString csEntry;
|
||||
while (file.ReadString (csEntry)) //not eof
|
||||
{
|
||||
csEntry.TrimLeft ();
|
||||
csEntry.TrimRight ();
|
||||
if (0 < csEntry.GetLength ()) //not a blank line
|
||||
{
|
||||
//find a section
|
||||
BOOL bBeginOfSection = cBeginBracket == csEntry [0];
|
||||
if (bBeginOfSection)
|
||||
{
|
||||
int iOpenedBracketCount = 1;
|
||||
//remove the bracket
|
||||
CString csRedSectionName = csEntry.Mid (1);
|
||||
csRedSectionName = RemoveParameters (csRedSectionName);
|
||||
BOOL bSectionMatch = csRedSectionName == csSectionName;
|
||||
if (bSectionMatch)
|
||||
{
|
||||
ASSERT (rSection.IsEmpty ());
|
||||
rSection.AddTail (csEntry);
|
||||
}
|
||||
|
||||
//read the whole section
|
||||
do{
|
||||
file.ReadString (csEntry);
|
||||
if (bSectionMatch)
|
||||
rSection.AddTail (csEntry);
|
||||
|
||||
csEntry.TrimLeft ();
|
||||
csEntry.TrimRight ();
|
||||
if (csEntry.IsEmpty ())
|
||||
continue;
|
||||
|
||||
//end bracket
|
||||
if (cEndBracket == csEntry [0]) iOpenedBracketCount--;
|
||||
//begin bracket
|
||||
if (cBeginBracket == csEntry [0]) iOpenedBracketCount++;
|
||||
|
||||
}while (0 < iOpenedBracketCount);
|
||||
|
||||
if (bSectionMatch)
|
||||
{
|
||||
//store this as a treated section in order not to include this the second time
|
||||
m_lstOfIncludedExternalReferences.AddTail (csSectionName);
|
||||
bReadOK = 1;
|
||||
break; //no need to read more
|
||||
}
|
||||
}
|
||||
//else go to next line
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
file.Close ();
|
||||
if (!bReadOK)
|
||||
{
|
||||
CString csWarningMsg = "Can't find the section: " + csSectionName + " in the file: " + csFileName;
|
||||
AfxMessageBox (csWarningMsg);
|
||||
}
|
||||
return bReadOK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : AnalyseSection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::AnalyseSection (CString csFileName, CStringList &rSection)
|
||||
{
|
||||
ASSERT (!rSection.IsEmpty ());
|
||||
//look for external references
|
||||
POSITION pos = rSection.GetHeadPosition ();
|
||||
while (NULL != pos)
|
||||
{
|
||||
POSITION oldPos = pos;
|
||||
//check every entry(line) in the section
|
||||
CString csEntry = rSection.GetNext (pos);
|
||||
int iInx = csEntry.Find (cExternalReferencesIndicator);
|
||||
BOOL bExternalReferences = -1 != iInx;
|
||||
if (bExternalReferences) // external references
|
||||
{
|
||||
//assume there is only one referenced section in the entry
|
||||
ASSERT (0 < iInx); //always there is something at the left
|
||||
int iBeginStringInx = csEntry.Find (cStringDelimitator);
|
||||
ASSERT (-1 != iBeginStringInx);
|
||||
//copy the keyword
|
||||
CString csEntryStartPart = csEntry.Left (iBeginStringInx);//don't include the delimitator
|
||||
CString csTextToAnalyze = csEntry.Mid (iBeginStringInx);
|
||||
while (!csTextToAnalyze.IsEmpty ())
|
||||
{
|
||||
int iFirstDelimitInx = csTextToAnalyze.Find (cStringDelimitator);
|
||||
BOOL bStringLeftForAnalyze = -1 != iFirstDelimitInx;
|
||||
if (!bStringLeftForAnalyze)
|
||||
{
|
||||
csEntryStartPart += csTextToAnalyze;
|
||||
break; //that's it
|
||||
}
|
||||
|
||||
CString csLeftTrail = csTextToAnalyze.Left (iFirstDelimitInx + 1); //include the delimitator
|
||||
csTextToAnalyze = csTextToAnalyze.Mid (iFirstDelimitInx + 1);
|
||||
int iSubstringInx = csTextToAnalyze.Find (cStringDelimitator);
|
||||
ASSERT (-1 != iSubstringInx); //get the pair "
|
||||
CString csSubstring = csTextToAnalyze.Left (iSubstringInx); //don't include the delimitator
|
||||
//but keep count of it
|
||||
csTextToAnalyze = csTextToAnalyze.Mid (iSubstringInx + 1); //get the right part, that will be analyzed next time
|
||||
int iSplitInx = csSubstring.Find (cExternalReferencesIndicator);
|
||||
BOOL bExternalReferencesFound = -1 != iSplitInx;
|
||||
if (!bExternalReferencesFound)
|
||||
{
|
||||
csEntryStartPart += csLeftTrail + csSubstring + cStringDelimitator;
|
||||
continue;
|
||||
}
|
||||
//if ext reference found
|
||||
|
||||
CString csSectionsFileName = csSubstring.Left (iSplitInx);
|
||||
BOOL bReferenceInThisFile = cThisFileReference == csSectionsFileName;
|
||||
if (bReferenceInThisFile)
|
||||
csSectionsFileName = csFileName;
|
||||
|
||||
CString csSectionName = csSubstring.Mid (iSplitInx + 1);
|
||||
if (!IsSectionIncluded (csSectionName))
|
||||
CopySectionWithAnalyze (csSectionsFileName, csSectionName);
|
||||
|
||||
//recompute the entry and replace the file name by *
|
||||
CString csFullSectionName;
|
||||
if (bReferenceInThisFile)
|
||||
{
|
||||
csFullSectionName = csLeftTrail + csSubstring + cStringDelimitator;
|
||||
}
|
||||
else
|
||||
{
|
||||
csFullSectionName = csLeftTrail + cThisFileReference + cExternalReferencesIndicator
|
||||
+ csSectionName + cStringDelimitator;
|
||||
}
|
||||
|
||||
csEntryStartPart += csFullSectionName;
|
||||
}
|
||||
rSection.SetAt (oldPos, csEntryStartPart);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : WriteSection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::WriteSection (CStringList &rSection)
|
||||
{
|
||||
ASSERT (!rSection.IsEmpty ());
|
||||
ASSERT (!m_csFinalMDFFileName.IsEmpty ());
|
||||
CStdioFile file;
|
||||
//assume the file exists
|
||||
UINT uOpenFlags = CFile::modeWrite | CFile::typeText;
|
||||
if (!file.Open (m_csFinalMDFFileName, uOpenFlags))
|
||||
return 0;
|
||||
|
||||
file.SeekToEnd ();
|
||||
while (!rSection.IsEmpty ())
|
||||
{
|
||||
CString csEntry = rSection.RemoveHead ();
|
||||
if (!csEntry.IsEmpty())
|
||||
{
|
||||
BOOL bOrdinaryEntryInSection = cBeginBracket != csEntry [0] || cEndBracket != csEntry [0];
|
||||
if (bOrdinaryEntryInSection)
|
||||
csEntry = "\t" + csEntry + "\n";
|
||||
else //begin and end section
|
||||
csEntry = csEntry + "\n";
|
||||
|
||||
file.WriteString (csEntry);
|
||||
}
|
||||
}
|
||||
|
||||
file.WriteString ("\n\n");
|
||||
file.Close ();
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : FillListOfInitialMDFSections
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::FillListOfInitialMDFSections (CString csInitialMDFFileName)
|
||||
{
|
||||
ASSERT (!csInitialMDFFileName.IsEmpty ());
|
||||
UINT uOpenFlags = CFile::modeRead | CFile::typeText;
|
||||
CStdioFile file;
|
||||
|
||||
if (!file.Open (csInitialMDFFileName, uOpenFlags))
|
||||
return 0;
|
||||
|
||||
//empty the lists before a new fill
|
||||
m_lstOfInitialUnchangeableMDFSections.RemoveAll ();
|
||||
m_lstOfInitialMDFSections.RemoveAll ();
|
||||
//read every line and when you find the section copy it in the rSection
|
||||
CString csEntry;
|
||||
while (file.ReadString (csEntry)) //not eof
|
||||
{
|
||||
csEntry.TrimLeft ();
|
||||
if (0 < csEntry.GetLength ()) //not a blank line
|
||||
{
|
||||
//find a section
|
||||
BOOL bBeginOfSection = cBeginBracket == csEntry [0];
|
||||
if (bBeginOfSection)
|
||||
{
|
||||
int iOpenedBracketCount = 1;
|
||||
//remove the bracket
|
||||
CString csRedSectionName = csEntry.Mid (1);
|
||||
csRedSectionName.TrimLeft ();
|
||||
csRedSectionName.TrimRight ();
|
||||
//read the whole section
|
||||
do{
|
||||
file.ReadString (csEntry);
|
||||
csEntry.TrimLeft ();
|
||||
//end bracket
|
||||
if (cEndBracket == csEntry [0]) iOpenedBracketCount--;
|
||||
//begin bracket
|
||||
if (cBeginBracket == csEntry [0]) iOpenedBracketCount++;
|
||||
|
||||
}while (0 < iOpenedBracketCount);
|
||||
|
||||
//exceptions at the rule
|
||||
if (szEditModificationsKW == csRedSectionName)
|
||||
{
|
||||
m_lstOfInitialUnchangeableMDFSections.AddTail (csRedSectionName);
|
||||
continue;
|
||||
}
|
||||
|
||||
m_lstOfInitialMDFSections.AddTail (csRedSectionName);
|
||||
}
|
||||
//else ignore it
|
||||
|
||||
}
|
||||
//else go to next line
|
||||
}
|
||||
|
||||
|
||||
file.Close ();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : CreateTheFinalMDFFile
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::CreateTheFinalMDFFile ()
|
||||
{
|
||||
ASSERT (!m_csFinalMDFFileName.IsEmpty ());
|
||||
CStdioFile file;
|
||||
//assume the file exists
|
||||
UINT uOpenFlags = CFile::modeCreate | CFile::modeWrite | CFile::typeText;
|
||||
if (!file.Open (m_csFinalMDFFileName, uOpenFlags))
|
||||
return 0;
|
||||
|
||||
CString csMDFHeader (";MDF file\n\n");
|
||||
file.WriteString (csMDFHeader);
|
||||
file.Close ();
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : IsSectionIncluded
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::IsSectionIncluded (CString csSectionName)
|
||||
{
|
||||
POSITION pos = m_lstOfIncludedExternalReferences.GetHeadPosition ();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CString csExternSectionName = m_lstOfIncludedExternalReferences.GetNext (pos);
|
||||
if (csSectionName == csExternSectionName)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : ComputeAbsoluteFileName
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CString CParseSection::ComputeAbsoluteFileName (CString csFileName)
|
||||
{
|
||||
ASSERT (!IsFileNameAbsolute (csFileName));
|
||||
if (cBackslash == csFileName [0])
|
||||
csFileName = csFileName.Mid (1); //remove the useless backslash
|
||||
|
||||
//assume we can compute only one absolute path
|
||||
POSITION pos = m_lstOfRoots.GetHeadPosition ();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CString csRoot = m_lstOfRoots.GetNext (pos);
|
||||
//assume the root ends with a backslash
|
||||
CString csFilePath = csRoot + csFileName;
|
||||
CFileStatus status;
|
||||
if (CFile::GetStatus (csFilePath, status)) //verify if the file exists
|
||||
return csFilePath;
|
||||
}
|
||||
|
||||
ASSERT (FALSE);
|
||||
return "";
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : IsFileNameAbsolute
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::IsFileNameAbsolute (CString csFileName)
|
||||
{
|
||||
csFileName.TrimLeft (); //make sure there are no pending blanks
|
||||
if (':' == csFileName [1]) //the path contains a drive
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
CFileStatus status;
|
||||
ASSERT (CFile::GetStatus (csFileName, status)); //the file exists
|
||||
#endif //_DEBUG
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : RemoveParameters
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CString CParseSection::RemoveParameters (CString csRedSectionName)
|
||||
{
|
||||
csRedSectionName.TrimLeft ();
|
||||
csRedSectionName.TrimRight ();
|
||||
int iInx = csRedSectionName.Find (cParameterBeginIndicator);
|
||||
BOOL bHasParameters = -1 != iInx;
|
||||
if (bHasParameters)
|
||||
csRedSectionName = csRedSectionName.Left (iInx);
|
||||
|
||||
return csRedSectionName;
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : AddRoot
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void CParseSection::AddRoot (CString csRoot)
|
||||
{
|
||||
csRoot.TrimRight ();
|
||||
//the roots have to end with a backslash
|
||||
if (cBackslash != csRoot [csRoot.GetLength () - 1])
|
||||
csRoot += cBackslash;
|
||||
|
||||
m_lstOfRoots.AddTail (csRoot);
|
||||
}
|
||||
|
||||
|
177
Rayman_X/cpa/tempgrp/Edt/src/edtrot.cpp
Normal file
@@ -0,0 +1,177 @@
|
||||
//ROMTEAM StickObjects (Nicolae Suparatu 10/02/98)
|
||||
|
||||
// Get the transform parameters (rotation + translation) in order to move one
|
||||
// triangle over another one, if they are congruent
|
||||
// Author: Nicolae Suparatu
|
||||
|
||||
#include <math.h>
|
||||
#include "stdafx.h"
|
||||
#include "edtrot.hpp"
|
||||
|
||||
|
||||
|
||||
//************************************************************************************
|
||||
float sqr(float f){ return f*f;}
|
||||
|
||||
|
||||
// Initialize a Matrix
|
||||
static void InitMatrix(Matrix &m)
|
||||
{
|
||||
for(int i=0; i<3; i++)
|
||||
for(int j=0; j<3; j++) m[i][j] = i == j;
|
||||
}
|
||||
|
||||
|
||||
// Rotate the vector v over the X axis
|
||||
static void GetXAlignMatrix(Vector &v, Matrix &m)
|
||||
{
|
||||
float b = (float)sqrt(v[0]*v[0] + v[1]*v[1]);
|
||||
float a = (float)sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
|
||||
if(a < eps)
|
||||
{
|
||||
InitMatrix(m);
|
||||
return;
|
||||
}
|
||||
m[0][0] = v[0]/a;
|
||||
m[0][1] = v[1]/a;
|
||||
m[0][2] = v[2]/a;
|
||||
m[1][0] = b > eps ? -v[1]/b : 0;
|
||||
m[1][1] = b > eps ? v[0]/b : 1;
|
||||
m[1][2] = 0;
|
||||
m[2][0] = -m[0][2]*m[1][1];
|
||||
m[2][1] = m[0][2]*m[1][0];
|
||||
m[2][2] = b/a;
|
||||
}
|
||||
|
||||
|
||||
// Rotate v2 over v1
|
||||
static void GetXRotateMatrix(Vector &v1, Vector &v2, Matrix &m)
|
||||
{
|
||||
InitMatrix(m);
|
||||
float d = v1[1]*v1[1] + v1[2]*v1[2];
|
||||
if(d > eps)
|
||||
{
|
||||
m[1][1] = (v1[1]*v2[1] + v1[2]*v2[2])/d;
|
||||
m[1][2] = (v1[1]*v2[2] - v1[2]*v2[1])/d;
|
||||
m[2][1] = -m[1][2];
|
||||
m[2][2] = m[1][1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Matrix with vector product
|
||||
static void VProd(Matrix &m, Vector &v, Vector &dst)
|
||||
{
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
dst[i] = 0;
|
||||
for(int j=0; j<3; j++) dst[i] += m[i][j]*v[j];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Matrix with Matrix product
|
||||
static void MProd(Matrix &m1, Matrix &m2, Matrix &dst)
|
||||
{
|
||||
for(int i=0; i<3; i++)
|
||||
for(int j=0; j<3; j++)
|
||||
{
|
||||
dst[i][j] = 0;
|
||||
for(int k=0; k<3; k++) dst[i][j] += m1[i][k]*m2[k][j];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Transpose Matrix with Matrix product
|
||||
static void MTProd(Matrix &m1, Matrix &m2, Matrix &dst)
|
||||
{
|
||||
for(int i=0; i<3; i++)
|
||||
for(int j=0; j<3; j++)
|
||||
{
|
||||
dst[i][j] = 0;
|
||||
for(int k=0; k<3; k++) dst[i][j] += m1[k][i]*m2[k][j];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add vectors
|
||||
void AddVector(Vector &dst, Vector &src)
|
||||
{
|
||||
for(int i=0; i<3; i++) dst[i] += src[i];
|
||||
}
|
||||
|
||||
|
||||
// Substract vectors
|
||||
void SubstractVector(Vector &dst, Vector &src)
|
||||
{
|
||||
for(int i=0; i<3; i++) dst[i] -= src[i];
|
||||
}
|
||||
|
||||
|
||||
static float Distance(Vector &v1, Vector &v2)
|
||||
{
|
||||
return sqr(v1[0]-v2[0]) + sqr(v1[1] - v2[1]) + sqr(v1[2] - v2[2]);
|
||||
}
|
||||
|
||||
// dst = destination triangle (on lines)
|
||||
// src = source triangle (on lines)
|
||||
// r = resulting rotation matrix
|
||||
// t = resulting translation matrix
|
||||
int GetTransform(Matrix &dst, Matrix &src, Matrix &r, Vector &t)
|
||||
{
|
||||
Vector v1;
|
||||
Matrix R1, R2, R3;
|
||||
|
||||
// congruence test
|
||||
if(fabs(Distance(dst[0], dst[1]) - Distance(src[0], src[1])) > eps ||
|
||||
fabs(Distance(dst[0], dst[2]) - Distance(src[0], src[2])) > eps ||
|
||||
fabs(Distance(dst[1], dst[2]) - Distance(src[1], src[2])) > eps) return 0;
|
||||
|
||||
// Origin translation
|
||||
SubstractVector(src[1], src[0]);
|
||||
SubstractVector(dst[1], dst[0]);
|
||||
SubstractVector(src[2], src[0]);
|
||||
SubstractVector(dst[2], dst[0]);
|
||||
|
||||
// Rotation
|
||||
GetXAlignMatrix(dst[1], R1);
|
||||
VProd(R1, src[1], v1);
|
||||
GetXAlignMatrix(v1, r);
|
||||
MProd(r, R1, R2);
|
||||
VProd(R1, dst[2], v1);
|
||||
VProd(R2, src[2], t);
|
||||
GetXRotateMatrix(v1, t, r);
|
||||
MProd(r, R2, R3);
|
||||
MTProd(R1, R3, r);
|
||||
|
||||
// Retranslation
|
||||
VProd(r, src[0], v1);
|
||||
CopyMemory(t, dst[0], sizeof(t));
|
||||
SubstractVector(t, v1);
|
||||
|
||||
AddVector(src[1], src[0]);
|
||||
AddVector(dst[1], dst[0]);
|
||||
AddVector(src[2], src[0]);
|
||||
AddVector(dst[2], dst[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void Convert(Matrix &r, Vector &t, Matrix &mo, Vector &vo)
|
||||
{
|
||||
Matrix mtmp;
|
||||
Vector vtmp;
|
||||
Matrix aaa;
|
||||
|
||||
InitMatrix(aaa);
|
||||
MTProd(r, aaa, mtmp);
|
||||
MProd(mo, mtmp, aaa);
|
||||
CopyMemory(mtmp, aaa, sizeof(Matrix));
|
||||
CopyMemory(mo, mtmp, sizeof(Matrix));
|
||||
VProd(r, vo, vtmp);
|
||||
CopyMemory(vo, vtmp, sizeof(Vector));
|
||||
AddVector(vo, t);
|
||||
}
|
||||
|
||||
//ENDROMTEAM StickObjects (Nicolae Suparatu)
|
||||
|
1344
Rayman_X/cpa/tempgrp/Edt/src/edtsobj.cpp
Normal file
639
Rayman_X/cpa/tempgrp/Edt/src/edtspec.cpp
Normal file
@@ -0,0 +1,639 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTSpec.cpp : EDT_SpecificEditor : Implementation file.
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "itf/customid.h"
|
||||
#ifdef ACTIVE_EDITOR
|
||||
#include "acp_base.h"
|
||||
|
||||
#include "geo.h"
|
||||
#include "gli.h"
|
||||
#include "col.h"
|
||||
#define HieFriend
|
||||
#include "spo.h"
|
||||
#include "lst.hpp"
|
||||
#undef HieFriend
|
||||
|
||||
#include "IncMEC.h"
|
||||
// Shaitan Clean Env {
|
||||
//#include "ENV.h"
|
||||
//End Shaitan Clean Env }
|
||||
#include "snd.h"
|
||||
#include "incSCT.h"
|
||||
|
||||
#include "ITF.h"
|
||||
|
||||
#include "EDTSpec.hpp"
|
||||
#include "EDTBase.hpp"
|
||||
#include "EDTSObj.hpp"
|
||||
|
||||
#include <direct.h>
|
||||
|
||||
#define C_lNbSpecificEntries 0
|
||||
|
||||
#define M_GetSpecificInterface() (GetEditor()->GetInterface()->GetSpecificInterface())
|
||||
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
#include "EDTModif.hpp"
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
//#################################################################################
|
||||
// CONSTRUCT
|
||||
//#################################################################################
|
||||
EDT_SpecificEditor::EDT_SpecificEditor (EDT_HierarchyEditor *pEditor)
|
||||
{
|
||||
m_bIsLoadingWorld = FALSE;
|
||||
m_pEditor = pEditor;
|
||||
}
|
||||
|
||||
EDT_SpecificEditor::~EDT_SpecificEditor (void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//#################################################################################
|
||||
// INITS
|
||||
//#################################################################################
|
||||
|
||||
void EDT_SpecificEditor::fn_vSpecificInit (void)
|
||||
{
|
||||
// init parameters
|
||||
m_bIsLoadingWorld = FALSE;
|
||||
}
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// SUBMENU
|
||||
//#################################################################################
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Fill Submenu with specific commands
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
long EDT_SpecificEditor::fn_lDefineSubmenu (EDT_SubMenu *p_oSubMenu, UINT uiStartID)
|
||||
{
|
||||
return C_lNbSpecificEntries;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: answer to submenu specific commands
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
void EDT_SpecificEditor::fn_vOnSubmenuCommand (UINT uiCmdMsg)
|
||||
{
|
||||
/*
|
||||
switch (uiCmdMsg)
|
||||
{
|
||||
case C_ui_DisplayWorldAction:
|
||||
SetDisplayMode(E_dm_DrawWorld);
|
||||
break;
|
||||
case C_ui_DisplaySectorAction:
|
||||
SetDisplayMode(E_dm_DrawOnlyCurrentSector);
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// SUPER OBJECT TYPE AND LEVEL
|
||||
//#################################################################################
|
||||
/*===========================================================================
|
||||
* Description: check if new type is valid
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
BOOL EDT_SpecificEditor::fn_bCanChangeTypeSO (EDT_SuperObject *pEdObj, tdeTypeSO eType)
|
||||
{
|
||||
CPA_SuperObject *pParent;
|
||||
|
||||
if (!M_GetSpecificInterface()->fn_bHasValidWorld(!m_bIsLoadingWorld))
|
||||
return TRUE;
|
||||
|
||||
// check parent
|
||||
pParent = pEdObj->GetSuperObjectFather();
|
||||
if (!pParent)
|
||||
return TRUE;
|
||||
|
||||
// protected objects are free
|
||||
if ((eType == C_Protected)&&(pEdObj->GetSuperObjectOwner()))
|
||||
return TRUE;
|
||||
// else type must be coherent with hierarchy
|
||||
return (pParent->GetTypeSO() == eType);
|
||||
}
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// DEFAULT PARENT
|
||||
//#################################################################################
|
||||
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
/*===========================================================================
|
||||
* Description: find parent from pos
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
/*
|
||||
EDT_SuperObject * EDT_SpecificEditor::GetDefaultParentFromPos (tdstPosition *p_stPosition, tdeTypeSO eTypeInsert)
|
||||
{
|
||||
// invalid world => no default parent
|
||||
return (EDT_SuperObject *) M_GetSpecificInterface()->GetDefaultParentFromPos(p_stPosition, eTypeInsert);
|
||||
}
|
||||
*/
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
|
||||
/*===========================================================================
|
||||
* Description: get parent for copy / paste.
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
EDT_SuperObject * EDT_SpecificEditor::GetDefaultParentForPaste (EDT_SuperObject *pEdObj)
|
||||
{
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
// CPA_SuperObject *pSector;
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
|
||||
// invalid world => no default parent
|
||||
if (!M_GetSpecificInterface()->fn_bHasValidWorld(!m_bIsLoadingWorld))
|
||||
return NULL;
|
||||
|
||||
// protected objects have no default parent
|
||||
if (pEdObj->GetTypeSO() == C_Protected)
|
||||
return NULL;
|
||||
|
||||
// dynamic objects => dynamic root
|
||||
if (pEdObj->GetTypeSO() == C_Dynamic)
|
||||
return (EDT_SuperObject *) M_GetSpecificInterface()->GetDynamicRoot();
|
||||
|
||||
// static object => current sector
|
||||
if (pEdObj->GetTypeSO() == C_Static)
|
||||
{
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
return (EDT_SuperObject *) M_GetSpecificInterface()->GetSuperObjectCurrentSector(pEdObj);
|
||||
// pSector = M_GetSpecificInterface()->GetSuperObjectCurrentSector(pEdObj);
|
||||
// if (pSector)
|
||||
// return (EDT_SuperObject *) pSector->GetSuperObjectFirstChild();
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
}
|
||||
|
||||
// others => invalid
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// PERMISSIONS
|
||||
//#################################################################################
|
||||
|
||||
/*==========================================================================
|
||||
* Description: check if parent is available
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
BOOL EDT_SpecificEditor::fn_bCanBeParent (EDT_SuperObject *pNewParent, EDT_SuperObject *pChild)
|
||||
{
|
||||
return fn_bCheckParentAndType(pChild, pNewParent);
|
||||
}
|
||||
|
||||
/*==========================================================================
|
||||
==========================================================================*/
|
||||
BOOL EDT_SpecificEditor::fn_bCanBeParent (EDT_SuperObject *pNewParent, CPA_List<CPA_SuperObject> *pListOfChilds)
|
||||
{
|
||||
CPA_SuperObject *pElem;
|
||||
POSITION pos;
|
||||
|
||||
// check all element in the list
|
||||
for (pElem = pListOfChilds->GetHeadElement(pos); pElem;
|
||||
pElem = pListOfChilds->GetNextElement(pos))
|
||||
{
|
||||
if (!fn_bCheckParentAndType((EDT_SuperObject *) pElem, pNewParent))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// no objection
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*==========================================================================
|
||||
* Description: check if move is available
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
long EDT_SpecificEditor::fn_lCanMoveObjects (CPA_List<CPA_SuperObject> *pObjectsToMove)
|
||||
{
|
||||
CPA_SuperObject *pElem;
|
||||
POSITION pos;
|
||||
long lNbBreak = 0;
|
||||
|
||||
// invalid world => only protected are free
|
||||
if (!M_GetSpecificInterface()->fn_bHasValidWorld(!m_bIsLoadingWorld))
|
||||
{
|
||||
// only protected objects are free
|
||||
for (pElem = pObjectsToMove->GetHeadElement(pos); pElem;
|
||||
pElem = pObjectsToMove->GetNextElement(pos))
|
||||
{
|
||||
if (pElem->GetTypeSO() != C_Protected)
|
||||
return -1;
|
||||
}
|
||||
// no condition
|
||||
return 0;
|
||||
}
|
||||
// reinit list modifs
|
||||
while (m_pEditor->GetListOfModifParent()->GetCount())
|
||||
delete (m_pEditor->GetListOfModifParent()->RemoveTail());
|
||||
// check all moved objects
|
||||
for (pElem = pObjectsToMove->GetHeadElement(pos); pElem;
|
||||
pElem = pObjectsToMove->GetNextElement(pos))
|
||||
{
|
||||
if (!fn_bCheckSectorMove((EDT_SuperObject *) pElem, &lNbBreak, TRUE))
|
||||
return -1;
|
||||
}
|
||||
// number of broken links
|
||||
return lNbBreak;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// SECTORS
|
||||
//#################################################################################
|
||||
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
/*===========================================================================
|
||||
* Description: init protection for sectors
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
/*
|
||||
void EDT_SpecificEditor::fn_vInitSectorsParameters (EDT_SuperObject *pSRoot)
|
||||
{
|
||||
CPA_SuperObject *pSector, *pChild;
|
||||
|
||||
// check all sectors
|
||||
for (pSector = pSRoot->GetSuperObjectFirstChild(); pSector;
|
||||
pSector = pSRoot->GetSuperObjectNextChild(pSector))
|
||||
{
|
||||
// first levels of sectors => protected childs
|
||||
for (pChild = pSector->GetSuperObjectFirstChild(); pChild;
|
||||
pChild = pSector->GetSuperObjectNextChild(pChild))
|
||||
{
|
||||
pChild->SetEditProtected(TRUE);
|
||||
pChild->SetSuperObjectOwner(pSector);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
|
||||
//#################################################################################
|
||||
// PERMISSIONS
|
||||
//#################################################################################
|
||||
|
||||
/*==========================================================================
|
||||
* Description: check if move is available (recursive function)
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
BOOL EDT_SpecificEditor::fn_bCheckSectorMove (EDT_SuperObject *pEdObj, long *p_lNbBreak, BOOL bSelected)
|
||||
{
|
||||
CPA_SuperObject *pSector;
|
||||
CPA_SuperObject *pParent;
|
||||
CPA_SuperObject *pChild;
|
||||
|
||||
// object must stay in a sector
|
||||
pSector = M_GetSpecificInterface()->GetSuperObjectCurrentSector(pEdObj);
|
||||
if ((pEdObj->GetTypeSO() != C_Protected)&&(!pSector))
|
||||
return FALSE;
|
||||
|
||||
// check for Univers Sector
|
||||
if (pSector == M_GetSpecificInterface()->GetStaticRoot()->GetSuperObjectLastChild())
|
||||
{
|
||||
CString csName = pEdObj->GetObject() ? pEdObj->GetObject()->GetName() : pEdObj->GetName();
|
||||
if (MessageBox( NULL,
|
||||
" Object " + csName + " is in Univers sector\n"
|
||||
" Are you sure you want to move it here ?\n",
|
||||
"Object In Univers Sector",
|
||||
MB_YESNO | MB_ICONEXCLAMATION | MB_TASKMODAL | MB_TOPMOST)
|
||||
== IDNO)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// only static objects require special handling
|
||||
if (pEdObj->GetTypeSO() == C_Static)
|
||||
{
|
||||
pParent = pEdObj->GetSuperObjectFather();
|
||||
// if sector is invalid, create modif parent
|
||||
if (pSector != M_GetSpecificInterface()->GetSuperObjectCurrentSector(pParent))
|
||||
{
|
||||
m_pEditor->GetListOfModifParent()->AddTail( new EDT_SaveParents
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
// (pEdObj, (EDT_SuperObject *) pParent, (EDT_SuperObject *) pSector->GetSuperObjectFirstChild()));
|
||||
(pEdObj, (EDT_SuperObject *) pParent, (EDT_SuperObject *) pSector));
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
if (!bSelected)
|
||||
*p_lNbBreak++;
|
||||
}
|
||||
}
|
||||
// next level of hierarchy
|
||||
for (pChild = pEdObj->GetSuperObjectFirstChild(); pChild;
|
||||
pChild = pEdObj->GetSuperObjectNextChild(pChild))
|
||||
{
|
||||
if (!fn_bCheckSectorMove((EDT_SuperObject *) pChild, p_lNbBreak, FALSE))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// no objection
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: check type
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
BOOL EDT_SpecificEditor::fn_bCheckParentAndType (EDT_SuperObject *pEdObj, EDT_SuperObject *pParent)
|
||||
{
|
||||
// invalid world => only protected are free
|
||||
if (!M_GetSpecificInterface()->fn_bHasValidWorld(!m_bIsLoadingWorld))
|
||||
return ((pParent)&&(pEdObj->GetTypeSO() == C_Protected));
|
||||
|
||||
// root or NULL are not available
|
||||
if ((!pParent)||(pParent == m_pEditor->GetInterface()->GetCurrentWorld()->GetRoot()))
|
||||
return FALSE;
|
||||
|
||||
switch (pEdObj->GetTypeSO())
|
||||
{
|
||||
// protected objects are free, except for roots and sectors
|
||||
case C_Protected:
|
||||
if ((pParent == M_GetSpecificInterface()->GetDynamicRoot())||(pParent == M_GetSpecificInterface()->GetStaticRoot()))
|
||||
return FALSE;
|
||||
//ANNECY Shaitan NewBorder 13/02/98
|
||||
// if (pParent->GetRealTypeName() == C_szSectorTypeName)
|
||||
// return FALSE;
|
||||
//ENDANNECY Shaitan NewBorder
|
||||
return TRUE;
|
||||
|
||||
// dynamic => only dynamic root
|
||||
case C_Dynamic:
|
||||
return (pParent == M_GetSpecificInterface()->GetDynamicRoot());
|
||||
|
||||
// static => same sector
|
||||
case C_Static:
|
||||
// parent must be static
|
||||
if (pParent->GetTypeSO() != C_Static)
|
||||
return FALSE;
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
// root is not a valid parent
|
||||
if (pParent == M_GetSpecificInterface()->GetStaticRoot())
|
||||
return FALSE;
|
||||
// // root or sector itself are not valid parent
|
||||
// if ((pParent == M_GetSpecificInterface()->GetStaticRoot())||(pParent->GetRealTypeName() == C_szSectorTypeName))
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
// child must be in the same sector
|
||||
if (M_GetSpecificInterface()->GetSuperObjectCurrentSector(pEdObj) != M_GetSpecificInterface()->GetSuperObjectCurrentSector(pParent))
|
||||
return FALSE;
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
// check super-object status
|
||||
if (!fn_bCheckSaveStatus(pEdObj->GetSaveStatus(), pParent))
|
||||
return FALSE;
|
||||
// // Designer mode => under sector first child
|
||||
// if (M_GetSpecificInterface()->GetUserStatus() == E_us_StatusDesign)
|
||||
// return (GetDefaultParentForPaste(pEdObj) == pParent);
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
// no objection
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
/*===========================================================================
|
||||
* Description: check status
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
BOOL EDT_SpecificEditor::fn_bCheckSaveStatus (tdeSaveStatus eStatus, EDT_SuperObject *pParent)
|
||||
{
|
||||
tdeSaveStatus eParentStatus = pParent->GetSaveStatus();
|
||||
|
||||
|
||||
switch (eStatus)
|
||||
{
|
||||
case E_ss_Responsible:
|
||||
case E_ss_Modify:
|
||||
return (eParentStatus != E_ss_NoSave);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
|
||||
//#################################################################################
|
||||
// LOAD
|
||||
//#################################################################################
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Load editor infos corresponding to engine current map
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
EDT_SuperObject * EDT_SpecificEditor::fn_pInitEditorMap (HIE_tdxHandleToSuperObject hRoot)
|
||||
{
|
||||
HIE_tdxHandleToSuperObject hDRoot, hSRoot, hDInactiveRoot;
|
||||
CPA_SuperObject *pRoot, *pDRoot, *pDInactiveRoot, *pSRoot;
|
||||
CString csSectionName;
|
||||
char szFileName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szActionName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
int iPos;
|
||||
|
||||
// set load mode
|
||||
m_bIsLoadingWorld = TRUE;
|
||||
|
||||
// get roots
|
||||
hDRoot = HIE_fn_hGetSuperObjectFirstChild(hRoot);
|
||||
hDInactiveRoot = HIE_fn_hGetSuperObjectNextBrother(hDRoot);
|
||||
hSRoot = HIE_fn_hGetSuperObjectLastChild(hRoot);
|
||||
|
||||
// init static file name
|
||||
csSectionName = m_pEditor->GetEngineSectionName(hSRoot);
|
||||
SCR_fn_v_RdL0_SplitSectionName((char*)(LPCSTR) csSectionName, szFileName, szActionName, szName);
|
||||
m_csStaticFileName = szFileName;
|
||||
// init dynamic file name
|
||||
iPos = m_csStaticFileName.ReverseFind('.');
|
||||
m_csDynamicFileName = m_csStaticFileName.Left(iPos) + ".lvl";
|
||||
|
||||
// create root
|
||||
pRoot = m_pEditor->GetNewSuperObject(hRoot, E_ss_NoSave, C_NoType, "SO_Root", "");
|
||||
pRoot->SetEditProtected(TRUE);
|
||||
// create Dynamic Root
|
||||
pDRoot = m_pEditor->GetNewSuperObject(hDRoot, E_ss_NoSave, C_Dynamic, "SO_DynamicRoot", "");
|
||||
pDRoot->SetEditProtected(TRUE);
|
||||
pRoot->AddANewChild(pDRoot, FALSE);
|
||||
// create Inactivate Dynamic Root
|
||||
pDInactiveRoot = m_pEditor->GetNewSuperObject(hDInactiveRoot, E_ss_NoSave, C_Dynamic, "SO_InactiveDynamicRoot", "");
|
||||
pDInactiveRoot->SetEditProtected(TRUE);
|
||||
pRoot->AddANewChild(pDInactiveRoot, FALSE);
|
||||
// create Static Root
|
||||
pSRoot = m_pEditor->GetNewSuperObject(hSRoot, E_ss_NoSave, C_Static, "SO_StaticRoot", m_csStaticFileName);
|
||||
pSRoot->SetEditProtected(TRUE);
|
||||
pRoot->AddANewChild(pSRoot, FALSE);
|
||||
|
||||
// build dynamic hierarchy
|
||||
g_oBaseFrame.mfnv_UpdateTitle("Loading Editor Dynamic Hierarchy");
|
||||
// M_GetMainWnd()->UpdateStatus("Loading Editor Dynamic Hierarchy", C_STATUSPANE_INFOS, C_STATUS_NORMAL);
|
||||
m_pEditor->fn_vBuildEditorHierarchy(pDRoot, hDRoot);
|
||||
// build static hierarchy
|
||||
g_oBaseFrame.mfnv_UpdateTitle("Loading Editor Static Hierarchy");
|
||||
// M_GetMainWnd()->UpdateStatus("Loading Editor Static Hierarchy", C_STATUSPANE_INFOS, C_STATUS_NORMAL);
|
||||
m_pEditor->fn_vBuildEditorHierarchy(pSRoot, hSRoot);
|
||||
//ANNECY Shaitan EmptySectors 25/02/98
|
||||
// // update for sectors
|
||||
// M_GetMainWnd()->UpdateStatus("Initializing Sectors", C_STATUSPANE_INFOS, C_STATUS_NORMAL);
|
||||
// fn_vInitSectorsParameters((EDT_SuperObject *) pSRoot);
|
||||
//ENDANNECY Shaitan EmptySectors
|
||||
|
||||
// load all modifs
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
csSectionName = m_pEditor->GetSOReferencePath() + GetModifSectionName();
|
||||
if (SCR_fn_c_RdL0_IsSectionExists((char *)(LPCTSTR) csSectionName))
|
||||
{
|
||||
g_oBaseFrame.mfnv_UpdateTitle("Loading temporary modifications");
|
||||
//M_GetMainWnd()->UpdateStatus("Loading temporary modifications", C_STATUSPANE_INFOS, C_STATUS_NORMAL);
|
||||
SCR_M_RdL0_SetContextLong(1, 0, (long) m_pEditor);
|
||||
SCR_fnp_st_RdL0_AnalyseSection((char *)(LPCTSTR) csSectionName, SCR_CDF_uw_Anl_Normal);
|
||||
}
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
// new editor root
|
||||
// g_oBaseFrame.mfnv_UpdateTitle("Editor Hierarchy Load >> 100%");
|
||||
// M_GetMainWnd()->UpdateStatus("Editor Hierarchy Load >> 100%", C_STATUSPANE_INFOS, C_STATUS_NORMAL);
|
||||
m_bIsLoadingWorld = FALSE;
|
||||
return (EDT_SuperObject *) pRoot;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: Get modifications section name
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
CString EDT_SpecificEditor::GetModifSectionName (void)
|
||||
{
|
||||
CString csSectionName;
|
||||
char szModifName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
CString csFileName;
|
||||
int iPos = m_csStaticFileName.ReverseFind ('.');
|
||||
ASSERT (-1 != iPos);
|
||||
csFileName = m_csStaticFileName.Left (iPos) + szModifExt;
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
SCR_fn_v_RdL0_ComputeSectionName(szModifName, (char*)(LPCSTR)csFileName, "Edit-Modifications", NULL);
|
||||
csSectionName = szModifName;
|
||||
|
||||
return csSectionName;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: init parameters for load
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
void EDT_SpecificEditor::fn_vInitTypeSO (EDT_SuperObject *pEdObj, EDT_SuperObject *pParent)
|
||||
{
|
||||
// init type from hierarchy position
|
||||
if (pEdObj->GetTypeSO() == C_NoType)
|
||||
{
|
||||
if (pEdObj->GetSuperObjectOwner())
|
||||
pEdObj->SetTypeSO(C_Protected);
|
||||
else
|
||||
pEdObj->SetTypeSO(pParent->GetTypeSO());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// SUPER OBJECT TYPE
|
||||
//#################################################################################
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: check if object's type correspond to user status
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
BOOL EDT_SpecificEditor::fn_bIsValidType (tdeTypeSO eTypeSO)
|
||||
{
|
||||
// invalid world => no condition
|
||||
if (!M_GetSpecificInterface()->fn_bHasValidWorld(!m_bIsLoadingWorld))
|
||||
return TRUE;
|
||||
|
||||
//chbani :desactive le test de USER Statut
|
||||
return TRUE;
|
||||
|
||||
switch (eTypeSO)
|
||||
{
|
||||
// static objects => always temporary modifs
|
||||
case C_Static:
|
||||
return (M_GetSpecificInterface()->GetUserStatus() != E_us_StatusDesign);
|
||||
// dynamic objects => temporary for graphist
|
||||
case C_Dynamic:
|
||||
return (M_GetSpecificInterface()->GetUserStatus() != E_us_StatusGraphic);
|
||||
// protected objets => always free
|
||||
case C_Protected:
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // ACTIVE_EDITOR
|
665
Rayman_X/cpa/tempgrp/Edt/src/edttemp.cpp
Normal file
@@ -0,0 +1,665 @@
|
||||
/*=========================================================================
|
||||
*
|
||||
* EDTTemp.cpp : List Of Temporary Modifs : Implementation file.
|
||||
*
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date
|
||||
* Revision date
|
||||
*
|
||||
* Shaitan
|
||||
*=======================================================================*/
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "itf/customid.h"
|
||||
#ifdef ACTIVE_EDITOR
|
||||
#include "acp_base.h"
|
||||
|
||||
#include "EDTBase.hpp"
|
||||
#include "EDTSObj.hpp"
|
||||
#include "EDTTemp.hpp"
|
||||
|
||||
#include "DPT.h"
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
#include "EDTModif.hpp"
|
||||
#include "OIT/Edit_IPO.hpp"
|
||||
#define OPD_GetFullGeomSectionName 999
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
inline POS_tdxHandleToPosition M_Temp_AllocMatrix()
|
||||
{
|
||||
POS_tdxHandleToPosition hPos = (POS_tdxHandleToPosition) malloc (sizeof (POS_tdstCompletePosition) );
|
||||
POS_fn_vSetIdentityMatrix(hPos);
|
||||
|
||||
return hPos;
|
||||
}
|
||||
//#################################################################################
|
||||
// EDT_TemporarySO
|
||||
//#################################################################################
|
||||
/*===========================================================================
|
||||
Default Constructor
|
||||
=========================================================================*/
|
||||
EDT_TempModif::EDT_TempModif (EDT_SuperObject *pOriginalSO, BOOL bLoaded, CString csModifSectionName/* = ""*/, CString csOriginalSOName/* = ""*/)
|
||||
: CPA_SectionObject ("", fn_szGetLevelsDataPath(), EDT_TempModif::CallBackSaveModif, NULL, bLoaded)
|
||||
{
|
||||
// set reference
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
ASSERT (pOriginalSO);
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
m_pOriginalSO = pOriginalSO;
|
||||
m_bLoaded = bLoaded;
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
if (csOriginalSOName.IsEmpty ())
|
||||
csOriginalSOName = m_pOriginalSO->GetReferencedSectionName();
|
||||
|
||||
mfn_vSetOriginalSOName (csOriginalSOName);
|
||||
// update section name
|
||||
if (csModifSectionName.IsEmpty ())
|
||||
csModifSectionName = m_pOriginalSO->GetTempModifSectionName();
|
||||
|
||||
SetReferencedSectionName(csModifSectionName);
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
SetSectionData(this);
|
||||
|
||||
// matrix
|
||||
m_pMatrixSection = new CPA_SectionObject (GetMatrixSectionName(), fn_szGetLevelsDataPath(),
|
||||
EDT_TempModif::CallBackSaveMatrix, this,
|
||||
bLoaded);
|
||||
// if new section, notify save
|
||||
if (!bLoaded)
|
||||
fn_vNotifySave();
|
||||
|
||||
// register initial state
|
||||
m_bCreated = FALSE;
|
||||
m_bDeleted = FALSE;
|
||||
// register initial name
|
||||
m_csFinalName = m_pOriginalSO->GetName();
|
||||
// register initial father
|
||||
m_pFinalFather = (EDT_SuperObject *) m_pOriginalSO->GetSuperObjectFather();
|
||||
// register initial position (relative)
|
||||
m_hFinalPosition = M_Temp_AllocMatrix();
|
||||
GEO_M_vCopyMatrix(m_hFinalPosition, HIE_fn_hGetSuperObjectMatrix(m_pOriginalSO->GetStruct()));
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
Destructor
|
||||
=========================================================================*/
|
||||
EDT_TempModif::~EDT_TempModif (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
Check validity
|
||||
=========================================================================*/
|
||||
BOOL EDT_TempModif::fn_bIsModified (CString csTypeModif)
|
||||
{
|
||||
//CPA2 modified by Stegaru Cristian 98-02
|
||||
// check creation
|
||||
if (csTypeModif == C_szCreation)
|
||||
return m_bCreated;
|
||||
|
||||
// check suppression
|
||||
if (csTypeModif == C_szSuppression)
|
||||
return m_bDeleted;
|
||||
|
||||
// check name
|
||||
if (csTypeModif == C_szChangeName)
|
||||
return m_bNameChanged;
|
||||
|
||||
// check father
|
||||
if (csTypeModif == C_szChangeFather)
|
||||
return m_bFatherChanged;
|
||||
|
||||
// check position
|
||||
if (csTypeModif == C_szChangePosition)
|
||||
return m_bPositionChanged;
|
||||
|
||||
// default => check all
|
||||
return (m_bCreated || m_bDeleted || m_bNameChanged ||
|
||||
m_bFatherChanged ||
|
||||
m_bPositionChanged);
|
||||
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
Set functions
|
||||
=========================================================================*/
|
||||
void EDT_TempModif::SetCreated (BOOL bCreated)
|
||||
{
|
||||
m_bCreated = bCreated;
|
||||
}
|
||||
|
||||
void EDT_TempModif::SetDeleted (BOOL bDeleted)
|
||||
{
|
||||
m_bDeleted = bDeleted;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : SetFinalPosition
|
||||
// Date : 98-02
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void EDT_TempModif::SetFinalPosition (GEO_tdxHandleToMatrix hNewPosition)
|
||||
{
|
||||
GEO_M_vCopyMatrix(m_hFinalPosition, hNewPosition);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : SetFinalFather
|
||||
// Date : 98-02
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void EDT_TempModif::SetFinalFather (EDT_SuperObject *pNewFather)
|
||||
{
|
||||
m_pFinalFather = pNewFather;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : SetFinalName
|
||||
// Date : 98-02
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void EDT_TempModif::SetFinalName (CString csNewName)
|
||||
{
|
||||
m_csFinalName = csNewName;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
Update temporary SO
|
||||
=========================================================================*/
|
||||
void EDT_TempModif::fn_vUpdateModification (CString csTypeModif, BOOL bAddModif)
|
||||
{
|
||||
BOOL bModified;
|
||||
|
||||
// creation => update flag and register father
|
||||
if (csTypeModif == C_szCreation)
|
||||
{
|
||||
m_bCreated = bAddModif;
|
||||
m_pFinalFather = (m_bCreated) ? (EDT_SuperObject *) m_pOriginalSO->GetSuperObjectFather() : NULL;
|
||||
}
|
||||
|
||||
// suppression => update flag
|
||||
else if (csTypeModif == C_szSuppression)
|
||||
{
|
||||
m_bDeleted = bAddModif;
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
fn_vNotifySave ();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
// father => register final father
|
||||
else if (csTypeModif == C_szChangeFather)
|
||||
{
|
||||
m_pFinalFather = (EDT_SuperObject *) m_pOriginalSO->GetSuperObjectFather();
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
m_bFatherChanged = bAddModif;
|
||||
fn_vNotifySave ();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
// position => register final position
|
||||
else if (csTypeModif == C_szChangePosition)
|
||||
{
|
||||
GEO_M_vCopyMatrix(m_hFinalPosition, HIE_fn_hGetSuperObjectMatrix(m_pOriginalSO->GetStruct()));
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
m_bPositionChanged = bAddModif;
|
||||
fn_vNotifySave ();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
// name => update section name and register final name
|
||||
else if (csTypeModif == C_szChangeName)
|
||||
{
|
||||
// register final name
|
||||
m_csFinalName = m_pOriginalSO->GetName();
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
fn_vNotifySave ();
|
||||
m_bNameChanged = bAddModif;
|
||||
m_pOriginalSO->GetSuperObjectEditor()->fn_vChangeTemporaryModif(m_pOriginalSO);
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
// update for modification manager
|
||||
bModified = fn_bIsModified(csTypeModif);
|
||||
m_pOriginalSO->fn_vUpdateModification(csTypeModif, bModified, !bModified);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
Notifications
|
||||
=========================================================================*/
|
||||
|
||||
void EDT_TempModif::fn_vNotifySave (void)
|
||||
{
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
// main section
|
||||
fn_vWriteSection();
|
||||
// matrix section
|
||||
m_pMatrixSection->fn_vWriteSection();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
//===========================================================================
|
||||
|
||||
void EDT_TempModif::fn_vNotifyUnsave (void)
|
||||
{
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
// main section
|
||||
fn_vDeleteSection();
|
||||
// matrix section
|
||||
m_pMatrixSection->fn_vDeleteSection();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void EDT_TempModif::fn_vNotifyRename (void)
|
||||
{
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
// main section
|
||||
fn_vRenameSection(m_pOriginalSO->GetTempModifSectionName());
|
||||
// matrix section
|
||||
m_pMatrixSection->fn_vRenameSection(GetMatrixSectionName());
|
||||
// for rename, must notify list of modifcations
|
||||
m_pOriginalSO->GetSuperObjectEditor()->fn_vChangeTemporaryModif(m_pOriginalSO);
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
CString EDT_TempModif::GetMatrixSectionName (void)
|
||||
{
|
||||
CString csSectionName, csName;
|
||||
char szSectionName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szActionName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szFileName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
|
||||
// get section name
|
||||
csSectionName = GetReferencedSectionName();
|
||||
SCR_fn_v_RdL0_SplitSectionName((char*)(LPCTSTR)csSectionName, szFileName, szActionName, szName);
|
||||
// get new name
|
||||
csName.Format("TempSO-%s", szName);
|
||||
// compute section name
|
||||
SCR_fn_v_RdL0_ComputeSectionName(szSectionName, szFileName, "Matrix", (char*)(LPCTSTR)csName);
|
||||
csSectionName = szSectionName;
|
||||
|
||||
return csSectionName;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
* Description: CallBack Save for modif sections
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
void EDT_TempModif::CallBackSaveModif (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction)
|
||||
{
|
||||
CPA_SectionObject *pMatrixSection;
|
||||
CPA_SuperObject *pSupObj;
|
||||
EDT_TempModif *pTempModif;
|
||||
CString csName, csMatrixName;
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
CString csObjectName;
|
||||
// char szSection[SCR_CV_ui_Cfg_MaxLenName];
|
||||
EditorIPO *pIPOObject = NULL;
|
||||
// char szActionName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
char szNewSectionName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
// char szFatherName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szFileName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szFinalName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
|
||||
|
||||
// get parameters
|
||||
pTempModif = (EDT_TempModif *) p_vData;
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
ASSERT (pTempModif);
|
||||
if (!pTempModif->mfn_bValidModif ())
|
||||
return;
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
pMatrixSection = pTempModif->GetMatrixSection();
|
||||
pSupObj = pTempModif->GetOriginalSO();
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
CString csStaticFileName, csFileName;
|
||||
int iPos = -1;
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
switch (eAction)
|
||||
{
|
||||
case SCR_EA_Ntfy_AddSection:
|
||||
// go to end of file (we need all file directive to load this section)
|
||||
SCR_fn_v_SvL1_ToEndSection(p_stFile);
|
||||
SCR_M_SvL0_SaveBlankLine (p_stFile);
|
||||
|
||||
case SCR_EA_Ntfy_RebuildSection:
|
||||
{
|
||||
// save section name
|
||||
csName = pTempModif->GetCompleteSectionName();
|
||||
SCR_fn_v_RdL0_SplitSectionName((char*)(LPCSTR)csName, szFileName, szNewSectionName, szName);
|
||||
SCR_fn_v_RdL0_ComputeSectionName(szNewSectionName, NULL, "Modif-SuperObject", szName);
|
||||
SCR_M_SvL0_SaveBeginSection(p_stFile, szNewSectionName, SCR_CC_C_Cfg_EOL);
|
||||
// save modif
|
||||
if (pTempModif->fn_bWasCreated())
|
||||
{
|
||||
CString csNameOfInitialSPO = pTempModif->mfn_csGetInitialSPOName ();
|
||||
CString csFullGeomSectionName;
|
||||
if (pSupObj->GetObject())
|
||||
{
|
||||
ASSERT(pSupObj->GetObject()->fn_bCanBeSaved());
|
||||
EditorPO *pPO = ((EditorIPO*)pSupObj->GetObject ())->GetPhysicalObject ();
|
||||
ASSERT (pPO);
|
||||
CPA_ObjectDLLBase *p_oPODll = pPO->GetMainWorld()->GetObjectDLLWithName (C_szDLLPhysicalObjectName);
|
||||
|
||||
CString *pcsFullGeomSectionName = (CString *)p_oPODll->OnQueryAction (NULL, OPD_GetFullGeomSectionName, (LPARAM)pPO);
|
||||
csFullGeomSectionName = *pcsFullGeomSectionName;
|
||||
delete pcsFullGeomSectionName;
|
||||
|
||||
}
|
||||
if (csNameOfInitialSPO.IsEmpty ())
|
||||
csNameOfInitialSPO = " ";
|
||||
if (csFullGeomSectionName.IsEmpty ())
|
||||
csFullGeomSectionName = " ";
|
||||
|
||||
SCR_M_SvL0_SaveEntry(p_stFile, "Created", SCR_CC_C_Cfg_NoChar);
|
||||
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Normal, 2, (char *)(LPCSTR)csNameOfInitialSPO, (char *)(LPCSTR)csFullGeomSectionName);
|
||||
}
|
||||
if (pTempModif->fn_bWasDeleted())
|
||||
SCR_M_SvL0_SaveEntry(p_stFile, "Deleted", SCR_CC_C_Cfg_EOL);
|
||||
// save final position
|
||||
csMatrixName = pMatrixSection->GetReferencedSectionName();
|
||||
SCR_fn_v_RdL0_SplitSectionName((char*)(LPCSTR)csMatrixName, szFileName, szNewSectionName, szName);
|
||||
SCR_fn_v_RdL0_ComputeSectionName(szNewSectionName, "*", "Matrix", (char*)(LPCSTR)szName);
|
||||
SCR_M_SvL0_SaveEntry(p_stFile, "FinalMatrix", SCR_CC_C_Cfg_NoChar);
|
||||
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Normal, 1, szNewSectionName);
|
||||
// save final parent
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
//don't use anymore the file of the parent(assume is the level\level.spo file)
|
||||
// strcpy(szFatherName, pTempModif->GetFinalFather()->GetName());
|
||||
// csFileName = szFileName;
|
||||
// iPos = csFileName.ReverseFind ('.');
|
||||
// ASSERT (-1 != iPos);
|
||||
// csStaticFileName = csFileName.Left (iPos) + szStaticExt;
|
||||
// SCR_fn_v_RdL0_ComputeSectionName(szNewSectionName, (char*)(LPCSTR)csStaticFileName, "SuperObject", szFatherName);
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
CString csFinalParent = "SuperObject:" + pTempModif->GetFinalFather()->GetName();
|
||||
SCR_M_SvL0_SaveEntry(p_stFile, "FinalParent", SCR_CC_C_Cfg_NoChar);
|
||||
// SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Normal, 1, szNewSectionName);
|
||||
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Normal, 1, (char*)(LPCSTR)csFinalParent);
|
||||
// save final name
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
strcpy(szFinalName, pTempModif->GetFinalName());
|
||||
SCR_M_SvL0_SaveEntry(p_stFile, "FinalName", SCR_CC_C_Cfg_NoChar);
|
||||
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Normal, 1, szFinalName);
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
// end section
|
||||
SCR_M_SvL0_SaveEndSection (p_stFile, SCR_CC_C_Cfg_EOL);
|
||||
if (eAction == SCR_EA_Ntfy_AddSection)
|
||||
SCR_M_SvL0_SaveBlankLine (p_stFile);
|
||||
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
// update existence
|
||||
pTempModif->fn_vSectionSaved();
|
||||
break;
|
||||
}
|
||||
case SCR_EA_Ntfy_DeleteSection:
|
||||
// update existence
|
||||
pTempModif->fn_vSectionDeleted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
* Description: CallBack Save for matrix sections
|
||||
* Creation date:
|
||||
* Author: Shaitan
|
||||
*---------------------------------------------------------------------------
|
||||
* Revision date: Author:
|
||||
*=========================================================================*/
|
||||
void EDT_TempModif::CallBackSaveMatrix (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction)
|
||||
{
|
||||
GEO_tdxHandleToMatrix hMatrix;
|
||||
CPA_SectionObject *pMatrixSection;
|
||||
EDT_SuperObject *pSupObj;
|
||||
EDT_TempModif *pTempModif;
|
||||
char szNewSectionName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
|
||||
|
||||
// get parameters
|
||||
pTempModif = (EDT_TempModif *) p_vData;
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
ASSERT (pTempModif);
|
||||
if (!pTempModif->mfn_bValidModif ())
|
||||
return;
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
pMatrixSection = pTempModif->GetMatrixSection();
|
||||
pSupObj = pTempModif->GetOriginalSO();
|
||||
|
||||
switch (eAction)
|
||||
{
|
||||
case SCR_EA_Ntfy_AddSection:
|
||||
// go to end of file (we need all file directive to load this section)
|
||||
SCR_fn_v_SvL1_ToEndSection(p_stFile);
|
||||
SCR_M_SvL0_SaveBlankLine (p_stFile);
|
||||
|
||||
case SCR_EA_Ntfy_RebuildSection:
|
||||
// save section name
|
||||
SCR_fn_v_RdL0_SplitSectionName(szSectionName, NULL, szNewSectionName, szName);
|
||||
// save matrix
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
hMatrix = pTempModif->GetFinalPosition ();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
pSupObj->fn_vSaveMatrix(p_stFile, hMatrix, szName);
|
||||
if (eAction == SCR_EA_Ntfy_AddSection)
|
||||
SCR_M_SvL0_SaveBlankLine (p_stFile);
|
||||
// update existence
|
||||
pMatrixSection->fn_vSectionSaved();
|
||||
break;
|
||||
|
||||
case SCR_EA_Ntfy_DeleteSection:
|
||||
// update existence
|
||||
pMatrixSection->fn_vSectionDeleted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//#################################################################################
|
||||
// CONSTRUCTOR
|
||||
//#################################################################################
|
||||
/*===========================================================================
|
||||
Constructor - init the list
|
||||
=========================================================================*/
|
||||
EDT_TempList::EDT_TempList (EDT_HierarchyEditor *pEditor, BOOL bLoaded)
|
||||
: CPA_SectionObject (pEditor->GetTempListSectionName(), fn_szGetLevelsDataPath(),
|
||||
EDT_TempList::CallBackSaveListModif)
|
||||
{
|
||||
// init editor
|
||||
m_pEditor = pEditor;
|
||||
// init list
|
||||
m_oListOfTempModif.RemoveAll();
|
||||
// init section object
|
||||
SetSectionData(this);
|
||||
SetExistingSection(bLoaded);
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
Destructor
|
||||
=========================================================================*/
|
||||
EDT_TempList::~EDT_TempList (void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//#################################################################################
|
||||
// Modifications
|
||||
//#################################################################################
|
||||
/*===========================================================================
|
||||
Add modif to the list
|
||||
=========================================================================*/
|
||||
void EDT_TempList::fn_vAddTemporaryModif (EDT_TempModif *pModif, BOOL bNotify)
|
||||
{
|
||||
POSITION pos;
|
||||
|
||||
// add modif to the list
|
||||
pos = m_oListOfTempModif.Find(pModif);
|
||||
if (!pos)
|
||||
m_oListOfTempModif.AddTail(pModif);
|
||||
// notify list
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
if (bNotify)
|
||||
fn_vWriteSection();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
remove modif to the list
|
||||
=========================================================================*/
|
||||
void EDT_TempList::fn_vRemoveTemporaryModif (EDT_TempModif *pModif)
|
||||
{
|
||||
POSITION pos;
|
||||
|
||||
// remove modif from the list
|
||||
pos = m_oListOfTempModif.Find(pModif);
|
||||
if (pos)
|
||||
m_oListOfTempModif.RemoveAt(pos);
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
// notify list
|
||||
fn_vWriteSection();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
change modif in the list
|
||||
=========================================================================*/
|
||||
void EDT_TempList::fn_vChangeTemporaryModif (EDT_TempModif *pModif)
|
||||
{
|
||||
POSITION pos;
|
||||
|
||||
// check if modif is in the list
|
||||
pos = m_oListOfTempModif.Find(pModif);
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
if (pos)
|
||||
fn_vWriteSection();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
Add modif to the list
|
||||
=========================================================================*/
|
||||
void EDT_TempList::fn_vRemoveAllTemporaryModifs (void)
|
||||
{
|
||||
// remove all modifs from the list
|
||||
while (m_oListOfTempModif.GetCount())
|
||||
m_oListOfTempModif.RemoveTail();
|
||||
}
|
||||
|
||||
|
||||
//#################################################################################
|
||||
// Saves
|
||||
//#################################################################################
|
||||
/*===========================================================================
|
||||
CallBack
|
||||
=========================================================================*/
|
||||
void EDT_TempList::CallBackSaveListModif (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction)
|
||||
{
|
||||
CPA_List<EDT_TempModif> *pListTemp;
|
||||
EDT_SuperObject *pSupObj;
|
||||
EDT_TempModif *pTempSO;
|
||||
EDT_TempList *pTempList;
|
||||
POSITION pos;
|
||||
CString csSectionName;
|
||||
char szName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szFileName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szModifName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szActionName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szSupObjName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
char szNewSectionName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
CString csOriginalSOName;
|
||||
char szOrigModifName[SCR_CV_ui_Cfg_MaxLenName];
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
|
||||
// get parameters
|
||||
pTempList = (EDT_TempList *) p_vData;
|
||||
|
||||
switch (eAction)
|
||||
{
|
||||
case SCR_EA_Ntfy_AddSection:
|
||||
case SCR_EA_Ntfy_RebuildSection:
|
||||
// get ist of modifs
|
||||
pListTemp = pTempList->GetListOfTemporaryModifs();
|
||||
// save begin section
|
||||
SCR_fn_v_RdL0_ComputeSectionName(szNewSectionName, NULL, "Edit-Modifications", " ");
|
||||
SCR_M_SvL0_SaveBeginSection(p_stFile, szNewSectionName, SCR_CC_C_Cfg_EOL);
|
||||
// save all entries
|
||||
for (pTempSO = pListTemp->GetHeadElement(pos); pTempSO;
|
||||
pTempSO = pListTemp->GetNextElement(pos))
|
||||
{
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
if (!pTempSO->mfn_bValidModif ())
|
||||
continue;
|
||||
|
||||
csOriginalSOName = pTempSO->mfn_csGetOriginalSOName ();
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
// get corresponding super-object
|
||||
pSupObj = pTempSO->GetOriginalSO();
|
||||
// get section names
|
||||
csSectionName = pSupObj->GetReferencedSectionName();
|
||||
SCR_fn_v_RdL0_SplitSectionName((char*)(LPCSTR)csSectionName, szFileName, szActionName, szName);
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
SCR_fn_v_RdL0_ComputeSectionName(szSupObjName, szFileName, "SuperObject", szName);
|
||||
SCR_fn_v_RdL0_SplitSectionName((char*)(LPCSTR)csOriginalSOName, NULL, NULL, szOrigModifName);
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
SCR_fn_v_RdL0_ComputeSectionName(szModifName, "*", "Modif-SuperObject", szOrigModifName);
|
||||
// register entry
|
||||
SCR_M_SvL0_SaveEntry(p_stFile, "Modification", SCR_CC_C_Cfg_NoChar);
|
||||
//CPA2 Stegaru Cristian 98-02
|
||||
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Normal, 3, (char*)(LPCSTR)csOriginalSOName, szSupObjName, szModifName);
|
||||
//End CPA2 Stegaru Cristian 98-02
|
||||
}
|
||||
// save end section
|
||||
SCR_M_SvL0_SaveEndSection (p_stFile, SCR_CC_C_Cfg_EOL);
|
||||
if (eAction == SCR_EA_Ntfy_AddSection)
|
||||
SCR_M_SvL0_SaveBlankLine (p_stFile);
|
||||
|
||||
// update section
|
||||
pTempList->fn_vSectionSaved();
|
||||
break;
|
||||
|
||||
case SCR_EA_Ntfy_DeleteSection:
|
||||
// update section
|
||||
pTempList->fn_vSectionDeleted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ACTIVE_EDITOR
|
558
Rayman_X/cpa/tempgrp/Edt/src/parsesection.cpp
Normal file
@@ -0,0 +1,558 @@
|
||||
//ParseSection.cpp
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ParseSection.hpp"
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : CParseSection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CParseSection::CParseSection (CString csFinalMDFFileName/* = ""*/)
|
||||
{
|
||||
m_csFinalMDFFileName = csFinalMDFFileName;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : ParseFile
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::ParseFile (CString csInitialMDFFileName, CString csFinalMDFFileName/* = ""*/)
|
||||
{
|
||||
//the final MDF file name can be passed in constructor or here
|
||||
if (!csFinalMDFFileName.IsEmpty ())
|
||||
m_csFinalMDFFileName = csFinalMDFFileName;
|
||||
|
||||
CFileStatus status;
|
||||
|
||||
BOOL bInitialMDFFileExists = CFile::GetStatus (csInitialMDFFileName, status);
|
||||
|
||||
if (!bInitialMDFFileExists) //the file exists
|
||||
{
|
||||
AfxMessageBox ("Error, can't open the initial MDF file");
|
||||
return 0;
|
||||
}
|
||||
else //normal behavior
|
||||
{
|
||||
if (FillListOfInitialMDFSections (csInitialMDFFileName))
|
||||
{
|
||||
CreateTheFinalMDFFile ();
|
||||
//copy the unchanged sections
|
||||
while (!m_lstOfInitialUnchangeableMDFSections.IsEmpty ())
|
||||
{
|
||||
CString csSectionName = m_lstOfInitialUnchangeableMDFSections.RemoveHead ();
|
||||
CopySectionAsItIs (csInitialMDFFileName, csSectionName);
|
||||
}
|
||||
//copy the normal sections
|
||||
while (!m_lstOfInitialMDFSections.IsEmpty ())
|
||||
{
|
||||
CString csSectionName = m_lstOfInitialMDFSections.RemoveHead ();
|
||||
CopySectionWithAnalyze (csInitialMDFFileName, csSectionName);
|
||||
}
|
||||
}
|
||||
else
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : CopySection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::CopySection (CString csFileName, CString csSectionName, BOOL bCopyAsItIs/* = FALSE*/)
|
||||
{
|
||||
//if section is already included skip it
|
||||
if (IsSectionIncluded (csSectionName))
|
||||
return 1;
|
||||
|
||||
if (!IsFileNameAbsolute (csFileName))
|
||||
//the absolute path is computed using different roots
|
||||
//we assume here that the relative path fit only one root(we can't compute two or more valid paths
|
||||
//using the same relative path and different roots)
|
||||
csFileName = ComputeAbsoluteFileName (csFileName);
|
||||
|
||||
if (csFileName.IsEmpty ())
|
||||
return 0;
|
||||
|
||||
CStringList lstSection;
|
||||
|
||||
if (!ReadSection (csFileName, csSectionName, lstSection))
|
||||
return 0;
|
||||
|
||||
if (!bCopyAsItIs)
|
||||
AnalyseSection (csFileName, lstSection);
|
||||
|
||||
WriteSection (lstSection);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : ReadSection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::ReadSection (CString csFileName, CString csSectionName, CStringList &rSection)
|
||||
{
|
||||
ASSERT (!csFileName.IsEmpty ());
|
||||
UINT uOpenFlags = CFile::modeRead | CFile::typeText;
|
||||
CStdioFile file;
|
||||
|
||||
if (!file.Open (csFileName, uOpenFlags))
|
||||
return 0;
|
||||
|
||||
BOOL bReadOK = 0;
|
||||
//read every line and when you find the section copy it in the rSection
|
||||
CString csEntry;
|
||||
while (file.ReadString (csEntry)) //not eof
|
||||
{
|
||||
csEntry.TrimLeft ();
|
||||
csEntry.TrimRight ();
|
||||
if (0 < csEntry.GetLength ()) //not a blank line
|
||||
{
|
||||
//find a section
|
||||
BOOL bBeginOfSection = cBeginBracket == csEntry [0];
|
||||
if (bBeginOfSection)
|
||||
{
|
||||
int iOpenedBracketCount = 1;
|
||||
//remove the bracket
|
||||
CString csRedSectionName = csEntry.Mid (1);
|
||||
csRedSectionName = RemoveParameters (csRedSectionName);
|
||||
BOOL bSectionMatch = csRedSectionName == csSectionName;
|
||||
if (bSectionMatch)
|
||||
{
|
||||
ASSERT (rSection.IsEmpty ());
|
||||
rSection.AddTail (csEntry);
|
||||
}
|
||||
|
||||
//read the whole section
|
||||
do{
|
||||
file.ReadString (csEntry);
|
||||
if (bSectionMatch)
|
||||
rSection.AddTail (csEntry);
|
||||
|
||||
csEntry.TrimLeft ();
|
||||
csEntry.TrimRight ();
|
||||
if (csEntry.IsEmpty ())
|
||||
continue;
|
||||
|
||||
//end bracket
|
||||
if (cEndBracket == csEntry [0]) iOpenedBracketCount--;
|
||||
//begin bracket
|
||||
if (cBeginBracket == csEntry [0]) iOpenedBracketCount++;
|
||||
|
||||
}while (0 < iOpenedBracketCount);
|
||||
|
||||
if (bSectionMatch)
|
||||
{
|
||||
//store this as a treated section in order not to include this the second time
|
||||
m_lstOfIncludedExternalReferences.AddTail (csSectionName);
|
||||
bReadOK = 1;
|
||||
break; //no need to read more
|
||||
}
|
||||
}
|
||||
//else go to next line
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
file.Close ();
|
||||
if (!bReadOK)
|
||||
{
|
||||
CString csWarningMsg = "Can't find the section: " + csSectionName + " in the file: " + csFileName;
|
||||
AfxMessageBox (csWarningMsg);
|
||||
}
|
||||
return bReadOK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : AnalyseSection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::AnalyseSection (CString csFileName, CStringList &rSection)
|
||||
{
|
||||
ASSERT (!rSection.IsEmpty ());
|
||||
//look for external references
|
||||
POSITION pos = rSection.GetHeadPosition ();
|
||||
while (NULL != pos)
|
||||
{
|
||||
POSITION oldPos = pos;
|
||||
//check every entry(line) in the section
|
||||
CString csEntry = rSection.GetNext (pos);
|
||||
int iInx = csEntry.Find (cExternalReferencesIndicator);
|
||||
BOOL bExternalReferences = -1 != iInx;
|
||||
if (bExternalReferences) // external references
|
||||
{
|
||||
//assume there is only one referenced section in the entry
|
||||
ASSERT (0 < iInx); //always there is something at the left
|
||||
int iBeginStringInx = csEntry.Find (cStringDelimitator);
|
||||
ASSERT (-1 != iBeginStringInx);
|
||||
//copy the keyword
|
||||
CString csEntryStartPart = csEntry.Left (iBeginStringInx);//don't include the delimitator
|
||||
CString csTextToAnalyze = csEntry.Mid (iBeginStringInx);
|
||||
while (!csTextToAnalyze.IsEmpty ())
|
||||
{
|
||||
int iFirstDelimitInx = csTextToAnalyze.Find (cStringDelimitator);
|
||||
BOOL bStringLeftForAnalyze = -1 != iFirstDelimitInx;
|
||||
if (!bStringLeftForAnalyze)
|
||||
{
|
||||
csEntryStartPart += csTextToAnalyze;
|
||||
break; //that's it
|
||||
}
|
||||
|
||||
CString csLeftTrail = csTextToAnalyze.Left (iFirstDelimitInx + 1); //include the delimitator
|
||||
csTextToAnalyze = csTextToAnalyze.Mid (iFirstDelimitInx + 1);
|
||||
int iSubstringInx = csTextToAnalyze.Find (cStringDelimitator);
|
||||
ASSERT (-1 != iSubstringInx); //get the pair "
|
||||
CString csSubstring = csTextToAnalyze.Left (iSubstringInx); //don't include the delimitator
|
||||
//but keep count of it
|
||||
csTextToAnalyze = csTextToAnalyze.Mid (iSubstringInx + 1); //get the right part, that will be analyzed next time
|
||||
int iSplitInx = csSubstring.Find (cExternalReferencesIndicator);
|
||||
BOOL bExternalReferencesFound = -1 != iSplitInx;
|
||||
if (!bExternalReferencesFound)
|
||||
{
|
||||
csEntryStartPart += csLeftTrail + csSubstring + cStringDelimitator;
|
||||
continue;
|
||||
}
|
||||
//if ext reference found
|
||||
|
||||
CString csSectionsFileName = csSubstring.Left (iSplitInx);
|
||||
BOOL bReferenceInThisFile = cThisFileReference == csSectionsFileName;
|
||||
if (bReferenceInThisFile)
|
||||
csSectionsFileName = csFileName;
|
||||
|
||||
CString csSectionName = csSubstring.Mid (iSplitInx + 1);
|
||||
if (!IsSectionIncluded (csSectionName))
|
||||
CopySectionWithAnalyze (csSectionsFileName, csSectionName);
|
||||
|
||||
//recompute the entry and replace the file name by *
|
||||
CString csFullSectionName;
|
||||
if (bReferenceInThisFile)
|
||||
{
|
||||
csFullSectionName = csLeftTrail + csSubstring + cStringDelimitator;
|
||||
}
|
||||
else
|
||||
{
|
||||
csFullSectionName = csLeftTrail + cThisFileReference + cExternalReferencesIndicator
|
||||
+ csSectionName + cStringDelimitator;
|
||||
}
|
||||
|
||||
csEntryStartPart += csFullSectionName;
|
||||
}
|
||||
rSection.SetAt (oldPos, csEntryStartPart);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : WriteSection
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::WriteSection (CStringList &rSection)
|
||||
{
|
||||
ASSERT (!rSection.IsEmpty ());
|
||||
ASSERT (!m_csFinalMDFFileName.IsEmpty ());
|
||||
CStdioFile file;
|
||||
//assume the file exists
|
||||
UINT uOpenFlags = CFile::modeWrite | CFile::typeText;
|
||||
if (!file.Open (m_csFinalMDFFileName, uOpenFlags))
|
||||
return 0;
|
||||
|
||||
file.SeekToEnd ();
|
||||
while (!rSection.IsEmpty ())
|
||||
{
|
||||
CString csEntry = rSection.RemoveHead ();
|
||||
if (!csEntry.IsEmpty())
|
||||
{
|
||||
BOOL bOrdinaryEntryInSection = cBeginBracket != csEntry [0] || cEndBracket != csEntry [0];
|
||||
if (bOrdinaryEntryInSection)
|
||||
csEntry = "\t" + csEntry + "\n";
|
||||
else //begin and end section
|
||||
csEntry = csEntry + "\n";
|
||||
|
||||
file.WriteString (csEntry);
|
||||
}
|
||||
}
|
||||
|
||||
file.WriteString ("\n\n");
|
||||
file.Close ();
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : FillListOfInitialMDFSections
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::FillListOfInitialMDFSections (CString csInitialMDFFileName)
|
||||
{
|
||||
ASSERT (!csInitialMDFFileName.IsEmpty ());
|
||||
UINT uOpenFlags = CFile::modeRead | CFile::typeText;
|
||||
CStdioFile file;
|
||||
|
||||
if (!file.Open (csInitialMDFFileName, uOpenFlags))
|
||||
return 0;
|
||||
|
||||
//empty the lists before a new fill
|
||||
m_lstOfInitialUnchangeableMDFSections.RemoveAll ();
|
||||
m_lstOfInitialMDFSections.RemoveAll ();
|
||||
//read every line and when you find the section copy it in the rSection
|
||||
CString csEntry;
|
||||
while (file.ReadString (csEntry)) //not eof
|
||||
{
|
||||
csEntry.TrimLeft ();
|
||||
if (0 < csEntry.GetLength ()) //not a blank line
|
||||
{
|
||||
//find a section
|
||||
BOOL bBeginOfSection = cBeginBracket == csEntry [0];
|
||||
if (bBeginOfSection)
|
||||
{
|
||||
int iOpenedBracketCount = 1;
|
||||
//remove the bracket
|
||||
CString csRedSectionName = csEntry.Mid (1);
|
||||
csRedSectionName.TrimLeft ();
|
||||
csRedSectionName.TrimRight ();
|
||||
//read the whole section
|
||||
do{
|
||||
file.ReadString (csEntry);
|
||||
csEntry.TrimLeft ();
|
||||
//end bracket
|
||||
if (cEndBracket == csEntry [0]) iOpenedBracketCount--;
|
||||
//begin bracket
|
||||
if (cBeginBracket == csEntry [0]) iOpenedBracketCount++;
|
||||
|
||||
}while (0 < iOpenedBracketCount);
|
||||
|
||||
//exceptions at the rule
|
||||
if (szEditModificationsKW == csRedSectionName)
|
||||
{
|
||||
m_lstOfInitialUnchangeableMDFSections.AddTail (csRedSectionName);
|
||||
continue;
|
||||
}
|
||||
|
||||
m_lstOfInitialMDFSections.AddTail (csRedSectionName);
|
||||
}
|
||||
//else ignore it
|
||||
|
||||
}
|
||||
//else go to next line
|
||||
}
|
||||
|
||||
|
||||
file.Close ();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : CreateTheFinalMDFFile
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::CreateTheFinalMDFFile ()
|
||||
{
|
||||
ASSERT (!m_csFinalMDFFileName.IsEmpty ());
|
||||
CStdioFile file;
|
||||
//assume the file exists
|
||||
UINT uOpenFlags = CFile::modeCreate | CFile::modeWrite | CFile::typeText;
|
||||
if (!file.Open (m_csFinalMDFFileName, uOpenFlags))
|
||||
return 0;
|
||||
|
||||
CString csMDFHeader (";MDF file\n\n");
|
||||
file.WriteString (csMDFHeader);
|
||||
file.Close ();
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : IsSectionIncluded
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::IsSectionIncluded (CString csSectionName)
|
||||
{
|
||||
POSITION pos = m_lstOfIncludedExternalReferences.GetHeadPosition ();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CString csExternSectionName = m_lstOfIncludedExternalReferences.GetNext (pos);
|
||||
if (csSectionName == csExternSectionName)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : ComputeAbsoluteFileName
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CString CParseSection::ComputeAbsoluteFileName (CString csFileName)
|
||||
{
|
||||
ASSERT (!IsFileNameAbsolute (csFileName));
|
||||
if (cBackslash == csFileName [0])
|
||||
csFileName = csFileName.Mid (1); //remove the useless backslash
|
||||
|
||||
//assume we can compute only one absolute path
|
||||
POSITION pos = m_lstOfRoots.GetHeadPosition ();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CString csRoot = m_lstOfRoots.GetNext (pos);
|
||||
//assume the root ends with a backslash
|
||||
CString csFilePath = csRoot + csFileName;
|
||||
CFileStatus status;
|
||||
if (CFile::GetStatus (csFilePath, status)) //verify if the file exists
|
||||
return csFilePath;
|
||||
}
|
||||
|
||||
ASSERT (FALSE);
|
||||
return "";
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : IsFileNameAbsolute
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
int CParseSection::IsFileNameAbsolute (CString csFileName)
|
||||
{
|
||||
csFileName.TrimLeft (); //make sure there are no pending blanks
|
||||
if (':' == csFileName [1]) //the path contains a drive
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
CFileStatus status;
|
||||
ASSERT (CFile::GetStatus (csFileName, status)); //the file exists
|
||||
#endif //_DEBUG
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : RemoveParameters
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CString CParseSection::RemoveParameters (CString csRedSectionName)
|
||||
{
|
||||
csRedSectionName.TrimLeft ();
|
||||
csRedSectionName.TrimRight ();
|
||||
int iInx = csRedSectionName.Find (cParameterBeginIndicator);
|
||||
BOOL bHasParameters = -1 != iInx;
|
||||
if (bHasParameters)
|
||||
csRedSectionName = csRedSectionName.Left (iInx);
|
||||
|
||||
return csRedSectionName;
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method : AddRoot
|
||||
// Date : 98-03
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Description :
|
||||
// Author : Stegaru Cristian - CPA2
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Modification :
|
||||
// Date :
|
||||
// By :
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void CParseSection::AddRoot (CString csRoot)
|
||||
{
|
||||
csRoot.TrimRight ();
|
||||
//the roots have to end with a backslash
|
||||
if (cBackslash != csRoot [csRoot.GetLength () - 1])
|
||||
csRoot += cBackslash;
|
||||
|
||||
m_lstOfRoots.AddTail (csRoot);
|
||||
}
|
||||
|
||||
|
6
Rayman_X/cpa/tempgrp/Edt/src/stdafx.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// ACPProject.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
16
Rayman_X/cpa/tempgrp/Edt/src/stdafx.h
Normal file
@@ -0,0 +1,16 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows 95 Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
|
||||
|