summaryrefslogtreecommitdiffstats
path: root/tools/statepropbuilder/apps/spbuilder/code/sp/builder
diff options
context:
space:
mode:
Diffstat (limited to 'tools/statepropbuilder/apps/spbuilder/code/sp/builder')
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.cpp73
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.dfm58
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.h34
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.cpp75
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.dfm58
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.h34
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp136
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.dfm120
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.h44
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.cpp704
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.dfm783
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.h163
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.cpp24
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.dfm42
-rw-r--r--tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.h28
15 files changed, 2376 insertions, 0 deletions
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.cpp b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.cpp
new file mode 100644
index 0000000..adc81aa
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.cpp
@@ -0,0 +1,73 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include <sp/interface.hpp>
+#include "callbacksframe.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+
+extern bool g_ForceDataUpdate;
+extern bool g_IsDataSaved;
+
+TFrame4 *Frame4;
+//---------------------------------------------------------------------------
+__fastcall TFrame4::TFrame4(TComponent* Owner,int cbindex) :
+ TFrame(Owner),
+ m_CBIndex( cbindex )
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TFrame4::CallbackComboBoxChange(TObject *Sender)
+{
+ CallbackData cbData;
+ SPGetCallbackData( SPGetCurrentState() , m_CBIndex , &cbData );
+
+ int index = CallbackComboBox->ItemIndex;
+ AnsiString eventname = CallbackComboBox->Items->Strings[index];
+ SPEditCallback( SPGetCurrentState() , m_CBIndex , eventname.c_str() , index , cbData.onFrame );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame4::OnFrameEditBoxChange(TObject *Sender)
+{
+ CallbackData cbData;
+ SPGetCallbackData( SPGetCurrentState() , m_CBIndex , &cbData );
+
+ AnsiString onFrame = OnFrameEditBox->Text;
+ float frame = 0.f;
+ try
+ {
+ frame = onFrame.ToDouble();
+ }
+ catch (Exception&)
+ {
+ frame = cbData.onFrame;
+ AnsiString oldFrame;
+ oldFrame.sprintf("%0.3f" , frame);
+ OnFrameEditBox->Text = oldFrame;
+ }
+
+ SPEditCallback( SPGetCurrentState() , m_CBIndex , cbData.callbackName , cbData.callbackID , frame );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame4::Button1Click(TObject *Sender)
+{
+ SPDeleteCallback( SPGetCurrentState() , m_CBIndex );
+ g_ForceDataUpdate = true;
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+
+void __fastcall TFrame4::OnFrameEditBoxExit(TObject *Sender)
+{
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.dfm b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.dfm
new file mode 100644
index 0000000..bddefe4
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.dfm
@@ -0,0 +1,58 @@
+object Frame4: TFrame4
+ Left = 0
+ Top = 0
+ Width = 286
+ Height = 71
+ TabOrder = 0
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 286
+ Height = 71
+ Align = alClient
+ BevelInner = bvLowered
+ TabOrder = 0
+ object Label2: TLabel
+ Left = 8
+ Top = 10
+ Width = 41
+ Height = 13
+ Caption = 'Callback'
+ end
+ object Label1: TLabel
+ Left = 8
+ Top = 35
+ Width = 43
+ Height = 13
+ Caption = 'On frame'
+ end
+ object CallbackComboBox: TComboBox
+ Left = 56
+ Top = 5
+ Width = 121
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 0
+ OnChange = CallbackComboBoxChange
+ end
+ object OnFrameEditBox: TEdit
+ Left = 56
+ Top = 30
+ Width = 49
+ Height = 21
+ TabOrder = 1
+ OnChange = OnFrameEditBoxChange
+ OnExit = OnFrameEditBoxExit
+ end
+ object Button1: TButton
+ Left = 110
+ Top = 30
+ Width = 67
+ Height = 23
+ Caption = 'delete'
+ TabOrder = 2
+ OnClick = Button1Click
+ end
+ end
+end
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.h b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.h
new file mode 100644
index 0000000..b2b0519
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/callbacksframe.h
@@ -0,0 +1,34 @@
+//---------------------------------------------------------------------------
+
+
+#ifndef callbacksframeH
+#define callbacksframeH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+//---------------------------------------------------------------------------
+class TFrame4 : public TFrame
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TLabel *Label2;
+ TComboBox *CallbackComboBox;
+ TLabel *Label1;
+ TEdit *OnFrameEditBox;
+ TButton *Button1;
+ void __fastcall CallbackComboBoxChange(TObject *Sender);
+ void __fastcall OnFrameEditBoxChange(TObject *Sender);
+ void __fastcall Button1Click(TObject *Sender);
+ void __fastcall OnFrameEditBoxExit(TObject *Sender);
+private: // User declarations
+ int m_CBIndex;
+public: // User declarations
+ __fastcall TFrame4(TComponent* Owner,int cbindex);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TFrame4 *Frame4;
+//---------------------------------------------------------------------------
+#endif
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.cpp b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.cpp
new file mode 100644
index 0000000..09ded82
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.cpp
@@ -0,0 +1,75 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+#include <sp/interface.hpp>
+#include "eventsframe.h"
+#include "main.h"
+
+extern float g_ForceDataUpdate;
+extern bool g_IsDataSaved;
+
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TFrame3 *Frame3;
+//---------------------------------------------------------------------------
+__fastcall TFrame3::TFrame3(TComponent* Owner , int EventIndex ) :
+ TFrame(Owner),
+ m_EventIndex( EventIndex )
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TFrame3::EventComboBoxChange(TObject *Sender)
+{
+ EventData eventData;
+ SPGetEventData( SPGetCurrentState() , m_EventIndex , &eventData );
+ int index = EventComboBox->ItemIndex;
+ AnsiString eventname = EventComboBox->Items->Strings[index];
+ SPEditEvent( SPGetCurrentState() , m_EventIndex , eventname.c_str() , index , eventData.toState );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame3::ToFrameEditBoxChange(TObject *Sender)
+{
+ EventData eventData;
+ SPGetEventData( SPGetCurrentState() , m_EventIndex , &eventData );
+
+ int index = EventComboBox->ItemIndex;
+ AnsiString eventname = EventComboBox->Items->Strings[index];
+ AnsiString toState = ToFrameEditBox->Text;
+ int state = 0;
+ try
+ {
+ state = toState.ToInt();
+ }
+ catch (Exception&)
+ {
+ state = eventData.toState + 1;
+ }
+ if ( state > SPGetNumberOfStates() || state == 0 )
+ {
+ state = eventData.toState + 1;
+ g_ForceDataUpdate = true;
+ }
+
+ SPEditEvent( SPGetCurrentState() , m_EventIndex , eventname.c_str() , index , state - 1 );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame3::Button1Click(TObject *Sender)
+{
+ SPDeleteEvent( SPGetCurrentState() , m_EventIndex );
+ g_ForceDataUpdate = true;
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame3::ToFrameEditBoxExit(TObject *Sender)
+{
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.dfm b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.dfm
new file mode 100644
index 0000000..cf1d0e6
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.dfm
@@ -0,0 +1,58 @@
+object Frame3: TFrame3
+ Left = 0
+ Top = 0
+ Width = 212
+ Height = 62
+ TabOrder = 0
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 212
+ Height = 62
+ Align = alClient
+ BevelInner = bvLowered
+ TabOrder = 0
+ object Label1: TLabel
+ Left = 8
+ Top = 10
+ Width = 44
+ Height = 13
+ Caption = 'On event'
+ end
+ object Label2: TLabel
+ Left = 8
+ Top = 35
+ Width = 50
+ Height = 13
+ Caption = 'go to state'
+ end
+ object EventComboBox: TComboBox
+ Left = 64
+ Top = 5
+ Width = 113
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 0
+ OnChange = EventComboBoxChange
+ end
+ object ToFrameEditBox: TEdit
+ Left = 64
+ Top = 30
+ Width = 41
+ Height = 21
+ TabOrder = 1
+ OnChange = ToFrameEditBoxChange
+ OnExit = ToFrameEditBoxExit
+ end
+ object Button1: TButton
+ Left = 110
+ Top = 30
+ Width = 67
+ Height = 23
+ Caption = 'delete'
+ TabOrder = 2
+ OnClick = Button1Click
+ end
+ end
+end
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.h b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.h
new file mode 100644
index 0000000..9154617
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/eventsframe.h
@@ -0,0 +1,34 @@
+//---------------------------------------------------------------------------
+
+
+#ifndef eventsframeH
+#define eventsframeH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+//---------------------------------------------------------------------------
+class TFrame3 : public TFrame
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TLabel *Label1;
+ TComboBox *EventComboBox;
+ TLabel *Label2;
+ TEdit *ToFrameEditBox;
+ TButton *Button1;
+ void __fastcall EventComboBoxChange(TObject *Sender);
+ void __fastcall ToFrameEditBoxChange(TObject *Sender);
+ void __fastcall Button1Click(TObject *Sender);
+ void __fastcall ToFrameEditBoxExit(TObject *Sender);
+private: // User declarations
+ int m_EventIndex;
+public: // User declarations
+ __fastcall TFrame3(TComponent* Owner , int EventIndex );
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TFrame3 *Frame3;
+//---------------------------------------------------------------------------
+#endif
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp
new file mode 100644
index 0000000..0a508b4
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.cpp
@@ -0,0 +1,136 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#include <sp/interface.hpp>
+#pragma hdrstop
+
+#include "fcframe.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+
+extern bool g_IsDataSaved;
+extern bool g_ForceDataUpdate;
+
+TFrame1 *Frame1;
+//---------------------------------------------------------------------------
+__fastcall TFrame1::TFrame1(TComponent* Owner , int fcindex)
+ : TFrame(Owner) , m_FCIndex( fcindex )
+{
+}
+
+//---------------------------------------------------------------------------
+
+
+void __fastcall TFrame1::CyclicCheckBoxClick(TObject *Sender)
+{
+ SPSetCyclic( SPGetCurrentState() , m_FCIndex , this->CyclicCheckBox->State != cbUnchecked );
+ this->cycleForEditBox->Enabled = CyclicCheckBox->State != cbUnchecked;
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::MaxFrameEditBoxChange(TObject *Sender)
+{
+ FrameControllerData fcData;
+ SPGetFrameControllerData( SPGetCurrentState() , m_FCIndex , &fcData );
+
+ AnsiString frame;
+ frame = this->MaxFrameEditBox->Text;
+ float f = 0.0f;
+ try
+ {
+ f = frame.ToDouble();
+ }
+ catch (Exception&)
+ {
+ f = fcData.maxFrame;
+ }
+
+ SPSetFrameRange( SPGetCurrentState() , m_FCIndex , fcData.minFrame , f );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::MinFrameEditBoxChange(TObject *Sender)
+{
+ FrameControllerData fcData;
+ SPGetFrameControllerData( SPGetCurrentState() , m_FCIndex , &fcData );
+
+ AnsiString frame;
+ frame = this->MinFrameEditBox->Text;
+ float f = 0.0f;
+
+ try
+ {
+ f = frame.ToDouble();
+
+ }
+ catch (Exception&)
+ {
+ f = fcData.minFrame;
+ }
+
+ SPSetFrameRange( SPGetCurrentState() , m_FCIndex , f , fcData.maxFrame );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::holdFrameCheckboxClick(TObject *Sender)
+{
+ SPSetHoldFrame( SPGetCurrentState() , m_FCIndex , holdFrameCheckbox->Checked );
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::speedEditBoxChange(TObject *Sender)
+{
+ FrameControllerData fcData;
+ SPGetFrameControllerData( SPGetCurrentState() , m_FCIndex , &fcData );
+
+ AnsiString speed;
+ speed = this->speedEditBox->Text;
+ float fSpeed = 0.0f;
+
+ try
+ {
+ fSpeed = speed.ToDouble();
+ }
+ catch (Exception&)
+ {
+ fSpeed = fcData.relativeSpeed;
+ }
+
+ SPSetRelativeSpeed( SPGetCurrentState() , m_FCIndex , fSpeed );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::cycleForEditBoxChange(TObject *Sender)
+{
+ FrameControllerData fcData;
+ SPGetFrameControllerData( SPGetCurrentState() , m_FCIndex , &fcData );
+
+ AnsiString cycles;
+ cycles = cycleForEditBox->Text;
+ int iCycles = 0;
+ try
+ {
+ iCycles = cycles.ToInt();
+ }
+ catch (Exception&)
+ {
+ iCycles = fcData.numberOfCycles;
+ }
+
+ SPSetNumberOfCycles( SPGetCurrentState() , m_FCIndex , iCycles );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TFrame1::EditBoxExit(TObject *Sender)
+{
+ //do something here
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.dfm b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.dfm
new file mode 100644
index 0000000..fb63774
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.dfm
@@ -0,0 +1,120 @@
+object Frame1: TFrame1
+ Left = 0
+ Top = 0
+ Width = 1066
+ Height = 30
+ TabOrder = 0
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 1066
+ Height = 30
+ Align = alClient
+ BevelInner = bvLowered
+ TabOrder = 0
+ object FrameControllerNameLabel: TLabel
+ Left = 10
+ Top = 7
+ Width = 24
+ Height = 13
+ Caption = 'none'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -8
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label1: TLabel
+ Left = 130
+ Top = 7
+ Width = 52
+ Height = 13
+ Caption = 'Frame: Min'
+ end
+ object Label3: TLabel
+ Left = 256
+ Top = 7
+ Width = 20
+ Height = 13
+ Caption = 'Max'
+ end
+ object Label4: TLabel
+ Left = 720
+ Top = 7
+ Width = 29
+ Height = 13
+ Caption = 'Frame'
+ end
+ object Label5: TLabel
+ Left = 352
+ Top = 8
+ Width = 31
+ Height = 13
+ Caption = 'Speed'
+ end
+ object MinFrameEditBox: TEdit
+ Left = 186
+ Top = 4
+ Width = 60
+ Height = 21
+ TabOrder = 0
+ OnChange = MinFrameEditBoxChange
+ OnExit = EditBoxExit
+ end
+ object MaxFrameEditBox: TEdit
+ Left = 280
+ Top = 4
+ Width = 60
+ Height = 21
+ TabOrder = 1
+ OnChange = MaxFrameEditBoxChange
+ OnExit = EditBoxExit
+ end
+ object CyclicCheckBox: TCheckBox
+ Left = 456
+ Top = 7
+ Width = 49
+ Height = 17
+ Caption = 'Cycle'
+ TabOrder = 2
+ OnClick = CyclicCheckBoxClick
+ end
+ object CurrentFrameLabel: TEdit
+ Left = 760
+ Top = 4
+ Width = 60
+ Height = 21
+ TabOrder = 3
+ end
+ object holdFrameCheckbox: TCheckBox
+ Left = 560
+ Top = 7
+ Width = 57
+ Height = 17
+ Caption = 'Hold'
+ TabOrder = 4
+ OnClick = holdFrameCheckboxClick
+ end
+ object cycleForEditBox: TEdit
+ Left = 503
+ Top = 4
+ Width = 39
+ Height = 21
+ Enabled = False
+ TabOrder = 5
+ Text = '0'
+ OnChange = cycleForEditBoxChange
+ OnExit = EditBoxExit
+ end
+ object speedEditBox: TEdit
+ Left = 387
+ Top = 4
+ Width = 57
+ Height = 21
+ TabOrder = 6
+ OnChange = speedEditBoxChange
+ OnExit = EditBoxExit
+ end
+ end
+end
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.h b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.h
new file mode 100644
index 0000000..fcc0f0a
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/fcframe.h
@@ -0,0 +1,44 @@
+//---------------------------------------------------------------------------
+
+
+#ifndef fcframeH
+#define fcframeH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+//---------------------------------------------------------------------------
+class TFrame1 : public TFrame
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TLabel *FrameControllerNameLabel;
+ TLabel *Label1;
+ TEdit *MinFrameEditBox;
+ TLabel *Label3;
+ TEdit *MaxFrameEditBox;
+ TCheckBox *CyclicCheckBox;
+ TLabel *Label4;
+ TEdit *CurrentFrameLabel;
+ TCheckBox *holdFrameCheckbox;
+ TEdit *cycleForEditBox;
+ TEdit *speedEditBox;
+ TLabel *Label5;
+ void __fastcall CyclicCheckBoxClick(TObject *Sender);
+ void __fastcall MaxFrameEditBoxChange(TObject *Sender);
+ void __fastcall MinFrameEditBoxChange(TObject *Sender);
+ void __fastcall holdFrameCheckboxClick(TObject *Sender);
+ void __fastcall speedEditBoxChange(TObject *Sender);
+ void __fastcall cycleForEditBoxChange(TObject *Sender);
+ void __fastcall EditBoxExit(TObject *Sender);
+private: // User declarations
+ int m_FCIndex;
+public: // User declarations
+ __fastcall TFrame1(TComponent* Owner , int fcindex);
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TFrame1 *Frame1;
+//---------------------------------------------------------------------------
+#endif
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.cpp b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.cpp
new file mode 100644
index 0000000..1192623
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.cpp
@@ -0,0 +1,704 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#include <sp/interface.hpp>
+#include <direct.h>
+
+#include <errno.h>
+#include <dos.h>
+#include <io.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#pragma hdrstop
+
+#include "main.h"
+#include "sp/builder/fcframe.h"
+#include "sp/builder/eventsframe.h"
+
+float g_ForceDataUpdate = false;
+bool g_IsDataSaved = true;
+
+/* returns the attributes of a DOS file */
+int get_file_attrib(char *filename)
+{
+ return(_rtl_chmod(filename, 0));
+}
+//---------------------------------------------------------------------------
+
+void FVUShiftStateToMouse(TShiftState shiftState, int& buttons, int& shift)
+{
+ buttons = 0;
+ if (shiftState.Contains(ssLeft))
+ buttons |= MK_LBUTTON;
+ if (shiftState.Contains(ssRight))
+ buttons |= MK_RBUTTON;
+ if (shiftState.Contains(ssMiddle))
+ buttons |= MK_MBUTTON;
+
+ shift = 0;
+ if (shiftState.Contains(ssShift))
+ shift |= MK_SHIFT;
+ if (shiftState.Contains(ssCtrl))
+ shift |= MK_CONTROL;
+}
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TMainForm *MainForm;
+//---------------------------------------------------------------------------
+__fastcall TMainForm::TMainForm(TComponent* Owner) :
+ TForm(Owner),
+ m_numFCPanels(0),
+ m_numDrawablePanels(0),
+ m_numEvents(0),
+ m_numCallbacks(0),
+ m_CurrentPropState(-1)
+{
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::ApplicationEvents1Idle(TObject *Sender,
+ bool &Done)
+{
+ int i;
+ SPContextAdvance();
+ SPContextDisplay();
+
+ //update frames
+ float currentFrame = SPGetBaseFrameControllerFrame();
+ AnsiString frame;
+ frame.sprintf("%0.3f",currentFrame);
+ CurrentFrameWindow->Text = frame;
+
+ for ( i = 0; i < m_numFCPanels; i++ )
+ {
+ frame.sprintf("%0.3f",SPGetFrameControllerFrame( i ));
+ m_FCPanels[i]->CurrentFrameLabel->Text = frame;
+ }
+
+ Save1->Enabled = ! g_IsDataSaved;
+
+ //check for a new state
+ int newState = SPGetCurrentState();
+ if ( m_CurrentPropState != newState || g_ForceDataUpdate )
+ {
+ UpdateStateInfo();
+ UpdateFrameControllers();
+ UpdateDrawables();
+ UpdateEvents();
+ UpdateCallbacks();
+ m_CurrentPropState = newState;
+ g_ForceDataUpdate = false;
+ }
+
+ static bool bgloaded = false;
+ if ( ! bgloaded )
+ {
+ //load the events list
+ AnsiString fname = Application->ExeName;
+ fname.SetLength( fname.Length() - 13 );
+ fname.cat_sprintf("data\\init.txt");
+ TComboBox* cbox = new TComboBox( this );
+ cbox->Parent = Panel4;
+ cbox->Items->LoadFromFile(fname);
+ if ( cbox->Items->Count >= 1 )
+ {
+ AnsiString bgfilename = cbox->Items->Strings[0];
+ SPLoadBackground( bgfilename.c_str() );
+ }
+
+ delete cbox;
+ bgloaded = true;
+ }
+
+ Done = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::FormShow(TObject *Sender)
+{
+ SPPlatformOpen( Handle );
+
+ HWND desktopHwnd = GetDesktopWindow();
+ RECT rect;
+ GetWindowRect(desktopHwnd, &rect);
+
+ P3DPanel->Width = rect.right - rect.left;
+ P3DPanel->Height = rect.bottom - rect.top;
+ SPContextOpen(P3DPanel->Handle);
+ SPContextViewResize(P3DClientPanel->ClientWidth, P3DClientPanel->ClientHeight);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::FormClose(TObject *Sender, TCloseAction &Action)
+{
+ SPContextClose();
+ SPPlatformClose();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::P3DClientPanelResize(TObject *Sender)
+{
+ SPContextViewResize(P3DClientPanel->ClientWidth, P3DClientPanel->ClientHeight);
+ SPContextDisplay();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::FileOpenExecute(TObject *Sender)
+{
+ if (OpenDialog1->Execute())
+ {
+ int i;
+ SPLoad( OpenDialog1->FileName.c_str() );
+ FileName = OpenDialog1->FileName;
+ m_CurrentPropState = -1;
+
+ //Remove old panels
+ for (i = 0; i < m_numFCPanels; i++)
+ {
+ delete m_FCPanels[i];
+ m_FCPanels[i] = NULL;
+ }
+ m_numFCPanels = 0;
+
+ for (i = 0; i < m_numDrawablePanels; i++)
+ {
+ delete m_DrawablePanels[i];
+ m_DrawablePanels[i] = NULL;
+ }
+ m_numDrawablePanels = 0;
+
+ //Set up new panels
+ int numfc = SPGetNumFrameControllers();
+ m_numFCPanels = numfc;
+ for (i = 0; i < numfc; i++ )
+ {
+ AnsiString framename;
+ framename.sprintf("fcframe%i", i );
+ TFrame1* f = new TFrame1( this , i );
+ f->Parent = Panel4;
+ f->Name = framename;
+ m_FCPanels[i] = f;
+ }
+ Panel2->Height = numfc * 33 + 35 + 32;
+ int panel4height = numfc * 33;
+ if ( panel4height < 6 * 33 )
+ {
+ Panel4->Height = numfc * 33;
+ }
+ else
+ {
+ Panel4->Height = 6 * 33;
+ }
+
+ for (i = numfc - 1; i >= 0; i-- )
+ {
+ m_FCPanels[i]->Align = alTop;
+ }
+
+ m_numDrawablePanels = SPGetNumDrawables();
+ for (i = 0; i < m_numDrawablePanels; i++ )
+ {
+ AnsiString framename;
+ framename.sprintf("drawframe%i", i );
+ TFrame2* f = new TFrame2( this , i );
+ f->Parent = Panel5;
+ f->Name = framename;
+ m_DrawablePanels[i] = f;
+ }
+ for ( i = m_numDrawablePanels-1; i >= 0; i-- )
+ {
+ m_DrawablePanels[i]->Align = alTop;
+ }
+ g_IsDataSaved = true;
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::P3DPanelMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{
+ int buttons, shift;
+ FVUShiftStateToMouse(Shift, buttons, shift);
+ SPContextMouseDown(buttons, shift, X, Y);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::P3DPanelMouseMove(TObject *Sender,
+ TShiftState Shift, int X, int Y)
+{
+ int buttons, shift;
+ FVUShiftStateToMouse(Shift, buttons, shift);
+ SPContextMouseMove(buttons, shift, X, Y);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::P3DPanelMouseUp(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y)
+{
+ int buttons, shift;
+ FVUShiftStateToMouse(Shift, buttons, shift);
+ SPContextMouseUp(buttons, shift, X, Y);
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::FormKeyPress(TObject *Sender, char &Key)
+{
+ switch (Key)
+ {
+ case '.':
+ SPNextState();
+ g_ForceDataUpdate = true;
+ break;
+ case ',':
+ SPPrevState();
+ g_ForceDataUpdate = true;
+ break;
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::PlayButtonClick(TObject *Sender)
+{
+ static bool play = true;
+ SPPause( play );
+ play = !play;
+ if (play)
+ {
+ PlayButton->Caption = "| |";
+ }
+ else
+ {
+ PlayButton->Caption = ">";
+ }
+}
+//---------------------------------------------------------------------------
+
+
+
+void __fastcall TMainForm::PrevStatebuttonClick(TObject *Sender)
+{
+ SPPrevState();
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::NextStateButtonClick(TObject *Sender)
+{
+ SPNextState();
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::ForwardStepButtonClick(TObject *Sender)
+{
+ SPAdvanceOneFrame();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::BackStepButtonClick(TObject *Sender)
+{
+ SPBackOneFrame();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Button1Click(TObject *Sender)
+{
+ SPAddEvent( "" , 0 , 0 , SPGetCurrentState() );
+ UpdateEvents();
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void TMainForm::UpdateStateInfo()
+{
+ AnsiString propname;
+ propname.sprintf( "%s", SPGetPropName() );
+ PropNameLabel->Caption = propname;
+ PropNameLabelTop->Caption = propname;
+
+ AnsiString numstates;
+ numstates.sprintf("%i", SPGetNumberOfStates() );
+ NumPropStatesLabel->Caption = numstates;
+ NumPropStatesLabelTop->Caption = numstates;
+
+ AnsiString curstate;
+ curstate.sprintf("%i" , SPGetCurrentState() + 1 );
+ CurrentStateLabel->Caption = curstate;
+ CurrentStateLabelTop->Caption = curstate;
+ StateStateLabel->Caption = curstate;
+
+ TransitionData transitionData;
+ if ( SPGetTransitionData( SPGetCurrentState() , &transitionData ) )
+ {
+ AutoTransitionCheckBox->Checked = transitionData.autoTransition;
+
+ AnsiString tostate;
+ tostate.sprintf("%i", transitionData.toState + 1);
+ ToStateEditBox->Text = tostate;
+ ToStateEditBox->Enabled = transitionData.autoTransition;
+
+ AnsiString onframe;
+ onframe.sprintf("%0.3f", transitionData.onFrame );
+ OnFrameEditBox->Text = onframe;
+ OnFrameEditBox->Enabled = transitionData.autoTransition;
+ }
+}
+//---------------------------------------------------------------------------
+
+void TMainForm::UpdateFrameControllers()
+{
+ //Set up fc's
+ int i;
+ for ( i = 0; i < m_numFCPanels; i++ )
+ {
+ AnsiString text;
+ text.sprintf("%s",SPGetFrameControllerName( i ));
+ m_FCPanels[i]->FrameControllerNameLabel->Caption = text;
+
+ FrameControllerData fcData;
+ if ( SPGetFrameControllerData( SPGetCurrentState() , i , &fcData ) )
+ {
+ text.sprintf("%0.3f", fcData.minFrame );
+ m_FCPanels[i]->MinFrameEditBox->Text = text;
+
+ text.sprintf("%0.3f",fcData.maxFrame);
+ m_FCPanels[i]->MaxFrameEditBox->Text = text;
+
+ text.sprintf("%0.3f", fcData.relativeSpeed );
+ m_FCPanels[i]->speedEditBox->Text = text;
+
+ if ( fcData.isCyclic )
+ {
+ m_FCPanels[i]->CyclicCheckBox->State = cbChecked;
+ }
+ else
+ {
+ m_FCPanels[i]->CyclicCheckBox->State = cbUnchecked;
+ }
+ m_FCPanels[i]->holdFrameCheckbox->Checked = fcData.holdFrame;
+
+ if ( fcData.numberOfCycles == 0 )
+ {
+ text.sprintf("forever" );
+ m_FCPanels[i]->cycleForEditBox->Text = text;
+ }
+ else
+ {
+ text.sprintf("%i" , fcData.numberOfCycles);
+ m_FCPanels[i]->cycleForEditBox->Text = text;
+ }
+
+ m_FCPanels[i]->cycleForEditBox->Enabled = m_FCPanels[i]->CyclicCheckBox->State != cbUnchecked;
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void TMainForm::UpdateDrawables()
+{
+ //Set up drawables
+ int i;
+ for ( i = 0; i < m_numDrawablePanels; i++ )
+ {
+ AnsiString n;
+ n.sprintf("%s",SPGetDrawableName( i ));
+ m_DrawablePanels[i]->NameLabel->Caption = n;
+
+ VisibilityData visData;
+ if ( SPGetVisibilityData( SPGetCurrentState() , i , &visData ) )
+ {
+ if ( visData.isVisible )
+ {
+ m_DrawablePanels[i]->VisibilityCheckBox->State = cbChecked;
+ }
+ else
+ {
+ m_DrawablePanels[i]->VisibilityCheckBox->State = cbUnchecked;
+ }
+ }
+ }
+}
+//---------------------------------------------------------------------------
+
+void TMainForm::UpdateEvents()
+{
+ int i;
+ for ( i = 0; i < m_numEvents; i++ )
+ {
+ //delete old panels
+ delete m_EventPanels[i];
+ m_EventPanels[i] = NULL;
+ }
+ m_numEvents = SPGetNumberOfEvents( SPGetCurrentState() );
+ for ( i = 0; i < m_numEvents; i++ )
+ {
+ //create panels
+ AnsiString framename;
+ framename.sprintf("eventframe%i", i );
+ TFrame3* f = new TFrame3( this , i );
+ f->Parent = Panel6;
+ f->Name = framename;
+
+ //load the events list
+ AnsiString fname = Application->ExeName;
+ fname.SetLength( fname.Length() - 13 );
+ fname.cat_sprintf("data\\events.txt");
+ f->EventComboBox->Items->LoadFromFile(fname);
+
+ //set up events fields
+ EventData eventData;
+ if ( SPGetEventData( SPGetCurrentState() , i , &eventData ) )
+ {
+ AnsiString eventname;
+ eventname.sprintf( eventData.eventName );
+ int eventindex = f->EventComboBox->Items->IndexOf( eventname );
+ f->EventComboBox->ItemIndex = eventindex;
+ AnsiString toState;
+ toState.sprintf("%i", eventData.toState + 1);
+ f->ToFrameEditBox->Text = toState;
+ }
+
+ //add panel to panel list
+ m_EventPanels[i] = f;
+ }
+
+ for ( i = m_numEvents-1; i >= 0 ; i-- )
+ {
+ m_EventPanels[i]->Align = alTop;
+ }
+}
+//---------------------------------------------------------------------------
+
+void TMainForm::UpdateCallbacks()
+{
+ int i;
+ for ( i = 0; i < m_numCallbacks; i++ )
+ {
+ //delete old panels
+ delete m_CallbackPanels[i];
+ m_CallbackPanels[i] = NULL;
+ }
+ m_numCallbacks = SPGetNumberOfCallbacks( SPGetCurrentState() );
+ for ( i = 0; i < m_numCallbacks; i++ )
+ {
+ //create panels
+ AnsiString framename;
+ framename.sprintf("callbackframe%i", i );
+ TFrame4* f = new TFrame4( this , i );
+ f->Parent = CallbackPanel;
+ f->Name = framename;
+
+ //load the callbacks list
+ AnsiString fname = Application->ExeName;
+ fname.SetLength( fname.Length() - 13 );
+ fname.cat_sprintf("data\\callbacks.txt");
+ f->CallbackComboBox->Items->LoadFromFile(fname);
+
+ CallbackData cbData;
+ if ( SPGetCallbackData( SPGetCurrentState() , i , &cbData ) )
+ {
+ //set up events fields
+ AnsiString callbackname;
+ callbackname.sprintf( cbData.callbackName );
+ int cbindex = f->CallbackComboBox->Items->IndexOf( callbackname );
+ f->CallbackComboBox->ItemIndex = cbindex;
+ AnsiString onFrame;
+ onFrame.sprintf("%0.3f", cbData.onFrame );
+ f->OnFrameEditBox->Text = onFrame;
+ }
+ //add panel to panel list
+ m_CallbackPanels[i] = f;
+ }
+
+ for ( i = m_numCallbacks-1; i >= 0 ; i-- )
+ {
+ m_CallbackPanels[i]->Align = alTop;
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Button2Click(TObject *Sender)
+{
+ SPAddCallback( SPGetCurrentState() , "" , 0 , 0.f );
+ UpdateCallbacks();
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Save1Click(TObject *Sender)
+{
+ SaveData();
+}
+//---------------------------------------------------------------------------
+
+void TMainForm::SaveData()
+{
+ char buf[256];
+ memcpy( buf , FileName.c_str() , strlen(FileName.c_str()) - 4 );
+ buf[strlen(FileName.c_str()) - 4] = '\0';
+ strcat(buf , "data.p3d");
+
+ int attrib = get_file_attrib( buf );
+
+ if ( ( attrib & FA_RDONLY ) && ( attrib != -1 ) )
+ {
+ AnsiString out;
+ out.sprintf( "%s is read-only.\n" , FileName.c_str() );
+ if ( Application->MessageBox( out.c_str() , "" , MB_RETRYCANCEL ) == IDRETRY )
+ {
+ SaveData();
+ }
+ }
+ else
+ {
+ SPExportStatePropData( FileName.c_str() );
+ g_IsDataSaved = true;
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::FileSaveExecute(TObject *Sender)
+{
+ SaveData();
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::AutoTransitionCheckBoxClick(TObject *Sender)
+{
+ bool autotransition = AutoTransitionCheckBox->State == cbChecked ? true : false;
+ SPSetAutoTransition( SPGetCurrentState() , autotransition );
+ g_ForceDataUpdate = true;
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::ToStateEditBoxChange(TObject *Sender)
+{
+ AnsiString toState = ToStateEditBox->Text;
+ int state = 0;
+ try
+ {
+ state = toState.ToInt();
+ }
+ catch (Exception&)
+ {
+ TransitionData tranData;
+ SPGetTransitionData( SPGetCurrentState() , &tranData );
+ state = tranData.toState + 1;
+ }
+ if ( state > SPGetNumberOfStates() || state <= 0 )
+ {
+ state = 1;
+ }
+ SPSetAutoTransitionToState( SPGetCurrentState() , state - 1 );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::OnFrameEditBoxChange(TObject *Sender)
+{
+ AnsiString toframe = OnFrameEditBox->Text;
+ float frame = 0;
+ try
+ {
+ frame = toframe.ToDouble();
+ }
+ catch (Exception&)
+ {
+ TransitionData tranData;
+ SPGetTransitionData( SPGetCurrentState() , &tranData );
+ frame = tranData.onFrame;
+ }
+
+ SPSetAutoTransitionOnFrame( SPGetCurrentState() , frame );
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Button4Click(TObject *Sender)
+{
+ AnsiString caption;
+ caption.sprintf("Delete State");
+ AnsiString out;
+ out.sprintf( "Delete State: %i\n It won't come back!", SPGetCurrentState() + 1 );
+ if ( Application->MessageBox(out.c_str() , caption.c_str() , MB_YESNO) != IDOK )
+ {
+ SPDeleteState( SPGetCurrentState() );
+ if ( SPGetCurrentState() - 1 >= 0 )
+ {
+ SPSetState( SPGetCurrentState() - 1 );
+ }
+ g_ForceDataUpdate = true;
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Button3Click(TObject *Sender)
+{
+ SPInsertState( SPGetCurrentState() );
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+void __fastcall TMainForm::Button6Click(TObject *Sender)
+{
+ SPHideAll( SPGetCurrentState() );
+ g_ForceDataUpdate = true;
+ g_IsDataSaved = false;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::Button7Click(TObject *Sender)
+{
+ SPShowAll( SPGetCurrentState() );
+ g_ForceDataUpdate = true;
+ g_IsDataSaved = false;
+}
+
+//---------------------------------------------------------------------------
+void __fastcall TMainForm::B1Click(TObject *Sender)
+{
+ if ( ColorDialog1->Execute() )
+ {
+ TColor color = ColorDialog1->Color;
+ int blue = (int) ((color & 0x00ff0000) >> 16);
+ int green = (int) ((color & 0x0000ff00) >> 8);
+ int red = (int) ((color & 0x000000ff));
+ SPSetBackgroundColour( red , green , blue );
+ }
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::PDDICheckBoxClick(TObject *Sender)
+{
+ SPContextSetIsPDDIStatsEnabled( PDDICheckBox->Checked );
+}
+//---------------------------------------------------------------------------
+
+
+
+void __fastcall TMainForm::ToStateEditBoxExit(TObject *Sender)
+{
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::OnFrameEditBoxExit(TObject *Sender)
+{
+ g_ForceDataUpdate = true;
+}
+//---------------------------------------------------------------------------
+
+void __fastcall TMainForm::P3DBackgroundArt1Click(TObject *Sender)
+{
+ if (OpenDialog1->Execute())
+ {
+ SPLoadBackground( OpenDialog1->FileName.c_str() );
+ }
+}
+//---------------------------------------------------------------------------
+
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.dfm b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.dfm
new file mode 100644
index 0000000..0b6eee2
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.dfm
@@ -0,0 +1,783 @@
+object MainForm: TMainForm
+ Left = 197
+ Top = 118
+ Width = 1262
+ Height = 869
+ Caption = 'State Animation Builder'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Menu = MainMenu1
+ OldCreateOrder = False
+ OnClose = FormClose
+ OnKeyPress = FormKeyPress
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Splitter2: TSplitter
+ Left = 0
+ Top = 628
+ Width = 1254
+ Height = 3
+ Cursor = crVSplit
+ Align = alBottom
+ end
+ object Splitter1: TSplitter
+ Left = 230
+ Top = 0
+ Width = 3
+ Height = 628
+ Cursor = crHSplit
+ end
+ object Panel2: TPanel
+ Left = 0
+ Top = 631
+ Width = 1254
+ Height = 192
+ Align = alBottom
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Panel3: TPanel
+ Left = 0
+ Top = 0
+ Width = 1254
+ Height = 33
+ Align = alTop
+ BevelInner = bvLowered
+ TabOrder = 0
+ object Label1: TLabel
+ Left = 2
+ Top = 2
+ Width = 31
+ Height = 29
+ Align = alLeft
+ Caption = ' Prop: '
+ end
+ object PropNameLabel: TLabel
+ Left = 33
+ Top = 2
+ Width = 24
+ Height = 29
+ Align = alLeft
+ Caption = 'none'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -12
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label2: TLabel
+ Left = 124
+ Top = 2
+ Width = 26
+ Height = 29
+ Align = alLeft
+ Caption = ' Of: '
+ end
+ object NumPropStatesLabel: TLabel
+ Left = 150
+ Top = 2
+ Width = 6
+ Height = 29
+ Align = alLeft
+ Caption = '0'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -12
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label3: TLabel
+ Left = 57
+ Top = 2
+ Width = 61
+ Height = 29
+ Align = alLeft
+ Caption = ' State: '
+ end
+ object CurrentStateLabel: TLabel
+ Left = 118
+ Top = 2
+ Width = 6
+ Height = 29
+ Align = alLeft
+ Caption = '0'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -12
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label4: TLabel
+ Left = 720
+ Top = 7
+ Width = 29
+ Height = 13
+ Caption = 'Frame'
+ end
+ object PlayButton: TButton
+ Left = 560
+ Top = 5
+ Width = 30
+ Height = 20
+ Hint = 'Play / Pause'
+ Caption = '| |'
+ ParentShowHint = False
+ ShowHint = True
+ TabOrder = 0
+ OnClick = PlayButtonClick
+ end
+ object ForwardStepButton: TButton
+ Left = 592
+ Top = 5
+ Width = 30
+ Height = 20
+ Hint = 'Step Forward One Frame'
+ Caption = '> |'
+ ParentShowHint = False
+ ShowHint = True
+ TabOrder = 1
+ OnClick = ForwardStepButtonClick
+ end
+ object BackStepButton: TButton
+ Left = 528
+ Top = 5
+ Width = 30
+ Height = 20
+ Hint = 'Step Back One Frame'
+ Caption = '| <'
+ ParentShowHint = False
+ ShowHint = True
+ TabOrder = 2
+ OnClick = BackStepButtonClick
+ end
+ object CurrentFrameWindow: TEdit
+ Left = 760
+ Top = 4
+ Width = 60
+ Height = 21
+ Hint = 'Current Frame, seconds'
+ ParentShowHint = False
+ ShowHint = True
+ TabOrder = 3
+ end
+ object PrevStatebutton: TButton
+ Left = 495
+ Top = 5
+ Width = 30
+ Height = 20
+ Hint = 'Previous State'
+ Caption = '| <<'
+ ParentShowHint = False
+ ShowHint = True
+ TabOrder = 4
+ OnClick = PrevStatebuttonClick
+ end
+ object NextStateButton: TButton
+ Left = 624
+ Top = 5
+ Width = 30
+ Height = 20
+ Hint = 'Next State'
+ Caption = '>> |'
+ ParentShowHint = False
+ ShowHint = True
+ TabOrder = 5
+ OnClick = NextStateButtonClick
+ end
+ end
+ object Panel4: TScrollBox
+ Left = 0
+ Top = 33
+ Width = 1254
+ Height = 159
+ Align = alClient
+ BorderStyle = bsNone
+ TabOrder = 1
+ end
+ end
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 230
+ Height = 628
+ Align = alLeft
+ BevelOuter = bvNone
+ TabOrder = 1
+ object PageControl1: TPageControl
+ Left = 0
+ Top = 0
+ Width = 230
+ Height = 628
+ ActivePage = TabSheet1
+ Align = alClient
+ MultiLine = True
+ TabOrder = 0
+ object TabSheet1: TTabSheet
+ Caption = 'Drawables'
+ object Panel12: TPanel
+ Left = 0
+ Top = 0
+ Width = 222
+ Height = 41
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Button6: TButton
+ Left = 8
+ Top = 8
+ Width = 75
+ Height = 25
+ Caption = 'Hide All'
+ TabOrder = 0
+ OnClick = Button6Click
+ end
+ object Button7: TButton
+ Left = 96
+ Top = 8
+ Width = 75
+ Height = 25
+ Caption = 'Show All'
+ TabOrder = 1
+ OnClick = Button7Click
+ end
+ end
+ object Panel5: TScrollBox
+ Left = 0
+ Top = 41
+ Width = 222
+ Height = 559
+ Align = alClient
+ BorderStyle = bsNone
+ TabOrder = 1
+ end
+ end
+ object TabSheet2: TTabSheet
+ Caption = 'Events'
+ ImageIndex = 1
+ object EventsPanel: TPanel
+ Left = 0
+ Top = 0
+ Width = 222
+ Height = 41
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Button1: TButton
+ Left = 8
+ Top = 8
+ Width = 75
+ Height = 25
+ Caption = 'Add Event'
+ TabOrder = 0
+ OnClick = Button1Click
+ end
+ end
+ object Panel6: TScrollBox
+ Left = 0
+ Top = 41
+ Width = 222
+ Height = 559
+ Align = alClient
+ BorderStyle = bsNone
+ TabOrder = 1
+ end
+ end
+ object TabSheet3: TTabSheet
+ Caption = 'Callbacks'
+ ImageIndex = 2
+ object Panel7: TPanel
+ Left = 0
+ Top = 0
+ Width = 222
+ Height = 600
+ Align = alClient
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Panel8: TPanel
+ Left = 0
+ Top = 0
+ Width = 222
+ Height = 41
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Button2: TButton
+ Left = 8
+ Top = 8
+ Width = 75
+ Height = 25
+ Caption = 'Add Callback'
+ TabOrder = 0
+ OnClick = Button2Click
+ end
+ end
+ object CallbackPanel: TScrollBox
+ Left = 0
+ Top = 41
+ Width = 222
+ Height = 559
+ Align = alClient
+ BorderStyle = bsNone
+ TabOrder = 1
+ end
+ end
+ end
+ object TabSheet4: TTabSheet
+ Caption = 'State'
+ ImageIndex = 3
+ object Panel11: TPanel
+ Left = 0
+ Top = 0
+ Width = 222
+ Height = 265
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Label10: TLabel
+ Left = 7
+ Top = 10
+ Width = 34
+ Height = 16
+ Caption = 'State:'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -15
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object StateStateLabel: TLabel
+ Left = 42
+ Top = 10
+ Width = 7
+ Height = 16
+ Caption = '0'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -15
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label6: TLabel
+ Left = 8
+ Top = 130
+ Width = 44
+ Height = 13
+ Caption = 'To State:'
+ end
+ object Label8: TLabel
+ Left = 8
+ Top = 154
+ Width = 49
+ Height = 13
+ Caption = 'On Frame:'
+ end
+ object AutoTransitionCheckBox: TCheckBox
+ Left = 8
+ Top = 105
+ Width = 97
+ Height = 17
+ Caption = 'Auto Transition'
+ TabOrder = 0
+ OnClick = AutoTransitionCheckBoxClick
+ end
+ object ToStateEditBox: TEdit
+ Left = 64
+ Top = 126
+ Width = 41
+ Height = 21
+ TabOrder = 1
+ OnChange = ToStateEditBoxChange
+ OnExit = ToStateEditBoxExit
+ end
+ object OnFrameEditBox: TEdit
+ Left = 64
+ Top = 150
+ Width = 41
+ Height = 21
+ TabOrder = 2
+ OnChange = OnFrameEditBoxChange
+ OnExit = OnFrameEditBoxExit
+ end
+ object Button4: TButton
+ Left = 8
+ Top = 64
+ Width = 75
+ Height = 25
+ Caption = 'Delete State'
+ TabOrder = 3
+ OnClick = Button4Click
+ end
+ object Button3: TButton
+ Left = 8
+ Top = 32
+ Width = 75
+ Height = 25
+ Caption = 'Add State'
+ TabOrder = 4
+ OnClick = Button3Click
+ end
+ object PDDICheckBox: TCheckBox
+ Left = 8
+ Top = 184
+ Width = 97
+ Height = 17
+ Caption = 'PDDI Stats'
+ TabOrder = 5
+ OnClick = PDDICheckBoxClick
+ end
+ end
+ end
+ end
+ end
+ object Panel9: TPanel
+ Left = 233
+ Top = 0
+ Width = 1021
+ Height = 628
+ Align = alClient
+ BevelOuter = bvNone
+ Caption = 'Panel9'
+ TabOrder = 2
+ object P3DClientPanel: TPanel
+ Left = 0
+ Top = 33
+ Width = 1021
+ Height = 595
+ Align = alClient
+ BevelInner = bvLowered
+ Caption = 'P3DClientPanel'
+ Color = clCaptionText
+ TabOrder = 0
+ OnResize = P3DClientPanelResize
+ object P3DPanel: TPanel
+ Left = 2
+ Top = 2
+ Width = 1065
+ Height = 793
+ BevelOuter = bvNone
+ Color = clActiveCaption
+ TabOrder = 0
+ OnMouseDown = P3DPanelMouseDown
+ OnMouseMove = P3DPanelMouseMove
+ OnMouseUp = P3DPanelMouseUp
+ end
+ end
+ object Panel10: TPanel
+ Left = 0
+ Top = 0
+ Width = 1021
+ Height = 33
+ Align = alTop
+ BevelInner = bvLowered
+ TabOrder = 1
+ object Label5: TLabel
+ Left = 10
+ Top = 7
+ Width = 41
+ Height = 20
+ Caption = 'Prop: '
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -16
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object PropNameLabelTop: TLabel
+ Left = 56
+ Top = 7
+ Width = 36
+ Height = 20
+ Caption = 'none'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -16
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object NumPropStatesLabelTop: TLabel
+ Left = 309
+ Top = 7
+ Width = 9
+ Height = 20
+ Caption = '0'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -16
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label9: TLabel
+ Left = 210
+ Top = 7
+ Width = 43
+ Height = 20
+ Caption = 'State:'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -16
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object CurrentStateLabelTop: TLabel
+ Left = 256
+ Top = 7
+ Width = 9
+ Height = 20
+ Caption = '0'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -16
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ object Label7: TLabel
+ Left = 286
+ Top = 7
+ Width = 21
+ Height = 20
+ Caption = 'Of:'
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -16
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentFont = False
+ end
+ end
+ end
+ object ApplicationEvents1: TApplicationEvents
+ OnIdle = ApplicationEvents1Idle
+ Left = 1040
+ Top = 72
+ end
+ object MainMenu1: TMainMenu
+ Images = ImageList1
+ Left = 1072
+ Top = 72
+ object N1: TMenuItem
+ Caption = '&File'
+ object Open1: TMenuItem
+ Action = FileOpen
+ end
+ object Save1: TMenuItem
+ Action = FileSave
+ end
+ object Exit1: TMenuItem
+ Action = FileExit
+ end
+ end
+ object Edit1: TMenuItem
+ Caption = '&Edit'
+ object B1: TMenuItem
+ Caption = '&Background Color'
+ OnClick = B1Click
+ end
+ object P3DBackgroundArt1: TMenuItem
+ Caption = '&P3D Background Art'
+ OnClick = P3DBackgroundArt1Click
+ end
+ end
+ object Help1: TMenuItem
+ Caption = '&Help'
+ object About1: TMenuItem
+ Action = HelpAbout
+ end
+ end
+ end
+ object ActionList1: TActionList
+ Left = 1136
+ Top = 72
+ object FileOpen: TAction
+ Category = 'File'
+ Caption = '&Open'
+ Hint = 'Open File'
+ ImageIndex = 0
+ OnExecute = FileOpenExecute
+ end
+ object FileSave: TAction
+ Category = 'File'
+ Caption = '&Save'
+ Hint = 'Save File'
+ ImageIndex = 1
+ OnExecute = FileSaveExecute
+ end
+ object FileExit: TAction
+ Category = 'File'
+ Caption = '&Exit'
+ Hint = 'Exit Application'
+ end
+ object HelpAbout: TAction
+ Category = 'Help'
+ Caption = '&About'
+ end
+ end
+ object ImageList1: TImageList
+ Left = 1104
+ Top = 72
+ Bitmap = {
+ 494C010102000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
+ 0000000000003600000028000000400000001000000001002000000000000010
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000008484000084
+ 8400000000000000000000000000000000000000000000000000C6C6C600C6C6
+ C600000000000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000008484000084
+ 8400008484000084840000848400008484000084840000848400008484000000
+ 0000000000000000000000000000000000000000000000000000008484000084
+ 8400000000000000000000000000000000000000000000000000C6C6C600C6C6
+ C600000000000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000FFFF00000000000084
+ 8400008484000084840000848400008484000084840000848400008484000084
+ 8400000000000000000000000000000000000000000000000000008484000084
+ 8400000000000000000000000000000000000000000000000000C6C6C600C6C6
+ C600000000000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 00000000000000000000000000000000000000000000FFFFFF0000FFFF000000
+ 0000008484000084840000848400008484000084840000848400008484000084
+ 8400008484000000000000000000000000000000000000000000008484000084
+ 8400000000000000000000000000000000000000000000000000000000000000
+ 0000000000000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF
+ FF00000000000084840000848400008484000084840000848400008484000084
+ 8400008484000084840000000000000000000000000000000000008484000084
+ 8400008484000084840000848400008484000084840000848400008484000084
+ 8400008484000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF
+ FF0000FFFF000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000008484000084
+ 8400000000000000000000000000000000000000000000000000000000000000
+ 0000008484000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF
+ FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000
+ 0000000000000000000000000000000000000000000000000000008484000000
+ 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C600000000000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 00000000000000000000000000000000000000000000FFFFFF0000FFFF00FFFF
+ FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000
+ 0000000000000000000000000000000000000000000000000000008484000000
+ 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C600000000000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000FFFF00FFFFFF0000FF
+ FF00000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000008484000000
+ 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C600000000000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000008484000000
+ 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C600000000000084840000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000008484000000
+ 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C600000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000008484000000
+ 0000C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6C600C6C6
+ C60000000000C6C6C60000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000424D3E000000000000003E000000
+ 2800000040000000100000000100010000000000800000000000000000000000
+ 000000000000000000000000FFFFFF00FFFFFFFF00000000FFFFC00100000000
+ 001F800100000000000F80010000000000078001000000000003800100000000
+ 00018001000000000000800100000000001F800100000000001F800100000000
+ 001F8001000000008FF1800100000000FFF9800100000000FF75800100000000
+ FF8F800100000000FFFFFFFF0000000000000000000000000000000000000000
+ 000000000000}
+ end
+ object OpenDialog1: TOpenDialog
+ DefaultExt = 'p3d'
+ Filter = 'P3D|*.p3d|All files|*.*'
+ Title = 'Open File'
+ Left = 1042
+ Top = 112
+ end
+ object ColorDialog1: TColorDialog
+ Ctl3D = True
+ Left = 1075
+ Top = 115
+ end
+end
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.h b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.h
new file mode 100644
index 0000000..23fc13d
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/main.h
@@ -0,0 +1,163 @@
+//---------------------------------------------------------------------------
+
+#ifndef mainH
+#define mainH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <AppEvnts.hpp>
+#include <ExtCtrls.hpp>
+#include <ComCtrls.hpp>
+#include <Menus.hpp>
+#include <ActnList.hpp>
+#include <ImgList.hpp>
+#include <Dialogs.hpp>
+#include <CheckLst.hpp>
+#include "fcframe.h"
+#include "visframe.h"
+#include "eventsframe.h"
+#include "callbacksframe.h"
+
+//---------------------------------------------------------------------------
+class TMainForm : public TForm
+{
+__published: // IDE-managed Components
+ TApplicationEvents *ApplicationEvents1;
+ TSplitter *Splitter2;
+ TPanel *Panel2;
+ TPanel *Panel1;
+ TSplitter *Splitter1;
+ TMainMenu *MainMenu1;
+ TMenuItem *N1;
+ TMenuItem *Open1;
+ TMenuItem *Save1;
+ TActionList *ActionList1;
+ TImageList *ImageList1;
+ TAction *FileOpen;
+ TAction *FileSave;
+ TAction *FileExit;
+ TAction *HelpAbout;
+ TMenuItem *Exit1;
+ TMenuItem *Edit1;
+ TMenuItem *Help1;
+ TMenuItem *About1;
+ TOpenDialog *OpenDialog1;
+ TPanel *Panel3;
+ TLabel *Label1;
+ TLabel *PropNameLabel;
+ TLabel *Label2;
+ TLabel *NumPropStatesLabel;
+ TLabel *Label3;
+ TLabel *CurrentStateLabel;
+ TButton *PlayButton;
+ TButton *ForwardStepButton;
+ TButton *BackStepButton;
+ TEdit *CurrentFrameWindow;
+ TButton *PrevStatebutton;
+ TButton *NextStateButton;
+ TLabel *Label4;
+ TPageControl *PageControl1;
+ TTabSheet *TabSheet1;
+ TTabSheet *TabSheet2;
+ TTabSheet *TabSheet3;
+ TPanel *EventsPanel;
+ TButton *Button1;
+ TPanel *Panel7;
+ TPanel *Panel8;
+ TButton *Button2;
+ TPanel *Panel9;
+ TPanel *P3DClientPanel;
+ TPanel *P3DPanel;
+ TPanel *Panel10;
+ TLabel *Label5;
+ TLabel *PropNameLabelTop;
+ TLabel *NumPropStatesLabelTop;
+ TLabel *Label9;
+ TLabel *CurrentStateLabelTop;
+ TTabSheet *TabSheet4;
+ TPanel *Panel11;
+ TLabel *Label10;
+ TLabel *StateStateLabel;
+ TCheckBox *AutoTransitionCheckBox;
+ TLabel *Label6;
+ TEdit *ToStateEditBox;
+ TLabel *Label8;
+ TEdit *OnFrameEditBox;
+ TButton *Button4;
+ TButton *Button3;
+ TLabel *Label7;
+ TPanel *Panel12;
+ TButton *Button6;
+ TButton *Button7;
+ TScrollBox *Panel5;
+ TScrollBox *Panel6;
+ TScrollBox *CallbackPanel;
+ TScrollBox *Panel4;
+ TMenuItem *B1;
+ TColorDialog *ColorDialog1;
+ TCheckBox *PDDICheckBox;
+ TMenuItem *P3DBackgroundArt1;
+ void __fastcall ApplicationEvents1Idle(TObject *Sender,
+ bool &Done);
+ void __fastcall FormShow(TObject *Sender);
+ void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
+ void __fastcall P3DClientPanelResize(TObject *Sender);
+ void __fastcall FileOpenExecute(TObject *Sender);
+ void __fastcall P3DPanelMouseDown(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall P3DPanelMouseMove(TObject *Sender,
+ TShiftState Shift, int X, int Y);
+ void __fastcall P3DPanelMouseUp(TObject *Sender,
+ TMouseButton Button, TShiftState Shift, int X, int Y);
+ void __fastcall FormKeyPress(TObject *Sender, char &Key);
+ void __fastcall PlayButtonClick(TObject *Sender);
+ void __fastcall PrevStatebuttonClick(TObject *Sender);
+ void __fastcall NextStateButtonClick(TObject *Sender);
+ void __fastcall ForwardStepButtonClick(TObject *Sender);
+ void __fastcall BackStepButtonClick(TObject *Sender);
+ void __fastcall Button1Click(TObject *Sender);
+ void __fastcall Button2Click(TObject *Sender);
+ void __fastcall Save1Click(TObject *Sender);
+ void __fastcall FileSaveExecute(TObject *Sender);
+ void __fastcall AutoTransitionCheckBoxClick(TObject *Sender);
+ void __fastcall ToStateEditBoxChange(TObject *Sender);
+ void __fastcall OnFrameEditBoxChange(TObject *Sender);
+ void __fastcall Button4Click(TObject *Sender);
+ void __fastcall Button3Click(TObject *Sender);
+ void __fastcall Button6Click(TObject *Sender);
+ void __fastcall Button7Click(TObject *Sender);
+ void __fastcall B1Click(TObject *Sender);
+ void __fastcall PDDICheckBoxClick(TObject *Sender);
+ void __fastcall ToStateEditBoxExit(TObject *Sender);
+ void __fastcall OnFrameEditBoxExit(TObject *Sender);
+ void __fastcall P3DBackgroundArt1Click(TObject *Sender);
+private: // User declarations
+ int m_CurrentPropState;
+ int m_numFCPanels;
+ TFrame1* m_FCPanels[250];
+ int m_numDrawablePanels;
+ TFrame2* m_DrawablePanels[250];
+ int m_numEvents;
+ TFrame3* m_EventPanels[250];
+ int m_numCallbacks;
+ TFrame4* m_CallbackPanels[250];
+ int m_numForces;
+
+ void UpdateStateInfo();
+ void UpdateFrameControllers();
+ void UpdateDrawables();
+ void UpdateEvents();
+ void UpdateCallbacks();
+ void SaveData();
+
+public: // User declarations
+ __fastcall TMainForm(TComponent* Owner);
+
+ AnsiString FileName;
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TMainForm *MainForm;
+//---------------------------------------------------------------------------
+#endif
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.cpp b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.cpp
new file mode 100644
index 0000000..66f224e
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.cpp
@@ -0,0 +1,24 @@
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#include <sp/interface.hpp>
+#pragma hdrstop
+
+#include "visframe.h"
+//---------------------------------------------------------------------------
+#pragma package(smart_init)
+#pragma resource "*.dfm"
+TFrame2 *Frame2;
+//---------------------------------------------------------------------------
+__fastcall TFrame2::TFrame2(TComponent* Owner , int dindex )
+ : TFrame(Owner),
+ m_DrawableIndex( dindex )
+{
+}
+//---------------------------------------------------------------------------
+void __fastcall TFrame2::VisibilityCheckBoxClick(TObject *Sender)
+{
+ SPSetVisible( SPGetCurrentState() , m_DrawableIndex , this->VisibilityCheckBox->State != cbUnchecked );
+}
+//---------------------------------------------------------------------------
+
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.dfm b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.dfm
new file mode 100644
index 0000000..c9010d2
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.dfm
@@ -0,0 +1,42 @@
+object Frame2: TFrame2
+ Left = 0
+ Top = 0
+ Width = 152
+ Height = 43
+ TabOrder = 0
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 152
+ Height = 43
+ Align = alClient
+ BevelInner = bvLowered
+ TabOrder = 0
+ object NameLabel: TLabel
+ Left = 8
+ Top = 5
+ Width = 26
+ Height = 13
+ Caption = 'name'
+ Color = clSilver
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clNavy
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ ParentColor = False
+ ParentFont = False
+ end
+ object VisibilityCheckBox: TCheckBox
+ Left = 8
+ Top = 21
+ Width = 97
+ Height = 17
+ Caption = 'Visible'
+ ParentShowHint = False
+ ShowHint = False
+ TabOrder = 0
+ OnClick = VisibilityCheckBoxClick
+ end
+ end
+end
diff --git a/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.h b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.h
new file mode 100644
index 0000000..aacf3da
--- /dev/null
+++ b/tools/statepropbuilder/apps/spbuilder/code/sp/builder/visframe.h
@@ -0,0 +1,28 @@
+//---------------------------------------------------------------------------
+
+
+#ifndef visframeH
+#define visframeH
+//---------------------------------------------------------------------------
+#include <Classes.hpp>
+#include <Controls.hpp>
+#include <StdCtrls.hpp>
+#include <Forms.hpp>
+#include <ExtCtrls.hpp>
+//---------------------------------------------------------------------------
+class TFrame2 : public TFrame
+{
+__published: // IDE-managed Components
+ TPanel *Panel1;
+ TCheckBox *VisibilityCheckBox;
+ TLabel *NameLabel;
+ void __fastcall VisibilityCheckBoxClick(TObject *Sender);
+private: // User declarations
+ int m_DrawableIndex;
+public: // User declarations
+ __fastcall TFrame2(TComponent* Owner , int dindex );
+};
+//---------------------------------------------------------------------------
+extern PACKAGE TFrame2 *Frame2;
+//---------------------------------------------------------------------------
+#endif